@honua/sdk-esri-compat 0.1.12 → 0.1.14

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 (250) hide show
  1. package/README.md +2 -0
  2. package/columnar/apache-arrow.d.ts +17 -0
  3. package/columnar/apache-arrow.d.ts.map +1 -0
  4. package/columnar/apache-arrow.js +1036 -0
  5. package/columnar/batch-cache-conformance.d.ts +66 -0
  6. package/columnar/batch-cache-conformance.d.ts.map +1 -0
  7. package/columnar/batch-cache-conformance.js +317 -0
  8. package/columnar/batch-cache-indexeddb.d.ts +31 -0
  9. package/columnar/batch-cache-indexeddb.d.ts.map +1 -0
  10. package/columnar/batch-cache-indexeddb.js +148 -0
  11. package/columnar/batch-cache.d.ts +298 -0
  12. package/columnar/batch-cache.d.ts.map +1 -0
  13. package/columnar/batch-cache.js +757 -0
  14. package/columnar/geoarrow-aggregate.d.ts +178 -0
  15. package/columnar/geoarrow-aggregate.d.ts.map +1 -0
  16. package/columnar/geoarrow-aggregate.js +976 -0
  17. package/columnar/geoarrow-patch.d.ts +382 -0
  18. package/columnar/geoarrow-patch.d.ts.map +1 -0
  19. package/columnar/geoarrow-patch.js +1656 -0
  20. package/columnar/geoarrow-reproject.d.ts +22 -0
  21. package/columnar/geoarrow-reproject.d.ts.map +1 -0
  22. package/columnar/geoarrow-reproject.js +119 -0
  23. package/columnar/geoarrow-serialization.d.ts +68 -0
  24. package/columnar/geoarrow-serialization.d.ts.map +1 -0
  25. package/columnar/geoarrow-serialization.js +331 -0
  26. package/columnar/geoarrow-types.d.ts +271 -0
  27. package/columnar/geoarrow-types.d.ts.map +1 -0
  28. package/columnar/geoarrow-types.js +15 -0
  29. package/columnar/geoarrow.d.ts +52 -0
  30. package/columnar/geoarrow.d.ts.map +1 -0
  31. package/columnar/geoarrow.js +1469 -0
  32. package/columnar/index.d.ts +43 -0
  33. package/columnar/index.d.ts.map +1 -0
  34. package/columnar/index.js +29 -0
  35. package/columnar/operators.d.ts +70 -0
  36. package/columnar/operators.d.ts.map +1 -0
  37. package/columnar/operators.js +307 -0
  38. package/columnar/result.d.ts +369 -0
  39. package/columnar/result.d.ts.map +1 -0
  40. package/columnar/result.js +815 -0
  41. package/columnar/telemetry.d.ts +152 -0
  42. package/columnar/telemetry.d.ts.map +1 -0
  43. package/columnar/telemetry.js +265 -0
  44. package/columnar/transfer.d.ts +28 -0
  45. package/columnar/transfer.d.ts.map +1 -0
  46. package/columnar/transfer.js +669 -0
  47. package/columnar/types.d.ts +175 -0
  48. package/columnar/types.d.ts.map +1 -0
  49. package/columnar/types.js +22 -0
  50. package/columnar/worker.d.ts +157 -0
  51. package/columnar/worker.d.ts.map +1 -0
  52. package/columnar/worker.js +1059 -0
  53. package/connect-url-safety.d.ts +53 -0
  54. package/connect-url-safety.js +189 -0
  55. package/contract/pmtiles.d.ts +6 -5
  56. package/contract/pmtiles.d.ts.map +1 -1
  57. package/contract/pmtiles.js +30 -5
  58. package/contract/source.d.ts.map +1 -1
  59. package/contract/source.js +11 -8
  60. package/core/client.d.ts.map +1 -1
  61. package/core/client.js +87 -19
  62. package/core/deprecation-notice.d.ts +28 -0
  63. package/core/deprecation-notice.d.ts.map +1 -0
  64. package/core/deprecation-notice.js +22 -0
  65. package/core/esri-geojson.d.ts.map +1 -1
  66. package/core/esri-geojson.js +14 -8
  67. package/core/optional-grpc-peer.d.ts +15 -0
  68. package/core/optional-grpc-peer.d.ts.map +1 -0
  69. package/core/optional-grpc-peer.js +60 -0
  70. package/esri-compat/basemap-gallery.d.ts +2 -0
  71. package/esri-compat/basemap-gallery.d.ts.map +1 -1
  72. package/esri-compat/basemap-gallery.js +12 -0
  73. package/esri-compat/basemap.d.ts +4 -0
  74. package/esri-compat/basemap.d.ts.map +1 -1
  75. package/esri-compat/basemap.js +70 -0
  76. package/esri-compat/bookmarks.d.ts +2 -0
  77. package/esri-compat/bookmarks.d.ts.map +1 -1
  78. package/esri-compat/bookmarks.js +12 -0
  79. package/esri-compat/controls.d.ts +18 -0
  80. package/esri-compat/controls.d.ts.map +1 -1
  81. package/esri-compat/controls.js +120 -57
  82. package/esri-compat/directions.d.ts +4 -0
  83. package/esri-compat/directions.d.ts.map +1 -1
  84. package/esri-compat/directions.js +30 -20
  85. package/esri-compat/editor.d.ts +4 -0
  86. package/esri-compat/editor.d.ts.map +1 -1
  87. package/esri-compat/editor.js +16 -0
  88. package/esri-compat/esri-config.d.ts +2 -1
  89. package/esri-compat/esri-config.d.ts.map +1 -1
  90. package/esri-compat/feature-effect.d.ts +23 -0
  91. package/esri-compat/feature-effect.d.ts.map +1 -0
  92. package/esri-compat/feature-effect.js +12 -0
  93. package/esri-compat/feature-form.d.ts +6 -0
  94. package/esri-compat/feature-form.d.ts.map +1 -1
  95. package/esri-compat/feature-form.js +63 -0
  96. package/esri-compat/feature-layer.d.ts +21 -2
  97. package/esri-compat/feature-layer.d.ts.map +1 -1
  98. package/esri-compat/feature-layer.js +172 -1
  99. package/esri-compat/feature-table.d.ts +5 -0
  100. package/esri-compat/feature-table.d.ts.map +1 -1
  101. package/esri-compat/feature-table.js +23 -0
  102. package/esri-compat/identity-manager.d.ts +1 -1
  103. package/esri-compat/identity-manager.js +1 -1
  104. package/esri-compat/legend.d.ts +2 -0
  105. package/esri-compat/legend.d.ts.map +1 -1
  106. package/esri-compat/legend.js +98 -0
  107. package/esri-compat/locator.d.ts +1 -1
  108. package/esri-compat/locator.js +1 -1
  109. package/esri-compat/map-view-mount.d.ts +1 -0
  110. package/esri-compat/map-view-mount.d.ts.map +1 -1
  111. package/esri-compat/map-view-mount.js +46 -25
  112. package/esri-compat/map-view.d.ts +13 -0
  113. package/esri-compat/map-view.d.ts.map +1 -1
  114. package/esri-compat/map-view.js +94 -8
  115. package/esri-compat/map.d.ts +5 -1
  116. package/esri-compat/map.d.ts.map +1 -1
  117. package/esri-compat/map.js +10 -0
  118. package/esri-compat/measurement.d.ts +2 -0
  119. package/esri-compat/measurement.d.ts.map +1 -1
  120. package/esri-compat/measurement.js +14 -0
  121. package/esri-compat/point.d.ts +7 -0
  122. package/esri-compat/point.d.ts.map +1 -1
  123. package/esri-compat/point.js +33 -3
  124. package/esri-compat/popup.d.ts +2 -0
  125. package/esri-compat/popup.d.ts.map +1 -1
  126. package/esri-compat/popup.js +12 -0
  127. package/esri-compat/portal.d.ts +1 -1
  128. package/esri-compat/portal.js +1 -1
  129. package/esri-compat/print.d.ts +3 -0
  130. package/esri-compat/print.d.ts.map +1 -1
  131. package/esri-compat/print.js +15 -0
  132. package/esri-compat/search.d.ts +4 -0
  133. package/esri-compat/search.d.ts.map +1 -1
  134. package/esri-compat/search.js +25 -28
  135. package/esri-compat/sketch.d.ts +2 -0
  136. package/esri-compat/sketch.d.ts.map +1 -1
  137. package/esri-compat/sketch.js +12 -0
  138. package/esri-compat/widget-host.d.ts +46 -17
  139. package/esri-compat/widget-host.d.ts.map +1 -1
  140. package/esri-compat/widget-host.js +84 -20
  141. package/esri-compat/widget-shell-hosts.d.ts +61 -0
  142. package/esri-compat/widget-shell-hosts.d.ts.map +1 -0
  143. package/esri-compat/widget-shell-hosts.js +76 -0
  144. package/index.d.ts +3 -1
  145. package/index.js +1 -0
  146. package/offline/digest.d.ts +15 -0
  147. package/offline/digest.js +58 -0
  148. package/offline/quota.d.ts +161 -0
  149. package/offline/quota.js +370 -0
  150. package/offline/types.d.ts +349 -0
  151. package/offline/types.js +75 -0
  152. package/package.json +21 -2
  153. package/query-planner/canonical-filter.d.ts +30 -0
  154. package/query-planner/canonical-filter.d.ts.map +1 -0
  155. package/query-planner/canonical-filter.js +30 -0
  156. package/query-planner/canonical.d.ts +7 -0
  157. package/query-planner/canonical.d.ts.map +1 -0
  158. package/query-planner/canonical.js +145 -0
  159. package/query-planner/columnar-plan.d.ts +63 -0
  160. package/query-planner/columnar-plan.d.ts.map +1 -0
  161. package/query-planner/columnar-plan.js +94 -0
  162. package/query-planner/cql2-json.d.ts +17 -0
  163. package/query-planner/cql2-json.d.ts.map +1 -0
  164. package/query-planner/cql2-json.js +646 -0
  165. package/query-planner/diagnostics.d.ts +35 -0
  166. package/query-planner/diagnostics.d.ts.map +1 -0
  167. package/query-planner/diagnostics.js +386 -0
  168. package/query-planner/duckdb.d.ts +79 -0
  169. package/query-planner/duckdb.d.ts.map +1 -0
  170. package/query-planner/duckdb.js +772 -0
  171. package/query-planner/execution-context.d.ts +5 -0
  172. package/query-planner/execution-context.d.ts.map +1 -0
  173. package/query-planner/execution-context.js +52 -0
  174. package/query-planner/executor.d.ts +5 -0
  175. package/query-planner/executor.d.ts.map +1 -0
  176. package/query-planner/executor.js +229 -0
  177. package/query-planner/geoservices.d.ts +91 -0
  178. package/query-planner/geoservices.d.ts.map +1 -0
  179. package/query-planner/geoservices.js +688 -0
  180. package/query-planner/grpc.d.ts +100 -0
  181. package/query-planner/grpc.d.ts.map +1 -0
  182. package/query-planner/grpc.js +760 -0
  183. package/query-planner/index.d.ts +59 -0
  184. package/query-planner/index.d.ts.map +1 -0
  185. package/query-planner/index.js +43 -0
  186. package/query-planner/ir.d.ts +25 -0
  187. package/query-planner/ir.d.ts.map +1 -0
  188. package/query-planner/ir.js +479 -0
  189. package/query-planner/local-aggregate.d.ts +5 -0
  190. package/query-planner/local-aggregate.d.ts.map +1 -0
  191. package/query-planner/local-aggregate.js +126 -0
  192. package/query-planner/odata-protocol-module.d.ts +54 -0
  193. package/query-planner/odata-protocol-module.d.ts.map +1 -0
  194. package/query-planner/odata-protocol-module.js +199 -0
  195. package/query-planner/odata-v1.d.ts +23 -0
  196. package/query-planner/odata-v1.d.ts.map +1 -0
  197. package/query-planner/odata-v1.js +202 -0
  198. package/query-planner/odata.d.ts +45 -0
  199. package/query-planner/odata.d.ts.map +1 -0
  200. package/query-planner/odata.js +519 -0
  201. package/query-planner/ogc-compiler.d.ts +55 -0
  202. package/query-planner/ogc-compiler.d.ts.map +1 -0
  203. package/query-planner/ogc-compiler.js +480 -0
  204. package/query-planner/ogc-features.d.ts +53 -0
  205. package/query-planner/ogc-features.d.ts.map +1 -0
  206. package/query-planner/ogc-features.js +639 -0
  207. package/query-planner/planner.d.ts +17 -0
  208. package/query-planner/planner.d.ts.map +1 -0
  209. package/query-planner/planner.js +937 -0
  210. package/query-planner/representation.d.ts +59 -0
  211. package/query-planner/representation.d.ts.map +1 -0
  212. package/query-planner/representation.js +140 -0
  213. package/query-planner/resource.d.ts +94 -0
  214. package/query-planner/resource.d.ts.map +1 -0
  215. package/query-planner/resource.js +526 -0
  216. package/query-planner/semantic-canonical.d.ts +15 -0
  217. package/query-planner/semantic-canonical.d.ts.map +1 -0
  218. package/query-planner/semantic-canonical.js +62 -0
  219. package/query-planner/semantic-compat.d.ts +10 -0
  220. package/query-planner/semantic-compat.d.ts.map +1 -0
  221. package/query-planner/semantic-compat.js +35 -0
  222. package/query-planner/semantic-compiler.d.ts +64 -0
  223. package/query-planner/semantic-compiler.d.ts.map +1 -0
  224. package/query-planner/semantic-compiler.js +81 -0
  225. package/query-planner/semantic-literals.d.ts +30 -0
  226. package/query-planner/semantic-literals.d.ts.map +1 -0
  227. package/query-planner/semantic-literals.js +133 -0
  228. package/query-planner/semantic-types.d.ts +265 -0
  229. package/query-planner/semantic-types.d.ts.map +1 -0
  230. package/query-planner/semantic-types.js +1 -0
  231. package/query-planner/semantic.d.ts +54 -0
  232. package/query-planner/semantic.d.ts.map +1 -0
  233. package/query-planner/semantic.js +1421 -0
  234. package/query-planner/types.d.ts +712 -0
  235. package/query-planner/types.d.ts.map +1 -0
  236. package/query-planner/types.js +49 -0
  237. package/query-planner/wfs-protocol-module.d.ts +57 -0
  238. package/query-planner/wfs-protocol-module.d.ts.map +1 -0
  239. package/query-planner/wfs-protocol-module.js +731 -0
  240. package/query-planner/wfs-semantic.d.ts +58 -0
  241. package/query-planner/wfs-semantic.d.ts.map +1 -0
  242. package/query-planner/wfs-semantic.js +547 -0
  243. package/query-planner/wfs-v1.d.ts +41 -0
  244. package/query-planner/wfs-v1.d.ts.map +1 -0
  245. package/query-planner/wfs-v1.js +366 -0
  246. package/query-planner/wfs.d.ts +4 -0
  247. package/query-planner/wfs.d.ts.map +1 -0
  248. package/query-planner/wfs.js +2 -0
  249. package/widget-capabilities.d.ts +67 -0
  250. package/widget-capabilities.js +152 -0
