{"version":3,"file":"mobxreactlite.umd.production.min.js","sources":["../src/utils/assertEnvironment.ts","../src/utils/observerBatching.ts","../src/utils/printDebugValue.ts","../src/staticRendering.ts","../src/utils/UniversalFinalizationRegistry.ts","../src/utils/observerFinalizationRegistry.ts","../src/useObserver.ts","../src/observer.ts","../src/ObserverComponent.ts","../src/useAsObservableSource.ts","../src/index.ts","../src/useLocalObservable.ts","../src/useLocalStore.ts"],"sourcesContent":["import { makeObservable } from \"mobx\"\nimport { useState } from \"react\"\n\nif (!useState) {\n    throw new Error(\"mobx-react-lite requires React with Hooks support\")\n}\nif (!makeObservable) {\n    throw new Error(\"mobx-react-lite@3 requires mobx at least version 6 to be available\")\n}\n","import { configure } from \"mobx\"\n\nexport function defaultNoopBatch(callback: () => void) {\n    callback()\n}\n\nexport function observerBatching(reactionScheduler: any) {\n    if (!reactionScheduler) {\n        reactionScheduler = defaultNoopBatch\n        if (\"production\" !== process.env.NODE_ENV) {\n            console.warn(\n                \"[MobX] Failed to get unstable_batched updates from react-dom / react-native\"\n            )\n        }\n    }\n    configure({ reactionScheduler })\n}\n\nexport const isObserverBatched = () => {\n    if (\"production\" !== process.env.NODE_ENV) {\n        console.warn(\"[MobX] Deprecated\")\n    }\n\n    return true\n}\n","import { getDependencyTree, Reaction } from \"mobx\"\n\nexport function printDebugValue(v: Reaction) {\n    return getDependencyTree(v)\n}\n","let globalIsUsingStaticRendering = false\n\nexport function enableStaticRendering(enable: boolean) {\n    globalIsUsingStaticRendering = enable\n}\n\nexport function isUsingStaticRendering(): boolean {\n    return globalIsUsingStaticRendering\n}\n","export declare class FinalizationRegistryType<T> {\n    constructor(finalize: (value: T) => void)\n    register(target: object, value: T, token?: object): void\n    unregister(token: object): void\n}\n\ndeclare const FinalizationRegistry: typeof FinalizationRegistryType | undefined\n\nexport const REGISTRY_FINALIZE_AFTER = 10_000\nexport const REGISTRY_SWEEP_INTERVAL = 10_000\n\nexport class TimerBasedFinalizationRegistry<T> implements FinalizationRegistryType<T> {\n    private registrations: Map<unknown, { value: T; registeredAt: number }> = new Map()\n    private sweepTimeout: ReturnType<typeof setTimeout> | undefined\n\n    constructor(private readonly finalize: (value: T) => void) {}\n\n    // Token is actually required with this impl\n    register(target: object, value: T, token?: object) {\n        this.registrations.set(token, {\n            value,\n            registeredAt: Date.now()\n        })\n        this.scheduleSweep()\n    }\n\n    unregister(token: unknown) {\n        this.registrations.delete(token)\n    }\n\n    // Bound so it can be used directly as setTimeout callback.\n    sweep = (maxAge = REGISTRY_FINALIZE_AFTER) => {\n        // cancel timeout so we can force sweep anytime\n        clearTimeout(this.sweepTimeout)\n        this.sweepTimeout = undefined\n\n        const now = Date.now()\n        this.registrations.forEach((registration, token) => {\n            if (now - registration.registeredAt >= maxAge) {\n                this.finalize(registration.value)\n                this.registrations.delete(token)\n            }\n        })\n\n        if (this.registrations.size > 0) {\n            this.scheduleSweep()\n        }\n    }\n\n    // Bound so it can be exported directly as clearTimers test utility.\n    finalizeAllImmediately = () => {\n        this.sweep(0)\n    }\n\n    private scheduleSweep() {\n        if (this.sweepTimeout === undefined) {\n            this.sweepTimeout = setTimeout(this.sweep, REGISTRY_SWEEP_INTERVAL)\n        }\n    }\n}\n\nexport const UniversalFinalizationRegistry =\n    typeof FinalizationRegistry !== \"undefined\"\n        ? FinalizationRegistry\n        : TimerBasedFinalizationRegistry\n","import { Reaction } from \"mobx\"\nimport { UniversalFinalizationRegistry } from \"./UniversalFinalizationRegistry\"\n\nexport const observerFinalizationRegistry = new UniversalFinalizationRegistry(\n    (adm: { reaction: Reaction | null }) => {\n        adm.reaction?.dispose()\n        adm.reaction = null\n    }\n)\n","import { Reaction } from \"mobx\"\nimport React from \"react\"\nimport { printDebugValue } from \"./utils/printDebugValue\"\nimport { isUsingStaticRendering } from \"./staticRendering\"\nimport { observerFinalizationRegistry } from \"./utils/observerFinalizationRegistry\"\nimport { useSyncExternalStore } from \"use-sync-external-store/shim\"\n\n// Do not store `admRef` (even as part of a closure!) on this object,\n// otherwise it will prevent GC and therefore reaction disposal via FinalizationRegistry.\ntype ObserverAdministration = {\n    reaction: Reaction | null // also serves as disposed flag\n    onStoreChange: Function | null // also serves as mounted flag\n    // stateVersion that 'ticks' for every time the reaction fires\n    // tearing is still present,\n    // because there is no cross component synchronization,\n    // but we can use `useSyncExternalStore` API.\n    // TODO: optimize to use number?\n    stateVersion: any\n    name: string\n    // These don't depend on state/props, therefore we can keep them here instead of `useCallback`\n    subscribe: Parameters<typeof React.useSyncExternalStore>[0]\n    getSnapshot: Parameters<typeof React.useSyncExternalStore>[1]\n}\n\nfunction createReaction(adm: ObserverAdministration) {\n    adm.reaction = new Reaction(`observer${adm.name}`, () => {\n        adm.stateVersion = Symbol()\n        // onStoreChange won't be available until the component \"mounts\".\n        // If state changes in between initial render and mount,\n        // `useSyncExternalStore` should handle that by checking the state version and issuing update.\n        adm.onStoreChange?.()\n    })\n}\n\nexport function useObserver<T>(render: () => T, baseComponentName: string = \"observed\"): T {\n    if (isUsingStaticRendering()) {\n        return render()\n    }\n\n    const admRef = React.useRef<ObserverAdministration | null>(null)\n\n    if (!admRef.current) {\n        // First render\n        const adm: ObserverAdministration = {\n            reaction: null,\n            onStoreChange: null,\n            stateVersion: Symbol(),\n            name: baseComponentName,\n            subscribe(onStoreChange: () => void) {\n                // Do NOT access admRef here!\n                observerFinalizationRegistry.unregister(adm)\n                adm.onStoreChange = onStoreChange\n                if (!adm.reaction) {\n                    // We've lost our reaction and therefore all subscriptions, occurs when:\n                    // 1. Timer based finalization registry disposed reaction before component mounted.\n                    // 2. React \"re-mounts\" same component without calling render in between (typically <StrictMode>).\n                    // We have to recreate reaction and schedule re-render to recreate subscriptions,\n                    // even if state did not change.\n                    createReaction(adm)\n                    // `onStoreChange` won't force update if subsequent `getSnapshot` returns same value.\n                    // So we make sure that is not the case\n                    adm.stateVersion = Symbol()\n                }\n\n                return () => {\n                    // Do NOT access admRef here!\n                    adm.onStoreChange = null\n                    adm.reaction?.dispose()\n                    adm.reaction = null\n                }\n            },\n            getSnapshot() {\n                // Do NOT access admRef here!\n                return adm.stateVersion\n            }\n        }\n\n        admRef.current = adm\n    }\n\n    const adm = admRef.current!\n\n    if (!adm.reaction) {\n        // First render or reaction was disposed by registry before subscribe\n        createReaction(adm)\n        // StrictMode/ConcurrentMode/Suspense may mean that our component is\n        // rendered and abandoned multiple times, so we need to track leaked\n        // Reactions.\n        observerFinalizationRegistry.register(admRef, adm, adm)\n    }\n\n    React.useDebugValue(adm.reaction!, printDebugValue)\n\n    useSyncExternalStore(\n        // Both of these must be stable, otherwise it would keep resubscribing every render.\n        adm.subscribe,\n        adm.getSnapshot,\n        adm.getSnapshot\n    )\n\n    // render the original component, but have the\n    // reaction track the observables, so that rendering\n    // can be invalidated (see above) once a dependency changes\n    let renderResult!: T\n    let exception\n    adm.reaction!.track(() => {\n        try {\n            renderResult = render()\n        } catch (e) {\n            exception = e\n        }\n    })\n\n    if (exception) {\n        throw exception // re-throw any exceptions caught during rendering\n    }\n\n    return renderResult\n}\n","import { forwardRef, memo } from \"react\"\n\nimport { isUsingStaticRendering } from \"./staticRendering\"\nimport { useObserver } from \"./useObserver\"\n\nlet warnObserverOptionsDeprecated = true\n\nconst hasSymbol = typeof Symbol === \"function\" && Symbol.for\nconst isFunctionNameConfigurable =\n    Object.getOwnPropertyDescriptor(() => {}, \"name\")?.configurable ?? false\n\n// Using react-is had some issues (and operates on elements, not on types), see #608 / #609\nconst ReactForwardRefSymbol = hasSymbol\n    ? Symbol.for(\"react.forward_ref\")\n    : typeof forwardRef === \"function\" && forwardRef((props: any) => null)[\"$$typeof\"]\n\nconst ReactMemoSymbol = hasSymbol\n    ? Symbol.for(\"react.memo\")\n    : typeof memo === \"function\" && memo((props: any) => null)[\"$$typeof\"]\n\nexport interface IObserverOptions {\n    readonly forwardRef?: boolean\n}\n\nexport function observer<P extends object, TRef = {}>(\n    baseComponent: React.ForwardRefRenderFunction<TRef, P>,\n    options: IObserverOptions & { forwardRef: true }\n): React.MemoExoticComponent<\n    React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<TRef>>\n>\n\nexport function observer<P extends object, TRef = {}>(\n    baseComponent: React.ForwardRefExoticComponent<\n        React.PropsWithoutRef<P> & React.RefAttributes<TRef>\n    >\n): React.MemoExoticComponent<\n    React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<TRef>>\n>\n\nexport function observer<P extends object>(\n    baseComponent: React.FunctionComponent<P>,\n    options?: IObserverOptions\n): React.FunctionComponent<P>\n\nexport function observer<\n    C extends React.FunctionComponent<any> | React.ForwardRefRenderFunction<any>,\n    Options extends IObserverOptions\n>(\n    baseComponent: C,\n    options?: Options\n): Options extends { forwardRef: true }\n    ? C extends React.ForwardRefRenderFunction<infer TRef, infer P>\n        ? C &\n              React.MemoExoticComponent<\n                  React.ForwardRefExoticComponent<\n                      React.PropsWithoutRef<P> & React.RefAttributes<TRef>\n                  >\n              >\n        : never /* forwardRef set for a non forwarding component */\n    : C & { displayName: string }\n\n// n.b. base case is not used for actual typings or exported in the typing files\nexport function observer<P extends object, TRef = {}>(\n    baseComponent:\n        | React.ForwardRefRenderFunction<TRef, P>\n        | React.FunctionComponent<P>\n        | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<TRef>>,\n    // TODO remove in next major\n    options?: IObserverOptions\n) {\n    if (process.env.NODE_ENV !== \"production\" && warnObserverOptionsDeprecated && options) {\n        warnObserverOptionsDeprecated = false\n        console.warn(\n            `[mobx-react-lite] \\`observer(fn, { forwardRef: true })\\` is deprecated, use \\`observer(React.forwardRef(fn))\\``\n        )\n    }\n\n    if (ReactMemoSymbol && baseComponent[\"$$typeof\"] === ReactMemoSymbol) {\n        throw new Error(\n            `[mobx-react-lite] You are trying to use \\`observer\\` on a function component wrapped in either another \\`observer\\` or \\`React.memo\\`. The observer already applies 'React.memo' for you.`\n        )\n    }\n\n    // The working of observer is explained step by step in this talk: https://www.youtube.com/watch?v=cPF4iBedoF0&feature=youtu.be&t=1307\n    if (isUsingStaticRendering()) {\n        return baseComponent\n    }\n\n    let useForwardRef = options?.forwardRef ?? false\n    let render = baseComponent\n\n    const baseComponentName = baseComponent.displayName || baseComponent.name\n\n    // If already wrapped with forwardRef, unwrap,\n    // so we can patch render and apply memo\n    if (ReactForwardRefSymbol && baseComponent[\"$$typeof\"] === ReactForwardRefSymbol) {\n        useForwardRef = true\n        render = baseComponent[\"render\"]\n        if (typeof render !== \"function\") {\n            throw new Error(\n                `[mobx-react-lite] \\`render\\` property of ForwardRef was not a function`\n            )\n        }\n    }\n\n    let observerComponent = (props: any, ref: React.Ref<TRef>) => {\n        return useObserver(() => render(props, ref), baseComponentName)\n    }\n\n    // Inherit original name and displayName, see #3438\n    ;(observerComponent as React.FunctionComponent).displayName = baseComponent.displayName\n\n    if (isFunctionNameConfigurable) {\n        Object.defineProperty(observerComponent, \"name\", {\n            value: baseComponent.name,\n            writable: true,\n            configurable: true\n        })\n    }\n\n    // Support legacy context: `contextTypes` must be applied before `memo`\n    if ((baseComponent as any).contextTypes) {\n        ;(observerComponent as React.FunctionComponent).contextTypes = (\n            baseComponent as any\n        ).contextTypes\n    }\n\n    if (useForwardRef) {\n        // `forwardRef` must be applied prior `memo`\n        // `forwardRef(observer(cmp))` throws:\n        // \"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))\"\n        observerComponent = forwardRef(observerComponent)\n    }\n\n    // memo; we are not interested in deep updates\n    // in props; we assume that if deep objects are changed,\n    // this is in observables, which would have been tracked anyway\n    observerComponent = memo(observerComponent)\n\n    copyStaticProperties(baseComponent, observerComponent)\n\n    if (\"production\" !== process.env.NODE_ENV) {\n        Object.defineProperty(observerComponent, \"contextTypes\", {\n            set() {\n                throw new Error(\n                    `[mobx-react-lite] \\`${\n                        this.displayName || this.type?.displayName || this.type?.name || \"Component\"\n                    }.contextTypes\\` must be set before applying \\`observer\\`.`\n                )\n            }\n        })\n    }\n\n    return observerComponent\n}\n\n// based on https://github.com/mridgway/hoist-non-react-statics/blob/master/src/index.js\nconst hoistBlackList: any = {\n    $$typeof: true,\n    render: true,\n    compare: true,\n    type: true,\n    // Don't redefine `displayName`,\n    // it's defined as getter-setter pair on `memo` (see #3192).\n    displayName: true\n}\n\nfunction copyStaticProperties(base: any, target: any) {\n    Object.keys(base).forEach(key => {\n        if (!hoistBlackList[key]) {\n            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(base, key)!)\n        }\n    })\n}\n","import { useObserver } from \"./useObserver\"\n\ninterface IObserverProps {\n    children?(): React.ReactElement | null\n    render?(): React.ReactElement | null\n}\n\nfunction ObserverComponent({ children, render }: IObserverProps) {\n    const component = children || render\n    if (typeof component !== \"function\") {\n        return null\n    }\n    return useObserver(component)\n}\nif (\"production\" !== process.env.NODE_ENV) {\n    ObserverComponent.propTypes = {\n        children: ObserverPropsCheck,\n        render: ObserverPropsCheck\n    }\n}\nObserverComponent.displayName = \"Observer\"\n\nexport { ObserverComponent as Observer }\n\nfunction ObserverPropsCheck(\n    props: { [k: string]: any },\n    key: string,\n    componentName: string,\n    location: any,\n    propFullName: string\n) {\n    const extraKey = key === \"children\" ? \"render\" : \"children\"\n    const hasProp = typeof props[key] === \"function\"\n    const hasExtraProp = typeof props[extraKey] === \"function\"\n    if (hasProp && hasExtraProp) {\n        return new Error(\n            \"MobX Observer: Do not use children and render in the same time in`\" + componentName\n        )\n    }\n\n    if (hasProp || hasExtraProp) {\n        return null\n    }\n    return new Error(\n        \"Invalid prop `\" +\n            propFullName +\n            \"` of type `\" +\n            typeof props[key] +\n            \"` supplied to\" +\n            \" `\" +\n            componentName +\n            \"`, expected `function`.\"\n    )\n}\n","import { useDeprecated } from \"./utils/utils\"\nimport { observable, runInAction } from \"mobx\"\nimport { useState } from \"react\"\n\nexport function useAsObservableSource<TSource extends object>(current: TSource): TSource {\n    if (\"production\" !== process.env.NODE_ENV)\n        useDeprecated(\n            \"[mobx-react-lite] 'useAsObservableSource' is deprecated, please store the values directly in an observable, for example by using 'useLocalObservable', and sync future updates using 'useEffect' when needed. See the README for examples.\"\n        )\n    // We're deliberately not using idiomatic destructuring for the hook here.\n    // Accessing the state value as an array element prevents TypeScript from generating unnecessary helpers in the resulting code.\n    // For further details, please refer to mobxjs/mobx#3842.\n    const res = useState(() => observable(current, {}, { deep: false }))[0]\n    runInAction(() => {\n        Object.assign(res, current)\n    })\n    return res\n}\n","import \"./utils/assertEnvironment\"\n\nimport { unstable_batchedUpdates as batch } from \"./utils/reactBatchedUpdates\"\nimport { observerBatching } from \"./utils/observerBatching\"\nimport { useDeprecated } from \"./utils/utils\"\nimport { useObserver as useObserverOriginal } from \"./useObserver\"\nimport { enableStaticRendering } from \"./staticRendering\"\nimport { observerFinalizationRegistry } from \"./utils/observerFinalizationRegistry\"\n\nobserverBatching(batch)\n\nexport { isUsingStaticRendering, enableStaticRendering } from \"./staticRendering\"\nexport { observer, IObserverOptions } from \"./observer\"\nexport { Observer } from \"./ObserverComponent\"\nexport { useLocalObservable } from \"./useLocalObservable\"\nexport { useLocalStore } from \"./useLocalStore\"\nexport { useAsObservableSource } from \"./useAsObservableSource\"\n\nexport { observerFinalizationRegistry as _observerFinalizationRegistry }\nexport const clearTimers = observerFinalizationRegistry[\"finalizeAllImmediately\"] ?? (() => {})\n\nexport function useObserver<T>(fn: () => T, baseComponentName: string = \"observed\"): T {\n    if (\"production\" !== process.env.NODE_ENV) {\n        useDeprecated(\n            \"[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `<Observer>{fn}</Observer>` instead, or wrap the entire component in `observer`.\"\n        )\n    }\n    return useObserverOriginal(fn, baseComponentName)\n}\n\nexport { isObserverBatched, observerBatching } from \"./utils/observerBatching\"\n\nexport function useStaticRendering(enable: boolean) {\n    if (\"production\" !== process.env.NODE_ENV) {\n        console.warn(\n            \"[mobx-react-lite] 'useStaticRendering' is deprecated, use 'enableStaticRendering' instead\"\n        )\n    }\n    enableStaticRendering(enable)\n}\n","import { observable, AnnotationsMap } from \"mobx\"\nimport { useState } from \"react\"\n\nexport function useLocalObservable<TStore extends Record<string, any>>(\n    initializer: () => TStore,\n    annotations?: AnnotationsMap<TStore, never>\n): TStore {\n    return useState(() => observable(initializer(), annotations, { autoBind: true }))[0]\n}\n","import { observable } from \"mobx\"\nimport { useState } from \"react\"\n\nimport { useDeprecated } from \"./utils/utils\"\nimport { useAsObservableSource } from \"./useAsObservableSource\"\n\nexport function useLocalStore<TStore extends Record<string, any>>(initializer: () => TStore): TStore\nexport function useLocalStore<TStore extends Record<string, any>, TSource extends object>(\n    initializer: (source: TSource) => TStore,\n    current: TSource\n): TStore\nexport function useLocalStore<TStore extends Record<string, any>, TSource extends object>(\n    initializer: (source?: TSource) => TStore,\n    current?: TSource\n): TStore {\n    if (\"production\" !== process.env.NODE_ENV) {\n        useDeprecated(\n            \"[mobx-react-lite] 'useLocalStore' is deprecated, use 'useLocalObservable' instead.\"\n        )\n    }\n    const source = current && useAsObservableSource(current)\n    return useState(() => observable(initializer(source), undefined, { autoBind: true }))[0]\n}\n"],"names":["useState","Error","makeObservable","defaultNoopBatch","callback","observerBatching","reactionScheduler","configure","printDebugValue","v","getDependencyTree","globalIsUsingStaticRendering","enableStaticRendering","enable","isUsingStaticRendering","observerFinalizationRegistry","FinalizationRegistry","TimerBasedFinalizationRegistry","finalize","registrations","Map","this","sweepTimeout","sweep","maxAge","clearTimeout","_this","undefined","now","Date","forEach","registration","token","registeredAt","value","size","scheduleSweep","finalizeAllImmediately","_proto","prototype","register","target","set","unregister","setTimeout","adm","_adm$reaction","reaction","dispose","createReaction","Reaction","name","stateVersion","Symbol","onStoreChange","useObserver","render","baseComponentName","admRef","React","useRef","current","subscribe","getSnapshot","renderResult","exception","useDebugValue","useSyncExternalStore","track","e","hasSymbol","isFunctionNameConfigurable","_Object$getOwnPropert","_Object$getOwnPropert2","Object","getOwnPropertyDescriptor","configurable","ReactForwardRefSymbol","forwardRef","props","ReactMemoSymbol","memo","hoistBlackList","$$typeof","compare","type","displayName","ObserverComponent","_ref","component","children","useAsObservableSource","res","observable","deep","runInAction","assign","batch","clearTimers","_observerFinalization","baseComponent","options","useForwardRef","_options$forwardRef","base","observerComponent","ref","defineProperty","writable","contextTypes","keys","key","initializer","annotations","autoBind","source","fn","useObserverOriginal"],"mappings":"4aAGA,IAAKA,WACD,MAAM,IAAIC,MAAM,qDAEpB,IAAKC,iBACD,MAAM,IAAID,MAAM,+ECLJE,EAAiBC,GAC7BA,aAGYC,EAAiBC,GACxBA,IACDA,EAAoBH,GAOxBI,YAAU,CAAED,kBAAAA,aCbAE,EAAgBC,GAC5B,OAAOC,oBAAkBD,GCH7B,IAAIE,GAA+B,WAEnBC,EAAsBC,GAClCF,EAA+BE,WAGnBC,IACZ,OAAOH,ECCJ,QCLMI,EAA+B,ID2DR,oBAAzBC,qBACDA,gCAhDN,SAAAC,EAA6BC,mBAAAA,qBAHrBC,cAAkE,IAAIC,IAAKC,KAC3EC,oBAAYD,KAkBpBE,MAAQ,SAACC,YAAAA,IAAAA,EAvB0B,KAyB/BC,aAAaC,EAAKJ,cAClBI,EAAKJ,kBAAeK,EAEpB,IAAMC,EAAMC,KAAKD,MACjBF,EAAKP,cAAcW,SAAQ,SAACC,EAAcC,GAClCJ,EAAMG,EAAaE,cAAgBT,IACnCE,EAAKR,SAASa,EAAaG,OAC3BR,EAAKP,qBAAqBa,OAI9BN,EAAKP,cAAcgB,KAAO,GAC1BT,EAAKU,iBAEZf,KAGDgB,uBAAyB,WACrBX,EAAKH,MAAM,IApCcF,cAAAH,EAE7B,IAAAoB,EAAArB,EAAAsB,UAyCC,OAzCDD,EACAE,SAAA,SAASC,EAAgBP,EAAUF,GAC/BX,KAAKF,cAAcuB,IAAIV,EAAO,CAC1BE,MAAAA,EACAD,aAAcJ,KAAKD,QAEvBP,KAAKe,iBACRE,EAEDK,WAAA,SAAWX,GACPX,KAAKF,qBAAqBa,IAG9BM,EAwBQF,cAAA,gBACsBT,IAAtBN,KAAKC,eACLD,KAAKC,aAAesB,WAAWvB,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