UNPKG

@bjoerge/mutiny

Version:

Tiny toolkit for working with Sanity mutations in JavaScript & TypeScript

1 lines 33.6 kB
{"version":3,"file":"index.cjs","sources":["../src/encoders/compact/decode.ts","../src/encoders/compact/encode.ts","../src/encoders/sanity/encode.ts","../src/formatters/compact.ts","../src/mutations/operations/creators.ts","../src/mutations/autoKeys.ts","../src/mutations/creators.ts"],"sourcesContent":["import {\n type Mutation,\n type PatchMutation,\n type SanityDocumentBase,\n} from '../../mutations/types'\nimport {type Index, type KeyedPathElement} from '../../path'\nimport {parse as parsePath} from '../../path/parser/parse'\nimport {\n type CompactMutation,\n type CompactPatchMutation,\n type CreateIfNotExistsMutation,\n type CreateMutation,\n type CreateOrReplaceMutation,\n type DeleteMutation,\n type ItemRef,\n} from './types'\n\nexport {Mutation, SanityDocumentBase}\n\nexport function decode<Doc extends SanityDocumentBase>(\n mutations: CompactMutation<Doc>[],\n): Mutation[] {\n return mutations.map(decodeMutation)\n}\n\nexport function decodeMutation<Doc extends SanityDocumentBase>(\n mutation: CompactMutation<Doc>,\n): Mutation {\n const [type] = mutation\n if (type === 'delete') {\n const [, id] = mutation as DeleteMutation\n return {id, type}\n } else if (type === 'create') {\n const [, document] = mutation as CreateMutation<Doc>\n return {type, document}\n } else if (type === 'createIfNotExists') {\n const [, document] = mutation as CreateIfNotExistsMutation<Doc>\n return {type, document}\n } else if (type === 'createOrReplace') {\n const [, document] = mutation as CreateOrReplaceMutation<Doc>\n return {type, document}\n } else if (type === 'patch') {\n return decodePatchMutation(mutation)\n }\n throw new Error(`Unrecognized mutation: ${JSON.stringify(mutation)}`)\n}\n\nfunction decodePatchMutation(mutation: CompactPatchMutation): PatchMutation {\n const [, type, id, serializedPath, , revisionId] = mutation\n\n const path = parsePath(serializedPath)\n if (type === 'dec' || type === 'inc') {\n const [, , , , [amount]] = mutation\n return {\n type: 'patch',\n id,\n patches: [{path, op: {type: 'inc', amount}}],\n ...createOpts(revisionId),\n }\n }\n if (type === 'unset') {\n return {\n type: 'patch',\n id,\n patches: [{path, op: {type: 'unset'}}],\n ...createOpts(revisionId),\n }\n }\n if (type === 'insert') {\n const [, , , , [position, ref, items]] = mutation\n return {\n type: 'patch',\n id,\n patches: [\n {\n path,\n op: {\n type: 'insert',\n position,\n items,\n referenceItem: typeof ref === 'string' ? {_key: ref} : ref,\n },\n },\n ],\n ...createOpts(revisionId),\n }\n }\n if (type === 'set') {\n const [, , , , [value]] = mutation\n return {\n type: 'patch',\n id,\n patches: [{path, op: {type: 'set', value}}],\n ...createOpts(revisionId),\n }\n }\n if (type === 'setIfMissing') {\n const [, , , , [value]] = mutation\n return {\n type: 'patch',\n id,\n patches: [{path, op: {type: 'setIfMissing', value}}],\n ...createOpts(revisionId),\n }\n }\n if (type === 'diffMatchPatch') {\n const [, , , , [value]] = mutation\n return {\n type: 'patch',\n id,\n patches: [{path, op: {type: 'diffMatchPatch', value}}],\n ...createOpts(revisionId),\n }\n }\n if (type === 'truncate') {\n const [, , , , [startIndex, endIndex]] = mutation\n\n return {\n type: 'patch',\n id,\n patches: [{path, op: {type: 'truncate', startIndex, endIndex}}],\n ...createOpts(revisionId),\n }\n }\n if (type === 'assign') {\n const [, , , , [value]] = mutation\n return {\n type: 'patch',\n id,\n patches: [{path, op: {type: 'assign', value}}],\n ...createOpts(revisionId),\n }\n }\n if (type === 'replace') {\n const [, , , , [ref, items]] = mutation\n return {\n type: 'patch',\n id,\n patches: [\n {path, op: {type: 'replace', items, referenceItem: decodeItemRef(ref)}},\n ],\n ...createOpts(revisionId),\n }\n }\n if (type === 'upsert') {\n const [, , , , [position, referenceItem, items]] = mutation\n return {\n type: 'patch',\n id,\n patches: [\n {\n path,\n op: {\n type: 'upsert',\n items,\n referenceItem: decodeItemRef(referenceItem),\n position,\n },\n },\n ],\n ...createOpts(revisionId),\n }\n }\n throw new Error(`Invalid mutation type: ${type}`)\n}\n\nfunction decodeItemRef(ref: ItemRef): Index | KeyedPathElement {\n return typeof ref === 'string' ? {_key: ref} : ref\n}\n\nfunction createOpts(revisionId: undefined | string) {\n return revisionId ? {options: {ifRevision: revisionId}} : null\n}\n","// An example of a compact transport/serialization format\nimport {\n type Mutation,\n type NodePatch,\n type SanityDocumentBase,\n} from '../../mutations/types'\nimport {type Index, type KeyedPathElement} from '../../path'\nimport {stringify as stringifyPath} from '../../path/parser/stringify'\nimport {\n type CompactMutation,\n type CompactPatchMutation,\n type ItemRef,\n} from './types'\n\nexport function encode<Doc extends SanityDocumentBase>(\n mutations: Mutation[],\n): CompactMutation<Doc>[] {\n return mutations.flatMap(m => encodeMutation<Doc>(m))\n}\n\nfunction encodeItemRef(ref: Index | KeyedPathElement): ItemRef {\n return typeof ref === 'number' ? ref : ref._key\n}\n\nfunction encodeMutation<Doc extends SanityDocumentBase>(\n mutation: Mutation,\n): CompactMutation<Doc>[] {\n if (\n mutation.type === 'create' ||\n mutation.type === 'createIfNotExists' ||\n mutation.type === 'createOrReplace'\n ) {\n return [[mutation.type, mutation.document]]\n }\n if (mutation.type === 'delete') {\n return [['delete', mutation.id]]\n }\n if (mutation.type === 'patch') {\n return mutation.patches.map(patch =>\n maybeAddRevision(\n mutation.options?.ifRevision,\n encodePatchMutation(mutation.id, patch),\n ),\n )\n }\n\n //@ts-expect-error - all cases are covered\n throw new Error(`Invalid mutation type: ${mutation.type}`)\n}\n\nfunction encodePatchMutation(\n id: string,\n patch: NodePatch<any>,\n): CompactPatchMutation {\n const {op} = patch\n const path = stringifyPath(patch.path)\n if (op.type === 'unset') {\n return ['patch', 'unset', id, path, []]\n }\n if (op.type === 'diffMatchPatch') {\n return ['patch', 'diffMatchPatch', id, path, [op.value]]\n }\n if (op.type === 'inc' || op.type === 'dec') {\n return ['patch', op.type, id, path, [op.amount]]\n }\n if (op.type === 'set') {\n return ['patch', op.type, id, path, [op.value]]\n }\n if (op.type === 'setIfMissing') {\n return ['patch', op.type, id, path, [op.value]]\n }\n if (op.type === 'insert') {\n return [\n 'patch',\n 'insert',\n id,\n path,\n [op.position, encodeItemRef(op.referenceItem), op.items],\n ]\n }\n if (op.type === 'upsert') {\n return [\n 'patch',\n 'upsert',\n id,\n path,\n [op.position, encodeItemRef(op.referenceItem), op.items],\n ]\n }\n if (op.type === 'assign') {\n return ['patch', 'assign', id, path, [op.value]]\n }\n if (op.type === 'unassign') {\n return ['patch', 'assign', id, path, [op.keys]]\n }\n if (op.type === 'replace') {\n return [\n 'patch',\n 'replace',\n id,\n path,\n [encodeItemRef(op.referenceItem), op.items],\n ]\n }\n if (op.type === 'truncate') {\n return ['patch', 'truncate', id, path, [op.startIndex, op.endIndex]]\n }\n // @ts-expect-error all cases are covered\n throw new Error(`Invalid operation type: ${op.type}`)\n}\n\nfunction maybeAddRevision<T extends CompactPatchMutation>(\n revision: string | undefined,\n mut: T,\n): T {\n const [mutType, patchType, id, path, args] = mut\n return (revision ? [mutType, patchType, id, path, args, revision] : mut) as T\n}\n","import {\n type Mutation,\n type NodePatch,\n type Transaction,\n} from '../../mutations/types'\nimport {stringify as stringifyPath} from '../../path/parser/stringify'\n\nexport function encode(mutation: Mutation) {\n return encodeMutation(mutation)\n}\n\nexport function encodeAll(mutations: Mutation[]) {\n return mutations.flatMap(encode)\n}\n\nexport function encodeTransaction(transaction: Transaction) {\n return {\n transactionId: transaction.id,\n mutations: encodeAll(transaction.mutations),\n }\n}\n\nexport function encodeMutation(mutation: Mutation) {\n if (\n mutation.type === 'create' ||\n mutation.type === 'createIfNotExists' ||\n mutation.type === 'createOrReplace'\n ) {\n return {[mutation.type]: mutation.document}\n }\n if (mutation.type === 'delete') {\n return {\n delete: {id: mutation.id},\n }\n }\n const ifRevisionID = mutation.options?.ifRevision\n return mutation.patches.map(patch => {\n return {\n patch: {\n id: mutation.id,\n ...(ifRevisionID && {ifRevisionID}),\n ...patchToSanity(patch),\n },\n }\n })\n}\n\nfunction patchToSanity(patch: NodePatch) {\n const {path, op} = patch\n if (op.type === 'unset') {\n return {unset: [stringifyPath(path)]}\n }\n if (op.type === 'insert') {\n return {\n insert: {\n [op.position]: stringifyPath([...path, op.referenceItem]),\n items: op.items,\n },\n }\n }\n if (op.type === 'diffMatchPatch') {\n return {diffMatchPatch: {[stringifyPath(path)]: op.value}}\n }\n if (op.type === 'inc') {\n return {inc: {[stringifyPath(path)]: op.amount}}\n }\n if (op.type === 'dec') {\n return {dec: {[stringifyPath(path)]: op.amount}}\n }\n if (op.type === 'set' || op.type === 'setIfMissing') {\n return {[op.type]: {[stringifyPath(path)]: op.value}}\n }\n if (op.type === 'truncate') {\n const range = [\n op.startIndex,\n typeof op.endIndex === 'number' ? op.endIndex : '',\n ].join(':')\n\n return {unset: [`${stringifyPath(path)}[${range}]`]}\n }\n if (op.type === 'upsert') {\n // note: upsert currently not supported by sanity, so will always insert at reference position\n return {\n unset: op.items.map(item =>\n stringifyPath([...path, {_key: (item as any)._key}]),\n ),\n insert: {\n [op.position]: stringifyPath([...path, op.referenceItem]),\n items: op.items,\n },\n }\n }\n if (op.type === 'assign') {\n return {\n set: Object.fromEntries(\n Object.keys(op.value).map(key => [\n stringifyPath(path.concat(key)),\n op.value[key as keyof typeof op.value],\n ]),\n ),\n }\n }\n if (op.type === 'unassign') {\n return {\n unset: op.keys.map(key => stringifyPath(path.concat(key))),\n }\n }\n if (op.type === 'replace') {\n return {\n insert: {\n replace: stringifyPath(path.concat(op.referenceItem)),\n items: op.items,\n },\n }\n }\n //@ts-expect-error all cases should be covered\n throw new Error(`Unknown operation type ${op.type}`)\n}\n","// An example of a compact formatter\n\nimport {\n type Mutation,\n type NodePatch,\n type SanityDocumentBase,\n} from '../mutations/types'\nimport {type Index, type KeyedPathElement, stringify} from '../path'\n\nexport type ItemRef = string | number\n\nexport function format<Doc extends SanityDocumentBase>(\n mutations: Mutation[],\n): string {\n return mutations.flatMap(m => encodeMutation<Doc>(m)).join('\\n')\n}\n\nfunction encodeItemRef(ref: Index | KeyedPathElement): ItemRef {\n return typeof ref === 'number' ? ref : ref._key\n}\n\nfunction encodeMutation<Doc extends SanityDocumentBase>(\n mutation: Mutation,\n): string {\n if (\n mutation.type === 'create' ||\n mutation.type === 'createIfNotExists' ||\n mutation.type === 'createOrReplace'\n ) {\n return [mutation.type, ': ', JSON.stringify(mutation.document)].join('')\n }\n if (mutation.type === 'delete') {\n return ['delete ', mutation.id].join(': ')\n }\n if (mutation.type === 'patch') {\n const ifRevision = mutation.options?.ifRevision\n return [\n 'patch',\n ' ',\n `id=${mutation.id}`,\n ifRevision ? ` (if revision==${ifRevision})` : '',\n ':\\n',\n mutation.patches\n .map(nodePatch => ` ${formatPatchMutation(nodePatch)}`)\n .join('\\n'),\n ].join('')\n }\n\n //@ts-expect-error - all cases are covered\n throw new Error(`Invalid mutation type: ${mutation.type}`)\n}\n\nfunction formatPatchMutation(patch: NodePatch<any>): string {\n const {op} = patch\n const path = stringify(patch.path)\n if (op.type === 'unset') {\n return [path, 'unset()'].join(': ')\n }\n if (op.type === 'diffMatchPatch') {\n return [path, `diffMatchPatch(${op.value})`].join(': ')\n }\n if (op.type === 'inc' || op.type === 'dec') {\n return [path, `${op.type}(${op.amount})`].join(': ')\n }\n if (op.type === 'set' || op.type === 'setIfMissing') {\n return [path, `${op.type}(${JSON.stringify(op.value)})`].join(': ')\n }\n if (op.type === 'assign') {\n return [path, `${op.type}(${JSON.stringify(op.value)})`].join(': ')\n }\n if (op.type === 'unassign') {\n return [path, `${op.type}(${JSON.stringify(op.keys)})`].join(': ')\n }\n if (op.type === 'insert' || op.type === 'upsert') {\n return [\n path,\n `${op.type}(${op.position}, ${encodeItemRef(\n op.referenceItem,\n )}, ${JSON.stringify(op.items)})`,\n ].join(': ')\n }\n if (op.type === 'replace') {\n return [\n path,\n `replace(${encodeItemRef(op.referenceItem)}, ${JSON.stringify(\n op.items,\n )})`,\n ].join(': ')\n }\n if (op.type === 'truncate') {\n return [path, `truncate(${op.startIndex}, ${op.endIndex}`].join(': ')\n }\n // @ts-expect-error all cases are covered\n throw new Error(`Invalid operation type: ${op.type}`)\n}\n","import {arrify} from '../../utils/arrify'\nimport {\n type AnyArray,\n type ArrayElement,\n type NormalizeReadOnlyArray,\n} from '../../utils/typeUtils'\nimport {\n type AssignOp,\n type DecOp,\n type DiffMatchPatchOp,\n type IncOp,\n type Index,\n type InsertOp,\n type KeyedPathElement,\n type RelativePosition,\n type ReplaceOp,\n type SetIfMissingOp,\n type SetOp,\n type TruncateOp,\n type UnassignOp,\n type UnsetOp,\n type UpsertOp,\n} from './types'\n\nexport const set = <const T>(value: T): SetOp<T> => ({type: 'set', value})\n\nexport const assign = <const T extends {[K in string]: unknown}>(\n value: T,\n): AssignOp<T> => ({\n type: 'assign',\n value,\n})\n\nexport const unassign = <const K extends readonly string[]>(\n keys: K,\n): UnassignOp<K> => ({\n type: 'unassign',\n keys,\n})\n\nexport const setIfMissing = <const T>(value: T): SetIfMissingOp<T> => ({\n type: 'setIfMissing',\n value,\n})\n\nexport const unset = (): UnsetOp => ({type: 'unset'})\n\nexport const inc = <const N extends number = 1>(\n amount: N = 1 as N,\n): IncOp<N> => ({\n type: 'inc',\n amount,\n})\n\nexport const dec = <const N extends number = 1>(\n amount: N = 1 as N,\n): DecOp<N> => ({\n type: 'dec',\n amount,\n})\n\nexport const diffMatchPatch = (value: string): DiffMatchPatchOp => ({\n type: 'diffMatchPatch',\n value,\n})\n\nexport function insert<\n const Items extends AnyArray<unknown>,\n const Pos extends RelativePosition,\n const ReferenceItem extends Index | KeyedPathElement,\n>(\n items: Items | ArrayElement<Items>,\n position: Pos,\n indexOrReferenceItem: ReferenceItem,\n): InsertOp<NormalizeReadOnlyArray<Items>, Pos, ReferenceItem> {\n return {\n type: 'insert',\n referenceItem: indexOrReferenceItem,\n position,\n items: arrify(items) as any,\n }\n}\n\nexport function append<const Items extends AnyArray<unknown>>(\n items: Items | ArrayElement<Items>,\n) {\n return insert(items, 'after', -1)\n}\n\nexport function prepend<const Items extends AnyArray<unknown>>(\n items: Items | ArrayElement<Items>,\n) {\n return insert(items, 'before', 0)\n}\n\nexport function insertBefore<\n const Items extends AnyArray<unknown>,\n const ReferenceItem extends Index | KeyedPathElement,\n>(items: Items | ArrayElement<Items>, indexOrReferenceItem: ReferenceItem) {\n return insert(items, 'before', indexOrReferenceItem)\n}\n\nexport const insertAfter = <\n const Items extends AnyArray<unknown>,\n const ReferenceItem extends Index | KeyedPathElement,\n>(\n items: Items | ArrayElement<Items>,\n indexOrReferenceItem: ReferenceItem,\n) => {\n return insert(items, 'after', indexOrReferenceItem)\n}\n\nexport function truncate(startIndex: number, endIndex?: number): TruncateOp {\n return {\n type: 'truncate',\n startIndex,\n endIndex,\n }\n}\n\n/*\n Use this when you know the ref Items already exists\n */\nexport function replace<\n Items extends any[],\n ReferenceItem extends Index | KeyedPathElement,\n>(\n items: Items | ArrayElement<Items>,\n referenceItem: ReferenceItem,\n): ReplaceOp<Items, ReferenceItem> {\n return {\n type: 'replace',\n referenceItem,\n items: arrify(items) as Items,\n }\n}\n\n/*\nuse this when the reference Items may or may not exist\n */\nexport function upsert<\n const Items extends AnyArray<unknown>,\n const Pos extends RelativePosition,\n const ReferenceItem extends Index | KeyedPathElement,\n>(\n items: Items | ArrayElement<Items>,\n position: Pos,\n referenceItem: ReferenceItem,\n): UpsertOp<Items, Pos, ReferenceItem> {\n return {\n type: 'upsert',\n items: arrify(items) as Items,\n referenceItem,\n position,\n }\n}\n","import {type Index, type KeyedPathElement} from '../path'\nimport {isObject} from '../utils/isObject'\nimport {\n insert as _insert,\n replace as _replace,\n upsert as _upsert,\n} from './operations/creators'\nimport {type RelativePosition} from './operations/types'\n\nexport function autoKeys<Item>(generateKey: (item: Item) => string) {\n const ensureKeys = createEnsureKeys(generateKey)\n\n const insert = <\n Pos extends RelativePosition,\n Ref extends Index | KeyedPathElement,\n >(\n position: Pos,\n referenceItem: Ref,\n items: Item[],\n ) => _insert(ensureKeys(items), position, referenceItem)\n const upsert = <\n Pos extends RelativePosition,\n ReferenceItem extends Index | KeyedPathElement,\n >(\n items: Item[],\n position: Pos,\n referenceItem: ReferenceItem,\n ) => _upsert(ensureKeys(items), position, referenceItem)\n\n const replace = <\n Pos extends RelativePosition,\n ReferenceItem extends Index | KeyedPathElement,\n >(\n items: Item[],\n position: Pos,\n referenceItem: ReferenceItem,\n ) => _replace(ensureKeys(items), referenceItem)\n\n const insertBefore = <Ref extends Index | KeyedPathElement>(\n ref: Ref,\n items: Item[],\n ) => insert('before', ref, items)\n\n const prepend = (items: Item[]) => insertBefore(0, items)\n\n const insertAfter = <Ref extends Index | KeyedPathElement>(\n ref: Ref,\n items: Item[],\n ) => insert('after', ref, items)\n\n const append = (items: Item[]) => insert('after', -1, items)\n\n return {insert, upsert, replace, insertBefore, prepend, insertAfter, append}\n}\n\nfunction hasKey<T extends object>(item: T): item is T & {_key: string} {\n return '_key' in item\n}\n\nfunction createEnsureKeys<T>(generateKey: (item: T) => string) {\n return (array: T[]): T[] => {\n let didModify = false\n const withKeys = array.map(item => {\n if (needsKey(item)) {\n didModify = true\n return {...item, _key: generateKey(item)}\n }\n return item\n })\n return didModify ? withKeys : array\n }\n}\n\nfunction needsKey(arrayItem: any): arrayItem is object {\n return isObject(arrayItem) && !hasKey(arrayItem)\n}\n","import {parse, type Path, type SafePath} from '../path'\nimport {arrify} from '../utils/arrify'\nimport {\n type NormalizeReadOnlyArray,\n type Optional,\n type Tuplify,\n} from '../utils/typeUtils'\nimport {type Operation} from './operations/types'\nimport {\n type CreateIfNotExistsMutation,\n type CreateMutation,\n type CreateOrReplaceMutation,\n type DeleteMutation,\n type NodePatch,\n type NodePatchList,\n type PatchMutation,\n type PatchOptions,\n type SanityDocumentBase,\n} from './types'\n\nexport function create<Doc extends Optional<SanityDocumentBase, '_id'>>(\n document: Doc,\n): CreateMutation<Doc> {\n return {type: 'create', document}\n}\n\nexport function patch<P extends NodePatchList | NodePatch>(\n id: string,\n patches: P,\n options?: PatchOptions,\n): PatchMutation<NormalizeReadOnlyArray<Tuplify<P>>> {\n return {\n type: 'patch',\n id,\n patches: arrify(patches) as any,\n ...(options ? {options} : {}),\n }\n}\n\nexport function at<const P extends Path, O extends Operation>(\n path: P,\n operation: O,\n): NodePatch<NormalizeReadOnlyArray<P>, O>\n\nexport function at<const P extends string, O extends Operation>(\n path: P,\n operation: O,\n): NodePatch<SafePath<P>, O>\n\nexport function at<O extends Operation>(\n path: Path | string,\n operation: O,\n): NodePatch<Path, O> {\n return {\n path: typeof path === 'string' ? parse(path) : path,\n op: operation,\n }\n}\n\nexport function createIfNotExists<Doc extends SanityDocumentBase>(\n document: Doc,\n): CreateIfNotExistsMutation<Doc> {\n return {type: 'createIfNotExists', document}\n}\n\nexport function createOrReplace<Doc extends SanityDocumentBase>(\n document: Doc,\n): CreateOrReplaceMutation<Doc> {\n return {type: 'createOrReplace', document}\n}\n\nexport function delete_(id: string): DeleteMutation {\n return {type: 'delete', id}\n}\n\nexport const del = delete_\nexport const destroy = delete_\n"],"names":["parsePath","encode","encodeMutation","encodeItemRef","patch","stringifyPath","stringify","arrify","insert","_insert","upsert","_upsert","replace","_replace","insertBefore","isObject","parse"],"mappings":";;;AAmBO,SAAS,OACd,WACY;AACL,SAAA,UAAU,IAAI,cAAc;AACrC;AAEO,SAAS,eACd,UACU;AACJ,QAAA,CAAC,IAAI,IAAI;AACf,MAAI,SAAS,UAAU;AACf,UAAA,CAAG,EAAA,EAAE,IAAI;AACR,WAAA,EAAC,IAAI;EAAI,WACP,SAAS,UAAU;AACtB,UAAA,CAAG,EAAA,QAAQ,IAAI;AACd,WAAA,EAAC,MAAM;EAAQ,WACb,SAAS,qBAAqB;AACjC,UAAA,CAAG,EAAA,QAAQ,IAAI;AACd,WAAA,EAAC,MAAM;EAAQ,WACb,SAAS,mBAAmB;AAC/B,UAAA,CAAG,EAAA,QAAQ,IAAI;AACd,WAAA,EAAC,MAAM;EAAQ,WACb,SAAS;AAClB,WAAO,oBAAoB,QAAQ;AAErC,QAAM,IAAI,MAAM,0BAA0B,KAAK,UAAU,QAAQ,CAAC,EAAE;AACtE;AAEA,SAAS,oBAAoB,UAA+C;AACpE,QAAA,C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