persona-community-5/.pnpm-store/v3/files/ad/7e0fc10a1f5b0383fdc9b0232335113e71bd9dd94d4854ed67efad1068f54c62fee046d93e9892191f8f9d87c3313fd0c252a90e78f3ab21a472aee6ce699c
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

1 line
38 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"ts.cjs","sources":["../../src/lib/ts.ts"],"sourcesContent":["import type { OasRef, Referenced } from \"@redocly/openapi-core\";\nimport { parseRef } from \"@redocly/openapi-core/lib/ref-utils.js\";\nimport ts, { type LiteralTypeNode, type TypeLiteralNode } from \"typescript\";\nimport type { ParameterObject } from \"../types.js\";\n\nexport const JS_PROPERTY_INDEX_RE = /^[A-Za-z_$][A-Za-z_$0-9]*$/;\nexport const JS_ENUM_INVALID_CHARS_RE = /[^A-Za-z_$0-9]+(.)?/g;\nexport const JS_PROPERTY_INDEX_INVALID_CHARS_RE = /[^A-Za-z_$0-9]+/g;\nexport const SPECIAL_CHARACTER_MAP: Record<string, string> = {\n \"+\": \"Plus\",\n // Add more mappings as needed\n};\n\nexport const BOOLEAN = ts.factory.createKeywordTypeNode(ts.SyntaxKind.BooleanKeyword);\nexport const FALSE = ts.factory.createLiteralTypeNode(ts.factory.createFalse());\nexport const NEVER = ts.factory.createKeywordTypeNode(ts.SyntaxKind.NeverKeyword);\nexport const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull());\nexport const NUMBER = ts.factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword);\nexport const QUESTION_TOKEN = ts.factory.createToken(ts.SyntaxKind.QuestionToken);\nexport const STRING = ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword);\nexport const TRUE = ts.factory.createLiteralTypeNode(ts.factory.createTrue());\nexport const UNDEFINED = ts.factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword);\nexport const UNKNOWN = ts.factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword);\n\nconst LB_RE = /\\r?\\n/g;\nconst COMMENT_RE = /\\*\\//g;\n\nexport interface AnnotatedSchemaObject {\n const?: unknown; // jsdoc without value\n default?: unknown; // jsdoc with value\n deprecated?: boolean; // jsdoc without value\n description?: string; // jsdoc with value\n enum?: unknown[]; // jsdoc without value\n example?: string; // jsdoc with value\n examples?: unknown;\n format?: string; // not jsdoc\n nullable?: boolean; // Node information\n summary?: string; // not jsdoc\n title?: string; // not jsdoc\n type?: string | string[]; // Type of node\n}\n\n/**\n * Preparing comments from fields\n * @see {comment} for output examples\n * @returns void if not comments or jsdoc format comment string\n */\nexport function addJSDocComment(schemaObject: AnnotatedSchemaObject, node: ts.PropertySignature): void {\n if (!schemaObject || typeof schemaObject !== \"object\" || Array.isArray(schemaObject)) {\n return;\n }\n const output: string[] = [];\n\n // Not JSDoc tags: [title, format]\n if (schemaObject.title) {\n output.push(schemaObject.title.trim().replace(LB_RE, \"\\n * \"));\n }\n if (schemaObject.summary) {\n output.push(schemaObject.summary.trim().replace(LB_RE, \"\\n * \"));\n }\n if (schemaObject.format) {\n output.push(`Format: ${schemaObject.format}`);\n }\n\n // JSDoc tags without value\n // 'Deprecated' without value\n if (schemaObject.deprecated) {\n output.push(\"@deprecated\");\n }\n\n // JSDoc tags with value\n const supportedJsDocTags = [\"description\", \"default\", \"example\"] as const;\n for (const field of supportedJsDocTags) {\n const allowEmptyString = field === \"default\" || field === \"example\";\n if (schemaObject[field] === undefined) {\n continue;\n }\n if (schemaObject[field] === \"\" && !allowEmptyString) {\n continue;\n }\n const serialized =\n typeof schemaObject[field] === \"object\" ? JSON.stringify(schemaObject[field], null, 2) : schemaObject[field];\n output.push(`@${field} ${String(serialized).trim().replace(LB_RE, \"\\n * \")}`);\n }\n\n if (Array.isArray(schemaObject.examples)) {\n for (const example of schemaObject.examples) {\n const serialized = typeof example === \"object\" ? JSON.stringify(example, null, 2) : example;\n output.push(`@example ${String(serialized).trim().replace(LB_RE, \"\\n * \")}`);\n }\n }\n\n // JSDoc 'Constant' without value\n if (\"const\" in schemaObject) {\n output.push(\"@constant\");\n }\n\n // JSDoc 'Enum' with type\n if (schemaObject.enum) {\n let type = \"unknown\";\n if (Array.isArray(schemaObject.type)) {\n type = schemaObject.type.join(\"|\");\n } else if (typeof schemaObject.type === \"string\") {\n type = schemaObject.type;\n }\n output.push(`@enum {${type}${schemaObject.nullable ? \"|null\" : \"\"}}`);\n }\n\n // attach comment if it has content\n\n if (output.length) {\n // Check if any output item contains multi-line content (has internal line breaks)\n const hasMultiLineContent = output.some((item) => item.includes(\"\\n\"));\n\n let text =\n output.length === 1 && !hasMultiLineContent ? `* ${output.join(\"\\n\")} ` : `*\\n * ${output.join(\"\\n * \")}\\n `;\n text = text.replace(COMMENT_RE, \"*\\\\/\"); // prevent inner comments from leaking\n\n ts.addSyntheticLeadingComment(\n /* node */ node,\n /* kind */ ts.SyntaxKind.MultiLineCommentTrivia, // note: MultiLine just refers to a \"/* */\" comment\n /* text */ text,\n /* hasTrailingNewLine */ true,\n );\n }\n}\n\nfunction isOasRef<T>(obj: Referenced<T>): obj is OasRef {\n return Boolean((obj as OasRef).$ref);\n}\ntype OapiRefResolved = Referenced<ParameterObject>;\n\nfunction isParameterObject(obj: OapiRefResolved | undefined): obj is ParameterObject {\n return Boolean(obj && !isOasRef(obj) && obj.in);\n}\n\nfunction addIndexedAccess(node: ts.TypeNode, ...segments: readonly string[]) {\n return segments.reduce<ts.TypeNode>((acc, segment) => {\n return ts.factory.createIndexedAccessTypeNode(\n acc,\n ts.factory.createLiteralTypeNode(\n typeof segment === \"number\"\n ? ts.factory.createNumericLiteral(segment)\n : ts.factory.createStringLiteral(segment),\n ),\n );\n }, node);\n}\n\n/**\n * Wrap a type with Extract<T, { propertyName: unknown }> to narrow a union type\n * before accessing a property that only exists on some variants.\n */\nfunction wrapWithExtract(type: ts.TypeNode, propertyName: string): ts.TypeNode {\n return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"Extract\"), [\n type,\n ts.factory.createTypeLiteralNode([\n ts.factory.createPropertySignature(\n /* modifiers */ undefined,\n /* name */ ts.factory.createIdentifier(propertyName),\n /* questionToken */ undefined,\n /* type */ ts.factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword),\n ),\n ]),\n ]);\n}\n\nexport interface OapiRefOptions {\n /** Whether to wrap with FlattenedDeepRequired<> (default: false) */\n deep?: boolean;\n /** Array of property names to wrap with Extract<> when accessing */\n extractProperties?: string[];\n}\n\n/**\n * Convert OpenAPI ref into TS indexed access node (ex: `components[\"schemas\"][\"Foo\"]`)\n * `path` is a JSON Pointer to a location within an OpenAPI document.\n * Transform it into a TypeScript type reference into the generated types.\n *\n * In most cases the structures of the openapi-typescript generated types and the\n * JSON Pointer paths into the OpenAPI document are the same. However, in some cases\n * special transformations are necessary to account for the ways they differ.\n * * Object schemas\n * $refs into the `properties` of object schemas are valid, but openapi-typescript\n * flattens these objects, so we omit so the index into the schema skips [\"properties\"]\n * * Parameters\n * $refs into the `parameters` of paths are valid, but openapi-ts represents\n * them according to their type; path, query, header, etc… so in these cases we\n * must check the parameter definition to determine the how to index into\n * the openapi-typescript type.\n * * Union variant properties (oneOf/anyOf)\n * When accessing properties that may only exist on some variants of a union type,\n * we use Extract<> to narrow the type before each property access.\n **/\nexport function oapiRef(path: string, resolved?: OapiRefResolved, options: OapiRefOptions = {}): ts.TypeNode {\n const { pointer } = parseRef(path);\n if (pointer.length === 0) {\n throw new Error(`Error parsing $ref: ${path}. Is this a valid $ref?`);\n }\n\n const parametersObject = isParameterObject(resolved);\n const extractSet = new Set(options.extractProperties ?? []);\n\n // Initial segments are handled in a fixed , then remaining segments are treated\n // according to heuristics based on the initial segments\n const initialSegment = pointer[0];\n const leadingSegments = pointer.slice(1, 3);\n const restSegments = pointer.slice(3);\n\n const leadingType = addIndexedAccess(\n ts.factory.createTypeReferenceNode(\n ts.factory.createIdentifier(\n options.deep ? `FlattenedDeepRequired<${String(initialSegment)}>` : String(initialSegment),\n ),\n ),\n ...leadingSegments,\n );\n\n return restSegments.reduce<ts.TypeNode>((acc, segment, index, original) => {\n // Skip `properties` items when in the middle of the pointer\n // See: https://github.com/openapi-ts/openapi-typescript/issues/1742\n if (segment === \"properties\") {\n return acc;\n }\n\n if (parametersObject && index === original.length - 1) {\n return addIndexedAccess(acc, resolved.in, resolved.name);\n }\n\n // If this segment is in the extractProperties list,\n // wrap the current type with Extract<T, { segment: unknown }> before accessing.\n // This narrows union types to variants that have this property.\n if (extractSet.has(segment)) {\n const narrowedType = wrapWithExtract(acc, segment);\n return addIndexedAccess(narrowedType, segment);\n }\n\n return addIndexedAccess(acc, segment);\n }, leadingType);\n}\n\nexport interface AstToStringOptions {\n fileName?: string;\n sourceText?: string;\n formatOptions?: ts.PrinterOptions;\n}\n\n/** Convert TypeScript AST to string */\nexport function astToString(\n ast: ts.Node | ts.Node[] | ts.TypeElement | ts.TypeElement[],\n options?: AstToStringOptions,\n): string {\n const sourceFile = ts.createSourceFile(\n options?.fileName ?? \"openapi-ts.ts\",\n options?.sourceText ?? \"\",\n ts.ScriptTarget.ESNext,\n false,\n ts.ScriptKind.TS,\n );\n\n // @ts-expect-error its OK to overwrite statements once\n sourceFile.statements = ts.factory.createNodeArray(Array.isArray(ast) ? ast : [ast]);\n\n const printer = ts.createPrinter({\n newLine: ts.NewLineKind.LineFeed,\n removeComments: false,\n ...options?.formatOptions,\n });\n return printer.printFile(sourceFile);\n}\n\n/** Convert an arbitrary string to TS (assuming its valid) */\nexport function stringToAST(source: string): unknown[] {\n return ts.createSourceFile(\n /* fileName */ \"stringInput\",\n /* sourceText */ source,\n /* languageVersion */ ts.ScriptTarget.ESNext,\n /* setParentNodes */ undefined,\n /* scriptKind */ undefined,\n ).statements as any;\n}\n\n/**\n * Deduplicate simple primitive types from an array of nodes\n * Note: wont deduplicate complex types like objects\n */\nexport function tsDedupe(types: ts.TypeNode[]): ts.TypeNode[] {\n const encounteredTypes = new Set<number>();\n const filteredTypes: ts.TypeNode[] = [];\n for (const t of types) {\n // only mark for deduplication if this is not a const (\"text\" means it is a const)\n if (!(\"text\" in ((t as LiteralTypeNode).literal ?? t))) {\n const { kind } = (t as LiteralTypeNode).literal ?? t;\n if (encounteredTypes.has(kind)) {\n continue;\n }\n if (tsIsPrimitive(t)) {\n encounteredTypes.add(kind);\n }\n }\n filteredTypes.push(t);\n }\n return filteredTypes;\n}\n\nexport const enumCache = new Map<string, ts.EnumDeclaration>();\n\n/** Create a TS enum (with sanitized name and members) */\nexport function tsEnum(\n name: string,\n members: (string | number)[],\n metadata?: { name?: string; description?: string | null }[],\n options?: { export?: boolean; shouldCache?: boolean },\n) {\n let enumName = sanitizeMemberName(name);\n enumName = `${enumName[0].toUpperCase()}${enumName.substring(1)}`;\n let key = \"\";\n if (options?.shouldCache) {\n key = `${members\n .slice(0)\n .sort()\n .map((v, i) => {\n return `${metadata?.[i]?.name ?? String(v)}:${metadata?.[i]?.description || \"\"}`;\n })\n .join(\",\")}`;\n if (enumCache.has(key)) {\n return enumCache.get(key) as ts.EnumDeclaration;\n }\n }\n const enumDeclaration = ts.factory.createEnumDeclaration(\n /* modifiers */ options ? tsModifiers({ export: options.export ?? false }) : undefined,\n /* name */ enumName,\n /* members */ members.map((value, i) => tsEnumMember(value, metadata?.[i])),\n );\n options?.shouldCache && enumCache.set(key, enumDeclaration);\n return enumDeclaration;\n}\n\n/** Create an exported TS array literal expression */\nexport function tsArrayLiteralExpression(\n name: string,\n elementType: ts.TypeNode,\n values: (string | number)[],\n options?: { export?: boolean; readonly?: boolean; injectFooter?: ts.Node[] },\n) {\n let variableName = sanitizeMemberName(name);\n variableName = `${variableName[0].toLowerCase()}${variableName.substring(1)}`;\n\n if (\n options?.injectFooter &&\n !options.injectFooter.some(\n (node) => ts.isTypeAliasDeclaration(node) && node?.name?.escapedText === \"FlattenedDeepRequired\",\n )\n ) {\n const helper = stringToAST(\n \"type FlattenedDeepRequired<T> = { [K in keyof T]-?: FlattenedDeepRequired<T[K] extends unknown[] | undefined | null ? Extract<T[K], unknown[]>[number] : T[K]>; };\",\n )[0] as any;\n options.injectFooter.push(helper);\n }\n\n const arrayType = options?.readonly\n ? tsReadonlyArray(elementType, options.injectFooter)\n : ts.factory.createArrayTypeNode(elementType);\n\n return ts.factory.createVariableStatement(\n options ? tsModifiers({ export: options.export ?? false }) : undefined,\n ts.factory.createVariableDeclarationList(\n [\n ts.factory.createVariableDeclaration(\n variableName,\n undefined,\n arrayType,\n ts.factory.createArrayLiteralExpression(\n values.map((value) => {\n if (typeof value === \"number\") {\n if (value < 0) {\n return ts.factory.createPrefixUnaryExpression(\n ts.SyntaxKind.MinusToken,\n ts.factory.createNumericLiteral(Math.abs(value)),\n );\n } else {\n return ts.factory.createNumericLiteral(value);\n }\n } else {\n return ts.factory.createStringLiteral(value);\n }\n }),\n ),\n ),\n ],\n ts.NodeFlags.Const,\n ),\n );\n}\n\nfunction sanitizeMemberName(name: string) {\n let sanitizedName = name.replace(JS_ENUM_INVALID_CHARS_RE, (c) => {\n const last = c[c.length - 1];\n return JS_PROPERTY_INDEX_INVALID_CHARS_RE.test(last) ? \"\" : last.toUpperCase();\n });\n if (Number(name[0]) >= 0) {\n sanitizedName = `Value${name}`;\n }\n return sanitizedName;\n}\n\n/** Sanitize TS enum member expression */\nexport function tsEnumMember(value: string | number, metadata: { name?: string; description?: string | null } = {}) {\n let name = metadata.name ?? String(value);\n if (!JS_PROPERTY_INDEX_RE.test(name)) {\n if (Number(name[0]) >= 0) {\n name = `Value${name}`.replace(\".\", \"_\"); // don't forged decimals;\n } else if (name[0] === \"-\") {\n name = `ValueMinus${name.slice(1)}`;\n }\n\n const invalidCharMatch = name.match(JS_PROPERTY_INDEX_INVALID_CHARS_RE);\n if (invalidCharMatch) {\n if (invalidCharMatch[0] === name) {\n name = `\"${name}\"`;\n } else {\n name = name.replace(JS_PROPERTY_INDEX_INVALID_CHARS_RE, (s) => {\n return s in SPECIAL_CHARACTER_MAP ? SPECIAL_CHARACTER_MAP[s] : \"_\";\n });\n }\n }\n }\n\n let member: ts.EnumMember;\n if (typeof value === \"number\") {\n const literal =\n value < 0\n ? ts.factory.createPrefixUnaryExpression(\n ts.SyntaxKind.MinusToken,\n ts.factory.createNumericLiteral(Math.abs(value)),\n )\n : ts.factory.createNumericLiteral(value);\n\n member = ts.factory.createEnumMember(name, literal);\n } else {\n member = ts.factory.createEnumMember(name, ts.factory.createStringLiteral(value));\n }\n\n const trimmedDescription = metadata.description?.trim();\n if (trimmedDescription === undefined || trimmedDescription === null || trimmedDescription === \"\") {\n return member;\n }\n\n return ts.addSyntheticLeadingComment(member, ts.SyntaxKind.SingleLineCommentTrivia, ` ${trimmedDescription}`, true);\n}\n\n/** Create an intersection type */\nexport function tsIntersection(types: ts.TypeNode[]): ts.TypeNode {\n if (types.length === 0) {\n return NEVER;\n }\n if (types.length === 1) {\n return types[0];\n }\n return ts.factory.createIntersectionTypeNode(tsDedupe(types));\n}\n\n/** Is this a primitive type (string, number, boolean, null, undefined)? */\nexport function tsIsPrimitive(type: ts.TypeNode): boolean {\n if (!type) {\n return true;\n }\n return (\n ts.SyntaxKind[type.kind] === \"BooleanKeyword\" ||\n ts.SyntaxKind[type.kind] === \"NeverKeyword\" ||\n ts.SyntaxKind[type.kind] === \"NullKeyword\" ||\n ts.SyntaxKind[type.kind] === \"NumberKeyword\" ||\n ts.SyntaxKind[type.kind] === \"StringKeyword\" ||\n ts.SyntaxKind[type.kind] === \"UndefinedKeyword\" ||\n (\"literal\" in type && tsIsPrimitive(type.literal as TypeLiteralNode))\n );\n}\n\n/** Create a literal type */\nexport function tsLiteral(value: unknown): ts.TypeNode {\n if (typeof value === \"string\") {\n // workaround for UTF-8: https://github.com/microsoft/TypeScript/issues/36174\n return ts.factory.createIdentifier(JSON.stringify(value)) as unknown as ts.TypeNode;\n }\n if (typeof value === \"number\") {\n const literal =\n value < 0\n ? ts.factory.createPrefixUnaryExpression(\n ts.SyntaxKind.MinusToken,\n ts.factory.createNumericLiteral(Math.abs(value)),\n )\n : ts.factory.createNumericLiteral(value);\n return ts.factory.createLiteralTypeNode(literal);\n }\n if (typeof value === \"boolean\") {\n return value === true ? TRUE : FALSE;\n }\n if (value === null) {\n return NULL;\n }\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return ts.factory.createArrayTypeNode(NEVER);\n }\n return ts.factory.createTupleTypeNode(value.map((v: unknown) => tsLiteral(v)));\n }\n if (typeof value === \"object\") {\n const keys: ts.TypeElement[] = [];\n for (const [k, v] of Object.entries(value)) {\n keys.push(\n ts.factory.createPropertySignature(\n /* modifiers */ undefined,\n /* name */ tsPropertyIndex(k),\n /* questionToken */ undefined,\n /* type */ tsLiteral(v),\n ),\n );\n }\n return keys.length ? ts.factory.createTypeLiteralNode(keys) : tsRecord(STRING, NEVER);\n }\n return UNKNOWN;\n}\n\n/** Modifiers (readonly) */\nexport function tsModifiers(modifiers: { readonly?: boolean; export?: boolean }): ts.Modifier[] {\n const typeMods: ts.Modifier[] = [];\n if (modifiers.export) {\n typeMods.push(ts.factory.createModifier(ts.SyntaxKind.ExportKeyword));\n }\n if (modifiers.readonly) {\n typeMods.push(ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword));\n }\n return typeMods;\n}\n\n/** Create a T | null union */\nexport function tsNullable(types: ts.TypeNode[]): ts.TypeNode {\n return ts.factory.createUnionTypeNode([...types, NULL]);\n}\n\n/** Create a TS Omit<X, Y> type */\nexport function tsOmit(type: ts.TypeNode, keys: string[]): ts.TypeNode {\n return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"Omit\"), [\n type,\n ts.factory.createUnionTypeNode(keys.map((k) => tsLiteral(k))),\n ]);\n}\n\n/** Create a TS Record<X, Y> type */\nexport function tsRecord(key: ts.TypeNode, value: ts.TypeNode) {\n return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"Record\"), [key, value]);\n}\n\n/** Create a valid property index */\nexport function tsPropertyIndex(index: string | number) {\n if (\n (typeof index === \"number\" && !(index < 0)) ||\n (typeof index === \"string\" && String(Number(index)) === index && index[0] !== \"-\")\n ) {\n return ts.factory.createNumericLiteral(index);\n }\n return typeof index === \"string\" && JS_PROPERTY_INDEX_RE.test(index)\n ? ts.factory.createIdentifier(index)\n : ts.factory.createStringLiteral(String(index));\n}\n\n/** Create a union type */\nexport function tsUnion(types: ts.TypeNode[]): ts.TypeNode {\n if (types.length === 0) {\n return NEVER;\n }\n if (types.length === 1) {\n return types[0];\n }\n return ts.factory.createUnionTypeNode(tsDedupe(types));\n}\n\n/** Create a WithRequired<X, Y> type */\nexport function tsWithRequired(\n type: ts.TypeNode,\n keys: string[],\n injectFooter: ts.Node[], // needed to inject type helper if used\n): ts.TypeNode {\n if (keys.length === 0) {\n return type;\n }\n\n // inject helper, if needed\n if (!injectFooter.some((node) => ts.isTypeAliasDeclaration(node) && node?.name?.escapedText === \"WithRequired\")) {\n const helper = stringToAST(\"type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };\")[0] as any;\n injectFooter.push(helper);\n }\n\n return ts.factory.createTypeReferenceNode(ts.factory.createIdentifier(\"WithRequired\"), [\n type,\n tsUnion(keys.map((k) => tsLiteral(k))),\n ]);\n}\n\n/**\n * Enhanced ReadonlyArray.\n * eg: type Foo = ReadonlyArray<T>; type Bar = ReadonlyArray<T[]>\n * Foo and Bar are both of type `readonly T[]`\n */\nexport function tsReadonlyArray(type: ts.TypeNode, injectFooter?: ts.Node[]): ts.TypeNode {\n if (\n injectFooter &&\n !injectFooter.some((node) => ts.isTypeAliasDeclaration(node) && node?.name?.escapedText === \"ReadonlyArray\")\n ) {\n const helper = stringToAST(\n \"type ReadonlyArray<T> = [Exclude<T, undefined>] extends [unknown[]] ? Readonly<Exclude<T, undefined>> : Readonly<Exclude<T, undefined>[]>;\",\n )[0] as any;\n injectFooter.push(helper);\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