dawn-ui-react 1.0.0-alpha
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/Input-Br91lfPH.js +76 -0
- package/dist/clamp-C6OCmUfq.js +3033 -0
- package/dist/cn-CXogf8HW.js +1692 -0
- package/dist/components/accordion/accordion-header.d.ts +2 -0
- package/dist/components/accordion/accordion-item.d.ts +2 -0
- package/dist/components/accordion/accordion-panel.d.ts +2 -0
- package/dist/components/accordion/accordion-subtitle.d.ts +2 -0
- package/dist/components/accordion/accordion-title.d.ts +2 -0
- package/dist/components/accordion/accordion-trigger.d.ts +2 -0
- package/dist/components/accordion/accordion.d.ts +2 -0
- package/dist/components/accordion/accordion.types.d.ts +18 -0
- package/dist/components/accordion/index.d.ts +7 -0
- package/dist/components/alert/alert-actions.d.ts +2 -0
- package/dist/components/alert/alert-content.d.ts +2 -0
- package/dist/components/alert/alert-description.d.ts +2 -0
- package/dist/components/alert/alert-title.d.ts +2 -0
- package/dist/components/alert/alert.d.ts +2 -0
- package/dist/components/alert/alert.types.d.ts +9 -0
- package/dist/components/alert/index.d.ts +6 -0
- package/dist/components/alert-dialog/alert-dialog-close.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-confirm.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-content.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-context.d.ts +10 -0
- package/dist/components/alert-dialog/alert-dialog-description.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-footer.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-header.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-popup.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-title.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog-trigger.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +2 -0
- package/dist/components/alert-dialog/alert-dialog.types.d.ts +15 -0
- package/dist/components/alert-dialog/index.d.ts +11 -0
- package/dist/components/autocomplete/autocomplete-collection.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-content.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-grid-content.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-grid-item.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-group-label.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-group.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-input-group-addon.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-input-group-input.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-input-group.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-item.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-row.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-status.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete-trigger.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete.d.ts +2 -0
- package/dist/components/autocomplete/autocomplete.types.d.ts +23 -0
- package/dist/components/autocomplete/index.d.ts +15 -0
- package/dist/components/avatar/avatar-badge.d.ts +2 -0
- package/dist/components/avatar/avatar-fallback.d.ts +2 -0
- package/dist/components/avatar/avatar-image.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +2 -0
- package/dist/components/avatar/avatar.types.d.ts +14 -0
- package/dist/components/avatar/index.d.ts +5 -0
- package/dist/components/badge/badge.d.ts +2 -0
- package/dist/components/badge/badge.types.d.ts +7 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb-ellipsis.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb-link.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb-separator.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb.types.d.ts +5 -0
- package/dist/components/breadcrumb/index.d.ts +6 -0
- package/dist/components/button/button.d.ts +2 -0
- package/dist/components/button/button.types.d.ts +8 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button-group/button-group.d.ts +2 -0
- package/dist/components/button-group/button-group.types.d.ts +8 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox-indicator.d.ts +2 -0
- package/dist/components/checkbox/checkbox.d.ts +2 -0
- package/dist/components/checkbox/checkbox.types.d.ts +10 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +2 -0
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +2 -0
- package/dist/components/checkbox-group/index.d.ts +2 -0
- package/dist/components/collapsible/collapsible-panel.d.ts +2 -0
- package/dist/components/collapsible/collapsible-trigger.d.ts +2 -0
- package/dist/components/collapsible/collapsible.d.ts +2 -0
- package/dist/components/collapsible/collapsible.types.d.ts +5 -0
- package/dist/components/collapsible/index.d.ts +4 -0
- package/dist/components/combobox/combobox-chip.d.ts +2 -0
- package/dist/components/combobox/combobox-chips.d.ts +2 -0
- package/dist/components/combobox/combobox-collection.d.ts +2 -0
- package/dist/components/combobox/combobox-empty.d.ts +2 -0
- package/dist/components/combobox/combobox-group-label.d.ts +2 -0
- package/dist/components/combobox/combobox-group.d.ts +2 -0
- package/dist/components/combobox/combobox-input.d.ts +2 -0
- package/dist/components/combobox/combobox-item.d.ts +2 -0
- package/dist/components/combobox/combobox-list.d.ts +2 -0
- package/dist/components/combobox/combobox-popup.d.ts +2 -0
- package/dist/components/combobox/combobox-status.d.ts +2 -0
- package/dist/components/combobox/combobox-trigger.d.ts +2 -0
- package/dist/components/combobox/combobox-value.d.ts +2 -0
- package/dist/components/combobox/combobox.d.ts +2 -0
- package/dist/components/combobox/combobox.types.d.ts +22 -0
- package/dist/components/combobox/index.d.ts +15 -0
- package/dist/components/context-menu/context-menu-checkbox-item.d.ts +2 -0
- package/dist/components/context-menu/context-menu-group-label.d.ts +2 -0
- package/dist/components/context-menu/context-menu-group.d.ts +2 -0
- package/dist/components/context-menu/context-menu-item.d.ts +2 -0
- package/dist/components/context-menu/context-menu-popup.d.ts +2 -0
- package/dist/components/context-menu/context-menu-radio-group.d.ts +2 -0
- package/dist/components/context-menu/context-menu-radio-item.d.ts +2 -0
- package/dist/components/context-menu/context-menu-separator.d.ts +2 -0
- package/dist/components/context-menu/context-menu-shortcut.d.ts +2 -0
- package/dist/components/context-menu/context-menu-submenu-trigger.d.ts +2 -0
- package/dist/components/context-menu/context-menu-submenu.d.ts +2 -0
- package/dist/components/context-menu/context-menu-trigger.d.ts +2 -0
- package/dist/components/context-menu/context-menu.d.ts +2 -0
- package/dist/components/context-menu/context-menu.types.d.ts +21 -0
- package/dist/components/context-menu/index.d.ts +14 -0
- package/dist/components/dialog/dialog-close.d.ts +2 -0
- package/dist/components/dialog/dialog-content.d.ts +2 -0
- package/dist/components/dialog/dialog-description.d.ts +2 -0
- package/dist/components/dialog/dialog-footer.d.ts +2 -0
- package/dist/components/dialog/dialog-header.d.ts +2 -0
- package/dist/components/dialog/dialog-popup.d.ts +2 -0
- package/dist/components/dialog/dialog-title.d.ts +2 -0
- package/dist/components/dialog/dialog-trigger.d.ts +2 -0
- package/dist/components/dialog/dialog.d.ts +2 -0
- package/dist/components/dialog/dialog.types.d.ts +11 -0
- package/dist/components/dialog/index.d.ts +10 -0
- package/dist/components/field/field-checkbox.d.ts +2 -0
- package/dist/components/field/field-description.d.ts +2 -0
- package/dist/components/field/field-errors.d.ts +2 -0
- package/dist/components/field/field-input-group-input.d.ts +2 -0
- package/dist/components/field/field-input-group.d.ts +2 -0
- package/dist/components/field/field-input.d.ts +2 -0
- package/dist/components/field/field-label.d.ts +2 -0
- package/dist/components/field/field-radio-group.d.ts +2 -0
- package/dist/components/field/field-select.d.ts +2 -0
- package/dist/components/field/field-slider.d.ts +2 -0
- package/dist/components/field/field-switch.d.ts +2 -0
- package/dist/components/field/field-text-area.d.ts +2 -0
- package/dist/components/field/field-toggle.d.ts +2 -0
- package/dist/components/field/field.d.ts +2 -0
- package/dist/components/field/field.types.d.ts +23 -0
- package/dist/components/field/index.d.ts +13 -0
- package/dist/components/form/form-context.d.ts +98 -0
- package/dist/components/form/form-errors.d.ts +2 -0
- package/dist/components/form/form-reset.d.ts +2 -0
- package/dist/components/form/form-submit.d.ts +2 -0
- package/dist/components/form/form.d.ts +3 -0
- package/dist/components/form/form.types.d.ts +7 -0
- package/dist/components/form/index.d.ts +6 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input.d.ts +2 -0
- package/dist/components/input/input.types.d.ts +8 -0
- package/dist/components/input-group/index.d.ts +4 -0
- package/dist/components/input-group/input-group-addon.d.ts +2 -0
- package/dist/components/input-group/input-group-input.d.ts +2 -0
- package/dist/components/input-group/input-group.d.ts +2 -0
- package/dist/components/input-group/input-group.types.d.ts +6 -0
- package/dist/components/input-otp/index.d.ts +3 -0
- package/dist/components/input-otp/input-otp-slot.d.ts +2 -0
- package/dist/components/input-otp/input-otp.d.ts +2 -0
- package/dist/components/input-otp/input-otp.types.d.ts +3 -0
- package/dist/components/kbd/index.d.ts +2 -0
- package/dist/components/kbd/kbd-group.d.ts +2 -0
- package/dist/components/kbd/kbd.d.ts +2 -0
- package/dist/components/kbd/kbd.types.d.ts +2 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/label.d.ts +2 -0
- package/dist/components/label/label.types.d.ts +5 -0
- package/dist/components/layer-tree/index.d.ts +8 -0
- package/dist/components/layer-tree/layer-tree-body.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree-expand-all.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree-node-toggle.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree-node.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree-row.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree-search.d.ts +2 -0
- package/dist/components/layer-tree/layer-tree.d.ts +5 -0
- package/dist/components/layer-tree/layer-tree.types.d.ts +24 -0
- package/dist/components/menu/index.d.ts +14 -0
- package/dist/components/menu/menu-checkbox-item.d.ts +2 -0
- package/dist/components/menu/menu-group-label.d.ts +2 -0
- package/dist/components/menu/menu-group.d.ts +2 -0
- package/dist/components/menu/menu-item.d.ts +2 -0
- package/dist/components/menu/menu-popup.d.ts +2 -0
- package/dist/components/menu/menu-radio-group.d.ts +2 -0
- package/dist/components/menu/menu-radio-item.d.ts +2 -0
- package/dist/components/menu/menu-separator.d.ts +2 -0
- package/dist/components/menu/menu-shortcut.d.ts +2 -0
- package/dist/components/menu/menu-submenu-trigger.d.ts +2 -0
- package/dist/components/menu/menu-submenu.d.ts +2 -0
- package/dist/components/menu/menu-trigger.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +2 -0
- package/dist/components/menu/menu.types.d.ts +21 -0
- package/dist/components/meter/index.d.ts +9 -0
- package/dist/components/meter/meter-footer.d.ts +2 -0
- package/dist/components/meter/meter-header.d.ts +2 -0
- package/dist/components/meter/meter-indicator.d.ts +2 -0
- package/dist/components/meter/meter-label.d.ts +2 -0
- package/dist/components/meter/meter-subtitle.d.ts +2 -0
- package/dist/components/meter/meter-track.d.ts +2 -0
- package/dist/components/meter/meter-value.d.ts +2 -0
- package/dist/components/meter/meter.d.ts +2 -0
- package/dist/components/meter/meter.types.d.ts +15 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/number-field.d.ts +2 -0
- package/dist/components/number-field/number-field.types.d.ts +8 -0
- package/dist/components/popover/index.d.ts +9 -0
- package/dist/components/popover/popover-content.d.ts +2 -0
- package/dist/components/popover/popover-description.d.ts +2 -0
- package/dist/components/popover/popover-header.d.ts +2 -0
- package/dist/components/popover/popover-panel.d.ts +2 -0
- package/dist/components/popover/popover-title.d.ts +2 -0
- package/dist/components/popover/popover-trigger.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +2 -0
- package/dist/components/popover/popover.types.d.ts +9 -0
- package/dist/components/profile/index.d.ts +2 -0
- package/dist/components/profile/profile.d.ts +2 -0
- package/dist/components/profile/profile.types.d.ts +16 -0
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/progress/progress-bar.d.ts +2 -0
- package/dist/components/progress/progress-indicator.d.ts +2 -0
- package/dist/components/progress/progress.d.ts +2 -0
- package/dist/components/progress/progress.types.d.ts +8 -0
- package/dist/components/radar-ping/index.d.ts +2 -0
- package/dist/components/radar-ping/radar-ping.d.ts +2 -0
- package/dist/components/radar-ping/radar-ping.types.d.ts +8 -0
- package/dist/components/radio-group/index.d.ts +3 -0
- package/dist/components/radio-group/radio-group.d.ts +2 -0
- package/dist/components/radio-group/radio-group.types.d.ts +7 -0
- package/dist/components/radio-group/radio.d.ts +2 -0
- package/dist/components/resizeable/index.d.ts +4 -0
- package/dist/components/resizeable/resizeable-handle.d.ts +2 -0
- package/dist/components/resizeable/resizeable-panel-group.d.ts +2 -0
- package/dist/components/resizeable/resizeable-panel.d.ts +2 -0
- package/dist/components/resizeable/resizeable.types.d.ts +6 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/scroll-area.d.ts +2 -0
- package/dist/components/scroll-area/scroll-area.types.d.ts +6 -0
- package/dist/components/select/index.d.ts +10 -0
- package/dist/components/select/select-group-label.d.ts +2 -0
- package/dist/components/select/select-group.d.ts +2 -0
- package/dist/components/select/select-icon.d.ts +2 -0
- package/dist/components/select/select-item.d.ts +2 -0
- package/dist/components/select/select-list.d.ts +2 -0
- package/dist/components/select/select-popup.d.ts +2 -0
- package/dist/components/select/select-trigger.d.ts +2 -0
- package/dist/components/select/select-value.d.ts +2 -0
- package/dist/components/select/select.d.ts +2 -0
- package/dist/components/select/select.types.d.ts +15 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/separator.d.ts +2 -0
- package/dist/components/separator/separator.types.d.ts +9 -0
- package/dist/components/sidebar/index.d.ts +17 -0
- package/dist/components/sidebar/sidebar-content.d.ts +2 -0
- package/dist/components/sidebar/sidebar-footer.d.ts +2 -0
- package/dist/components/sidebar/sidebar-group-content.d.ts +2 -0
- package/dist/components/sidebar/sidebar-group-label.d.ts +2 -0
- package/dist/components/sidebar/sidebar-group.d.ts +2 -0
- package/dist/components/sidebar/sidebar-header.d.ts +2 -0
- package/dist/components/sidebar/sidebar-menu-badge.d.ts +2 -0
- package/dist/components/sidebar/sidebar-menu-button.d.ts +2 -0
- package/dist/components/sidebar/sidebar-menu-collapsible-panel.d.ts +2 -0
- package/dist/components/sidebar/sidebar-menu-collapsible-trigger.d.ts +2 -0
- package/dist/components/sidebar/sidebar-menu-collapsible.d.ts +2 -0
- package/dist/components/sidebar/sidebar-menu-item.d.ts +2 -0
- package/dist/components/sidebar/sidebar-menu.d.ts +2 -0
- package/dist/components/sidebar/sidebar-provider.d.ts +14 -0
- package/dist/components/sidebar/sidebar-toggle.d.ts +2 -0
- package/dist/components/sidebar/sidebar.d.ts +2 -0
- package/dist/components/sidebar/sidebar.types.d.ts +27 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/skeleton.d.ts +2 -0
- package/dist/components/skeleton/skeleton.types.d.ts +1 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/slider-thumb.d.ts +2 -0
- package/dist/components/slider/slider.d.ts +2 -0
- package/dist/components/slider/slider.types.d.ts +12 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/switch.d.ts +2 -0
- package/dist/components/switch/switch.types.d.ts +4 -0
- package/dist/components/table/index.d.ts +16 -0
- package/dist/components/table/table-body.d.ts +2 -0
- package/dist/components/table/table-change-view.d.ts +4 -0
- package/dist/components/table/table-content.d.ts +2 -0
- package/dist/components/table/table-filter.d.ts +2 -0
- package/dist/components/table/table-first-page.d.ts +2 -0
- package/dist/components/table/table-footer.d.ts +2 -0
- package/dist/components/table/table-header.d.ts +2 -0
- package/dist/components/table/table-last-page.d.ts +2 -0
- package/dist/components/table/table-nav.d.ts +2 -0
- package/dist/components/table/table-next-page.d.ts +2 -0
- package/dist/components/table/table-pagination.d.ts +2 -0
- package/dist/components/table/table-previous-page.d.ts +2 -0
- package/dist/components/table/table-refresh.d.ts +2 -0
- package/dist/components/table/table-results.d.ts +3 -0
- package/dist/components/table/table-row-grid.d.ts +2 -0
- package/dist/components/table/table-row-list.d.ts +2 -0
- package/dist/components/table/table-search.d.ts +2 -0
- package/dist/components/table/table-sort.d.ts +2 -0
- package/dist/components/table/table.d.ts +10 -0
- package/dist/components/table/table.types.d.ts +39 -0
- package/dist/components/tabs/index.d.ts +6 -0
- package/dist/components/tabs/tabs-indicator.d.ts +2 -0
- package/dist/components/tabs/tabs-list.d.ts +2 -0
- package/dist/components/tabs/tabs-panel.d.ts +2 -0
- package/dist/components/tabs/tabs-tab.d.ts +2 -0
- package/dist/components/tabs/tabs.d.ts +2 -0
- package/dist/components/tabs/tabs.types.d.ts +12 -0
- package/dist/components/text-area/index.d.ts +2 -0
- package/dist/components/text-area/text-area.d.ts +2 -0
- package/dist/components/text-area/text-area.types.d.ts +5 -0
- package/dist/components/toast/anchored-toast-item.d.ts +2 -0
- package/dist/components/toast/anchored-toasts.d.ts +2 -0
- package/dist/components/toast/index.d.ts +27 -0
- package/dist/components/toast/stack-toast-item.d.ts +2 -0
- package/dist/components/toast/stack-toasts.d.ts +2 -0
- package/dist/components/toast/toast-manager.d.ts +19 -0
- package/dist/components/toast/toast-provider.d.ts +2 -0
- package/dist/components/toast/toast.types.d.ts +21 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/toggle.d.ts +2 -0
- package/dist/components/toggle/toggle.types.d.ts +9 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/toggle-group-context.d.ts +5 -0
- package/dist/components/toggle-group/toggle-group.d.ts +2 -0
- package/dist/components/toggle-group/toggle-group.types.d.ts +6 -0
- package/dist/components/tooltip/index.d.ts +4 -0
- package/dist/components/tooltip/tooltip-context.d.ts +2 -0
- package/dist/components/tooltip/tooltip-trigger.d.ts +2 -0
- package/dist/components/tooltip/tooltip.d.ts +2 -0
- package/dist/components/tooltip/tooltip.types.d.ts +9 -0
- package/dist/dawn-ui-react.js +12736 -0
- package/dist/dawn-ui-react.umd.cjs +49 -0
- package/dist/field-description-BDRJXMS8.js +12 -0
- package/dist/field-errors-BDUanNiE.js +19 -0
- package/dist/field-input-0WxX-93A.js +58 -0
- package/dist/field-input-group-Dcwadst3.js +18 -0
- package/dist/field-input-group-input-CLQz2SPo.js +20 -0
- package/dist/field-label-DwF_1o76.js +16 -0
- package/dist/field-select-BmvhGVSz.js +2149 -0
- package/dist/field-slider-oL8pDrCe.js +2167 -0
- package/dist/form-context-CzC_p5DL.js +3036 -0
- package/dist/index.d.ts +2 -0
- package/dist/input-group-D3zocoNy.js +12 -0
- package/dist/input-group-input-CHby62R-.js +11 -0
- package/dist/input.types-Dl_61f0y.js +21 -0
- package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
- package/dist/styles.css +779 -0
- package/dist/useLabelableId-VWw8rfpn.js +271 -0
- package/dist/utils/cn.d.ts +2 -0
- package/package.json +124 -0
|
@@ -0,0 +1,3036 @@
|
|
|
1
|
+
import { n as e, t } from "./cn-CXogf8HW.js";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { createContext as r, createElement as i, lazy as a, useCallback as o, useContext as s, useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
4
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
5
|
+
import { useSyncExternalStoreWithSelector as g } from "use-sync-external-store/shim/with-selector";
|
|
6
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/error.js
|
|
7
|
+
var _;
|
|
8
|
+
process.env.NODE_ENV !== "production" && (_ = /* @__PURE__ */ new Set());
|
|
9
|
+
function v(...e) {
|
|
10
|
+
if (process.env.NODE_ENV !== "production") {
|
|
11
|
+
let t = e.join(" ");
|
|
12
|
+
_.has(t) || (_.add(t), console.error(`Base UI: ${t}`));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/useRefWithInit.js
|
|
17
|
+
var y = {};
|
|
18
|
+
function b(e, t) {
|
|
19
|
+
let r = n.useRef(y);
|
|
20
|
+
return r.current === y && (r.current = e(t)), r;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/useStableCallback.js
|
|
24
|
+
var ee = n[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)], te = ee && ee !== n.useLayoutEffect ? ee : (e) => e();
|
|
25
|
+
function ne(e) {
|
|
26
|
+
let t = b(re).current;
|
|
27
|
+
return t.next = e, te(t.effect), t.trampoline;
|
|
28
|
+
}
|
|
29
|
+
function re() {
|
|
30
|
+
let e = {
|
|
31
|
+
next: void 0,
|
|
32
|
+
callback: ie,
|
|
33
|
+
trampoline: (...t) => e.callback?.(...t),
|
|
34
|
+
effect: () => {
|
|
35
|
+
e.callback = e.next;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return e;
|
|
39
|
+
}
|
|
40
|
+
function ie() {
|
|
41
|
+
if (process.env.NODE_ENV !== "production") throw Error("Base UI: Cannot call an event handler while rendering.");
|
|
42
|
+
}
|
|
43
|
+
var ae = typeof document < "u" ? n.useLayoutEffect : () => {}, oe;
|
|
44
|
+
process.env.NODE_ENV !== "production" && (oe = /* @__PURE__ */ new Set());
|
|
45
|
+
function se(...e) {
|
|
46
|
+
if (process.env.NODE_ENV !== "production") {
|
|
47
|
+
let t = e.join(" ");
|
|
48
|
+
oe.has(t) || (oe.add(t), console.warn(`Base UI: ${t}`));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/formatErrorMessage.js
|
|
53
|
+
function ce(e, t) {
|
|
54
|
+
return function(n, ...r) {
|
|
55
|
+
let i = new URL(e);
|
|
56
|
+
return i.searchParams.set("code", n.toString()), r.forEach((e) => i.searchParams.append("args[]", e)), `${t} error #${n}; visit ${i} for the full message.`;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var le = ce("https://base-ui.com/production-error", "Base UI");
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/useMergedRefs.js
|
|
62
|
+
function ue(e, t, n, r) {
|
|
63
|
+
let i = b(fe).current;
|
|
64
|
+
return pe(i, e, t, n, r) && he(i, [
|
|
65
|
+
e,
|
|
66
|
+
t,
|
|
67
|
+
n,
|
|
68
|
+
r
|
|
69
|
+
]), i.callback;
|
|
70
|
+
}
|
|
71
|
+
function de(e) {
|
|
72
|
+
let t = b(fe).current;
|
|
73
|
+
return me(t, e) && he(t, e), t.callback;
|
|
74
|
+
}
|
|
75
|
+
function fe() {
|
|
76
|
+
return {
|
|
77
|
+
callback: null,
|
|
78
|
+
cleanup: null,
|
|
79
|
+
refs: []
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function pe(e, t, n, r, i) {
|
|
83
|
+
return e.refs[0] !== t || e.refs[1] !== n || e.refs[2] !== r || e.refs[3] !== i;
|
|
84
|
+
}
|
|
85
|
+
function me(e, t) {
|
|
86
|
+
return e.refs.length !== t.length || e.refs.some((e, n) => e !== t[n]);
|
|
87
|
+
}
|
|
88
|
+
function he(e, t) {
|
|
89
|
+
if (e.refs = t, t.every((e) => e == null)) {
|
|
90
|
+
e.callback = null;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
e.callback = (n) => {
|
|
94
|
+
if (e.cleanup &&= (e.cleanup(), null), n != null) {
|
|
95
|
+
let r = Array(t.length).fill(null);
|
|
96
|
+
for (let e = 0; e < t.length; e += 1) {
|
|
97
|
+
let i = t[e];
|
|
98
|
+
if (i != null) switch (typeof i) {
|
|
99
|
+
case "function": {
|
|
100
|
+
let t = i(n);
|
|
101
|
+
typeof t == "function" && (r[e] = t);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
case "object":
|
|
105
|
+
i.current = n;
|
|
106
|
+
break;
|
|
107
|
+
default:
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
e.cleanup = () => {
|
|
111
|
+
for (let e = 0; e < t.length; e += 1) {
|
|
112
|
+
let n = t[e];
|
|
113
|
+
if (n != null) switch (typeof n) {
|
|
114
|
+
case "function": {
|
|
115
|
+
let t = r[e];
|
|
116
|
+
typeof t == "function" ? t() : n(null);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
case "object":
|
|
120
|
+
n.current = null;
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/reactVersion.js
|
|
131
|
+
var ge = parseInt(n.version, 10);
|
|
132
|
+
function _e(e) {
|
|
133
|
+
return ge >= e;
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/getReactElementRef.js
|
|
137
|
+
function ve(e) {
|
|
138
|
+
if (!/* @__PURE__ */ n.isValidElement(e)) return null;
|
|
139
|
+
let t = e, r = t.props;
|
|
140
|
+
return (_e(19) ? r?.ref : t.ref) ?? null;
|
|
141
|
+
}
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/mergeObjects.js
|
|
144
|
+
function ye(e, t) {
|
|
145
|
+
if (e && !t) return e;
|
|
146
|
+
if (!e && t) return t;
|
|
147
|
+
if (e || t) return {
|
|
148
|
+
...e,
|
|
149
|
+
...t
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/empty.js
|
|
154
|
+
function be() {}
|
|
155
|
+
var xe = Object.freeze([]), x = Object.freeze({});
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
|
|
158
|
+
function Se(e, t) {
|
|
159
|
+
let n = {};
|
|
160
|
+
for (let r in e) {
|
|
161
|
+
let i = e[r];
|
|
162
|
+
if (t?.hasOwnProperty(r)) {
|
|
163
|
+
let e = t[r](i);
|
|
164
|
+
e != null && Object.assign(n, e);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
i === !0 ? n[`data-${r.toLowerCase()}`] = "" : i && (n[`data-${r.toLowerCase()}`] = i.toString());
|
|
168
|
+
}
|
|
169
|
+
return n;
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/utils/resolveClassName.js
|
|
173
|
+
function Ce(e, t) {
|
|
174
|
+
return typeof e == "function" ? e(t) : e;
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/utils/resolveStyle.js
|
|
178
|
+
function we(e, t) {
|
|
179
|
+
return typeof e == "function" ? e(t) : e;
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/merge-props/mergeProps.js
|
|
183
|
+
var Te = {};
|
|
184
|
+
function S(e, t, n, r, i) {
|
|
185
|
+
if (!n && !r && !i && !e) return C(t);
|
|
186
|
+
let a = C(e);
|
|
187
|
+
return t && (a = w(a, t)), n && (a = w(a, n)), r && (a = w(a, r)), i && (a = w(a, i)), a;
|
|
188
|
+
}
|
|
189
|
+
function Ee(e) {
|
|
190
|
+
if (e.length === 0) return Te;
|
|
191
|
+
if (e.length === 1) return C(e[0]);
|
|
192
|
+
let t = C(e[0]);
|
|
193
|
+
for (let n = 1; n < e.length; n += 1) t = w(t, e[n]);
|
|
194
|
+
return t;
|
|
195
|
+
}
|
|
196
|
+
function C(e) {
|
|
197
|
+
return Ae(e) ? { ...je(e, Te) } : De(e);
|
|
198
|
+
}
|
|
199
|
+
function w(e, t) {
|
|
200
|
+
return Ae(t) ? je(t, e) : Oe(e, t);
|
|
201
|
+
}
|
|
202
|
+
function De(e) {
|
|
203
|
+
let t = { ...e };
|
|
204
|
+
for (let e in t) {
|
|
205
|
+
let n = t[e];
|
|
206
|
+
ke(e, n) && (t[e] = Ne(n));
|
|
207
|
+
}
|
|
208
|
+
return t;
|
|
209
|
+
}
|
|
210
|
+
function Oe(e, t) {
|
|
211
|
+
if (!t) return e;
|
|
212
|
+
for (let n in t) {
|
|
213
|
+
let r = t[n];
|
|
214
|
+
switch (n) {
|
|
215
|
+
case "style":
|
|
216
|
+
e[n] = ye(e.style, r);
|
|
217
|
+
break;
|
|
218
|
+
case "className":
|
|
219
|
+
e[n] = Pe(e.className, r);
|
|
220
|
+
break;
|
|
221
|
+
default: ke(n, r) ? e[n] = Me(e[n], r) : e[n] = r;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return e;
|
|
225
|
+
}
|
|
226
|
+
function ke(e, t) {
|
|
227
|
+
let n = e.charCodeAt(0), r = e.charCodeAt(1), i = e.charCodeAt(2);
|
|
228
|
+
return n === 111 && r === 110 && i >= 65 && i <= 90 && (typeof t == "function" || t === void 0);
|
|
229
|
+
}
|
|
230
|
+
function Ae(e) {
|
|
231
|
+
return typeof e == "function";
|
|
232
|
+
}
|
|
233
|
+
function je(e, t) {
|
|
234
|
+
return Ae(e) ? e(t) : e ?? Te;
|
|
235
|
+
}
|
|
236
|
+
function Me(e, t) {
|
|
237
|
+
return t ? e ? (...n) => {
|
|
238
|
+
let r = n[0];
|
|
239
|
+
if (Fe(r)) {
|
|
240
|
+
let i = r;
|
|
241
|
+
T(i);
|
|
242
|
+
let a = t(...n);
|
|
243
|
+
return i.baseUIHandlerPrevented || e?.(...n), a;
|
|
244
|
+
}
|
|
245
|
+
let i = t(...n);
|
|
246
|
+
return e?.(...n), i;
|
|
247
|
+
} : Ne(t) : e;
|
|
248
|
+
}
|
|
249
|
+
function Ne(e) {
|
|
250
|
+
return e && ((...t) => {
|
|
251
|
+
let n = t[0];
|
|
252
|
+
return Fe(n) && T(n), e(...t);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function T(e) {
|
|
256
|
+
return e.preventBaseUIHandler = () => {
|
|
257
|
+
e.baseUIHandlerPrevented = !0;
|
|
258
|
+
}, e;
|
|
259
|
+
}
|
|
260
|
+
function Pe(e, t) {
|
|
261
|
+
return t ? e ? t + " " + e : t : e;
|
|
262
|
+
}
|
|
263
|
+
function Fe(e) {
|
|
264
|
+
return typeof e == "object" && !!e && "nativeEvent" in e;
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/internals/useRenderElement.js
|
|
268
|
+
function Ie(e, t, n = {}) {
|
|
269
|
+
let r = t.render, i = Le(t, n);
|
|
270
|
+
return n.enabled === !1 ? null : He(e, r, i, n.state ?? x);
|
|
271
|
+
}
|
|
272
|
+
function Le(e, t = {}) {
|
|
273
|
+
let { className: n, style: r, render: i } = e, { state: a = x, ref: o, props: s, stateAttributesMapping: c, enabled: l = !0 } = t, u = l ? Ce(n, a) : void 0, d = l ? we(r, a) : void 0, f = l ? Se(a, c) : x, p = l && s ? Re(s) : void 0, m = l ? ye(f, p) ?? {} : x;
|
|
274
|
+
return typeof document < "u" && (l ? Array.isArray(o) ? m.ref = de([
|
|
275
|
+
m.ref,
|
|
276
|
+
ve(i),
|
|
277
|
+
...o
|
|
278
|
+
]) : m.ref = ue(m.ref, ve(i), o) : ue(null, null)), l ? (u !== void 0 && (m.className = Pe(m.className, u)), d !== void 0 && (m.style = ye(m.style, d)), m) : x;
|
|
279
|
+
}
|
|
280
|
+
function Re(e) {
|
|
281
|
+
return Array.isArray(e) ? Ee(e) : S(void 0, e);
|
|
282
|
+
}
|
|
283
|
+
var ze = Symbol.for("react.lazy"), Be = /^[A-Z][A-Za-z0-9$]*$/, Ve = /[a-z]/;
|
|
284
|
+
function He(e, t, r, i) {
|
|
285
|
+
if (t) {
|
|
286
|
+
if (typeof t == "function") return process.env.NODE_ENV !== "production" && Ue(t), t(r, i);
|
|
287
|
+
let e = S(r, t.props);
|
|
288
|
+
e.ref = r.ref;
|
|
289
|
+
let a = t;
|
|
290
|
+
if (a?.$$typeof === ze && (a = n.Children.toArray(t)[0]), process.env.NODE_ENV !== "production" && !/* @__PURE__ */ n.isValidElement(a)) throw Error([
|
|
291
|
+
"Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.",
|
|
292
|
+
"A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",
|
|
293
|
+
"https://base-ui.com/r/invalid-render-prop"
|
|
294
|
+
].join("\n"));
|
|
295
|
+
return /* @__PURE__ */ n.cloneElement(a, e);
|
|
296
|
+
}
|
|
297
|
+
if (e && typeof e == "string") return We(e, r);
|
|
298
|
+
throw Error(process.env.NODE_ENV === "production" ? le(8) : "Base UI: Render element or function are not defined.");
|
|
299
|
+
}
|
|
300
|
+
function Ue(e) {
|
|
301
|
+
let t = e.name;
|
|
302
|
+
t.length !== 0 && Be.test(t) && Ve.test(t) && se(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
|
|
303
|
+
}
|
|
304
|
+
function We(e, t) {
|
|
305
|
+
return e === "button" ? /* @__PURE__ */ i("button", {
|
|
306
|
+
type: "button",
|
|
307
|
+
...t,
|
|
308
|
+
key: t.key
|
|
309
|
+
}) : e === "img" ? /* @__PURE__ */ i("img", {
|
|
310
|
+
alt: "",
|
|
311
|
+
...t,
|
|
312
|
+
key: t.key
|
|
313
|
+
}) : /* @__PURE__ */ n.createElement(e, t);
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region node_modules/.pnpm/@base-ui+utils@0.2.8_@types_d3ee2f4e7c4092dbff53908511a88462/node_modules/@base-ui/utils/esm/safeReact.js
|
|
317
|
+
var Ge = { ...n };
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region node_modules/.pnpm/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
320
|
+
function Ke() {
|
|
321
|
+
return typeof window < "u";
|
|
322
|
+
}
|
|
323
|
+
function qe(e) {
|
|
324
|
+
return Ye(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
325
|
+
}
|
|
326
|
+
function E(e) {
|
|
327
|
+
var t;
|
|
328
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
329
|
+
}
|
|
330
|
+
function Je(e) {
|
|
331
|
+
return ((Ye(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
332
|
+
}
|
|
333
|
+
function Ye(e) {
|
|
334
|
+
return Ke() ? e instanceof Node || e instanceof E(e).Node : !1;
|
|
335
|
+
}
|
|
336
|
+
function Xe(e) {
|
|
337
|
+
return Ke() ? e instanceof Element || e instanceof E(e).Element : !1;
|
|
338
|
+
}
|
|
339
|
+
function Ze(e) {
|
|
340
|
+
return Ke() ? e instanceof HTMLElement || e instanceof E(e).HTMLElement : !1;
|
|
341
|
+
}
|
|
342
|
+
function Qe(e) {
|
|
343
|
+
return !Ke() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof E(e).ShadowRoot;
|
|
344
|
+
}
|
|
345
|
+
function $e(e) {
|
|
346
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = lt(e);
|
|
347
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
348
|
+
}
|
|
349
|
+
function et(e) {
|
|
350
|
+
return /^(table|td|th)$/.test(qe(e));
|
|
351
|
+
}
|
|
352
|
+
function tt(e) {
|
|
353
|
+
try {
|
|
354
|
+
if (e.matches(":popover-open")) return !0;
|
|
355
|
+
} catch {}
|
|
356
|
+
try {
|
|
357
|
+
return e.matches(":modal");
|
|
358
|
+
} catch {
|
|
359
|
+
return !1;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
var nt = /transform|translate|scale|rotate|perspective|filter/, rt = /paint|layout|strict|content/, D = (e) => !!e && e !== "none", it;
|
|
363
|
+
function at(e) {
|
|
364
|
+
let t = Xe(e) ? lt(e) : e;
|
|
365
|
+
return D(t.transform) || D(t.translate) || D(t.scale) || D(t.rotate) || D(t.perspective) || !st() && (D(t.backdropFilter) || D(t.filter)) || nt.test(t.willChange || "") || rt.test(t.contain || "");
|
|
366
|
+
}
|
|
367
|
+
function ot(e) {
|
|
368
|
+
let t = O(e);
|
|
369
|
+
for (; Ze(t) && !ct(t);) {
|
|
370
|
+
if (at(t)) return t;
|
|
371
|
+
if (tt(t)) return null;
|
|
372
|
+
t = O(t);
|
|
373
|
+
}
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
function st() {
|
|
377
|
+
return it ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), it;
|
|
378
|
+
}
|
|
379
|
+
function ct(e) {
|
|
380
|
+
return /^(html|body|#document)$/.test(qe(e));
|
|
381
|
+
}
|
|
382
|
+
function lt(e) {
|
|
383
|
+
return E(e).getComputedStyle(e);
|
|
384
|
+
}
|
|
385
|
+
function ut(e) {
|
|
386
|
+
return Xe(e) ? {
|
|
387
|
+
scrollLeft: e.scrollLeft,
|
|
388
|
+
scrollTop: e.scrollTop
|
|
389
|
+
} : {
|
|
390
|
+
scrollLeft: e.scrollX,
|
|
391
|
+
scrollTop: e.scrollY
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function O(e) {
|
|
395
|
+
if (qe(e) === "html") return e;
|
|
396
|
+
let t = e.assignedSlot || e.parentNode || Qe(e) && e.host || Je(e);
|
|
397
|
+
return Qe(t) ? t.host : t;
|
|
398
|
+
}
|
|
399
|
+
function dt(e) {
|
|
400
|
+
let t = O(e);
|
|
401
|
+
return ct(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Ze(t) && $e(t) ? t : dt(t);
|
|
402
|
+
}
|
|
403
|
+
function ft(e, t, n) {
|
|
404
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
405
|
+
let r = dt(e), i = r === e.ownerDocument?.body, a = E(r);
|
|
406
|
+
if (i) {
|
|
407
|
+
let e = pt(a);
|
|
408
|
+
return t.concat(a, a.visualViewport || [], $e(r) ? r : [], e && n ? ft(e) : []);
|
|
409
|
+
} else return t.concat(r, ft(r, [], n));
|
|
410
|
+
}
|
|
411
|
+
function pt(e) {
|
|
412
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
413
|
+
}
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/internals/composite/root/CompositeRootContext.js
|
|
416
|
+
var mt = /* @__PURE__ */ n.createContext(void 0);
|
|
417
|
+
process.env.NODE_ENV !== "production" && (mt.displayName = "CompositeRootContext");
|
|
418
|
+
function ht(e = !1) {
|
|
419
|
+
let t = n.useContext(mt);
|
|
420
|
+
if (t === void 0 && !e) throw Error(process.env.NODE_ENV === "production" ? le(16) : "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
|
|
421
|
+
return t;
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js
|
|
425
|
+
function gt(e) {
|
|
426
|
+
let { focusableWhenDisabled: t, disabled: r, composite: i = !1, tabIndex: a = 0, isNativeButton: o } = e, s = i && t !== !1, c = i && t === !1;
|
|
427
|
+
return { props: n.useMemo(() => {
|
|
428
|
+
let e = { onKeyDown(e) {
|
|
429
|
+
r && t && e.key !== "Tab" && e.preventDefault();
|
|
430
|
+
} };
|
|
431
|
+
return i || (e.tabIndex = a, !o && r && (e.tabIndex = t ? a : -1)), (o && (t || s) || !o && r) && (e["aria-disabled"] = r), o && (!t || c) && (e.disabled = r), e;
|
|
432
|
+
}, [
|
|
433
|
+
i,
|
|
434
|
+
r,
|
|
435
|
+
t,
|
|
436
|
+
s,
|
|
437
|
+
c,
|
|
438
|
+
o,
|
|
439
|
+
a
|
|
440
|
+
]) };
|
|
441
|
+
}
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region node_modules/.pnpm/@base-ui+react@1.4.1_@date-_b8638dac2a3c723a96c38fd0e25c7d53/node_modules/@base-ui/react/esm/internals/use-button/useButton.js
|
|
444
|
+
function _t(e = {}) {
|
|
445
|
+
let { disabled: t = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0, composite: o } = e, s = n.useRef(null), c = ht(!0), l = o ?? c !== void 0, { props: u } = gt({
|
|
446
|
+
focusableWhenDisabled: r,
|
|
447
|
+
disabled: t,
|
|
448
|
+
composite: l,
|
|
449
|
+
tabIndex: i,
|
|
450
|
+
isNativeButton: a
|
|
451
|
+
});
|
|
452
|
+
process.env.NODE_ENV !== "production" && n.useEffect(() => {
|
|
453
|
+
if (!s.current) return;
|
|
454
|
+
let e = vt(s.current);
|
|
455
|
+
a ? e || v(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${Ge.captureOwnerStack?.() || ""}`) : e && v(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${Ge.captureOwnerStack?.() || ""}`);
|
|
456
|
+
}, [a]);
|
|
457
|
+
let d = n.useCallback(() => {
|
|
458
|
+
let e = s.current;
|
|
459
|
+
vt(e) && l && t && u.disabled === void 0 && e.disabled && (e.disabled = !1);
|
|
460
|
+
}, [
|
|
461
|
+
t,
|
|
462
|
+
u.disabled,
|
|
463
|
+
l
|
|
464
|
+
]);
|
|
465
|
+
return ae(d, [d]), {
|
|
466
|
+
getButtonProps: n.useCallback((e = {}) => {
|
|
467
|
+
let { onClick: n, onMouseDown: r, onKeyUp: i, onKeyDown: o, onPointerDown: s, ...c } = e;
|
|
468
|
+
return S({
|
|
469
|
+
type: a ? "button" : void 0,
|
|
470
|
+
onClick(e) {
|
|
471
|
+
if (t) {
|
|
472
|
+
e.preventDefault();
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
n?.(e);
|
|
476
|
+
},
|
|
477
|
+
onMouseDown(e) {
|
|
478
|
+
t || r?.(e);
|
|
479
|
+
},
|
|
480
|
+
onKeyDown(e) {
|
|
481
|
+
if (t || (T(e), o?.(e), e.baseUIHandlerPrevented)) return;
|
|
482
|
+
let r = e.target === e.currentTarget, i = e.currentTarget, s = vt(i), c = !a && yt(i), u = r && (a ? s : !c), d = e.key === "Enter", f = e.key === " ", p = i.getAttribute("role"), m = p?.startsWith("menuitem") || p === "option" || p === "gridcell";
|
|
483
|
+
if (r && l && f) {
|
|
484
|
+
if (e.defaultPrevented && m) return;
|
|
485
|
+
e.preventDefault(), c || a && s ? (i.click(), e.preventBaseUIHandler()) : u && (n?.(e), e.preventBaseUIHandler());
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
u && (!a && (f || d) && e.preventDefault(), !a && d && n?.(e));
|
|
489
|
+
},
|
|
490
|
+
onKeyUp(e) {
|
|
491
|
+
if (!t) {
|
|
492
|
+
if (T(e), i?.(e), e.target === e.currentTarget && a && l && vt(e.currentTarget) && e.key === " ") {
|
|
493
|
+
e.preventDefault();
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
e.baseUIHandlerPrevented || e.target === e.currentTarget && !a && !l && e.key === " " && n?.(e);
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
onPointerDown(e) {
|
|
500
|
+
if (t) {
|
|
501
|
+
e.preventDefault();
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
s?.(e);
|
|
505
|
+
}
|
|
506
|
+
}, a ? void 0 : { role: "button" }, u, c);
|
|
507
|
+
}, [
|
|
508
|
+
t,
|
|
509
|
+
u,
|
|
510
|
+
l,
|
|
511
|
+
a
|
|
512
|
+
]),
|
|
513
|
+
buttonRef: ne((e) => {
|
|
514
|
+
s.current = e, d();
|
|
515
|
+
})
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
function vt(e) {
|
|
519
|
+
return Ze(e) && e.tagName === "BUTTON";
|
|
520
|
+
}
|
|
521
|
+
function yt(e) {
|
|
522
|
+
return !!(e?.tagName === "A" && e?.href);
|
|
523
|
+
}
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
526
|
+
var bt = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, xt = e, St = (e, t) => (n) => {
|
|
527
|
+
if (t?.variants == null) return xt(e, n?.class, n?.className);
|
|
528
|
+
let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
|
|
529
|
+
let t = n?.[e], a = i?.[e];
|
|
530
|
+
if (t === null) return null;
|
|
531
|
+
let o = bt(t) || bt(a);
|
|
532
|
+
return r[e][o];
|
|
533
|
+
}), o = n && Object.entries(n).reduce((e, t) => {
|
|
534
|
+
let [n, r] = t;
|
|
535
|
+
return r === void 0 || (e[n] = r), e;
|
|
536
|
+
}, {});
|
|
537
|
+
return xt(e, a, t?.compoundVariants?.reduce((e, t) => {
|
|
538
|
+
let { class: n, className: r, ...a } = t;
|
|
539
|
+
return Object.entries(a).every((e) => {
|
|
540
|
+
let [t, n] = e;
|
|
541
|
+
return Array.isArray(n) ? n.includes({
|
|
542
|
+
...i,
|
|
543
|
+
...o
|
|
544
|
+
}[t]) : {
|
|
545
|
+
...i,
|
|
546
|
+
...o
|
|
547
|
+
}[t] === n;
|
|
548
|
+
}) ? [
|
|
549
|
+
...e,
|
|
550
|
+
n,
|
|
551
|
+
r
|
|
552
|
+
] : e;
|
|
553
|
+
}, []), n?.class, n?.className);
|
|
554
|
+
}, Ct = St("group flex items-center justify-start gap-sm rounded-xl border px-md py-sm transition-all [&>svg]:size-lg", {
|
|
555
|
+
variants: { tone: {
|
|
556
|
+
brand: "border-brand-border bg-brand-container [&_[data-description]]:text-brand-on-container-muted [&_[data-title]]:text-brand-on-container [&_svg]:text-brand-on-container",
|
|
557
|
+
accent: "border-accent-border bg-accent-container [&_[data-description]]:text-accent-on-container-muted [&_[data-title]]:text-accent-on-container [&_svg]:text-accent-on-container",
|
|
558
|
+
neutral: "border-neutral-border bg-neutral-container [&_[data-description]]:text-neutral-on-container-muted [&_[data-title]]:text-neutral-on-container [&_svg]:text-neutral-on-container",
|
|
559
|
+
error: "border-error-border bg-error-container [&_[data-description]]:text-error-on-container-muted [&_[data-title]]:text-error-on-container [&_svg]:text-error-on-container",
|
|
560
|
+
info: "border-info-border bg-info-container [&_[data-description]]:text-info-on-container-muted [&_[data-title]]:text-info-on-container [&_svg]:text-info-on-container",
|
|
561
|
+
success: "border-success-border bg-success-container [&_[data-description]]:text-success-on-container-muted [&_[data-title]]:text-success-on-container [&_svg]:text-success-on-container",
|
|
562
|
+
warning: "border-warning-border bg-warning-container [&_[data-description]]:text-warning-on-container-muted [&_[data-title]]:text-warning-on-container [&_svg]:text-warning-on-container"
|
|
563
|
+
} },
|
|
564
|
+
defaultVariants: { tone: "brand" }
|
|
565
|
+
}), wt = ({ tone: e, className: n, children: r, ref: i, ...a }) => /* @__PURE__ */ m("div", {
|
|
566
|
+
className: t(Ct({
|
|
567
|
+
tone: e,
|
|
568
|
+
className: n
|
|
569
|
+
})),
|
|
570
|
+
ref: i,
|
|
571
|
+
...a,
|
|
572
|
+
children: r
|
|
573
|
+
}), Tt = ({ className: e, children: n, ref: r, ...i }) => /* @__PURE__ */ m("div", {
|
|
574
|
+
className: t("style-text-prose-0", e),
|
|
575
|
+
"data-description": !0,
|
|
576
|
+
ref: r,
|
|
577
|
+
...i,
|
|
578
|
+
children: n
|
|
579
|
+
}), Et = ({ className: e, children: n, ref: r, ...i }) => /* @__PURE__ */ m("div", {
|
|
580
|
+
className: t("", e),
|
|
581
|
+
ref: r,
|
|
582
|
+
...i,
|
|
583
|
+
children: n
|
|
584
|
+
}), Dt = /* @__PURE__ */ n.forwardRef(function(e, t) {
|
|
585
|
+
let { render: n, className: r, disabled: i = !1, focusableWhenDisabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { getButtonProps: l, buttonRef: u } = _t({
|
|
586
|
+
disabled: i,
|
|
587
|
+
focusableWhenDisabled: a,
|
|
588
|
+
native: o
|
|
589
|
+
});
|
|
590
|
+
return Ie("button", e, {
|
|
591
|
+
state: { disabled: i },
|
|
592
|
+
ref: [t, u],
|
|
593
|
+
props: [c, l]
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
process.env.NODE_ENV !== "production" && (Dt.displayName = "Button");
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region src/components/button/button.types.ts
|
|
599
|
+
var Ot = St("inline-flex cursor-pointer items-center justify-center rounded-full whitespace-nowrap transition-all select-none disabled:pointer-events-none disabled:opacity-50", {
|
|
600
|
+
variants: {
|
|
601
|
+
tone: {
|
|
602
|
+
brand: "",
|
|
603
|
+
accent: "",
|
|
604
|
+
neutral: "",
|
|
605
|
+
error: "",
|
|
606
|
+
info: "",
|
|
607
|
+
warning: "",
|
|
608
|
+
success: ""
|
|
609
|
+
},
|
|
610
|
+
variant: {
|
|
611
|
+
fill: "active:scale-[0.98]",
|
|
612
|
+
outline: "border active:scale-[0.98]",
|
|
613
|
+
ghost: "active:scale-[0.98]",
|
|
614
|
+
soft: "border active:scale-[0.98]",
|
|
615
|
+
elevated: "shadow-xs not-active:hover:shadow-md"
|
|
616
|
+
},
|
|
617
|
+
size: {
|
|
618
|
+
large: "h-2xl gap-xs px-md style-text-default-2 [&>svg]:size-md",
|
|
619
|
+
medium: "h-xl gap-2xs px-sm style-text-default-0 [&>svg]:size-sm",
|
|
620
|
+
small: "h-lg gap-3xs px-xs style-text-default--1 [&>svg]:size-xs",
|
|
621
|
+
extraSmall: "h-md gap-3xs px-2xs style-text-default--2 [&>svg]:size-xs",
|
|
622
|
+
iconLarge: "size-2xl p-[0px] [&>svg]:size-md",
|
|
623
|
+
iconMedium: "size-xl p-[0px] [&>svg]:size-sm",
|
|
624
|
+
iconSmall: "size-lg p-[0px] [&>svg]:size-xs",
|
|
625
|
+
iconExtraSmall: "size-md p-[0px] [&>svg]:size-xs"
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
defaultVariants: {
|
|
629
|
+
tone: "brand",
|
|
630
|
+
variant: "fill",
|
|
631
|
+
size: "medium"
|
|
632
|
+
},
|
|
633
|
+
compoundVariants: [
|
|
634
|
+
{
|
|
635
|
+
variant: "fill",
|
|
636
|
+
tone: "brand",
|
|
637
|
+
className: "bg-brand-default text-brand-on-default hover:bg-brand-muted"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
variant: "fill",
|
|
641
|
+
tone: "accent",
|
|
642
|
+
className: "bg-accent-default text-accent-on-default hover:bg-accent-muted"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
variant: "fill",
|
|
646
|
+
tone: "neutral",
|
|
647
|
+
className: "bg-neutral-default text-neutral-on-default hover:bg-neutral-muted"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
variant: "fill",
|
|
651
|
+
tone: "error",
|
|
652
|
+
className: "bg-error-default text-error-on-default hover:bg-error-muted"
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
variant: "fill",
|
|
656
|
+
tone: "info",
|
|
657
|
+
className: "bg-info-default text-info-on-default hover:bg-info-muted"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
variant: "fill",
|
|
661
|
+
tone: "success",
|
|
662
|
+
className: "bg-success-default text-success-on-default hover:bg-success-muted"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
variant: "fill",
|
|
666
|
+
tone: "warning",
|
|
667
|
+
className: "bg-warning-default text-warning-on-default hover:bg-warning-muted"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
variant: "outline",
|
|
671
|
+
tone: "brand",
|
|
672
|
+
className: "border-brand-border text-brand-default hover:bg-brand-subtle hover:text-brand-on-container"
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
variant: "outline",
|
|
676
|
+
tone: "accent",
|
|
677
|
+
className: "border-accent-border text-accent-default hover:bg-accent-subtle hover:text-accent-on-container"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
variant: "outline",
|
|
681
|
+
tone: "neutral",
|
|
682
|
+
className: "border-neutral-border text-neutral-default hover:bg-neutral-subtle hover:text-neutral-on-container"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
variant: "outline",
|
|
686
|
+
tone: "error",
|
|
687
|
+
className: "border-error-border text-error-default hover:bg-error-subtle hover:text-error-on-container"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
variant: "outline",
|
|
691
|
+
tone: "info",
|
|
692
|
+
className: "border-info-border text-info-default hover:bg-info-subtle hover:text-info-on-container"
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
variant: "outline",
|
|
696
|
+
tone: "success",
|
|
697
|
+
className: "border-success-border text-success-default hover:bg-success-subtle hover:text-success-on-container"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
variant: "outline",
|
|
701
|
+
tone: "warning",
|
|
702
|
+
className: "border-warning-border text-warning-default hover:bg-warning-subtle hover:text-warning-on-container"
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
variant: "ghost",
|
|
706
|
+
tone: "brand",
|
|
707
|
+
className: "text-brand-default hover:bg-brand-subtle hover:text-brand-on-container"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
variant: "ghost",
|
|
711
|
+
tone: "accent",
|
|
712
|
+
className: "text-accent-default hover:bg-accent-subtle hover:text-accent-on-container"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
variant: "ghost",
|
|
716
|
+
tone: "neutral",
|
|
717
|
+
className: "text-neutral-default hover:bg-neutral-subtle hover:text-neutral-on-container"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
variant: "ghost",
|
|
721
|
+
tone: "error",
|
|
722
|
+
className: "text-error-default hover:bg-error-subtle hover:text-error-on-container"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
variant: "ghost",
|
|
726
|
+
tone: "info",
|
|
727
|
+
className: "text-info-default hover:bg-info-subtle hover:text-info-on-container"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
variant: "ghost",
|
|
731
|
+
tone: "success",
|
|
732
|
+
className: "text-success-default hover:bg-success-subtle hover:text-success-on-container"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
variant: "ghost",
|
|
736
|
+
tone: "warning",
|
|
737
|
+
className: "text-warning-default hover:bg-warning-subtle hover:text-warning-on-container"
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
variant: "soft",
|
|
741
|
+
tone: "brand",
|
|
742
|
+
className: "border-brand-border bg-brand-container text-brand-on-container hover:border-brand-border-strong hover:bg-brand-container-high"
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
variant: "soft",
|
|
746
|
+
tone: "accent",
|
|
747
|
+
className: "border-accent-border bg-accent-container text-accent-on-container hover:border-accent-border-strong hover:bg-accent-container-high"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
variant: "soft",
|
|
751
|
+
tone: "neutral",
|
|
752
|
+
className: "border-neutral-border bg-neutral-container text-neutral-on-container hover:border-neutral-border-strong hover:bg-neutral-container-high"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
variant: "soft",
|
|
756
|
+
tone: "error",
|
|
757
|
+
className: "border-error-border bg-error-container text-error-on-container hover:border-error-border-strong hover:bg-error-container-high"
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
variant: "soft",
|
|
761
|
+
tone: "info",
|
|
762
|
+
className: "border-info-border bg-info-container text-info-on-container hover:border-info-border-strong hover:bg-info-container-high"
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
variant: "soft",
|
|
766
|
+
tone: "success",
|
|
767
|
+
className: "border-success-border bg-success-container text-success-on-container hover:border-success-border-strong hover:bg-success-container-high"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
variant: "soft",
|
|
771
|
+
tone: "warning",
|
|
772
|
+
className: "border-warning-border bg-warning-container text-warning-on-container hover:border-warning-border-strong hover:bg-warning-container-high"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
variant: "elevated",
|
|
776
|
+
tone: "brand",
|
|
777
|
+
className: "bg-brand-container text-brand-on-container not-active:hover:bg-brand-container-high"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
variant: "elevated",
|
|
781
|
+
tone: "accent",
|
|
782
|
+
className: "bg-accent-container text-accent-on-container not-active:hover:bg-accent-container-high"
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
variant: "elevated",
|
|
786
|
+
tone: "neutral",
|
|
787
|
+
className: "bg-surface-2 text-on-surface not-active:hover:bg-surface-3"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
variant: "elevated",
|
|
791
|
+
tone: "error",
|
|
792
|
+
className: "bg-error-container text-error-on-container not-active:hover:bg-error-container-high"
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
variant: "elevated",
|
|
796
|
+
tone: "info",
|
|
797
|
+
className: "bg-info-container text-info-on-container not-active:hover:bg-info-container-high"
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
variant: "elevated",
|
|
801
|
+
tone: "success",
|
|
802
|
+
className: "bg-success-container text-success-on-container not-active:hover:bg-success-container-high"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
variant: "elevated",
|
|
806
|
+
tone: "warning",
|
|
807
|
+
className: "bg-warning-container text-warning-on-container not-active:hover:bg-warning-container-high"
|
|
808
|
+
}
|
|
809
|
+
]
|
|
810
|
+
}), kt = ({ tone: e, variant: n, size: r, className: i, children: a, ...o }) => /* @__PURE__ */ m(Dt, {
|
|
811
|
+
"data-size": r,
|
|
812
|
+
className: t(Ot({
|
|
813
|
+
tone: e,
|
|
814
|
+
variant: n,
|
|
815
|
+
size: r,
|
|
816
|
+
className: i
|
|
817
|
+
})),
|
|
818
|
+
...o,
|
|
819
|
+
children: a
|
|
820
|
+
}), At = /* @__PURE__ */ new Map([
|
|
821
|
+
["bold", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z" }))],
|
|
822
|
+
["duotone", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", {
|
|
823
|
+
d: "M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",
|
|
824
|
+
opacity: "0.2"
|
|
825
|
+
}), /* @__PURE__ */ n.createElement("path", { d: "M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z" }))],
|
|
826
|
+
["fill", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z" }))],
|
|
827
|
+
["light", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z" }))],
|
|
828
|
+
["regular", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z" }))],
|
|
829
|
+
["thin", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z" }))]
|
|
830
|
+
]), jt = /* @__PURE__ */ new Map([
|
|
831
|
+
["bold", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M168.49,104.49,145,128l23.52,23.51a12,12,0,0,1-17,17L128,145l-23.51,23.52a12,12,0,0,1-17-17L111,128,87.51,104.49a12,12,0,0,1,17-17L128,111l23.51-23.52a12,12,0,0,1,17,17ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z" }))],
|
|
832
|
+
["duotone", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", {
|
|
833
|
+
d: "M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",
|
|
834
|
+
opacity: "0.2"
|
|
835
|
+
}), /* @__PURE__ */ n.createElement("path", { d: "M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z" }))],
|
|
836
|
+
["fill", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))],
|
|
837
|
+
["light", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M164.24,100.24,136.48,128l27.76,27.76a6,6,0,1,1-8.48,8.48L128,136.48l-27.76,27.76a6,6,0,0,1-8.48-8.48L119.52,128,91.76,100.24a6,6,0,0,1,8.48-8.48L128,119.52l27.76-27.76a6,6,0,0,1,8.48,8.48ZM230,128A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z" }))],
|
|
838
|
+
["regular", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z" }))],
|
|
839
|
+
["thin", /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M162.83,98.83,133.66,128l29.17,29.17a4,4,0,0,1-5.66,5.66L128,133.66,98.83,162.83a4,4,0,0,1-5.66-5.66L122.34,128,93.17,98.83a4,4,0,0,1,5.66-5.66L128,122.34l29.17-29.17a4,4,0,1,1,5.66,5.66ZM228,128A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z" }))]
|
|
840
|
+
]), Mt = r({
|
|
841
|
+
color: "currentColor",
|
|
842
|
+
size: "1em",
|
|
843
|
+
weight: "regular",
|
|
844
|
+
mirrored: !1
|
|
845
|
+
}), k = n.forwardRef((e, t) => {
|
|
846
|
+
let { alt: r, color: i, size: a, weight: o, mirrored: s, children: c, weights: l, ...u } = e, { color: d = "currentColor", size: f, weight: p = "regular", mirrored: m = !1, ...h } = n.useContext(Mt);
|
|
847
|
+
return /* @__PURE__ */ n.createElement("svg", {
|
|
848
|
+
ref: t,
|
|
849
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
850
|
+
width: a ?? f,
|
|
851
|
+
height: a ?? f,
|
|
852
|
+
fill: i ?? d,
|
|
853
|
+
viewBox: "0 0 256 256",
|
|
854
|
+
transform: s || m ? "scale(-1, 1)" : void 0,
|
|
855
|
+
...h,
|
|
856
|
+
...u
|
|
857
|
+
}, !!r && /* @__PURE__ */ n.createElement("title", null, r), c, l.get(o ?? p));
|
|
858
|
+
});
|
|
859
|
+
k.displayName = "IconBase";
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region node_modules/.pnpm/@phosphor-icons+react@2.1.1_b81d301829b4c0fa768641d7d4577f50/node_modules/@phosphor-icons/react/dist/csr/CircleNotch.es.js
|
|
862
|
+
var Nt = n.forwardRef((e, t) => /* @__PURE__ */ n.createElement(k, {
|
|
863
|
+
ref: t,
|
|
864
|
+
...e,
|
|
865
|
+
weights: At
|
|
866
|
+
}));
|
|
867
|
+
Nt.displayName = "CircleNotchIcon";
|
|
868
|
+
//#endregion
|
|
869
|
+
//#region node_modules/.pnpm/@phosphor-icons+react@2.1.1_b81d301829b4c0fa768641d7d4577f50/node_modules/@phosphor-icons/react/dist/csr/XCircle.es.js
|
|
870
|
+
var Pt = n.forwardRef((e, t) => /* @__PURE__ */ n.createElement(k, {
|
|
871
|
+
ref: t,
|
|
872
|
+
...e,
|
|
873
|
+
weights: jt
|
|
874
|
+
}));
|
|
875
|
+
Pt.displayName = "XCircleIcon";
|
|
876
|
+
//#endregion
|
|
877
|
+
//#region node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/alien.js
|
|
878
|
+
var A = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Mutable = 1] = "Mutable", e[e.Watching = 2] = "Watching", e[e.RecursedCheck = 4] = "RecursedCheck", e[e.Recursed = 8] = "Recursed", e[e.Dirty = 16] = "Dirty", e[e.Pending = 32] = "Pending", e))(A || {});
|
|
879
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
880
|
+
function Ft({ update: e, notify: t, unwatched: n }) {
|
|
881
|
+
return {
|
|
882
|
+
link: r,
|
|
883
|
+
unlink: i,
|
|
884
|
+
propagate: a,
|
|
885
|
+
checkDirty: o,
|
|
886
|
+
shallowPropagate: s
|
|
887
|
+
};
|
|
888
|
+
function r(e, t, n) {
|
|
889
|
+
let r = t.depsTail;
|
|
890
|
+
if (r !== void 0 && r.dep === e) return;
|
|
891
|
+
let i = r === void 0 ? t.deps : r.nextDep;
|
|
892
|
+
if (i !== void 0 && i.dep === e) {
|
|
893
|
+
i.version = n, t.depsTail = i;
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
let a = e.subsTail;
|
|
897
|
+
if (a !== void 0 && a.version === n && a.sub === t) return;
|
|
898
|
+
let o = t.depsTail = e.subsTail = {
|
|
899
|
+
version: n,
|
|
900
|
+
dep: e,
|
|
901
|
+
sub: t,
|
|
902
|
+
prevDep: r,
|
|
903
|
+
nextDep: i,
|
|
904
|
+
prevSub: a,
|
|
905
|
+
nextSub: void 0
|
|
906
|
+
};
|
|
907
|
+
i !== void 0 && (i.prevDep = o), r === void 0 ? t.deps = o : r.nextDep = o, a === void 0 ? e.subs = o : a.nextSub = o;
|
|
908
|
+
}
|
|
909
|
+
function i(e, t = e.sub) {
|
|
910
|
+
let r = e.dep, i = e.prevDep, a = e.nextDep, o = e.nextSub, s = e.prevSub;
|
|
911
|
+
return a === void 0 ? t.depsTail = i : a.prevDep = i, i === void 0 ? t.deps = a : i.nextDep = a, o === void 0 ? r.subsTail = s : o.prevSub = s, s === void 0 ? (r.subs = o) === void 0 && n(r) : s.nextSub = o, a;
|
|
912
|
+
}
|
|
913
|
+
function a(e) {
|
|
914
|
+
let n = e.nextSub, r;
|
|
915
|
+
top: do {
|
|
916
|
+
let i = e.sub, a = i.flags;
|
|
917
|
+
if (a & 60 ? a & 12 ? a & 4 ? !(a & 48) && c(e, i) ? (i.flags = a | 40, a &= 1) : a = 0 : i.flags = a & -9 | 32 : a = 0 : i.flags = a | 32, a & 2 && t(i), a & 1) {
|
|
918
|
+
let t = i.subs;
|
|
919
|
+
if (t !== void 0) {
|
|
920
|
+
let i = (e = t).nextSub;
|
|
921
|
+
i !== void 0 && (r = {
|
|
922
|
+
value: n,
|
|
923
|
+
prev: r
|
|
924
|
+
}, n = i);
|
|
925
|
+
continue;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
if ((e = n) !== void 0) {
|
|
929
|
+
n = e.nextSub;
|
|
930
|
+
continue;
|
|
931
|
+
}
|
|
932
|
+
for (; r !== void 0;) if (e = r.value, r = r.prev, e !== void 0) {
|
|
933
|
+
n = e.nextSub;
|
|
934
|
+
continue top;
|
|
935
|
+
}
|
|
936
|
+
break;
|
|
937
|
+
} while (!0);
|
|
938
|
+
}
|
|
939
|
+
function o(t, n) {
|
|
940
|
+
let r, i = 0, a = !1;
|
|
941
|
+
top: do {
|
|
942
|
+
let o = t.dep, c = o.flags;
|
|
943
|
+
if (n.flags & 16) a = !0;
|
|
944
|
+
else if ((c & 17) == 17) {
|
|
945
|
+
if (e(o)) {
|
|
946
|
+
let e = o.subs;
|
|
947
|
+
e.nextSub !== void 0 && s(e), a = !0;
|
|
948
|
+
}
|
|
949
|
+
} else if ((c & 33) == 33) {
|
|
950
|
+
(t.nextSub !== void 0 || t.prevSub !== void 0) && (r = {
|
|
951
|
+
value: t,
|
|
952
|
+
prev: r
|
|
953
|
+
}), t = o.deps, n = o, ++i;
|
|
954
|
+
continue;
|
|
955
|
+
}
|
|
956
|
+
if (!a) {
|
|
957
|
+
let e = t.nextDep;
|
|
958
|
+
if (e !== void 0) {
|
|
959
|
+
t = e;
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
for (; i--;) {
|
|
964
|
+
let i = n.subs, o = i.nextSub !== void 0;
|
|
965
|
+
if (o ? (t = r.value, r = r.prev) : t = i, a) {
|
|
966
|
+
if (e(n)) {
|
|
967
|
+
o && s(i), n = t.sub;
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
a = !1;
|
|
971
|
+
} else n.flags &= -33;
|
|
972
|
+
n = t.sub;
|
|
973
|
+
let c = t.nextDep;
|
|
974
|
+
if (c !== void 0) {
|
|
975
|
+
t = c;
|
|
976
|
+
continue top;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
return a;
|
|
980
|
+
} while (!0);
|
|
981
|
+
}
|
|
982
|
+
function s(e) {
|
|
983
|
+
do {
|
|
984
|
+
let n = e.sub, r = n.flags;
|
|
985
|
+
(r & 48) == 32 && (n.flags = r | 16, (r & 6) == 2 && t(n));
|
|
986
|
+
} while ((e = e.nextSub) !== void 0);
|
|
987
|
+
}
|
|
988
|
+
function c(e, t) {
|
|
989
|
+
let n = t.depsTail;
|
|
990
|
+
for (; n !== void 0;) {
|
|
991
|
+
if (n === e) return !0;
|
|
992
|
+
n = n.prevDep;
|
|
993
|
+
}
|
|
994
|
+
return !1;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
//#endregion
|
|
998
|
+
//#region node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/atom.js
|
|
999
|
+
function It(e, t, n) {
|
|
1000
|
+
let r = typeof e == "object", i = r ? e : void 0;
|
|
1001
|
+
return {
|
|
1002
|
+
next: (r ? e.next : e)?.bind(i),
|
|
1003
|
+
error: (r ? e.error : t)?.bind(i),
|
|
1004
|
+
complete: (r ? e.complete : n)?.bind(i)
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
var Lt = [], j = 0, { link: Rt, unlink: zt, propagate: Bt, checkDirty: Vt, shallowPropagate: Ht } = /* @__PURE__ */ Ft({
|
|
1008
|
+
update(e) {
|
|
1009
|
+
return e._update();
|
|
1010
|
+
},
|
|
1011
|
+
notify(e) {
|
|
1012
|
+
Lt[Wt++] = e, e.flags &= ~A.Watching;
|
|
1013
|
+
},
|
|
1014
|
+
unwatched(e) {
|
|
1015
|
+
e.depsTail !== void 0 && (e.depsTail = void 0, e.flags = A.Mutable | A.Dirty, Kt(e));
|
|
1016
|
+
}
|
|
1017
|
+
}), Ut = 0, Wt = 0, M, Gt = 0;
|
|
1018
|
+
function N(e) {
|
|
1019
|
+
try {
|
|
1020
|
+
++Gt, e();
|
|
1021
|
+
} finally {
|
|
1022
|
+
--Gt || qt();
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
function Kt(e) {
|
|
1026
|
+
let t = e.depsTail, n = t === void 0 ? e.deps : t.nextDep;
|
|
1027
|
+
for (; n !== void 0;) n = zt(n, e);
|
|
1028
|
+
}
|
|
1029
|
+
function qt() {
|
|
1030
|
+
if (!(Gt > 0)) {
|
|
1031
|
+
for (; Ut < Wt;) {
|
|
1032
|
+
let e = Lt[Ut];
|
|
1033
|
+
Lt[Ut++] = void 0, e.notify();
|
|
1034
|
+
}
|
|
1035
|
+
Ut = 0, Wt = 0;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
function Jt(e, t) {
|
|
1039
|
+
let n = typeof e == "function", r = e, i = {
|
|
1040
|
+
_snapshot: n ? void 0 : e,
|
|
1041
|
+
subs: void 0,
|
|
1042
|
+
subsTail: void 0,
|
|
1043
|
+
deps: void 0,
|
|
1044
|
+
depsTail: void 0,
|
|
1045
|
+
flags: n ? A.None : A.Mutable,
|
|
1046
|
+
get() {
|
|
1047
|
+
return M !== void 0 && Rt(i, M, j), i._snapshot;
|
|
1048
|
+
},
|
|
1049
|
+
subscribe(e) {
|
|
1050
|
+
let t = It(e), n = { current: !1 }, r = Yt(() => {
|
|
1051
|
+
i.get(), n.current ? t.next?.(i._snapshot) : n.current = !0;
|
|
1052
|
+
});
|
|
1053
|
+
return { unsubscribe: () => {
|
|
1054
|
+
r.stop();
|
|
1055
|
+
} };
|
|
1056
|
+
},
|
|
1057
|
+
_update(e) {
|
|
1058
|
+
let a = M, o = t?.compare ?? Object.is;
|
|
1059
|
+
if (n) M = i, ++j, i.depsTail = void 0;
|
|
1060
|
+
else if (e === void 0) return !1;
|
|
1061
|
+
n && (i.flags = A.Mutable | A.RecursedCheck);
|
|
1062
|
+
try {
|
|
1063
|
+
let t = i._snapshot, a = typeof e == "function" ? e(t) : e === void 0 && n ? r(t) : e;
|
|
1064
|
+
return t === void 0 || !o(t, a) ? (i._snapshot = a, !0) : !1;
|
|
1065
|
+
} finally {
|
|
1066
|
+
M = a, n && (i.flags &= ~A.RecursedCheck), Kt(i);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
return n ? (i.flags = A.Mutable | A.Dirty, i.get = function() {
|
|
1071
|
+
let e = i.flags;
|
|
1072
|
+
if (e & A.Dirty || e & A.Pending && Vt(i.deps, i)) {
|
|
1073
|
+
if (i._update()) {
|
|
1074
|
+
let e = i.subs;
|
|
1075
|
+
e !== void 0 && Ht(e);
|
|
1076
|
+
}
|
|
1077
|
+
} else e & A.Pending && (i.flags = e & ~A.Pending);
|
|
1078
|
+
return M !== void 0 && Rt(i, M, j), i._snapshot;
|
|
1079
|
+
}) : i.set = function(e) {
|
|
1080
|
+
if (i._update(e)) {
|
|
1081
|
+
let e = i.subs;
|
|
1082
|
+
e !== void 0 && (Bt(e), Ht(e), qt());
|
|
1083
|
+
}
|
|
1084
|
+
}, i;
|
|
1085
|
+
}
|
|
1086
|
+
function Yt(e) {
|
|
1087
|
+
let t = () => {
|
|
1088
|
+
let t = M;
|
|
1089
|
+
M = n, ++j, n.depsTail = void 0, n.flags = A.Watching | A.RecursedCheck;
|
|
1090
|
+
try {
|
|
1091
|
+
return e();
|
|
1092
|
+
} finally {
|
|
1093
|
+
M = t, n.flags &= ~A.RecursedCheck, Kt(n);
|
|
1094
|
+
}
|
|
1095
|
+
}, n = {
|
|
1096
|
+
deps: void 0,
|
|
1097
|
+
depsTail: void 0,
|
|
1098
|
+
subs: void 0,
|
|
1099
|
+
subsTail: void 0,
|
|
1100
|
+
flags: A.Watching | A.RecursedCheck,
|
|
1101
|
+
notify() {
|
|
1102
|
+
let e = this.flags;
|
|
1103
|
+
e & A.Dirty || e & A.Pending && Vt(this.deps, this) ? t() : this.flags = A.Watching;
|
|
1104
|
+
},
|
|
1105
|
+
stop() {
|
|
1106
|
+
this.flags = A.None, this.depsTail = void 0, Kt(this);
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
return t(), n;
|
|
1110
|
+
}
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region node_modules/.pnpm/@tanstack+store@0.9.3/node_modules/@tanstack/store/dist/esm/store.js
|
|
1113
|
+
var Xt = class {
|
|
1114
|
+
constructor(e) {
|
|
1115
|
+
this.atom = Jt(e);
|
|
1116
|
+
}
|
|
1117
|
+
setState(e) {
|
|
1118
|
+
this.atom.set(e);
|
|
1119
|
+
}
|
|
1120
|
+
get state() {
|
|
1121
|
+
return this.atom.get();
|
|
1122
|
+
}
|
|
1123
|
+
get() {
|
|
1124
|
+
return this.state;
|
|
1125
|
+
}
|
|
1126
|
+
subscribe(e) {
|
|
1127
|
+
return this.atom.subscribe(It(e));
|
|
1128
|
+
}
|
|
1129
|
+
}, Zt = class {
|
|
1130
|
+
constructor(e) {
|
|
1131
|
+
this.atom = Jt(e);
|
|
1132
|
+
}
|
|
1133
|
+
get state() {
|
|
1134
|
+
return this.atom.get();
|
|
1135
|
+
}
|
|
1136
|
+
get() {
|
|
1137
|
+
return this.state;
|
|
1138
|
+
}
|
|
1139
|
+
subscribe(e) {
|
|
1140
|
+
return this.atom.subscribe(It(e));
|
|
1141
|
+
}
|
|
1142
|
+
};
|
|
1143
|
+
function P(e) {
|
|
1144
|
+
return typeof e == "function" ? new Zt(e) : new Xt(e);
|
|
1145
|
+
}
|
|
1146
|
+
//#endregion
|
|
1147
|
+
//#region node_modules/.pnpm/@tanstack+pacer-lite@0.1.1/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js
|
|
1148
|
+
var Qt = class {
|
|
1149
|
+
constructor(e, t) {
|
|
1150
|
+
this.fn = e, this.options = t, this.lastExecutionTime = 0, this.isPending = !1, this.maybeExecute = (...e) => {
|
|
1151
|
+
let t = Date.now() - this.lastExecutionTime;
|
|
1152
|
+
if (this.options.leading && t >= this.options.wait) this.execute(...e);
|
|
1153
|
+
else if (this.lastArgs = e, !this.timeoutId && this.options.trailing) {
|
|
1154
|
+
let e = this.options.wait - t;
|
|
1155
|
+
this.isPending = !0, this.timeoutId = setTimeout(() => {
|
|
1156
|
+
this.lastArgs !== void 0 && this.execute(...this.lastArgs);
|
|
1157
|
+
}, e);
|
|
1158
|
+
}
|
|
1159
|
+
}, this.execute = (...e) => {
|
|
1160
|
+
this.fn(...e), this.options.onExecute?.(e, this), this.lastExecutionTime = Date.now(), this.clearTimeout(), this.lastArgs = void 0, this.isPending = !1;
|
|
1161
|
+
}, this.flush = () => {
|
|
1162
|
+
this.isPending && this.lastArgs && this.execute(...this.lastArgs);
|
|
1163
|
+
}, this.cancel = () => {
|
|
1164
|
+
this.clearTimeout(), this.lastArgs = void 0, this.isPending = !1;
|
|
1165
|
+
}, this.clearTimeout = () => {
|
|
1166
|
+
this.timeoutId &&= (clearTimeout(this.timeoutId), void 0);
|
|
1167
|
+
}, this.options.leading === void 0 && this.options.trailing === void 0 && (this.options.leading = !0, this.options.trailing = !0);
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
function $t(e, t) {
|
|
1171
|
+
return new Qt(e, t).maybeExecute;
|
|
1172
|
+
}
|
|
1173
|
+
//#endregion
|
|
1174
|
+
//#region node_modules/.pnpm/@tanstack+devtools-event-client@0.4.3/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js
|
|
1175
|
+
var en = class {
|
|
1176
|
+
#e = !0;
|
|
1177
|
+
#t;
|
|
1178
|
+
#n;
|
|
1179
|
+
#r;
|
|
1180
|
+
#i;
|
|
1181
|
+
#a;
|
|
1182
|
+
#o;
|
|
1183
|
+
#s;
|
|
1184
|
+
#c = 0;
|
|
1185
|
+
#l = 5;
|
|
1186
|
+
#u = !1;
|
|
1187
|
+
#d = !1;
|
|
1188
|
+
#f = null;
|
|
1189
|
+
#p = () => {
|
|
1190
|
+
this.debugLog("Connected to event bus"), this.#a = !0, this.#u = !1, this.debugLog("Emitting queued events", this.#i), this.#i.forEach((e) => this.emitEventToBus(e)), this.#i = [], this.stopConnectLoop(), this.#n().removeEventListener("tanstack-connect-success", this.#p);
|
|
1191
|
+
};
|
|
1192
|
+
#m = () => {
|
|
1193
|
+
if (this.#c < this.#l) {
|
|
1194
|
+
this.#c++, this.dispatchCustomEvent("tanstack-connect", {});
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
this.#n().removeEventListener("tanstack-connect", this.#m), this.#d = !0, this.debugLog("Max retries reached, giving up on connection"), this.stopConnectLoop();
|
|
1198
|
+
};
|
|
1199
|
+
#h = () => {
|
|
1200
|
+
this.#u || (this.#u = !0, this.#n().addEventListener("tanstack-connect-success", this.#p), this.#m());
|
|
1201
|
+
};
|
|
1202
|
+
constructor({ pluginId: e, debug: t = !1, enabled: n = !0, reconnectEveryMs: r = 300 }) {
|
|
1203
|
+
this.#t = e, this.#e = n, this.#n = this.getGlobalTarget, this.#r = t, this.debugLog(" Initializing event subscription for plugin", this.#t), this.#i = [], this.#a = !1, this.#d = !1, this.#o = null, this.#s = r;
|
|
1204
|
+
}
|
|
1205
|
+
startConnectLoop() {
|
|
1206
|
+
this.#o !== null || this.#a || (this.debugLog(`Starting connect loop (every ${this.#s}ms)`), this.#o = setInterval(this.#m, this.#s));
|
|
1207
|
+
}
|
|
1208
|
+
stopConnectLoop() {
|
|
1209
|
+
this.#u = !1, this.#o !== null && (clearInterval(this.#o), this.#o = null, this.#i = [], this.debugLog("Stopped connect loop"));
|
|
1210
|
+
}
|
|
1211
|
+
debugLog(...e) {
|
|
1212
|
+
this.#r && console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`, ...e);
|
|
1213
|
+
}
|
|
1214
|
+
getGlobalTarget() {
|
|
1215
|
+
if (typeof globalThis < "u" && globalThis.__TANSTACK_EVENT_TARGET__) return this.debugLog("Using global event target"), globalThis.__TANSTACK_EVENT_TARGET__;
|
|
1216
|
+
if (typeof window < "u" && window.addEventListener !== void 0) return this.debugLog("Using window as event target"), window;
|
|
1217
|
+
let e = typeof EventTarget < "u" ? new EventTarget() : void 0;
|
|
1218
|
+
return e === void 0 || e.addEventListener === void 0 ? (this.debugLog("No event mechanism available, running in non-web environment"), {
|
|
1219
|
+
addEventListener: () => {},
|
|
1220
|
+
removeEventListener: () => {},
|
|
1221
|
+
dispatchEvent: () => !1
|
|
1222
|
+
}) : (this.debugLog("Using new EventTarget as fallback"), e);
|
|
1223
|
+
}
|
|
1224
|
+
getPluginId() {
|
|
1225
|
+
return this.#t;
|
|
1226
|
+
}
|
|
1227
|
+
dispatchCustomEventShim(e, t) {
|
|
1228
|
+
try {
|
|
1229
|
+
let n = new Event(e, { detail: t });
|
|
1230
|
+
this.#n().dispatchEvent(n);
|
|
1231
|
+
} catch {
|
|
1232
|
+
this.debugLog("Failed to dispatch shim event");
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
dispatchCustomEvent(e, t) {
|
|
1236
|
+
try {
|
|
1237
|
+
this.#n().dispatchEvent(new CustomEvent(e, { detail: t }));
|
|
1238
|
+
} catch {
|
|
1239
|
+
this.dispatchCustomEventShim(e, t);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
emitEventToBus(e) {
|
|
1243
|
+
this.debugLog("Emitting event to client bus", e), this.dispatchCustomEvent("tanstack-dispatch-event", e);
|
|
1244
|
+
}
|
|
1245
|
+
createEventPayload(e, t) {
|
|
1246
|
+
return {
|
|
1247
|
+
type: `${this.#t}:${e}`,
|
|
1248
|
+
payload: t,
|
|
1249
|
+
pluginId: this.#t
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
emit(e, t) {
|
|
1253
|
+
if (!this.#e) {
|
|
1254
|
+
this.debugLog("Event bus client is disabled, not emitting event", e, t);
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
if (this.#f && (this.debugLog("Emitting event to internal event target", e, t), this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`, { detail: this.createEventPayload(e, t) }))), this.#d) {
|
|
1258
|
+
this.debugLog("Previously failed to connect, not emitting to bus");
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
if (!this.#a) {
|
|
1262
|
+
this.debugLog("Bus not available, will be pushed as soon as connected"), this.#i.push(this.createEventPayload(e, t)), typeof CustomEvent < "u" && !this.#u && (this.#h(), this.startConnectLoop());
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
return this.emitEventToBus(this.createEventPayload(e, t));
|
|
1266
|
+
}
|
|
1267
|
+
on(e, t, n) {
|
|
1268
|
+
let r = n?.withEventTarget ?? !1, i = `${this.#t}:${e}`;
|
|
1269
|
+
if (r && (this.#f ||= new EventTarget(), this.#f.addEventListener(i, (e) => {
|
|
1270
|
+
t(e.detail);
|
|
1271
|
+
})), !this.#e) return this.debugLog("Event bus client is disabled, not registering event", i), () => {};
|
|
1272
|
+
let a = (e) => {
|
|
1273
|
+
this.debugLog("Received event from bus", e.detail), t(e.detail);
|
|
1274
|
+
};
|
|
1275
|
+
return this.#n().addEventListener(i, a), this.debugLog("Registered event to bus", i), () => {
|
|
1276
|
+
r && this.#f?.removeEventListener(i, a), this.#n().removeEventListener(i, a);
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
onAll(e) {
|
|
1280
|
+
if (!this.#e) return this.debugLog("Event bus client is disabled, not registering event"), () => {};
|
|
1281
|
+
let t = (t) => {
|
|
1282
|
+
let n = t.detail;
|
|
1283
|
+
e(n);
|
|
1284
|
+
};
|
|
1285
|
+
return this.#n().addEventListener("tanstack-devtools-global", t), () => this.#n().removeEventListener("tanstack-devtools-global", t);
|
|
1286
|
+
}
|
|
1287
|
+
onAllPluginEvents(e) {
|
|
1288
|
+
if (!this.#e) return this.debugLog("Event bus client is disabled, not registering event"), () => {};
|
|
1289
|
+
let t = (t) => {
|
|
1290
|
+
let n = t.detail;
|
|
1291
|
+
this.#t && n.pluginId !== this.#t || e(n);
|
|
1292
|
+
};
|
|
1293
|
+
return this.#n().addEventListener("tanstack-devtools-global", t), () => this.#n().removeEventListener("tanstack-devtools-global", t);
|
|
1294
|
+
}
|
|
1295
|
+
}, F = new class extends en {
|
|
1296
|
+
constructor() {
|
|
1297
|
+
super({
|
|
1298
|
+
pluginId: "form-devtools",
|
|
1299
|
+
reconnectEveryMs: 1e3
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
}();
|
|
1303
|
+
//#endregion
|
|
1304
|
+
//#region node_modules/.pnpm/@tanstack+form-core@1.29.1/node_modules/@tanstack/form-core/dist/esm/utils.js
|
|
1305
|
+
function I(e, t) {
|
|
1306
|
+
return typeof e == "function" ? e(t) : e;
|
|
1307
|
+
}
|
|
1308
|
+
function L(e, t) {
|
|
1309
|
+
return B(t).reduce((e, t) => {
|
|
1310
|
+
if (e === null) return null;
|
|
1311
|
+
if (e !== void 0) return e[t];
|
|
1312
|
+
}, e);
|
|
1313
|
+
}
|
|
1314
|
+
function R(e, t, n) {
|
|
1315
|
+
let r = B(t);
|
|
1316
|
+
function i(e) {
|
|
1317
|
+
if (!r.length) return I(n, e);
|
|
1318
|
+
let t = r.shift();
|
|
1319
|
+
if (typeof t == "string" || typeof t == "number" && !Array.isArray(e)) return typeof e == "object" ? (e === null && (e = {}), {
|
|
1320
|
+
...e,
|
|
1321
|
+
[t]: i(e[t])
|
|
1322
|
+
}) : { [t]: i() };
|
|
1323
|
+
if (Array.isArray(e) && typeof t == "number") {
|
|
1324
|
+
let n = e.slice(0, t);
|
|
1325
|
+
return [
|
|
1326
|
+
...n.length ? n : Array(t),
|
|
1327
|
+
i(e[t]),
|
|
1328
|
+
...e.slice(t + 1)
|
|
1329
|
+
];
|
|
1330
|
+
}
|
|
1331
|
+
return [...Array(t), i()];
|
|
1332
|
+
}
|
|
1333
|
+
return i(e);
|
|
1334
|
+
}
|
|
1335
|
+
function tn(e, t) {
|
|
1336
|
+
let n = B(t);
|
|
1337
|
+
function r(e) {
|
|
1338
|
+
if (!e) return;
|
|
1339
|
+
if (n.length === 1) {
|
|
1340
|
+
let t = n[0];
|
|
1341
|
+
if (Array.isArray(e) && typeof t == "number") return e.filter((e, n) => n !== t);
|
|
1342
|
+
let { [t]: r, ...i } = e;
|
|
1343
|
+
return i;
|
|
1344
|
+
}
|
|
1345
|
+
let t = n.shift();
|
|
1346
|
+
if ((typeof t == "string" || typeof t == "number" && !Array.isArray(e)) && typeof e == "object") return {
|
|
1347
|
+
...e,
|
|
1348
|
+
[t]: r(e[t])
|
|
1349
|
+
};
|
|
1350
|
+
if (typeof t == "number" && Array.isArray(e)) {
|
|
1351
|
+
if (t >= e.length) return e;
|
|
1352
|
+
let n = e.slice(0, t);
|
|
1353
|
+
return [
|
|
1354
|
+
...n.length ? n : Array(t),
|
|
1355
|
+
r(e[t]),
|
|
1356
|
+
...e.slice(t + 1)
|
|
1357
|
+
];
|
|
1358
|
+
}
|
|
1359
|
+
throw Error("It seems we have created an infinite loop in deleteBy. ");
|
|
1360
|
+
}
|
|
1361
|
+
return r(e);
|
|
1362
|
+
}
|
|
1363
|
+
var nn = /^(\d+)$/gm, rn = /\.(\d+)(?=\.)/gm, an = /^(\d+)\./gm, on = /\.(\d+$)/gm, sn = /\.{2,}/gm, cn = "__int__", z = `${cn}$1`;
|
|
1364
|
+
function B(e) {
|
|
1365
|
+
if (Array.isArray(e)) return [...e];
|
|
1366
|
+
if (typeof e != "string") throw Error("Path must be a string.");
|
|
1367
|
+
return e.replace(/(^\[)|]/gm, "").replace(/\[/g, ".").replace(nn, z).replace(rn, `.${z}.`).replace(an, `${z}.`).replace(on, `.${z}`).replace(sn, ".").split(".").map((e) => {
|
|
1368
|
+
if (e.startsWith(cn)) {
|
|
1369
|
+
let t = e.substring(7), n = parseInt(t, 10);
|
|
1370
|
+
return String(n) === t ? n : t;
|
|
1371
|
+
}
|
|
1372
|
+
return e;
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
function ln(e, t) {
|
|
1376
|
+
return e.length === 0 ? t : t.length === 0 ? e : t.startsWith("[") || t.startsWith(".") ? e + t : `${e}.${t}`;
|
|
1377
|
+
}
|
|
1378
|
+
function un(e) {
|
|
1379
|
+
return !(Array.isArray(e) && e.length === 0);
|
|
1380
|
+
}
|
|
1381
|
+
function dn(e, t) {
|
|
1382
|
+
return t.validationLogic({
|
|
1383
|
+
form: t.form,
|
|
1384
|
+
validators: t.validators,
|
|
1385
|
+
event: {
|
|
1386
|
+
type: e,
|
|
1387
|
+
fieldName: t.fieldName,
|
|
1388
|
+
async: !1
|
|
1389
|
+
},
|
|
1390
|
+
runValidation: (e) => e.validators.filter(Boolean).map((e) => ({
|
|
1391
|
+
cause: e.cause,
|
|
1392
|
+
validate: e.fn
|
|
1393
|
+
}))
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
function fn(e, t) {
|
|
1397
|
+
let { asyncDebounceMs: n } = t, { onBlurAsyncDebounceMs: r, onChangeAsyncDebounceMs: i, onDynamicAsyncDebounceMs: a } = t.validators || {}, o = n ?? 0;
|
|
1398
|
+
return t.validationLogic({
|
|
1399
|
+
form: t.form,
|
|
1400
|
+
validators: t.validators,
|
|
1401
|
+
event: {
|
|
1402
|
+
type: e,
|
|
1403
|
+
fieldName: t.fieldName,
|
|
1404
|
+
async: !0
|
|
1405
|
+
},
|
|
1406
|
+
runValidation: (t) => t.validators.filter(Boolean).map((t) => {
|
|
1407
|
+
let n = t?.cause || e, s = o;
|
|
1408
|
+
switch (n) {
|
|
1409
|
+
case "change":
|
|
1410
|
+
s = i ?? o;
|
|
1411
|
+
break;
|
|
1412
|
+
case "blur":
|
|
1413
|
+
s = r ?? o;
|
|
1414
|
+
break;
|
|
1415
|
+
case "dynamic":
|
|
1416
|
+
s = a ?? o;
|
|
1417
|
+
break;
|
|
1418
|
+
case "submit":
|
|
1419
|
+
s = 0;
|
|
1420
|
+
break;
|
|
1421
|
+
}
|
|
1422
|
+
return e === "submit" && (s = 0), {
|
|
1423
|
+
cause: n,
|
|
1424
|
+
validate: t.fn,
|
|
1425
|
+
debounceMs: s
|
|
1426
|
+
};
|
|
1427
|
+
})
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
var V = (e) => !!e && typeof e == "object" && "fields" in e;
|
|
1431
|
+
function H(e, t) {
|
|
1432
|
+
if (Object.is(e, t)) return !0;
|
|
1433
|
+
if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
|
|
1434
|
+
if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
|
|
1435
|
+
if (e instanceof Map && t instanceof Map) {
|
|
1436
|
+
if (e.size !== t.size) return !1;
|
|
1437
|
+
for (let [n, r] of e) if (!t.has(n) || !Object.is(r, t.get(n))) return !1;
|
|
1438
|
+
return !0;
|
|
1439
|
+
}
|
|
1440
|
+
if (e instanceof Set && t instanceof Set) {
|
|
1441
|
+
if (e.size !== t.size) return !1;
|
|
1442
|
+
for (let n of e) if (!t.has(n)) return !1;
|
|
1443
|
+
return !0;
|
|
1444
|
+
}
|
|
1445
|
+
let n = Object.keys(e), r = Object.keys(t);
|
|
1446
|
+
if (n.length !== r.length) return !1;
|
|
1447
|
+
for (let i of n) if (!r.includes(i) || !H(e[i], t[i])) return !1;
|
|
1448
|
+
return !0;
|
|
1449
|
+
}
|
|
1450
|
+
var pn = ({ newFormValidatorError: e, isPreviousErrorFromFormValidator: t, previousErrorValue: n }) => e ? {
|
|
1451
|
+
newErrorValue: e,
|
|
1452
|
+
newSource: "form"
|
|
1453
|
+
} : t ? {
|
|
1454
|
+
newErrorValue: void 0,
|
|
1455
|
+
newSource: void 0
|
|
1456
|
+
} : n ? {
|
|
1457
|
+
newErrorValue: n,
|
|
1458
|
+
newSource: "field"
|
|
1459
|
+
} : {
|
|
1460
|
+
newErrorValue: void 0,
|
|
1461
|
+
newSource: void 0
|
|
1462
|
+
}, mn = ({ formLevelError: e, fieldLevelError: t }) => t ? {
|
|
1463
|
+
newErrorValue: t,
|
|
1464
|
+
newSource: "field"
|
|
1465
|
+
} : e ? {
|
|
1466
|
+
newErrorValue: e,
|
|
1467
|
+
newSource: "form"
|
|
1468
|
+
} : {
|
|
1469
|
+
newErrorValue: void 0,
|
|
1470
|
+
newSource: void 0
|
|
1471
|
+
};
|
|
1472
|
+
function U(e, t) {
|
|
1473
|
+
return e == null ? t : {
|
|
1474
|
+
...e,
|
|
1475
|
+
...t
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
for (var W = 256, G = [], K; W--;) G[W] = (W + 256).toString(16).substring(1);
|
|
1479
|
+
function hn() {
|
|
1480
|
+
let e = 0, t, n = "";
|
|
1481
|
+
if (!K || W + 16 > 256) {
|
|
1482
|
+
for (K = Array(256), e = 256; e--;) K[e] = 256 * Math.random() | 0;
|
|
1483
|
+
e = 0, W = 0;
|
|
1484
|
+
}
|
|
1485
|
+
for (; e < 16; e++) t = K[W + e], e === 6 ? n += G[t & 15 | 64] : e === 8 ? n += G[t & 63 | 128] : n += G[t], e & 1 && e > 1 && e < 11 && (n += "-");
|
|
1486
|
+
return W++, n;
|
|
1487
|
+
}
|
|
1488
|
+
var gn = $t((e) => F.emit("form-state", {
|
|
1489
|
+
id: e.formId,
|
|
1490
|
+
state: e.store.state
|
|
1491
|
+
}), { wait: 300 });
|
|
1492
|
+
function q(e) {
|
|
1493
|
+
if (typeof e != "object" || !e) return e;
|
|
1494
|
+
if (e instanceof Date) return new Date(e.getTime());
|
|
1495
|
+
if (Array.isArray(e)) {
|
|
1496
|
+
let t = [];
|
|
1497
|
+
for (let n = 0; n < e.length; n++) t[n] = q(e[n]);
|
|
1498
|
+
return t;
|
|
1499
|
+
}
|
|
1500
|
+
if (e instanceof Map) {
|
|
1501
|
+
let t = /* @__PURE__ */ new Map();
|
|
1502
|
+
return e.forEach((e, n) => {
|
|
1503
|
+
t.set(n, q(e));
|
|
1504
|
+
}), t;
|
|
1505
|
+
}
|
|
1506
|
+
if (e instanceof Set) {
|
|
1507
|
+
let t = /* @__PURE__ */ new Set();
|
|
1508
|
+
return e.forEach((e) => {
|
|
1509
|
+
t.add(q(e));
|
|
1510
|
+
}), t;
|
|
1511
|
+
}
|
|
1512
|
+
let t = {};
|
|
1513
|
+
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = q(e[n]));
|
|
1514
|
+
return t;
|
|
1515
|
+
}
|
|
1516
|
+
//#endregion
|
|
1517
|
+
//#region node_modules/.pnpm/@tanstack+form-core@1.29.1/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js
|
|
1518
|
+
var J = (e) => {
|
|
1519
|
+
if (!e.validators) return e.runValidation({
|
|
1520
|
+
validators: [],
|
|
1521
|
+
form: e.form
|
|
1522
|
+
});
|
|
1523
|
+
let t = e.event.async, n = t ? void 0 : {
|
|
1524
|
+
fn: e.validators.onMount,
|
|
1525
|
+
cause: "mount"
|
|
1526
|
+
}, r = {
|
|
1527
|
+
fn: t ? e.validators.onChangeAsync : e.validators.onChange,
|
|
1528
|
+
cause: "change"
|
|
1529
|
+
}, i = {
|
|
1530
|
+
fn: t ? e.validators.onBlurAsync : e.validators.onBlur,
|
|
1531
|
+
cause: "blur"
|
|
1532
|
+
}, a = {
|
|
1533
|
+
fn: t ? e.validators.onSubmitAsync : e.validators.onSubmit,
|
|
1534
|
+
cause: "submit"
|
|
1535
|
+
}, o = t ? void 0 : {
|
|
1536
|
+
fn: () => void 0,
|
|
1537
|
+
cause: "server"
|
|
1538
|
+
};
|
|
1539
|
+
switch (e.event.type) {
|
|
1540
|
+
case "mount": return e.runValidation({
|
|
1541
|
+
validators: [n],
|
|
1542
|
+
form: e.form
|
|
1543
|
+
});
|
|
1544
|
+
case "submit": return e.runValidation({
|
|
1545
|
+
validators: [
|
|
1546
|
+
r,
|
|
1547
|
+
i,
|
|
1548
|
+
a,
|
|
1549
|
+
o
|
|
1550
|
+
],
|
|
1551
|
+
form: e.form
|
|
1552
|
+
});
|
|
1553
|
+
case "server": return e.runValidation({
|
|
1554
|
+
validators: [],
|
|
1555
|
+
form: e.form
|
|
1556
|
+
});
|
|
1557
|
+
case "blur": return e.runValidation({
|
|
1558
|
+
validators: [i, o],
|
|
1559
|
+
form: e.form
|
|
1560
|
+
});
|
|
1561
|
+
case "change": return e.runValidation({
|
|
1562
|
+
validators: [r, o],
|
|
1563
|
+
form: e.form
|
|
1564
|
+
});
|
|
1565
|
+
default: throw Error(`Unknown validation event type: ${e.event.type}`);
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
//#endregion
|
|
1569
|
+
//#region node_modules/.pnpm/@tanstack+form-core@1.29.1/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js
|
|
1570
|
+
function _n(e, t) {
|
|
1571
|
+
let n = /* @__PURE__ */ new Map();
|
|
1572
|
+
for (let r of e) {
|
|
1573
|
+
let e = r.path ?? [], i = t, a = "";
|
|
1574
|
+
for (let t = 0; t < e.length; t++) {
|
|
1575
|
+
let n = e[t];
|
|
1576
|
+
if (n === void 0) continue;
|
|
1577
|
+
let r = typeof n == "object" ? n.key : n, o = Number(r);
|
|
1578
|
+
Array.isArray(i) && !Number.isNaN(o) ? a += `[${o}]` : a += (t > 0 ? "." : "") + String(r), i = typeof i == "object" && i ? i[r] : void 0;
|
|
1579
|
+
}
|
|
1580
|
+
n.set(a, (n.get(a) ?? []).concat(r));
|
|
1581
|
+
}
|
|
1582
|
+
return Object.fromEntries(n);
|
|
1583
|
+
}
|
|
1584
|
+
var vn = (e, t) => {
|
|
1585
|
+
let n = _n(e, t);
|
|
1586
|
+
return {
|
|
1587
|
+
form: n,
|
|
1588
|
+
fields: n
|
|
1589
|
+
};
|
|
1590
|
+
}, Y = {
|
|
1591
|
+
validate({ value: e, validationSource: t }, n) {
|
|
1592
|
+
let r = n["~standard"].validate(e);
|
|
1593
|
+
if (r instanceof Promise) throw Error("async function passed to sync validator");
|
|
1594
|
+
if (r.issues) return t === "field" ? r.issues : vn(r.issues, e);
|
|
1595
|
+
},
|
|
1596
|
+
async validateAsync({ value: e, validationSource: t }, n) {
|
|
1597
|
+
let r = await n["~standard"].validate(e);
|
|
1598
|
+
if (r.issues) return t === "field" ? r.issues : vn(r.issues, e);
|
|
1599
|
+
}
|
|
1600
|
+
}, yn = (e) => !!e && "~standard" in e, X = {
|
|
1601
|
+
isValidating: !1,
|
|
1602
|
+
isTouched: !1,
|
|
1603
|
+
isBlurred: !1,
|
|
1604
|
+
isDirty: !1,
|
|
1605
|
+
isPristine: !0,
|
|
1606
|
+
isValid: !0,
|
|
1607
|
+
isDefaultValue: !0,
|
|
1608
|
+
errors: [],
|
|
1609
|
+
errorMap: {},
|
|
1610
|
+
errorSourceMap: {}
|
|
1611
|
+
};
|
|
1612
|
+
function bn(e) {
|
|
1613
|
+
function t(t, n, r) {
|
|
1614
|
+
let i = o(t, n, "move", r), s = Math.min(n, r), l = Math.max(n, r);
|
|
1615
|
+
for (let e = s; e <= l; e++) i.push(a(t, e));
|
|
1616
|
+
let u = Object.keys(e.fieldInfo).reduce((r, i) => (i.startsWith(a(t, n)) && r.set(i, e.getFieldMeta(i)), r), /* @__PURE__ */ new Map());
|
|
1617
|
+
c(i, n < r ? "up" : "down"), Object.keys(e.fieldInfo).filter((e) => e.startsWith(a(t, r))).forEach((i) => {
|
|
1618
|
+
let o = i.replace(a(t, r), a(t, n)), s = u.get(o);
|
|
1619
|
+
s && e.setFieldMeta(i, s);
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
function n(e, t) {
|
|
1623
|
+
c(o(e, t, "remove"), "up");
|
|
1624
|
+
}
|
|
1625
|
+
function r(t, n, r) {
|
|
1626
|
+
o(t, n, "swap", r).forEach((i) => {
|
|
1627
|
+
if (!i.toString().startsWith(a(t, n))) return;
|
|
1628
|
+
let o = i.toString().replace(a(t, n), a(t, r)), [s, c] = [e.getFieldMeta(i), e.getFieldMeta(o)];
|
|
1629
|
+
s && e.setFieldMeta(o, s), c && e.setFieldMeta(i, c);
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
function i(t, n) {
|
|
1633
|
+
let r = o(t, n, "insert");
|
|
1634
|
+
c(r, "down"), r.forEach((r) => {
|
|
1635
|
+
r.toString().startsWith(a(t, n)) && e.setFieldMeta(r, l());
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
function a(e, t) {
|
|
1639
|
+
return `${e}[${t}]`;
|
|
1640
|
+
}
|
|
1641
|
+
function o(t, n, r, i) {
|
|
1642
|
+
let o = [a(t, n)];
|
|
1643
|
+
switch (r) {
|
|
1644
|
+
case "swap":
|
|
1645
|
+
o.push(a(t, i));
|
|
1646
|
+
break;
|
|
1647
|
+
case "move": {
|
|
1648
|
+
let [e, r] = [Math.min(n, i), Math.max(n, i)];
|
|
1649
|
+
for (let n = e; n <= r; n++) o.push(a(t, n));
|
|
1650
|
+
break;
|
|
1651
|
+
}
|
|
1652
|
+
default: {
|
|
1653
|
+
let r = e.getFieldValue(t), i = Array.isArray(r) ? r.length : 0;
|
|
1654
|
+
for (let e = n + 1; e < i; e++) o.push(a(t, e));
|
|
1655
|
+
break;
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
return Object.keys(e.fieldInfo).filter((e) => o.some((t) => e.startsWith(t)));
|
|
1659
|
+
}
|
|
1660
|
+
function s(e, t) {
|
|
1661
|
+
return e.replace(/\[(\d+)\]/, (e, n) => {
|
|
1662
|
+
let r = parseInt(n, 10);
|
|
1663
|
+
return `[${t === "up" ? r + 1 : Math.max(0, r - 1)}]`;
|
|
1664
|
+
});
|
|
1665
|
+
}
|
|
1666
|
+
function c(t, n) {
|
|
1667
|
+
(n === "up" ? t : [...t].reverse()).forEach((t) => {
|
|
1668
|
+
let r = s(t.toString(), n), i = e.getFieldMeta(r);
|
|
1669
|
+
i ? e.setFieldMeta(t, i) : e.setFieldMeta(t, l());
|
|
1670
|
+
});
|
|
1671
|
+
}
|
|
1672
|
+
let l = () => X;
|
|
1673
|
+
return {
|
|
1674
|
+
handleArrayMove: t,
|
|
1675
|
+
handleArrayRemove: n,
|
|
1676
|
+
handleArraySwap: r,
|
|
1677
|
+
handleArrayInsert: i
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
//#endregion
|
|
1681
|
+
//#region node_modules/.pnpm/@tanstack+form-core@1.29.1/node_modules/@tanstack/form-core/dist/esm/FormApi.js
|
|
1682
|
+
function xn(e) {
|
|
1683
|
+
return {
|
|
1684
|
+
values: e.values ?? {},
|
|
1685
|
+
errorMap: e.errorMap ?? {},
|
|
1686
|
+
fieldMetaBase: e.fieldMetaBase ?? {},
|
|
1687
|
+
isSubmitted: e.isSubmitted ?? !1,
|
|
1688
|
+
isSubmitting: e.isSubmitting ?? !1,
|
|
1689
|
+
isValidating: e.isValidating ?? !1,
|
|
1690
|
+
submissionAttempts: e.submissionAttempts ?? 0,
|
|
1691
|
+
isSubmitSuccessful: e.isSubmitSuccessful ?? !1,
|
|
1692
|
+
validationMetaMap: e.validationMetaMap ?? {
|
|
1693
|
+
onChange: void 0,
|
|
1694
|
+
onBlur: void 0,
|
|
1695
|
+
onSubmit: void 0,
|
|
1696
|
+
onMount: void 0,
|
|
1697
|
+
onServer: void 0,
|
|
1698
|
+
onDynamic: void 0
|
|
1699
|
+
}
|
|
1700
|
+
};
|
|
1701
|
+
}
|
|
1702
|
+
var Sn = class {
|
|
1703
|
+
constructor(e) {
|
|
1704
|
+
this.options = {}, this.fieldInfo = {}, this.mount = () => {
|
|
1705
|
+
let e = this.store.subscribe(() => {
|
|
1706
|
+
gn(this);
|
|
1707
|
+
}), t = F.on("request-form-state", (e) => {
|
|
1708
|
+
e.payload.id === this._formId && F.emit("form-api", {
|
|
1709
|
+
id: this._formId,
|
|
1710
|
+
state: this.store.state,
|
|
1711
|
+
options: this.options
|
|
1712
|
+
});
|
|
1713
|
+
}), n = F.on("request-form-reset", (e) => {
|
|
1714
|
+
e.payload.id === this._formId && this.reset();
|
|
1715
|
+
}), r = F.on("request-form-force-submit", (e) => {
|
|
1716
|
+
e.payload.id === this._formId && (this._devtoolsSubmissionOverride = !0, this.handleSubmit(), this._devtoolsSubmissionOverride = !1);
|
|
1717
|
+
}), i = () => {
|
|
1718
|
+
r(), n(), t(), e.unsubscribe(), F.emit("form-unmounted", { id: this._formId });
|
|
1719
|
+
};
|
|
1720
|
+
this.options.listeners?.onMount?.({ formApi: this });
|
|
1721
|
+
let { onMount: a } = this.options.validators || {};
|
|
1722
|
+
return F.emit("form-api", {
|
|
1723
|
+
id: this._formId,
|
|
1724
|
+
state: this.store.state,
|
|
1725
|
+
options: this.options
|
|
1726
|
+
}), a && this.validateSync("mount"), i;
|
|
1727
|
+
}, this.update = (e) => {
|
|
1728
|
+
if (!e) return;
|
|
1729
|
+
let t = this.options;
|
|
1730
|
+
this.options = e;
|
|
1731
|
+
let n = e.defaultValues && !H(e.defaultValues, t.defaultValues) && !this.state.isTouched, r = !H(e.defaultState, t.defaultState) && !this.state.isTouched;
|
|
1732
|
+
!n && !r || (N(() => {
|
|
1733
|
+
this.baseStore.setState(() => xn(Object.assign({}, this.state, r ? e.defaultState : {}, n ? { values: e.defaultValues } : {})));
|
|
1734
|
+
}), F.emit("form-api", {
|
|
1735
|
+
id: this._formId,
|
|
1736
|
+
state: this.store.state,
|
|
1737
|
+
options: this.options
|
|
1738
|
+
}));
|
|
1739
|
+
}, this.reset = (e, t) => {
|
|
1740
|
+
let { fieldMeta: n } = this.state, r = this.resetFieldMeta(n);
|
|
1741
|
+
e && !t?.keepDefaultValues && (this.options = {
|
|
1742
|
+
...this.options,
|
|
1743
|
+
defaultValues: e
|
|
1744
|
+
}), this.baseStore.setState(() => xn({
|
|
1745
|
+
...this.options.defaultState,
|
|
1746
|
+
values: e ?? this.options.defaultValues ?? this.options.defaultState?.values,
|
|
1747
|
+
fieldMetaBase: r
|
|
1748
|
+
}));
|
|
1749
|
+
}, this.validateAllFields = async (e) => {
|
|
1750
|
+
let t = [];
|
|
1751
|
+
return N(() => {
|
|
1752
|
+
Object.values(this.fieldInfo).forEach((n) => {
|
|
1753
|
+
if (!n.instance) return;
|
|
1754
|
+
let r = n.instance;
|
|
1755
|
+
t.push(Promise.resolve().then(() => r.validate(e, { skipFormValidation: !0 }))), n.instance.state.meta.isTouched || n.instance.setMeta((e) => ({
|
|
1756
|
+
...e,
|
|
1757
|
+
isTouched: !0
|
|
1758
|
+
}));
|
|
1759
|
+
});
|
|
1760
|
+
}), (await Promise.all(t)).flat();
|
|
1761
|
+
}, this.validateArrayFieldsStartingFrom = async (e, t, n) => {
|
|
1762
|
+
let r = this.getFieldValue(e), i = Array.isArray(r) ? Math.max(r.length - 1, 0) : null, a = [`${e}[${t}]`];
|
|
1763
|
+
for (let n = t + 1; n <= (i ?? 0); n++) a.push(`${e}[${n}]`);
|
|
1764
|
+
let o = Object.keys(this.fieldInfo).filter((e) => a.some((t) => e.startsWith(t))), s = [];
|
|
1765
|
+
return N(() => {
|
|
1766
|
+
o.forEach((e) => {
|
|
1767
|
+
s.push(Promise.resolve().then(() => this.validateField(e, n)));
|
|
1768
|
+
});
|
|
1769
|
+
}), (await Promise.all(s)).flat();
|
|
1770
|
+
}, this.validateField = (e, t) => {
|
|
1771
|
+
let n = this.fieldInfo[e]?.instance;
|
|
1772
|
+
if (!n) {
|
|
1773
|
+
let { hasErrored: n } = this.validateSync(t);
|
|
1774
|
+
return n && !this.options.asyncAlways ? this.getFieldMeta(e)?.errors ?? [] : this.validateAsync(t).then(() => this.getFieldMeta(e)?.errors ?? []);
|
|
1775
|
+
}
|
|
1776
|
+
return n.state.meta.isTouched || n.setMeta((e) => ({
|
|
1777
|
+
...e,
|
|
1778
|
+
isTouched: !0
|
|
1779
|
+
})), n.validate(t);
|
|
1780
|
+
}, this.validateSync = (e) => {
|
|
1781
|
+
let t = dn(e, {
|
|
1782
|
+
...this.options,
|
|
1783
|
+
form: this,
|
|
1784
|
+
validationLogic: this.options.validationLogic || J
|
|
1785
|
+
}), n = !1, r = {};
|
|
1786
|
+
return N(() => {
|
|
1787
|
+
for (let e of t) {
|
|
1788
|
+
if (!e.validate) continue;
|
|
1789
|
+
let { formError: t, fieldErrors: i } = Cn(this.runValidator({
|
|
1790
|
+
validate: e.validate,
|
|
1791
|
+
value: {
|
|
1792
|
+
value: this.state.values,
|
|
1793
|
+
formApi: this,
|
|
1794
|
+
validationSource: "form"
|
|
1795
|
+
},
|
|
1796
|
+
type: "validate"
|
|
1797
|
+
})), a = Z(e.cause), o = /* @__PURE__ */ new Set([...Object.keys(this.state.fieldMeta), ...Object.keys(i || {})]);
|
|
1798
|
+
for (let e of o) {
|
|
1799
|
+
if (this.baseStore.state.fieldMetaBase[e] === void 0 && !i?.[e]) continue;
|
|
1800
|
+
let { errorMap: t, errorSourceMap: n } = this.getFieldMeta(e) ?? X, o = i?.[e], { newErrorValue: s, newSource: c } = pn({
|
|
1801
|
+
newFormValidatorError: o,
|
|
1802
|
+
isPreviousErrorFromFormValidator: n?.[a] === "form",
|
|
1803
|
+
previousErrorValue: t?.[a]
|
|
1804
|
+
});
|
|
1805
|
+
c === "form" && (r[e] = {
|
|
1806
|
+
...r[e],
|
|
1807
|
+
[a]: o
|
|
1808
|
+
}), t?.[a] !== s && this.setFieldMeta(e, (e = X) => ({
|
|
1809
|
+
...e,
|
|
1810
|
+
errorMap: {
|
|
1811
|
+
...e.errorMap,
|
|
1812
|
+
[a]: s
|
|
1813
|
+
},
|
|
1814
|
+
errorSourceMap: {
|
|
1815
|
+
...e.errorSourceMap,
|
|
1816
|
+
[a]: c
|
|
1817
|
+
}
|
|
1818
|
+
}));
|
|
1819
|
+
}
|
|
1820
|
+
this.state.errorMap?.[a] !== t && this.baseStore.setState((e) => ({
|
|
1821
|
+
...e,
|
|
1822
|
+
errorMap: {
|
|
1823
|
+
...e.errorMap,
|
|
1824
|
+
[a]: t
|
|
1825
|
+
}
|
|
1826
|
+
})), (t || i) && (n = !0);
|
|
1827
|
+
}
|
|
1828
|
+
let i = Z("submit");
|
|
1829
|
+
this.state.errorMap?.[i] && e !== "submit" && !n && this.baseStore.setState((e) => ({
|
|
1830
|
+
...e,
|
|
1831
|
+
errorMap: {
|
|
1832
|
+
...e.errorMap,
|
|
1833
|
+
[i]: void 0
|
|
1834
|
+
}
|
|
1835
|
+
}));
|
|
1836
|
+
let a = Z("server");
|
|
1837
|
+
this.state.errorMap?.[a] && e !== "server" && !n && this.baseStore.setState((e) => ({
|
|
1838
|
+
...e,
|
|
1839
|
+
errorMap: {
|
|
1840
|
+
...e.errorMap,
|
|
1841
|
+
[a]: void 0
|
|
1842
|
+
}
|
|
1843
|
+
}));
|
|
1844
|
+
}), {
|
|
1845
|
+
hasErrored: n,
|
|
1846
|
+
fieldsErrorMap: r
|
|
1847
|
+
};
|
|
1848
|
+
}, this.validateAsync = async (e) => {
|
|
1849
|
+
let t = fn(e, {
|
|
1850
|
+
...this.options,
|
|
1851
|
+
form: this,
|
|
1852
|
+
validationLogic: this.options.validationLogic || J
|
|
1853
|
+
});
|
|
1854
|
+
this.state.isFormValidating || this.baseStore.setState((e) => ({
|
|
1855
|
+
...e,
|
|
1856
|
+
isFormValidating: !0
|
|
1857
|
+
}));
|
|
1858
|
+
let n = [], r;
|
|
1859
|
+
for (let e of t) {
|
|
1860
|
+
if (!e.validate) continue;
|
|
1861
|
+
let t = Z(e.cause);
|
|
1862
|
+
this.state.validationMetaMap[t]?.lastAbortController.abort();
|
|
1863
|
+
let i = new AbortController();
|
|
1864
|
+
this.state.validationMetaMap[t] = { lastAbortController: i }, n.push(new Promise(async (t) => {
|
|
1865
|
+
let n;
|
|
1866
|
+
try {
|
|
1867
|
+
n = await new Promise((t, n) => {
|
|
1868
|
+
setTimeout(async () => {
|
|
1869
|
+
if (i.signal.aborted) return t(void 0);
|
|
1870
|
+
try {
|
|
1871
|
+
t(await this.runValidator({
|
|
1872
|
+
validate: e.validate,
|
|
1873
|
+
value: {
|
|
1874
|
+
value: this.state.values,
|
|
1875
|
+
formApi: this,
|
|
1876
|
+
validationSource: "form",
|
|
1877
|
+
signal: i.signal
|
|
1878
|
+
},
|
|
1879
|
+
type: "validateAsync"
|
|
1880
|
+
}));
|
|
1881
|
+
} catch (e) {
|
|
1882
|
+
n(e);
|
|
1883
|
+
}
|
|
1884
|
+
}, e.debounceMs);
|
|
1885
|
+
});
|
|
1886
|
+
} catch (e) {
|
|
1887
|
+
n = e;
|
|
1888
|
+
}
|
|
1889
|
+
let { formError: a, fieldErrors: o } = Cn(n);
|
|
1890
|
+
o && (r = r ? {
|
|
1891
|
+
...r,
|
|
1892
|
+
...o
|
|
1893
|
+
} : o);
|
|
1894
|
+
let s = Z(e.cause);
|
|
1895
|
+
for (let e of Object.keys(this.state.fieldMeta)) {
|
|
1896
|
+
if (this.baseStore.state.fieldMetaBase[e] === void 0) continue;
|
|
1897
|
+
let t = this.getFieldMeta(e);
|
|
1898
|
+
if (!t) continue;
|
|
1899
|
+
let { errorMap: n, errorSourceMap: i } = t, a = r?.[e], { newErrorValue: o, newSource: c } = pn({
|
|
1900
|
+
newFormValidatorError: a,
|
|
1901
|
+
isPreviousErrorFromFormValidator: i?.[s] === "form",
|
|
1902
|
+
previousErrorValue: n?.[s]
|
|
1903
|
+
});
|
|
1904
|
+
n?.[s] !== o && this.setFieldMeta(e, (e) => ({
|
|
1905
|
+
...e,
|
|
1906
|
+
errorMap: {
|
|
1907
|
+
...e.errorMap,
|
|
1908
|
+
[s]: o
|
|
1909
|
+
},
|
|
1910
|
+
errorSourceMap: {
|
|
1911
|
+
...e.errorSourceMap,
|
|
1912
|
+
[s]: c
|
|
1913
|
+
}
|
|
1914
|
+
}));
|
|
1915
|
+
}
|
|
1916
|
+
this.baseStore.setState((e) => ({
|
|
1917
|
+
...e,
|
|
1918
|
+
errorMap: {
|
|
1919
|
+
...e.errorMap,
|
|
1920
|
+
[s]: a
|
|
1921
|
+
}
|
|
1922
|
+
})), t(r ? {
|
|
1923
|
+
fieldErrors: r,
|
|
1924
|
+
errorMapKey: s
|
|
1925
|
+
} : void 0);
|
|
1926
|
+
}));
|
|
1927
|
+
}
|
|
1928
|
+
let i = [], a = {};
|
|
1929
|
+
if (n.length) {
|
|
1930
|
+
i = await Promise.all(n);
|
|
1931
|
+
for (let e of i) if (e?.fieldErrors) {
|
|
1932
|
+
let { errorMapKey: t } = e;
|
|
1933
|
+
for (let [n, r] of Object.entries(e.fieldErrors)) a[n] = {
|
|
1934
|
+
...a[n] || {},
|
|
1935
|
+
[t]: r
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
return this.baseStore.setState((e) => ({
|
|
1940
|
+
...e,
|
|
1941
|
+
isFormValidating: !1
|
|
1942
|
+
})), a;
|
|
1943
|
+
}, this.validate = (e) => {
|
|
1944
|
+
let { hasErrored: t, fieldsErrorMap: n } = this.validateSync(e);
|
|
1945
|
+
return t && !this.options.asyncAlways ? n : this.validateAsync(e);
|
|
1946
|
+
}, this._handleSubmit = async (e) => {
|
|
1947
|
+
this.baseStore.setState((e) => ({
|
|
1948
|
+
...e,
|
|
1949
|
+
isSubmitted: !1,
|
|
1950
|
+
submissionAttempts: e.submissionAttempts + 1,
|
|
1951
|
+
isSubmitSuccessful: !1
|
|
1952
|
+
})), N(() => {
|
|
1953
|
+
Object.values(this.fieldInfo).forEach((e) => {
|
|
1954
|
+
e.instance && (e.instance.state.meta.isTouched || e.instance.setMeta((e) => ({
|
|
1955
|
+
...e,
|
|
1956
|
+
isTouched: !0
|
|
1957
|
+
})));
|
|
1958
|
+
});
|
|
1959
|
+
});
|
|
1960
|
+
let t = e ?? this.options.onSubmitMeta;
|
|
1961
|
+
if (!this.state.canSubmit && !this._devtoolsSubmissionOverride) {
|
|
1962
|
+
this.options.onSubmitInvalid?.({
|
|
1963
|
+
value: this.state.values,
|
|
1964
|
+
formApi: this,
|
|
1965
|
+
meta: t
|
|
1966
|
+
});
|
|
1967
|
+
return;
|
|
1968
|
+
}
|
|
1969
|
+
this.baseStore.setState((e) => ({
|
|
1970
|
+
...e,
|
|
1971
|
+
isSubmitting: !0
|
|
1972
|
+
}));
|
|
1973
|
+
let n = () => {
|
|
1974
|
+
this.baseStore.setState((e) => ({
|
|
1975
|
+
...e,
|
|
1976
|
+
isSubmitting: !1
|
|
1977
|
+
}));
|
|
1978
|
+
};
|
|
1979
|
+
if (await this.validateAllFields("submit"), !this.state.isFieldsValid) {
|
|
1980
|
+
n(), this.options.onSubmitInvalid?.({
|
|
1981
|
+
value: this.state.values,
|
|
1982
|
+
formApi: this,
|
|
1983
|
+
meta: t
|
|
1984
|
+
}), F.emit("form-submission", {
|
|
1985
|
+
id: this._formId,
|
|
1986
|
+
submissionAttempt: this.state.submissionAttempts,
|
|
1987
|
+
successful: !1,
|
|
1988
|
+
stage: "validateAllFields",
|
|
1989
|
+
errors: Object.values(this.state.fieldMeta).map((e) => e.errors).flat()
|
|
1990
|
+
});
|
|
1991
|
+
return;
|
|
1992
|
+
}
|
|
1993
|
+
if (await this.validate("submit"), !this.state.isValid) {
|
|
1994
|
+
n(), this.options.onSubmitInvalid?.({
|
|
1995
|
+
value: this.state.values,
|
|
1996
|
+
formApi: this,
|
|
1997
|
+
meta: t
|
|
1998
|
+
}), F.emit("form-submission", {
|
|
1999
|
+
id: this._formId,
|
|
2000
|
+
submissionAttempt: this.state.submissionAttempts,
|
|
2001
|
+
successful: !1,
|
|
2002
|
+
stage: "validate",
|
|
2003
|
+
errors: this.state.errors
|
|
2004
|
+
});
|
|
2005
|
+
return;
|
|
2006
|
+
}
|
|
2007
|
+
N(() => {
|
|
2008
|
+
Object.values(this.fieldInfo).forEach((e) => {
|
|
2009
|
+
e.instance?.options.listeners?.onSubmit?.({
|
|
2010
|
+
value: e.instance.state.value,
|
|
2011
|
+
fieldApi: e.instance
|
|
2012
|
+
});
|
|
2013
|
+
});
|
|
2014
|
+
}), this.options.listeners?.onSubmit?.({
|
|
2015
|
+
formApi: this,
|
|
2016
|
+
meta: t
|
|
2017
|
+
});
|
|
2018
|
+
try {
|
|
2019
|
+
await this.options.onSubmit?.({
|
|
2020
|
+
value: this.state.values,
|
|
2021
|
+
formApi: this,
|
|
2022
|
+
meta: t
|
|
2023
|
+
}), N(() => {
|
|
2024
|
+
this.baseStore.setState((e) => ({
|
|
2025
|
+
...e,
|
|
2026
|
+
isSubmitted: !0,
|
|
2027
|
+
isSubmitSuccessful: !0
|
|
2028
|
+
})), F.emit("form-submission", {
|
|
2029
|
+
id: this._formId,
|
|
2030
|
+
submissionAttempt: this.state.submissionAttempts,
|
|
2031
|
+
successful: !0
|
|
2032
|
+
}), n();
|
|
2033
|
+
});
|
|
2034
|
+
} catch (e) {
|
|
2035
|
+
throw this.baseStore.setState((e) => ({
|
|
2036
|
+
...e,
|
|
2037
|
+
isSubmitSuccessful: !1
|
|
2038
|
+
})), F.emit("form-submission", {
|
|
2039
|
+
id: this._formId,
|
|
2040
|
+
submissionAttempt: this.state.submissionAttempts,
|
|
2041
|
+
successful: !1,
|
|
2042
|
+
stage: "inflight",
|
|
2043
|
+
onError: e
|
|
2044
|
+
}), n(), e;
|
|
2045
|
+
}
|
|
2046
|
+
}, this.getFieldValue = (e) => L(this.state.values, e), this.getFieldMeta = (e) => this.state.fieldMeta[e], this.getFieldInfo = (e) => this.fieldInfo[e] ||= {
|
|
2047
|
+
instance: null,
|
|
2048
|
+
validationMetaMap: {
|
|
2049
|
+
onChange: void 0,
|
|
2050
|
+
onBlur: void 0,
|
|
2051
|
+
onSubmit: void 0,
|
|
2052
|
+
onMount: void 0,
|
|
2053
|
+
onServer: void 0,
|
|
2054
|
+
onDynamic: void 0
|
|
2055
|
+
}
|
|
2056
|
+
}, this.setFieldMeta = (e, t) => {
|
|
2057
|
+
this.baseStore.setState((n) => ({
|
|
2058
|
+
...n,
|
|
2059
|
+
fieldMetaBase: {
|
|
2060
|
+
...n.fieldMetaBase,
|
|
2061
|
+
[e]: I(t, n.fieldMetaBase[e])
|
|
2062
|
+
}
|
|
2063
|
+
}));
|
|
2064
|
+
}, this.resetFieldMeta = (e) => Object.keys(e).reduce((e, t) => {
|
|
2065
|
+
let n = t;
|
|
2066
|
+
return e[n] = X, e;
|
|
2067
|
+
}, {}), this.setFieldValue = (e, t, n) => {
|
|
2068
|
+
let r = n?.dontUpdateMeta ?? !1, i = n?.dontRunListeners ?? !1, a = n?.dontValidate ?? !1;
|
|
2069
|
+
N(() => {
|
|
2070
|
+
r || this.setFieldMeta(e, (e) => ({
|
|
2071
|
+
...e,
|
|
2072
|
+
isTouched: !0,
|
|
2073
|
+
isDirty: !0,
|
|
2074
|
+
errorMap: {
|
|
2075
|
+
...e?.errorMap,
|
|
2076
|
+
onMount: void 0
|
|
2077
|
+
}
|
|
2078
|
+
})), this.baseStore.setState((n) => ({
|
|
2079
|
+
...n,
|
|
2080
|
+
values: R(n.values, e, t)
|
|
2081
|
+
}));
|
|
2082
|
+
}), i || this.getFieldInfo(e).instance?.triggerOnChangeListener(), a || this.validateField(e, "change");
|
|
2083
|
+
}, this.deleteField = (e) => {
|
|
2084
|
+
let t = [...Object.keys(this.fieldInfo).filter((t) => {
|
|
2085
|
+
let n = e.toString();
|
|
2086
|
+
return t !== n && t.startsWith(n);
|
|
2087
|
+
}), e];
|
|
2088
|
+
this.baseStore.setState((e) => {
|
|
2089
|
+
let n = { ...e };
|
|
2090
|
+
return t.forEach((e) => {
|
|
2091
|
+
n.values = tn(n.values, e), delete this.fieldInfo[e], delete n.fieldMetaBase[e];
|
|
2092
|
+
}), n;
|
|
2093
|
+
});
|
|
2094
|
+
}, this.pushFieldValue = (e, t, n) => {
|
|
2095
|
+
this.setFieldValue(e, (e) => [...Array.isArray(e) ? e : [], t], n);
|
|
2096
|
+
}, this.insertFieldValue = async (e, t, n, r) => {
|
|
2097
|
+
this.setFieldValue(e, (e) => [
|
|
2098
|
+
...e.slice(0, t),
|
|
2099
|
+
n,
|
|
2100
|
+
...e.slice(t)
|
|
2101
|
+
], U(r, { dontValidate: !0 }));
|
|
2102
|
+
let i = r?.dontValidate ?? !1;
|
|
2103
|
+
i || await this.validateField(e, "change"), bn(this).handleArrayInsert(e, t), i || await this.validateArrayFieldsStartingFrom(e, t, "change");
|
|
2104
|
+
}, this.replaceFieldValue = async (e, t, n, r) => {
|
|
2105
|
+
this.setFieldValue(e, (e) => e.map((e, r) => r === t ? n : e), U(r, { dontValidate: !0 })), (r?.dontValidate ?? !1) || (await this.validateField(e, "change"), await this.validateArrayFieldsStartingFrom(e, t, "change"));
|
|
2106
|
+
}, this.removeFieldValue = async (e, t, n) => {
|
|
2107
|
+
let r = this.getFieldValue(e), i = Array.isArray(r) ? Math.max(r.length - 1, 0) : null;
|
|
2108
|
+
if (this.setFieldValue(e, (e) => e.filter((e, n) => n !== t), U(n, { dontValidate: !0 })), bn(this).handleArrayRemove(e, t), i !== null) {
|
|
2109
|
+
let t = `${e}[${i}]`;
|
|
2110
|
+
this.deleteField(t);
|
|
2111
|
+
}
|
|
2112
|
+
(n?.dontValidate ?? !1) || (await this.validateField(e, "change"), await this.validateArrayFieldsStartingFrom(e, t, "change"));
|
|
2113
|
+
}, this.swapFieldValues = (e, t, n, r) => {
|
|
2114
|
+
this.setFieldValue(e, (e) => {
|
|
2115
|
+
let r = e[t], i = e[n];
|
|
2116
|
+
return R(R(e, `${t}`, i), `${n}`, r);
|
|
2117
|
+
}, U(r, { dontValidate: !0 })), bn(this).handleArraySwap(e, t, n), (r?.dontValidate ?? !1) || (this.validateField(e, "change"), this.validateField(`${e}[${t}]`, "change"), this.validateField(`${e}[${n}]`, "change"));
|
|
2118
|
+
}, this.moveFieldValues = (e, t, n, r) => {
|
|
2119
|
+
this.setFieldValue(e, (e) => {
|
|
2120
|
+
let r = [...e];
|
|
2121
|
+
return r.splice(n, 0, r.splice(t, 1)[0]), r;
|
|
2122
|
+
}, U(r, { dontValidate: !0 })), bn(this).handleArrayMove(e, t, n), (r?.dontValidate ?? !1) || (this.validateField(e, "change"), this.validateField(`${e}[${t}]`, "change"), this.validateField(`${e}[${n}]`, "change"));
|
|
2123
|
+
}, this.clearFieldValues = (e, t) => {
|
|
2124
|
+
let n = this.getFieldValue(e), r = Array.isArray(n) ? Math.max(n.length - 1, 0) : null;
|
|
2125
|
+
if (this.setFieldValue(e, [], U(t, { dontValidate: !0 })), r !== null) for (let t = 0; t <= r; t++) {
|
|
2126
|
+
let n = `${e}[${t}]`;
|
|
2127
|
+
this.deleteField(n);
|
|
2128
|
+
}
|
|
2129
|
+
(t?.dontValidate ?? !1) || this.validateField(e, "change");
|
|
2130
|
+
}, this.resetField = (e) => {
|
|
2131
|
+
this.baseStore.setState((t) => ({
|
|
2132
|
+
...t,
|
|
2133
|
+
fieldMetaBase: {
|
|
2134
|
+
...t.fieldMetaBase,
|
|
2135
|
+
[e]: X
|
|
2136
|
+
},
|
|
2137
|
+
values: this.options.defaultValues ? R(t.values, e, L(this.options.defaultValues, e)) : t.values
|
|
2138
|
+
}));
|
|
2139
|
+
}, this.setErrorMap = (e) => {
|
|
2140
|
+
N(() => {
|
|
2141
|
+
Object.entries(e).forEach(([e, t]) => {
|
|
2142
|
+
let n = e;
|
|
2143
|
+
if (V(t)) {
|
|
2144
|
+
let { formError: e, fieldErrors: r } = Cn(t);
|
|
2145
|
+
for (let e of Object.keys(this.fieldInfo)) this.getFieldMeta(e) && this.setFieldMeta(e, (t) => ({
|
|
2146
|
+
...t,
|
|
2147
|
+
errorMap: {
|
|
2148
|
+
...t.errorMap,
|
|
2149
|
+
[n]: r?.[e]
|
|
2150
|
+
},
|
|
2151
|
+
errorSourceMap: {
|
|
2152
|
+
...t.errorSourceMap,
|
|
2153
|
+
[n]: "form"
|
|
2154
|
+
}
|
|
2155
|
+
}));
|
|
2156
|
+
this.baseStore.setState((t) => ({
|
|
2157
|
+
...t,
|
|
2158
|
+
errorMap: {
|
|
2159
|
+
...t.errorMap,
|
|
2160
|
+
[n]: e
|
|
2161
|
+
}
|
|
2162
|
+
}));
|
|
2163
|
+
} else this.baseStore.setState((e) => ({
|
|
2164
|
+
...e,
|
|
2165
|
+
errorMap: {
|
|
2166
|
+
...e.errorMap,
|
|
2167
|
+
[n]: t
|
|
2168
|
+
}
|
|
2169
|
+
}));
|
|
2170
|
+
});
|
|
2171
|
+
});
|
|
2172
|
+
}, this.getAllErrors = () => ({
|
|
2173
|
+
form: {
|
|
2174
|
+
errors: this.state.errors,
|
|
2175
|
+
errorMap: this.state.errorMap
|
|
2176
|
+
},
|
|
2177
|
+
fields: Object.entries(this.state.fieldMeta).reduce((e, [t, n]) => (Object.keys(n).length && n.errors.length && (e[t] = {
|
|
2178
|
+
errors: n.errors,
|
|
2179
|
+
errorMap: n.errorMap
|
|
2180
|
+
}), e), {})
|
|
2181
|
+
}), this.parseValuesWithSchema = (e) => Y.validate({
|
|
2182
|
+
value: this.state.values,
|
|
2183
|
+
validationSource: "form"
|
|
2184
|
+
}, e), this.parseValuesWithSchemaAsync = (e) => Y.validateAsync({
|
|
2185
|
+
value: this.state.values,
|
|
2186
|
+
validationSource: "form"
|
|
2187
|
+
}, e), this.timeoutIds = {
|
|
2188
|
+
validations: {},
|
|
2189
|
+
listeners: {},
|
|
2190
|
+
formListeners: {}
|
|
2191
|
+
}, this._formId = e?.formId ?? hn(), this._devtoolsSubmissionOverride = !1;
|
|
2192
|
+
let t = xn({
|
|
2193
|
+
...e?.defaultState,
|
|
2194
|
+
values: e?.defaultValues ?? e?.defaultState?.values
|
|
2195
|
+
});
|
|
2196
|
+
if (e?.transform) {
|
|
2197
|
+
t = e.transform({ state: t }).state;
|
|
2198
|
+
for (let e of Object.keys(t.errorMap)) {
|
|
2199
|
+
let n = t.errorMap[e];
|
|
2200
|
+
if (!(n === void 0 || !V(n))) for (let r of Object.keys(n.fields)) {
|
|
2201
|
+
let i = n.fields[r];
|
|
2202
|
+
if (i === void 0) continue;
|
|
2203
|
+
let a = t.fieldMetaBase[r];
|
|
2204
|
+
t.fieldMetaBase[r] = {
|
|
2205
|
+
isTouched: !1,
|
|
2206
|
+
isValidating: !1,
|
|
2207
|
+
isBlurred: !1,
|
|
2208
|
+
isDirty: !1,
|
|
2209
|
+
...a ?? {},
|
|
2210
|
+
errorSourceMap: {
|
|
2211
|
+
...a?.errorSourceMap ?? {},
|
|
2212
|
+
onChange: "form"
|
|
2213
|
+
},
|
|
2214
|
+
errorMap: {
|
|
2215
|
+
...a?.errorMap ?? {},
|
|
2216
|
+
[e]: i
|
|
2217
|
+
}
|
|
2218
|
+
};
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
this.baseStore = P(t);
|
|
2223
|
+
let n;
|
|
2224
|
+
this.fieldMetaDerived = P((e) => {
|
|
2225
|
+
let t = this.baseStore.get(), r = 0, i = {};
|
|
2226
|
+
for (let a of Object.keys(t.fieldMetaBase)) {
|
|
2227
|
+
let o = t.fieldMetaBase[a], s = n?.fieldMetaBase[a], c = e?.[a], l = L(t.values, a), u = c?.errors;
|
|
2228
|
+
if (!s || o.errorMap !== s.errorMap) {
|
|
2229
|
+
u = Object.values(o.errorMap ?? {}).filter((e) => e !== void 0);
|
|
2230
|
+
let e = this.getFieldInfo(a)?.instance;
|
|
2231
|
+
(!e || !e.options.disableErrorFlat) && (u = u.flat(1));
|
|
2232
|
+
}
|
|
2233
|
+
let d = !un(u), f = !o.isDirty, p = H(l, L(this.options.defaultValues, a)) || H(l, this.getFieldInfo(a)?.instance?.options.defaultValue);
|
|
2234
|
+
if (c && c.isPristine === f && c.isValid === d && c.isDefaultValue === p && c.errors === u && o === s) {
|
|
2235
|
+
i[a] = c, r++;
|
|
2236
|
+
continue;
|
|
2237
|
+
}
|
|
2238
|
+
i[a] = {
|
|
2239
|
+
...o,
|
|
2240
|
+
errors: u ?? [],
|
|
2241
|
+
isPristine: f,
|
|
2242
|
+
isValid: d,
|
|
2243
|
+
isDefaultValue: p
|
|
2244
|
+
};
|
|
2245
|
+
}
|
|
2246
|
+
return Object.keys(t.fieldMetaBase).length ? e && r === Object.keys(t.fieldMetaBase).length ? e : (n = this.baseStore.get(), i) : i;
|
|
2247
|
+
});
|
|
2248
|
+
let r;
|
|
2249
|
+
this.store = P((e) => {
|
|
2250
|
+
let t = this.baseStore.get(), n = this.fieldMetaDerived.get(), i = Object.values(n).filter(Boolean), a = i.some((e) => e.isValidating), o = i.every((e) => e.isValid), s = i.some((e) => e.isTouched), c = i.some((e) => e.isBlurred), l = i.every((e) => e.isDefaultValue), u = s && t.errorMap?.onMount, d = i.some((e) => e.isDirty), f = !d, p = !!(t.errorMap?.onMount || i.some((e) => e?.errorMap?.onMount)), m = !!a, h = e?.errors ?? [];
|
|
2251
|
+
(!r || t.errorMap !== r.errorMap) && (h = Object.values(t.errorMap).reduce((e, t) => t === void 0 ? e : t && V(t) ? (e.push(t.form), e) : (e.push(t), e), []));
|
|
2252
|
+
let g = h.length === 0, _ = o && g, v = this.options.canSubmitWhenInvalid ?? !1, y = t.submissionAttempts === 0 && !s && !p || !m && !t.isSubmitting && _ || v, b = t.errorMap;
|
|
2253
|
+
if (u && (h = h.filter((e) => e !== t.errorMap.onMount), b = Object.assign(b, { onMount: void 0 })), e && r && e.errorMap === b && e.fieldMeta === this.fieldMetaDerived.state && e.errors === h && e.isFieldsValidating === a && e.isFieldsValid === o && e.isFormValid === g && e.isValid === _ && e.canSubmit === y && e.isTouched === s && e.isBlurred === c && e.isPristine === f && e.isDefaultValue === l && e.isDirty === d && H(r, t)) return e;
|
|
2254
|
+
let ee = {
|
|
2255
|
+
...t,
|
|
2256
|
+
errorMap: b,
|
|
2257
|
+
fieldMeta: this.fieldMetaDerived.state,
|
|
2258
|
+
errors: h,
|
|
2259
|
+
isFieldsValidating: a,
|
|
2260
|
+
isFieldsValid: o,
|
|
2261
|
+
isFormValid: g,
|
|
2262
|
+
isValid: _,
|
|
2263
|
+
canSubmit: y,
|
|
2264
|
+
isTouched: s,
|
|
2265
|
+
isBlurred: c,
|
|
2266
|
+
isPristine: f,
|
|
2267
|
+
isDefaultValue: l,
|
|
2268
|
+
isDirty: d
|
|
2269
|
+
};
|
|
2270
|
+
return r = this.baseStore.get(), ee;
|
|
2271
|
+
}), this.handleSubmit = this.handleSubmit.bind(this), this.update(e || {});
|
|
2272
|
+
}
|
|
2273
|
+
get state() {
|
|
2274
|
+
return this.store.state;
|
|
2275
|
+
}
|
|
2276
|
+
get formId() {
|
|
2277
|
+
return this._formId;
|
|
2278
|
+
}
|
|
2279
|
+
runValidator(e) {
|
|
2280
|
+
return yn(e.validate) ? Y[e.type](e.value, e.validate) : e.validate(e.value);
|
|
2281
|
+
}
|
|
2282
|
+
handleSubmit(e) {
|
|
2283
|
+
return this._handleSubmit(e);
|
|
2284
|
+
}
|
|
2285
|
+
};
|
|
2286
|
+
function Cn(e) {
|
|
2287
|
+
return e ? V(e) ? {
|
|
2288
|
+
formError: Cn(e.form).formError,
|
|
2289
|
+
fieldErrors: e.fields
|
|
2290
|
+
} : { formError: e } : { formError: void 0 };
|
|
2291
|
+
}
|
|
2292
|
+
function Z(e) {
|
|
2293
|
+
switch (e) {
|
|
2294
|
+
case "submit": return "onSubmit";
|
|
2295
|
+
case "blur": return "onBlur";
|
|
2296
|
+
case "mount": return "onMount";
|
|
2297
|
+
case "server": return "onServer";
|
|
2298
|
+
case "dynamic": return "onDynamic";
|
|
2299
|
+
default: return "onChange";
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
//#endregion
|
|
2303
|
+
//#region node_modules/.pnpm/@tanstack+form-core@1.29.1/node_modules/@tanstack/form-core/dist/esm/FieldApi.js
|
|
2304
|
+
var wn = class {
|
|
2305
|
+
constructor(e) {
|
|
2306
|
+
this.options = {}, this.mount = () => {
|
|
2307
|
+
this.options.defaultValue !== void 0 && !this.getMeta().isTouched && this.form.setFieldValue(this.name, this.options.defaultValue, { dontUpdateMeta: !0 });
|
|
2308
|
+
let e = this.getInfo();
|
|
2309
|
+
e.instance = this, this.update(this.options);
|
|
2310
|
+
let { onMount: t } = this.options.validators || {};
|
|
2311
|
+
if (t) {
|
|
2312
|
+
let e = this.runValidator({
|
|
2313
|
+
validate: t,
|
|
2314
|
+
value: {
|
|
2315
|
+
value: this.state.value,
|
|
2316
|
+
fieldApi: this,
|
|
2317
|
+
validationSource: "field"
|
|
2318
|
+
},
|
|
2319
|
+
type: "validate"
|
|
2320
|
+
});
|
|
2321
|
+
e && this.setMeta((t) => ({
|
|
2322
|
+
...t,
|
|
2323
|
+
errorMap: {
|
|
2324
|
+
...t?.errorMap,
|
|
2325
|
+
onMount: e
|
|
2326
|
+
},
|
|
2327
|
+
errorSourceMap: {
|
|
2328
|
+
...t?.errorSourceMap,
|
|
2329
|
+
onMount: "field"
|
|
2330
|
+
}
|
|
2331
|
+
}));
|
|
2332
|
+
}
|
|
2333
|
+
return this.options.listeners?.onMount?.({
|
|
2334
|
+
value: this.state.value,
|
|
2335
|
+
fieldApi: this
|
|
2336
|
+
}), () => {
|
|
2337
|
+
for (let [e, t] of Object.entries(this.timeoutIds.validations)) t && (clearTimeout(t), this.timeoutIds.validations[e] = null);
|
|
2338
|
+
for (let [e, t] of Object.entries(this.timeoutIds.listeners)) t && (clearTimeout(t), this.timeoutIds.listeners[e] = null);
|
|
2339
|
+
for (let [e, t] of Object.entries(this.timeoutIds.formListeners)) t && (clearTimeout(t), this.timeoutIds.formListeners[e] = null);
|
|
2340
|
+
let e = this.form.fieldInfo[this.name];
|
|
2341
|
+
if (e && e.instance === this) {
|
|
2342
|
+
for (let [t, n] of Object.entries(e.validationMetaMap)) n?.lastAbortController.abort(), e.validationMetaMap[t] = void 0;
|
|
2343
|
+
this.form.baseStore.setState((e) => ({
|
|
2344
|
+
...e,
|
|
2345
|
+
fieldMetaBase: {
|
|
2346
|
+
...e.fieldMetaBase,
|
|
2347
|
+
[this.name]: {
|
|
2348
|
+
...X,
|
|
2349
|
+
isTouched: e.fieldMetaBase[this.name]?.isTouched ?? X.isTouched,
|
|
2350
|
+
isBlurred: e.fieldMetaBase[this.name]?.isBlurred ?? X.isBlurred,
|
|
2351
|
+
isDirty: e.fieldMetaBase[this.name]?.isDirty ?? X.isDirty
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
})), e.instance = null, this.options.listeners?.onUnmount?.({
|
|
2355
|
+
value: this.state.value,
|
|
2356
|
+
fieldApi: this
|
|
2357
|
+
}), this.form.options.listeners?.onFieldUnmount?.({
|
|
2358
|
+
formApi: this.form,
|
|
2359
|
+
fieldApi: this
|
|
2360
|
+
});
|
|
2361
|
+
}
|
|
2362
|
+
};
|
|
2363
|
+
}, this.update = (e) => {
|
|
2364
|
+
this.options = e, this.name = e.name, !this.state.meta.isTouched && this.options.defaultValue !== void 0 && (H(this.form.getFieldValue(this.name), e.defaultValue) || this.form.setFieldValue(this.name, e.defaultValue, {
|
|
2365
|
+
dontUpdateMeta: !0,
|
|
2366
|
+
dontValidate: !0,
|
|
2367
|
+
dontRunListeners: !0
|
|
2368
|
+
})), this.form.getFieldMeta(this.name) || this.form.setFieldMeta(this.name, this.state.meta);
|
|
2369
|
+
}, this.getValue = () => this.form.getFieldValue(this.name), this.setValue = (e, t) => {
|
|
2370
|
+
this.form.setFieldValue(this.name, e, U(t, {
|
|
2371
|
+
dontRunListeners: !0,
|
|
2372
|
+
dontValidate: !0
|
|
2373
|
+
})), t?.dontRunListeners || this.triggerOnChangeListener(), t?.dontValidate || this.validate("change");
|
|
2374
|
+
}, this.getMeta = () => this.store.state.meta, this.setMeta = (e) => this.form.setFieldMeta(this.name, e), this.getInfo = () => this.form.getFieldInfo(this.name), this.pushValue = (e, t) => {
|
|
2375
|
+
this.form.pushFieldValue(this.name, e, U(t, { dontRunListeners: !0 })), t?.dontRunListeners || this.triggerOnChangeListener();
|
|
2376
|
+
}, this.insertValue = (e, t, n) => {
|
|
2377
|
+
this.form.insertFieldValue(this.name, e, t, U(n, { dontRunListeners: !0 })), n?.dontRunListeners || this.triggerOnChangeListener();
|
|
2378
|
+
}, this.replaceValue = (e, t, n) => {
|
|
2379
|
+
this.form.replaceFieldValue(this.name, e, t, U(n, { dontRunListeners: !0 })), n?.dontRunListeners || this.triggerOnChangeListener();
|
|
2380
|
+
}, this.removeValue = (e, t) => {
|
|
2381
|
+
this.form.removeFieldValue(this.name, e, U(t, { dontRunListeners: !0 })), t?.dontRunListeners || this.triggerOnChangeListener();
|
|
2382
|
+
}, this.swapValues = (e, t, n) => {
|
|
2383
|
+
this.form.swapFieldValues(this.name, e, t, U(n, { dontRunListeners: !0 })), n?.dontRunListeners || this.triggerOnChangeListener();
|
|
2384
|
+
}, this.moveValue = (e, t, n) => {
|
|
2385
|
+
this.form.moveFieldValues(this.name, e, t, U(n, { dontRunListeners: !0 })), n?.dontRunListeners || this.triggerOnChangeListener();
|
|
2386
|
+
}, this.clearValues = (e) => {
|
|
2387
|
+
this.form.clearFieldValues(this.name, U(e, { dontRunListeners: !0 })), e?.dontRunListeners || this.triggerOnChangeListener();
|
|
2388
|
+
}, this.getLinkedFields = (e) => {
|
|
2389
|
+
let t = Object.values(this.form.fieldInfo), n = [];
|
|
2390
|
+
for (let r of t) {
|
|
2391
|
+
if (!r.instance) continue;
|
|
2392
|
+
let { onChangeListenTo: t, onBlurListenTo: i } = r.instance.options.validators || {};
|
|
2393
|
+
e === "change" && t?.includes(this.name) && n.push(r.instance), e === "blur" && i?.includes(this.name) && n.push(r.instance);
|
|
2394
|
+
}
|
|
2395
|
+
return n;
|
|
2396
|
+
}, this.validateSync = (e, t) => {
|
|
2397
|
+
let n = dn(e, {
|
|
2398
|
+
...this.options,
|
|
2399
|
+
form: this.form,
|
|
2400
|
+
fieldName: this.name,
|
|
2401
|
+
validationLogic: this.form.options.validationLogic || J
|
|
2402
|
+
}), r = this.getLinkedFields(e).reduce((t, n) => {
|
|
2403
|
+
let r = dn(e, {
|
|
2404
|
+
...n.options,
|
|
2405
|
+
form: n.form,
|
|
2406
|
+
fieldName: n.name,
|
|
2407
|
+
validationLogic: n.form.options.validationLogic || J
|
|
2408
|
+
});
|
|
2409
|
+
return r.forEach((e) => {
|
|
2410
|
+
e.field = n;
|
|
2411
|
+
}), t.concat(r);
|
|
2412
|
+
}, []), i = !1;
|
|
2413
|
+
N(() => {
|
|
2414
|
+
let e = (e, n) => {
|
|
2415
|
+
let r = En(n.cause), a = n.validate ? Tn(e.runValidator({
|
|
2416
|
+
validate: n.validate,
|
|
2417
|
+
value: {
|
|
2418
|
+
value: e.store.state.value,
|
|
2419
|
+
validationSource: "field",
|
|
2420
|
+
fieldApi: e
|
|
2421
|
+
},
|
|
2422
|
+
type: "validate"
|
|
2423
|
+
})) : void 0, o = t[r], { newErrorValue: s, newSource: c } = mn({
|
|
2424
|
+
formLevelError: o,
|
|
2425
|
+
fieldLevelError: a
|
|
2426
|
+
});
|
|
2427
|
+
e.state.meta.errorMap?.[r] !== s && e.setMeta((e) => ({
|
|
2428
|
+
...e,
|
|
2429
|
+
errorMap: {
|
|
2430
|
+
...e.errorMap,
|
|
2431
|
+
[r]: s
|
|
2432
|
+
},
|
|
2433
|
+
errorSourceMap: {
|
|
2434
|
+
...e.errorSourceMap,
|
|
2435
|
+
[r]: c
|
|
2436
|
+
}
|
|
2437
|
+
})), s && (i = !0);
|
|
2438
|
+
};
|
|
2439
|
+
for (let t of n) e(this, t);
|
|
2440
|
+
for (let t of r) t.validate && e(t.field, t);
|
|
2441
|
+
});
|
|
2442
|
+
let a = En("submit");
|
|
2443
|
+
return this.state.meta.errorMap?.[a] && e !== "submit" && !i && this.setMeta((e) => ({
|
|
2444
|
+
...e,
|
|
2445
|
+
errorMap: {
|
|
2446
|
+
...e.errorMap,
|
|
2447
|
+
[a]: void 0
|
|
2448
|
+
},
|
|
2449
|
+
errorSourceMap: {
|
|
2450
|
+
...e.errorSourceMap,
|
|
2451
|
+
[a]: void 0
|
|
2452
|
+
}
|
|
2453
|
+
})), { hasErrored: i };
|
|
2454
|
+
}, this.validateAsync = async (e, t) => {
|
|
2455
|
+
let n = fn(e, {
|
|
2456
|
+
...this.options,
|
|
2457
|
+
form: this.form,
|
|
2458
|
+
fieldName: this.name,
|
|
2459
|
+
validationLogic: this.form.options.validationLogic || J
|
|
2460
|
+
}), r = await t, i = this.getLinkedFields(e), a = i.reduce((t, n) => {
|
|
2461
|
+
let r = fn(e, {
|
|
2462
|
+
...n.options,
|
|
2463
|
+
form: n.form,
|
|
2464
|
+
fieldName: n.name,
|
|
2465
|
+
validationLogic: n.form.options.validationLogic || J
|
|
2466
|
+
});
|
|
2467
|
+
return r.forEach((e) => {
|
|
2468
|
+
e.field = n;
|
|
2469
|
+
}), t.concat(r);
|
|
2470
|
+
}, []), o = [], s = [], c = n.some((e) => e.validate) || a.some((e) => e.validate);
|
|
2471
|
+
if (c) {
|
|
2472
|
+
this.state.meta.isValidating || this.setMeta((e) => ({
|
|
2473
|
+
...e,
|
|
2474
|
+
isValidating: !0
|
|
2475
|
+
}));
|
|
2476
|
+
for (let e of i) e.setMeta((e) => ({
|
|
2477
|
+
...e,
|
|
2478
|
+
isValidating: !0
|
|
2479
|
+
}));
|
|
2480
|
+
}
|
|
2481
|
+
let l = (e, t, n) => {
|
|
2482
|
+
let i = En(t.cause), a = e.getInfo();
|
|
2483
|
+
a.validationMetaMap[i]?.lastAbortController.abort();
|
|
2484
|
+
let o = new AbortController();
|
|
2485
|
+
a.validationMetaMap[i] = { lastAbortController: o }, n.push(new Promise(async (n) => {
|
|
2486
|
+
let a;
|
|
2487
|
+
try {
|
|
2488
|
+
a = await new Promise((n, r) => {
|
|
2489
|
+
e.timeoutIds.validations[t.cause] && clearTimeout(e.timeoutIds.validations[t.cause]), e.timeoutIds.validations[t.cause] = setTimeout(async () => {
|
|
2490
|
+
if (o.signal.aborted) return n(void 0);
|
|
2491
|
+
try {
|
|
2492
|
+
n(await this.runValidator({
|
|
2493
|
+
validate: t.validate,
|
|
2494
|
+
value: {
|
|
2495
|
+
value: e.store.state.value,
|
|
2496
|
+
fieldApi: e,
|
|
2497
|
+
signal: o.signal,
|
|
2498
|
+
validationSource: "field"
|
|
2499
|
+
},
|
|
2500
|
+
type: "validateAsync"
|
|
2501
|
+
}));
|
|
2502
|
+
} catch (e) {
|
|
2503
|
+
r(e);
|
|
2504
|
+
}
|
|
2505
|
+
}, t.debounceMs);
|
|
2506
|
+
});
|
|
2507
|
+
} catch (e) {
|
|
2508
|
+
a = e;
|
|
2509
|
+
}
|
|
2510
|
+
if (o.signal.aborted) return n(void 0);
|
|
2511
|
+
let s = Tn(a), c = r[e.name]?.[i], { newErrorValue: l, newSource: u } = mn({
|
|
2512
|
+
formLevelError: c,
|
|
2513
|
+
fieldLevelError: s
|
|
2514
|
+
});
|
|
2515
|
+
if (e.getInfo().instance !== e) return n(void 0);
|
|
2516
|
+
e.setMeta((e) => ({
|
|
2517
|
+
...e,
|
|
2518
|
+
errorMap: {
|
|
2519
|
+
...e?.errorMap,
|
|
2520
|
+
[i]: l
|
|
2521
|
+
},
|
|
2522
|
+
errorSourceMap: {
|
|
2523
|
+
...e.errorSourceMap,
|
|
2524
|
+
[i]: u
|
|
2525
|
+
}
|
|
2526
|
+
})), n(l);
|
|
2527
|
+
}));
|
|
2528
|
+
};
|
|
2529
|
+
for (let e of n) e.validate && l(this, e, o);
|
|
2530
|
+
for (let e of a) e.validate && l(e.field, e, s);
|
|
2531
|
+
let u = [];
|
|
2532
|
+
if ((o.length || s.length) && (u = await Promise.all(o), await Promise.all(s)), c) {
|
|
2533
|
+
this.setMeta((e) => ({
|
|
2534
|
+
...e,
|
|
2535
|
+
isValidating: !1
|
|
2536
|
+
}));
|
|
2537
|
+
for (let e of i) e.setMeta((e) => ({
|
|
2538
|
+
...e,
|
|
2539
|
+
isValidating: !1
|
|
2540
|
+
}));
|
|
2541
|
+
}
|
|
2542
|
+
return u.filter(Boolean);
|
|
2543
|
+
}, this.validate = (e, t) => {
|
|
2544
|
+
if (!this.state.meta.isTouched) return [];
|
|
2545
|
+
let { fieldsErrorMap: n } = t?.skipFormValidation ? { fieldsErrorMap: {} } : this.form.validateSync(e), { hasErrored: r } = this.validateSync(e, n[this.name] ?? {});
|
|
2546
|
+
if (r && !this.options.asyncAlways) return this.getInfo().validationMetaMap[En(e)]?.lastAbortController.abort(), this.state.meta.errors;
|
|
2547
|
+
let i = t?.skipFormValidation ? Promise.resolve({}) : this.form.validateAsync(e);
|
|
2548
|
+
return this.validateAsync(e, i);
|
|
2549
|
+
}, this.handleChange = (e) => {
|
|
2550
|
+
this.setValue(e);
|
|
2551
|
+
}, this.handleBlur = () => {
|
|
2552
|
+
this.state.meta.isTouched || this.setMeta((e) => ({
|
|
2553
|
+
...e,
|
|
2554
|
+
isTouched: !0
|
|
2555
|
+
})), this.state.meta.isBlurred || this.setMeta((e) => ({
|
|
2556
|
+
...e,
|
|
2557
|
+
isBlurred: !0
|
|
2558
|
+
})), this.validate("blur"), this.triggerOnBlurListener();
|
|
2559
|
+
}, this.setErrorMap = (e) => {
|
|
2560
|
+
this.setMeta((t) => ({
|
|
2561
|
+
...t,
|
|
2562
|
+
errorMap: {
|
|
2563
|
+
...t.errorMap,
|
|
2564
|
+
...e
|
|
2565
|
+
}
|
|
2566
|
+
}));
|
|
2567
|
+
}, this.parseValueWithSchema = (e) => Y.validate({
|
|
2568
|
+
value: this.state.value,
|
|
2569
|
+
validationSource: "field"
|
|
2570
|
+
}, e), this.parseValueWithSchemaAsync = (e) => Y.validateAsync({
|
|
2571
|
+
value: this.state.value,
|
|
2572
|
+
validationSource: "field"
|
|
2573
|
+
}, e), this.triggerOnChangeListener = () => {
|
|
2574
|
+
let e = this.form.options.listeners?.onChangeDebounceMs;
|
|
2575
|
+
e && e > 0 ? (this.timeoutIds.formListeners.change && clearTimeout(this.timeoutIds.formListeners.change), this.timeoutIds.formListeners.change = setTimeout(() => {
|
|
2576
|
+
this.form.options.listeners?.onChange?.({
|
|
2577
|
+
formApi: this.form,
|
|
2578
|
+
fieldApi: this
|
|
2579
|
+
});
|
|
2580
|
+
}, e)) : this.form.options.listeners?.onChange?.({
|
|
2581
|
+
formApi: this.form,
|
|
2582
|
+
fieldApi: this
|
|
2583
|
+
});
|
|
2584
|
+
let t = this.options.listeners?.onChangeDebounceMs;
|
|
2585
|
+
t && t > 0 ? (this.timeoutIds.listeners.change && clearTimeout(this.timeoutIds.listeners.change), this.timeoutIds.listeners.change = setTimeout(() => {
|
|
2586
|
+
this.options.listeners?.onChange?.({
|
|
2587
|
+
value: this.state.value,
|
|
2588
|
+
fieldApi: this
|
|
2589
|
+
});
|
|
2590
|
+
}, t)) : this.options.listeners?.onChange?.({
|
|
2591
|
+
value: this.state.value,
|
|
2592
|
+
fieldApi: this
|
|
2593
|
+
});
|
|
2594
|
+
}, this.form = e.form, this.name = e.name, this.options = e, this.timeoutIds = {
|
|
2595
|
+
validations: {},
|
|
2596
|
+
listeners: {},
|
|
2597
|
+
formListeners: {}
|
|
2598
|
+
}, this.store = P((t) => {
|
|
2599
|
+
this.form.store.get();
|
|
2600
|
+
let n = this.form.getFieldMeta(this.name) ?? {
|
|
2601
|
+
...X,
|
|
2602
|
+
...e.defaultMeta
|
|
2603
|
+
}, r = this.form.getFieldValue(this.name);
|
|
2604
|
+
return !n.isTouched && r === void 0 && this.options.defaultValue !== void 0 && !H(r, this.options.defaultValue) && (r = this.options.defaultValue), t && t.value === r && t.meta === n ? t : {
|
|
2605
|
+
value: r,
|
|
2606
|
+
meta: n
|
|
2607
|
+
};
|
|
2608
|
+
});
|
|
2609
|
+
}
|
|
2610
|
+
get state() {
|
|
2611
|
+
return this.store.state;
|
|
2612
|
+
}
|
|
2613
|
+
runValidator(e) {
|
|
2614
|
+
return yn(e.validate) ? Y[e.type](e.value, e.validate) : e.validate(e.value);
|
|
2615
|
+
}
|
|
2616
|
+
triggerOnBlurListener() {
|
|
2617
|
+
let e = this.form.options.listeners?.onBlurDebounceMs;
|
|
2618
|
+
e && e > 0 ? (this.timeoutIds.formListeners.blur && clearTimeout(this.timeoutIds.formListeners.blur), this.timeoutIds.formListeners.blur = setTimeout(() => {
|
|
2619
|
+
this.form.options.listeners?.onBlur?.({
|
|
2620
|
+
formApi: this.form,
|
|
2621
|
+
fieldApi: this
|
|
2622
|
+
});
|
|
2623
|
+
}, e)) : this.form.options.listeners?.onBlur?.({
|
|
2624
|
+
formApi: this.form,
|
|
2625
|
+
fieldApi: this
|
|
2626
|
+
});
|
|
2627
|
+
let t = this.options.listeners?.onBlurDebounceMs;
|
|
2628
|
+
t && t > 0 ? (this.timeoutIds.listeners.blur && clearTimeout(this.timeoutIds.listeners.blur), this.timeoutIds.listeners.blur = setTimeout(() => {
|
|
2629
|
+
this.options.listeners?.onBlur?.({
|
|
2630
|
+
value: this.state.value,
|
|
2631
|
+
fieldApi: this
|
|
2632
|
+
});
|
|
2633
|
+
}, t)) : this.options.listeners?.onBlur?.({
|
|
2634
|
+
value: this.state.value,
|
|
2635
|
+
fieldApi: this
|
|
2636
|
+
});
|
|
2637
|
+
}
|
|
2638
|
+
};
|
|
2639
|
+
function Tn(e) {
|
|
2640
|
+
if (e) return e;
|
|
2641
|
+
}
|
|
2642
|
+
function En(e) {
|
|
2643
|
+
switch (e) {
|
|
2644
|
+
case "submit": return "onSubmit";
|
|
2645
|
+
case "blur": return "onBlur";
|
|
2646
|
+
case "mount": return "onMount";
|
|
2647
|
+
case "server": return "onServer";
|
|
2648
|
+
case "dynamic": return "onDynamic";
|
|
2649
|
+
default: return "onChange";
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
//#endregion
|
|
2653
|
+
//#region node_modules/.pnpm/@tanstack+form-core@1.29.1/node_modules/@tanstack/form-core/dist/esm/FieldGroupApi.js
|
|
2654
|
+
var Dn = class e {
|
|
2655
|
+
constructor(t) {
|
|
2656
|
+
if (this.getFormFieldName = (e) => {
|
|
2657
|
+
if (typeof this.fieldsMap == "string") return ln(this.fieldsMap, e);
|
|
2658
|
+
let t = B(e)[0];
|
|
2659
|
+
if (typeof t != "string") return "";
|
|
2660
|
+
let n = e.slice(t.length), r = this.fieldsMap[t];
|
|
2661
|
+
return ln(r, n);
|
|
2662
|
+
}, this.getFormFieldOptions = (e) => {
|
|
2663
|
+
let t = { ...e }, n = t.validators;
|
|
2664
|
+
if (t.name = this.getFormFieldName(e.name), n && (n.onChangeListenTo || n.onBlurListenTo)) {
|
|
2665
|
+
let e = { ...n }, r = (e) => {
|
|
2666
|
+
if (e) return e.map((e) => this.getFormFieldName(e));
|
|
2667
|
+
};
|
|
2668
|
+
e.onChangeListenTo = r(n.onChangeListenTo), e.onBlurListenTo = r(n.onBlurListenTo), t.validators = e;
|
|
2669
|
+
}
|
|
2670
|
+
return t;
|
|
2671
|
+
}, this.mount = () => () => {}, this.validateArrayFieldsStartingFrom = async (e, t, n) => this.form.validateArrayFieldsStartingFrom(this.getFormFieldName(e), t, n), this.validateField = (e, t) => this.form.validateField(this.getFormFieldName(e), t), this.getFieldValue = (e) => this.form.getFieldValue(this.getFormFieldName(e)), this.getFieldMeta = (e) => this.form.getFieldMeta(this.getFormFieldName(e)), this.setFieldMeta = (e, t) => this.form.setFieldMeta(this.getFormFieldName(e), t), this.setFieldValue = (e, t, n) => this.form.setFieldValue(this.getFormFieldName(e), t, n), this.deleteField = (e) => this.form.deleteField(this.getFormFieldName(e)), this.pushFieldValue = (e, t, n) => this.form.pushFieldValue(this.getFormFieldName(e), t, n), this.insertFieldValue = async (e, t, n, r) => this.form.insertFieldValue(this.getFormFieldName(e), t, n, r), this.replaceFieldValue = async (e, t, n, r) => this.form.replaceFieldValue(this.getFormFieldName(e), t, n, r), this.removeFieldValue = async (e, t, n) => this.form.removeFieldValue(this.getFormFieldName(e), t, n), this.swapFieldValues = (e, t, n, r) => this.form.swapFieldValues(this.getFormFieldName(e), t, n, r), this.moveFieldValues = (e, t, n, r) => this.form.moveFieldValues(this.getFormFieldName(e), t, n, r), this.clearFieldValues = (e, t) => this.form.clearFieldValues(this.getFormFieldName(e), t), this.resetField = (e) => this.form.resetField(this.getFormFieldName(e)), this.validateAllFields = (e) => this.form.validateAllFields(e), t.form instanceof e) {
|
|
2672
|
+
let e = t.form;
|
|
2673
|
+
if (this.form = e.form, typeof t.fields == "string") this.fieldsMap = e.getFormFieldName(t.fields);
|
|
2674
|
+
else {
|
|
2675
|
+
let n = { ...t.fields };
|
|
2676
|
+
for (let t in n) n[t] = e.getFormFieldName(n[t]);
|
|
2677
|
+
this.fieldsMap = n;
|
|
2678
|
+
}
|
|
2679
|
+
} else this.form = t.form, this.fieldsMap = t.fields;
|
|
2680
|
+
this.store = P(() => {
|
|
2681
|
+
let e = this.form.store.get(), t;
|
|
2682
|
+
if (typeof this.fieldsMap == "string") t = L(e.values, this.fieldsMap);
|
|
2683
|
+
else {
|
|
2684
|
+
t = {};
|
|
2685
|
+
let n = this.fieldsMap;
|
|
2686
|
+
for (let r in n) t[r] = L(e.values, n[r]);
|
|
2687
|
+
}
|
|
2688
|
+
return { values: t };
|
|
2689
|
+
});
|
|
2690
|
+
}
|
|
2691
|
+
get state() {
|
|
2692
|
+
return this.store.state;
|
|
2693
|
+
}
|
|
2694
|
+
async handleSubmit(e) {
|
|
2695
|
+
return this.form.handleSubmit(e);
|
|
2696
|
+
}
|
|
2697
|
+
};
|
|
2698
|
+
//#endregion
|
|
2699
|
+
//#region node_modules/.pnpm/@tanstack+form-core@1.29.1/node_modules/@tanstack/form-core/dist/esm/transform.js
|
|
2700
|
+
function On(e, t) {
|
|
2701
|
+
if (!t) return;
|
|
2702
|
+
let n = Object.assign({}, e, { state: q(e.state) });
|
|
2703
|
+
t(n), n.fieldInfo !== e.fieldInfo && (e.fieldInfo = n.fieldInfo), n.options !== e.options && (e.options = n.options);
|
|
2704
|
+
let r = Object.keys({
|
|
2705
|
+
values: null,
|
|
2706
|
+
validationMetaMap: null,
|
|
2707
|
+
fieldMetaBase: null,
|
|
2708
|
+
isSubmitting: null,
|
|
2709
|
+
isSubmitted: null,
|
|
2710
|
+
isValidating: null,
|
|
2711
|
+
submissionAttempts: null,
|
|
2712
|
+
isSubmitSuccessful: null,
|
|
2713
|
+
_force_re_eval: null
|
|
2714
|
+
}).reduce((t, r) => (e.state[r] !== n.state[r] && (t[r] = n.state[r]), t), {});
|
|
2715
|
+
return N(() => {
|
|
2716
|
+
Object.keys(r).length && e.baseStore.setState((e) => ({
|
|
2717
|
+
...e,
|
|
2718
|
+
...r
|
|
2719
|
+
})), n.state.errorMap !== e.state.errorMap && e.setErrorMap(n.state.errorMap);
|
|
2720
|
+
}), n;
|
|
2721
|
+
}
|
|
2722
|
+
//#endregion
|
|
2723
|
+
//#region node_modules/.pnpm/@tanstack+react-store@0.9.3_980f5b5ae26ef77a5d39e0acde3841dd/node_modules/@tanstack/react-store/dist/esm/useStore.js
|
|
2724
|
+
function kn(e, t) {
|
|
2725
|
+
return e === t;
|
|
2726
|
+
}
|
|
2727
|
+
function Q(e, t, n = kn) {
|
|
2728
|
+
let r = o((t) => {
|
|
2729
|
+
if (!e) return () => {};
|
|
2730
|
+
let { unsubscribe: n } = e.subscribe(t);
|
|
2731
|
+
return n;
|
|
2732
|
+
}, [e]), i = o(() => e?.get(), [e]);
|
|
2733
|
+
return g(r, i, i, t, n);
|
|
2734
|
+
}
|
|
2735
|
+
//#endregion
|
|
2736
|
+
//#region node_modules/.pnpm/@tanstack+react-form@1.29.1_b398a8b475773749cca68c037a8226bf/node_modules/@tanstack/react-form/dist/esm/useIsomorphicLayoutEffect.js
|
|
2737
|
+
var $ = typeof window < "u" ? l : c;
|
|
2738
|
+
//#endregion
|
|
2739
|
+
//#region node_modules/.pnpm/@tanstack+react-form@1.29.1_b398a8b475773749cca68c037a8226bf/node_modules/@tanstack/react-form/dist/esm/useField.js
|
|
2740
|
+
function An(e) {
|
|
2741
|
+
let [t, n] = f(() => ({
|
|
2742
|
+
form: e.form,
|
|
2743
|
+
name: e.name
|
|
2744
|
+
})), [r, i] = f(() => new wn({ ...e }));
|
|
2745
|
+
(t.form !== e.form || t.name !== e.name) && (i(new wn({ ...e })), n({
|
|
2746
|
+
form: e.form,
|
|
2747
|
+
name: e.name
|
|
2748
|
+
}));
|
|
2749
|
+
let a = Q(r.store, e.mode === "array" ? (e) => Object.keys(e.value ?? []).length : (e) => e.value), o = Q(r.store, (e) => e.meta.isTouched), s = Q(r.store, (e) => e.meta.isBlurred), c = Q(r.store, (e) => e.meta.isDirty), l = Q(r.store, (e) => e.meta.errorMap), d = Q(r.store, (e) => e.meta.errorSourceMap), p = Q(r.store, (e) => e.meta.isValidating), m = u(() => {
|
|
2750
|
+
let t = {
|
|
2751
|
+
...r,
|
|
2752
|
+
get state() {
|
|
2753
|
+
return {
|
|
2754
|
+
value: e.mode === "array" ? r.state.value : a,
|
|
2755
|
+
get meta() {
|
|
2756
|
+
return {
|
|
2757
|
+
...r.state.meta,
|
|
2758
|
+
isTouched: o,
|
|
2759
|
+
isBlurred: s,
|
|
2760
|
+
isDirty: c,
|
|
2761
|
+
errorMap: l,
|
|
2762
|
+
errorSourceMap: d,
|
|
2763
|
+
isValidating: p
|
|
2764
|
+
};
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
}
|
|
2768
|
+
};
|
|
2769
|
+
return t.Field = jn, t;
|
|
2770
|
+
}, [
|
|
2771
|
+
r,
|
|
2772
|
+
e.mode,
|
|
2773
|
+
a,
|
|
2774
|
+
o,
|
|
2775
|
+
s,
|
|
2776
|
+
c,
|
|
2777
|
+
l,
|
|
2778
|
+
d,
|
|
2779
|
+
p
|
|
2780
|
+
]);
|
|
2781
|
+
return $(r.mount, [r]), $(() => {
|
|
2782
|
+
r.update(e);
|
|
2783
|
+
}), m;
|
|
2784
|
+
}
|
|
2785
|
+
var jn = (({ children: e, ...t }) => {
|
|
2786
|
+
let n = An(t);
|
|
2787
|
+
return /* @__PURE__ */ m(p, { children: u(() => I(e, n), [e, n]) });
|
|
2788
|
+
});
|
|
2789
|
+
//#endregion
|
|
2790
|
+
//#region node_modules/.pnpm/@tanstack+react-form@1.29.1_b398a8b475773749cca68c037a8226bf/node_modules/@tanstack/react-form/dist/esm/useUUID.js
|
|
2791
|
+
function Mn() {
|
|
2792
|
+
return f(() => hn())[0];
|
|
2793
|
+
}
|
|
2794
|
+
//#endregion
|
|
2795
|
+
//#region node_modules/.pnpm/@tanstack+react-form@1.29.1_b398a8b475773749cca68c037a8226bf/node_modules/@tanstack/react-form/dist/esm/useFormId.js
|
|
2796
|
+
var Nn = n, Pn = n.version.split(".")[0] === "17" ? Mn : Nn.useId;
|
|
2797
|
+
//#endregion
|
|
2798
|
+
//#region node_modules/.pnpm/@tanstack+react-form@1.29.1_b398a8b475773749cca68c037a8226bf/node_modules/@tanstack/react-form/dist/esm/useForm.js
|
|
2799
|
+
function Fn({ form: e, selector: t = (e) => e, children: n }) {
|
|
2800
|
+
return /* @__PURE__ */ m(p, { children: I(n, Q(e.store, t)) });
|
|
2801
|
+
}
|
|
2802
|
+
function In(e) {
|
|
2803
|
+
let t = Pn(), [n, r] = f(e?.formId), [i, a] = f(() => new Sn({
|
|
2804
|
+
...e,
|
|
2805
|
+
formId: e?.formId ?? t
|
|
2806
|
+
}));
|
|
2807
|
+
if (n !== e?.formId) {
|
|
2808
|
+
let n = e?.formId ?? t;
|
|
2809
|
+
a(new Sn({
|
|
2810
|
+
...e,
|
|
2811
|
+
formId: n
|
|
2812
|
+
})), r(n);
|
|
2813
|
+
}
|
|
2814
|
+
let o = u(() => {
|
|
2815
|
+
let e = {
|
|
2816
|
+
...i,
|
|
2817
|
+
handleSubmit: ((...e) => i._handleSubmit(...e)),
|
|
2818
|
+
get formId() {
|
|
2819
|
+
return i._formId;
|
|
2820
|
+
},
|
|
2821
|
+
get state() {
|
|
2822
|
+
return i.store.state;
|
|
2823
|
+
}
|
|
2824
|
+
};
|
|
2825
|
+
return e.Field = function(e) {
|
|
2826
|
+
return /* @__PURE__ */ m(jn, {
|
|
2827
|
+
...e,
|
|
2828
|
+
form: i
|
|
2829
|
+
});
|
|
2830
|
+
}, e.Subscribe = function(e) {
|
|
2831
|
+
return /* @__PURE__ */ m(Fn, {
|
|
2832
|
+
form: i,
|
|
2833
|
+
selector: e.selector,
|
|
2834
|
+
children: e.children
|
|
2835
|
+
});
|
|
2836
|
+
}, e;
|
|
2837
|
+
}, [i]);
|
|
2838
|
+
$(i.mount, []), $(() => {
|
|
2839
|
+
i.update(e);
|
|
2840
|
+
});
|
|
2841
|
+
let s = d(!1);
|
|
2842
|
+
return $(() => {
|
|
2843
|
+
s.current && e?.transform && On(i, e.transform);
|
|
2844
|
+
}, [i, e?.transform]), $(() => {
|
|
2845
|
+
s.current = !0;
|
|
2846
|
+
}), o;
|
|
2847
|
+
}
|
|
2848
|
+
//#endregion
|
|
2849
|
+
//#region node_modules/.pnpm/@tanstack+react-form@1.29.1_b398a8b475773749cca68c037a8226bf/node_modules/@tanstack/react-form/dist/esm/useFieldGroup.js
|
|
2850
|
+
function Ln({ lens: e, selector: t = (e) => e, children: n }) {
|
|
2851
|
+
return /* @__PURE__ */ m(p, { children: I(n, Q(e.store, t)) });
|
|
2852
|
+
}
|
|
2853
|
+
function Rn(e) {
|
|
2854
|
+
let [t] = f(() => {
|
|
2855
|
+
let n = new Dn(e), r = e.form instanceof Dn ? e.form.form : e.form, i = n;
|
|
2856
|
+
return i.AppForm = function(e) {
|
|
2857
|
+
return /* @__PURE__ */ m(r.AppForm, { ...e });
|
|
2858
|
+
}, i.AppField = function(e) {
|
|
2859
|
+
return /* @__PURE__ */ m(r.AppField, { ...t.getFormFieldOptions(e) });
|
|
2860
|
+
}, i.Field = function(e) {
|
|
2861
|
+
return /* @__PURE__ */ m(r.Field, { ...t.getFormFieldOptions(e) });
|
|
2862
|
+
}, i.Subscribe = function(e) {
|
|
2863
|
+
return /* @__PURE__ */ m(Ln, {
|
|
2864
|
+
lens: t,
|
|
2865
|
+
selector: e.selector,
|
|
2866
|
+
children: e.children
|
|
2867
|
+
});
|
|
2868
|
+
}, Object.assign(i, { ...e.formComponents });
|
|
2869
|
+
});
|
|
2870
|
+
return $(t.mount, [t]), t;
|
|
2871
|
+
}
|
|
2872
|
+
//#endregion
|
|
2873
|
+
//#region node_modules/.pnpm/@tanstack+react-form@1.29.1_b398a8b475773749cca68c037a8226bf/node_modules/@tanstack/react-form/dist/esm/createFormHook.js
|
|
2874
|
+
var zn = r(null), Bn = r(null);
|
|
2875
|
+
function Vn() {
|
|
2876
|
+
let e = s(Bn);
|
|
2877
|
+
if (!e) throw Error("`formContext` only works when within a `formComponent` passed to `createFormHook`");
|
|
2878
|
+
return e;
|
|
2879
|
+
}
|
|
2880
|
+
function Hn() {
|
|
2881
|
+
function e() {
|
|
2882
|
+
let e = s(zn);
|
|
2883
|
+
if (!e) throw Error("`fieldContext` only works when within a `fieldComponent` passed to `createFormHook`");
|
|
2884
|
+
return e;
|
|
2885
|
+
}
|
|
2886
|
+
return {
|
|
2887
|
+
fieldContext: zn,
|
|
2888
|
+
useFieldContext: e,
|
|
2889
|
+
useFormContext: Vn,
|
|
2890
|
+
formContext: Bn
|
|
2891
|
+
};
|
|
2892
|
+
}
|
|
2893
|
+
function Un({ fieldComponents: e, fieldContext: t, formContext: n, formComponents: r }) {
|
|
2894
|
+
function i(i) {
|
|
2895
|
+
let a = In(i), o = u(() => ({ children: e }) => /* @__PURE__ */ m(n.Provider, {
|
|
2896
|
+
value: a,
|
|
2897
|
+
children: e
|
|
2898
|
+
}), [a]), s = u(() => (({ children: n, ...r }) => /* @__PURE__ */ m(a.Field, {
|
|
2899
|
+
...r,
|
|
2900
|
+
children: (r) => /* @__PURE__ */ m(t.Provider, {
|
|
2901
|
+
value: r,
|
|
2902
|
+
children: n(Object.assign(r, e))
|
|
2903
|
+
})
|
|
2904
|
+
})), [a]);
|
|
2905
|
+
return u(() => Object.assign(a, {
|
|
2906
|
+
AppField: s,
|
|
2907
|
+
AppForm: o,
|
|
2908
|
+
...r
|
|
2909
|
+
}), [
|
|
2910
|
+
a,
|
|
2911
|
+
s,
|
|
2912
|
+
o
|
|
2913
|
+
]);
|
|
2914
|
+
}
|
|
2915
|
+
function a({ render: e, props: t }) {
|
|
2916
|
+
return function(n) {
|
|
2917
|
+
return e({
|
|
2918
|
+
...t,
|
|
2919
|
+
...n
|
|
2920
|
+
});
|
|
2921
|
+
};
|
|
2922
|
+
}
|
|
2923
|
+
function o({ render: e, props: t, defaultValues: n }) {
|
|
2924
|
+
return function(i) {
|
|
2925
|
+
let a = Rn(u(() => ({
|
|
2926
|
+
form: i.form,
|
|
2927
|
+
fields: i.fields,
|
|
2928
|
+
defaultValues: n,
|
|
2929
|
+
formComponents: r
|
|
2930
|
+
}), [i.form, i.fields]));
|
|
2931
|
+
return e({
|
|
2932
|
+
...t,
|
|
2933
|
+
...i,
|
|
2934
|
+
group: a
|
|
2935
|
+
});
|
|
2936
|
+
};
|
|
2937
|
+
}
|
|
2938
|
+
function s(e) {
|
|
2939
|
+
return Vn();
|
|
2940
|
+
}
|
|
2941
|
+
function c(i) {
|
|
2942
|
+
return Un({
|
|
2943
|
+
fieldContext: t,
|
|
2944
|
+
formContext: n,
|
|
2945
|
+
fieldComponents: {
|
|
2946
|
+
...e,
|
|
2947
|
+
...i.fieldComponents
|
|
2948
|
+
},
|
|
2949
|
+
formComponents: {
|
|
2950
|
+
...r,
|
|
2951
|
+
...i.formComponents
|
|
2952
|
+
}
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
return {
|
|
2956
|
+
useAppForm: i,
|
|
2957
|
+
withForm: a,
|
|
2958
|
+
withFieldGroup: o,
|
|
2959
|
+
useTypedAppFormContext: s,
|
|
2960
|
+
extendForm: c
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2963
|
+
//#endregion
|
|
2964
|
+
//#region src/components/form/form-errors.tsx
|
|
2965
|
+
var Wn = ({ className: e, children: n, ref: r, ...i }) => /* @__PURE__ */ m(ir().Subscribe, {
|
|
2966
|
+
selector: (e) => [e.errors],
|
|
2967
|
+
children: ([a]) => {
|
|
2968
|
+
if (!a || a.length === 0) return null;
|
|
2969
|
+
let o = [];
|
|
2970
|
+
return a.forEach((e) => {
|
|
2971
|
+
Object.values(e).forEach((e) => {
|
|
2972
|
+
Array.isArray(e) && e.forEach((e) => {
|
|
2973
|
+
e?.message && o.push(e.message);
|
|
2974
|
+
});
|
|
2975
|
+
});
|
|
2976
|
+
}), /* @__PURE__ */ h(wt, {
|
|
2977
|
+
className: t("", e),
|
|
2978
|
+
ref: r,
|
|
2979
|
+
tone: "error",
|
|
2980
|
+
...i,
|
|
2981
|
+
children: [/* @__PURE__ */ m(Pt, { weight: "duotone" }), /* @__PURE__ */ h(Et, { children: [n, /* @__PURE__ */ m(Tt, { children: /* @__PURE__ */ m("ul", { children: o.length > 0 ? o.map((e) => /* @__PURE__ */ m("li", { children: e }, e)) : /* @__PURE__ */ m("li", {
|
|
2982
|
+
className: "style-text-prose--1",
|
|
2983
|
+
children: a.toString()
|
|
2984
|
+
}) }) })] })]
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
}), Gn = ({ className: e, children: n, ref: r, ...i }) => {
|
|
2988
|
+
let a = ir(), o = () => {
|
|
2989
|
+
a.reset();
|
|
2990
|
+
};
|
|
2991
|
+
return /* @__PURE__ */ m(a.Subscribe, {
|
|
2992
|
+
selector: (e) => e,
|
|
2993
|
+
children: (a) => /* @__PURE__ */ m(kt, {
|
|
2994
|
+
className: t("w-full", e),
|
|
2995
|
+
disabled: !a.values,
|
|
2996
|
+
onClick: o,
|
|
2997
|
+
ref: r,
|
|
2998
|
+
type: "reset",
|
|
2999
|
+
...i,
|
|
3000
|
+
children: n
|
|
3001
|
+
})
|
|
3002
|
+
});
|
|
3003
|
+
}, Kn = ({ className: e, children: n, ref: r, ...i }) => /* @__PURE__ */ m(ir().Subscribe, {
|
|
3004
|
+
selector: (e) => e,
|
|
3005
|
+
children: (a) => /* @__PURE__ */ m(kt, {
|
|
3006
|
+
className: t("w-full", e),
|
|
3007
|
+
disabled: a.isSubmitting || !a.canSubmit,
|
|
3008
|
+
ref: r,
|
|
3009
|
+
type: "submit",
|
|
3010
|
+
...i,
|
|
3011
|
+
children: a.isSubmitting ? /* @__PURE__ */ m(Nt, {
|
|
3012
|
+
className: "animate-spin",
|
|
3013
|
+
weight: "bold"
|
|
3014
|
+
}) : n
|
|
3015
|
+
})
|
|
3016
|
+
}), qn = a(() => import("./field-description-BDRJXMS8.js").then((e) => e.n).then((e) => ({ default: e.FieldDescription }))), Jn = a(() => import("./field-errors-BDUanNiE.js").then((e) => e.n).then((e) => ({ default: e.FieldErrors }))), Yn = a(() => import("./field-input-0WxX-93A.js").then((e) => e.n).then((e) => ({ default: e.FieldInput }))), Xn = a(() => import("./field-input-group-Dcwadst3.js").then((e) => ({ default: e.FieldInputGroup }))), Zn = a(() => import("./field-input-group-input-CLQz2SPo.js").then((e) => ({ default: e.FieldInputGroupInput }))), Qn = a(() => import("./field-label-DwF_1o76.js").then((e) => e.n).then((e) => ({ default: e.FieldLabel }))), $n = a(() => import("./field-select-BmvhGVSz.js").then((e) => e.n).then((e) => ({ default: e.FieldSelect }))), er = a(() => import("./field-slider-oL8pDrCe.js").then((e) => e.n).then((e) => ({ default: e.FieldSlider }))), { fieldContext: tr, useFieldContext: nr, formContext: rr, useFormContext: ir } = Hn(), { useAppForm: ar, withFieldGroup: or, withForm: sr, useTypedAppFormContext: cr } = Un({
|
|
3017
|
+
fieldContext: tr,
|
|
3018
|
+
fieldComponents: {
|
|
3019
|
+
FieldDescription: qn,
|
|
3020
|
+
FieldErrors: Jn,
|
|
3021
|
+
FieldInput: Yn,
|
|
3022
|
+
FieldInputGroup: Xn,
|
|
3023
|
+
FieldInputGroupInput: Zn,
|
|
3024
|
+
FieldLabel: Qn,
|
|
3025
|
+
FieldSelect: $n,
|
|
3026
|
+
FieldSlider: er
|
|
3027
|
+
},
|
|
3028
|
+
formContext: rr,
|
|
3029
|
+
formComponents: {
|
|
3030
|
+
FormErrors: Wn,
|
|
3031
|
+
FormReset: Gn,
|
|
3032
|
+
FormSubmit: Kn
|
|
3033
|
+
}
|
|
3034
|
+
});
|
|
3035
|
+
//#endregion
|
|
3036
|
+
export { v as $, at as A, Ge as B, Je as C, ft as D, ut as E, $e as F, be as G, S as H, Qe as I, le as J, _e as K, et as L, Ze as M, ct as N, O, Ye as P, b as Q, tt as R, ot as S, qe as T, xe as U, Ie as V, x as W, ae as X, se as Y, ne as Z, St as _, ir as a, ht as b, sr as c, Wn as d, k as f, wt as g, Tt as h, nr as i, Xe as j, E as k, Kn as l, Et as m, rr as n, cr as o, kt as p, ue as q, ar as r, or as s, tr as t, Gn as u, _t as v, pt as w, lt as x, mt as y, st as z };
|