@dashspec/renderer 0.1.40 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +1 -1
  3. package/dist/FlowMapView-BSTKU7D4.js +458 -0
  4. package/dist/FlowMapView-BSTKU7D4.js.map +1 -0
  5. package/dist/chunk-5LRFKK4I.js +118 -0
  6. package/dist/chunk-5LRFKK4I.js.map +1 -0
  7. package/dist/{chunk-NLKXHTLO.js → chunk-D4GFCPCL.js} +6 -33
  8. package/dist/chunk-D4GFCPCL.js.map +1 -0
  9. package/dist/chunk-E4CT25TF.js +440 -0
  10. package/dist/chunk-E4CT25TF.js.map +1 -0
  11. package/dist/chunk-HUBYJ34E.js +38 -0
  12. package/dist/chunk-HUBYJ34E.js.map +1 -0
  13. package/dist/{chunk-M4WXE3FW.js → chunk-JCPQBIAL.js} +5 -3
  14. package/dist/{chunk-M4WXE3FW.js.map → chunk-JCPQBIAL.js.map} +1 -1
  15. package/dist/{chunk-UK4FBI4D.js → chunk-O4BYNRCA.js} +204 -526
  16. package/dist/chunk-O4BYNRCA.js.map +1 -0
  17. package/dist/{core-CrM2CTkH.d.ts → core-B0gU-OwN.d.ts} +34 -1
  18. package/dist/core.d.ts +1 -1
  19. package/dist/core.js +18 -16
  20. package/dist/index.d.ts +61 -5
  21. package/dist/index.js +587 -505
  22. package/dist/index.js.map +1 -1
  23. package/dist/sandbox-RCDZ7SDZ.js +11 -0
  24. package/dist/sandbox.js +3 -2
  25. package/dist/schema.json +12 -0
  26. package/docs/README.md +1 -1
  27. package/docs/api.md +1 -1
  28. package/docs/data.md +8 -0
  29. package/docs/design-systems.md +21 -0
  30. package/docs/getting-started.md +1 -1
  31. package/docs/json-format.md +2 -0
  32. package/docs/theming.md +31 -0
  33. package/docs/widgets.md +2 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-NLKXHTLO.js.map +0 -1
  36. package/dist/chunk-UK4FBI4D.js.map +0 -1
  37. package/dist/sandbox-WEMG76LE.js +0 -10
  38. /package/dist/{sandbox-WEMG76LE.js.map → sandbox-RCDZ7SDZ.js.map} +0 -0
@@ -0,0 +1,11 @@
1
+ import {
2
+ createSandboxRunner,
3
+ loadQuickJS
4
+ } from "./chunk-JCPQBIAL.js";
5
+ import "./chunk-D4GFCPCL.js";
6
+ import "./chunk-HUBYJ34E.js";
7
+ export {
8
+ createSandboxRunner,
9
+ loadQuickJS
10
+ };
11
+ //# sourceMappingURL=sandbox-RCDZ7SDZ.js.map
package/dist/sandbox.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  createSandboxRunner
3
- } from "./chunk-M4WXE3FW.js";
4
- import "./chunk-NLKXHTLO.js";
3
+ } from "./chunk-JCPQBIAL.js";
4
+ import "./chunk-D4GFCPCL.js";
5
+ import "./chunk-HUBYJ34E.js";
5
6
  export {
6
7
  createSandboxRunner
7
8
  };
package/dist/schema.json CHANGED
@@ -1700,6 +1700,9 @@
1700
1700
  },
1701
1701
  "from": {
1702
1702
  "$ref": "#/properties/metadata/properties/key"
1703
+ },
1704
+ "path": {
1705
+ "type": "string"
1703
1706
  }
1704
1707
  },
