{"version":3,"file":"styloviz-core-feedback.mjs","names":[],"sources":["../../../../projects/core/feedback/banner-stack.ts","../../../../projects/core/feedback/spinner-arc.component.ts","../../../../projects/core/feedback/wait-escalation.ts","../../../../projects/core/feedback/delayed-visibility.ts"],"sourcesContent":["import { Injectable, computed, signal, type Signal } from '@angular/core';\n\n/**\n * Where a banner is pinned. `inline` banners never register — they are in the\n * document flow and cannot collide.\n */\nexport type SvBannerSlot = 'top-fixed' | 'bottom-fixed' | 'top-sticky';\n\n/** What a banner tells the stack about itself. */\nexport interface SvBannerRegistration {\n  /** Which edge it is pinned to. */\n  readonly slot: SvBannerSlot;\n  /**\n   * Higher wins the edge. Equal priorities keep registration order.\n   *\n   * ★ A number rather than a `'low' | 'high'` union: an app's fourth banner is\n   *   always the one that has to go between two of the first three.\n   */\n  readonly priority: number;\n  /** Identity for suppression, or `null` to never suppress (`OF-01-M2`). */\n  readonly dedupeKey: string | null;\n}\n\nexport interface SvBannerHandle {\n  /** Slot-relative order, 0 = against the edge. -1 while suppressed. */\n  readonly index: Signal<number>;\n  /** Pixels from the edge: the summed height of the banners before this one. */\n  readonly offset: Signal<number>;\n  /**\n   * True when an identical banner (same `dedupeKey`, same slot) registered\n   * first. A suppressed banner renders nothing.\n   */\n  readonly suppressed: Signal<boolean>;\n  /** Report this banner's rendered height so the ones after it can be placed. */\n  measured(height: number): void;\n  /**\n   * Leave the stack.\n   *\n   * ★ Idempotent because the removal IS a filter by id, not because anything\n   *   remembers having been called. A `released` flag was written here first\n   *   and no mutation could tell it from its absence — a second filter for an\n   *   id nothing holds removes nothing — so it went, like the same flag in\n   *   `SvOverlayRouteService`.\n   */\n  release(): void;\n}\n\ninterface Entry {\n  readonly id: number;\n  readonly reg: SvBannerRegistration;\n  readonly height: ReturnType<typeof signal<number>>;\n}\n\nlet _seq = 0;\n\n/** Separator for the slot-scoped dedupe key: a NUL, which no message contains. */\nconst KEY_SEP = '\\x00';\n\n/**\n * SvBannerStackService — who gets the edge, and how far down the next one sits\n * (`X-12`, `OF-01-I1`, `OF-01-M1`, `OF-01-M2`).\n *\n * ── The finding ─────────────────────────────────────────────────────────────\n *\n * ★★★ TWO `top-fixed` BANNERS GOT BYTE-IDENTICAL `fixed top-0 left-0 right-0\n *     z-50`, SO ONE WAS SIMPLY NEVER SEEN. Not clipped, not below the fold —\n *     painted underneath the other, in the same place, with nothing to suggest\n *     a second message existed. The dangerous shape is the ordinary one: a\n *     shell renders a maintenance notice and a route renders a trial-expiry\n *     notice, neither knowing about the other.\n *\n * ── Why a service rather than a container component ─────────────────────────\n *\n * ★★ THE BANNERS DO NOT SHARE A PARENT, and that is the whole problem. They\n *    are rendered by whoever has the message — a shell, a route, a lazily\n *    loaded panel — so a wrapper component would coordinate only the ones a\n *    single author remembered to put inside it. A root service is reachable\n *    from all of them and needs no cooperation from the tree.\n *\n * ★ Nothing registers unless it is pinned. An `inline` banner is in the\n *   document flow: it cannot overlap anything, and giving it a slot would make\n *   it push a fixed banner down for no reason.\n */\n@Injectable({ providedIn: 'root' })\nexport class SvBannerStackService {\n  private readonly _entries = signal<readonly Entry[]>([]);\n\n  /**\n   * The entries actually shown, in paint order.\n   *\n   * ★★ SUPPRESSION IS DECIDED HERE AND NOT BY THE BANNER, because it depends\n   *    on what else is on screen. The FIRST registration with a key keeps the\n   *    slot; later identical ones render nothing — first rather than last for\n   *    the same reason a deduplicated toast keeps its place: the user may\n   *    already be reading it, or acting on it.\n   */\n  private readonly _visible = computed<readonly Entry[]>(() => {\n    const seen = new Set<string>();\n    const kept: Entry[] = [];\n    for (const entry of this._entries()) {\n      const key = entry.reg.dedupeKey;\n      if (key !== null) {\n        const scoped = entry.reg.slot + KEY_SEP + key;\n        if (seen.has(scoped)) continue;\n        seen.add(scoped);\n      }\n      kept.push(entry);\n    }\n    // ★ A STABLE sort by priority, so equal priorities keep registration order\n    //   — otherwise two banners of equal weight swap places whenever a third\n    //   arrives, which reads as the page glitching. `Array.prototype.sort` is\n    //   specified as stable, so this is the whole implementation.\n    return [...kept].sort((a, b) => b.reg.priority - a.reg.priority);\n  });\n\n  /** How many banners are visible in a slot. */\n  visibleCount(slot: SvBannerSlot): number {\n    return this._visible().filter((e) => e.reg.slot === slot).length;\n  }\n\n  register(reg: SvBannerRegistration): SvBannerHandle {\n    const entry: Entry = { id: ++_seq, reg, height: signal(0) };\n    this._entries.update((list) => [...list, entry]);\n\n    const ownSlot = computed(() => this._visible().filter((e) => e.reg.slot === reg.slot));\n    const index = computed(() => ownSlot().findIndex((e) => e.id === entry.id));\n\n    return {\n      index,\n      suppressed: computed(() => index() === -1),\n      offset: computed(() => {\n        const group = ownSlot();\n        const at = index();\n        if (at <= 0) return 0;\n        // ★ Heights are REPORTED, not measured here. This service has no\n        //   element and no business touching the DOM; a banner knows its own\n        //   height and says so. An unreported height is 0, which stacks them\n        //   again — honest, because the alternative is inventing a number and\n        //   leaving a gap where no banner is.\n        return group.slice(0, at).reduce((sum, e) => sum + e.height(), 0);\n      }),\n      measured: (height: number) => entry.height.set(Math.max(0, height)),\n      release: () => {\n        this._entries.update((list) => list.filter((e) => e.id !== entry.id));\n      },\n    };\n  }\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\n\n/**\n * The kit's one spinning-arc indicator.\n *\n * ★ WHY THIS EXISTS\n *\n * The same twelve lines of SVG — a faint ring plus a quarter-arc wedge, spun by\n * `animate-spin` — were hand-copied into **21 places** across 19 packages and 2\n * app components. They had drifted, in every way a copy can:\n *\n *   • four spellings of one curve (`5.373` vs `5.4`, `018-8` vs `0 0 1 8-8`,\n *     `z` vs `Z`) — the same shape, four times, none of them wrong\n *   • three opacity pairs: 25/75 (×13), 25/90 (×4), 20/90 (×2)\n *   • **six copies with no `aria-hidden` and no label at all** — silent to a\n *     screen reader in a way nobody chose\n *   • and the two data-table copies were not this shape at all: a stroked\n *     quarter-circle with no ring behind it\n *\n * None of that drift is visible in review, because no reviewer sees two copies\n * at once. It is only visible from up here.\n *\n * ★ It lives in `@styloviz/core`, not `@styloviz/overlays`, for two reasons.\n * `<sv-spinner>` in overlays draws a **border ring** — `border`/`dots`/`pulse`/\n * `bars`, no arc — so routing these through it would have restyled every\n * spinner in the kit. And core is already a dependency of 15 of the 17 affected\n * packages, where overlays is a dependency of none; core already exports\n * `SvSkeletonShellComponent` and `SvFieldErrorComponent`, so a shared indicator\n * is at home here.\n *\n * ★ ACCESSIBILITY: decorative by default. A spinner beside its own visible\n * \"Loading…\" text must not be announced twice, so with no `label` this renders\n * `aria-hidden=\"true\"`. Pass `label` only when the spinner is the *only* thing\n * conveying that something is happening — then it becomes `role=\"img\"` with an\n * accessible name.\n *\n * @example Static size and colour\n * ```html\n * <sv-spinner-arc cssClass=\"h-7 w-7 text-primary-500\" />\n * ```\n *\n * @example Driven by a computed size, and the only loading affordance present\n * ```html\n * <sv-spinner-arc [cssClass]=\"iconSize()\" label=\"Loading suggestions\" />\n * ```\n */\n@Component({\n  selector: 'sv-spinner-arc',\n  standalone: true,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  template: `\n    <svg\n      [class]=\"svgClass()\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      [attr.role]=\"label() ? 'img' : null\"\n      [attr.aria-label]=\"label() || null\"\n      [attr.aria-hidden]=\"label() ? null : 'true'\"\n    >\n      <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\" />\n      <path class=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\" />\n    </svg>\n  `,\n})\nexport class SvSpinnerArcComponent {\n  /**\n   * Classes for the `<svg>` itself — size and colour. `animate-spin` is always\n   * applied and must not be passed here.\n   *\n   * Named `cssClass` rather than `class` to match `sv-loader-icon`, the kit's\n   * existing precedent for the same job.\n   */\n  readonly cssClass = input('');\n\n  /**\n   * An accessible name. Leave empty (the default) whenever the surrounding UI\n   * already says that something is loading — see the note above.\n   */\n  readonly label = input('');\n\n  protected readonly svgClass = computed(() =>\n    ('animate-spin shrink-0 ' + this.cssClass()).trim(),\n  );\n}\n","import { computed, signal, type DestroyRef, type Signal } from '@angular/core';\nimport { svFormatLabel } from '@styloviz/core/i18n';\nimport { SV_CORE_LABELS, type SvCoreLabels } from '@styloviz/core/i18n';\n\n/**\n * How long a wait has been going on, in three words instead of a millisecond\n * count.\n *\n * ── The defect this exists for (`OF-18-I5`, `OF-17-I7`) ─────────────────────\n *\n * ★★★ A SPINNER IS INDISTINGUISHABLE FROM A FAILED REQUEST, FOREVER. Both are\n *     \"something is happening and I cannot tell you anything about it\", and a\n *     spinner that has been going for ninety seconds is no longer telling the\n *     truth: nothing is happening. The user's only move is to reload the page\n *     and lose whatever they had typed — which is exactly what they do.\n *\n * ★★ THE SAME IS TRUE OF A SKELETON, AND WORSE. A skeleton says \"the shape of\n *    your data is arriving\"; a stuck one says that permanently, in the exact\n *    place the data was going to be. There is no timeout, no error, no retry —\n *    the host's request failed silently and the placeholder outlived it.\n *\n * ★ Two thresholds, not one, because the honest answers differ. At ten seconds\n *   the right thing to say is \"this is taking longer than usual\" — the request\n *   is probably fine and an error would be a lie. At thirty it is \"this has\n *   stopped being a wait\", and the surface owes the user a way out: a cancel, a\n *   retry, or at minimum an acknowledgement that it is stuck.\n */\nexport type SvWaitStage =\n  /** Nothing is waiting. */\n  | 'idle'\n  /** Waiting, and that is normal. */\n  | 'waiting'\n  /** Longer than usual. Say so; do not claim failure. */\n  | 'slow'\n  /** Long enough that \"waiting\" is no longer a useful description. */\n  | 'stalled';\n\nexport interface SvWaitEscalationOptions {\n  /**\n   * When `waiting` becomes `slow`, in ms. `0` or less never escalates.\n   *\n   * Accepts a signal so a component can expose it as an input.\n   * @default 10_000\n   */\n  readonly slowAfterMs?: number | Signal<number>;\n  /**\n   * When it becomes `stalled`, in ms from the same start. `0` or less never\n   * escalates. @default 30_000\n   */\n  readonly stalledAfterMs?: number | Signal<number>;\n  /**\n   * Destroy hook. Pass `inject(DestroyRef)` from a field initializer and the\n   * timers are cleared on teardown — a timer that fires into a destroyed\n   * component is the leak that only shows up under a router which reuses the\n   * route.\n   */\n  readonly destroyRef?: DestroyRef | null;\n}\n\nexport interface SvWaitEscalation {\n  readonly stage: Signal<SvWaitStage>;\n  /** `slow` or worse. */\n  readonly slow: Signal<boolean>;\n  /** `stalled`. */\n  readonly stalled: Signal<boolean>;\n  /**\n   * Begin (or continue) waiting.\n   *\n   * ★★ IDEMPOTENT, AND THAT IS THE WHOLE DESIGN. Every caller is a template or\n   *    an `effect` that runs again for reasons unrelated to the wait — a\n   *    keystroke elsewhere, a theme change, a parent re-render. A `start()`\n   *    that restarted the clock would mean a busy page never escalates at all,\n   *    which is the failure mode that looks like the feature working.\n   */\n  start(): void;\n  /** Stop waiting and return to `idle`. Safe to call when already idle. */\n  stop(): void;\n  /** Clear the timers. Called for you when `destroyRef` was supplied. */\n  destroy(): void;\n}\n\nconst DEFAULT_SLOW_MS = 10_000;\nconst DEFAULT_STALLED_MS = 30_000;\n\n/**\n * Escalate a wait through `waiting → slow → stalled` on two timers.\n *\n * ```ts\n * protected readonly wait = createWaitEscalation({\n *   slowAfterMs: this.slowAfterMs,\n *   stalledAfterMs: this.stalledAfterMs,\n *   destroyRef: inject(DestroyRef),\n * });\n *\n * constructor() {\n *   effect(() => (this.loading() ? this.wait.start() : this.wait.stop()));\n * }\n * ```\n *\n * A plain factory: two timers and a signal, no injection context, callable\n * from a field initializer.\n */\nexport function createWaitEscalation(\n  options: SvWaitEscalationOptions = {},\n): SvWaitEscalation {\n  const msOf = (\n    value: number | Signal<number> | undefined,\n    fallback: number,\n  ): number => {\n    const ms = value === undefined ? fallback : typeof value === 'number' ? value : value();\n    return Number.isFinite(ms) ? ms : 0;\n  };\n\n  const stage = signal<SvWaitStage>('idle');\n  let slowTimer: ReturnType<typeof setTimeout> | null = null;\n  let stalledTimer: ReturnType<typeof setTimeout> | null = null;\n\n  const clear = (): void => {\n    if (slowTimer !== null) { clearTimeout(slowTimer); slowTimer = null; }\n    if (stalledTimer !== null) { clearTimeout(stalledTimer); stalledTimer = null; }\n  };\n\n  const api: SvWaitEscalation = {\n    stage: stage.asReadonly(),\n    // ★ Derived, not a third signal: \"is it slow?\" cannot then disagree with\n    //   \"what stage is it?\", which is how a two-flag version of this drifts.\n    slow: computed(() => stage() === 'slow' || stage() === 'stalled'),\n    stalled: computed(() => stage() === 'stalled'),\n\n    start: (): void => {\n      if (stage() !== 'idle') return;   // already waiting — see `start`'s note\n      stage.set('waiting');\n\n      const slowMs = msOf(options.slowAfterMs, DEFAULT_SLOW_MS);\n      const stalledMs = msOf(options.stalledAfterMs, DEFAULT_STALLED_MS);\n\n      if (slowMs > 0) {\n        slowTimer = setTimeout(() => {\n          slowTimer = null;\n          // ★ Never demote: a `stalled` wait that hears from the slow timer\n          //   late — a suspended tab, a debugger pause, timers firing out of\n          //   order under fake clocks — must not go back to saying \"longer\n          //   than usual\".\n          if (stage() === 'waiting') stage.set('slow');\n        }, slowMs);\n      }\n      if (stalledMs > 0) {\n        stalledTimer = setTimeout(() => {\n          stalledTimer = null;\n          // ★ No `idle` check here, unlike the slow timer above. `stop()`\n          //   clears both timers, so this callback cannot run after one — I\n          //   wrote the guard, it survived every mutation, and it is gone.\n          //   The guard above is NOT redundant: it is the never-demote rule,\n          //   and removing it turns a stalled wait back into a slow one.\n          stage.set('stalled');\n        }, stalledMs);\n      }\n    },\n\n    stop: (): void => {\n      clear();\n      stage.set('idle');\n    },\n\n    destroy: clear,\n  };\n\n  options.destroyRef?.onDestroy(clear);\n\n  return api;\n}\n\n// ── Stating the expectation (`OF-18-I8`) ─────────────────────────────────────\n\n/**\n * Turn \"how long this usually takes\" into the sentence a user can act on.\n *\n * ★★★ AN ESCALATION IS AN APOLOGY, NOT AN EXPECTATION. `createWaitEscalation`\n *     above only ever speaks once a wait has already gone wrong — it says\n *     \"longer than usual\" without ever having said what usual IS. A user who\n *     is told nothing for ten seconds has already decided the page is broken;\n *     the decision that matters is made in the first second, and it is made on\n *     information the host almost always has and never passes on.\n *\n * ★★ NEVER UNDERSTATE. Every figure here rounds UP, and that is deliberate:\n *    a user told \"about 1 minute\" who waits ninety seconds has been lied to,\n *    while one told \"about 2 minutes\" who is served in ninety seconds got a\n *    pleasant surprise. The two errors are not symmetrical, so the rounding\n *    is not either.\n *\n * ★ AND DO NOT OVER-CLAIM PRECISION. Above ten seconds the figure snaps to a\n *   five-second grid, because the number came from a host's estimate and\n *   \"about 23 seconds\" dresses a guess up as a measurement. Below ten it\n *   rounds to the second, where the grid would be coarser than the wait.\n *\n * Returns `null` for anything that is not a positive, finite duration — a\n * caller can pass its raw input straight in and render the result or nothing.\n *\n * @example\n * ```ts\n * svFormatExpectedWait(8_000);   // 'about 8 seconds'\n * svFormatExpectedWait(23_000);  // 'about 25 seconds'\n * svFormatExpectedWait(60_000);  // 'about 1 minute'\n * svFormatExpectedWait(0);       // null\n * ```\n */\n/** The templates `svFormatExpectedWait` fills — core's English by default. */\nexport type SvExpectedWaitLabels = Pick<SvCoreLabels, 'expectedWaitSeconds' | 'expectedWaitMinutes'>;\n\nexport function svFormatExpectedWait(\n  ms: number,\n  labels: SvExpectedWaitLabels = SV_CORE_LABELS,\n  locale = '',\n): string | null {\n  if (!Number.isFinite(ms) || ms <= 0) return null;\n\n  const seconds = ms / 1000;\n\n  // ★ A 200ms expectation still reads \"about 1 second\" — \"about 0 seconds\" is\n  //   not a sentence, and a host passing a figure that small has made a units\n  //   mistake this function cannot fix for it. There is no floor here doing\n  //   that work: I wrote `Math.max(1, …)` and no mutation could kill it,\n  //   because rounding UP off a positive duration cannot reach zero. The\n  //   guarantee is the ceiling's, so the floor is gone.\n  const snapped = seconds <= 10\n    ? Math.ceil(seconds)\n    : Math.ceil(seconds / 5) * 5;\n\n  // ★ The grid is applied BEFORE the unit is chosen, so 59s does not become\n  //   \"about 60 seconds\" — the snap pushed it to a minute, and a minute is\n  //   what a minute is called.\n  if (snapped < 60) return svFormatLabel(labels.expectedWaitSeconds, { count: snapped, n: String(snapped) }, locale);\n\n  const minutes = Math.ceil(snapped / 60);\n  return svFormatLabel(labels.expectedWaitMinutes, { count: minutes, n: String(minutes) }, locale);\n}\n","import { DestroyRef, effect, inject, PLATFORM_ID, signal, untracked, type Signal } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n/**\n * delayed-visibility.ts — show a loader late, and keep it long enough to read\n * (FL-J3-OF-06, `OF-18-M2`, `OF-17-M4`).\n *\n * ★★★ TWO OPPOSITE FLICKERS, ONE CAUSE. A request that answers in 80 ms\n *     flashes a spinner for 80 ms — a frame of \"something is wrong\" for a\n *     wait the user never noticed. And one that answers 50 ms after the\n *     spinner finally appeared yanks it away mid-glance. Both are a loader\n *     whose visibility follows the request exactly. The fix is the same\n *     primitive both ways round: appear only after `showAfterMs`, and once\n *     shown stay at least `minVisibleMs`.\n *\n * ★★ THE HOST NEEDS THE SAME SIGNAL, not only the loader. If the loader\n *    lingers for its minimum while the host has already swapped the content\n *    in, the screen shows both. So this is exported from core, and the host\n *    drives its own `@if` from it:\n *\n * ```ts\n * readonly showLoader = createDelayedVisibility(() => this.loading(), {\n *   showAfterMs: 200,\n *   minVisibleMs: 400,\n * });\n * ```\n * ```html\n * @if (showLoader()) { <sv-spinner /> } @else if (!loading()) { …content… }\n * ```\n *\n * Both delays default to 0, which is \"follow `active` exactly\" — the\n * behaviour every loader had before.\n */\n\n/** Options for {@link createDelayedVisibility}. Read on every transition, so signals and inputs work. */\nexport interface SvDelayedVisibilityOptions {\n  /** Wait this long after `active` turns on before showing, in ms. @default 0 */\n  readonly showAfterMs?: number | (() => number);\n  /** Once shown, stay shown at least this long, in ms. @default 0 */\n  readonly minVisibleMs?: number | (() => number);\n}\n\nconst msOf = (value: number | (() => number) | undefined): number => {\n  const ms = typeof value === 'function' ? value() : (value ?? 0);\n  return Number.isFinite(ms) && ms > 0 ? ms : 0;\n};\n\n/**\n * A signal that follows `active` with a show delay and a minimum visible time.\n *\n * Must be called in an injection context (it creates an effect and cleans its\n * timers up on destroy). On the server it follows `active` exactly: a delay\n * there would only ever render the page without its loader.\n */\nexport function createDelayedVisibility(\n  active: () => boolean,\n  options: SvDelayedVisibilityOptions = {},\n): Signal<boolean> {\n  const visible = signal(false);\n  const isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n  let showTimer: ReturnType<typeof setTimeout> | null = null;\n  let hideTimer: ReturnType<typeof setTimeout> | null = null;\n  let shownAt = 0;\n\n  const clearShow = (): void => {\n    if (showTimer !== null) { clearTimeout(showTimer); showTimer = null; }\n  };\n  const clearHide = (): void => {\n    if (hideTimer !== null) { clearTimeout(hideTimer); hideTimer = null; }\n  };\n  const show = (): void => {\n    shownAt = Date.now();\n    visible.set(true);\n  };\n\n  effect(() => {\n    const on = active();\n    untracked(() => {\n      if (!isBrowser) { visible.set(on); return; }\n      if (on) {\n        // ★ Back on while a hide was pending: the loader never left, so it\n        //   simply stays — no second fade, no restarted minimum.\n        clearHide();\n        if (visible() || showTimer !== null) return;\n        const delay = msOf(options.showAfterMs);\n        if (delay === 0) { show(); return; }\n        showTimer = setTimeout(() => { showTimer = null; show(); }, delay);\n        return;\n      }\n      // Off before it was ever shown: the wait was short enough not to mention.\n      clearShow();\n      if (!visible() || hideTimer !== null) return;\n      const remaining = msOf(options.minVisibleMs) - (Date.now() - shownAt);\n      if (remaining <= 0) { visible.set(false); return; }\n      hideTimer = setTimeout(() => { hideTimer = null; visible.set(false); }, remaining);\n    });\n  });\n\n  inject(DestroyRef).onDestroy(() => { clearShow(); clearHide(); });\n\n  return visible.asReadonly();\n}\n"],"mappings":";;;;AAqDA,IAAI,OAAO;AAGX,MAAM,UAAU;AA4BhB,IAAa,uBAAb,MAAa,qBAAoB;CACd,WAAW,OAAyB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAWvC,WAAW,eAAgC;EAC1D,MAAM,uBAAO,IAAI,IAAG;EACpB,MAAM,OAAgB,CAAA;EACtB,KAA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