semiotic 3.10.2 → 3.10.3

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.
Files changed (80) hide show
  1. package/README.md +23 -27
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/behaviorContracts.cjs +1 -1
  4. package/ai/dist/mcp-server.js +1 -1
  5. package/ai/reference.md +4 -4
  6. package/ai/schema.json +1 -1
  7. package/ai/surface-manifest.json +1 -1
  8. package/ai/system-prompt.md +1 -1
  9. package/ai/task-packets/compare-category-totals.json +4 -4
  10. package/ai/task-packets/compare-category-totals.md +2 -2
  11. package/ai/task-packets/correct-published-chart.json +4 -4
  12. package/ai/task-packets/correct-published-chart.md +2 -2
  13. package/ai/task-packets/index.json +6 -6
  14. package/ai/task-packets/update-live-chart.json +4 -4
  15. package/ai/task-packets/update-live-chart.md +2 -2
  16. package/dist/{c-AKLBQMQF.min.js → c-43XNOQNQ.min.js} +50 -50
  17. package/dist/{c-PZ3NEGNG.min.js → c-5PIKBUMF.min.js} +1 -1
  18. package/dist/{c-FDUQDCBC.min.js → c-CO4NDAD6.min.js} +23 -23
  19. package/dist/c-FHNY57SO.min.js +209 -0
  20. package/dist/c-FMCUQ6JX.min.js +1 -0
  21. package/dist/{c-C4KIXUWU.min.js → c-GK263BF4.min.js} +1 -1
  22. package/dist/{c-TTKWXGAI.min.js → c-HNHKIMIV.min.js} +3 -3
  23. package/dist/c-IJCZGUG6.min.js +31 -0
  24. package/dist/{c-7LY46QUI.min.js → c-ISA6IJ6V.min.js} +7 -7
  25. package/dist/{c-4MD53L2J.min.js → c-JC76YAHB.min.js} +28 -28
  26. package/dist/{c-VXIYF7V2.min.js → c-JOPGDP6N.min.js} +1 -1
  27. package/dist/c-KXH7LFIL.min.js +26 -0
  28. package/dist/c-M43PK7K4.min.js +1 -0
  29. package/dist/{c-7ASK4WBF.min.js → c-PITYSOPK.min.js} +1 -1
  30. package/dist/{c-2TW5H5PD.min.js → c-QPO24R7Q.min.js} +1 -1
  31. package/dist/{c-KGROWFT2.min.js → c-SAP5KY6R.min.js} +2 -2
  32. package/dist/c-UMGHCBH5.min.js +114 -0
  33. package/dist/{c-6ZU3QVLB.min.js → c-VEMCBQZZ.min.js} +33 -33
  34. package/dist/{c-IPYGNVN6.min.js → c-WD2RL76M.min.js} +45 -45
  35. package/dist/{c-PQOZPM4G.min.js → c-YL7HJL5J.min.js} +1 -1
  36. package/dist/c-Z6GRGS53.min.js +1 -0
  37. package/dist/{c-SG2Y7EBY.min.js → c-ZVOFLE2P.min.js} +6 -6
  38. package/dist/components/CategoryColors.d.ts +7 -0
  39. package/dist/components/LinkedCharts.d.ts +2 -1
  40. package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
  41. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
  42. package/dist/components/data/transforms.d.ts +1 -0
  43. package/dist/geo.min.js +3 -3
  44. package/dist/geo.module.min.js +10 -10
  45. package/dist/network.module.min.js +1 -1
  46. package/dist/ordinal.module.min.js +1 -1
  47. package/dist/physics.module.min.js +1 -1
  48. package/dist/physicsWorker.js +1 -1
  49. package/dist/semiotic-ai-core.min.js +1 -1
  50. package/dist/semiotic-ai-core.module.min.js +1 -1
  51. package/dist/semiotic-ai.module.min.js +7 -7
  52. package/dist/semiotic-artifact.min.js +1 -1
  53. package/dist/semiotic-artifact.module.min.js +1 -1
  54. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  55. package/dist/semiotic-client-cjs-shared.min.js +903 -902
  56. package/dist/semiotic-data.min.js +1 -1
  57. package/dist/semiotic-data.module.min.js +1 -1
  58. package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
  59. package/dist/semiotic-experimental-node-auxiliary.module.min.js +2 -2
  60. package/dist/semiotic-line.module.min.js +1 -1
  61. package/dist/semiotic-realtime-core.module.min.js +1 -1
  62. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  63. package/dist/semiotic-recipes-core.module.min.js +1 -1
  64. package/dist/semiotic-server-edge-node.module.min.js +65 -65
  65. package/dist/semiotic-server-edge.min.js +64 -64
  66. package/dist/semiotic-server-edge.module.min.js +80 -80
  67. package/dist/semiotic-server-node.min.js +64 -64
  68. package/dist/semiotic-server-node.module.min.js +1 -1
  69. package/dist/semiotic.module.min.js +10 -10
  70. package/dist/server.min.js +64 -64
  71. package/dist/server.module.min.js +1 -1
  72. package/dist/xy.module.min.js +1 -1
  73. package/package.json +5 -5
  74. package/dist/c-72CBVNYX.min.js +0 -209
  75. package/dist/c-F2GGJB2S.min.js +0 -31
  76. package/dist/c-G53AVC42.min.js +0 -113
  77. package/dist/c-HQ27AHMC.min.js +0 -1
  78. package/dist/c-IHWZ2C6D.min.js +0 -26
  79. package/dist/c-MOP2NGLH.min.js +0 -1
  80. package/dist/c-PKY4JFY5.min.js +0 -1
package/README.md CHANGED
@@ -26,24 +26,20 @@ evidence scope; source availability does not establish installed or deployed par
26
26
  <img src="./docs/public/assets/img/semiotic-release-dashboard.svg" alt="Semiotic release dashboard showing chart count, bundle sizes, capability coverage, chart families, and documentation growth" width="100%">
27
27
  <!-- semiotic-readme-dashboard:end -->
28
28
 
29
- ## What's New in 3.10.2
29
+ ## What's New in 3.10.3
30
30
 
31
- 3.10.2 improves realtime aggregation, stream chart recommendations, server
32
- rendering, and line labels.
31
+ 3.10.3 fixes coordinated chart colors and histogram boundaries, and reduces
32
+ repeated work in graph and physics layouts.
33
33
 
34
- - Stream recommendations cover ordinal and value charts, with audience-aware
35
- dashboard layouts and explanations for excluded candidates.
36
- - Realtime charts support keyed changelogs, percentile and distinct-count
37
- aggregates, per-series line aggregation, and more controlled-data SSR paths.
38
- - Event-time queues, incremental aggregates, and smaller validation imports
39
- reduce repeated work and bundle overhead.
40
- - LineChart direct labels share measured placement across browser and server
41
- rendering; keyed path transitions preserve point identity during updates.
34
+ - Linked charts preserve explicit palettes, including network push mode and
35
+ partial category-color provider mappings. Legends reflect resolved colors.
36
+ - The `bin` transform correctly excludes observations outside custom domains.
37
+ - Large physics datasets avoid array argument-limit crashes in scheduling,
38
+ builders, projections, and sediment calculations.
39
+ - Mermaid layering avoids repeated queue shifts and sorting; Crucible body
40
+ sizing computes shared amount ranges once per batch.
42
41
 
