{"version":3,"names":["createEffect","createSignal","onCleanup","untrack","IsDrawerContext","useDialogRootContext","DialogRoot","useBaseUiId","createChangeEventDetails","REASONS","createControlledState","readOption","createDrawer","useDrawerProviderContext","DrawerRootContext","useDrawerRootContext","createNestedSwipeProgressStore","progress","listeners","Set","getSnapshot","set","nextProgress","resolved","Number","isFinite","l","subscribe","listener","add","delete","DrawerRoot","props","parentDrawer","notifyParentSwipeProgressChange","onNestedSwipeProgressChange","notifyParentFrontmostHeight","onNestedFrontmostHeightChange","notifyParentSwipingChange","onNestedSwipingChange","notifyParentHasNestedDrawer","onNestedDrawerPresenceChange","resolvedOpen","setUncontrolledOpen","controlled","open","undefined","Boolean","default","defaultOpen","fallback","name","state","drawerPrimitive","modal","swipeDirection","snapToSequentialPoints","snapPoints","activeSnapPointAccessor","snapPoint","popupHeight","setPopupHeight","ownedWrite","frontmostHeight","setFrontmostHeight","hasNestedDrawer","setHasNestedDrawer","nestedSwiping","setNestedSwiping","nestedSwipeProgressStore","isNestedDrawerOpenRef","setActiveSnapPoint","nextSnapPoint","details","eventDetails","none","onSnapPointChange","resolvedActiveSnapPoint","onPopupHeightChange","height","present","swiping","handleOpenChange","nextOpen","onOpenChange","isCanceled","pts","length","reason","event","trigger","contextValue","activeSnapPoint","setOpen","onOpenChangeComplete","disablePointerDismissal","actionsRef","handle","triggerId","children","ctx","DrawerProviderReporter","generatedId","drawerId","providerContext","dialogRootContext","nestedOpenDialogCount","popupElement","isTopmost","id","removeDrawer","o","setDrawerOpen","topmost","popup","ua","navigator","userAgent","isAndroid","test","win","ownerDocument","defaultView","globalThis","window","CloseWatcherCtor","CloseWatcher","handleCloseWatcher","closeWatcher","addEventListener","removeEventListener","destroy"],"sources":["drawer-root.tsx"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n/**\n * `<Drawer.Root>` — Solid 2 port of Base UI React's `DrawerRoot`\n * (`packages/react/src/drawer/root/DrawerRoot.tsx`).\n *\n * Composes over `<Dialog.Root>` + `IsDrawerContext(true)` to reuse\n * dialog's open/close/focus-trap/scroll-lock machinery. Adds drawer-\n * specific state:\n *\n *  - `swipeDirection` — dismissal direction (defaults `'down'`).\n *  - `snapPoints` / `snapPoint` / `defaultSnapPoint` — snap-point control.\n *  - Nested-drawer bookkeeping (`popupHeight`, `frontmostHeight`,\n *    `hasNestedDrawer`, `nestedSwiping`, `nestedSwipeProgressStore`).\n *  - `DrawerProvider` reporter — auto-registers the drawer's id with the\n *    enclosing `<Drawer.Provider>` and wires an Android `CloseWatcher` (if\n *    available) for back-gesture support.\n *\n * Papercuts avoided:\n *\n *  - P4: the `<DrawerRootContext>` wraps children via `<Dialog.Root>`'s\n *    children, which already evaluates under the dialog's provider at\n *    the right time.\n *  - P11: `DialogRoot` accepts `children` by value; we thread the drawer\n *    provider + reporter through its children JSX (no `omit` needed here\n *    because we never enter the `renderElement` path).\n */\n\nimport { createEffect, createSignal, onCleanup, untrack } from \"solid-js\";\nimport {\n\tIsDrawerContext,\n\tuseDialogRootContext,\n} from \"../../dialog/dialog-root-context\";\nimport {\n\tDialogRoot,\n\ttype DialogRootActions,\n} from \"../../dialog/root/dialog-root\";\nimport type { DialogHandle } from \"../../dialog/store/dialog-store\";\nimport { useBaseUiId } from \"../../internals/base-ui-id\";\nimport {\n\ttype BaseUIChangeEventDetails,\n\tcreateChangeEventDetails,\n\tREASONS,\n} from \"../../internals/change-event-details\";\nimport { createControlledState } from \"../../internals/create-controlled-state\";\nimport { type MaybeAccessor, readOption } from \"../../internals/maybe-accessor\";\nimport { createDrawer } from \"../create-drawer\";\nimport { useDrawerProviderContext } from \"../provider/drawer-provider-context\";\nimport {\n\ttype DrawerNestedSwipeProgressStore,\n\ttype DrawerRootChangeEventReason,\n\tDrawerRootContext,\n\ttype DrawerRootContextValue,\n\ttype DrawerRootSnapPointChangeEventDetails,\n\ttype DrawerRootSnapPointChangeEventReason,\n\ttype DrawerSnapPoint,\n\ttype DrawerSwipeDirection,\n\tuseDrawerRootContext,\n} from \"./drawer-root-context\";\n\nexport type {\n\tDrawerRootChangeEventReason,\n\tDrawerRootSnapPointChangeEventDetails,\n\tDrawerRootSnapPointChangeEventReason,\n};\n\nexport type DrawerRootChangeEventDetails = BaseUIChangeEventDetails<\n\tDrawerRootChangeEventReason,\n\t{ preventUnmountOnClose: () => void }\n>;\nexport type DrawerPayloadChildRenderFunction<Payload> = (ctx: {\n\tpayload: Payload | undefined;\n}) => JSX.Element;\n\nexport interface DrawerRootActions extends DialogRootActions {}\n\nexport interface DrawerRootProps<Payload = unknown> {\n\t/**\n\t * Controlled open state. When provided (resolved value not\n\t * `undefined`), the consumer owns the state — pair with\n\t * {@link onOpenChange}. When omitted, the drawer manages its own open\n\t * state (seeded from {@link defaultOpen}).\n\t */\n\topen?: MaybeAccessor<boolean | undefined>;\n\t/**\n\t * Initial open state when uncontrolled. Read once at mount.\n\t * @default false\n\t */\n\tdefaultOpen?: MaybeAccessor<boolean | undefined>;\n\tmodal?: MaybeAccessor<boolean | \"trap-focus\" | undefined>;\n\tonOpenChange?:\n\t\t| ((open: boolean, details: DrawerRootChangeEventDetails) => void)\n\t\t| undefined;\n\tonOpenChangeComplete?: ((open: boolean) => void) | undefined;\n\tdisablePointerDismissal?: boolean | undefined;\n\tactionsRef?:\n\t\t| ((actions: DrawerRootActions | null) => void)\n\t\t| { current: DrawerRootActions | null }\n\t\t| undefined;\n\thandle?: DialogHandle<Payload> | undefined;\n\ttriggerId?: string | null | undefined;\n\tchildren?: JSX.Element | DrawerPayloadChildRenderFunction<Payload>;\n\t/** Swipe dismissal direction. @default \"down\" */\n\tswipeDirection?: DrawerSwipeDirection | undefined;\n\t/** Snap points list (fractions / px / CSS length strings). */\n\tsnapPoints?: DrawerSnapPoint[] | undefined;\n\t/** Disable velocity-based snap skipping. @default false */\n\tsnapToSequentialPoints?: boolean | undefined;\n\t/** Active snap point. Consumer-owned — pair with {@link onSnapPointChange}. */\n\tsnapPoint?: DrawerSnapPoint | null | undefined;\n\t/** Fires on every snap-point change request. */\n\tonSnapPointChange?:\n\t\t| ((\n\t\t\t\tsnapPoint: DrawerSnapPoint | null,\n\t\t\t\tdetails: DrawerRootSnapPointChangeEventDetails,\n\t\t  ) => void)\n\t\t| undefined;\n}\n\n// biome-ignore lint/complexity/noBannedTypes: state is empty — matches React.\nexport type DrawerRootState = {};\n\ninterface NestedSwipeProgressStoreImpl extends DrawerNestedSwipeProgressStore {\n\tset: (progress: number) => void;\n}\n\nfunction createNestedSwipeProgressStore(): NestedSwipeProgressStoreImpl {\n\tlet progress = 0;\n\tconst listeners = new Set<() => void>();\n\treturn {\n\t\tgetSnapshot: () => progress,\n\t\tset(nextProgress) {\n\t\t\tconst resolved = Number.isFinite(nextProgress) ? nextProgress : 0;\n\t\t\tif (resolved === progress) return;\n\t\t\tprogress = resolved;\n\t\t\tfor (const l of listeners) l();\n\t\t},\n\t\tsubscribe(listener) {\n\t\t\tlisteners.add(listener);\n\t\t\treturn () => {\n\t\t\t\tlisteners.delete(listener);\n\t\t\t};\n\t\t},\n\t};\n}\n\n/**\n * Groups all parts of the drawer. Doesn't render its own HTML element.\n */\nexport function DrawerRoot<Payload = unknown>(\n\tprops: DrawerRootProps<Payload>,\n): JSX.Element {\n\tconst parentDrawer = useDrawerRootContext(true);\n\n\tconst notifyParentSwipeProgressChange =\n\t\tparentDrawer?.onNestedSwipeProgressChange;\n\tconst notifyParentFrontmostHeight =\n\t\tparentDrawer?.onNestedFrontmostHeightChange;\n\tconst notifyParentSwipingChange = parentDrawer?.onNestedSwipingChange;\n\tconst notifyParentHasNestedDrawer =\n\t\tparentDrawer?.onNestedDrawerPresenceChange;\n\n\t// Controlled / uncontrolled open state (Base UI `open` / `defaultOpen`\n\t// contract): the `open` prop wins while its resolved value is defined;\n\t// otherwise an internal signal (seeded once from `defaultOpen`) backs\n\t// the state and `handleOpenChange` (below) writes it. In React Base UI\n\t// this resolution lives in `Dialog.Root` (Drawer passes `open` /\n\t// `defaultOpen` straight through); here the drawer owns it so its\n\t// headless primitive sees the resolved open and the inner `<DialogRoot>`\n\t// stays controlled by it.\n\tconst [resolvedOpen, setUncontrolledOpen] = createControlledState<boolean>({\n\t\tcontrolled: () => {\n\t\t\tconst controlled = readOption(props.open);\n\t\t\treturn controlled === undefined ? undefined : Boolean(controlled);\n\t\t},\n\t\tdefault: () => readOption(props.defaultOpen),\n\t\tfallback: false,\n\t\tname: \"<Drawer.Root>\",\n\t\tstate: \"open\",\n\t});\n\n\t// Compose the headless Drawer primitive — owns logical popup state (open,\n\t// disabled, modal). DOM machinery (DialogRoot's floating tree, swipe\n\t// gesture, snap-points, transitions, portal, dismiss) stays in this\n\t// wrapper. `onOpenChange` is NOT wired here — `handleOpenChange` (below)\n\t// owns the open-change pipeline so it can run snap-point reset bookkeeping.\n\tconst drawerPrimitive = createDrawer({\n\t\topen: resolvedOpen,\n\t\tmodal: () => readOption(props.modal) ?? true,\n\t});\n\n\tconst swipeDirection = (): DrawerSwipeDirection =>\n\t\tprops.swipeDirection ?? \"down\";\n\tconst snapToSequentialPoints = (): boolean =>\n\t\tprops.snapToSequentialPoints ?? false;\n\tconst snapPoints = (): DrawerSnapPoint[] | undefined => props.snapPoints;\n\n\t// Consumer-owned snap-point accessor. Falls back to first snap point when\n\t// the consumer has not passed a value. No internal signal.\n\tconst activeSnapPointAccessor = (): DrawerSnapPoint | null => {\n\t\tif (props.snapPoint !== undefined) return props.snapPoint ?? null;\n\t\treturn props.snapPoints?.[0] ?? null;\n\t};\n\n\tconst [popupHeight, setPopupHeight] = createSignal(0, { ownedWrite: true });\n\tconst [frontmostHeight, setFrontmostHeight] = createSignal(0, {\n\t\townedWrite: true,\n\t});\n\tconst [hasNestedDrawer, setHasNestedDrawer] = createSignal(false, {\n\t\townedWrite: true,\n\t});\n\tconst [nestedSwiping, setNestedSwiping] = createSignal(false, {\n\t\townedWrite: true,\n\t});\n\n\tconst nestedSwipeProgressStore = createNestedSwipeProgressStore();\n\n\t// Track whether a nested drawer is currently open (for frontmost-height\n\t// bookkeeping) — a plain `let` matches React's `useRef(false)`.\n\tlet isNestedDrawerOpenRef = false;\n\n\tconst setActiveSnapPoint = (\n\t\tnextSnapPoint: DrawerSnapPoint | null,\n\t\tdetails?: DrawerRootSnapPointChangeEventDetails,\n\t): void => {\n\t\tconst eventDetails = details ?? createChangeEventDetails(REASONS.none);\n\t\tprops.onSnapPointChange?.(nextSnapPoint, eventDetails);\n\t\t// Consumer's onSnapPointChange handler is the only writer — no internal\n\t\t// write. `eventDetails.isCanceled` check preserved for the cancel path.\n\t};\n\n\t// Read through the consumer's accessor — no internal copy.\n\tconst resolvedActiveSnapPoint = (): DrawerSnapPoint | null | undefined =>\n\t\tactiveSnapPointAccessor();\n\n\tconst onPopupHeightChange = (height: number): void => {\n\t\tsetPopupHeight(height);\n\t\tif (!isNestedDrawerOpenRef && height > 0) setFrontmostHeight(height);\n\t};\n\n\t// Invoked from a child drawer's effect-apply (`drawer-popup` notifies on\n\t// frontmost-height change). The `popupHeight()` read is a snapshot —\n\t// wrap in `untrack` so it doesn't trip `[STRICT_READ_UNTRACKED]`.\n\tconst onNestedFrontmostHeightChange = (height: number): void =>\n\t\tuntrack(() => {\n\t\t\tif (height > 0) {\n\t\t\t\tisNestedDrawerOpenRef = true;\n\t\t\t\tsetFrontmostHeight(height);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tisNestedDrawerOpenRef = false;\n\t\t\tif (popupHeight() > 0) setFrontmostHeight(popupHeight());\n\t\t});\n\n\tconst onNestedDrawerPresenceChange = (present: boolean): void => {\n\t\tsetHasNestedDrawer(present);\n\t};\n\n\tconst onNestedSwipeProgressChange = (progress: number): void => {\n\t\tnestedSwipeProgressStore.set(progress);\n\t\tnotifyParentSwipeProgressChange?.(progress);\n\t};\n\n\tconst onNestedSwipingChange = (swiping: boolean): void => {\n\t\tsetNestedSwiping(swiping);\n\t\tnotifyParentSwipingChange?.(swiping);\n\t};\n\n\t// Every open writer (trigger press, Escape, outside press, close button,\n\t// swipe dismissal, CloseWatcher, imperative handle) routes through the\n\t// inner dialog's `setOpen` → `setOpenInternal` → this callback (wired as\n\t// `<DialogRoot onOpenChange>`). Mirrors Base UI's drawer pipeline: fire\n\t// the consumer's `onOpenChange`, honor `details.cancel()`, run the\n\t// snap-point reset, then write the uncontrolled open state — a no-op\n\t// for reads while the `open` prop is controlled.\n\tconst handleOpenChange = (\n\t\tnextOpen: boolean,\n\t\tdetails: DrawerRootChangeEventDetails,\n\t): void => {\n\t\tprops.onOpenChange?.(nextOpen, details);\n\t\tif (details.isCanceled) return;\n\t\tconst pts = snapPoints();\n\t\tif (!nextOpen && pts && pts.length > 0) {\n\t\t\t// On close, reset to first snap point by notifying the consumer.\n\t\t\tsetActiveSnapPoint(\n\t\t\t\tpts[0] ?? null,\n\t\t\t\tcreateChangeEventDetails(\n\t\t\t\t\tdetails.reason,\n\t\t\t\t\tdetails.event,\n\t\t\t\t\tdetails.trigger as HTMLElement | undefined,\n\t\t\t\t) as DrawerRootSnapPointChangeEventDetails,\n\t\t\t);\n\t\t}\n\t\tsetUncontrolledOpen(nextOpen);\n\t};\n\n\tconst contextValue: DrawerRootContextValue = {\n\t\tswipeDirection,\n\t\tsnapToSequentialPoints,\n\t\tsnapPoints,\n\t\tactiveSnapPoint: resolvedActiveSnapPoint,\n\t\tsetOpen: handleOpenChange,\n\t\tsetActiveSnapPoint,\n\t\tfrontmostHeight,\n\t\tpopupHeight,\n\t\thasNestedDrawer,\n\t\tnestedSwiping,\n\t\tnestedSwipeProgressStore,\n\t\tonPopupHeightChange,\n\t\tonNestedFrontmostHeightChange,\n\t\tonNestedDrawerPresenceChange,\n\t\tonNestedSwipingChange,\n\t\tonNestedSwipeProgressChange,\n\t\tnotifyParentFrontmostHeight,\n\t\tnotifyParentSwipingChange,\n\t\tnotifyParentSwipeProgressChange,\n\t\tnotifyParentHasNestedDrawer,\n\t};\n\n\treturn (\n\t\t<DrawerRootContext value={contextValue}>\n\t\t\t<IsDrawerContext value={true}>\n\t\t\t\t<DialogRoot<Payload>\n\t\t\t\t\topen={drawerPrimitive.open()}\n\t\t\t\t\tonOpenChange={\n\t\t\t\t\t\thandleOpenChange as (\n\t\t\t\t\t\t\topen: boolean,\n\t\t\t\t\t\t\tdetails: Parameters<\n\t\t\t\t\t\t\t\tNonNullable<\n\t\t\t\t\t\t\t\t\tParameters<typeof DialogRoot<Payload>>[0][\"onOpenChange\"]\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t>[1],\n\t\t\t\t\t\t) => void\n\t\t\t\t\t}\n\t\t\t\t\tonOpenChangeComplete={props.onOpenChangeComplete}\n\t\t\t\t\tdisablePointerDismissal={props.disablePointerDismissal}\n\t\t\t\t\tmodal={drawerPrimitive.modal()}\n\t\t\t\t\tactionsRef={props.actionsRef}\n\t\t\t\t\thandle={props.handle}\n\t\t\t\t\ttriggerId={props.triggerId}\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the consumer passed a payload render-function, wrap it so\n\t\t\t\t\t\t// we can inject the provider reporter alongside the resolved\n\t\t\t\t\t\t// JSX. Otherwise render children + reporter directly.\n\t\t\t\t\t\ttypeof props.children === \"function\" ? (\n\t\t\t\t\t\t\t(((ctx: { payload: Payload | undefined }) => (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<DrawerProviderReporter />\n\t\t\t\t\t\t\t\t\t{(\n\t\t\t\t\t\t\t\t\t\tprops.children as DrawerPayloadChildRenderFunction<Payload>\n\t\t\t\t\t\t\t\t\t)(ctx)}\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)) as DrawerPayloadChildRenderFunction<Payload>)\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<DrawerProviderReporter />\n\t\t\t\t\t\t\t\t{props.children as JSX.Element}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t</DialogRoot>\n\t\t\t</IsDrawerContext>\n\t\t</DrawerRootContext>\n\t);\n}\n\n/**\n * Reports the drawer's open state to the enclosing `<Drawer.Provider>`\n * (if any) and installs an Android `CloseWatcher` for the back gesture.\n *\n * 1:1 port of the React `DrawerProviderReporter`. Skips the `CloseWatcher`\n * wiring when not on Android — the React source scopes it the same way\n * to avoid interfering with `useDismiss`'s Escape + nesting semantics.\n */\nfunction DrawerProviderReporter(): JSX.Element | null {\n\tconst generatedId = useBaseUiId();\n\tconst drawerId = (): string | undefined => generatedId;\n\n\tconst providerContext = useDrawerProviderContext(true);\n\tconst dialogRootContext = useDialogRootContext();\n\n\tconst open = dialogRootContext.open;\n\tconst nestedOpenDialogCount = dialogRootContext.nestedOpenDialogCount;\n\tconst popupElement = dialogRootContext.popupElement;\n\n\tconst isTopmost = (): boolean => nestedOpenDialogCount() === 0;\n\n\t// Cleanup registration on unmount.\n\tonCleanup(() => {\n\t\tconst id = drawerId();\n\t\tif (providerContext && id) providerContext.removeDrawer(id);\n\t});\n\n\t// Forward open-state to the enclosing provider.\n\tcreateEffect(\n\t\t() => ({ o: open(), id: drawerId() }),\n\t\t({ o, id }) => {\n\t\t\tif (!id) return;\n\t\t\tproviderContext?.setDrawerOpen(id, o);\n\t\t},\n\t);\n\n\t// Android `CloseWatcher` wiring. Chromium-only; kept Android-only to\n\t// avoid interfering with Escape handling on desktop.\n\tcreateEffect(\n\t\t() => ({\n\t\t\to: open(),\n\t\t\ttopmost: isTopmost(),\n\t\t\tpopup: popupElement(),\n\t\t}),\n\t\t({ o, topmost, popup }) => {\n\t\t\tif (!o || !topmost) return undefined;\n\t\t\tconst ua = typeof navigator !== \"undefined\" ? navigator.userAgent : \"\";\n\t\t\tconst isAndroid = /Android/i.test(ua);\n\t\t\tif (!isAndroid) return undefined;\n\t\t\tconst win = popup?.ownerDocument?.defaultView ?? globalThis.window;\n\t\t\tconst CloseWatcherCtor = (\n\t\t\t\twin as Window & {\n\t\t\t\t\tCloseWatcher?: new () => EventTarget & { destroy: () => void };\n\t\t\t\t}\n\t\t\t).CloseWatcher;\n\t\t\tif (!CloseWatcherCtor) return undefined;\n\n\t\t\tconst handleCloseWatcher = (event: Event): void => {\n\t\t\t\tif (!dialogRootContext.open()) return;\n\t\t\t\tdialogRootContext.setOpen(\n\t\t\t\t\tfalse,\n\t\t\t\t\tcreateChangeEventDetails(REASONS.closeWatcher, event) as Parameters<\n\t\t\t\t\t\ttypeof dialogRootContext.setOpen\n\t\t\t\t\t>[1],\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst closeWatcher = new CloseWatcherCtor();\n\t\t\tcloseWatcher.addEventListener(\"close\", handleCloseWatcher);\n\t\t\treturn () => {\n\t\t\t\tcloseWatcher.removeEventListener(\"close\", handleCloseWatcher);\n\t\t\t\tcloseWatcher.destroy?.();\n\t\t\t};\n\t\t},\n\t);\n\n\treturn null;\n}\n"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,EAAEC,YAAY,EAAEC,SAAS,EAAEC,OAAO,QAAQ,UAAU;AACzE,SACCC,eAAe,EACfC,oBAAoB,QACd,kCAAkC;AACzC,SACCC,UAAU,QAEJ,+BAA+B;AAEtC,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAECC,wBAAwB,EACxBC,OAAO,QACD,sCAAsC;AAC7C,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SAA6BC,UAAU,QAAQ,gCAAgC;AAC/E,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SAGCC,iBAAiB,EAMjBC,oBAAoB,QACd,uBAAuB;;AA6D9B;;AAOA,SAASC,8BAA8BA,CAAA,EAAiC;EACvE,IAAIC,QAAQ,GAAG,CAAC;EAChB,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;EACvC,OAAO;IACNC,WAAW,EAAEA,CA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