@devcabs/folio-engine 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +7 -0
- package/dist/components/canvas/CanvasAddBar.d.ts +28 -0
- package/dist/components/canvas/CanvasAddModal.d.ts +38 -0
- package/dist/components/canvas/CanvasChart.d.ts +23 -0
- package/dist/components/canvas/CanvasDeleteConfirmModal.d.ts +21 -0
- package/dist/components/canvas/CanvasGallery.d.ts +20 -0
- package/dist/components/canvas/CanvasItemControls.d.ts +33 -0
- package/dist/components/canvas/CanvasPhoto.d.ts +28 -0
- package/dist/components/canvas/CanvasSection.d.ts +27 -0
- package/dist/components/canvas/CanvasSubsection.d.ts +23 -0
- package/dist/components/canvas/CanvasText.d.ts +23 -0
- package/dist/components/canvas/DocumentCanvas.d.ts +20 -0
- package/dist/components/canvas/HeroPhoto.d.ts +17 -0
- package/dist/components/canvas/NodeCanvas.d.ts +2 -0
- package/dist/components/canvas/index.d.ts +17 -0
- package/dist/components/chart/BarChart.d.ts +23 -0
- package/dist/components/chart/ChartCard.d.ts +33 -0
- package/dist/components/chart/ChartConfigDrawer.d.ts +16 -0
- package/dist/components/chart/ChartGhostWireframe.d.ts +16 -0
- package/dist/components/chart/ChartLegend.d.ts +14 -0
- package/dist/components/chart/ChartRouter.d.ts +8 -0
- package/dist/components/chart/ChartSortingControls.d.ts +15 -0
- package/dist/components/chart/ChartTableModal.d.ts +26 -0
- package/dist/components/chart/ChartTooltip.d.ts +12 -0
- package/dist/components/chart/DataPendingCard.d.ts +28 -0
- package/dist/components/chart/DonutChart.d.ts +16 -0
- package/dist/components/chart/HistogramChart.d.ts +23 -0
- package/dist/components/chart/LineChart.d.ts +22 -0
- package/dist/components/chart/RangePreviewMatrix.d.ts +19 -0
- package/dist/components/chart/ScatterPlot.d.ts +21 -0
- package/dist/components/chart/drawer/controls/BarVisualControls.d.ts +9 -0
- package/dist/components/chart/drawer/controls/ChartTitlesSection.d.ts +15 -0
- package/dist/components/chart/drawer/controls/DonutVisualControls.d.ts +7 -0
- package/dist/components/chart/drawer/controls/HistogramVisualControls.d.ts +13 -0
- package/dist/components/chart/drawer/controls/LineVisualControls.d.ts +14 -0
- package/dist/components/chart/drawer/controls/ScatterDataControls.d.ts +17 -0
- package/dist/components/chart/drawer/controls/ScatterVisualControls.d.ts +23 -0
- package/dist/components/chart/drawer/controls/SortingAndOrderControls.d.ts +18 -0
- package/dist/components/chart/drawer/controls/StandardDataControls.d.ts +31 -0
- package/dist/components/chart/drawer/hooks/useChartConfigForm.d.ts +156 -0
- package/dist/components/chart/drawer/hooks/useLiveMatrixSync.d.ts +21 -0
- package/dist/components/chart/drawer/hooks/useSheetVerification.d.ts +26 -0
- package/dist/components/chart/drawer/index.d.ts +17 -0
- package/dist/components/chart/drawer/panels/Step1Source.d.ts +18 -0
- package/dist/components/chart/drawer/panels/Step1SourceRange.d.ts +32 -0
- package/dist/components/chart/drawer/panels/Step2DataRange.d.ts +15 -0
- package/dist/components/chart/drawer/panels/Step3ChartSetup.d.ts +17 -0
- package/dist/components/chart/drawer/panels/Step4Review.d.ts +11 -0
- package/dist/components/chart/index.d.ts +22 -0
- package/dist/components/dev/DevActionAffordance.d.ts +4 -0
- package/dist/components/dev/DevExitConfirmModal.d.ts +14 -0
- package/dist/components/dev/DevLockBlockedModal.d.ts +3 -0
- package/dist/components/dev/DevModeBadge.d.ts +3 -0
- package/dist/components/dev/DevPinModal.d.ts +3 -0
- package/dist/components/dev/DevPublishModal.d.ts +9 -0
- package/dist/components/dev/UniversalEditModal.d.ts +40 -0
- package/dist/components/dev/index.d.ts +8 -0
- package/dist/components/feedback/EmptyState.d.ts +13 -0
- package/dist/components/feedback/PageNotFound.d.ts +15 -0
- package/dist/components/feedback/Toast.d.ts +25 -0
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/history/HistoryHubModal.d.ts +44 -0
- package/dist/components/history/index.d.ts +1 -0
- package/dist/components/layout/AppFooter.d.ts +10 -0
- package/dist/components/layout/AppHeader.d.ts +22 -0
- package/dist/components/layout/EditorialSection.d.ts +27 -0
- package/dist/components/layout/EditorialSidebar.d.ts +34 -0
- package/dist/components/layout/HeroSection.d.ts +2 -0
- package/dist/components/layout/HeroWelcome.d.ts +11 -0
- package/dist/components/layout/SearchField.d.ts +9 -0
- package/dist/components/layout/StatusPill.d.ts +2 -0
- package/dist/components/layout/index.d.ts +8 -0
- package/dist/components/roadmap/RoadmapNode.d.ts +30 -0
- package/dist/components/roadmap/RoadmapSection.d.ts +27 -0
- package/dist/components/roadmap/RoadmapTrack.d.ts +25 -0
- package/dist/components/roadmap/serpentine-generator.d.ts +60 -0
- package/dist/components/roadmap/use-roadmap-scroll.d.ts +19 -0
- package/dist/components/source/EditPhotoModal.d.ts +22 -0
- package/dist/components/source/LightboxPhotoStrip.d.ts +23 -0
- package/dist/components/source/LinkFolderModal.d.ts +24 -0
- package/dist/components/source/SourceCard.d.ts +31 -0
- package/dist/components/source/SourceFolderAttachment.d.ts +25 -0
- package/dist/components/source/SourceGallery.d.ts +26 -0
- package/dist/components/source/SourceImage.d.ts +26 -0
- package/dist/components/source/SourceLightbox.d.ts +28 -0
- package/dist/components/source/index.d.ts +9 -0
- package/dist/components/ui/AccordionSection.d.ts +21 -0
- package/dist/components/ui/Breadcrumb.d.ts +29 -0
- package/dist/components/ui/Button.d.ts +31 -0
- package/dist/components/ui/ColumnSelect.d.ts +17 -0
- package/dist/components/ui/ColumnTypeBadge.d.ts +6 -0
- package/dist/components/ui/DevHelpTooltip.d.ts +11 -0
- package/dist/components/ui/DraggableRows.d.ts +21 -0
- package/dist/components/ui/Drawer.d.ts +50 -0
- package/dist/components/ui/DrawerTier.d.ts +8 -0
- package/dist/components/ui/EditableText.d.ts +48 -0
- package/dist/components/ui/FAB.d.ts +24 -0
- package/dist/components/ui/Modal.d.ts +24 -0
- package/dist/components/ui/PageTitle.d.ts +33 -0
- package/dist/components/ui/ParametricShape.d.ts +57 -0
- package/dist/components/ui/RevolvingButton.d.ts +5 -0
- package/dist/components/ui/SectionTitle.d.ts +42 -0
- package/dist/components/ui/SeriesSelectToolbar.d.ts +10 -0
- package/dist/components/ui/StatusPill.d.ts +21 -0
- package/dist/components/ui/TieredSlider.d.ts +19 -0
- package/dist/components/ui/Toast.d.ts +1 -0
- package/dist/components/ui/ValueLabelToggle.d.ts +10 -0
- package/dist/components/ui/index.d.ts +21 -0
- package/dist/config/engine.config.d.ts +162 -0
- package/dist/context/DeveloperModeContext.d.ts +11 -0
- package/dist/context/UndoRedoContext.d.ts +20 -0
- package/dist/diagnostics/verifyEngineSetup.d.ts +30 -0
- package/dist/diagnostics-CpGr1hhi.js +126 -0
- package/dist/diagnostics-Dw5PzR78.cjs +5 -0
- package/dist/diagnostics.cjs +1 -0
- package/dist/diagnostics.d.ts +10 -0
- package/dist/diagnostics.js +14 -0
- package/dist/edge-1WCVZ0J7.cjs +1 -0
- package/dist/edge-CSjifIhA.js +2709 -0
- package/dist/edge-Dr41JdrQ.cjs +34 -0
- package/dist/edge-h_ge9f1E.js +512 -0
- package/dist/edge.cjs +1 -0
- package/dist/edge.d.ts +10 -0
- package/dist/edge.js +26 -0
- package/dist/folio.cjs +9 -0
- package/dist/folio.js +21895 -0
- package/dist/hooks/use-auto-toc.d.ts +31 -0
- package/dist/hooks/use-discrete-step-navigation.d.ts +26 -0
- package/dist/hooks/use-dynamic-section-numbers.d.ts +30 -0
- package/dist/hooks/use-hash-route.d.ts +36 -0
- package/dist/hooks/use-scroll.d.ts +22 -0
- package/dist/hooks/use-scrollspy.d.ts +19 -0
- package/dist/hooks/useChartTooltip.d.ts +25 -0
- package/dist/hooks/useContent.d.ts +36 -0
- package/dist/hooks/useDeveloperMode.d.ts +1 -0
- package/dist/hooks/useDocumentCanvas.d.ts +53 -0
- package/dist/hooks/useDrivePhotoSync.d.ts +15 -0
- package/dist/hooks/useImageLoader.d.ts +12 -0
- package/dist/hooks/useLightboxHistory.d.ts +14 -0
- package/dist/hooks/useNodeCanvas.d.ts +2 -0
- package/dist/hooks/useSheetChartData.d.ts +31 -0
- package/dist/hooks/useSourcePoint.d.ts +35 -0
- package/dist/hooks/useSwipeGesture.d.ts +30 -0
- package/dist/hooks/useUndoRedo.d.ts +9 -0
- package/dist/hooks/useUnsavedChangesPrompt.d.ts +18 -0
- package/dist/index.d.ts +53 -0
- package/dist/main.d.ts +1 -0
- package/dist/services/canvasLayoutService.d.ts +158 -0
- package/dist/services/chartSourceService.d.ts +128 -0
- package/dist/services/devLockService.d.ts +76 -0
- package/dist/services/draftService.d.ts +129 -0
- package/dist/services/drivePhotoSyncService.d.ts +60 -0
- package/dist/services/driveVerificationService.d.ts +41 -0
- package/dist/services/edgePreBakeService.d.ts +81 -0
- package/dist/services/historyService.d.ts +215 -0
- package/dist/services/historyStorage.d.ts +17 -0
- package/dist/services/mediaService.d.ts +25 -0
- package/dist/services/sheetsDataService.d.ts +59 -0
- package/dist/services/sheetsVerificationService.d.ts +87 -0
- package/dist/services/sourceService.d.ts +43 -0
- package/dist/services/undoRedoService.d.ts +63 -0
- package/dist/services/unsavedChangesService.d.ts +32 -0
- package/dist/style.css +1 -0
- package/dist/types/canvas.d.ts +115 -0
- package/dist/types/chart.d.ts +117 -0
- package/dist/types/developer.d.ts +144 -0
- package/dist/types/draft.d.ts +21 -0
- package/dist/types/edge.d.ts +232 -0
- package/dist/types/history.d.ts +81 -0
- package/dist/types/media.d.ts +16 -0
- package/dist/types/navigation.d.ts +19 -0
- package/dist/types/node.d.ts +51 -0
- package/dist/types/source.d.ts +88 -0
- package/dist/utils/canvasDefaults.d.ts +43 -0
- package/dist/utils/chartColors.d.ts +48 -0
- package/dist/utils/chartDimensions.d.ts +50 -0
- package/dist/utils/chartMath.d.ts +142 -0
- package/dist/utils/chartSanitizer.d.ts +84 -0
- package/dist/utils/contentDb.d.ts +86 -0
- package/dist/utils/devSecurity.d.ts +84 -0
- package/dist/utils/mediaUrl.d.ts +32 -0
- package/dist/utils/modalActions.d.ts +32 -0
- package/dist/utils/node-sections.d.ts +15 -0
- package/dist/utils/page-sections.d.ts +1 -0
- package/dist/utils/runtime-env.d.ts +21 -0
- package/dist/utils/scrollLock.d.ts +10 -0
- package/dist/utils/smooth-scroll.d.ts +24 -0
- package/dist/utils/source.d.ts +25 -0
- package/dist/utils/storage.d.ts +13 -0
- package/dist/utils/supabase-config.d.ts +29 -0
- package/dist/utils/supabase-write-guard.d.ts +15 -0
- package/package.json +68 -4
- package/README.md +0 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { NodeItem } from "../types/node";
|
|
3
|
+
export declare const EngineBrandingConfigSchema: z.ZodObject<{
|
|
4
|
+
appName: z.ZodString;
|
|
5
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
6
|
+
logoText: z.ZodOptional<z.ZodString>;
|
|
7
|
+
markSides: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
markWaviness: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
heroKicker: z.ZodOptional<z.ZodString>;
|
|
10
|
+
heroTitle: z.ZodOptional<z.ZodString>;
|
|
11
|
+
heroSubtitle: z.ZodOptional<z.ZodString>;
|
|
12
|
+
orgName: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
appName: string;
|
|
15
|
+
tagline?: string | undefined;
|
|
16
|
+
logoText?: string | undefined;
|
|
17
|
+
markSides?: number | undefined;
|
|
18
|
+
markWaviness?: number | undefined;
|
|
19
|
+
heroKicker?: string | undefined;
|
|
20
|
+
heroTitle?: string | undefined;
|
|
21
|
+
heroSubtitle?: string | undefined;
|
|
22
|
+
orgName?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
appName: string;
|
|
25
|
+
tagline?: string | undefined;
|
|
26
|
+
logoText?: string | undefined;
|
|
27
|
+
markSides?: number | undefined;
|
|
28
|
+
markWaviness?: number | undefined;
|
|
29
|
+
heroKicker?: string | undefined;
|
|
30
|
+
heroTitle?: string | undefined;
|
|
31
|
+
heroSubtitle?: string | undefined;
|
|
32
|
+
orgName?: string | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const EngineConfigSchema: z.ZodObject<{
|
|
35
|
+
appId: z.ZodString;
|
|
36
|
+
appNamespace: z.ZodString;
|
|
37
|
+
basePath: z.ZodOptional<z.ZodString>;
|
|
38
|
+
nodes: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
39
|
+
branding: z.ZodObject<{
|
|
40
|
+
appName: z.ZodString;
|
|
41
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
42
|
+
logoText: z.ZodOptional<z.ZodString>;
|
|
43
|
+
markSides: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
markWaviness: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
heroKicker: z.ZodOptional<z.ZodString>;
|
|
46
|
+
heroTitle: z.ZodOptional<z.ZodString>;
|
|
47
|
+
heroSubtitle: z.ZodOptional<z.ZodString>;
|
|
48
|
+
orgName: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
appName: string;
|
|
51
|
+
tagline?: string | undefined;
|
|
52
|
+
logoText?: string | undefined;
|
|
53
|
+
markSides?: number | undefined;
|
|
54
|
+
markWaviness?: number | undefined;
|
|
55
|
+
heroKicker?: string | undefined;
|
|
56
|
+
heroTitle?: string | undefined;
|
|
57
|
+
heroSubtitle?: string | undefined;
|
|
58
|
+
orgName?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
appName: string;
|
|
61
|
+
tagline?: string | undefined;
|
|
62
|
+
logoText?: string | undefined;
|
|
63
|
+
markSides?: number | undefined;
|
|
64
|
+
markWaviness?: number | undefined;
|
|
65
|
+
heroKicker?: string | undefined;
|
|
66
|
+
heroTitle?: string | undefined;
|
|
67
|
+
heroSubtitle?: string | undefined;
|
|
68
|
+
orgName?: string | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
securitySalt: z.ZodOptional<z.ZodString>;
|
|
71
|
+
expectedPinHash: z.ZodOptional<z.ZodString>;
|
|
72
|
+
features: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
enableChartDrawer: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
enableEditorMode: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
enableHistoryLedger: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
enableChartDrawer?: boolean | undefined;
|
|
78
|
+
enableEditorMode?: boolean | undefined;
|
|
79
|
+
enableHistoryLedger?: boolean | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
enableChartDrawer?: boolean | undefined;
|
|
82
|
+
enableEditorMode?: boolean | undefined;
|
|
83
|
+
enableHistoryLedger?: boolean | undefined;
|
|
84
|
+
}>>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
appId: string;
|
|
87
|
+
appNamespace: string;
|
|
88
|
+
nodes: any[];
|
|
89
|
+
branding: {
|
|
90
|
+
appName: string;
|
|
91
|
+
tagline?: string | undefined;
|
|
92
|
+
logoText?: string | undefined;
|
|
93
|
+
markSides?: number | undefined;
|
|
94
|
+
markWaviness?: number | undefined;
|
|
95
|
+
heroKicker?: string | undefined;
|
|
96
|
+
heroTitle?: string | undefined;
|
|
97
|
+
heroSubtitle?: string | undefined;
|
|
98
|
+
orgName?: string | undefined;
|
|
99
|
+
};
|
|
100
|
+
basePath?: string | undefined;
|
|
101
|
+
securitySalt?: string | undefined;
|
|
102
|
+
expectedPinHash?: string | undefined;
|
|
103
|
+
features?: {
|
|
104
|
+
enableChartDrawer?: boolean | undefined;
|
|
105
|
+
enableEditorMode?: boolean | undefined;
|
|
106
|
+
enableHistoryLedger?: boolean | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
appId: string;
|
|
110
|
+
appNamespace: string;
|
|
111
|
+
branding: {
|
|
112
|
+
appName: string;
|
|
113
|
+
tagline?: string | undefined;
|
|
114
|
+
logoText?: string | undefined;
|
|
115
|
+
markSides?: number | undefined;
|
|
116
|
+
markWaviness?: number | undefined;
|
|
117
|
+
heroKicker?: string | undefined;
|
|
118
|
+
heroTitle?: string | undefined;
|
|
119
|
+
heroSubtitle?: string | undefined;
|
|
120
|
+
orgName?: string | undefined;
|
|
121
|
+
};
|
|
122
|
+
basePath?: string | undefined;
|
|
123
|
+
nodes?: any[] | undefined;
|
|
124
|
+
securitySalt?: string | undefined;
|
|
125
|
+
expectedPinHash?: string | undefined;
|
|
126
|
+
features?: {
|
|
127
|
+
enableChartDrawer?: boolean | undefined;
|
|
128
|
+
enableEditorMode?: boolean | undefined;
|
|
129
|
+
enableHistoryLedger?: boolean | undefined;
|
|
130
|
+
} | undefined;
|
|
131
|
+
}>;
|
|
132
|
+
export interface EngineBrandingConfig {
|
|
133
|
+
appName: string;
|
|
134
|
+
tagline?: string;
|
|
135
|
+
logoText?: string;
|
|
136
|
+
markSides?: number;
|
|
137
|
+
markWaviness?: number;
|
|
138
|
+
heroKicker?: string;
|
|
139
|
+
heroTitle?: string;
|
|
140
|
+
heroSubtitle?: string;
|
|
141
|
+
orgName?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface EngineConfig {
|
|
144
|
+
appId: string;
|
|
145
|
+
appNamespace: string;
|
|
146
|
+
basePath?: string;
|
|
147
|
+
nodes: NodeItem[];
|
|
148
|
+
branding: EngineBrandingConfig;
|
|
149
|
+
securitySalt?: string;
|
|
150
|
+
expectedPinHash?: string;
|
|
151
|
+
features?: {
|
|
152
|
+
enableChartDrawer?: boolean;
|
|
153
|
+
enableEditorMode?: boolean;
|
|
154
|
+
enableHistoryLedger?: boolean;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export declare function createDefaultEngineConfig(overrides?: Partial<EngineConfig>): EngineConfig;
|
|
158
|
+
export declare function getEngineConfig(): EngineConfig;
|
|
159
|
+
export declare function setEngineConfig(config: Partial<EngineConfig>): EngineConfig;
|
|
160
|
+
export declare function resetEngineConfig(): void;
|
|
161
|
+
export declare function getStorageNamespace(): string;
|
|
162
|
+
export declare function getStorageKey(key: string, namespace?: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DeveloperModeContextType } from '../types/developer';
|
|
3
|
+
declare const DeveloperModeContext: React.Context<DeveloperModeContextType | null>;
|
|
4
|
+
export interface DeveloperModeProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
securitySalt?: string;
|
|
7
|
+
expectedPinHash?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const DeveloperModeProvider: React.FC<DeveloperModeProviderProps>;
|
|
10
|
+
export declare const useDeveloperMode: () => DeveloperModeContextType;
|
|
11
|
+
export default DeveloperModeContext;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Folio Engine - Active Session Undo / Redo Context
|
|
3
|
+
* Location: src/context/UndoRedoContext.tsx
|
|
4
|
+
* Specification: docs/tasks/task9_2_active_session_undo_redo_engine.md
|
|
5
|
+
* Aligned with: docs/00_WORKFLOW.md, docs/03_ARCHITECTURE.md, docs/07_CODING_STANDARDS.md
|
|
6
|
+
*
|
|
7
|
+
* Implements:
|
|
8
|
+
* 1. Global UndoRedoProvider wrapping the application.
|
|
9
|
+
* 2. React 19 startTransition to guarantee non-blocking layout reconciliations (rerender-transitions).
|
|
10
|
+
* 3. Unified keyboard shortcut handling (Cmd+Z / Ctrl+Z / Cmd+Shift+Z / Ctrl+Shift+Z / Ctrl+Y).
|
|
11
|
+
* 4. Resilient input focus guards (isTextInput) to prevent shortcut collisions with native inputs.
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import type { UndoRedoContextType } from '../types/history';
|
|
15
|
+
export declare const UndoRedoContext: React.Context<UndoRedoContextType | null>;
|
|
16
|
+
export interface UndoRedoProviderProps {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare const UndoRedoProvider: React.FC<UndoRedoProviderProps>;
|
|
20
|
+
export default UndoRedoProvider;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Folio Engine - Diagnostic Verification Suite & Self-Audit Tooling
|
|
3
|
+
* Location: src/diagnostics/verifyEngineSetup.ts
|
|
4
|
+
*
|
|
5
|
+
* Implements automated validation of engine wiring, config contracts,
|
|
6
|
+
* and data payload schemas (Canvas AST, Vector Charts, Edge KV payloads).
|
|
7
|
+
*/
|
|
8
|
+
import { type EngineConfig } from '../config/engine.config';
|
|
9
|
+
export interface DiagnosticResult {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
errors: string[];
|
|
12
|
+
warnings: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Validates that an Edge KV node payload adheres to contracts:
|
|
16
|
+
* 1. Schema conformance (Zod).
|
|
17
|
+
* 2. Referential integrity: Every chart element in the canvas AST must exist in chartDatasets.
|
|
18
|
+
* 3. Structural uniqueness: No duplicated element IDs.
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateNodePayload(payload: unknown): DiagnosticResult;
|
|
21
|
+
/**
|
|
22
|
+
* Verifies that host DOM and styling prerequisites are properly loaded:
|
|
23
|
+
* 1. Checks that engine CSS tokens (e.g. --canvas-bg) are computed.
|
|
24
|
+
* 2. Validates active EngineConfig against EngineConfigSchema.
|
|
25
|
+
*/
|
|
26
|
+
export declare function verifyEngineWiring(customConfig?: Partial<EngineConfig>): DiagnosticResult;
|
|
27
|
+
/**
|
|
28
|
+
* Runs a complete diagnostic self-check and prints a clean, formatted report.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runEngineSelfAudit(): boolean;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { o as m, s as t, n as y, b as g, a as b, c as T, P as v } from "./edge-CSjifIhA.js";
|
|
2
|
+
const w = m({
|
|
3
|
+
appName: t().min(1, "appName is required"),
|
|
4
|
+
tagline: t().optional(),
|
|
5
|
+
logoText: t().optional(),
|
|
6
|
+
markSides: y().int().min(3).max(32).optional(),
|
|
7
|
+
markWaviness: y().min(0).max(1).optional(),
|
|
8
|
+
heroKicker: t().optional(),
|
|
9
|
+
heroTitle: t().optional(),
|
|
10
|
+
heroSubtitle: t().optional(),
|
|
11
|
+
orgName: t().optional()
|
|
12
|
+
}), $ = m({
|
|
13
|
+
appId: t().min(1, "appId is required"),
|
|
14
|
+
appNamespace: t().min(1, "appNamespace is required"),
|
|
15
|
+
basePath: t().optional(),
|
|
16
|
+
nodes: b(T()).default([]),
|
|
17
|
+
branding: w,
|
|
18
|
+
securitySalt: t().optional(),
|
|
19
|
+
expectedPinHash: t().optional(),
|
|
20
|
+
features: m({
|
|
21
|
+
enableChartDrawer: g().optional(),
|
|
22
|
+
enableEditorMode: g().optional(),
|
|
23
|
+
enableHistoryLedger: g().optional()
|
|
24
|
+
}).optional()
|
|
25
|
+
});
|
|
26
|
+
function h(n) {
|
|
27
|
+
return {
|
|
28
|
+
appId: "default-app",
|
|
29
|
+
appNamespace: "folio",
|
|
30
|
+
branding: {
|
|
31
|
+
appName: "Folio Engine",
|
|
32
|
+
tagline: "Parametric Stepped Sequence & Document AST Platform",
|
|
33
|
+
logoText: "FOLIO",
|
|
34
|
+
markSides: 8,
|
|
35
|
+
markWaviness: 0.15
|
|
36
|
+
},
|
|
37
|
+
nodes: [],
|
|
38
|
+
securitySalt: void 0,
|
|
39
|
+
expectedPinHash: void 0,
|
|
40
|
+
features: {
|
|
41
|
+
enableChartDrawer: !0,
|
|
42
|
+
enableEditorMode: !0,
|
|
43
|
+
enableHistoryLedger: !0
|
|
44
|
+
},
|
|
45
|
+
...n
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
let c = h();
|
|
49
|
+
function S() {
|
|
50
|
+
return c;
|
|
51
|
+
}
|
|
52
|
+
function k(n) {
|
|
53
|
+
return c = h({ ...c, ...n }), c;
|
|
54
|
+
}
|
|
55
|
+
function N() {
|
|
56
|
+
c = h();
|
|
57
|
+
}
|
|
58
|
+
function A() {
|
|
59
|
+
return c.appNamespace || "folio";
|
|
60
|
+
}
|
|
61
|
+
function D(n, i) {
|
|
62
|
+
return (i || A()) + "_" + n;
|
|
63
|
+
}
|
|
64
|
+
function I(n) {
|
|
65
|
+
const i = [], a = [], l = v.safeParse(n);
|
|
66
|
+
if (!l.success)
|
|
67
|
+
return l.error.issues.forEach((e) => {
|
|
68
|
+
i.push(`[Schema] ${e.path.join(".")}: ${e.message}`);
|
|
69
|
+
}), { ok: !1, errors: i, warnings: a };
|
|
70
|
+
const s = l.data, r = s.chartDatasets || {}, o = /* @__PURE__ */ new Set();
|
|
71
|
+
function f(e, p) {
|
|
72
|
+
e.id ? o.has(e.id) ? i.push(`[AST] Duplicate element id detected: "${e.id}".`) : o.add(e.id) : i.push(`[AST] Element in "${p}" is missing an 'id'.`), e.type === "chart" && (e.chartId ? r[e.chartId] || a.push(
|
|
73
|
+
`[Chart] Chart "${e.chartId}" is referenced in canvas section "${p}" but not found in chartDatasets.`
|
|
74
|
+
) : i.push(`[Chart] Chart element "${e.id}" is missing 'chartId'.`));
|
|
75
|
+
}
|
|
76
|
+
return s.canvas && Array.isArray(s.canvas.sections) && s.canvas.sections.forEach((e, p) => {
|
|
77
|
+
e.id ? o.has(e.id) ? i.push(`[AST] Duplicate section id detected: "${e.id}".`) : o.add(e.id) : i.push(`[AST] Section at index ${p} is missing an 'id'.`), (!e.title || e.title.trim().length === 0) && a.push(`[AST] Section "${e.id || p}" has an empty title.`), Array.isArray(e.elements) && e.elements.forEach((u) => {
|
|
78
|
+
if (u.type === "subsection") {
|
|
79
|
+
const d = u;
|
|
80
|
+
d.id ? o.has(d.id) ? i.push(`[AST] Duplicate subsection id detected: "${d.id}".`) : o.add(d.id) : i.push(`[AST] Subsection in "${e.title || e.id}" is missing an 'id'.`), Array.isArray(d.elements) && d.elements.forEach((E) => f(E, `${e.title} > ${d.title}`));
|
|
81
|
+
} else
|
|
82
|
+
f(u, e.title);
|
|
83
|
+
});
|
|
84
|
+
}), {
|
|
85
|
+
ok: i.length === 0,
|
|
86
|
+
errors: i,
|
|
87
|
+
warnings: a
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function C(n) {
|
|
91
|
+
const i = [], a = [], l = n ? { ...S(), ...n } : S(), s = $.safeParse(l);
|
|
92
|
+
if (s.success || s.error.issues.forEach((r) => {
|
|
93
|
+
i.push(`[Config] ${r.path.join(".")}: ${r.message}`);
|
|
94
|
+
}), typeof window < "u" && typeof document < "u") {
|
|
95
|
+
const r = window.getComputedStyle(document.documentElement), o = r.getPropertyValue("--canvas-bg").trim(), f = r.getPropertyValue("--font-mono").trim();
|
|
96
|
+
!o && !f && a.push(
|
|
97
|
+
"[Styles] Folio Engine stylesheet not detected! Ensure you import '@devcabs/folio-engine/style.css' in your main entry point."
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
ok: i.length === 0,
|
|
102
|
+
errors: i,
|
|
103
|
+
warnings: a
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function x() {
|
|
107
|
+
const n = C();
|
|
108
|
+
return typeof console < "u" && (n.ok || console.error(`❌ [Folio Engine] Wiring verification failed:
|
|
109
|
+
` + n.errors.join(`
|
|
110
|
+
`)), n.warnings.length > 0 && console.warn(`⚠️ [Folio Engine] Wiring warnings:
|
|
111
|
+
` + n.warnings.join(`
|
|
112
|
+
`)), n.ok && n.warnings.length === 0 && console.log("✅ [Folio Engine] Configuration and stylesheet wiring verified successfully.")), n.ok;
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
w as E,
|
|
116
|
+
S as a,
|
|
117
|
+
D as b,
|
|
118
|
+
$ as c,
|
|
119
|
+
h as d,
|
|
120
|
+
x as e,
|
|
121
|
+
C as f,
|
|
122
|
+
A as g,
|
|
123
|
+
N as r,
|
|
124
|
+
k as s,
|
|
125
|
+
I as v
|
|
126
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";const n=require("./edge-1WCVZ0J7.cjs"),m=n.objectType({appName:n.stringType().min(1,"appName is required"),tagline:n.stringType().optional(),logoText:n.stringType().optional(),markSides:n.numberType().int().min(3).max(32).optional(),markWaviness:n.numberType().min(0).max(1).optional(),heroKicker:n.stringType().optional(),heroTitle:n.stringType().optional(),heroSubtitle:n.stringType().optional(),orgName:n.stringType().optional()}),h=n.objectType({appId:n.stringType().min(1,"appId is required"),appNamespace:n.stringType().min(1,"appNamespace is required"),basePath:n.stringType().optional(),nodes:n.arrayType(n.anyType()).default([]),branding:m,securitySalt:n.stringType().optional(),expectedPinHash:n.stringType().optional(),features:n.objectType({enableChartDrawer:n.booleanType().optional(),enableEditorMode:n.booleanType().optional(),enableHistoryLedger:n.booleanType().optional()}).optional()});function f(i){return{appId:"default-app",appNamespace:"folio",branding:{appName:"Folio Engine",tagline:"Parametric Stepped Sequence & Document AST Platform",logoText:"FOLIO",markSides:8,markWaviness:.15},nodes:[],securitySalt:void 0,expectedPinHash:void 0,features:{enableChartDrawer:!0,enableEditorMode:!0,enableHistoryLedger:!0},...i}}let d=f();function y(){return d}function b(i){return d=f({...d,...i}),d}function C(){d=f()}function T(){return d.appNamespace||"folio"}function v(i,t){return(t||T())+"_"+i}function w(i){const t=[],o=[],p=n.PublicNodePayloadSchema.safeParse(i);if(!p.success)return p.error.issues.forEach(e=>{t.push(`[Schema] ${e.path.join(".")}: ${e.message}`)}),{ok:!1,errors:t,warnings:o};const r=p.data,s=r.chartDatasets||{},a=new Set;function l(e,c){e.id?a.has(e.id)?t.push(`[AST] Duplicate element id detected: "${e.id}".`):a.add(e.id):t.push(`[AST] Element in "${c}" is missing an 'id'.`),e.type==="chart"&&(e.chartId?s[e.chartId]||o.push(`[Chart] Chart "${e.chartId}" is referenced in canvas section "${c}" but not found in chartDatasets.`):t.push(`[Chart] Chart element "${e.id}" is missing 'chartId'.`))}return r.canvas&&Array.isArray(r.canvas.sections)&&r.canvas.sections.forEach((e,c)=>{e.id?a.has(e.id)?t.push(`[AST] Duplicate section id detected: "${e.id}".`):a.add(e.id):t.push(`[AST] Section at index ${c} is missing an 'id'.`),(!e.title||e.title.trim().length===0)&&o.push(`[AST] Section "${e.id||c}" has an empty title.`),Array.isArray(e.elements)&&e.elements.forEach(u=>{if(u.type==="subsection"){const g=u;g.id?a.has(g.id)?t.push(`[AST] Duplicate subsection id detected: "${g.id}".`):a.add(g.id):t.push(`[AST] Subsection in "${e.title||e.id}" is missing an 'id'.`),Array.isArray(g.elements)&&g.elements.forEach(S=>l(S,`${e.title} > ${g.title}`))}else l(u,e.title)})}),{ok:t.length===0,errors:t,warnings:o}}function E(i){const t=[],o=[],p=i?{...y(),...i}:y(),r=h.safeParse(p);if(r.success||r.error.issues.forEach(s=>{t.push(`[Config] ${s.path.join(".")}: ${s.message}`)}),typeof window<"u"&&typeof document<"u"){const s=window.getComputedStyle(document.documentElement),a=s.getPropertyValue("--canvas-bg").trim(),l=s.getPropertyValue("--font-mono").trim();!a&&!l&&o.push("[Styles] Folio Engine stylesheet not detected! Ensure you import '@devcabs/folio-engine/style.css' in your main entry point.")}return{ok:t.length===0,errors:t,warnings:o}}function A(){const i=E();return typeof console<"u"&&(i.ok||console.error(`❌ [Folio Engine] Wiring verification failed:
|
|
2
|
+
`+i.errors.join(`
|
|
3
|
+
`)),i.warnings.length>0&&console.warn(`⚠️ [Folio Engine] Wiring warnings:
|
|
4
|
+
`+i.warnings.join(`
|
|
5
|
+
`)),i.ok&&i.warnings.length===0&&console.log("✅ [Folio Engine] Configuration and stylesheet wiring verified successfully.")),i.ok}exports.EngineBrandingConfigSchema=m;exports.EngineConfigSchema=h;exports.createDefaultEngineConfig=f;exports.getEngineConfig=y;exports.getStorageKey=v;exports.getStorageNamespace=T;exports.resetEngineConfig=C;exports.runEngineSelfAudit=A;exports.setEngineConfig=b;exports.validateNodePayload=w;exports.verifyEngineWiring=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./diagnostics-Dw5PzR78.cjs"),a=require("./edge-1WCVZ0J7.cjs");exports.EngineBrandingConfigSchema=e.EngineBrandingConfigSchema;exports.EngineConfigSchema=e.EngineConfigSchema;exports.runEngineSelfAudit=e.runEngineSelfAudit;exports.validateNodePayload=e.validateNodePayload;exports.verifyEngineWiring=e.verifyEngineWiring;exports.CachedIndicatorDatasetSchema=a.CachedIndicatorDatasetSchema;exports.NodeCanvasDocumentSchema=a.NodeCanvasDocumentSchema;exports.PublicNodePayloadSchema=a.PublicNodePayloadSchema;exports.PublicPortalManifestPayloadSchema=a.PublicPortalManifestPayloadSchema;exports.SyncedSourceMetadataSchema=a.SyncedSourceMetadataSchema;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Folio Engine — Diagnostic Verification & Contract Testing Entry Point
|
|
3
|
+
* Location: src/diagnostics.ts
|
|
4
|
+
*
|
|
5
|
+
* Dedicated entry point for build-time verification, CI pre-flight checks,
|
|
6
|
+
* and prebake payload validation.
|
|
7
|
+
*/
|
|
8
|
+
export * from './diagnostics/verifyEngineSetup';
|
|
9
|
+
export { PublicNodePayloadSchema, PublicPortalManifestPayloadSchema, NodeCanvasDocumentSchema, CachedIndicatorDatasetSchema, SyncedSourceMetadataSchema, } from './types/edge';
|
|
10
|
+
export { EngineConfigSchema, EngineBrandingConfigSchema, } from './config/engine.config';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { E as n, c as i, e as o, v as c, f as d } from "./diagnostics-CpGr1hhi.js";
|
|
2
|
+
import { C as t, N as r, P as S, d as m, S as f } from "./edge-CSjifIhA.js";
|
|
3
|
+
export {
|
|
4
|
+
t as CachedIndicatorDatasetSchema,
|
|
5
|
+
n as EngineBrandingConfigSchema,
|
|
6
|
+
i as EngineConfigSchema,
|
|
7
|
+
r as NodeCanvasDocumentSchema,
|
|
8
|
+
S as PublicNodePayloadSchema,
|
|
9
|
+
m as PublicPortalManifestPayloadSchema,
|
|
10
|
+
f as SyncedSourceMetadataSchema,
|
|
11
|
+
o as runEngineSelfAudit,
|
|
12
|
+
c as validateNodePayload,
|
|
13
|
+
d as verifyEngineWiring
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g;(function(s){s.assertEqual=a=>{};function e(a){}s.assertIs=e;function t(a){throw new Error}s.assertNever=t,s.arrayToEnum=a=>{const n={};for(const i of a)n[i]=i;return n},s.getValidEnumValues=a=>{const n=s.objectKeys(a).filter(d=>typeof a[a[d]]!="number"),i={};for(const d of n)i[d]=a[d];return s.objectValues(i)},s.objectValues=a=>s.objectKeys(a).map(function(n){return a[n]}),s.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&n.push(i);return n},s.find=(a,n)=>{for(const i of a)if(n(i))return i},s.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,n=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}s.joinValues=r,s.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(g||(g={}));var de;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(de||(de={}));const u=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),A=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},o=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class O extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(n){return n.message},r={_errors:[]},a=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let d=r,h=0;for(;h<i.path.length;){const f=i.path[h];h===i.path.length-1?(d[f]=d[f]||{_errors:[]},d[f]._errors.push(t(i))):d[f]=d[f]||{_errors:[]},d=d[f],h++}}};return a(this),r}static assert(e){if(!(e instanceof O))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,g.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}O.create=s=>new O(s);const K=(s,e)=>{let t;switch(s.code){case o.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case o.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,g.jsonStringifyReplacer)}`;break;case o.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(s.keys,", ")}`;break;case o.invalid_union:t="Invalid input";break;case o.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(s.options)}`;break;case o.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(s.options)}, received '${s.received}'`;break;case o.invalid_arguments:t="Invalid function arguments";break;case o.invalid_return_type:t="Invalid function return type";break;case o.invalid_date:t="Invalid date";break;case o.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:g.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case o.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case o.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case o.custom:t="Invalid input";break;case o.invalid_intersection_types:t="Intersection results could not be merged";break;case o.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case o.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(s)}return{message:t}};let Oe=K;function Ae(){return Oe}const Ne=s=>{const{data:e,path:t,errorMaps:r,issueData:a}=s,n=[...t,...a.path||[]],i={...a,path:n};if(a.message!==void 0)return{...a,path:n,message:a.message};let d="";const h=r.filter(f=>!!f).slice().reverse();for(const f of h)d=f(i,{data:e,defaultError:d}).message;return{...a,path:n,message:d}};function c(s,e){const t=Ae(),r=Ne({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===K?void 0:K].filter(a=>!!a)});s.common.issues.push(r)}class b{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const a of t){if(a.status==="aborted")return p;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const a of t){const n=await a.key,i=await a.value;r.push({key:n,value:i})}return b.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const a of t){const{key:n,value:i}=a;if(n.status==="aborted"||i.status==="aborted")return p;n.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[n.value]=i.value)}return{status:e.value,value:r}}}const p=Object.freeze({status:"aborted"}),D=s=>({status:"dirty",value:s}),w=s=>({status:"valid",value:s}),oe=s=>s.status==="aborted",ce=s=>s.status==="dirty",j=s=>s.status==="valid",q=s=>typeof Promise<"u"&&s instanceof Promise;var l;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(l||(l={}));class S{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ue=(s,e)=>{if(j(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new O(s.common.issues);return this._error=t,this._error}}};function y(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:a}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,d)=>{const{message:h}=s;return i.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:h??r??d.defaultError}:i.code!=="invalid_type"?{message:d.defaultError}:{message:h??t??d.defaultError}},description:a}}class _{get description(){return this._def.description}_getType(e){return A(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(q(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},a=this._parseSync({data:e,path:r.path,parent:r});return ue(r,a)}"~validate"(e){var r,a;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return j(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(a=(r=n==null?void 0:n.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>j(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},a=this._parse({data:e,path:r.path,parent:r}),n=await(q(a)?a:Promise.resolve(a));return ue(r,n)}refine(e,t){const r=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const i=e(a),d=()=>n.addIssue({code:o.custom,...r(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(h=>h?!0:(d(),!1)):i?!0:(d(),!1)})}refinement(e,t){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof t=="function"?t(r,a):t),!1))}_refinement(e){return new V({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return N.create(this,this._def)}nullable(){return M.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return T.create(this)}promise(){return H.create(this,this._def)}or(e){return F.create([this,e],this._def)}and(e){return J.create(this,e,this._def)}transform(e){return new V({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new re({...y(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Xe({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({...y(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ie.create(this,e)}readonly(){return ne.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ze=/^c[^\s-]{8,}$/i,Ie=/^[0-9a-z]+$/,Re=/^[0-9A-HJKMNP-TV-Z]{26}$/i,je=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ee=/^[a-z0-9_-]{21}$/i,$e=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ve=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Me=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let X;const Le=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,De=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ze=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ue=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Be=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,be="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",We=new RegExp(`^${be}$`);function we(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Fe(s){return new RegExp(`^${we(s)}$`)}function Je(s){let e=`${be}T${we(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ye(s,e){return!!((e==="v4"||!e)&&Le.test(s)||(e==="v6"||!e)&&ze.test(s))}function He(s,e){if(!$e.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Ge(s,e){return!!((e==="v4"||!e)&&De.test(s)||(e==="v6"||!e)&&Ue.test(s))}class C extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_type,expected:u.string,received:n.parsedType}),p}const r=new b;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty());else if(n.kind==="length"){const i=e.data.length>n.value,d=e.data.length<n.value;(i||d)&&(a=this._getOrReturnCtx(e,a),i?c(a,{code:o.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):d&&c(a,{code:o.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),r.dirty())}else if(n.kind==="email")Me.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"email",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="emoji")X||(X=new RegExp(Pe,"u")),X.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"emoji",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="uuid")je.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"uuid",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="nanoid")Ee.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"nanoid",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid")Ze.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="cuid2")Ie.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid2",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="ulid")Re.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ulid",code:o.invalid_string,message:n.message}),r.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),c(a,{validation:"url",code:o.invalid_string,message:n.message}),r.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"regex",code:o.invalid_string,message:n.message}),r.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()):n.kind==="datetime"?Je(n).test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:"datetime",message:n.message}),r.dirty()):n.kind==="date"?We.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:"date",message:n.message}),r.dirty()):n.kind==="time"?Fe(n).test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:o.invalid_string,validation:"time",message:n.message}),r.dirty()):n.kind==="duration"?Ve.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"duration",code:o.invalid_string,message:n.message}),r.dirty()):n.kind==="ip"?Ye(e.data,n.version)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ip",code:o.invalid_string,message:n.message}),r.dirty()):n.kind==="jwt"?He(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"jwt",code:o.invalid_string,message:n.message}),r.dirty()):n.kind==="cidr"?Ge(e.data,n.version)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cidr",code:o.invalid_string,message:n.message}),r.dirty()):n.kind==="base64"?Be.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"base64",code:o.invalid_string,message:n.message}),r.dirty()):n.kind==="base64url"?qe.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"base64url",code:o.invalid_string,message:n.message}),r.dirty()):g.assertNever(n);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(a=>e.test(a),{validation:t,code:o.invalid_string,...l.errToObj(r)})}_addCheck(e){return new C({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...l.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...l.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new C({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}C.create=s=>new C({checks:[],typeName:m.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});function Qe(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=t>r?t:r,n=Number.parseInt(s.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return n%i/10**a}class E extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_type,expected:u.number,received:n.parsedType}),p}let r;const a=new b;for(const n of this._def.checks)n.kind==="int"?g.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:o.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?Qe(e.data,n.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:o.not_finite,message:n.message}),a.dirty()):g.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,a){return new E({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(a)}]})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}E.create=s=>new E({checks:[],typeName:m.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class z extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const a=new b;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:o.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):g.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:u.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,a){return new z({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(a)}]})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}z.create=s=>new z({checks:[],typeName:m.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...y(s)});class ee extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:o.invalid_type,expected:u.boolean,received:r.parsedType}),p}return w(e.data)}}ee.create=s=>new ee({typeName:m.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...y(s)});class W extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_type,expected:u.date,received:n.parsedType}),p}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:o.invalid_date}),p}const r=new b;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:o.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):g.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}W.create=s=>new W({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:m.ZodDate,...y(s)});class le extends _{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:o.invalid_type,expected:u.symbol,received:r.parsedType}),p}return w(e.data)}}le.create=s=>new le({typeName:m.ZodSymbol,...y(s)});class he extends _{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:o.invalid_type,expected:u.undefined,received:r.parsedType}),p}return w(e.data)}}he.create=s=>new he({typeName:m.ZodUndefined,...y(s)});class fe extends _{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:o.invalid_type,expected:u.null,received:r.parsedType}),p}return w(e.data)}}fe.create=s=>new fe({typeName:m.ZodNull,...y(s)});class te extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}}te.create=s=>new te({typeName:m.ZodAny,...y(s)});class me extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}me.create=s=>new me({typeName:m.ZodUnknown,...y(s)});class Z extends _{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:o.invalid_type,expected:u.never,received:t.parsedType}),p}}Z.create=s=>new Z({typeName:m.ZodNever,...y(s)});class pe extends _{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:o.invalid_type,expected:u.void,received:r.parsedType}),p}return w(e.data)}}pe.create=s=>new pe({typeName:m.ZodVoid,...y(s)});class T extends _{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==u.array)return c(t,{code:o.invalid_type,expected:u.array,received:t.parsedType}),p;if(a.exactLength!==null){const i=t.data.length>a.exactLength.value,d=t.data.length<a.exactLength.value;(i||d)&&(c(t,{code:i?o.too_big:o.too_small,minimum:d?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(c(t,{code:o.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(c(t,{code:o.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,d)=>a.type._parseAsync(new S(t,i,t.path,d)))).then(i=>b.mergeArray(r,i));const n=[...t.data].map((i,d)=>a.type._parseSync(new S(t,i,t.path,d)));return b.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new T({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new T({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new T({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}T.create=(s,e)=>new T({type:s,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function R(s){if(s instanceof k){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=N.create(R(r))}return new k({...s._def,shape:()=>e})}else return s instanceof T?new T({...s._def,type:R(s.element)}):s instanceof N?N.create(R(s.unwrap())):s instanceof M?M.create(R(s.unwrap())):s instanceof I?I.create(s.items.map(e=>R(e))):s}class k extends _{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const f=this._getOrReturnCtx(e);return c(f,{code:o.invalid_type,expected:u.object,received:f.parsedType}),p}const{status:r,ctx:a}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),d=[];if(!(this._def.catchall instanceof Z&&this._def.unknownKeys==="strip"))for(const f in a.data)i.includes(f)||d.push(f);const h=[];for(const f of i){const v=n[f],L=a.data[f];h.push({key:{status:"valid",value:f},value:v._parse(new S(a,L,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Z){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of d)h.push({key:{status:"valid",value:v},value:{status:"valid",value:a.data[v]}});else if(f==="strict")d.length>0&&(c(a,{code:o.unrecognized_keys,keys:d}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of d){const L=a.data[v];h.push({key:{status:"valid",value:v},value:f._parse(new S(a,L,a.path,v)),alwaysSet:v in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of h){const L=await v.key,Ce=await v.value;f.push({key:L,value:Ce,alwaysSet:v.alwaysSet})}return f}).then(f=>b.mergeObjectSync(r,f)):b.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,i;const a=((i=(n=this._def).errorMap)==null?void 0:i.call(n,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const t={};for(const r of g.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new k({...this._def,shape:()=>t})}omit(e){const t={};for(const r of g.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new k({...this._def,shape:()=>t})}deepPartial(){return R(this)}partial(e){const t={};for(const r of g.objectKeys(this.shape)){const a=this.shape[r];e&&!e[r]?t[r]=a:t[r]=a.optional()}return new k({...this._def,shape:()=>t})}required(e){const t={};for(const r of g.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let n=this.shape[r];for(;n instanceof N;)n=n._def.innerType;t[r]=n}return new k({...this._def,shape:()=>t})}keyof(){return Te(g.objectKeys(this.shape))}}k.create=(s,e)=>new k({shape:()=>s,unknownKeys:"strip",catchall:Z.create(),typeName:m.ZodObject,...y(e)});k.strictCreate=(s,e)=>new k({shape:()=>s,unknownKeys:"strict",catchall:Z.create(),typeName:m.ZodObject,...y(e)});k.lazycreate=(s,e)=>new k({shape:s,unknownKeys:"strip",catchall:Z.create(),typeName:m.ZodObject,...y(e)});class F extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function a(n){for(const d of n)if(d.result.status==="valid")return d.result;for(const d of n)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const i=n.map(d=>new O(d.ctx.common.issues));return c(t,{code:o.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(r.map(async n=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(a);{let n;const i=[];for(const h of r){const f={...t,common:{...t.common,issues:[]},parent:null},v=h._parseSync({data:t.data,path:t.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!n&&(n={result:v,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const d=i.map(h=>new O(h));return c(t,{code:o.invalid_union,unionErrors:d}),p}}get options(){return this._def.options}}F.create=(s,e)=>new F({options:s,typeName:m.ZodUnion,...y(e)});function se(s,e){const t=A(s),r=A(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const a=g.objectKeys(e),n=g.objectKeys(s).filter(d=>a.indexOf(d)!==-1),i={...s,...e};for(const d of n){const h=se(s[d],e[d]);if(!h.valid)return{valid:!1};i[d]=h.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const a=[];for(let n=0;n<s.length;n++){const i=s[n],d=e[n],h=se(i,d);if(!h.valid)return{valid:!1};a.push(h.data)}return{valid:!0,data:a}}else return t===u.date&&r===u.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class J extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=(n,i)=>{if(oe(n)||oe(i))return p;const d=se(n.value,i.value);return d.valid?((ce(n)||ce(i))&&t.dirty(),{status:t.value,value:d.data}):(c(r,{code:o.invalid_intersection_types}),p)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,i])=>a(n,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}J.create=(s,e,t)=>new J({left:s,right:e,typeName:m.ZodIntersection,...y(t)});class I extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:o.invalid_type,expected:u.array,received:r.parsedType}),p;if(r.data.length<this._def.items.length)return c(r,{code:o.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&r.data.length>this._def.items.length&&(c(r,{code:o.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((i,d)=>{const h=this._def.items[d]||this._def.rest;return h?h._parse(new S(r,i,r.path,d)):null}).filter(i=>!!i);return r.common.async?Promise.all(n).then(i=>b.mergeArray(t,i)):b.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new I({...this._def,rest:e})}}I.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:s,typeName:m.ZodTuple,rest:null,...y(e)})};class Y extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.object)return c(r,{code:o.invalid_type,expected:u.object,received:r.parsedType}),p;const a=[],n=this._def.keyType,i=this._def.valueType;for(const d in r.data)a.push({key:n._parse(new S(r,d,r.path,d)),value:i._parse(new S(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?b.mergeObjectAsync(t,a):b.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof _?new Y({keyType:e,valueType:t,typeName:m.ZodRecord,...y(r)}):new Y({keyType:C.create(),valueType:e,typeName:m.ZodRecord,...y(t)})}}class ye extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:o.invalid_type,expected:u.map,received:r.parsedType}),p;const a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([d,h],f)=>({key:a._parse(new S(r,d,r.path,[f,"key"])),value:n._parse(new S(r,h,r.path,[f,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const h of i){const f=await h.key,v=await h.value;if(f.status==="aborted"||v.status==="aborted")return p;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),d.set(f.value,v.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const h of i){const f=h.key,v=h.value;if(f.status==="aborted"||v.status==="aborted")return p;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),d.set(f.value,v.value)}return{status:t.value,value:d}}}}ye.create=(s,e,t)=>new ye({valueType:e,keyType:s,typeName:m.ZodMap,...y(t)});class U extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:o.invalid_type,expected:u.set,received:r.parsedType}),p;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(c(r,{code:o.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(c(r,{code:o.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function i(h){const f=new Set;for(const v of h){if(v.status==="aborted")return p;v.status==="dirty"&&t.dirty(),f.add(v.value)}return{status:t.value,value:f}}const d=[...r.data.values()].map((h,f)=>n._parse(new S(r,h,r.path,f)));return r.common.async?Promise.all(d).then(h=>i(h)):i(d)}min(e,t){return new U({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new U({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}U.create=(s,e)=>new U({valueType:s,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});class _e extends _{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}_e.create=(s,e)=>new _e({getter:s,typeName:m.ZodLazy,...y(e)});class ge extends _{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:o.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}ge.create=(s,e)=>new ge({value:s,typeName:m.ZodLiteral,...y(e)});function Te(s,e){return new $({values:s,typeName:m.ZodEnum,...y(e)})}class $ extends _{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:g.joinValues(r),received:t.parsedType,code:o.invalid_type}),p}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:o.invalid_enum_value,options:r}),p}return w(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}$.create=Te;class ve extends _{_parse(e){const t=g.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const a=g.objectValues(t);return c(r,{expected:g.joinValues(a),received:r.parsedType,code:o.invalid_type}),p}if(this._cache||(this._cache=new Set(g.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=g.objectValues(t);return c(r,{received:r.data,code:o.invalid_enum_value,options:a}),p}return w(e.data)}get enum(){return this._def.values}}ve.create=(s,e)=>new ve({values:s,typeName:m.ZodNativeEnum,...y(e)});class H extends _{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:o.invalid_type,expected:u.promise,received:t.parsedType}),p;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return w(r.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}H.create=(s,e)=>new H({type:s,typeName:m.ZodPromise,...y(e)});class V extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const i=a.transform(r.data,n);if(r.common.async)return Promise.resolve(i).then(async d=>{if(t.value==="aborted")return p;const h=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return h.status==="aborted"?p:h.status==="dirty"||t.value==="dirty"?D(h.value):h});{if(t.value==="aborted")return p;const d=this._def.schema._parseSync({data:i,path:r.path,parent:r});return d.status==="aborted"?p:d.status==="dirty"||t.value==="dirty"?D(d.value):d}}if(a.type==="refinement"){const i=d=>{const h=a.refinement(d,n);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?p:(d.status==="dirty"&&t.dirty(),i(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?p:(d.status==="dirty"&&t.dirty(),i(d.value).then(()=>({status:t.value,value:d.value}))))}if(a.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!j(i))return p;const d=a.transform(i.value,n);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>j(i)?Promise.resolve(a.transform(i.value,n)).then(d=>({status:t.value,value:d})):p);g.assertNever(a)}}V.create=(s,e,t)=>new V({schema:s,typeName:m.ZodEffects,effect:e,...y(t)});V.createWithPreprocess=(s,e,t)=>new V({schema:e,effect:{type:"preprocess",transform:s},typeName:m.ZodEffects,...y(t)});class N extends _{_parse(e){return this._getType(e)===u.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}N.create=(s,e)=>new N({innerType:s,typeName:m.ZodOptional,...y(e)});class M extends _{_parse(e){return this._getType(e)===u.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(s,e)=>new M({innerType:s,typeName:m.ZodNullable,...y(e)});class re extends _{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}re.create=(s,e)=>new re({innerType:s,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ae extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return q(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new O(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new O(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class xe extends _{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:o.invalid_type,expected:u.nan,received:r.parsedType}),p}return{status:"valid",value:e.data}}}xe.create=s=>new xe({typeName:m.ZodNaN,...y(s)});class Xe extends _{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ie extends _{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),D(n.value)):this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,t){return new ie({in:e,out:t,typeName:m.ZodPipeline})}}class ne extends _{_parse(e){const t=this._def.innerType._parse(e),r=a=>(j(a)&&(a.value=Object.freeze(a.value)),a);return q(t)?t.then(a=>r(a)):r(t)}unwrap(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:m.ZodReadonly,...y(e)});var m;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(m||(m={}));const x=C.create,G=E.create,Ke=ee.create,B=te.create;Z.create;const Q=T.create,P=k.create;F.create;J.create;I.create;const ke=Y.create;$.create;H.create;N.create;M.create;const et=["access","equity","quality","resiliency","governance"],tt=P({activeSnapshotId:x().min(1,"activeSnapshotId is required"),publishedAt:x().min(1,"publishedAt is required"),nodeIds:Q(x()).min(1,"nodeIds cannot be empty"),schemaVersion:G().int().positive()}),Se=P({nodeId:x(),version:G(),sections:Q(B()),updatedAt:x()}),st=P({chartId:x(),title:x(),subtitle:x().optional(),unit:x().optional(),asOfDate:x(),chartType:x(),sanitizedCsvContent:x().optional()}).passthrough(),rt=P({pointId:x(),folderUrl:x().optional(),folderTitle:x().optional(),description:x().optional(),lastSyncedAt:x().optional(),items:Q(B()).optional()}).passthrough(),at=P({nodeId:x().min(1,"nodeId is required"),snapshotId:x().min(1,"snapshotId is required"),version:G().int().nonnegative(),updatedAt:x().min(1,"updatedAt is required"),canvas:Se,chartDatasets:ke(x(),B()),sourceMetadata:ke(x(),B())});function nt(s){let e=2166136261;for(let a=0;a<s.length;a++)e^=s.charCodeAt(a),e=Math.imul(e,16777619);const t=(e>>>0).toString(16).padStart(8,"0"),r=s.length.toString(16);return`W/"${t}-${r}"`}exports.CachedIndicatorDatasetSchema=st;exports.NodeCanvasDocumentSchema=Se;exports.PublicNodePayloadSchema=at;exports.PublicPortalManifestPayloadSchema=tt;exports.SyncedSourceMetadataSchema=rt;exports.VALID_NODES=et;exports.anyType=B;exports.arrayType=Q;exports.booleanType=Ke;exports.computeWeakEtag=nt;exports.numberType=G;exports.objectType=P;exports.stringType=x;
|