1705
1708
  "required": [
@@ -2874,6 +2877,15 @@
2874
2877
  "open": {
2875
2878
  "$ref": "#/properties/spec/properties/display/properties/title"
2876
2879
  },
2880
+ "defaultArgs": {
2881
+ "type": "object",
2882
+ "additionalProperties": {
2883
+ "$ref": "#/definitions/JsonValue"
2884
+ }
2885
+ },
2886
+ "availableWhen": {
2887
+ "type": "string"
2888
+ },
2877
2889
  "datasources": {
2878
2890
  "type": "object",
2879
2891
  "additionalProperties": {
package/docs/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  | Page | What it covers |
10
10
  |---|---|
11
11
  | [Getting started](getting-started.md) | Install, a first dashboard, loading JSON from your API, validating with `loadDocument`, what viewers see for invalid documents |
12
- | [Widgets](widgets.md) | The 31 built-in widgets and their props, nesting with slots, and writing your own with `wrapComponent`, `defineWidget` and `lazyWidget` |
12
+ | [Widgets](widgets.md) | The 32 built-in widgets and their props, nesting with slots, and writing your own with `wrapComponent`, `defineWidget` and `lazyWidget` |
13
13
  | [Data](data.md) | Connections and auth, every datasource type, transforms, refresh and cache, `${…}` templates, the expression language and its helpers, custom datasource types, errors |
14
14
  | [State and events](state-and-events.md) | The state tree, widget events, every action with an example, named actions, `watch`, host actions, scripts, driving a dashboard from your app, URL sync |
15
15
  | [Design systems](design-systems.md) | Bringing your own components, filter controls, empty / error / loading states and custom filter kinds; combining design systems; aliasing built-ins |
package/docs/api.md CHANGED
@@ -408,7 +408,7 @@ See [Widgets](widgets.md) for a guide.
408
408
  | `wrapComponent(Component, options)` | Turns any React component into a widget by mapping props, events, state writes and slots (`WrapOptions`) |
409
409
  | `lazyWidget(def)` | A widget whose code downloads only when a dashboard uses it (`load: () => import(…)`, optional `fallback`) |
410
410
  | `checkWidget(def)` | Returns a list of contract problems (empty when fine). Use it in your tests |
411
- | `builtInWidgets` | The 31 built-in widget definitions |
411
+ | `builtInWidgets` | The 32 built-in widget definitions |
412
412
  | `createWidgetRegistry(builtIns, extra, aliases)` | Builds the kind → widget map the renderer uses (throws on un-namespaced or duplicate kinds). `WidgetRegistry` type |
413
413
 
414
414
  Types: `WidgetDefinition`, `AnyWidgetDefinition` (for lists of widgets with different
package/docs/data.md CHANGED
@@ -325,6 +325,14 @@ source does.
325
325
  }
326
326
  ```
327
327
 
328
+ `path` picks one part of the upstream result before the steps run. It may hold templates, so a derived source can
329
+ follow the dashboard's state, e.g. the stage a drawer was opened for:
330
+
331
+ ```json
332
+ "stageItems": { "from": "flow", "path": "stages.${modal.args.key}.items",
333
+ "transform": [{ "filter": "(state.line == 'all' || sand == state.line) && pending > 0" }] }
334
+ ```
335
+
328
336
  ### `forEach`: one request per row
329
337
 
330
338
  `forEach` repeats a request once per row of another datasource. The row is available in
@@ -262,3 +262,24 @@ Your widget then receives the built-in's JSON props (`columns`, `search`, …) i
262
262
  must match or the renderer throws; this keeps an alias from turning a table into a
263
263
  chart. Your own kind can't simply be named `Table`: host kinds are always namespaced
264
264
  and can't replace a built-in, only alias it.
265
+
266
+
267
+ ## Your own drawer (`ui.Drawer`)
268
+
269
+ Modals with `"presentation": "drawer"` can be drawn by your app's own drawer component, so its placement, rail or
270
+ handle, animation and the way it makes room on the page are yours. The dashboard keeps the state: which drawer is
271
+ open, its title, its panels, and the arguments it was last opened with.
272
+
273
+ ```tsx
274
+ import type { UIDrawerProps } from "@dashspec/renderer";
275
+
276
+ function AppDrawer({ open, title, onClose, onReopen, children }: UIDrawerProps) {
277
+ return <MyRightDrawer open={open} title={title} onClose={onClose} onOpen={onReopen}>{children}</MyRightDrawer>;
278
+ }
279
+
280
+ <DashSpecProvider ui={{ Drawer: AppDrawer }}>
281
+ ```
282
+
283
+ Your drawer stays mounted while closed (a rail can stay on screen). `onReopen` opens it with its last arguments, or
284
+ the modal's `defaultArgs` before it was ever opened. Your drawer handles Escape and focus; the renderer leaves both to
285
+ it.
@@ -231,7 +231,7 @@ Report these to your monitoring with `onError`:
231
231
 
232
232
  ## Next steps
233
233
 
234
- - [Widgets](widgets.md): the 31 built-in widgets, nesting, and writing your own.
234
+ - [Widgets](widgets.md): the 32 built-in widgets, nesting, and writing your own.
235
235
  - [Data](data.md): connections, auth, datasources, templates and expressions.
236
236
  - [State and events](state-and-events.md): clicks, actions, filters, and driving a dashboard from your app.
237
237
  - [Design systems](design-systems.md): use your own components and controls.
@@ -283,6 +283,8 @@ Pop-ups opened by `openModal` (or by an `open` template turning true), keyed by
283
283
  | `title` | Template |
284
284
  | `size` | `sm`, `md` (default), `lg`, `xl`, `full` |
285
285
  | `presentation` | `modal` (default) or `drawer` (slides in from the side) |
286
+ | `defaultArgs` | arguments to open with when it was never opened (a host drawer's rail or handle reopens with them) |
287
+ | `availableWhen` | an expression; while false the modal can't be open and a host drawer isn't drawn (e.g. `"filters.page == 'flow'"`) |
286
288
  | `open` | Template; the modal opens when it becomes true, e.g. `"${state.showOrder}"` |
287
289
  | `datasources` | Datasources only this modal uses; they load when it opens |
288
290
  | `panels` | Its own nodes (required) |
package/docs/theming.md CHANGED
@@ -334,3 +334,34 @@ createTheme({
334
334
  widgets: { Kpi: { css: "…", dark: { css: "…" } } }, // dark-only additions
335
335
  });
336
336
  ```
337
+
338
+ ### Refer to the current theme's values
339
+
340
+ `token` gives references to the active theme's values. They are CSS variables, so they follow the theme and switch by
341
+ themselves between light and dark; there is nothing to write twice:
342
+
343
+ ```ts
344
+ import { createTheme, token } from "@dashspec/renderer";
345
+
346
+ createTheme({
347
+ scale: {
348
+ parts: {
349
+ title: { color: token.color("text.primary") },
350
+ meta: { color: token.color("text.secondary") },
351
+ tile: { border: token.color("border.default"), padding: 12 },
352
+ },
353
+ },
354
+ widgets: { Kpi: { css: { "& .ds-kpi-label": { color: token.color("status.good.fg") } } } },
355
+ });
356
+ ```
357
+
358
+ `token.color(path)` autocompletes every colour (`"surface.card"`, `"status.bad.bg"`…); also `token.space("md")`,
359
+ `token.radius("card")`, `token.font("heading")`.
360
+
361
+ To build on a theme's actual values, pass a function: it receives the base theme (the default, or the one you pass
362
+ second) and returns your changes.
363
+
364
+ ```ts
365
+ const acme = createTheme((base) => ({ dark: { surface: { card: base.dark.surface.sunken } } }));
366
+ const acmeCompact = createTheme((base) => ({ scale: { radius: { ...base.scale.radius, card: 6 } } }), acme);
367
+ ```
package/docs/widgets.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Widgets
2
2
 
3
3
  Every box on a dashboard is a **node** in `spec.panels`: a `kind` (which widget) and a
4
- `spec` (that widget's props). The renderer ships 31 built-in widgets, and you can add
4
+ `spec` (that widget's props). The renderer ships 32 built-in widgets, and you can add
5
5
  your own.
6
6
 
7
7
  ```json
@@ -240,6 +240,7 @@ sends them; see [Data](data.md#server-side-paging)).
240
240
  | `Content` | Markdown text: paragraphs, headings, lists, **bold**, *italic*, `code`, links, and `action:<name>` links that run a named action | `markdown`, `align` | `click` |
241
241
  | `Image` | An image from a URL or a data field | `src`, `srcField`, `alt`, `fit` (`contain` / `cover` / `fill`) | `click` |
242
242
  | `ImageMap` | An image with markers at x/y percentages | `src` (required), `alt`, `markers` (a list of `{ x, y, label, value, status }`, or field names to read them from data rows), `statusMap`, `format`, `unit` | `click`, `hover` (part `marker`) |
243
+ | `FlowMap` | A process flow: feed rows merging into one step, then a main path snaking in rows; loads on first use | `data`, `id`, `label`, `kind`, `details` (values per step id, joined as `row.detail`), `group` (feed row), `site` + `siteLabel` (dashed hand-off with a tag), `value`, `unit` (fields or `${row…}` templates), `emptyValue`, `trackedWhen`, `attentionWhen`, `selected`, `dimOthers`, `markers` (per kind: `shape` circle/diamond/square/triangle, `color` theme path or CSS, `size`, `image { src, dimmedSrc, size }`, `legend`, `chipTone`), `attention { color, legend, halo, ring }`, `selection { color, halo, ring }`, `legend`, `untrackedLegend`, `layout` (`perRow`, `colGap`, `rowGap`, `feedGap`, `mainGroup`, `mainStartsAt`, `mergeRow`, `width`…), `minWidth`; slot `hover` (a card above the hovered step, its panels read the step as `item`) | `click`, `hover`, `hoverEnd` (part `step`) |
243
244
 
244
245
  ```json
245
246
  "intro": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashspec/renderer",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "Draws a dashboard from DashSpec JSON: widgets, data, events, state.",
5
5
  "keywords": [
6
6
  "dashboard",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/runtime/store/paths.ts","../src/runtime/store/stateSlice.ts","../src/runtime/scripts/stateProxy.ts","../src/runtime/scripts/index.ts"],"sourcesContent":["/** Immutable get/set by dot path (\"panels.kpi.selection\" or [\"panels\", \"kpi\"]). */\n\nexport type Path = string | readonly (string | number)[];\nexport const toPath = (p: Path): (string | number)[] =>\n typeof p === \"string\"\n ? p\n .split(\".\")\n .filter(Boolean)\n .map((k) => (/^\\d+$/.test(k) ? Number(k) : k))\n : [...p];\n\nexport const BLOCKED = new Set([\"__proto__\", \"prototype\", \"constructor\"]);\n\n/**\n * Reads own properties only: `constructor`, `__proto__` and anything inherited are undefined, so a path from a\n * document or a script can never reach a prototype or a host function.\n */\nexport function getPath(obj: unknown, path: Path): unknown {\n let cur = obj;\n for (const k of toPath(path)) {\n if (cur === null || cur === undefined || typeof cur !== \"object\") return undefined;\n if (BLOCKED.has(String(k)) || !Object.hasOwn(cur, k)) return undefined;\n cur = (cur as Record<string | number, unknown>)[k];\n }\n return cur;\n}\n\nexport function setPath<T>(obj: T, path: Path, value: unknown): T {\n const keys = toPath(path);\n if (keys.some((k) => typeof k === \"string\" && BLOCKED.has(k)))\n throw new Error(`Invalid state path: ${keys.join(\".\")}`);\n const go = (cur: unknown, i: number): unknown => {\n if (i === keys.length) return value;\n const k = keys[i] as string | number;\n const base = cur && typeof cur === \"object\" ? cur : typeof k === \"number\" ? [] : {};\n const next = go((base as Record<string | number, unknown>)[k], i + 1);\n if (Array.isArray(base)) {\n const copy = [...base];\n copy[k as number] = next;\n return copy;\n }\n return { ...(base as object), [k]: next };\n };\n return go(obj, 0) as T;\n}\n","import { type PayloadAction, createSlice } from \"@reduxjs/toolkit\";\nimport { type Path, getPath, setPath, toPath } from \"./paths\";\n\n/** Runtime state of one panel. */\nexport interface PanelState {\n /** Runtime prop overrides, merged over the panel's spec. */\n props?: Record<string, unknown>;\n hidden?: boolean;\n selection?: unknown;\n hover?: unknown;\n /** Drill path: one entry per level below the top, e.g. [{ level: \"day\", value: \"2026-11-10\" }]. */\n drill?: { level: string; value: unknown }[];\n /** Panel controls. */\n controls?: Record<string, unknown>;\n /** Hidden series names (legend toggles). */\n hiddenSeries?: string[];\n /** Widget-owned state, e.g. a table's page, sort, search and filters; read as `${panels.<id>.ui.page}`. */\n ui?: Record<string, unknown>;\n}\n\nexport interface TreeState {\n /** Your keys from spec.state live at the top level next to these. */\n [key: string]: unknown;\n filters: Record<string, unknown>;\n panels: Record<string, PanelState>;\n view: string | null;\n modal: { id: string; args: Record<string, unknown> } | null;\n /** Highlight groups: group → hovered value (cross-panel hover). */\n highlight: Record<string, unknown>;\n}\n\n/** Roots a callback or setState may not write. */\nexport const READ_ONLY_ROOTS = new Set([\"datasources\", \"context\"]);\n/** Runtime roots that must stay objects: replacing them with anything else would break every expression. */\nconst OBJECT_ROOTS = new Set([\"filters\", \"panels\", \"highlight\"]);\n\n/** Why a write to the state is refused, or undefined when it is fine. */\nexport function stateWriteProblem(path: Path, value: unknown): string | undefined {\n const keys = toPath(path);\n if (keys.length === 0) return \"a state path can't be empty\";\n const root = String(keys[0]);\n if (READ_ONLY_ROOTS.has(root)) return `state.${root} is read-only`;\n if (keys.length === 1 && OBJECT_ROOTS.has(root) && (!value || typeof value !== \"object\" || Array.isArray(value)))\n return `state.${root} must stay an object`;\n return undefined;\n}\n\nexport const stateSlice = createSlice({\n name: \"state\",\n initialState: {} as TreeState,\n reducers: {\n set(s, a: PayloadAction<{ path: Path; value: unknown; merge?: boolean }>) {\n const { path, value, merge } = a.payload;\n if (stateWriteProblem(path, value)) return s; // the action runner reports it; the store never breaks\n const next =\n merge && value && typeof value === \"object\" && !Array.isArray(value)\n ? { ...(getPath(s, path) as object), ...(value as object) }\n : value;\n return setPath(s, path, next);\n },\n setFilter(s, a: PayloadAction<{ name: string; value: unknown }>) {\n s.filters[a.payload.name] = a.payload.value as never;\n },\n patchPanel(s, a: PayloadAction<{ id: string; patch: Partial<PanelState> }>) {\n s.panels[a.payload.id] = { ...s.panels[a.payload.id], ...a.payload.patch } as never;\n },\n setView(s, a: PayloadAction<string | null>) {\n s.view = a.payload;\n },\n openModal(s, a: PayloadAction<{ id: string; args?: Record<string, unknown> }>) {\n s.modal = { id: a.payload.id, args: (a.payload.args ?? {}) as never };\n },\n closeModal(s) {\n s.modal = null;\n },\n setHighlight(s, a: PayloadAction<{ group: string; value: unknown }>) {\n s.highlight[a.payload.group] = a.payload.value as never;\n },\n },\n});\n\nexport const stateActions = stateSlice.actions;\n","import { type Path, getPath, toPath } from \"../store/paths\";\nimport { stateWriteProblem } from \"../store/stateSlice\";\n\n/**\n * The `state` a callback receives: reads see the live tree, writes dispatch at once —\n * including after `await`. A cancelled run's writes are ignored.\n */\nexport function createStateProxy(opts: {\n read: () => unknown;\n write: (path: (string | number)[], value: unknown) => void;\n isCancelled?: () => boolean;\n}): Record<string, unknown> {\n const make = (base: (string | number)[]): unknown => {\n const target = () => getPath(opts.read(), base as Path);\n return new Proxy(\n {},\n {\n get(_t, key) {\n if (typeof key === \"symbol\") return undefined;\n if (key === \"toJSON\") return () => target();\n const v = getPath(target(), [key]);\n return v !== null && typeof v === \"object\" ? make([...base, key]) : v;\n },\n set(_t, key, value) {\n if (typeof key === \"symbol\") return false;\n const path = [...base, key];\n const v = unwrap(value);\n const problem = stateWriteProblem(path, v);\n if (problem) throw new Error(problem);\n if (!opts.isCancelled?.()) opts.write(path, v);\n return true;\n },\n deleteProperty(_t, key) {\n if (typeof key === \"symbol\") return false;\n const problem = stateWriteProblem([...base, key], undefined);\n if (problem) throw new Error(problem);\n if (!opts.isCancelled?.()) opts.write([...base, key], undefined);\n return true;\n },\n has(_t, key) {\n const t = target();\n return typeof key === \"string\" && t !== null && typeof t === \"object\" && Object.hasOwn(t, key);\n },\n ownKeys() {\n const t = target();\n return t && typeof t === \"object\" ? Reflect.ownKeys(t as object) : [];\n },\n getOwnPropertyDescriptor(_t, key) {\n const t = target();\n if (!t || typeof t !== \"object\" || typeof key !== \"string\" || getPath(t, [key]) === undefined)\n return undefined;\n return { enumerable: true, configurable: true, writable: true, value: getPath(t, [key as string]) };\n },\n },\n );\n };\n return make([]) as Record<string, unknown>;\n}\n\n/** Proxies assigned back into state are stored as plain data. */\nfunction unwrap(v: unknown): unknown {\n if (v === null || typeof v !== \"object\") return v;\n return JSON.parse(JSON.stringify(v));\n}\n\nexport { toPath };\n","// callback runner: sandbox | trusted | off, the `api` object\n\nexport type ScriptMode = \"sandbox\" | \"trusted\" | \"off\";\n\n/** What a callback's third argument offers. */\nexport interface CallbackApi {\n fetch(source: string, params?: Record<string, unknown>): Promise<unknown>;\n http(connection: string, request: Record<string, unknown>): Promise<unknown>;\n refresh(source?: string | string[]): void;\n navigate(to: string): void;\n toast(message: string, tone?: string): void;\n emit(event: string, payload?: unknown): void;\n call(fn: string, args?: unknown): Promise<unknown>;\n}\n\nexport interface ScriptRunner {\n /** Runs a callback source `(event, state, api) => …`. */\n callback(code: string, event: unknown, state: unknown, api: CallbackApi): Promise<unknown>;\n /** Runs a `{ \"fn\": … }` transform body with `rows`. Synchronous. */\n transform(code: string, rows: unknown): unknown;\n /** Builds a function prop from a `{ \"fn\": … }` body with named parameters. */\n fnProp(code: string, params: string[]): (...args: unknown[]) => unknown;\n}\n\nexport class ScriptError extends Error {\n override name = \"ScriptError\";\n}\n\n/** `trusted`: runs code with `new Function`, like the form engine. Only for JSON written by trusted authors. */\nexport function trustedRunner(opts: { transformTimeoutMs?: number } = {}): ScriptRunner {\n const limit = opts.transformTimeoutMs ?? 1000;\n return {\n async callback(code, event, state, api) {\n const fn = new Function(`\"use strict\"; return (${code});`)();\n if (typeof fn !== \"function\") throw new ScriptError(\"A callback must be a function\");\n return await fn(event, state, api);\n },\n transform(code, rows) {\n const start = Date.now();\n const out = new Function(\"rows\", `\"use strict\"; ${code}`)(rows);\n if (Date.now() - start > limit) console.warn(`[dashspec] transform took ${Date.now() - start} ms`);\n return out;\n },\n fnProp(code, params) {\n return new Function(...params, `\"use strict\"; ${code}`) as (...args: unknown[]) => unknown;\n },\n };\n}\n\n/** `off`: callbacks and fn props do nothing; fn transforms fail with a clear error. */\nexport function offRunner(): ScriptRunner {\n return {\n async callback() {\n console.warn(\"[dashspec] scripts are off; callback skipped\");\n },\n transform() {\n throw new ScriptError('Scripts are off; this \"fn\" transform cannot run');\n },\n fnProp() {\n return () => undefined;\n },\n };\n}\n\nexport { createStateProxy } from \"./stateProxy\";\n"],"mappings":";AAGO,IAAM,SAAS,CAAC,MACrB,OA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