zudoku 0.1.1-dev.45 → 0.1.1-dev.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/plugins/openapi/OperationListItem.js +2 -22
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListView.d.ts +7 -0
- package/dist/lib/plugins/openapi/SchemaListView.js +43 -0
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -0
- package/lib/{Spinner-2oXmSf81.js → Spinner-DEkC7JSn.js} +2089 -1986
- package/lib/zudoku.components.js +507 -608
- package/lib/zudoku.plugins.js +4993 -4892
- package/package.json +1 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +7 -121
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -1
- package/src/lib/plugins/openapi/SchemaListView.tsx +229 -0
|
@@ -6,33 +6,13 @@ import { OperationsFragment } from "./OperationList.js";
|
|
|
6
6
|
import { ParameterList } from "./ParameterList.js";
|
|
7
7
|
import { Sidecar } from "./Sidecar.js";
|
|
8
8
|
import { useFragment } from "./graphql/index.js";
|
|
9
|
-
import { useState } from "react";
|
|
10
|
-
import { cn } from "../../util/cn.js";
|
|
11
9
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../ui/Tabs.js";
|
|
10
|
+
import { SchemaListView } from "./SchemaListView.js";
|
|
12
11
|
export const PARAM_GROUPS = ["path", "query", "header", "cookie"];
|
|
13
12
|
export const OperationListItem = ({ operationFragment, }) => {
|
|
14
13
|
const operation = useFragment(OperationsFragment, operationFragment);
|
|
15
14
|
const groupedParameters = groupBy(operation?.parameters ?? [], "in");
|
|
16
15
|
const first = operation.responses.find((re) => re.statusCode === "200");
|
|
17
|
-
return (_jsxs("div", { className: "grid grid-cols-2 gap-8 items-start border-b-2 mb-16 pb-16 border-border", children: [_jsxs("div", { className: ProseClasses, children: [_jsx(Heading, { level: 2, className: "mt-0", id: operation.slug, registerSidebarAnchor: true, children: operation.summary }), operation.description && _jsx(Markdown, { content: operation.description }), operation.parameters && operation.parameters.length > 0 && (_jsx("div", { className: "mt-4", children: PARAM_GROUPS.flatMap((group) => groupedParameters?.[group]?.length ? (_jsx(ParameterList, { id: operation.slug, groupedParameters: groupedParameters, group: group }, group)) : ([])) })), _jsx(Heading, { level: 3, className: "capitalize", children: "Responses" }), _jsxs(Tabs, { defaultValue: `${first?.statusCode}${first?.description}`, children: [_jsx(TabsList, { children: operation.responses.map((response) => (
|
|
18
|
-
};
|
|
19
|
-
const ViewSchema = ({ name, schema, level = 0, collapsible = false, }) => {
|
|
20
|
-
const [open, setOpen] = useState(!collapsible);
|
|
21
|
-
const properties = Object.entries(schema.properties ?? {});
|
|
22
|
-
const additionalProperties = typeof schema.additionalProperties === "object"
|
|
23
|
-
? Object.entries(schema.additionalProperties)
|
|
24
|
-
: [];
|
|
25
|
-
return (_jsxs("div", { className: cn("not-prose", level > 0 && "border border-border rounded text-sm"), onClick: collapsible
|
|
26
|
-
? () => {
|
|
27
|
-
setOpen((open) => !open);
|
|
28
|
-
}
|
|
29
|
-
: undefined, children: [(schema.title ?? name) && (_jsx("div", { className: "ml-2 my-1 font-bold", children: schema.title ?? name })), level === 0 && _jsx("p", { children: "schema.description" }), _jsx("ul", { children: open &&
|
|
30
|
-
properties
|
|
31
|
-
.concat(additionalProperties)
|
|
32
|
-
.map(([propertyName, property]) => (_jsxs("div", { className: cn(level > 0 ? "py-2" : "py-4", "px-2 border-t border-border bg-border/20 hover:bg-border/30 flex gap-1 flex-col", property.deprecated && "opacity-50"), children: [_jsxs("div", { className: "flex items-center gap-2 relative", children: [_jsxs("code", { children: [propertyName, " ", property.title] }), property.type && (_jsx("span", { className: "text-sm text-muted-foreground", children: property.type })), property.deprecated && (_jsx("span", { className: "text-sm text-muted-foreground", children: "Deprecated" })), !schema.required?.includes(propertyName) &&
|
|
33
|
-
!property.required && (_jsx("span", { className: "py-px px-1.5 font-medium text-xs border border-border rounded-lg", children: "optional" }))] }), property.description && (_jsx(Markdown, { content: property.description, className: "prose text-sm prose-p:my-1 leading-normal line-clamp-4" })), property.enum && (_jsxs("span", { className: "text-sm text-muted-foreground flex gap-1 flex-wrap items-center", children: [_jsx("span", { children: "Possible values" }), property.enum
|
|
34
|
-
.filter((value) => value)
|
|
35
|
-
.map((value) => (_jsx("span", { className: "font-mono text-xs border-border border bg-muted rounded px-1", children: value }, value)))] })), property.type === "object" && (_jsx("div", { className: "mt-2.5", children: _jsx(ViewSchema, { schema: property, level: level + 1 }) })), property.type === "array" &&
|
|
36
|
-
property.items.type === "object" && (_jsx("div", { className: "mt-2.5", children: _jsx(ViewSchema, { schema: property.items, level: level + 1 }) }))] }, propertyName))) })] }));
|
|
16
|
+
return (_jsxs("div", { className: "grid grid-cols-2 gap-8 items-start border-b-2 mb-16 pb-16 border-border", children: [_jsxs("div", { className: ProseClasses, children: [_jsx(Heading, { level: 2, className: "mt-0", id: operation.slug, registerSidebarAnchor: true, children: operation.summary }), operation.description && _jsx(Markdown, { content: operation.description }), operation.parameters && operation.parameters.length > 0 && (_jsx("div", { className: "mt-4", children: PARAM_GROUPS.flatMap((group) => groupedParameters?.[group]?.length ? (_jsx(ParameterList, { id: operation.slug, groupedParameters: groupedParameters, group: group }, group)) : ([])) })), _jsx(Heading, { level: 3, className: "capitalize", children: "Responses" }), _jsxs(Tabs, { defaultValue: `${first?.statusCode}${first?.description}`, children: [_jsx(TabsList, { children: operation.responses.map((response) => (_jsx(TabsTrigger, { value: response.statusCode + response.description, title: response.description, children: response.statusCode }, response.statusCode))) }), _jsx("ul", { className: "list-none m-0 px-0 overflow-hidden", children: operation.responses.map((response) => (_jsx(TabsContent, { value: response.statusCode + response.description, children: _jsx(SchemaListView, { schema: response.content?.at(0)?.schema, name: "" }) }, response.statusCode))) })] })] }), _jsx(Sidecar, { operation: operation })] }, operation.operationId));
|
|
37
17
|
};
|
|
38
18
|
//# sourceMappingURL=OperationListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationListItem.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/OperationListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAgB,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"OperationListItem.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/OperationListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAgB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,E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AAK,EAAE,UAAU,GAAG,KAAK,EAAE,WAAW,EAAE,aAC7D,KAAC,QAAQ,cACN,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACrC,KAAC,WAAW,IACV,KAAK,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,WAAW,EAEjD,KAAK,EAAE,QAAQ,CAAC,WAAW,YAE1B,QAAQ,CAAC,UAAU,IAHf,QAAQ,CAAC,UAAU,CAIZ,CACf,CAAC,GACO,EACX,aAAI,SAAS,EAAC,oCAAoC,YAC/C,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACrC,KAAC,WAAW,IACV,KAAK,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,WAAW,YAGjD,KAAC,cAAc,IACb,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EACvC,IAAI,EAAC,EAAE,GACP,IALG,QAAQ,CAAC,UAAU,CAMZ,CACf,CAAC,GACC,IACA,IACH,EAEN,KAAC,OAAO,IAAC,SAAS,EAAE,SAAS,GAAI,KA5D5B,SAAS,CAAC,WAAW,CA6DtB,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -9,5 +9,5 @@ const getParameterSchema = (parameter) => {
|
|
|
9
9
|
type: "string",
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
export const ParameterListItem = ({ parameter, group, id, }) => (_jsxs("li", { className: "not-prose px-2 py-4 border-t border-border bg-border/20", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { children: group === "path" ? (_jsx(ColorizedParam, { name: parameter.name, backgroundOpacity: "15%", className: "px-1", slug: id + "-" + parameter.name.toLocaleLowerCase() })) : (parameter.name) }), parameter.required && (_jsx("span", { className: "py-px px-1.5 font-medium text-xs bg-primary/75 text-muted rounded-lg", children: "required" })), getParameterSchema(parameter).type && (_jsx("span", { className: "text-xs text-muted-foreground", children: getParameterSchema(parameter).type }))] }), parameter.description && (_jsx(Markdown, { content: parameter.description, className: "text-sm prose-p:my-1" }))] }));
|
|
12
|
+
export const ParameterListItem = ({ parameter, group, id, }) => (_jsxs("li", { className: "not-prose px-2 py-4 border-t border-border bg-border/20 text-sm flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { children: group === "path" ? (_jsx(ColorizedParam, { name: parameter.name, backgroundOpacity: "15%", className: "px-1", slug: id + "-" + parameter.name.toLocaleLowerCase() })) : (parameter.name) }), parameter.required && (_jsx("span", { className: "py-px px-1.5 font-medium text-xs bg-primary/75 text-muted rounded-lg", children: "required" })), getParameterSchema(parameter).type && (_jsx("span", { className: "text-xs text-muted-foreground", children: getParameterSchema(parameter).type }))] }), parameter.description && (_jsx(Markdown, { content: parameter.description, className: "text-sm prose-p:my-1" }))] }));
|
|
13
13
|
//# sourceMappingURL=ParameterListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterListItem.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ParameterListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,MAAM,kBAAkB,GAAG,CACzB,SAAkC,EACpB,EAAE;IAChB,IAAI,SAAS,CAAC,MAAM,IAAI,IAAI,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC,MAAM,CAAC;IAC1B,CAAC;IACD,OAAO;QACL,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,SAAS,EACT,KAAK,EACL,EAAE,GAKH,EAAE,EAAE,CAAC,CACJ,cAAI,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"ParameterListItem.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ParameterListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,MAAM,kBAAkB,GAAG,CACzB,SAAkC,EACpB,EAAE;IAChB,IAAI,SAAS,CAAC,MAAM,IAAI,IAAI,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACrE,OAAO,SAAS,CAAC,MAAM,CAAC;IAC1B,CAAC;IACD,OAAO;QACL,IAAI,EAAE,QAAQ;KACf,CAAC;AACJ,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,SAAS,EACT,KAAK,EACL,EAAE,GAKH,EAAE,EAAE,CAAC,CACJ,cAAI,SAAS,EAAC,qFAAqF,aACjG,eAAK,SAAS,EAAC,yBAAyB,aACtC,yBACG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAClB,KAAC,cAAc,IACb,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,iBAAiB,EAAC,KAAK,EACvB,SAAS,EAAC,MAAM,EAChB,IAAI,EAAE,EAAE,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,GACnD,CACH,CAAC,CAAC,CAAC,CACF,SAAS,CAAC,IAAI,CACf,GACI,EACN,SAAS,CAAC,QAAQ,IAAI,CACrB,eAAM,SAAS,EAAC,sEAAsE,yBAE/E,CACR,EACA,kBAAkB,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,CACrC,eAAM,SAAS,EAAC,+BAA+B,YAC5C,kBAAkB,CAAC,SAAS,CAAC,CAAC,IAAI,GAC9B,CACR,IACG,EACL,SAAS,CAAC,WAAW,IAAI,CACxB,KAAC,QAAQ,IACP,OAAO,EAAE,SAAS,CAAC,WAAW,EAC9B,SAAS,EAAC,sBAAsB,GAChC,CACH,IACE,CACN,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SchemaObject } from "../../oas/parser/index.js";
|
|
2
|
+
export declare const SchemaListView: ({ name, schema, level, defaultOpen, }: {
|
|
3
|
+
level?: number;
|
|
4
|
+
defaultOpen?: boolean;
|
|
5
|
+
name?: string;
|
|
6
|
+
schema: SchemaObject;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { cn } from "../../util/cn.js";
|
|
4
|
+
import { Markdown } from "../../components/Markdown.js";
|
|
5
|
+
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
6
|
+
import { Button } from "../../ui/Button.js";
|
|
7
|
+
import { ListPlusIcon } from "lucide-react";
|
|
8
|
+
export const SchemaListView = ({ name, schema, level = 0, defaultOpen = false, }) => {
|
|
9
|
+
const properties = Object.entries(schema.properties ?? {});
|
|
10
|
+
const additionalProperties = typeof schema.additionalProperties === "object"
|
|
11
|
+
? Object.entries(schema.additionalProperties)
|
|
12
|
+
: [];
|
|
13
|
+
const combinedProperties = properties.concat(Array.isArray(additionalProperties) ? additionalProperties : []);
|
|
14
|
+
const groups = Object.groupBy(combinedProperties, ([propertyName, property]) => {
|
|
15
|
+
return property.deprecated
|
|
16
|
+
? "deprecated"
|
|
17
|
+
: schema.required?.includes(propertyName)
|
|
18
|
+
? "required"
|
|
19
|
+
: "optional";
|
|
20
|
+
});
|
|
21
|
+
return (_jsxs("div", { className: cn("not-prose", level > 0 && "border border-border rounded text-sm"), children: [(schema.title ?? name) && (_jsx("div", { className: "ml-2 my-1 font-bold", children: schema.title ?? name })), level === 0 && schema.description && (_jsx("p", { className: "prose", children: schema.description })), _jsx("ul", { children: Object.entries(groups).map(([group, properties]) => {
|
|
22
|
+
return (_jsx(SchemaListViewItemGroup, { defaultOpen: defaultOpen, group: group, nestingLevel: level, properties: properties, required: schema.required ?? [] }));
|
|
23
|
+
}) })] }));
|
|
24
|
+
};
|
|
25
|
+
const SchemaListViewItemGroup = ({ group, properties, nestingLevel, required, defaultOpen = false, }) => {
|
|
26
|
+
const notCollapsible = defaultOpen ||
|
|
27
|
+
group === "required" ||
|
|
28
|
+
properties.length === 1 ||
|
|
29
|
+
nestingLevel === 0;
|
|
30
|
+
const [open, setOpen] = useState(notCollapsible);
|
|
31
|
+
if (properties.length === 0) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
return (_jsxs(Collapsible.Root, { className: "CollapsibleRoot", open: open, onOpenChange: setOpen, children: [!open && (_jsxs(Collapsible.Trigger, { className: cn("py-2 hover:bg-muted w-full", group === "optional" && "font-semibold", group === "deprecated" && "text-muted-foreground"), children: [properties.length, " ", group, " fields"] })), _jsx(Collapsible.Content, { children: properties.map(([propertyName, property]) => (_jsx(SchemaListViewItem, { property: property, propertyName: propertyName, nestingLevel: nestingLevel, isRequired: required?.includes(propertyName) ?? false }))) })] }));
|
|
35
|
+
};
|
|
36
|
+
const SchemaListViewItem = ({ propertyName, property, nestingLevel, isRequired, }) => {
|
|
37
|
+
return (_jsxs("div", { className: cn(nestingLevel > 0 ? "py-2" : "py-4", "px-2 border-t border-border bg-border/20 hover:bg-border/30 flex gap-1 flex-col text-sm", property.deprecated && "opacity-50"), children: [_jsxs("div", { className: "flex items-center gap-2 relative", children: [_jsxs("code", { children: [propertyName, " ", property.title] }), property.type && (_jsx("span", { className: "text-muted-foreground", children: property.type })), property.deprecated && (_jsx("span", { className: "text-muted-foreground", children: "Deprecated" })), !isRequired && (_jsxs("span", { className: "py-px px-1.5 font-medium text-xs border border-border rounded-lg", children: ["optional ", property.required] }))] }), property.description && (_jsx(Markdown, { content: property.description, className: "text-sm leading-normal line-clamp-4 " })), property.enum && (_jsxs("span", { className: "text-sm text-muted-foreground flex gap-1 flex-wrap items-center", children: [_jsx("span", { children: "Possible values" }), property.enum
|
|
38
|
+
.filter((value) => value)
|
|
39
|
+
.map((value) => (_jsx("span", { className: "font-mono text-xs border-border border bg-muted rounded px-1", children: value }, value)))
|
|
40
|
+
.slice(0, 4), property.enum.length > 4 && (_jsx("span", { className: "font-mono text-xs border-border border bg-muted rounded px-1", children: "..." }))] })), _jsxs(Collapsible.Root, { className: "CollapsibleRoot", defaultOpen: false, children: [property.type === "object" ||
|
|
41
|
+
(property.type === "array" && property.items.type === "object") ? (_jsx(Collapsible.Trigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", children: ["Show nested fields", _jsx(ListPlusIcon, { size: 18, className: "ml-1.5" })] }) })) : null, _jsxs(Collapsible.Content, { children: [property.type === "object" && (_jsx("div", { className: "mt-2.5", children: _jsx(SchemaListView, { schema: property, level: nestingLevel + 1, defaultOpen: true }) })), property.type === "array" && property.items.type === "object" && (_jsx("div", { className: "mt-2.5", children: _jsx(SchemaListView, { schema: property.items, defaultOpen: true, level: nestingLevel + 1 }) }))] })] })] }, propertyName));
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=SchemaListView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaListView.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/SchemaListView.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,IAAI,EACJ,MAAM,EACN,KAAK,GAAG,CAAC,E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