@loaders.gl/schema 4.5.3 → 5.0.0-alpha.10

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 (54) hide show
  1. package/LICENSE +14 -3
  2. package/dist/categories/category-gis.d.ts +1 -0
  3. package/dist/categories/category-gis.d.ts.map +1 -1
  4. package/dist/categories/category-image.d.ts +1 -1
  5. package/dist/categories/category-mesh.d.ts +54 -3
  6. package/dist/categories/category-mesh.d.ts.map +1 -1
  7. package/dist/categories/category-mesh.js +10 -1
  8. package/dist/categories/category-mesh.js.map +1 -1
  9. package/dist/deprecated/mesh-utils.d.ts +5 -18
  10. package/dist/deprecated/mesh-utils.d.ts.map +1 -1
  11. package/dist/deprecated/mesh-utils.js +13 -25
  12. package/dist/deprecated/mesh-utils.js.map +1 -1
  13. package/dist/dist.dev.js +1789 -352
  14. package/dist/dist.min.js +4 -3
  15. package/dist/float16.d.ts +19 -0
  16. package/dist/float16.d.ts.map +1 -0
  17. package/dist/float16.js +90 -0
  18. package/dist/float16.js.map +1 -0
  19. package/dist/geometry/arrow-binary-features.d.ts +45 -0
  20. package/dist/geometry/arrow-binary-features.d.ts.map +1 -0
  21. package/dist/geometry/arrow-binary-features.js +5 -0
  22. package/dist/geometry/arrow-binary-features.js.map +1 -0
  23. package/dist/geometry/geoarrow.d.ts +69 -0
  24. package/dist/geometry/geoarrow.d.ts.map +1 -0
  25. package/dist/geometry/geoarrow.js +5 -0
  26. package/dist/geometry/geoarrow.js.map +1 -0
  27. package/dist/index.cjs +180 -17
  28. package/dist/index.cjs.map +2 -3
  29. package/dist/index.d.ts +10 -3
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +5 -3
  32. package/dist/index.js.map +1 -1
  33. package/dist/metadata.d.ts +40 -0
  34. package/dist/metadata.d.ts.map +1 -0
  35. package/dist/metadata.js +86 -0
  36. package/dist/metadata.js.map +1 -0
  37. package/dist/types/schema.d.ts +4 -1
  38. package/dist/types/schema.d.ts.map +1 -1
  39. package/dist/types/types.d.ts +3 -2
  40. package/dist/types/types.d.ts.map +1 -1
  41. package/dist/types/types.js +1 -0
  42. package/dist/types/types.js.map +1 -1
  43. package/package.json +3 -2
  44. package/src/categories/category-gis.ts +8 -0
  45. package/src/categories/category-image.ts +1 -1
  46. package/src/categories/category-mesh.ts +86 -3
  47. package/src/deprecated/mesh-utils.ts +15 -35
  48. package/src/float16.ts +111 -0
  49. package/src/geometry/arrow-binary-features.ts +54 -0
  50. package/src/geometry/geoarrow.ts +116 -0
  51. package/src/index.ts +57 -9
  52. package/src/metadata.ts +115 -0
  53. package/src/types/schema.ts +3 -0
  54. package/src/types/types.ts +7 -0
package/LICENSE CHANGED
@@ -24,8 +24,20 @@ THE SOFTWARE.
24
24
 
25
25
  Copyright (c) 2015 Uber Technologies, Inc.
26
26
 