@@ -0,0 +1,646 @@
1
+ import { parseSourceSchemaV2, validateExecutableCrsBinding, } from "../contract/schema.js";
2
+ import { canonicalStringify, toJsonValue } from "./canonical.js";
3
+ import { MAX_SEMANTIC_QUERY_DEPTH, parseBoundedSemanticJson, parseSemanticQuery } from "./semantic.js";
4
+ import { HonuaQueryPlanningError } from "./types.js";
5
+ const COMPARISON_TO_CQL2 = {
6
+ eq: "=",
7
+ ne: "<>",
8
+ lt: "<",
9
+ lte: "<=",
10
+ gt: ">",
11
+ gte: ">=",
12
+ };
13
+ const CQL2_TO_COMPARISON = {
14
+ "=": "eq",
15
+ "<>": "ne",
16
+ "<": "lt",
17
+ "<=": "lte",
18
+ ">": "gt",
19
+ ">=": "gte",
20
+ };
21
+ const SPATIAL_TO_CQL2 = {
22
+ equals: "s_equals",
23
+ intersects: "s_intersects",
24
+ within: "s_within",
25
+ contains: "s_contains",
26
+ disjoint: "s_disjoint",
27
+ touches: "s_touches",
28
+ overlaps: "s_overlaps",
29
+ crosses: "s_crosses",
30
+ };
31
+ const CQL2_TO_SPATIAL = {
32
+ s_equals: "equals",
33
+ s_intersects: "intersects",
34
+ s_within: "within",
35
+ s_contains: "contains",
36
+ s_disjoint: "disjoint",
37
+ s_touches: "touches",
38
+ s_overlaps: "overlaps",
39
+ s_crosses: "crosses",
40
+ };
41
+ const TEMPORAL_TO_CQL2 = {
42
+ before: "t_before",
43
+ after: "t_after",
44
+ during: "t_during",
45
+ "time-intersects": "t_intersects",
46
+ };
47
+ const CQL2_TO_TEMPORAL = {
48
+ t_before: "before",
49
+ t_after: "after",
50
+ t_during: "during",
51
+ t_intersects: "time-intersects",
52
+ };
53
+ // Annex C's normative CQL2 JSON schema declares GeometryCollection
54
+ // `geometries` with minItems: 2. Enforce that in both directions even though
55
+ // the broader semantic/GeoJSON model also admits a single member.
56
+ const MIN_CQL2_GEOMETRY_COLLECTION_ITEMS = 2;
57
+ const CQL2_DATE = /^\d{4}-\d{2}-\d{2}$/;
58
+ const CQL2_TIMESTAMP = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/;
59
+ /**
60
+ * Export the CQL2-representable semantic-filter subset. CQL2 carries spatial
61
+ * CRS outside the expression, so every spatial export requires `filterCrs`
62
+ * and verifies that each operand uses that exact executable binding.
63
+ */
64
+ export function semanticFilterToCql2Json(filter, options = {}) {
65
+ const context = cql2Context(options);
66
+ const query = parseSemanticQuery({ kind: "features", filter }, {
67
+ ...(context.schema ? { schema: context.schema } : {}),
68
+ ...(context.protocol !== undefined ? { protocol: context.protocol } : {}),
69
+ });
70
+ if (!query.filter)
71
+ throw cql2Invalid("$", "requires a filter");
72
+ const encoded = exportFilter(query.filter, context, "$", 0);
73
+ return parseBoundedSemanticJson(encoded);
74
+ }
75
+ /**
76
+ * Import the strict CQL2 JSON subset into the same runtime-validated semantic
77
+ * AST used by builders. Unknown functions, property-property comparisons,
78
+ * distance extensions, and other non-representable constructs fail closed.
79
+ */
80
+ export function semanticFilterFromCql2Json(value, options = {}) {
81
+ const json = parseBoundedSemanticJson(value);
82
+ const context = cql2Context(options);
83
+ const filter = importFilter(json, context, "$", 0);
84
+ const query = parseSemanticQuery({ kind: "features", filter }, {
85
+ ...(context.schema ? { schema: context.schema } : {}),
86
+ ...(context.protocol !== undefined ? { protocol: context.protocol } : {}),
87
+ });
88
+ if (!query.filter)
89
+ throw cql2Invalid("$", "requires a filter");
90
+ return query.filter;
91
+ }
92
+ function exportFilter(filter, context, path, depth) {
93
+ if (depth > MAX_SEMANTIC_QUERY_DEPTH)
94
+ throw cql2Invalid(path, "exceeds the expression depth bound");
95
+ switch (filter.kind) {
96
+ case "comparison": {
97
+ const field = schemaField(context.schema, filter.left.name);
98
+ return {
99
+ op: COMPARISON_TO_CQL2[filter.operator],
100
+ args: [{ property: filter.left.name }, exportLiteral(filter.right.value, field, `${path}.args[1]`)],
101
+ };
102
+ }
103
+ case "boolean":
104
+ if (filter.args.length < 2)
105
+ throw cql2Unsupported(path, "CQL2 and/or requires at least two operands");
106
+ return {
107
+ op: filter.operator,
108
+ args: filter.args.map((entry, index) => exportFilter(entry, context, `${path}.args[${index}]`, depth + 1)),
109
+ };
110
+ case "not":
111
+ return { op: "not", args: [exportFilter(filter.arg, context, `${path}.args[0]`, depth + 1)] };
112
+ case "null": {
113
+ const isNull = { op: "isNull", args: [{ property: filter.operand.name }] };
114
+ return filter.operator === "is-null" ? isNull : { op: "not", args: [isNull] };
115
+ }
116
+ case "list": {
117
+ const field = schemaField(context.schema, filter.operand.name);
118
+ return {
119
+ op: "in",
120
+ args: [
121
+ { property: filter.operand.name },
122
+ filter.values.map((entry, index) => exportLiteral(entry.value, field, `${path}.args[1][${index}]`)),
123
+ ],
124
+ };
125
+ }
126
+ case "range": {
127
+ if (typeof filter.lower.value !== "number" || typeof filter.upper.value !== "number") {
128
+ throw cql2Unsupported(path, "CQL2 between represents only numeric bounds in the supported subset");
129
+ }
130
+ return {
131
+ op: "between",
132
+ args: [{ property: filter.operand.name }, filter.lower.value, filter.upper.value],
133
+ };
134
+ }
135
+ case "pattern": {
136
+ const property = { property: filter.operand.name };
137
+ if (filter.caseSensitive === false) {
138
+ return {
139
+ op: "like",
140
+ args: [
141
+ { op: "casei", args: [property] },
142
+ { op: "casei", args: [filter.pattern] },
143
+ ],
144
+ };
145
+ }
146
+ return { op: "like", args: [property, filter.pattern] };
147
+ }
148
+ case "spatial":
149
+ return exportSpatial(filter, context, path);
150
+ case "temporal":
151
+ return {
152
+ op: TEMPORAL_TO_CQL2[filter.operator],
153
+ args: [{ property: filter.operand.name }, exportTemporalLiteral(filter.value, `${path}.args[1]`)],
154
+ };
155
+ case "native":
156
+ throw cql2Unsupported(path, "native expressions are dialect escape hatches, not semantic CQL2 nodes");
157
+ }
158
+ }
159
+ function exportSpatial(filter, context, path) {
160
+ const property = filter.property?.name ?? primaryGeometryField(context.schema, path);
161
+ const propertyRef = { property };
162
+ if (filter.operator === "bbox-intersects") {
163
+ assertFilterCrs(filter.bbox.crs, context, path);
164
+ return { op: "s_intersects", args: [propertyRef, { bbox: [...filter.bbox.box.bounds] }] };
165
+ }
166
+ if (filter.operator === "within-distance" || filter.operator === "beyond-distance") {
167
+ throw cql2Unsupported(path, "distance predicates are outside standard CQL2 1.0");
168
+ }
169
+ if (filter.geometry.layout !== "xy" && filter.geometry.layout !== "xyz") {
170
+ throw cql2Unsupported(path, "CQL2 GeoJSON literals cannot preserve measured coordinate layouts");
171
+ }
172
+ assertFilterCrs(filter.geometry.crs, context, path);
173
+ assertCql2GeometryCollectionCardinality(filter.geometry.geometry, `${path}.args[1]`);
174
+ return {
175
+ op: SPATIAL_TO_CQL2[filter.operator],
176
+ args: [propertyRef, toJsonValue(filter.geometry.geometry)],
177
+ };
178
+ }
179
+ function exportLiteral(value, field, path) {
180
+ if (field?.type.kind === "date") {
181
+ if (typeof value !== "string")
182
+ throw cql2Unsupported(path, "date values require their string encoding");
183
+ if (!CQL2_DATE.test(value))
184
+ throw cql2Unsupported(path, "date values require the CQL2 full-date form");
185
+ return { date: value };
186
+ }
187
+ if (field?.type.kind === "timestamp") {
188
+ if (typeof value !== "string")
189
+ throw cql2Unsupported(path, "timestamp values require their string encoding");
190
+ if (!CQL2_TIMESTAMP.test(value)) {
191
+ throw cql2Unsupported(path, "timestamp values require the CQL2 UTC Z form");
192
+ }
193
+ return { timestamp: value };
194
+ }
195
+ if ((field?.type.kind === "decimal" && field.type.jsonEncoding === "string") ||
196
+ (field?.type.kind === "integer" && field.type.jsonEncoding === "string")) {
197
+ throw cql2Unsupported(path, "CQL2 JSON numbers cannot preserve string-encoded numeric precision");
198
+ }
199
+ if (value === null || Array.isArray(value) || typeof value === "object") {
200
+ throw cql2Unsupported(path, "the supported CQL2 scalar subset accepts only string, number, or boolean literals");
201
+ }
202
+ return value;
203
+ }
204
+ function exportTemporalLiteral(value, path) {
205
+ if (value.valueType === "interval") {
206
+ return {
207
+ interval: value.value.map((entry, index) => exportTemporalEndpoint(entry, `${path}.interval[${index}]`)),
208
+ };
209
+ }
210
+ if (value.valueType === "date") {
211
+ if (!CQL2_DATE.test(value.value))
212
+ throw cql2Unsupported(path, "date values require the CQL2 full-date form");
213
+ return { date: value.value };
214
+ }
215
+ if (!CQL2_TIMESTAMP.test(value.value)) {
216
+ throw cql2Unsupported(path, "timestamp values require the CQL2 UTC Z form");
217
+ }
218
+ return { timestamp: value.value };
219
+ }
220
+ function exportTemporalEndpoint(value, path) {
221
+ if (CQL2_DATE.test(value) || CQL2_TIMESTAMP.test(value))
222
+ return value;
223
+ throw cql2Unsupported(path, "requires a CQL2 full-date or UTC Z timestamp");
224
+ }
225
+ function importFilter(value, context, path, depth) {
226
+ if (depth > MAX_SEMANTIC_QUERY_DEPTH)
227
+ throw cql2Invalid(path, "exceeds the expression depth bound");
228
+ const object = exactObject(value, path, ["op", "args"]);
229
+ const op = text(object.op, `${path}.op`);
230
+ const args = array(object.args, `${path}.args`);
231
+ if (op === "and" || op === "or") {
232
+ if (args.length < 2)
233
+ throw cql2Invalid(`${path}.args`, "must contain at least two expressions");
234
+ const parsedArgs = [
235
+ importFilter(args[0], context, `${path}.args[0]`, depth + 1),
236
+ ...args.slice(1).map((entry, index) => importFilter(entry, context, `${path}.args[${index + 1}]`, depth + 1)),
237
+ ];
238
+ return {
239
+ kind: "boolean",
240
+ operator: op,
241
+ args: parsedArgs,
242
+ };
243
+ }
244
+ if (op === "not") {
245
+ exactLength(args, 1, `${path}.args`);
246
+ const inner = importFilter(args[0], context, `${path}.args[0]`, depth + 1);
247
+ if (inner.kind === "null" && inner.operator === "is-null") {
248
+ return { ...inner, operator: "is-not-null" };
249
+ }
250
+ return { kind: "not", arg: inner };
251
+ }
252
+ if (hasOwn(CQL2_TO_COMPARISON, op)) {
253
+ exactLength(args, 2, `${path}.args`);
254
+ const property = importProperty(args[0], `${path}.args[0]`);
255
+ const literal = importLiteral(args[1], schemaField(context.schema, property.name), `${path}.args[1]`);
256
+ return {
257
+ kind: "comparison",
258
+ operator: CQL2_TO_COMPARISON[op],
259
+ left: property,
260
+ right: literal,
261
+ };
262
+ }
263
+ if (op === "isNull") {
264
+ exactLength(args, 1, `${path}.args`);
265
+ return {
266
+ kind: "null",
267
+ operator: "is-null",
268
+ operand: importProperty(args[0], `${path}.args[0]`),
269
+ };
270
+ }
271
+ if (op === "in") {
272
+ exactLength(args, 2, `${path}.args`);
273
+ const property = importProperty(args[0], `${path}.args[0]`);
274
+ const values = array(args[1], `${path}.args[1]`);
275
+ if (values.length === 0)
276
+ throw cql2Invalid(`${path}.args[1]`, "must not be empty");
277
+ const field = schemaField(context.schema, property.name);
278
+ const parsedValues = [
279
+ importLiteral(values[0], field, `${path}.args[1][0]`),
280
+ ...values.slice(1).map((entry, index) => importLiteral(entry, field, `${path}.args[1][${index + 1}]`)),
281
+ ];
282
+ return {
283
+ kind: "list",
284
+ operator: "in",
285
+ operand: property,
286
+ values: parsedValues,
287
+ };
288
+ }
289
+ if (op === "between") {
290
+ exactLength(args, 3, `${path}.args`);
291
+ const property = importProperty(args[0], `${path}.args[0]`);
292
+ if (typeof args[1] !== "number" || typeof args[2] !== "number") {
293
+ throw cql2Unsupported(path, "the supported between form requires numeric literal bounds");
294
+ }
295
+ return {
296
+ kind: "range",
297
+ operator: "between",
298
+ operand: property,
299
+ lower: { kind: "literal", value: args[1] },
300
+ upper: { kind: "literal", value: args[2] },
301
+ };
302
+ }
303
+ if (op === "like")
304
+ return importLike(args, path);
305
+ if (hasOwn(CQL2_TO_SPATIAL, op))
306
+ return importSpatial(op, args, context, path);
307
+ if (hasOwn(CQL2_TO_TEMPORAL, op))
308
+ return importTemporal(op, args, path);
309
+ throw cql2Unsupported(`${path}.op`, "uses an unsupported CQL2 function or operator");
310
+ }
311
+ function importLike(args, path) {
312
+ exactLength(args, 2, `${path}.args`);
313
+ const leftCaseInsensitive = isOperation(args[0], "casei");
314
+ const rightCaseInsensitive = isOperation(args[1], "casei");
315
+ if (leftCaseInsensitive !== rightCaseInsensitive) {
316
+ throw cql2Invalid(`${path}.args`, "must apply casei to both operands or neither operand");
317
+ }
318
+ if (leftCaseInsensitive) {
319
+ const left = operationArgs(args[0], "casei", `${path}.args[0]`);
320
+ const right = operationArgs(args[1], "casei", `${path}.args[1]`);
321
+ exactLength(left, 1, `${path}.args[0].args`);
322
+ exactLength(right, 1, `${path}.args[1].args`);
323
+ if (typeof right[0] !== "string")
324
+ throw cql2Invalid(`${path}.args[1]`, "must wrap a string pattern");
325
+ return {
326
+ kind: "pattern",
327
+ operator: "like",
328
+ operand: importProperty(left[0], `${path}.args[0].args[0]`),
329
+ pattern: right[0],
330
+ caseSensitive: false,
331
+ };
332
+ }
333
+ if (typeof args[1] !== "string")
334
+ throw cql2Invalid(`${path}.args[1]`, "must be a string pattern");
335
+ return {
336
+ kind: "pattern",
337
+ operator: "like",
338
+ operand: importProperty(args[0], `${path}.args[0]`),
339
+ pattern: args[1],
340
+ caseSensitive: true,
341
+ };
342
+ }
343
+ function importSpatial(op, args, context, path) {
344
+ exactLength(args, 2, `${path}.args`);
345
+ const property = importProperty(args[0], `${path}.args[0]`);
346
+ const crs = requiredFilterCrs(context, path);
347
+ const operand = object(args[1], `${path}.args[1]`);
348
+ if (Object.hasOwn(operand, "bbox") && !Object.hasOwn(operand, "type")) {
349
+ exactKeys(operand, ["bbox"], `${path}.args[1]`);
350
+ if (op !== "s_intersects")
351
+ throw cql2Unsupported(path, "only s_intersects maps a CQL2 BBox literal");
352
+ const bounds = array(operand.bbox, `${path}.args[1].bbox`);
353
+ const layout = bounds.length === 4 ? "xy" : bounds.length === 6 ? "xyz" : undefined;
354
+ if (!layout)
355
+ throw cql2Invalid(`${path}.args[1].bbox`, "must contain four or six ordinates");
356
+ return {
357
+ kind: "spatial",
358
+ operator: "bbox-intersects",
359
+ property,
360
+ bbox: { box: { layout, bounds }, crs },
361
+ };
362
+ }
363
+ const layout = geometryLayout(operand, `${path}.args[1]`);
364
+ return {
365
+ kind: "spatial",
366
+ operator: CQL2_TO_SPATIAL[op],
367
+ property,
368
+ // GeoJSON permits an optional bbox on every geometry object. The
369
+ // protocol-neutral semantic contract intentionally stores canonical
370
+ // geometry only, so validate those extents above and discard them here.
371
+ geometry: { state: "present", geometry: geometryWithoutBboxes(operand), crs, layout },
372
+ };
373
+ }
374
+ function importTemporal(op, args, path) {
375
+ exactLength(args, 2, `${path}.args`);
376
+ return {
377
+ kind: "temporal",
378
+ operator: CQL2_TO_TEMPORAL[op],
379
+ operand: importProperty(args[0], `${path}.args[0]`),
380
+ value: importTemporalLiteral(args[1], `${path}.args[1]`),
381
+ };
382
+ }
383
+ function importLiteral(value, field, path) {
384
+ if (value === null || Array.isArray(value)) {
385
+ throw cql2Unsupported(path, "the supported scalar form accepts string, number, boolean, date, or timestamp");
386
+ }
387
+ if (typeof value !== "object") {
388
+ if (field?.type.kind === "date" || field?.type.kind === "timestamp") {
389
+ throw cql2Unsupported(path, `schema-typed ${field.type.kind} comparisons require the tagged CQL2 literal form`);
390
+ }
391
+ if ((field?.type.kind === "decimal" && field.type.jsonEncoding === "string") ||
392
+ (field?.type.kind === "integer" && field.type.jsonEncoding === "string")) {
393
+ throw cql2Unsupported(path, "CQL2 JSON numbers cannot preserve string-encoded numeric precision");
394
+ }
395
+ return { kind: "literal", value };
396
+ }
397
+ const objectValue = value;
398
+ if (Object.hasOwn(objectValue, "date")) {
399
+ exactKeys(objectValue, ["date"], path);
400
+ if (!field)
401
+ throw cql2Unsupported(path, "tagged date comparison requires schema context");
402
+ if (field.type.kind !== "date")
403
+ throw cql2Invalid(path, "date literal does not match the schema field type");
404
+ const date = text(objectValue.date, `${path}.date`);
405
+ if (!CQL2_DATE.test(date))
406
+ throw cql2Invalid(`${path}.date`, "must use the CQL2 full-date form");
407
+ return { kind: "literal", value: date };
408
+ }
409
+ if (Object.hasOwn(objectValue, "timestamp")) {
410
+ exactKeys(objectValue, ["timestamp"], path);
411
+ if (!field)
412
+ throw cql2Unsupported(path, "tagged timestamp comparison requires schema context");
413
+ if (field.type.kind !== "timestamp") {
414
+ throw cql2Invalid(path, "timestamp literal does not match the schema field type");
415
+ }
416
+ const timestamp = text(objectValue.timestamp, `${path}.timestamp`);
417
+ if (!CQL2_TIMESTAMP.test(timestamp)) {
418
+ throw cql2Invalid(`${path}.timestamp`, "must use the CQL2 UTC Z form");
419
+ }
420
+ return { kind: "literal", value: timestamp };
421
+ }
422
+ throw cql2Unsupported(path, "uses an unsupported CQL2 scalar expression");
423
+ }
424
+ function importTemporalLiteral(value, path) {
425
+ const literal = object(value, path);
426
+ if (Object.hasOwn(literal, "date")) {
427
+ exactKeys(literal, ["date"], path);
428
+ const date = text(literal.date, `${path}.date`);
429
+ if (!CQL2_DATE.test(date))
430
+ throw cql2Invalid(`${path}.date`, "must use the CQL2 full-date form");
431
+ return { kind: "temporal-literal", valueType: "date", value: date };
432
+ }
433
+ if (Object.hasOwn(literal, "timestamp")) {
434
+ exactKeys(literal, ["timestamp"], path);
435
+ const timestamp = text(literal.timestamp, `${path}.timestamp`);
436
+ if (!CQL2_TIMESTAMP.test(timestamp)) {
437
+ throw cql2Invalid(`${path}.timestamp`, "must use the CQL2 UTC Z form");
438
+ }
439
+ return {
440
+ kind: "temporal-literal",
441
+ valueType: "instant",
442
+ value: timestamp,
443
+ };
444
+ }
445
+ if (Object.hasOwn(literal, "interval")) {
446
+ exactKeys(literal, ["interval"], path);
447
+ const interval = array(literal.interval, `${path}.interval`);
448
+ exactLength(interval, 2, `${path}.interval`);
449
+ const endpoints = [text(interval[0], `${path}.interval[0]`), text(interval[1], `${path}.interval[1]`)];
450
+ endpoints.forEach((entry, index) => {
451
+ if (!CQL2_DATE.test(entry) && !CQL2_TIMESTAMP.test(entry)) {
452
+ throw cql2Invalid(`${path}.interval[${index}]`, "must use a CQL2 full-date or UTC Z timestamp");
453
+ }
454
+ });
455
+ return {
456
+ kind: "temporal-literal",
457
+ valueType: "interval",
458
+ value: endpoints,
459
+ };
460
+ }
461
+ throw cql2Unsupported(path, "uses an unsupported temporal literal");
462
+ }
463
+ function importProperty(value, path) {
464
+ const property = exactObject(value, path, ["property"]);
465
+ const name = text(property.property, `${path}.property`);
466
+ if (name.length === 0)
467
+ throw cql2Invalid(`${path}.property`, "must not be empty");
468
+ return { kind: "property", name };
469
+ }
470
+ function geometryLayout(geometry, path) {
471
+ const type = text(geometry.type, `${path}.type`);
472
+ if (type === "GeometryCollection") {
473
+ exactKeys(geometry, Object.hasOwn(geometry, "bbox") ? ["type", "geometries", "bbox"] : ["type", "geometries"], path);
474
+ const geometries = array(geometry.geometries, `${path}.geometries`);
475
+ if (geometries.length < MIN_CQL2_GEOMETRY_COLLECTION_ITEMS) {
476
+ throw cql2Invalid(`${path}.geometries`, "must contain at least two geometries in CQL2 JSON");
477
+ }
478
+ const layouts = geometries.map((entry, index) => {
479
+ const childPath = `${path}.geometries[${index}]`;
480
+ const child = object(entry, childPath);
481
+ if (child.type === "GeometryCollection") {
482
+ throw cql2Invalid(childPath, "must not be a nested GeometryCollection in CQL2 JSON");
483
+ }
484
+ return geometryLayout(child, childPath);
485
+ });
486
+ const layout = layouts[0];
487
+ if (layouts.some((candidate) => candidate !== layout)) {
488
+ throw cql2Invalid(`${path}.geometries`, "must use one coordinate layout throughout the collection");
489
+ }
490
+ validateGeometryBbox(geometry, layout, path);
491
+ return layout;
492
+ }
493
+ if (!["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon"].includes(type)) {
494
+ throw cql2Unsupported(`${path}.type`, "uses an unsupported GeoJSON geometry type");
495
+ }
496
+ exactKeys(geometry, Object.hasOwn(geometry, "bbox") ? ["type", "coordinates", "bbox"] : ["type", "coordinates"], path);
497
+ let position = geometry.coordinates;
498
+ while (Array.isArray(position) && position.length > 0 && Array.isArray(position[0])) {
499
+ position = position[0];
500
+ }
501
+ if (!Array.isArray(position))
502
+ throw cql2Invalid(`${path}.coordinates`, "must contain coordinate positions");
503
+ if (position.length === 2) {
504
+ validateGeometryBbox(geometry, "xy", path);
505
+ return "xy";
506
+ }
507
+ if (position.length === 3) {
508
+ validateGeometryBbox(geometry, "xyz", path);
509
+ return "xyz";
510
+ }
511
+ throw cql2Unsupported(`${path}.coordinates`, "positions must contain two or three ordinates");
512
+ }
513
+ function validateGeometryBbox(geometry, layout, path) {
514
+ if (!Object.hasOwn(geometry, "bbox"))
515
+ return;
516
+ const bbox = array(geometry.bbox, `${path}.bbox`);
517
+ const expectedLength = layout === "xy" ? 4 : 6;
518
+ if (bbox.length !== expectedLength) {
519
+ throw cql2Invalid(`${path}.bbox`, `must contain ${expectedLength} ordinates for ${layout} geometry`);
520
+ }
521
+ bbox.forEach((ordinate, index) => {
522
+ if (typeof ordinate !== "number")
523
+ throw cql2Invalid(`${path}.bbox[${index}]`, "must be a number");
524
+ });
525
+ }
526
+ function geometryWithoutBboxes(geometry) {
527
+ if (geometry.type === "GeometryCollection") {
528
+ return {
529
+ type: "GeometryCollection",
530
+ geometries: geometry.geometries.map((entry) => geometryWithoutBboxes(entry)),
531
+ };
532
+ }
533
+ return { type: geometry.type, coordinates: geometry.coordinates };
534
+ }
535
+ function assertCql2GeometryCollectionCardinality(geometry, path) {
536
+ if (geometry.type !== "GeometryCollection")
537
+ return;
538
+ const geometries = geometry.geometries;
539
+ if (!Array.isArray(geometries) || geometries.length < MIN_CQL2_GEOMETRY_COLLECTION_ITEMS) {
540
+ throw cql2Unsupported(`${path}.geometries`, "must contain at least two geometries in CQL2 JSON");
541
+ }
542
+ geometries.forEach((entry, index) => {
543
+ if (entry !== null &&
544
+ !Array.isArray(entry) &&
545
+ typeof entry === "object" &&
546
+ entry.type === "GeometryCollection") {
547
+ throw cql2Unsupported(`${path}.geometries[${index}]`, "nested GeometryCollection literals are outside CQL2 JSON 1.0");
548
+ }
549
+ });
550
+ }
551
+ function assertFilterCrs(value, context, path) {
552
+ const expected = requiredFilterCrs(context, path);
553
+ if (canonicalStringify(toJsonValue(value)) !== canonicalStringify(toJsonValue(expected))) {
554
+ throw cql2Unsupported(path, "spatial operand CRS does not match the external filterCrs context");
555
+ }
556
+ }
557
+ function requiredFilterCrs(context, path) {
558
+ if (!context.filterCrs) {
559
+ throw cql2Unsupported(path, "spatial CQL2 interchange requires an explicit filterCrs binding");
560
+ }
561
+ return context.filterCrs;
562
+ }
563
+ function primaryGeometryField(schema, path) {
564
+ if (schema?.geometry.state === "known" && schema.geometry.primaryField.state === "known") {
565
+ return schema.geometry.primaryField.field;
566
+ }
567
+ throw cql2Unsupported(path, "an implicit semantic geometry property requires schema primary-field context");
568
+ }
569
+ function schemaField(schema, name) {
570
+ return schema?.fields.find((field) => field.name === name);
571
+ }
572
+ function cql2Context(options) {
573
+ let schema;
574
+ let filterCrs;
575
+ try {
576
+ schema = options.schema === undefined ? undefined : parseSourceSchemaV2(options.schema);
577
+ }
578
+ catch {
579
+ throw cql2Invalid("$", "requires a valid schema context");
580
+ }
581
+ try {
582
+ filterCrs = options.filterCrs === undefined ? undefined : validateExecutableCrsBinding(options.filterCrs);
583
+ }
584
+ catch {
585
+ throw cql2Invalid("$", "requires a valid executable filterCrs binding");
586
+ }
587
+ return {
588
+ ...(schema ? { schema } : {}),
589
+ ...(filterCrs ? { filterCrs } : {}),
590
+ ...(options.protocol !== undefined ? { protocol: options.protocol } : {}),
591
+ };
592
+ }
593
+ function isOperation(value, op) {
594
+ return value !== null && !Array.isArray(value) && typeof value === "object" && value.op === op;
595
+ }
596
+ function operationArgs(value, op, path) {
597
+ const operation = exactObject(value, path, ["op", "args"]);
598
+ if (operation.op !== op)
599
+ throw cql2Invalid(`${path}.op`, `must be ${op}`);
600
+ return array(operation.args, `${path}.args`);
601
+ }
602
+ function exactObject(value, path, keys) {
603
+ const result = object(value, path);
604
+ exactKeys(result, keys, path);
605
+ return result;
606
+ }
607
+ function object(value, path) {
608
+ if (value === null || Array.isArray(value) || typeof value !== "object") {
609
+ throw cql2Invalid(path, "must be an object");
610
+ }
611
+ return value;
612
+ }
613
+ function array(value, path) {
614
+ if (!Array.isArray(value))
615
+ throw cql2Invalid(path, "must be an array");
616
+ return value;
617
+ }
618
+ function text(value, path) {
619
+ if (typeof value !== "string")
620
+ throw cql2Invalid(path, "must be a string");
621
+ return value;
622
+ }
623
+ function exactLength(value, expected, path) {
624
+ if (value.length !== expected)
625
+ throw cql2Invalid(path, `must contain exactly ${expected} entries`);
626
+ }
627
+ function exactKeys(value, expected, path) {
628
+ const allowed = new Set(expected);
629
+ for (const key of Object.keys(value)) {
630
+ if (!allowed.has(key))
631
+ throw cql2Invalid(path, "contains a member outside the supported CQL2 form");
632
+ }
633
+ for (const key of expected) {
634
+ if (!Object.hasOwn(value, key))
635
+ throw cql2Invalid(`${path}.${key}`, "is required");
636
+ }
637
+ }
638
+ function hasOwn(value, key) {
639
+ return Object.prototype.hasOwnProperty.call(value, key);
640
+ }
641
+ function cql2Invalid(path, message) {
642
+ return new HonuaQueryPlanningError("invalid-query", `CQL2 JSON ${path} ${message}`);
643
+ }
644
+ function cql2Unsupported(path, message) {
645
+ return new HonuaQueryPlanningError("unsupported-query", `CQL2 JSON ${path} ${message}`);
646
+ }
@@ -0,0 +1,35 @@
1
+ import type { CapabilityPolicy, SourceDescriptor } from "../contract/types.js";
2
+ import type { CanonicalQuery, ExplainQueryOptions, QueryFallbackPolicy, QueryIrSourceIdentity, QueryIrSourceIdentityV2, QueryIrV1, QueryIrV2, QueryPlanBoundsV1, QueryPlanCacheDecisionV1, QueryPlanCacheOptions, QueryPlanFidelity, QueryPlanFidelityLoss, QueryPlanProvenanceV1, QueryPlanRepresentation, QueryPlanRepresentationDecisionV1, QueryPlanStepProvenanceV1, QueryPlanValidityV1, QueryPlanWarning, QueryPlanningEstimates } from "./types.js";
3
+ type SourceIdentity = QueryIrSourceIdentity | QueryIrSourceIdentityV2;
4
+ interface DiagnosticStep {
5
+ readonly engine: "remote" | "client";
6
+ readonly operation: string;
7
+ readonly requests?: number;
8
+ readonly query?: CanonicalQuery;
9
+ readonly compiled?: object;
10
+ readonly maxRows?: number;
11
+ readonly maxBytes?: number;
12
+ }
13
+ export declare function createQueryPlanProvenance(descriptor: SourceDescriptor, source: SourceIdentity, options: Pick<ExplainQueryOptions, "discovery" | "schemaVersion">): QueryPlanProvenanceV1;
14
+ export declare function createStepProvenance(provenance: QueryPlanProvenanceV1): QueryPlanStepProvenanceV1;
15
+ export declare function createCacheDecision(options?: QueryPlanCacheOptions): QueryPlanCacheDecisionV1;
16
+ export declare function createStepDiagnostics(step: DiagnosticStep, estimates: QueryPlanningEstimates, provenance: QueryPlanProvenanceV1): {
17
+ readonly fidelity: QueryPlanFidelity;
18
+ readonly losses: readonly QueryPlanFidelityLoss[];
19
+ readonly bounds: QueryPlanBoundsV1;
20
+ readonly provenance: QueryPlanStepProvenanceV1;
21
+ };
22
+ export declare function summarizePlanBounds(steps: readonly {
23
+ readonly bounds: QueryPlanBoundsV1;
24
+ }[]): QueryPlanBoundsV1;
25
+ export declare function summarizeFidelity(steps: readonly {
26
+ readonly fidelity: QueryPlanFidelity;
27
+ readonly losses: readonly QueryPlanFidelityLoss[];
28
+ }[]): {
29
+ readonly fidelity: QueryPlanFidelity;
30
+ readonly losses: readonly QueryPlanFidelityLoss[];
31
+ };
32
+ export declare function createPlanWarnings(steps: readonly DiagnosticStep[], source: SourceIdentity, representation: QueryPlanRepresentationDecisionV1): readonly QueryPlanWarning[];
33
+ export declare function createPlanValidity(ir: QueryIrV1 | QueryIrV2, provenance: QueryPlanProvenanceV1, capabilityPolicy: CapabilityPolicy, fallback: QueryFallbackPolicy, executionMode: "snapshot" | "delta", representation: QueryPlanRepresentation): QueryPlanValidityV1;
34
+ export {};
35
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../src/query-planner/diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAErB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EAErB,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EAEzB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAGpB,KAAK,cAAc,GAAG,qBAAqB,GAAG,uBAAuB,CAAC;AAGtE,UAAU,cAAc;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,gBAAgB,EAC5B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,eAAe,CAAC,GAChE,qBAAqB,CA6BvB;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,qBAAqB,GAAG,yBAAyB,CAQjG;AAED,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,wBAAwB,CA0C7F;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,sBAAsB,EACjC,UAAU,EAAE,qBAAqB,GAChC;IACD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAClD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;CAChD,CAUA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;CAAE,EAAE,GAAG,iBAAiB,CAU/G;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS;IAAE,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAAE,EAAE,GAC5G;IAAE,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAA;CAAE,CAO7F;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,iCAAiC,GAChD,SAAS,gBAAgB,EAAE,CA2C7B;AAMD,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,UAAU,EAAE,qBAAqB,EACjC,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,UAAU,GAAG,OAAO,EACnC,cAAc,EAAE,uBAAuB,GACtC,mBAAmB,CAgBrB"}