@nxgt/material 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +180 -0
- package/README.md +7 -4
- package/dist/{_Uint8Array-JRUmWcRr.js → _Uint8Array-CALbCR7W.js} +1 -1
- package/dist/{_overRest-DvC5rm5s.js → _overRest-BQ8agsDH.js} +1 -1
- package/dist/{abnfDiagram-O67JEVCF-Cl4ukf6a.js → abnfDiagram-O67JEVCF-D-rmT4BY.js} +4 -4
- package/dist/{architectureDiagram-NJMV4G6O-WmFlBQF5.js → architectureDiagram-NJMV4G6O-DOc_c_T9.js} +7 -7
- package/dist/{async-slice-OftEOtMA.js → async-slice-BHMdvnqm.js} +2 -2
- package/dist/{blockDiagram-BEXU5L5S-BM-gkWAO.js → blockDiagram-BEXU5L5S-D4gI6nqs.js} +11 -11
- package/dist/{c4Diagram-YGBWAQC7-D9xSt2QO.js → c4Diagram-YGBWAQC7-El4SkIzX.js} +8 -8
- package/dist/{channel-Dg92Hoym.js → channel-CnLB6790.js} +1 -1
- package/dist/{chunk-3FUC2YCW-Cf18L00V.js → chunk-3FUC2YCW-BLMCnCFE.js} +8 -8
- package/dist/{chunk-5DYCD2WN-Cja1INgd.js → chunk-5DYCD2WN-Cd1zazNp.js} +3 -3
- package/dist/{chunk-6AEJRKK7-3YWRP4aV.js → chunk-6AEJRKK7-BLBlw8ui.js} +2 -2
- package/dist/{chunk-742MDFTN-Cs1qGiTK.js → chunk-742MDFTN-CsUjFyzK.js} +2 -2
- package/dist/{chunk-7INBJB4K-BY5n77ka.js → chunk-7INBJB4K-k-I67NSP.js} +6 -6
- package/dist/{chunk-7M6MHVWA-C3x6E3yT.js → chunk-7M6MHVWA-CUtKEeuL.js} +9 -9
- package/dist/{chunk-7PRAP22T-_Av9vcXz.js → chunk-7PRAP22T-0C6_H8Li.js} +1 -1
- package/dist/{chunk-GNY47TPC-D1E6DHDV.js → chunk-GNY47TPC-CB_83G7J.js} +11 -11
- package/dist/{chunk-GTNCS2PH-BZ9WMD1v.js → chunk-GTNCS2PH-AJi9PVT7.js} +3 -3
- package/dist/{chunk-GWA4HPMP-Co-A6dtV.js → chunk-GWA4HPMP-B8jXI0Tl.js} +3 -3
- package/dist/{chunk-MBY4JIJT-C3RQP_Nk.js → chunk-MBY4JIJT-BFIqOe-8.js} +4 -4
- package/dist/{chunk-NETBCI7D-DJUuN4EY.js → chunk-NETBCI7D-Cywmx0rz.js} +1 -1
- package/dist/{chunk-O7XYJQB3-A66QSOPA.js → chunk-O7XYJQB3-BChweQ_V.js} +1 -1
- package/dist/{chunk-UA2S7LBM-BNeHeMx9.js → chunk-UA2S7LBM-ChuksCDg.js} +6 -6
- package/dist/{chunk-WEXAMYUT-CucJfehv.js → chunk-WEXAMYUT-CbFOhEve.js} +2 -2
- package/dist/{chunk-XXDRQBXY-FgXU14Bh.js → chunk-XXDRQBXY-dKXxu_aj.js} +1 -1
- package/dist/{chunk-Z7XXMR3K-DMTBxZxM.js → chunk-Z7XXMR3K-Ccb3Rfjl.js} +8 -8
- package/dist/{chunk-ZIGJFQKS-C3xUAXJq.js → chunk-ZIGJFQKS-9VXArDKF.js} +3 -3
- package/dist/{classDiagram-v2-NBCMYWYE-BDaxYvDy.js → classDiagram-v2-NBCMYWYE-CRgxPgLD.js} +14 -14
- package/dist/clsx-CbxlCXZ3.js +16 -0
- package/dist/components/base-content.css +139 -0
- package/dist/components/base.css +150 -0
- package/dist/components/components.css +2 -0
- package/dist/components/reduced-motion.css +56 -0
- package/dist/components/theme-tokens.css +116 -0
- package/dist/components/ui/actions/button-group/button-group.css +1 -1
- package/dist/components/ui/feedback/toast/toast.css +21 -0
- package/dist/components/ui/primitives/label/label.css +33 -0
- package/dist/{components-DrStgM4J.js → components-Bg1bqGbc.js} +34666 -34274
- package/dist/components.js +6 -6
- package/dist/{cose-bilkent-JH36ORCC-DRUT3qBb.js → cose-bilkent-JH36ORCC-P94vkHv_.js} +2 -2
- package/dist/{cynefinDiagram-VND7K2PF-B9HrdQW8.js → cynefinDiagram-VND7K2PF-EIpXbLXm.js} +4 -4
- package/dist/{dagre-6A5THRUB-DZF0nICj.js → dagre-6A5THRUB-c8yG3_vh.js} +20 -20
- package/dist/{diagram-22UHCM2B-CVZYpeev.js → diagram-22UHCM2B-C3Xcfy6D.js} +15 -15
- package/dist/{diagram-3UASUU5V-D7MmBJbM.js → diagram-3UASUU5V-maEO61Bh.js} +7 -7
- package/dist/{diagram-ATOU4E4O-CNY-8kl0.js → diagram-ATOU4E4O-isL7nwg2.js} +3 -3
- package/dist/{diagram-CDSNMT55-C8Mk1smi.js → diagram-CDSNMT55-Bnhlo5at.js} +5 -5
- package/dist/{diagram-MLGK6HIB-CpfeILwW.js → diagram-MLGK6HIB-DvBcyz8v.js} +4 -4
- package/dist/{diagram-MPIPVDR6-Do7bUnTd.js → diagram-MPIPVDR6-iTevwmNE.js} +4 -4
- package/dist/{dist-C3YK_ean.js → dist-B6_-RPZ3.js} +1 -1
- package/dist/{dist-CRbPtqwD.js → dist-BvUQHUs_.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{ebnfDiagram-ZINNZB2B-1GewX9Zq.js → ebnfDiagram-ZINNZB2B-RVuQIpm0.js} +4 -4
- package/dist/{elk-276RUBZZ-DI4eicFj.js → elk-276RUBZZ-BoWoJr6K.js} +26 -26
- package/dist/{erDiagram-OPXOYQCR-CUbpVns3.js → erDiagram-OPXOYQCR-CVvgZCSJ.js} +14 -14
- package/dist/field-blur-Bwa48QBk.js +3637 -0
- package/dist/flowDiagram-KWPJA3E3-RdU0csul.js +17 -0
- package/dist/{ganttDiagram-FUAMR5RP-D3vmspam.js → ganttDiagram-FUAMR5RP-DPLDPJtJ.js} +6 -6
- package/dist/{gitGraphDiagram-X574FWY7-80yOq8dE.js → gitGraphDiagram-X574FWY7-DerJL1Q-.js} +3 -3
- package/dist/{graphlib-DLJn7qS3.js → graphlib-DHgEBs83.js} +6 -6
- package/dist/hooks.js +3 -3
- package/dist/{i18n-provider-DBFRz5uH.js → i18n-provider-CA8YAlje.js} +1 -1
- package/dist/i18n.js +6 -6
- package/dist/icon-button-G9zdQ3Ix.js +2753 -0
- package/dist/{infoDiagram-VRGFBTTK-Cboh-B9n.js → infoDiagram-VRGFBTTK-CtVsLyCQ.js} +3 -3
- package/dist/{isArrayLikeObject-CO5xeuaJ.js → isArrayLikeObject-BSfDsA7T.js} +3 -3
- package/dist/{isEmpty-DOC38Ces.js → isEmpty-BEe-nNXw.js} +3 -3
- package/dist/{ishikawaDiagram-OU5B5YK6-DwTd1YxL.js → ishikawaDiagram-OU5B5YK6-D1n8vp8C.js} +4 -4
- package/dist/{journeyDiagram-ZHPQQLJL-Dxvl3oeN.js → journeyDiagram-ZHPQQLJL-CTGnr-JY.js} +4 -4
- package/dist/{kanban-definition-PNTS6WVX-S8plI4wn.js → kanban-definition-PNTS6WVX-D1-Owjil.js} +10 -10
- package/dist/lib/components/ui/actions/button/busy-click-capture.d.ts +11 -0
- package/dist/lib/components/ui/actions/button/button-tones.d.ts +36 -0
- package/dist/lib/components/ui/actions/button/button.d.ts +19 -0
- package/dist/lib/components/ui/actions/button/button.wrap.d.ts +8 -0
- package/dist/lib/components/ui/actions/button/label-text.d.ts +10 -0
- package/dist/lib/components/ui/actions/button/use-click-lock.d.ts +18 -0
- package/dist/lib/components/ui/actions/copy-button/copy-button.d.ts +5 -1
- package/dist/lib/components/ui/actions/icon-button/icon-button.compound-variants.d.ts +114 -0
- package/dist/lib/components/ui/collections/data-table/hooks.d.ts +13 -13
- package/dist/lib/components/ui/collections/data-table/partials/data-table-empty-row.d.ts +5 -1
- package/dist/lib/components/ui/collections/data-table/partials/data-table-scroll-region.d.ts +16 -0
- package/dist/lib/components/ui/collections/data-table/partials/data-table-toolbar.d.ts +24 -0
- package/dist/lib/components/ui/collections/data-table/select-checkbox.d.ts +10 -0
- package/dist/lib/components/ui/collections/data-table/types.d.ts +9 -0
- package/dist/lib/components/ui/collections/data-table/use-data-table.d.ts +12 -1
- package/dist/lib/components/ui/collections/data-table/use-scroll-edges.d.ts +22 -0
- package/dist/lib/components/ui/dates/calendar/calendar-day.d.ts +8 -0
- package/dist/lib/components/ui/dates/calendar/calendar.d.ts +3 -3
- package/dist/lib/components/ui/dates/calendar/calendar.utils.d.ts +8 -0
- package/dist/lib/components/ui/dates/calendar/use-calendar-labels.d.ts +22 -0
- package/dist/lib/components/ui/display/description/description.d.ts +2 -1
- package/dist/lib/components/ui/display/list-tile/list-tile.d.ts +9 -1
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-body.d.ts +11 -0
- package/dist/lib/components/ui/display/list-tile/partials/list-tile-classes.d.ts +10 -0
- package/dist/lib/components/ui/feedback/alert-dialog/alert-dialog.d.ts +1 -1
- package/dist/lib/components/ui/feedback/toast/partials/toast-actions.d.ts +3 -0
- package/dist/lib/components/ui/feedback/toast/toast.d.ts +27 -3
- package/dist/lib/components/ui/feedback/toast/toaster.d.ts +19 -0
- package/dist/lib/components/ui/feedback/toast/toasts.d.ts +3 -0
- package/dist/lib/components/ui/forms/field-blur.d.ts +7 -2
- package/dist/lib/components/ui/forms/use-field-blur.d.ts +8 -1
- package/dist/lib/components/ui/layout/app-shell/activity-content.d.ts +10 -1
- package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +26 -2
- package/dist/lib/components/ui/layout/app-shell/app-header.d.ts +8 -2
- package/dist/lib/components/ui/layout/app-shell/app-sidebar.d.ts +8 -2
- package/dist/lib/components/ui/layout/app-shell/types.d.ts +3 -0
- package/dist/lib/components/ui/layout/app-shell/use-content-scroll.d.ts +10 -0
- package/dist/lib/components/ui/layout/app-shell/use-navigation-sheet.d.ts +19 -0
- package/dist/lib/components/ui/layout/sidebar/index.d.ts +5 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-content.d.ts +2 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-context.d.ts +7 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-footer.d.ts +2 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-header.d.ts +2 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-menu-item-tooltip.d.ts +7 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-menu-item.d.ts +31 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar-menu-label.d.ts +4 -0
- package/dist/lib/components/ui/layout/sidebar/sidebar.d.ts +1 -12
- package/dist/lib/components/ui/overlays/context-menu/context-menu-items.d.ts +10 -0
- package/dist/lib/components/ui/overlays/context-menu/context-menu-sub.d.ts +8 -0
- package/dist/lib/components/ui/overlays/context-menu/context-menu.d.ts +4 -14
- package/dist/lib/components/ui/overlays/dialog/dialog-outside.d.ts +6 -0
- package/dist/lib/components/ui/overlays/dialog/dialog-scroll-content.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dialog/dialog.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dialog/use-return-focus.d.ts +3 -2
- package/dist/lib/components/ui/overlays/drawer/drawer.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dropdown-menu/dropdown-menu-items.d.ts +11 -0
- package/dist/lib/components/ui/overlays/dropdown-menu/dropdown-menu-sub.d.ts +8 -0
- package/dist/lib/components/ui/overlays/dropdown-menu/dropdown-menu.d.ts +6 -21
- package/dist/lib/components/ui/overlays/popover/popover.d.ts +1 -1
- package/dist/lib/components/ui/overlays/sheet/sheet.d.ts +1 -1
- package/dist/lib/components/ui/primitives/card/card.d.ts +10 -1
- package/dist/lib/components/ui/primitives/link/link-component.d.ts +14 -0
- package/dist/lib/components/ui/selection/select/select.d.ts +1 -1
- package/dist/lib/components/ui/selection/select-chip-field/select-chip-field.d.ts +1 -1
- package/dist/lib/i18n/resources/en/en.d.ts +9 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +13 -4
- package/dist/lib/i18n/resources/fr/fr.d.ts +9 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +13 -4
- package/dist/lib/i18n/resources/resources.d.ts +18 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/lib/redux/status-slice.d.ts +1 -1
- package/dist/lib.js +39 -55
- package/dist/main.js +13 -13
- package/dist/map.js +35 -35
- package/dist/material.css +1 -1
- package/dist/{merge-CuDTNgpm.js → merge-CRXQ4NSv.js} +4 -4
- package/dist/{mermaid.core-O7mtb1-p.js → mermaid.core-C_JPRVNa.js} +49 -49
- package/dist/{mindmap-definition-NLK3R4M7-CO0E97EZ.js → mindmap-definition-NLK3R4M7-OTZIWZah.js} +13 -13
- package/dist/{pegDiagram-GJSIUBJH-CAO6aYvj.js → pegDiagram-GJSIUBJH-CWKobqLl.js} +4 -4
- package/dist/{pieDiagram-5QR66LMP-BXxVfv5K.js → pieDiagram-5QR66LMP-BpmwlCYh.js} +5 -5
- package/dist/print.js +2 -2
- package/dist/{quadrantDiagram-O4NWA36T-BbidZDM8.js → quadrantDiagram-O4NWA36T-CIFt4MgA.js} +3 -3
- package/dist/{railroadDiagram-XR7U4H2S-DmKDXg8V.js → railroadDiagram-XR7U4H2S-fsZ7oqPG.js} +4 -4
- package/dist/{requirementDiagram-PLB6GJNP-wFvgSWJP.js → requirementDiagram-PLB6GJNP-BJaiDsKj.js} +13 -13
- package/dist/rolldown-runtime-BFFgcFxR.js +30 -0
- package/dist/{sankeyDiagram-IPEJSGJF-Cka5t09q.js → sankeyDiagram-IPEJSGJF-XDAIB5as.js} +3 -3
- package/dist/{sequenceDiagram-PO4LG4MO-B2qb55A5.js → sequenceDiagram-PO4LG4MO-Bgx1kuGA.js} +5 -5
- package/dist/{sortable-provider-C5VYhY8u.js → sortable-provider-MCgOzfRp.js} +24 -24
- package/dist/{src-C9kQSo6K.js → src-CsLQInsN.js} +1 -1
- package/dist/{stateDiagram-v2-GCMORJYK-EMa7q3ju.js → stateDiagram-v2-GCMORJYK-CGo16q99.js} +14 -14
- package/dist/{stored-language-B0o4cBh8.js → stored-language-Cz89IYZX.js} +26 -8
- package/dist/styles.css +10 -368
- package/dist/{swimlanes-2SLR337P-BtZ7Di5u.js → swimlanes-2SLR337P-DXZt0zyd.js} +12 -12
- package/dist/swimlanesDiagram-TC7HE7FX-Cno6MSMH.js +28 -0
- package/dist/{timeline-definition-EJHVYXUP-2Z6UABw8.js → timeline-definition-EJHVYXUP-CbPIZcT7.js} +5 -5
- package/dist/{translate-material-BCwQrt2G.js → translate-material-Caxsy0bp.js} +2 -2
- package/dist/{translator-CwpmpI24.js → translator-B85Q_O55.js} +1 -1
- package/dist/{use-heading-spy-BtBJiU63.js → use-heading-spy-C4yWEr5c.js} +37 -37
- package/dist/{use-material-translation-DG_7z3Q7.js → use-material-translation-Cm3Ej3bT.js} +2 -2
- package/dist/{usecaseDiagram-POWQR4AR-DT56cp_B.js → usecaseDiagram-POWQR4AR-D_gyFA3m.js} +13 -13
- package/dist/{utils-UBn-46YY.js → utils-DC8bw9A_.js} +346 -360
- package/dist/{vennDiagram-UO4OBE2U-CO0yFCI8.js → vennDiagram-UO4OBE2U-BpgP__1T.js} +4 -4
- package/dist/{wardleyDiagram-VNRHLVJA-QkwghAYo.js → wardleyDiagram-VNRHLVJA-CYqKMb2f.js} +4 -4
- package/dist/{xychartDiagram-PMCCYNJV-B2aZlrno.js → xychartDiagram-PMCCYNJV-W-fXV6iN.js} +7 -7
- package/docs/components/buttons-and-actions.md +60 -10
- package/docs/components/data-display.md +23 -1
- package/docs/components/data-table-filter-and-lists.md +88 -10
- package/docs/components/date-and-time.md +24 -0
- package/docs/components/feedback-and-status.md +85 -8
- package/docs/components/form-fields.md +14 -5
- package/docs/components/media-and-files.md +7 -0
- package/docs/components/navigation-and-layout.md +21 -3
- package/docs/components/overlays-and-menus.md +21 -6
- package/docs/components/primitives.md +16 -2
- package/docs/components/selection-and-choice.md +13 -2
- package/docs/getting-started.md +4 -2
- package/docs/guides/app-shell.md +97 -4
- package/docs/guides/forms.md +54 -5
- package/docs/guides/helpers.md +2 -2
- package/docs/guides/i18n.md +5 -2
- package/docs/guides/ssr.md +1 -1
- package/docs/guides/theming.md +133 -5
- package/docs/previews/data-display-description.webp +0 -0
- package/docs/previews/feedback-status-toast.webp +0 -0
- package/docs/roadmap.md +22 -1
- package/docs/troubleshooting.md +963 -11
- package/lib/components/base-content.css +139 -0
- package/lib/components/base.css +150 -0
- package/lib/components/components.css +2 -0
- package/lib/components/reduced-motion.css +56 -0
- package/lib/components/theme-tokens.css +116 -0
- package/lib/components/ui/actions/button-group/button-group.css +1 -1
- package/lib/components/ui/feedback/toast/toast.css +21 -0
- package/lib/components/ui/primitives/label/label.css +33 -0
- package/lib/styles.css +10 -368
- package/package.json +2 -2
- package/dist/field-blur-DWQtxiAe.js +0 -3483
- package/dist/flowDiagram-KWPJA3E3-DZxumFfu.js +0 -17
- package/dist/icon-button-BxySFfrr.js +0 -2718
- package/dist/swimlanesDiagram-TC7HE7FX-CROh8GTF.js +0 -28
|
@@ -1,3483 +0,0 @@
|
|
|
1
|
-
import { $ as e, Q as t, _t as n, at as r, d as i, dt as a, et as o, f as s, ft as c, ht as l, i as u, it as d, l as f, lt as p, m, n as h, nt as g, ot as _, p as v, pt as y, r as b, rt as x, st as S, t as C, tt as w } from "./icon-button-BxySFfrr.js";
|
|
2
|
-
import { t as T } from "./utils-UBn-46YY.js";
|
|
3
|
-
import { t as E } from "./use-material-translation-DG_7z3Q7.js";
|
|
4
|
-
import { X as ee } from "lucide-react";
|
|
5
|
-
import { Fragment as te, jsx as D, jsxs as ne } from "react/jsx-runtime";
|
|
6
|
-
import * as O from "react";
|
|
7
|
-
import k, { Activity as re, createContext as ie, isValidElement as ae, use as A, useCallback as oe, useContext as se, useEffect as ce, useId as le, useMemo as ue, useRef as de, useState as fe } from "react";
|
|
8
|
-
import { layerOf as pe, openerOf as me } from "@nxgt/material-core/field-blur-layers";
|
|
9
|
-
//#region ../../node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
10
|
-
var he = Object.defineProperty, j = (e, t) => he(e, "name", {
|
|
11
|
-
value: t,
|
|
12
|
-
configurable: !0
|
|
13
|
-
}), ge = "focusScope.autoFocusOnMount", _e = "focusScope.autoFocusOnUnmount", ve = {
|
|
14
|
-
bubbles: !1,
|
|
15
|
-
cancelable: !0
|
|
16
|
-
}, ye = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ j(function(e, t) {
|
|
17
|
-
let { loop: n = !1, trapped: r = !1, onMountAutoFocus: i, onUnmountAutoFocus: a, ...o } = e, [s, c] = O.useState(null), u = w(i), d = w(a), f = O.useRef(null), m = l(t, c), h = O.useRef({
|
|
18
|
-
paused: !1,
|
|
19
|
-
pause() {
|
|
20
|
-
this.paused = !0;
|
|
21
|
-
},
|
|
22
|
-
resume() {
|
|
23
|
-
this.paused = !1;
|
|
24
|
-
}
|
|
25
|
-
}).current;
|
|
26
|
-
O.useEffect(() => {
|
|
27
|
-
if (r) {
|
|
28
|
-
let e = function(e) {
|
|
29
|
-
if (h.paused || !s) return;
|
|
30
|
-
let t = e.target;
|
|
31
|
-
s.contains(t) ? f.current = t : M(f.current, { select: !0 });
|
|
32
|
-
}, t = function(e) {
|
|
33
|
-
if (h.paused || !s) return;
|
|
34
|
-
let t = e.relatedTarget;
|
|
35
|
-
t !== null && (s.contains(t) || M(f.current, { select: !0 }));
|
|
36
|
-
}, n = function(e) {
|
|
37
|
-
if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 && M(s);
|
|
38
|
-
};
|
|
39
|
-
j(e, "handleFocusIn"), j(t, "handleFocusOut"), j(n, "handleMutations"), document.addEventListener("focusin", e), document.addEventListener("focusout", t);
|
|
40
|
-
let r = new MutationObserver(n);
|
|
41
|
-
return s && r.observe(s, {
|
|
42
|
-
childList: !0,
|
|
43
|
-
subtree: !0
|
|
44
|
-
}), () => {
|
|
45
|
-
document.removeEventListener("focusin", e), document.removeEventListener("focusout", t), r.disconnect();
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}, [
|
|
49
|
-
r,
|
|
50
|
-
s,
|
|
51
|
-
h.paused
|
|
52
|
-
]), O.useEffect(() => {
|
|
53
|
-
if (s) {
|
|
54
|
-
Ee.add(h);
|
|
55
|
-
let e = document.activeElement;
|
|
56
|
-
if (!s.contains(e)) {
|
|
57
|
-
let t = new CustomEvent(ge, ve);
|
|
58
|
-
s.addEventListener(ge, u), s.dispatchEvent(t), t.defaultPrevented || (be(ke(Se(s)), { select: !0 }), document.activeElement === e && M(s));
|
|
59
|
-
}
|
|
60
|
-
return () => {
|
|
61
|
-
s.removeEventListener(ge, u), setTimeout(() => {
|
|
62
|
-
let t = new CustomEvent(_e, ve);
|
|
63
|
-
s.addEventListener(_e, d), s.dispatchEvent(t), t.defaultPrevented || M(e ?? document.body, { select: !0 }), s.removeEventListener(_e, d), Ee.remove(h);
|
|
64
|
-
}, 0);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}, [
|
|
68
|
-
s,
|
|
69
|
-
u,
|
|
70
|
-
d,
|
|
71
|
-
h
|
|
72
|
-
]);
|
|
73
|
-
let g = O.useCallback((e) => {
|
|
74
|
-
if (!n && !r || h.paused) return;
|
|
75
|
-
let t = e.key === "Tab" && !e.altKey && !e.ctrlKey && !e.metaKey, i = document.activeElement;
|
|
76
|
-
if (t && i) {
|
|
77
|
-
let t = e.currentTarget, [r, a] = xe(t);
|
|
78
|
-
r && a ? !e.shiftKey && i === a ? (e.preventDefault(), n && M(r, { select: !0 })) : e.shiftKey && i === r && (e.preventDefault(), n && M(a, { select: !0 })) : i === t && e.preventDefault();
|
|
79
|
-
}
|
|
80
|
-
}, [
|
|
81
|
-
n,
|
|
82
|
-
r,
|
|
83
|
-
h.paused
|
|
84
|
-
]);
|
|
85
|
-
return /* @__PURE__ */ D(p.div, {
|
|
86
|
-
tabIndex: -1,
|
|
87
|
-
...o,
|
|
88
|
-
ref: m,
|
|
89
|
-
onKeyDown: g
|
|
90
|
-
});
|
|
91
|
-
}, "FocusScope"));
|
|
92
|
-
function be(e, { select: t = !1 } = {}) {
|
|
93
|
-
let n = document.activeElement;
|
|
94
|
-
for (let r of e) if (M(r, { select: t }), document.activeElement !== n) return;
|
|
95
|
-
}
|
|
96
|
-
j(be, "focusFirst");
|
|
97
|
-
function xe(e) {
|
|
98
|
-
let t = Se(e);
|
|
99
|
-
return [Ce(t, e), Ce(t.reverse(), e)];
|
|
100
|
-
}
|
|
101
|
-
j(xe, "getTabbableEdges");
|
|
102
|
-
function Se(e) {
|
|
103
|
-
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ j((e) => {
|
|
104
|
-
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
105
|
-
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
106
|
-
}, "acceptNode") });
|
|
107
|
-
for (; n.nextNode();) t.push(n.currentNode);
|
|
108
|
-
return t;
|
|
109
|
-
}
|
|
110
|
-
j(Se, "getTabbableCandidates");
|
|
111
|
-
function Ce(e, t) {
|
|
112
|
-
let n = typeof t.checkVisibility == "function" && t.checkVisibility({ checkVisibilityCSS: !0 });
|
|
113
|
-
for (let r of e) if (!(n ? !r.checkVisibility({ checkVisibilityCSS: !0 }) : we(r, { upTo: t }))) return r;
|
|
114
|
-
}
|
|
115
|
-
j(Ce, "findVisible");
|
|
116
|
-
function we(e, { upTo: t }) {
|
|
117
|
-
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
118
|
-
for (; e;) {
|
|
119
|
-
if (t !== void 0 && e === t) return !1;
|
|
120
|
-
if (getComputedStyle(e).display === "none") return !0;
|
|
121
|
-
e = e.parentElement;
|
|
122
|
-
}
|
|
123
|
-
return !1;
|
|
124
|
-
}
|
|
125
|
-
j(we, "isHidden");
|
|
126
|
-
function Te(e) {
|
|
127
|
-
return e instanceof HTMLInputElement && "select" in e;
|
|
128
|
-
}
|
|
129
|
-
j(Te, "isSelectableInput");
|
|
130
|
-
function M(e, { select: t = !1 } = {}) {
|
|
131
|
-
if (e && e.focus) {
|
|
132
|
-
let n = document.activeElement;
|
|
133
|
-
e.focus({ preventScroll: !0 }), e !== n && Te(e) && t && e.select();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
j(M, "focus");
|
|
137
|
-
var Ee = De();
|
|
138
|
-
function De() {
|
|
139
|
-
let e = [];
|
|
140
|
-
return {
|
|
141
|
-
add(t) {
|
|
142
|
-
let n = e[0];
|
|
143
|
-
t !== n && n?.pause(), e = Oe(e, t), e.unshift(t);
|
|
144
|
-
},
|
|
145
|
-
remove(t) {
|
|
146
|
-
e = Oe(e, t), e[0]?.resume();
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
j(De, "createFocusScopesStack");
|
|
151
|
-
function Oe(e, t) {
|
|
152
|
-
let n = [...e], r = n.indexOf(t);
|
|
153
|
-
return r !== -1 && n.splice(r, 1), n;
|
|
154
|
-
}
|
|
155
|
-
j(Oe, "arrayRemove");
|
|
156
|
-
function ke(e) {
|
|
157
|
-
return e.filter((e) => e.tagName !== "A");
|
|
158
|
-
}
|
|
159
|
-
j(ke, "removeLinks");
|
|
160
|
-
//#endregion
|
|
161
|
-
//#region ../../node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
162
|
-
var Ae = Object.defineProperty, je = (e, t) => Ae(e, "name", {
|
|
163
|
-
value: t,
|
|
164
|
-
configurable: !0
|
|
165
|
-
}), Me = 0, Ne = null;
|
|
166
|
-
function Pe(e) {
|
|
167
|
-
return Fe(), e.children;
|
|
168
|
-
}
|
|
169
|
-
je(Pe, "FocusGuards");
|
|
170
|
-
function Fe() {
|
|
171
|
-
O.useEffect(() => {
|
|
172
|
-
Ne ||= {
|
|
173
|
-
start: Ie(),
|
|
174
|
-
end: Ie()
|
|
175
|
-
};
|
|
176
|
-
let { start: e, end: t } = Ne;
|
|
177
|
-
return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== t && document.body.insertAdjacentElement("beforeend", t), Me++, () => {
|
|
178
|
-
Me === 1 && (Ne?.start.remove(), Ne?.end.remove(), Ne = null), Me = Math.max(0, Me - 1);
|
|
179
|
-
};
|
|
180
|
-
}, []);
|
|
181
|
-
}
|
|
182
|
-
je(Fe, "useFocusGuards");
|
|
183
|
-
function Ie() {
|
|
184
|
-
let e = document.createElement("span");
|
|
185
|
-
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
186
|
-
}
|
|
187
|
-
je(Ie, "createFocusGuard");
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region ../../node_modules/tslib/tslib.es6.mjs
|
|
190
|
-
function Le(e, t) {
|
|
191
|
-
var n = {};
|
|
192
|
-
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
193
|
-
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
194
|
-
return n;
|
|
195
|
-
}
|
|
196
|
-
function Re(e, t, n) {
|
|
197
|
-
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
198
|
-
return e.concat(a || Array.prototype.slice.call(t));
|
|
199
|
-
}
|
|
200
|
-
var N, ze = n((() => {
|
|
201
|
-
N = function() {
|
|
202
|
-
return N = Object.assign || function(e) {
|
|
203
|
-
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
204
|
-
return e;
|
|
205
|
-
}, N.apply(this, arguments);
|
|
206
|
-
};
|
|
207
|
-
}));
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region ../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
210
|
-
ze();
|
|
211
|
-
var Be = "right-scroll-bar-position", Ve = "width-before-scroll-bar", He = "with-scroll-bars-hidden", Ue = "--removed-body-scroll-bar-size";
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region ../../node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
214
|
-
function We(e, t) {
|
|
215
|
-
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
216
|
-
}
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region ../../node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
219
|
-
function Ge(e, t) {
|
|
220
|
-
var n = fe(function() {
|
|
221
|
-
return {
|
|
222
|
-
value: e,
|
|
223
|
-
callback: t,
|
|
224
|
-
facade: {
|
|
225
|
-
get current() {
|
|
226
|
-
return n.value;
|
|
227
|
-
},
|
|
228
|
-
set current(e) {
|
|
229
|
-
var t = n.value;
|
|
230
|
-
t !== e && (n.value = e, n.callback(e, t));
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
})[0];
|
|
235
|
-
return n.callback = t, n.facade;
|
|
236
|
-
}
|
|
237
|
-
//#endregion
|
|
238
|
-
//#region ../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
239
|
-
var Ke = typeof window < "u" ? O.useLayoutEffect : O.useEffect, qe = /* @__PURE__ */ new WeakMap();
|
|
240
|
-
function Je(e, t) {
|
|
241
|
-
var n = Ge(t || null, function(t) {
|
|
242
|
-
return e.forEach(function(e) {
|
|
243
|
-
return We(e, t);
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
return Ke(function() {
|
|
247
|
-
var t = qe.get(n);
|
|
248
|
-
if (t) {
|
|
249
|
-
var r = new Set(t), i = new Set(e), a = n.current;
|
|
250
|
-
r.forEach(function(e) {
|
|
251
|
-
i.has(e) || We(e, null);
|
|
252
|
-
}), i.forEach(function(e) {
|
|
253
|
-
r.has(e) || We(e, a);
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
qe.set(n, e);
|
|
257
|
-
}, [e]), n;
|
|
258
|
-
}
|
|
259
|
-
//#endregion
|
|
260
|
-
//#region ../../node_modules/use-sidecar/dist/es2015/medium.js
|
|
261
|
-
function Ye(e) {
|
|
262
|
-
return e;
|
|
263
|
-
}
|
|
264
|
-
function Xe(e, t) {
|
|
265
|
-
t === void 0 && (t = Ye);
|
|
266
|
-
var n = [], r = !1;
|
|
267
|
-
return {
|
|
268
|
-
read: function() {
|
|
269
|
-
if (r) throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
270
|
-
return n.length ? n[n.length - 1] : e;
|
|
271
|
-
},
|
|
272
|
-
useMedium: function(e) {
|
|
273
|
-
var i = t(e, r);
|
|
274
|
-
return n.push(i), function() {
|
|
275
|
-
n = n.filter(function(e) {
|
|
276
|
-
return e !== i;
|
|
277
|
-
});
|
|
278
|
-
};
|
|
279
|
-
},
|
|
280
|
-
assignSyncMedium: function(e) {
|
|
281
|
-
for (r = !0; n.length;) {
|
|
282
|
-
var t = n;
|
|
283
|
-
n = [], t.forEach(e);
|
|
284
|
-
}
|
|
285
|
-
n = {
|
|
286
|
-
push: function(t) {
|
|
287
|
-
return e(t);
|
|
288
|
-
},
|
|
289
|
-
filter: function() {
|
|
290
|
-
return n;
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
},
|
|
294
|
-
assignMedium: function(e) {
|
|
295
|
-
r = !0;
|
|
296
|
-
var t = [];
|
|
297
|
-
if (n.length) {
|
|
298
|
-
var i = n;
|
|
299
|
-
n = [], i.forEach(e), t = n;
|
|
300
|
-
}
|
|
301
|
-
var a = function() {
|
|
302
|
-
var n = t;
|
|
303
|
-
t = [], n.forEach(e);
|
|
304
|
-
}, o = function() {
|
|
305
|
-
return Promise.resolve().then(a);
|
|
306
|
-
};
|
|
307
|
-
o(), n = {
|
|
308
|
-
push: function(e) {
|
|
309
|
-
t.push(e), o();
|
|
310
|
-
},
|
|
311
|
-
filter: function(e) {
|
|
312
|
-
return t = t.filter(e), n;
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
function Ze(e) {
|
|
319
|
-
e === void 0 && (e = {});
|
|
320
|
-
var t = Xe(null);
|
|
321
|
-
return t.options = N({
|
|
322
|
-
async: !0,
|
|
323
|
-
ssr: !1
|
|
324
|
-
}, e), t;
|
|
325
|
-
}
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region ../../node_modules/use-sidecar/dist/es2015/exports.js
|
|
328
|
-
ze();
|
|
329
|
-
var Qe = function(e) {
|
|
330
|
-
var t = e.sideCar, n = Le(e, ["sideCar"]);
|
|
331
|
-
if (!t) throw Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
332
|
-
var r = t.read();
|
|
333
|
-
if (!r) throw Error("Sidecar medium not found");
|
|
334
|
-
return O.createElement(r, N({}, n));
|
|
335
|
-
};
|
|
336
|
-
Qe.isSideCarExport = !0;
|
|
337
|
-
function $e(e, t) {
|
|
338
|
-
return e.useMedium(t), Qe;
|
|
339
|
-
}
|
|
340
|
-
//#endregion
|
|
341
|
-
//#region ../../node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
342
|
-
var et = Ze();
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region ../../node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
345
|
-
ze();
|
|
346
|
-
var tt = function() {}, nt = O.forwardRef(function(e, t) {
|
|
347
|
-
var n = O.useRef(null), r = O.useState({
|
|
348
|
-
onScrollCapture: tt,
|
|
349
|
-
onWheelCapture: tt,
|
|
350
|
-
onTouchMoveCapture: tt
|
|
351
|
-
}), i = r[0], a = r[1], o = e.forwardProps, s = e.children, c = e.className, l = e.removeScrollBar, u = e.enabled, d = e.shards, f = e.sideCar, p = e.noRelative, m = e.noIsolation, h = e.inert, g = e.allowPinchZoom, _ = e.as, v = _ === void 0 ? "div" : _, y = e.gapMode, b = Le(e, [
|
|
352
|
-
"forwardProps",
|
|
353
|
-
"children",
|
|
354
|
-
"className",
|
|
355
|
-
"removeScrollBar",
|
|
356
|
-
"enabled",
|
|
357
|
-
"shards",
|
|
358
|
-
"sideCar",
|
|
359
|
-
"noRelative",
|
|
360
|
-
"noIsolation",
|
|
361
|
-
"inert",
|
|
362
|
-
"allowPinchZoom",
|
|
363
|
-
"as",
|
|
364
|
-
"gapMode"
|
|
365
|
-
]), x = f, S = Je([n, t]), C = N(N({}, b), i);
|
|
366
|
-
return O.createElement(O.Fragment, null, u && O.createElement(x, {
|
|
367
|
-
sideCar: et,
|
|
368
|
-
removeScrollBar: l,
|
|
369
|
-
shards: d,
|
|
370
|
-
noRelative: p,
|
|
371
|
-
noIsolation: m,
|
|
372
|
-
inert: h,
|
|
373
|
-
setCallbacks: a,
|
|
374
|
-
allowPinchZoom: !!g,
|
|
375
|
-
lockRef: n,
|
|
376
|
-
gapMode: y
|
|
377
|
-
}), o ? O.cloneElement(O.Children.only(s), N(N({}, C), { ref: S })) : O.createElement(v, N({}, C, {
|
|
378
|
-
className: c,
|
|
379
|
-
ref: S
|
|
380
|
-
}), s));
|
|
381
|
-
});
|
|
382
|
-
nt.defaultProps = {
|
|
383
|
-
enabled: !0,
|
|
384
|
-
removeScrollBar: !0,
|
|
385
|
-
inert: !1
|
|
386
|
-
}, nt.classNames = {
|
|
387
|
-
fullWidth: Ve,
|
|
388
|
-
zeroRight: Be
|
|
389
|
-
};
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region ../../node_modules/get-nonce/dist/es2015/index.js
|
|
392
|
-
var rt, it = function() {
|
|
393
|
-
if (rt) return rt;
|
|
394
|
-
if (typeof __webpack_nonce__ < "u") return __webpack_nonce__;
|
|
395
|
-
};
|
|
396
|
-
//#endregion
|
|
397
|
-
//#region ../../node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
398
|
-
function at() {
|
|
399
|
-
if (!document) return null;
|
|
400
|
-
var e = document.createElement("style");
|
|
401
|
-
e.type = "text/css";
|
|
402
|
-
var t = it();
|
|
403
|
-
return t && e.setAttribute("nonce", t), e;
|
|
404
|
-
}
|
|
405
|
-
function ot(e, t) {
|
|
406
|
-
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
407
|
-
}
|
|
408
|
-
function st(e) {
|
|
409
|
-
(document.head || document.getElementsByTagName("head")[0]).appendChild(e);
|
|
410
|
-
}
|
|
411
|
-
var ct = function() {
|
|
412
|
-
var e = 0, t = null;
|
|
413
|
-
return {
|
|
414
|
-
add: function(n) {
|
|
415
|
-
e == 0 && (t = at()) && (ot(t, n), st(t)), e++;
|
|
416
|
-
},
|
|
417
|
-
remove: function() {
|
|
418
|
-
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
}, lt = function() {
|
|
422
|
-
var e = ct();
|
|
423
|
-
return function(t, n) {
|
|
424
|
-
O.useEffect(function() {
|
|
425
|
-
return e.add(t), function() {
|
|
426
|
-
e.remove();
|
|
427
|
-
};
|
|
428
|
-
}, [t && n]);
|
|
429
|
-
};
|
|
430
|
-
}, ut = function() {
|
|
431
|
-
var e = lt();
|
|
432
|
-
return function(t) {
|
|
433
|
-
var n = t.styles, r = t.dynamic;
|
|
434
|
-
return e(n, r), null;
|
|
435
|
-
};
|
|
436
|
-
}, dt = {
|
|
437
|
-
left: 0,
|
|
438
|
-
top: 0,
|
|
439
|
-
right: 0,
|
|
440
|
-
gap: 0
|
|
441
|
-
}, ft = function(e) {
|
|
442
|
-
return parseInt(e || "", 10) || 0;
|
|
443
|
-
}, pt = function(e) {
|
|
444
|
-
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], i = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
445
|
-
return [
|
|
446
|
-
ft(n),
|
|
447
|
-
ft(r),
|
|
448
|
-
ft(i)
|
|
449
|
-
];
|
|
450
|
-
}, mt = function(e) {
|
|
451
|
-
if (e === void 0 && (e = "margin"), typeof window > "u") return dt;
|
|
452
|
-
var t = pt(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
453
|
-
return {
|
|
454
|
-
left: t[0],
|
|
455
|
-
top: t[1],
|
|
456
|
-
right: t[2],
|
|
457
|
-
gap: Math.max(0, r - n + t[2] - t[0])
|
|
458
|
-
};
|
|
459
|
-
}, ht = ut(), gt = "data-scroll-locked", _t = function(e, t, n, r) {
|
|
460
|
-
var i = e.left, a = e.top, o = e.right, s = e.gap;
|
|
461
|
-
return n === void 0 && (n = "margin"), `
|
|
462
|
-
.${He} {
|
|
463
|
-
overflow: hidden ${r};
|
|
464
|
-
padding-right: ${s}px ${r};
|
|
465
|
-
}
|
|
466
|
-
body[${gt}] {
|
|
467
|
-
overflow: hidden ${r};
|
|
468
|
-
overscroll-behavior: contain;
|
|
469
|
-
${[
|
|
470
|
-
t && `position: relative ${r};`,
|
|
471
|
-
n === "margin" && `
|
|
472
|
-
padding-left: ${i}px;
|
|
473
|
-
padding-top: ${a}px;
|
|
474
|
-
padding-right: ${o}px;
|
|
475
|
-
margin-left:0;
|
|
476
|
-
margin-top:0;
|
|
477
|
-
margin-right: ${s}px ${r};
|
|
478
|
-
`,
|
|
479
|
-
n === "padding" && `padding-right: ${s}px ${r};`
|
|
480
|
-
].filter(Boolean).join("")}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
.${Be} {
|
|
484
|
-
right: ${s}px ${r};
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.${Ve} {
|
|
488
|
-
margin-right: ${s}px ${r};
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
.${Be} .${Be} {
|
|
492
|
-
right: 0 ${r};
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
.${Ve} .${Ve} {
|
|
496
|
-
margin-right: 0 ${r};
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
body[${gt}] {
|
|
500
|
-
${Ue}: ${s}px;
|
|
501
|
-
}
|
|
502
|
-
`;
|
|
503
|
-
}, vt = function() {
|
|
504
|
-
var e = parseInt(document.body.getAttribute("data-scroll-locked") || "0", 10);
|
|
505
|
-
return isFinite(e) ? e : 0;
|
|
506
|
-
}, yt = function() {
|
|
507
|
-
O.useEffect(function() {
|
|
508
|
-
return document.body.setAttribute(gt, (vt() + 1).toString()), function() {
|
|
509
|
-
var e = vt() - 1;
|
|
510
|
-
e <= 0 ? document.body.removeAttribute(gt) : document.body.setAttribute(gt, e.toString());
|
|
511
|
-
};
|
|
512
|
-
}, []);
|
|
513
|
-
}, bt = function(e) {
|
|
514
|
-
var t = e.noRelative, n = e.noImportant, r = e.gapMode, i = r === void 0 ? "margin" : r;
|
|
515
|
-
yt();
|
|
516
|
-
var a = O.useMemo(function() {
|
|
517
|
-
return mt(i);
|
|
518
|
-
}, [i]);
|
|
519
|
-
return O.createElement(ht, { styles: _t(a, !t, i, n ? "" : "!important") });
|
|
520
|
-
}, xt = !1;
|
|
521
|
-
if (typeof window < "u") try {
|
|
522
|
-
var St = Object.defineProperty({}, "passive", { get: function() {
|
|
523
|
-
return xt = !0, !0;
|
|
524
|
-
} });
|
|
525
|
-
window.addEventListener("test", St, St), window.removeEventListener("test", St, St);
|
|
526
|
-
} catch {
|
|
527
|
-
xt = !1;
|
|
528
|
-
}
|
|
529
|
-
var Ct = xt ? { passive: !1 } : !1, wt = function(e) {
|
|
530
|
-
return e.tagName === "TEXTAREA";
|
|
531
|
-
}, Tt = function(e, t) {
|
|
532
|
-
if (!(e instanceof Element)) return !1;
|
|
533
|
-
var n = window.getComputedStyle(e);
|
|
534
|
-
return n[t] !== "hidden" && !(n.overflowY === n.overflowX && !wt(e) && n[t] === "visible");
|
|
535
|
-
}, Et = function(e) {
|
|
536
|
-
return Tt(e, "overflowY");
|
|
537
|
-
}, Dt = function(e) {
|
|
538
|
-
return Tt(e, "overflowX");
|
|
539
|
-
}, Ot = function(e, t) {
|
|
540
|
-
var n = t.ownerDocument, r = t;
|
|
541
|
-
do {
|
|
542
|
-
if (typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host), jt(e, r)) {
|
|
543
|
-
var i = Mt(e, r);
|
|
544
|
-
if (i[1] > i[2]) return !0;
|
|
545
|
-
}
|
|
546
|
-
r = r.parentNode;
|
|
547
|
-
} while (r && r !== n.body);
|
|
548
|
-
return !1;
|
|
549
|
-
}, kt = function(e) {
|
|
550
|
-
return [
|
|
551
|
-
e.scrollTop,
|
|
552
|
-
e.scrollHeight,
|
|
553
|
-
e.clientHeight
|
|
554
|
-
];
|
|
555
|
-
}, At = function(e) {
|
|
556
|
-
return [
|
|
557
|
-
e.scrollLeft,
|
|
558
|
-
e.scrollWidth,
|
|
559
|
-
e.clientWidth
|
|
560
|
-
];
|
|
561
|
-
}, jt = function(e, t) {
|
|
562
|
-
return e === "v" ? Et(t) : Dt(t);
|
|
563
|
-
}, Mt = function(e, t) {
|
|
564
|
-
return e === "v" ? kt(t) : At(t);
|
|
565
|
-
}, Nt = function(e, t) {
|
|
566
|
-
return e === "h" && t === "rtl" ? -1 : 1;
|
|
567
|
-
}, Pt = function(e, t, n, r, i) {
|
|
568
|
-
var a = Nt(e, window.getComputedStyle(t).direction), o = a * r, s = n.target, c = t.contains(s), l = !1, u = o > 0, d = 0, f = 0;
|
|
569
|
-
do {
|
|
570
|
-
if (!s) break;
|
|
571
|
-
var p = Mt(e, s), m = p[0], h = p[1] - p[2] - a * m;
|
|
572
|
-
(m || h) && jt(e, s) && (d += h, f += m);
|
|
573
|
-
var g = s.parentNode;
|
|
574
|
-
s = g && g.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? g.host : g;
|
|
575
|
-
} while (!c && s !== document.body || c && (t.contains(s) || t === s));
|
|
576
|
-
return (u && (i && Math.abs(d) < 1 || !i && o > d) || !u && (i && Math.abs(f) < 1 || !i && -o > f)) && (l = !0), l;
|
|
577
|
-
};
|
|
578
|
-
//#endregion
|
|
579
|
-
//#region ../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
580
|
-
ze();
|
|
581
|
-
var Ft = function(e) {
|
|
582
|
-
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
583
|
-
}, It = function(e) {
|
|
584
|
-
return [e.deltaX, e.deltaY];
|
|
585
|
-
}, Lt = function(e) {
|
|
586
|
-
return e && "current" in e ? e.current : e;
|
|
587
|
-
}, Rt = function(e, t) {
|
|
588
|
-
return e[0] === t[0] && e[1] === t[1];
|
|
589
|
-
}, zt = function(e) {
|
|
590
|
-
return `
|
|
591
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
592
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
593
|
-
`;
|
|
594
|
-
}, Bt = 0, Vt = [];
|
|
595
|
-
function Ht(e) {
|
|
596
|
-
var t = O.useRef([]), n = O.useRef([0, 0]), r = O.useRef(), i = O.useState(Bt++)[0], a = O.useState(ut)[0], o = O.useRef(e);
|
|
597
|
-
O.useEffect(function() {
|
|
598
|
-
o.current = e;
|
|
599
|
-
}, [e]), O.useEffect(function() {
|
|
600
|
-
if (e.inert) {
|
|
601
|
-
document.body.classList.add(`block-interactivity-${i}`);
|
|
602
|
-
var t = Re([e.lockRef.current], (e.shards || []).map(Lt), !0).filter(Boolean);
|
|
603
|
-
return t.forEach(function(e) {
|
|
604
|
-
return e.classList.add(`allow-interactivity-${i}`);
|
|
605
|
-
}), function() {
|
|
606
|
-
document.body.classList.remove(`block-interactivity-${i}`), t.forEach(function(e) {
|
|
607
|
-
return e.classList.remove(`allow-interactivity-${i}`);
|
|
608
|
-
});
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
}, [
|
|
612
|
-
e.inert,
|
|
613
|
-
e.lockRef.current,
|
|
614
|
-
e.shards
|
|
615
|
-
]);
|
|
616
|
-
var s = O.useCallback(function(e, t) {
|
|
617
|
-
if ("touches" in e && e.touches.length === 2 || e.type === "wheel" && e.ctrlKey) return !o.current.allowPinchZoom;
|
|
618
|
-
var i = Ft(e), a = n.current, s = "deltaX" in e ? e.deltaX : a[0] - i[0], c = "deltaY" in e ? e.deltaY : a[1] - i[1], l, u = e.target, d = Math.abs(s) > Math.abs(c) ? "h" : "v";
|
|
619
|
-
if ("touches" in e && d === "h" && u.type === "range") return !1;
|
|
620
|
-
var f = window.getSelection(), p = f && f.anchorNode;
|
|
621
|
-
if (p && (p === u || p.contains(u))) return !1;
|
|
622
|
-
var m = Ot(d, u);
|
|
623
|
-
if (!m) return !0;
|
|
624
|
-
if (m ? l = d : (l = d === "v" ? "h" : "v", m = Ot(d, u)), !m) return !1;
|
|
625
|
-
if (!r.current && "changedTouches" in e && (s || c) && (r.current = l), !l) return !0;
|
|
626
|
-
var h = r.current || l;
|
|
627
|
-
return Pt(h, t, e, h === "h" ? s : c, !0);
|
|
628
|
-
}, []), c = O.useCallback(function(e) {
|
|
629
|
-
var n = e;
|
|
630
|
-
if (!(!Vt.length || Vt[Vt.length - 1] !== a)) {
|
|
631
|
-
var r = "deltaY" in n ? It(n) : Ft(n), i = t.current.filter(function(e) {
|
|
632
|
-
return e.name === n.type && (e.target === n.target || n.target === e.shadowParent) && Rt(e.delta, r);
|
|
633
|
-
})[0];
|
|
634
|
-
if (i && i.should) {
|
|
635
|
-
n.cancelable && n.preventDefault();
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
if (!i) {
|
|
639
|
-
var c = (o.current.shards || []).map(Lt).filter(Boolean).filter(function(e) {
|
|
640
|
-
return e.contains(n.target);
|
|
641
|
-
});
|
|
642
|
-
(c.length > 0 ? s(n, c[0]) : !o.current.noIsolation) && n.cancelable && n.preventDefault();
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}, []), l = O.useCallback(function(e, n, r, i) {
|
|
646
|
-
var a = {
|
|
647
|
-
name: e,
|
|
648
|
-
delta: n,
|
|
649
|
-
target: r,
|
|
650
|
-
should: i,
|
|
651
|
-
shadowParent: Ut(r)
|
|
652
|
-
};
|
|
653
|
-
t.current.push(a), setTimeout(function() {
|
|
654
|
-
t.current = t.current.filter(function(e) {
|
|
655
|
-
return e !== a;
|
|
656
|
-
});
|
|
657
|
-
}, 1);
|
|
658
|
-
}, []), u = O.useCallback(function(e) {
|
|
659
|
-
n.current = Ft(e), r.current = void 0;
|
|
660
|
-
}, []), d = O.useCallback(function(t) {
|
|
661
|
-
l(t.type, It(t), t.target, s(t, e.lockRef.current));
|
|
662
|
-
}, []), f = O.useCallback(function(t) {
|
|
663
|
-
l(t.type, Ft(t), t.target, s(t, e.lockRef.current));
|
|
664
|
-
}, []);
|
|
665
|
-
O.useEffect(function() {
|
|
666
|
-
return Vt.push(a), e.setCallbacks({
|
|
667
|
-
onScrollCapture: d,
|
|
668
|
-
onWheelCapture: d,
|
|
669
|
-
onTouchMoveCapture: f
|
|
670
|
-
}), document.addEventListener("wheel", c, Ct), document.addEventListener("touchmove", c, Ct), document.addEventListener("touchstart", u, Ct), function() {
|
|
671
|
-
Vt = Vt.filter(function(e) {
|
|
672
|
-
return e !== a;
|
|
673
|
-
}), document.removeEventListener("wheel", c, Ct), document.removeEventListener("touchmove", c, Ct), document.removeEventListener("touchstart", u, Ct);
|
|
674
|
-
};
|
|
675
|
-
}, []);
|
|
676
|
-
var p = e.removeScrollBar, m = e.inert;
|
|
677
|
-
return O.createElement(O.Fragment, null, m ? O.createElement(a, { styles: zt(i) }) : null, p ? O.createElement(bt, {
|
|
678
|
-
noRelative: e.noRelative,
|
|
679
|
-
gapMode: e.gapMode
|
|
680
|
-
}) : null);
|
|
681
|
-
}
|
|
682
|
-
function Ut(e) {
|
|
683
|
-
for (var t = null; e !== null;) e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
684
|
-
return t;
|
|
685
|
-
}
|
|
686
|
-
//#endregion
|
|
687
|
-
//#region ../../node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
688
|
-
var Wt = $e(et, Ht);
|
|
689
|
-
//#endregion
|
|
690
|
-
//#region ../../node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
691
|
-
ze();
|
|
692
|
-
var Gt = O.forwardRef(function(e, t) {
|
|
693
|
-
return O.createElement(nt, N({}, e, {
|
|
694
|
-
ref: t,
|
|
695
|
-
sideCar: Wt
|
|
696
|
-
}));
|
|
697
|
-
});
|
|
698
|
-
Gt.classNames = nt.classNames;
|
|
699
|
-
//#endregion
|
|
700
|
-
//#region ../../node_modules/aria-hidden/dist/es2015/index.js
|
|
701
|
-
var Kt = function(e) {
|
|
702
|
-
return typeof document > "u" ? null : (Array.isArray(e) ? e[0] : e).ownerDocument.body;
|
|
703
|
-
}, qt = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), Yt = {}, Xt = 0, Zt = function(e) {
|
|
704
|
-
return e && (e.host || Zt(e.parentNode));
|
|
705
|
-
}, Qt = function(e, t) {
|
|
706
|
-
return t.map(function(t) {
|
|
707
|
-
if (e.contains(t)) return t;
|
|
708
|
-
var n = Zt(t);
|
|
709
|
-
return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
|
|
710
|
-
}).filter(function(e) {
|
|
711
|
-
return !!e;
|
|
712
|
-
});
|
|
713
|
-
}, $t = function(e, t, n, r) {
|
|
714
|
-
var i = Qt(t, Array.isArray(e) ? e : [e]);
|
|
715
|
-
Yt[n] || (Yt[n] = /* @__PURE__ */ new WeakMap());
|
|
716
|
-
var a = Yt[n], o = [], s = /* @__PURE__ */ new Set(), c = new Set(i), l = function(e) {
|
|
717
|
-
!e || s.has(e) || (s.add(e), l(e.parentNode));
|
|
718
|
-
};
|
|
719
|
-
i.forEach(l);
|
|
720
|
-
var u = function(e) {
|
|
721
|
-
!e || c.has(e) || Array.prototype.forEach.call(e.children, function(e) {
|
|
722
|
-
if (s.has(e)) u(e);
|
|
723
|
-
else try {
|
|
724
|
-
var t = e.getAttribute(r), i = t !== null && t !== "false", c = (qt.get(e) || 0) + 1, l = (a.get(e) || 0) + 1;
|
|
725
|
-
qt.set(e, c), a.set(e, l), o.push(e), c === 1 && i && Jt.set(e, !0), l === 1 && e.setAttribute(n, "true"), i || e.setAttribute(r, "true");
|
|
726
|
-
} catch (t) {
|
|
727
|
-
console.error("aria-hidden: cannot operate on ", e, t);
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
};
|
|
731
|
-
return u(t), s.clear(), Xt++, function() {
|
|
732
|
-
o.forEach(function(e) {
|
|
733
|
-
var t = qt.get(e) - 1, i = a.get(e) - 1;
|
|
734
|
-
qt.set(e, t), a.set(e, i), t || (Jt.has(e) || e.removeAttribute(r), Jt.delete(e)), i || e.removeAttribute(n);
|
|
735
|
-
}), Xt--, Xt || (qt = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), Yt = {});
|
|
736
|
-
};
|
|
737
|
-
}, en = function(e, t, n) {
|
|
738
|
-
n === void 0 && (n = "data-aria-hidden");
|
|
739
|
-
var r = Array.from(Array.isArray(e) ? e : [e]), i = t || Kt(e);
|
|
740
|
-
return i ? (r.push.apply(r, Array.from(i.querySelectorAll("[aria-live], script"))), $t(r, i, n, "aria-hidden")) : function() {
|
|
741
|
-
return null;
|
|
742
|
-
};
|
|
743
|
-
}, tn = Object.defineProperty, P = (e, t) => tn(e, "name", {
|
|
744
|
-
value: t,
|
|
745
|
-
configurable: !0
|
|
746
|
-
}), nn = "Dialog", [rn, an] = S(nn), [on, F] = rn(nn), sn = /* @__PURE__ */ P((e) => {
|
|
747
|
-
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s = O.useRef(null), c = O.useRef(null), [l, u] = d({
|
|
748
|
-
prop: r,
|
|
749
|
-
defaultProp: i ?? !1,
|
|
750
|
-
onChange: a,
|
|
751
|
-
caller: nn
|
|
752
|
-
}), [f, p] = O.useState(0), [m, h] = O.useState(0);
|
|
753
|
-
return /* @__PURE__ */ D(on, {
|
|
754
|
-
scope: t,
|
|
755
|
-
triggerRef: s,
|
|
756
|
-
contentRef: c,
|
|
757
|
-
contentId: g(),
|
|
758
|
-
titleId: g(),
|
|
759
|
-
descriptionId: g(),
|
|
760
|
-
titlePresent: f > 0,
|
|
761
|
-
descriptionPresent: m > 0,
|
|
762
|
-
setTitleCount: p,
|
|
763
|
-
setDescriptionCount: h,
|
|
764
|
-
open: l,
|
|
765
|
-
onOpenChange: u,
|
|
766
|
-
onOpenToggle: O.useCallback(() => u((e) => !e), [u]),
|
|
767
|
-
modal: o,
|
|
768
|
-
children: n
|
|
769
|
-
});
|
|
770
|
-
}, "Dialog"), cn = "DialogTrigger", ln = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
771
|
-
let { __scopeDialog: n, ...r } = e, i = F(cn, n), a = l(t, i.triggerRef);
|
|
772
|
-
return /* @__PURE__ */ D(p.button, {
|
|
773
|
-
type: "button",
|
|
774
|
-
"aria-haspopup": "dialog",
|
|
775
|
-
"aria-expanded": i.open,
|
|
776
|
-
"aria-controls": i.open ? i.contentId : void 0,
|
|
777
|
-
"data-state": kn(i.open),
|
|
778
|
-
...r,
|
|
779
|
-
ref: a,
|
|
780
|
-
onClick: _(e.onClick, i.onOpenToggle)
|
|
781
|
-
});
|
|
782
|
-
}, "DialogTrigger")), un = "DialogPortal", [dn, fn] = rn(un, { forceMount: void 0 }), pn = /* @__PURE__ */ P((e) => {
|
|
783
|
-
let { __scopeDialog: n, forceMount: r, children: i, container: a } = e, o = F(un, n);
|
|
784
|
-
return /* @__PURE__ */ D(dn, {
|
|
785
|
-
scope: n,
|
|
786
|
-
forceMount: r,
|
|
787
|
-
children: O.Children.map(i, (e) => /* @__PURE__ */ D(x, {
|
|
788
|
-
present: r || o.open,
|
|
789
|
-
children: /* @__PURE__ */ D(t, {
|
|
790
|
-
asChild: !0,
|
|
791
|
-
container: a,
|
|
792
|
-
children: e
|
|
793
|
-
})
|
|
794
|
-
}))
|
|
795
|
-
});
|
|
796
|
-
}, "DialogPortal"), mn = "DialogOverlay", hn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
797
|
-
let n = fn(mn, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = F(mn, e.__scopeDialog);
|
|
798
|
-
return a.modal ? /* @__PURE__ */ D(x, {
|
|
799
|
-
present: r || a.open,
|
|
800
|
-
children: /* @__PURE__ */ D(_n, {
|
|
801
|
-
...i,
|
|
802
|
-
ref: t
|
|
803
|
-
})
|
|
804
|
-
}) : null;
|
|
805
|
-
}, "DialogOverlay")), gn = y("DialogOverlay.RemoveScroll"), _n = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
806
|
-
let { __scopeDialog: n, ...r } = e, i = F(mn, n), a = l(t, o());
|
|
807
|
-
return /* @__PURE__ */ D(Gt, {
|
|
808
|
-
as: gn,
|
|
809
|
-
allowPinchZoom: !0,
|
|
810
|
-
shards: [i.contentRef],
|
|
811
|
-
children: /* @__PURE__ */ D(p.div, {
|
|
812
|
-
"data-state": kn(i.open),
|
|
813
|
-
...r,
|
|
814
|
-
ref: a,
|
|
815
|
-
style: {
|
|
816
|
-
pointerEvents: "auto",
|
|
817
|
-
...r.style
|
|
818
|
-
}
|
|
819
|
-
})
|
|
820
|
-
});
|
|
821
|
-
}, "DialogOverlayImpl")), vn = "DialogContent", yn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
822
|
-
let n = fn(vn, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = F(vn, e.__scopeDialog);
|
|
823
|
-
return /* @__PURE__ */ D(x, {
|
|
824
|
-
present: r || a.open,
|
|
825
|
-
children: a.modal ? /* @__PURE__ */ D(bn, {
|
|
826
|
-
...i,
|
|
827
|
-
ref: t
|
|
828
|
-
}) : /* @__PURE__ */ D(xn, {
|
|
829
|
-
...i,
|
|
830
|
-
ref: t
|
|
831
|
-
})
|
|
832
|
-
});
|
|
833
|
-
}, "DialogContent")), bn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
834
|
-
let n = F(vn, e.__scopeDialog), r = O.useRef(null), i = l(t, n.contentRef, r);
|
|
835
|
-
return O.useEffect(() => {
|
|
836
|
-
let e = r.current;
|
|
837
|
-
if (e) return en(e);
|
|
838
|
-
}, []), /* @__PURE__ */ D(Sn, {
|
|
839
|
-
...e,
|
|
840
|
-
ref: i,
|
|
841
|
-
trapFocus: n.open,
|
|
842
|
-
disableOutsidePointerEvents: n.open,
|
|
843
|
-
onCloseAutoFocus: _(e.onCloseAutoFocus, (e) => {
|
|
844
|
-
e.preventDefault(), n.triggerRef.current?.focus();
|
|
845
|
-
}),
|
|
846
|
-
onPointerDownOutside: _(e.onPointerDownOutside, (e) => {
|
|
847
|
-
let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0;
|
|
848
|
-
(t.button === 2 || n) && e.preventDefault();
|
|
849
|
-
}),
|
|
850
|
-
onFocusOutside: _(e.onFocusOutside, (e) => e.preventDefault())
|
|
851
|
-
});
|
|
852
|
-
}, "DialogContentModal")), xn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
853
|
-
let n = F(vn, e.__scopeDialog), r = O.useRef(!1), i = O.useRef(!1);
|
|
854
|
-
return /* @__PURE__ */ D(Sn, {
|
|
855
|
-
...e,
|
|
856
|
-
ref: t,
|
|
857
|
-
trapFocus: !1,
|
|
858
|
-
disableOutsidePointerEvents: !1,
|
|
859
|
-
onCloseAutoFocus: (t) => {
|
|
860
|
-
e.onCloseAutoFocus?.(t), t.defaultPrevented || (r.current || n.triggerRef.current?.focus(), t.preventDefault()), r.current = !1, i.current = !1;
|
|
861
|
-
},
|
|
862
|
-
onInteractOutside: (t) => {
|
|
863
|
-
e.onInteractOutside?.(t), t.defaultPrevented || (r.current = !0, t.detail.originalEvent.type === "pointerdown" && (i.current = !0));
|
|
864
|
-
let a = t.target;
|
|
865
|
-
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
866
|
-
}
|
|
867
|
-
});
|
|
868
|
-
}, "DialogContentNonModal")), Sn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(t, n) {
|
|
869
|
-
let { __scopeDialog: r, trapFocus: i, onOpenAutoFocus: a, onCloseAutoFocus: o, ...s } = t, c = F(vn, r);
|
|
870
|
-
return Fe(), /* @__PURE__ */ D(te, { children: /* @__PURE__ */ D(ye, {
|
|
871
|
-
asChild: !0,
|
|
872
|
-
loop: !0,
|
|
873
|
-
trapped: i,
|
|
874
|
-
onMountAutoFocus: a,
|
|
875
|
-
onUnmountAutoFocus: o,
|
|
876
|
-
children: /* @__PURE__ */ D(e, {
|
|
877
|
-
role: "dialog",
|
|
878
|
-
id: c.contentId,
|
|
879
|
-
"aria-describedby": c.descriptionPresent ? c.descriptionId : void 0,
|
|
880
|
-
"aria-labelledby": c.titlePresent ? c.titleId : void 0,
|
|
881
|
-
"data-state": kn(c.open),
|
|
882
|
-
...s,
|
|
883
|
-
ref: n,
|
|
884
|
-
deferPointerDownOutside: !0,
|
|
885
|
-
onDismiss: () => c.onOpenChange(!1)
|
|
886
|
-
})
|
|
887
|
-
}) });
|
|
888
|
-
}, "DialogContentImpl")), Cn = "DialogTitle", wn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
889
|
-
let { __scopeDialog: n, ...i } = e, a = F(Cn, n), { setTitleCount: o } = a;
|
|
890
|
-
return r(() => (o((e) => e + 1), () => o((e) => e - 1)), [o]), /* @__PURE__ */ D(p.h2, {
|
|
891
|
-
id: a.titleId,
|
|
892
|
-
...i,
|
|
893
|
-
ref: t
|
|
894
|
-
});
|
|
895
|
-
}, "DialogTitle")), Tn = "DialogDescription", En = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
896
|
-
let { __scopeDialog: n, ...i } = e, a = F(Tn, n), { setDescriptionCount: o } = a;
|
|
897
|
-
return r(() => (o((e) => e + 1), () => o((e) => e - 1)), [o]), /* @__PURE__ */ D(p.p, {
|
|
898
|
-
id: a.descriptionId,
|
|
899
|
-
...i,
|
|
900
|
-
ref: t
|
|
901
|
-
});
|
|
902
|
-
}, "DialogDescription")), Dn = "DialogClose", On = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
903
|
-
let { __scopeDialog: n, ...r } = e, i = F(Dn, n);
|
|
904
|
-
return /* @__PURE__ */ D(p.button, {
|
|
905
|
-
type: "button",
|
|
906
|
-
...r,
|
|
907
|
-
ref: t,
|
|
908
|
-
onClick: _(e.onClick, () => i.onOpenChange(!1))
|
|
909
|
-
});
|
|
910
|
-
}, "DialogClose"));
|
|
911
|
-
function kn(e) {
|
|
912
|
-
return e ? "open" : "closed";
|
|
913
|
-
}
|
|
914
|
-
P(kn, "getState");
|
|
915
|
-
//#endregion
|
|
916
|
-
//#region ../../node_modules/@radix-ui/react-label/dist/index.mjs
|
|
917
|
-
var An = Object.defineProperty, jn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ ((e, t) => An(e, "name", {
|
|
918
|
-
value: t,
|
|
919
|
-
configurable: !0
|
|
920
|
-
}))(function(e, t) {
|
|
921
|
-
return /* @__PURE__ */ D(p.label, {
|
|
922
|
-
...e,
|
|
923
|
-
ref: t,
|
|
924
|
-
onMouseDown: (t) => {
|
|
925
|
-
t.target.closest("button, input, select, textarea") || (e.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
|
|
926
|
-
}
|
|
927
|
-
});
|
|
928
|
-
}, "Label")), Mn = Object.defineProperty, I = (e, t) => Mn(e, "name", {
|
|
929
|
-
value: t,
|
|
930
|
-
configurable: !0
|
|
931
|
-
}), Nn, Pn = "HoverCard", [Fn, In] = S(Pn, [m]), Ln = m(), [Rn, zn] = Fn(Pn), Bn = /* @__PURE__ */ I((e) => {
|
|
932
|
-
let { __scopeHoverCard: t, children: n, open: r, defaultOpen: i, onOpenChange: a, openDelay: o = 700, closeDelay: s = 300 } = e, c = Ln(t), l = O.useRef(0), u = O.useRef(0), f = O.useRef(!1), p = O.useRef(!1), [m, h] = d({
|
|
933
|
-
prop: r,
|
|
934
|
-
defaultProp: i ?? !1,
|
|
935
|
-
onChange: a,
|
|
936
|
-
caller: Pn
|
|
937
|
-
}), g = O.useCallback(() => {
|
|
938
|
-
clearTimeout(u.current), l.current = window.setTimeout(() => h(!0), o);
|
|
939
|
-
}, [o, h]), _ = O.useCallback(() => {
|
|
940
|
-
clearTimeout(l.current), !f.current && !p.current && (u.current = window.setTimeout(() => h(!1), s));
|
|
941
|
-
}, [s, h]), y = O.useCallback(() => h(!1), [h]);
|
|
942
|
-
return O.useEffect(() => () => {
|
|
943
|
-
clearTimeout(l.current), clearTimeout(u.current);
|
|
944
|
-
}, []), /* @__PURE__ */ D(Rn, {
|
|
945
|
-
scope: t,
|
|
946
|
-
open: m,
|
|
947
|
-
onOpenChange: h,
|
|
948
|
-
onOpen: g,
|
|
949
|
-
onClose: _,
|
|
950
|
-
onDismiss: y,
|
|
951
|
-
hasSelectionRef: f,
|
|
952
|
-
isPointerDownOnContentRef: p,
|
|
953
|
-
children: /* @__PURE__ */ D(v, {
|
|
954
|
-
...c,
|
|
955
|
-
children: n
|
|
956
|
-
})
|
|
957
|
-
});
|
|
958
|
-
}, "HoverCard"), Vn = "HoverCardTrigger", Hn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
959
|
-
let { __scopeHoverCard: n, ...r } = e, a = zn(Vn, n);
|
|
960
|
-
return /* @__PURE__ */ D(i, {
|
|
961
|
-
asChild: !0,
|
|
962
|
-
...Ln(n),
|
|
963
|
-
children: /* @__PURE__ */ D(p.a, {
|
|
964
|
-
"data-state": a.open ? "open" : "closed",
|
|
965
|
-
...r,
|
|
966
|
-
ref: t,
|
|
967
|
-
onPointerEnter: _(e.onPointerEnter, Xn(a.onOpen)),
|
|
968
|
-
onPointerLeave: _(e.onPointerLeave, Xn(a.onClose)),
|
|
969
|
-
onFocus: _(e.onFocus, a.onOpen),
|
|
970
|
-
onBlur: _(e.onBlur, a.onClose),
|
|
971
|
-
onTouchStart: _(e.onTouchStart, (e) => e.preventDefault())
|
|
972
|
-
})
|
|
973
|
-
});
|
|
974
|
-
}, "HoverCardTrigger")), Un = "HoverCardPortal", [Wn, Gn] = Fn(Un, { forceMount: void 0 }), Kn = /* @__PURE__ */ I((e) => {
|
|
975
|
-
let { __scopeHoverCard: n, forceMount: r, children: i, container: a } = e, o = zn(Un, n);
|
|
976
|
-
return /* @__PURE__ */ D(Wn, {
|
|
977
|
-
scope: n,
|
|
978
|
-
forceMount: r,
|
|
979
|
-
children: /* @__PURE__ */ D(x, {
|
|
980
|
-
present: r || o.open,
|
|
981
|
-
children: /* @__PURE__ */ D(t, {
|
|
982
|
-
asChild: !0,
|
|
983
|
-
container: a,
|
|
984
|
-
children: i
|
|
985
|
-
})
|
|
986
|
-
})
|
|
987
|
-
});
|
|
988
|
-
}, "HoverCardPortal"), qn = "HoverCardContent", Jn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
989
|
-
let n = Gn(qn, e.__scopeHoverCard), { forceMount: r = n.forceMount, ...i } = e, a = zn(qn, e.__scopeHoverCard);
|
|
990
|
-
return /* @__PURE__ */ D(x, {
|
|
991
|
-
present: r || a.open,
|
|
992
|
-
children: /* @__PURE__ */ D(Yn, {
|
|
993
|
-
"data-state": a.open ? "open" : "closed",
|
|
994
|
-
...i,
|
|
995
|
-
onPointerEnter: _(e.onPointerEnter, Xn(a.onOpen)),
|
|
996
|
-
onPointerLeave: _(e.onPointerLeave, Xn(a.onClose)),
|
|
997
|
-
ref: t
|
|
998
|
-
})
|
|
999
|
-
});
|
|
1000
|
-
}, "HoverCardContent")), Yn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ I(function(t, n) {
|
|
1001
|
-
let { __scopeHoverCard: r, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: o, onInteractOutside: c, ...u } = t, d = zn(qn, r), f = Ln(r), p = O.useRef(null), m = l(n, p), [h, g] = O.useState(!1);
|
|
1002
|
-
return O.useEffect(() => {
|
|
1003
|
-
if (h) {
|
|
1004
|
-
let e = document.body;
|
|
1005
|
-
return Nn = e.style.userSelect || e.style.webkitUserSelect, e.style.userSelect = "none", e.style.webkitUserSelect = "none", () => {
|
|
1006
|
-
e.style.userSelect = Nn, e.style.webkitUserSelect = Nn;
|
|
1007
|
-
};
|
|
1008
|
-
}
|
|
1009
|
-
}, [h]), O.useEffect(() => {
|
|
1010
|
-
if (p.current) {
|
|
1011
|
-
let e = /* @__PURE__ */ I(() => {
|
|
1012
|
-
g(!1), d.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
1013
|
-
document.getSelection()?.toString() !== "" && (d.hasSelectionRef.current = !0);
|
|
1014
|
-
});
|
|
1015
|
-
}, "handlePointerUp");
|
|
1016
|
-
return document.addEventListener("pointerup", e), () => {
|
|
1017
|
-
document.removeEventListener("pointerup", e), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !1;
|
|
1018
|
-
};
|
|
1019
|
-
}
|
|
1020
|
-
}, [d.isPointerDownOnContentRef, d.hasSelectionRef]), O.useEffect(() => {
|
|
1021
|
-
p.current && Zn(p.current).forEach((e) => e.setAttribute("tabindex", "-1"));
|
|
1022
|
-
}), /* @__PURE__ */ D(e, {
|
|
1023
|
-
asChild: !0,
|
|
1024
|
-
disableOutsidePointerEvents: !1,
|
|
1025
|
-
onInteractOutside: c,
|
|
1026
|
-
onEscapeKeyDown: i,
|
|
1027
|
-
onPointerDownOutside: a,
|
|
1028
|
-
onFocusOutside: _(o, (e) => {
|
|
1029
|
-
e.preventDefault();
|
|
1030
|
-
}),
|
|
1031
|
-
onDismiss: d.onDismiss,
|
|
1032
|
-
children: /* @__PURE__ */ D(s, {
|
|
1033
|
-
...f,
|
|
1034
|
-
...u,
|
|
1035
|
-
onPointerDown: _(u.onPointerDown, (e) => {
|
|
1036
|
-
e.currentTarget.contains(e.target) && g(!0), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !0;
|
|
1037
|
-
}),
|
|
1038
|
-
ref: m,
|
|
1039
|
-
style: {
|
|
1040
|
-
...u.style,
|
|
1041
|
-
userSelect: h ? "text" : void 0,
|
|
1042
|
-
WebkitUserSelect: h ? "text" : void 0,
|
|
1043
|
-
"--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1044
|
-
"--radix-hover-card-content-available-width": "var(--radix-popper-available-width)",
|
|
1045
|
-
"--radix-hover-card-content-available-height": "var(--radix-popper-available-height)",
|
|
1046
|
-
"--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1047
|
-
"--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1048
|
-
}
|
|
1049
|
-
})
|
|
1050
|
-
});
|
|
1051
|
-
}, "HoverCardContentImpl"));
|
|
1052
|
-
function Xn(e) {
|
|
1053
|
-
return (t) => t.pointerType === "touch" ? void 0 : e();
|
|
1054
|
-
}
|
|
1055
|
-
I(Xn, "excludeTouch");
|
|
1056
|
-
function Zn(e) {
|
|
1057
|
-
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ I((e) => e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP, "acceptNode") });
|
|
1058
|
-
for (; n.nextNode();) t.push(n.currentNode);
|
|
1059
|
-
return t;
|
|
1060
|
-
}
|
|
1061
|
-
I(Zn, "getTabbableNodes");
|
|
1062
|
-
var Qn = Bn, $n = Hn, er = Kn, tr = Jn, nr = f("transition-all duration-500", {
|
|
1063
|
-
variants: {
|
|
1064
|
-
variant: {
|
|
1065
|
-
1: "",
|
|
1066
|
-
2: "",
|
|
1067
|
-
3: "",
|
|
1068
|
-
4: ""
|
|
1069
|
-
},
|
|
1070
|
-
color: {
|
|
1071
|
-
primary: null,
|
|
1072
|
-
secondary: null,
|
|
1073
|
-
info: null,
|
|
1074
|
-
warning: null,
|
|
1075
|
-
default: null,
|
|
1076
|
-
error: null,
|
|
1077
|
-
success: null,
|
|
1078
|
-
light: null
|
|
1079
|
-
}
|
|
1080
|
-
},
|
|
1081
|
-
defaultVariants: {
|
|
1082
|
-
variant: "1",
|
|
1083
|
-
color: "primary"
|
|
1084
|
-
},
|
|
1085
|
-
compoundVariants: [
|
|
1086
|
-
{
|
|
1087
|
-
variant: "1",
|
|
1088
|
-
color: "primary",
|
|
1089
|
-
className: "border-primary/10 border-t-primary"
|
|
1090
|
-
},
|
|
1091
|
-
{
|
|
1092
|
-
variant: "1",
|
|
1093
|
-
color: "secondary",
|
|
1094
|
-
className: "border-secondary/10 border-t-secondary"
|
|
1095
|
-
},
|
|
1096
|
-
{
|
|
1097
|
-
variant: "1",
|
|
1098
|
-
color: "success",
|
|
1099
|
-
className: "border-success/10 border-t-success"
|
|
1100
|
-
},
|
|
1101
|
-
{
|
|
1102
|
-
variant: "1",
|
|
1103
|
-
color: "info",
|
|
1104
|
-
className: "border-info/10 border-t-info"
|
|
1105
|
-
},
|
|
1106
|
-
{
|
|
1107
|
-
variant: "1",
|
|
1108
|
-
color: "warning",
|
|
1109
|
-
className: "border-warning/10 border-t-warning"
|
|
1110
|
-
},
|
|
1111
|
-
{
|
|
1112
|
-
variant: "1",
|
|
1113
|
-
color: "error",
|
|
1114
|
-
className: "border-error/10 border-t-error"
|
|
1115
|
-
},
|
|
1116
|
-
{
|
|
1117
|
-
variant: "1",
|
|
1118
|
-
color: "default",
|
|
1119
|
-
className: "border-foreground/10 border-t-foreground"
|
|
1120
|
-
},
|
|
1121
|
-
{
|
|
1122
|
-
variant: "1",
|
|
1123
|
-
color: "light",
|
|
1124
|
-
className: "border-white/10 border-t-white"
|
|
1125
|
-
},
|
|
1126
|
-
{
|
|
1127
|
-
variant: "2",
|
|
1128
|
-
color: "primary",
|
|
1129
|
-
className: "border-primary/10 border-b-primary border-t-primary"
|
|
1130
|
-
},
|
|
1131
|
-
{
|
|
1132
|
-
variant: "2",
|
|
1133
|
-
color: "secondary",
|
|
1134
|
-
className: "border-secondary/10 border-b-secondary border-t-secondary"
|
|
1135
|
-
},
|
|
1136
|
-
{
|
|
1137
|
-
variant: "2",
|
|
1138
|
-
color: "success",
|
|
1139
|
-
className: "border-success/10 border-b-success border-t-success"
|
|
1140
|
-
},
|
|
1141
|
-
{
|
|
1142
|
-
variant: "2",
|
|
1143
|
-
color: "info",
|
|
1144
|
-
className: "border-info/10 border-b-info border-t-info"
|
|
1145
|
-
},
|
|
1146
|
-
{
|
|
1147
|
-
variant: "2",
|
|
1148
|
-
color: "warning",
|
|
1149
|
-
className: "border-warning/10 border-b-warning border-t-warning"
|
|
1150
|
-
},
|
|
1151
|
-
{
|
|
1152
|
-
variant: "2",
|
|
1153
|
-
color: "error",
|
|
1154
|
-
className: "border-error/10 border-b-error border-t-error"
|
|
1155
|
-
},
|
|
1156
|
-
{
|
|
1157
|
-
variant: "2",
|
|
1158
|
-
color: "default",
|
|
1159
|
-
className: "border-foreground/10 border-b-foreground border-t-foreground"
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
variant: "2",
|
|
1163
|
-
color: "light",
|
|
1164
|
-
className: "border-white/10 border-b-white border-t-white"
|
|
1165
|
-
},
|
|
1166
|
-
{
|
|
1167
|
-
variant: "3",
|
|
1168
|
-
color: "primary",
|
|
1169
|
-
className: "border-primary/10 border-b-primary border-t-primary border-r-primary"
|
|
1170
|
-
},
|
|
1171
|
-
{
|
|
1172
|
-
variant: "3",
|
|
1173
|
-
color: "secondary",
|
|
1174
|
-
className: "border-secondary/10 border-b-secondary border-t-secondary border-r-secondary"
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
variant: "3",
|
|
1178
|
-
color: "success",
|
|
1179
|
-
className: "border-success/10 border-b-success border-t-success border-r-success"
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
variant: "3",
|
|
1183
|
-
color: "info",
|
|
1184
|
-
className: "border-info/10 border-b-info border-t-info border-r-info"
|
|
1185
|
-
},
|
|
1186
|
-
{
|
|
1187
|
-
variant: "3",
|
|
1188
|
-
color: "warning",
|
|
1189
|
-
className: "border-warning/10 border-b-warning border-t-warning border-r-warning"
|
|
1190
|
-
},
|
|
1191
|
-
{
|
|
1192
|
-
variant: "3",
|
|
1193
|
-
color: "error",
|
|
1194
|
-
className: "border-error/10 border-b-error border-t-error border-r-error"
|
|
1195
|
-
},
|
|
1196
|
-
{
|
|
1197
|
-
variant: "3",
|
|
1198
|
-
color: "default",
|
|
1199
|
-
className: "border-foreground/10 border-b-foreground border-t-foreground border-r-foreground"
|
|
1200
|
-
},
|
|
1201
|
-
{
|
|
1202
|
-
variant: "3",
|
|
1203
|
-
color: "light",
|
|
1204
|
-
className: "border-white/10 border-b-white border-t-white border-r-white"
|
|
1205
|
-
},
|
|
1206
|
-
{
|
|
1207
|
-
variant: "4",
|
|
1208
|
-
color: "primary",
|
|
1209
|
-
className: "stroke-primary"
|
|
1210
|
-
},
|
|
1211
|
-
{
|
|
1212
|
-
variant: "4",
|
|
1213
|
-
color: "secondary",
|
|
1214
|
-
className: "stroke-secondary"
|
|
1215
|
-
},
|
|
1216
|
-
{
|
|
1217
|
-
variant: "4",
|
|
1218
|
-
color: "success",
|
|
1219
|
-
className: "stroke-success"
|
|
1220
|
-
},
|
|
1221
|
-
{
|
|
1222
|
-
variant: "4",
|
|
1223
|
-
color: "info",
|
|
1224
|
-
className: "stroke-info"
|
|
1225
|
-
},
|
|
1226
|
-
{
|
|
1227
|
-
variant: "4",
|
|
1228
|
-
color: "warning",
|
|
1229
|
-
className: "stroke-warning"
|
|
1230
|
-
},
|
|
1231
|
-
{
|
|
1232
|
-
variant: "4",
|
|
1233
|
-
color: "error",
|
|
1234
|
-
className: "stroke-error"
|
|
1235
|
-
},
|
|
1236
|
-
{
|
|
1237
|
-
variant: "4",
|
|
1238
|
-
color: "default",
|
|
1239
|
-
className: "stroke-foreground"
|
|
1240
|
-
},
|
|
1241
|
-
{
|
|
1242
|
-
variant: "4",
|
|
1243
|
-
color: "light",
|
|
1244
|
-
className: "stroke-white"
|
|
1245
|
-
}
|
|
1246
|
-
]
|
|
1247
|
-
});
|
|
1248
|
-
function rr({ variant: e = "1", color: t, className: n, ...r }) {
|
|
1249
|
-
let { t: i } = E();
|
|
1250
|
-
return e === "4" ? /* @__PURE__ */ ne(te, { children: [/* @__PURE__ */ D("style", { children: "@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n \n @keyframes spin2 {\n 0% {\n stroke-dasharray: 1, 800;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 400, 400;\n stroke-dashoffset: -200px;\n }\n 100% {\n stroke-dasharray: 800, 1;\n stroke-dashoffset: -800px;\n }\n }\n \n .spin2 {\n transform-origin: center;\n animation: spin2 1.5s ease-in-out infinite,\n spin 2s linear infinite;\n animation-direction: alternate;\n }" }), /* @__PURE__ */ D("svg", {
|
|
1251
|
-
viewBox: "0 0 800 800",
|
|
1252
|
-
"data-slot": "spinner",
|
|
1253
|
-
"data-variant": e,
|
|
1254
|
-
"data-color": t,
|
|
1255
|
-
className: T("size-14", n),
|
|
1256
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1257
|
-
role: "img",
|
|
1258
|
-
"aria-label": r["aria-label"] ?? i("material.spinner.loading", "Loading..."),
|
|
1259
|
-
children: /* @__PURE__ */ D("circle", {
|
|
1260
|
-
className: T("spin2", nr({
|
|
1261
|
-
variant: e,
|
|
1262
|
-
color: t
|
|
1263
|
-
})),
|
|
1264
|
-
cx: "400",
|
|
1265
|
-
cy: "400",
|
|
1266
|
-
fill: "none",
|
|
1267
|
-
r: "200",
|
|
1268
|
-
strokeWidth: "50",
|
|
1269
|
-
strokeDasharray: "700 1400",
|
|
1270
|
-
strokeLinecap: "round"
|
|
1271
|
-
})
|
|
1272
|
-
})] }) : /* @__PURE__ */ D("div", {
|
|
1273
|
-
"data-slot": "spinner",
|
|
1274
|
-
"data-variant": e,
|
|
1275
|
-
"data-color": t,
|
|
1276
|
-
className: T("size-12 border-[2px] rounded-full animate-spin", nr({
|
|
1277
|
-
variant: e,
|
|
1278
|
-
color: t,
|
|
1279
|
-
className: n
|
|
1280
|
-
})),
|
|
1281
|
-
...r
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
//#endregion
|
|
1285
|
-
//#region lib/components/ui/actions/button/button.variants.ts
|
|
1286
|
-
var ir = f("inline-flex center truncate **:truncate gap-2 h-min cursor-pointer whitespace-nowrap rounded-full text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error px-4 py-2 has-[>svg]:px-3", {
|
|
1287
|
-
variants: {
|
|
1288
|
-
variant: {
|
|
1289
|
-
filled: "shadow-xs",
|
|
1290
|
-
tonal: "shadow-xs",
|
|
1291
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
1292
|
-
outlined: "border shadow-xs",
|
|
1293
|
-
link: "focus:underline underline-offset-4 hover:underline"
|
|
1294
|
-
},
|
|
1295
|
-
color: {
|
|
1296
|
-
primary: null,
|
|
1297
|
-
secondary: null,
|
|
1298
|
-
info: null,
|
|
1299
|
-
warning: null,
|
|
1300
|
-
default: null,
|
|
1301
|
-
error: null,
|
|
1302
|
-
success: null
|
|
1303
|
-
},
|
|
1304
|
-
size: {
|
|
1305
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
1306
|
-
xs: "h-6 gap-1 rounded-full px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
1307
|
-
sm: "h-8 rounded-full gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
1308
|
-
lg: "h-10 rounded-full px-6 has-[>svg]:px-4",
|
|
1309
|
-
icon: "size-9 px-0 py-0 has-[>svg]:px-0",
|
|
1310
|
-
"icon-xs": "size-6 rounded-full px-0 py-0 has-[>svg]:px-0 [&_svg:not([class*='size-'])]:size-3",
|
|
1311
|
-
"icon-sm": "size-8 px-0 py-0 has-[>svg]:px-0",
|
|
1312
|
-
"icon-lg": "size-10 px-0 py-0 has-[>svg]:px-0"
|
|
1313
|
-
}
|
|
1314
|
-
},
|
|
1315
|
-
defaultVariants: {
|
|
1316
|
-
variant: "filled",
|
|
1317
|
-
color: "primary"
|
|
1318
|
-
},
|
|
1319
|
-
compoundVariants: [
|
|
1320
|
-
{
|
|
1321
|
-
variant: "filled",
|
|
1322
|
-
color: "primary",
|
|
1323
|
-
class: "bg-primary text-primary-foreground hover:bg-primary/90 [&_svg]:data-[slot=icon]:text-primary-foreground active:bg-primary/70 focus:bg-primary/80"
|
|
1324
|
-
},
|
|
1325
|
-
{
|
|
1326
|
-
variant: "filled",
|
|
1327
|
-
color: "secondary",
|
|
1328
|
-
class: "bg-secondary text-secondary-foreground hover:bg-secondary/90 [&_svg]:data-[slot=icon]:text-secondary-foreground active:bg-secondary/70 focus:bg-secondary/80"
|
|
1329
|
-
},
|
|
1330
|
-
{
|
|
1331
|
-
variant: "filled",
|
|
1332
|
-
color: "success",
|
|
1333
|
-
class: "bg-success text-success-foreground hover:bg-success/90 [&_svg]:data-[slot=icon]:text-success-foreground active:bg-success/70 focus:bg-success/80"
|
|
1334
|
-
},
|
|
1335
|
-
{
|
|
1336
|
-
variant: "filled",
|
|
1337
|
-
color: "info",
|
|
1338
|
-
class: "bg-info text-info-foreground hover:bg-info/90 [&_svg]:data-[slot=icon]:text-info-foreground active:bg-info/70 focus:bg-info/80"
|
|
1339
|
-
},
|
|
1340
|
-
{
|
|
1341
|
-
variant: "filled",
|
|
1342
|
-
color: "warning",
|
|
1343
|
-
class: "bg-warning text-warning-foreground hover:bg-warning/90 [&_svg]:data-[slot=icon]:text-warning-foreground active:bg-warning/70 focus:bg-warning/80"
|
|
1344
|
-
},
|
|
1345
|
-
{
|
|
1346
|
-
variant: "filled",
|
|
1347
|
-
color: "error",
|
|
1348
|
-
class: "bg-error text-error-foreground hover:bg-error/90 [&_svg]:data-[slot=icon]:text-error-foreground active:bg-error/70 focus:bg-error/80"
|
|
1349
|
-
},
|
|
1350
|
-
{
|
|
1351
|
-
variant: "filled",
|
|
1352
|
-
color: "default",
|
|
1353
|
-
class: "bg-foreground text-background hover:bg-foreground/90 [&_svg]:data-[slot=icon]:text-foreground active:bg-foreground/70 focus:bg-foreground/80"
|
|
1354
|
-
},
|
|
1355
|
-
{
|
|
1356
|
-
variant: "tonal",
|
|
1357
|
-
color: "primary",
|
|
1358
|
-
class: "bg-primary/15 text-primary hover:bg-primary/10 [&_svg]:data-[slot=icon]:text-primary active:bg-primary/5 focus:bg-primary/50"
|
|
1359
|
-
},
|
|
1360
|
-
{
|
|
1361
|
-
variant: "tonal",
|
|
1362
|
-
color: "secondary",
|
|
1363
|
-
class: "bg-secondary/15 text-secondary hover:bg-secondary/10 [&_svg]:data-[slot=icon]:text-secondary active:bg-secondary/5 focus:bg-secondary/50"
|
|
1364
|
-
},
|
|
1365
|
-
{
|
|
1366
|
-
variant: "tonal",
|
|
1367
|
-
color: "info",
|
|
1368
|
-
class: "bg-info/15 text-info hover:bg-info/10 [&_svg]:data-[slot=icon]:text-info active:bg-info/5 focus:bg-info/50"
|
|
1369
|
-
},
|
|
1370
|
-
{
|
|
1371
|
-
variant: "tonal",
|
|
1372
|
-
color: "success",
|
|
1373
|
-
class: "bg-success/15 text-success hover:bg-success/10 [&_svg]:data-[slot=icon]:text-success active:bg-success/5 focus:bg-success/50"
|
|
1374
|
-
},
|
|
1375
|
-
{
|
|
1376
|
-
variant: "tonal",
|
|
1377
|
-
color: "warning",
|
|
1378
|
-
class: "bg-warning/15 text-warning hover:bg-warning/10 [&_svg]:data-[slot=icon]:text-warning active:bg-warning/5 focus:bg-warning/50"
|
|
1379
|
-
},
|
|
1380
|
-
{
|
|
1381
|
-
variant: "tonal",
|
|
1382
|
-
color: "error",
|
|
1383
|
-
class: "bg-error/15 text-error hover:bg-error/10 [&_svg]:data-[slot=icon]:text-error active:bg-error/5 focus:bg-error/50"
|
|
1384
|
-
},
|
|
1385
|
-
{
|
|
1386
|
-
variant: "tonal",
|
|
1387
|
-
color: "default",
|
|
1388
|
-
class: "bg-foreground/15 text-foreground hover:bg-foreground/10 [&_svg]:data-[slot=icon]:text-foreground active:bg-muted focus:bg-muted0"
|
|
1389
|
-
},
|
|
1390
|
-
{
|
|
1391
|
-
variant: "outlined",
|
|
1392
|
-
color: "primary",
|
|
1393
|
-
class: "text-primary border-primary/50 [&_svg]:data-[slot=icon]:text-primary focus:bg-primary/20 hover:bg-primary/10 hover:text-primary/90"
|
|
1394
|
-
},
|
|
1395
|
-
{
|
|
1396
|
-
variant: "outlined",
|
|
1397
|
-
color: "secondary",
|
|
1398
|
-
class: "text-secondary border-secondary/50 [&_svg]:data-[slot=icon]:text-secondary focus:bg-secondary/20 hover:bg-secondary/10 hover:text-secondary/90"
|
|
1399
|
-
},
|
|
1400
|
-
{
|
|
1401
|
-
variant: "outlined",
|
|
1402
|
-
color: "info",
|
|
1403
|
-
class: "text-info border-info/50 [&_svg]:data-[slot=icon]:text-info focus:bg-info/20 hover:bg-info/10 hover:text-info/90"
|
|
1404
|
-
},
|
|
1405
|
-
{
|
|
1406
|
-
variant: "outlined",
|
|
1407
|
-
color: "success",
|
|
1408
|
-
class: "text-success border-success/50 [&_svg]:data-[slot=icon]:text-success focus:bg-success/20 hover:bg-success/10 hover:text-success/90"
|
|
1409
|
-
},
|
|
1410
|
-
{
|
|
1411
|
-
variant: "outlined",
|
|
1412
|
-
color: "warning",
|
|
1413
|
-
class: "text-warning border-warning/50 [&_svg]:data-[slot=icon]:text-warning focus:bg-warning/20 hover:bg-warning/10 hover:text-warning/90"
|
|
1414
|
-
},
|
|
1415
|
-
{
|
|
1416
|
-
variant: "outlined",
|
|
1417
|
-
color: "error",
|
|
1418
|
-
class: "text-error border-error/50 [&_svg]:data-[slot=icon]:text-error focus:bg-error/20 hover:bg-error/10 hover:text-error/90"
|
|
1419
|
-
},
|
|
1420
|
-
{
|
|
1421
|
-
variant: "outlined",
|
|
1422
|
-
color: "default",
|
|
1423
|
-
class: "text-foreground border-foreground/50 [&_svg]:data-[slot=icon]:text-foreground focus:bg-foreground/20 hover:bg-foreground/10 hover:text-foreground/90"
|
|
1424
|
-
},
|
|
1425
|
-
{
|
|
1426
|
-
variant: "link",
|
|
1427
|
-
color: "primary",
|
|
1428
|
-
class: "text-primary [&_svg]:data-[slot=icon]:text-primary hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/15"
|
|
1429
|
-
},
|
|
1430
|
-
{
|
|
1431
|
-
variant: "link",
|
|
1432
|
-
color: "secondary",
|
|
1433
|
-
class: "text-secondary [&_svg]:data-[slot=icon]:text-secondary hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/15"
|
|
1434
|
-
},
|
|
1435
|
-
{
|
|
1436
|
-
variant: "link",
|
|
1437
|
-
color: "success",
|
|
1438
|
-
class: "text-success [&_svg]:data-[slot=icon]:text-success hover:bg-success/10 active:bg-success/5 focus:bg-success/15"
|
|
1439
|
-
},
|
|
1440
|
-
{
|
|
1441
|
-
variant: "link",
|
|
1442
|
-
color: "info",
|
|
1443
|
-
class: "text-info [&_svg]:data-[slot=icon]:text-info hover:bg-info/10 active:bg-info/5 focus:bg-info/15"
|
|
1444
|
-
},
|
|
1445
|
-
{
|
|
1446
|
-
variant: "link",
|
|
1447
|
-
color: "warning",
|
|
1448
|
-
class: "text-warning [&_svg]:data-[slot=icon]:text-warning hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/15"
|
|
1449
|
-
},
|
|
1450
|
-
{
|
|
1451
|
-
variant: "link",
|
|
1452
|
-
color: "error",
|
|
1453
|
-
class: "text-error [&_svg]:data-[slot=icon]:text-error hover:bg-error/10 active:bg-error/5 focus:bg-error/15"
|
|
1454
|
-
},
|
|
1455
|
-
{
|
|
1456
|
-
variant: "link",
|
|
1457
|
-
color: "default",
|
|
1458
|
-
class: "text-foreground [&_svg]:data-[slot=icon]:text-foreground hover:bg-foreground/10 active:bg-muted focus:bg-foreground/15"
|
|
1459
|
-
}
|
|
1460
|
-
]
|
|
1461
|
-
});
|
|
1462
|
-
//#endregion
|
|
1463
|
-
//#region lib/components/ui/actions/button/has-text-content.ts
|
|
1464
|
-
function ar(e) {
|
|
1465
|
-
return e == null || typeof e == "boolean" ? !1 : typeof e == "string" || typeof e == "number" || typeof e == "bigint" ? String(e).trim() !== "" : Array.isArray(e) ? e.some(ar) : ae(e) ? !or(e.props["aria-hidden"]) && ar(e.props.children) : !1;
|
|
1466
|
-
}
|
|
1467
|
-
function or(e) {
|
|
1468
|
-
return !!e && e !== "false";
|
|
1469
|
-
}
|
|
1470
|
-
//#endregion
|
|
1471
|
-
//#region lib/components/ui/actions/button/button.tsx
|
|
1472
|
-
function sr({ className: e, variant: t = "filled", asChild: n = !1, children: r, color: i, size: o, loading: s, spinnerVariant: l = "2", disabled: u, onClick: d, type: f = "button", ...p }) {
|
|
1473
|
-
let m = n ? a : "button";
|
|
1474
|
-
return /* @__PURE__ */ D(b, {
|
|
1475
|
-
value: se(b) || !!(p["aria-label"] || p["aria-labelledby"]) || ar(r),
|
|
1476
|
-
children: /* @__PURE__ */ ne(m, {
|
|
1477
|
-
"data-slot": "button",
|
|
1478
|
-
"data-variant": t,
|
|
1479
|
-
"data-color": i,
|
|
1480
|
-
className: T("w-max truncate justify-center line-clamp-1 text-ellipsis duration-500", ir({
|
|
1481
|
-
variant: t,
|
|
1482
|
-
color: i,
|
|
1483
|
-
size: o
|
|
1484
|
-
}), e),
|
|
1485
|
-
type: n ? void 0 : f,
|
|
1486
|
-
disabled: u,
|
|
1487
|
-
onClick: s ? (e) => {
|
|
1488
|
-
e.preventDefault();
|
|
1489
|
-
} : d,
|
|
1490
|
-
...p,
|
|
1491
|
-
children: [s && /* @__PURE__ */ D(rr, {
|
|
1492
|
-
variant: l,
|
|
1493
|
-
color: t === "filled" ? "light" : i,
|
|
1494
|
-
className: T("starting:scale-0 duration-500", l === "4" ? "size-7.5" : "size-4.5")
|
|
1495
|
-
}), /* @__PURE__ */ D(c, { children: r })]
|
|
1496
|
-
})
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
|
-
function cr({ tooltip: e, ...t }) {
|
|
1500
|
-
return e ? /* @__PURE__ */ D(u, {
|
|
1501
|
-
content: e,
|
|
1502
|
-
children: /* @__PURE__ */ D(sr, { ...t })
|
|
1503
|
-
}) : /* @__PURE__ */ D(sr, { ...t });
|
|
1504
|
-
}
|
|
1505
|
-
//#endregion
|
|
1506
|
-
//#region ../../node_modules/react-use/esm/misc/util.js
|
|
1507
|
-
var lr = function() {};
|
|
1508
|
-
function ur(e) {
|
|
1509
|
-
var t = [...arguments].slice(1);
|
|
1510
|
-
e && e.addEventListener && e.addEventListener.apply(e, t);
|
|
1511
|
-
}
|
|
1512
|
-
function dr(e) {
|
|
1513
|
-
var t = [...arguments].slice(1);
|
|
1514
|
-
e && e.removeEventListener && e.removeEventListener.apply(e, t);
|
|
1515
|
-
}
|
|
1516
|
-
var fr = typeof window < "u", pr = fr ? window : null, mr = function(e) {
|
|
1517
|
-
return !!e.addEventListener;
|
|
1518
|
-
}, hr = function(e) {
|
|
1519
|
-
return !!e.on;
|
|
1520
|
-
}, gr = function(e, t, n, r) {
|
|
1521
|
-
n === void 0 && (n = pr), ce(function() {
|
|
1522
|
-
if (t && n) return mr(n) ? ur(n, e, t, r) : hr(n) && n.on(e, t, r), function() {
|
|
1523
|
-
mr(n) ? dr(n, e, t, r) : hr(n) && n.off(e, t, r);
|
|
1524
|
-
};
|
|
1525
|
-
}, [
|
|
1526
|
-
e,
|
|
1527
|
-
t,
|
|
1528
|
-
n,
|
|
1529
|
-
JSON.stringify(r)
|
|
1530
|
-
]);
|
|
1531
|
-
}, _r = function(e) {
|
|
1532
|
-
var t = de(e);
|
|
1533
|
-
return t.current = e, t;
|
|
1534
|
-
}, vr = f("overflow-auto in-[[data-state=selected]]:text-primary-foreground", {
|
|
1535
|
-
variants: { variant: {
|
|
1536
|
-
normal: "text-sm",
|
|
1537
|
-
"huge-larger": "text-8xl font-semibold",
|
|
1538
|
-
"huge-large": "text-8xl font-semibold",
|
|
1539
|
-
"huge-medium": "text-7xl font-semibold",
|
|
1540
|
-
"huge-small": "text-6xl font-semibold",
|
|
1541
|
-
"headline-larger": "text-5xl font-semibold",
|
|
1542
|
-
"headline-large": "text-4xl font-semibold",
|
|
1543
|
-
"headline-medium": "text-3xl font-semibold",
|
|
1544
|
-
"headline-small": "text-2xl font-semibold",
|
|
1545
|
-
"title-large": "text-xl font-semibold",
|
|
1546
|
-
"title-medium": "text-lg font-semibold",
|
|
1547
|
-
"title-small": "text-base font-semibold",
|
|
1548
|
-
"body-medium": "text-sm",
|
|
1549
|
-
"body-small": "text-xs",
|
|
1550
|
-
caption: "text-[10px] text-muted-foreground"
|
|
1551
|
-
} },
|
|
1552
|
-
defaultVariants: { variant: "normal" }
|
|
1553
|
-
});
|
|
1554
|
-
function yr({ className: e, variant: t, ...n }) {
|
|
1555
|
-
return /* @__PURE__ */ D("div", {
|
|
1556
|
-
"data-test": "typogaphy",
|
|
1557
|
-
className: T(vr({
|
|
1558
|
-
variant: t,
|
|
1559
|
-
className: e
|
|
1560
|
-
})),
|
|
1561
|
-
...n
|
|
1562
|
-
});
|
|
1563
|
-
}
|
|
1564
|
-
//#endregion
|
|
1565
|
-
//#region lib/components/ui/forms/field-blur-context.ts
|
|
1566
|
-
var br = ie(null);
|
|
1567
|
-
function xr(e, t) {
|
|
1568
|
-
return ue(() => e ? t ? (n) => {
|
|
1569
|
-
let r = e(n), i = typeof t == "function" ? t(n) : void 0;
|
|
1570
|
-
return typeof t != "function" && (t.current = n), () => {
|
|
1571
|
-
r?.(), typeof i == "function" ? i() : typeof t == "function" ? t(null) : t.current = null;
|
|
1572
|
-
};
|
|
1573
|
-
} : e : t, [e, t]);
|
|
1574
|
-
}
|
|
1575
|
-
function Sr(e) {
|
|
1576
|
-
return xr(A(br), e);
|
|
1577
|
-
}
|
|
1578
|
-
//#endregion
|
|
1579
|
-
//#region lib/components/ui/primitives/helper-text/helper-text.tsx
|
|
1580
|
-
function Cr({ error: e, className: t, ...n }) {
|
|
1581
|
-
return /* @__PURE__ */ D(yr, {
|
|
1582
|
-
"data-slot": "helper-text",
|
|
1583
|
-
variant: "caption",
|
|
1584
|
-
className: T("flex pl-0.5 truncate text-wrap", { "text-error": e }, t),
|
|
1585
|
-
...n
|
|
1586
|
-
});
|
|
1587
|
-
}
|
|
1588
|
-
//#endregion
|
|
1589
|
-
//#region lib/components/ui/primitives/label/label.tsx
|
|
1590
|
-
function wr({ className: e, withAsterisk: t, ...n }) {
|
|
1591
|
-
return /* @__PURE__ */ D(jn, {
|
|
1592
|
-
"data-slot": "label",
|
|
1593
|
-
className: T("flex items-center pl-0.5 gap-2 text-sm leading-none font-semibold select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
1594
|
-
...n,
|
|
1595
|
-
children: t ? /* @__PURE__ */ ne("div", {
|
|
1596
|
-
className: "inline-flex",
|
|
1597
|
-
children: [n.children, /* @__PURE__ */ D("span", {
|
|
1598
|
-
"aria-hidden": "true",
|
|
1599
|
-
className: "text-error",
|
|
1600
|
-
children: "*"
|
|
1601
|
-
})]
|
|
1602
|
-
}) : n.children
|
|
1603
|
-
});
|
|
1604
|
-
}
|
|
1605
|
-
//#endregion
|
|
1606
|
-
//#region lib/components/ui/overlays/dialog/use-return-focus.ts
|
|
1607
|
-
var Tr = "button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]";
|
|
1608
|
-
function Er(e) {
|
|
1609
|
-
([...e.querySelectorAll(Tr)].find((e) => e.tabIndex >= 0 && e.getClientRects().length > 0) ?? e).focus({ preventScroll: !0 });
|
|
1610
|
-
}
|
|
1611
|
-
function Dr(e, { focusFallback: t = !1 } = {}) {
|
|
1612
|
-
let n = de(null);
|
|
1613
|
-
return {
|
|
1614
|
-
onOpenAutoFocus(r) {
|
|
1615
|
-
let i = document.activeElement;
|
|
1616
|
-
n.current = i instanceof HTMLElement && i !== document.body ? i : null, e.onOpenAutoFocus?.(r);
|
|
1617
|
-
let a = r.target;
|
|
1618
|
-
!t || r.defaultPrevented || !(a instanceof HTMLElement) || queueMicrotask(() => {
|
|
1619
|
-
a.isConnected && !a.contains(document.activeElement) && Er(a);
|
|
1620
|
-
});
|
|
1621
|
-
},
|
|
1622
|
-
onCloseAutoFocus(t) {
|
|
1623
|
-
e.onCloseAutoFocus?.(t);
|
|
1624
|
-
let r = n.current;
|
|
1625
|
-
if (n.current = null, t.defaultPrevented || !r?.isConnected) return;
|
|
1626
|
-
let i = document.activeElement;
|
|
1627
|
-
i && i !== document.body || (t.preventDefault(), r.focus());
|
|
1628
|
-
}
|
|
1629
|
-
};
|
|
1630
|
-
}
|
|
1631
|
-
//#endregion
|
|
1632
|
-
//#region lib/components/ui/primitives/input/input-box.ts
|
|
1633
|
-
var Or = [
|
|
1634
|
-
"inline-flex gap-2 items-center h-11 max-h-full w-full bg-muted/5 disabled:bg-transparent",
|
|
1635
|
-
"file:text-muted-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input",
|
|
1636
|
-
"rounded border px-2 py-1 text-base shadow-xs transition-all outline-none file:inline-flex",
|
|
1637
|
-
"file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
1638
|
-
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
1639
|
-
"focus-visible:border-primary focus-visible:ring-primary/30 focus-visible:ring-[2px]",
|
|
1640
|
-
"aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error"
|
|
1641
|
-
], kr = [...Or, "not-placeholder-shown:bg-primary/10"];
|
|
1642
|
-
function Ar({ className: e, type: t = "text", ...n }) {
|
|
1643
|
-
return /* @__PURE__ */ D("input", {
|
|
1644
|
-
type: t,
|
|
1645
|
-
"data-slot": "input",
|
|
1646
|
-
className: T(kr, e),
|
|
1647
|
-
"data-pw": n.name ?? "input",
|
|
1648
|
-
...n
|
|
1649
|
-
});
|
|
1650
|
-
}
|
|
1651
|
-
//#endregion
|
|
1652
|
-
//#region lib/components/ui/fields/text-field/text-field.tsx
|
|
1653
|
-
function jr({ error: e, helperText: t, label: n, className: r, leading: i, trailing: a, ...o }) {
|
|
1654
|
-
let s = Sr(), c = le(), l = /* @__PURE__ */ ne("div", {
|
|
1655
|
-
className: T("relative", {
|
|
1656
|
-
"*:first:size-8 *:first:absolute *:first:top-[calc(50%-16px)] *:first:left-1.5 [&_input]:pl-10 *:first:bg-muted/80 *:first:text-muted-foreground": !!i,
|
|
1657
|
-
"*:last:size-8 *:last:absolute *:last:top-[calc(50%-16px)] *:last:right-1.5 [&_input]:pr-.5 *:last:bg-muted/80 *:last:text-muted-foreground": !!a
|
|
1658
|
-
}),
|
|
1659
|
-
children: [
|
|
1660
|
-
i && i,
|
|
1661
|
-
/* @__PURE__ */ D(Ar, {
|
|
1662
|
-
"aria-invalid": e,
|
|
1663
|
-
...o,
|
|
1664
|
-
id: o.id ?? c,
|
|
1665
|
-
className: T("transition-all hover:border-primary hover:ring-[2px] hover:ring-primary/25")
|
|
1666
|
-
}),
|
|
1667
|
-
a && a
|
|
1668
|
-
]
|
|
1669
|
-
});
|
|
1670
|
-
return /* @__PURE__ */ ne("div", {
|
|
1671
|
-
ref: s,
|
|
1672
|
-
"data-slot": "text-field",
|
|
1673
|
-
className: T("grid w-full gap-1.5", r),
|
|
1674
|
-
children: [/* @__PURE__ */ D(wr, {
|
|
1675
|
-
withAsterisk: o.required,
|
|
1676
|
-
htmlFor: o.id ?? c,
|
|
1677
|
-
children: n
|
|
1678
|
-
}), t ? /* @__PURE__ */ ne("div", {
|
|
1679
|
-
className: "flex flex-col gap-0.5",
|
|
1680
|
-
children: [l, /* @__PURE__ */ D(Cr, {
|
|
1681
|
-
error: e,
|
|
1682
|
-
children: t
|
|
1683
|
-
})]
|
|
1684
|
-
}) : l]
|
|
1685
|
-
});
|
|
1686
|
-
}
|
|
1687
|
-
//#endregion
|
|
1688
|
-
//#region lib/components/ui/overlays/dialog/dialog-outside.ts
|
|
1689
|
-
function Mr(e) {
|
|
1690
|
-
let t = e.target;
|
|
1691
|
-
t instanceof Element && t.closest("[data-slot=\"combobox-content\"]") && e.preventDefault();
|
|
1692
|
-
}
|
|
1693
|
-
//#endregion
|
|
1694
|
-
//#region lib/components/ui/overlays/dialog/dialog.tsx
|
|
1695
|
-
function Nr({ ...e }) {
|
|
1696
|
-
return /* @__PURE__ */ D(sn, {
|
|
1697
|
-
"data-slot": "dialog",
|
|
1698
|
-
...e
|
|
1699
|
-
});
|
|
1700
|
-
}
|
|
1701
|
-
function Pr({ asChild: e = !0, ...t }) {
|
|
1702
|
-
return /* @__PURE__ */ D(ln, {
|
|
1703
|
-
"data-slot": "dialog-trigger",
|
|
1704
|
-
...t,
|
|
1705
|
-
asChild: e
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
|
-
function Fr({ ...e }) {
|
|
1709
|
-
return /* @__PURE__ */ D(pn, {
|
|
1710
|
-
"data-slot": "dialog-portal",
|
|
1711
|
-
...e
|
|
1712
|
-
});
|
|
1713
|
-
}
|
|
1714
|
-
function Ir({ className: e, color: t, children: n, type: r = "button", variant: i = "ghost", ...a }) {
|
|
1715
|
-
let { t: o } = E();
|
|
1716
|
-
return /* @__PURE__ */ D(On, {
|
|
1717
|
-
"aria-label": n ? void 0 : o("material.buttons.close", "Close"),
|
|
1718
|
-
...a,
|
|
1719
|
-
type: r,
|
|
1720
|
-
className: T("absolute top-4 right-4", h({
|
|
1721
|
-
variant: i,
|
|
1722
|
-
color: t,
|
|
1723
|
-
className: e
|
|
1724
|
-
})),
|
|
1725
|
-
"data-slot": "dialog-close",
|
|
1726
|
-
children: n || /* @__PURE__ */ D(ee, { className: "size-4" })
|
|
1727
|
-
});
|
|
1728
|
-
}
|
|
1729
|
-
function Lr({ className: e, ...t }) {
|
|
1730
|
-
return /* @__PURE__ */ D(hn, {
|
|
1731
|
-
"data-slot": "dialog-overlay",
|
|
1732
|
-
className: T("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", e),
|
|
1733
|
-
...t
|
|
1734
|
-
});
|
|
1735
|
-
}
|
|
1736
|
-
function Rr({ className: e, children: t, onInteractOutside: n, onPointerDownOutside: r, onFocusOutside: i, onOpenAutoFocus: a, onCloseAutoFocus: o, ...s }) {
|
|
1737
|
-
let c = Dr({
|
|
1738
|
-
onOpenAutoFocus: a,
|
|
1739
|
-
onCloseAutoFocus: o
|
|
1740
|
-
});
|
|
1741
|
-
return /* @__PURE__ */ ne(Fr, {
|
|
1742
|
-
"data-slot": "dialog-portal",
|
|
1743
|
-
children: [/* @__PURE__ */ D(Lr, {}), /* @__PURE__ */ D(yn, {
|
|
1744
|
-
"data-slot": "dialog-content",
|
|
1745
|
-
className: T("bg-background rounded-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", e),
|
|
1746
|
-
onOpenAutoFocus: c.onOpenAutoFocus,
|
|
1747
|
-
onCloseAutoFocus: c.onCloseAutoFocus,
|
|
1748
|
-
onInteractOutside: (e) => {
|
|
1749
|
-
Mr(e), n?.(e);
|
|
1750
|
-
},
|
|
1751
|
-
onPointerDownOutside: (e) => {
|
|
1752
|
-
Mr(e), r?.(e);
|
|
1753
|
-
},
|
|
1754
|
-
onFocusOutside: (e) => {
|
|
1755
|
-
Mr(e), i?.(e);
|
|
1756
|
-
},
|
|
1757
|
-
...s,
|
|
1758
|
-
children: t
|
|
1759
|
-
})]
|
|
1760
|
-
});
|
|
1761
|
-
}
|
|
1762
|
-
function zr({ className: e, ...t }) {
|
|
1763
|
-
return /* @__PURE__ */ D("div", {
|
|
1764
|
-
"data-slot": "dialog-header",
|
|
1765
|
-
className: T("flex flex-col gap-2 text-center sm:text-left", e),
|
|
1766
|
-
...t
|
|
1767
|
-
});
|
|
1768
|
-
}
|
|
1769
|
-
function Br({ className: e, ...t }) {
|
|
1770
|
-
return /* @__PURE__ */ D("div", {
|
|
1771
|
-
"data-slot": "dialog-footer",
|
|
1772
|
-
className: T("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
1773
|
-
...t
|
|
1774
|
-
});
|
|
1775
|
-
}
|
|
1776
|
-
function Vr({ className: e, ...t }) {
|
|
1777
|
-
return /* @__PURE__ */ D(wn, {
|
|
1778
|
-
"data-slot": "dialog-title",
|
|
1779
|
-
className: T("text-xl leading-none font-semibold", e),
|
|
1780
|
-
...t
|
|
1781
|
-
});
|
|
1782
|
-
}
|
|
1783
|
-
function Hr({ className: e, ...t }) {
|
|
1784
|
-
return /* @__PURE__ */ D(En, {
|
|
1785
|
-
"data-slot": "dialog-description",
|
|
1786
|
-
className: T("text-muted-foreground text-sm", e),
|
|
1787
|
-
...t
|
|
1788
|
-
});
|
|
1789
|
-
}
|
|
1790
|
-
//#endregion
|
|
1791
|
-
//#region lib/components/ui/actions/icon-button/icon-badge.tsx
|
|
1792
|
-
function Ur({ children: e, className: t, ...n }) {
|
|
1793
|
-
let r = !!(n["aria-label"] || n["aria-labelledby"]);
|
|
1794
|
-
return /* @__PURE__ */ D(C, {
|
|
1795
|
-
"aria-hidden": r ? void 0 : "true",
|
|
1796
|
-
role: r ? "img" : void 0,
|
|
1797
|
-
...n,
|
|
1798
|
-
asChild: !0,
|
|
1799
|
-
className: T("cursor-default", t),
|
|
1800
|
-
children: /* @__PURE__ */ D("span", { children: e })
|
|
1801
|
-
});
|
|
1802
|
-
}
|
|
1803
|
-
//#endregion
|
|
1804
|
-
//#region lib/components/ui/primitives/activity/activity.tsx
|
|
1805
|
-
function Wr({ visible: e = !1, ...t }) {
|
|
1806
|
-
return /* @__PURE__ */ D(re, {
|
|
1807
|
-
...t,
|
|
1808
|
-
mode: e ? "visible" : "hidden"
|
|
1809
|
-
});
|
|
1810
|
-
}
|
|
1811
|
-
//#endregion
|
|
1812
|
-
//#region lib/components/ui/overlays/hover-card/hover-card.tsx
|
|
1813
|
-
function Gr({ ...e }) {
|
|
1814
|
-
return /* @__PURE__ */ D(Qn, {
|
|
1815
|
-
"data-slot": "hover-card",
|
|
1816
|
-
...e
|
|
1817
|
-
});
|
|
1818
|
-
}
|
|
1819
|
-
function Kr({ ...e }) {
|
|
1820
|
-
return /* @__PURE__ */ D($n, {
|
|
1821
|
-
"data-slot": "hover-card-trigger",
|
|
1822
|
-
...e
|
|
1823
|
-
});
|
|
1824
|
-
}
|
|
1825
|
-
function qr({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
1826
|
-
return /* @__PURE__ */ D(er, {
|
|
1827
|
-
"data-slot": "hover-card-portal",
|
|
1828
|
-
children: /* @__PURE__ */ D(tr, {
|
|
1829
|
-
"data-slot": "hover-card-content",
|
|
1830
|
-
align: t,
|
|
1831
|
-
sideOffset: n,
|
|
1832
|
-
className: T("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", e),
|
|
1833
|
-
...r
|
|
1834
|
-
})
|
|
1835
|
-
});
|
|
1836
|
-
}
|
|
1837
|
-
//#endregion
|
|
1838
|
-
//#region ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
1839
|
-
var Jr = (e) => e.type === "checkbox", Yr = (e) => e.type === "file", L = (e) => e instanceof Date, R = (e) => e == null, Xr = (e) => typeof e == "object", z = (e) => !R(e) && !Array.isArray(e) && Xr(e) && !L(e), Zr = (e) => z(e) && e.target ? Jr(e.target) ? e.target.checked : Yr(e.target) ? e.target.files : e.target.value : e, Qr = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), $r = (e) => {
|
|
1840
|
-
let t = e.constructor && e.constructor.prototype;
|
|
1841
|
-
return z(t) && t.hasOwnProperty("isPrototypeOf");
|
|
1842
|
-
}, ei = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
1843
|
-
function B(e) {
|
|
1844
|
-
if (e instanceof Date) return new Date(e);
|
|
1845
|
-
let t = typeof FileList < "u" && e instanceof FileList;
|
|
1846
|
-
if (ei && (e instanceof Blob || t)) return e;
|
|
1847
|
-
let n = Array.isArray(e);
|
|
1848
|
-
if (!n && !(z(e) && $r(e))) return e;
|
|
1849
|
-
let r = n ? [] : Object.create(Object.getPrototypeOf(e));
|
|
1850
|
-
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = B(e[t]));
|
|
1851
|
-
return r;
|
|
1852
|
-
}
|
|
1853
|
-
var ti = {
|
|
1854
|
-
BLUR: "blur",
|
|
1855
|
-
FOCUS_OUT: "focusout",
|
|
1856
|
-
CHANGE: "change",
|
|
1857
|
-
SUBMIT: "submit",
|
|
1858
|
-
TRIGGER: "trigger",
|
|
1859
|
-
VALID: "valid"
|
|
1860
|
-
}, V = {
|
|
1861
|
-
onBlur: "onBlur",
|
|
1862
|
-
onChange: "onChange",
|
|
1863
|
-
onSubmit: "onSubmit",
|
|
1864
|
-
onTouched: "onTouched",
|
|
1865
|
-
all: "all"
|
|
1866
|
-
}, H = {
|
|
1867
|
-
max: "max",
|
|
1868
|
-
min: "min",
|
|
1869
|
-
maxLength: "maxLength",
|
|
1870
|
-
minLength: "minLength",
|
|
1871
|
-
pattern: "pattern",
|
|
1872
|
-
required: "required",
|
|
1873
|
-
validate: "validate"
|
|
1874
|
-
}, ni = "root", ri = [
|
|
1875
|
-
"__proto__",
|
|
1876
|
-
"constructor",
|
|
1877
|
-
"prototype"
|
|
1878
|
-
], ii = /^\w*$/, ai = (e) => ii.test(e), U = (e) => e === void 0, oi = /[.[\]'"]/, si = (e) => e.split(oi).filter(Boolean), W = (e, t, n) => {
|
|
1879
|
-
if (!t || !z(e)) return n;
|
|
1880
|
-
let r = ai(t) ? [t] : si(t);
|
|
1881
|
-
if (r.some((e) => ri.includes(e))) return n;
|
|
1882
|
-
let i = r.reduce((e, t) => R(e) ? void 0 : e[t], e);
|
|
1883
|
-
return U(i) || i === e ? U(e[t]) ? n : e[t] : i;
|
|
1884
|
-
}, G = (e) => typeof e == "boolean", K = (e) => typeof e == "function", q = (e, t, n) => {
|
|
1885
|
-
let r = -1, i = ai(t) ? [t] : si(t), a = i.length, o = a - 1;
|
|
1886
|
-
for (; ++r < a;) {
|
|
1887
|
-
let t = i[r], a = n;
|
|
1888
|
-
if (r !== o) {
|
|
1889
|
-
let n = e[t];
|
|
1890
|
-
a = z(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
1891
|
-
}
|
|
1892
|
-
if (ri.includes(t)) return;
|
|
1893
|
-
e[t] = a, e = e[t];
|
|
1894
|
-
}
|
|
1895
|
-
}, ci = k.createContext(null);
|
|
1896
|
-
ci.displayName = "HookFormControlContext";
|
|
1897
|
-
var li = () => k.useContext(ci), ui = (e, t, n, r = !0) => {
|
|
1898
|
-
let i = {};
|
|
1899
|
-
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
1900
|
-
let i = a;
|
|
1901
|
-
return t._proxyFormState[i] !== V.all && (t._proxyFormState[i] = !r || V.all), n && (n[i] = !0), e[i];
|
|
1902
|
-
} });
|
|
1903
|
-
return i;
|
|
1904
|
-
}, di = ei ? k.useLayoutEffect : k.useEffect, fi = (e) => R(e) || !Xr(e), pi = (e, t) => t.length === 0 && !Array.isArray(e) && !$r(e);
|
|
1905
|
-
function J(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
1906
|
-
if (e === t) return !0;
|
|
1907
|
-
if (fi(e) || fi(t)) return Object.is(e, t);
|
|
1908
|
-
if (L(e) && L(t)) return Object.is(e.getTime(), t.getTime());
|
|
1909
|
-
let r = Object.keys(e), i = Object.keys(t);
|
|
1910
|
-
if (r.length !== i.length) return !1;
|
|
1911
|
-
if (pi(e, r) || pi(t, i)) return Object.is(e, t);
|
|
1912
|
-
if (!r.length && Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1913
|
-
let a = n.get(e);
|
|
1914
|
-
if (a && a.has(t)) return !0;
|
|
1915
|
-
if (a) a.add(t);
|
|
1916
|
-
else {
|
|
1917
|
-
let r = /* @__PURE__ */ new WeakSet();
|
|
1918
|
-
r.add(t), n.set(e, r);
|
|
1919
|
-
}
|
|
1920
|
-
for (let i of r) {
|
|
1921
|
-
let r = e[i];
|
|
1922
|
-
if (!(i in t)) return !1;
|
|
1923
|
-
if (i !== "ref") {
|
|
1924
|
-
let e = t[i];
|
|
1925
|
-
if (L(r) && L(e) || (z(r) || Array.isArray(r)) && (z(e) || Array.isArray(e)) ? !J(r, e, n) : !Object.is(r, e)) return !1;
|
|
1926
|
-
}
|
|
1927
|
-
}
|
|
1928
|
-
return !0;
|
|
1929
|
-
}
|
|
1930
|
-
function mi() {
|
|
1931
|
-
let e = k.useRef(!1), t = k.useRef(void 0);
|
|
1932
|
-
return {
|
|
1933
|
-
resyncIfNeeded: k.useCallback((n, r, i) => {
|
|
1934
|
-
if (n && e.current) {
|
|
1935
|
-
let e = r();
|
|
1936
|
-
J(t.current, e) || i(e);
|
|
1937
|
-
}
|
|
1938
|
-
e.current = !0;
|
|
1939
|
-
}, []),
|
|
1940
|
-
snapshot: k.useCallback((e, n) => {
|
|
1941
|
-
e && (t.current = B(n()));
|
|
1942
|
-
}, [])
|
|
1943
|
-
};
|
|
1944
|
-
}
|
|
1945
|
-
function hi(e) {
|
|
1946
|
-
let t = li(), { control: n = t, disabled: r, name: i, exact: a } = e || {}, [o, s] = k.useState(() => ({
|
|
1947
|
-
...n._formState,
|
|
1948
|
-
defaultValues: n._defaultValues
|
|
1949
|
-
})), c = k.useRef({
|
|
1950
|
-
isDirty: !1,
|
|
1951
|
-
isLoading: !1,
|
|
1952
|
-
dirtyFields: !1,
|
|
1953
|
-
touchedFields: !1,
|
|
1954
|
-
validatingFields: !1,
|
|
1955
|
-
isValidating: !1,
|
|
1956
|
-
isValid: !1,
|
|
1957
|
-
errors: !1
|
|
1958
|
-
}), { resyncIfNeeded: l, snapshot: u } = mi();
|
|
1959
|
-
return di(() => {
|
|
1960
|
-
let e = () => ({
|
|
1961
|
-
...n._formState,
|
|
1962
|
-
defaultValues: n._defaultValues
|
|
1963
|
-
});
|
|
1964
|
-
l(!r, e, s);
|
|
1965
|
-
let t = n._subscribe({
|
|
1966
|
-
name: i,
|
|
1967
|
-
formState: c.current,
|
|
1968
|
-
exact: a,
|
|
1969
|
-
callback: (e) => {
|
|
1970
|
-
!r && s({
|
|
1971
|
-
...n._formState,
|
|
1972
|
-
...e,
|
|
1973
|
-
defaultValues: n._defaultValues
|
|
1974
|
-
});
|
|
1975
|
-
}
|
|
1976
|
-
});
|
|
1977
|
-
return () => {
|
|
1978
|
-
t(), u(!r, e);
|
|
1979
|
-
};
|
|
1980
|
-
}, [
|
|
1981
|
-
i,
|
|
1982
|
-
r,
|
|
1983
|
-
a,
|
|
1984
|
-
l,
|
|
1985
|
-
u
|
|
1986
|
-
]), k.useEffect(() => {
|
|
1987
|
-
c.current.isValid && n._setValid(!0);
|
|
1988
|
-
}, [n]), k.useMemo(() => ui(o, n, c.current, !1), [o, n]);
|
|
1989
|
-
}
|
|
1990
|
-
var Y = (e) => typeof e == "string", gi = (e, t, n, r, i) => Y(e) ? (r && t.watch.add(e), W(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), W(n, e))) : (r && (t.watchAll = !0), n);
|
|
1991
|
-
function _i(e) {
|
|
1992
|
-
let t = li(), { control: n = t, name: r, defaultValue: i, disabled: a, exact: o, compute: s } = e || {}, c = k.useRef(i), l = k.useRef(s), u = k.useRef(void 0), d = k.useRef(n), f = k.useRef(r);
|
|
1993
|
-
l.current = s;
|
|
1994
|
-
let [p, m] = k.useState(() => {
|
|
1995
|
-
let e = n._getWatch(r, c.current);
|
|
1996
|
-
return l.current ? l.current(e) : e;
|
|
1997
|
-
}), h = k.useCallback((e) => {
|
|
1998
|
-
let t = gi(r, n._names, e || n._formValues, !1, c.current);
|
|
1999
|
-
return l.current ? l.current(t) : t;
|
|
2000
|
-
}, [
|
|
2001
|
-
n._formValues,
|
|
2002
|
-
n._names,
|
|
2003
|
-
r
|
|
2004
|
-
]), g = k.useCallback((e) => {
|
|
2005
|
-
if (!a) {
|
|
2006
|
-
let t = gi(r, n._names, e || n._formValues, !1, c.current);
|
|
2007
|
-
if (l.current) {
|
|
2008
|
-
let e = l.current(t);
|
|
2009
|
-
J(e, u.current) || (m(e), u.current = e);
|
|
2010
|
-
} else m(t);
|
|
2011
|
-
}
|
|
2012
|
-
}, [
|
|
2013
|
-
n._formValues,
|
|
2014
|
-
n._names,
|
|
2015
|
-
a,
|
|
2016
|
-
r
|
|
2017
|
-
]), { resyncIfNeeded: _, snapshot: v } = mi(), y = k.useRef(g);
|
|
2018
|
-
y.current = g;
|
|
2019
|
-
let b = k.useRef(h);
|
|
2020
|
-
b.current = h, di(() => {
|
|
2021
|
-
d.current !== n || !J(f.current, r) ? (d.current = n, f.current = r, y.current()) : _(!a, () => b.current(), (e) => {
|
|
2022
|
-
m(e), u.current = e;
|
|
2023
|
-
});
|
|
2024
|
-
let e = n._subscribe({
|
|
2025
|
-
name: r,
|
|
2026
|
-
formState: { values: !0 },
|
|
2027
|
-
exact: o,
|
|
2028
|
-
callback: (e) => {
|
|
2029
|
-
y.current(e.values);
|
|
2030
|
-
}
|
|
2031
|
-
});
|
|
2032
|
-
return () => {
|
|
2033
|
-
e(), v(!a, () => b.current());
|
|
2034
|
-
};
|
|
2035
|
-
}, [
|
|
2036
|
-
n,
|
|
2037
|
-
o,
|
|
2038
|
-
r,
|
|
2039
|
-
a,
|
|
2040
|
-
_,
|
|
2041
|
-
v
|
|
2042
|
-
]), k.useEffect(() => n._removeUnmounted());
|
|
2043
|
-
let x = d.current !== n, S = f.current, C = k.useMemo(() => {
|
|
2044
|
-
if (a) return null;
|
|
2045
|
-
let e = !x && !J(S, r);
|
|
2046
|
-
return x || e ? h() : null;
|
|
2047
|
-
}, [
|
|
2048
|
-
a,
|
|
2049
|
-
x,
|
|
2050
|
-
r,
|
|
2051
|
-
S,
|
|
2052
|
-
h
|
|
2053
|
-
]);
|
|
2054
|
-
return C === null ? p : C;
|
|
2055
|
-
}
|
|
2056
|
-
function vi(e) {
|
|
2057
|
-
let t = li(), { name: n, disabled: r, control: i = t, shouldUnregister: a, defaultValue: o, exact: s = !0 } = e, c = Qr(i._names.array, n), l = _i({
|
|
2058
|
-
control: i,
|
|
2059
|
-
name: n,
|
|
2060
|
-
defaultValue: k.useMemo(() => W(i._formValues, n, W(i._defaultValues, n, o)), [
|
|
2061
|
-
i,
|
|
2062
|
-
n,
|
|
2063
|
-
o
|
|
2064
|
-
]),
|
|
2065
|
-
exact: s
|
|
2066
|
-
}), u = hi({
|
|
2067
|
-
control: i,
|
|
2068
|
-
name: n,
|
|
2069
|
-
exact: s
|
|
2070
|
-
}), d = k.useRef(e), f = k.useRef(null), p = k.useRef(i.register(n, {
|
|
2071
|
-
...e.rules,
|
|
2072
|
-
value: l,
|
|
2073
|
-
...G(e.disabled) ? { disabled: e.disabled } : {}
|
|
2074
|
-
}));
|
|
2075
|
-
d.current = e;
|
|
2076
|
-
let m = k.useMemo(() => Object.defineProperties({}, {
|
|
2077
|
-
invalid: {
|
|
2078
|
-
enumerable: !0,
|
|
2079
|
-
get: () => !!W(u.errors, n)
|
|
2080
|
-
},
|
|
2081
|
-
isDirty: {
|
|
2082
|
-
enumerable: !0,
|
|
2083
|
-
get: () => !!W(u.dirtyFields, n)
|
|
2084
|
-
},
|
|
2085
|
-
isTouched: {
|
|
2086
|
-
enumerable: !0,
|
|
2087
|
-
get: () => !!W(u.touchedFields, n)
|
|
2088
|
-
},
|
|
2089
|
-
isValidating: {
|
|
2090
|
-
enumerable: !0,
|
|
2091
|
-
get: () => !!W(u.validatingFields, n)
|
|
2092
|
-
},
|
|
2093
|
-
error: {
|
|
2094
|
-
enumerable: !0,
|
|
2095
|
-
get: () => W(u.errors, n)
|
|
2096
|
-
}
|
|
2097
|
-
}), [u, n]), h = k.useCallback((e) => {
|
|
2098
|
-
let t = Zr(e);
|
|
2099
|
-
return W(i._fields, n) || (p.current = i.register(n, {
|
|
2100
|
-
...d.current.rules,
|
|
2101
|
-
value: t
|
|
2102
|
-
})), p.current.onChange({
|
|
2103
|
-
target: {
|
|
2104
|
-
value: Zr(e),
|
|
2105
|
-
name: n
|
|
2106
|
-
},
|
|
2107
|
-
type: ti.CHANGE
|
|
2108
|
-
});
|
|
2109
|
-
}, [n, i]), g = k.useCallback(() => p.current.onBlur({
|
|
2110
|
-
target: {
|
|
2111
|
-
value: W(i._formValues, n),
|
|
2112
|
-
name: n
|
|
2113
|
-
},
|
|
2114
|
-
type: ti.BLUR
|
|
2115
|
-
}), [n, i._formValues]), _ = k.useCallback((e) => {
|
|
2116
|
-
e && (f.current = {
|
|
2117
|
-
focus: () => K(e.focus) && e.focus(),
|
|
2118
|
-
select: () => K(e.select) && e.select(),
|
|
2119
|
-
setCustomValidity: (t) => K(e.setCustomValidity) && e.setCustomValidity(t),
|
|
2120
|
-
reportValidity: () => K(e.reportValidity) && e.reportValidity()
|
|
2121
|
-
});
|
|
2122
|
-
let t = W(i._fields, n);
|
|
2123
|
-
t && t._f && e && (t._f.ref = f.current);
|
|
2124
|
-
}, [i._fields, n]), v = k.useMemo(() => ({
|
|
2125
|
-
name: n,
|
|
2126
|
-
value: l,
|
|
2127
|
-
...G(r) || u.disabled ? { disabled: u.disabled || r } : {},
|
|
2128
|
-
onChange: h,
|
|
2129
|
-
onBlur: g,
|
|
2130
|
-
ref: _
|
|
2131
|
-
}), [
|
|
2132
|
-
n,
|
|
2133
|
-
r,
|
|
2134
|
-
u.disabled,
|
|
2135
|
-
h,
|
|
2136
|
-
g,
|
|
2137
|
-
_,
|
|
2138
|
-
l
|
|
2139
|
-
]);
|
|
2140
|
-
return k.useEffect(() => {
|
|
2141
|
-
let e = i._options.shouldUnregister || a;
|
|
2142
|
-
p.current = i.register(n, {
|
|
2143
|
-
...d.current.rules,
|
|
2144
|
-
...G(d.current.disabled) ? { disabled: d.current.disabled } : {}
|
|
2145
|
-
});
|
|
2146
|
-
let t = (e, t) => {
|
|
2147
|
-
let n = W(i._fields, e);
|
|
2148
|
-
n && n._f && (n._f.mount = t);
|
|
2149
|
-
};
|
|
2150
|
-
if (t(n, !0), e) {
|
|
2151
|
-
let e = B(W(a ? i._defaultValues : i._options.values || i._defaultValues, n, W(i._options.defaultValues, n, d.current.defaultValue)));
|
|
2152
|
-
q(i._defaultValues, n, e), U(W(i._formValues, n)) && q(i._formValues, n, e);
|
|
2153
|
-
}
|
|
2154
|
-
if (!c && i.register(n), f.current) {
|
|
2155
|
-
let e = W(i._fields, n);
|
|
2156
|
-
e && e._f && (e._f.ref = f.current);
|
|
2157
|
-
}
|
|
2158
|
-
return () => {
|
|
2159
|
-
(c ? e && !i._state.action : e) ? i.unregister(n) : t(n, !1);
|
|
2160
|
-
};
|
|
2161
|
-
}, [
|
|
2162
|
-
n,
|
|
2163
|
-
i,
|
|
2164
|
-
c,
|
|
2165
|
-
a
|
|
2166
|
-
]), k.useEffect(() => {
|
|
2167
|
-
i._setDisabledField({
|
|
2168
|
-
disabled: r,
|
|
2169
|
-
name: n
|
|
2170
|
-
});
|
|
2171
|
-
}, [
|
|
2172
|
-
r,
|
|
2173
|
-
n,
|
|
2174
|
-
i
|
|
2175
|
-
]), k.useMemo(() => ({
|
|
2176
|
-
field: v,
|
|
2177
|
-
formState: u,
|
|
2178
|
-
fieldState: m
|
|
2179
|
-
}), [
|
|
2180
|
-
v,
|
|
2181
|
-
u,
|
|
2182
|
-
m
|
|
2183
|
-
]);
|
|
2184
|
-
}
|
|
2185
|
-
var yi = (e) => e.render(vi(e)), bi = () => {
|
|
2186
|
-
if (typeof crypto < "u" && crypto.randomUUID) return crypto.randomUUID();
|
|
2187
|
-
let e = typeof performance > "u" ? Date.now() : performance.now() * 1e3;
|
|
2188
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
2189
|
-
let n = (Math.random() * 16 + e) % 16 | 0;
|
|
2190
|
-
return (t == "x" ? n : n & 3 | 8).toString(16);
|
|
2191
|
-
});
|
|
2192
|
-
}, xi = (e, t, n = {}) => n.shouldFocus || U(n.shouldFocus) ? n.focusName || `${e}.${U(n.focusIndex) ? t : n.focusIndex}.` : "", X = (e) => ({
|
|
2193
|
-
isOnSubmit: !e || e === V.onSubmit,
|
|
2194
|
-
isOnBlur: e === V.onBlur,
|
|
2195
|
-
isOnChange: e === V.onChange,
|
|
2196
|
-
isOnAll: e === V.all,
|
|
2197
|
-
isOnTouch: e === V.onTouched
|
|
2198
|
-
}), Si = (e, t, n) => {
|
|
2199
|
-
if (n) return !1;
|
|
2200
|
-
if (t.watchAll || t.watch.has(e)) return !0;
|
|
2201
|
-
for (let n of t.watch) if (e.startsWith(n) && e.charAt(n.length) === ".") return !0;
|
|
2202
|
-
return !1;
|
|
2203
|
-
}, Ci = (e, t, n, r) => {
|
|
2204
|
-
for (let i of n || Object.keys(e)) {
|
|
2205
|
-
if (i === "_f") continue;
|
|
2206
|
-
let a = n ? W(e, i) : e[i];
|
|
2207
|
-
if (a) {
|
|
2208
|
-
let { _f: e } = a;
|
|
2209
|
-
if (e) {
|
|
2210
|
-
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
2211
|
-
if (Ci(a, t)) break;
|
|
2212
|
-
} else if ((z(a) || Array.isArray(a)) && Ci(a, t)) break;
|
|
2213
|
-
}
|
|
2214
|
-
}
|
|
2215
|
-
}, wi = (e, t, n) => {
|
|
2216
|
-
let r = W(e, n), i = Array.isArray(r) ? r : [];
|
|
2217
|
-
return q(i, ni, t[n]), q(e, n, i), e;
|
|
2218
|
-
}, Z = (e) => z(e) && !Object.keys(e).length, Ti = (e) => {
|
|
2219
|
-
if (!ei) return !1;
|
|
2220
|
-
let t = e ? e.ownerDocument : 0;
|
|
2221
|
-
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
2222
|
-
}, Ei = (e) => e.type === "radio", Di = (e) => e instanceof RegExp, Oi = (e, t, n, r, i) => t ? {
|
|
2223
|
-
...n[e],
|
|
2224
|
-
types: {
|
|
2225
|
-
...n[e] && n[e].types ? n[e].types : {},
|
|
2226
|
-
[r]: i || !0
|
|
2227
|
-
}
|
|
2228
|
-
} : {}, ki = {
|
|
2229
|
-
value: !1,
|
|
2230
|
-
isValid: !1
|
|
2231
|
-
}, Ai = {
|
|
2232
|
-
value: !0,
|
|
2233
|
-
isValid: !0
|
|
2234
|
-
}, ji = (e) => {
|
|
2235
|
-
if (Array.isArray(e)) {
|
|
2236
|
-
if (e.length > 1) {
|
|
2237
|
-
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
2238
|
-
return {
|
|
2239
|
-
value: t,
|
|
2240
|
-
isValid: !!t.length
|
|
2241
|
-
};
|
|
2242
|
-
}
|
|
2243
|
-
return e[0].checked && !e[0].disabled ? e[0].attributes && !U(e[0].attributes.value) ? U(e[0].value) || e[0].value === "" ? Ai : {
|
|
2244
|
-
value: e[0].value,
|
|
2245
|
-
isValid: !0
|
|
2246
|
-
} : Ai : ki;
|
|
2247
|
-
}
|
|
2248
|
-
return ki;
|
|
2249
|
-
}, Mi = {
|
|
2250
|
-
isValid: !1,
|
|
2251
|
-
value: null
|
|
2252
|
-
}, Ni = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
2253
|
-
isValid: !0,
|
|
2254
|
-
value: t.value
|
|
2255
|
-
} : e, Mi) : Mi;
|
|
2256
|
-
function Pi(e, t, n = "validate") {
|
|
2257
|
-
if (Y(e) || Array.isArray(e) && e.every(Y) || G(e) && !e) return {
|
|
2258
|
-
type: n,
|
|
2259
|
-
message: Y(e) ? e : "",
|
|
2260
|
-
ref: t
|
|
2261
|
-
};
|
|
2262
|
-
}
|
|
2263
|
-
var Fi = (e) => z(e) && !Di(e) ? e : {
|
|
2264
|
-
value: e,
|
|
2265
|
-
message: ""
|
|
2266
|
-
}, Ii = async (e, t, n, r, i, a) => {
|
|
2267
|
-
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = W(n, h);
|
|
2268
|
-
if (!_ || t.has(h)) return {};
|
|
2269
|
-
let y = s ? s[0] : o, b = (e) => {
|
|
2270
|
-
if (i && y.reportValidity) {
|
|
2271
|
-
let t = G(e) ? "" : e || "";
|
|
2272
|
-
s ? s.forEach((e) => e.setCustomValidity(t)) : y.setCustomValidity(t), y.reportValidity();
|
|
2273
|
-
}
|
|
2274
|
-
}, x = {}, S = Ei(o), C = Jr(o), w = S || C, T = (g || Yr(o)) && U(o.value) && U(v) || Ti(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length, E = Oi.bind(null, h, r, x), ee = (e, t, n, r = H.maxLength, i = H.minLength) => {
|
|
2275
|
-
let a = e ? t : n;
|
|
2276
|
-
x[h] = {
|
|
2277
|
-
type: e ? r : i,
|
|
2278
|
-
message: a,
|
|
2279
|
-
ref: o,
|
|
2280
|
-
...E(e ? r : i, a)
|
|
2281
|
-
};
|
|
2282
|
-
};
|
|
2283
|
-
if (a ? !Array.isArray(v) || !v.length : c && (!w && (T || R(v)) || G(v) && !v || C && !ji(s).isValid || S && !Ni(s).isValid)) {
|
|
2284
|
-
let { value: e, message: t } = Y(c) ? {
|
|
2285
|
-
value: !!c,
|
|
2286
|
-
message: c
|
|
2287
|
-
} : Fi(c);
|
|
2288
|
-
if (e && (x[h] = {
|
|
2289
|
-
type: H.required,
|
|
2290
|
-
message: t,
|
|
2291
|
-
ref: y,
|
|
2292
|
-
...E(H.required, t)
|
|
2293
|
-
}, !r)) return b(t), x;
|
|
2294
|
-
}
|
|
2295
|
-
if (!T && (!R(d) || !R(f))) {
|
|
2296
|
-
let e, t, n = Fi(f), i = Fi(d);
|
|
2297
|
-
if (!R(v) && !L(v) && !isNaN(v)) {
|
|
2298
|
-
let r = o.valueAsNumber || v && +v;
|
|
2299
|
-
R(n.value) || (e = r > n.value), R(i.value) || (t = r < i.value);
|
|
2300
|
-
} else {
|
|
2301
|
-
let r = o.valueAsDate || new Date(v), a = (e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + e), s = o.type == "time", c = o.type == "week";
|
|
2302
|
-
Y(n.value) && v && (e = s ? a(v) > a(n.value) : c ? v > n.value : r > new Date(n.value)), Y(i.value) && v && (t = s ? a(v) < a(i.value) : c ? v < i.value : r < new Date(i.value));
|
|
2303
|
-
}
|
|
2304
|
-
if ((e || t) && (ee(!!e, n.message, i.message, H.max, H.min), !r)) return b(x[h].message), x;
|
|
2305
|
-
}
|
|
2306
|
-
if ((l || u) && !T && (Y(v) || a && Array.isArray(v))) {
|
|
2307
|
-
let e = Fi(l), t = Fi(u), n = !R(e.value) && v.length > +e.value, i = !R(t.value) && v.length < +t.value;
|
|
2308
|
-
if ((n || i) && (ee(n, e.message, t.message), !r)) return b(x[h].message), x;
|
|
2309
|
-
}
|
|
2310
|
-
if (p && !T && Y(v)) {
|
|
2311
|
-
let { value: e, message: t } = Fi(p);
|
|
2312
|
-
if (Di(e) && !v.match(e) && (x[h] = {
|
|
2313
|
-
type: H.pattern,
|
|
2314
|
-
message: t,
|
|
2315
|
-
ref: o,
|
|
2316
|
-
...E(H.pattern, t)
|
|
2317
|
-
}, !r)) return b(t), x;
|
|
2318
|
-
}
|
|
2319
|
-
if (m) {
|
|
2320
|
-
if (K(m)) {
|
|
2321
|
-
let e = Pi(await m(v, n), y);
|
|
2322
|
-
if (e && (x[h] = {
|
|
2323
|
-
...e,
|
|
2324
|
-
...E(H.validate, e.message)
|
|
2325
|
-
}, !r)) return b(e.message), x;
|
|
2326
|
-
} else if (z(m)) {
|
|
2327
|
-
let e = {};
|
|
2328
|
-
for (let t in m) {
|
|
2329
|
-
if (!Z(e) && !r) break;
|
|
2330
|
-
let i = Pi(await m[t](v, n), y, t);
|
|
2331
|
-
i && (e = {
|
|
2332
|
-
...i,
|
|
2333
|
-
...E(t, i.message)
|
|
2334
|
-
}, b(i.message), r && (x[h] = e));
|
|
2335
|
-
}
|
|
2336
|
-
if (!Z(e) && (x[h] = {
|
|
2337
|
-
ref: y,
|
|
2338
|
-
...e
|
|
2339
|
-
}, !r)) return x;
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
return b(!0), x;
|
|
2343
|
-
}, Q = (e) => Array.isArray(e) ? e : [e], Li = (e, t) => [...e, ...Q(t)], Ri = (e) => Array.isArray(e) ? e.map(() => void 0) : void 0;
|
|
2344
|
-
function zi(e, t, n) {
|
|
2345
|
-
return [
|
|
2346
|
-
...e.slice(0, t),
|
|
2347
|
-
...Q(n),
|
|
2348
|
-
...e.slice(t)
|
|
2349
|
-
];
|
|
2350
|
-
}
|
|
2351
|
-
var Bi = (e, t, n) => Array.isArray(e) ? (U(e[n]) && (e[n] = void 0), e.splice(n, 0, e.splice(t, 1)[0]), e) : [], Vi = (e, t) => [...Q(t), ...Q(e)], Hi = (e) => Array.isArray(e) ? e.filter(Boolean) : [];
|
|
2352
|
-
function Ui(e, t) {
|
|
2353
|
-
let n = 0, r = [...e];
|
|
2354
|
-
for (let e of t) r.splice(e - n, 1), n++;
|
|
2355
|
-
return Hi(r).length ? r : [];
|
|
2356
|
-
}
|
|
2357
|
-
var Wi = (e, t) => U(t) ? [] : Ui(e, Q(t).sort((e, t) => e - t)), Gi = (e, t, n) => {
|
|
2358
|
-
[e[t], e[n]] = [e[n], e[t]];
|
|
2359
|
-
};
|
|
2360
|
-
function Ki(e, t) {
|
|
2361
|
-
let n = t.length - 1, r = 0;
|
|
2362
|
-
for (; r < n;) {
|
|
2363
|
-
if (R(e)) {
|
|
2364
|
-
e = void 0;
|
|
2365
|
-
break;
|
|
2366
|
-
}
|
|
2367
|
-
e = e[t[r]], r++;
|
|
2368
|
-
}
|
|
2369
|
-
return e;
|
|
2370
|
-
}
|
|
2371
|
-
function qi(e) {
|
|
2372
|
-
for (let t in e) if (e.hasOwnProperty(t) && !U(e[t])) return !1;
|
|
2373
|
-
return !0;
|
|
2374
|
-
}
|
|
2375
|
-
function $(e, t) {
|
|
2376
|
-
if (Y(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
|
|
2377
|
-
let n = Array.isArray(t) ? t : ai(t) ? [t] : si(t);
|
|
2378
|
-
if (n.some((e) => ri.includes(String(e)))) return e;
|
|
2379
|
-
let r = n.length === 1 ? e : Ki(e, n), i = n.length - 1, a = n[i];
|
|
2380
|
-
return r && delete r[a], i !== 0 && (z(r) && Z(r) || Array.isArray(r) && qi(r)) && $(e, n.slice(0, -1)), e;
|
|
2381
|
-
}
|
|
2382
|
-
var Ji = (e, t, n) => (e[t] = n, e);
|
|
2383
|
-
function Yi(e) {
|
|
2384
|
-
let t = li(), { control: n = t, name: r, keyName: i = "id", disabled: a, shouldUnregister: o, rules: s } = e, [c, l] = k.useState(n._getFieldArray(r)), u = k.useRef(n._getFieldArray(r).map(bi)), d = k.useRef(!1);
|
|
2385
|
-
a || n._names.array.add(r), k.useMemo(() => !a && s && c.length >= 0 && n.register(r, s), [
|
|
2386
|
-
n,
|
|
2387
|
-
r,
|
|
2388
|
-
c.length,
|
|
2389
|
-
s,
|
|
2390
|
-
a
|
|
2391
|
-
]), di(() => {
|
|
2392
|
-
if (!a) return n._subjects.array.subscribe({ next: ({ values: e, name: t }) => {
|
|
2393
|
-
if (t === r || !t) {
|
|
2394
|
-
let n = W(e, r);
|
|
2395
|
-
Array.isArray(n) ? (l(n), u.current = n.map(bi)) : t || (l([]), u.current = []);
|
|
2396
|
-
}
|
|
2397
|
-
} }).unsubscribe;
|
|
2398
|
-
}, [
|
|
2399
|
-
n,
|
|
2400
|
-
r,
|
|
2401
|
-
a
|
|
2402
|
-
]);
|
|
2403
|
-
let f = k.useCallback((e) => {
|
|
2404
|
-
d.current = !0, n._setFieldArray(r, e);
|
|
2405
|
-
}, [n, r]);
|
|
2406
|
-
return k.useEffect(() => {
|
|
2407
|
-
if (a) {
|
|
2408
|
-
n._state.actionArrayLengths.delete(r);
|
|
2409
|
-
return;
|
|
2410
|
-
}
|
|
2411
|
-
n._state.action = !1, n._state.actionArrayLengths.delete(r), Si(r, n._names) && n._subjects.state.next({ ...n._formState });
|
|
2412
|
-
let e = X(n._options.mode);
|
|
2413
|
-
if (d.current && (!e.isOnSubmit || n._formState.isSubmitted) && !X(n._options.reValidateMode).isOnSubmit && !e.isOnBlur) if (n._options.resolver) n._runSchema([r]).then((e) => {
|
|
2414
|
-
n._updateIsValidating([r]);
|
|
2415
|
-
let t = W(e.errors, r), i = W(n._formState.errors, r), a = i && (i.type || i.root?.type), o = i && (i.message || i.root?.message);
|
|
2416
|
-
(i ? !t && a || t && (a !== t.type || o !== t.message) : t && t.type) && (t ? z(t) && !Object.keys(t).some((e) => !Number.isNaN(+e)) ? wi(n._formState.errors, { [r]: t }, r) : q(n._formState.errors, r, t) : $(n._formState.errors, r), n._subjects.state.next({ errors: n._formState.errors }));
|
|
2417
|
-
});
|
|
2418
|
-
else {
|
|
2419
|
-
let e = W(n._fields, r);
|
|
2420
|
-
e && e._f && !(X(n._options.reValidateMode).isOnSubmit && X(n._options.mode).isOnSubmit) && Ii(e, n._names.disabled, n._formValues, n._options.criteriaMode === V.all, n._options.shouldUseNativeValidation, !0).then((e) => !Z(e) && n._subjects.state.next({ errors: wi(n._formState.errors, e, r) }));
|
|
2421
|
-
}
|
|
2422
|
-
d.current && n._subjects.state.next({
|
|
2423
|
-
name: r,
|
|
2424
|
-
values: B(n._formValues)
|
|
2425
|
-
}), n._names.focus && Ci(n._fields, (e, t) => {
|
|
2426
|
-
if (n._names.focus && t.startsWith(n._names.focus) && e.focus) return e.focus(), 1;
|
|
2427
|
-
}), n._names.focus = "", n._setValid(), d.current = !1;
|
|
2428
|
-
}, [
|
|
2429
|
-
c,
|
|
2430
|
-
r,
|
|
2431
|
-
n,
|
|
2432
|
-
a
|
|
2433
|
-
]), k.useEffect(() => (a || !W(n._formValues, r) && n._setFieldArray(r), () => {
|
|
2434
|
-
if (n._state.actionArrayLengths.delete(r), a) return;
|
|
2435
|
-
let e = !(n._options.shouldUnregister || o);
|
|
2436
|
-
d.current && e && n._subjects.state.next({
|
|
2437
|
-
name: r,
|
|
2438
|
-
values: B(n._formValues)
|
|
2439
|
-
}), e ? ((e, t) => {
|
|
2440
|
-
let r = W(n._fields, e);
|
|
2441
|
-
r && r._f && (r._f.mount = t);
|
|
2442
|
-
})(r, !1) : n.unregister(r);
|
|
2443
|
-
}), [
|
|
2444
|
-
r,
|
|
2445
|
-
n,
|
|
2446
|
-
i,
|
|
2447
|
-
o,
|
|
2448
|
-
a
|
|
2449
|
-
]), {
|
|
2450
|
-
swap: k.useCallback((e, t) => {
|
|
2451
|
-
if (a) return;
|
|
2452
|
-
let i = n._getFieldArray(r);
|
|
2453
|
-
Gi(i, e, t), Gi(u.current, e, t), f(i), l(i), n._setFieldArray(r, i, Gi, {
|
|
2454
|
-
argA: e,
|
|
2455
|
-
argB: t
|
|
2456
|
-
}, !1);
|
|
2457
|
-
}, [
|
|
2458
|
-
f,
|
|
2459
|
-
r,
|
|
2460
|
-
n,
|
|
2461
|
-
a
|
|
2462
|
-
]),
|
|
2463
|
-
move: k.useCallback((e, t) => {
|
|
2464
|
-
if (a) return;
|
|
2465
|
-
let i = n._getFieldArray(r);
|
|
2466
|
-
Bi(i, e, t), Bi(u.current, e, t), f(i), l(i), n._setFieldArray(r, i, Bi, {
|
|
2467
|
-
argA: e,
|
|
2468
|
-
argB: t
|
|
2469
|
-
}, !1);
|
|
2470
|
-
}, [
|
|
2471
|
-
f,
|
|
2472
|
-
r,
|
|
2473
|
-
n,
|
|
2474
|
-
a
|
|
2475
|
-
]),
|
|
2476
|
-
prepend: k.useCallback((e, t) => {
|
|
2477
|
-
if (a) return;
|
|
2478
|
-
let i = Q(B(e)), o = Vi(n._getFieldArray(r), i);
|
|
2479
|
-
n._names.focus = xi(r, 0, t), u.current = Vi(u.current, i.map(bi)), f(o), l(o), n._setFieldArray(r, o, Vi, { argA: Ri(e) });
|
|
2480
|
-
}, [
|
|
2481
|
-
f,
|
|
2482
|
-
r,
|
|
2483
|
-
n,
|
|
2484
|
-
a
|
|
2485
|
-
]),
|
|
2486
|
-
append: k.useCallback((e, t) => {
|
|
2487
|
-
if (a) return;
|
|
2488
|
-
let i = Q(B(e)), o = Li(n._getFieldArray(r), i);
|
|
2489
|
-
n._names.focus = xi(r, o.length - 1, t), u.current = Li(u.current, i.map(bi)), f(o), l(o), n._setFieldArray(r, o, Li, { argA: Ri(e) });
|
|
2490
|
-
}, [
|
|
2491
|
-
f,
|
|
2492
|
-
r,
|
|
2493
|
-
n,
|
|
2494
|
-
a
|
|
2495
|
-
]),
|
|
2496
|
-
remove: k.useCallback((e) => {
|
|
2497
|
-
if (a) return;
|
|
2498
|
-
let t = Wi(n._getFieldArray(r), e);
|
|
2499
|
-
u.current = Wi(u.current, e), f(t), l(t), !Array.isArray(W(n._fields, r)) && q(n._fields, r, void 0), n._setFieldArray(r, t, Wi, { argA: e });
|
|
2500
|
-
}, [
|
|
2501
|
-
f,
|
|
2502
|
-
r,
|
|
2503
|
-
n,
|
|
2504
|
-
a
|
|
2505
|
-
]),
|
|
2506
|
-
insert: k.useCallback((e, t, i) => {
|
|
2507
|
-
if (a) return;
|
|
2508
|
-
let o = Q(B(t)), s = zi(n._getFieldArray(r), e, o);
|
|
2509
|
-
n._names.focus = xi(r, e, i), u.current = zi(u.current, e, o.map(bi)), f(s), l(s), n._setFieldArray(r, s, zi, {
|
|
2510
|
-
argA: e,
|
|
2511
|
-
argB: Ri(t)
|
|
2512
|
-
});
|
|
2513
|
-
}, [
|
|
2514
|
-
f,
|
|
2515
|
-
r,
|
|
2516
|
-
n,
|
|
2517
|
-
a
|
|
2518
|
-
]),
|
|
2519
|
-
update: k.useCallback((e, t) => {
|
|
2520
|
-
if (a) return;
|
|
2521
|
-
let i = B(t), o = Ji(n._getFieldArray(r), e, i);
|
|
2522
|
-
u.current = [...o].map((t, n) => !t || n === e ? bi() : u.current[n]), f(o), l([...o]), n._setFieldArray(r, o, Ji, {
|
|
2523
|
-
argA: e,
|
|
2524
|
-
argB: i
|
|
2525
|
-
}, !0, !1);
|
|
2526
|
-
}, [
|
|
2527
|
-
f,
|
|
2528
|
-
r,
|
|
2529
|
-
n,
|
|
2530
|
-
a
|
|
2531
|
-
]),
|
|
2532
|
-
replace: k.useCallback((e) => {
|
|
2533
|
-
if (a) return;
|
|
2534
|
-
let t = Q(B(e));
|
|
2535
|
-
u.current = t.map(bi), f([...t]), l([...t]), n._setFieldArray(r, [...t], (e) => e, {}, !0, !1);
|
|
2536
|
-
}, [
|
|
2537
|
-
f,
|
|
2538
|
-
r,
|
|
2539
|
-
n,
|
|
2540
|
-
a
|
|
2541
|
-
]),
|
|
2542
|
-
fields: k.useMemo(() => c.map((e, t) => ({
|
|
2543
|
-
...e,
|
|
2544
|
-
...G(a) ? { disabled: a } : {},
|
|
2545
|
-
[i]: u.current[t] || bi()
|
|
2546
|
-
})), [
|
|
2547
|
-
c,
|
|
2548
|
-
i,
|
|
2549
|
-
a
|
|
2550
|
-
])
|
|
2551
|
-
};
|
|
2552
|
-
}
|
|
2553
|
-
var Xi = (e) => {
|
|
2554
|
-
let t = {};
|
|
2555
|
-
for (let n of Object.keys(e)) if (Xr(e[n]) && e[n] !== null && !L(e[n])) {
|
|
2556
|
-
let r = Xi(e[n]);
|
|
2557
|
-
for (let e of Object.keys(r)) t[`${n}.${e}`] = r[e];
|
|
2558
|
-
} else t[n] = e[n];
|
|
2559
|
-
return t;
|
|
2560
|
-
}, Zi = k.createContext(null);
|
|
2561
|
-
Zi.displayName = "HookFormContext";
|
|
2562
|
-
var Qi = () => {
|
|
2563
|
-
let e = [];
|
|
2564
|
-
return {
|
|
2565
|
-
get observers() {
|
|
2566
|
-
return e;
|
|
2567
|
-
},
|
|
2568
|
-
next: (t) => {
|
|
2569
|
-
for (let n of e) n.next && n.next(t);
|
|
2570
|
-
},
|
|
2571
|
-
subscribe: (t) => (e.push(t), { unsubscribe: () => {
|
|
2572
|
-
e = e.filter((e) => e !== t);
|
|
2573
|
-
} }),
|
|
2574
|
-
unsubscribe: () => {
|
|
2575
|
-
e = [];
|
|
2576
|
-
}
|
|
2577
|
-
};
|
|
2578
|
-
};
|
|
2579
|
-
function $i(e, t) {
|
|
2580
|
-
let n = {};
|
|
2581
|
-
for (let r in e) if (e.hasOwnProperty(r)) {
|
|
2582
|
-
let i = e[r], a = t[r];
|
|
2583
|
-
if (i && z(i) && a) {
|
|
2584
|
-
let e = $i(i, a);
|
|
2585
|
-
z(e) && (n[r] = e);
|
|
2586
|
-
} else e[r] && (n[r] = a);
|
|
2587
|
-
}
|
|
2588
|
-
return n;
|
|
2589
|
-
}
|
|
2590
|
-
var ea = (e) => e.type === "select-multiple", ta = (e) => Ei(e) || Jr(e), na = (e) => Ti(e) && e.isConnected;
|
|
2591
|
-
function ra(e) {
|
|
2592
|
-
return Array.isArray(e) || z(e);
|
|
2593
|
-
}
|
|
2594
|
-
function ia(e, t, n = "", r = []) {
|
|
2595
|
-
for (let i in e) {
|
|
2596
|
-
let a = n ? `${n}.${i}` : i, o = e[i];
|
|
2597
|
-
ra(o) && ra(W(t, a)) ? ia(o, t, a, r) : r.push(a);
|
|
2598
|
-
}
|
|
2599
|
-
return r;
|
|
2600
|
-
}
|
|
2601
|
-
var aa = (e) => {
|
|
2602
|
-
for (let t in e) if (K(e[t])) return !0;
|
|
2603
|
-
return !1;
|
|
2604
|
-
};
|
|
2605
|
-
function oa(e) {
|
|
2606
|
-
return Array.isArray(e) || z(e) && !aa(e);
|
|
2607
|
-
}
|
|
2608
|
-
function sa(e) {
|
|
2609
|
-
return !!(e && "_f" in e);
|
|
2610
|
-
}
|
|
2611
|
-
function ca(e) {
|
|
2612
|
-
return Array.isArray(e) ? !e.some((e) => !U(e)) : !Object.keys(e).length;
|
|
2613
|
-
}
|
|
2614
|
-
function la(e, t) {
|
|
2615
|
-
Array.isArray(e) ? e[t] = void 0 : delete e[t];
|
|
2616
|
-
}
|
|
2617
|
-
function ua(e, t = {}, n) {
|
|
2618
|
-
for (let r in e) {
|
|
2619
|
-
let i = e[r], a = n && n[r];
|
|
2620
|
-
oa(i) && (!Array.isArray(i) || !sa(a)) ? (t[r] = Array.isArray(i) ? [] : {}, ua(i, t[r], a), ca(t[r]) && la(t, r)) : U(i) || (t[r] = !0);
|
|
2621
|
-
}
|
|
2622
|
-
return t;
|
|
2623
|
-
}
|
|
2624
|
-
function da(e, t, n, r) {
|
|
2625
|
-
n ||= ua(t, {}, r);
|
|
2626
|
-
for (let i in e) {
|
|
2627
|
-
let a = e[i], o = r && r[i];
|
|
2628
|
-
oa(a) && (!Array.isArray(a) || !sa(o)) ? (U(t) || fi(n[i]) ? n[i] = ua(a, Array.isArray(a) ? [] : {}, o) : da(a, R(t) ? {} : t[i], n[i], o), ca(n[i]) && la(n, i)) : J(a, t[i]) ? la(n, i) : n[i] = !0;
|
|
2629
|
-
}
|
|
2630
|
-
return n;
|
|
2631
|
-
}
|
|
2632
|
-
var fa = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => U(e) ? e : t ? e === "" ? NaN : e && +e : n && Y(e) ? new Date(e) : r ? r(e) : e;
|
|
2633
|
-
function pa(e) {
|
|
2634
|
-
let t = e.ref;
|
|
2635
|
-
return Yr(t) ? t.files : Ei(t) ? Ni(e.refs).value : ea(t) ? [...t.selectedOptions].map(({ value: e }) => e) : Jr(t) ? ji(e.refs).value : fa(t.value, e);
|
|
2636
|
-
}
|
|
2637
|
-
var ma = (e, t, n, r) => {
|
|
2638
|
-
let i = {};
|
|
2639
|
-
for (let n of e) {
|
|
2640
|
-
let e = W(t, n);
|
|
2641
|
-
e && q(i, n, e._f);
|
|
2642
|
-
}
|
|
2643
|
-
return {
|
|
2644
|
-
criteriaMode: n,
|
|
2645
|
-
names: [...e],
|
|
2646
|
-
fields: i,
|
|
2647
|
-
shouldUseNativeValidation: r
|
|
2648
|
-
};
|
|
2649
|
-
}, ha = (e) => U(e) ? e : Di(e) ? e.source : z(e) ? Di(e.value) ? e.value.source : e.value : e, ga = "AsyncFunction", _a = (e) => {
|
|
2650
|
-
if (!e || !e.validate) return !1;
|
|
2651
|
-
if (K(e.validate)) return e.validate.constructor.name === ga;
|
|
2652
|
-
if (z(e.validate)) {
|
|
2653
|
-
for (let t in e.validate) if (e.validate[t].constructor.name === ga) return !0;
|
|
2654
|
-
}
|
|
2655
|
-
return !1;
|
|
2656
|
-
}, va = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2657
|
-
function ya(e, t, n) {
|
|
2658
|
-
let r = W(e, n);
|
|
2659
|
-
if (r || ai(n)) return {
|
|
2660
|
-
error: r,
|
|
2661
|
-
name: n
|
|
2662
|
-
};
|
|
2663
|
-
let i = n.split(".");
|
|
2664
|
-
for (; i.length;) {
|
|
2665
|
-
let r = i.join("."), a = W(t, r), o = W(e, r);
|
|
2666
|
-
if (a && !Array.isArray(a) && n !== r) return { name: n };
|
|
2667
|
-
if (o && o.type) return {
|
|
2668
|
-
name: r,
|
|
2669
|
-
error: o
|
|
2670
|
-
};
|
|
2671
|
-
if (o && o.root && o.root.type) return {
|
|
2672
|
-
name: `${r}.root`,
|
|
2673
|
-
error: o.root
|
|
2674
|
-
};
|
|
2675
|
-
i.pop();
|
|
2676
|
-
}
|
|
2677
|
-
return { name: n };
|
|
2678
|
-
}
|
|
2679
|
-
var ba = (e, t, n, r) => {
|
|
2680
|
-
n(e);
|
|
2681
|
-
let i = Object.keys(e).filter((e) => e !== "name");
|
|
2682
|
-
return !i.length || r && i.length >= Object.keys(t).length || i.find((e) => t[e] === (!r || V.all));
|
|
2683
|
-
}, xa = (e, t, n) => !e || !t || e === t || Q(e).some((e) => e && (n ? e === t || e.startsWith(t + ".") : e.startsWith(t) || t.startsWith(e))), Sa = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, Ca = (e, t) => {
|
|
2684
|
-
let n = W(e, t);
|
|
2685
|
-
!Hi(n).length && !n?.root && $(e, t);
|
|
2686
|
-
}, wa = {
|
|
2687
|
-
mode: V.onSubmit,
|
|
2688
|
-
reValidateMode: V.onChange,
|
|
2689
|
-
shouldFocusError: !0
|
|
2690
|
-
}, Ta = "form", Ea = (e, t) => {
|
|
2691
|
-
for (let n in e) n in t || delete e[n];
|
|
2692
|
-
Object.assign(e, t);
|
|
2693
|
-
}, Da = {
|
|
2694
|
-
submitCount: 0,
|
|
2695
|
-
isDirty: !1,
|
|
2696
|
-
isReady: !1,
|
|
2697
|
-
isValidating: !1,
|
|
2698
|
-
isSubmitted: !1,
|
|
2699
|
-
isSubmitting: !1,
|
|
2700
|
-
isSubmitSuccessful: !1,
|
|
2701
|
-
isValid: !1,
|
|
2702
|
-
touchedFields: {},
|
|
2703
|
-
dirtyFields: {},
|
|
2704
|
-
validatingFields: {}
|
|
2705
|
-
};
|
|
2706
|
-
function Oa(e = {}) {
|
|
2707
|
-
let t = {
|
|
2708
|
-
...wa,
|
|
2709
|
-
...e
|
|
2710
|
-
}, n = {
|
|
2711
|
-
...B(Da),
|
|
2712
|
-
isLoading: K(t.defaultValues),
|
|
2713
|
-
errors: t.errors || {},
|
|
2714
|
-
disabled: t.disabled || !1
|
|
2715
|
-
}, r = {}, i = (z(t.defaultValues) || z(t.values)) && B(t.defaultValues || t.values) || {}, a = t.shouldUnregister ? {} : B(i), o = {
|
|
2716
|
-
action: !1,
|
|
2717
|
-
actionArrayLengths: /* @__PURE__ */ new Map(),
|
|
2718
|
-
mount: !1,
|
|
2719
|
-
watch: !1,
|
|
2720
|
-
keepIsValid: !1
|
|
2721
|
-
}, s = {
|
|
2722
|
-
mount: /* @__PURE__ */ new Set(),
|
|
2723
|
-
disabled: /* @__PURE__ */ new Set(),
|
|
2724
|
-
unMount: /* @__PURE__ */ new Set(),
|
|
2725
|
-
array: /* @__PURE__ */ new Set(),
|
|
2726
|
-
watch: /* @__PURE__ */ new Set(),
|
|
2727
|
-
registerName: /* @__PURE__ */ new Set()
|
|
2728
|
-
}, c = {}, l = {}, u = 0, d = X(t.mode), f = X(t.reValidateMode), p = {
|
|
2729
|
-
isDirty: !1,
|
|
2730
|
-
dirtyFields: !1,
|
|
2731
|
-
validatingFields: !1,
|
|
2732
|
-
touchedFields: !1,
|
|
2733
|
-
isValidating: !1,
|
|
2734
|
-
isValid: !1,
|
|
2735
|
-
errors: !1
|
|
2736
|
-
}, m = { ...p }, h = { ...m }, g = {
|
|
2737
|
-
array: Qi(),
|
|
2738
|
-
state: Qi()
|
|
2739
|
-
}, _ = 0, v = t.criteriaMode === V.all, y = (e, t) => (n) => {
|
|
2740
|
-
clearTimeout(l[e]), l[e] = setTimeout(t, n);
|
|
2741
|
-
}, b = async (e) => {
|
|
2742
|
-
if (!o.keepIsValid && !t.disabled && (m.isValid || h.isValid || e)) {
|
|
2743
|
-
let e = ++_, i;
|
|
2744
|
-
t.resolver ? (i = Z((await O()).errors), e === _ && x()) : i = await ie({
|
|
2745
|
-
fields: r,
|
|
2746
|
-
onlyCheckValid: !0,
|
|
2747
|
-
eventType: ti.VALID
|
|
2748
|
-
}), e === _ && i !== n.isValid && g.state.next({ isValid: i });
|
|
2749
|
-
}
|
|
2750
|
-
}, x = (e, r) => {
|
|
2751
|
-
!t.disabled && (m.isValidating || m.validatingFields || h.isValidating || h.validatingFields) && ((e || Array.from(s.mount)).forEach((e) => {
|
|
2752
|
-
e && (r ? q(n.validatingFields, e, r) : $(n.validatingFields, e));
|
|
2753
|
-
}), g.state.next({
|
|
2754
|
-
validatingFields: n.validatingFields,
|
|
2755
|
-
isValidating: !Z(n.validatingFields)
|
|
2756
|
-
}));
|
|
2757
|
-
}, S = () => {
|
|
2758
|
-
n.dirtyFields = da(i, a, void 0, r);
|
|
2759
|
-
}, C = (e, i = [], s, c, l = !0, u = !0) => {
|
|
2760
|
-
if (c && s && !t.disabled) {
|
|
2761
|
-
if (o.action = !0, !o.actionArrayLengths.has(e)) {
|
|
2762
|
-
let t = W(r, e);
|
|
2763
|
-
o.actionArrayLengths.set(e, Array.isArray(t) ? t.length : 0);
|
|
2764
|
-
}
|
|
2765
|
-
if (u && Array.isArray(W(r, e))) {
|
|
2766
|
-
let t = s(W(r, e), c.argA, c.argB);
|
|
2767
|
-
l && q(r, e, t);
|
|
2768
|
-
}
|
|
2769
|
-
if (u && Array.isArray(W(n.errors, e))) {
|
|
2770
|
-
let t = W(n.errors, e), r = t.root, i = s(t, c.argA, c.argB) || t;
|
|
2771
|
-
r && (i.root = r), l && q(n.errors, e, i), Ca(n.errors, e);
|
|
2772
|
-
}
|
|
2773
|
-
if ((m.touchedFields || h.touchedFields) && u && Array.isArray(W(n.touchedFields, e))) {
|
|
2774
|
-
let t = s(W(n.touchedFields, e), c.argA, c.argB);
|
|
2775
|
-
l && q(n.touchedFields, e, t);
|
|
2776
|
-
}
|
|
2777
|
-
(m.dirtyFields || h.dirtyFields) && S(), g.state.next({
|
|
2778
|
-
name: e,
|
|
2779
|
-
isDirty: A(e, i),
|
|
2780
|
-
dirtyFields: n.dirtyFields,
|
|
2781
|
-
errors: n.errors,
|
|
2782
|
-
isValid: n.isValid
|
|
2783
|
-
});
|
|
2784
|
-
} else q(a, e, i);
|
|
2785
|
-
}, w = (e, t) => {
|
|
2786
|
-
q(n.errors, e, t), n.errors = { ...n.errors }, g.state.next({ errors: n.errors });
|
|
2787
|
-
}, T = (e) => {
|
|
2788
|
-
n.errors = e, g.state.next({
|
|
2789
|
-
errors: n.errors,
|
|
2790
|
-
isValid: !1
|
|
2791
|
-
});
|
|
2792
|
-
}, E = (e) => {
|
|
2793
|
-
let t = ai(e) ? [e] : si(e), n = a, r = i;
|
|
2794
|
-
for (let e = 0; e < t.length - 1; e++) {
|
|
2795
|
-
let i = t[e];
|
|
2796
|
-
if (n = R(n) ? n : n[i], r = R(r) ? r : r[i], n === null && r !== null) return !0;
|
|
2797
|
-
}
|
|
2798
|
-
return !1;
|
|
2799
|
-
}, ee = (e) => {
|
|
2800
|
-
if (!o.actionArrayLengths.size) return !1;
|
|
2801
|
-
let t = ai(e) ? [e] : si(e), n = a, r = "", i = -1, s = 0;
|
|
2802
|
-
for (let e = 0; e < t.length; e++) {
|
|
2803
|
-
if (R(n)) return !1;
|
|
2804
|
-
let a = t[e];
|
|
2805
|
-
if (r = r ? `${r}.${a}` : a, Array.isArray(n) && +a >= n.length) return i === -1 ? !1 : e !== i || +a < s;
|
|
2806
|
-
o.actionArrayLengths.has(r) && (i = e + 1, s = o.actionArrayLengths.get(r)), n = n[a];
|
|
2807
|
-
}
|
|
2808
|
-
return !1;
|
|
2809
|
-
}, te = (t, c, l, u) => {
|
|
2810
|
-
let d = W(r, t);
|
|
2811
|
-
if (d) {
|
|
2812
|
-
if (E(t) || ee(t)) return;
|
|
2813
|
-
let r = U(W(a, t)), f = W(a, t, U(l) ? W(i, t) : l);
|
|
2814
|
-
U(f) || u && u.defaultChecked || c ? q(a, t, c ? f : pa(d._f)) : ce(t, f), o.mount && !o.action && (b(), r && n.isDirty && (m.isDirty || h.isDirty) && (A() || (n.isDirty = !1, g.state.next({ ...n }))), e.shouldUnregister && r && !U(W(a, t)) && Si(t, s) && (o.watch = !0));
|
|
2815
|
-
}
|
|
2816
|
-
}, D = (e, o, s, c, l) => {
|
|
2817
|
-
let u = !1, d = !1, f = { name: e };
|
|
2818
|
-
if (!t.disabled || c === !0) {
|
|
2819
|
-
if (!s || c) {
|
|
2820
|
-
let t = J(W(i, e), o);
|
|
2821
|
-
(m.isDirty || h.isDirty) && (d = n.isDirty, n.isDirty = f.isDirty = !t || A(), u = d !== f.isDirty), d = !!W(n.dirtyFields, e), t === n.isDirty ? t ? $(n.dirtyFields, e) : q(n.dirtyFields, e, !0) : Ea(n.dirtyFields, da(i, a, void 0, r)), f.dirtyFields = n.dirtyFields, u ||= (m.dirtyFields || h.dirtyFields) && d !== !t;
|
|
2822
|
-
}
|
|
2823
|
-
if (s) {
|
|
2824
|
-
let t = W(n.touchedFields, e);
|
|
2825
|
-
t || (q(n.touchedFields, e, s), f.touchedFields = n.touchedFields, u ||= (m.touchedFields || h.touchedFields) && t !== s);
|
|
2826
|
-
}
|
|
2827
|
-
u && l && g.state.next(f);
|
|
2828
|
-
}
|
|
2829
|
-
return u ? f : {};
|
|
2830
|
-
}, ne = (e, r, i, a) => {
|
|
2831
|
-
let o = W(n.errors, e), s = (m.isValid || h.isValid) && G(r) && n.isValid !== r;
|
|
2832
|
-
if (t.delayError && i ? (c[e] = y(e, () => w(e, i)), c[e](t.delayError)) : (clearTimeout(l[e]), delete c[e], i ? q(n.errors, e, i) : $(n.errors, e), n.errors = { ...n.errors }), (i ? !J(o, i) : o) || !Z(a) || s) {
|
|
2833
|
-
let t = {
|
|
2834
|
-
...a,
|
|
2835
|
-
...s && G(r) ? { isValid: r } : {},
|
|
2836
|
-
errors: n.errors,
|
|
2837
|
-
name: e
|
|
2838
|
-
};
|
|
2839
|
-
n = {
|
|
2840
|
-
...n,
|
|
2841
|
-
...t
|
|
2842
|
-
}, g.state.next(t);
|
|
2843
|
-
}
|
|
2844
|
-
}, O = async (e) => (x(e, !0), await t.resolver(a, t.context, ma(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), k = async (e) => {
|
|
2845
|
-
let { errors: t } = await O(e);
|
|
2846
|
-
if (x(e), e) {
|
|
2847
|
-
for (let r of e) {
|
|
2848
|
-
let e = W(t, r);
|
|
2849
|
-
e ? s.array.has(r) && z(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? wi(n.errors, { [r]: e }, r) : q(n.errors, r, e) : $(n.errors, r);
|
|
2850
|
-
}
|
|
2851
|
-
n.errors = { ...n.errors };
|
|
2852
|
-
} else n.errors = t;
|
|
2853
|
-
return t;
|
|
2854
|
-
}, re = async ({ name: t, eventType: r }) => {
|
|
2855
|
-
if (e.validate) {
|
|
2856
|
-
let i = await e.validate({
|
|
2857
|
-
formValues: a,
|
|
2858
|
-
formState: n,
|
|
2859
|
-
name: t,
|
|
2860
|
-
eventType: r
|
|
2861
|
-
});
|
|
2862
|
-
if (z(i)) for (let e in i) {
|
|
2863
|
-
let t = i[e];
|
|
2864
|
-
t && ve(`${Ta}.${e}`, {
|
|
2865
|
-
message: Y(t.message) ? t.message : "",
|
|
2866
|
-
type: t.type || H.validate
|
|
2867
|
-
});
|
|
2868
|
-
}
|
|
2869
|
-
else Y(i) || !i ? ve(Ta, {
|
|
2870
|
-
message: i || "",
|
|
2871
|
-
type: H.validate
|
|
2872
|
-
}) : _e(Ta);
|
|
2873
|
-
return i;
|
|
2874
|
-
}
|
|
2875
|
-
return !0;
|
|
2876
|
-
}, ie = async ({ fields: r, onlyCheckValid: i, name: o, eventType: c, context: l = {
|
|
2877
|
-
valid: !0,
|
|
2878
|
-
runRootValidation: !1
|
|
2879
|
-
} }) => {
|
|
2880
|
-
if (e.validate && (l.runRootValidation = !0, !await re({
|
|
2881
|
-
name: o,
|
|
2882
|
-
eventType: c
|
|
2883
|
-
}) && (l.valid = !1, i))) return l.valid;
|
|
2884
|
-
for (let o in r) {
|
|
2885
|
-
let u = r[o];
|
|
2886
|
-
if (u) {
|
|
2887
|
-
let { _f: r, ...d } = u;
|
|
2888
|
-
if (r) {
|
|
2889
|
-
let o = s.array.has(r.name), c = u._f && _a(u._f), d = m.validatingFields || m.isValidating || h.validatingFields || h.isValidating;
|
|
2890
|
-
c && d && x([r.name], !0);
|
|
2891
|
-
let f = await Ii(u, s.disabled, a, v, t.shouldUseNativeValidation && !i, o);
|
|
2892
|
-
if (c && d && x([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (W(f, r.name) ? o ? wi(n.errors, f, r.name) : q(n.errors, r.name, f[r.name]) : $(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
|
|
2893
|
-
}
|
|
2894
|
-
!Z(d) && await ie({
|
|
2895
|
-
context: l,
|
|
2896
|
-
onlyCheckValid: i,
|
|
2897
|
-
fields: d,
|
|
2898
|
-
name: o,
|
|
2899
|
-
eventType: c
|
|
2900
|
-
});
|
|
2901
|
-
}
|
|
2902
|
-
}
|
|
2903
|
-
return l.valid;
|
|
2904
|
-
}, ae = () => {
|
|
2905
|
-
for (let e of s.unMount) {
|
|
2906
|
-
let t = W(r, e);
|
|
2907
|
-
t && (t._f.refs ? t._f.refs.every((e) => !na(e)) : !na(t._f.ref)) && Se(e);
|
|
2908
|
-
}
|
|
2909
|
-
s.unMount = /* @__PURE__ */ new Set();
|
|
2910
|
-
}, A = (e, t) => (e && t && q(a, e, t), !J(o.mount ? a : i, i)), oe = (e, t, n) => gi(e, s, { ...o.mount ? a : U(t) || Y(e) ? i : t }, n, t), se = (e) => Hi(W(o.mount ? a : i, e, t.shouldUnregister ? W(i, e, []) : [])), ce = (e, t, n = {}, i = !1, o = !1, s = !1) => {
|
|
2911
|
-
let c = W(r, e), l = t;
|
|
2912
|
-
if (c) {
|
|
2913
|
-
let n = c._f;
|
|
2914
|
-
n && (!n.disabled && q(a, e, fa(t, n)), l = Ti(n.ref) && R(t) ? "" : t, ea(n.ref) ? [...n.ref.options].forEach((e) => e.selected = l.includes(e.value)) : n.refs ? Jr(n.ref) ? n.refs.forEach((e) => {
|
|
2915
|
-
(!e.defaultChecked || !e.disabled) && (Array.isArray(l) ? e.checked = !!l.find((t) => t === e.value) : e.checked = l === e.value || !!l);
|
|
2916
|
-
}) : n.refs.forEach((e) => e.checked = e.value === l) : Yr(n.ref) ? n.ref.value = "" : (n.ref.value = l, !n.ref.type && !o && !s && g.state.next({
|
|
2917
|
-
name: e,
|
|
2918
|
-
values: i ? a : B(a)
|
|
2919
|
-
})));
|
|
2920
|
-
}
|
|
2921
|
-
(n.shouldDirty || n.shouldTouch) && D(e, l, n.shouldTouch, n.shouldDirty, !o), n.shouldValidate && he(e, { delayError: n.delayError });
|
|
2922
|
-
}, le = (e, t, n, i = !1, o = !1, c = !1) => {
|
|
2923
|
-
s.array.has(e) && g.array.next({
|
|
2924
|
-
name: e,
|
|
2925
|
-
values: i ? a : B(a)
|
|
2926
|
-
});
|
|
2927
|
-
for (let a in t) {
|
|
2928
|
-
if (!t.hasOwnProperty(a)) return;
|
|
2929
|
-
let l = t[a], u = e + "." + a, d = W(r, u);
|
|
2930
|
-
(s.array.has(e) || z(l) || d && !d._f) && !L(l) ? le(u, l, n, i, o, c) : ce(u, l, n, i, o, c);
|
|
2931
|
-
}
|
|
2932
|
-
}, ue = (e, t, i, c, l = !1) => {
|
|
2933
|
-
let u = W(r, e), d = s.array.has(e), f = c ? t : B(t), p = J(W(a, e), f);
|
|
2934
|
-
if (p || q(a, e, f), d) g.array.next({
|
|
2935
|
-
name: e,
|
|
2936
|
-
values: c ? a : B(a)
|
|
2937
|
-
}), (m.isDirty || m.dirtyFields || h.isDirty || h.dirtyFields) && i.shouldDirty && (S(), l || g.state.next({
|
|
2938
|
-
name: e,
|
|
2939
|
-
dirtyFields: n.dirtyFields,
|
|
2940
|
-
isDirty: A(e, f)
|
|
2941
|
-
}));
|
|
2942
|
-
else {
|
|
2943
|
-
let t = Array.isArray(f) && !f.length || Z(f), n = !p && !l;
|
|
2944
|
-
!u || u._f || R(f) || t ? ce(e, f, i, c, l, n) : le(e, f, i, c, l, n);
|
|
2945
|
-
}
|
|
2946
|
-
if (!p && !l) {
|
|
2947
|
-
let t = Si(e, s), r = c ? a : B(a);
|
|
2948
|
-
g.state.next({
|
|
2949
|
-
...t && n,
|
|
2950
|
-
name: o.mount || t ? e : void 0,
|
|
2951
|
-
values: r
|
|
2952
|
-
});
|
|
2953
|
-
}
|
|
2954
|
-
}, de = (e, t, n = {}) => ue(e, t, n, !1), fe = (e, t = {}) => {
|
|
2955
|
-
let r = K(e) ? e(a) : e;
|
|
2956
|
-
if (!J(a, r)) {
|
|
2957
|
-
a = {
|
|
2958
|
-
...a,
|
|
2959
|
-
...r
|
|
2960
|
-
};
|
|
2961
|
-
let e = Xi(r);
|
|
2962
|
-
for (let n of s.mount) n in e && ue(n, e[n], t, !0, !0);
|
|
2963
|
-
g.state.next({
|
|
2964
|
-
...n,
|
|
2965
|
-
name: void 0,
|
|
2966
|
-
type: void 0,
|
|
2967
|
-
...u ? { values: a } : {}
|
|
2968
|
-
}), t.shouldValidate && b();
|
|
2969
|
-
}
|
|
2970
|
-
}, pe = async (i) => {
|
|
2971
|
-
o.mount = !0;
|
|
2972
|
-
let l = i.target, p = l.name, _ = !0, y = W(r, p), S = (e) => {
|
|
2973
|
-
_ = Number.isNaN(e) || L(e) && isNaN(e.getTime()) || J(e, W(a, p, e));
|
|
2974
|
-
};
|
|
2975
|
-
if (y) {
|
|
2976
|
-
let o, C, w = l.type ? pa(y._f) : Zr(i), T = i.type === ti.BLUR || i.type === ti.FOCUS_OUT, E = !va(y._f) && !e.validate && !t.resolver && !W(n.errors, p) && !y._f.deps, ee = E || Sa(T, W(n.touchedFields, p), n.isSubmitted, f, d), te = Si(p, s, T);
|
|
2977
|
-
if (q(a, p, w), T) {
|
|
2978
|
-
if (!l || !l.readOnly) {
|
|
2979
|
-
y._f.onBlur && y._f.onBlur(i);
|
|
2980
|
-
let e = c[p];
|
|
2981
|
-
e && e(0);
|
|
2982
|
-
}
|
|
2983
|
-
} else y._f.onChange && y._f.onChange(i);
|
|
2984
|
-
let k = D(p, w, T), ae = !Z(k) || te;
|
|
2985
|
-
if (!T && g.state.next({
|
|
2986
|
-
name: p,
|
|
2987
|
-
type: i.type,
|
|
2988
|
-
...u ? { values: B(a) } : {}
|
|
2989
|
-
}), ee) return (!E || !n.isValid) && (m.isValid || h.isValid) && (t.mode === "onBlur" ? T && b() : T || b()), ae && g.state.next({
|
|
2990
|
-
name: p,
|
|
2991
|
-
...te ? {} : k
|
|
2992
|
-
});
|
|
2993
|
-
if (!t.resolver && e.validate && await re({
|
|
2994
|
-
name: p,
|
|
2995
|
-
eventType: i.type
|
|
2996
|
-
}), !T && te && g.state.next({ ...n }), t.resolver) {
|
|
2997
|
-
let { errors: e } = await O([p]);
|
|
2998
|
-
if (x([p]), S(w), !_) {
|
|
2999
|
-
!Z(k) && g.state.next(k);
|
|
3000
|
-
return;
|
|
3001
|
-
}
|
|
3002
|
-
let t = ya(n.errors, r, p), i = ya(e, r, t.name || p);
|
|
3003
|
-
o = i.error, p = i.name, C = Z(e);
|
|
3004
|
-
} else x([p], !0), o = (await Ii(y, s.disabled, a, v, t.shouldUseNativeValidation))[p], x([p]), S(w), _ && (o ? C = !1 : (m.isValid || h.isValid) && (C = await ie({
|
|
3005
|
-
fields: r,
|
|
3006
|
-
onlyCheckValid: !0,
|
|
3007
|
-
name: p,
|
|
3008
|
-
eventType: i.type
|
|
3009
|
-
})));
|
|
3010
|
-
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && he(y._f.deps), ne(p, C, o, k));
|
|
3011
|
-
}
|
|
3012
|
-
}, me = (e, t) => {
|
|
3013
|
-
if (W(n.errors, t) && e.focus) return e.focus(), 1;
|
|
3014
|
-
}, he = async (e, i = {}) => {
|
|
3015
|
-
let a, o, u = Q(e);
|
|
3016
|
-
if (t.resolver) {
|
|
3017
|
-
let t = await k(U(e) ? e : u);
|
|
3018
|
-
a = Z(t), o = e ? !u.some((e) => W(t, e)) : a;
|
|
3019
|
-
} else e ? (o = (await Promise.all(u.map(async (e) => {
|
|
3020
|
-
let t = W(r, e);
|
|
3021
|
-
return await ie({
|
|
3022
|
-
fields: t && t._f ? { [e]: t } : t,
|
|
3023
|
-
eventType: ti.TRIGGER
|
|
3024
|
-
});
|
|
3025
|
-
}))).every(Boolean), !(!o && !n.isValid) && b()) : o = a = await ie({
|
|
3026
|
-
fields: r,
|
|
3027
|
-
name: e,
|
|
3028
|
-
eventType: ti.TRIGGER
|
|
3029
|
-
});
|
|
3030
|
-
if (i.delayError && t.delayError && Y(e)) {
|
|
3031
|
-
let r = W(n.errors, e);
|
|
3032
|
-
r ? ($(n.errors, e), c[e] = y(e, () => w(e, r)), c[e](t.delayError)) : (clearTimeout(l[e]), delete c[e]);
|
|
3033
|
-
}
|
|
3034
|
-
return g.state.next({
|
|
3035
|
-
...!Y(e) || (m.isValid || h.isValid) && a !== n.isValid ? {} : { name: e },
|
|
3036
|
-
...t.resolver || !e ? { isValid: a } : {},
|
|
3037
|
-
errors: n.errors
|
|
3038
|
-
}), i.shouldFocus && !o && Ci(r, me, e ? u : s.mount), o;
|
|
3039
|
-
}, j = (e, t) => {
|
|
3040
|
-
let r = { ...o.mount ? a : i };
|
|
3041
|
-
return t && (r = $i(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), U(e) ? r : Y(e) ? W(r, e) : e.map((e) => W(r, e));
|
|
3042
|
-
}, ge = (e, t) => ({
|
|
3043
|
-
invalid: !!W((t || n).errors, e),
|
|
3044
|
-
isDirty: !!W((t || n).dirtyFields, e),
|
|
3045
|
-
error: W((t || n).errors, e),
|
|
3046
|
-
isValidating: !!W(n.validatingFields, e),
|
|
3047
|
-
isTouched: !!W((t || n).touchedFields, e)
|
|
3048
|
-
}), _e = (e) => {
|
|
3049
|
-
let t = e ? Q(e) : void 0;
|
|
3050
|
-
t?.forEach((e) => $(n.errors, e)), t ? t.forEach((e) => {
|
|
3051
|
-
g.state.next({
|
|
3052
|
-
name: e,
|
|
3053
|
-
errors: n.errors
|
|
3054
|
-
});
|
|
3055
|
-
}) : (n.errors = {}, g.state.next({ errors: n.errors }));
|
|
3056
|
-
}, ve = (e, t, i) => {
|
|
3057
|
-
let a = (W(r, e, { _f: {} })._f || {}).ref, { ref: o, message: s, type: c, ...l } = W(n.errors, e) || {};
|
|
3058
|
-
q(n.errors, e, {
|
|
3059
|
-
...l,
|
|
3060
|
-
...t,
|
|
3061
|
-
ref: a
|
|
3062
|
-
}), g.state.next({
|
|
3063
|
-
name: e,
|
|
3064
|
-
errors: n.errors,
|
|
3065
|
-
isValid: !1
|
|
3066
|
-
}), i && i.shouldFocus && a && a.focus && a.focus();
|
|
3067
|
-
}, ye = (e, t) => {
|
|
3068
|
-
if (K(e)) {
|
|
3069
|
-
u++;
|
|
3070
|
-
let { unsubscribe: n } = g.state.subscribe({ next: (n) => "values" in n && e(n.values || oe(void 0, t), n) }), r = !1;
|
|
3071
|
-
return { unsubscribe: () => {
|
|
3072
|
-
r || (r = !0, u--, n());
|
|
3073
|
-
} };
|
|
3074
|
-
}
|
|
3075
|
-
return oe(e, t, !0);
|
|
3076
|
-
}, be = (e) => {
|
|
3077
|
-
let t = !!e.formState?.values;
|
|
3078
|
-
t && u++;
|
|
3079
|
-
let { unsubscribe: r } = g.state.subscribe({ next: (t) => {
|
|
3080
|
-
if (xa(e.name, t.name, e.exact) && ba(t, e.formState || m, je, e.reRenderRoot)) {
|
|
3081
|
-
let r = { ...a };
|
|
3082
|
-
e.callback({
|
|
3083
|
-
values: r,
|
|
3084
|
-
...n,
|
|
3085
|
-
...t,
|
|
3086
|
-
defaultValues: i
|
|
3087
|
-
});
|
|
3088
|
-
}
|
|
3089
|
-
} });
|
|
3090
|
-
if (!t) return r;
|
|
3091
|
-
let o = !1;
|
|
3092
|
-
return () => {
|
|
3093
|
-
o || (o = !0, u--, r());
|
|
3094
|
-
};
|
|
3095
|
-
}, xe = (e) => (o.mount = !0, h = {
|
|
3096
|
-
...h,
|
|
3097
|
-
...e.formState
|
|
3098
|
-
}, be({
|
|
3099
|
-
...e,
|
|
3100
|
-
formState: {
|
|
3101
|
-
...p,
|
|
3102
|
-
...e.formState
|
|
3103
|
-
}
|
|
3104
|
-
})), Se = (e, o = {}) => {
|
|
3105
|
-
for (let c of e ? Q(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || ($(r, c), $(a, c)), !o.keepError && $(n.errors, c), !o.keepDirty && $(n.dirtyFields, c), !o.keepTouched && $(n.touchedFields, c), !o.keepIsValidating && $(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && $(i, c);
|
|
3106
|
-
g.state.next({ values: B(a) }), g.state.next({
|
|
3107
|
-
...n,
|
|
3108
|
-
...o.keepDirty ? { isDirty: A() } : {}
|
|
3109
|
-
}), !o.keepIsValid && b();
|
|
3110
|
-
}, Ce = ({ disabled: e, name: t }) => {
|
|
3111
|
-
if (G(e) && o.mount || e || s.disabled.has(t)) {
|
|
3112
|
-
let n = s.disabled.has(t) !== !!e;
|
|
3113
|
-
e ? s.disabled.add(t) : s.disabled.delete(t), n && o.mount && !o.action && b();
|
|
3114
|
-
}
|
|
3115
|
-
}, we = (e, n = {}) => {
|
|
3116
|
-
let a = W(r, e), c = G(n.disabled) || G(t.disabled), l = !s.registerName.has(e) && a && a._f && !a._f.mount;
|
|
3117
|
-
return q(r, e, {
|
|
3118
|
-
...a || {},
|
|
3119
|
-
_f: {
|
|
3120
|
-
...a && a._f ? a._f : { ref: { name: e } },
|
|
3121
|
-
name: e,
|
|
3122
|
-
mount: !0,
|
|
3123
|
-
...n
|
|
3124
|
-
}
|
|
3125
|
-
}), s.mount.add(e), a && !l ? Ce({
|
|
3126
|
-
disabled: G(n.disabled) ? n.disabled : t.disabled,
|
|
3127
|
-
name: e
|
|
3128
|
-
}) : te(e, !0, n.value), {
|
|
3129
|
-
...c ? { disabled: n.disabled || t.disabled } : {},
|
|
3130
|
-
...t.progressive ? {
|
|
3131
|
-
required: !!n.required,
|
|
3132
|
-
min: ha(n.min),
|
|
3133
|
-
max: ha(n.max),
|
|
3134
|
-
minLength: ha(n.minLength),
|
|
3135
|
-
maxLength: ha(n.maxLength),
|
|
3136
|
-
pattern: ha(n.pattern)
|
|
3137
|
-
} : {},
|
|
3138
|
-
name: e,
|
|
3139
|
-
onChange: pe,
|
|
3140
|
-
onBlur: pe,
|
|
3141
|
-
ref: (c) => {
|
|
3142
|
-
if (c) {
|
|
3143
|
-
s.registerName.add(e), we(e, n), s.registerName.delete(e), a = W(r, e);
|
|
3144
|
-
let t = U(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = ta(t), l = a._f.refs || [];
|
|
3145
|
-
if (o ? l.find((e) => e === t) : t === a._f.ref) return;
|
|
3146
|
-
let u = { ...a._f };
|
|
3147
|
-
o ? (u.refs = [
|
|
3148
|
-
...l.filter(na),
|
|
3149
|
-
t,
|
|
3150
|
-
...Array.isArray(W(i, e)) ? [{}] : []
|
|
3151
|
-
], u.ref = {
|
|
3152
|
-
type: t.type,
|
|
3153
|
-
name: e
|
|
3154
|
-
}) : (u.ref = t, delete u.refs), q(r, e, { _f: u }), te(e, !1, void 0, t);
|
|
3155
|
-
} else a = W(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(Qr(s.array, e) && o.action) && s.unMount.add(e);
|
|
3156
|
-
}
|
|
3157
|
-
};
|
|
3158
|
-
}, Te = () => t.shouldFocusError && !t.shouldUseNativeValidation && Ci(r, me, s.mount), M = (e) => {
|
|
3159
|
-
G(e) && (g.state.next({ disabled: e }), Ci(r, (t, n) => {
|
|
3160
|
-
let i = W(r, n);
|
|
3161
|
-
i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
|
|
3162
|
-
t.disabled = i._f.disabled || e;
|
|
3163
|
-
}));
|
|
3164
|
-
}, 0, !1));
|
|
3165
|
-
}, Ee = (e, i) => async (o) => {
|
|
3166
|
-
let c, l;
|
|
3167
|
-
o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
|
|
3168
|
-
let u = B(a);
|
|
3169
|
-
if (g.state.next({ isSubmitting: !0 }), t.resolver) {
|
|
3170
|
-
let { errors: e, values: t } = await O();
|
|
3171
|
-
x(), n.errors = e, u = B(t);
|
|
3172
|
-
} else await ie({
|
|
3173
|
-
fields: r,
|
|
3174
|
-
eventType: ti.SUBMIT
|
|
3175
|
-
});
|
|
3176
|
-
if (s.disabled.size) for (let e of s.disabled) $(u, e);
|
|
3177
|
-
if ($(n.errors, ni), Z(n.errors)) {
|
|
3178
|
-
g.state.next({ errors: {} });
|
|
3179
|
-
try {
|
|
3180
|
-
c = await e(u, o);
|
|
3181
|
-
} catch (e) {
|
|
3182
|
-
l = e;
|
|
3183
|
-
}
|
|
3184
|
-
} else i && await i({ ...n.errors }, o), Te(), setTimeout(Te);
|
|
3185
|
-
if (g.state.next({
|
|
3186
|
-
isSubmitted: !0,
|
|
3187
|
-
isSubmitting: !1,
|
|
3188
|
-
isSubmitSuccessful: Z(n.errors) && !l,
|
|
3189
|
-
submitCount: n.submitCount + 1,
|
|
3190
|
-
errors: n.errors
|
|
3191
|
-
}), l) throw l;
|
|
3192
|
-
return c;
|
|
3193
|
-
}, De = (e, t = {}) => {
|
|
3194
|
-
W(r, e) && (U(t.defaultValue) ? de(e, B(W(i, e))) : (de(e, t.defaultValue), q(i, e, B(t.defaultValue))), t.keepTouched || $(n.touchedFields, e), t.keepDirty || ($(n.dirtyFields, e), n.isDirty = t.defaultValue ? A(e, B(W(i, e))) : A()), t.keepError || ($(n.errors, e), m.isValid && b()), g.state.next({ ...n }));
|
|
3195
|
-
}, Oe = (e, c = {}) => {
|
|
3196
|
-
let l = e ? B(e) : i, u = B(l), d = Z(e), f = u, p = r;
|
|
3197
|
-
if (c.keepDefaultValues || (i = l), !c.keepValues) {
|
|
3198
|
-
if (c.keepDirtyValues) {
|
|
3199
|
-
let e = /* @__PURE__ */ new Set([...s.mount, ...ia(da(i, a, void 0, p), n.dirtyFields)]);
|
|
3200
|
-
for (let t of Array.from(e)) {
|
|
3201
|
-
let e = W(n.dirtyFields, t), r = W(a, t), i = W(f, t);
|
|
3202
|
-
e && !U(r) ? q(f, t, r) : !e && !U(i) && de(t, i);
|
|
3203
|
-
}
|
|
3204
|
-
} else {
|
|
3205
|
-
if (ei && U(e)) for (let e of s.mount) {
|
|
3206
|
-
let t = W(r, e);
|
|
3207
|
-
if (t && t._f) {
|
|
3208
|
-
let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
|
|
3209
|
-
if (Ti(e)) {
|
|
3210
|
-
let t = e.closest("form");
|
|
3211
|
-
if (t) {
|
|
3212
|
-
t.reset();
|
|
3213
|
-
break;
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
}
|
|
3217
|
-
}
|
|
3218
|
-
if (c.keepFieldsRef) for (let e of s.mount) de(e, W(f, e));
|
|
3219
|
-
else r = {};
|
|
3220
|
-
}
|
|
3221
|
-
if (t.shouldUnregister) {
|
|
3222
|
-
if (a = c.keepDefaultValues ? B(i) : {}, c.keepFieldsRef) for (let e of s.mount) q(a, e, W(f, e));
|
|
3223
|
-
} else a = B(f);
|
|
3224
|
-
g.array.next({ values: { ...f } }), g.state.next({
|
|
3225
|
-
name: void 0,
|
|
3226
|
-
type: void 0,
|
|
3227
|
-
values: { ...f }
|
|
3228
|
-
});
|
|
3229
|
-
}
|
|
3230
|
-
s = {
|
|
3231
|
-
mount: c.keepDirtyValues ? s.mount : /* @__PURE__ */ new Set(),
|
|
3232
|
-
unMount: /* @__PURE__ */ new Set(),
|
|
3233
|
-
array: /* @__PURE__ */ new Set(),
|
|
3234
|
-
registerName: /* @__PURE__ */ new Set(),
|
|
3235
|
-
disabled: /* @__PURE__ */ new Set(),
|
|
3236
|
-
watch: /* @__PURE__ */ new Set(),
|
|
3237
|
-
watchAll: !1,
|
|
3238
|
-
focus: ""
|
|
3239
|
-
}, o.mount = !m.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !t.shouldUnregister && !Z(f), o.watch = !!t.shouldUnregister, o.keepIsValid = !!c.keepIsValid, o.action = !1, o.actionArrayLengths.clear(), c.keepErrors || (n.errors = {}), g.state.next({
|
|
3240
|
-
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
3241
|
-
isDirty: d ? !1 : c.keepDirty ? n.isDirty : c.keepValues ? A() : !!(c.keepDefaultValues && !J(e, i)),
|
|
3242
|
-
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
3243
|
-
dirtyFields: d ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? da(i, a, void 0, p) : n.dirtyFields : c.keepDefaultValues && e ? da(i, e, void 0, p) : c.keepDirty ? n.dirtyFields : {},
|
|
3244
|
-
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
3245
|
-
errors: c.keepErrors ? n.errors : {},
|
|
3246
|
-
isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
3247
|
-
isSubmitting: !1,
|
|
3248
|
-
defaultValues: i
|
|
3249
|
-
});
|
|
3250
|
-
}, ke = (e, n) => Oe(K(e) ? e(a) : e, {
|
|
3251
|
-
...t.resetOptions,
|
|
3252
|
-
...n
|
|
3253
|
-
}), Ae = (e, t = {}) => {
|
|
3254
|
-
let n = W(r, e), i = n && n._f;
|
|
3255
|
-
if (i) {
|
|
3256
|
-
let e = i.refs ? i.refs[0] : i.ref;
|
|
3257
|
-
e.focus && setTimeout(() => {
|
|
3258
|
-
e.focus(), t.shouldSelect && K(e.select) && e.select();
|
|
3259
|
-
});
|
|
3260
|
-
}
|
|
3261
|
-
}, je = (e) => {
|
|
3262
|
-
let { name: t, type: r, values: i, ...a } = e;
|
|
3263
|
-
n = {
|
|
3264
|
-
...n,
|
|
3265
|
-
...a
|
|
3266
|
-
};
|
|
3267
|
-
};
|
|
3268
|
-
g.state.subscribe({ next: je });
|
|
3269
|
-
let Me = {
|
|
3270
|
-
control: {
|
|
3271
|
-
register: we,
|
|
3272
|
-
unregister: Se,
|
|
3273
|
-
getFieldState: ge,
|
|
3274
|
-
handleSubmit: Ee,
|
|
3275
|
-
setError: ve,
|
|
3276
|
-
_subscribe: be,
|
|
3277
|
-
_runSchema: O,
|
|
3278
|
-
_updateIsValidating: x,
|
|
3279
|
-
_focusError: Te,
|
|
3280
|
-
_getWatch: oe,
|
|
3281
|
-
_getDirty: A,
|
|
3282
|
-
_setValid: b,
|
|
3283
|
-
_setFieldArray: C,
|
|
3284
|
-
_setDisabledField: Ce,
|
|
3285
|
-
_setErrors: T,
|
|
3286
|
-
_getFieldArray: se,
|
|
3287
|
-
_reset: Oe,
|
|
3288
|
-
_resetDefaultValues: () => K(t.defaultValues) && t.defaultValues().then((e) => {
|
|
3289
|
-
ke(e, t.resetOptions), g.state.next({ isLoading: !1 });
|
|
3290
|
-
}),
|
|
3291
|
-
_removeUnmounted: ae,
|
|
3292
|
-
_disableForm: M,
|
|
3293
|
-
_subjects: g,
|
|
3294
|
-
_proxyFormState: m,
|
|
3295
|
-
get _fields() {
|
|
3296
|
-
return r;
|
|
3297
|
-
},
|
|
3298
|
-
get _formValues() {
|
|
3299
|
-
return a;
|
|
3300
|
-
},
|
|
3301
|
-
get _state() {
|
|
3302
|
-
return o;
|
|
3303
|
-
},
|
|
3304
|
-
set _state(e) {
|
|
3305
|
-
o = e;
|
|
3306
|
-
},
|
|
3307
|
-
get _defaultValues() {
|
|
3308
|
-
return i;
|
|
3309
|
-
},
|
|
3310
|
-
get _names() {
|
|
3311
|
-
return s;
|
|
3312
|
-
},
|
|
3313
|
-
set _names(e) {
|
|
3314
|
-
s = e;
|
|
3315
|
-
},
|
|
3316
|
-
get _formState() {
|
|
3317
|
-
return n;
|
|
3318
|
-
},
|
|
3319
|
-
get _options() {
|
|
3320
|
-
return t;
|
|
3321
|
-
},
|
|
3322
|
-
set _options(e) {
|
|
3323
|
-
t = {
|
|
3324
|
-
...t,
|
|
3325
|
-
...e
|
|
3326
|
-
}, d = X(t.mode), f = X(t.reValidateMode);
|
|
3327
|
-
}
|
|
3328
|
-
},
|
|
3329
|
-
subscribe: xe,
|
|
3330
|
-
trigger: he,
|
|
3331
|
-
register: we,
|
|
3332
|
-
handleSubmit: Ee,
|
|
3333
|
-
watch: ye,
|
|
3334
|
-
setValue: de,
|
|
3335
|
-
setValues: fe,
|
|
3336
|
-
getValues: j,
|
|
3337
|
-
reset: ke,
|
|
3338
|
-
resetField: De,
|
|
3339
|
-
resetDefaultValues: (e, t = {}) => {
|
|
3340
|
-
if (i = B(e), !t.keepDirty) {
|
|
3341
|
-
let e = da(i, a, void 0, r);
|
|
3342
|
-
n.dirtyFields = e, n.isDirty = !Z(e);
|
|
3343
|
-
}
|
|
3344
|
-
t.keepIsValid || b(), g.state.next({
|
|
3345
|
-
...n,
|
|
3346
|
-
defaultValues: i
|
|
3347
|
-
});
|
|
3348
|
-
},
|
|
3349
|
-
clearErrors: _e,
|
|
3350
|
-
unregister: Se,
|
|
3351
|
-
setError: ve,
|
|
3352
|
-
setFocus: Ae,
|
|
3353
|
-
getFieldState: ge
|
|
3354
|
-
};
|
|
3355
|
-
return {
|
|
3356
|
-
...Me,
|
|
3357
|
-
formControl: Me
|
|
3358
|
-
};
|
|
3359
|
-
}
|
|
3360
|
-
function ka(e = {}) {
|
|
3361
|
-
let t = k.useRef(void 0), n = k.useRef(void 0), r = k.useRef(e.formControl), [i, a] = k.useState(() => ({
|
|
3362
|
-
...B(Da),
|
|
3363
|
-
isLoading: K(e.defaultValues),
|
|
3364
|
-
errors: e.errors || {},
|
|
3365
|
-
disabled: e.disabled || !1,
|
|
3366
|
-
defaultValues: K(e.defaultValues) ? void 0 : e.defaultValues
|
|
3367
|
-
}));
|
|
3368
|
-
if (!t.current || e.formControl && r.current !== e.formControl) if (r.current = e.formControl, e.formControl) t.current = {
|
|
3369
|
-
...e.formControl,
|
|
3370
|
-
formState: i
|
|
3371
|
-
}, e.defaultValues && !K(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3372
|
-
else {
|
|
3373
|
-
let { formControl: n, ...r } = Oa(e);
|
|
3374
|
-
t.current = {
|
|
3375
|
-
...r,
|
|
3376
|
-
formState: i
|
|
3377
|
-
};
|
|
3378
|
-
}
|
|
3379
|
-
let o = t.current.control;
|
|
3380
|
-
o._options = e;
|
|
3381
|
-
let { resyncIfNeeded: s, snapshot: c } = mi();
|
|
3382
|
-
return di(() => {
|
|
3383
|
-
let e = () => ({
|
|
3384
|
-
...o._formState,
|
|
3385
|
-
defaultValues: o._defaultValues
|
|
3386
|
-
});
|
|
3387
|
-
s(!0, e, a);
|
|
3388
|
-
let t = o._subscribe({
|
|
3389
|
-
formState: o._proxyFormState,
|
|
3390
|
-
callback: () => a({
|
|
3391
|
-
...o._formState,
|
|
3392
|
-
defaultValues: o._defaultValues
|
|
3393
|
-
}),
|
|
3394
|
-
reRenderRoot: !0
|
|
3395
|
-
});
|
|
3396
|
-
return a((e) => ({
|
|
3397
|
-
...e,
|
|
3398
|
-
isReady: !0
|
|
3399
|
-
})), o._formState.isReady = !0, () => {
|
|
3400
|
-
t(), c(!0, e);
|
|
3401
|
-
};
|
|
3402
|
-
}, [
|
|
3403
|
-
o,
|
|
3404
|
-
s,
|
|
3405
|
-
c
|
|
3406
|
-
]), k.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), k.useEffect(() => {
|
|
3407
|
-
e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode);
|
|
3408
|
-
}, [
|
|
3409
|
-
o,
|
|
3410
|
-
e.mode,
|
|
3411
|
-
e.reValidateMode
|
|
3412
|
-
]), k.useEffect(() => {
|
|
3413
|
-
e.errors && (o._setErrors(e.errors), o._focusError());
|
|
3414
|
-
}, [o, e.errors]), k.useEffect(() => {
|
|
3415
|
-
e.shouldUnregister && o._subjects.state.next({ values: o._getWatch() });
|
|
3416
|
-
}, [o, e.shouldUnregister]), k.useEffect(() => {
|
|
3417
|
-
if (o._proxyFormState.isDirty) {
|
|
3418
|
-
let e = o._getDirty();
|
|
3419
|
-
e !== i.isDirty && o._subjects.state.next({ isDirty: e });
|
|
3420
|
-
}
|
|
3421
|
-
}, [o, i.isDirty]), k.useEffect(() => {
|
|
3422
|
-
e.values && !J(e.values, n.current) ? (o._reset(e.values, {
|
|
3423
|
-
keepFieldsRef: !0,
|
|
3424
|
-
...o._options.resetOptions
|
|
3425
|
-
}), o._options.resetOptions?.keepIsValid || o._setValid(), n.current = e.values, a((e) => ({ ...e }))) : o._resetDefaultValues();
|
|
3426
|
-
}, [o, e.values]), k.useEffect(() => {
|
|
3427
|
-
o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
|
|
3428
|
-
}), t.current.formState = k.useMemo(() => ui(i, o), [o, i]), t.current;
|
|
3429
|
-
}
|
|
3430
|
-
//#endregion
|
|
3431
|
-
//#region lib/components/ui/forms/use-field-blur.ts
|
|
3432
|
-
var Aa = typeof document > "u" ? null : document, ja = {
|
|
3433
|
-
capture: !0,
|
|
3434
|
-
passive: !0
|
|
3435
|
-
};
|
|
3436
|
-
function Ma(e, t) {
|
|
3437
|
-
for (let t of e.roots) t.isConnected || e.roots.delete(t);
|
|
3438
|
-
let n = [...e.roots];
|
|
3439
|
-
if (!n.length) return !1;
|
|
3440
|
-
if (n.some((e) => e.contains(t))) return e.inside || (e.before = new Set(t.ownerDocument?.body.childNodes ?? []), e.home = new Set(n.map(pe)), e.opened = /* @__PURE__ */ new Set()), e.inside = !0, !1;
|
|
3441
|
-
if (!e.inside) return !1;
|
|
3442
|
-
let r = pe(t);
|
|
3443
|
-
if (e.home.has(r)) return !0;
|
|
3444
|
-
if (!r || e.opened.has(r)) return !1;
|
|
3445
|
-
let i = me(n, e, r);
|
|
3446
|
-
return i === "theirs" || !i && e.before.has(r) ? !0 : (e.opened.add(r), !1);
|
|
3447
|
-
}
|
|
3448
|
-
function Na(e) {
|
|
3449
|
-
let t = _r(e), n = de({
|
|
3450
|
-
roots: /* @__PURE__ */ new Set(),
|
|
3451
|
-
inside: !1,
|
|
3452
|
-
before: /* @__PURE__ */ new Set(),
|
|
3453
|
-
home: /* @__PURE__ */ new Set(),
|
|
3454
|
-
opened: /* @__PURE__ */ new Set()
|
|
3455
|
-
}).current, r = oe((e) => {
|
|
3456
|
-
if (e) return n.roots.add(e), () => {
|
|
3457
|
-
n.roots.delete(e);
|
|
3458
|
-
};
|
|
3459
|
-
}, [n]), i = oe(() => {
|
|
3460
|
-
n.inside = !1, t.current();
|
|
3461
|
-
}, [n, t]), a = oe((e) => {
|
|
3462
|
-
let t = e.target;
|
|
3463
|
-
t instanceof Node && (clearTimeout(n.settle), Ma(n, t) && i());
|
|
3464
|
-
}, [n, i]), o = oe((e) => {
|
|
3465
|
-
!n.inside || e.relatedTarget || (clearTimeout(n.settle), n.settle = setTimeout(() => {
|
|
3466
|
-
n.settle = setTimeout(() => {
|
|
3467
|
-
let e = Aa?.activeElement;
|
|
3468
|
-
n.inside && (!e || e === Aa?.body) && i();
|
|
3469
|
-
});
|
|
3470
|
-
}));
|
|
3471
|
-
}, [n, i]);
|
|
3472
|
-
return gr("focusin", a, Aa, ja), gr("focusout", o, Aa, ja), ce(() => () => clearTimeout(n.settle), [n]), r;
|
|
3473
|
-
}
|
|
3474
|
-
//#endregion
|
|
3475
|
-
//#region lib/components/ui/forms/field-blur.tsx
|
|
3476
|
-
function Pa({ onBlur: e, children: t }) {
|
|
3477
|
-
return /* @__PURE__ */ D(br, {
|
|
3478
|
-
value: Na(e),
|
|
3479
|
-
children: t
|
|
3480
|
-
});
|
|
3481
|
-
}
|
|
3482
|
-
//#endregion
|
|
3483
|
-
export { ln as $, Or as A, lr as B, Fr as C, jr as D, Mr as E, xr as F, rr as G, ur as H, yr as I, yn as J, sn as K, vr as L, wr as M, Cr as N, Ar as O, Sr as P, wn as Q, gr as R, Lr as S, Pr as T, cr as U, dr as V, ir as W, hn as X, En as Y, pn as Z, Ir as _, q as a, Br as b, ka as c, Gr as d, an as et, qr as f, Nr as g, Ur as h, W as i, ye as it, Dr as j, kr as k, hi as l, Wr as m, Na as n, Gt as nt, vi as o, Kr as p, On as q, yi as r, Fe as rt, Yi as s, Pa as t, en as tt, _i as u, Rr as v, Vr as w, zr as x, Hr as y, fr as z };
|