43
- Stream suggestion callers should now destructure the result:
44
- `const { suggestions } = suggestStreamCharts(...)`.
45
-
46
- See [the changelog](CHANGELOG.md#3102---2026-09-18) for details.
42
+ See [the changelog](CHANGELOG.md#3103---2026-09-19) for details.
47
43
 
48
44
  ## Why Semiotic
49
45
 
@@ -416,8 +412,8 @@ The numbers below are **first-party artifact cost**: the gzip size of Semiotic's
416
412
  | `semiotic/ordinal` | **128 KB** | BarChart, PieChart, BoxPlot, Histogram, + 11 more categorical charts |
417
413
  | `semiotic/network` | **148 KB** | ForceDirectedGraph, SankeyDiagram, ProcessSankey, Treemap, + 4 more |
418
414
  | `semiotic/geo` | **106 KB** | ChoroplethMap, FlowMap, DistanceCartogram, ProportionalSymbolMap |
419
- | `semiotic/realtime` | **163 KB** | RealtimeLineChart, RealtimeHistogram, + 4 streaming charts |
420
- | `semiotic/realtime/core` | **162 KB** | Streaming chart types, HOCs, and buffer helpers |
415
+ | `semiotic/realtime` | **164 KB** | RealtimeLineChart, RealtimeHistogram, + 4 streaming charts |
416
+ | `semiotic/realtime/core` | **163 KB** | Streaming chart types, HOCs, and buffer helpers |
421
417
  | `semiotic/realtime/react` | **1 KB** | Stream status and synced push hooks |
422
418
  | `semiotic/server` | **243 KB** | renderChart, renderDashboard, renderToImage, renderToAnimatedGif |
423
419
  | `semiotic/server/node` | **243 KB** | renderChart, renderDashboard, renderToImage, renderToAnimatedGif |
@@ -431,9 +427,9 @@ The numbers below are **first-party artifact cost**: the gzip size of Semiotic's
431
427
  | `semiotic/themes` | **11 KB** | Theme presets only (tufte, carbon, etc.) |
432
428
  | `semiotic/themes/core` | **11 KB** | Theme presets and token helpers |
433
429
  | `semiotic/themes/react` | **6 KB** | ThemeProvider/useTheme and hooks |
434
- | `semiotic/data` | **3 KB** | bin, rollup, groupBy, pivot, fromVegaLite |
430
+ | `semiotic/data` | **4 KB** | bin, rollup, groupBy, pivot, fromVegaLite |
435
431
  | `semiotic/value` | **6 KB** | BigNumber — focal-value KPI / scorecard (SingleValueFrame POC) |
436
- | `semiotic/physics` | **164 KB** | GaltonBoardChart, EventDropChart, UnitPileChart, CollisionSwarmChart, PacketFlowChart, PhysicsCustomChart |
432
+ | `semiotic/physics` | **165 KB** | GaltonBoardChart, EventDropChart, UnitPileChart, CollisionSwarmChart, PacketFlowChart, PhysicsCustomChart |
437
433
  | `semiotic/physics/matter` | **1 KB** | Matter.js migration helpers + optional peer guard (no chart components) |
438
434
  | `semiotic/physics/rapier` | **1 KB** | Rapier peer guard + adapter decision metadata (no chart components) |
439
435
  | `semiotic/ai` | **595 KB** | All schema-backed charts + validation — optimized for LLM code generation |
@@ -465,27 +461,27 @@ Method: fresh `npm pack --ignore-scripts` tarball → temporary consumer → min
465
461
  | `import { MotifBraidChart } from "semiotic/atlas"` | browser | **159.5 KiB** |
466
462
  | `import { prepareNetworkAtlas } from "semiotic/atlas/core"` | browser | **6.2 KiB** |
467
463
  | `import { LineChart } from "semiotic"` | browser | **145.1 KiB** |
468
- | `import { LineChart } from "semiotic/xy"` | browser | **145.5 KiB** |
469
- | `import { LineChart } from "semiotic/line"` | browser | **145.3 KiB** |
470
- | `import { BarChart } from "semiotic/ordinal"` | browser | **133.1 KiB** |
471
- | `import { SankeyDiagram } from "semiotic/network"` | browser | **154.9 KiB** |
464
+ | `import { LineChart } from "semiotic/xy"` | browser | **145.6 KiB** |
465
+ | `import { LineChart } from "semiotic/line"` | browser | **145.4 KiB** |
466
+ | `import { BarChart } from "semiotic/ordinal"` | browser | **133.2 KiB** |
467
+ | `import { SankeyDiagram } from "semiotic/network"` | browser | **155.0 KiB** |
472
468
  | `import { RealtimeLineChart } from "semiotic/realtime"` | browser | **147.9 KiB** |
473
469
  | `import { RingBuffer } from "semiotic/realtime/core"` | browser | **0.7 KiB** |
474
470
  | `import { useStreamStatus } from "semiotic/realtime/react"` | browser | **0.6 KiB** |
475
- | `import { GaltonBoardChart } from "semiotic/physics"` | browser | **147.4 KiB** |
471
+ | `import { GaltonBoardChart } from "semiotic/physics"` | browser | **147.5 KiB** |
476
472
  | `import { MATTER_PHYSICS_CAPABILITIES } from "semiotic/physics/matter"` | browser | **0.2 KiB** |
477
473
  | `import { RAPIER_PHYSICS_CAPABILITIES } from "semiotic/physics/rapier"` | browser | **0.2 KiB** |
478
474
  | `import { renderChart } from "semiotic/server"` | node | **277.4 KiB** |
479
475
  | `import { generateFrameSVGs } from "semiotic/server/edge"` | node | **142.2 KiB** |
480
476
  | `import { renderToImage } from "semiotic/server/node"` | node | **278.3 KiB** |
481
- | `import { suggestCharts } from "semiotic/ai"` | browser | **255.4 KiB** |
477
+ | `import { suggestCharts } from "semiotic/ai"` | browser | **255.7 KiB** |
482
478
  | `import { suggestCharts } from "semiotic/ai/core"` | browser | **39.1 KiB** |
483
479
  | `import { buildArtifactContract } from "semiotic/artifact"` | browser | **13.0 KiB** |
484
480
  | `import { ArtifactInspector } from "semiotic/artifact/react"` | browser | **3.8 KiB** |
485
481
  | `import { createChartAccessContract } from "semiotic/access"` | browser | **27.0 KiB** |
486
482
  | `import { toEvidenceEnvelope } from "semiotic/evidence"` | browser | **42.3 KiB** |
487
483
  | `import { bin } from "semiotic/data"` | browser | **0.4 KiB** |
488
- | `import { ChoroplethMap } from "semiotic/geo"` | browser | **115.9 KiB** |
484
+ | `import { ChoroplethMap } from "semiotic/geo"` | browser | **116.0 KiB** |
489
485
  | `import { usePretextAnnotations } from "semiotic/text"` | browser | **1.5 KiB** |
490
486
  | `import { createRoughRenderMode } from "semiotic/rough"` | browser | **3.1 KiB** |
491
487
  | `import { resolveThemePreset } from "semiotic/themes"` | browser | **2.6 KiB** |
@@ -500,7 +496,7 @@ Method: fresh `npm pack --ignore-scripts` tarball → temporary consumer → min
500
496
  | `import { BigNumber } from "semiotic/value"` | browser | **5.9 KiB** |
501
497
  | `import { DirectManipulationControl } from "semiotic/controls"` | browser | **1.3 KiB** |
502
498
 
503
- **Line-boundary interpretation:** the retained named import from `semiotic/line` emits 434.5 KiB raw versus 434.5 KiB from `semiotic/xy`; gzip differs by 0.2 KiB (0.1%). Tree-shaking converges both paths on the same LineChart implementation graph. Treat `semiotic/line` as a narrower API/direct-ESM artifact boundary, not an application-bundle saving. Do not add another per-chart entry until its packed named import beats the family path by both 10 KiB gzip and 7%.
499
+ **Line-boundary interpretation:** the retained named import from `semiotic/line` emits 434.7 KiB raw versus 434.7 KiB from `semiotic/xy`; gzip differs by 0.2 KiB (0.1%). Tree-shaking converges both paths on the same LineChart implementation graph. Treat `semiotic/line` as a narrower API/direct-ESM artifact boundary, not an application-bundle saving. Do not add another per-chart entry until its packed named import beats the family path by both 10 KiB gzip and 7%.
504
500
 
505
501
  <!-- semiotic-cold-consumer:end -->
506
502
 
@@ -107,7 +107,7 @@
107
107
  "src/components/store/selectionProvenance.ts"
108
108
  ],
109
109
  "inventoryVersion": 1,
110
- "repositoryVersion": "3.10.2",
110
+ "repositoryVersion": "3.10.3",
111
111
  "relations": [
112
112
  {
113
113
  "id": "claim-support",
@@ -196,7 +196,7 @@ const BEHAVIOR_CONTRACTS = [
196
196
  appliesTo: {
197
197
  propsAny: ["colorBy", "colorScheme"],
198
198
  },
199
- summary: "When colorBy is set, CategoryColorProvider/LinkedCharts category maps win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback.",
199
+ summary: "When colorBy is set, explicit CategoryColorProvider mappings, including those inherited through LinkedCharts, win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback. Generated LinkedCharts colors do not override a child's colorScheme.",
200
200
  agentAction: "Use colorBy for categorical encodings. Use CategoryColorProvider or LinkedCharts for cross-chart consistency, colorScheme for per-chart fallback palettes, and avoid frameProps style functions unless intentionally bypassing HOC color resolution.",
201
201
  },
202
202
  {
@@ -41,7 +41,7 @@ ${a}<${o.component} ${i} />
41
41
  }
42
42
  \`\`\`
43
43
  Or use \`<ThemeProvider theme="dark">\` / \`<ThemeProvider theme={{ colors: {...}, typography: {...} }}>\`.
44
- For accessibility, use \`colorScheme={COLOR_BLIND_SAFE_CATEGORICAL}\` (import from \`semiotic/themes\`) - 8-color palette safe for all forms of color blindness.`}function t4(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t}=${r}`).join(", ")}xT.exports={VALID_INTENTS:xp,VALID_CAPABILITY_KEYS:Rv,formatSuggestionReport:e4,suggestCharts:QM,chartSatisfiesCapabilities:Cv,explainCapabilityMismatch:$T}});var CT=C((ZH,RT)=>{"use strict";var ST=require("path"),r4=require("fs"),kT="<!-- semiotic-behavior-contracts:start -->",TT="<!-- semiotic-behavior-contracts:end -->";function n4(){let e=[ST.join(__dirname,"schema.json"),ST.join(__dirname,"..","schema.json")];for(let t of e)try{let r=JSON.parse(r4.readFileSync(t,"utf8")),o=new Set;for(let n of r.tools||[])"data"in(n.function?.parameters?.properties||{})&&o.add(n.function.name);if(o.size>0)return o}catch{}return new Set}var wp=[{component:"StackedAreaChart",required:["areaBy"],staticRequired:["data","areaBy"],pushRequired:["areaBy"],summary:"Stacked areas need a flat data array plus areaBy to identify the stacked series."},{component:"BubbleChart",required:["sizeBy"],staticRequired:["data","sizeBy"],pushRequired:["sizeBy"],summary:"Bubbles need sizeBy in addition to x/y accessors so radius encodes data rather than a constant point size."},{component:"StackedBarChart",required:["stackBy"],staticRequired:["data","stackBy"],pushRequired:["stackBy"],summary:"Stacked bars need stackBy to split each category into stack segments."},{component:"GroupedBarChart",required:["groupBy"],staticRequired:["data","groupBy"],pushRequired:["groupBy"],summary:"Grouped bars need groupBy to split each category into side-by-side bars."},{component:"SwimlaneChart",required:["subcategoryAccessor"],staticRequired:["data","subcategoryAccessor"],pushRequired:["subcategoryAccessor"],summary:"Swimlanes need subcategoryAccessor; colorBy defaults to the same field when not provided."},{component:"GaugeChart",required:["value"],staticRequired:["value"],pushRequired:[],summary:"GaugeChart is value-only. Its thresholds use { value, color, label? }; BigNumber thresholds use the distinct { at, level, color?, label? } vocabulary."},{component:"ForceDirectedGraph",required:["nodes","edges"],staticRequired:["nodes","edges"],pushRequired:["nodes","edges"],summary:"ForceDirectedGraph schema/rendering requires nodes and edges. If an agent infers nodes from edge endpoints, it must materialize a nodes array before returning code."}],pi=["LineChart","AreaChart","StackedAreaChart","Scatterplot","BubbleChart","ConnectedScatterplot","CandlestickChart","MultiAxisLineChart","QuadrantChart","DifferenceChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","LikertChart","SwimlaneChart","ForceDirectedGraph","SankeyDiagram","ChordDiagram","ProportionalSymbolMap","DistanceCartogram","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","ChainReactionChart"],IT=n4(),Nv=[{id:"accessibility.description-props",category:"accessibility",title:"Accessible chart text uses direct chart props",severity:"warning",appliesTo:{},summary:"High-level charts expose title for the visible name, description for a concise accessible description, summary for a screen-reader-only takeaway and interaction guidance, and accessibleTable for the data-table fallback.",agentAction:'Put title, description, summary, and accessibleTable directly on the chart component when they appear in its schema. If a consumer-owned role=img wraps the chart, use accessibleTable: { portalTarget: "element-id" } and render that target outside the image. For generated L1\u2013L3 description or a navigable chart tree, use ChartContainer with chartConfig plus describe and/or navigable; do not invent frameProps fields.'},{id:"interaction.cursor-is-presentation-only",category:"interaction",title:"Cursor styling does not create behavior",severity:"warning",appliesTo:{propsAny:["cursor"],propPathsAny:[["styleRules","*","style","cursor"]]},summary:"Cursor values in realtime props, retained mark styles, styleRules, and custom hit targets change pointer presentation only. They do not install click handlers, keyboard activation, observations, or accessibility semantics.",agentAction:"Use an actionable cursor only when the application separately supplies documented click or observation behavior and an accessible activation path. Treat cursor in serialized/static output as visual metadata, never as proof that a mark is interactive."},{id:"props.data-required-by-usage-mode",category:"required-props",title:"Data required by usage mode",severity:"error",appliesTo:{components:pi},summary:"Static usage (`renderChart`, MCP previews, SSR snapshots, and copy/paste examples with immediate data) requires data in props. React push mode selects live ingestion by omitting data and mutating through a ref.",agentAction:'Pass usageMode="push" to `semiotic-ai --doctor` when validating ref-based JSX with no data prop. Keep usageMode="static" or omit it for renderChart/MCP/static configs where data must be present.'},{id:"color.category-precedence",category:"color",title:"Categorical color precedence",severity:"info",appliesTo:{propsAny:["colorBy","colorScheme"]},summary:"When colorBy is set, CategoryColorProvider/LinkedCharts category maps win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback.",agentAction:"Use colorBy for categorical encodings. Use CategoryColorProvider or LinkedCharts for cross-chart consistency, colorScheme for per-chart fallback palettes, and avoid frameProps style functions unless intentionally bypassing HOC color resolution."},{id:"props.required-combinations",category:"required-props",title:"Required prop combinations",severity:"error",appliesTo:{components:wp.map(e=>e.component)},summary:"Some chart families need semantic props beyond data. These combinations are enforced by validation/schema for static configs and remain required in push mode unless explicitly noted.",agentAction:"Before returning code, check the selected component against the required combinations list. For push mode, omit data but keep semantic props such as areaBy, sizeBy, stackBy, and groupBy.",combinations:wp},{id:"streaming.push-mode-data",category:"streaming",title:"Push mode omits data",severity:"warning",appliesTo:{components:pi},summary:"HOC push mode is selected by omitting the data prop entirely. Passing data={[]} is static empty data and can clear/reinitialize the frame on render.",agentAction:"For live charts, create a ref, omit data, then call ref.current.push() or pushMany(). For static renderChart/MCP snapshots, provide data because renderChart cannot push later."},{id:"streaming.serialized-proposal-snapshot",category:"streaming",title:"Serialized proposals keep the initial snapshot",severity:"warning",appliesTo:{components:pi},summary:"A JSON component/props proposal for MCP, SSR, or evaluation is a static snapshot even when the request mentions future pushes. Keep the supplied initial rows in the component's real data prop and do not invent pushRows, pushRequirement, ref, or method props.",agentAction:"Return renderable initial props in JSON. If the requested deliverable is React push code, separately omit the controlled data prop in JSX, attach a ref, and call the documented imperative method from an effect or event handler.",example:'JSON snapshot: { "component": "LineChart", "props": { "data": [{"week":1,"users":120}], "xAccessor":"week", "yAccessor":"users" } }. React push code instead omits data and calls ref.current?.push(row).'},{id:"streaming.ref-mutations-require-id-accessors",category:"streaming",title:"Ref mutations need stable IDs",severity:"warning",appliesTo:{components:pi},summary:"push() and pushMany() can append without IDs, but remove(id) and update(id, updater) require a stable ID accessor: pointIdAccessor for XY/realtime charts, dataIdAccessor for ordinal charts, and nodeIDAccessor/edgeIdAccessor for network operations.",agentAction:"When generating code that calls remove() or update(), include the matching ID accessor and make sure pushed rows carry that ID field."},{id:"rendering.renderchart-static-props",category:"rendering",title:"renderChart uses static props only",severity:"warning",appliesTo:{},summary:"MCP renderChart and semiotic/server renderChart render a single static SVG/PNG snapshot. Browser-only realtime components and future ref pushes are not renderable through that path.",agentAction:"Use renderChart only with renderable HOC components and complete static data. For live behavior, return React code with a ref and do not promise MCP-rendered output."},{id:"serialization.formatters-are-react-callbacks",category:"serialization",title:"Axis formatters are React callbacks",severity:"error",appliesTo:{propsAny:["xFormat","yFormat","categoryFormat","valueFormat"]},summary:"xFormat, yFormat, categoryFormat, and valueFormat are callback props, not d3 format strings or axis-title strings. They are intentionally absent from JSON/MCP schemas and string values fail validation.",agentAction:"In serialized props, omit formatter callbacks and use xLabel, yLabel, categoryLabel, or valueLabel for axis titles. In React JSX, pass a function such as xFormat={value => formatAxis(value)}.",example:'JSON: { "xLabel": "Payload (KB)", "yLabel": "Response time (ms)" }. React-only: xFormat={value => formatNumber(value, { maximumFractionDigits: 0 })}.'},{id:"value.bignumber-wire-contract",category:"value",title:"Value components do not inherit chart-HOC props",severity:"error",appliesTo:{components:["BigNumber"]},summary:"BigNumber is a value component, not a chart HOC, so it does not inherit the common chart-HOC prop list. It uses label as its visible heading and supports description and summary; title and accessibleTable are invalid. Its percent format expects a ratio such as 0.97 and renders it as 97%.",agentAction:'Validate BigNumber against its own prop schema and remove inherited chart-HOC props such as title and accessibleTable before returning a proposal. Use label, description, and summary for text. For a 97-of-100 KPI, either pass value={0.97} with format="percent" or pass value={97} with format="number" and suffix="%"; do not combine value={97} with format="percent".',example:'{ "component": "BigNumber", "props": { "value": 97, "label": "SLA attainment", "format": "number", "suffix": "%", "target": { "value": 99, "label": "target", "format": "number" } } }'},{id:"geo.proportional-symbol-wire-shape",category:"geo",title:"Proportional symbol maps use geographic props",severity:"error",appliesTo:{components:["ProportionalSymbolMap"]},summary:"ProportionalSymbolMap reads point rows from points, longitude from xAccessor (default lon), latitude from yAccessor (default lat), and radius from sizeBy. sizeRange is the two-number pixel-radius range.",agentAction:"Use points, xAccessor, yAccessor, and sizeBy. Do not rename points to data or sizeBy to valueAccessor merely because the map renders circles.",example:'{ "points": [{"city":"A","longitude":-122.4,"latitude":37.8,"incidents":18}], "xAccessor":"longitude", "yAccessor":"latitude", "sizeBy":"incidents", "sizeRange":[5,40] }'},{id:"physics.sample-and-mechanical-inputs",category:"physics",title:"Physics charts separate chart mode from simulation input",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart"]},summary:`Sample simulations use data plus the chart's accessors. Seeded no-data demonstrations use simulationMode="mechanical" (legacy mode="mechanical" remains accepted); mode otherwise carries chart display modes such as primary or sparkline.`,agentAction:"For observed Galton values pass data + valueAccessor. For unit piles pass data + categoryAccessor + valueAccessor. Use seed for reproducibility, bins for Galton columns, and unitValue for the amount represented by one full UnitPile circle; remainders use proportional area.",example:'{ "component": "GaltonBoardChart", "props": { "data": [{"id":"a","value":1}], "valueAccessor":"value", "bins":4, "seed":42 } }'},{id:"physics.push-uses-source-records",category:"physics",title:"Physics push methods ingest source records",severity:"error",appliesTo:{components:["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart"]},summary:"Physics HOC refs push source records through the chart's accessors. pushRows and dataIdAccessor are not component props; stable source id fields are retained on spawned bodies without an invented accessor.",agentAction:"For React live code, call ref.current?.push(row) or pushMany(rows). For serialized snapshots, append the rows to data. Keep category/value/time accessors, but omit pushRows and dataIdAccessor.",example:'ref.current?.push({ id: "c", team: "Blue", value: 2 }); <UnitPileChart ref={ref} categoryAccessor="team" valueAccessor="value" unitValue={1} />'},{id:"physics.live-source-reconciliation",category:"physics",title:"Distribution physics charts update bodies and projections together",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart","CollisionSwarmChart","EventDropChart"]},summary:"Bodies, categories, domains, and totals update together without changing React keys. getData() returns source rows. New data replaces live rows; rerunMS restores the seed.",agentAction:"Omit data for push mode; data=[] stays empty and rejects pushes. Use stable IDs and remove for source edits; popBodies only removes marks. Set xExtent/valueExtent/timeExtent for stable domains.",example:'ref.current?.update("a", row => ({ ...row, value: 102 })); ref.current?.remove("b");'},{id:"physics.event-admission-history",category:"physics",title:"EventDrop distinguishes admission history from current closure",severity:"error",appliesTo:{components:["EventDropChart"]},summary:"Arrival order determines historical lateness with a delay/function watermark. Equal arrival times keep source order. A window is closed when its end is at or below the watermark; previously accepted events stay accepted as later events advance it. An explicit watermark.value instead tests one fixed policy.",agentAction:"Use watermark={{delay: n}} for arrival-ordered admission, or watermarkAtArrivalAccessor for recorded thresholds independent of current closure. Keep all times in the same units. The current board has solid lids: accepted history starts below them, late arrivals roll left. For a chronological demonstration, supply successive data/watermark states and coordinate source time with travel. timeScale does not replay lid changes. Source projection labels describe snapshot totals; readEventDropOccupancy(metadata, bodies) counts current containers and in-flight bodies independently of source flags.",example:'{ "data": [{"time":1,"arrivalTime":2,"admission":-3}], "watermarkAtArrivalAccessor":"admission", "watermark":{"value":100} }'}];function ET(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o4(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function i4(e,t){if(!t)return!e.appliesTo?.components;let r=e.appliesTo?.components;return!r||r.includes(t)}function a4(e,t){let r=e.appliesTo?.propsAny,o=e.appliesTo?.propPathsAny;return(!r||r.length===0)&&(!o||o.length===0)||r?.some(n=>ET(t,n)&&t[n]!==void 0)?!0:o?.some(n=>jv(t,n))??!1}function jv(e,t){if(t.length===0)return e!==void 0;if(e===null||typeof e!="object")return!1;let[r,...o]=t;return r==="*"?Array.isArray(e)&&e.some(n=>jv(n,o)):ET(e,r)&&jv(e[r],o)}function s4({component:e,props:t}={}){let r=o4(t);return Nv.filter(o=>i4(o,e)&&a4(o,r))}function PT(e){return e==="push"?"push":"static"}function c4(e,t){return!(!IT.has(e)||PT(t)==="push"&&pi.includes(e))}function u4(e){return wp.filter(t=>!e||t.component===e)}function zT(e){let t=e.staticRequired||e.required,r=e.pushRequired||e.required.filter(n=>n!=="data"),o=r.length>0?r.join(" + "):"not supported";return`${e.component}: static ${t.join(" + ")}; push ${o}. ${e.summary}`}function l4(e){if(!e||e.length===0)return"";let t=["Behavior contracts:"];for(let r of e){if(t.push(` - [${r.id}] ${r.summary}`),r.combinations)for(let o of r.combinations)t.push(` ${zT(o)}`);r.example&&t.push(` Example: ${r.example}`),t.push(` Action: ${r.agentAction}`)}return t.join(`
44
+ For accessibility, use \`colorScheme={COLOR_BLIND_SAFE_CATEGORICAL}\` (import from \`semiotic/themes\`) - 8-color palette safe for all forms of color blindness.`}function t4(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t}=${r}`).join(", ")}xT.exports={VALID_INTENTS:xp,VALID_CAPABILITY_KEYS:Rv,formatSuggestionReport:e4,suggestCharts:QM,chartSatisfiesCapabilities:Cv,explainCapabilityMismatch:$T}});var CT=C((ZH,RT)=>{"use strict";var ST=require("path"),r4=require("fs"),kT="<!-- semiotic-behavior-contracts:start -->",TT="<!-- semiotic-behavior-contracts:end -->";function n4(){let e=[ST.join(__dirname,"schema.json"),ST.join(__dirname,"..","schema.json")];for(let t of e)try{let r=JSON.parse(r4.readFileSync(t,"utf8")),o=new Set;for(let n of r.tools||[])"data"in(n.function?.parameters?.properties||{})&&o.add(n.function.name);if(o.size>0)return o}catch{}return new Set}var wp=[{component:"StackedAreaChart",required:["areaBy"],staticRequired:["data","areaBy"],pushRequired:["areaBy"],summary:"Stacked areas need a flat data array plus areaBy to identify the stacked series."},{component:"BubbleChart",required:["sizeBy"],staticRequired:["data","sizeBy"],pushRequired:["sizeBy"],summary:"Bubbles need sizeBy in addition to x/y accessors so radius encodes data rather than a constant point size."},{component:"StackedBarChart",required:["stackBy"],staticRequired:["data","stackBy"],pushRequired:["stackBy"],summary:"Stacked bars need stackBy to split each category into stack segments."},{component:"GroupedBarChart",required:["groupBy"],staticRequired:["data","groupBy"],pushRequired:["groupBy"],summary:"Grouped bars need groupBy to split each category into side-by-side bars."},{component:"SwimlaneChart",required:["subcategoryAccessor"],staticRequired:["data","subcategoryAccessor"],pushRequired:["subcategoryAccessor"],summary:"Swimlanes need subcategoryAccessor; colorBy defaults to the same field when not provided."},{component:"GaugeChart",required:["value"],staticRequired:["value"],pushRequired:[],summary:"GaugeChart is value-only. Its thresholds use { value, color, label? }; BigNumber thresholds use the distinct { at, level, color?, label? } vocabulary."},{component:"ForceDirectedGraph",required:["nodes","edges"],staticRequired:["nodes","edges"],pushRequired:["nodes","edges"],summary:"ForceDirectedGraph schema/rendering requires nodes and edges. If an agent infers nodes from edge endpoints, it must materialize a nodes array before returning code."}],pi=["LineChart","AreaChart","StackedAreaChart","Scatterplot","BubbleChart","ConnectedScatterplot","CandlestickChart","MultiAxisLineChart","QuadrantChart","DifferenceChart","BarChart","StackedBarChart","GroupedBarChart","SwarmPlot","BoxPlot","Histogram","ViolinPlot","RidgelinePlot","DotPlot","PieChart","DonutChart","LikertChart","SwimlaneChart","ForceDirectedGraph","SankeyDiagram","ChordDiagram","ProportionalSymbolMap","DistanceCartogram","GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart","PacketFlowChart","ProcessFlowChart","GauntletChart","CrucibleChart","ChainReactionChart"],IT=n4(),Nv=[{id:"accessibility.description-props",category:"accessibility",title:"Accessible chart text uses direct chart props",severity:"warning",appliesTo:{},summary:"High-level charts expose title for the visible name, description for a concise accessible description, summary for a screen-reader-only takeaway and interaction guidance, and accessibleTable for the data-table fallback.",agentAction:'Put title, description, summary, and accessibleTable directly on the chart component when they appear in its schema. If a consumer-owned role=img wraps the chart, use accessibleTable: { portalTarget: "element-id" } and render that target outside the image. For generated L1\u2013L3 description or a navigable chart tree, use ChartContainer with chartConfig plus describe and/or navigable; do not invent frameProps fields.'},{id:"interaction.cursor-is-presentation-only",category:"interaction",title:"Cursor styling does not create behavior",severity:"warning",appliesTo:{propsAny:["cursor"],propPathsAny:[["styleRules","*","style","cursor"]]},summary:"Cursor values in realtime props, retained mark styles, styleRules, and custom hit targets change pointer presentation only. They do not install click handlers, keyboard activation, observations, or accessibility semantics.",agentAction:"Use an actionable cursor only when the application separately supplies documented click or observation behavior and an accessible activation path. Treat cursor in serialized/static output as visual metadata, never as proof that a mark is interactive."},{id:"props.data-required-by-usage-mode",category:"required-props",title:"Data required by usage mode",severity:"error",appliesTo:{components:pi},summary:"Static usage (`renderChart`, MCP previews, SSR snapshots, and copy/paste examples with immediate data) requires data in props. React push mode selects live ingestion by omitting data and mutating through a ref.",agentAction:'Pass usageMode="push" to `semiotic-ai --doctor` when validating ref-based JSX with no data prop. Keep usageMode="static" or omit it for renderChart/MCP/static configs where data must be present.'},{id:"color.category-precedence",category:"color",title:"Categorical color precedence",severity:"info",appliesTo:{propsAny:["colorBy","colorScheme"]},summary:"When colorBy is set, explicit CategoryColorProvider mappings, including those inherited through LinkedCharts, win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback. Generated LinkedCharts colors do not override a child's colorScheme.",agentAction:"Use colorBy for categorical encodings. Use CategoryColorProvider or LinkedCharts for cross-chart consistency, colorScheme for per-chart fallback palettes, and avoid frameProps style functions unless intentionally bypassing HOC color resolution."},{id:"props.required-combinations",category:"required-props",title:"Required prop combinations",severity:"error",appliesTo:{components:wp.map(e=>e.component)},summary:"Some chart families need semantic props beyond data. These combinations are enforced by validation/schema for static configs and remain required in push mode unless explicitly noted.",agentAction:"Before returning code, check the selected component against the required combinations list. For push mode, omit data but keep semantic props such as areaBy, sizeBy, stackBy, and groupBy.",combinations:wp},{id:"streaming.push-mode-data",category:"streaming",title:"Push mode omits data",severity:"warning",appliesTo:{components:pi},summary:"HOC push mode is selected by omitting the data prop entirely. Passing data={[]} is static empty data and can clear/reinitialize the frame on render.",agentAction:"For live charts, create a ref, omit data, then call ref.current.push() or pushMany(). For static renderChart/MCP snapshots, provide data because renderChart cannot push later."},{id:"streaming.serialized-proposal-snapshot",category:"streaming",title:"Serialized proposals keep the initial snapshot",severity:"warning",appliesTo:{components:pi},summary:"A JSON component/props proposal for MCP, SSR, or evaluation is a static snapshot even when the request mentions future pushes. Keep the supplied initial rows in the component's real data prop and do not invent pushRows, pushRequirement, ref, or method props.",agentAction:"Return renderable initial props in JSON. If the requested deliverable is React push code, separately omit the controlled data prop in JSX, attach a ref, and call the documented imperative method from an effect or event handler.",example:'JSON snapshot: { "component": "LineChart", "props": { "data": [{"week":1,"users":120}], "xAccessor":"week", "yAccessor":"users" } }. React push code instead omits data and calls ref.current?.push(row).'},{id:"streaming.ref-mutations-require-id-accessors",category:"streaming",title:"Ref mutations need stable IDs",severity:"warning",appliesTo:{components:pi},summary:"push() and pushMany() can append without IDs, but remove(id) and update(id, updater) require a stable ID accessor: pointIdAccessor for XY/realtime charts, dataIdAccessor for ordinal charts, and nodeIDAccessor/edgeIdAccessor for network operations.",agentAction:"When generating code that calls remove() or update(), include the matching ID accessor and make sure pushed rows carry that ID field."},{id:"rendering.renderchart-static-props",category:"rendering",title:"renderChart uses static props only",severity:"warning",appliesTo:{},summary:"MCP renderChart and semiotic/server renderChart render a single static SVG/PNG snapshot. Browser-only realtime components and future ref pushes are not renderable through that path.",agentAction:"Use renderChart only with renderable HOC components and complete static data. For live behavior, return React code with a ref and do not promise MCP-rendered output."},{id:"serialization.formatters-are-react-callbacks",category:"serialization",title:"Axis formatters are React callbacks",severity:"error",appliesTo:{propsAny:["xFormat","yFormat","categoryFormat","valueFormat"]},summary:"xFormat, yFormat, categoryFormat, and valueFormat are callback props, not d3 format strings or axis-title strings. They are intentionally absent from JSON/MCP schemas and string values fail validation.",agentAction:"In serialized props, omit formatter callbacks and use xLabel, yLabel, categoryLabel, or valueLabel for axis titles. In React JSX, pass a function such as xFormat={value => formatAxis(value)}.",example:'JSON: { "xLabel": "Payload (KB)", "yLabel": "Response time (ms)" }. React-only: xFormat={value => formatNumber(value, { maximumFractionDigits: 0 })}.'},{id:"value.bignumber-wire-contract",category:"value",title:"Value components do not inherit chart-HOC props",severity:"error",appliesTo:{components:["BigNumber"]},summary:"BigNumber is a value component, not a chart HOC, so it does not inherit the common chart-HOC prop list. It uses label as its visible heading and supports description and summary; title and accessibleTable are invalid. Its percent format expects a ratio such as 0.97 and renders it as 97%.",agentAction:'Validate BigNumber against its own prop schema and remove inherited chart-HOC props such as title and accessibleTable before returning a proposal. Use label, description, and summary for text. For a 97-of-100 KPI, either pass value={0.97} with format="percent" or pass value={97} with format="number" and suffix="%"; do not combine value={97} with format="percent".',example:'{ "component": "BigNumber", "props": { "value": 97, "label": "SLA attainment", "format": "number", "suffix": "%", "target": { "value": 99, "label": "target", "format": "number" } } }'},{id:"geo.proportional-symbol-wire-shape",category:"geo",title:"Proportional symbol maps use geographic props",severity:"error",appliesTo:{components:["ProportionalSymbolMap"]},summary:"ProportionalSymbolMap reads point rows from points, longitude from xAccessor (default lon), latitude from yAccessor (default lat), and radius from sizeBy. sizeRange is the two-number pixel-radius range.",agentAction:"Use points, xAccessor, yAccessor, and sizeBy. Do not rename points to data or sizeBy to valueAccessor merely because the map renders circles.",example:'{ "points": [{"city":"A","longitude":-122.4,"latitude":37.8,"incidents":18}], "xAccessor":"longitude", "yAccessor":"latitude", "sizeBy":"incidents", "sizeRange":[5,40] }'},{id:"physics.sample-and-mechanical-inputs",category:"physics",title:"Physics charts separate chart mode from simulation input",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart"]},summary:`Sample simulations use data plus the chart's accessors. Seeded no-data demonstrations use simulationMode="mechanical" (legacy mode="mechanical" remains accepted); mode otherwise carries chart display modes such as primary or sparkline.`,agentAction:"For observed Galton values pass data + valueAccessor. For unit piles pass data + categoryAccessor + valueAccessor. Use seed for reproducibility, bins for Galton columns, and unitValue for the amount represented by one full UnitPile circle; remainders use proportional area.",example:'{ "component": "GaltonBoardChart", "props": { "data": [{"id":"a","value":1}], "valueAccessor":"value", "bins":4, "seed":42 } }'},{id:"physics.push-uses-source-records",category:"physics",title:"Physics push methods ingest source records",severity:"error",appliesTo:{components:["GaltonBoardChart","EventDropChart","UnitPileChart","CollisionSwarmChart"]},summary:"Physics HOC refs push source records through the chart's accessors. pushRows and dataIdAccessor are not component props; stable source id fields are retained on spawned bodies without an invented accessor.",agentAction:"For React live code, call ref.current?.push(row) or pushMany(rows). For serialized snapshots, append the rows to data. Keep category/value/time accessors, but omit pushRows and dataIdAccessor.",example:'ref.current?.push({ id: "c", team: "Blue", value: 2 }); <UnitPileChart ref={ref} categoryAccessor="team" valueAccessor="value" unitValue={1} />'},{id:"physics.live-source-reconciliation",category:"physics",title:"Distribution physics charts update bodies and projections together",severity:"warning",appliesTo:{components:["GaltonBoardChart","UnitPileChart","CollisionSwarmChart","EventDropChart"]},summary:"Bodies, categories, domains, and totals update together without changing React keys. getData() returns source rows. New data replaces live rows; rerunMS restores the seed.",agentAction:"Omit data for push mode; data=[] stays empty and rejects pushes. Use stable IDs and remove for source edits; popBodies only removes marks. Set xExtent/valueExtent/timeExtent for stable domains.",example:'ref.current?.update("a", row => ({ ...row, value: 102 })); ref.current?.remove("b");'},{id:"physics.event-admission-history",category:"physics",title:"EventDrop distinguishes admission history from current closure",severity:"error",appliesTo:{components:["EventDropChart"]},summary:"Arrival order determines historical lateness with a delay/function watermark. Equal arrival times keep source order. A window is closed when its end is at or below the watermark; previously accepted events stay accepted as later events advance it. An explicit watermark.value instead tests one fixed policy.",agentAction:"Use watermark={{delay: n}} for arrival-ordered admission, or watermarkAtArrivalAccessor for recorded thresholds independent of current closure. Keep all times in the same units. The current board has solid lids: accepted history starts below them, late arrivals roll left. For a chronological demonstration, supply successive data/watermark states and coordinate source time with travel. timeScale does not replay lid changes. Source projection labels describe snapshot totals; readEventDropOccupancy(metadata, bodies) counts current containers and in-flight bodies independently of source flags.",example:'{ "data": [{"time":1,"arrivalTime":2,"admission":-3}], "watermarkAtArrivalAccessor":"admission", "watermark":{"value":100} }'}];function ET(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o4(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function i4(e,t){if(!t)return!e.appliesTo?.components;let r=e.appliesTo?.components;return!r||r.includes(t)}function a4(e,t){let r=e.appliesTo?.propsAny,o=e.appliesTo?.propPathsAny;return(!r||r.length===0)&&(!o||o.length===0)||r?.some(n=>ET(t,n)&&t[n]!==void 0)?!0:o?.some(n=>jv(t,n))??!1}function jv(e,t){if(t.length===0)return e!==void 0;if(e===null||typeof e!="object")return!1;let[r,...o]=t;return r==="*"?Array.isArray(e)&&e.some(n=>jv(n,o)):ET(e,r)&&jv(e[r],o)}function s4({component:e,props:t}={}){let r=o4(t);return Nv.filter(o=>i4(o,e)&&a4(o,r))}function PT(e){return e==="push"?"push":"static"}function c4(e,t){return!(!IT.has(e)||PT(t)==="push"&&pi.includes(e))}function u4(e){return wp.filter(t=>!e||t.component===e)}function zT(e){let t=e.staticRequired||e.required,r=e.pushRequired||e.required.filter(n=>n!=="data"),o=r.length>0?r.join(" + "):"not supported";return`${e.component}: static ${t.join(" + ")}; push ${o}. ${e.summary}`}function l4(e){if(!e||e.length===0)return"";let t=["Behavior contracts:"];for(let r of e){if(t.push(` - [${r.id}] ${r.summary}`),r.combinations)for(let o of r.combinations)t.push(` ${zT(o)}`);r.example&&t.push(` Example: ${r.example}`),t.push(` Action: ${r.agentAction}`)}return t.join(`
45
45
  `)}function d4({compact:e=!1}={}){let t=[e?"## Behavior Contracts":"## AI Behavior Contracts","",kT,"","These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `semiotic-ai --doctor`, MCP resources, and docs checks.",""];for(let r of Nv){if(t.push(`- **${r.title}** (\`${r.id}\`): ${r.summary}`),e||t.push(` Agent action: ${r.agentAction}`),r.combinations){let o=r.combinations.map(zT).join(" ");t.push(` Required combinations: ${o}`)}!e&&r.example&&t.push(` Example: \`${r.example}\``)}return t.push("",TT),t.join(`
46
46
  `)}RT.exports={BEHAVIOR_CONTRACTS:Nv,DOC_MARKER_END:TT,DOC_MARKER_START:kT,PUSH_MODE_COMPONENTS:pi,REQUIRED_COMBINATIONS:wp,STATIC_DATA_COMPONENTS:IT,behaviorContractsFor:s4,dataRequiredForUsageMode:c4,formatBehaviorContractsMarkdown:d4,formatDoctorBehaviorContracts:l4,normalizeUsageMode:PT,requiredCombinationsFor:u4}});var ae;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let i={};for(let a of n)i[a]=a;return i},e.getValidEnumValues=n=>{let i=e.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(let s of i)a[s]=n[s];return e.objectValues(a)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.push(a);return i},e.find=(n,i)=>{for(let a of n)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function o(n,i=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(ae||(ae={}));var Kv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Kv||(Kv={}));var N=ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ar=e=>{switch(typeof e){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(e)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(e)?N.array:e===null?N.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?N.promise:typeof Map<"u"&&e instanceof Map?N.map:typeof Set<"u"&&e instanceof Set?N.set:typeof Date<"u"&&e instanceof Date?N.date:N.object;default:return N.unknown}};var I=ae.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"]);var ht=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},o={_errors:[]},n=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)o._errors.push(r(a));else{let s=o,c=0;for(;c<a.path.length;){let u=a.path[c];c===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return n(this),o}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ae.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),o=[];for(let n of this.issues)if(n.path.length>0){let i=n.path[0];r[i]=r[i]||[],r[i].push(t(n))}else o.push(t(n));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};ht.create=e=>new ht(e);var SI=(e,t)=>{let r;switch(e.code){case I.invalid_type:e.received===N.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ae.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:r=`Unrecognized key(s) in object: ${ae.joinValues(e.keys,", ")}`;break;case I.invalid_union:r="Invalid input";break;case I.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ae.joinValues(e.options)}`;break;case I.invalid_enum_value:r=`Invalid enum value. Expected ${ae.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:r="Invalid function arguments";break;case I.invalid_return_type:r="Invalid function return type";break;case I.invalid_date:r="Invalid date";break;case I.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ae.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case I.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case I.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case I.custom:r="Invalid input";break;case I.invalid_intersection_types:r="Intersection results could not be merged";break;case I.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:r="Number must be finite";break;default:r=t.defaultError,ae.assertNever(e)}return{message:r}},wr=SI;var kI=wr;function _i(){return kI}var Ls=e=>{let{data:t,path:r,errorMaps:o,issueData:n}=e,i=[...r,...n.path||[]],a={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let s="",c=o.filter(u=>!!u).slice().reverse();for(let u of c)s=u(a,{data:t,defaultError:s}).message;return{...n,path:i,message:s}};function O(e,t){let r=_i(),o=Ls({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wr?void 0:wr].filter(n=>!!n)});e.common.issues.push(o)}var Be=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let o=[];for(let n of r){if(n.status==="aborted")return B;n.status==="dirty"&&t.dirty(),o.push(n.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,r){let o=[];for(let n of r){let i=await n.key,a=await n.value;o.push({key:i,value:a})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,r){let o={};for(let n of r){let{key:i,value:a}=n;if(i.status==="aborted"||a.status==="aborted")return B;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(o[i.value]=a.value)}return{status:t.value,value:o}}},B=Object.freeze({status:"aborted"}),Bn=e=>({status:"dirty",value:e}),Xe=e=>({status:"valid",value:e}),jp=e=>e.status==="aborted",Np=e=>e.status==="dirty",cn=e=>e.status==="valid",bi=e=>typeof Promise<"u"&&e instanceof Promise;var M;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(M||(M={}));var bt=class{constructor(t,r,o,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=o,this._key=n}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}},Xv=(e,t)=>{if(cn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ht(e.common.issues);return this._error=r,this._error}}};function W(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:o,description:n}=e;if(t&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(a,s)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??o??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:n}}var te=class{get description(){return this._def.description}_getType(t){return ar(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ar(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Be,ctx:{common:t.parent.common,data:t.data,parsedType:ar(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(bi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let o=this.safeParse(t,r);if(o.success)return o.data;throw o.error}safeParse(t,r){let o={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ar(t)},n=this._parseSync({data:t,path:o.path,parent:o});return Xv(o,n)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ar(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:r});return cn(o)?{value:o.value}:{issues:r.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>cn(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(t,r){let o=await this.safeParseAsync(t,r);if(o.success)return o.data;throw o.error}async safeParseAsync(t,r){let o={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ar(t)},n=this._parse({data:t,path:o.path,parent:o}),i=await(bi(n)?n:Promise.resolve(n));return Xv(o,i)}refine(t,r){let o=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,i)=>{let a=t(n),s=()=>i.addIssue({code:I.custom,...o(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((o,n)=>t(o)?!0:(n.addIssue(typeof r=="function"?r(o,n):r),!1))}_refinement(t){return new Ct({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:r=>this["~validate"](r)}}optional(){return Rt.create(this,this._def)}nullable(){return ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this)}promise(){return un.create(this,this._def)}or(t){return Kn.create([this,t],this._def)}and(t){return Xn.create(this,t,this._def)}transform(t){return new Ct({...W(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ro({...W(this._def),innerType:this,defaultValue:r,typeName:z.ZodDefault})}brand(){return new Zs({typeName:z.ZodBranded,type:this,...W(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new no({...W(this._def),innerType:this,catchValue:r,typeName:z.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return qs.create(this,t)}readonly(){return oo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},TI=/^c[^\s-]{8,}$/i,II=/^[0-9a-z]+$/,EI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,PI=/^[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,zI=/^[a-z0-9_-]{21}$/i,RI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,CI=/^[-+]?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)?)??$/,OI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Dp,jI=/^(?:(?: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])$/,NI=/^(?:(?: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])$/,DI=/^(([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]))$/,MI=/^(([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])$/,UI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LI=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yv="((\\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])))",ZI=new RegExp(`^${Yv}$`);function Qv(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function qI(e){return new RegExp(`^${Qv(e)}$`)}function FI(e){let t=`${Yv}T${Qv(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function VI(e,t){return!!((t==="v4"||!t)&&jI.test(e)||(t==="v6"||!t)&&DI.test(e))}function BI(e,t){if(!RI.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let o=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(o));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||t&&n.alg!==t)}catch{return!1}}function HI(e,t){return!!((t==="v4"||!t)&&NI.test(e)||(t==="v6"||!t)&&MI.test(e))}var Jn=class e extends te{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N.string){let i=this._getOrReturnCtx(t);return O(i,{code:I.invalid_type,expected:N.string,received:i.parsedType}),B}let o=new Be,n;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(n=this._getOrReturnCtx(t,n),O(n,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")t.data.length>i.value&&(n=this._getOrReturnCtx(t,n),O(n,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(n=this._getOrReturnCtx(t,n),a?O(n,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&O(n,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")OI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"email",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")Dp||(Dp=new RegExp(AI,"u")),Dp.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"emoji",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")PI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"uuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")zI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"nanoid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")TI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"cuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")II.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"cuid2",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")EI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"ulid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),O(n,{validation:"url",code:I.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"regex",code:I.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(t,n),O(n,{code:I.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(n=this._getOrReturnCtx(t,n),O(n,{code:I.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(n=this._getOrReturnCtx(t,n),O(n,{code:I.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?FI(i).test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{code:I.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?ZI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{code:I.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?qI(i).test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{code:I.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?CI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"duration",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?VI(t.data,i.version)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"ip",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?BI(t.data,i.alg)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"jwt",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?HI(t.data,i.version)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"cidr",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?UI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"base64",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?LI.test(t.data)||(n=this._getOrReturnCtx(t,n),O(n,{validation:"base64url",code:I.invalid_string,message:i.message}),o.dirty()):ae.assertNever(i);return{status:o.value,value:t.data}}_regex(t,r,o){return this.refinement(n=>t.test(n),{validation:r,code:I.invalid_string,...M.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...M.errToObj(t)})}url(t){return this._addCheck({kind:"url",...M.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...M.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...M.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...M.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...M.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...M.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...M.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...M.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...M.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...M.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...M.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...M.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...M.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...M.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...M.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...M.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...M.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...M.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...M.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...M.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...M.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...M.errToObj(r)})}nonempty(t){return this.min(1,M.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Jn.create=e=>new Jn({checks:[],typeName:z.ZodString,coerce:e?.coerce??!1,...W(e)});function JI(e,t){let r=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,n=r>o?r:o,i=Number.parseInt(e.toFixed(n).replace(".","")),a=Number.parseInt(t.toFixed(n).replace(".",""));return i%a/10**n}var $i=class e extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==N.number){let i=this._getOrReturnCtx(t);return O(i,{code:I.invalid_type,expected:N.number,received:i.parsedType}),B}let o,n=new Be;for(let i of this._def.checks)i.kind==="int"?ae.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),O(o,{code:I.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),O(o,{code:I.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),O(o,{code:I.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?JI(t.data,i.value)!==0&&(o=this._getOrReturnCtx(t,o),O(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),O(o,{code:I.not_finite,message:i.message}),n.dirty()):ae.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,M.toString(r))}gt(t,r){return this.setLimit("min",t,!1,M.toString(r))}lte(t,r){return this.setLimit("max",t,!0,M.toString(r))}lt(t,r){return this.setLimit("max",t,!1,M.toString(r))}setLimit(t,r,o,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:o,message:M.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:M.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:M.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:M.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:M.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:M.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:M.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:M.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:M.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:M.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ae.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(r)&&Number.isFinite(t)}};$i.create=e=>new $i({checks:[],typeName:z.ZodNumber,coerce:e?.coerce||!1,...W(e)});var xi=class e extends te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==N.bigint)return this._getInvalidInput(t);let o,n=new Be;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),O(o,{code:I.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),O(o,{code:I.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),O(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):ae.assertNever(i);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return O(r,{code:I.invalid_type,expected:N.bigint,received:r.parsedType}),B}gte(t,r){return this.setLimit("min",t,!0,M.toString(r))}gt(t,r){return this.setLimit("min",t,!1,M.toString(r))}lte(t,r){return this.setLimit("max",t,!0,M.toString(r))}lt(t,r){return this.setLimit("max",t,!1,M.toString(r))}setLimit(t,r,o,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:o,message:M.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:M.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:M.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:M.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:M.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:M.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};xi.create=e=>new xi({checks:[],typeName:z.ZodBigInt,coerce:e?.coerce??!1,...W(e)});var wi=class extends te{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==N.boolean){let o=this._getOrReturnCtx(t);return O(o,{code:I.invalid_type,expected:N.boolean,received:o.parsedType}),B}return Xe(t.data)}};wi.create=e=>new wi({typeName:z.ZodBoolean,coerce:e?.coerce||!1,...W(e)});var Si=class e extends te{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==N.date){let i=this._getOrReturnCtx(t);return O(i,{code:I.invalid_type,expected:N.date,received:i.parsedType}),B}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return O(i,{code:I.invalid_date}),B}let o=new Be,n;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(n=this._getOrReturnCtx(t,n),O(n,{code:I.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(n=this._getOrReturnCtx(t,n),O(n,{code:I.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):ae.assertNever(i);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:M.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:M.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Si.create=e=>new Si({checks:[],coerce:e?.coerce||!1,typeName:z.ZodDate,...W(e)});var ki=class extends te{_parse(t){if(this._getType(t)!==N.symbol){let o=this._getOrReturnCtx(t);return O(o,{code:I.invalid_type,expected:N.symbol,received:o.parsedType}),B}return Xe(t.data)}};ki.create=e=>new ki({typeName:z.ZodSymbol,...W(e)});var Gn=class extends te{_parse(t){if(this._getType(t)!==N.undefined){let o=this._getOrReturnCtx(t);return O(o,{code:I.invalid_type,expected:N.undefined,received:o.parsedType}),B}return Xe(t.data)}};Gn.create=e=>new Gn({typeName:z.ZodUndefined,...W(e)});var Wn=class extends te{_parse(t){if(this._getType(t)!==N.null){let o=this._getOrReturnCtx(t);return O(o,{code:I.invalid_type,expected:N.null,received:o.parsedType}),B}return Xe(t.data)}};Wn.create=e=>new Wn({typeName:z.ZodNull,...W(e)});var Ti=class extends te{constructor(){super(...arguments),this._any=!0}_parse(t){return Xe(t.data)}};Ti.create=e=>new Ti({typeName:z.ZodAny,...W(e)});var Sr=class extends te{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Xe(t.data)}};Sr.create=e=>new Sr({typeName:z.ZodUnknown,...W(e)});var Bt=class extends te{_parse(t){let r=this._getOrReturnCtx(t);return O(r,{code:I.invalid_type,expected:N.never,received:r.parsedType}),B}};Bt.create=e=>new Bt({typeName:z.ZodNever,...W(e)});var Ii=class extends te{_parse(t){if(this._getType(t)!==N.undefined){let o=this._getOrReturnCtx(t);return O(o,{code:I.invalid_type,expected:N.void,received:o.parsedType}),B}return Xe(t.data)}};Ii.create=e=>new Ii({typeName:z.ZodVoid,...W(e)});var kr=class e extends te{_parse(t){let{ctx:r,status:o}=this._processInputParams(t),n=this._def;if(r.parsedType!==N.array)return O(r,{code:I.invalid_type,expected:N.array,received:r.parsedType}),B;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,s=r.data.length<n.exactLength.value;(a||s)&&(O(r,{code:a?I.too_big:I.too_small,minimum:s?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),o.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(O(r,{code:I.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),o.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(O(r,{code:I.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>n.type._parseAsync(new bt(r,a,r.path,s)))).then(a=>Be.mergeArray(o,a));let i=[...r.data].map((a,s)=>n.type._parseSync(new bt(r,a,r.path,s)));return Be.mergeArray(o,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:M.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:M.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:M.toString(r)}})}nonempty(t){return this.min(1,t)}};kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...W(t)});function Hn(e){if(e instanceof gt){let t={};for(let r in e.shape){let o=e.shape[r];t[r]=Rt.create(Hn(o))}return new gt({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:Hn(e.element)}):e instanceof Rt?Rt.create(Hn(e.unwrap())):e instanceof ur?ur.create(Hn(e.unwrap())):e instanceof cr?cr.create(e.items.map(t=>Hn(t))):e}var gt=class e extends te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=ae.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==N.object){let u=this._getOrReturnCtx(t);return O(u,{code:I.invalid_type,expected:N.object,received:u.parsedType}),B}let{status:o,ctx:n}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Bt&&this._def.unknownKeys==="strip"))for(let u in n.data)a.includes(u)||s.push(u);let c=[];for(let u of a){let l=i[u],p=n.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new bt(n,p,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Bt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(u==="strict")s.length>0&&(O(n,{code:I.unrecognized_keys,keys:s}),o.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of s){let p=n.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new bt(n,p,n.path,l)),alwaysSet:l in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let p=await l.key,m=await l.value;u.push({key:p,value:m,alwaysSet:l.alwaysSet})}return u}).then(u=>Be.mergeObjectSync(o,u)):Be.mergeObjectSync(o,c)}get shape(){return this._def.shape()}strict(t){return M.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,o)=>{let n=this._def.errorMap?.(r,o).message??o.defaultError;return r.code==="unrecognized_keys"?{message:M.errToObj(t).message??n}:{message:n}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:z.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let o of ae.objectKeys(t))t[o]&&this.shape[o]&&(r[o]=this.shape[o]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let o of ae.objectKeys(this.shape))t[o]||(r[o]=this.shape[o]);return new e({...this._def,shape:()=>r})}deepPartial(){return Hn(this)}partial(t){let r={};for(let o of ae.objectKeys(this.shape)){let n=this.shape[o];t&&!t[o]?r[o]=n:r[o]=n.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let o of ae.objectKeys(this.shape))if(t&&!t[o])r[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof Rt;)i=i._def.innerType;r[o]=i}return new e({...this._def,shape:()=>r})}keyof(){return e_(ae.objectKeys(this.shape))}};gt.create=(e,t)=>new gt({shape:()=>e,unknownKeys:"strip",catchall:Bt.create(),typeName:z.ZodObject,...W(t)});gt.strictCreate=(e,t)=>new gt({shape:()=>e,unknownKeys:"strict",catchall:Bt.create(),typeName:z.ZodObject,...W(t)});gt.lazycreate=(e,t)=>new gt({shape:e,unknownKeys:"strip",catchall:Bt.create(),typeName:z.ZodObject,...W(t)});var Kn=class extends te{_parse(t){let{ctx:r}=this._processInputParams(t),o=this._def.options;function n(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new ht(s.ctx.common.issues));return O(r,{code:I.invalid_union,unionErrors:a}),B}if(r.common.async)return Promise.all(o.map(async i=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let i,a=[];for(let c of o){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(c=>new ht(c));return O(r,{code:I.invalid_union,unionErrors:s}),B}}get options(){return this._def.options}};Kn.create=(e,t)=>new Kn({options:e,typeName:z.ZodUnion,...W(t)});var sr=e=>e instanceof Yn?sr(e.schema):e instanceof Ct?sr(e.innerType()):e instanceof Qn?[e.value]:e instanceof eo?e.options:e instanceof to?ae.objectValues(e.enum):e instanceof ro?sr(e._def.innerType):e instanceof Gn?[void 0]:e instanceof Wn?[null]:e instanceof Rt?[void 0,...sr(e.unwrap())]:e instanceof ur?[null,...sr(e.unwrap())]:e instanceof Zs||e instanceof oo?sr(e.unwrap()):e instanceof no?sr(e._def.innerType):[],Mp=class e extends te{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N.object)return O(r,{code:I.invalid_type,expected:N.object,received:r.parsedType}),B;let o=this.discriminator,n=r.data[o],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(O(r,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,o){let n=new Map;for(let i of r){let a=sr(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(n.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);n.set(s,i)}}return new e({typeName:z.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...W(o)})}};function Up(e,t){let r=ar(e),o=ar(t);if(e===t)return{valid:!0,data:e};if(r===N.object&&o===N.object){let n=ae.objectKeys(t),i=ae.objectKeys(e).filter(s=>n.indexOf(s)!==-1),a={...e,...t};for(let s of i){let c=Up(e[s],t[s]);if(!c.valid)return{valid:!1};a[s]=c.data}return{valid:!0,data:a}}else if(r===N.array&&o===N.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],c=Up(a,s);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===N.date&&o===N.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Xn=class extends te{_parse(t){let{status:r,ctx:o}=this._processInputParams(t),n=(i,a)=>{if(jp(i)||jp(a))return B;let s=Up(i.value,a.value);return s.valid?((Np(i)||Np(a))&&r.dirty(),{status:r.value,value:s.data}):(O(o,{code:I.invalid_intersection_types}),B)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,a])=>n(i,a)):n(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Xn.create=(e,t,r)=>new Xn({left:e,right:t,typeName:z.ZodIntersection,...W(r)});var cr=class e extends te{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.array)return O(o,{code:I.invalid_type,expected:N.array,received:o.parsedType}),B;if(o.data.length<this._def.items.length)return O(o,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&o.data.length>this._def.items.length&&(O(o,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...o.data].map((a,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new bt(o,a,o.path,s)):null}).filter(a=>!!a);return o.common.async?Promise.all(i).then(a=>Be.mergeArray(r,a)):Be.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};cr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cr({items:e,typeName:z.ZodTuple,rest:null,...W(t)})};var Lp=class e extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.object)return O(o,{code:I.invalid_type,expected:N.object,received:o.parsedType}),B;let n=[],i=this._def.keyType,a=this._def.valueType;for(let s in o.data)n.push({key:i._parse(new bt(o,s,o.path,s)),value:a._parse(new bt(o,o.data[s],o.path,s)),alwaysSet:s in o.data});return o.common.async?Be.mergeObjectAsync(r,n):Be.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,o){return r instanceof te?new e({keyType:t,valueType:r,typeName:z.ZodRecord,...W(o)}):new e({keyType:Jn.create(),valueType:t,typeName:z.ZodRecord,...W(r)})}},Ei=class extends te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.map)return O(o,{code:I.invalid_type,expected:N.map,received:o.parsedType}),B;let n=this._def.keyType,i=this._def.valueType,a=[...o.data.entries()].map(([s,c],u)=>({key:n._parse(new bt(o,s,o.path,[u,"key"])),value:i._parse(new bt(o,c,o.path,[u,"value"]))}));if(o.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of a){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return B;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of a){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return B;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}}}};Ei.create=(e,t,r)=>new Ei({valueType:t,keyType:e,typeName:z.ZodMap,...W(r)});var Pi=class e extends te{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.set)return O(o,{code:I.invalid_type,expected:N.set,received:o.parsedType}),B;let n=this._def;n.minSize!==null&&o.data.size<n.minSize.value&&(O(o,{code:I.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&o.data.size>n.maxSize.value&&(O(o,{code:I.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let i=this._def.valueType;function a(c){let u=new Set;for(let l of c){if(l.status==="aborted")return B;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let s=[...o.data.values()].map((c,u)=>i._parse(new bt(o,c,o.path,u)));return o.common.async?Promise.all(s).then(c=>a(c)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:M.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:M.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Pi.create=(e,t)=>new Pi({valueType:e,minSize:null,maxSize:null,typeName:z.ZodSet,...W(t)});var Zp=class e extends te{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N.function)return O(r,{code:I.invalid_type,expected:N.function,received:r.parsedType}),B;function o(s,c){return Ls({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_i(),wr].filter(u=>!!u),issueData:{code:I.invalid_arguments,argumentsError:c}})}function n(s,c){return Ls({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_i(),wr].filter(u=>!!u),issueData:{code:I.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof un){let s=this;return Xe(async function(...c){let u=new ht([]),l=await s._def.args.parseAsync(c,i).catch(f=>{throw u.addIssue(o(c,f)),u}),p=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(p,i).catch(f=>{throw u.addIssue(n(p,f)),u})})}else{let s=this;return Xe(function(...c){let u=s._def.args.safeParse(c,i);if(!u.success)throw new ht([o(c,u.error)]);let l=Reflect.apply(a,this,u.data),p=s._def.returns.safeParse(l,i);if(!p.success)throw new ht([n(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:cr.create(t).rest(Sr.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,o){return new e({args:t||cr.create([]).rest(Sr.create()),returns:r||Sr.create(),typeName:z.ZodFunction,...W(o)})}},Yn=class extends te{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Yn.create=(e,t)=>new Yn({getter:e,typeName:z.ZodLazy,...W(t)});var Qn=class extends te{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return O(r,{received:r.data,code:I.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:t.data}}get value(){return this._def.value}};Qn.create=(e,t)=>new Qn({value:e,typeName:z.ZodLiteral,...W(t)});function e_(e,t){return new eo({values:e,typeName:z.ZodEnum,...W(t)})}var eo=class e extends te{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),o=this._def.values;return O(r,{expected:ae.joinValues(o),received:r.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),o=this._def.values;return O(r,{received:r.data,code:I.invalid_enum_value,options:o}),B}return Xe(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...r})}};eo.create=e_;var to=class extends te{_parse(t){let r=ae.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==N.string&&o.parsedType!==N.number){let n=ae.objectValues(r);return O(o,{expected:ae.joinValues(n),received:o.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(ae.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let n=ae.objectValues(r);return O(o,{received:o.data,code:I.invalid_enum_value,options:n}),B}return Xe(t.data)}get enum(){return this._def.values}};to.create=(e,t)=>new to({values:e,typeName:z.ZodNativeEnum,...W(t)});var un=class extends te{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==N.promise&&r.common.async===!1)return O(r,{code:I.invalid_type,expected:N.promise,received:r.parsedType}),B;let o=r.parsedType===N.promise?r.data:Promise.resolve(r.data);return Xe(o.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};un.create=(e,t)=>new un({type:e,typeName:z.ZodPromise,...W(t)});var Ct=class extends te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:o}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:a=>{O(o,a),a.fatal?r.abort():r.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){let a=n.transform(o.data,i);if(o.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return B;let c=await this._def.schema._parseAsync({data:s,path:o.path,parent:o});return c.status==="aborted"?B:c.status==="dirty"?Bn(c.value):r.value==="dirty"?Bn(c.value):c});{if(r.value==="aborted")return B;let s=this._def.schema._parseSync({data:a,path:o.path,parent:o});return s.status==="aborted"?B:s.status==="dirty"?Bn(s.value):r.value==="dirty"?Bn(s.value):s}}if(n.type==="refinement"){let a=s=>{let c=n.refinement(s,i);if(o.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?B:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>s.status==="aborted"?B:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(n.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!cn(a))return B;let s=n.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>cn(a)?Promise.resolve(n.transform(a.value,i)).then(s=>({status:r.value,value:s})):B);ae.assertNever(n)}};Ct.create=(e,t,r)=>new Ct({schema:e,typeName:z.ZodEffects,effect:t,...W(r)});Ct.createWithPreprocess=(e,t,r)=>new Ct({schema:t,effect:{type:"preprocess",transform:e},typeName:z.ZodEffects,...W(r)});var Rt=class extends te{_parse(t){return this._getType(t)===N.undefined?Xe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Rt.create=(e,t)=>new Rt({innerType:e,typeName:z.ZodOptional,...W(t)});var ur=class extends te{_parse(t){return this._getType(t)===N.null?Xe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ur.create=(e,t)=>new ur({innerType:e,typeName:z.ZodNullable,...W(t)});var ro=class extends te{_parse(t){let{ctx:r}=this._processInputParams(t),o=r.data;return r.parsedType===N.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ro.create=(e,t)=>new ro({innerType:e,typeName:z.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...W(t)});var no=class extends te{_parse(t){let{ctx:r}=this._processInputParams(t),o={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return bi(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ht(o.common.issues)},input:o.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ht(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};no.create=(e,t)=>new no({innerType:e,typeName:z.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...W(t)});var zi=class extends te{_parse(t){if(this._getType(t)!==N.nan){let o=this._getOrReturnCtx(t);return O(o,{code:I.invalid_type,expected:N.nan,received:o.parsedType}),B}return{status:"valid",value:t.data}}};zi.create=e=>new zi({typeName:z.ZodNaN,...W(e)});var Zs=class extends te{_parse(t){let{ctx:r}=this._processInputParams(t),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}},qs=class e extends te{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?B:i.status==="dirty"?(r.dirty(),Bn(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let n=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return n.status==="aborted"?B:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:o.path,parent:o})}}static create(t,r){return new e({in:t,out:r,typeName:z.ZodPipeline})}},oo=class extends te{_parse(t){let r=this._def.innerType._parse(t),o=n=>(cn(n)&&(n.value=Object.freeze(n.value)),n);return bi(r)?r.then(n=>o(n)):o(r)}unwrap(){return this._def.innerType}};oo.create=(e,t)=>new oo({innerType:e,typeName:z.ZodReadonly,...W(t)});var XU={object:gt.lazycreate},z;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(z||(z={}));var YU=Jn.create,QU=$i.create,eL=zi.create,tL=xi.create,rL=wi.create,nL=Si.create,oL=ki.create,iL=Gn.create,aL=Wn.create,sL=Ti.create,cL=Sr.create,uL=Bt.create,lL=Ii.create,dL=kr.create,t_=gt.create,pL=gt.strictCreate,mL=Kn.create,fL=Mp.create,hL=Xn.create,gL=cr.create,yL=Lp.create,vL=Ei.create,_L=Pi.create,bL=Zp.create,$L=Yn.create,xL=Qn.create,wL=eo.create,SL=to.create,kL=un.create,TL=Ct.create,IL=Rt.create,EL=ur.create,PL=Ct.createWithPreprocess,zL=qs.create;var vt={};ir(vt,{$ZodAny:()=>qc,$ZodArray:()=>Jc,$ZodAsyncError:()=>Ot,$ZodBase64:()=>Cc,$ZodBase64URL:()=>Oc,$ZodBigInt:()=>Vi,$ZodBigIntFormat:()=>Mc,$ZodBoolean:()=>go,$ZodCIDRv4:()=>zc,$ZodCIDRv6:()=>Rc,$ZodCUID:()=>vc,$ZodCUID2:()=>_c,$ZodCatch:()=>du,$ZodCheck:()=>ye,$ZodCheckBigIntFormat:()=>Im,$ZodCheckEndsWith:()=>Um,$ZodCheckGreaterThan:()=>ac,$ZodCheckIncludes:()=>Dm,$ZodCheckLengthEquals:()=>Om,$ZodCheckLessThan:()=>ic,$ZodCheckLowerCase:()=>jm,$ZodCheckMaxLength:()=>Rm,$ZodCheckMaxSize:()=>Em,$ZodCheckMimeType:()=>Zm,$ZodCheckMinLength:()=>Cm,$ZodCheckMinSize:()=>Pm,$ZodCheckMultipleOf:()=>km,$ZodCheckNumberFormat:()=>Tm,$ZodCheckOverwrite:()=>qm,$ZodCheckProperty:()=>Lm,$ZodCheckRegex:()=>Am,$ZodCheckSizeEquals:()=>zm,$ZodCheckStartsWith:()=>Mm,$ZodCheckStringFormat:()=>ho,$ZodCheckUpperCase:()=>Nm,$ZodCodec:()=>vo,$ZodCustom:()=>_u,$ZodCustomStringFormat:()=>Nc,$ZodDate:()=>Hc,$ZodDefault:()=>su,$ZodDiscriminatedUnion:()=>Kc,$ZodE164:()=>Ac,$ZodEmail:()=>fc,$ZodEmoji:()=>gc,$ZodEncodeError:()=>Tr,$ZodEnum:()=>tu,$ZodError:()=>Ui,$ZodExactOptional:()=>iu,$ZodFile:()=>nu,$ZodFunction:()=>gu,$ZodGUID:()=>pc,$ZodIPv4:()=>Ic,$ZodIPv6:()=>Ec,$ZodISODate:()=>Sc,$ZodISODateTime:()=>wc,$ZodISODuration:()=>Tc,$ZodISOTime:()=>kc,$ZodIntersection:()=>Xc,$ZodJWT:()=>jc,$ZodKSUID:()=>xc,$ZodLazy:()=>vu,$ZodLiteral:()=>ru,$ZodMAC:()=>Pc,$ZodMap:()=>Qc,$ZodNaN:()=>pu,$ZodNanoID:()=>yc,$ZodNever:()=>Vc,$ZodNonOptional:()=>uu,$ZodNull:()=>Zc,$ZodNullable:()=>au,$ZodNumber:()=>Fi,$ZodNumberFormat:()=>Dc,$ZodObject:()=>Gc,$ZodObjectJIT:()=>Hm,$ZodOptional:()=>Hi,$ZodPipe:()=>mu,$ZodPrefault:()=>cu,$ZodPromise:()=>yu,$ZodReadonly:()=>fu,$ZodRealError:()=>at,$ZodRecord:()=>Yc,$ZodRegistry:()=>wu,$ZodSet:()=>eu,$ZodString:()=>Or,$ZodStringFormat:()=>he,$ZodSuccess:()=>lu,$ZodSymbol:()=>Uc,$ZodTemplateLiteral:()=>hu,$ZodTransform:()=>ou,$ZodTuple:()=>Bi,$ZodType:()=>J,$ZodULID:()=>bc,$ZodURL:()=>hc,$ZodUUID:()=>mc,$ZodUndefined:()=>Lc,$ZodUnion:()=>yo,$ZodUnknown:()=>Fc,$ZodVoid:()=>Bc,$ZodXID:()=>$c,$ZodXor:()=>Wc,$brand:()=>Ci,$constructor:()=>y,$input:()=>ku,$output:()=>Su,Doc:()=>qi,JSONSchema:()=>Lb,JSONSchemaGenerator:()=>ml,NEVER:()=>Fs,TimePrecision:()=>Pu,_any:()=>Ku,_array:()=>Jm,_base64:()=>da,_base64url:()=>pa,_bigint:()=>Fu,_boolean:()=>Zu,_catch:()=>tz,_check:()=>Ub,_cidrv4:()=>ua,_cidrv6:()=>la,_coercedBigint:()=>Vu,_coercedBoolean:()=>qu,_coercedDate:()=>tl,_coercedNumber:()=>ju,_coercedString:()=>Iu,_cuid:()=>ra,_cuid2:()=>na,_custom:()=>ol,_date:()=>el,_decode:()=>Ks,_decodeAsync:()=>Ys,_default:()=>YP,_discriminatedUnion:()=>LP,_e164:()=>ma,_email:()=>Wi,_emoji:()=>ea,_encode:()=>Ws,_encodeAsync:()=>Xs,_endsWith:()=>_n,_enum:()=>HP,_file:()=>nl,_float32:()=>Du,_float64:()=>Mu,_gt:()=>jt,_gte:()=>De,_guid:()=>$o,_includes:()=>yn,_int:()=>Nu,_int32:()=>Uu,_int64:()=>Bu,_intersection:()=>ZP,_ipv4:()=>sa,_ipv6:()=>ca,_isoDate:()=>Ru,_isoDateTime:()=>zu,_isoDuration:()=>Ou,_isoTime:()=>Cu,_jwt:()=>fa,_ksuid:()=>aa,_lazy:()=>iz,_length:()=>Nr,_literal:()=>GP,_lowercase:()=>hn,_lt:()=>At,_lte:()=>Ye,_mac:()=>Eu,_map:()=>VP,_max:()=>Ye,_maxLength:()=>jr,_maxSize:()=>pr,_mime:()=>bn,_min:()=>De,_minLength:()=>Ht,_minSize:()=>Nt,_multipleOf:()=>dr,_nan:()=>rl,_nanoid:()=>ta,_nativeEnum:()=>JP,_negative:()=>ga,_never:()=>Yu,_nonnegative:()=>va,_nonoptional:()=>QP,_nonpositive:()=>ya,_normalize:()=>$n,_null:()=>Wu,_nullable:()=>XP,_number:()=>Au,_optional:()=>KP,_overwrite:()=>xt,_parse:()=>lo,_parseAsync:()=>po,_pipe:()=>rz,_positive:()=>ha,_promise:()=>az,_property:()=>_a,_readonly:()=>nz,_record:()=>FP,_refine:()=>il,_regex:()=>fn,_safeDecode:()=>ec,_safeDecodeAsync:()=>rc,_safeEncode:()=>Qs,_safeEncodeAsync:()=>tc,_safeParse:()=>mo,_safeParseAsync:()=>fo,_set:()=>BP,_size:()=>Ar,_slugify:()=>wo,_startsWith:()=>vn,_string:()=>Tu,_stringFormat:()=>kn,_stringbool:()=>ul,_success:()=>ez,_superRefine:()=>al,_symbol:()=>Ju,_templateLiteral:()=>oz,_toLowerCase:()=>wn,_toUpperCase:()=>Sn,_transform:()=>WP,_trim:()=>xn,_tuple:()=>qP,_uint32:()=>Lu,_uint64:()=>Hu,_ulid:()=>oa,_undefined:()=>Gu,_union:()=>MP,_unknown:()=>Xu,_uppercase:()=>gn,_url:()=>xo,_uuid:()=>Ki,_uuidv4:()=>Xi,_uuidv6:()=>Yi,_uuidv7:()=>Qi,_void:()=>Qu,_xid:()=>ia,_xor:()=>UP,clone:()=>Ae,config:()=>Ee,createStandardJSONSchemaMethod:()=>So,createToJSONSchemaMethod:()=>Gm,decode:()=>f_,decodeAsync:()=>g_,describe:()=>sl,encode:()=>m_,encodeAsync:()=>h_,extractDefs:()=>Mr,finalize:()=>Ur,flattenError:()=>co,formatError:()=>uo,globalConfig:()=>Ri,globalRegistry:()=>je,initializeContext:()=>Dr,isValidBase64:()=>Bm,isValidBase64URL:()=>M_,isValidJWT:()=>U_,locales:()=>bo,meta:()=>cl,parse:()=>dn,parseAsync:()=>pn,prettifyError:()=>Gs,process:()=>fe,regexes:()=>st,registry:()=>Gi,safeDecode:()=>v_,safeDecodeAsync:()=>b_,safeEncode:()=>y_,safeEncodeAsync:()=>__,safeParse:()=>Rr,safeParseAsync:()=>Cr,toDotPath:()=>p_,toJSONSchema:()=>Tn,treeifyError:()=>Js,util:()=>E,version:()=>Fm});var Fs=Object.freeze({status:"aborted"});function y(e,t,r){function o(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let u=a.prototype,l=Object.keys(u);for(let p=0;p<l.length;p++){let m=l[p];m in s||(s[m]=u[m].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let u=r?.Parent?new i:this;o(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Ci=Symbol("zod_brand"),Ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ri={};function Ee(e){return e&&Object.assign(Ri,e),Ri}var E={};ir(E,{BIGINT_FORMAT_RANGES:()=>Kp,Class:()=>Fp,NUMBER_FORMAT_RANGES:()=>Wp,aborted:()=>zr,allowsEval:()=>Hp,assert:()=>eE,assertEqual:()=>KI,assertIs:()=>YI,assertNever:()=>QI,assertNotEqual:()=>XI,assignProp:()=>Er,base64ToUint8Array:()=>u_,base64urlToUint8Array:()=>dE,cached:()=>ao,captureStackTrace:()=>Bs,cleanEnum:()=>lE,cleanRegex:()=>ji,clone:()=>Ae,cloneDef:()=>rE,createTransparentProxy:()=>cE,defineLazy:()=>K,esc:()=>Vs,escapeRegex:()=>$t,extend:()=>i_,finalizeIssue:()=>it,floatSafeRemainder:()=>Vp,getElementAtPath:()=>nE,getEnumValues:()=>Ai,getLengthableOrigin:()=>Mi,getParsedType:()=>sE,getSizableOrigin:()=>Di,hexToUint8Array:()=>mE,isObject:()=>ln,isPlainObject:()=>Pr,issue:()=>so,joinValues:()=>_,jsonStringifyReplacer:()=>io,merge:()=>uE,mergeDefs:()=>lr,normalizeParams:()=>R,nullish:()=>Ir,numKeys:()=>aE,objectClone:()=>tE,omit:()=>o_,optionalKeys:()=>Gp,parsedType:()=>P,partial:()=>s_,pick:()=>n_,prefixIssues:()=>yt,primitiveTypes:()=>Jp,promiseAllObject:()=>oE,propertyKeyTypes:()=>Ni,randomString:()=>iE,required:()=>c_,safeExtend:()=>a_,shallowClone:()=>Hs,slugify:()=>Bp,stringifyPrimitive:()=>T,uint8ArrayToBase64:()=>l_,uint8ArrayToBase64url:()=>pE,uint8ArrayToHex:()=>fE,unwrapMessage:()=>Oi});function KI(e){return e}function XI(e){return e}function YI(e){}function QI(e){throw new Error("Unexpected value in exhaustive check")}function eE(e){}function Ai(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function _(e,t="|"){return e.map(r=>T(r)).join(t)}function io(e,t){return typeof t=="bigint"?t.toString():t}function ao(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ir(e){return e==null}function ji(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Vp(e,t){let r=(e.toString().split(".")[1]||"").length,o=t.toString(),n=(o.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c?.[1]&&(n=Number.parseInt(c[1]))}let i=r>n?r:n,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}var r_=Symbol("evaluating");function K(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==r_)return o===void 0&&(o=r_,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tE(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Er(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function lr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function rE(e){return lr(e._zod.def)}function nE(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function oE(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function iE(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function Vs(e){return JSON.stringify(e)}function Bp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Bs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ln(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Hp=ao(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pr(e){if(ln(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ln(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Hs(e){return Pr(e)?{...e}:Array.isArray(e)?[...e]:e}function aE(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var sE=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ni=new Set(["string","number","symbol"]),Jp=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ae(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function R(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function cE(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function T(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Gp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Wp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function n_(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=lr(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return Er(this,"shape",a),a},checks:[]});return Ae(e,i)}function o_(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=lr(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Er(this,"shape",a),a},checks:[]});return Ae(e,i)}function i_(e,t){if(!Pr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=lr(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Er(this,"shape",i),i}});return Ae(e,n)}function a_(e,t){if(!Pr(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=lr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Er(this,"shape",o),o}});return Ae(e,r)}function uE(e,t){let r=lr(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Er(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ae(e,r)}function s_(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=lr(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(r)for(let u in r){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)c[u]=e?new e({type:"optional",innerType:s[u]}):s[u];return Er(this,"shape",c),c},checks:[]});return Ae(t,a)}function c_(e,t,r){let o=lr(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return Er(this,"shape",i),i}});return Ae(t,o)}function zr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function yt(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Oi(e){return typeof e=="string"?e:e?.message}function it(e,t,r){let o={...e,path:e.path??[]};if(!e.message){let n=Oi(e.inst?._zod.def?.error?.(e))??Oi(t?.error?.(e))??Oi(r.customError?.(e))??Oi(r.localeError?.(e))??"Invalid input";o.message=n}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Di(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Mi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function P(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function so(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function lE(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function u_(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function l_(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function dE(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return u_(t+r)}function pE(e){return l_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mE(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function fE(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Fp=class{constructor(...t){}};var d_=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,io,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ui=y("$ZodError",d_),at=y("$ZodError",d_,{Parent:Error});function co(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function uo(e,t=r=>r.message){let r={_errors:[]},o=n=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(t(i));else{let a=r,s=0;for(;s<i.path.length;){let c=i.path[s];s===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(i))):a[c]=a[c]||{_errors:[]},a=a[c],s++}}};return o(e),r}function Js(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},c.path));else if(c.code==="invalid_key")o({issues:c.issues},c.path);else if(c.code==="invalid_element")o({issues:c.issues},c.path);else{let u=[...i,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,p=0;for(;p<u.length;){let m=u[p],f=p===u.length-1;typeof m=="string"?(l.properties??(l.properties={}),(a=l.properties)[m]??(a[m]={errors:[]}),l=l.properties[m]):(l.items??(l.items=[]),(s=l.items)[m]??(s[m]={errors:[]}),l=l.items[m]),f&&l.errors.push(t(c)),p++}}};return o(e),r}function p_(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Gs(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${p_(o.path)}`);return t.join(`
47
47
  `)}var lo=e=>(t,r,o,n)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Ot;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>it(c,i,Ee())));throw Bs(s,n?.callee),s}return a.value},dn=lo(at),po=e=>async(t,r,o,n)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(c=>it(c,i,Ee())));throw Bs(s,n?.callee),s}return a.value},pn=po(at),mo=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Ot;return i.issues.length?{success:!1,error:new(e??Ui)(i.issues.map(a=>it(a,n,Ee())))}:{success:!0,data:i.value}},Rr=mo(at),fo=e=>async(t,r,o)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>it(a,n,Ee())))}:{success:!0,data:i.value}},Cr=fo(at),Ws=e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return lo(e)(t,r,n)},m_=Ws(at),Ks=e=>(t,r,o)=>lo(e)(t,r,o),f_=Ks(at),Xs=e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return po(e)(t,r,n)},h_=Xs(at),Ys=e=>async(t,r,o)=>po(e)(t,r,o),g_=Ys(at),Qs=e=>(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return mo(e)(t,r,n)},y_=Qs(at),ec=e=>(t,r,o)=>mo(e)(t,r,o),v_=ec(at),tc=e=>async(t,r,o)=>{let n=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return fo(e)(t,r,n)},__=tc(at),rc=e=>async(t,r,o)=>fo(e)(t,r,o),b_=rc(at);var st={};ir(st,{base64:()=>pm,base64url:()=>nc,bigint:()=>vm,boolean:()=>bm,browserEmail:()=>wE,cidrv4:()=>lm,cidrv6:()=>dm,cuid:()=>Xp,cuid2:()=>Yp,date:()=>fm,datetime:()=>gm,domain:()=>TE,duration:()=>nm,e164:()=>mm,email:()=>im,emoji:()=>am,extendedDuration:()=>gE,guid:()=>om,hex:()=>IE,hostname:()=>kE,html5Email:()=>bE,idnEmail:()=>xE,integer:()=>_m,ipv4:()=>sm,ipv6:()=>cm,ksuid:()=>tm,lowercase:()=>wm,mac:()=>um,md5_base64:()=>PE,md5_base64url:()=>zE,md5_hex:()=>EE,nanoid:()=>rm,null:()=>$m,number:()=>oc,rfc5322Email:()=>$E,sha1_base64:()=>CE,sha1_base64url:()=>OE,sha1_hex:()=>RE,sha256_base64:()=>jE,sha256_base64url:()=>NE,sha256_hex:()=>AE,sha384_base64:()=>ME,sha384_base64url:()=>UE,sha384_hex:()=>DE,sha512_base64:()=>ZE,sha512_base64url:()=>qE,sha512_hex:()=>LE,string:()=>ym,time:()=>hm,ulid:()=>Qp,undefined:()=>xm,unicodeEmail:()=>$_,uppercase:()=>Sm,uuid:()=>mn,uuid4:()=>yE,uuid6:()=>vE,uuid7:()=>_E,xid:()=>em});var Xp=/^[cC][^\s-]{8,}$/,Yp=/^[0-9a-z]+$/,Qp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,em=/^[0-9a-vA-V]{20}$/,tm=/^[A-Za-z0-9]{27}$/,rm=/^[a-zA-Z0-9_-]{21}$/,nm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gE=/^[-+]?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)?)??$/,om=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,yE=mn(4),vE=mn(6),_E=mn(7),im=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$E=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,$_=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xE=$_,wE=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,SE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function am(){return new RegExp(SE,"u")}var sm=/^(?:(?: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])$/,cm=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,um=e=>{let t=$t(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},lm=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,dm=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nc=/^[A-Za-z0-9_-]*$/,kE=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,TE=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mm=/^\+[1-9]\d{6,14}$/,x_="(?:(?:\\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])))",fm=new RegExp(`^${x_}$`);function w_(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function hm(e){return new RegExp(`^${w_(e)}$`)}function gm(e){let t=w_({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${x_}T(?:${o})$`)}var ym=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},vm=/^-?\d+n?$/,_m=/^-?\d+$/,oc=/^-?\d+(?:\.\d+)?$/,bm=/^(?:true|false)$/i,$m=/^null$/i;var xm=/^undefined$/i;var wm=/^[^A-Z]*$/,Sm=/^[^a-z]*$/,IE=/^[0-9a-fA-F]*$/;function Li(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Zi(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var EE=/^[0-9a-fA-F]{32}$/,PE=Li(22,"=="),zE=Zi(22),RE=/^[0-9a-fA-F]{40}$/,CE=Li(27,"="),OE=Zi(27),AE=/^[0-9a-fA-F]{64}$/,jE=Li(43,"="),NE=Zi(43),DE=/^[0-9a-fA-F]{96}$/,ME=Li(64,""),UE=Zi(64),LE=/^[0-9a-fA-F]{128}$/,ZE=Li(86,"=="),qE=Zi(86);var ye=y("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),k_={number:"number",bigint:"bigint",object:"date"},ic=y("$ZodCheckLessThan",(e,t)=>{ye.init(e,t);let r=k_[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ac=y("$ZodCheckGreaterThan",(e,t)=>{ye.init(e,t);let r=k_[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),km=y("$ZodCheckMultipleOf",(e,t)=>{ye.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Vp(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Tm=y("$ZodCheckNumberFormat",(e,t)=>{ye.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=Wp[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=_m)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Im=y("$ZodCheckBigIntFormat",(e,t)=>{ye.init(e,t);let[r,o]=Kp[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Em=y("$ZodCheckMaxSize",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ir(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:Di(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Pm=y("$ZodCheckMinSize",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ir(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:Di(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zm=y("$ZodCheckSizeEquals",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ir(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:Di(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Rm=y("$ZodCheckMaxLength",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ir(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=Mi(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Cm=y("$ZodCheckMinLength",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ir(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=Mi(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Om=y("$ZodCheckLengthEquals",(e,t)=>{var r;ye.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Ir(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=Mi(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),ho=y("$ZodCheckStringFormat",(e,t)=>{var r,o;ye.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Am=y("$ZodCheckRegex",(e,t)=>{ho.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),jm=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=wm),ho.init(e,t)}),Nm=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sm),ho.init(e,t)}),Dm=y("$ZodCheckIncludes",(e,t)=>{ye.init(e,t);let r=$t(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mm=y("$ZodCheckStartsWith",(e,t)=>{ye.init(e,t);let r=new RegExp(`^${$t(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Um=y("$ZodCheckEndsWith",(e,t)=>{ye.init(e,t);let r=new RegExp(`.*${$t(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function S_(e,t,r){e.issues.length&&t.issues.push(...yt(r,e.issues))}var Lm=y("$ZodCheckProperty",(e,t)=>{ye.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>S_(n,r,t.property));S_(o,r,t.property)}}),Zm=y("$ZodCheckMimeType",(e,t)=>{ye.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),qm=y("$ZodCheckOverwrite",(e,t)=>{ye.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var qi=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
package/ai/reference.md CHANGED
@@ -10,7 +10,7 @@ diagnostic tools; when possible, confirm a non-empty render with evidence.
10
10
  - Install: `npm install semiotic`
11
11
  <!-- semiotic-bundle-sizes:start -->
12
12
  <!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
13
- - **Use sub-path imports** — `semiotic/atlas` (270KB gz), `semiotic/atlas/core` (13KB gz), `semiotic/access` (28KB gz), `semiotic/evidence` (44KB gz), `semiotic/artifact` (121KB gz), `semiotic/artifact/react` (4KB gz), `semiotic/line` (134KB gz), `semiotic/xy` (164KB gz), `semiotic/ordinal` (128KB gz), `semiotic/network` (148KB gz), `semiotic/geo` (106KB gz), `semiotic/realtime` (163KB gz), `semiotic/realtime/core` (162KB gz), `semiotic/realtime/react` (1KB gz), `semiotic/server` (243KB gz), `semiotic/server/node` (243KB gz), `semiotic/server/edge` (250KB gz), `semiotic/utils` (99KB gz), `semiotic/utils/core` (92KB gz), `semiotic/utils/react` (7KB gz), `semiotic/recipes` (110KB gz), `semiotic/recipes/core` (102KB gz), `semiotic/recipes/react` (7KB gz), `semiotic/themes` (11KB gz), `semiotic/themes/core` (11KB gz), `semiotic/themes/react` (6KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/physics` (164KB gz), `semiotic/physics/matter` (1KB gz), `semiotic/physics/rapier` (1KB gz), `semiotic/ai` (595KB gz), `semiotic/ai/core` (138KB gz), `semiotic/controls` (11KB gz), `semiotic/rough` (3KB gz), `semiotic/text` (2KB gz). Full `semiotic` is 374KB gz.
13
+ - **Use sub-path imports** — `semiotic/atlas` (270KB gz), `semiotic/atlas/core` (13KB gz), `semiotic/access` (28KB gz), `semiotic/evidence` (44KB gz), `semiotic/artifact` (121KB gz), `semiotic/artifact/react` (4KB gz), `semiotic/line` (134KB gz), `semiotic/xy` (164KB gz), `semiotic/ordinal` (128KB gz), `semiotic/network` (148KB gz), `semiotic/geo` (106KB gz), `semiotic/realtime` (164KB gz), `semiotic/realtime/core` (163KB gz), `semiotic/realtime/react` (1KB gz), `semiotic/server` (243KB gz), `semiotic/server/node` (243KB gz), `semiotic/server/edge` (250KB gz), `semiotic/utils` (99KB gz), `semiotic/utils/core` (92KB gz), `semiotic/utils/react` (7KB gz), `semiotic/recipes` (110KB gz), `semiotic/recipes/core` (102KB gz), `semiotic/recipes/react` (7KB gz), `semiotic/themes` (11KB gz), `semiotic/themes/core` (11KB gz), `semiotic/themes/react` (6KB gz), `semiotic/data` (4KB gz), `semiotic/value` (6KB gz), `semiotic/physics` (165KB gz), `semiotic/physics/matter` (1KB gz), `semiotic/physics/rapier` (1KB gz), `semiotic/ai` (595KB gz), `semiotic/ai/core` (138KB gz), `semiotic/controls` (11KB gz), `semiotic/rough` (3KB gz), `semiotic/text` (2KB gz). Full `semiotic` is 374KB gz.
14
14
  <!-- semiotic-bundle-sizes:end -->
15
15
  - CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor|--audit-a11y|--evaluate]` · MCP: `npx semiotic-mcp`
16
16
 
@@ -338,7 +338,7 @@ or geo custom charts; a server renderer cannot read a browser's selection store.
338
338
  **LinkedCharts** — `selections`. **CategoryColorProvider** — `colors`|`categories` + `colorScheme`.
339
339
  Chart props: `selection`, `linkedHover`, `linkedBrush`. Hooks: `useSelection`, `useLinkedHover`, `useBrushSelection`. Works for `NetworkCustomChart` too — the resolved selection predicate is threaded into the custom layout as `ctx.selection`.
340
340
  **`useSelectionActions(name)`** — write-only access (`selectPoints`/`clear`) that does NOT subscribe to selection state, so a *container* can push a selection (e.g. from a hover handler) without re-rendering; only the leaf consumers reading the selection re-render. The provider-at-top / consumers-at-leaves pattern for interaction-heavy coordinated views.
341
- **Shared categories inside LinkedCharts → wrap in `CategoryColorProvider`.** Gives identical per-category colors AND makes LinkedCharts render one unified legend (suppressing individual chart legends). Without it, mismatched colors and duplicate legends.
341
+ **Shared categories inside LinkedCharts:** generated colors keep charts without an explicit palette consistent. A child's `colorScheme` overrides those generated defaults; wrap in `CategoryColorProvider` to explicitly assign shared category colors above each child's palette. LinkedCharts builds its unified legend from resolved chart colors. If charts use different colors for the same category, it retains individual legends instead.
342
342
  **Linked crosshair**: `linkedHover={{ name: "sync", mode: "x-position", xField: "time" }}`. Click locks crosshair (dashed white); click/Escape unlocks.
343
343
  **Linked series highlight** (series↔bar cross-highlight): `linkedHover={{ name: "sync", mode: "series" }}` auto-resolves the chart's series-identity field (colorBy/lineBy/areaBy/stackBy/groupBy) and keys the linked selection off it — no hand-wired `fields`. Add `seriesField: "region"` to override (align charts whose series live under different prop names). Modes are exclusive: `mode` is `"field"` (default) | `"x-position"` (crosshair) | `"series"`.
344
344
  **CircularBrush** — accessible range brush over a **cyclical** domain (day-of-year, hour, compass): `value` ({start,end}) / `onChange` (value | updater) / `period` (365) / `radius` / `step`+`largeStep` / `formatValue` / `arcFill`/`stroke`. Wrap-around ranges, pointer-capture drag, and full keyboard control (each handle + the range is a `role="slider"`, ←/→ nudges, Shift = `largeStep`). The radial counterpart to the linear `RealtimeHistogram` brush. **Control-surface contract**: it takes value/domain/geometry/`onChange` and never reaches into a chart — layer it over a chart sharing its coordinate space and feed `onChange` into your state (or the selection store). Built on the cyclical + radial kit.
@@ -399,7 +399,7 @@ CSS custom properties: `--semiotic-{bg, text, text-secondary, border, grid, prim
399
399
  <ThemeProvider theme={{ mode: "dark", colors: { categorical: [...] } }}> {/* merge onto dark base */}
400
400
  ```
401
401
 
402
- **Color priority** (with `colorBy`): CategoryColorProvider/LinkedCharts map > `colorScheme` > ThemeProvider `colors.categorical` > `"category10"`. `colorScheme` accepts a named scheme (`"tableau10"`), an array, or a `{category: color}` **object map** for exact per-category colors (no array ordering to keep in sync).
402
+ **Color priority** (with `colorBy`): explicit CategoryColorProvider mappings (including those inherited through LinkedCharts) > `colorScheme` > ThemeProvider `colors.categorical` > `"category10"`. LinkedCharts registration-order defaults do not override `colorScheme`. `colorScheme` accepts a named scheme (`"tableau10"`), an array, or a `{category: color}` **object map** for exact per-category colors (no array ordering to keep in sync).
403
403
  Presets: `light`, `dark`, `high-contrast`, `pastels`(-dark), `bi-tool`(-dark), `italian`(-dark), `tufte`(-dark), `journalist`(-dark), `playful`(-dark), `carbon`(-dark).
404
404
  Serialization: `themeToCSS(theme, selector)`, `themeToTokens(theme)`, `designTokensToTheme(tokens)`, `resolveThemePreset(name)`. Native `semiotic.*` tokens round-trip title/legend size, family, and weight along with the base typography and color roles.
405
405
 
@@ -499,7 +499,7 @@ These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `s
499
499
  Agent action: Use an actionable cursor only when the application separately supplies documented click or observation behavior and an accessible activation path. Treat cursor in serialized/static output as visual metadata, never as proof that a mark is interactive.
500
500
  - **Data required by usage mode** (`props.data-required-by-usage-mode`): Static usage (`renderChart`, MCP previews, SSR snapshots, and copy/paste examples with immediate data) requires data in props. React push mode selects live ingestion by omitting data and mutating through a ref.
501
501
  Agent action: Pass usageMode="push" to `semiotic-ai --doctor` when validating ref-based JSX with no data prop. Keep usageMode="static" or omit it for renderChart/MCP/static configs where data must be present.
502
- - **Categorical color precedence** (`color.category-precedence`): When colorBy is set, CategoryColorProvider/LinkedCharts category maps win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback.
502
+ - **Categorical color precedence** (`color.category-precedence`): When colorBy is set, explicit CategoryColorProvider mappings, including those inherited through LinkedCharts, win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback. Generated LinkedCharts colors do not override a child's colorScheme.
503
503
  Agent action: Use colorBy for categorical encodings. Use CategoryColorProvider or LinkedCharts for cross-chart consistency, colorScheme for per-chart fallback palettes, and avoid frameProps style functions unless intentionally bypassing HOC color resolution.
504
504
  - **Required prop combinations** (`props.required-combinations`): Some chart families need semantic props beyond data. These combinations are enforced by validation/schema for static configs and remain required in push mode unless explicitly noted.
505
505
  Agent action: Before returning code, check the selected component against the required combinations list. For push mode, omit data but keep semantic props such as areaBy, sizeBy, stackBy, and groupBy.
package/ai/schema.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "name": "semiotic",
4
- "version": "3.10.2",
4
+ "version": "3.10.3",
5
5
  "description": "React data visualization library for charts, networks, and beyond",
6
6
  "tools": [
7
7
  {
@@ -7,7 +7,7 @@
7
7
  "src/components/semiotic-ai.ts",
8
8
  "ai/mcp-server.ts"
9
9
  ],
10
- "version": "3.10.2",
10
+ "version": "3.10.3",
11
11
  "components": {
12
12
  "schema": 64,
13
13
  "aiChartExports": 56,
@@ -113,7 +113,7 @@ These rules are generated from `ai/behaviorContracts.cjs` and are consumed by `s
113
113
  - **Accessible chart text uses direct chart props** (`accessibility.description-props`): High-level charts expose title for the visible name, description for a concise accessible description, summary for a screen-reader-only takeaway and interaction guidance, and accessibleTable for the data-table fallback.
114
114
  - **Cursor styling does not create behavior** (`interaction.cursor-is-presentation-only`): Cursor values in realtime props, retained mark styles, styleRules, and custom hit targets change pointer presentation only. They do not install click handlers, keyboard activation, observations, or accessibility semantics.
115
115
  - **Data required by usage mode** (`props.data-required-by-usage-mode`): Static usage (`renderChart`, MCP previews, SSR snapshots, and copy/paste examples with immediate data) requires data in props. React push mode selects live ingestion by omitting data and mutating through a ref.
116
- - **Categorical color precedence** (`color.category-precedence`): When colorBy is set, CategoryColorProvider/LinkedCharts category maps win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback.
116
+ - **Categorical color precedence** (`color.category-precedence`): When colorBy is set, explicit CategoryColorProvider mappings, including those inherited through LinkedCharts, win for mapped categories. Unmapped categories fall back to explicit colorScheme, then ThemeProvider colors.categorical, then the built-in categorical fallback. Generated LinkedCharts colors do not override a child's colorScheme.
117
117
  - **Required prop combinations** (`props.required-combinations`): Some chart families need semantic props beyond data. These combinations are enforced by validation/schema for static configs and remain required in push mode unless explicitly noted.
118
118
  Required combinations: StackedAreaChart: static data + areaBy; push areaBy. Stacked areas need a flat data array plus areaBy to identify the stacked series. BubbleChart: static data + sizeBy; push sizeBy. Bubbles need sizeBy in addition to x/y accessors so radius encodes data rather than a constant point size. StackedBarChart: static data + stackBy; push stackBy. Stacked bars need stackBy to split each category into stack segments. GroupedBarChart: static data + groupBy; push groupBy. Grouped bars need groupBy to split each category into side-by-side bars. SwimlaneChart: static data + subcategoryAccessor; push subcategoryAccessor. Swimlanes need subcategoryAccessor; colorBy defaults to the same field when not provided. GaugeChart: static value; push not supported. GaugeChart is value-only. Its thresholds use { value, color, label? }; BigNumber thresholds use the distinct { at, level, color?, label? } vocabulary. ForceDirectedGraph: static nodes + edges; push nodes + edges. ForceDirectedGraph schema/rendering requires nodes and edges. If an agent infers nodes from edge endpoints, it must materialize a nodes array before returning code.
119
119
  - **Push mode omits data** (`streaming.push-mode-data`): HOC push mode is selected by omitting the data prop entirely. Passing data={[]} is static empty data and can clear/reinitialize the frame on render.
@@ -7,16 +7,16 @@
7
7
  "route": "/tasks/compare-category-totals",
8
8
  "identity": {
9
9
  "packageName": "semiotic",
10
- "packageVersion": "3.10.2",
10
+ "packageVersion": "3.10.3",
11
11
  "channel": "source",
12
- "sourceRevision": "sha256:3cf6701c453ebddb4c3f0d425983a4977f4a2d3d5220396c43e35ebb65453727",
12
+ "sourceRevision": "sha256:03b9d282fdf261fc90d262ec74bead44e05d6e3a8c11c2357d9b8242d8d1bc7b",
13
13
  "revisionKind": "content-digest",
14
14
  "runtime": {
15
- "digest": "sha256:c2aac1145bd9945c21e1ea12eeaf0f29ba1f3e55f04b06c31a4b5403293cf8b5",
15
+ "digest": "sha256:8aa926db2e659e8e7a1fa37d00c7d22c67179d97c9b192b44e86bb678f1f22f4",
16
16
  "fileCount": 1171
17
17
  },
18
18
  "taskSources": {
19
- "digest": "sha256:75a490ba8eb66ac32b45fb47c49bdc0e03cdd5b82b7826d7f6d638f07dd60558",
19
+ "digest": "sha256:bd8f750c15145f453eb3be245e55cf5fe6efd2c976761edd3efbbd2f798abbf9",
20
20
  "fileCount": 36
21
21
  },
22
22
  "availability": "Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks."
@@ -4,8 +4,8 @@
4
4
 
5
5
  Compare three totals in React, inspect their exact values, and verify the server-rendered bar geometry.
6
6
 
7
- Source package: semiotic@3.10.2. Channel: source.
8
- Source revision: sha256:3cf6701c453ebddb4c3f0d425983a4977f4a2d3d5220396c43e35ebb65453727. Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks.
7
+ Source package: semiotic@3.10.3. Channel: source.
8
+ Source revision: sha256:03b9d282fdf261fc90d262ec74bead44e05d6e3a8c11c2357d9b8242d8d1bc7b. Verified source checkout guidance; npm package, hosted site and MCP deployment identities require separate checks.
9
9
 
10
10
  ## The job
11
11