27
- loaders.gl includes certain files from Cesium (https://github.com/AnalyticalGraphicsInc/cesium)
28
- under the Apache 2 License (found in the submodule: modules/3d-tiles):)
27
+ Portions of modules/images/src/lib/category-api/binary-image-api.ts are based on
28
+ binary-gltf-utils (https://github.com/Qantas94Heavy/binary-gltf-utils) under the
29
+ MIT License reproduced above.
30
+
31
+ Copyright (c) 2016-17 Karl Cheng
32
+
33
+ Portions of modules/schema-utils/src/lib/utils/async-queue.ts are adapted from
34
+ async-iter-demo (https://github.com/rauschma/async-iter-demo) under the MIT
35
+ License reproduced above.
36
+
37
+ Copyright (c) 2016 Axel Rauschmayer
38
+
39
+ loaders.gl includes certain files from Cesium (https://github.com/CesiumGS/cesium)
40
+ under the Apache 2.0 License, including files in modules/3d-tiles.
29
41
 
30
42
  Copyright 2011-2018 CesiumJS Contributors
31
43
 
@@ -38,4 +50,3 @@ Unless required by applicable law or agreed to in writing, software
38
50
  distributed under the License is distributed on an "AS IS" BASIS,
39
51
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40
52
  See the License for the specific language governing permissions and limitations under the License.
41
-
@@ -3,4 +3,5 @@ export type { Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPoly
3
3
  export type { FlatGeometryType, FlatIndexedGeometry, FlatPoint, FlatLineString, FlatPolygon, FlatGeometry, FlatFeature } from "../geometry/flat-geometries.js";
4
4
  export type { BinaryGeometryType, BinaryFixedSizeList, BinaryGeometry, BinaryPointGeometry, BinaryLineGeometry, BinaryPolygonGeometry } from "../geometry/binary-geometries.js";
5
5
  export type { BinaryAttribute, BinaryProperties, BinaryFeatureCollection, BinaryFeature, BinaryPointFeature, BinaryLineFeature, BinaryPolygonFeature } from "../geometry/binary-features.js";
6
+ export type { ArrowBinaryFeatureTable, ArrowBinaryPointFeature, ArrowBinaryLineFeature, ArrowBinaryPolygonFeature, ArrowBinaryFeatureCollection, BinaryFeatureCollectionLike } from "../geometry/arrow-binary-features.js";
6
7
  //# sourceMappingURL=category-gis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"category-gis.d.ts","sourceRoot":"","sources":["../../src/categories/category-gis.ts"],"names":[],"mappings":"AAOA,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,uCAAoC;AAGrC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACtB,yCAAsC;AACvC,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACrB,uCAAoC"}
1
+ {"version":3,"file":"category-gis.d.ts","sourceRoot":"","sources":["../../src/categories/category-gis.ts"],"names":[],"mappings":"AAOA,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,KAAK,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,OAAO,EACP,YAAY,EACZ,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,uCAAoC;AAGrC,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACtB,yCAAsC;AACvC,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACrB,uCAAoC;AACrC,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC5B,6CAA0C"}
@@ -12,7 +12,7 @@ export type ImageDataType = {
12
12
  */
13
13
  export type ImageType = ImageBitmap | ImageDataType | HTMLImageElement;
14
14
  /**
15
- * Image type string used to control or determine the type of images returned from ImageLoader
15
+ * Image type string used to control or determine the type of images returned from image category loaders
16
16
  */
17
17
  export type ImageTypeEnum = 'imagebitmap' | 'image' | 'data';
18
18
  //# sourceMappingURL=category-image.d.ts.map
@@ -1,23 +1,50 @@
1
1
  import type { Schema } from "../types/schema.js";
2
2
  import type { TypedArray } from "../types/types.js";
3
3
  import type { ColumnarTable, ArrowTable } from "./category-table.js";
4
+ import * as arrow from 'apache-arrow';
4
5
  /** Mesh as columnar table */
5
6
  export interface MeshTable extends ColumnarTable {
6
- topology: 'point-list' | 'triangle-list' | 'triangle-strip';
7
+ topology: MeshTopology;
7
8
  indices?: MeshAttribute;
8
9
  }
9
10
  /** Mesh as arrow table */
10
11
  export interface MeshArrowTable extends ArrowTable {
11
- topology: 'point-list' | 'triangle-list' | 'triangle-strip';
12
+ /** Mesh topology represented by the Arrow table rows and indices. */
13
+ topology: MeshTopology;
14
+ /** Optional top-level primitive indices accessor for indexed meshes. */
12
15
  indices?: MeshAttribute;
16
+ /** Raw Apache Arrow table data for Mesh or IndexedMesh columns. */
17
+ data: MeshArrowTableData | IndexedMeshArrowTableData;
13
18
  }
19
+ /** Apache Arrow columns for a mesh vertex table. */
20
+ export type MeshArrowColumns = {
21
+ /** XYZ vertex positions as float32 tuples. */
22
+ POSITION: arrow.FixedSizeList<arrow.Float32>;
23
+ /** Loader-specific vertex attribute columns appended after predefined fields. */
24
+ [attributeName: string]: arrow.DataType;
25
+ };
26
+ /** Primitive topology names shared by columnar and Arrow mesh representations. */
27
+ export type MeshTopology = 'point-list' | 'line-list' | 'line-loop' | 'line-strip' | 'triangle-list' | 'triangle-strip' | 'triangle-fan';
28
+ /** Apache Arrow columns for an indexed mesh vertex table. */
29
+ export type IndexedMeshArrowColumns = MeshArrowColumns & {
30
+ /** Unsigned 32-bit primitive indices, stored in row 0 and null for remaining vertex rows. */
31
+ indices: arrow.List<arrow.Uint32>;
32
+ };
33
+ /** Raw Apache Arrow table data for a mesh vertex table. */
34
+ export type MeshArrowTableData = arrow.Table<MeshArrowColumns>;
35
+ /** Raw Apache Arrow table data for an indexed mesh vertex table. */
36
+ export type IndexedMeshArrowTableData = arrow.Table<IndexedMeshArrowColumns>;
37
+ /** Predefined Apache Arrow schema for common mesh vertex columns. */
38
+ export declare const meshArrowSchema: arrow.Schema<MeshArrowColumns>;
39
+ /** Predefined Apache Arrow schema for indexed mesh vertex tables. */
40
+ export declare const indexedMeshArrowSchema: arrow.Schema<IndexedMeshArrowColumns>;
14
41
  /** Geometry part of a Mesh (compatible with a standard luma.gl "mesh") */
15
42
  export type MeshGeometry = {
16
43
  attributes: {
17
44
  [attributeName: string]: MeshAttribute;
18
45
  };
19
46
  indices?: MeshAttribute;
20
- topology: 'point-list' | 'triangle-list' | 'triangle-strip';
47
+ topology: MeshTopology;
21
48
  mode: number;
22
49
  };
23
50
  /** Geometry and metadata for a Mesh (compatible with a standard luma.gl "mesh") */
@@ -32,6 +59,26 @@ export type Mesh = MeshGeometry & {
32
59
  };
33
60
  schema: Schema;
34
61
  };
62
+ /** Quantization transform required to reconstruct floating-point attribute values. */
63
+ export type MeshAttributeQuantizationTransform = {
64
+ /** Transform discriminator. */
65
+ type: 'quantization';
66
+ /** Number of quantization bits. */
67
+ bits: number;
68
+ /** Per-component quantization origin. */
69
+ origin: number[];
70
+ /** Quantization range shared by every component. */
71
+ range: number;
72
+ };
73
+ /** Octahedral transform required to reconstruct directional attribute values. */
74
+ export type MeshAttributeOctahedronTransform = {
75
+ /** Transform discriminator. */
76
+ type: 'octahedron';
77
+ /** Number of quantization bits. */
78
+ bits: number;
79
+ };
80
+ /** Encoded transform retained on an attribute for deferred CPU or GPU reconstruction. */
81
+ export type MeshAttributeTransform = MeshAttributeQuantizationTransform | MeshAttributeOctahedronTransform;
35
82
  /**
36
83
  * luma.gl compatible attribute descriptors
37
84
  * Can be mapped to any WebGL framework
@@ -42,6 +89,10 @@ export type MeshAttribute = {
42
89
  byteOffset?: number;
43
90
  byteStride?: number;
44
91
  normalized?: boolean;
92
+ /** Logical component type when the storage array does not expose it directly. */
93
+ componentType?: 'float16';
94
+ /** Transform required to reconstruct the logical attribute values. */
95
+ transform?: MeshAttributeTransform;
45
96
  };
46
97
  /** A map of mesh attributes keyed by attribute names */
47
98
  export type MeshAttributes = Record<string, MeshAttribute>;
@@ -1 +1 @@
1
- {"version":3,"file":"category-mesh.d.ts","sourceRoot":"","sources":["../../src/categories/category-mesh.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,2BAAwB;AAC5C,OAAO,KAAK,EAAC,UAAU,EAAC,0BAAuB;AAC/C,OAAO,KAAK,EAAC,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AAM,MAAM,sBAAsB,GAC9B,kCAAkC,GAClC,gCAAgC,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,sEAAsE;IACtE,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC"}
@@ -1,5 +1,14 @@
1
1
  // loaders.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- export {};
4
+ import * as arrow from 'apache-arrow';
5
+ /** Predefined Apache Arrow schema for common mesh vertex columns. */
6
+ export const meshArrowSchema = new arrow.Schema([
7
+ new arrow.Field('POSITION', new arrow.FixedSizeList(3, new arrow.Field('value', new arrow.Float32(), false)), false)
8
+ ]);
9
+ /** Predefined Apache Arrow schema for indexed mesh vertex tables. */
10
+ export const indexedMeshArrowSchema = new arrow.Schema([
11
+ ...meshArrowSchema.fields,
12
+ new arrow.Field('indices', new arrow.List(new arrow.Field('item', new arrow.Uint32(), false)), true)
13
+ ]);
5
14
  //# sourceMappingURL=category-mesh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"category-mesh.js","sourceRoot":"","sources":["../../src/categories/category-mesh.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC"}
1
+ {"version":3,"file":"category-mesh.js","sourceRoot":"","sources":["../../src/categories/category-mesh.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAkDtC,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,KAAK,CAAC,MAAM,CAAmB;IAChE,IAAI,KAAK,CAAC,KAAK,CACb,UAAU,EACV,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC,EAChF,KAAK,CACN;CACF,CAAC,CAAC;AAEH,qEAAqE;AACrE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,KAAK,CAAC,MAAM,CAA0B;IAC9E,GAAG,eAAe,CAAC,MAAM;IACzB,IAAI,KAAK,CAAC,KAAK,CACb,SAAS,EACT,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC,EAClE,IAAI,CACL;CACF,CAAC,CAAC"}
@@ -1,24 +1,11 @@
1
1
  import { MeshAttributes } from "../categories/category-mesh.js";
2
- import { TypedArray } from "../types/types.js";
3
- type TypedArrays = {
4
- [key: string]: TypedArray;
5
- };
6
- /**
7
- * Holds an axis aligned bounding box
8
- * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)
9
- */
10
2
  type BoundingBox = [[number, number, number], [number, number, number]];
11
3
  /**
12
- * Get number of vertices in mesh
13
- * @param attributes
14
- * @deprecated Import from shema-utils
15
- */
16
- export declare function getMeshSize(attributes: TypedArrays): number;
17
- /**
18
- * Get the (axis aligned) bounding box of a mesh
19
- * @param attributes
20
- * @returns array of two vectors representing the axis aligned bounding box
21
- * @deprecated Import from shema-utils
4
+ * Get the (axis aligned) bounding box of a mesh.
5
+ * @param attributes Mesh attributes.
6
+ * @returns The axis aligned bounding box as minimum and maximum vectors.
7
+ * @deprecated Import `getMeshBoundingBox` from `@loaders.gl/schema-utils` instead. This root
8
+ * export remains temporarily for deck.gl 9.4 compatibility.
22
9
  */
23
10
  export declare function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox;
24
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"mesh-utils.d.ts","sourceRoot":"","sources":["../../src/deprecated/mesh-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,cAAc,EAAC,uCAAoC;AAC3D,OAAO,EAAC,UAAU,EAAC,0BAAuB;AAE1C,KAAK,WAAW,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAC,CAAC;AAE/C;;;GAGG;AACH,KAAK,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,WAAW,GAAG,MAAM,CAU3D;AAED;;;;;GAKG;AAEH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,WAAW,CA4B1E"}
1
+ {"version":3,"file":"mesh-utils.d.ts","sourceRoot":"","sources":["../../src/deprecated/mesh-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAC,uCAAoC;AAE3D,KAAK,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExE;;;;;;GAMG;AAEH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,WAAW,CA6B1E"}
@@ -1,24 +1,12 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  /**
2
- * Get number of vertices in mesh
3
- * @param attributes
4
- * @deprecated Import from shema-utils
5
- */
6
- export function getMeshSize(attributes) {
7
- let size = 0;
8
- for (const attributeName in attributes) {
9
- const attribute = attributes[attributeName];
10
- if (ArrayBuffer.isView(attribute)) {
11
- // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT
12
- size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;
13
- }
14
- }
15
- return size;
16
- }
17
- /**
18
- * Get the (axis aligned) bounding box of a mesh
19
- * @param attributes
20
- * @returns array of two vectors representing the axis aligned bounding box
21
- * @deprecated Import from shema-utils
5
+ * Get the (axis aligned) bounding box of a mesh.
6
+ * @param attributes Mesh attributes.
7
+ * @returns The axis aligned bounding box as minimum and maximum vectors.
8
+ * @deprecated Import `getMeshBoundingBox` from `@loaders.gl/schema-utils` instead. This root
9
+ * export remains temporarily for deck.gl 9.4 compatibility.
22
10
  */
23
11
  // eslint-disable-next-line complexity
24
12
  export function getMeshBoundingBox(attributes) {
@@ -29,11 +17,11 @@ export function getMeshBoundingBox(attributes) {
29
17
  let maxY = -Infinity;
30
18
  let maxZ = -Infinity;
31
19
  const positions = attributes.POSITION ? attributes.POSITION.value : [];
32
- const len = positions && positions.length;
33
- for (let i = 0; i < len; i += 3) {
34
- const x = positions[i];
35
- const y = positions[i + 1];
36
- const z = positions[i + 2];
20
+ const length = positions && positions.length;
21
+ for (let index = 0; index < length; index += 3) {
22
+ const x = positions[index];
23
+ const y = positions[index + 1];
24
+ const z = positions[index + 2];
37
25
  minX = x < minX ? x : minX;
38
26
  minY = y < minY ? y : minY;
39
27
  minZ = z < minZ ? z : minZ;
@@ -1 +1 @@
1
- {"version":3,"file":"mesh-utils.js","sourceRoot":"","sources":["../../src/deprecated/mesh-utils.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,UAAuB;IACjD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,aAAa,IAAI,UAAU,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;QAC5C,IAAI,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YAClC,q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