From c8418366267364a064ddeb8f8718b89ad7d04942 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 14:18:35 +0200 Subject: [PATCH 01/50] Promote space-group-database ADR to accepted --- .../space-group-database.md | 21 ++++++++++--------- .../space_groups_overrides.yaml | 0 docs/dev/adrs/index.md | 2 +- docs/dev/plans/space-group-database.md | 10 ++++----- 4 files changed, 17 insertions(+), 16 deletions(-) rename docs/dev/adrs/{suggestions => accepted}/space-group-database.md (97%) rename docs/dev/adrs/{suggestions => accepted}/space-group-database/space_groups_overrides.yaml (100%) diff --git a/docs/dev/adrs/suggestions/space-group-database.md b/docs/dev/adrs/accepted/space-group-database.md similarity index 97% rename from docs/dev/adrs/suggestions/space-group-database.md rename to docs/dev/adrs/accepted/space-group-database.md index cc1cf3566..011dde5d1 100644 --- a/docs/dev/adrs/suggestions/space-group-database.md +++ b/docs/dev/adrs/accepted/space-group-database.md @@ -1,16 +1,17 @@ # ADR: Complete Space-Group Reference Database -**Status:** Proposed **Date:** 2026-06-01 +**Status:** Accepted **Date:** 2026-06-01 ## Group Structure model. -> This ADR follows [`AGENTS.md`](../../../../AGENTS.md). It is a +> This ADR follows [`AGENTS.md`](../../../../AGENTS.md). It was a > prerequisite for -> [`wyckoff-letter-detection.md`](wyckoff-letter-detection.md): Wyckoff +> [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md): Wyckoff > detection can only resolve letters for space groups present in the -> bundled table, and that table is currently incomplete. +> bundled table, which this ADR's implementation completed for all +> 230 groups. ## Context @@ -102,7 +103,7 @@ Coordinates and operators stay **strings** (e.g. `'(x,1/2,0)'`, `sympify`) in `crystallography.py` and to keep the file JSON-native (§2). Triclinic no-setting groups keep the `None` coordinate code, as today (see the `''`→`None` normalisation in -[`wyckoff-letter-detection.md`](wyckoff-letter-detection.md) §2). +[`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) §2). **Query surface preserved.** On disk the JSON is a list of setting records, each carrying the canonical `IT_number` and @@ -225,7 +226,7 @@ containing: The maintainer inspects the report and **selects** the authoritative value per case. Selections are recorded in a checked-in **YAML overrides file**, -`docs/dev/adrs/suggestions/space-group-database/space_groups_overrides.yaml` +`docs/dev/adrs/accepted/space-group-database/space_groups_overrides.yaml` while the ADR is proposed. If this ADR is accepted, move that companion file with the ADR to the accepted ADR area. YAML lets each selection carry an inline comment recording its rationale. The generator consumes @@ -284,7 +285,7 @@ coordinate-system code": EasyDiffraction's `SpaceGroup` category uses the empty string `''`, while the table key uses `None`. The database keeps `(1, None)` and `(2, None)`; callers normalise `''` to `None` at lookup boundaries, as specified in -[`wyckoff-letter-detection.md`](wyckoff-letter-detection.md). This is +[`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md). This is the least surprising solution because it keeps "no setting" distinct from any real coordinate-code string without inventing a sentinel value. @@ -343,7 +344,7 @@ and the documented decisions in sync. early when `coord_code is None` and `_get_general_position_ops()` indexes the raw key, so they need the `''`→`None` normalisation defined in - [`wyckoff-letter-detection.md`](wyckoff-letter-detection.md) §2 (which + [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) §2 (which also updates these call sites). This ADR delivers the data; that ADR delivers the `None`-code consumer handling. @@ -424,7 +425,7 @@ Generated and curation artifacts: `30f0051c669712ab34d991e60223c5e29264fc033b2ab03392cc01465ceba926` - `tmp/space-groups/helper-tools/generate_space_groups.py`: `bf10dcfbcf9e60485037ddabc65425e61f746ad9649cd3ccc67376dd6aae241a` -- `docs/dev/adrs/suggestions/space-group-database/space_groups_overrides.yaml`: +- `docs/dev/adrs/accepted/space-group-database/space_groups_overrides.yaml`: `7077eec25d0f3b852dd7096a24dc7ac438467f9cb594f91a65ce10cda0e0722a` - `tmp/space-groups/extracted-comparison/disagreements.md`: `dda940fbf75862516411685c9b9bdf7170fa4a116f90eeeff93bd068b8acda4c` @@ -508,7 +509,7 @@ respectively. ## Related ADRs -- [`wyckoff-letter-detection.md`](wyckoff-letter-detection.md) — the +- [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) — the dependent feature; its `''`→`None` coordinate-code normalisation and its "unsupported group" handling both build on this database. - [`iucr-cif-tag-alignment.md`](../accepted/iucr-cif-tag-alignment.md) — diff --git a/docs/dev/adrs/suggestions/space-group-database/space_groups_overrides.yaml b/docs/dev/adrs/accepted/space-group-database/space_groups_overrides.yaml similarity index 100% rename from docs/dev/adrs/suggestions/space-group-database/space_groups_overrides.yaml rename to docs/dev/adrs/accepted/space-group-database/space_groups_overrides.yaml diff --git a/docs/dev/adrs/index.md b/docs/dev/adrs/index.md index fe759d3ee..8aedc2e57 100644 --- a/docs/dev/adrs/index.md +++ b/docs/dev/adrs/index.md @@ -46,7 +46,7 @@ folders. | Quality | Accepted | Test Strategy | Defines layered unit, functional, integration, script, and notebook testing. | [`test-strategy.md`](accepted/test-strategy.md) | | Structure model | Accepted | Type-Neutral ADP Parameters | Keeps ADP parameter object identities stable across B/U and iso/ani switches. | [`type-neutral-adp-parameters.md`](accepted/type-neutral-adp-parameters.md) | | Structure model | Suggestion | Automatic Wyckoff Position Detection | Detects Wyckoff letter, multiplicity, and site symmetry from space group and coordinates; calculators consume them. | [`wyckoff-letter-detection.md`](suggestions/wyckoff-letter-detection.md) | -| Structure model | Suggestion | Complete Space-Group Reference Database | One-time build of a complete space_groups.json.gz (all 230 groups) from cctbx, verified against multiple sources. | [`space-group-database.md`](suggestions/space-group-database.md) | +| Structure model | Accepted | Complete Space-Group Reference Database | One-time build of a complete space_groups.json.gz (all 230 groups) from cctbx, verified against multiple sources. | [`space-group-database.md`](accepted/space-group-database.md) | | User-facing API | Accepted | Crystal Structure 3D Visualization | Adds a renderer-neutral scene model drawn by ASCII and interactive Three.js engines for viewing crystal structures. | [`crysview-structure-visualization.md`](accepted/crysview-structure-visualization.md) | | User-facing API | Accepted | Display UX Facade | Defines `project.display` and `project.rendering` responsibilities and display method names. | [`display-ux.md`](accepted/display-ux.md) | | User-facing API | Accepted | Fit Results Display Naming | Short, IUCr/GUM-aligned column headers (`s.u.`, `value`, `95% CI`) with a footnote glossary on every fit table. | [`fit-results-display-naming.md`](accepted/fit-results-display-naming.md) | diff --git a/docs/dev/plans/space-group-database.md b/docs/dev/plans/space-group-database.md index 9710b0561..81346acd6 100644 --- a/docs/dev/plans/space-group-database.md +++ b/docs/dev/plans/space-group-database.md @@ -1,7 +1,7 @@ # Plan: Complete Space-Group Reference Database This plan follows [`AGENTS.md`](../../../AGENTS.md) and implements the -[`space-group-database`](../adrs/suggestions/space-group-database.md) +[`space-group-database`](../adrs/accepted/space-group-database.md) ADR. **Deliberate exception to note for `/draft-impl-1`:** Phase 1 contains a @@ -24,7 +24,7 @@ careful rebuild remains possible from the preserved local workspace. ## ADR This plan owns the ADR -[`docs/dev/adrs/suggestions/space-group-database.md`](../adrs/suggestions/space-group-database.md) +[`docs/dev/adrs/accepted/space-group-database.md`](../adrs/accepted/space-group-database.md) (drafted via `/draft-adr`, review cycle closed). It is a **prerequisite** for [`wyckoff-letter-detection`](../adrs/suggestions/wyckoff-letter-detection.md): @@ -86,7 +86,7 @@ this plan delivers the complete data; that feature delivers the ignored generator (cctbx extraction + multi-source cross-check + disagreement report + overrides consumption). Do not keep this helper in the branch after implementation. -- `docs/dev/adrs/suggestions/space-group-database/space_groups_overrides.yaml` +- `docs/dev/adrs/accepted/space-group-database/space_groups_overrides.yaml` — **new** curation overrides (maintainer-authored at P1.4). Keep the selected values here, not inside this plan: the plan documents workflow, while YAML is the structured generator input with a focused @@ -98,7 +98,7 @@ this plan delivers the complete data; that feature delivers the generated database; **remove** `space_groups.pkl.gz`. - `src/easydiffraction/crystallography/space_groups.py` — rewrite loader (read JSON, reconstruct dict, drop `_RestrictedUnpickler` + `pickle`). -- `docs/dev/adrs/suggestions/space-group-database.md` — fill in _Build +- `docs/dev/adrs/accepted/space-group-database.md` — fill in _Build Provenance_ with recorded versions. - `tools/check_packaged_db.py` — **new** helper that inspects a built wheel (independent of the package's dependency tree): it reads @@ -170,7 +170,7 @@ in this file as part of the same commit. **stops here**. The maintainer inspects the report, consults International Tables for flagged cases, and **always** produces a checked-in - `docs/dev/adrs/suggestions/space-group-database/space_groups_overrides.yaml`: + `docs/dev/adrs/accepted/space-group-database/space_groups_overrides.yaml`: a list of curated records (each with rationale) when there were disagreements, or — if the report was empty because all machine sources agreed — the same file containing only an explanatory From 8a7fc161a36a072efdfa96caea917b82e7b669dd Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 14:55:27 +0200 Subject: [PATCH 02/50] Promote plotting-docs-performance ADR to accepted --- .../plotting-docs-performance.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename docs/dev/adrs/{suggestions => accepted}/plotting-docs-performance.md (97%) diff --git a/docs/dev/adrs/suggestions/plotting-docs-performance.md b/docs/dev/adrs/accepted/plotting-docs-performance.md similarity index 97% rename from docs/dev/adrs/suggestions/plotting-docs-performance.md rename to docs/dev/adrs/accepted/plotting-docs-performance.md index 99d2cf528..1d4cd9a78 100644 --- a/docs/dev/adrs/suggestions/plotting-docs-performance.md +++ b/docs/dev/adrs/accepted/plotting-docs-performance.md @@ -1,6 +1,6 @@ # ADR: Plotting & Docs Performance for Interactive Figures -**Status:** Proposed **Date:** 2026-06-02 +**Status:** Accepted **Date:** 2026-06-02 ## Group @@ -9,8 +9,8 @@ Documentation. > This ADR follows [`AGENTS.md`](../../../../AGENTS.md). It spans the > documentation build (MkDocs) and the display serialization contract, > so it also relates to the User-facing API ADRs -> [`display-ux.md`](../accepted/display-ux.md) and -> [`crysview-structure-visualization.md`](../accepted/crysview-structure-visualization.md). +> [`display-ux.md`](display-ux.md) and +> [`crysview-structure-visualization.md`](crysview-structure-visualization.md). > No public Python API change is intended; the change is in how figure > HTML and its JavaScript runtime are delivered. @@ -29,7 +29,7 @@ appear progressively. 1. Tutorial sources are `docs/docs/tutorials/ed-*.py`; notebooks are generated artifacts (per - [`notebook-generation.md`](../accepted/notebook-generation.md)) and + [`notebook-generation.md`](notebook-generation.md)) and are committed with **outputs stripped** (`notebook-strip`). 2. The docs CI ([`.github/workflows/docs.yml`](../../../../.github/workflows/docs.yml)) @@ -80,7 +80,7 @@ runtime needs, which is the crux of any robust fix: | --------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Live notebook** | `_show_figure` in Jupyter | Runtime must be reachable from the running kernel/browser (today: Plotly via CDN; Three.js inlined). | | **MkDocs site** | executed-notebook HTML embedded by `mkdocs-jupyter` | Wants the runtime loaded **once per page** and figures rendered **lazily**. | -| **Standalone report** | `report/html_renderer.py` → `PlotlyPlotter.serialize_html` / Three.js `render(offline=...)` | Delivery set by the existing `offline` flag — embedded/self-contained when `offline=True`, CDN when `offline=False` (default). Authoritative per [`project-summary-rendering.md`](../accepted/project-summary-rendering.md). | +| **Standalone report** | `report/html_renderer.py` → `PlotlyPlotter.serialize_html` / Three.js `render(offline=...)` | Delivery set by the existing `offline` flag — embedded/self-contained when `offline=True`, CDN when `offline=False` (default). Authoritative per [`project-summary-rendering.md`](project-summary-rendering.md). | A useful precedent already lives in the report renderer ([`src/easydiffraction/report/html_renderer.py`](../../../../src/easydiffraction/report/html_renderer.py)): @@ -157,7 +157,7 @@ delivered together** in one change. Concretely: `include_requirejs` if verification confirms it is no longer needed. 2. **Introduce a figure _embedding mode_** (a `(str, Enum)` per - [`enum-backed-closed-values.md`](../accepted/enum-backed-closed-values.md)) + [`enum-backed-closed-values.md`](enum-backed-closed-values.md)) threaded through `serialize_html` and the Three.js `render`: - `INLINE` — live Jupyter: render eagerly with the runtime reachable as today. **Default.** @@ -196,7 +196,7 @@ delivered together** in one change. Concretely: 4. **Reports keep their existing `offline` contract, authoritative and unchanged.** Per - [`project-summary-rendering.md`](../accepted/project-summary-rendering.md), + [`project-summary-rendering.md`](project-summary-rendering.md), `render_html_report(offline=...)` already decides runtime delivery: `offline=True` embeds a self-contained runtime; `offline=False` (the default) links the CDN, embedding Plotly in the first figure and @@ -366,7 +366,7 @@ inject one shared runtime, and add the lazy loader globally. the resolver with a unit test asserting both the default and the docs-build override. - **Report `offline` contract.** Keep - [`project-summary-rendering.md`](../accepted/project-summary-rendering.md) + [`project-summary-rendering.md`](project-summary-rendering.md) authoritative (Decision 4); the existing `offline=True` / `offline=False` report tests must stay green and gain no `SHARED` behavior. @@ -418,11 +418,11 @@ Settled in discussion on 2026-06-02: payload + faster draw) — a separate, data-side optimization. - A docs CI budget check (page weight / figure count) to catch regressions, aligning with - [`documentation-ci-build.md`](suggestions/documentation-ci-build.md). + [`documentation-ci-build.md`](../suggestions/documentation-ci-build.md). - Hoist a single importmap into the **report** template `` for standalone reports that render multiple Three.js scenes (the same per-scene-importmap bug as docs, but governed by - [`project-summary-rendering.md`](../accepted/project-summary-rendering.md)). + [`project-summary-rendering.md`](project-summary-rendering.md)). Out of scope here since it touches the report contract; flagged so it is not lost. From 07b0baebeea096a52e1a75329b9c58157f45d598 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 14:58:30 +0200 Subject: [PATCH 03/50] Add plotting-docs-performance implementation plan --- docs/dev/plans/plotting-docs-performance.md | 318 ++++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 docs/dev/plans/plotting-docs-performance.md diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md new file mode 100644 index 000000000..ab433daae --- /dev/null +++ b/docs/dev/plans/plotting-docs-performance.md @@ -0,0 +1,318 @@ +# Plan: Plotting & Docs Performance for Interactive Figures + +This plan follows [`AGENTS.md`](../../../AGENTS.md). It applies the +two-phase workflow (Phase 1 implementation, Phase 2 verification) and +the per-step commit discipline described there. No deliberate exceptions +to `AGENTS.md` are taken. + +## ADR + +This plan **owns** the ADR +[`plotting-docs-performance.md`](../adrs/suggestions/plotting-docs-performance.md) +(drafted via `/draft-adr`; Status: Proposed, not yet committed). It also +references these accepted ADRs (no change to them is intended): + +- [`project-summary-rendering.md`](../adrs/accepted/project-summary-rendering.md) + — the report `offline` contract stays authoritative. +- [`crysview-structure-visualization.md`](../adrs/accepted/crysview-structure-visualization.md) + — the Three.js renderer this plan extends. +- [`display-ux.md`](../adrs/accepted/display-ux.md) — display facade. +- [`enum-backed-closed-values.md`](../adrs/accepted/enum-backed-closed-values.md) + — `FigureEmbedMode` is a `(str, Enum)`. +- [`notebook-generation.md`](../adrs/accepted/notebook-generation.md) — + tutorial `.py` are sources, notebooks are generated. + +**For `/draft-impl-1` Phase A:** the ADR is owned by this plan. Remove +the design-phase `plotting-docs-performance_review-*.md` / `_reply-*.md` +siblings, **promote** the ADR (set Status to `Accepted`, `git mv` it to +`docs/dev/adrs/accepted/`), add a matching row to +[`docs/dev/adrs/index.md`](../adrs/index.md) (Group: Documentation), and +commit with message `Promote plotting-docs-performance ADR to accepted`. + +## Branch and PR + +- Intended branch: **`plotting-docs-performance`** (flat slug off + `develop`, no `feature/` prefix). PR targets `develop`. +- Per the shortcut preamble, implementation stays on the **current** + branch; do not switch or create branches. (The working tree is + currently on `space-group-database`; the maintainer decides when to + rebranch.) +- Do not push the branch unless asked. + +## Decisions (from the ADR) + +1. **Self-hosted, pinned, committed runtime snapshots; no runtime CDN.** + Three.js canonical home stays + `src/easydiffraction/display/structure/renderers/vendor/threejs` (the + wheel needs it); its docs **serving** copy is **generated at build** + (git-ignored) by a new `docs-sync-vendored-js` task. The Plotly + `plotly-cartesian` partial bundle is **docs-only** and **committed** + under `docs/docs/assets/javascripts/vendor/plotly/`. +2. **`FigureEmbedMode` `(str, Enum)`** — `INLINE` (live Jupyter, + default), `SHARED` (docs: placeholder + JSON payload + lazy), and + `STANDALONE` (reports: eager fragment, delivery via existing + `offline` flag). Resolved centrally from + `EASYDIFFRACTION_FIGURE_EMBED_MODE` in `utils/environment.py`. +3. **One shared `ed-figures.js`** loaded once per page: lazy + `IntersectionObserver` activation behind a themed "Loading…" + skeleton, plus centralized theme-sync / resize / legend logic. +4. **Reports unchanged** — keep the `offline` contract from + `project-summary-rendering.md`; `SHARED`/lazy is docs-only. +5. **`tools/bump_vendored_js.py` + `vendor-update-js` task** — pinned + table (versions, URLs, SHA-256), `pooch` fetch with `known_hash`, + regenerates each `LICENSES.md`, `--check` drift mode. No new + dependency (`pooch` already present). +6. **Page-level Three.js importmap** injected via + `{% block extrahead %}` in `docs/overrides/main.html`, paths resolved + against `{{ base_url }}`; `SHARED` scenes drop their per-scene + importmap. + +## No new dependencies + +This plan adds **no** Python runtime or dev dependency. `plotly` and +`pooch` are already declared; Three.js and the Plotly partial bundle are +**vendored static JS assets**, not packages. Edits to `pixi.toml` are +**task definitions only** (not `[dependencies]`/`[pypi-dependencies]`), +and `pyproject.toml` is **not** modified. If any Phase 2 fix appears to +need a new dependency, stop and ask per `AGENTS.md` §Planning. + +## Open questions (leans recorded; resolve during implementation) + +1. **Activation trigger.** Scroll-near lazy only (lean: yes); + click-to-activate deferred unless a page proves pathological. +2. **RequireJS.** Keep `include_requirejs: true` through Phase 1; in + Phase 2, after confirming the self-hosted `include_plotlyjs=False` + output renders under `mkdocs-jupyter`, remove it. If removal breaks + rendering, keep it and note why. + +## Concrete files likely to change + +**Source (`src/`)** + +- `utils/environment.py` — add `FigureEmbedMode` enum + + `resolve_figure_embed_mode()` (reads + `EASYDIFFRACTION_FIGURE_EMBED_MODE`, default `INLINE`, validated to + the enum). +- `utils/__init__.py` — export the new symbols if they need to be + public. +- `display/plotters/plotly.py` — thread mode through `serialize_html` + and `_show_figure`; `SHARED` emits placeholder + `application/json` + payload + `data-ed-figure` hook with `include_plotlyjs=False` and no + per-figure post-scripts; `INLINE`/`STANDALONE` keep current output. +- `display/structure/renderers/threejs.py` + + `display/structure/templates/structure.html.j2` — add mode; `SHARED` + drops the per-scene importmap (bare specifiers), emits a placeholder + + `data-ed-figure` lazy boot; `STANDALONE` keeps the inline data-URL + importmap. +- `display/structure/viewing.py` — pass the resolved mode into + `render(...)`. +- `report/html_renderer.py` — pass `STANDALONE` explicitly in + `_fit_figure_html_context` / `_structure_figure_html_context`, + preserving the `offline` contract. + +**Docs (`docs/`)** + +- `docs/docs/assets/javascripts/ed-figures.js` — new shared loader. +- `docs/docs/assets/javascripts/vendor/plotly/plotly-cartesian.min.js` + - `LICENSES.md` — committed vendored Plotly bundle. +- `docs/docs/assets/javascripts/vendor/threejs/` — **generated** + (git-ignored) docs copy of the canonical Three.js. +- `docs/docs/assets/stylesheets/extra.css` — skeleton placeholder + styles. +- `docs/mkdocs.yml` — `extra_javascript` (Plotly bundle + + `ed-figures.js`), `extra_css` if separate; RequireJS removal in + Phase 2. +- `docs/overrides/main.html` — `{% block extrahead %}` importmap. + +**Tooling / build** + +- `tools/bump_vendored_js.py` — new bump/`--check` script. +- `pixi.toml` — new `vendor-update-js` and `docs-sync-vendored-js` + tasks; wire `docs-sync-vendored-js` as `depends-on` of `docs-build` + and `docs-serve`; set `EASYDIFFRACTION_FIGURE_EMBED_MODE=shared` on + `notebook-exec-ci` and `notebook-exec`. +- `.gitignore` — ignore the generated + `docs/docs/assets/javascripts/vendor/threejs/`. +- `.github/workflows/docs.yml` — run `docs-sync-vendored-js` before + `mkdocs build` (belt-and-braces with the `depends-on`). +- `src/.../vendor/threejs/LICENSES.md` — regenerated by the bump script. + +## Implementation steps (Phase 1) + +Phase 1 is **code and docs only — no tests** (tests are added in Phase +2). After completing each step, stage the step's files **with explicit +paths** and commit locally with the given message **before** starting +the next step (per `AGENTS.md` §Commits). Keep commits atomic and +single-purpose. If a step uncovers a serious design gap or a need for a +dependency the plan does not name, **stop and ask**. + +- [ ] **P1.1 — Add `FigureEmbedMode` enum and env resolver.** In + `utils/environment.py`, add the `(str, Enum)` with `INLINE` / + `SHARED` / `STANDALONE` and `resolve_figure_embed_mode()` reading + `EASYDIFFRACTION_FIGURE_EMBED_MODE`. **Strict validation:** an + unset or empty variable resolves to `INLINE`; any other non-empty + value that is not an enum member raises a clear `ValueError` + naming the bad value and listing the supported values (`inline`, + `shared`, `standalone`) — never a silent fallback, so a typo in a + docs/CI env fails the build loudly instead of baking eager CDN + HTML. Export from `utils/__init__.py` if needed. Commit: + `Add FigureEmbedMode enum and env resolver` + +- [ ] **P1.2 — Add the vendored-JS bump script and task.** Create + `tools/bump_vendored_js.py` (pinned table of Plotly + Three.js + versions/URLs/SHA-256, `pooch` fetch with `known_hash`, regenerate + `LICENSES.md`, `--check` mode). Add the `vendor-update-js` pixi + task. Do not run network fetches in CI/tests. Commit: + `Add vendored-JS bump script and pixi task` + +- [ ] **P1.3 — Vendor Plotly and refresh Three.js.** Run + `pixi run vendor-update-js` to fetch `plotly-cartesian.min.js` + into the committed docs vendor dir and refresh the Three.js + snapshot + regenerate both `LICENSES.md`. Stage the vendored + assets explicitly. Commit: + `Vendor plotly-cartesian and refresh three.js` + +- [ ] **P1.4 — Add `docs-sync-vendored-js` and wire it.** Add the pixi + task copying canonical Three.js → + `docs/docs/assets/javascripts/ vendor/threejs/`; git-ignore that + path; add `depends-on` on `docs-build` and `docs-serve`; add a + sync step before `mkdocs build` in `docs.yml`. Commit: + `Add docs-sync-vendored-js task and wiring` + +- [ ] **P1.5 — Add the shared `ed-figures.js` loader + skeleton CSS.** + Implement `IntersectionObserver` lazy activation for + `data-ed-figure` placeholders (Plotly `newPlot` + Three.js boot), + centralized theme-sync / resize / legend logic, eager fallback + when no observer or when printing; add the "Loading…" skeleton + styles to `extra.css`. Commit: + `Add shared ed-figures.js lazy figure loader` + +- [ ] **P1.6 — Wire docs runtime assets and the page importmap.** Add + the Plotly bundle + `ed-figures.js` to `extra_javascript` (and + skeleton CSS to `extra_css` if separate) in `mkdocs.yml`; add the + `{% block extrahead %}` importmap to `overrides/main.html`. (Leave + `include_requirejs` in place for now — Phase 2 removes it.) + Commit: `Wire docs runtime assets and page importmap` + +- [ ] **P1.7 — Add `SHARED` mode to the Plotly serializer.** Thread the + mode through `serialize_html` and `_show_figure`; in `SHARED` emit + placeholder + `application/json` payload + `data-ed-figure`, + `include_plotlyjs=False`, no per-figure post-scripts. + `_show_figure` resolves the mode via + `resolve_figure_embed_mode()`. Commit: + `Add SHARED embedding mode to Plotly serializer` + +- [ ] **P1.8 — Add `SHARED` mode to the Three.js renderer.** Thread the + mode through `render(...)` (`viewing.py` + `threejs.py`) and + `structure.html.j2`; `SHARED` drops the per-scene importmap (bare + specifiers) and emits a placeholder + lazy boot; `STANDALONE` + keeps the inline data-URL importmap. Commit: + `Add SHARED embedding mode to Three.js renderer` + +- [ ] **P1.9 — Pass `STANDALONE` from the report renderer.** Update + `report/html_renderer.py` to pass `STANDALONE` into + `serialize_html` / `render`, preserving the `offline` contract + exactly. Commit: `Pass STANDALONE mode from report renderer` + +- [ ] **P1.10 — Route docs notebook execution to `SHARED`.** Set + `EASYDIFFRACTION_FIGURE_EMBED_MODE=shared` on `notebook-exec-ci` + and `notebook-exec` in `pixi.toml`. This is the switch that makes + baked cell HTML carry `SHARED` output; live Jupyter stays + `INLINE`. Commit: `Route docs notebook execution to SHARED mode` + +- [ ] **P1.11 — Phase 1 review gate (no code).** Mark this item `[x]`, + commit the checklist update alone, then hand off to + `/review-impl-1`. Commit: `Reach Phase 1 review gate` + +## Verification (Phase 2) + +Add/update tests first (mirroring the source tree; verify with +`pixi run test-structure-check`), then run the task suite. Capture logs +with the zsh-safe pattern and preserve the exit code. + +**Tests to add/update** + +- `tests/unit/easydiffraction/utils/test_environment*.py` — + `resolve_figure_embed_mode()`: unset/empty → `INLINE`; `shared` → + `SHARED`; `standalone` → `STANDALONE`; and an unknown non-empty value + raises `ValueError` whose message contains both the bad value and the + supported values. +- `tests/unit/easydiffraction/display/plotters/test_plotly*.py` — + `SHARED` output contains the placeholder + `application/json` + payload + `data-ed-figure`, **no** inline Plotly runtime and **no** + per-figure post-scripts; `INLINE`/`STANDALONE` output unchanged. +- `tests/unit/easydiffraction/display/structure/renderers/test_threejs*.py` + — `SHARED` emits bare-specifier bootstrap and **no** per-scene + importmap; `STANDALONE`/offline keeps the inline importmap. +- Report tests — existing `offline=True`/`offline=False` behavior stays + green and now asserts `STANDALONE` is used. +- A `tools/` test for `bump_vendored_js.py --check` drift detection (no + network — monkeypatch/`pooch` fixture), mirroring + `tools/test_structure_check.py`. + +**Trace-type audit** — confirm no WebGL/3D/map trace types are used +anywhere; if any are found, switch the vendored bundle from +`plotly-cartesian` to the full bundle and re-vendor. Run this single +line: + +```bash +git grep -nE "go\.(Scattergl|Scatter3d|Surface|Mesh3d|Cone|Streamtube|Volume|Isosurface|Scattermapbox|Choroplethmapbox|Densitymapbox|Scattergeo|Choropleth)" -- src docs || echo "no gl/3d/map traces; plotly-cartesian suffices" +``` + +**RequireJS** — after confirming docs render with the self-hosted +`include_plotlyjs=False` output, remove `include_requirejs: true` from +`mkdocs.yml` (open question 2). Commit separately. + +**Command suite** (run in order; fix → commit → re-run until clean): + +```bash +pixi run fix +pixi run test-structure-check > /tmp/easydiffraction-structure.log 2>&1; structure_check_exit_code=$?; tail -n 200 /tmp/easydiffraction-structure.log; exit $structure_check_exit_code +pixi run check > /tmp/easydiffraction-check.log 2>&1; check_exit_code=$?; tail -n 200 /tmp/easydiffraction-check.log; exit $check_exit_code +pixi run unit-tests > /tmp/easydiffraction-unit.log 2>&1; unit_tests_exit_code=$?; tail -n 200 /tmp/easydiffraction-unit.log; exit $unit_tests_exit_code +pixi run integration-tests > /tmp/easydiffraction-integration.log 2>&1; integration_tests_exit_code=$?; tail -n 200 /tmp/easydiffraction-integration.log; exit $integration_tests_exit_code +pixi run script-tests > /tmp/easydiffraction-script.log 2>&1; script_tests_exit_code=$?; tail -n 200 /tmp/easydiffraction-script.log; exit $script_tests_exit_code +``` + +**Docs build smoke** (not a unit test — confirms sync + importmap + +assets resolve, and that figures lazy-load): + +```bash +pixi run docs-sync-vendored-js && pixi run docs-build-local > /tmp/easydiffraction-docs.log 2>&1; docs_exit_code=$?; tail -n 120 /tmp/easydiffraction-docs.log; exit $docs_exit_code +``` + +Notes: `pixi run fix` regenerates `docs/dev/package-structure/*.md` +automatically — accept and include them. Leave generated benchmark CSVs +and `docs/site/` untracked. For tutorial project-path collisions in +`script-tests`, fix the tutorial **source** and +`pixi run notebook-prepare`. + +## Status checklist + +- [ ] Phase 1 complete (P1.1–P1.11 committed) +- [ ] Phase 1 review cycle closed (`/review-impl-1` sentinel) +- [ ] Phase 2 tests added; `test-structure-check` + the five task + commands clean +- [ ] Docs build smoke passes; figures load lazily +- [ ] RequireJS decision applied +- [ ] Phase 2 review cycle closed (`/review-impl-2` sentinel) +- [ ] ADR promoted to `accepted/` and indexed +- [ ] PR opened against `develop` + +## Suggested Pull Request + +**Title:** Faster, progressively-loading tutorial and documentation +pages + +**Description (for users):** Documentation pages that contain many +interactive charts — especially the tutorials — now become usable almost +immediately instead of pausing for several seconds while every plot +draws at once. Plots now appear progressively as you scroll, each +showing a brief "Loading…" placeholder, and they stay **fully +interactive** as before. The charting libraries (Plotly and the 3D +structure viewer) are now served directly from the documentation site +rather than fetched from external servers, so pages also load reliably +on restricted or slow institutional networks and keep working for older, +archived documentation versions. A simple maintenance command keeps +those bundled libraries up to date. Nothing changes about how tutorials +are written. From 54d27f52bbaec4d5f0404225734cedbf845b5d5a Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:00:23 +0200 Subject: [PATCH 04/50] Add FigureEmbedMode enum and env resolver --- docs/dev/plans/plotting-docs-performance.md | 2 +- src/easydiffraction/utils/environment.py | 58 +++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index ab433daae..8bff7266a 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -146,7 +146,7 @@ the next step (per `AGENTS.md` §Commits). Keep commits atomic and single-purpose. If a step uncovers a serious design gap or a need for a dependency the plan does not name, **stop and ask**. -- [ ] **P1.1 — Add `FigureEmbedMode` enum and env resolver.** In +- [x] **P1.1 — Add `FigureEmbedMode` enum and env resolver.** In `utils/environment.py`, add the `(str, Enum)` with `INLINE` / `SHARED` / `STANDALONE` and `resolve_figure_embed_mode()` reading `EASYDIFFRACTION_FIGURE_EMBED_MODE`. **Strict validation:** an diff --git a/src/easydiffraction/utils/environment.py b/src/easydiffraction/utils/environment.py index 0fd35ce0c..525c6c1e7 100644 --- a/src/easydiffraction/utils/environment.py +++ b/src/easydiffraction/utils/environment.py @@ -6,11 +6,13 @@ import os import sys import tempfile +from enum import Enum from importlib.util import find_spec from pathlib import Path _ARTIFACT_ROOT_ENV_VAR = 'EASYDIFFRACTION_ARTIFACT_ROOT' _PIXI_PROJECT_ROOT_ENV_VAR = 'PIXI_PROJECT_ROOT' +_FIGURE_EMBED_MODE_ENV_VAR = 'EASYDIFFRACTION_FIGURE_EMBED_MODE' _TUTORIALS_DIR = Path('docs') / 'docs' / 'tutorials' _TUTORIAL_ARTIFACT_ROOT = Path('tmp') / 'tutorials' @@ -201,6 +203,62 @@ def create_artifact_temp_dir(prefix: str) -> Path: return Path(tempfile.mkdtemp(prefix=prefix, dir=artifact_root)).resolve() +# ---------------------------------------------------------------------- +# Figure embedding mode +# ---------------------------------------------------------------------- + + +class FigureEmbedMode(str, Enum): + """ + How interactive figure HTML embeds its JavaScript runtime. + + ``INLINE`` renders eagerly for live Jupyter; ``SHARED`` emits a lazy + placeholder activated by a once-per-page shared runtime for the docs + site; ``STANDALONE`` renders an eager self-contained fragment for + reports, with runtime delivery decided by the caller's ``offline`` + flag. + """ + + INLINE = 'inline' + SHARED = 'shared' + STANDALONE = 'standalone' + + +def resolve_figure_embed_mode() -> FigureEmbedMode: + """ + Resolve the active figure embedding mode from the environment. + + Reads ``EASYDIFFRACTION_FIGURE_EMBED_MODE``. An unset or empty value + resolves to :attr:`FigureEmbedMode.INLINE`. Any other value must + name a supported mode; an unknown value raises ``ValueError`` so a + typo in a docs or CI environment fails the build loudly instead of + silently falling back to eager output. + + Returns + ------- + FigureEmbedMode + The resolved embedding mode. + + Raises + ------ + ValueError + If the variable is set to a non-empty value that is not a + supported mode. + """ + raw = os.environ.get(_FIGURE_EMBED_MODE_ENV_VAR, '').strip() + if not raw: + return FigureEmbedMode.INLINE + try: + return FigureEmbedMode(raw.lower()) + except ValueError: + supported = ', '.join(mode.value for mode in FigureEmbedMode) + message = ( + f'Invalid {_FIGURE_EMBED_MODE_ENV_VAR}={raw!r}; ' + f'supported values: {supported}.' + ) + raise ValueError(message) from None + + # ---------------------------------------------------------------------- # IPython/Jupyter helpers # ---------------------------------------------------------------------- From 06437d10f44f56c24f40b3ad7f8371ad373cad58 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:04:46 +0200 Subject: [PATCH 05/50] Add vendored-JS bump script and pixi task --- docs/dev/plans/plotting-docs-performance.md | 2 +- pixi.toml | 6 + tools/bump_vendored_js.py | 259 ++++++++++++++++++++ 3 files changed, 266 insertions(+), 1 deletion(-) create mode 100644 tools/bump_vendored_js.py diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 8bff7266a..c687d13ca 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -158,7 +158,7 @@ dependency the plan does not name, **stop and ask**. HTML. Export from `utils/__init__.py` if needed. Commit: `Add FigureEmbedMode enum and env resolver` -- [ ] **P1.2 — Add the vendored-JS bump script and task.** Create +- [x] **P1.2 — Add the vendored-JS bump script and task.** Create `tools/bump_vendored_js.py` (pinned table of Plotly + Three.js versions/URLs/SHA-256, `pooch` fetch with `known_hash`, regenerate `LICENSES.md`, `--check` mode). Add the `vendor-update-js` pixi diff --git a/pixi.toml b/pixi.toml index feecdfb53..4e56bace6 100644 --- a/pixi.toml +++ b/pixi.toml @@ -221,6 +221,12 @@ docs-set-default-pre = 'mike set-default -F docs/mkdocs.yml --push --branch gh-p docs-update-assets = 'python tools/update_docs_assets.py' +# Vendored JavaScript runtimes (Plotly cartesian bundle + Three.js). +# vendor-update-js re-fetches the pinned versions; vendor-check-js is a +# no-network drift guard for CI. +vendor-update-js = 'python tools/bump_vendored_js.py' +vendor-check-js = 'python tools/bump_vendored_js.py --check' + ############################## # 📦 Template Management Tasks ############################## diff --git a/tools/bump_vendored_js.py b/tools/bump_vendored_js.py new file mode 100644 index 000000000..9c0fdcbbd --- /dev/null +++ b/tools/bump_vendored_js.py @@ -0,0 +1,259 @@ +""" +Bump or verify the vendored JavaScript runtimes. + +Fetches the pinned Plotly and Three.js assets from jsDelivr with +integrity checks, writes them into their canonical vendor folders, and +regenerates each folder's ``LICENSES.md``. With ``--check`` it re-hashes +the already-vendored files against the pinned table and writes nothing +(a CI drift guard); no network access is used in that mode. + +The pinned table below is the single source of truth for the vendored +runtime versions. To bump a runtime: change its ``version``, the asset +URLs, and the expected ``sha256`` hashes, then run +``pixi run vendor-update-js``. +""" + +from __future__ import annotations + +import argparse +import hashlib +import shutil +import sys +from dataclasses import dataclass +from pathlib import Path + +import pooch + +_REPO_ROOT = Path(__file__).resolve().parent.parent +_CACHE_DIR = Path.home() / '.cache' / 'easydiffraction-vendored-js' + + +@dataclass(frozen=True) +class VendoredAsset: + """One vendored file: its name, source URL, and expected hash.""" + + filename: str + url: str + sha256: str + + +@dataclass(frozen=True) +class VendoredRuntime: + """A pinned runtime vendored as one or more files in one folder.""" + + name: str + package: str + version: str + dest_dir: Path + licence: str + assets: tuple[VendoredAsset, ...] + + +THREEJS = VendoredRuntime( + name='Three.js', + package='three', + version='0.160.0', + dest_dir=Path('src/easydiffraction/display/structure/renderers/vendor/threejs'), + licence=( + 'MIT — Copyright © 2010-2024 three.js authors. ' + 'See `https://github.com/mrdoob/three.js/blob/dev/LICENSE`.' + ), + assets=( + VendoredAsset( + 'three.module.js', + 'https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js', + '76dea8151bc9352aef3528b4262e249b2604f62543828328db978d060d61a495', + ), + VendoredAsset( + 'OrbitControls.js', + 'https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/controls/OrbitControls.js', + '5a44a9e86a2a0fb11933eed69bc2cd33c76a496854c1aed6ed776efa87d7b064', + ), + VendoredAsset( + 'CSS2DRenderer.js', + 'https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/renderers/CSS2DRenderer.js', + 'a4f0f79184c043f6b9d2654d8ba051e49a7d631d34e8f437c1804798a68c379f', + ), + ), +) + +PLOTLY = VendoredRuntime( + name='Plotly.js (cartesian bundle)', + package='plotly.js', + version='3.5.0', + dest_dir=Path('docs/docs/assets/javascripts/vendor/plotly'), + licence=( + 'MIT — Copyright 2012-2026 Plotly, Inc. ' + 'See `https://github.com/plotly/plotly.js/blob/master/LICENSE`.' + ), + assets=( + VendoredAsset( + 'plotly-cartesian.min.js', + 'https://cdn.jsdelivr.net/npm/plotly.js@3.5.0/dist/plotly-cartesian.min.js', + '65248e65cd56530272d19ff7ef12cb849228f4464001f3f67cbb2b95adb22443', + ), + ), +) + +RUNTIMES: tuple[VendoredRuntime, ...] = (THREEJS, PLOTLY) + + +def _sha256(path: Path) -> str: + """ + Return the SHA-256 hex digest of a file. + + Parameters + ---------- + path : Path + File to hash. + + Returns + ------- + str + The hex digest. + """ + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def _license_text(runtime: VendoredRuntime) -> str: + """ + Render the ``LICENSES.md`` content for a vendored runtime. + + Parameters + ---------- + runtime : VendoredRuntime + The runtime whose vendored files to document. + + Returns + ------- + str + The full markdown content. + """ + rows = '\n'.join(f'| `{asset.filename}` | `{asset.url}` |' for asset in runtime.assets) + return ( + f'# Vendored {runtime.name}\n\n' + f'Pinned, bundled snapshot fetched verbatim from jsDelivr ' + f'(npm `{runtime.package}@{runtime.version}`). Generated by ' + f'`tools/bump_vendored_js.py`; do not edit by hand — replace only ' + f'by re-fetching the pinned version with `pixi run vendor-update-js`.\n\n' + f'| File | Source URL |\n| --- | --- |\n{rows}\n\n' + f'**Version:** {runtime.version}.\n\n' + f'**Licence:** {runtime.licence}\n\n' + f'These are upstream snapshots, not project-owned code: they are ' + f'excluded from linting, formatting, coverage, and test-structure ' + f'mirroring in `pyproject.toml`.\n' + ) + + +def _bump_runtime(runtime: VendoredRuntime) -> None: + """ + Fetch a runtime's assets and regenerate its ``LICENSES.md``. + + Parameters + ---------- + runtime : VendoredRuntime + The runtime to fetch and write. + """ + dest_dir = _REPO_ROOT / runtime.dest_dir + dest_dir.mkdir(parents=True, exist_ok=True) + for asset in runtime.assets: + fetched = pooch.retrieve( + url=asset.url, + known_hash=f'sha256:{asset.sha256}', + fname=asset.filename, + path=_CACHE_DIR, + ) + shutil.copy2(fetched, dest_dir / asset.filename) + print(f' wrote {runtime.dest_dir / asset.filename}') + (dest_dir / 'LICENSES.md').write_text(_license_text(runtime), encoding='utf-8') + print(f' wrote {runtime.dest_dir / "LICENSES.md"}') + + +def _check_runtime(runtime: VendoredRuntime) -> list[str]: + """ + Return drift messages for a runtime's vendored files. + + Parameters + ---------- + runtime : VendoredRuntime + The runtime to verify. + + Returns + ------- + list[str] + One message per missing or mismatched file; empty when clean. + """ + problems: list[str] = [] + dest_dir = _REPO_ROOT / runtime.dest_dir + for asset in runtime.assets: + path = dest_dir / asset.filename + if not path.is_file(): + problems.append(f'missing: {runtime.dest_dir / asset.filename}') + continue + actual = _sha256(path) + if actual != asset.sha256: + problems.append( + f'hash drift: {runtime.dest_dir / asset.filename} ' + f'(expected {asset.sha256}, actual {actual})' + ) + return problems + + +def bump() -> int: + """ + Fetch and write every pinned runtime. + + Returns + ------- + int + Process exit code (always ``0``; integrity failures raise). + """ + for runtime in RUNTIMES: + print(f'{runtime.name} {runtime.version}:') + _bump_runtime(runtime) + print('Done. Stage and commit the refreshed vendored files.') + return 0 + + +def check() -> int: + """ + Verify vendored files match the pinned hashes. + + Returns + ------- + int + ``0`` when every file matches, ``1`` on any drift. + """ + problems: list[str] = [] + for runtime in RUNTIMES: + problems.extend(_check_runtime(runtime)) + if problems: + print('Vendored JS drift detected:') + for problem in problems: + print(f' {problem}') + return 1 + print('Vendored JS matches the pinned table.') + return 0 + + +def main() -> int: + """ + Parse arguments and run the bump or check workflow. + + Returns + ------- + int + Process exit code. + """ + parser = argparse.ArgumentParser(description='Bump or verify vendored JS runtimes.') + parser.add_argument( + '--check', + action='store_true', + help='Verify vendored files against the pinned hashes (no network, no writes).', + ) + args = parser.parse_args() + return check() if args.check else bump() + + +if __name__ == '__main__': + sys.exit(main()) From 7f75ffa2b8fbbb92d64e28cfed73f77a31dfb79a Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:06:09 +0200 Subject: [PATCH 06/50] Vendor plotly-cartesian and refresh three.js --- docs/dev/plans/plotting-docs-performance.md | 2 +- .../javascripts/vendor/plotly/LICENSES.md | 13 ++ .../vendor/plotly/plotly-cartesian.min.js | 146 ++++++++++++++++++ .../renderers/vendor/threejs/LICENSES.md | 14 +- 4 files changed, 164 insertions(+), 11 deletions(-) create mode 100644 docs/docs/assets/javascripts/vendor/plotly/LICENSES.md create mode 100644 docs/docs/assets/javascripts/vendor/plotly/plotly-cartesian.min.js diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index c687d13ca..e1d673871 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -165,7 +165,7 @@ dependency the plan does not name, **stop and ask**. task. Do not run network fetches in CI/tests. Commit: `Add vendored-JS bump script and pixi task` -- [ ] **P1.3 — Vendor Plotly and refresh Three.js.** Run +- [x] **P1.3 — Vendor Plotly and refresh Three.js.** Run `pixi run vendor-update-js` to fetch `plotly-cartesian.min.js` into the committed docs vendor dir and refresh the Three.js snapshot + regenerate both `LICENSES.md`. Stage the vendored diff --git a/docs/docs/assets/javascripts/vendor/plotly/LICENSES.md b/docs/docs/assets/javascripts/vendor/plotly/LICENSES.md new file mode 100644 index 000000000..c91dbed37 --- /dev/null +++ b/docs/docs/assets/javascripts/vendor/plotly/LICENSES.md @@ -0,0 +1,13 @@ +# Vendored Plotly.js (cartesian bundle) + +Pinned, bundled snapshot fetched verbatim from jsDelivr (npm `plotly.js@3.5.0`). Generated by `tools/bump_vendored_js.py`; do not edit by hand — replace only by re-fetching the pinned version with `pixi run vendor-update-js`. + +| File | Source URL | +| --- | --- | +| `plotly-cartesian.min.js` | `https://cdn.jsdelivr.net/npm/plotly.js@3.5.0/dist/plotly-cartesian.min.js` | + +**Version:** 3.5.0. + +**Licence:** MIT — Copyright 2012-2026 Plotly, Inc. See `https://github.com/plotly/plotly.js/blob/master/LICENSE`. + +These are upstream snapshots, not project-owned code: they are excluded from linting, formatting, coverage, and test-structure mirroring in `pyproject.toml`. diff --git a/docs/docs/assets/javascripts/vendor/plotly/plotly-cartesian.min.js b/docs/docs/assets/javascripts/vendor/plotly/plotly-cartesian.min.js new file mode 100644 index 000000000..7b6d7d2f4 --- /dev/null +++ b/docs/docs/assets/javascripts/vendor/plotly/plotly-cartesian.min.js @@ -0,0 +1,146 @@ +/** +* plotly.js (cartesian - minified) v3.5.0 +* Copyright 2012-2026, Plotly, Inc. +* All rights reserved. +* Licensed under the MIT license +*/ +( + function(root, factory) { + if (typeof module === "object" && module.exports) { + module.exports = factory(); + } else { + root.moduleName = factory(); + } +} (typeof self !== "undefined" ? self : this, () => { +"use strict";var Plotly=(()=>{var ooe=Object.defineProperty,loe=Object.defineProperties;var soe=Object.getOwnPropertyDescriptors;var J8=Object.getOwnPropertySymbols;var uoe=Object.prototype.hasOwnProperty,foe=Object.prototype.propertyIsEnumerable;var $8=(e,r,t)=>r in e?ooe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ks=(e,r)=>{for(var t in r||(r={}))uoe.call(r,t)&&$8(e,t,r[t]);if(J8)for(var t of J8(r))foe.call(r,t)&&$8(e,t,r[t]);return e},yp=(e,r)=>loe(e,soe(r));var N=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var mp=N(K8=>{"use strict";K8.version="3.5.0"});var eM=N((Q8,gp)=>{(function(r,t,a){t[r]=t[r]||a(),typeof gp!="undefined"&&gp.exports&&(gp.exports=t[r])})("Promise",typeof window!="undefined"?window:Q8,function(){"use strict";var r,t,a,n=Object.prototype.toString,i=typeof setImmediate!="undefined"?function(T){return setImmediate(T)}:setTimeout;try{Object.defineProperty({},"x",{}),r=function(T,_,b,w){return Object.defineProperty(T,_,{value:b,writable:!0,configurable:w!==!1})}}catch(x){r=function(_,b,w){return _[b]=w,_}}a=function(){var T,_,b;function w(k,M){this.fn=k,this.self=M,this.next=void 0}return{add:function(M,q){b=new w(M,q),_?_.next=b:T=b,_=b,b=void 0},drain:function(){var M=T;for(T=_=t=void 0;M;)M.fn.call(M.self),M=M.next}}}();function o(x,T){a.add(x,T),t||(t=i(a.drain))}function l(x){var T,_=typeof x;return x!=null&&(_=="object"||_=="function")&&(T=x.then),typeof T=="function"?T:!1}function s(){for(var x=0;x0&&o(s,_))}catch(b){c.call(new d(_),b)}}}function c(x){var T=this;T.triggered||(T.triggered=!0,T.def&&(T=T.def),T.msg=x,T.state=2,T.chain.length>0&&o(s,T))}function v(x,T,_,b){for(var w=0;w{(function(){var e={version:"3.8.2"},r=[].slice,t=function(h){return r.call(h)},a=self.document;function n(h){return h&&(h.ownerDocument||h.document||h).documentElement}function i(h){return h&&(h.ownerDocument&&h.ownerDocument.defaultView||h.document&&h||h.defaultView)}if(a)try{t(a.documentElement.childNodes)[0].nodeType}catch(h){t=function(g){for(var A=g.length,S=new Array(A);A--;)S[A]=g[A];return S}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(h){var o=this.Element.prototype,l=o.setAttribute,s=o.setAttributeNS,u=this.CSSStyleDeclaration.prototype,f=u.setProperty;o.setAttribute=function(g,A){l.call(this,g,A+"")},o.setAttributeNS=function(g,A,S){s.call(this,g,A,S+"")},u.setProperty=function(g,A,S){f.call(this,g,A+"",S)}}e.ascending=c;function c(h,g){return hg?1:h>=g?0:NaN}e.descending=function(h,g){return gh?1:g>=h?0:NaN},e.min=function(h,g){var A=-1,S=h.length,L,C;if(arguments.length===1){for(;++A=C){L=C;break}for(;++AC&&(L=C)}else{for(;++A=C){L=C;break}for(;++AC&&(L=C)}return L},e.max=function(h,g){var A=-1,S=h.length,L,C;if(arguments.length===1){for(;++A=C){L=C;break}for(;++AL&&(L=C)}else{for(;++A=C){L=C;break}for(;++AL&&(L=C)}return L},e.extent=function(h,g){var A=-1,S=h.length,L,C,O;if(arguments.length===1){for(;++A=C){L=O=C;break}for(;++AC&&(L=C),O=C){L=O=C;break}for(;++AC&&(L=C),O1)return O/(U-1)},e.deviation=function(){var h=e.variance.apply(this,arguments);return h&&Math.sqrt(h)};function p(h){return{left:function(g,A,S,L){for(arguments.length<3&&(S=0),arguments.length<4&&(L=g.length);S>>1;h(g[C],A)<0?S=C+1:L=C}return S},right:function(g,A,S,L){for(arguments.length<3&&(S=0),arguments.length<4&&(L=g.length);S>>1;h(g[C],A)>0?L=C:S=C+1}return S}}}var y=p(c);e.bisectLeft=y.left,e.bisect=e.bisectRight=y.right,e.bisector=function(h){return p(h.length===1?function(g,A){return c(h(g),A)}:h)},e.shuffle=function(h,g,A){(S=arguments.length)<3&&(A=h.length,S<2&&(g=0));for(var S=A-g,L,C;S;)C=Math.random()*S--|0,L=h[S+g],h[S+g]=h[C+g],h[C+g]=L;return h},e.permute=function(h,g){for(var A=g.length,S=new Array(A);A--;)S[A]=h[g[A]];return S},e.pairs=function(h){for(var g=0,A=h.length-1,S,L=h[0],C=new Array(A<0?0:A);g=0;)for(O=h[g],A=O.length;--A>=0;)C[--L]=O[A];return C};var x=Math.abs;e.range=function(h,g,A){if(arguments.length<3&&(A=1,arguments.length<2&&(g=h,h=0)),(g-h)/A===1/0)throw new Error("infinite range");var S=[],L=T(x(A)),C=-1,O;if(h*=L,g*=L,A*=L,A<0)for(;(O=h+A*++C)>g;)S.push(O/L);else for(;(O=h+A*++C)=g.length)return L?L.call(h,U):S?U.sort(S):U;for(var $=-1,re=U.length,te=g[J++],_e,ke,ae,pe=new b,ge;++$=g.length)return F;var J=[],$=A[U++];return F.forEach(function(re,te){J.push({key:re,values:O(te,U)})}),$?J.sort(function(re,te){return $(re.key,te.key)}):J}return h.map=function(F,U){return C(U,F,0)},h.entries=function(F){return O(C(e.map,F,0),0)},h.key=function(F){return g.push(F),h},h.sortKeys=function(F){return A[g.length-1]=F,h},h.sortValues=function(F){return S=F,h},h.rollup=function(F){return L=F,h},h},e.set=function(h){var g=new I;if(h)for(var A=0,S=h.length;A=0&&(S=h.slice(A+1),h=h.slice(0,A)),h)return arguments.length<2?this[h].on(S):this[h].on(S,g);if(arguments.length===2){if(g==null)for(h in this)this.hasOwnProperty(h)&&this[h].on(S,null);return this}};function j(h){var g=[],A=new b;function S(){for(var L=g,C=-1,O=L.length,F;++C=0&&(A=h.slice(0,g))!=="xmlns"&&(h=h.slice(g+1)),le.hasOwnProperty(A)?{space:le[A],local:h}:h}},ye.attr=function(h,g){if(arguments.length<2){if(typeof h=="string"){var A=this.node();return h=e.ns.qualify(h),h.local?A.getAttributeNS(h.space,h.local):A.getAttribute(h)}for(g in h)this.each(ve(g,h[g]));return this}return this.each(ve(h,g))};function ve(h,g){h=e.ns.qualify(h);function A(){this.removeAttribute(h)}function S(){this.removeAttributeNS(h.space,h.local)}function L(){this.setAttribute(h,g)}function C(){this.setAttributeNS(h.space,h.local,g)}function O(){var U=g.apply(this,arguments);U==null?this.removeAttribute(h):this.setAttribute(h,U)}function F(){var U=g.apply(this,arguments);U==null?this.removeAttributeNS(h.space,h.local):this.setAttributeNS(h.space,h.local,U)}return g==null?h.local?S:A:typeof g=="function"?h.local?F:O:h.local?C:L}function me(h){return h.trim().replace(/\s+/g," ")}ye.classed=function(h,g){if(arguments.length<2){if(typeof h=="string"){var A=this.node(),S=(h=Pe(h)).length,L=-1;if(g=A.classList){for(;++L=0;)(C=A[S])&&(L&&L!==C.nextSibling&&L.parentNode.insertBefore(C,L),L=C);return this},ye.sort=function(h){h=Ae.apply(this,arguments);for(var g=-1,A=this.length;++g=g&&(g=L+1);!(U=O[g])&&++g0&&(h=h.slice(0,L));var O=He.get(h);O&&(h=O,C=We);function F(){var $=this[S];$&&(this.removeEventListener(h,$,$.$),delete this[S])}function U(){var $=C(g,t(arguments));F.call(this),this.addEventListener(h,this[S]=$,$.$=A),$._=g}function J(){var $=new RegExp("^__on([^.]+)"+e.requote(h)+"$"),re;for(var te in this)if(re=te.match($)){var _e=this[te];this.removeEventListener(re[1],_e,_e.$),delete this[te]}}return L?g?U:F:g?H:J}var He=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});a&&He.forEach(function(h){"on"+h in a&&He.remove(h)});function Je(h,g){return function(A){var S=e.event;e.event=A,g[0]=this.__data__;try{h.apply(this,g)}finally{e.event=S}}}function We(h,g){var A=Je(h,g);return function(S){var L=this,C=S.relatedTarget;(!C||C!==L&&!(C.compareDocumentPosition(L)&8))&&A.call(L,S)}}var Ze,lr=0;function rr(h){var g=".dragsuppress-"+ ++lr,A="click"+g,S=e.select(i(h)).on("touchmove"+g,ee).on("dragstart"+g,ee).on("selectstart"+g,ee);if(Ze==null&&(Ze="onselectstart"in h?!1:Y(h.style,"userSelect")),Ze){var L=n(h).style,C=L[Ze];L[Ze]="none"}return function(O){if(S.on(g,null),Ze&&(L[Ze]=C),O){var F=function(){S.on(A,null)};S.on(A,function(){ee(),F()},!0),setTimeout(F,0)}}}e.mouse=function(h){return Ie(h,fe())};var er=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ie(h,g){g.changedTouches&&(g=g.changedTouches[0]);var A=h.ownerSVGElement||h;if(A.createSVGPoint){var S=A.createSVGPoint();if(er<0){var L=i(h);if(L.scrollX||L.scrollY){A=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var C=A[0][0].getScreenCTM();er=!(C.f||C.e),A.remove()}}return er?(S.x=g.pageX,S.y=g.pageY):(S.x=g.clientX,S.y=g.clientY),S=S.matrixTransform(h.getScreenCTM().inverse()),[S.x,S.y]}var O=h.getBoundingClientRect();return[g.clientX-O.left-h.clientLeft,g.clientY-O.top-h.clientTop]}e.touch=function(h,g,A){if(arguments.length<3&&(A=g,g=fe().changedTouches),g){for(var S=0,L=g.length,C;S0?1:h<0?-1:0}function et(h,g,A){return(g[0]-h[0])*(A[1]-h[1])-(g[1]-h[1])*(A[0]-h[0])}function qt(h){return h>1?0:h<-1?Fe:Math.acos(h)}function ct(h){return h>1?ur:h<-1?-ur:Math.asin(h)}function Ot(h){return((h=Math.exp(h))-1/h)/2}function gt(h){return((h=Math.exp(h))+1/h)/2}function wa(h){return((h=Math.exp(2*h))-1)/(h+1)}function Zt(h){return(h=Math.sin(h/2))*h}var Xt=Math.SQRT2,Na=2,ua=4;e.interpolateZoom=function(h,g){var A=h[0],S=h[1],L=h[2],C=g[0],O=g[1],F=g[2],U=C-A,J=O-S,$=U*U+J*J,re,te;if($0&&(nr=nr.transition().duration(O)),nr.call(Se.event)}function pr(){pe&&pe.domain(ae.range().map(function(nr){return(nr-h.x)/h.k}).map(ae.invert)),Me&&Me.domain(ge.range().map(function(nr){return(nr-h.y)/h.k}).map(ge.invert))}function yr(nr){F++||nr({type:"zoomstart"})}function Er(nr){pr(),nr({type:"zoom",scale:h.k,translate:[h.x,h.y]})}function gr(nr){--F||(nr({type:"zoomend"}),A=null)}function kr(){var nr=this,Dr=ke.of(nr,arguments),Pr=0,nt=e.select(i(nr)).on(J,Oa).on($,nn),Bt=xe(e.mouse(nr)),ma=rr(nr);vp.call(nr),yr(Dr);function Oa(){Pr=1,vr(e.mouse(nr),Bt),Er(Dr)}function nn(){nt.on(J,null).on($,null),ma(Pr),gr(Dr)}}function at(){var nr=this,Dr=ke.of(nr,arguments),Pr={},nt=0,Bt,ma=".zoom-"+e.event.changedTouches[0].identifier,Oa="touchmove"+ma,nn="touchend"+ma,mn=[],on=e.select(nr),kn=rr(nr);Sn(),yr(Dr),on.on(U,null).on(te,Sn);function Ja(){var $i=e.touches(nr);return Bt=h.k,$i.forEach(function(Ba){Ba.identifier in Pr&&(Pr[Ba.identifier]=xe(Ba))}),$i}function Sn(){var $i=e.event.target;e.select($i).on(Oa,Js).on(nn,ioe),mn.push($i);for(var Ba=e.event.changedTouches,si=0,ko=Ba.length;si1){var $s=ui[0],Gl=ui[1],pp=$s[0]-Gl[0],X8=$s[1]-Gl[1];nt=pp*pp+X8*X8}}function Js(){var $i=e.touches(nr),Ba,si,ko,ui;vp.call(nr);for(var Cf=0,$s=$i.length;Cf<$s;++Cf,ui=null)if(ko=$i[Cf],ui=Pr[ko.identifier]){if(si)break;Ba=ko,si=ui}if(ui){var Gl=(Gl=ko[0]-Ba[0])*Gl+(Gl=ko[1]-Ba[1])*Gl,pp=nt&&Math.sqrt(Gl/nt);Ba=[(Ba[0]+ko[0])/2,(Ba[1]+ko[1])/2],si=[(si[0]+ui[0])/2,(si[1]+ui[1])/2],or(pp*Bt)}_e=null,vr(Ba,si),Er(Dr)}function ioe(){if(e.event.touches.length){for(var $i=e.event.changedTouches,Ba=0,si=$i.length;Ba1?1:g,A=A<0?0:A>1?1:A,L=A<=.5?A*(1+g):A+g-A*g,S=2*A-L;function C(F){return F>360?F-=360:F<0&&(F+=360),F<60?S+(L-S)*F/60:F<180?L:F<240?S+(L-S)*(240-F)/60:S}function O(F){return Math.round(C(F)*255)}return new Yt(O(h+120),O(h),O(h-120))}e.hcl=ft;function ft(h,g,A){return this instanceof ft?(this.h=+h,this.c=+g,void(this.l=+A)):arguments.length<2?h instanceof ft?new ft(h.h,h.c,h.l):h instanceof Kt?Pt(h.l,h.a,h.b):Pt((h=fr((h=e.rgb(h)).r,h.g,h.b)).l,h.a,h.b):new ft(h,g,A)}var Ea=ft.prototype=new Xr;Ea.brighter=function(h){return new ft(this.h,this.c,Math.min(100,this.l+_t*(arguments.length?h:1)))},Ea.darker=function(h){return new ft(this.h,this.c,Math.max(0,this.l-_t*(arguments.length?h:1)))},Ea.rgb=function(){return An(this.h,this.c,this.l).rgb()};function An(h,g,A){return isNaN(h)&&(h=0),isNaN(g)&&(g=0),new Kt(A,Math.cos(h*=Mr)*g,Math.sin(h)*g)}e.lab=Kt;function Kt(h,g,A){return this instanceof Kt?(this.l=+h,this.a=+g,void(this.b=+A)):arguments.length<2?h instanceof Kt?new Kt(h.l,h.a,h.b):h instanceof ft?An(h.h,h.c,h.l):fr((h=Yt(h)).r,h.g,h.b):new Kt(h,g,A)}var _t=18,Vt=.95047,Xa=1,ol=1.08883,vt=Kt.prototype=new Xr;vt.brighter=function(h){return new Kt(Math.min(100,this.l+_t*(arguments.length?h:1)),this.a,this.b)},vt.darker=function(h){return new Kt(Math.max(0,this.l-_t*(arguments.length?h:1)),this.a,this.b)},vt.rgb=function(){return Mn(this.l,this.a,this.b)};function Mn(h,g,A){var S=(h+16)/116,L=S+g/500,C=S-A/200;return L=Ys(L)*Vt,S=Ys(S)*Xa,C=Ys(C)*ol,new Yt(ji(3.2404542*L-1.5371385*S-.4985314*C),ji(-.969266*L+1.8760108*S+.041556*C),ji(.0556434*L-.2040259*S+1.0572252*C))}function Pt(h,g,A){return h>0?new ft(Math.atan2(A,g)*Ir,Math.sqrt(g*g+A*A),h):new ft(NaN,NaN,h)}function Ys(h){return h>.206893034?h*h*h:(h-4/29)/7.787037}function yn(h){return h>.008856?Math.pow(h,1/3):7.787037*h+4/29}function ji(h){return Math.round(255*(h<=.00304?12.92*h:1.055*Math.pow(h,1/2.4)-.055))}e.rgb=Yt;function Yt(h,g,A){return this instanceof Yt?(this.r=~~h,this.g=~~g,void(this.b=~~A)):arguments.length<2?h instanceof Yt?new Yt(h.r,h.g,h.b):Kr(""+h,Yt,$t):new Yt(h,g,A)}function Zi(h){return new Yt(h>>16,h>>8&255,h&255)}function Bl(h){return Zi(h)+""}var Hl=Yt.prototype=new Xr;Hl.brighter=function(h){h=Math.pow(.7,arguments.length?h:1);var g=this.r,A=this.g,S=this.b,L=30;return!g&&!A&&!S?new Yt(L,L,L):(g&&g>4,S=S>>4|S,L=U&240,L=L>>4|L,C=U&15,C=C<<4|C):h.length===7&&(S=(U&16711680)>>16,L=(U&65280)>>8,C=U&255)),g(S,L,C))}function ht(h,g,A){var S=Math.min(h/=255,g/=255,A/=255),L=Math.max(h,g,A),C=L-S,O,F,U=(L+S)/2;return C?(F=U<.5?C/(L+S):C/(2-L-S),h==L?O=(g-A)/C+(g0&&U<1?0:O),new $r(O,F,U)}function fr(h,g,A){h=Ia(h),g=Ia(g),A=Ia(A);var S=yn((.4124564*h+.3575761*g+.1804375*A)/Vt),L=yn((.2126729*h+.7151522*g+.072175*A)/Xa),C=yn((.0193339*h+.119192*g+.9503041*A)/ol);return Kt(116*L-16,500*(S-L),200*(L-C))}function Ia(h){return(h/=255)<=.04045?h/12.92:Math.pow((h+.055)/1.055,2.4)}function At(h){var g=parseFloat(h);return h.charAt(h.length-1)==="%"?Math.round(g*2.55):g}var za=e.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});za.forEach(function(h,g){za.set(h,Zi(g))});function Or(h){return typeof h=="function"?h:function(){return h}}e.functor=Or,e.xhr=Xi(B);function Xi(h){return function(g,A,S){return arguments.length===2&&typeof A=="function"&&(S=A,A=null),Ws(g,A,h,S)}}function Ws(h,g,A,S){var L={},C=e.dispatch("beforesend","progress","load","error"),O={},F=new XMLHttpRequest,U=null;self.XDomainRequest&&!("withCredentials"in F)&&/^(http(s)?:)?\/\//.test(h)&&(F=new XDomainRequest),"onload"in F?F.onload=F.onerror=J:F.onreadystatechange=function(){F.readyState>3&&J()};function J(){var $=F.status,re;if(!$&&lne(F)||$>=200&&$<300||$===304){try{re=A.call(L,F)}catch(te){C.error.call(L,te);return}C.load.call(L,re)}else C.error.call(L,F)}return F.onprogress=function($){var re=e.event;e.event=$;try{C.progress.call(L,F)}finally{e.event=re}},L.header=function($,re){return $=($+"").toLowerCase(),arguments.length<2?O[$]:(re==null?delete O[$]:O[$]=re+"",L)},L.mimeType=function($){return arguments.length?(g=$==null?null:$+"",L):g},L.responseType=function($){return arguments.length?(U=$,L):U},L.response=function($){return A=$,L},["get","post"].forEach(function($){L[$]=function(){return L.send.apply(L,[$].concat(t(arguments)))}}),L.send=function($,re,te){if(arguments.length===2&&typeof re=="function"&&(te=re,re=null),F.open($,h,!0),g!=null&&!("accept"in O)&&(O.accept=g+",*/*"),F.setRequestHeader)for(var _e in O)F.setRequestHeader(_e,O[_e]);return g!=null&&F.overrideMimeType&&F.overrideMimeType(g),U!=null&&(F.responseType=U),te!=null&&L.on("error",te).on("load",function(ke){te(null,ke)}),C.beforesend.call(L,F),F.send(re==null?null:re),L},L.abort=function(){return F.abort(),L},e.rebind(L,C,"on"),S==null?L:L.get(one(S))}function one(h){return h.length===1?function(g,A){h(g==null?A:null)}:h}function lne(h){var g=h.responseType;return g&&g!=="text"?h.response:h.responseText}e.dsv=function(h,g){var A=new RegExp('["'+h+` +]`),S=h.charCodeAt(0);function L(J,$,re){arguments.length<3&&(re=$,$=null);var te=Ws(J,g,$==null?C:O($),re);return te.row=function(_e){return arguments.length?te.response(($=_e)==null?C:O(_e)):$},te}function C(J){return L.parse(J.responseText)}function O(J){return function($){return L.parse($.responseText,J)}}L.parse=function(J,$){var re;return L.parseRows(J,function(te,_e){if(re)return re(te,_e-1);var ke=function(ae){for(var pe={},ge=te.length,Me=0;Me=ke)return te;if(Me)return Me=!1,re;var Ye=ae;if(J.charCodeAt(Ye)===34){for(var or=Ye;or++24?(isFinite(g)&&(clearTimeout(Jd),Jd=setTimeout(D3,g)),Xd=0):(Xd=1,FA(D3))}e.timer.flush=function(){NA(),IA()};function NA(){for(var h=Date.now(),g=jd;g;)h>=g.t&&g.c(h-g.t)&&(g.c=null),g=g.n;return h}function IA(){for(var h,g=jd,A=1/0;g;)g.c?(g.t=0;--F)ae.push(L[J[re[F]][2]]);for(F=+_e;F1&&et(h[A[S-2]],h[A[S-1]],h[L])<=0;)--S;A[S++]=L}return A.slice(0,S)}function sne(h,g){return h[0]-g[0]||h[1]-g[1]}e.geom.polygon=function(h){return K(h,Kd),h};var Kd=e.geom.polygon.prototype=[];Kd.area=function(){for(var h=-1,g=this.length,A,S=this[g-1],L=0;++hde)F=F.L;else if(O=g-vne(F,A),O>de){if(!F.R){S=F;break}F=F.R}else{C>-de?(S=F.P,L=F):O>-de?(S=F,L=F.N):S=L=F;break}var U=UA(h);if(kf.insert(S,U),!(!S&&!L)){if(S===L){qf(S),L=UA(S.site),kf.insert(U,L),U.edge=L.edge=Gv(S.site,U.site),Sf(S),Sf(L);return}if(!L){U.edge=Gv(S.site,U.site);return}qf(S),qf(L);var J=S.site,$=J.x,re=J.y,te=h.x-$,_e=h.y-re,ke=L.site,ae=ke.x-$,pe=ke.y-re,ge=2*(te*pe-_e*ae),Me=te*te+_e*_e,Se=ae*ae+pe*pe,xe={x:(pe*Me-_e*Se)/ge+$,y:(te*Se-ae*Me)/ge+re};Qd(L.edge,J,ke,xe),U.edge=Gv(J,h,null,xe),L.edge=Gv(h,ke,null,xe),Sf(S),Sf(L)}}function GA(h,g){var A=h.site,S=A.x,L=A.y,C=L-g;if(!C)return S;var O=h.P;if(!O)return-1/0;A=O.site;var F=A.x,U=A.y,J=U-g;if(!J)return F;var $=F-S,re=1/C-1/J,te=$/J;return re?(-te+Math.sqrt(te*te-2*re*($*$/(-2*J)-U+J/2+L-C/2)))/re+S:(S+F)/2}function vne(h,g){var A=h.N;if(A)return GA(A,g);var S=h.site;return S.y===g?S.x:1/0}function VA(h){this.site=h,this.edges=[]}VA.prototype.prepare=function(){for(var h=this.edges,g=h.length,A;g--;)A=h[g].edge,(!A.b||!A.a)&&h.splice(g,1);return h.sort(YA),h.length};function hne(h){for(var g=h[0][0],A=h[1][0],S=h[0][1],L=h[1][1],C,O,F,U,J=js,$=J.length,re,te,_e,ke,ae,pe;$--;)if(re=J[$],!(!re||!re.prepare()))for(_e=re.edges,ke=_e.length,te=0;tede||x(U-O)>de)&&(_e.splice(te,0,new ep(gne(re.site,pe,x(F-g)de?{x:g,y:x(C-g)de?{x:x(O-L)de?{x:A,y:x(C-A)de?{x:x(O-S)=-Re)){var te=U*U+J*J,_e=$*$+pe*pe,ke=(pe*te-J*_e)/re,ae=(U*_e-$*te)/re,pe=ae+F,ge=HA.pop()||new dne;ge.arc=h,ge.site=L,ge.x=ke+O,ge.y=pe+Math.sqrt(ke*ke+ae*ae),ge.cy=pe,h.circle=ge;for(var Me=null,Se=Uv._;Se;)if(ge.y0)){if(ae/=_e,_e<0){if(ae0){if(ae>te)return;ae>re&&(re=ae)}if(ae=A-F,!(!_e&&ae<0)){if(ae/=_e,_e<0){if(ae>te)return;ae>re&&(re=ae)}else if(_e>0){if(ae0)){if(ae/=ke,ke<0){if(ae0){if(ae>te)return;ae>re&&(re=ae)}if(ae=S-U,!(!ke&&ae<0)){if(ae/=ke,ke<0){if(ae>te)return;ae>re&&(re=ae)}else if(ke>0){if(ae0&&(L.a={x:F+re*_e,y:U+re*ke}),te<1&&(L.b={x:F+te*_e,y:U+te*ke}),L}}}}}}function yne(h){for(var g=Mf,A=pne(h[0][0],h[0][1],h[1][0],h[1][1]),S=g.length,L;S--;)L=g[S],(!mne(L,h)||!A(L)||x(L.a.x-L.b.x)=C)return;if($>te){if(!S)S={x:ke,y:O};else if(S.y>=F)return;A={x:ke,y:F}}else{if(!S)S={x:ke,y:F};else if(S.y1)if($>te){if(!S)S={x:(O-ge)/pe,y:O};else if(S.y>=F)return;A={x:(F-ge)/pe,y:F}}else{if(!S)S={x:(F-ge)/pe,y:F};else if(S.y=C)return;A={x:C,y:pe*C+ge}}else{if(!S)S={x:C,y:pe*C+ge};else if(S.x=$&&ge.x<=te&&ge.y>=re&&ge.y<=_e?[[$,_e],[te,_e],[te,re],[$,re]]:[];Me.point=U[ae]}),J}function F(U){return U.map(function(J,$){return{x:Math.round(S(J,$)/de)*de,y:Math.round(L(J,$)/de)*de,i:$}})}return O.links=function(U){return z3(F(U)).edges.filter(function(J){return J.l&&J.r}).map(function(J){return{source:U[J.l.i],target:U[J.r.i]}})},O.triangles=function(U){var J=[];return z3(F(U)).cells.forEach(function($,re){for(var te=$.site,_e=$.edges.sort(YA),ke=-1,ae=_e.length,pe,ge,Me=_e[ae-1].edge,Se=Me.l===te?Me.r:Me.l;++keSe&&(Se=$.x),$.y>xe&&(xe=$.y),_e.push($.x),ke.push($.y);else for(ae=0;aeSe&&(Se=Ye),or>xe&&(xe=or),_e.push(Ye),ke.push(or)}var vr=Se-ge,sr=xe-Me;vr>sr?xe=Me+vr:Se=ge+sr;function pr(gr,kr,at,Qt,pt,nr,Dr,Pr){if(!(isNaN(at)||isNaN(Qt)))if(gr.leaf){var nt=gr.x,Bt=gr.y;if(nt!=null)if(x(nt-at)+x(Bt-Qt)<.01)yr(gr,kr,at,Qt,pt,nr,Dr,Pr);else{var ma=gr.point;gr.x=gr.y=gr.point=null,yr(gr,ma,nt,Bt,pt,nr,Dr,Pr),yr(gr,kr,at,Qt,pt,nr,Dr,Pr)}else gr.x=at,gr.y=Qt,gr.point=kr}else yr(gr,kr,at,Qt,pt,nr,Dr,Pr)}function yr(gr,kr,at,Qt,pt,nr,Dr,Pr){var nt=(pt+Dr)*.5,Bt=(nr+Pr)*.5,ma=at>=nt,Oa=Qt>=Bt,nn=Oa<<1|ma;gr.leaf=!1,gr=gr.nodes[nn]||(gr.nodes[nn]=ZA()),ma?pt=nt:Dr=nt,Oa?nr=Bt:Pr=Bt,pr(gr,kr,at,Qt,pt,nr,Dr,Pr)}var Er=ZA();if(Er.add=function(gr){pr(Er,gr,+re(gr,++ae),+te(gr,ae),ge,Me,Se,xe)},Er.visit=function(gr){Wv(gr,Er,ge,Me,Se,xe)},Er.find=function(gr){return Tne(Er,gr[0],gr[1],ge,Me,Se,xe)},ae=-1,g==null){for(;++aeC||te>O||_e=Ye,sr=A>=or,pr=sr<<1|vr,yr=pr+4;prA&&(C=g.slice(A,C),F[O]?F[O]+=C:F[++O]=C),(S=S[0])===(L=L[0])?F[O]?F[O]+=L:F[++O]=L:(F[++O]=null,U.push({i:O,x:ll(S,L)})),A=H3.lastIndex;return A=0&&!(S=e.interpolators[A](h,g)););return S}e.interpolators=[function(h,g){var A=typeof g;return(A==="string"?za.has(g.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(g)?O3:JA:g instanceof Xr?O3:Array.isArray(g)?ap:A==="object"&&isNaN(g)?XA:ll)(h,g)}],e.interpolateArray=ap;function ap(h,g){var A=[],S=[],L=h.length,C=g.length,O=Math.min(h.length,g.length),F;for(F=0;F=0?h.slice(0,g):h,S=g>=0?h.slice(g+1):"in";return A=Ane.get(A)||$A,S=Mne.get(S)||B,kne(S(A.apply(null,r.call(arguments,1))))};function kne(h){return function(g){return g<=0?0:g>=1?1:h(g)}}function KA(h){return function(g){return 1-h(1-g)}}function QA(h){return function(g){return .5*(g<.5?h(2*g):2-h(2-2*g))}}function Sne(h){return h*h}function qne(h){return h*h*h}function Lne(h){if(h<=0)return 0;if(h>=1)return 1;var g=h*h,A=g*h;return 4*(h<.5?A:3*(h-g)+A-.75)}function Cne(h){return function(g){return Math.pow(g,h)}}function Ene(h){return 1-Math.cos(h*ur)}function Dne(h){return Math.pow(2,10*(h-1))}function Rne(h){return 1-Math.sqrt(1-h*h)}function Pne(h,g){var A;return arguments.length<2&&(g=.45),arguments.length?A=g/Ke*Math.asin(1/h):(h=1,A=g/4),function(S){return 1+h*Math.pow(2,-10*S)*Math.sin((S-A)*Ke/g)}}function Fne(h){return h||(h=1.70158),function(g){return g*g*((h+1)*g-h)}}function Nne(h){return h<1/2.75?7.5625*h*h:h<2/2.75?7.5625*(h-=1.5/2.75)*h+.75:h<2.5/2.75?7.5625*(h-=2.25/2.75)*h+.9375:7.5625*(h-=2.625/2.75)*h+.984375}e.interpolateHcl=Ine;function Ine(h,g){h=e.hcl(h),g=e.hcl(g);var A=h.h,S=h.c,L=h.l,C=g.h-A,O=g.c-S,F=g.l-L;return isNaN(O)&&(O=0,S=isNaN(S)?g.c:S),isNaN(C)?(C=0,A=isNaN(A)?g.h:A):C>180?C-=360:C<-180&&(C+=360),function(U){return An(A+C*U,S+O*U,L+F*U)+""}}e.interpolateHsl=zne;function zne(h,g){h=e.hsl(h),g=e.hsl(g);var A=h.h,S=h.s,L=h.l,C=g.h-A,O=g.s-S,F=g.l-L;return isNaN(O)&&(O=0,S=isNaN(S)?g.s:S),isNaN(C)?(C=0,A=isNaN(A)?g.h:A):C>180?C-=360:C<-180&&(C+=360),function(U){return $t(A+C*U,S+O*U,L+F*U)+""}}e.interpolateLab=One;function One(h,g){h=e.lab(h),g=e.lab(g);var A=h.l,S=h.a,L=h.b,C=g.l-A,O=g.a-S,F=g.b-L;return function(U){return Mn(A+C*U,S+O*U,L+F*U)+""}}e.interpolateRound=e8;function e8(h,g){return g-=h,function(A){return Math.round(h+g*A)}}e.transform=function(h){var g=a.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(A){if(A!=null){g.setAttribute("transform",A);var S=g.transform.baseVal.consolidate()}return new r8(S?S.matrix:Hne)})(h)};function r8(h){var g=[h.a,h.b],A=[h.c,h.d],S=a8(g),L=t8(g,A),C=a8(Bne(A,g,-L))||0;g[0]*A[1]180?g+=360:g-h>180&&(h+=360),S.push({i:A.push(Lf(A)+"rotate(",null,")")-2,x:ll(h,g)})):g&&A.push(Lf(A)+"rotate("+g+")")}function Vne(h,g,A,S){h!==g?S.push({i:A.push(Lf(A)+"skewX(",null,")")-2,x:ll(h,g)}):g&&A.push(Lf(A)+"skewX("+g+")")}function Yne(h,g,A,S){if(h[0]!==g[0]||h[1]!==g[1]){var L=A.push(Lf(A)+"scale(",null,",",null,")");S.push({i:L-4,x:ll(h[0],g[0])},{i:L-2,x:ll(h[1],g[1])})}else(g[0]!==1||g[1]!==1)&&A.push(Lf(A)+"scale("+g+")")}function n8(h,g){var A=[],S=[];return h=e.transform(h),g=e.transform(g),Une(h.translate,g.translate,A,S),Gne(h.rotate,g.rotate,A,S),Vne(h.skew,g.skew,A,S),Yne(h.scale,g.scale,A,S),h=g=null,function(L){for(var C=-1,O=S.length,F;++C0?C=xe:(A.c=null,A.t=NaN,A=null,g.end({type:"end",alpha:C=0})):xe>0&&(g.start({type:"start",alpha:C=xe}),A=$d(h.tick)),h):C},h.start=function(){var xe,Ye=_e.length,or=ke.length,vr=S[0],sr=S[1],pr,yr;for(xe=0;xe=0;)C.push($=J[U]),$.parent=F,$.depth=F.depth+1;A&&(F.value=0),F.children=J}else A&&(F.value=+A.call(S,F,F.depth)||0),delete F.children;return Mo(L,function(re){var te,_e;h&&(te=re.children)&&te.sort(h),A&&(_e=re.parent)&&(_e.value+=re.value)}),O}return S.sort=function(L){return arguments.length?(h=L,S):h},S.children=function(L){return arguments.length?(g=L,S):g},S.value=function(L){return arguments.length?(A=L,S):A},S.revalue=function(L){return A&&(Zv(L,function(C){C.children&&(C.value=0)}),Mo(L,function(C){var O;C.children||(C.value=+A.call(S,C,C.depth)||0),(O=C.parent)&&(O.value+=C.value)})),L},S};function jv(h,g){return e.rebind(h,g,"sort","children","value"),h.nodes=h,h.links=oie,h}function Zv(h,g){for(var A=[h];(h=A.pop())!=null;)if(g(h),(L=h.children)&&(S=L.length))for(var S,L;--S>=0;)A.push(L[S])}function Mo(h,g){for(var A=[h],S=[];(h=A.pop())!=null;)if(S.push(h),(O=h.children)&&(C=O.length))for(var L=-1,C,O;++LL&&(L=F),S.push(F)}for(O=0;OS&&(A=g,S=L);return A}function hie(h){return h.reduce(die,0)}function die(h,g){return h+g[1]}e.layout.histogram=function(){var h=!0,g=Number,A=yie,S=pie;function L(C,te){for(var F=[],U=C.map(g,this),J=A.call(this,U,te),$=S.call(this,J,U,te),re,te=-1,_e=U.length,ke=$.length-1,ae=h?1:1/_e,pe;++te0)for(te=-1;++te<_e;)pe=U[te],pe>=J[0]&&pe<=J[1]&&(re=F[e.bisect($,pe,1,ke)-1],re.y+=ae,re.push(C[te]));return F}return L.value=function(C){return arguments.length?(g=C,L):g},L.range=function(C){return arguments.length?(A=Or(C),L):A},L.bins=function(C){return arguments.length?(S=typeof C=="number"?function(O){return s8(O,C)}:Or(C),L):S},L.frequency=function(C){return arguments.length?(h=!!C,L):h},L};function pie(h,g){return s8(h,Math.ceil(Math.log(g.length)/Math.LN2+1))}function s8(h,g){for(var A=-1,S=+h[0],L=(h[1]-S)/g,C=[];++A<=g;)C[A]=L*A+S;return C}function yie(h){return[e.min(h),e.max(h)]}e.layout.pack=function(){var h=e.layout.hierarchy().sort(mie),g=0,A=[1,1],S;function L(C,O){var F=h.call(this,C,O),U=F[0],J=A[0],$=A[1],re=S==null?Math.sqrt:typeof S=="function"?S:function(){return S};if(U.x=U.y=0,Mo(U,function(_e){_e.r=+re(_e.value)}),Mo(U,c8),g){var te=g*(S?1:Math.max(2*U.r/J,2*U.r/$))/2;Mo(U,function(_e){_e.r+=te}),Mo(U,c8),Mo(U,function(_e){_e.r-=te})}return v8(U,J/2,$/2,S?1:1/Math.max(2*U.r/J,2*U.r/$)),F}return L.size=function(C){return arguments.length?(A=C,L):A},L.radius=function(C){return arguments.length?(S=C==null||typeof C=="function"?C:+C,L):S},L.padding=function(C){return arguments.length?(g=+C,L):g},jv(L,h)};function mie(h,g){return h.value-g.value}function V3(h,g){var A=h._pack_next;h._pack_next=g,g._pack_prev=h,g._pack_next=A,A._pack_prev=g}function u8(h,g){h._pack_next=g,g._pack_prev=h}function f8(h,g){var A=g.x-h.x,S=g.y-h.y,L=h.r+g.r;return .999*L*L>A*A+S*S}function c8(h){if(!(g=h.children)||!(te=g.length))return;var g,A=1/0,S=-1/0,L=1/0,C=-1/0,O,F,U,J,$,re,te;function _e(xe){A=Math.min(xe.x-xe.r,A),S=Math.max(xe.x+xe.r,S),L=Math.min(xe.y-xe.r,L),C=Math.max(xe.y+xe.r,C)}if(g.forEach(gie),O=g[0],O.x=-O.r,O.y=0,_e(O),te>1&&(F=g[1],F.x=F.r,F.y=0,_e(F),te>2))for(U=g[2],h8(O,F,U),_e(U),V3(O,U),O._pack_prev=U,V3(U,F),F=O._pack_next,J=3;Jpe.x&&(pe=Ye),Ye.depth>ge.depth&&(ge=Ye)});var Me=g(ae,pe)/2-ae.x,Se=A[0]/(pe.x+g(pe,ae)/2+Me),xe=A[1]/(ge.depth||1);Zv(_e,function(Ye){Ye.x=(Ye.x+Me)*Se,Ye.y=Ye.depth*xe})}return te}function C($){for(var re={A:null,children:[$]},te=[re],_e;(_e=te.pop())!=null;)for(var ke=_e.children,ae,pe=0,ge=ke.length;pe0&&(xie(wie(ae,$,te),$,Ye),ge+=Ye,Me+=Ye),Se+=ae.m,ge+=_e.m,xe+=pe.m,Me+=ke.m;ae&&!W3(ke)&&(ke.t=ae,ke.m+=Se-Me),_e&&!Y3(pe)&&(pe.t=_e,pe.m+=ge-xe,te=$)}return te}function J($){$.x*=A[0],$.y=$.depth*A[1]}return L.separation=function($){return arguments.length?(g=$,L):g},L.size=function($){return arguments.length?(S=(A=$)==null?J:null,L):S?null:A},L.nodeSize=function($){return arguments.length?(S=(A=$)==null?null:J,L):S?A:null},jv(L,h)};function d8(h,g){return h.parent==g.parent?1:2}function Y3(h){var g=h.children;return g.length?g[0]:h.t}function W3(h){var g=h.children,A;return(A=g.length)?g[A-1]:h.t}function xie(h,g,A){var S=A/(g.i-h.i);g.c-=S,g.s+=A,h.c+=S,g.z+=A,g.m+=A}function _ie(h){for(var g=0,A=0,S=h.children,L=S.length,C;--L>=0;)C=S[L],C.z+=g,C.m+=g,g+=C.s+(A+=C.c)}function wie(h,g,A){return h.a.parent===g.parent?h.a:A}e.layout.cluster=function(){var h=e.layout.hierarchy().sort(null).value(null),g=d8,A=[1,1],S=!1;function L(C,O){var F=h.call(this,C,O),U=F[0],J,$=0;Mo(U,function(ae){var pe=ae.children;pe&&pe.length?(ae.x=Aie(pe),ae.y=Tie(pe)):(ae.x=J?$+=g(ae,J):0,ae.y=0,J=ae)});var re=p8(U),te=y8(U),_e=re.x-g(re,te)/2,ke=te.x+g(te,re)/2;return Mo(U,S?function(ae){ae.x=(ae.x-U.x)*A[0],ae.y=(U.y-ae.y)*A[1]}:function(ae){ae.x=(ae.x-_e)/(ke-_e)*A[0],ae.y=(1-(U.y?ae.y/U.y:1))*A[1]}),F}return L.separation=function(C){return arguments.length?(g=C,L):g},L.size=function(C){return arguments.length?(S=(A=C)==null,L):S?null:A},L.nodeSize=function(C){return arguments.length?(S=(A=C)!=null,L):S?A:null},jv(L,h)};function Tie(h){return 1+e.max(h,function(g){return g.y})}function Aie(h){return h.reduce(function(g,A){return g+A.x},0)/h.length}function p8(h){var g=h.children;return g&&g.length?p8(g[0]):h}function y8(h){var g=h.children,A;return g&&(A=g.length)?y8(g[A-1]):h}e.layout.treemap=function(){var h=e.layout.hierarchy(),g=Math.round,A=[1,1],S=null,L=j3,C=!1,O,F="squarify",U=.5*(1+Math.sqrt(5));function J(ae,pe){for(var ge=-1,Me=ae.length,Se,xe;++ge0;)Me.push(xe=Se[sr-1]),Me.area+=xe.area,F!=="squarify"||(or=te(Me,vr))<=Ye?(Se.pop(),Ye=or):(Me.area-=Me.pop().area,_e(Me,vr,ge,!1),vr=Math.min(ge.dx,ge.dy),Me.length=Me.area=0,Ye=1/0);Me.length&&(_e(Me,vr,ge,!0),Me.length=Me.area=0),pe.forEach($)}}function re(ae){var pe=ae.children;if(pe&&pe.length){var ge=L(ae),Me=pe.slice(),Se,xe=[];for(J(Me,ge.dx*ge.dy/ae.value),xe.area=0;Se=Me.pop();)xe.push(Se),xe.area+=Se.area,Se.z!=null&&(_e(xe,Se.z?ge.dx:ge.dy,ge,!Me.length),xe.length=xe.area=0);pe.forEach(re)}}function te(ae,pe){for(var ge=ae.area,Me,Se=0,xe=1/0,Ye=-1,or=ae.length;++YeSe&&(Se=Me));return ge*=ge,pe*=pe,ge?Math.max(pe*Se*U/ge,ge/(pe*xe*U)):1/0}function _e(ae,pe,ge,Me){var Se=-1,xe=ae.length,Ye=ge.x,or=ge.y,vr=pe?g(ae.area/pe):0,sr;if(pe==ge.dx){for((Me||vr>ge.dy)&&(vr=ge.dy);++Sege.dx)&&(vr=ge.dx);++Se1);return h+g*S*Math.sqrt(-2*Math.log(C)/C)}},logNormal:function(){var h=e.random.normal.apply(e,arguments);return function(){return Math.exp(h())}},bates:function(h){var g=e.random.irwinHall(h);return function(){return g()/h}},irwinHall:function(h){return function(){for(var g=0,A=0;A2?Sie:Mie,J=S?jne:Wne;return L=U(h,g,J,A),C=U(g,h,J,Zs),F}function F(U){return L(U)}return F.invert=function(U){return C(U)},F.domain=function(U){return arguments.length?(h=U.map(Number),O()):h},F.range=function(U){return arguments.length?(g=U,O()):g},F.rangeRound=function(U){return F.range(U).interpolate(e8)},F.clamp=function(U){return arguments.length?(S=U,O()):S},F.interpolate=function(U){return arguments.length?(A=U,O()):A},F.ticks=function(U){return J3(h,U)},F.tickFormat=function(U,J){return d3_scale_linearTickFormat(h,U,J)},F.nice=function(U){return _8(h,U),O()},F.copy=function(){return b8(h,g,A,S)},O()}function x8(h,g){return e.rebind(h,g,"range","rangeRound","interpolate","clamp")}function _8(h,g){return Z3(h,g8(X3(h,g)[2])),Z3(h,g8(X3(h,g)[2])),h}function X3(h,g){g==null&&(g=10);var A=np(h),S=A[1]-A[0],L=Math.pow(10,Math.floor(Math.log(S/g)/Math.LN10)),C=g/S*L;return C<=.15?L*=10:C<=.35?L*=5:C<=.75&&(L*=2),A[0]=Math.ceil(A[0]/L)*L,A[1]=Math.floor(A[1]/L)*L+L*.5,A[2]=L,A}function J3(h,g){return e.range.apply(e,X3(h,g))}var qie={s:1,g:1,p:1,r:1,e:1};function w8(h){return-Math.floor(Math.log(h)/Math.LN10+.01)}function SCe(h,g){var A=w8(g[2]);return h in qie?Math.abs(A-w8(Math.max(x(g[0]),x(g[1]))))+ +(h!=="e"):A-(h==="%")*2}e.scale.log=function(){return T8(e.scale.linear().domain([0,1]),10,!0,[1,10])};function T8(h,g,A,S){function L(F){return(A?Math.log(F<0?0:F):-Math.log(F>0?0:-F))/Math.log(g)}function C(F){return A?Math.pow(g,F):-Math.pow(g,-F)}function O(F){return h(L(F))}return O.invert=function(F){return C(h.invert(F))},O.domain=function(F){return arguments.length?(A=F[0]>=0,h.domain((S=F.map(Number)).map(L)),O):S},O.base=function(F){return arguments.length?(g=+F,h.domain(S.map(L)),O):g},O.nice=function(){var F=Z3(S.map(L),A?Math:Lie);return h.domain(F),S=F.map(C),O},O.ticks=function(){var F=np(S),U=[],J=F[0],$=F[1],re=Math.floor(L(J)),te=Math.ceil(L($)),_e=g%1?2:g;if(isFinite(te-re)){if(A){for(;re0;ke--)U.push(C(re)*ke);for(re=0;U[re]$;te--);U=U.slice(re,te)}return U},O.copy=function(){return T8(h.copy(),g,A,S)},x8(O,h)}var Lie={floor:function(h){return-Math.ceil(-h)},ceil:function(h){return-Math.floor(-h)}};e.scale.pow=function(){return A8(e.scale.linear(),1,[0,1])};function A8(h,g,A){var S=op(g),L=op(1/g);function C(O){return h(S(O))}return C.invert=function(O){return L(h.invert(O))},C.domain=function(O){return arguments.length?(h.domain((A=O.map(Number)).map(S)),C):A},C.ticks=function(O){return J3(A,O)},C.tickFormat=function(O,F){return d3_scale_linearTickFormat(A,O,F)},C.nice=function(O){return C.domain(_8(A,O))},C.exponent=function(O){return arguments.length?(S=op(g=O),L=op(1/g),h.domain(A.map(S)),C):g},C.copy=function(){return A8(h.copy(),g,A)},x8(C,h)}function op(h){return function(g){return g<0?-Math.pow(-g,h):Math.pow(g,h)}}e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return M8([],{t:"range",a:[[]]})};function M8(h,g){var A,S,L;function C(F){return S[((A.get(F)||(g.t==="range"?A.set(F,h.push(F)):NaN))-1)%S.length]}function O(F,U){return e.range(h.length).map(function(J){return F+U*J})}return C.domain=function(F){if(!arguments.length)return h;h=[],A=new b;for(var U=-1,J=F.length,$;++U0?A[C-1]:h[0],Cte?0:1;if($=cr)return U($,ke)+(J?U(J,1-ke):"")+"Z";var ae,pe,ge,Me,Se=0,xe=0,Ye,or,vr,sr,pr,yr,Er,gr,kr=[];if((Me=(+O.apply(this,arguments)||0)/2)&&(ge=S===lp?Math.sqrt(J*J+$*$):+S.apply(this,arguments),ke||(xe*=-1),$&&(xe=ct(ge/$*Math.sin(Me))),J&&(Se=ct(ge/J*Math.sin(Me)))),$){Ye=$*Math.cos(re+xe),or=$*Math.sin(re+xe),vr=$*Math.cos(te-xe),sr=$*Math.sin(te-xe);var at=Math.abs(te-re-2*xe)<=Fe?0:1;if(xe&&sp(Ye,or,vr,sr)===ke^at){var Qt=(re+te)/2;Ye=$*Math.cos(Qt),or=$*Math.sin(Qt),vr=sr=null}}else Ye=or=0;if(J){pr=J*Math.cos(te-Se),yr=J*Math.sin(te-Se),Er=J*Math.cos(re+Se),gr=J*Math.sin(re+Se);var pt=Math.abs(re-te+2*Se)<=Fe?0:1;if(Se&&sp(pr,yr,Er,gr)===1-ke^pt){var nr=(re+te)/2;pr=J*Math.cos(nr),yr=J*Math.sin(nr),Er=gr=null}}else pr=yr=0;if(_e>de&&(ae=Math.min(Math.abs($-J)/2,+A.apply(this,arguments)))>.001){pe=J<$^ke?0:1;var Dr=ae,Pr=ae;if(_e0?0:1}function up(h,g,A,S,L){var C=h[0]-g[0],O=h[1]-g[1],F=(L?S:-S)/Math.sqrt(C*C+O*O),U=F*O,J=-F*C,$=h[0]+U,re=h[1]+J,te=g[0]+U,_e=g[1]+J,ke=($+te)/2,ae=(re+_e)/2,pe=te-$,ge=_e-re,Me=pe*pe+ge*ge,Se=A-S,xe=$*_e-te*re,Ye=(ge<0?-1:1)*Math.sqrt(Math.max(0,Se*Se*Me-xe*xe)),or=(xe*ge-pe*Ye)/Me,vr=(-xe*pe-ge*Ye)/Me,sr=(xe*ge+pe*Ye)/Me,pr=(-xe*pe+ge*Ye)/Me,yr=or-ke,Er=vr-ae,gr=sr-ke,kr=pr-ae;return yr*yr+Er*Er>gr*gr+kr*kr&&(or=sr,vr=pr),[[or-U,vr-J],[or*A/Se,vr*A/Se]]}function D8(){return!0}function R8(h){var g=Af,A=Hv,S=D8,L=Ji,C=L.key,O=.7;function F(U){var J=[],$=[],re=-1,te=U.length,_e,ke=Or(g),ae=Or(A);function pe(){J.push("M",L(h($),O))}for(;++re1?h.join("L"):h+"Z"}function P8(h){return h.join("L")+"Z"}function zie(h){for(var g=0,A=h.length,S=h[0],L=[S[0],",",S[1]];++g1&&L.push("H",S[0]),L.join("")}function K3(h){for(var g=0,A=h.length,S=h[0],L=[S[0],",",S[1]];++g1){F=g[1],C=h[U],U++,S+="C"+(L[0]+O[0])+","+(L[1]+O[1])+","+(C[0]-F[0])+","+(C[1]-F[1])+","+C[0]+","+C[1];for(var J=2;J9&&(C=A*3/Math.sqrt(C),O[F]=C*S,O[F+1]=C*L));for(F=-1;++F<=U;)C=(h[Math.min(U,F+1)][0]-h[Math.max(0,F-1)][0])/(6*(1+O[F]*O[F])),g.push([C||0,O[F]*C||0]);return g}function jie(h){return h.length<3?Ji(h):h[0]+fp(h,Wie(h))}e.svg.line.radial=function(){var h=R8(z8);return h.radius=h.x,delete h.x,h.angle=h.y,delete h.y,h};function z8(h){for(var g,A=-1,S=h.length,L,C;++AFe)+",1 "+re}function J($,re,te,_e){return"Q 0,0 "+_e}return C.radius=function($){return arguments.length?(A=Or($),C):A},C.source=function($){return arguments.length?(h=Or($),C):h},C.target=function($){return arguments.length?(g=Or($),C):g},C.startAngle=function($){return arguments.length?(S=Or($),C):S},C.endAngle=function($){return arguments.length?(L=Or($),C):L},C};function Zie(h){return h.radius}e.svg.diagonal=function(){var h=B8,g=H8,A=U8;function S(L,C){var O=h.call(this,L,C),F=g.call(this,L,C),U=(O.y+F.y)/2,J=[O,{x:O.x,y:U},{x:F.x,y:U},F];return J=J.map(A),"M"+J[0]+"C"+J[1]+" "+J[2]+" "+J[3]}return S.source=function(L){return arguments.length?(h=Or(L),S):h},S.target=function(L){return arguments.length?(g=Or(L),S):g},S.projection=function(L){return arguments.length?(A=L,S):A},S};function U8(h){return[h.x,h.y]}e.svg.diagonal.radial=function(){var h=e.svg.diagonal(),g=U8,A=h.projection;return h.projection=function(S){return arguments.length?A(Xie(g=S)):g},h};function Xie(h){return function(){var g=h.apply(this,arguments),A=g[0],S=g[1]-ur;return[A*Math.cos(S),A*Math.sin(S)]}}e.svg.symbol=function(){var h=$ie,g=Jie;function A(S,L){return(V8.get(h.call(this,S,L))||G8)(g.call(this,S,L))}return A.type=function(S){return arguments.length?(h=Or(S),A):h},A.size=function(S){return arguments.length?(g=Or(S),A):g},A};function Jie(){return 64}function $ie(){return"circle"}function G8(h){var g=Math.sqrt(h/Fe);return"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z"}var V8=e.map({circle:G8,cross:function(h){var g=Math.sqrt(h/5)/2;return"M"+-3*g+","+-g+"H"+-g+"V"+-3*g+"H"+g+"V"+-g+"H"+3*g+"V"+g+"H"+g+"V"+3*g+"H"+-g+"V"+g+"H"+-3*g+"Z"},diamond:function(h){var g=Math.sqrt(h/(2*Y8)),A=g*Y8;return"M0,"+-g+"L"+A+",0 0,"+g+" "+-A+",0Z"},square:function(h){var g=Math.sqrt(h)/2;return"M"+-g+","+-g+"L"+g+","+-g+" "+g+","+g+" "+-g+","+g+"Z"},"triangle-down":function(h){var g=Math.sqrt(h/cp),A=g*cp/2;return"M0,"+A+"L"+g+","+-A+" "+-g+","+-A+"Z"},"triangle-up":function(h){var g=Math.sqrt(h/cp),A=g*cp/2;return"M0,"+-A+"L"+g+","+A+" "+-g+","+A+"Z"}});e.svg.symbolTypes=V8.keys();var cp=Math.sqrt(3),Y8=Math.tan(30*Mr);ye.transition=function(h){for(var g=Xs||++j8,A=nb(h),S=[],L,C,O=hp||{time:Date.now(),ease:Lne,delay:0,duration:250},F=-1,U=this.length;++F0;)re[--Me].call(h,ge);if(pe>=1)return O.event&&O.event.end.call(h,h.__data__,g),--C.count?delete C[S]:delete h[A],1}O||(F=L.time,U=$d(te,0,F),O=C[S]={tween:new b,time:F,timer:U,delay:L.delay,duration:L.duration,ease:L.ease,index:g},L=null,++C.count)}e.svg.axis=function(){var h=e.scale.linear(),g=Z8,A=6,S=6,L=3,C=[10],O=null,F;function U(J){J.each(function(){var $=e.select(this),re=this.__chart__||h,te=this.__chart__=h.copy(),_e=O==null?te.ticks?te.ticks.apply(te,C):te.domain():O,ke=F==null?te.tickFormat?te.tickFormat.apply(te,C):B:F,ae=$.selectAll(".tick").data(_e,te),pe=ae.enter().insert("g",".domain").attr("class","tick").style("opacity",de),ge=e.transition(ae.exit()).style("opacity",de).remove(),Me=e.transition(ae.order()).style("opacity",1),Se=Math.max(A,0)+L,xe,Ye=ip(te),or=$.selectAll(".domain").data([0]),vr=(or.enter().append("path").attr("class","domain"),e.transition(or));pe.append("line"),pe.append("text");var sr=pe.select("line"),pr=Me.select("line"),yr=ae.select("text").text(ke),Er=pe.select("text"),gr=Me.select("text"),kr=g==="top"||g==="left"?-1:1,at,Qt,pt,nr;if(g==="bottom"||g==="top"?(xe=eoe,at="x",pt="y",Qt="x2",nr="y2",yr.attr("dy",kr<0?"0em":".71em").style("text-anchor","middle"),vr.attr("d","M"+Ye[0]+","+kr*S+"V0H"+Ye[1]+"V"+kr*S)):(xe=roe,at="y",pt="x",Qt="y2",nr="x2",yr.attr("dy",".32em").style("text-anchor",kr<0?"end":"start"),vr.attr("d","M"+kr*S+","+Ye[0]+"H0V"+Ye[1]+"H"+kr*S)),sr.attr(nr,kr*A),Er.attr(pt,kr*Se),pr.attr(Qt,0).attr(nr,kr*A),gr.attr(at,0).attr(pt,kr*Se),te.rangeBand){var Dr=te,Pr=Dr.rangeBand()/2;re=te=function(nt){return Dr(nt)+Pr}}else re.rangeBand?re=te:ge.call(xe,te,re);pe.call(xe,re,te),Me.call(xe,te,te)})}return U.scale=function(J){return arguments.length?(h=J,U):h},U.orient=function(J){return arguments.length?(g=J in Qie?J+"":Z8,U):g},U.ticks=function(){return arguments.length?(C=t(arguments),U):C},U.tickValues=function(J){return arguments.length?(O=J,U):O},U.tickFormat=function(J){return arguments.length?(F=J,U):F},U.tickSize=function(J){var $=arguments.length;return $?(A=+J,S=+arguments[$-1],U):A},U.innerTickSize=function(J){return arguments.length?(A=+J,U):A},U.outerTickSize=function(J){return arguments.length?(S=+J,U):S},U.tickPadding=function(J){return arguments.length?(L=+J,U):L},U.tickSubdivide=function(){return arguments.length&&U},U};var Z8="bottom",Qie={top:1,right:1,bottom:1,left:1};function eoe(h,g,A){h.attr("transform",function(S){var L=g(S);return"translate("+(isFinite(L)?L:A(S))+",0)"})}function roe(h,g,A){h.attr("transform",function(S){var L=g(S);return"translate(0,"+(isFinite(L)?L:A(S))+")"})}e.svg.brush=function(){var h=ie($,"brushstart","brush","brushend"),g=null,A=null,S=[0,0],L=[0,0],C,O,F=!0,U=!0,J=ib[0];function $(ae){ae.each(function(){var pe=e.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",ke).on("touchstart.brush",ke),ge=pe.selectAll(".background").data([0]);ge.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),pe.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Me=pe.selectAll(".resize").data(J,B);Me.exit().remove(),Me.enter().append("g").attr("class",function(or){return"resize "+or}).style("cursor",function(or){return toe[or]}).append("rect").attr("x",function(or){return/[ew]$/.test(or)?-3:null}).attr("y",function(or){return/^[ns]/.test(or)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Me.style("display",$.empty()?"none":null);var Se=e.transition(pe),xe=e.transition(ge),Ye;g&&(Ye=ip(g),xe.attr("x",Ye[0]).attr("width",Ye[1]-Ye[0]),te(Se)),A&&(Ye=ip(A),xe.attr("y",Ye[0]).attr("height",Ye[1]-Ye[0]),_e(Se)),re(Se)})}$.event=function(ae){ae.each(function(){var pe=h.of(this,arguments),ge={x:S,y:L,i:C,j:O},Me=this.__chart__||ge;this.__chart__=ge,Xs?e.select(this).transition().each("start.brush",function(){C=Me.i,O=Me.j,S=Me.x,L=Me.y,pe({type:"brushstart"})}).tween("brush:brush",function(){var Se=ap(S,ge.x),xe=ap(L,ge.y);return C=O=null,function(Ye){S=ge.x=Se(Ye),L=ge.y=xe(Ye),pe({type:"brush",mode:"resize"})}}).each("end.brush",function(){C=ge.i,O=ge.j,pe({type:"brush",mode:"resize"}),pe({type:"brushend"})}):(pe({type:"brushstart"}),pe({type:"brush",mode:"resize"}),pe({type:"brushend"}))})};function re(ae){ae.selectAll(".resize").attr("transform",function(pe){return"translate("+S[+/e$/.test(pe)]+","+L[+/^s/.test(pe)]+")"})}function te(ae){ae.select(".extent").attr("x",S[0]),ae.selectAll(".extent,.n>rect,.s>rect").attr("width",S[1]-S[0])}function _e(ae){ae.select(".extent").attr("y",L[0]),ae.selectAll(".extent,.e>rect,.w>rect").attr("height",L[1]-L[0])}function ke(){var ae=this,pe=e.select(e.event.target),ge=h.of(ae,arguments),Me=e.select(ae),Se=pe.datum(),xe=!/^(n|s)$/.test(Se)&&g,Ye=!/^(e|w)$/.test(Se)&&A,or=pe.classed("extent"),vr=rr(ae),sr,pr=e.mouse(ae),yr,Er=e.select(i(ae)).on("keydown.brush",at).on("keyup.brush",Qt);if(e.event.changedTouches?Er.on("touchmove.brush",pt).on("touchend.brush",Dr):Er.on("mousemove.brush",pt).on("mouseup.brush",Dr),Me.interrupt().selectAll("*").interrupt(),or)pr[0]=S[0]-pr[0],pr[1]=L[0]-pr[1];else if(Se){var gr=+/w$/.test(Se),kr=+/^n/.test(Se);yr=[S[1-gr]-pr[0],L[1-kr]-pr[1]],pr[0]=S[gr],pr[1]=L[kr]}else e.event.altKey&&(sr=pr.slice());Me.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",pe.style("cursor")),ge({type:"brushstart"}),pt();function at(){e.event.keyCode==32&&(or||(sr=null,pr[0]-=S[1],pr[1]-=L[1],or=2),ee())}function Qt(){e.event.keyCode==32&&or==2&&(pr[0]+=S[1],pr[1]+=L[1],or=0,ee())}function pt(){var Pr=e.mouse(ae),nt=!1;yr&&(Pr[0]+=yr[0],Pr[1]+=yr[1]),or||(e.event.altKey?(sr||(sr=[(S[0]+S[1])/2,(L[0]+L[1])/2]),pr[0]=S[+(Pr[0]{(function(e,r){typeof xp=="object"&&typeof rM!="undefined"?r(xp):(e=e||self,r(e.d3=e.d3||{}))})(xp,function(e){"use strict";var r=new Date,t=new Date;function a(oe,Ae,Xe,dr){function Ne(Te){return oe(Te=arguments.length===0?new Date:new Date(+Te)),Te}return Ne.floor=function(Te){return oe(Te=new Date(+Te)),Te},Ne.ceil=function(Te){return oe(Te=new Date(Te-1)),Ae(Te,1),oe(Te),Te},Ne.round=function(Te){var qe=Ne(Te),He=Ne.ceil(Te);return Te-qe0))return Je;do Je.push(We=new Date(+Te)),Ae(Te,He),oe(Te);while(We=qe)for(;oe(qe),!Te(qe);)qe.setTime(qe-1)},function(qe,He){if(qe>=qe)if(He<0)for(;++He<=0;)for(;Ae(qe,-1),!Te(qe););else for(;--He>=0;)for(;Ae(qe,1),!Te(qe););})},Xe&&(Ne.count=function(Te,qe){return r.setTime(+Te),t.setTime(+qe),oe(r),oe(t),Math.floor(Xe(r,t))},Ne.every=function(Te){return Te=Math.floor(Te),!isFinite(Te)||!(Te>0)?null:Te>1?Ne.filter(dr?function(qe){return dr(qe)%Te===0}:function(qe){return Ne.count(0,qe)%Te===0}):Ne}),Ne}var n=a(function(){},function(oe,Ae){oe.setTime(+oe+Ae)},function(oe,Ae){return Ae-oe});n.every=function(oe){return oe=Math.floor(oe),!isFinite(oe)||!(oe>0)?null:oe>1?a(function(Ae){Ae.setTime(Math.floor(Ae/oe)*oe)},function(Ae,Xe){Ae.setTime(+Ae+Xe*oe)},function(Ae,Xe){return(Xe-Ae)/oe}):n};var i=n.range,o=1e3,l=6e4,s=36e5,u=864e5,f=6048e5,c=a(function(oe){oe.setTime(oe-oe.getMilliseconds())},function(oe,Ae){oe.setTime(+oe+Ae*o)},function(oe,Ae){return(Ae-oe)/o},function(oe){return oe.getUTCSeconds()}),v=c.range,d=a(function(oe){oe.setTime(oe-oe.getMilliseconds()-oe.getSeconds()*o)},function(oe,Ae){oe.setTime(+oe+Ae*l)},function(oe,Ae){return(Ae-oe)/l},function(oe){return oe.getMinutes()}),p=d.range,y=a(function(oe){oe.setTime(oe-oe.getMilliseconds()-oe.getSeconds()*o-oe.getMinutes()*l)},function(oe,Ae){oe.setTime(+oe+Ae*s)},function(oe,Ae){return(Ae-oe)/s},function(oe){return oe.getHours()}),m=y.range,x=a(function(oe){oe.setHours(0,0,0,0)},function(oe,Ae){oe.setDate(oe.getDate()+Ae)},function(oe,Ae){return(Ae-oe-(Ae.getTimezoneOffset()-oe.getTimezoneOffset())*l)/u},function(oe){return oe.getDate()-1}),T=x.range;function _(oe){return a(function(Ae){Ae.setDate(Ae.getDate()-(Ae.getDay()+7-oe)%7),Ae.setHours(0,0,0,0)},function(Ae,Xe){Ae.setDate(Ae.getDate()+Xe*7)},function(Ae,Xe){return(Xe-Ae-(Xe.getTimezoneOffset()-Ae.getTimezoneOffset())*l)/f})}var b=_(0),w=_(1),k=_(2),M=_(3),q=_(4),E=_(5),D=_(6),P=b.range,R=w.range,z=k.range,I=M.range,B=q.range,G=E.range,Y=D.range,V=a(function(oe){oe.setDate(1),oe.setHours(0,0,0,0)},function(oe,Ae){oe.setMonth(oe.getMonth()+Ae)},function(oe,Ae){return Ae.getMonth()-oe.getMonth()+(Ae.getFullYear()-oe.getFullYear())*12},function(oe){return oe.getMonth()}),H=V.range,X=a(function(oe){oe.setMonth(0,1),oe.setHours(0,0,0,0)},function(oe,Ae){oe.setFullYear(oe.getFullYear()+Ae)},function(oe,Ae){return Ae.getFullYear()-oe.getFullYear()},function(oe){return oe.getFullYear()});X.every=function(oe){return!isFinite(oe=Math.floor(oe))||!(oe>0)?null:a(function(Ae){Ae.setFullYear(Math.floor(Ae.getFullYear()/oe)*oe),Ae.setMonth(0,1),Ae.setHours(0,0,0,0)},function(Ae,Xe){Ae.setFullYear(Ae.getFullYear()+Xe*oe)})};var j=X.range,ee=a(function(oe){oe.setUTCSeconds(0,0)},function(oe,Ae){oe.setTime(+oe+Ae*l)},function(oe,Ae){return(Ae-oe)/l},function(oe){return oe.getUTCMinutes()}),fe=ee.range,ie=a(function(oe){oe.setUTCMinutes(0,0,0)},function(oe,Ae){oe.setTime(+oe+Ae*s)},function(oe,Ae){return(Ae-oe)/s},function(oe){return oe.getUTCHours()}),ue=ie.range,K=a(function(oe){oe.setUTCHours(0,0,0,0)},function(oe,Ae){oe.setUTCDate(oe.getUTCDate()+Ae)},function(oe,Ae){return(Ae-oe)/u},function(oe){return oe.getUTCDate()-1}),we=K.range;function se(oe){return a(function(Ae){Ae.setUTCDate(Ae.getUTCDate()-(Ae.getUTCDay()+7-oe)%7),Ae.setUTCHours(0,0,0,0)},function(Ae,Xe){Ae.setUTCDate(Ae.getUTCDate()+Xe*7)},function(Ae,Xe){return(Xe-Ae)/f})}var ce=se(0),he=se(1),ye=se(2),W=se(3),Q=se(4),Z=se(5),le=se(6),ve=ce.range,me=he.range,Ce=ye.range,Pe=W.range,Le=Q.range,ze=Z.range,Be=le.range,Ge=a(function(oe){oe.setUTCDate(1),oe.setUTCHours(0,0,0,0)},function(oe,Ae){oe.setUTCMonth(oe.getUTCMonth()+Ae)},function(oe,Ae){return Ae.getUTCMonth()-oe.getUTCMonth()+(Ae.getUTCFullYear()-oe.getUTCFullYear())*12},function(oe){return oe.getUTCMonth()}),De=Ge.range,Oe=a(function(oe){oe.setUTCMonth(0,1),oe.setUTCHours(0,0,0,0)},function(oe,Ae){oe.setUTCFullYear(oe.getUTCFullYear()+Ae)},function(oe,Ae){return Ae.getUTCFullYear()-oe.getUTCFullYear()},function(oe){return oe.getUTCFullYear()});Oe.every=function(oe){return!isFinite(oe=Math.floor(oe))||!(oe>0)?null:a(function(Ae){Ae.setUTCFullYear(Math.floor(Ae.getUTCFullYear()/oe)*oe),Ae.setUTCMonth(0,1),Ae.setUTCHours(0,0,0,0)},function(Ae,Xe){Ae.setUTCFullYear(Ae.getUTCFullYear()+Xe*oe)})};var Ue=Oe.range;e.timeDay=x,e.timeDays=T,e.timeFriday=E,e.timeFridays=G,e.timeHour=y,e.timeHours=m,e.timeInterval=a,e.timeMillisecond=n,e.timeMilliseconds=i,e.timeMinute=d,e.timeMinutes=p,e.timeMonday=w,e.timeMondays=R,e.timeMonth=V,e.timeMonths=H,e.timeSaturday=D,e.timeSaturdays=Y,e.timeSecond=c,e.timeSeconds=v,e.timeSunday=b,e.timeSundays=P,e.timeThursday=q,e.timeThursdays=B,e.timeTuesday=k,e.timeTuesdays=z,e.timeWednesday=M,e.timeWednesdays=I,e.timeWeek=b,e.timeWeeks=P,e.timeYear=X,e.timeYears=j,e.utcDay=K,e.utcDays=we,e.utcFriday=Z,e.utcFridays=ze,e.utcHour=ie,e.utcHours=ue,e.utcMillisecond=n,e.utcMilliseconds=i,e.utcMinute=ee,e.utcMinutes=fe,e.utcMonday=he,e.utcMondays=me,e.utcMonth=Ge,e.utcMonths=De,e.utcSaturday=le,e.utcSaturdays=Be,e.utcSecond=c,e.utcSeconds=v,e.utcSunday=ce,e.utcSundays=ve,e.utcThursday=Q,e.utcThursdays=Le,e.utcTuesday=ye,e.utcTuesdays=Ce,e.utcWednesday=W,e.utcWednesdays=Pe,e.utcWeek=ce,e.utcWeeks=ve,e.utcYear=Oe,e.utcYears=Ue,Object.defineProperty(e,"__esModule",{value:!0})})});var Ef=N((_p,tM)=>{(function(e,r){typeof _p=="object"&&typeof tM!="undefined"?r(_p,ob()):(e=e||self,r(e.d3=e.d3||{},e.d3))})(_p,function(e,r){"use strict";function t(ne){if(0<=ne.y&&ne.y<100){var de=new Date(-1,ne.m,ne.d,ne.H,ne.M,ne.S,ne.L);return de.setFullYear(ne.y),de}return new Date(ne.y,ne.m,ne.d,ne.H,ne.M,ne.S,ne.L)}function a(ne){if(0<=ne.y&&ne.y<100){var de=new Date(Date.UTC(-1,ne.m,ne.d,ne.H,ne.M,ne.S,ne.L));return de.setUTCFullYear(ne.y),de}return new Date(Date.UTC(ne.y,ne.m,ne.d,ne.H,ne.M,ne.S,ne.L))}function n(ne,de,Re){return{y:ne,m:de,d:Re,H:0,M:0,S:0,L:0}}function i(ne){var de=ne.dateTime,Re=ne.date,Fe=ne.time,Ke=ne.periods,cr=ne.days,ur=ne.shortDays,Mr=ne.months,Ir=ne.shortMonths,Gr=v(Ke),et=d(Ke),qt=v(cr),ct=d(cr),Ot=v(ur),gt=d(ur),wa=v(Mr),Zt=d(Mr),Xt=v(Ir),Na=d(Ir),ua={a:Xa,A:ol,b:vt,B:Mn,c:null,d:V,e:V,f:fe,H,I:X,j,L:ee,m:ie,M:ue,p:Pt,q:Ys,Q:qe,s:He,S:K,u:we,U:se,V:ce,w:he,W:ye,x:null,X:null,y:W,Y:Q,Z,"%":Te},Jt={a:yn,A:ji,b:Yt,B:Zi,c:null,d:le,e:le,f:Le,H:ve,I:me,j:Ce,L:Pe,m:ze,M:Be,p:Bl,q:Hl,Q:qe,s:He,S:Ge,u:De,U:Oe,V:Ue,w:oe,W:Ae,x:null,X:null,y:Xe,Y:dr,Z:Ne,"%":Te},ar={a:$t,A:ft,b:Ea,B:An,c:Kt,d:q,e:q,f:I,H:D,I:D,j:E,L:z,m:M,M:P,p:Rt,q:k,Q:G,s:Y,S:R,u:y,U:m,V:x,w:p,W:T,x:_t,X:Vt,y:b,Y:_,Z:w,"%":B};ua.x=Jr(Re,ua),ua.X=Jr(Fe,ua),ua.c=Jr(de,ua),Jt.x=Jr(Re,Jt),Jt.X=Jr(Fe,Jt),Jt.c=Jr(de,Jt);function Jr(mr,Kr){return function(ht){var fr=[],Ia=-1,At=0,za=mr.length,Or,Xi,Ws;for(ht instanceof Date||(ht=new Date(+ht));++Ia53)return null;"w"in fr||(fr.w=1),"Z"in fr?(At=a(n(fr.y,0,1)),za=At.getUTCDay(),At=za>4||za===0?r.utcMonday.ceil(At):r.utcMonday(At),At=r.utcDay.offset(At,(fr.V-1)*7),fr.y=At.getUTCFullYear(),fr.m=At.getUTCMonth(),fr.d=At.getUTCDate()+(fr.w+6)%7):(At=t(n(fr.y,0,1)),za=At.getDay(),At=za>4||za===0?r.timeMonday.ceil(At):r.timeMonday(At),At=r.timeDay.offset(At,(fr.V-1)*7),fr.y=At.getFullYear(),fr.m=At.getMonth(),fr.d=At.getDate()+(fr.w+6)%7)}else("W"in fr||"U"in fr)&&("w"in fr||(fr.w="u"in fr?fr.u%7:"W"in fr?1:0),za="Z"in fr?a(n(fr.y,0,1)).getUTCDay():t(n(fr.y,0,1)).getDay(),fr.m=0,fr.d="W"in fr?(fr.w+6)%7+fr.W*7-(za+5)%7:fr.w+fr.U*7-(za+6)%7);return"Z"in fr?(fr.H+=fr.Z/100|0,fr.M+=fr.Z%100,a(fr)):t(fr)}}function $r(mr,Kr,ht,fr){for(var Ia=0,At=Kr.length,za=ht.length,Or,Xi;Ia=za)return-1;if(Or=Kr.charCodeAt(Ia++),Or===37){if(Or=Kr.charAt(Ia++),Xi=ar[Or in o?Kr.charAt(Ia++):Or],!Xi||(fr=Xi(mr,ht,fr))<0)return-1}else if(Or!=ht.charCodeAt(fr++))return-1}return fr}function Rt(mr,Kr,ht){var fr=Gr.exec(Kr.slice(ht));return fr?(mr.p=et[fr[0].toLowerCase()],ht+fr[0].length):-1}function $t(mr,Kr,ht){var fr=Ot.exec(Kr.slice(ht));return fr?(mr.w=gt[fr[0].toLowerCase()],ht+fr[0].length):-1}function ft(mr,Kr,ht){var fr=qt.exec(Kr.slice(ht));return fr?(mr.w=ct[fr[0].toLowerCase()],ht+fr[0].length):-1}function Ea(mr,Kr,ht){var fr=Xt.exec(Kr.slice(ht));return fr?(mr.m=Na[fr[0].toLowerCase()],ht+fr[0].length):-1}function An(mr,Kr,ht){var fr=wa.exec(Kr.slice(ht));return fr?(mr.m=Zt[fr[0].toLowerCase()],ht+fr[0].length):-1}function Kt(mr,Kr,ht){return $r(mr,de,Kr,ht)}function _t(mr,Kr,ht){return $r(mr,Re,Kr,ht)}function Vt(mr,Kr,ht){return $r(mr,Fe,Kr,ht)}function Xa(mr){return ur[mr.getDay()]}function ol(mr){return cr[mr.getDay()]}function vt(mr){return Ir[mr.getMonth()]}function Mn(mr){return Mr[mr.getMonth()]}function Pt(mr){return Ke[+(mr.getHours()>=12)]}function Ys(mr){return 1+~~(mr.getMonth()/3)}function yn(mr){return ur[mr.getUTCDay()]}function ji(mr){return cr[mr.getUTCDay()]}function Yt(mr){return Ir[mr.getUTCMonth()]}function Zi(mr){return Mr[mr.getUTCMonth()]}function Bl(mr){return Ke[+(mr.getUTCHours()>=12)]}function Hl(mr){return 1+~~(mr.getUTCMonth()/3)}return{format:function(mr){var Kr=Jr(mr+="",ua);return Kr.toString=function(){return mr},Kr},parse:function(mr){var Kr=Xr(mr+="",!1);return Kr.toString=function(){return mr},Kr},utcFormat:function(mr){var Kr=Jr(mr+="",Jt);return Kr.toString=function(){return mr},Kr},utcParse:function(mr){var Kr=Xr(mr+="",!0);return Kr.toString=function(){return mr},Kr}}}var o={"-":"",_:" ",0:"0"},l=/^\s*\d+/,s=/^%/,u=/[\\^$*+?|[\]().{}]/g;function f(ne,de,Re){var Fe=ne<0?"-":"",Ke=(Fe?-ne:ne)+"",cr=Ke.length;return Fe+(cr68?1900:2e3),Re+Fe[0].length):-1}function w(ne,de,Re){var Fe=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(de.slice(Re,Re+6));return Fe?(ne.Z=Fe[1]?0:-(Fe[2]+(Fe[3]||"00")),Re+Fe[0].length):-1}function k(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+1));return Fe?(ne.q=Fe[0]*3-3,Re+Fe[0].length):-1}function M(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+2));return Fe?(ne.m=Fe[0]-1,Re+Fe[0].length):-1}function q(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+2));return Fe?(ne.d=+Fe[0],Re+Fe[0].length):-1}function E(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+3));return Fe?(ne.m=0,ne.d=+Fe[0],Re+Fe[0].length):-1}function D(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+2));return Fe?(ne.H=+Fe[0],Re+Fe[0].length):-1}function P(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+2));return Fe?(ne.M=+Fe[0],Re+Fe[0].length):-1}function R(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+2));return Fe?(ne.S=+Fe[0],Re+Fe[0].length):-1}function z(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+3));return Fe?(ne.L=+Fe[0],Re+Fe[0].length):-1}function I(ne,de,Re){var Fe=l.exec(de.slice(Re,Re+6));return Fe?(ne.L=Math.floor(Fe[0]/1e3),Re+Fe[0].length):-1}function B(ne,de,Re){var Fe=s.exec(de.slice(Re,Re+1));return Fe?Re+Fe[0].length:-1}function G(ne,de,Re){var Fe=l.exec(de.slice(Re));return Fe?(ne.Q=+Fe[0],Re+Fe[0].length):-1}function Y(ne,de,Re){var Fe=l.exec(de.slice(Re));return Fe?(ne.s=+Fe[0],Re+Fe[0].length):-1}function V(ne,de){return f(ne.getDate(),de,2)}function H(ne,de){return f(ne.getHours(),de,2)}function X(ne,de){return f(ne.getHours()%12||12,de,2)}function j(ne,de){return f(1+r.timeDay.count(r.timeYear(ne),ne),de,3)}function ee(ne,de){return f(ne.getMilliseconds(),de,3)}function fe(ne,de){return ee(ne,de)+"000"}function ie(ne,de){return f(ne.getMonth()+1,de,2)}function ue(ne,de){return f(ne.getMinutes(),de,2)}function K(ne,de){return f(ne.getSeconds(),de,2)}function we(ne){var de=ne.getDay();return de===0?7:de}function se(ne,de){return f(r.timeSunday.count(r.timeYear(ne)-1,ne),de,2)}function ce(ne,de){var Re=ne.getDay();return ne=Re>=4||Re===0?r.timeThursday(ne):r.timeThursday.ceil(ne),f(r.timeThursday.count(r.timeYear(ne),ne)+(r.timeYear(ne).getDay()===4),de,2)}function he(ne){return ne.getDay()}function ye(ne,de){return f(r.timeMonday.count(r.timeYear(ne)-1,ne),de,2)}function W(ne,de){return f(ne.getFullYear()%100,de,2)}function Q(ne,de){return f(ne.getFullYear()%1e4,de,4)}function Z(ne){var de=ne.getTimezoneOffset();return(de>0?"-":(de*=-1,"+"))+f(de/60|0,"0",2)+f(de%60,"0",2)}function le(ne,de){return f(ne.getUTCDate(),de,2)}function ve(ne,de){return f(ne.getUTCHours(),de,2)}function me(ne,de){return f(ne.getUTCHours()%12||12,de,2)}function Ce(ne,de){return f(1+r.utcDay.count(r.utcYear(ne),ne),de,3)}function Pe(ne,de){return f(ne.getUTCMilliseconds(),de,3)}function Le(ne,de){return Pe(ne,de)+"000"}function ze(ne,de){return f(ne.getUTCMonth()+1,de,2)}function Be(ne,de){return f(ne.getUTCMinutes(),de,2)}function Ge(ne,de){return f(ne.getUTCSeconds(),de,2)}function De(ne){var de=ne.getUTCDay();return de===0?7:de}function Oe(ne,de){return f(r.utcSunday.count(r.utcYear(ne)-1,ne),de,2)}function Ue(ne,de){var Re=ne.getUTCDay();return ne=Re>=4||Re===0?r.utcThursday(ne):r.utcThursday.ceil(ne),f(r.utcThursday.count(r.utcYear(ne),ne)+(r.utcYear(ne).getUTCDay()===4),de,2)}function oe(ne){return ne.getUTCDay()}function Ae(ne,de){return f(r.utcMonday.count(r.utcYear(ne)-1,ne),de,2)}function Xe(ne,de){return f(ne.getUTCFullYear()%100,de,2)}function dr(ne,de){return f(ne.getUTCFullYear()%1e4,de,4)}function Ne(){return"+0000"}function Te(){return"%"}function qe(ne){return+ne}function He(ne){return Math.floor(+ne/1e3)}var Je;We({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function We(ne){return Je=i(ne),e.timeFormat=Je.format,e.timeParse=Je.parse,e.utcFormat=Je.utcFormat,e.utcParse=Je.utcParse,Je}var Ze="%Y-%m-%dT%H:%M:%S.%LZ";function lr(ne){return ne.toISOString()}var rr=Date.prototype.toISOString?lr:e.utcFormat(Ze);function er(ne){var de=new Date(ne);return isNaN(de)?null:de}var Ie=+new Date("2000-01-01T00:00:00.000Z")?er:e.utcParse(Ze);e.isoFormat=rr,e.isoParse=Ie,e.timeFormatDefaultLocale=We,e.timeFormatLocale=i,Object.defineProperty(e,"__esModule",{value:!0})})});var lb=N((wp,aM)=>{(function(e,r){typeof wp=="object"&&typeof aM!="undefined"?r(wp):(e=typeof globalThis!="undefined"?globalThis:e||self,r(e.d3=e.d3||{}))})(wp,function(e){"use strict";function r(M){return Math.abs(M=Math.round(M))>=1e21?M.toLocaleString("en").replace(/,/g,""):M.toString(10)}function t(M,q){if((E=(M=q?M.toExponential(q-1):M.toExponential()).indexOf("e"))<0)return null;var E,D=M.slice(0,E);return[D.length>1?D[0]+D.slice(2):D,+M.slice(E+1)]}function a(M){return M=t(Math.abs(M)),M?M[1]:NaN}function n(M,q){return function(E,D){for(var P=E.length,R=[],z=0,I=M[0],B=0;P>0&&I>0&&(B+I+1>D&&(I=Math.max(1,D-B)),R.push(E.substring(P-=I,P+I)),!((B+=I+1)>D));)I=M[z=(z+1)%M.length];return R.reverse().join(q)}}function i(M){return function(q){return q.replace(/[0-9]/g,function(E){return M[+E]})}}var o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function l(M){if(!(q=o.exec(M)))throw new Error("invalid format: "+M);var q;return new s({fill:q[1],align:q[2],sign:q[3],symbol:q[4],zero:q[5],width:q[6],comma:q[7],precision:q[8]&&q[8].slice(1),trim:q[9],type:q[10]})}l.prototype=s.prototype;function s(M){this.fill=M.fill===void 0?" ":M.fill+"",this.align=M.align===void 0?">":M.align+"",this.sign=M.sign===void 0?"-":M.sign+"",this.symbol=M.symbol===void 0?"":M.symbol+"",this.zero=!!M.zero,this.width=M.width===void 0?void 0:+M.width,this.comma=!!M.comma,this.precision=M.precision===void 0?void 0:+M.precision,this.trim=!!M.trim,this.type=M.type===void 0?"":M.type+""}s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function u(M){e:for(var q=M.length,E=1,D=-1,P;E0&&(D=0);break}return D>0?M.slice(0,D)+M.slice(P+1):M}var f;function c(M,q){var E=t(M,q);if(!E)return M+"";var D=E[0],P=E[1],R=P-(f=Math.max(-8,Math.min(8,Math.floor(P/3)))*3)+1,z=D.length;return R===z?D:R>z?D+new Array(R-z+1).join("0"):R>0?D.slice(0,R)+"."+D.slice(R):"0."+new Array(1-R).join("0")+t(M,Math.max(0,q+R-1))[0]}function v(M,q){var E=t(M,q);if(!E)return M+"";var D=E[0],P=E[1];return P<0?"0."+new Array(-P).join("0")+D:D.length>P+1?D.slice(0,P+1)+"."+D.slice(P+1):D+new Array(P-D.length+2).join("0")}var d={"%":function(M,q){return(M*100).toFixed(q)},b:function(M){return Math.round(M).toString(2)},c:function(M){return M+""},d:r,e:function(M,q){return M.toExponential(q)},f:function(M,q){return M.toFixed(q)},g:function(M,q){return M.toPrecision(q)},o:function(M){return Math.round(M).toString(8)},p:function(M,q){return v(M*100,q)},r:v,s:c,X:function(M){return Math.round(M).toString(16).toUpperCase()},x:function(M){return Math.round(M).toString(16)}};function p(M){return M}var y=Array.prototype.map,m=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function x(M){var q=M.grouping===void 0||M.thousands===void 0?p:n(y.call(M.grouping,Number),M.thousands+""),E=M.currency===void 0?"":M.currency[0]+"",D=M.currency===void 0?"":M.currency[1]+"",P=M.decimal===void 0?".":M.decimal+"",R=M.numerals===void 0?p:i(y.call(M.numerals,String)),z=M.percent===void 0?"%":M.percent+"",I=M.minus===void 0?"-":M.minus+"",B=M.nan===void 0?"NaN":M.nan+"";function G(V){V=l(V);var H=V.fill,X=V.align,j=V.sign,ee=V.symbol,fe=V.zero,ie=V.width,ue=V.comma,K=V.precision,we=V.trim,se=V.type;se==="n"?(ue=!0,se="g"):d[se]||(K===void 0&&(K=12),we=!0,se="g"),(fe||H==="0"&&X==="=")&&(fe=!0,H="0",X="=");var ce=ee==="$"?E:ee==="#"&&/[boxX]/.test(se)?"0"+se.toLowerCase():"",he=ee==="$"?D:/[%p]/.test(se)?z:"",ye=d[se],W=/[defgprs%]/.test(se);K=K===void 0?6:/[gprs]/.test(se)?Math.max(1,Math.min(21,K)):Math.max(0,Math.min(20,K));function Q(Z){var le=ce,ve=he,me,Ce,Pe;if(se==="c")ve=ye(Z)+ve,Z="";else{Z=+Z;var Le=Z<0||1/Z<0;if(Z=isNaN(Z)?B:ye(Math.abs(Z),K),we&&(Z=u(Z)),Le&&+Z==0&&j!=="+"&&(Le=!1),le=(Le?j==="("?j:I:j==="-"||j==="("?"":j)+le,ve=(se==="s"?m[8+f/3]:"")+ve+(Le&&j==="("?")":""),W){for(me=-1,Ce=Z.length;++mePe||Pe>57){ve=(Pe===46?P+Z.slice(me+1):Z.slice(me))+ve,Z=Z.slice(0,me);break}}}ue&&!fe&&(Z=q(Z,1/0));var ze=le.length+Z.length+ve.length,Be=ze>1)+le+Z+ve+Be.slice(ze);break;default:Z=Be+le+Z+ve;break}return R(Z)}return Q.toString=function(){return V+""},Q}function Y(V,H){var X=G((V=l(V),V.type="f",V)),j=Math.max(-8,Math.min(8,Math.floor(a(H)/3)))*3,ee=Math.pow(10,-j),fe=m[8+j/3];return function(ie){return X(ee*ie)+fe}}return{format:G,formatPrefix:Y}}var T;_({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function _(M){return T=x(M),e.format=T.format,e.formatPrefix=T.formatPrefix,T}function b(M){return Math.max(0,-a(Math.abs(M)))}function w(M,q){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(a(q)/3)))*3-a(Math.abs(M)))}function k(M,q){return M=Math.abs(M),q=Math.abs(q)-M,Math.max(0,a(q)-a(M))+1}e.FormatSpecifier=s,e.formatDefaultLocale=_,e.formatLocale=x,e.formatSpecifier=l,e.precisionFixed=b,e.precisionPrefix=w,e.precisionRound=k,Object.defineProperty(e,"__esModule",{value:!0})})});var iM=N((ECe,nM)=>{"use strict";nM.exports=function(e){for(var r=e.length,t,a=0;a13)&&t!==32&&t!==133&&t!==160&&t!==5760&&t!==6158&&(t<8192||t>8205)&&t!==8232&&t!==8233&&t!==8239&&t!==8287&&t!==8288&&t!==12288&&t!==65279)return!1;return!0}});var Rr=N((DCe,oM)=>{"use strict";var coe=iM();oM.exports=function(e){var r=typeof e;if(r==="string"){var t=e;if(e=+e,e===0&&coe(t))return!1}else if(r!=="number")return!1;return e-e<1}});var Ft=N((RCe,lM)=>{"use strict";lM.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"\u2212"}});var sb=N((Tp,sM)=>{(function(e,r){typeof Tp=="object"&&typeof sM!="undefined"?r(Tp):(e=typeof globalThis!="undefined"?globalThis:e||self,r(e["base64-arraybuffer"]={}))})(Tp,function(e){"use strict";for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array=="undefined"?[]:new Uint8Array(256),a=0;a>2],f+=r[(l[s]&3)<<4|l[s+1]>>4],f+=r[(l[s+1]&15)<<2|l[s+2]>>6],f+=r[l[s+2]&63];return u%3===2?f=f.substring(0,f.length-1)+"=":u%3===1&&(f=f.substring(0,f.length-2)+"=="),f},i=function(o){var l=o.length*.75,s=o.length,u,f=0,c,v,d,p;o[o.length-1]==="="&&(l--,o[o.length-2]==="="&&l--);var y=new ArrayBuffer(l),m=new Uint8Array(y);for(u=0;u>4,m[f++]=(v&15)<<4|d>>2,m[f++]=(d&3)<<6|p&63;return y};e.decode=i,e.encode=n,Object.defineProperty(e,"__esModule",{value:!0})})});var Vl=N((PCe,uM)=>{"use strict";uM.exports=function(r){return window&&window.process&&window.process.versions?Object.prototype.toString.call(r)==="[object Object]":Object.prototype.toString.call(r)==="[object Object]"&&Object.getPrototypeOf(r).hasOwnProperty("hasOwnProperty")}});var Yn=N(Ki=>{"use strict";var voe=sb().decode,hoe=Vl(),ub=Array.isArray,doe=ArrayBuffer,poe=DataView;function fM(e){return doe.isView(e)&&!(e instanceof poe)}Ki.isTypedArray=fM;function Ap(e){return ub(e)||fM(e)}Ki.isArrayOrTypedArray=Ap;function yoe(e){return!Ap(e[0])}Ki.isArray1D=yoe;Ki.ensureArray=function(e,r){return ub(e)||(e=[]),e.length=r,e};var Da={u1c:typeof Uint8ClampedArray=="undefined"?void 0:Uint8ClampedArray,i1:typeof Int8Array=="undefined"?void 0:Int8Array,u1:typeof Uint8Array=="undefined"?void 0:Uint8Array,i2:typeof Int16Array=="undefined"?void 0:Int16Array,u2:typeof Uint16Array=="undefined"?void 0:Uint16Array,i4:typeof Int32Array=="undefined"?void 0:Int32Array,u4:typeof Uint32Array=="undefined"?void 0:Uint32Array,f4:typeof Float32Array=="undefined"?void 0:Float32Array,f8:typeof Float64Array=="undefined"?void 0:Float64Array};Da.uint8c=Da.u1c;Da.uint8=Da.u1;Da.int8=Da.i1;Da.uint16=Da.u2;Da.int16=Da.i2;Da.uint32=Da.u4;Da.int32=Da.i4;Da.float32=Da.f4;Da.float64=Da.f8;function fb(e){return e.constructor===ArrayBuffer}Ki.isArrayBuffer=fb;Ki.decodeTypedArraySpec=function(e){var r=[],t=moe(e),a=t.dtype,n=Da[a];if(!n)throw new Error('Error in dtype: "'+a+'"');var i=n.BYTES_PER_ELEMENT,o=t.bdata;fb(o)||(o=voe(o));var l=t.shape===void 0?[o.byteLength/i]:(""+t.shape).split(",");l.reverse();var s=l.length,u,f,c=+l[0],v=i*c,d=0;if(s===1)r=new n(o);else if(s===2)for(u=+l[1],f=0;f{"use strict";var vM=Rr(),vb=Yn().isArrayOrTypedArray;yM.exports=function(r,t){if(vM(t))t=String(t);else if(typeof t!="string"||t.slice(-4)==="[-1]")throw"bad property string";var a=t.split("."),n,i,o,l;for(l=0;l{"use strict";var Df=Mp(),woe=/^\w*$/,Toe=0,mM=1,kp=2,gM=3,Qs=4;bM.exports=function(r,t,a,n){a=a||"name",n=n||"value";var i,o,l,s={};t&&t.length?(l=Df(r,t),o=l.get()):o=r,t=t||"";var u={};if(o)for(i=0;i2)return s[d]=s[d]|kp,c.set(v,null);if(f){for(i=d;i{"use strict";var Aoe=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,Moe=/^[^\.\[\]]+$/;_M.exports=function(e,r){for(;r;){var t=e.match(Aoe);if(t)e=t[1];else if(e.match(Moe))e="";else throw new Error("bad relativeAttr call:"+[e,r]);if(r.charAt(0)==="^")r=r.slice(1);else break}return e&&r.charAt(0)!=="["?e+"."+r:e+r}});var Sp=N((OCe,TM)=>{"use strict";var koe=Rr();TM.exports=function(r,t){if(r>0)return Math.log(r)/Math.LN10;var a=Math.log(Math.min(t[0],t[1]))/Math.LN10;return koe(a)||(a=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),a}});var kM=N((BCe,MM)=>{"use strict";var AM=Yn().isArrayOrTypedArray,Jv=Vl();MM.exports=function e(r,t){for(var a in t){var n=t[a],i=r[a];if(i!==n)if(a.charAt(0)==="_"||typeof n=="function"){if(a in r)continue;r[a]=n}else if(AM(n)&&AM(i)&&Jv(n[0])){if(a==="customdata"||a==="ids")continue;for(var o=Math.min(n.length,i.length),l=0;l{"use strict";function Soe(e,r){var t=e%r;return t<0?t+r:t}function qoe(e,r){return Math.abs(e)>r/2?e-Math.round(e/r)*r:e}SM.exports={mod:Soe,modHalf:qoe}});var qn=N((UCe,qp)=>{(function(e){var r=/^\s+/,t=/\s+$/,a=0,n=e.round,i=e.min,o=e.max,l=e.random;function s(W,Q){if(W=W||"",Q=Q||{},W instanceof s)return W;if(!(this instanceof s))return new s(W,Q);var Z=u(W);this._originalInput=W,this._r=Z.r,this._g=Z.g,this._b=Z.b,this._a=Z.a,this._roundA=n(100*this._a)/100,this._format=Q.format||Z.format,this._gradientType=Q.gradientType,this._r<1&&(this._r=n(this._r)),this._g<1&&(this._g=n(this._g)),this._b<1&&(this._b=n(this._b)),this._ok=Z.ok,this._tc_id=a++}s.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var W=this.toRgb();return(W.r*299+W.g*587+W.b*114)/1e3},getLuminance:function(){var W=this.toRgb(),Q,Z,le,ve,me,Ce;return Q=W.r/255,Z=W.g/255,le=W.b/255,Q<=.03928?ve=Q/12.92:ve=e.pow((Q+.055)/1.055,2.4),Z<=.03928?me=Z/12.92:me=e.pow((Z+.055)/1.055,2.4),le<=.03928?Ce=le/12.92:Ce=e.pow((le+.055)/1.055,2.4),.2126*ve+.7152*me+.0722*Ce},setAlpha:function(W){return this._a=V(W),this._roundA=n(100*this._a)/100,this},toHsv:function(){var W=d(this._r,this._g,this._b);return{h:W.h*360,s:W.s,v:W.v,a:this._a}},toHsvString:function(){var W=d(this._r,this._g,this._b),Q=n(W.h*360),Z=n(W.s*100),le=n(W.v*100);return this._a==1?"hsv("+Q+", "+Z+"%, "+le+"%)":"hsva("+Q+", "+Z+"%, "+le+"%, "+this._roundA+")"},toHsl:function(){var W=c(this._r,this._g,this._b);return{h:W.h*360,s:W.s,l:W.l,a:this._a}},toHslString:function(){var W=c(this._r,this._g,this._b),Q=n(W.h*360),Z=n(W.s*100),le=n(W.l*100);return this._a==1?"hsl("+Q+", "+Z+"%, "+le+"%)":"hsla("+Q+", "+Z+"%, "+le+"%, "+this._roundA+")"},toHex:function(W){return y(this._r,this._g,this._b,W)},toHexString:function(W){return"#"+this.toHex(W)},toHex8:function(W){return m(this._r,this._g,this._b,this._a,W)},toHex8String:function(W){return"#"+this.toHex8(W)},toRgb:function(){return{r:n(this._r),g:n(this._g),b:n(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+n(this._r)+", "+n(this._g)+", "+n(this._b)+")":"rgba("+n(this._r)+", "+n(this._g)+", "+n(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:n(H(this._r,255)*100)+"%",g:n(H(this._g,255)*100)+"%",b:n(H(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+n(H(this._r,255)*100)+"%, "+n(H(this._g,255)*100)+"%, "+n(H(this._b,255)*100)+"%)":"rgba("+n(H(this._r,255)*100)+"%, "+n(H(this._g,255)*100)+"%, "+n(H(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:G[y(this._r,this._g,this._b,!0)]||!1},toFilter:function(W){var Q="#"+x(this._r,this._g,this._b,this._a),Z=Q,le=this._gradientType?"GradientType = 1, ":"";if(W){var ve=s(W);Z="#"+x(ve._r,ve._g,ve._b,ve._a)}return"progid:DXImageTransform.Microsoft.gradient("+le+"startColorstr="+Q+",endColorstr="+Z+")"},toString:function(W){var Q=!!W;W=W||this._format;var Z=!1,le=this._a<1&&this._a>=0,ve=!Q&&le&&(W==="hex"||W==="hex6"||W==="hex3"||W==="hex4"||W==="hex8"||W==="name");return ve?W==="name"&&this._a===0?this.toName():this.toRgbString():(W==="rgb"&&(Z=this.toRgbString()),W==="prgb"&&(Z=this.toPercentageRgbString()),(W==="hex"||W==="hex6")&&(Z=this.toHexString()),W==="hex3"&&(Z=this.toHexString(!0)),W==="hex4"&&(Z=this.toHex8String(!0)),W==="hex8"&&(Z=this.toHex8String()),W==="name"&&(Z=this.toName()),W==="hsl"&&(Z=this.toHslString()),W==="hsv"&&(Z=this.toHsvString()),Z||this.toHexString())},clone:function(){return s(this.toString())},_applyModification:function(W,Q){var Z=W.apply(null,[this].concat([].slice.call(Q)));return this._r=Z._r,this._g=Z._g,this._b=Z._b,this.setAlpha(Z._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(k,arguments)},darken:function(){return this._applyModification(M,arguments)},desaturate:function(){return this._applyModification(T,arguments)},saturate:function(){return this._applyModification(_,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(q,arguments)},_applyCombination:function(W,Q){return W.apply(null,[this].concat([].slice.call(Q)))},analogous:function(){return this._applyCombination(z,arguments)},complement:function(){return this._applyCombination(E,arguments)},monochromatic:function(){return this._applyCombination(I,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(D,arguments)},tetrad:function(){return this._applyCombination(P,arguments)}},s.fromRatio=function(W,Q){if(typeof W=="object"){var Z={};for(var le in W)W.hasOwnProperty(le)&&(le==="a"?Z[le]=W[le]:Z[le]=ue(W[le]));W=Z}return s(W,Q)};function u(W){var Q={r:0,g:0,b:0},Z=1,le=null,ve=null,me=null,Ce=!1,Pe=!1;return typeof W=="string"&&(W=he(W)),typeof W=="object"&&(ce(W.r)&&ce(W.g)&&ce(W.b)?(Q=f(W.r,W.g,W.b),Ce=!0,Pe=String(W.r).substr(-1)==="%"?"prgb":"rgb"):ce(W.h)&&ce(W.s)&&ce(W.v)?(le=ue(W.s),ve=ue(W.v),Q=p(W.h,le,ve),Ce=!0,Pe="hsv"):ce(W.h)&&ce(W.s)&&ce(W.l)&&(le=ue(W.s),me=ue(W.l),Q=v(W.h,le,me),Ce=!0,Pe="hsl"),W.hasOwnProperty("a")&&(Z=W.a)),Z=V(Z),{ok:Ce,format:W.format||Pe,r:i(255,o(Q.r,0)),g:i(255,o(Q.g,0)),b:i(255,o(Q.b,0)),a:Z}}function f(W,Q,Z){return{r:H(W,255)*255,g:H(Q,255)*255,b:H(Z,255)*255}}function c(W,Q,Z){W=H(W,255),Q=H(Q,255),Z=H(Z,255);var le=o(W,Q,Z),ve=i(W,Q,Z),me,Ce,Pe=(le+ve)/2;if(le==ve)me=Ce=0;else{var Le=le-ve;switch(Ce=Pe>.5?Le/(2-le-ve):Le/(le+ve),le){case W:me=(Q-Z)/Le+(Q1&&(Ge-=1),Ge<1/6?ze+(Be-ze)*6*Ge:Ge<1/2?Be:Ge<2/3?ze+(Be-ze)*(2/3-Ge)*6:ze}if(Q===0)le=ve=me=Z;else{var Pe=Z<.5?Z*(1+Q):Z+Q-Z*Q,Le=2*Z-Pe;le=Ce(Le,Pe,W+1/3),ve=Ce(Le,Pe,W),me=Ce(Le,Pe,W-1/3)}return{r:le*255,g:ve*255,b:me*255}}function d(W,Q,Z){W=H(W,255),Q=H(Q,255),Z=H(Z,255);var le=o(W,Q,Z),ve=i(W,Q,Z),me,Ce,Pe=le,Le=le-ve;if(Ce=le===0?0:Le/le,le==ve)me=0;else{switch(le){case W:me=(Q-Z)/Le+(Q>1)+720)%360;--Q;)le.h=(le.h+ve)%360,me.push(s(le));return me}function I(W,Q){Q=Q||6;for(var Z=s(W).toHsv(),le=Z.h,ve=Z.s,me=Z.v,Ce=[],Pe=1/Q;Q--;)Ce.push(s({h:le,s:ve,v:me})),me=(me+Pe)%1;return Ce}s.mix=function(W,Q,Z){Z=Z===0?0:Z||50;var le=s(W).toRgb(),ve=s(Q).toRgb(),me=Z/100,Ce={r:(ve.r-le.r)*me+le.r,g:(ve.g-le.g)*me+le.g,b:(ve.b-le.b)*me+le.b,a:(ve.a-le.a)*me+le.a};return s(Ce)},s.readability=function(W,Q){var Z=s(W),le=s(Q);return(e.max(Z.getLuminance(),le.getLuminance())+.05)/(e.min(Z.getLuminance(),le.getLuminance())+.05)},s.isReadable=function(W,Q,Z){var le=s.readability(W,Q),ve,me;switch(me=!1,ve=ye(Z),ve.level+ve.size){case"AAsmall":case"AAAlarge":me=le>=4.5;break;case"AAlarge":me=le>=3;break;case"AAAsmall":me=le>=7;break}return me},s.mostReadable=function(W,Q,Z){var le=null,ve=0,me,Ce,Pe,Le;Z=Z||{},Ce=Z.includeFallbackColors,Pe=Z.level,Le=Z.size;for(var ze=0;zeve&&(ve=me,le=s(Q[ze]));return s.isReadable(W,le,{level:Pe,size:Le})||!Ce?le:(Z.includeFallbackColors=!1,s.mostReadable(W,["#fff","#000"],Z))};var B=s.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},G=s.hexNames=Y(B);function Y(W){var Q={};for(var Z in W)W.hasOwnProperty(Z)&&(Q[W[Z]]=Z);return Q}function V(W){return W=parseFloat(W),(isNaN(W)||W<0||W>1)&&(W=1),W}function H(W,Q){ee(W)&&(W="100%");var Z=fe(W);return W=i(Q,o(0,parseFloat(W))),Z&&(W=parseInt(W*Q,10)/100),e.abs(W-Q)<1e-6?1:W%Q/parseFloat(Q)}function X(W){return i(1,o(0,W))}function j(W){return parseInt(W,16)}function ee(W){return typeof W=="string"&&W.indexOf(".")!=-1&&parseFloat(W)===1}function fe(W){return typeof W=="string"&&W.indexOf("%")!=-1}function ie(W){return W.length==1?"0"+W:""+W}function ue(W){return W<=1&&(W=W*100+"%"),W}function K(W){return e.round(parseFloat(W)*255).toString(16)}function we(W){return j(W)/255}var se=function(){var W="[-\\+]?\\d+%?",Q="[-\\+]?\\d*\\.\\d+%?",Z="(?:"+Q+")|(?:"+W+")",le="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?",ve="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?";return{CSS_UNIT:new RegExp(Z),rgb:new RegExp("rgb"+le),rgba:new RegExp("rgba"+ve),hsl:new RegExp("hsl"+le),hsla:new RegExp("hsla"+ve),hsv:new RegExp("hsv"+le),hsva:new RegExp("hsva"+ve),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ce(W){return!!se.CSS_UNIT.exec(W)}function he(W){W=W.replace(r,"").replace(t,"").toLowerCase();var Q=!1;if(B[W])W=B[W],Q=!0;else if(W=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Z;return(Z=se.rgb.exec(W))?{r:Z[1],g:Z[2],b:Z[3]}:(Z=se.rgba.exec(W))?{r:Z[1],g:Z[2],b:Z[3],a:Z[4]}:(Z=se.hsl.exec(W))?{h:Z[1],s:Z[2],l:Z[3]}:(Z=se.hsla.exec(W))?{h:Z[1],s:Z[2],l:Z[3],a:Z[4]}:(Z=se.hsv.exec(W))?{h:Z[1],s:Z[2],v:Z[3]}:(Z=se.hsva.exec(W))?{h:Z[1],s:Z[2],v:Z[3],a:Z[4]}:(Z=se.hex8.exec(W))?{r:j(Z[1]),g:j(Z[2]),b:j(Z[3]),a:we(Z[4]),format:Q?"name":"hex8"}:(Z=se.hex6.exec(W))?{r:j(Z[1]),g:j(Z[2]),b:j(Z[3]),format:Q?"name":"hex"}:(Z=se.hex4.exec(W))?{r:j(Z[1]+""+Z[1]),g:j(Z[2]+""+Z[2]),b:j(Z[3]+""+Z[3]),a:we(Z[4]+""+Z[4]),format:Q?"name":"hex8"}:(Z=se.hex3.exec(W))?{r:j(Z[1]+""+Z[1]),g:j(Z[2]+""+Z[2]),b:j(Z[3]+""+Z[3]),format:Q?"name":"hex"}:!1}function ye(W){var Q,Z;return W=W||{level:"AA",size:"small"},Q=(W.level||"AA").toUpperCase(),Z=(W.size||"small").toLowerCase(),Q!=="AA"&&Q!=="AAA"&&(Q="AA"),Z!=="small"&&Z!=="large"&&(Z="small"),{level:Q,size:Z}}typeof qp!="undefined"&&qp.exports?qp.exports=s:window.tinycolor=s})(Math)});var bt=N(Qv=>{"use strict";var qM=Vl(),$v=Array.isArray;function Loe(e,r){var t,a;for(t=0;t{"use strict";LM.exports=function(e){var r=e.variantValues,t=e.editType,a=e.colorEditType;a===void 0&&(a=t);var n={editType:t,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};e.noNumericWeightValues&&(n.valType="enumerated",n.values=n.extras,n.extras=void 0,n.min=void 0,n.max=void 0);var i={family:{valType:"string",noBlank:!0,strict:!0,editType:t},size:{valType:"number",min:1,editType:t},color:{valType:"color",editType:a},weight:n,style:{editType:t,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:e.noFontVariant?void 0:{editType:t,valType:"enumerated",values:r||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:e.noFontTextcase?void 0:{editType:t,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:e.noFontLineposition?void 0:{editType:t,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:e.noFontShadow?void 0:{editType:t,valType:"string",dflt:e.autoShadowDflt?"auto":"none"},editType:t};return e.autoSize&&(i.size.dflt="auto"),e.autoColor&&(i.color.dflt="auto"),e.arrayOk&&(i.family.arrayOk=!0,i.weight.arrayOk=!0,i.style.arrayOk=!0,e.noFontVariant||(i.variant.arrayOk=!0),e.noFontTextcase||(i.textcase.arrayOk=!0),e.noFontLineposition||(i.lineposition.arrayOk=!0),e.noFontShadow||(i.shadow.arrayOk=!0),i.size.arrayOk=!0,i.color.arrayOk=!0),i}});var eh=N((YCe,CM)=>{"use strict";CM.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}});var Pf=N((WCe,RM)=>{"use strict";var EM=eh(),DM=ga(),hb=DM({editType:"none"});hb.family.dflt=EM.HOVERFONT;hb.size.dflt=EM.HOVERFONTSIZE;RM.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoveranywhere:{valType:"boolean",dflt:!1,editType:"none"},clickanywhere:{valType:"boolean",dflt:!1,editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:hb,grouptitlefont:DM({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},showarrow:{valType:"boolean",dflt:!0,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}});var Lp=N((jCe,PM)=>{"use strict";var Coe=ga(),rh=Pf().hoverlabel,th=bt().extendFlat;PM.exports={hoverlabel:{bgcolor:th({},rh.bgcolor,{arrayOk:!0}),bordercolor:th({},rh.bordercolor,{arrayOk:!0}),font:Coe({arrayOk:!0,editType:"none"}),align:th({},rh.align,{arrayOk:!0}),namelength:th({},rh.namelength,{arrayOk:!0}),showarrow:th({},rh.showarrow),editType:"none"}}});var gn=N((ZCe,FM)=>{"use strict";var Eoe=ga(),Doe=Lp();FM.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:Eoe({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:Doe.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}});var eu=N((XCe,zM)=>{"use strict";var Roe=qn(),Cp={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},NM=Cp.RdBu;function Poe(e,r){if(r||(r=NM),!e)return r;function t(){try{e=Cp[e]||JSON.parse(e)}catch(a){e=r}}return typeof e=="string"&&(t(),typeof e=="string"&&t()),IM(e)?e:r}function IM(e){var r=0;if(!Array.isArray(e)||e.length<2||!e[0]||!e[e.length-1]||+e[0][0]!=0||+e[e.length-1][0]!=1)return!1;for(var t=0;t{"use strict";ru.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];ru.defaultLine="#444";ru.lightLine="#eee";ru.background="#fff";ru.borderLine="#BEC8D9";ru.lightFraction=100*10/11});var Tr=N(($Ce,OM)=>{"use strict";var Ln=qn(),Noe=Rr(),Ioe=Yn().isTypedArray,Ta=OM.exports={},Ep=fi();Ta.defaults=Ep.defaults;var zoe=Ta.defaultLine=Ep.defaultLine;Ta.lightLine=Ep.lightLine;var pb=Ta.background=Ep.background;Ta.tinyRGB=function(e){var r=e.toRgb();return"rgb("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+")"};Ta.rgb=function(e){return Ta.tinyRGB(Ln(e))};Ta.opacity=function(e){return e?Ln(e).getAlpha():0};Ta.addOpacity=function(e,r){var t=Ln(e).toRgb();return"rgba("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+", "+r+")"};Ta.combine=function(e,r){var t=Ln(e).toRgb();if(t.a===1)return Ln(e).toRgbString();var a=Ln(r||pb).toRgb(),n=a.a===1?a:{r:255*(1-a.a)+a.r*a.a,g:255*(1-a.a)+a.g*a.a,b:255*(1-a.a)+a.b*a.a},i={r:n.r*(1-t.a)+t.r*t.a,g:n.g*(1-t.a)+t.g*t.a,b:n.b*(1-t.a)+t.b*t.a};return Ln(i).toRgbString()};Ta.interpolate=function(e,r,t){var a=Ln(e).toRgb(),n=Ln(r).toRgb(),i={r:t*a.r+(1-t)*n.r,g:t*a.g+(1-t)*n.g,b:t*a.b+(1-t)*n.b};return Ln(i).toRgbString()};Ta.contrast=function(e,r,t){var a=Ln(e);a.getAlpha()!==1&&(a=Ln(Ta.combine(e,pb)));var n=a.isDark()?r?a.lighten(r):pb:t?a.darken(t):zoe;return n.toString()};Ta.stroke=function(e,r){var t=Ln(r);e.style({stroke:Ta.tinyRGB(t),"stroke-opacity":t.getAlpha()})};Ta.fill=function(e,r){var t=Ln(r);e.style({fill:Ta.tinyRGB(t),"fill-opacity":t.getAlpha()})};Ta.clean=function(e){if(!(!e||typeof e!="object")){var r=Object.keys(e),t,a,n,i;for(t=0;t=0)))return e;if(i===3)a[i]>1&&(a[i]=1);else if(a[i]>=1)return e}var o=Math.round(a[0]*255)+", "+Math.round(a[1]*255)+", "+Math.round(a[2]*255);return n?"rgba("+o+", "+a[3]+")":"rgb("+o+")"}});var Dp=N((KCe,BM)=>{"use strict";BM.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}});var Ff=N(HM=>{"use strict";HM.counter=function(e,r,t,a){var n=(r||"")+(t?"":"$"),i=a===!1?"":"^";return e==="xy"?new RegExp(i+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+n):new RegExp(i+e+"([2-9]|[1-9][0-9]+)?"+n)}});var YM=N(Cn=>{"use strict";var yb=Rr(),UM=qn(),GM=bt().extendFlat,Ooe=gn(),Boe=eu(),Hoe=Tr(),Uoe=Dp().DESELECTDIM,Nf=Mp(),VM=Ff().counter,Goe=Rf().modHalf,Qi=Yn().isArrayOrTypedArray,Yl=Yn().isTypedArraySpec,Wl=Yn().decodeTypedArraySpec;Cn.valObjectMeta={data_array:{coerceFunction:function(e,r,t){r.set(Qi(e)?e:Yl(e)?Wl(e):t)}},enumerated:{coerceFunction:function(e,r,t,a){a.coerceNumber&&(e=+e),a.values.indexOf(e)===-1?r.set(t):r.set(e)},validateFunction:function(e,r){r.coerceNumber&&(e=+e);for(var t=r.values,a=0;ai===!0||i===!1;n(e)||a.arrayOk&&Array.isArray(e)&&e.length>0&&e.every(n)?r.set(e):r.set(t)}},number:{coerceFunction:function(e,r,t,a){Yl(e)&&(e=Wl(e)),!yb(e)||a.min!==void 0&&ea.max?r.set(t):r.set(+e)}},integer:{coerceFunction:function(e,r,t,a){if((a.extras||[]).indexOf(e)!==-1){r.set(e);return}Yl(e)&&(e=Wl(e)),e%1||!yb(e)||a.min!==void 0&&ea.max?r.set(t):r.set(+e)}},string:{coerceFunction:function(e,r,t,a){if(typeof e!="string"){var n=typeof e=="number";a.strict===!0||!n?r.set(t):r.set(String(e))}else a.noBlank&&!e?r.set(t):r.set(e)}},color:{coerceFunction:function(e,r,t){Yl(e)&&(e=Wl(e)),UM(e).isValid()?r.set(e):r.set(t)}},colorlist:{coerceFunction:function(e,r,t){function a(n){return UM(n).isValid()}!Array.isArray(e)||!e.length?r.set(t):e.every(a)?r.set(e):r.set(t)}},colorscale:{coerceFunction:function(e,r,t){r.set(Boe.get(e,t))}},angle:{coerceFunction:function(e,r,t){Yl(e)&&(e=Wl(e)),e==="auto"?r.set("auto"):yb(e)?r.set(Goe(+e,360)):r.set(t)}},subplotid:{coerceFunction:function(e,r,t,a){var n=a.regex||VM(t);let i=o=>typeof o=="string"&&n.test(o);i(e)||a.arrayOk&&Qi(e)&&e.length>0&&e.every(i)?r.set(e):r.set(t)},validateFunction:function(e,r){var t=r.dflt;return e===t?!0:typeof e!="string"?!1:!!VM(t).test(e)}},flaglist:{coerceFunction:function(e,r,t,a){if((a.extras||[]).indexOf(e)!==-1){r.set(e);return}if(typeof e!="string"){r.set(t);return}for(var n=e.split("+"),i=0;i{"use strict";var WM={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},displayNotifier:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/un/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},jM={};function ZM(e,r){for(var t in e){var a=e[t];a.valType?r[t]=a.dflt:(r[t]||(r[t]={}),ZM(a,r[t]))}}ZM(WM,jM);XM.exports={configAttributes:WM,dfltConfig:jM}});var gb=N((tEe,JM)=>{"use strict";var mb=Sr(),Voe=Rr(),ah=[];JM.exports=function(e,r,t){var l;if(((l=t==null?void 0:t._context)==null?void 0:l.displayNotifier)===!1||ah.indexOf(e)!==-1)return;ah.push(e);var a=1e3;Voe(r)?a=r:r==="long"&&(a=3e3);var n=mb.select("body").selectAll(".plotly-notifier").data([0]);n.enter().append("div").classed("plotly-notifier",!0);var i=n.selectAll(".notifier-note").data(ah);function o(s){s.duration(700).style("opacity",0).each("end",function(u){var f=ah.indexOf(u);f!==-1&&ah.splice(f,1),mb.select(this).remove()})}i.enter().append("div").classed("notifier-note",!0).style("opacity",0).each(function(s){var u=mb.select(this);u.append("button").classed("notifier-close",!0).html("×").on("click",function(){u.transition().call(o)});for(var f=u.append("p"),c=s.split(//g),v=0;v{"use strict";var If=tu().dfltConfig,bb=gb(),xb=$M.exports={};xb.log=function(){var e;if(If.logging>1){var r=["LOG:"];for(e=0;e1){var t=[];for(e=0;e"),"long")}};xb.warn=function(){var e;if(If.logging>0){var r=["WARN:"];for(e=0;e0){var t=[];for(e=0;e"),"stick")}};xb.error=function(){var e;if(If.logging>0){var r=["ERROR:"];for(e=0;e0){var t=[];for(e=0;e"),"stick")}}});var Pp=N((nEe,KM)=>{"use strict";KM.exports=function(){}});var _b=N((iEe,QM)=>{"use strict";QM.exports=function(r,t){if(t instanceof RegExp){for(var a=t.toString(),n=0;n{e9.exports=Yoe;function Yoe(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}});var a9=N((lEe,t9)=>{t9.exports=Woe;function Woe(e){var r=new Float32Array(16);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}});var i9=N((sEe,n9)=>{n9.exports=joe;function joe(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}});var wb=N((uEe,o9)=>{o9.exports=Zoe;function Zoe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}});var s9=N((fEe,l9)=>{l9.exports=Xoe;function Xoe(e,r){if(e===r){var t=r[1],a=r[2],n=r[3],i=r[6],o=r[7],l=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=a,e[9]=i,e[11]=r[14],e[12]=n,e[13]=o,e[14]=l}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}});var f9=N((cEe,u9)=>{u9.exports=Joe;function Joe(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],o=r[4],l=r[5],s=r[6],u=r[7],f=r[8],c=r[9],v=r[10],d=r[11],p=r[12],y=r[13],m=r[14],x=r[15],T=t*l-a*o,_=t*s-n*o,b=t*u-i*o,w=a*s-n*l,k=a*u-i*l,M=n*u-i*s,q=f*y-c*p,E=f*m-v*p,D=f*x-d*p,P=c*m-v*y,R=c*x-d*y,z=v*x-d*m,I=T*z-_*R+b*P+w*D-k*E+M*q;return I?(I=1/I,e[0]=(l*z-s*R+u*P)*I,e[1]=(n*R-a*z-i*P)*I,e[2]=(y*M-m*k+x*w)*I,e[3]=(v*k-c*M-d*w)*I,e[4]=(s*D-o*z-u*E)*I,e[5]=(t*z-n*D+i*E)*I,e[6]=(m*b-p*M-x*_)*I,e[7]=(f*M-v*b+d*_)*I,e[8]=(o*R-l*D+u*q)*I,e[9]=(a*D-t*R-i*q)*I,e[10]=(p*k-y*b+x*T)*I,e[11]=(c*b-f*k-d*T)*I,e[12]=(l*E-o*P-s*q)*I,e[13]=(t*P-a*E+n*q)*I,e[14]=(y*_-p*w-m*T)*I,e[15]=(f*w-c*_+v*T)*I,e):null}});var v9=N((vEe,c9)=>{c9.exports=$oe;function $oe(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],o=r[4],l=r[5],s=r[6],u=r[7],f=r[8],c=r[9],v=r[10],d=r[11],p=r[12],y=r[13],m=r[14],x=r[15];return e[0]=l*(v*x-d*m)-c*(s*x-u*m)+y*(s*d-u*v),e[1]=-(a*(v*x-d*m)-c*(n*x-i*m)+y*(n*d-i*v)),e[2]=a*(s*x-u*m)-l*(n*x-i*m)+y*(n*u-i*s),e[3]=-(a*(s*d-u*v)-l*(n*d-i*v)+c*(n*u-i*s)),e[4]=-(o*(v*x-d*m)-f*(s*x-u*m)+p*(s*d-u*v)),e[5]=t*(v*x-d*m)-f*(n*x-i*m)+p*(n*d-i*v),e[6]=-(t*(s*x-u*m)-o*(n*x-i*m)+p*(n*u-i*s)),e[7]=t*(s*d-u*v)-o*(n*d-i*v)+f*(n*u-i*s),e[8]=o*(c*x-d*y)-f*(l*x-u*y)+p*(l*d-u*c),e[9]=-(t*(c*x-d*y)-f*(a*x-i*y)+p*(a*d-i*c)),e[10]=t*(l*x-u*y)-o*(a*x-i*y)+p*(a*u-i*l),e[11]=-(t*(l*d-u*c)-o*(a*d-i*c)+f*(a*u-i*l)),e[12]=-(o*(c*m-v*y)-f*(l*m-s*y)+p*(l*v-s*c)),e[13]=t*(c*m-v*y)-f*(a*m-n*y)+p*(a*v-n*c),e[14]=-(t*(l*m-s*y)-o*(a*m-n*y)+p*(a*s-n*l)),e[15]=t*(l*v-s*c)-o*(a*v-n*c)+f*(a*s-n*l),e}});var d9=N((hEe,h9)=>{h9.exports=Koe;function Koe(e){var r=e[0],t=e[1],a=e[2],n=e[3],i=e[4],o=e[5],l=e[6],s=e[7],u=e[8],f=e[9],c=e[10],v=e[11],d=e[12],p=e[13],y=e[14],m=e[15],x=r*o-t*i,T=r*l-a*i,_=r*s-n*i,b=t*l-a*o,w=t*s-n*o,k=a*s-n*l,M=u*p-f*d,q=u*y-c*d,E=u*m-v*d,D=f*y-c*p,P=f*m-v*p,R=c*m-v*y;return x*R-T*P+_*D+b*E-w*q+k*M}});var y9=N((dEe,p9)=>{p9.exports=Qoe;function Qoe(e,r,t){var a=r[0],n=r[1],i=r[2],o=r[3],l=r[4],s=r[5],u=r[6],f=r[7],c=r[8],v=r[9],d=r[10],p=r[11],y=r[12],m=r[13],x=r[14],T=r[15],_=t[0],b=t[1],w=t[2],k=t[3];return e[0]=_*a+b*l+w*c+k*y,e[1]=_*n+b*s+w*v+k*m,e[2]=_*i+b*u+w*d+k*x,e[3]=_*o+b*f+w*p+k*T,_=t[4],b=t[5],w=t[6],k=t[7],e[4]=_*a+b*l+w*c+k*y,e[5]=_*n+b*s+w*v+k*m,e[6]=_*i+b*u+w*d+k*x,e[7]=_*o+b*f+w*p+k*T,_=t[8],b=t[9],w=t[10],k=t[11],e[8]=_*a+b*l+w*c+k*y,e[9]=_*n+b*s+w*v+k*m,e[10]=_*i+b*u+w*d+k*x,e[11]=_*o+b*f+w*p+k*T,_=t[12],b=t[13],w=t[14],k=t[15],e[12]=_*a+b*l+w*c+k*y,e[13]=_*n+b*s+w*v+k*m,e[14]=_*i+b*u+w*d+k*x,e[15]=_*o+b*f+w*p+k*T,e}});var g9=N((pEe,m9)=>{m9.exports=ele;function ele(e,r,t){var a=t[0],n=t[1],i=t[2],o,l,s,u,f,c,v,d,p,y,m,x;return r===e?(e[12]=r[0]*a+r[4]*n+r[8]*i+r[12],e[13]=r[1]*a+r[5]*n+r[9]*i+r[13],e[14]=r[2]*a+r[6]*n+r[10]*i+r[14],e[15]=r[3]*a+r[7]*n+r[11]*i+r[15]):(o=r[0],l=r[1],s=r[2],u=r[3],f=r[4],c=r[5],v=r[6],d=r[7],p=r[8],y=r[9],m=r[10],x=r[11],e[0]=o,e[1]=l,e[2]=s,e[3]=u,e[4]=f,e[5]=c,e[6]=v,e[7]=d,e[8]=p,e[9]=y,e[10]=m,e[11]=x,e[12]=o*a+f*n+p*i+r[12],e[13]=l*a+c*n+y*i+r[13],e[14]=s*a+v*n+m*i+r[14],e[15]=u*a+d*n+x*i+r[15]),e}});var x9=N((yEe,b9)=>{b9.exports=rle;function rle(e,r,t){var a=t[0],n=t[1],i=t[2];return e[0]=r[0]*a,e[1]=r[1]*a,e[2]=r[2]*a,e[3]=r[3]*a,e[4]=r[4]*n,e[5]=r[5]*n,e[6]=r[6]*n,e[7]=r[7]*n,e[8]=r[8]*i,e[9]=r[9]*i,e[10]=r[10]*i,e[11]=r[11]*i,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}});var w9=N((mEe,_9)=>{_9.exports=tle;function tle(e,r,t,a){var n=a[0],i=a[1],o=a[2],l=Math.sqrt(n*n+i*i+o*o),s,u,f,c,v,d,p,y,m,x,T,_,b,w,k,M,q,E,D,P,R,z,I,B;return Math.abs(l)<1e-6?null:(l=1/l,n*=l,i*=l,o*=l,s=Math.sin(t),u=Math.cos(t),f=1-u,c=r[0],v=r[1],d=r[2],p=r[3],y=r[4],m=r[5],x=r[6],T=r[7],_=r[8],b=r[9],w=r[10],k=r[11],M=n*n*f+u,q=i*n*f+o*s,E=o*n*f-i*s,D=n*i*f-o*s,P=i*i*f+u,R=o*i*f+n*s,z=n*o*f+i*s,I=i*o*f-n*s,B=o*o*f+u,e[0]=c*M+y*q+_*E,e[1]=v*M+m*q+b*E,e[2]=d*M+x*q+w*E,e[3]=p*M+T*q+k*E,e[4]=c*D+y*P+_*R,e[5]=v*D+m*P+b*R,e[6]=d*D+x*P+w*R,e[7]=p*D+T*P+k*R,e[8]=c*z+y*I+_*B,e[9]=v*z+m*I+b*B,e[10]=d*z+x*I+w*B,e[11]=p*z+T*I+k*B,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}});var A9=N((gEe,T9)=>{T9.exports=ale;function ale(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[4],o=r[5],l=r[6],s=r[7],u=r[8],f=r[9],c=r[10],v=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=i*n+u*a,e[5]=o*n+f*a,e[6]=l*n+c*a,e[7]=s*n+v*a,e[8]=u*n-i*a,e[9]=f*n-o*a,e[10]=c*n-l*a,e[11]=v*n-s*a,e}});var k9=N((bEe,M9)=>{M9.exports=nle;function nle(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],o=r[1],l=r[2],s=r[3],u=r[8],f=r[9],c=r[10],v=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n-u*a,e[1]=o*n-f*a,e[2]=l*n-c*a,e[3]=s*n-v*a,e[8]=i*a+u*n,e[9]=o*a+f*n,e[10]=l*a+c*n,e[11]=s*a+v*n,e}});var q9=N((xEe,S9)=>{S9.exports=ile;function ile(e,r,t){var a=Math.sin(t),n=Math.cos(t),i=r[0],o=r[1],l=r[2],s=r[3],u=r[4],f=r[5],c=r[6],v=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=i*n+u*a,e[1]=o*n+f*a,e[2]=l*n+c*a,e[3]=s*n+v*a,e[4]=u*n-i*a,e[5]=f*n-o*a,e[6]=c*n-l*a,e[7]=v*n-s*a,e}});var C9=N((_Ee,L9)=>{L9.exports=ole;function ole(e,r,t){var a,n,i,o=t[0],l=t[1],s=t[2],u=Math.sqrt(o*o+l*l+s*s);return Math.abs(u)<1e-6?null:(u=1/u,o*=u,l*=u,s*=u,a=Math.sin(r),n=Math.cos(r),i=1-n,e[0]=o*o*i+n,e[1]=l*o*i+s*a,e[2]=s*o*i-l*a,e[3]=0,e[4]=o*l*i-s*a,e[5]=l*l*i+n,e[6]=s*l*i+o*a,e[7]=0,e[8]=o*s*i+l*a,e[9]=l*s*i-o*a,e[10]=s*s*i+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}});var D9=N((wEe,E9)=>{E9.exports=lle;function lle(e,r,t){var a=r[0],n=r[1],i=r[2],o=r[3],l=a+a,s=n+n,u=i+i,f=a*l,c=a*s,v=a*u,d=n*s,p=n*u,y=i*u,m=o*l,x=o*s,T=o*u;return e[0]=1-(d+y),e[1]=c+T,e[2]=v-x,e[3]=0,e[4]=c-T,e[5]=1-(f+y),e[6]=p+m,e[7]=0,e[8]=v+x,e[9]=p-m,e[10]=1-(f+d),e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}});var P9=N((TEe,R9)=>{R9.exports=sle;function sle(e,r){return e[0]=r[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}});var N9=N((AEe,F9)=>{F9.exports=ule;function ule(e,r){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}});var z9=N((MEe,I9)=>{I9.exports=fle;function fle(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=t,e[7]=0,e[8]=0,e[9]=-t,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}});var B9=N((kEe,O9)=>{O9.exports=cle;function cle(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=0,e[2]=-t,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=t,e[9]=0,e[10]=a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}});var U9=N((SEe,H9)=>{H9.exports=vle;function vle(e,r){var t=Math.sin(r),a=Math.cos(r);return e[0]=a,e[1]=t,e[2]=0,e[3]=0,e[4]=-t,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}});var V9=N((qEe,G9)=>{G9.exports=hle;function hle(e,r){var t=r[0],a=r[1],n=r[2],i=r[3],o=t+t,l=a+a,s=n+n,u=t*o,f=a*o,c=a*l,v=n*o,d=n*l,p=n*s,y=i*o,m=i*l,x=i*s;return e[0]=1-c-p,e[1]=f+x,e[2]=v-m,e[3]=0,e[4]=f-x,e[5]=1-u-p,e[6]=d+y,e[7]=0,e[8]=v+m,e[9]=d-y,e[10]=1-u-c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}});var W9=N((LEe,Y9)=>{Y9.exports=dle;function dle(e,r,t,a,n,i,o){var l=1/(t-r),s=1/(n-a),u=1/(i-o);return e[0]=i*2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i*2*s,e[6]=0,e[7]=0,e[8]=(t+r)*l,e[9]=(n+a)*s,e[10]=(o+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*i*2*u,e[15]=0,e}});var Z9=N((CEe,j9)=>{j9.exports=ple;function ple(e,r,t,a,n){var i=1/Math.tan(r/2),o=1/(a-n);return e[0]=i/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(n+a)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*n*a*o,e[15]=0,e}});var J9=N((EEe,X9)=>{X9.exports=yle;function yle(e,r,t,a){var n=Math.tan(r.upDegrees*Math.PI/180),i=Math.tan(r.downDegrees*Math.PI/180),o=Math.tan(r.leftDegrees*Math.PI/180),l=Math.tan(r.rightDegrees*Math.PI/180),s=2/(o+l),u=2/(n+i);return e[0]=s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((o-l)*s*.5),e[9]=(n-i)*u*.5,e[10]=a/(t-a),e[11]=-1,e[12]=0,e[13]=0,e[14]=a*t/(t-a),e[15]=0,e}});var K9=N((DEe,$9)=>{$9.exports=mle;function mle(e,r,t,a,n,i,o){var l=1/(r-t),s=1/(a-n),u=1/(i-o);return e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(r+t)*l,e[13]=(n+a)*s,e[14]=(o+i)*u,e[15]=1,e}});var ek=N((REe,Q9)=>{var gle=wb();Q9.exports=ble;function ble(e,r,t,a){var n,i,o,l,s,u,f,c,v,d,p=r[0],y=r[1],m=r[2],x=a[0],T=a[1],_=a[2],b=t[0],w=t[1],k=t[2];return Math.abs(p-b)<1e-6&&Math.abs(y-w)<1e-6&&Math.abs(m-k)<1e-6?gle(e):(f=p-b,c=y-w,v=m-k,d=1/Math.sqrt(f*f+c*c+v*v),f*=d,c*=d,v*=d,n=T*v-_*c,i=_*f-x*v,o=x*c-T*f,d=Math.sqrt(n*n+i*i+o*o),d?(d=1/d,n*=d,i*=d,o*=d):(n=0,i=0,o=0),l=c*o-v*i,s=v*n-f*o,u=f*i-c*n,d=Math.sqrt(l*l+s*s+u*u),d?(d=1/d,l*=d,s*=d,u*=d):(l=0,s=0,u=0),e[0]=n,e[1]=l,e[2]=f,e[3]=0,e[4]=i,e[5]=s,e[6]=c,e[7]=0,e[8]=o,e[9]=u,e[10]=v,e[11]=0,e[12]=-(n*p+i*y+o*m),e[13]=-(l*p+s*y+u*m),e[14]=-(f*p+c*y+v*m),e[15]=1,e)}});var tk=N((PEe,rk)=>{rk.exports=xle;function xle(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}});var Tb=N((FEe,ak)=>{ak.exports={create:r9(),clone:a9(),copy:i9(),identity:wb(),transpose:s9(),invert:f9(),adjoint:v9(),determinant:d9(),multiply:y9(),translate:g9(),scale:x9(),rotate:w9(),rotateX:A9(),rotateY:k9(),rotateZ:q9(),fromRotation:C9(),fromRotationTranslation:D9(),fromScaling:P9(),fromTranslation:N9(),fromXRotation:z9(),fromYRotation:B9(),fromZRotation:U9(),fromQuat:V9(),frustum:W9(),perspective:Z9(),perspectiveFromFieldOfView:J9(),ortho:K9(),lookAt:ek(),str:tk()}});var Fp=N(ea=>{"use strict";var _le=Tb();ea.init2dArray=function(e,r){for(var t=new Array(e),a=0;a{"use strict";var wle=Sr(),nk=au(),Tle=Fp(),Ale=Tb();function Mle(e){var r;if(typeof e=="string"){if(r=document.getElementById(e),r===null)throw new Error("No DOM element with id '"+e+"' exists on the page.");return r}else if(e==null)throw new Error("DOM element provided is null or undefined");return e}function kle(e){var r=wle.select(e);return r.node()instanceof HTMLElement&&r.size()&&r.classed("js-plotly-plot")}function ik(e){var r=e&&e.parentNode;r&&r.removeChild(e)}function Sle(e,r){ok("global",e,r)}function ok(e,r,t){var a="plotly.js-style-"+e,n=document.getElementById(a);if(!(n&&n.matches(".no-inline-styles"))){n||(n=document.createElement("style"),n.setAttribute("id",a),n.appendChild(document.createTextNode("")),document.head.appendChild(n));var i=n.sheet;i?i.insertRule?i.insertRule(r+"{"+t+"}",0):i.addRule?i.addRule(r,t,0):nk.warn("addStyleRule failed"):nk.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function qle(e){var r="plotly.js-style-"+e,t=document.getElementById(r);t&&ik(t)}function Lle(e,r,t,a,n,i){var o=a.split(":"),l=n.split(":"),s="data-btn-style-event-added";i||(i=document),i.querySelectorAll(e).forEach(function(u){u.getAttribute(s)||(u.addEventListener("mouseenter",function(){var f=this.querySelector(t);f&&(f.style[o[0]]=o[1])}),u.addEventListener("mouseleave",function(){var f=this.querySelector(t);f&&(r&&this.matches(r)?f.style[o[0]]=o[1]:f.style[l[0]]=l[1])}),u.setAttribute(s,!0))})}function Cle(e){var r=sk(e),t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return r.forEach(function(a){var n=lk(a);if(n){var i=Tle.convertCssMatrix(n);t=Ale.multiply(t,t,i)}}),t}function lk(e){var r=window.getComputedStyle(e,null),t=r.getPropertyValue("-webkit-transform")||r.getPropertyValue("-moz-transform")||r.getPropertyValue("-ms-transform")||r.getPropertyValue("-o-transform")||r.getPropertyValue("transform");return t==="none"?null:t.replace("matrix","").replace("3d","").slice(1,-1).split(",").map(function(a){return+a})}function sk(e){for(var r=[];Ele(e);)r.push(e),e=e.parentNode,typeof ShadowRoot=="function"&&e instanceof ShadowRoot&&(e=e.host);return r}function Ele(e){return e&&(e instanceof Element||e instanceof HTMLElement)}function Dle(e,r){return e&&r&&e.top===r.top&&e.left===r.left&&e.right===r.right&&e.bottom===r.bottom}uk.exports={getGraphDiv:Mle,isPlotDiv:kle,removeElement:ik,addStyleRule:Sle,addRelatedStyleRule:ok,deleteRelatedStyleRule:qle,setStyleOnHover:Lle,getFullTransformMatrix:Cle,getElementTransformMatrix:lk,getElementAndAncestors:sk,equalDomRects:Dle}});var ih=N((zEe,fk)=>{"use strict";fk.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}});var eo=N((OEe,mk)=>{"use strict";var vk=bt().extendFlat,Rle=Vl(),hk={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},dk={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},Ple=hk.flags.slice().concat(["fullReplot"]),Fle=dk.flags.slice().concat("layoutReplot");mk.exports={traces:hk,layout:dk,traceFlags:function(){return ck(Ple)},layoutFlags:function(){return ck(Fle)},update:function(e,r){var t=r.editType;if(t&&t!=="none")for(var a=t.split("+"),n=0;n{"use strict";Ab.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"};Ab.pattern={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},path:{valType:"string",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}});var Mb=N((HEe,gk)=>{"use strict";gk.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}});var Wn=N(zf=>{"use strict";var{DATE_FORMAT_LINK:Nle,FORMAT_LINK:Ile}=Mb(),zle=["Variables that can't be found will be replaced with the specifier.",'For example, a template of "data: %{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1 and y is missing.',"Variables with an undefined value will be replaced with the fallback value."].join(" ");function Ole({supportOther:e}={}){return["Variables are inserted using %{variable},",'for example "y: %{y}"'+(e?" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown.":"."),`Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}".`,Ile,"for details on the formatting syntax.",`Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".`,Nle,"for details on the date formatting syntax.",zle].join(" ")}zf.templateFormatStringDescription=Ole;zf.hovertemplateAttrs=({editType:e="none",arrayOk:r}={},t={})=>Ks({valType:"string",dflt:"",editType:e},r!==!1?{arrayOk:!0}:{});zf.texttemplateAttrs=({editType:e="calc",arrayOk:r}={},t={})=>Ks({valType:"string",dflt:"",editType:e},r!==!1?{arrayOk:!0}:{});zf.shapeTexttemplateAttrs=({editType:e="arraydraw",newshape:r}={},t={})=>({valType:"string",dflt:"",editType:e});zf.templatefallbackAttrs=({editType:e="none"}={})=>({valType:"any",dflt:"-",editType:e})});var zp=N((VEe,Ak)=>{"use strict";function jl(e,r){return r?r.d2l(e):e}function bk(e,r){return r?r.l2d(e):e}function Ble(e){return e.x0}function Hle(e){return e.x1}function Ule(e){return e.y0}function Gle(e){return e.y1}function xk(e){return e.x0shift||0}function _k(e){return e.x1shift||0}function wk(e){return e.y0shift||0}function Tk(e){return e.y1shift||0}function Np(e,r){return jl(e.x1,r)+_k(e)-jl(e.x0,r)-xk(e)}function Ip(e,r,t){return jl(e.y1,t)+Tk(e)-jl(e.y0,t)-wk(e)}function Vle(e,r){return Math.abs(Np(e,r))}function Yle(e,r,t){return Math.abs(Ip(e,r,t))}function Wle(e,r,t){return e.type!=="line"?void 0:Math.sqrt(Math.pow(Np(e,r),2)+Math.pow(Ip(e,r,t),2))}function jle(e,r){return bk((jl(e.x1,r)+_k(e)+jl(e.x0,r)+xk(e))/2,r)}function Zle(e,r,t){return bk((jl(e.y1,t)+Tk(e)+jl(e.y0,t)+wk(e))/2,t)}function Xle(e,r,t){return e.type!=="line"?void 0:Ip(e,r,t)/Np(e,r)}var Jle=["x0","x1","y0","y1","dy","height","ycenter"],$le=["x0","x1","y0","y1","dx","width","xcenter"];Ak.exports={x0:Ble,x1:Hle,y0:Ule,y1:Gle,slope:Xle,dx:Np,dy:Ip,width:Vle,height:Yle,length:Wle,xcenter:jle,ycenter:Zle,simpleXVariables:Jle,simpleYVariables:$le}});var Sk=N((YEe,kk)=>{"use strict";var Kle=eo().overrideAll,nu=gn(),Mk=ga(),Qle=ci().dash,Zl=bt().extendFlat,{shapeTexttemplateAttrs:ese,templatefallbackAttrs:rse}=Wn(),tse=zp();kk.exports=Kle({newshape:{visible:Zl({},nu.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:Zl({},nu.legend,{}),legendgroup:Zl({},nu.legendgroup,{}),legendgrouptitle:{text:Zl({},nu.legendgrouptitle.text,{}),font:Mk({})},legendrank:Zl({},nu.legendrank,{}),legendwidth:Zl({},nu.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:Zl({},Qle,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:Zl({},nu.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:ese({newshape:!0},{keys:Object.keys(tse)}),texttemplatefallback:rse({editType:"arraydraw"}),font:Mk({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)",description:"Sets the color filling the active shape' interior."},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")});var Lk=N((WEe,qk)=>{"use strict";var ase=ci().dash,nse=bt().extendFlat;qk.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:nse({},ase,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}});var Op=N((jEe,Ck)=>{"use strict";Ck.exports=function(e){var r=e.editType;return{t:{valType:"number",dflt:0,editType:r},r:{valType:"number",dflt:0,editType:r},b:{valType:"number",dflt:0,editType:r},l:{valType:"number",dflt:0,editType:r},editType:r}}});var Of=N((ZEe,Pk)=>{"use strict";var kb=ga(),ise=ih(),Bp=fi(),Ek=Sk(),Dk=Lk(),ose=Op(),Rk=bt().extendFlat,Hp=kb({editType:"calc"});Hp.family.dflt='"Open Sans", verdana, arial, sans-serif';Hp.size.dflt=12;Hp.color.dflt=Bp.defaultLine;Pk.exports={font:Hp,title:{text:{valType:"string",editType:"layoutstyle"},font:kb({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:kb({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:Rk(ose({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:Bp.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:Bp.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:Bp.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:Ek.newshape,activeshape:Ek.activeshape,newselection:Dk.newselection,activeselection:Dk.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:Rk({},ise.transition,{editType:"none"})}});var Fk=N(()=>{(function(){if(!document.getElementById("8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc")){var e=document.createElement("style");e.id="8431bff7cc77ea8693f8122c6e0981316b936a0a4930625e08b1512d134062bc",e.textContent=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}`,document.head.appendChild(e)}})()});var br=N(Br=>{"use strict";var Bf=au(),Nk=Pp(),Ik=_b(),lse=Vl(),sse=nh().addStyleRule,zk=bt(),use=gn(),fse=Of(),cse=zk.extendFlat,Sb=zk.extendDeepAll;Br.modules={};Br.allCategories={};Br.allTypes=[];Br.subplotsRegistry={};Br.componentsRegistry={};Br.layoutArrayContainers=[];Br.layoutArrayRegexes=[];Br.traceLayoutAttributes={};Br.localeRegistry={};Br.apiMethodRegistry={};Br.collectableSubplotTypes=null;Br.register=function(r){if(Br.collectableSubplotTypes=null,r)r&&!Array.isArray(r)&&(r=[r]);else throw new Error("No argument passed to Plotly.register.");for(var t=0;t{"use strict";var mse=Ef().timeFormat,Xk=Rr(),qb=au(),Jl=Rf().mod,Gf=Ft(),vi=Gf.BADNUM,En=Gf.ONEDAY,oh=Gf.ONEHOUR,Xl=Gf.ONEMIN,Uf=Gf.ONESEC,lh=Gf.EPOCHJD,sl=br(),Gk=Ef().utcFormat,gse=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,bse=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,Vk=new Date().getFullYear()-70;function ul(e){return e&&sl.componentsRegistry.calendars&&typeof e=="string"&&e!=="gregorian"}ra.dateTick0=function(e,r){var t=xse(e,!!r);if(r<2)return t;var a=ra.dateTime2ms(t,e);return a+=En*(r-1),ra.ms2DateTime(a,0,e)};function xse(e,r){return ul(e)?r?sl.getComponentMethod("calendars","CANONICAL_SUNDAY")[e]:sl.getComponentMethod("calendars","CANONICAL_TICK")[e]:r?"2000-01-02":"2000-01-01"}ra.dfltRange=function(e){return ul(e)?sl.getComponentMethod("calendars","DFLTRANGE")[e]:["2000-01-01","2001-01-01"]};ra.isJSDate=function(e){return typeof e=="object"&&e!==null&&typeof e.getTime=="function"};var Gp,Vp;ra.dateTime2ms=function(e,r){if(ra.isJSDate(e)){var t=e.getTimezoneOffset()*Xl,a=(e.getUTCMinutes()-e.getMinutes())*Xl+(e.getUTCSeconds()-e.getSeconds())*Uf+(e.getUTCMilliseconds()-e.getMilliseconds());if(a){var n=3*Xl;t=t-n/2+Jl(a-t+n/2,n)}return e=Number(e)-t,e>=Gp&&e<=Vp?e:vi}if(typeof e!="string"&&typeof e!="number")return vi;e=String(e);var i=ul(r),o=e.charAt(0);i&&(o==="G"||o==="g")&&(e=e.slice(1),r="");var l=i&&r.slice(0,7)==="chinese",s=e.match(l?bse:gse);if(!s)return vi;var u=s[1],f=s[3]||"1",c=Number(s[5]||1),v=Number(s[7]||0),d=Number(s[9]||0),p=Number(s[11]||0);if(i){if(u.length===2)return vi;u=Number(u);var y;try{var m=sl.getComponentMethod("calendars","getCal")(r);if(l){var x=f.charAt(f.length-1)==="i";f=parseInt(f,10),y=m.newDate(u,m.toMonthIndex(u,f,x),c)}else y=m.newDate(u,Number(f),c)}catch(_){return vi}return y?(y.toJD()-lh)*En+v*oh+d*Xl+p*Uf:vi}u.length===2?u=(Number(u)+2e3-Vk)%100+Vk:u=Number(u),f-=1;var T=new Date(Date.UTC(2e3,f,c,v,d));return T.setUTCFullYear(u),T.getUTCMonth()!==f||T.getUTCDate()!==c?vi:T.getTime()+p*Uf};Gp=ra.MIN_MS=ra.dateTime2ms("-9999");Vp=ra.MAX_MS=ra.dateTime2ms("9999-12-31 23:59:59.9999");ra.isDateTime=function(e,r){return ra.dateTime2ms(e,r)!==vi};function Hf(e,r){return String(e+Math.pow(10,r)).slice(1)}var Up=90*En,Yk=3*oh,Wk=5*Xl;ra.ms2DateTime=function(e,r,t){if(typeof e!="number"||!(e>=Gp&&e<=Vp))return vi;r||(r=0);var a=Math.floor(Jl(e+.05,1)*10),n=Math.round(e-a/10),i,o,l,s,u,f;if(ul(t)){var c=Math.floor(n/En)+lh,v=Math.floor(Jl(e,En));try{i=sl.getComponentMethod("calendars","getCal")(t).fromJD(c).formatDate("yyyy-mm-dd")}catch(d){i=Gk("G%Y-%m-%d")(new Date(n))}if(i.charAt(0)==="-")for(;i.length<11;)i="-0"+i.slice(1);else for(;i.length<10;)i="0"+i;o=r=Gp+En&&e<=Vp-En))return vi;var r=Math.floor(Jl(e+.05,1)*10),t=new Date(Math.round(e-r/10)),a=mse("%Y-%m-%d")(t),n=t.getHours(),i=t.getMinutes(),o=t.getSeconds(),l=t.getUTCMilliseconds()*10+r;return Jk(a,n,i,o,l)};function Jk(e,r,t,a,n){if((r||t||a||n)&&(e+=" "+Hf(r,2)+":"+Hf(t,2),(a||n)&&(e+=":"+Hf(a,2),n))){for(var i=4;n%10===0;)i-=1,n/=10;e+="."+Hf(n,i)}return e}ra.cleanDate=function(e,r,t){if(e===vi)return r;if(ra.isJSDate(e)||typeof e=="number"&&isFinite(e)){if(ul(t))return qb.error("JS Dates and milliseconds are incompatible with world calendars",e),r;if(e=ra.ms2DateTimeLocal(+e),!e&&r!==void 0)return r}else if(!ra.isDateTime(e,t))return qb.error("unrecognized date",e),r;return e};var _se=/%\d?f/g,wse=/%h/g,Tse={1:"1",2:"1",3:"2",4:"2"};function jk(e,r,t,a){e=e.replace(_se,function(i){var o=Math.min(+i.charAt(1)||6,6),l=(r/1e3%1+2).toFixed(o).slice(2).replace(/0+$/,"")||"0";return l});var n=new Date(Math.floor(r+.05));if(e=e.replace(wse,function(){return Tse[t("%q")(n)]}),ul(a))try{e=sl.getComponentMethod("calendars","worldCalFmt")(e,r,a)}catch(i){return"Invalid"}return t(e)(n)}var Ase=[59,59.9,59.99,59.999,59.9999];function Mse(e,r){var t=Jl(e+.05,En),a=Hf(Math.floor(t/oh),2)+":"+Hf(Jl(Math.floor(t/Xl),60),2);if(r!=="M"){Xk(r)||(r=0);var n=Math.min(Jl(e/Uf,60),Ase[r]),i=(100+n).toFixed(r).slice(1);r>0&&(i=i.replace(/0+$/,"").replace(/[\.]$/,"")),a+=":"+i}return a}ra.formatDate=function(e,r,t,a,n,i){if(n=ul(n)&&n,!r)if(t==="y")r=i.year;else if(t==="m")r=i.month;else if(t==="d")r=i.dayMonth+` +`+i.year;else return Mse(e,t)+` +`+jk(i.dayMonthYear,e,a,n);return jk(r,e,a,n)};var Zk=3*En;ra.incrementMonth=function(e,r,t){t=ul(t)&&t;var a=Jl(e,En);if(e=Math.round(e-a),t)try{var n=Math.round(e/En)+lh,i=sl.getComponentMethod("calendars","getCal")(t),o=i.fromJD(n);return r%12?i.add(o,r,"m"):i.add(o,r/12,"y"),(o.toJD()-lh)*En+a}catch(s){qb.error("invalid ms "+e+" in calendar "+t)}var l=new Date(e+Zk);return l.setUTCMonth(l.getUTCMonth()+r)+a-Zk};ra.findExactDates=function(e,r){for(var t=0,a=0,n=0,i=0,o,l,s=ul(r)&&sl.getComponentMethod("calendars","getCal")(r),u=0;u{"use strict";Kk.exports=function(r){return r}});var Eb=N(fl=>{"use strict";var kse=Rr(),Sse=au(),qse=Lb(),Lse=Ft().BADNUM,Cb=1e-9;fl.findBin=function(e,r,t){if(kse(r.start))return t?Math.ceil((e-r.start)/r.size-Cb)-1:Math.floor((e-r.start)/r.size+Cb);var a=0,n=r.length,i=0,o=n>1?(r[n-1]-r[0])/(n-1):1,l,s;for(o>=0?s=t?Cse:Ese:s=t?Rse:Dse,e+=o*Cb*(t?-1:1)*(o>=0?1:-1);a90&&Sse.log("Long binary search..."),a-1};function Cse(e,r){return er}function Rse(e,r){return e>=r}fl.sorterAsc=function(e,r){return e-r};fl.sorterDes=function(e,r){return r-e};fl.distinctVals=function(e){var r=e.slice();r.sort(fl.sorterAsc);var t;for(t=r.length-1;t>-1&&r[t]===Lse;t--);for(var a=r[t]-r[0]||1,n=a/(t||1)/1e4,i=[],o,l=0;l<=t;l++){var s=r[l],u=s-o;o===void 0?(i.push(s),o=s):u>n&&(a=Math.min(a,u),i.push(s),o=s)}return{vals:i,minDiff:a}};fl.roundUp=function(e,r,t){for(var a=0,n=r.length-1,i,o=0,l=t?0:1,s=t?1:0,u=t?Math.ceil:Math.floor;a0&&(a=1),t&&a)return e.sort(r)}return a?e:e.reverse()};fl.findIndexOfMin=function(e,r){r=r||qse;for(var t=1/0,a,n=0;n{"use strict";Qk.exports=function(r){return Object.keys(r).sort()}});var eS=N(ta=>{"use strict";var sh=Rr(),Pse=Yn().isArrayOrTypedArray;ta.aggNums=function(e,r,t,a){var n,i;if((!a||a>t.length)&&(a=t.length),sh(r)||(r=!1),Pse(t[0])){for(i=new Array(a),n=0;ne.length-1)return e[e.length-1];var t=r%1;return t*e[Math.ceil(r)]+(1-t)*e[Math.floor(r)]}});var iS=N((aDe,nS)=>{"use strict";var rS=Rf(),Rb=rS.mod,Fse=rS.modHalf,uh=Math.PI,$l=2*uh;function Nse(e){return e/180*uh}function Ise(e){return e/uh*180}function Pb(e){return Math.abs(e[1]-e[0])>$l-1e-14}function tS(e,r){return Fse(r-e,$l)}function zse(e,r){return Math.abs(tS(e,r))}function aS(e,r){if(Pb(r))return!0;var t,a;r[0]a&&(a+=$l);var n=Rb(e,$l),i=n+$l;return n>=t&&n<=a||i>=t&&i<=a}function Ose(e,r,t,a){if(!aS(r,a))return!1;var n,i;return t[0]=n&&e<=i}function Fb(e,r,t,a,n,i,o){n=n||0,i=i||0;var l=Pb([t,a]),s,u,f,c,v;l?(s=0,u=uh,f=$l):t{"use strict";iu.isLeftAnchor=function(r){return r.xanchor==="left"||r.xanchor==="auto"&&r.x<=1/3};iu.isCenterAnchor=function(r){return r.xanchor==="center"||r.xanchor==="auto"&&r.x>1/3&&r.x<2/3};iu.isRightAnchor=function(r){return r.xanchor==="right"||r.xanchor==="auto"&&r.x>=2/3};iu.isTopAnchor=function(r){return r.yanchor==="top"||r.yanchor==="auto"&&r.y>=2/3};iu.isMiddleAnchor=function(r){return r.yanchor==="middle"||r.yanchor==="auto"&&r.y>1/3&&r.y<2/3};iu.isBottomAnchor=function(r){return r.yanchor==="bottom"||r.yanchor==="auto"&&r.y<=1/3}});var uS=N(ou=>{"use strict";var Nb=Rf().mod;ou.segmentsIntersect=sS;function sS(e,r,t,a,n,i,o,l){var s=t-e,u=n-e,f=o-n,c=a-r,v=i-r,d=l-i,p=s*d-f*c;if(p===0)return null;var y=(u*d-f*v)/p,m=(u*c-s*v)/p;return m<0||m>1||y<0||y>1?null:{x:e+s*y,y:r+c*y}}ou.segmentDistance=function(r,t,a,n,i,o,l,s){if(sS(r,t,a,n,i,o,l,s))return 0;var u=a-r,f=n-t,c=l-i,v=s-o,d=u*u+f*f,p=c*c+v*v,y=Math.min(Yp(u,f,d,i-r,o-t),Yp(u,f,d,l-r,s-t),Yp(c,v,p,r-i,t-o),Yp(c,v,p,a-i,n-o));return Math.sqrt(y)};function Yp(e,r,t,a,n){var i=a*e+n*r;if(i<0)return a*a+n*n;if(i>t){var o=a-e,l=n-r;return o*o+l*l}else{var s=a*r-n*e;return s*s/t}}var Wp,Ib,lS;ou.getTextLocation=function(r,t,a,n){if((r!==Ib||n!==lS)&&(Wp={},Ib=r,lS=n),Wp[a])return Wp[a];var i=r.getPointAtLength(Nb(a-n/2,t)),o=r.getPointAtLength(Nb(a+n/2,t)),l=Math.atan((o.y-i.y)/(o.x-i.x)),s=r.getPointAtLength(Nb(a,t)),u=(s.x*4+i.x+o.x)/6,f=(s.y*4+i.y+o.y)/6,c={x:u,y:f,theta:l};return Wp[a]=c,c};ou.clearLocationCache=function(){Ib=null};ou.getVisibleSegment=function(r,t,a){var n=t.left,i=t.right,o=t.top,l=t.bottom,s=0,u=r.getTotalLength(),f=u,c,v;function d(y){var m=r.getPointAtLength(y);y===0?c=m:y===u&&(v=m);var x=m.xi?m.x-i:0,T=m.yl?m.y-l:0;return Math.sqrt(x*x+T*T)}for(var p=d(s);p;){if(s+=p+a,s>f)return;p=d(s)}for(p=d(f);p;){if(f-=p+a,s>f)return;p=d(f)}return{min:s,max:f,len:f-s,total:u,isClosed:s===0&&f===u&&Math.abs(c.x-v.x)<.1&&Math.abs(c.y-v.y)<.1}};ou.findPointOnPath=function(r,t,a,n){n=n||{};for(var i=n.pathLength||r.getTotalLength(),o=n.tolerance||.001,l=n.iterationLimit||30,s=r.getPointAtLength(0)[a]>r.getPointAtLength(i)[a]?-1:1,u=0,f=0,c=i,v,d,p;u0?c=v:f=v,u++}return d}});var jp=N(fh=>{"use strict";var cl={};fh.throttle=function(r,t,a){var n=cl[r],i=Date.now();if(!n){for(var o in cl)cl[o].tsn.ts+t){l();return}n.timer=setTimeout(function(){l(),n.timer=null},t)};fh.done=function(e){var r=cl[e];return!r||!r.timer?Promise.resolve():new Promise(function(t){var a=r.onDone;r.onDone=function(){a&&a(),t(),r.onDone=null}})};fh.clear=function(e){if(e)fS(cl[e]),delete cl[e];else for(var r in cl)fh.clear(r)};function fS(e){e&&e.timer!==null&&(clearTimeout(e.timer),e.timer=null)}});var vS=N((lDe,cS)=>{"use strict";cS.exports=function(r){r._responsiveChartHandler&&(window.removeEventListener("resize",r._responsiveChartHandler),delete r._responsiveChartHandler)}});var hS=N((sDe,Zp)=>{"use strict";Zp.exports=zb;Zp.exports.isMobile=zb;Zp.exports.default=zb;var Gse=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,Vse=/CrOS/,Yse=/android|ipad|playbook|silk/i;function zb(e){e||(e={});let r=e.ua;if(!r&&typeof navigator!="undefined"&&(r=navigator.userAgent),r&&r.headers&&typeof r.headers["user-agent"]=="string"&&(r=r.headers["user-agent"]),typeof r!="string")return!1;let t=Gse.test(r)&&!Vse.test(r)||!!e.tablet&&Yse.test(r);return!t&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&r.indexOf("Macintosh")!==-1&&r.indexOf("Safari")!==-1&&(t=!0),t}});var pS=N((uDe,dS)=>{"use strict";var Wse=Rr(),jse=hS();dS.exports=function(r){var t;if(r&&r.hasOwnProperty("userAgent")?t=r.userAgent:t=Zse(),typeof t!="string")return!0;var a=jse({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!a)for(var n=t.split(" "),i=1;i-1;l--){var s=n[l];if(s.slice(0,8)==="Version/"){var u=s.slice(8).split(".")[0];if(Wse(u)&&(u=+u),u>=13)return!0}}}return a};function Zse(){var e;return typeof navigator!="undefined"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),e}});var mS=N((fDe,yS)=>{"use strict";var Xse=Sr();yS.exports=function(r,t,a){var n=r.selectAll("g."+a.replace(/\s/g,".")).data(t,function(o){return o[0].trace.uid});n.exit().remove(),n.enter().append("g").attr("class",a),n.order();var i=r.classed("rangeplot")?"nodeRangePlot3":"node3";return n.each(function(o){o[0][i]=Xse.select(this)}),n}});var bS=N((cDe,gS)=>{"use strict";var Jse=br();gS.exports=function(r,t){for(var a=r._context.locale,n=0;n<2;n++){for(var i=r._context.locales,o=0;o<2;o++){var l=(i[a]||{}).dictionary;if(l){var s=l[t];if(s)return s}i=Jse.localeRegistry}var u=a.split("-")[0];if(u===a)break;a=u}return t}});var _S=N((vDe,xS)=>{"use strict";xS.exports=function(r){for(var t={},a=[],n=0,i=0;i{"use strict";wS.exports=function(r){for(var t=Qse(r)?Kse:$se,a=[],n=0;n{"use strict";AS.exports=function(r,t){if(!t)return r;var a=1/Math.abs(t),n=a>1?(a*r+a*t)/a:r+t,i=String(n).length;if(i>16){var o=String(t).length,l=String(r).length;if(i>=l+o){var s=parseFloat(n).toPrecision(12);s.indexOf("e+")===-1&&(n=+s)}}return n}});var SS=N((pDe,kS)=>{"use strict";var eue=Rr(),rue=Ft().BADNUM,tue=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;kS.exports=function(r){return typeof r=="string"&&(r=r.replace(tue,"")),eue(r)?Number(r):rue}});var Ee=N((yDe,BS)=>{"use strict";var ch=Sr(),aue=Ef().utcFormat,nue=lb().format,RS=Rr(),PS=Ft(),FS=PS.FP_SAFE,iue=-FS,qS=PS.BADNUM,be=BS.exports={};be.adjustFormat=function(r){return!r||/^\d[.]\df/.test(r)||/[.]\d%/.test(r)?r:r==="0.f"?"~f":/^\d%/.test(r)?"~%":/^\ds/.test(r)?"~s":!/^[~,.0$]/.test(r)&&/[&fps]/.test(r)?"~"+r:r};var LS={};be.warnBadFormat=function(e){var r=String(e);LS[r]||(LS[r]=1,be.warn('encountered bad format: "'+r+'"'))};be.noFormat=function(e){return String(e)};be.numberFormat=function(e){var r;try{r=nue(be.adjustFormat(e))}catch(t){return be.warnBadFormat(e),be.noFormat}return r};be.nestedProperty=Mp();be.keyedContainer=xM();be.relativeAttr=wM();be.isPlainObject=Vl();be.toLogRange=Sp();be.relinkPrivateKeys=kM();var Kl=Yn();be.isArrayBuffer=Kl.isArrayBuffer;be.isTypedArray=Kl.isTypedArray;be.isArrayOrTypedArray=Kl.isArrayOrTypedArray;be.isArray1D=Kl.isArray1D;be.ensureArray=Kl.ensureArray;be.concat=Kl.concat;be.maxRowLength=Kl.maxRowLength;be.minRowLength=Kl.minRowLength;var NS=Rf();be.mod=NS.mod;be.modHalf=NS.modHalf;var Ql=YM();be.valObjectMeta=Ql.valObjectMeta;be.coerce=Ql.coerce;be.coerce2=Ql.coerce2;be.coerceFont=Ql.coerceFont;be.coercePattern=Ql.coercePattern;be.coerceHoverinfo=Ql.coerceHoverinfo;be.coerceSelectionMarkerOpacity=Ql.coerceSelectionMarkerOpacity;be.validate=Ql.validate;var jn=$k();be.dateTime2ms=jn.dateTime2ms;be.isDateTime=jn.isDateTime;be.ms2DateTime=jn.ms2DateTime;be.ms2DateTimeLocal=jn.ms2DateTimeLocal;be.cleanDate=jn.cleanDate;be.isJSDate=jn.isJSDate;be.formatDate=jn.formatDate;be.incrementMonth=jn.incrementMonth;be.dateTick0=jn.dateTick0;be.dfltRange=jn.dfltRange;be.findExactDates=jn.findExactDates;be.MIN_MS=jn.MIN_MS;be.MAX_MS=jn.MAX_MS;var lu=Eb();be.findBin=lu.findBin;be.sorterAsc=lu.sorterAsc;be.sorterDes=lu.sorterDes;be.distinctVals=lu.distinctVals;be.roundUp=lu.roundUp;be.sort=lu.sort;be.findIndexOfMin=lu.findIndexOfMin;be.sortObjectKeys=Db();var vl=eS();be.aggNums=vl.aggNums;be.len=vl.len;be.mean=vl.mean;be.geometricMean=vl.geometricMean;be.median=vl.median;be.midRange=vl.midRange;be.variance=vl.variance;be.stdev=vl.stdev;be.interp=vl.interp;var ro=Fp();be.init2dArray=ro.init2dArray;be.transposeRagged=ro.transposeRagged;be.dot=ro.dot;be.translationMatrix=ro.translationMatrix;be.rotationMatrix=ro.rotationMatrix;be.rotationXYMatrix=ro.rotationXYMatrix;be.apply3DTransform=ro.apply3DTransform;be.apply2DTransform=ro.apply2DTransform;be.apply2DTransform2=ro.apply2DTransform2;be.convertCssMatrix=ro.convertCssMatrix;be.inverseTransformMatrix=ro.inverseTransformMatrix;var So=iS();be.deg2rad=So.deg2rad;be.rad2deg=So.rad2deg;be.angleDelta=So.angleDelta;be.angleDist=So.angleDist;be.isFullCircle=So.isFullCircle;be.isAngleInsideSector=So.isAngleInsideSector;be.isPtInsideSector=So.isPtInsideSector;be.pathArc=So.pathArc;be.pathSector=So.pathSector;be.pathAnnulus=So.pathAnnulus;var Yf=oS();be.isLeftAnchor=Yf.isLeftAnchor;be.isCenterAnchor=Yf.isCenterAnchor;be.isRightAnchor=Yf.isRightAnchor;be.isTopAnchor=Yf.isTopAnchor;be.isMiddleAnchor=Yf.isMiddleAnchor;be.isBottomAnchor=Yf.isBottomAnchor;var Wf=uS();be.segmentsIntersect=Wf.segmentsIntersect;be.segmentDistance=Wf.segmentDistance;be.getTextLocation=Wf.getTextLocation;be.clearLocationCache=Wf.clearLocationCache;be.getVisibleSegment=Wf.getVisibleSegment;be.findPointOnPath=Wf.findPointOnPath;var $p=bt();be.extendFlat=$p.extendFlat;be.extendDeep=$p.extendDeep;be.extendDeepAll=$p.extendDeepAll;be.extendDeepNoArrays=$p.extendDeepNoArrays;var Ob=au();be.log=Ob.log;be.warn=Ob.warn;be.error=Ob.error;var oue=Ff();be.counterRegex=oue.counter;var Bb=jp();be.throttle=Bb.throttle;be.throttleDone=Bb.done;be.clearThrottle=Bb.clear;var to=nh();be.getGraphDiv=to.getGraphDiv;be.isPlotDiv=to.isPlotDiv;be.removeElement=to.removeElement;be.addStyleRule=to.addStyleRule;be.addRelatedStyleRule=to.addRelatedStyleRule;be.deleteRelatedStyleRule=to.deleteRelatedStyleRule;be.setStyleOnHover=to.setStyleOnHover;be.getFullTransformMatrix=to.getFullTransformMatrix;be.getElementTransformMatrix=to.getElementTransformMatrix;be.getElementAndAncestors=to.getElementAndAncestors;be.equalDomRects=to.equalDomRects;be.clearResponsive=vS();be.preserveDrawingBuffer=pS();be.makeTraceGroups=mS();be._=bS();be.notifier=gb();be.filterUnique=_S();be.filterVisible=TS();be.pushUnique=_b();be.increment=MS();be.cleanNumber=SS();be.ensureNumber=function(r){return RS(r)?(r=Number(r),r>FS||r=r?!1:RS(e)&&e>=0&&e%1===0};be.noop=Pp();be.identity=Lb();be.repeat=function(e,r){for(var t=new Array(r),a=0;at?Math.max(t,Math.min(r,e)):Math.max(r,Math.min(t,e))};be.bBoxIntersect=function(e,r,t){return t=t||0,e.left<=r.right+t&&r.left<=e.right+t&&e.top<=r.bottom+t&&r.top<=e.bottom+t};be.simpleMap=function(e,r,t,a,n){for(var i=e.length,o=new Array(i),l=0;l=Math.pow(2,t)?n>10?(be.warn("randstr failed uniqueness"),o):e(r,t,a,(n||0)+1):o};be.OptionControl=function(e,r){e||(e={}),r||(r="opt");var t={};return t.optionList=[],t._newoption=function(a){a[r]=e,t[a.name]=a,t.optionList.push(a)},t["_"+r]=e,t};be.smooth=function(e,r){if(r=Math.round(r)||0,r<2)return e;var t=e.length,a=2*t,n=2*r-1,i=new Array(n),o=new Array(t),l,s,u,f;for(l=0;l=a&&(u-=a*Math.floor(u/a)),u<0?u=-1-u:u>=t&&(u=a-1-u),f+=e[u]*i[s];o[l]=f}return o};be.syncOrAsync=function(e,r,t){var a,n;function i(){return be.syncOrAsync(e,r,t)}for(;e.length;)if(n=e.splice(0,1)[0],a=n(r),a&&a.then)return a.then(i);return t&&t(r)};be.stripTrailingSlash=function(e){return e.slice(-1)==="/"?e.slice(0,-1):e};be.noneOrAll=function(e,r,t){if(e){var a=!1,n=!0,i,o;for(i=0;i0?n:0})};be.fillArray=function(e,r,t,a){if(a=a||be.identity,be.isArrayOrTypedArray(e))for(var n=0;nuue.test(window.navigator.userAgent);var fue=/Firefox\/(\d+)\.\d+/;be.getFirefoxVersion=function(){var e=fue.exec(window.navigator.userAgent);if(e&&e.length===2){var r=parseInt(e[1]);if(!isNaN(r))return r}return null};be.isD3Selection=function(e){return e instanceof ch.selection};be.ensureSingle=function(e,r,t,a){var n=e.select(r+(t?"."+t:""));if(n.size())return n;var i=e.append(r);return t&&i.classed(t,!0),a&&i.call(a),i};be.ensureSingleById=function(e,r,t,a){var n=e.select(r+"#"+t);if(n.size())return n;var i=e.append(r).attr("id",t);return a&&i.call(a),i};be.objectFromPath=function(e,r){for(var t=e.split("."),a,n=a={},i=0;i1?n+o[1]:"";if(i&&(o.length>1||l.length>4||t))for(;a.test(l);)l=l.replace(a,"$1"+i+"$2");return l+s};be.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var OS=/^\w*$/;be.templateString=function(e,r){var t={};return e.replace(be.TEMPLATE_STRING_REGEX,function(a,n){var i;return OS.test(n)?i=r[n]:(t[n]=t[n]||be.nestedProperty(r,n).get,i=t[n](!0)),i!==void 0?i:""})};var hue={max:10,count:0,name:"hovertemplate"};be.hovertemplateString=e=>Hb(yp(Ks({},e),{opts:hue}));var due={max:10,count:0,name:"texttemplate"};be.texttemplateString=e=>Hb(yp(Ks({},e),{opts:due}));var pue=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function yue(e){var r=e.match(pue);return r?{key:r[1],op:r[2],number:Number(r[3])}:{key:e,op:null,number:null}}var mue={max:10,count:0,name:"texttemplate",parseMultDiv:!0};be.texttemplateStringForShapes=e=>Hb(yp(Ks({},e),{opts:mue}));var CS=/^[:|\|]/;function Hb({data:e=[],locale:r,fallback:t,labels:a={},opts:n,template:i}){return i.replace(be.TEMPLATE_STRING_REGEX,(o,l,s)=>{let u=["xother","yother"].includes(l),f=["_xother","_yother"].includes(l),c=["_xother_","_yother_"].includes(l),v=["xother_","yother_"].includes(l),d=u||f||v||c;(f||c)&&(l=l.substring(1)),(v||c)&&(l=l.substring(0,l.length-1));let p=null,y=null;if(n.parseMultDiv){var m=yue(l);l=m.key,p=m.op,y=m.number}let x;if(d){if(a[l]===void 0)return"";x=a[l]}else for(let w of e)if(w){if(w.hasOwnProperty(l)){x=w[l];break}if(OS.test(l)||(x=be.nestedProperty(w,l).get(!0)),x!==void 0)break}if(x===void 0){let{count:w,max:k,name:M}=n,q=t===!1?o:t;return w=Jp&&o<=ES,u=l>=Jp&&l<=ES;if(s&&(a=10*a+o-Jp),u&&(n=10*n+l-Jp),!s||!u){if(a!==n)return a-n;if(o!==l)return o-l}}return n-a};var Vf=2e9;be.seedPseudoRandom=function(){Vf=2e9};be.pseudoRandom=function(){var e=Vf;return Vf=(69069*Vf+1)%4294967296,Math.abs(Vf-e)<429496729?be.pseudoRandom():Vf/4294967296};be.fillText=function(e,r,t){var a=Array.isArray(t)?function(o){t.push(o)}:function(o){t.text=o},n=be.extractOption(e,r,"htx","hovertext");if(be.isValidTextValue(n))return a(n);var i=be.extractOption(e,r,"tx","text");if(be.isValidTextValue(i))return a(i)};be.isValidTextValue=function(e){return e||e===0};be.formatPercent=function(e,r){r=r||0;for(var t=(Math.round(100*e*Math.pow(10,r))*Math.pow(.1,r)).toFixed(r)+"%",a=0;a1&&(u=1):u=0,be.strTranslate(n-u*(t+o),i-u*(a+l))+be.strScale(u)+(s?"rotate("+s+(r?"":" "+t+" "+a)+")":"")};be.setTransormAndDisplay=function(e,r){e.attr("transform",be.getTextTransform(r)),e.style("display",r.scale?null:"none")};be.ensureUniformFontSize=function(e,r){var t=be.extendFlat({},r);return t.size=Math.max(r.size,e._fullLayout.uniformtext.minsize||0),t};be.join2=function(e,r,t){var a=e.length;return a>1?e.slice(0,-1).join(r)+t+e[a-1]:e.join(r)};be.bigFont=function(e){return Math.round(1.2*e)};var DS=be.getFirefoxVersion(),gue=DS!==null&&DS<86;be.getPositionFromD3Event=function(){return gue?[ch.event.layerX,ch.event.layerY]:[ch.event.offsetX,ch.event.offsetY]}});var GS=N(()=>{"use strict";var bue=Ee(),HS={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;border:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X:focus-within .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-group a":"display:grid;place-content:center;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;border:none;background:rgba(0,0,0,0);","X .modebar-btn svg":"position:relative;","X .modebar-btn:focus-visible":"outline:1px solid #000;outline-offset:1px;border-radius:3px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(Ub in HS)US=Ub.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),bue.addStyleRule(US,HS[Ub]);var US,Ub});var Gb=N((xDe,VS)=>{VS.exports=!0});var Yb=N((_De,YS)=>{"use strict";var xue=Gb(),Vb;typeof window.matchMedia=="function"?Vb=!window.matchMedia("(hover: none)").matches:Vb=xue;YS.exports=Vb});var su=N((wDe,Wb)=>{"use strict";var jf=typeof Reflect=="object"?Reflect:null,WS=jf&&typeof jf.apply=="function"?jf.apply:function(r,t,a){return Function.prototype.apply.call(r,t,a)},Kp;jf&&typeof jf.ownKeys=="function"?Kp=jf.ownKeys:Object.getOwnPropertySymbols?Kp=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Kp=function(r){return Object.getOwnPropertyNames(r)};function _ue(e){console&&console.warn&&console.warn(e)}var ZS=Number.isNaN||function(r){return r!==r};function Lt(){Lt.init.call(this)}Wb.exports=Lt;Wb.exports.once=Mue;Lt.EventEmitter=Lt;Lt.prototype._events=void 0;Lt.prototype._eventsCount=0;Lt.prototype._maxListeners=void 0;var jS=10;function Qp(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Lt,"defaultMaxListeners",{enumerable:!0,get:function(){return jS},set:function(e){if(typeof e!="number"||e<0||ZS(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");jS=e}});Lt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Lt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||ZS(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function XS(e){return e._maxListeners===void 0?Lt.defaultMaxListeners:e._maxListeners}Lt.prototype.getMaxListeners=function(){return XS(this)};Lt.prototype.emit=function(r){for(var t=[],a=1;a0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var s=i[r];if(s===void 0)return!1;if(typeof s=="function")WS(s,this,t);else for(var u=s.length,f=eq(s,u),a=0;a0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(r)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=r,l.count=o.length,_ue(l)}return e}Lt.prototype.addListener=function(r,t){return JS(this,r,t,!1)};Lt.prototype.on=Lt.prototype.addListener;Lt.prototype.prependListener=function(r,t){return JS(this,r,t,!0)};function wue(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function $S(e,r,t){var a={fired:!1,wrapFn:void 0,target:e,type:r,listener:t},n=wue.bind(a);return n.listener=t,a.wrapFn=n,n}Lt.prototype.once=function(r,t){return Qp(t),this.on(r,$S(this,r,t)),this};Lt.prototype.prependOnceListener=function(r,t){return Qp(t),this.prependListener(r,$S(this,r,t)),this};Lt.prototype.removeListener=function(r,t){var a,n,i,o,l;if(Qp(t),n=this._events,n===void 0)return this;if(a=n[r],a===void 0)return this;if(a===t||a.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,a.listener||t));else if(typeof a!="function"){for(i=-1,o=a.length-1;o>=0;o--)if(a[o]===t||a[o].listener===t){l=a[o].listener,i=o;break}if(i<0)return this;i===0?a.shift():Tue(a,i),a.length===1&&(n[r]=a[0]),n.removeListener!==void 0&&this.emit("removeListener",r,l||t)}return this};Lt.prototype.off=Lt.prototype.removeListener;Lt.prototype.removeAllListeners=function(r){var t,a,n;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[r]),this;if(arguments.length===0){var i=Object.keys(a),o;for(n=0;n=0;n--)this.removeListener(r,t[n]);return this};function KS(e,r,t){var a=e._events;if(a===void 0)return[];var n=a[r];return n===void 0?[]:typeof n=="function"?t?[n.listener||n]:[n]:t?Aue(n):eq(n,n.length)}Lt.prototype.listeners=function(r){return KS(this,r,!0)};Lt.prototype.rawListeners=function(r){return KS(this,r,!1)};Lt.listenerCount=function(e,r){return typeof e.listenerCount=="function"?e.listenerCount(r):QS.call(e,r)};Lt.prototype.listenerCount=QS;function QS(e){var r=this._events;if(r!==void 0){var t=r[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Lt.prototype.eventNames=function(){return this._eventsCount>0?Kp(this._events):[]};function eq(e,r){for(var t=new Array(r),a=0;a{"use strict";var jb=su().EventEmitter,Sue={init:function(e){if(e._ev instanceof jb)return e;var r=new jb,t=new jb;return e._ev=r,e._internalEv=t,e.on=r.on.bind(r),e.once=r.once.bind(r),e.removeListener=r.removeListener.bind(r),e.removeAllListeners=r.removeAllListeners.bind(r),e._internalOn=t.on.bind(t),e._internalOnce=t.once.bind(t),e._removeInternalListener=t.removeListener.bind(t),e._removeAllInternalListeners=t.removeAllListeners.bind(t),e.emit=function(a,n){r.emit(a,n),t.emit(a,n)},typeof e.addEventListener=="function"&&e.addEventListener("wheel",()=>{},{passive:!0}),e},triggerHandler:function(e,r,t){var a,n=e._ev;if(!n)return;var i=n._events[r];if(!i)return;function o(s){if(s.listener){if(n.removeListener(r,s.listener),!s.fired)return s.fired=!0,s.listener.apply(n,[t])}else return s.apply(n,[t])}i=Array.isArray(i)?i:[i];var l;for(l=0;l{"use strict";var aq=Ee(),que=tu().dfltConfig;function Lue(e,r){for(var t=[],a,n=0;nque.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)};hl.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0};hl.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1};hl.undo=function(r){var t,a;if(!(r.undoQueue===void 0||isNaN(r.undoQueue.index)||r.undoQueue.index<=0)){for(r.undoQueue.index--,t=r.undoQueue.queue[r.undoQueue.index],r.undoQueue.inSequence=!0,a=0;a=r.undoQueue.queue.length)){for(t=r.undoQueue.queue[r.undoQueue.index],r.undoQueue.inSequence=!0,a=0;a{"use strict";oq.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}});var Jf=N(ba=>{"use strict";var hi=br(),hh=Ee(),r1=gn(),Xb=Of(),Cue=Zb(),Eue=ih(),Due=tu().configAttributes,lq=eo(),ao=hh.extendDeepAll,Zf=hh.isPlainObject,Rue=hh.isArrayOrTypedArray,t1=hh.nestedProperty,Pue=hh.valObjectMeta,Jb="_isSubplotObj",a1="_isLinkedToArray",Fue="_arrayAttrRegexps",uq="_deprecated",$b=[Jb,a1,Fue,uq];ba.IS_SUBPLOT_OBJ=Jb;ba.IS_LINKED_TO_ARRAY=a1;ba.DEPRECATED=uq;ba.UNDERSCORE_ATTRS=$b;ba.get=function(){var e={};return hi.allTypes.forEach(function(r){e[r]=Iue(r)}),{defs:{valObjects:Pue,metaKeys:$b.concat(["description","role","editType","impliedEdits"]),editType:{traces:lq.traces,layout:lq.layout},impliedEdits:{}},traces:e,layout:zue(),frames:Oue(),animation:Xf(Eue),config:Xf(Due)}};ba.crawl=function(e,r,t,a){var n=t||0;a=a||"",Object.keys(e).forEach(function(i){var o=e[i];if($b.indexOf(i)===-1){var l=(a?a+".":"")+i;r(o,i,e,n,l),!ba.isValObject(o)&&Zf(o)&&i!=="impliedEdits"&&ba.crawl(o,r,n+1,l)}})};ba.isValObject=function(e){return e&&e.valType!==void 0};ba.findArrayAttributes=function(e){var r=[],t=[],a=[],n,i;function o(s,u,f,c){t=t.slice(0,c).concat([u]),a=a.slice(0,c).concat([s&&s._isLinkedToArray]);var v=s&&(s.valType==="data_array"||s.arrayOk===!0)&&!(t[c-1]==="colorbar"&&(u==="ticktext"||u==="tickvals"));v&&l(n,0,"")}function l(s,u,f){var c=s[t[u]],v=f+t[u];if(u===t.length-1)Rue(c)&&r.push(i+v);else if(a[u]){if(Array.isArray(c))for(var d=0;d=i.length)return!1;if(e.dimensions===2){if(t++,r.length===t)return e;var o=r[t];if(!e1(o))return!1;e=i[n][o]}else e=i[n]}else e=i}}return e}function e1(e){return e===Math.round(e)&&e>=0}function Iue(e){var r,t;r=hi.modules[e]._module,t=r.basePlotModule;var a={};a.type=null;var n=ao({},r1),i=ao({},r.attributes);ba.crawl(i,function(s,u,f,c,v){t1(n,v).set(void 0),s===void 0&&t1(i,v).set(void 0)}),ao(a,n),hi.traceIs(e,"noOpacity")&&delete a.opacity,hi.traceIs(e,"showLegend")||(delete a.showlegend,delete a.legendgroup),hi.traceIs(e,"noHover")&&(delete a.hoverinfo,delete a.hoverlabel),r.selectPoints||delete a.selectedpoints,ao(a,i),t.attributes&&ao(a,t.attributes),a.type=e;var o={meta:r.meta||{},categories:r.categories||{},animatable:!!r.animatable,type:e,attributes:Xf(a)};if(r.layoutAttributes){var l={};ao(l,r.layoutAttributes),o.layoutAttributes=Xf(l)}return r.animatable||ba.crawl(o,function(s){ba.isValObject(s)&&"anim"in s&&delete s.anim}),o}function zue(){var e={},r,t;ao(e,Xb);for(r in hi.subplotsRegistry)if(t=hi.subplotsRegistry[r],!!t.layoutAttributes)if(Array.isArray(t.attr))for(var a=0;a{"use strict";var $f=Ee(),Vue=gn(),es="templateitemname",Kb={name:{valType:"string",editType:"none"}};Kb[es]={valType:"string",editType:"calc"};uu.templatedArray=function(e,r){return r._isLinkedToArray=e,r.name=Kb.name,r[es]=Kb[es],r};uu.traceTemplater=function(e){var r={},t,a;for(t in e)a=e[t],Array.isArray(a)&&a.length&&(r[t]=0);function n(i){t=$f.coerce(i,{},Vue,"type");var o={type:t,_template:null};if(t in r){a=e[t];var l=r[t]%a.length;r[t]++,o._template=a[l]}return o}return{newTrace:n}};uu.newContainer=function(e,r,t){var a=e._template,n=a&&(a[r]||t&&a[t]);$f.isPlainObject(n)||(n=null);var i=e[r]={_template:n};return i};uu.arrayTemplater=function(e,r,t){var a=e._template,n=a&&a[vq(r)],i=a&&a[r];(!Array.isArray(i)||!i.length)&&(i=[]);var o={};function l(u){var f={name:u.name,_input:u},c=f[es]=u[es];if(!cq(c))return f._template=n,f;for(var v=0;v=a&&(t._input||{})._templateitemname;i&&(n=a);var o=r+"["+n+"]",l;function s(){l={},i&&(l[o]={},l[o][es]=i)}s();function u(d,p){l[d]=p}function f(d,p){i?$f.nestedProperty(l[o],d).set(p):l[o+"."+d]=p}function c(){var d=l;return s(),d}function v(d,p){d&&f(d,p);var y=c();for(var m in y)$f.nestedProperty(e,m).set(y[m])}return{modifyBase:u,modifyItem:f,getUpdateObj:c,applyUpdate:v}}});var xa=N((qDe,hq)=>{"use strict";var dh=Ff().counter;hq.exports={idRegex:{x:dh("x","( domain)?"),y:dh("y","( domain)?")},attrRegex:dh("[xy]axis"),xAxisMatch:dh("xaxis"),yAxisMatch:dh("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}});var fa=N(Dn=>{"use strict";var Yue=br(),Qb=xa();Dn.id2name=function(r){if(!(typeof r!="string"||!r.match(Qb.AX_ID_PATTERN))){var t=r.split(" ")[0].slice(1);return t==="1"&&(t=""),r.charAt(0)+"axis"+t}};Dn.name2id=function(r){if(r.match(Qb.AX_NAME_PATTERN)){var t=r.slice(5);return t==="1"&&(t=""),r.charAt(0)+t}};Dn.cleanId=function(r,t,a){var n=/( domain)$/.test(r);if(!(typeof r!="string"||!r.match(Qb.AX_ID_PATTERN))&&!(t&&r.charAt(0)!==t)&&!(n&&!a)){var i=r.split(" ")[0].slice(1).replace(/^0+/,"");return i==="1"&&(i=""),r.charAt(0)+i+(n&&a?" domain":"")}};Dn.list=function(e,r,t){var a=e._fullLayout;if(!a)return[];var n=Dn.listIds(e,r),i=new Array(n.length),o;for(o=0;oa?1:-1:+(e.slice(1)||1)-+(r.slice(1)||1)};Dn.ref2id=function(e){return/^[xyz]/.test(e)?e.split(" ")[0]:!1};function dq(e,r){if(r&&r.length){for(var t=0;t{"use strict";function Wue(e){var r=e._fullLayout._zoomlayer;r&&r.selectAll(".outline-controllers").remove()}function jue(e){var r=e._fullLayout._zoomlayer;r&&r.selectAll(".select-outline").remove(),e._fullLayout._outlining=!1}pq.exports={clearOutlineControllers:Wue,clearOutline:jue}});var n1=N((EDe,yq)=>{"use strict";yq.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}});var l1=N(o1=>{"use strict";var i1=br(),DDe=xa().SUBPLOT_PATTERN;o1.getSubplotCalcData=function(e,r,t){var a=i1.subplotsRegistry[r];if(!a)return[];for(var n=a.attr,i=[],o=0;o{"use strict";var Zue=br(),Kf=Ee();fu.manageCommandObserver=function(e,r,t,a){var n={},i=!0;r&&r._commandObserver&&(n=r._commandObserver),n.cache||(n.cache={}),n.lookupTable={};var o=fu.hasSimpleAPICommandBindings(e,t,n.lookupTable);if(r&&r._commandObserver){if(o)return n;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,n}if(o){mq(e,o,n.cache),n.check=function(){if(i){var f=mq(e,o,n.cache);return f.changed&&a&&n.lookupTable[f.value]!==void 0&&(n.disable(),Promise.resolve(a({value:f.value,type:o.type,prop:o.prop,traces:o.traces,index:n.lookupTable[f.value]})).then(n.enable,n.enable)),f.changed}};for(var l=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],s=0;s0?".":"")+n;Kf.isPlainObject(i)?ex(i,r,o,a+1):r(o,n,i)}})}});var aa=N((FDe,Pq)=>{"use strict";var Sq=Sr(),Jue=Ef().timeFormatLocale,$ue=lb().formatLocale,ph=Rr(),Kue=sb(),Qr=br(),qq=Jf(),Que=wt(),hr=Ee(),Lq=Tr(),_q=Ft().BADNUM,Rn=fa(),efe=rs().clearOutline,rfe=n1(),rx=ih(),tfe=Zb(),afe=l1().getModuleCalcData,wq=hr.relinkPrivateKeys,cu=hr._,Qe=Pq.exports={};hr.extendFlat(Qe,Qr);Qe.attributes=gn();Qe.attributes.type.values=Qe.allTypes;Qe.fontAttrs=ga();Qe.layoutAttributes=Of();var u1=xq();Qe.executeAPICommand=u1.executeAPICommand;Qe.computeAPICommandBindings=u1.computeAPICommandBindings;Qe.manageCommandObserver=u1.manageCommandObserver;Qe.hasSimpleAPICommandBindings=u1.hasSimpleAPICommandBindings;Qe.redrawText=function(e){return e=hr.getGraphDiv(e),new Promise(function(r){setTimeout(function(){e._fullLayout&&(Qr.getComponentMethod("annotations","draw")(e),Qr.getComponentMethod("legend","draw")(e),Qr.getComponentMethod("colorbar","draw")(e),r(Qe.previousPromises(e)))},300)})};Qe.resize=function(e){e=hr.getGraphDiv(e);var r,t=new Promise(function(a,n){(!e||hr.isHidden(e))&&n(new Error("Resize must be passed a displayed plot div element.")),e._redrawTimer&&clearTimeout(e._redrawTimer),e._resolveResize&&(r=e._resolveResize),e._resolveResize=a,e._redrawTimer=setTimeout(function(){if(!e.layout||e.layout.width&&e.layout.height||hr.isHidden(e)){a(e);return}delete e.layout.width,delete e.layout.height;var i=e.changed;e.autoplay=!0,Qr.call("relayout",e,{autosize:!0}).then(function(){e.changed=i,e._resolveResize===a&&(delete e._resolveResize,a(e))})},100)});return r&&r(t),t};Qe.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then(function(){e._promises=[]})};Qe.addLinks=function(e){if(!(!e._context.showLink&&!e._context.showSources)){var r=e._fullLayout,t=hr.ensureSingle(r._paper,"text","js-plot-link-container",function(s){s.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:Lq.defaultLine,"pointer-events":"all"}).each(function(){var u=Sq.select(this);u.append("tspan").classed("js-link-to-tool",!0),u.append("tspan").classed("js-link-spacer",!0),u.append("tspan").classed("js-sourcelinks",!0)})}),a=t.node(),n={y:r._paper.attr("height")-9};document.body.contains(a)&&a.getComputedTextLength()>=r.width-20?(n["text-anchor"]="start",n.x=5):(n["text-anchor"]="end",n.x=r._paper.attr("width")-7),t.attr(n);var i=t.select(".js-link-to-tool"),o=t.select(".js-link-spacer"),l=t.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&nfe(e,i),o.text(i.text()&&l.text()?" - ":"")}};function nfe(e,r){r.text("");var t=r.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" \xBB");if(e._context.sendData)t.on("click",function(){Qe.sendDataToCloud(e)});else{var a=window.location.pathname.split("/"),n=window.location.search;t.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+a[2].split(".")[0]+"/"+a[1]+n})}}Qe.sendDataToCloud=function(e){var r=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(r){e.emit("plotly_beforeexport");var t=Sq.select(e).append("div").attr("id","hiddenform").style("display","none"),a=t.append("form").attr({action:r+"/external",method:"post",target:"_blank"}),n=a.append("input").attr({type:"text",name:"data"});return n.node().value=Qe.graphJson(e,!1,"keepdata"),a.node().submit(),t.remove(),e.emit("plotly_afterexport"),!1}};var ife=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],ofe=["year","month","dayMonth","dayMonthYear"];Qe.supplyDefaults=function(e,r){var t=r&&r.skipUpdateCalc,a=e._fullLayout||{};if(a._skipDefaults){delete a._skipDefaults;return}var n=e._fullLayout={},i=e.layout||{},o=e._fullData||[],l=e._fullData=[],s=e.data||[],u=e.calcdata||[],f=e._context||{},c;e._transitionData||Qe.createTransitionData(e),n._dfltTitle={plot:cu(e,"Click to enter Plot title"),subtitle:cu(e,"Click to enter Plot subtitle"),x:cu(e,"Click to enter X axis title"),y:cu(e,"Click to enter Y axis title"),colorbar:cu(e,"Click to enter Colorscale title"),annotation:cu(e,"new text")},n._traceWord=cu(e,"trace");var v=Tq(e,ife);if(n._mapboxAccessToken=f.mapboxAccessToken,a._initialAutoSizeIsDone){var d=a.width,p=a.height;Qe.supplyLayoutGlobalDefaults(i,n,v),i.width||(n.width=d),i.height||(n.height=p),Qe.sanitizeMargins(n)}else{Qe.supplyLayoutGlobalDefaults(i,n,v);var y=!i.width||!i.height,m=n.autosize,x=f.autosizable,T=y&&(m||x);T?Qe.plotAutoSize(e,i,n):y&&Qe.sanitizeMargins(n),!m&&y&&(i.width=n.width,i.height=n.height)}n._d3locale=ufe(v,n.separators),n._extraFormat=Tq(e,ofe),n._initialAutoSizeIsDone=!0,n._dataLength=s.length,n._modules=[],n._visibleModules=[],n._basePlotModules=[];var _=n._subplots=sfe(),b=n._splomAxes={x:{},y:{}},w=n._splomSubplots={};n._splomGridDflt={},n._scatterStackOpts={},n._firstScatter={},n._alignmentOpts={},n._colorAxes={},n._requestRangeslider={},n._traceUids=lfe(o,s),Qe.supplyDataDefaults(s,l,i,n);var k=Object.keys(b.x),M=Object.keys(b.y);if(k.length>1&&M.length>1){for(Qr.getComponentMethod("grid","sizeDefaults")(i,n),c=0;c15&&M.length>15&&n.shapes.length===0&&n.images.length===0,Qe.linkSubplots(l,n,o,a),Qe.cleanPlot(l,n,o,a);var R=!!(a._has&&a._has("cartesian")),z=!!(n._has&&n._has("cartesian")),I=R,B=z;I&&!B?a._bgLayer.remove():B&&!I&&(n._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&efe({_fullLayout:a}),ffe(l,n),wq(n,a),Qr.getComponentMethod("colorscale","crossTraceDefaults")(l,n),n._preGUI||(n._preGUI={}),n._tracePreGUI||(n._tracePreGUI={});var G=n._tracePreGUI,Y={},V;for(V in G)Y[V]="old";for(c=0;c0){var f=1-2*i;o=Math.round(f*o),l=Math.round(f*l)}}var c=Qe.layoutAttributes.width.min,v=Qe.layoutAttributes.height.min;o1,p=!t.height&&Math.abs(a.height-l)>1;(p||d)&&(d&&(a.width=o),p&&(a.height=l)),r._initialAutoSize||(r._initialAutoSize={width:o,height:l}),Qe.sanitizeMargins(a)};Qe.supplyLayoutModuleDefaults=function(e,r,t,a){var n=Qr.componentsRegistry,i=r._basePlotModules,o,l,s,u=Qr.subplotsRegistry.cartesian;for(o in n)s=n[o],s.includeBasePlot&&s.includeBasePlot(e,r);i.length||i.push(u),r._has("cartesian")&&(Qr.getComponentMethod("grid","contentDefaults")(e,r),u.finalizeSubplots(e,r));for(var f in r._subplots)r._subplots[f].sort(hr.subplotSort);for(l=0;l1&&(t.l/=m,t.r/=m)}if(v){var x=(t.t+t.b)/v;x>1&&(t.t/=x,t.b/=x)}var T=t.xl!==void 0?t.xl:t.x,_=t.xr!==void 0?t.xr:t.x,b=t.yt!==void 0?t.yt:t.y,w=t.yb!==void 0?t.yb:t.y;d[r]={l:{val:T,size:t.l+y},r:{val:_,size:t.r+y},b:{val:w,size:t.b+y},t:{val:b,size:t.t+y}},p[r]=1}if(!a._replotting)return Qe.doAutoMargin(e)}};function vfe(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var r=Rn.list(e,"",!0);for(var t in r)if(r[t].autoshift||r[t].shift)return!0;return!1}Qe.doAutoMargin=function(e){var r=e._fullLayout,t=r.width,a=r.height;r._size||(r._size={}),Cq(r);var n=r._size,i=r.margin,o={t:0,b:0,l:0,r:0},l=hr.extendFlat({},n),s=i.l,u=i.r,f=i.t,c=i.b,v=r._pushmargin,d=r._pushmarginIds,p=r.minreducedwidth,y=r.minreducedheight;if(i.autoexpand!==!1){for(var m in v)d[m]||delete v[m];var x=e._fullLayout._reservedMargin;for(var T in x)for(var _ in x[T]){var b=x[T][_];o[_]=Math.max(o[_],b)}v.base={l:{val:0,size:s},r:{val:1,size:u},t:{val:1,size:f},b:{val:0,size:c}};for(var w in o){var k=0;for(var M in v)M!=="base"&&ph(v[M][w].size)&&(k=v[M][w].size>k?v[M][w].size:k);var q=Math.max(0,i[w]-k);o[w]=Math.max(0,o[w]-q)}for(var E in v){var D=v[E].l||{},P=v[E].b||{},R=D.val,z=D.size,I=P.val,B=P.size,G=t-o.r-o.l,Y=a-o.t-o.b;for(var V in v){if(ph(z)&&v[V].r){var H=v[V].r.val,X=v[V].r.size;if(H>R){var j=(z*H+(X-G)*R)/(H-R),ee=(X*(1-R)+(z-G)*(1-H))/(H-R);j+ee>s+u&&(s=j,u=ee)}}if(ph(B)&&v[V].t){var fe=v[V].t.val,ie=v[V].t.size;if(fe>I){var ue=(B*fe+(ie-Y)*I)/(fe-I),K=(ie*(1-I)+(B-Y)*(1-fe))/(fe-I);ue+K>c+f&&(c=ue,f=K)}}}}}var we=hr.constrain(t-i.l-i.r,Eq,p),se=hr.constrain(a-i.t-i.b,Dq,y),ce=Math.max(0,t-we),he=Math.max(0,a-se);if(ce){var ye=(s+u)/ce;ye>1&&(s/=ye,u/=ye)}if(he){var W=(c+f)/he;W>1&&(c/=W,f/=W)}if(n.l=Math.round(s)+o.l,n.r=Math.round(u)+o.r,n.t=Math.round(f)+o.t,n.b=Math.round(c)+o.b,n.p=Math.round(i.pad),n.w=Math.round(t)-n.l-n.r,n.h=Math.round(a)-n.t-n.b,!r._replotting&&(Qe.didMarginChange(l,n)||vfe(e))){"_redrawFromAutoMarginCount"in r?r._redrawFromAutoMarginCount++:r._redrawFromAutoMarginCount=1;var Q=3*(1+Object.keys(d).length);if(r._redrawFromAutoMarginCount1)return!0}return!1};Qe.graphJson=function(e,r,t,a,n,i){(n&&r&&!e._fullData||n&&!r&&!e._fullLayout)&&Qe.supplyDefaults(e);var o=n?e._fullData:e.data,l=n?e._fullLayout:e.layout,s=(e._transitionData||{})._frames;function u(v,d){if(typeof v=="function")return d?"_function_":null;if(hr.isPlainObject(v)){var p={},y;return Object.keys(v).sort().forEach(function(_){if(["_","["].indexOf(_.charAt(0))===-1){if(typeof v[_]=="function"){d&&(p[_]="_function");return}if(t==="keepdata"){if(_.slice(-3)==="src")return}else if(t==="keepstream"){if(y=v[_+"src"],typeof y=="string"&&y.indexOf(":")>0&&!hr.isPlainObject(v.stream))return}else if(t!=="keepall"&&(y=v[_+"src"],typeof y=="string"&&y.indexOf(":")>0))return;p[_]=u(v[_],d)}}),p}var m=Array.isArray(v),x=hr.isTypedArray(v);if((m||x)&&v.dtype&&v.shape){var T=v.bdata;return u({dtype:v.dtype,shape:v.shape,bdata:hr.isArrayBuffer(T)?Kue.encode(T):T},d)}return m?v.map(function(_){return u(_,d)}):x?hr.simpleMap(v,hr.identity):hr.isJSDate(v)?hr.ms2DateTimeLocal(+v):v}var f={data:(o||[]).map(function(v){var d=u(v);return r&&delete d.fit,d})};if(!r&&(f.layout=u(l),n)){var c=l._size;f.layout.computed={margin:{b:c.b,l:c.l,r:c.r,t:c.t}}}return s&&(f.frames=u(s)),i&&(f.config=u(e._context,!0)),a==="object"?f:JSON.stringify(f)};Qe.modifyFrames=function(e,r){var t,a,n,i=e._transitionData._frames,o=e._transitionData._frameHash;for(t=0;t0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push(function(){a=!0}),t.redraw&&e._transitionData._interruptCallbacks.push(function(){return Qr.call("redraw",e)}),e._transitionData._interruptCallbacks.push(function(){e.emit("plotly_transitioninterrupted",[])});var v=0,d=0;function p(){return v++,function(){d++,!a&&d===v&&l(c)}}t.runFn(p),setTimeout(p())})}function l(c){if(e._transitionData)return i(e._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(t.redraw)return Qr.call("redraw",e)}).then(function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])}).then(c)}function s(){if(e._transitionData)return e._transitioning=!1,n(e._transitionData._interruptCallbacks)}var u=[Qe.previousPromises,s,t.prepareFn,Qe.rehover,Qe.reselect,o],f=hr.syncOrAsync(u,e);return(!f||!f.then)&&(f=Promise.resolve()),f.then(function(){return e})}Qe.doCalcdata=function(e,r){var t=Rn.list(e),a=e._fullData,n=e._fullLayout,i,o,l,s,u=new Array(a.length),f=(e.calcdata||[]).slice();for(e.calcdata=u,n._numBoxes=0,n._numViolins=0,n._violinScaleGroupStats={},e._hmpixcount=0,e._hmlumcount=0,n._piecolormap={},n._sunburstcolormap={},n._treemapcolormap={},n._iciclecolormap={},n._funnelareacolormap={},l=0;l=0;s--)if(w[s].enabled){i._indexToPoints=w[s]._indexToPoints;break}o&&o.calc&&(b=o.calc(e,i))}(!Array.isArray(b)||!b[0])&&(b=[{x:_q,y:_q}]),b[0].t||(b[0].t={}),b[0].trace=i,u[T]=b}}for(Mq(t,a,n),l=0;l{"use strict";vu.xmlns="http://www.w3.org/2000/xmlns/";vu.svg="http://www.w3.org/2000/svg";vu.xlink="http://www.w3.org/1999/xlink";vu.svgAttrs={xmlns:vu.svg,"xmlns:xlink":vu.xlink}});var Ha=N((IDe,Fq)=>{"use strict";Fq.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}});var Aa=N(di=>{"use strict";var ca=Sr(),pl=Ee(),yfe=pl.strTranslate,tx=dl(),mfe=Ha().LINE_SPACING,gfe=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;di.convertToTspans=function(e,r,t){var a=e.text(),n=!e.attr("data-notex")&&r&&r._context.typesetMath&&typeof MathJax!="undefined"&&a.match(gfe),i=ca.select(e.node().parentNode);if(i.empty())return;var o=e.attr("class")?e.attr("class").split(" ")[0]:"text";o+="-math",i.selectAll("svg."+o).remove(),i.selectAll("g."+o+"-group").remove(),e.style("display",null).attr({"data-unformatted":a,"data-math":"N"});function l(){i.empty()||(o=e.attr("class")+"-math",i.select("svg."+o).remove()),e.text("").style("white-space","pre");var s=Efe(e.node(),a);s&&e.style("pointer-events","all"),di.positionText(e),t&&t.call(e)}return n?(r&&r._promises||[]).push(new Promise(function(s){e.style("display","none");var u=parseInt(e.node().style.fontSize,10),f={fontSize:u};wfe(n[2],f,function(c,v,d){i.selectAll("svg."+o).remove(),i.selectAll("g."+o+"-group").remove();var p=c&&c.select("svg");if(!p||!p.node()){l(),s();return}var y=i.append("g").classed(o+"-group",!0).attr({"pointer-events":"none","data-unformatted":a,"data-math":"Y"});y.node().appendChild(p.node()),v&&v.node()&&p.node().insertBefore(v.node().cloneNode(!0),p.node().firstChild);var m=d.width,x=d.height;p.attr({class:o,height:x,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var T=e.node().style.fill||"black",_=p.select("g");_.attr({fill:T,stroke:T});var b=_.node().getBoundingClientRect(),w=b.width,k=b.height;(w>m||k>x)&&(p.style("overflow","hidden"),b=p.node().getBoundingClientRect(),w=b.width,k=b.height);var M=+e.attr("x"),q=+e.attr("y"),E=u||e.node().getBoundingClientRect().height,D=-E/4;if(o[0]==="y")y.attr({transform:"rotate("+[-90,M,q]+")"+yfe(-w/2,D-k/2)});else if(o[0]==="l")q=D-k/2;else if(o[0]==="a"&&o.indexOf("atitle")!==0)M=0,q=D;else{var P=e.attr("text-anchor");M=M-w*(P==="middle"?.5:P==="end"?1:0),q=q+D-k/2}p.attr({x:M,y:q}),t&&t.call(e,y),s(y)})})):l(),e};var bfe=/(<|<|<)/g,xfe=/(>|>|>)/g;function _fe(e){return e.replace(bfe,"\\lt ").replace(xfe,"\\gt ")}var Nq=[["$","$"],["\\(","\\)"]];function wfe(e,r,t){var a=parseInt((MathJax.version||"").split(".")[0]);if(a!==2&&a!==3){pl.warn("No MathJax version:",MathJax.version);return}var n,i,o,l,s=function(){return i=pl.extendDeepAll({},MathJax.Hub.config),o=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:Nq},displayAlign:"left"})},u=function(){i=pl.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=Nq},f=function(){if(n=MathJax.Hub.config.menuSettings.renderer,n!=="SVG")return MathJax.Hub.setRenderer("SVG")},c=function(){n=MathJax.config.startup.output,n!=="svg"&&(MathJax.config.startup.output="svg")},v=function(){var T="math-output-"+pl.randstr({},64);l=ca.select("body").append("div").attr({id:T}).style({visibility:"hidden",position:"absolute","font-size":r.fontSize+"px"}).text(_fe(e));var _=l.node();return a===2?MathJax.Hub.Typeset(_):MathJax.typeset([_])},d=function(){var T=l.select(a===2?".MathJax_SVG":".MathJax"),_=!T.empty()&&l.select("svg").node();if(!_)pl.log("There was an error in the tex syntax.",e),t();else{var b=_.getBoundingClientRect(),w;a===2?w=ca.select("body").select("#MathJax_SVG_glyphs"):w=T.select("defs"),t(T,w,b)}l.remove()},p=function(){if(n!=="SVG")return MathJax.Hub.setRenderer(n)},y=function(){n!=="svg"&&(MathJax.config.startup.output=n)},m=function(){return o!==void 0&&(MathJax.Hub.processSectionDelay=o),MathJax.Hub.Config(i)},x=function(){MathJax.config=i};a===2?MathJax.Hub.Queue(s,f,v,d,p,m):a===3&&(u(),c(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){v(),d(),y(),x()}))}var Bq={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},Tfe={sub:"0.3em",sup:"-0.6em"},Afe={sub:"-0.21em",sup:"0.42em"},Iq="\u200B",zq=["http:","https:","mailto:","",void 0,":"],Hq=di.NEWLINES=/(\r\n?|\n)/g,nx=/(<[^<>]*>)/,ix=/<(\/?)([^ >]*)(\s+(.*))?>/i,Mfe=//i;di.BR_TAG_ALL=//gi;var Uq=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,Gq=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,Vq=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,kfe=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function hu(e,r){if(!e)return null;var t=e.match(r),a=t&&(t[3]||t[4]);return a&&f1(a)}var Sfe=/(^|;)\s*color:/;di.plainText=function(e,r){r=r||{};for(var t=r.len!==void 0&&r.len!==-1?r.len:1/0,a=r.allowedTags!==void 0?r.allowedTags:["br"],n="...",i=n.length,o=e.split(nx),l=[],s="",u=0,f=0;fi?l.push(c.slice(0,Math.max(0,y-i))+n):l.push(c.slice(0,y));break}s=""}}return l.join("")};var qfe={mu:"\u03BC",amp:"&",lt:"<",gt:">",nbsp:"\xA0",times:"\xD7",plusmn:"\xB1",deg:"\xB0"},Lfe=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function f1(e){return e.replace(Lfe,function(r,t){var a;return t.charAt(0)==="#"?a=Cfe(t.charAt(1)==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10)):a=qfe[t],a||r})}di.convertEntities=f1;function Cfe(e){if(!(e>1114111)){var r=String.fromCodePoint;if(r)return r(e);var t=String.fromCharCode;return e<=65535?t(e):t((e>>10)+55232,e%1024+56320)}}function Efe(e,r){r=r.replace(Hq," ");var t=!1,a=[],n,i=-1;function o(){i++;var k=document.createElementNS(tx.svg,"tspan");ca.select(k).attr({class:"line",dy:i*mfe+"em"}),e.appendChild(k),n=k;var M=a;if(a=[{node:k}],M.length>1)for(var q=1;q.",r);return}var M=a.pop();k!==M.type&&pl.log("Start tag <"+M.type+"> doesnt match end tag <"+k+">. Pretending it did match.",r),n=a[a.length-1].node}var f=Mfe.test(r);f?o():(n=e,a=[{node:e}]);for(var c=r.split(nx),v=0;v{"use strict";var Dfe=Sr(),v1=qn(),mh=Rr(),c1=Ee(),Wq=Tr(),Rfe=eu().isValid;function Pfe(e,r,t){var a=r?c1.nestedProperty(e,r).get()||{}:e,n=a[t||"color"];n&&n._inputArray&&(n=n._inputArray);var i=!1;if(c1.isArrayOrTypedArray(n)){for(var o=0;o=0;a--,n++){var i=e[a];t[n]=[1-i[0],i[1]]}return t}function Kq(e,r){r=r||{};for(var t=e.domain,a=e.range,n=a.length,i=new Array(n),o=0;o{"use strict";var eL=Mb(),Nfe=eL.FORMAT_LINK,Ife=eL.DATE_FORMAT_LINK;function zfe(e,r){return{valType:"string",dflt:"",editType:"none",description:(r?ox:rL)("hover text",e)+["By default the values are formatted using "+(r?"generic number format":"`"+e+"axis.hoverformat`")+"."].join(" ")}}function ox(e,r){return["Sets the "+e+" formatting rule"+(r?"for `"+r+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+Nfe+"."].join(" ")}function rL(e,r){return ox(e,r)+[" And for dates see: "+Ife+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}tL.exports={axisHoverFormat:zfe,descriptionOnlyNumbers:ox,descriptionWithDates:rL}});var pi=N((UDe,bL)=>{"use strict";var aL=ga(),Qf=fi(),gL=ci().dash,sx=bt().extendFlat,nL=wt().templatedArray,HDe=Wn().templateFormatStringDescription,iL=no().descriptionWithDates,Ofe=Ft().ONEDAY,qo=xa(),Bfe=qo.HOUR_PATTERN,Hfe=qo.WEEKDAY_PATTERN,lx={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},Ufe=sx({},lx,{values:lx.values.slice().concat(["sync"])});function oL(e){return{valType:"integer",min:0,dflt:e?5:0,editType:"ticks"}}var lL={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},sL={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},uL={valType:"data_array",editType:"ticks"},fL={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function cL(e){var r={valType:"number",min:0,editType:"ticks"};return e||(r.dflt=5),r}function vL(e){var r={valType:"number",min:0,editType:"ticks"};return e||(r.dflt=1),r}var hL={valType:"color",dflt:Qf.defaultLine,editType:"ticks"},dL={valType:"color",dflt:Qf.lightLine,editType:"ticks"};function pL(e){var r={valType:"number",min:0,editType:"ticks"};return e||(r.dflt=1),r}var yL=sx({},gL,{editType:"ticks"}),mL={valType:"boolean",editType:"ticks"};bL.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:Qf.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:aL({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},modebardisable:{valType:"flaglist",flags:["autoscale","zoominout"],extras:["none"],dflt:"none",editType:"modebar"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[qo.idRegex.x.toString(),qo.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[qo.idRegex.x.toString(),qo.idRegex.y.toString()],editType:"calc"},rangebreaks:nL("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[Hfe,Bfe,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:Ofe},editType:"calc"}),tickmode:Ufe,nticks:oL(),tick0:lL,dtick:sL,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:uL,ticktext:{valType:"data_array",editType:"ticks"},ticks:fL,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:cL(),tickwidth:vL(),tickcolor:hL,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:sx({},gL,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:aL({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B","SI extended"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:iL("tick label")},tickformatstops:nL("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:iL("hover text")},unifiedhovertitle:{text:{valType:"string",dflt:"",editType:"none"},editType:"none"},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:Qf.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:mL,gridcolor:dL,gridwidth:pL(),griddash:yL,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:Qf.defaultLine,editType:"ticks"},zerolinelayer:{valType:"enumerated",values:["above traces","below traces"],dflt:"below traces",editType:"plot"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:Qf.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",qo.idRegex.x.toString(),qo.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",qo.idRegex.x.toString(),qo.idRegex.y.toString()],editType:"plot"},minor:{tickmode:lx,nticks:oL("minor"),tick0:lL,dtick:sL,tickvals:uL,ticks:fL,ticklen:cL("minor"),tickwidth:vL("minor"),tickcolor:hL,gridcolor:dL,gridwidth:pL("minor"),griddash:yL,showgrid:mL,editType:"ticks"},minorloglabels:{valType:"enumerated",values:["small digits","complete","none"],dflt:"small digits",editType:"calc"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}});var h1=N((GDe,wL)=>{"use strict";var Ct=pi(),xL=ga(),_L=bt().extendFlat,Gfe=eo().overrideAll;wL.exports=Gfe({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:Ct.linecolor,outlinewidth:Ct.linewidth,bordercolor:Ct.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:Ct.minor.tickmode,nticks:Ct.nticks,tick0:Ct.tick0,dtick:Ct.dtick,tickvals:Ct.tickvals,ticktext:Ct.ticktext,ticks:_L({},Ct.ticks,{dflt:""}),ticklabeloverflow:_L({},Ct.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:Ct.ticklen,tickwidth:Ct.tickwidth,tickcolor:Ct.tickcolor,ticklabelstep:Ct.ticklabelstep,showticklabels:Ct.showticklabels,labelalias:Ct.labelalias,tickfont:xL({}),tickangle:Ct.tickangle,tickformat:Ct.tickformat,tickformatstops:Ct.tickformatstops,tickprefix:Ct.tickprefix,showtickprefix:Ct.showtickprefix,ticksuffix:Ct.ticksuffix,showticksuffix:Ct.showticksuffix,separatethousands:Ct.separatethousands,exponentformat:Ct.exponentformat,minexponent:Ct.minexponent,showexponent:Ct.showexponent,title:{text:{valType:"string"},font:xL({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")});var Lo=N((YDe,AL)=>{"use strict";var Vfe=h1(),Yfe=Ff().counter,Wfe=Db(),TL=eu().scales,VDe=Wfe(TL);function d1(e){return"`"+e+"`"}AL.exports=function(r,t){r=r||"",t=t||{};var a=t.cLetter||"c",n="onlyIfNumerical"in t?t.onlyIfNumerical:!!r,i="noScale"in t?t.noScale:r==="marker.line",o="showScaleDflt"in t?t.showScaleDflt:a==="z",l=typeof t.colorscaleDflt=="string"?TL[t.colorscaleDflt]:null,s=t.editTypeOverride||"",u=r?r+".":"",f,c;"colorAttr"in t?(f=t.colorAttr,c=t.colorAttr):(f={z:"z",c:"color"}[a],c="in "+d1(u+f));var v=n?" Has an effect only if "+c+" is set to a numerical array.":"",d=a+"auto",p=a+"min",y=a+"max",m=a+"mid",x=d1(u+d),T=d1(u+p),_=d1(u+y),b=T+" and "+_,w={};w[p]=w[y]=void 0;var k={};k[d]=!1;var M={};return f==="color"&&(M.color={valType:"color",arrayOk:!0,editType:s||"style"},t.anim&&(M.color.anim=!0)),M[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:w},M[p]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:k},M[y]={valType:"number",dflt:null,editType:s||"plot",impliedEdits:k},M[m]={valType:"number",dflt:null,editType:"calc",impliedEdits:w},M.colorscale={valType:"colorscale",editType:"calc",dflt:l,impliedEdits:{autocolorscale:!1}},M.autocolorscale={valType:"boolean",dflt:t.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},M.reversescale={valType:"boolean",dflt:!1,editType:"plot"},i||(M.showscale={valType:"boolean",dflt:o,editType:"calc"},M.colorbar=Vfe),t.noColorAxis||(M.coloraxis={valType:"subplotid",regex:Yfe("coloraxis"),dflt:null,editType:"calc"}),M}});var fx=N((WDe,ML)=>{"use strict";var jfe=bt().extendFlat,Zfe=Lo(),ux=eu().scales;ML.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:ux.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:ux.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:ux.RdBu,editType:"calc"}},coloraxis:jfe({_isSubplotObj:!0,editType:"calc"},Zfe("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}});var cx=N((jDe,kL)=>{"use strict";var Xfe=Ee();kL.exports=function(r){return Xfe.isPlainObject(r.colorbar)}});var dx=N(hx=>{"use strict";var vx=Rr(),SL=Ee(),qL=Ft(),Jfe=qL.ONEDAY,$fe=qL.ONEWEEK;hx.dtick=function(e,r){var t=r==="log",a=r==="date",n=r==="category",i=a?Jfe:1;if(!e)return i;if(vx(e))return e=Number(e),e<=0?i:n?Math.max(1,Math.round(e)):a?Math.max(.1,e):e;if(typeof e!="string"||!(a||t))return i;var o=e.charAt(0),l=e.slice(1);return l=vx(l)?Number(l):0,l<=0||!(a&&o==="M"&&l===Math.round(l)||t&&o==="L"||t&&o==="D"&&(l===1||l===2))?i:e};hx.tick0=function(e,r,t,a){if(r==="date")return SL.cleanDate(e,SL.dateTick0(t,a%$fe===0?1:0));if(!(a==="D1"||a==="D2"))return vx(e)?Number(e):0}});var p1=N((XDe,CL)=>{"use strict";var LL=dx(),Kfe=Ee().isArrayOrTypedArray,Qfe=Yn().isTypedArraySpec,ece=Yn().decodeTypedArraySpec;CL.exports=function(r,t,a,n,i){i||(i={});var o=i.isMinor,l=o?r.minor||{}:r,s=o?t.minor:t,u=o?"minor.":"";function f(T){var _=l[T];return Qfe(_)&&(_=ece(_)),_!==void 0?_:(s._template||{})[T]}var c=f("tick0"),v=f("dtick"),d=f("tickvals"),p=Kfe(d)?"array":v?"linear":"auto",y=a(u+"tickmode",p);if(y==="auto"||y==="sync")a(u+"nticks");else if(y==="linear"){var m=s.dtick=LL.dtick(v,n);s.tick0=LL.tick0(c,n,t.calendar,m)}else if(n!=="multicategory"){var x=a(u+"tickvals");x===void 0?s.tickmode="auto":o||a("ticktext")}}});var y1=N((JDe,DL)=>{"use strict";var px=Ee(),EL=pi();DL.exports=function(r,t,a,n){var i=n.isMinor,o=i?r.minor||{}:r,l=i?t.minor:t,s=i?EL.minor:EL,u=i?"minor.":"",f=px.coerce2(o,l,s,"ticklen",i?(t.ticklen||5)*.6:void 0),c=px.coerce2(o,l,s,"tickwidth",i?t.tickwidth||1:void 0),v=px.coerce2(o,l,s,"tickcolor",(i?t.tickcolor:void 0)||l.color),d=a(u+"ticks",!i&&n.outerTicks||f||c||v?"outside":"");d||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)}});var yx=N(($De,RL)=>{"use strict";RL.exports=function(r){var t=["showexponent","showtickprefix","showticksuffix"],a=t.filter(function(i){return r[i]!==void 0}),n=function(i){return r[i]===r[a[0]]};if(a.every(n)||a.length===1)return r[a[0]]}});var io=N((KDe,PL)=>{"use strict";var m1=Ee(),rce=wt();PL.exports=function(r,t,a){var n=a.name,i=a.inclusionAttr||"visible",o=t[n],l=m1.isArrayOrTypedArray(r[n])?r[n]:[],s=t[n]=[],u=rce.arrayTemplater(t,n,i),f,c;for(f=0;f{"use strict";var mx=Ee(),tce=Tr().contrast,FL=pi(),ace=yx(),nce=io();NL.exports=function(r,t,a,n,i){i||(i={});var o=a("labelalias");mx.isPlainObject(o)||delete t.labelalias;var l=ace(r),s=a("showticklabels");if(s){i.noTicklabelshift||a("ticklabelshift"),i.noTicklabelstandoff||a("ticklabelstandoff");var u=i.font||{},f=t.color,c=t.ticklabelposition||"",v=c.indexOf("inside")!==-1?tce(i.bgColor):f&&f!==FL.color.dflt?f:u.color;if(mx.coerceFont(a,"tickfont",u,{overrideDflt:{color:v}}),!i.noTicklabelstep&&n!=="multicategory"&&n!=="log"&&a("ticklabelstep"),!i.noAng){var d=a("tickangle");!i.noAutotickangles&&d==="auto"&&a("autotickangles")}if(n!=="category"){var p=a("tickformat");nce(r,t,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:ice}),t.tickformatstops.length||delete t.tickformatstops,!i.noExp&&!p&&n!=="date"&&(a("showexponent",l),a("exponentformat"),a("minexponent"),a("separatethousands"))}!i.noMinorloglabels&&n==="log"&&a("minorloglabels")}};function ice(e,r){function t(n,i){return mx.coerce(e,r,FL.tickformatstops,n,i)}var a=t("enabled");a&&(t("dtickrange"),t("value"))}});var b1=N((eRe,IL)=>{"use strict";var oce=yx();IL.exports=function(r,t,a,n,i){i||(i={});var o=i.tickSuffixDflt,l=oce(r),s=a("tickprefix");s&&a("showtickprefix",l);var u=a("ticksuffix",o);u&&a("showticksuffix",l)}});var gx=N((rRe,zL)=>{"use strict";var ts=Ee(),lce=wt(),sce=p1(),uce=y1(),fce=g1(),cce=b1(),vce=h1();zL.exports=function(r,t,a){var n=lce.newContainer(t,"colorbar"),i=r.colorbar||{};function o(P,R){return ts.coerce(i,n,vce,P,R)}var l=a.margin||{t:0,b:0,l:0,r:0},s=a.width-l.l-l.r,u=a.height-l.t-l.b,f=o("orientation"),c=f==="v",v=o("thicknessmode");o("thickness",v==="fraction"?30/(c?s:u):30);var d=o("lenmode");o("len",d==="fraction"?1:c?u:s);var p=o("yref"),y=o("xref"),m=p==="paper",x=y==="paper",T,_,b,w="left";c?(b="middle",w=x?"left":"right",T=x?1.02:1,_=.5):(b=m?"bottom":"top",w="center",T=.5,_=m?1.02:1),ts.coerce(i,n,{x:{valType:"number",min:x?-2:0,max:x?3:1,dflt:T}},"x"),ts.coerce(i,n,{y:{valType:"number",min:m?-2:0,max:m?3:1,dflt:_}},"y"),o("xanchor",w),o("xpad"),o("yanchor",b),o("ypad"),ts.noneOrAll(i,n,["x","y"]),o("outlinecolor"),o("outlinewidth"),o("bordercolor"),o("borderwidth"),o("bgcolor");var k=ts.coerce(i,n,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:c?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");o("ticklabeloverflow",k.indexOf("inside")!==-1?"hide past domain":"hide past div"),sce(i,n,o,"linear");var M=a.font,q={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:M};k.indexOf("inside")!==-1&&(q.bgColor="black"),cce(i,n,o,"linear",q),fce(i,n,o,"linear",q),uce(i,n,o,"linear",q),o("title.text",a._dfltTitle.colorbar);var E=n.showticklabels?n.tickfont:M,D=ts.extendFlat({},M,{family:E.family,size:ts.bigFont(E.size)});ts.coerceFont(o,"title.font",D),o("title.side",c?"top":"right")}});var yl=N((tRe,HL)=>{"use strict";var OL=Rr(),xx=Ee(),hce=cx(),dce=gx(),BL=eu().isValid,pce=br().traceIs;function bx(e,r){var t=r.slice(0,r.length-1);return r?xx.nestedProperty(e,t).get()||{}:e}HL.exports=function e(r,t,a,n,i){var o=i.prefix,l=i.cLetter,s="_module"in t,u=bx(r,o),f=bx(t,o),c=bx(t._template||{},o)||{},v=function(){return delete r.coloraxis,delete t.coloraxis,e(r,t,a,n,i)};if(s){var d=a._colorAxes||{},p=n(o+"coloraxis");if(p){var y=pce(t,"contour")&&xx.nestedProperty(t,"contours.coloring").get()||"heatmap",m=d[p];m?(m[2].push(v),m[0]!==y&&(m[0]=!1,xx.warn(["Ignoring coloraxis:",p,"setting","as it is linked to incompatible colorscales."].join(" ")))):d[p]=[y,t,[v]];return}}var x=u[l+"min"],T=u[l+"max"],_=OL(x)&&OL(T)&&x{"use strict";var UL=Ee(),yce=wt(),GL=fx(),mce=yl();VL.exports=function(r,t){function a(c,v){return UL.coerce(r,t,GL,c,v)}a("colorscale.sequential"),a("colorscale.sequentialminus"),a("colorscale.diverging");var n=t._colorAxes,i,o;function l(c,v){return UL.coerce(i,o,GL.coloraxis,c,v)}for(var s in n){var u=n[s];if(u[0])i=r[s]||{},o=yce.newContainer(t,s,"coloraxis"),o._name=s,mce(i,o,t,l,{prefix:"",cLetter:"c"});else{for(var f=0;f{"use strict";var gce=Ee(),bce=Zn().hasColorscale,xce=Zn().extractOpts;WL.exports=function(r,t){function a(f,c){var v=f["_"+c];v!==void 0&&(f[c]=v)}function n(f,c){var v=c.container?gce.nestedProperty(f,c.container).get():f;if(v)if(v.coloraxis)v._colorAx=t[v.coloraxis];else{var d=xce(v),p=d.auto;(p||d.min===void 0)&&a(v,c.min),(p||d.max===void 0)&&a(v,c.max),d.autocolorscale&&a(v,"colorscale")}}for(var i=0;i{"use strict";var ZL=Rr(),_x=Ee(),_ce=Zn().extractOpts;XL.exports=function(r,t,a){var n=r._fullLayout,i=a.vals,o=a.containerStr,l=o?_x.nestedProperty(t,o).get():t,s=_ce(l),u=s.auto!==!1,f=s.min,c=s.max,v=s.mid,d=function(){return _x.aggNums(Math.min,null,i)},p=function(){return _x.aggNums(Math.max,null,i)};if(f===void 0?f=d():u&&(l._colorAx&&ZL(f)?f=Math.min(f,d()):f=d()),c===void 0?c=p():u&&(l._colorAx&&ZL(c)?c=Math.max(c,p()):c=p()),u&&v!==void 0&&(c-v>v-f?f=v-(c-v):c-v=0?y=n.colorscale.sequential:y=n.colorscale.sequentialminus,s._sync("colorscale",y)}}});var Co=N((oRe,JL)=>{"use strict";var x1=eu(),rc=Zn();JL.exports={moduleType:"component",name:"colorscale",attributes:Lo(),layoutAttributes:fx(),supplyLayoutDefaults:YL(),handleDefaults:yl(),crossTraceDefaults:jL(),calc:ec(),scales:x1.scales,defaultScale:x1.defaultScale,getScale:x1.get,isValidScale:x1.isValid,hasColorscale:rc.hasColorscale,extractOpts:rc.extractOpts,extractScale:rc.extractScale,flipScale:rc.flipScale,makeColorScaleFunc:rc.makeColorScaleFunc,makeColorScaleFuncFromTrace:rc.makeColorScaleFuncFromTrace}});var Pn=N((lRe,KL)=>{"use strict";var $L=Ee(),wce=Yn().isTypedArraySpec;KL.exports={hasLines:function(e){return e.visible&&e.mode&&e.mode.indexOf("lines")!==-1},hasMarkers:function(e){return e.visible&&(e.mode&&e.mode.indexOf("markers")!==-1||e.type==="splom")},hasText:function(e){return e.visible&&e.mode&&e.mode.indexOf("text")!==-1},isBubble:function(e){var r=e.marker;return $L.isPlainObject(r)&&($L.isArrayOrTypedArray(r.size)||wce(r.size))}}});var eC=N((sRe,QL)=>{"use strict";var Tce=Rr();QL.exports=function(r,t){t||(t=2);var a=r.marker,n=a.sizeref||1,i=a.sizemin||0,o=a.sizemode==="area"?function(l){return Math.sqrt(l/n)}:function(l){return l/n};return function(l){var s=o(l/t);return Tce(s)&&s>0?Math.max(s,i):0}}});var Eo=N($a=>{"use strict";var _1=Ee();$a.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo};$a.isTraceInSubplots=function(e,r){if(e.type==="splom"){for(var t=e.xaxes||[],a=e.yaxes||[],n=0;n=0&&t.index{aC.exports=qce;var wx={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Sce=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function qce(e){var r=[];return e.replace(Sce,function(t,a,n){var i=a.toLowerCase();for(n=Cce(n),i=="m"&&n.length>2&&(r.push([a].concat(n.splice(0,2))),i="l",a=a=="m"?"l":"L");;){if(n.length==wx[i])return n.unshift(a),r.push(n);if(n.length{"use strict";var Ece=Tx(),$e=function(e,r){return r?Math.round(e*(r=Math.pow(10,r)))/r:Math.round(e)},qr="M0,0Z",nC=Math.sqrt(2),as=Math.sqrt(3),Ax=Math.PI,Mx=Math.cos,kx=Math.sin;uC.exports={circle:{n:0,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n="M"+a+",0A"+a+","+a+" 0 1,1 0,-"+a+"A"+a+","+a+" 0 0,1 "+a+",0Z";return t?Cr(r,t,n):n}},square:{n:1,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M"+a+","+a+"H-"+a+"V-"+a+"H"+a+"Z")}},diamond:{n:2,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.3,2);return Cr(r,t,"M"+a+",0L0,"+a+"L-"+a+",0L0,-"+a+"Z")}},cross:{n:3,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.4,2),n=$e(e*1.2,2);return Cr(r,t,"M"+n+","+a+"H"+a+"V"+n+"H-"+a+"V"+a+"H-"+n+"V-"+a+"H-"+a+"V-"+n+"H"+a+"V-"+a+"H"+n+"Z")}},x:{n:4,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.8/nC,2),n="l"+a+","+a,i="l"+a+",-"+a,o="l-"+a+",-"+a,l="l-"+a+","+a;return Cr(r,t,"M0,"+a+n+i+o+i+o+l+o+l+n+l+n+"Z")}},"triangle-up":{n:5,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2/as,2),n=$e(e/2,2),i=$e(e,2);return Cr(r,t,"M-"+a+","+n+"H"+a+"L0,-"+i+"Z")}},"triangle-down":{n:6,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2/as,2),n=$e(e/2,2),i=$e(e,2);return Cr(r,t,"M-"+a+",-"+n+"H"+a+"L0,"+i+"Z")}},"triangle-left":{n:7,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2/as,2),n=$e(e/2,2),i=$e(e,2);return Cr(r,t,"M"+n+",-"+a+"V"+a+"L-"+i+",0Z")}},"triangle-right":{n:8,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2/as,2),n=$e(e/2,2),i=$e(e,2);return Cr(r,t,"M-"+n+",-"+a+"V"+a+"L"+i+",0Z")}},"triangle-ne":{n:9,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.6,2),n=$e(e*1.2,2);return Cr(r,t,"M-"+n+",-"+a+"H"+a+"V"+n+"Z")}},"triangle-se":{n:10,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.6,2),n=$e(e*1.2,2);return Cr(r,t,"M"+a+",-"+n+"V"+a+"H-"+n+"Z")}},"triangle-sw":{n:11,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.6,2),n=$e(e*1.2,2);return Cr(r,t,"M"+n+","+a+"H-"+a+"V-"+n+"Z")}},"triangle-nw":{n:12,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.6,2),n=$e(e*1.2,2);return Cr(r,t,"M-"+a+","+n+"V-"+a+"H"+n+"Z")}},pentagon:{n:13,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.951,2),n=$e(e*.588,2),i=$e(-e,2),o=$e(e*-.309,2),l=$e(e*.809,2);return Cr(r,t,"M"+a+","+o+"L"+n+","+l+"H-"+n+"L-"+a+","+o+"L0,"+i+"Z")}},hexagon:{n:14,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n=$e(e/2,2),i=$e(e*as/2,2);return Cr(r,t,"M"+i+",-"+n+"V"+n+"L0,"+a+"L-"+i+","+n+"V-"+n+"L0,-"+a+"Z")}},hexagon2:{n:15,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n=$e(e/2,2),i=$e(e*as/2,2);return Cr(r,t,"M-"+n+","+i+"H"+n+"L"+a+",0L"+n+",-"+i+"H-"+n+"L-"+a+",0Z")}},octagon:{n:16,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.924,2),n=$e(e*.383,2);return Cr(r,t,"M-"+n+",-"+a+"H"+n+"L"+a+",-"+n+"V"+n+"L"+n+","+a+"H-"+n+"L-"+a+","+n+"V-"+n+"Z")}},star:{n:17,f:function(e,r,t){if(Lr(r))return qr;var a=e*1.4,n=$e(a*.225,2),i=$e(a*.951,2),o=$e(a*.363,2),l=$e(a*.588,2),s=$e(-a,2),u=$e(a*-.309,2),f=$e(a*.118,2),c=$e(a*.809,2),v=$e(a*.382,2);return Cr(r,t,"M"+n+","+u+"H"+i+"L"+o+","+f+"L"+l+","+c+"L0,"+v+"L-"+l+","+c+"L-"+o+","+f+"L-"+i+","+u+"H-"+n+"L0,"+s+"Z")}},hexagram:{n:18,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.66,2),n=$e(e*.38,2),i=$e(e*.76,2);return Cr(r,t,"M-"+i+",0l-"+n+",-"+a+"h"+i+"l"+n+",-"+a+"l"+n+","+a+"h"+i+"l-"+n+","+a+"l"+n+","+a+"h-"+i+"l-"+n+","+a+"l-"+n+",-"+a+"h-"+i+"Z")}},"star-triangle-up":{n:19,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*as*.8,2),n=$e(e*.8,2),i=$e(e*1.6,2),o=$e(e*4,2),l="A "+o+","+o+" 0 0 1 ";return Cr(r,t,"M-"+a+","+n+l+a+","+n+l+"0,-"+i+l+"-"+a+","+n+"Z")}},"star-triangle-down":{n:20,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*as*.8,2),n=$e(e*.8,2),i=$e(e*1.6,2),o=$e(e*4,2),l="A "+o+","+o+" 0 0 1 ";return Cr(r,t,"M"+a+",-"+n+l+"-"+a+",-"+n+l+"0,"+i+l+a+",-"+n+"Z")}},"star-square":{n:21,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.1,2),n=$e(e*2,2),i="A "+n+","+n+" 0 0 1 ";return Cr(r,t,"M-"+a+",-"+a+i+"-"+a+","+a+i+a+","+a+i+a+",-"+a+i+"-"+a+",-"+a+"Z")}},"star-diamond":{n:22,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.4,2),n=$e(e*1.9,2),i="A "+n+","+n+" 0 0 1 ";return Cr(r,t,"M-"+a+",0"+i+"0,"+a+i+a+",0"+i+"0,-"+a+i+"-"+a+",0Z")}},"diamond-tall":{n:23,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*.7,2),n=$e(e*1.4,2);return Cr(r,t,"M0,"+n+"L"+a+",0L0,-"+n+"L-"+a+",0Z")}},"diamond-wide":{n:24,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.4,2),n=$e(e*.7,2);return Cr(r,t,"M0,"+n+"L"+a+",0L0,-"+n+"L-"+a+",0Z")}},hourglass:{n:25,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M"+a+","+a+"H-"+a+"L"+a+",-"+a+"H-"+a+"Z")},noDot:!0},bowtie:{n:26,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M"+a+","+a+"V-"+a+"L-"+a+","+a+"V-"+a+"Z")},noDot:!0},"circle-cross":{n:27,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M0,"+a+"V-"+a+"M"+a+",0H-"+a+"M"+a+",0A"+a+","+a+" 0 1,1 0,-"+a+"A"+a+","+a+" 0 0,1 "+a+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n=$e(e/nC,2);return Cr(r,t,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+a+",0A"+a+","+a+" 0 1,1 0,-"+a+"A"+a+","+a+" 0 0,1 "+a+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M0,"+a+"V-"+a+"M"+a+",0H-"+a+"M"+a+","+a+"H-"+a+"V-"+a+"H"+a+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M"+a+","+a+"L-"+a+",-"+a+"M"+a+",-"+a+"L-"+a+","+a+"M"+a+","+a+"H-"+a+"V-"+a+"H"+a+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.3,2);return Cr(r,t,"M"+a+",0L0,"+a+"L-"+a+",0L0,-"+a+"ZM0,-"+a+"V"+a+"M-"+a+",0H"+a)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.3,2),n=$e(e*.65,2);return Cr(r,t,"M"+a+",0L0,"+a+"L-"+a+",0L0,-"+a+"ZM-"+n+",-"+n+"L"+n+","+n+"M-"+n+","+n+"L"+n+",-"+n)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.4,2);return Cr(r,t,"M0,"+a+"V-"+a+"M"+a+",0H-"+a)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M"+a+","+a+"L-"+a+",-"+a+"M"+a+",-"+a+"L-"+a+","+a)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.2,2),n=$e(e*.85,2);return Cr(r,t,"M0,"+a+"V-"+a+"M"+a+",0H-"+a+"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e/2,2),n=$e(e,2);return Cr(r,t,"M"+a+","+n+"V-"+n+"M"+(a-n)+",-"+n+"V"+n+"M"+n+","+a+"H-"+n+"M-"+n+","+(a-n)+"H"+n)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.2,2),n=$e(e*1.6,2),i=$e(e*.8,2);return Cr(r,t,"M-"+a+","+i+"L0,0M"+a+","+i+"L0,0M0,-"+n+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.2,2),n=$e(e*1.6,2),i=$e(e*.8,2);return Cr(r,t,"M-"+a+",-"+i+"L0,0M"+a+",-"+i+"L0,0M0,"+n+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.2,2),n=$e(e*1.6,2),i=$e(e*.8,2);return Cr(r,t,"M"+i+","+a+"L0,0M"+i+",-"+a+"L0,0M-"+n+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.2,2),n=$e(e*1.6,2),i=$e(e*.8,2);return Cr(r,t,"M-"+i+","+a+"L0,0M-"+i+",-"+a+"L0,0M"+n+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.4,2);return Cr(r,t,"M"+a+",0H-"+a)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*1.4,2);return Cr(r,t,"M0,"+a+"V-"+a)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M"+a+",-"+a+"L-"+a+","+a)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2);return Cr(r,t,"M"+a+","+a+"L-"+a+",-"+a)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n=$e(e*2,2);return Cr(r,t,"M0,0L-"+a+","+n+"H"+a+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n=$e(e*2,2);return Cr(r,t,"M0,0L-"+a+",-"+n+"H"+a+"Z")},noDot:!0},"arrow-left":{n:47,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2,2),n=$e(e,2);return Cr(r,t,"M0,0L"+a+",-"+n+"V"+n+"Z")},noDot:!0},"arrow-right":{n:48,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2,2),n=$e(e,2);return Cr(r,t,"M0,0L-"+a+",-"+n+"V"+n+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n=$e(e*2,2);return Cr(r,t,"M-"+a+",0H"+a+"M0,0L-"+a+","+n+"H"+a+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e,2),n=$e(e*2,2);return Cr(r,t,"M-"+a+",0H"+a+"M0,0L-"+a+",-"+n+"H"+a+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2,2),n=$e(e,2);return Cr(r,t,"M0,-"+n+"V"+n+"M0,0L"+a+",-"+n+"V"+n+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e,r,t){if(Lr(r))return qr;var a=$e(e*2,2),n=$e(e,2);return Cr(r,t,"M0,-"+n+"V"+n+"M0,0L-"+a+",-"+n+"V"+n+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(e,r,t){if(Lr(r))return qr;var a=Ax/2.5,n=2*e*Mx(a),i=2*e*kx(a);return Cr(r,t,"M0,0L"+-n+","+i+"L"+n+","+i+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(e,r,t){if(Lr(r))return qr;var a=Ax/4,n=2*e*Mx(a),i=2*e*kx(a);return Cr(r,t,"M0,0L"+-n+","+i+"A "+2*e+","+2*e+" 0 0 1 "+n+","+i+"Z")},backoff:.4,noDot:!0}};function Lr(e){return e===null}var iC,oC,lC,sC;function Cr(e,r,t){if((!e||e%360===0)&&!r)return t;if(lC===e&&sC===r&&iC===t)return oC;lC=e,sC=r,iC=t;function a(m,x){var T=Mx(m),_=kx(m),b=x[0],w=x[1]+(r||0);return[b*T-w*_,b*_+w*T]}for(var n=e/180*Ax,i=0,o=0,l=Ece(t),s="",u=0;u{"use strict";var Ma=Sr(),yt=Ee(),Dce=yt.numberFormat,mu=Rr(),Dx=qn(),T1=br(),Ua=Tr(),Rce=Co(),bh=yt.strTranslate,A1=Aa(),Pce=dl(),Fce=Ha(),Nce=Fce.LINE_SPACING,xC=Dp().DESELECTDIM,Ice=Pn(),zce=eC(),Oce=Eo().appendArrayPointValue,tr=CC.exports={};tr.font=function(e,r){var t=r.variant,a=r.style,n=r.weight,i=r.color,o=r.size,l=r.family,s=r.shadow,u=r.lineposition,f=r.textcase;l&&e.style("font-family",l),o+1&&e.style("font-size",o+"px"),i&&e.call(Ua.fill,i),n&&e.style("font-weight",n),a&&e.style("font-style",a),t&&e.style("font-variant",t),f&&e.style("text-transform",Sx(Hce(f))),s&&e.style("text-shadow",s==="auto"?A1.makeTextShadow(Ua.contrast(i)):Sx(s)),u&&e.style("text-decoration-line",Sx(Uce(u)))};function Sx(e){return e==="none"?void 0:e}var Bce={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function Hce(e){return Bce[e]}function Uce(e){return e.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}tr.setPosition=function(e,r,t){e.attr("x",r).attr("y",t)};tr.setSize=function(e,r,t){e.attr("width",r).attr("height",t)};tr.setRect=function(e,r,t,a,n){e.call(tr.setPosition,r,t).call(tr.setSize,a,n)};tr.translatePoint=function(e,r,t,a){var n=t.c2p(e.x),i=a.c2p(e.y);if(mu(n)&&mu(i)&&r.node())r.node().nodeName==="text"?r.attr("x",n).attr("y",i):r.attr("transform",bh(n,i));else return!1;return!0};tr.translatePoints=function(e,r,t){e.each(function(a){var n=Ma.select(this);tr.translatePoint(a,n,r,t)})};tr.hideOutsideRangePoint=function(e,r,t,a,n,i){r.attr("display",t.isPtWithinRange(e,n)&&a.isPtWithinRange(e,i)?null:"none")};tr.hideOutsideRangePoints=function(e,r){if(r._hasClipOnAxisFalse){var t=r.xaxis,a=r.yaxis;e.each(function(n){var i=n[0].trace,o=i.xcalendar,l=i.ycalendar,s=T1.traceIs(i,"bar-like")?".bartext":".point,.textpoint";e.selectAll(s).each(function(u){tr.hideOutsideRangePoint(u,Ma.select(this),t,a,o,l)})})}};tr.crispRound=function(e,r,t){return!r||!mu(r)?t||0:e._context.staticPlot?r:r<1?1:Math.round(r)};tr.singleLineStyle=function(e,r,t,a,n){r.style("fill","none");var i=(((e||[])[0]||{}).trace||{}).line||{},o=t||i.width||0,l=n||i.dash||"";Ua.stroke(r,a||i.color),tr.dashLine(r,l,o)};tr.lineGroupStyle=function(e,r,t,a){e.style("fill","none").each(function(n){var i=(((n||[])[0]||{}).trace||{}).line||{},o=r||i.width||0,l=a||i.dash||"";Ma.select(this).call(Ua.stroke,t||i.color).call(tr.dashLine,l,o)})};tr.dashLine=function(e,r,t){t=+t||0,r=tr.dashStyle(r,t),e.style({"stroke-dasharray":r,"stroke-width":t+"px"})};tr.dashStyle=function(e,r){r=+r||1;var t=Math.max(r,3);return e==="solid"?e="":e==="dot"?e=t+"px,"+t+"px":e==="dash"?e=3*t+"px,"+3*t+"px":e==="longdash"?e=5*t+"px,"+5*t+"px":e==="dashdot"?e=3*t+"px,"+t+"px,"+t+"px,"+t+"px":e==="longdashdot"&&(e=5*t+"px,"+2*t+"px,"+t+"px,"+2*t+"px"),e};function _C(e,r,t,a){var n=r.fillpattern,i=r.fillgradient,o=tr.getPatternAttr,l=n&&(o(n.shape,0,"")||o(n.path,0,""));if(l){var s=o(n.bgcolor,0,null),u=o(n.fgcolor,0,null),f=n.fgopacity,c=o(n.size,0,8),v=o(n.solidity,0,.3),d=r.uid;tr.pattern(e,"point",t,d,l,c,v,void 0,n.fillmode,s,u,f)}else if(i&&i.type!=="none"){var p=i.type,y="scatterfill-"+r.uid;if(a&&(y="legendfill-"+r.uid),!a&&(i.start!==void 0||i.stop!==void 0)){var m,x;p==="horizontal"?(m={x:i.start,y:0},x={x:i.stop,y:0}):p==="vertical"&&(m={x:0,y:i.start},x={x:0,y:i.stop}),m.x=r._xA.c2p(m.x===void 0?r._extremes.x.min[0].val:m.x,!0),m.y=r._yA.c2p(m.y===void 0?r._extremes.y.min[0].val:m.y,!0),x.x=r._xA.c2p(x.x===void 0?r._extremes.x.max[0].val:x.x,!0),x.y=r._yA.c2p(x.y===void 0?r._extremes.y.max[0].val:x.y,!0),e.call(AC,t,y,"linear",i.colorscale,"fill",m,x,!0,!1)}else p==="horizontal"&&(p=p+"reversed"),e.call(tr.gradient,t,y,p,i.colorscale,"fill")}else r.fillcolor&&e.call(Ua.fill,r.fillcolor)}tr.singleFillStyle=function(e,r){var t=Ma.select(e.node()),a=t.data(),n=((a[0]||[])[0]||{}).trace||{};_C(e,n,r,!1)};tr.fillGroupStyle=function(e,r,t){e.style("stroke-width",0).each(function(a){var n=Ma.select(this);a[0].trace&&_C(n,a[0].trace,r,t)})};var cC=fC();tr.symbolNames=[];tr.symbolFuncs=[];tr.symbolBackOffs=[];tr.symbolNeedLines={};tr.symbolNoDot={};tr.symbolNoFill={};tr.symbolList=[];Object.keys(cC).forEach(function(e){var r=cC[e],t=r.n;tr.symbolList.push(t,String(t),e,t+100,String(t+100),e+"-open"),tr.symbolNames[t]=e,tr.symbolFuncs[t]=r.f,tr.symbolBackOffs[t]=r.backoff||0,r.needLine&&(tr.symbolNeedLines[t]=!0),r.noDot?tr.symbolNoDot[t]=!0:tr.symbolList.push(t+200,String(t+200),e+"-dot",t+300,String(t+300),e+"-open-dot"),r.noFill&&(tr.symbolNoFill[t]=!0)});var Gce=tr.symbolNames.length,Vce="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";tr.symbolNumber=function(e){if(mu(e))e=+e;else if(typeof e=="string"){var r=0;e.indexOf("-open")>0&&(r=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(r+=200,e=e.replace("-dot","")),e=tr.symbolNames.indexOf(e),e>=0&&(e+=r)}return e%100>=Gce||e>=400?0:Math.floor(Math.max(e,0))};function wC(e,r,t,a){var n=e%100;return tr.symbolFuncs[n](r,t,a)+(e>=200?Vce:"")}var vC=Dce("~f"),TC={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};tr.gradient=function(e,r,t,a,n,i){var o=TC[a];return AC(e,r,t,o.type,n,i,o.start,o.stop,!1,o.reversed)};function AC(e,r,t,a,n,i,o,l,s,u){var f=n.length,c;a==="linear"?c={node:"linearGradient",attrs:{x1:o.x,y1:o.y,x2:l.x,y2:l.y,gradientUnits:s?"userSpaceOnUse":"objectBoundingBox"},reversed:u}:a==="radial"&&(c={node:"radialGradient",reversed:u});for(var v=new Array(f),d=0;d=0&&e.i===void 0&&(e.i=i.i),r.style("opacity",a.selectedOpacityFn?a.selectedOpacityFn(e):e.mo===void 0?o.opacity:e.mo),a.ms2mrc){var s;e.ms==="various"||o.size==="various"?s=3:s=a.ms2mrc(e.ms),e.mrc=s,a.selectedSizeFn&&(s=e.mrc=a.selectedSizeFn(e));var u=tr.symbolNumber(e.mx||o.symbol)||0;e.om=u%200>=100;var f=Fx(e,t),c=Px(e,t);r.attr("d",wC(u,s,f,c))}var v=!1,d,p,y;if(e.so)y=l.outlierwidth,p=l.outliercolor,d=o.outliercolor;else{var m=(l||{}).width;y=(e.mlw+1||m+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in e?p=e.mlcc=a.lineScale(e.mlc):yt.isArrayOrTypedArray(l.color)?p=Ua.defaultLine:p=l.color,yt.isArrayOrTypedArray(o.color)&&(d=Ua.defaultLine,v=!0),"mc"in e?d=e.mcc=a.markerScale(e.mc):d=o.color||o.colors||"rgba(0,0,0,0)",a.selectedColorFn&&(d=a.selectedColorFn(e))}let x=e.mld||(l||{}).dash;if(x&&tr.dashLine(r,x,y),e.om)r.call(Ua.stroke,d).style({"stroke-width":(y||1)+"px",fill:"none"});else{r.style("stroke-width",(e.isBlank?0:y)+"px");var T=o.gradient,_=e.mgt;_?v=!0:_=T&&T.type,yt.isArrayOrTypedArray(_)&&(_=_[0],TC[_]||(_=0));var b=o.pattern,w=tr.getPatternAttr,k=b&&(w(b.shape,e.i,"")||w(b.path,e.i,""));if(_&&_!=="none"){var M=e.mgc;M?v=!0:M=T.color;var q=t.uid;v&&(q+="-"+e.i),tr.gradient(r,n,q,_,[[0,M],[1,d]],"fill")}else if(k){var E=!1,D=b.fgcolor;!D&&i&&i.color&&(D=i.color,E=!0);var P=w(D,e.i,i&&i.color||null),R=w(b.bgcolor,e.i,null),z=b.fgopacity,I=w(b.size,e.i,8),B=w(b.solidity,e.i,.3);E=E||e.mcc||yt.isArrayOrTypedArray(b.shape)||yt.isArrayOrTypedArray(b.path)||yt.isArrayOrTypedArray(b.bgcolor)||yt.isArrayOrTypedArray(b.fgcolor)||yt.isArrayOrTypedArray(b.size)||yt.isArrayOrTypedArray(b.solidity);var G=t.uid;E&&(G+="-"+e.i),tr.pattern(r,"point",n,G,k,I,B,e.mcc,b.fillmode,R,P,z)}else yt.isArrayOrTypedArray(d)?Ua.fill(r,d[e.i]):Ua.fill(r,d);y&&Ua.stroke(r,p)}};tr.makePointStyleFns=function(e){var r={},t=e.marker;return r.markerScale=tr.tryColorscale(t,""),r.lineScale=tr.tryColorscale(t,"line"),T1.traceIs(e,"symbols")&&(r.ms2mrc=Ice.isBubble(e)?zce(e):function(){return(t.size||6)/2}),e.selectedpoints&&yt.extendFlat(r,tr.makeSelectedPointStyleFns(e)),r};tr.makeSelectedPointStyleFns=function(e){var r={},t=e.selected||{},a=e.unselected||{},n=e.marker||{},i=t.marker||{},o=a.marker||{},l=n.opacity,s=i.opacity,u=o.opacity,f=s!==void 0,c=u!==void 0;(yt.isArrayOrTypedArray(l)||f||c)&&(r.selectedOpacityFn=function(b){var w=b.mo===void 0?n.opacity:b.mo;return b.selected?f?s:w:c?u:xC*w});var v=n.color,d=i.color,p=o.color;(d||p)&&(r.selectedColorFn=function(b){var w=b.mcc||v;return b.selected?d||w:p||w});var y=n.size,m=i.size,x=o.size,T=m!==void 0,_=x!==void 0;return T1.traceIs(e,"symbols")&&(T||_)&&(r.selectedSizeFn=function(b){var w=b.mrc||y/2;return b.selected?T?m/2:w:_?x/2:w}),r};tr.makeSelectedTextStyleFns=function(e){var r={},t=e.selected||{},a=e.unselected||{},n=e.textfont||{},i=t.textfont||{},o=a.textfont||{},l=n.color,s=i.color,u=o.color;return r.selectedTextColorFn=function(f){var c=f.tc||l;return f.selected?s||c:u||(s?c:Ua.addOpacity(c,xC))},r};tr.selectedPointStyle=function(e,r){if(!(!e.size()||!r.selectedpoints)){var t=tr.makeSelectedPointStyleFns(r),a=r.marker||{},n=[];t.selectedOpacityFn&&n.push(function(i,o){i.style("opacity",t.selectedOpacityFn(o))}),t.selectedColorFn&&n.push(function(i,o){Ua.fill(i,t.selectedColorFn(o))}),t.selectedSizeFn&&n.push(function(i,o){var l=o.mx||a.symbol||0,s=t.selectedSizeFn(o);i.attr("d",wC(tr.symbolNumber(l),s,Fx(o,r),Px(o,r))),o.mrc2=s}),n.length&&e.each(function(i){for(var o=Ma.select(this),l=0;l0?t:0}tr.textPointStyle=function(e,r,t){if(e.size()){var a;if(r.selectedpoints){var n=tr.makeSelectedTextStyleFns(r);a=n.selectedTextColorFn}var i=r.texttemplate,o=t._fullLayout;e.each(function(l){var s=Ma.select(this),u=i?yt.extractOption(l,r,"txt","texttemplate"):yt.extractOption(l,r,"tx","text");if(!u&&u!==0){s.remove();return}if(i){var f=r._module.formatLabels,c=f?f(l,r,o):{},v={};Oce(v,r,l.i),u=yt.texttemplateString({data:[v,l,r._meta],fallback:r.texttemplatefallback,labels:c,locale:o._d3locale,template:u})}var d=l.tp||r.textposition,p=kC(l,r),y=a?a(l):l.tc||r.textfont.color;s.call(tr.font,{family:l.tf||r.textfont.family,weight:l.tw||r.textfont.weight,style:l.ty||r.textfont.style,variant:l.tv||r.textfont.variant,textcase:l.tC||r.textfont.textcase,lineposition:l.tE||r.textfont.lineposition,shadow:l.tS||r.textfont.shadow,size:p,color:y}).text(u).call(A1.convertToTspans,t).call(MC,d,p,l.mrc)})}};tr.selectedTextStyle=function(e,r){if(!(!e.size()||!r.selectedpoints)){var t=tr.makeSelectedTextStyleFns(r);e.each(function(a){var n=Ma.select(this),i=t.selectedTextColorFn(a),o=a.tp||r.textposition,l=kC(a,r);Ua.fill(n,i);var s=T1.traceIs(r,"bar-like");MC(n,o,l,a.mrc2||a.mrc,s)})}};var hC=.5;tr.smoothopen=function(e,r){if(e.length<3)return"M"+e.join("L");var t="M"+e[0],a=[],n;for(n=1;n=s||b>=f&&b<=s)&&(w<=c&&w>=u||w>=c&&w<=u)&&(e=[b,w])}return e}tr.applyBackoff=LC;tr.makeTester=function(){var e=yt.ensureSingleById(Ma.select("body"),"svg","js-plotly-tester",function(t){t.attr(Pce.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),r=yt.ensureSingle(e,"path","js-reference-point",function(t){t.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});tr.tester=e,tr.testref=r};tr.savedBBoxes={};var Lx=0,jce=1e4;tr.bBox=function(e,r,t){t||(t=dC(e));var a;if(t){if(a=tr.savedBBoxes[t],a)return yt.extendFlat({},a)}else if(e.childNodes.length===1){var n=e.childNodes[0];if(t=dC(n),t){var i=+n.getAttribute("x")||0,o=+n.getAttribute("y")||0,l=n.getAttribute("transform");if(!l){var s=tr.bBox(n,!1,t);return i&&(s.left+=i,s.right+=i),o&&(s.top+=o,s.bottom+=o),s}if(t+="~"+i+"~"+o+"~"+l,a=tr.savedBBoxes[t],a)return yt.extendFlat({},a)}}var u,f;r?u=e:(f=tr.tester.node(),u=e.cloneNode(!0),f.appendChild(u)),Ma.select(u).attr("transform",null).call(A1.positionText,0,0);var c=u.getBoundingClientRect(),v=tr.testref.node().getBoundingClientRect();r||f.removeChild(u);var d={height:c.height,width:c.width,left:c.left-v.left,top:c.top-v.top,right:c.right-v.left,bottom:c.bottom-v.top};return Lx>=jce&&(tr.savedBBoxes={},Lx=0),t&&(tr.savedBBoxes[t]=d),Lx++,yt.extendFlat({},d)};function dC(e){var r=e.getAttribute("data-unformatted");if(r!==null)return r+e.getAttribute("data-math")+e.getAttribute("text-anchor")+e.getAttribute("style")}tr.setClipUrl=function(e,r,t){e.attr("clip-path",Rx(r,t))};function Rx(e,r){if(!e)return null;var t=r._context,a=t._exportedPlot?"":t._baseUrl||"";return a?"url('"+a+"#"+e+"')":"url(#"+e+")"}tr.getTranslate=function(e){var r=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,t=e.attr?"attr":"getAttribute",a=e[t]("transform")||"",n=a.replace(r,function(i,o,l){return[o,l].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}};tr.setTranslate=function(e,r,t){var a=/(\btranslate\(.*?\);?)/,n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",o=e[n]("transform")||"";return r=r||0,t=t||0,o=o.replace(a,"").trim(),o+=bh(r,t),o=o.trim(),e[i]("transform",o),o};tr.getScale=function(e){var r=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,t=e.attr?"attr":"getAttribute",a=e[t]("transform")||"",n=a.replace(r,function(i,o,l){return[o,l].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}};tr.setScale=function(e,r,t){var a=/(\bscale\(.*?\);?)/,n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",o=e[n]("transform")||"";return r=r||1,t=t||1,o=o.replace(a,"").trim(),o+="scale("+r+","+t+")",o=o.trim(),e[i]("transform",o),o};var Zce=/\s*sc.*/;tr.setPointGroupScale=function(e,r,t){if(r=r||1,t=t||1,!!e){var a=r===1&&t===1?"":"scale("+r+","+t+")";e.each(function(){var n=(this.getAttribute("transform")||"").replace(Zce,"");n+=a,n=n.trim(),this.setAttribute("transform",n)})}};var Xce=/translate\([^)]*\)\s*$/;tr.setTextPointsScale=function(e,r,t){e&&e.each(function(){var a,n=Ma.select(this),i=n.select("text");if(i.node()){var o=parseFloat(i.attr("x")||0),l=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(Xce);r===1&&t===1?a=[]:a=[bh(o,l),"scale("+r+","+t+")",bh(-o,-l)],s&&a.push(s),n.attr("transform",a.join(""))}})};function Px(e,r){var t;return e&&(t=e.mf),t===void 0&&(t=r.marker&&r.marker.standoff||0),!r._geo&&!r._xA?-t:t}tr.getMarkerStandoff=Px;var gh=Math.atan2,du=Math.cos,ac=Math.sin;function pC(e,r){var t=r[0],a=r[1];return[t*du(e)-a*ac(e),t*ac(e)+a*du(e)]}var yC,mC,gC,bC,Cx,Ex;function Fx(e,r){var t=e.ma;t===void 0&&(t=r.marker.angle,(!t||yt.isArrayOrTypedArray(t))&&(t=0));var a,n,i=r.marker.angleref;if(i==="previous"||i==="north"){if(r._geo){var o=r._geo.project(e.lonlat);a=o[0],n=o[1]}else{var l=r._xA,s=r._yA;if(l&&s)a=l.c2p(e.x),n=s.c2p(e.y);else return 90}if(r._geo){var u=e.lonlat[0],f=e.lonlat[1],c=r._geo.project([u,f+1e-5]),v=r._geo.project([u+1e-5,f]),d=gh(v[1]-n,v[0]-a),p=gh(c[1]-n,c[0]-a),y;if(i==="north")y=t/180*Math.PI;else if(i==="previous"){var m=u/180*Math.PI,x=f/180*Math.PI,T=yC/180*Math.PI,_=mC/180*Math.PI,b=T-m,w=du(_)*ac(b),k=ac(_)*du(x)-du(_)*ac(x)*du(b);y=-gh(w,k)-Math.PI,yC=u,mC=f}var M=pC(d,[du(y),0]),q=pC(p,[ac(y),0]);t=gh(M[1]+q[1],M[0]+q[0])/Math.PI*180,i==="previous"&&!(Ex===r.uid&&e.i===Cx+1)&&(t=null)}if(i==="previous"&&!r._geo)if(Ex===r.uid&&e.i===Cx+1&&mu(a)&&mu(n)){var E=a-gC,D=n-bC,P=r.line&&r.line.shape||"",R=P.slice(P.length-1);R==="h"&&(D=0),R==="v"&&(E=0),t+=gh(D,E)/Math.PI*180+90}else t=null}return gC=a,bC=n,Cx=e.i,Ex=r.uid,t}tr.getMarkerAngle=Fx});var oc=N((hRe,PC)=>{"use strict";var nc=Sr(),Jce=Rr(),$ce=aa(),Nx=br(),gu=Ee(),EC=gu.strTranslate,M1=Yr(),k1=Tr(),ic=Aa(),DC=Dp(),Kce=Ha().OPPOSITE_SIDE,RC=/ [XY][0-9]* /,Ix=1.6,zx=1.6;function Qce(e,r,t){var a=e._fullLayout,n=t.propContainer,i=t.propName,o=t.placeholder,l=t.traceIndex,s=t.avoid||{},u=t.attributes,f=t.transform,c=t.containerGroup,v=1,d=n.title,p=(d&&d.text?d.text:"").trim(),y=!1,m=d&&d.font?d.font:{},x=m.family,T=m.size,_=m.color,b=m.weight,w=m.style,k=m.variant,M=m.textcase,q=m.lineposition,E=m.shadow,D=t.subtitlePropName,P=!!D,R=t.subtitlePlaceholder,z=(n.title||{}).subtitle||{text:"",font:{}},I=(z.text||"").trim(),B=!1,G=1,Y=z.font,V=Y.family,H=Y.size,X=Y.color,j=Y.weight,ee=Y.style,fe=Y.variant,ie=Y.textcase,ue=Y.lineposition,K=Y.shadow,we;i==="title.text"?we="titleText":i.indexOf("axis")!==-1?we="axisTitleText":i.indexOf("colorbar")!==-1&&(we="colorbarTitleText");var se=e._context.edits[we];function ce(Be,Ge){return Be===void 0||Ge===void 0?!1:Be.replace(RC," % ")===Ge.replace(RC," % ")}p===""?v=0:ce(p,o)&&(se||(p=""),v=.2,y=!0),P&&(I===""?G=0:ce(I,R)&&(se||(I=""),G=.2,B=!0)),t._meta?p=gu.templateString(p,t._meta):a._meta&&(p=gu.templateString(p,a._meta));var he=p||I||se,ye;c||(c=gu.ensureSingle(a._infolayer,"g","g-"+r),ye=a._hColorbarMoveTitle);var W=c.selectAll("text."+r).data(he?[0]:[]);W.enter().append("text"),W.text(p).attr("class",r),W.exit().remove();var Q=null,Z=r+"-subtitle",le=I||se;if(P&&(Q=c.selectAll("text."+Z).data(le?[0]:[]),Q.enter().append("text"),Q.text(I).attr("class",Z),Q.exit().remove()),!he)return c;function ve(Be,Ge){gu.syncOrAsync([me,Ce],{title:Be,subtitle:Ge})}function me(Be){var Ge=Be.title,De=Be.subtitle,Oe;!f&&ye&&(f={}),f?(Oe="",f.rotate&&(Oe+="rotate("+[f.rotate,u.x,u.y]+")"),(f.offset||ye)&&(Oe+=EC(0,(f.offset||0)-(ye||0)))):Oe=null,Ge.attr("transform",Oe);function Ue(Te){if(Te){var qe=nc.select(Te.node().parentNode).select("."+Z);if(!qe.empty()){var He=Te.node().getBBox();if(He.height){var Je=He.y+He.height+Ix*H;qe.attr("y",Je)}}}}if(Ge.style("opacity",v*k1.opacity(_)).call(M1.font,{color:k1.rgb(_),size:nc.round(T,2),family:x,weight:b,style:w,variant:k,textcase:M,shadow:E,lineposition:q}).attr(u).call(ic.convertToTspans,e,Ue),De&&!De.empty()){var oe=c.select("."+r+"-math-group"),Ae=Ge.node().getBBox(),Xe=oe.node()?oe.node().getBBox():void 0,dr=Xe?Xe.y+Xe.height+Ix*H:Ae.y+Ae.height+zx*H,Ne=gu.extendFlat({},u,{y:dr});De.attr("transform",Oe),De.style("opacity",G*k1.opacity(X)).call(M1.font,{color:k1.rgb(X),size:nc.round(H,2),family:V,weight:j,style:ee,variant:fe,textcase:ie,shadow:K,lineposition:ue}).attr(Ne).call(ic.convertToTspans,e)}return $ce.previousPromises(e)}function Ce(Be){var Ge=Be.title,De=nc.select(Ge.node().parentNode);if(s&&s.selection&&s.side&&p){De.attr("transform",null);var Oe=Kce[s.side],Ue=s.side==="left"||s.side==="top"?-1:1,oe=Jce(s.pad)?s.pad:2,Ae=M1.bBox(De.node()),Xe={t:0,b:0,l:0,r:0},dr=e._fullLayout._reservedMargin;for(var Ne in dr)for(var Te in dr[Ne]){var qe=dr[Ne][Te];Xe[Te]=Math.max(Xe[Te],qe)}var He={left:Xe.l,top:Xe.t,right:a.width-Xe.r,bottom:a.height-Xe.b},Je=s.maxShift||Ue*(He[s.side]-Ae[s.side]),We=0;if(Je<0)We=Je;else{var Ze=s.offsetLeft||0,lr=s.offsetTop||0;Ae.left-=Ze,Ae.right-=Ze,Ae.top-=lr,Ae.bottom-=lr,s.selection.each(function(){var er=M1.bBox(this);gu.bBoxIntersect(Ae,er,oe)&&(We=Math.max(We,Ue*(er[s.side]-Ae[Oe])+oe))}),We=Math.min(Je,We),n._titleScoot=Math.abs(We)}if(We>0||Je<0){var rr={left:[-We,0],right:[We,0],top:[0,-We],bottom:[0,We]}[s.side];De.attr("transform",EC(rr[0],rr[1]))}}}W.call(ve,Q);function Pe(Be,Ge){Be.text(Ge).on("mouseover.opacity",function(){nc.select(this).transition().duration(DC.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){nc.select(this).transition().duration(DC.HIDE_PLACEHOLDER).style("opacity",0)})}if(se&&(p?W.on(".opacity",null):(Pe(W,o),y=!0),W.call(ic.makeEditable,{gd:e}).on("edit",function(Be){l!==void 0?Nx.call("_guiRestyle",e,i,Be,l):Nx.call("_guiRelayout",e,i,Be)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ve)}).on("input",function(Be){this.text(Be||" ").call(ic.positionText,u.x,u.y)}),P)){if(P&&!p){var Le=W.node().getBBox(),ze=Le.y+Le.height+zx*H;Q.attr("y",ze)}I?Q.on(".opacity",null):(Pe(Q,R),B=!0),Q.call(ic.makeEditable,{gd:e}).on("edit",function(Be){Nx.call("_guiRelayout",e,"title.subtitle.text",Be)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(ve)}).on("input",function(Be){this.text(Be||" ").call(ic.positionText,Q.attr("x"),Q.attr("y"))})}return W.classed("js-placeholder",y),Q&&!Q.empty()&&Q.classed("js-placeholder",B),c}PC.exports={draw:Qce,SUBTITLE_PADDING_EM:zx,SUBTITLE_PADDING_MATHJAX_EM:Ix}});var lc=N((dRe,OC)=>{"use strict";var eve=Sr(),rve=Ef().utcFormat,Tt=Ee(),tve=Tt.numberFormat,Do=Rr(),ns=Tt.cleanNumber,ave=Tt.ms2DateTime,FC=Tt.dateTime2ms,Ro=Tt.ensureNumber,NC=Tt.isArrayOrTypedArray,is=Ft(),S1=is.FP_SAFE,oo=is.BADNUM,nve=is.LOG_CLIP,ive=is.ONEWEEK,q1=is.ONEDAY,L1=is.ONEHOUR,IC=is.ONEMIN,zC=is.ONESEC,C1=fa(),R1=xa(),E1=R1.HOUR_PATTERN,D1=R1.WEEKDAY_PATTERN;function xh(e){return Math.pow(10,e)}function Ox(e){return e!=null}OC.exports=function(r,t){t=t||{};var a=r._id||"x",n=a.charAt(0);function i(b,w){if(b>0)return Math.log(b)/Math.LN10;if(b<=0&&w&&r.range&&r.range.length===2){var k=r.range[0],M=r.range[1];return .5*(k+M-2*nve*Math.abs(k-M))}else return oo}function o(b,w,k,M){if((M||{}).msUTC&&Do(b))return+b;var q=FC(b,k||r.calendar);if(q===oo)if(Do(b)){b=+b;var E=Math.floor(Tt.mod(b+.05,1)*10),D=Math.round(b-E/10);q=FC(new Date(D))+E/10}else return oo;return q}function l(b,w,k){return ave(b,w,k||r.calendar)}function s(b){return r._categories[Math.round(b)]}function u(b){if(Ox(b)){if(r._categoriesMap===void 0&&(r._categoriesMap={}),r._categoriesMap[b]!==void 0)return r._categoriesMap[b];r._categories.push(typeof b=="number"?String(b):b);var w=r._categories.length-1;return r._categoriesMap[b]=w,w}return oo}function f(b,w){for(var k=new Array(w),M=0;Mr.range[1]&&(k=!k);for(var M=k?-1:1,q=M*b,E=0,D=0;DR)E=D+1;else{E=q<(P+R)/2?D:D+1;break}}var z=r._B[E]||0;return isFinite(z)?p(b,r._m2,z):0},x=function(b){var w=r._rangebreaks.length;if(!w)return y(b,r._m,r._b);for(var k=0,M=0;Mr._rangebreaks[M].pmax&&(k=M+1);return y(b,r._m2,r._B[k])}}r.c2l=r.type==="log"?i:Ro,r.l2c=r.type==="log"?xh:Ro,r.l2p=m,r.p2l=x,r.c2p=r.type==="log"?function(b,w){return m(i(b,w))}:m,r.p2c=r.type==="log"?function(b){return xh(x(b))}:x,["linear","-"].indexOf(r.type)!==-1?(r.d2r=r.r2d=r.d2c=r.r2c=r.d2l=r.r2l=ns,r.c2d=r.c2r=r.l2d=r.l2r=Ro,r.d2p=r.r2p=function(b){return r.l2p(ns(b))},r.p2d=r.p2r=x,r.cleanPos=Ro):r.type==="log"?(r.d2r=r.d2l=function(b,w){return i(ns(b),w)},r.r2d=r.r2c=function(b){return xh(ns(b))},r.d2c=r.r2l=ns,r.c2d=r.l2r=Ro,r.c2r=i,r.l2d=xh,r.d2p=function(b,w){return r.l2p(r.d2r(b,w))},r.p2d=function(b){return xh(x(b))},r.r2p=function(b){return r.l2p(ns(b))},r.p2r=x,r.cleanPos=Ro):r.type==="date"?(r.d2r=r.r2d=Tt.identity,r.d2c=r.r2c=r.d2l=r.r2l=o,r.c2d=r.c2r=r.l2d=r.l2r=l,r.d2p=r.r2p=function(b,w,k){return r.l2p(o(b,0,k))},r.p2d=r.p2r=function(b,w,k){return l(x(b),w,k)},r.cleanPos=function(b){return Tt.cleanDate(b,oo,r.calendar)}):r.type==="category"?(r.d2c=r.d2l=u,r.r2d=r.c2d=r.l2d=s,r.d2r=r.d2l_noadd=v,r.r2c=function(b){var w=d(b);return w!==void 0?w:r.fraction2r(.5)},r.l2r=r.c2r=Ro,r.r2l=d,r.d2p=function(b){return r.l2p(r.r2c(b))},r.p2d=function(b){return s(x(b))},r.r2p=r.d2p,r.p2r=x,r.cleanPos=function(b){return typeof b=="string"&&b!==""?b:Ro(b)}):r.type==="multicategory"&&(r.r2d=r.c2d=r.l2d=s,r.d2r=r.d2l_noadd=v,r.r2c=function(b){var w=v(b);return w!==void 0?w:r.fraction2r(.5)},r.r2c_just_indices=c,r.l2r=r.c2r=Ro,r.r2l=v,r.d2p=function(b){return r.l2p(r.r2c(b))},r.p2d=function(b){return s(x(b))},r.r2p=r.d2p,r.p2r=x,r.cleanPos=function(b){return Array.isArray(b)||typeof b=="string"&&b!==""?b:Ro(b)},r.setupMultiCategory=function(b){var w=r._traceIndices,k,M,q=r._matchGroup;if(q&&r._categories.length===0){for(var E in q)if(E!==a){var D=t[C1.id2name(E)];w=w.concat(D._traceIndices)}}var P=[[0,{}],[0,{}]],R=[];for(k=0;kD[1]&&(M[E?0:1]=k),M[0]===M[1]){var P=r.l2r(w),R=r.l2r(k);if(w!==void 0){var z=P+1;k!==void 0&&(z=Math.min(z,R)),M[E?1:0]=z}if(k!==void 0){var I=R+1;w!==void 0&&(I=Math.max(I,P)),M[E?0:1]=I}}}},r.cleanRange=function(b,w){r._cleanRange(b,w),r.limitRange(b)},r._cleanRange=function(b,w){w||(w={}),b||(b="range");var k=Tt.nestedProperty(r,b).get(),M,q;if(r.type==="date"?q=Tt.dfltRange(r.calendar):n==="y"?q=R1.DFLTRANGEY:r._name==="realaxis"?q=[0,1]:q=w.dfltRange||R1.DFLTRANGEX,q=q.slice(),(r.rangemode==="tozero"||r.rangemode==="nonnegative")&&(q[0]=0),!k||k.length!==2){Tt.nestedProperty(r,b).set(q);return}var E=k[0]===null,D=k[1]===null;for(r.type==="date"&&!r.autorange&&(k[0]=Tt.cleanDate(k[0],oo,r.calendar),k[1]=Tt.cleanDate(k[1],oo,r.calendar)),M=0;M<2;M++)if(r.type==="date"){if(!Tt.isDateTime(k[M],r.calendar)){r[b]=q;break}if(r.r2l(k[0])===r.r2l(k[1])){var P=Tt.constrain(r.r2l(k[0]),Tt.MIN_MS+1e3,Tt.MAX_MS-1e3);k[0]=r.l2r(P-1e3),k[1]=r.l2r(P+1e3);break}}else{if(!Do(k[M]))if(!(E||D)&&Do(k[1-M]))k[M]=k[1-M]*(M?10:.1);else{r[b]=q;break}if(k[M]<-S1?k[M]=-S1:k[M]>S1&&(k[M]=S1),k[0]===k[1]){var R=Math.max(1,Math.abs(k[0]*1e-6));k[0]-=R,k[1]+=R}}},r.setScale=function(b){var w=t._size;if(r.overlaying){var k=C1.getFromId({_fullLayout:t},r.overlaying);r.domain=k.domain}var M=b&&r._r?"_r":"range",q=r.calendar;r.cleanRange(M);var E=r.r2l(r[M][0],q),D=r.r2l(r[M][1],q),P=n==="y";if(P?(r._offset=w.t+(1-r.domain[1])*w.h,r._length=w.h*(r.domain[1]-r.domain[0]),r._m=r._length/(E-D),r._b=-r._m*D):(r._offset=w.l+r.domain[0]*w.w,r._length=w.w*(r.domain[1]-r.domain[0]),r._m=r._length/(D-E),r._b=-r._m*E),r._rangebreaks=[],r._lBreaks=0,r._m2=0,r._B=[],r.rangebreaks){var R,z;if(r._rangebreaks=r.locateBreaks(Math.min(E,D),Math.max(E,D)),r._rangebreaks.length){for(R=0;RD&&(I=!I),I&&r._rangebreaks.reverse();var B=I?-1:1;for(r._m2=B*r._length/(Math.abs(D-E)-r._lBreaks),r._B.push(-r._m2*(P?D:E)),R=0;Rq&&(q+=7,Eq&&(q+=24,E=M&&E=M&&b=K.min&&(eeK.max&&(K.max=fe),ie=!1)}ie&&D.push({min:ee,max:fe})}};for(k=0;k{"use strict";var BC=Rr(),Bx=Ee(),ove=Ft().BADNUM,P1=Bx.isArrayOrTypedArray,lve=Bx.isDateTime,sve=Bx.cleanNumber,HC=Math.round;GC.exports=function(r,t,a){var n=r,i=a.noMultiCategory;if(P1(n)&&!n.length)return"-";if(!i&&hve(n))return"multicategory";if(i&&Array.isArray(n[0])){for(var o=[],l=0;li*2}function UC(e){return Math.max(1,(e-1)/1e3)}function vve(e,r){for(var t=e.length,a=UC(t),n=0,i=0,o={},l=0;ln*2}function hve(e){return P1(e[0])&&P1(e[1])}});var _h=N((yRe,$C)=>{"use strict";var dve=Sr(),jC=Rr(),os=Ee(),N1=Ft().FP_SAFE,pve=br(),yve=Yr(),ZC=fa(),mve=ZC.getFromId,gve=ZC.isLinked;$C.exports={applyAutorangeOptions:JC,getAutoRange:Hx,makePadFn:Ux,doAutoRange:xve,findExtremes:_ve,concatExtremes:Yx};function Hx(e,r){var t,a,n=[],i=e._fullLayout,o=Ux(i,r,0),l=Ux(i,r,1),s=Yx(e,r),u=s.min,f=s.max;if(u.length===0||f.length===0)return os.simpleMap(r.range,r.r2l);var c=u[0].val,v=f[0].val;for(t=1;t0&&(D=_-o(k)-l(M),D>b?P/D>w&&(q=k,E=M,w=P/D):P/_>w&&(q={val:k.val,nopad:1},E={val:M.val,nopad:1},w=P/_));function R(Y,V){return Math.max(Y,l(V))}if(c===v){var z=c-1,I=c+1;if(x)if(c===0)n=[0,1];else{var B=(c>0?f:u).reduce(R,0),G=c/(1-Math.min(.5,B/_));n=c>0?[0,G]:[G,0]}else T?n=[Math.max(0,z),Math.max(1,I)]:n=[z,I]}else x?(q.val>=0&&(q={val:0,nopad:1}),E.val<=0&&(E={val:0,nopad:1})):T&&(q.val-w*o(q)<0&&(q={val:0,nopad:1}),E.val<=0&&(E={val:1,nopad:1})),w=(E.val-q.val-VC(r,k.val,M.val))/(_-o(q)-l(E)),n=[q.val-w*o(q),E.val+w*l(E)];return n=JC(n,r),r.limitRange&&r.limitRange(),p&&n.reverse(),os.simpleMap(n,r.l2r||Number)}function VC(e,r,t){var a=0;if(e.rangebreaks)for(var n=e.locateBreaks(r,t),i=0;i0?t.ppadplus:t.ppadminus)||t.ppad||0),k=b((e._m>0?t.ppadminus:t.ppadplus)||t.ppad||0),M=b(t.vpadplus||t.vpad),q=b(t.vpadminus||t.vpad);if(!u){if(T=1/0,_=-1/0,s)for(c=0;c0&&(T=v),v>_&&v-N1&&(T=v),v>_&&v=P;c--)D(c);return{min:a,max:n,opts:t}}function Gx(e,r,t,a){XC(e,r,t,a,wve)}function Vx(e,r,t,a){XC(e,r,t,a,Tve)}function XC(e,r,t,a,n){for(var i=a.tozero,o=a.extrapad,l=!0,s=0;s=t&&(u.extrapad||!o)){l=!1;break}else n(r,u.val)&&u.pad<=t&&(o||!u.extrapad)&&(e.splice(s,1),s--)}if(l){var f=i&&r===0;e.push({val:r,pad:f?0:t,extrapad:f?!1:o})}}function WC(e){return jC(e)&&Math.abs(e)=r}function Ave(e,r){var t=r.autorangeoptions;return t&&t.minallowed!==void 0&&I1(r,t.minallowed,t.maxallowed)?t.minallowed:t&&t.clipmin!==void 0&&I1(r,t.clipmin,t.clipmax)?Math.max(e,r.d2l(t.clipmin)):e}function Mve(e,r){var t=r.autorangeoptions;return t&&t.maxallowed!==void 0&&I1(r,t.minallowed,t.maxallowed)?t.maxallowed:t&&t.clipmax!==void 0&&I1(r,t.clipmin,t.clipmax)?Math.min(e,r.d2l(t.clipmax)):e}function I1(e,r,t){return r!==void 0&&t!==void 0?(r=e.d2l(r),t=e.d2l(t),r=s&&(i=s,t=s),o<=s&&(o=s,a=s)}}return t=Ave(t,r),a=Mve(a,r),[t,a]}});var zr=N((gRe,xE)=>{"use strict";var yi=Sr(),va=Rr(),sc=aa(),Th=br(),xr=Ee(),uc=xr.strTranslate,bu=Aa(),kve=oc(),Ah=Tr(),Xn=Yr(),Sve=pi(),KC=dx(),mRe=xa(),Ga=Ft(),qve=Ga.ONEMAXYEAR,B1=Ga.ONEAVGYEAR,H1=Ga.ONEMINYEAR,Lve=Ga.ONEMAXQUARTER,Xx=Ga.ONEAVGQUARTER,U1=Ga.ONEMINQUARTER,Cve=Ga.ONEMAXMONTH,fc=Ga.ONEAVGMONTH,G1=Ga.ONEMINMONTH,Jn=Ga.ONEWEEK,ln=Ga.ONEDAY,ls=ln/2,Fo=Ga.ONEHOUR,Mh=Ga.ONEMIN,V1=Ga.ONESEC,Eve=Ga.ONEMILLI,Dve=Ga.ONEMICROSEC,xu=Ga.MINUS_SIGN,W1=Ga.BADNUM,Jx={K:"zeroline"},$x={K:"gridline",L:"path"},Kx={K:"minor-gridline",L:"path"},uE={K:"tick",L:"path"},QC={K:"tick",L:"text"},eE={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},j1=Ha(),wh=j1.MID_SHIFT,_u=j1.CAP_SHIFT,kh=j1.LINE_SPACING,Rve=j1.OPPOSITE_SIDE,Y1=3,Ve=xE.exports={};Ve.setConvert=lc();var Pve=F1(),No=fa(),Fve=No.idSort,Nve=No.isLinked;Ve.id2name=No.id2name;Ve.name2id=No.name2id;Ve.cleanId=No.cleanId;Ve.list=No.list;Ve.listIds=No.listIds;Ve.getFromId=No.getFromId;Ve.getFromTrace=No.getFromTrace;var fE=_h();Ve.getAutoRange=fE.getAutoRange;Ve.findExtremes=fE.findExtremes;var Ive=1e-4;function t5(e){var r=(e[1]-e[0])*Ive;return[e[0]-r,e[1]+r]}Ve.coerceRef=function(e,r,t,a,n,i){var o=a.charAt(a.length-1),l=t._fullLayout._subplots[o+"axis"],s=a+"ref",u={};return n||(n=l[0]||(typeof i=="string"?i:i[0])),i||(i=n),l=l.concat(l.map(function(f){return f+" domain"})),u[s]={valType:"enumerated",values:l.concat(i?typeof i=="string"?[i]:i:[]),dflt:n},xr.coerce(e,r,u,s)};Ve.coerceRefArray=function(e,r,t,a,n,i,o){let l=a.charAt(a.length-1);var s=t._fullLayout._subplots[l+"axis"];let u=a+"ref";var f=e[u];n||(n=s[0]||(typeof i=="string"?i:i[0])),s=s.concat(s.map(v=>v+" domain")),s=s.concat(i||[]),f.length>o?(xr.warn("Array attribute "+u+" has more entries than expected, truncating to "+o),f=f.slice(0,o)):f.length2e-6||((t-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0))};Ve.saveRangeInitial=function(e,r){for(var t=Ve.list(e,"",!0),a=!1,n=0;nc*.3||u(a)||u(n))){var v=t.dtick/2;e+=e+vo){var l=Number(t.slice(1));i.exactYears>o&&l%12===0?e=Ve.tickIncrement(e,"M6","reverse")+ln*1.5:i.exactMonths>o?e=Ve.tickIncrement(e,"M1","reverse")+ln*15.5:e-=ls;var s=Ve.tickIncrement(e,t);if(s<=a)return s}return e}Ve.prepMinorTicks=function(e,r,t){if(!r.minor.dtick){delete e.dtick;var a=r.dtick&&va(r._tmin),n;if(a){var i=Ve.tickIncrement(r._tmin,r.dtick,!0);n=[r._tmin,i*.99+r._tmin*.01]}else{var o=xr.simpleMap(r.range,r.r2l);n=[o[0],.8*o[0]+.2*o[1]]}if(e.range=xr.simpleMap(n,r.l2r),e._isMinor=!0,Ve.prepTicks(e,t),a){var l=va(r.dtick),s=va(e.dtick),u=l?r.dtick:+r.dtick.substring(1),f=s?e.dtick:+e.dtick.substring(1);l&&s?Wx(u,f)?u===2*Jn&&f===2*ln&&(e.dtick=Jn):u===2*Jn&&f===3*ln?e.dtick=Jn:u===Jn&&!(r._input.minor||{}).nticks?e.dtick=ln:aE(u/f,2.5)?e.dtick=u/2:e.dtick=u:String(r.dtick).charAt(0)==="M"?s?e.dtick="M1":Wx(u,f)?u>=12&&f===2&&(e.dtick="M3"):e.dtick=r.dtick:String(e.dtick).charAt(0)==="L"?String(r.dtick).charAt(0)==="L"?Wx(u,f)||(e.dtick=aE(u/f,2.5)?r.dtick/2:r.dtick):e.dtick="D1":e.dtick==="D2"&&+r.dtick>1&&(e.dtick=1)}e.range=r.range}r.minor._tick0Init===void 0&&(e.tick0=r.tick0)};function Wx(e,r){return Math.abs((e/r+.5)%1-.5)<.001}function aE(e,r){return Math.abs(e/r-1)<.001}Ve.prepTicks=function(e,r){var t=xr.simpleMap(e.range,e.r2l,void 0,void 0,r);if(e.tickmode==="auto"||!e.dtick){var a=e.nticks,n;a||(e.type==="category"||e.type==="multicategory"?(n=e.tickfont?xr.bigFont(e.tickfont.size||12):15,a=e._length/n):(n=e._id.charAt(0)==="y"?40:80,a=xr.constrain(e._length/n,4,9)+1),e._name==="radialaxis"&&(a*=2)),e.minor&&e.minor.tickmode!=="array"||e.tickmode==="array"&&(a*=100),e._roughDTick=Math.abs(t[1]-t[0])/a,Ve.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick0?(i=a-1,o=a):(i=a,o=a);var l=e[i].value,s=e[o].value,u=Math.abs(s-l),f=t||u,c=0;f>=H1?u>=H1&&u<=qve?c=u:c=B1:t===Xx&&f>=U1?u>=U1&&u<=Lve?c=u:c=Xx:f>=G1?u>=G1&&u<=Cve?c=u:c=fc:t===Jn&&f>=Jn?c=Jn:f>=ln?c=ln:t===ls&&f>=ls?c=ls:t===Fo&&f>=Fo&&(c=Fo);var v;c>=u&&(c=u,v=!0);var d=n+c;if(r.rangebreaks&&c>0){for(var p=84,y=0,m=0;mJn&&(c=u)}(c>0||a===0)&&(e[a].periodX=n+c/2)}}Ve.calcTicks=function(r,t){for(var a=r.type,n=r.calendar,i=r.ticklabelstep,o=r.ticklabelmode==="period",l=r.range[0]>r.range[1],s=!r.ticklabelindex||xr.isArrayOrTypedArray(r.ticklabelindex)?r.ticklabelindex:[r.ticklabelindex],u=xr.simpleMap(r.range,r.r2l,void 0,void 0,t),f=u[1]=(_?0:1);b--){var w=!b;b?(r._dtickInit=r.dtick,r._tick0Init=r.tick0):(r.minor._dtickInit=r.minor.dtick,r.minor._tick0Init=r.minor.tick0);var k=b?r:xr.extendFlat({},r,r.minor);if(w?Ve.prepMinorTicks(k,r,t):Ve.prepTicks(k,t),k.tickmode==="array"){b?(m=[],p=nE(r,!w)):(x=[],y=nE(r,!w));continue}if(k.tickmode==="sync"){m=[],p=Gve(r);continue}var M=t5(u),q=M[0],E=M[1],D=va(k.dtick),P=a==="log"&&!(D||k.dtick.charAt(0)==="L"),R=Ve.tickFirst(k,t);if(b){if(r._tmin=R,R=E:I<=E;I=Ve.tickIncrement(I,Y,f,n)){if(b&&B++,k.rangebreaks&&!f){if(I=v)break}if(m.length>d||I===z)break;z=I;var V={value:I};b?(P&&I!==(I|0)&&(V.simpleLabel=!0),i>1&&B%i&&(V.skipLabel=!0),m.push(V)):(V.minor=!0,x.push(V))}}if(!x||x.length<2)s=!1;else{var H=(x[1].value-x[0].value)*(l?-1:1);dhe(H,r.tickformat)||(s=!1)}if(!s)T=m;else{var X=m.concat(x);o&&m.length&&(X=X.slice(1)),X=X.sort(function(ze,Be){return ze.value-Be.value}).filter(function(ze,Be,Ge){return Be===0||ze.value!==Ge[Be-1].value});var j=X.map(function(ze,Be){return ze.minor===void 0&&!ze.skipLabel?Be:null}).filter(function(ze){return ze!==null});j.forEach(function(ze){s.map(function(Be){var Ge=ze+Be;Ge>=0&&Ge-1;he--){if(m[he].drop){m.splice(he,1);continue}m[he].value=Zx(m[he].value,r);var Z=r.c2p(m[he].value);(ye?Q>Z-W:Qv||Dev&&(Ge.periodX=v),Den&&vB1)r/=B1,a=n(10),e.dtick="M"+12*Po(r,a,z1);else if(i>fc)r/=fc,e.dtick="M"+Po(r,1,iE);else if(i>ln){if(e.dtick=Po(r,ln,e._hasDayOfWeekBreaks?[1,2,7,14]:Vve),!t){var o=Ve.getTickFormat(e),l=e.ticklabelmode==="period";l&&(e._rawTick0=e.tick0),/%[uVW]/.test(o)?e.tick0=xr.dateTick0(e.calendar,2):e.tick0=xr.dateTick0(e.calendar,1),l&&(e._dowTick0=e.tick0)}}else i>Fo?e.dtick=Po(r,Fo,iE):i>Mh?e.dtick=Po(r,Mh,oE):i>V1?e.dtick=Po(r,V1,oE):(a=n(10),e.dtick=Po(r,a,z1))}else if(e.type==="log"){e.tick0=0;var s=xr.simpleMap(e.range,e.r2l);if(e._isMinor&&(r*=1.5),r>.7)e.dtick=Math.ceil(r);else if(Math.abs(s[1]-s[0])<1){var u=1.5*Math.abs((s[1]-s[0])/r);r=Math.abs(Math.pow(10,s[1])-Math.pow(10,s[0]))/u,a=n(10),e.dtick="L"+Po(r,a,z1)}else e.dtick=r>.3?"D2":"D1"}else e.type==="category"||e.type==="multicategory"?(e.tick0=0,e.dtick=Math.ceil(Math.max(r,1))):o5(e)?(e.tick0=0,a=1,e.dtick=Po(r,a,Yve)):(e.tick0=0,a=n(10),e.dtick=Po(r,a,z1));if(e.dtick===0&&(e.dtick=1),!va(e.dtick)&&typeof e.dtick!="string"){var f=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(f)}};function dE(e){var r=e.dtick;if(e._tickexponent=0,!va(r)&&typeof r!="string"&&(r=1),(e.type==="category"||e.type==="multicategory")&&(e._tickround=null),e.type==="date"){var t=e.r2l(e.tick0),a=e.l2r(t).replace(/(^-|i)/g,""),n=a.length;if(String(r).charAt(0)==="M")n>10||a.slice(5)!=="01-01"?e._tickround="d":e._tickround=+r.slice(1)%12===0?"y":"m";else if(r>=ln&&n<=10||r>=ln*15)e._tickround="d";else if(r>=Mh&&n<=16||r>=Fo)e._tickround="M";else if(r>=V1&&n<=19||r>=Mh)e._tickround="S";else{var i=e.l2r(t+r).replace(/^-/,"").length;e._tickround=Math.max(n,i)-20,e._tickround<0&&(e._tickround=4)}}else if(va(r)||r.charAt(0)==="L"){var o=e.range.map(e.r2d||Number);va(r)||(r=Number(r.slice(1))),e._tickround=2-Math.floor(Math.log(r)/Math.LN10+.01);var l=Math.max(Math.abs(o[0]),Math.abs(o[1])),s=Math.floor(Math.log(l)/Math.LN10+.01),u=e.minexponent===void 0?3:e.minexponent;Math.abs(s)>u&&(cc(e.exponentformat)&&e.exponentformat!=="SI extended"&&!a5(s)||cc(e.exponentformat)&&e.exponentformat==="SI extended"&&!n5(s)?e._tickexponent=3*Math.round((s-1)/3):e._tickexponent=s)}else e._tickround=null}Ve.tickIncrement=function(e,r,t,a){var n=t?-1:1;if(va(r))return xr.increment(e,n*r);var i=r.charAt(0),o=n*Number(r.slice(1));if(i==="M")return xr.incrementMonth(e,o,a);if(i==="L")return Math.log(Math.pow(10,e)+o)/Math.LN10;if(i==="D"){var l=r==="D2"?hE:vE,s=e+n*.01,u=xr.roundUp(xr.mod(s,1),l,t);return Math.floor(s)+Math.log(yi.round(Math.pow(10,u),1))/Math.LN10}throw"unrecognized dtick "+String(r)};Ve.tickFirst=function(e,r){var t=e.r2l||Number,a=xr.simpleMap(e.range,t,void 0,void 0,r),n=a[1]=0&&x<=e._length?m:null};if(i&&xr.isArrayOrTypedArray(e.ticktext)){var c=xr.simpleMap(e.range,e.r2l),v=(Math.abs(c[1]-c[0])-(e._lBreaks||0))/1e4;for(u=0;u"+l;else{var u=qh(e),f=e._trueSide||e.side;(!u&&f==="top"||u&&f==="bottom")&&(o+="
")}r.text=o}function jve(e,r,t,a,n){var i=e.dtick,o=r.x,l=e.tickformat,s=typeof i=="string"&&i.charAt(0);if(n==="never"&&(n=""),a&&s!=="L"&&(i="L3",s="L"),l||s==="L")r.text=Sh(Math.pow(10,o),e,n,a);else if(va(i)||s==="D"&&(e.minorloglabels==="complete"||xr.mod(o+.01,1)<.1)){var u;e.minorloglabels==="complete"&&!(xr.mod(o+.01,1)<.1)&&(u=!0,r.fontSize*=.75);var f=Math.pow(10,o).toExponential(0),c=f.split("e"),v=+c[1],d=Math.abs(v),p=e.exponentformat;p==="power"||cc(p)&&p!=="SI extended"&&a5(v)||cc(p)&&p==="SI extended"&&n5(v)?(r.text=c[0],d>0&&(r.text+="x10"),r.text==="1x10"&&(r.text="10"),v!==0&&v!==1&&(r.text+=""+(v>0?"":xu)+d+""),r.fontSize*=1.25):(p==="e"||p==="E")&&d>2?r.text=c[0]+p+(v>0?"+":xu)+d:(r.text=Sh(Math.pow(10,o),e,"","fakehover"),i==="D1"&&e._id.charAt(0)==="y"&&(r.dy-=r.fontSize/6))}else if(s==="D")r.text=e.minorloglabels==="none"?"":String(Math.round(Math.pow(10,xr.mod(o,1)))),r.fontSize*=.75;else throw"unrecognized dtick "+String(i);if(e.dtick==="D1"){var y=String(r.text).charAt(0);(y==="0"||y==="1")&&(e._id.charAt(0)==="y"?r.dx-=r.fontSize/4:(r.dy+=r.fontSize/2,r.dx+=(e.range[1]>e.range[0]?1:-1)*r.fontSize*(o<0?.5:.25)))}}function Zve(e,r){var t=e._categories[Math.round(r.x)];t===void 0&&(t=""),r.text=String(t)}function Xve(e,r,t){var a=Math.round(r.x),n=e._categories[a]||[],i=n[1]===void 0?"":String(n[1]),o=n[0]===void 0?"":String(n[0]);t?r.text=o+" - "+i:(r.text=i,r.text2=o)}function Jve(e,r,t,a,n){n==="never"?n="":e.showexponent==="all"&&Math.abs(r.x/e.dtick)<1e-6&&(n="hide"),r.text=Sh(r.x,e,n,a)}function $ve(e,r,t,a,n){if(e.thetaunit==="radians"&&!t){var i=r.x/180;if(i===0)r.text="0";else{var o=Kve(i);if(o[1]>=100)r.text=Sh(xr.deg2rad(r.x),e,n,a);else{var l=r.x<0;o[1]===1?o[0]===1?r.text="\u03C0":r.text=o[0]+"\u03C0":r.text=["",o[0],"","\u2044","",o[1],"","\u03C0"].join(""),l&&(r.text=xu+r.text)}}}else r.text=Sh(r.x,e,n,a)}function Kve(e){function r(l,s){return Math.abs(l-s)<=1e-6}function t(l,s){return r(s,0)?l:t(s,l%s)}function a(l){for(var s=1;!r(Math.round(l*s)/s,l);)s*=10;return s}var n=a(e),i=e*n,o=Math.abs(t(i,n));return[Math.round(i/o),Math.round(n/o)]}var yE=["f","p","n","\u03BC","m","","k","M","G","T"],Qve=["q","r","y","z","a",...yE,"P","E","Z","Y","R","Q"],cc=e=>["SI","SI extended","B"].includes(e);function a5(e){return e>14||e<-15}function n5(e){return e>32||e<-30}function ehe(e,r){return cc(r)?!!(r==="SI extended"&&n5(e)||r!=="SI extended"&&a5(e)):!1}function Sh(e,r,t,a){var n=e<0,i=r._tickround,o=t||r.exponentformat||"B",l=r._tickexponent,s=Ve.getTickFormat(r),u=r.separatethousands;if(a){var f={exponentformat:o,minexponent:r.minexponent,dtick:r.showexponent==="none"?r.dtick:va(e)&&Math.abs(e)||1,range:r.showexponent==="none"?r.range.map(r.r2d):[0,e||1]};dE(f),i=(Number(f._tickround)||0)+4,l=f._tickexponent,r.hoverformat&&(s=r.hoverformat)}if(s)return r._numFormat(s)(e).replace(/-/g,xu);var c=Math.pow(10,-i)/2;if(o==="none"&&(l=0),e=Math.abs(e),e"+p+"":o==="B"&&l===9?e+="B":cc(o)&&(e+=o==="SI extended"?Qve[l/3+10]:yE[l/3+5])}return n?xu+e:e}Ve.getTickFormat=function(e){var r;function t(s){return typeof s!="string"?s:Number(s.replace("M",""))*fc}function a(s,u){var f=["L","D"];if(typeof s==typeof u){if(typeof s=="number")return s-u;var c=f.indexOf(s.charAt(0)),v=f.indexOf(u.charAt(0));return c===v?Number(s.replace(/(L|D)/g,""))-Number(u.replace(/(L|D)/g,"")):c-v}else return typeof s=="number"?1:-1}function n(s,u,f){var c=f||function(p){return p},v=u[0],d=u[1];return(!v&&typeof v!="number"||c(v)<=c(s))&&(!d&&typeof d!="number"||c(d)>=c(s))}function i(s,u){var f=u[0]===null,c=u[1]===null,v=a(s,u[0])>=0,d=a(s,u[1])<=0;return(f||v)&&(c||d)}var o,l;if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":{for(r=0;r=0&&n.unshift(n.splice(f,1).shift())}});var l={false:{left:0,right:0}};return xr.syncOrAsync(n.map(function(s){return function(){if(s){var u=Ve.getFromId(e,s);t||(t={}),t.axShifts=l,t.overlayingShiftedAx=o;var f=Ve.drawOne(e,u,t);return u._shiftPusher&&r5(u,u._fullDepth||0,l,!0),u._r=u.range.slice(),u._rl=xr.simpleMap(u._r,u.r2l),f}}}))};Ve.drawOne=function(e,r,t){t=t||{};var a=t.axShifts||{},n=t.overlayingShiftedAx||[],i,o,l;r.setScale();var s=e._fullLayout,u=r._id,f=u.charAt(0),c=Ve.counterLetter(u),v=s._plots[r._mainSubplot],d=r.zerolinelayer==="above traces";if(!v)return;if(r._shiftPusher=r.autoshift||n.indexOf(r._id)!==-1||n.indexOf(r.overlaying)!==-1,r._shiftPusher&r.anchor==="free"){var p=r.linewidth/2||0;r.ticks==="inside"&&(p+=r.ticklen),r5(r,p,a,!0),r5(r,r.shift||0,a,!1)}(t.skipTitle!==!0||r._shift===void 0)&&(r._shift=hhe(r,a));var y=v[f+"axislayer"],m=r._mainLinePosition,x=m+=r._shift,T=r._mainMirrorPosition,_=r._vals=Ve.calcTicks(r),b=[r.mirror,x,T].join("_");for(i=0;i<_.length;i++)_[i].axInfo=b;r._selections={},r._tickAngles&&(r._prevTickAngles=r._tickAngles),r._tickAngles={},r._depth=null;var w={};function k(Le){var ze=u+(Le||"tick");return w[ze]||(w[ze]=nhe(r,ze,x)),w[ze]}if(r.visible){var M=Ve.makeTransTickFn(r),q=Ve.makeTransTickLabelFn(r),E,D,P=r.ticks==="inside",R=r.ticks==="outside";if(r.tickson==="boundaries"){var z=rhe(r,_);D=Ve.clipEnds(r,z),E=P?D:z}else D=Ve.clipEnds(r,_),E=P&&r.ticklabelmode!=="period"?D:_;var I=r._gridVals=D,B=ahe(r,_);if(!s._hasOnlyLargeSploms){var G=r._subplotsWith,Y={};for(i=0;i0?De.bottom-Be:0,Ge))));var Ae=0,Xe=0;if(r._shiftPusher&&(Ae=Math.max(Ge,De.height>0?Le==="l"?Be-De.left:De.right-Be:0),r.title.text!==s._dfltTitle[f]&&(Xe=(r._titleStandoff||0)+(r._titleScoot||0),Le==="l"&&(Xe+=sE(r))),r._fullDepth=Math.max(Ae,Xe)),r.automargin){Oe={x:0,y:0,r:0,l:0,t:0,b:0};var dr=[0,1],Ne=typeof r._shift=="number"?r._shift:0;if(f==="x"){if(Le==="b"?Oe[Le]=r._depth:(Oe[Le]=r._depth=Math.max(De.width>0?Be-De.top:0,Ge),dr.reverse()),De.width>0){var Te=De.right-(r._offset+r._length);Te>0&&(Oe.xr=1,Oe.r=Te);var qe=r._offset-De.left;qe>0&&(Oe.xl=0,Oe.l=qe)}}else if(Le==="l"?(r._depth=Math.max(De.height>0?Be-De.left:0,Ge),Oe[Le]=r._depth-Ne):(r._depth=Math.max(De.height>0?De.right-Be:0,Ge),Oe[Le]=r._depth+Ne,dr.reverse()),De.height>0){var He=De.bottom-(r._offset+r._length);He>0&&(Oe.yb=0,Oe.b=He);var Je=r._offset-De.top;Je>0&&(Oe.yt=1,Oe.t=Je)}Oe[c]=r.anchor==="free"?r.position:r._anchorAxis.domain[dr[0]],r.title.text!==s._dfltTitle[f]&&(Oe[Le]+=sE(r)+(r.title.standoff||0)),r.mirror&&r.anchor!=="free"&&(Ue={x:0,y:0,r:0,l:0,t:0,b:0},Ue[ze]=r.linewidth,r.mirror&&r.mirror!==!0&&(Ue[ze]+=Ge),r.mirror===!0||r.mirror==="ticks"?Ue[c]=r._anchorAxis.domain[dr[1]]:(r.mirror==="all"||r.mirror==="allticks")&&(Ue[c]=[r._counterDomainMin,r._counterDomainMax][dr[1]]))}Pe&&(oe=Th.getComponentMethod("rangeslider","autoMarginOpts")(e,r)),typeof r.automargin=="string"&&(lE(Oe,r.automargin),lE(Ue,r.automargin)),sc.autoMargin(e,i5(r),Oe),sc.autoMargin(e,gE(r),Ue),sc.autoMargin(e,bE(r),oe)}),xr.syncOrAsync(me)}};function lE(e,r){if(e){var t=Object.keys(eE).reduce(function(a,n){return r.indexOf(n)!==-1&&eE[n].forEach(function(i){a[i]=1}),a},{});Object.keys(e).forEach(function(a){t[a]||(a.length===1?e[a]=0:delete e[a])})}}function rhe(e,r){var t=[],a,n=function(i,o){var l=i.xbnd[o];l!==null&&t.push(xr.extendFlat({},i,{x:l}))};if(r.length){for(a=0;ae.range[1],l=e.ticklabelposition&&e.ticklabelposition.indexOf("inside")!==-1,s=!l;if(t){var u=o?-1:1;t=t*u}if(a){var f=e.side,c=l&&(f==="top"||f==="left")||s&&(f==="bottom"||f==="right")?1:-1;a=a*c}return e._id.charAt(0)==="x"?function(v){return uc(n+e._offset+e.l2p(Qx(v))+t,i+a)}:function(v){return uc(i+a,n+e._offset+e.l2p(Qx(v))+t)}};function Qx(e){return e.periodX!==void 0?e.periodX:e.x}function ihe(e){var r=e.ticklabelposition||"",t=e.tickson||"",a=function(p){return r.indexOf(p)!==-1},n=a("top"),i=a("left"),o=a("right"),l=a("bottom"),s=a("inside"),u=t!=="boundaries"&&(l||i||n||o);if(!u&&!s)return[0,0];var f=e.side,c=u?(e.tickwidth||0)/2:0,v=Y1,d=e.tickfont?e.tickfont.size:12;return(l||n)&&(c+=d*_u,v+=(e.linewidth||0)/2),(i||o)&&(c+=(e.linewidth||0)/2,v+=Y1),s&&f==="top"&&(v-=d*(1-_u)),(i||n)&&(c=-c),(f==="bottom"||f==="right")&&(v=-v),[u?c:0,s?v:0]}Ve.makeTickPath=function(e,r,t,a){a||(a={});var n=a.minor;if(n&&!e.minor)return"";var i=a.len!==void 0?a.len:n?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),l=(e.linewidth||1)/2;return o==="x"?"M0,"+(r+l*t)+"v"+i*t:"M"+(r+l*t)+",0h"+i*t};Ve.makeLabelFns=function(e,r,t){var a=e.ticklabelposition||"",n=e.tickson||"",i=function(z){return a.indexOf(z)!==-1},o=i("top"),l=i("left"),s=i("right"),u=i("bottom"),f=n!=="boundaries"&&(u||l||o||s),c=i("inside"),v=a==="inside"&&e.ticks==="inside"||!c&&e.ticks==="outside"&&n!=="boundaries",d=0,p=0,y=v?e.ticklen:0;if(c?y*=-1:f&&(y=0),v&&(d+=y,t)){var m=xr.deg2rad(t);d=y*Math.cos(m)+1,p=y*Math.sin(m)}e.showticklabels&&(v||e.showline)&&(d+=.2*e.tickfont.size),d+=(e.linewidth||1)/2*(c?-1:1);var x={labelStandoff:d,labelShift:p},T,_,b,w,k=0,M=e.side,q=e._id.charAt(0),E=e.tickangle,D;if(q==="x")D=!c&&M==="bottom"||c&&M==="top",w=D?1:-1,c&&(w*=-1),T=p*w,_=r+d*w,b=D?1:-.2,Math.abs(E)===90&&(c?b+=wh:E===-90&&M==="bottom"?b=_u:E===90&&M==="top"?b=wh:b=.5,k=wh/2*(E/90)),x.xFn=function(z){return z.dx+T+k*z.fontSize},x.yFn=function(z){return z.dy+_+z.fontSize*b},x.anchorFn=function(z,I){if(f){if(l)return"end";if(s)return"start"}return!va(I)||I===0||I===180?"middle":I*w<0!==c?"end":"start"},x.heightFn=function(z,I,B){return I<-60||I>60?-.5*B:e.side==="top"!==c?-B:0};else if(q==="y"){if(D=!c&&M==="left"||c&&M==="right",w=D?1:-1,c&&(w*=-1),T=d,_=p*w,b=0,!c&&Math.abs(E)===90&&(E===-90&&M==="left"||E===90&&M==="right"?b=_u:b=.5),c){var P=va(E)?+E:0;if(P!==0){var R=xr.deg2rad(P);k=Math.abs(Math.sin(R))*_u*w,b=0}}x.xFn=function(z){return z.dx+r-(T+z.fontSize*b)*w+k*z.fontSize},x.yFn=function(z){return z.dy+_+z.fontSize*wh},x.anchorFn=function(z,I){return va(I)&&Math.abs(I)===90?"middle":D?"end":"start"},x.heightFn=function(z,I,B){return e.side==="right"&&(I*=-1),I<-30?-B:I<30?-.5*B:0}}return x};function Z1(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}Ve.drawTicks=function(e,r,t){t=t||{};var a=r._id+"tick",n=[].concat(r.minor&&r.minor.ticks?t.vals.filter(function(o){return o.minor&&!o.noTick}):[]).concat(r.ticks?t.vals.filter(function(o){return!o.minor&&!o.noTick}):[]),i=t.layer.selectAll("path."+a).data(n,Z1);i.exit().remove(),i.enter().append("path").classed(a,1).classed("ticks",1).classed("crisp",t.crisp!==!1).each(function(o){return Ah.stroke(yi.select(this),o.minor?r.minor.tickcolor:r.tickcolor)}).style("stroke-width",function(o){return Xn.crispRound(e,o.minor?r.minor.tickwidth:r.tickwidth,1)+"px"}).attr("d",t.path).style("display",null),X1(r,[uE]),i.attr("transform",t.transFn)};Ve.drawGrid=function(e,r,t){if(t=t||{},r.tickmode!=="sync"){var a=r._id+"grid",n=r.minor&&r.minor.showgrid,i=n?t.vals.filter(function(x){return x.minor}):[],o=r.showgrid?t.vals.filter(function(x){return!x.minor}):[],l=t.counterAxis;if(l&&Ve.shouldShowZeroLine(e,r,l))for(var s=r.tickmode==="array",u=0;u=0;p--){var y=p?v:d;if(y){var m=y.selectAll("path."+a).data(p?o:i,Z1);m.exit().remove(),m.enter().append("path").classed(a,1).classed("crisp",t.crisp!==!1),m.attr("transform",t.transFn).attr("d",t.path).each(function(x){return Ah.stroke(yi.select(this),x.minor?r.minor.gridcolor:r.gridcolor||"#ddd")}).style("stroke-dasharray",function(x){return Xn.dashStyle(x.minor?r.minor.griddash:r.griddash,x.minor?r.minor.gridwidth:r.gridwidth)}).style("stroke-width",function(x){return(x.minor?c:r._gw)+"px"}).style("display",null),typeof t.path=="function"&&m.attr("d",t.path)}}X1(r,[$x,Kx])}};Ve.drawZeroLine=function(e,r,t){t=t||t;var a=r._id+"zl",n=Ve.shouldShowZeroLine(e,r,t.counterAxis),i=t.layer.selectAll("path."+a).data(n?[{x:0,id:r._id}]:[]);i.exit().remove(),i.enter().append("path").classed(a,1).classed("zl",1).classed("crisp",t.crisp!==!1).each(function(){t.layer.selectAll("path").sort(function(o,l){return Fve(o.id,l.id)})}),i.attr("transform",t.transFn).attr("d",t.path).call(Ah.stroke,r.zerolinecolor||Ah.defaultLine).style("stroke-width",Xn.crispRound(e,r.zerolinewidth,r._gw||1)+"px").style("display",null),X1(r,[Jx])};Ve.drawLabels=function(e,r,t){t=t||{};var a=e._fullLayout,n=r._id,i=r.zerolinelayer==="above traces",o=t.cls||n+"tick",l=t.vals.filter(function(H){return H.text}),s=t.labelFns,u=t.secondary?0:r.tickangle,f=(r._prevTickAngles||{})[o],c=t.layer.selectAll("g."+o).data(r.showticklabels?l:[],Z1),v=[];c.enter().append("g").classed(o,1).append("text").attr("text-anchor","middle").each(function(H){var X=yi.select(this),j=e._promises.length;X.call(bu.positionText,s.xFn(H),s.yFn(H)).call(Xn.font,{family:H.font,size:H.fontSize,color:H.fontColor,weight:H.fontWeight,style:H.fontStyle,variant:H.fontVariant,textcase:H.fontTextcase,lineposition:H.fontLineposition,shadow:H.fontShadow}).text(H.text).call(bu.convertToTspans,e),e._promises[j]?v.push(e._promises.pop().then(function(){d(X,u)})):d(X,u)}),X1(r,[QC]),c.exit().remove(),t.repositionOnUpdate&&c.each(function(H){yi.select(this).select("text").call(bu.positionText,s.xFn(H),s.yFn(H))});function d(H,X){H.each(function(j){var ee=yi.select(this),fe=ee.select(".text-math-group"),ie=s.anchorFn(j,X),ue=t.transFn.call(ee.node(),j)+(va(X)&&+X!=0?" rotate("+X+","+s.xFn(j)+","+(s.yFn(j)-j.fontSize/2)+")":""),K=bu.lineCount(ee),we=kh*j.fontSize,se=s.heightFn(j,va(X)?+X:0,(K-1)*we);if(se&&(ue+=uc(0,se)),fe.empty()){var ce=ee.select("text");ce.attr({transform:ue,"text-anchor":ie}),ce.style("display",null),r._adjustTickLabelsOverflow&&r._adjustTickLabelsOverflow()}else{var he=Xn.bBox(fe.node()).width,ye=he*{end:-.5,start:.5}[ie];fe.attr("transform",ue+uc(ye,0))}})}r._adjustTickLabelsOverflow=function(){var H=r.ticklabeloverflow;if(!(!H||H==="allow")){var X=H.indexOf("hide")!==-1,j=r._id.charAt(0)==="x",ee=0,fe=j?e._fullLayout.width:e._fullLayout.height;if(H.indexOf("domain")!==-1){var ie=xr.simpleMap(r.range,r.r2l);ee=r.l2p(ie[0])+r._offset,fe=r.l2p(ie[1])+r._offset}var ue=Math.min(ee,fe),K=Math.max(ee,fe),we=r.side,se=1/0,ce=-1/0;c.each(function(Q){var Z=yi.select(this),le=Z.select(".text-math-group");if(le.empty()){var ve=Xn.bBox(Z.node()),me=0;j?(ve.right>K||ve.leftK||ve.top+(r.tickangle?0:Q.fontSize/4)r["_visibleLabelMin_"+ie._id]?Z.style("display","none"):K.K==="tick"&&!ue&&Z.node().style.display!=="none"&&Z.style("display",null)})})})})},d(c,f+1?f:u);function p(){return v.length&&Promise.all(v)}var y=null;function m(){if(d(c,u),l.length&&r.autotickangles&&(r.type!=="log"||String(r.dtick).charAt(0)!=="D")){y=r.autotickangles[0];var H=0,X=[],j,ee=1;c.each(function(Oe){H=Math.max(H,Oe.fontSize);var Ue=r.l2p(Oe.x),oe=e5(this),Ae=Xn.bBox(oe.node());ee=Math.max(ee,bu.lineCount(oe)),X.push({top:0,bottom:10,height:10,left:Ue-Ae.width/2,right:Ue+Ae.width/2+2,width:Ae.width+2})});var fe=(r.tickson==="boundaries"||r.showdividers)&&!t.secondary,ie=l.length,ue=Math.abs((l[ie-1].x-l[0].x)*r._m)/(ie-1),K=fe?ue/2:ue,we=fe?r.ticklen:H*1.25*ee,se=Math.sqrt(Math.pow(K,2)+Math.pow(we,2)),ce=K/se,he=r.autotickangles.map(function(Oe){return Oe*Math.PI/180}),ye=he.find(function(Oe){return Math.abs(Math.cos(Oe))<=ce});ye===void 0&&(ye=he.reduce(function(Oe,Ue){return Math.abs(Math.cos(Oe))G*B&&(R=B,E[q]=D[q]=z[q])}var Y=Math.abs(R-P);Y-w>0?(Y-=w,w*=1+w/Y):w=0,r._id.charAt(0)!=="y"&&(w=-w),E[M]=_.p2r(_.r2p(D[M])+k*w),_.autorange==="min"||_.autorange==="max reversed"?(E[0]=null,_._rangeInitial0=void 0,_._rangeInitial1=void 0):(_.autorange==="max"||_.autorange==="min reversed")&&(E[1]=null,_._rangeInitial0=void 0,_._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[_._name+".range"]=E}var V=xr.syncOrAsync(x);return V&&V.then&&e._promises.push(V),V};function ohe(e,r,t){var a=r._id+"divider",n=t.vals,i=t.layer.selectAll("path."+a).data(n,Z1);i.exit().remove(),i.enter().insert("path",":first-child").classed(a,1).classed("crisp",1).call(Ah.stroke,r.dividercolor).style("stroke-width",Xn.crispRound(e,r.dividerwidth,1)+"px"),i.attr("transform",t.transFn).attr("d",t.path)}Ve.getPxPosition=function(e,r){var t=e._fullLayout._size,a=r._id.charAt(0),n=r.side,i;if(r.anchor!=="free"?i=r._anchorAxis:a==="x"?i={_offset:t.t+(1-(r.position||0))*t.h,_length:0}:a==="y"&&(i={_offset:t.l+(r.position||0)*t.w+r._shift,_length:0}),n==="top"||n==="left")return i._offset;if(n==="bottom"||n==="right")return i._offset+i._length};function sE(e){var r=e.title.font.size,t=(e.title.text.match(bu.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?r*(_u+t*kh):t?r*(t+1)*kh:r}function lhe(e,r){var t=e._fullLayout,a=r._id,n=a.charAt(0),i=r.title.font.size,o,l=(r.title.text.match(bu.BR_TAG_ALL)||[]).length;if(r.title.hasOwnProperty("standoff"))r.side==="bottom"||r.side==="right"?o=r._depth+r.title.standoff+i*_u:(r.side==="top"||r.side==="left")&&(o=r._depth+r.title.standoff+i*(wh+l*kh));else{var s=qh(r);if(r.type==="multicategory")o=r._depth;else{var u=1.5*i;s&&(u=.5*i,r.ticks==="outside"&&(u+=r.ticklen)),o=10+u+(r.linewidth?r.linewidth-1:0)}s||(n==="x"?o+=r.side==="top"?i*(r.showticklabels?1:0):i*(r.showticklabels?1.5:.5):o+=r.side==="right"?i*(r.showticklabels?1:.5):i*(r.showticklabels?.5:0))}var f=Ve.getPxPosition(e,r),c,v,d;n==="x"?(v=r._offset+r._length/2,d=r.side==="top"?f-o:f+o):(d=r._offset+r._length/2,v=r.side==="right"?f+o:f-o,c={rotate:"-90",offset:0});var p;if(r.type!=="multicategory"){var y=r._selections[r._id+"tick"];if(p={selection:y,side:r.side},y&&y.node()&&y.node().parentNode){var m=Xn.getTranslate(y.node().parentNode);p.offsetLeft=m.x,p.offsetTop=m.y}r.title.hasOwnProperty("standoff")&&(p.pad=0)}return r._titleStandoff=o,kve.draw(e,a+"title",{propContainer:r,propName:r._name+".title.text",placeholder:t._dfltTitle[n],avoid:p,transform:c,attributes:{x:v,y:d,"text-anchor":"middle"}})}Ve.shouldShowZeroLine=function(e,r,t){var a=xr.simpleMap(r.range,r.r2l);return a[0]*a[1]<=0&&r.zeroline&&(r.type==="linear"||r.type==="-")&&!(r.rangebreaks&&r.maskBreaks(0)===W1)&&(mE(r,0)||!she(e,r,t,a)||uhe(e,r))};Ve.clipEnds=function(e,r){return r.filter(function(t){return mE(e,t.x)})};function mE(e,r){var t=e.l2p(r);return t>1&&t1)for(n=1;n=n.min&&e=Dve:/%L/.test(r)?e>=Eve:/%[SX]/.test(r)?e>=V1:/%M/.test(r)?e>=Mh:/%[HI]/.test(r)?e>=Fo:/%p/.test(r)?e>=ls:/%[Aadejuwx]/.test(r)?e>=ln:/%[UVW]/.test(r)?e>=Jn:/%[Bbm]/.test(r)?e>=G1:/%[q]/.test(r)?e>=U1:/%[Yy]/.test(r)?e>=H1:!0}});var wE=N((bRe,_E)=>{"use strict";_E.exports=function(r,t,a){var n,i;if(a){var o=t==="reversed"||t==="min reversed"||t==="max reversed";n=a[o?1:0],i=a[o?0:1]}var l=r("autorangeoptions.minallowed",i===null?n:void 0),s=r("autorangeoptions.maxallowed",n===null?i:void 0);l===void 0&&r("autorangeoptions.clipmin"),s===void 0&&r("autorangeoptions.clipmax"),r("autorangeoptions.include")}});var l5=N((xRe,TE)=>{"use strict";var phe=wE();TE.exports=function(r,t,a,n){var i=t._template||{},o=t.type||i.type||"-";a("minallowed"),a("maxallowed");var l=a("range");if(!l){var s;!n.noInsiderange&&o!=="log"&&(s=a("insiderange"),s&&(s[0]===null||s[1]===null)&&(t.insiderange=!1,s=void 0),s&&(l=a("range",s)))}var u=t.getAutorangeDflt(l,n),f=a("autorange",u),c;l&&(l[0]===null&&l[1]===null||(l[0]===null||l[1]===null)&&(f==="reversed"||f===!0)||l[0]!==null&&(f==="min"||f==="max reversed")||l[1]!==null&&(f==="max"||f==="min reversed"))&&(l=void 0,delete t.range,t.autorange=!0,c=!0),c||(u=t.getAutorangeDflt(l,n),f=a("autorange",u)),f&&(phe(a,f,l),(o==="linear"||o==="-")&&a("rangemode")),t.cleanRange()}});var ME=N((_Re,AE)=>{var yhe={left:0,top:0};AE.exports=mhe;function mhe(e,r,t){r=r||e.currentTarget||e.srcElement,Array.isArray(t)||(t=[0,0]);var a=e.clientX||0,n=e.clientY||0,i=ghe(r);return t[0]=a-i.left,t[1]=n-i.top,t}function ghe(e){return e===window||e===document||e===document.body?yhe:e.getBoundingClientRect()}});var s5=N((wRe,kE)=>{"use strict";var bhe=Gb();function xhe(){var e=!1;try{var r=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,r),window.removeEventListener("test",null,r)}catch(t){e=!1}return e}kE.exports=bhe&&xhe()});var qE=N((TRe,SE)=>{"use strict";SE.exports=function(r,t,a,n,i){var o=(r-a)/(n-a),l=o+t/(n-a),s=(o+l)/2;return i==="left"||i==="bottom"?o:i==="center"||i==="middle"?s:i==="right"||i==="top"?l:o<2/3-s?o:l>4/3-s?l:s}});var EE=N((ARe,CE)=>{"use strict";var LE=Ee(),_he=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];CE.exports=function(r,t,a,n){return a==="left"?r=0:a==="center"?r=1:a==="right"?r=2:r=LE.constrain(Math.floor(r*3),0,2),n==="bottom"?t=0:n==="middle"?t=1:n==="top"?t=2:t=LE.constrain(Math.floor(t*3),0,2),_he[t][r]}});var RE=N((MRe,DE)=>{"use strict";var whe=vh(),The=jp(),Ahe=nh().getGraphDiv,Mhe=eh(),u5=DE.exports={};u5.wrapped=function(e,r,t){e=Ahe(e),e._fullLayout&&The.clear(e._fullLayout._uid+Mhe.HOVERID),u5.raw(e,r,t)};u5.raw=function(r,t){var a=r._fullLayout,n=r._hoverdata;t||(t={}),!(t.target&&!r._dragged&&whe.triggerHandler(r,"plotly_beforehover",t)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,t.target&&n&&r.emit("plotly_unhover",{event:t,points:n}))}});var mi=N((kRe,IE)=>{"use strict";var khe=ME(),f5=Yb(),She=s5(),qhe=Ee().removeElement,Lhe=xa(),wu=IE.exports={};wu.align=qE();wu.getCursor=EE();var FE=RE();wu.unhover=FE.wrapped;wu.unhoverRaw=FE.raw;wu.init=function(r){var t=r.gd,a=1,n=t._context.doubleClickDelay,i=r.element,o,l,s,u,f,c,v,d;t._mouseDownTime||(t._mouseDownTime=0),i.style.pointerEvents="all",i.onmousedown=m,She?(i._ontouchstart&&i.removeEventListener("touchstart",i._ontouchstart),i._ontouchstart=m,i.addEventListener("touchstart",m,{passive:!1})):i.ontouchstart=m;function p(_,b,w){return Math.abs(_)n&&(a=Math.max(a-1,1)),t._dragged)r.doneFn&&r.doneFn();else{var b;c.target===v?b=c:(b={target:v,srcElement:v,toElement:v},Object.keys(c).concat(Object.keys(c.__proto__)).forEach(w=>{var k=c[w];!b[w]&&typeof k!="function"&&(b[w]=k)})),r.clickFn&&r.clickFn(a,b),d||v.dispatchEvent(new MouseEvent("click",_))}t._dragging=!1,t._dragged=!1}};function NE(){var e=document.createElement("div");e.className="dragcover";var r=e.style;return r.position="fixed",r.left=0,r.right=0,r.top=0,r.bottom=0,r.zIndex=999999999,r.background="none",document.body.appendChild(e),e}wu.coverSlip=NE;function PE(e){return khe(e.changedTouches?e.changedTouches[0]:e,document.body)}});var ss=N((SRe,zE)=>{"use strict";zE.exports=function(r,t){(r.attr("class")||"").split(" ").forEach(function(a){a.indexOf("cursor-")===0&&r.classed(a,!1)}),t&&r.classed("cursor-"+t,!0)}});var HE=N((qRe,BE)=>{"use strict";var c5=ss(),Lh="data-savedcursor",OE="!!";BE.exports=function(r,t){var a=r.attr(Lh);if(t){if(!a){for(var n=(r.attr("class")||"").split(" "),i=0;i{"use strict";var v5=ga(),Che=fi();UE.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:Che.defaultLine,editType:"legend"},maxheight:{valType:"number",min:0,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:v5({editType:"legend"}),grouptitlefont:v5({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},titleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],editType:"legend"},titledoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:v5({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}});var Eh=N(Ch=>{"use strict";Ch.isGrouped=function(r){return(r.traceorder||"").indexOf("grouped")!==-1};Ch.isVertical=function(r){return r.orientation!=="h"};Ch.isReversed=function(r){return(r.traceorder||"").indexOf("reversed")!==-1};Ch.getId=function(r){return r._id||"legend"}});var p5=N((ERe,GE)=>{"use strict";var J1=br(),$n=Ee(),Ehe=wt(),Dhe=gn(),Rhe=h5(),Phe=Of(),d5=Eh();function Fhe(e,r,t,a,n){var i=r[e]||{},o=Ehe.newContainer(t,e);function l(H,X){return $n.coerce(i,o,Rhe,H,X)}var s=$n.coerceFont(l,"font",t.font);l("bgcolor",t.paper_bgcolor),l("bordercolor");var u=l("visible");if(!u)return;var f,c=function(H,X){var j=f._input,ee=f;return $n.coerce(j,ee,Dhe,H,X)},v=t.font||{},d=$n.coerceFont(l,"grouptitlefont",v,{overrideDflt:{size:Math.round(v.size*1.1)}}),p=0,y=!1,m="normal",x=(t.shapes||[]).filter(function(H){return H.showlegend});function T(H){return J1.traceIs(H,"pie-like")&&H._length!=null&&(Array.isArray(H.legend)||Array.isArray(H.showlegend))}a.filter(T).forEach(function(H){H.visible&&p++;for(var X=0;XH.legend.length)for(var ee=H.legend.length;ee(e==="legend"?1:0));if(k===!1&&(t[e]=void 0),!(k===!1&&!i.uirevision)&&(l("uirevision",t.uirevision),k!==!1)){l("borderwidth");var M=l("orientation"),q=l("yref"),E=l("xref"),D=M==="h",P=q==="paper",R=E==="paper",z,I,B,G="left";D?(z=0,J1.getComponentMethod("rangeslider","isVisible")(r.xaxis)?P?(I=1.1,B="bottom"):(I=1,B="top"):P?(I=-.1,B="top"):(I=0,B="bottom")):(I=1,B="auto",R?z=1.02:(z=1,G="right")),$n.coerce(i,o,{x:{valType:"number",editType:"legend",min:R?-2:0,max:R?3:1,dflt:z}},"x"),$n.coerce(i,o,{y:{valType:"number",editType:"legend",min:P?-2:0,max:P?3:1,dflt:I}},"y"),l("traceorder",m),d5.isGrouped(t[e])&&l("tracegroupgap"),l("entrywidth"),l("entrywidthmode"),l("indentation"),l("itemsizing"),l("itemwidth"),l("itemclick"),l("itemdoubleclick"),l("groupclick"),l("xanchor",G),l("yanchor",B),l("maxheight"),l("valign"),$n.noneOrAll(i,o,["x","y"]);var Y=l("title.text");if(Y){l("title.side",D?"left":"top");var V=$n.extendFlat({},s,{size:$n.bigFont(s.size)});$n.coerceFont(l,"title.font",V);let H=n>1;l("titleclick",H?"toggle":!1),l("titledoubleclick",H?"toggleothers":!1)}}}GE.exports=function(r,t,a){var n,i=a.slice(),o=t.shapes;if(o)for(n=0;n{"use strict";var us=br(),y5=Ee(),Nhe=y5.pushUnique,Ihe=Eh(),VE=!0;m5.handleItemClick=function(r,t,a,n){var i=t._fullLayout;if(t._dragged||t._editing)return;var o=r.data()[0][0];if(o.groupTitle&&o.noClick)return;var l=a.groupclick;n==="toggle"&&a.itemdoubleclick==="toggleothers"&&VE&&t.data&&t._context.showTips&&(y5.notifier(y5._(t,"Double-click on legend to isolate one trace"),"long",t),VE=!1);var s=l==="togglegroup",u=i.hiddenlabels?i.hiddenlabels.slice():[],f=t._fullData,c=(i.shapes||[]).filter(function(Pe){return Pe.showlegend}),v=f.concat(c),d=o.trace;d._isShape&&(d=d._fullInput);var p=d.legendgroup,y,m,x,T,_,b,w={},k=[],M=[],q=[];function E(Pe,Le){var ze=k.indexOf(Pe),Be=w.visible;return Be||(Be=w.visible=[]),k.indexOf(Pe)===-1&&(k.push(Pe),ze=k.length-1),Be[ze]=Le,ze}var D=(i.shapes||[]).map(function(Pe){return Pe._input}),P=!1;function R(Pe,Le){D[Pe].visible=Le,P=!0}function z(Pe,Le){if(!(o.groupTitle&&!s)){var ze=Pe._fullInput||Pe,Be=ze._isShape,Ge=ze.index;Ge===void 0&&(Ge=ze._index);var De=ze.visible===!1?!1:Le;Be?R(Ge,De):E(Ge,De)}}var I=d.legend,B=d._fullInput,G=B&&B._isShape;if(!G&&us.traceIs(d,"pie-like")){var Y=o.label,V=u.indexOf(Y);if(n==="toggle")V===-1?u.push(Y):u.splice(V,1);else if(n==="toggleothers"){var H=V!==-1,X=[];for(y=0;y{"use strict";YE.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}});var ZE=N((PRe,jE)=>{"use strict";var WE=br(),x5=Eh();jE.exports=function(r,t,a){var n=t._inHover,i=x5.isGrouped(t),o=x5.isReversed(t),l={},s=[],u=!1,f={},c=0,v=0,d,p;function y(H,X,j){if(t.visible!==!1&&!(a&&H!==t._id))if(X===""||!x5.isGrouped(t)){var ee="~~i"+c;s.push(ee),l[ee]=[j],c++}else s.indexOf(X)===-1?(s.push(X),u=!0,l[X]=[j]):l[X].push(j)}for(d=0;dR&&(P=R)}E[d][0]._groupMinRank=P,E[d][0]._preGroupSort=d}var z=function(H,X){return H[0]._groupMinRank-X[0]._groupMinRank||H[0]._preGroupSort-X[0]._preGroupSort},I=function(H,X){return H.trace.legendrank-X.trace.legendrank||H._preSort-X._preSort};for(E.forEach(function(H,X){H[0]._preGroupSort=X}),E.sort(z),d=0;d{"use strict";var $1=Ee();function XE(e){return e.indexOf("e")!==-1?e.replace(/[.]?0+e/,"e"):e.indexOf(".")!==-1?e.replace(/[.]?0+$/,""):e}Tu.formatPiePercent=function(r,t){var a=XE((r*100).toPrecision(3));return $1.numSeparate(a,t)+"%"};Tu.formatPieValue=function(r,t){var a=XE(r.toPrecision(10));return $1.numSeparate(a,t)};Tu.getFirstFilled=function(r,t){if($1.isArrayOrTypedArray(r))for(var a=0;a{"use strict";var zhe=Yr(),Ohe=Tr();JE.exports=function(r,t,a,n){var i=a.marker.pattern;i&&i.shape?zhe.pointStyle(r,a,n,t):Ohe.fill(r,t.color)}});var Q1=N((IRe,eD)=>{"use strict";var KE=Tr(),QE=K1().castOption,Bhe=$E();eD.exports=function(r,t,a,n){var i=a.marker.line,o=QE(i.color,t.pts)||KE.defaultLine,l=QE(i.width,t.pts)||0;r.call(Bhe,t,a,n).style("stroke-width",l).call(KE.stroke,o)}});var A5=N((zRe,oD)=>{"use strict";var sn=Sr(),_5=br(),Ka=Ee(),rD=Ka.strTranslate,Kn=Yr(),gi=Tr(),w5=Zn().extractOpts,ey=Pn(),Hhe=Q1(),Uhe=K1().castOption,Ghe=b5(),tD=12,aD=5,Au=2,Vhe=10,vc=5;oD.exports=function(r,t,a){var n=t._fullLayout;a||(a=n.legend);var i=a.itemsizing==="constant",o=a.itemwidth,l=(o+Ghe.itemGap*2)/2,s=rD(l,0),u=function(M,q,E,D){var P;if(M+1)P=M;else if(q&&q.width>0)P=q.width;else return 0;return i?D:Math.min(P,E)};r.each(function(M){var q=sn.select(this),E=Ka.ensureSingle(q,"g","layers");E.style("opacity",M[0].trace.opacity);var D=a.indentation,P=a.valign,R=M[0].lineHeight,z=M[0].height;if(P==="middle"&&D===0||!R||!z)E.attr("transform",null);else{var I={top:1,bottom:-1}[P],B=I*(.5*(R-z+3))||0,G=a.indentation;E.attr("transform",rD(G,B))}var Y=E.selectAll("g.legendfill").data([M]);Y.enter().append("g").classed("legendfill",!0);var V=E.selectAll("g.legendlines").data([M]);V.enter().append("g").classed("legendlines",!0);var H=E.selectAll("g.legendsymbols").data([M]);H.enter().append("g").classed("legendsymbols",!0),H.selectAll("g.legendpoints").data([M]).enter().append("g").classed("legendpoints",!0)}).each(k).each(v).each(p).each(d).each(m).each(b).each(_).each(f).each(c).each(x).each(T);function f(M){var q=nD(M),E=q.showFill,D=q.showLine,P=q.showGradientLine,R=q.showGradientFill,z=q.anyFill,I=q.anyLine,B=M[0],G=B.trace,Y,V,H=w5(G),X=H.colorscale,j=H.reversescale,ee=function(ce){if(ce.size())if(E)Kn.fillGroupStyle(ce,t,!0);else{var he="legendfill-"+G.uid;Kn.gradient(ce,t,he,T5(j),X,"fill")}},fe=function(ce){if(ce.size()){var he="legendline-"+G.uid;Kn.lineGroupStyle(ce),Kn.gradient(ce,t,he,T5(j),X,"stroke")}},ie=ey.hasMarkers(G)||!z?"M5,0":I?"M5,-2":"M5,-3",ue=sn.select(this),K=ue.select(".legendfill").selectAll("path").data(E||R?[M]:[]);if(K.enter().append("path").classed("js-fill",!0),K.exit().remove(),K.attr("d",ie+"h"+o+"v6h-"+o+"z").call(ee),D||P){var we=u(void 0,G.line,Vhe,aD);V=Ka.minExtend(G,{line:{width:we}}),Y=[Ka.minExtend(B,{trace:V})]}var se=ue.select(".legendlines").selectAll("path").data(D||P?[Y]:[]);se.enter().append("path").classed("js-line",!0),se.exit().remove(),se.attr("d",ie+(P?"l"+o+",0.0001":"h"+o)).call(D?Kn.lineGroupStyle:fe)}function c(M){var q=nD(M),E=q.anyFill,D=q.anyLine,P=q.showLine,R=q.showMarker,z=M[0],I=z.trace,B=!R&&!D&&!E&&ey.hasText(I),G,Y;function V(K,we,se,ce){var he=Ka.nestedProperty(I,K).get(),ye=Ka.isArrayOrTypedArray(he)&&we?we(he):he;if(i&&ye&&ce!==void 0&&(ye=ce),se){if(yese[1])return se[1]}return ye}function H(K){return z._distinct&&z.index&&K[z.index]?K[z.index]:K[0]}if(R||B||P){var X={},j={};if(R){X.mc=V("marker.color",H),X.mx=V("marker.symbol",H),X.mo=V("marker.opacity",Ka.mean,[.2,1]),X.mlc=V("marker.line.color",H),X.mlw=V("marker.line.width",Ka.mean,[0,5],Au),X.mld=I._isShape?"solid":V("marker.line.dash",H),j.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var ee=V("marker.size",Ka.mean,[2,16],tD);X.ms=ee,j.marker.size=ee}P&&(j.line={width:V("line.width",H,[0,10],aD)}),B&&(X.tx="Aa",X.tp=V("textposition",H),X.ts=10,X.tc=V("textfont.color",H),X.tf=V("textfont.family",H),X.tw=V("textfont.weight",H),X.ty=V("textfont.style",H),X.tv=V("textfont.variant",H),X.tC=V("textfont.textcase",H),X.tE=V("textfont.lineposition",H),X.tS=V("textfont.shadow",H)),G=[Ka.minExtend(z,X)],Y=Ka.minExtend(I,j),Y.selectedpoints=null,Y.texttemplate=null}var fe=sn.select(this).select("g.legendpoints"),ie=fe.selectAll("path.scatterpts").data(R?G:[]);ie.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",s),ie.exit().remove(),ie.call(Kn.pointStyle,Y,t),R&&(G[0].mrc=3);var ue=fe.selectAll("g.pointtext").data(B?G:[]);ue.enter().append("g").classed("pointtext",!0).append("text").attr("transform",s),ue.exit().remove(),ue.selectAll("text").call(Kn.textPointStyle,Y,t)}function v(M){var q=M[0].trace,E=q.type==="waterfall";if(M[0]._distinct&&E){var D=M[0].trace[M[0].dir].marker;return M[0].mc=D.color,M[0].mlw=D.line.width,M[0].mlc=D.line.color,y(M,this,"waterfall")}var P=[];q.visible&&E&&(P=M[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var R=sn.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(P);R.enter().append("path").classed("legendwaterfall",!0).attr("transform",s).style("stroke-miterlimit",1),R.exit().remove(),R.each(function(z){var I=sn.select(this),B=q[z[0]].marker,G=u(void 0,B.line,vc,Au);I.attr("d",z[1]).style("stroke-width",G+"px").call(gi.fill,B.color),G&&I.call(gi.stroke,B.line.color)})}function d(M){y(M,this)}function p(M){y(M,this,"funnel")}function y(M,q,E){var D=M[0].trace,P=D.marker||{},R=P.line||{},z=P.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",I=E?D.visible&&D.type===E:_5.traceIs(D,"bar"),B=sn.select(q).select("g.legendpoints").selectAll("path.legend"+E).data(I?[M]:[]);B.enter().append("path").classed("legend"+E,!0).attr("d",z).attr("transform",s),B.exit().remove(),B.each(function(G){var Y=sn.select(this),V=G[0],H=u(V.mlw,P.line,vc,Au);Y.style("stroke-width",H+"px");var X=V.mcc;if(!a._inHover&&"mc"in V){var j=w5(P),ee=j.mid;ee===void 0&&(ee=(j.max+j.min)/2),X=Kn.tryColorscale(P,"")(ee)}var fe=X||V.mc||P.color,ie=P.pattern,ue=Kn.getPatternAttr,K=ie&&(ue(ie.shape,0,"")||ue(ie.path,0,""));if(K){var we=ue(ie.bgcolor,0,null),se=ue(ie.fgcolor,0,null),ce=ie.fgopacity,he=iD(ie.size,8,10),ye=iD(ie.solidity,.5,1),W="legend-"+D.uid;Y.call(Kn.pattern,"legend",t,W,K,he,ye,X,ie.fillmode,we,se,ce)}else Y.call(gi.fill,fe);H&&gi.stroke(Y,V.mlc||R.color)})}function m(M){var q=M[0].trace,E=sn.select(this).select("g.legendpoints").selectAll("path.legendbox").data(q.visible&&_5.traceIs(q,"box-violin")?[M]:[]);E.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",s),E.exit().remove(),E.each(function(){var D=sn.select(this);if((q.boxpoints==="all"||q.points==="all")&&gi.opacity(q.fillcolor)===0&&gi.opacity((q.line||{}).color)===0){var P=Ka.minExtend(q,{marker:{size:i?tD:Ka.constrain(q.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});E.call(Kn.pointStyle,P,t)}else{var R=u(void 0,q.line,vc,Au);D.style("stroke-width",R+"px").call(gi.fill,q.fillcolor),R&&gi.stroke(D,q.line.color)}})}function x(M){var q=M[0].trace,E=sn.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(q.visible&&q.type==="candlestick"?[M,M]:[]);E.enter().append("path").classed("legendcandle",!0).attr("d",function(D,P){return P?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",s).style("stroke-miterlimit",1),E.exit().remove(),E.each(function(D,P){var R=sn.select(this),z=q[P?"increasing":"decreasing"],I=u(void 0,z.line,vc,Au);R.style("stroke-width",I+"px").call(gi.fill,z.fillcolor),I&&gi.stroke(R,z.line.color)})}function T(M){var q=M[0].trace,E=sn.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(q.visible&&q.type==="ohlc"?[M,M]:[]);E.enter().append("path").classed("legendohlc",!0).attr("d",function(D,P){return P?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",s).style("stroke-miterlimit",1),E.exit().remove(),E.each(function(D,P){var R=sn.select(this),z=q[P?"increasing":"decreasing"],I=u(void 0,z.line,vc,Au);R.style("fill","none").call(Kn.dashLine,z.line.dash,I),I&&gi.stroke(R,z.line.color)})}function _(M){w(M,this,"pie")}function b(M){w(M,this,"funnelarea")}function w(M,q,E){var D=M[0],P=D.trace,R=E?P.visible&&P.type===E:_5.traceIs(P,E),z=sn.select(q).select("g.legendpoints").selectAll("path.legend"+E).data(R?[M]:[]);if(z.enter().append("path").classed("legend"+E,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",s),z.exit().remove(),z.size()){var I=P.marker||{},B=u(Uhe(I.line.width,D.pts),I.line,vc,Au),G="pieLike",Y=Ka.minExtend(P,{marker:{line:{width:B}}},G),V=Ka.minExtend(D,{trace:Y},G);Hhe(z,V,Y,t)}}function k(M){var q=M[0].trace,E,D=[];if(q.visible)switch(q.type){case"histogram2d":case"heatmap":D=[["M-15,-2V4H15V-2Z"]],E=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":D=[["M-6,-6V6H6V-6Z"]],E=!0;break;case"densitymapbox":case"densitymap":D=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],E="radial";break;case"cone":D=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],E=!1;break;case"streamtube":D=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],E=!1;break;case"surface":D=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],E=!0;break;case"mesh3d":D=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],E=!1;break;case"volume":D=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],E=!0;break;case"isosurface":D=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],E=!1;break}var P=sn.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(D);P.enter().append("path").classed("legend3dandfriends",!0).attr("transform",s).style("stroke-miterlimit",1),P.exit().remove(),P.each(function(R,z){var I=sn.select(this),B=w5(q),G=B.colorscale,Y=B.reversescale,V=function(ee){if(ee.size()){var fe="legendfill-"+q.uid;Kn.gradient(ee,t,fe,T5(Y,E==="radial"),G,"fill")}},H;if(G){if(!E){var j=G.length;H=z===0?G[Y?j-1:0][1]:z===1?G[Y?0:j-1][1]:G[Math.floor((j-1)/2)][1]}}else{var X=q.vertexcolor||q.facecolor||q.color;H=Ka.isArrayOrTypedArray(X)?X[z]||X[0]:X}I.attr("d",R[0]),H?I.call(gi.fill,H):I.call(V)})}};function T5(e,r){var t=r?"radial":"horizontal";return t+(e?"":"reversed")}function nD(e){var r=e[0].trace,t=r.contours,a=ey.hasLines(r),n=ey.hasMarkers(r),i=r.visible&&r.fill&&r.fill!=="none",o=!1,l=!1;if(t){var s=t.coloring;s==="lines"?o=!0:a=s==="none"||s==="heatmap"||t.showlines,t.type==="constraint"?i=t._operation!=="=":(s==="fill"||s==="heatmap")&&(l=!0)}return{showMarker:n,showLine:a,showFill:i,showGradientLine:o,showGradientFill:l,anyLine:a||o,anyFill:i||l}}function iD(e,r,t){return e&&Ka.isArrayOrTypedArray(e)?r:e>t?t:e}});var q5=N((ORe,pD)=>{"use strict";var bn=Sr(),na=Ee(),k5=aa(),Mu=br(),ay=vh(),M5=mi(),ia=Yr(),Dh=Tr(),ku=Aa(),lD=g5().handleItemClick,sD=g5().handleTitleClick,ha=b5(),S5=Ha(),hD=S5.LINE_SPACING,dc=S5.FROM_TL,uD=S5.FROM_BR,fD=ZE(),Yhe=A5(),pc=Eh(),hc=1,Whe=/^legend[0-9]*$/;pD.exports=function(r,t){if(t)cD(r,t);else{var a=r._fullLayout,n=a._legends,i=a._infolayer.selectAll('[class^="legend"]');i.each(function(){var u=bn.select(this),f=u.attr("class"),c=f.split(" ")[0];c.match(Whe)&&n.indexOf(c)===-1&&u.remove()});for(var o=0;o1)}var p=a.hiddenlabels||[];if(!l&&(!a.showlegend||!s.length))return o.selectAll("."+n).remove(),a._topdefs.select("#"+i).remove(),k5.autoMargin(e,n);var y=na.ensureSingle(o,"g",n,function(q){l||q.attr("pointer-events","all")}),m=na.ensureSingleById(a._topdefs,"clipPath",i,function(q){q.append("rect")}),x=na.ensureSingle(y,"rect","bg",function(q){q.attr("shape-rendering","crispEdges")});x.call(Dh.stroke,t.bordercolor).call(Dh.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px");var T=na.ensureSingle(y,"g","scrollbox"),_=t.title;t._titleWidth=0,t._titleHeight=0;var b;_.text?(b=na.ensureSingle(T,"text",n+"titletext"),b.attr("text-anchor","start").call(ia.font,_.font).text(_.text),ty(b,T,e,t,hc),!l&&(t.titleclick||t.titledoubleclick)&&Jhe(T,e,t,n)):(T.selectAll("."+n+"titletext").remove(),T.selectAll("."+n+"titletoggle").remove());var w=na.ensureSingle(y,"rect","scrollbar",function(q){q.attr(ha.scrollBarEnterAttrs).call(Dh.fill,ha.scrollBarColor)}),k=T.selectAll("g.groups").data(s);k.enter().append("g").attr("class","groups"),k.exit().remove();var M=k.selectAll("g.traces").data(na.identity);M.enter().append("g").attr("class","traces"),M.exit().remove(),M.style("opacity",function(q){let E=q[0],D=E.trace;if(E.groupTitle){let P=D.legendgroup,R=(a.shapes||[]).filter(function(I){return I.showlegend});return e._fullData.concat(R).some(function(I){return I.legendgroup===P&&(I.legend||"legend")===n&&I.visible===!0})?1:.5}return Mu.traceIs(D,"pie-like")?p.indexOf(q[0].label)!==-1?.5:1:D.visible==="legendonly"?.5:1}).each(function(){bn.select(this).call(Zhe,e,t)}).call(Yhe,e,t).each(function(q){l||q[0].groupTitle&&t.groupclick==="toggleitem"||bn.select(this).call(Xhe,e,n)}),na.syncOrAsync([k5.previousPromises,function(){return Qhe(e,k,M,t,T)},function(){var q=a._size,E=t.borderwidth,D=t.xref==="paper",P=t.yref==="paper";if(_.text){let le=(a.shapes||[]).filter(function(me){return me.showlegend}),ve=e._fullData.concat(le).some(function(me){let Ce=me.legend||"legend";var Pe=Array.isArray(Ce)?Ce.includes(n):Ce===n;return Pe&&me.visible===!0});b.style("opacity",ve?1:.5)}if(!l){var R,z;D?R=q.l+q.w*t.x-dc[ny(t)]*t._width:R=a.width*t.x-dc[ny(t)]*t._width,P?z=q.t+q.h*(1-t.y)-dc[iy(t)]*t._effHeight:z=a.height*(1-t.y)-dc[iy(t)]*t._effHeight;var I=e0e(e,n,R,z);if(I)return;if(a.margin.autoexpand){var B=R,G=z;R=D?na.constrain(R,0,a.width-t._width):B,z=P?na.constrain(z,0,a.height-t._effHeight):G,R!==B&&na.log("Constrain "+n+".x to make legend fit inside graph"),z!==G&&na.log("Constrain "+n+".y to make legend fit inside graph")}ia.setTranslate(y,R,z)}if(w.on(".drag",null),y.on("wheel",null),l||t._height<=t._maxHeight||e._context.staticPlot){var Y=t._effHeight;l&&(Y=t._height),x.attr({width:t._width-E,height:Y-E,x:E/2,y:E/2}),ia.setTranslate(T,0,0),m.select("rect").attr({width:t._width-2*E,height:Y-2*E,x:E,y:E}),ia.setClipUrl(T,i,e),ia.setRect(w,0,0,0,0),delete t._scrollY}else{var V=Math.max(ha.scrollBarMinHeight,t._effHeight*t._effHeight/t._height),H=t._effHeight-V-2*ha.scrollBarMargin,X=t._height-t._effHeight,j=H/X,ee=Math.min(t._scrollY||0,X);x.attr({width:t._width-2*E+ha.scrollBarWidth+ha.scrollBarMargin,height:t._effHeight-E,x:E/2,y:E/2}),m.select("rect").attr({width:t._width-2*E+ha.scrollBarWidth+ha.scrollBarMargin,height:t._effHeight-2*E,x:E,y:E+ee}),ia.setClipUrl(T,i,e),he(ee,V,j),y.on("wheel",function(){ee=na.constrain(t._scrollY+bn.event.deltaY/X*H,0,X),he(ee,V,j),ee!==0&&ee!==X&&bn.event.preventDefault()});var fe,ie,ue,K=function(le,ve,me){var Ce=(me-ve)/j+le;return na.constrain(Ce,0,X)},we=function(le,ve,me){var Ce=(ve-me)/j+le;return na.constrain(Ce,0,X)},se=bn.behavior.drag().on("dragstart",function(){var le=bn.event.sourceEvent;le.type==="touchstart"?fe=le.changedTouches[0].clientY:fe=le.clientY,ue=ee}).on("drag",function(){var le=bn.event.sourceEvent;le.buttons===2||le.ctrlKey||(le.type==="touchmove"?ie=le.changedTouches[0].clientY:ie=le.clientY,ee=K(ue,fe,ie),he(ee,V,j))});w.call(se);var ce=bn.behavior.drag().on("dragstart",function(){var le=bn.event.sourceEvent;le.type==="touchstart"&&(fe=le.changedTouches[0].clientY,ue=ee)}).on("drag",function(){var le=bn.event.sourceEvent;le.type==="touchmove"&&(ie=le.changedTouches[0].clientY,ee=we(ue,fe,ie),he(ee,V,j))});T.call(ce)}function he(le,ve,me){t._scrollY=e._fullLayout[n]._scrollY=le,ia.setTranslate(T,0,-le),ia.setRect(w,t._width,ha.scrollBarMargin+le*me,ha.scrollBarWidth,ve),m.select("rect").attr("y",E+le)}if(e._context.edits.legendPosition){var ye,W,Q,Z;y.classed("cursor-move",!0),M5.init({element:y.node(),gd:e,prepFn:function(le){if(le.target!==w.node()){var ve=ia.getTranslate(y);Q=ve.x,Z=ve.y}},moveFn:function(le,ve){if(Q!==void 0&&Z!==void 0){var me=Q+le,Ce=Z+ve;ia.setTranslate(y,me,Ce),ye=M5.align(me,t._width,q.l,q.l+q.w,t.xanchor),W=M5.align(Ce+t._height,-t._height,q.t+q.h,q.t,t.yanchor)}},doneFn:function(){if(ye!==void 0&&W!==void 0){var le={};le[n+".x"]=ye,le[n+".y"]=W,Mu.call("_guiRelayout",e,le)}},clickFn:function(le,ve){var me=o.selectAll("g.traces").filter(function(){var Ce=this.getBoundingClientRect();return ve.clientX>=Ce.left&&ve.clientX<=Ce.right&&ve.clientY>=Ce.top&&ve.clientY<=Ce.bottom});me.size()>0&&dD(e,t,me,le,ve)}})}}],e)}}function ry(e,r,t){var a=e[0],n=a.width,i=r.entrywidthmode,o=a.trace.legendwidth||r.entrywidth;return i==="fraction"?r._maxWidth*o:t+(o||n)}function dD(e,r,t,a,n){var i=e._fullLayout,o=t.data()[0][0].trace,l=r.itemclick,s=r.itemdoubleclick,u={event:n,node:t.node(),curveNumber:o.index,expandedIndex:o.index,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:i};o._group&&(u.group=o._group),Mu.traceIs(o,"pie-like")&&(u.label=t.datum()[0].label);var f=ay.triggerHandler(e,"plotly_legendclick",u);if(a===1){if(f===!1)return;r._clickTimeout=setTimeout(function(){e._fullLayout&&l&&lD(t,e,r,l)},e._context.doubleClickDelay)}else if(a===2){r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0;var c=ay.triggerHandler(e,"plotly_legenddoubleclick",u);c!==!1&&f!==!1&&s&&lD(t,e,r,s)}}function Zhe(e,r,t){var a=pc.getId(t),n=e.data()[0][0],i=n.trace,o=Mu.traceIs(i,"pie-like"),l=!t._inHover&&r._context.edits.legendText&&!o,s=t._maxNameLength,u,f;n.groupTitle?(u=n.groupTitle.text,f=n.groupTitle.font):(f=t.font,t.entries?u=n.text:(u=o?n.label:i.name,i._meta&&(u=na.templateString(u,i._meta))));var c=na.ensureSingle(e,"text",a+"text");c.attr("text-anchor","start").call(ia.font,f).text(l?vD(u,s):u);var v=t.indentation+t.itemwidth+ha.itemGap*2;ku.positionText(c,v,0),l?c.call(ku.makeEditable,{gd:r,text:u}).call(ty,e,r,t).on("edit",function(d){this.text(vD(d,s)).call(ty,e,r,t);var p=n.trace._fullInput||{},y={};return y.name=d,p._isShape?Mu.call("_guiRelayout",r,"shapes["+i.index+"].name",y.name):Mu.call("_guiRestyle",r,y,i.index)}):ty(c,e,r,t)}function vD(e,r){var t=Math.max(4,r);if(e&&e.trim().length>=t/2)return e;e=e||"";for(var a=t-e.length;a>0;a--)e+=" ";return e}function Xhe(e,r,t){var a=r._context.doubleClickDelay,n,i=1,o=na.ensureSingle(e,"rect",t+"toggle",function(l){r._context.staticPlot||l.style("cursor","pointer").attr("pointer-events","all"),l.call(Dh.fill,"rgba(0,0,0,0)")});r._context.staticPlot||(o.on("mousedown",function(){n=new Date().getTime(),n-r._legendMouseDownTimea&&(i=Math.max(i-1,1)),dD(r,l,e,i,bn.event)}}))}function Jhe(e,r,t,a){if(r._fullData.some(function(u){let f=u.legend||"legend";return(Array.isArray(f)?f.includes(a):f===a)&&Mu.traceIs(u,"pie-like")}))return;let i=r._context.doubleClickDelay;var o,l=1;let s=na.ensureSingle(e,"rect",a+"titletoggle",function(u){r._context.staticPlot||u.style("cursor","pointer").attr("pointer-events","all"),u.call(Dh.fill,"rgba(0,0,0,0)")});r._context.staticPlot||(s.on("mousedown",function(){o=new Date().getTime(),o-r._legendMouseDownTimei&&(l=Math.max(l-1,1));let u={event:bn.event,legendId:a,data:r.data,layout:r.layout,fullData:r._fullData,fullLayout:r._fullLayout};if(l===1&&t.titleclick){if(ay.triggerHandler(r,"plotly_legendtitleclick",u)===!1)return;t._titleClickTimeout=setTimeout(function(){r._fullLayout&&sD(r,t,t.titleclick)},i)}else l===2&&(t._titleClickTimeout&&clearTimeout(t._titleClickTimeout),r._legendMouseDownTime=0,ay.triggerHandler(r,"plotly_legendtitledoubleclick",u)!==!1&&t.titledoubleclick&&sD(r,t,t.titledoubleclick))}))}function ty(e,r,t,a,n){a._inHover&&e.attr("data-notex",!0),ku.convertToTspans(e,t,function(){$he(r,t,a,n)})}function $he(e,r,t,a){var n=e.data()[0][0],i=n&&n.trace.showlegend;if(Array.isArray(i)&&(i=i[n.i]!==!1),!t._inHover&&n&&!i){e.remove();return}var o=e.select("g[class*=math-group]"),l=o.node(),s=pc.getId(t);t||(t=r._fullLayout[s]);var u=t.borderwidth,f;a===hc?f=t.title.font:n.groupTitle?f=n.groupTitle.font:f=t.font;var c=f.size*hD,v,d;if(l){var p=ia.bBox(l);v=p.height,d=p.width,a===hc?ia.setTranslate(o,u,u+v*.75):ia.setTranslate(o,0,v*.25)}else{var y="."+s+(a===hc?"title":"")+"text",m=e.select(y),x=ku.lineCount(m),T=m.node();if(v=c*x,d=T?ia.bBox(T).width:0,a===hc)t.title.side==="left"&&(d+=ha.itemGap*2),ku.positionText(m,u+ha.titlePad,u+c);else{var _=ha.itemGap*2+t.indentation+t.itemwidth;n.groupTitle&&(_=ha.itemGap,d-=t.indentation+t.itemwidth),ku.positionText(m,_,-c*((x-1)/2-.3))}}a===hc?(t._titleWidth=d,t._titleHeight=v):(n.lineHeight=c,n.height=Math.max(v,16)+3,n.width=d)}function Khe(e){var r=0,t=0,a=e.title.side;return a&&(a.indexOf("left")!==-1&&(r=e._titleWidth),a.indexOf("top")!==-1&&(t=e._titleHeight)),[r,t]}function Qhe(e,r,t,a,n){var i=e._fullLayout,o=pc.getId(a);a||(a=i[o]);var l=i._size,s=pc.isVertical(a),u=pc.isGrouped(a),f=a.entrywidthmode==="fraction",c=a.borderwidth,v=2*c,d=ha.itemGap,p=a.indentation+a.itemwidth+d*2,y=2*(c+d),m=iy(a),x=a.y<0||a.y===0&&m==="top",T=a.y>1||a.y===1&&m==="bottom",_=a.tracegroupgap,b={};let{orientation:w,yref:k}=a,{maxheight:M}=a,q=x||T||w!=="v"||k!=="paper";M||(M=q?.5:1);let E=q?i.height:l.h;a._maxHeight=Math.max(M>1?M:M*E,30);var D=0;a._width=0,a._height=0;var P=Khe(a);if(s)t.each(function(le){var ve=le[0].height;ia.setTranslate(this,c+P[0],c+P[1]+a._height+ve/2+d),a._height+=ve,a._width=Math.max(a._width,le[0].width)}),D=p+a._width,a._width+=d+p+v,a._height+=y,u&&(r.each(function(le,ve){ia.setTranslate(this,0,ve*a.tracegroupgap)}),a._height+=(a._lgroupsLength-1)*a.tracegroupgap);else{var R=ny(a),z=a.x<0||a.x===0&&R==="right",I=a.x>1||a.x===1&&R==="left",B=T||x,G=i.width/2;a._maxWidth=Math.max(z?B&&R==="left"?l.l+l.w:G:I?B&&R==="right"?l.r+l.w:G:l.w,2*p);var Y=0,V=0;t.each(function(le){var ve=ry(le,a,p);Y=Math.max(Y,ve),V+=ve}),D=null;var H=0;if(u){var X=0,j=0,ee=0;r.each(function(){var le=0,ve=0;bn.select(this).selectAll("g.traces").each(function(Ce){var Pe=ry(Ce,a,p),Le=Ce[0].height;ia.setTranslate(this,P[0],P[1]+c+d+Le/2+ve),ve+=Le,le=Math.max(le,Pe),b[Ce[0].trace.legendgroup]=le});var me=le+d;j>0&&me+c+j>a._maxWidth?(H=Math.max(H,j),j=0,ee+=X+_,X=ve):X=Math.max(X,ve),ia.setTranslate(this,j,ee),j+=me}),a._width=Math.max(H,j)+c,a._height=ee+X+y}else{var fe=t.size(),ie=V+v+(fe-1)*d=a._maxWidth&&(H=Math.max(H,se),K=0,we+=ue,a._height+=ue,ue=0),ia.setTranslate(this,P[0]+c+K,P[1]+c+we+ve/2+d),se=K+me+d,K+=Ce,ue=Math.max(ue,ve)}),ie?(a._width=K+v,a._height=ue+y):(a._width=Math.max(H,se)+v,a._height+=ue+y)}}a._width=Math.ceil(Math.max(a._width+P[0],a._titleWidth+2*(c+ha.titlePad))),a._height=Math.ceil(Math.max(a._height+P[1],a._titleHeight+2*(c+ha.itemGap))),a._effHeight=Math.min(a._height,a._maxHeight);var ce=e._context.edits,he=ce.legendText||ce.legendPosition;t.each(function(le){var ve=bn.select(this).select("."+o+"toggle"),me=le[0].height,Ce=le[0].trace.legendgroup,Pe=ry(le,a,p);u&&Ce!==""&&(Pe=b[Ce]);var Le=he?p:D||Pe;!s&&!f&&(Le+=d/2),ia.setRect(ve,0,-me/2,Le,me)});var ye=n.select("."+o+"titletext");ye.node()&&jhe(ye,a,c);var W=n.select("."+o+"titletoggle");if(W.size()&&ye.node()){var Q=ye.attr("x")||0,Z=ha.titlePad;ia.setRect(W,Q-Z,c,a._titleWidth+2*Z,a._titleHeight+2*Z)}}function e0e(e,r,t,a){var n=e._fullLayout,i=n[r],o=ny(i),l=iy(i),s=i.xref==="paper",u=i.yref==="paper";e._fullLayout._reservedMargin[r]={};var f=i.y<.5?"b":"t",c=i.x<.5?"l":"r",v={r:n.width-t,l:t+i._width,b:n.height-a,t:a+i._effHeight};if(s&&u)return k5.autoMargin(e,r,{x:i.x,y:i.y,l:i._width*dc[o],r:i._width*uD[o],b:i._effHeight*uD[l],t:i._effHeight*dc[l]});s?e._fullLayout._reservedMargin[r][f]=v[f]:u||i.orientation==="v"?e._fullLayout._reservedMargin[r][c]=v[c]:e._fullLayout._reservedMargin[r][f]=v[f]}function ny(e){return na.isRightAnchor(e)?"right":na.isCenterAnchor(e)?"center":"left"}function iy(e){return na.isBottomAnchor(e)?"bottom":na.isMiddleAnchor(e)?"middle":"top"}});var D5=N(E5=>{"use strict";var Su=Sr(),ml=Rr(),yD=qn(),Ht=Ee(),r0e=Ht.pushUnique,L5=Ht.strTranslate,t0e=Ht.strRotate,a0e=vh(),bi=Aa(),n0e=HE(),Io=Yr(),ka=Tr(),oy=mi(),zo=zr(),i0e=xa().zindexSeparator,mc=br(),lo=Eo(),qu=eh(),o0e=p5(),l0e=q5(),AD=qu.YANGLE,C5=Math.PI*AD/180,s0e=1/Math.sin(C5),u0e=Math.cos(C5),f0e=Math.sin(C5),Et=qu.HOVERARROWSIZE,Vr=qu.HOVERTEXTPAD,mD={box:!0,ohlc:!0,violin:!0,candlestick:!0},c0e={scatter:!0,scattergl:!0,splom:!0};function gD(e,r){return e.distance-r.distance}E5.hover=function(r,t,a,n){r=Ht.getGraphDiv(r);var i=t.target;Ht.throttle(r._fullLayout._uid+qu.HOVERID,qu.HOVERMINTIME,function(){v0e(r,t,a,n,i)})};E5.loneHover=function(r,t){var a=!0;Array.isArray(r)||(a=!1,r=[r]);var n=t.gd,i=LD(n),o=CD(n),l=r.map(function(m){var x=m._x0||m.x0||m.x||0,T=m._x1||m.x1||m.x||0,_=m._y0||m.y0||m.y||0,b=m._y1||m.y1||m.y||0,w=m.eventData;if(w){var k=Math.min(x,T),M=Math.max(x,T),q=Math.min(_,b),E=Math.max(_,b),D=m.trace;if(mc.traceIs(D,"gl3d")){var P=n._fullLayout[D.scene]._scene.container,R=P.offsetLeft,z=P.offsetTop;k+=R,M+=R,q+=z,E+=z}w.bbox={x0:k+o,x1:M+o,y0:q+i,y1:E+i},w.xPixel=(x+T)/2,w.yPixel=(_+b)/2,t.inOut_bbox&&t.inOut_bbox.push(w.bbox)}else w=!1;return{color:m.color||ka.defaultLine,x0:m.x0||m.x||0,x1:m.x1||m.x||0,y0:m.y0||m.y||0,y1:m.y1||m.y||0,xLabel:m.xLabel,yLabel:m.yLabel,zLabel:m.zLabel,text:m.text,name:m.name,idealAlign:m.idealAlign,borderColor:m.borderColor,fontFamily:m.fontFamily,fontSize:m.fontSize,fontColor:m.fontColor,fontWeight:m.fontWeight,fontStyle:m.fontStyle,fontVariant:m.fontVariant,nameLength:m.nameLength,textAlign:m.textAlign,trace:m.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:m.hovertemplate||!1,hovertemplateLabels:m.hovertemplateLabels||!1,eventData:w}}),s=!1,u=kD(l,{gd:n,hovermode:"closest",rotateLabels:s,bgColor:t.bgColor||ka.background,container:Su.select(t.container),outerContainer:t.outerContainer||t.container}),f=u.hoverLabels,c=5,v=0,d=0;f.sort(function(m,x){return m.y0-x.y0}).each(function(m,x){var T=m.y0-m.by/2;T-cM[0]._length||Z<0||Z>q[0]._length)return oy.unhoverRaw(e,r)}if(r.pointerX=Q+M[0]._offset,r.pointerY=Z+q[0]._offset,"xval"in r?G=lo.flat(i,r.xval):G=lo.p2c(M,Q),"yval"in r?Y=lo.flat(i,r.yval):Y=lo.p2c(q,Z),!ml(G[0])||!ml(Y[0]))return Ht.warn("Fx.hover failed",r,e),oy.unhoverRaw(e,r)}l.clickanywhere&&(e._hoverXVals=G,e._hoverYVals=Y,e._hoverXAxes=M,e._hoverYAxes=q);var me=1/0;function Ce(ar,Jr){for(H=0;Hse&&(I.splice(0,se),me=I[0].distance),c&&z!==0&&I.length===0){we.distance=z,we.index=!1;var ft=j._module.hoverPoints(we,ue,K,"closest",{hoverLayer:l._hoverlayer});if(ft&&(ft=ft.filter(function(Xa){return Xa.spikeDistance<=z})),ft&&ft.length){var Ea,An=ft.filter(function(Xa){return Xa.xa.showspikes&&Xa.xa.spikesnap!=="hovered data"});if(An.length){var Kt=An[0];ml(Kt.x0)&&ml(Kt.y0)&&(Ea=Le(Kt),(!ce.vLinePoint||ce.vLinePoint.spikeDistance>Ea.spikeDistance)&&(ce.vLinePoint=Ea))}var _t=ft.filter(function(Xa){return Xa.ya.showspikes&&Xa.ya.spikesnap!=="hovered data"});if(_t.length){var Vt=_t[0];ml(Vt.x0)&&ml(Vt.y0)&&(Ea=Le(Vt),(!ce.hLinePoint||ce.hLinePoint.spikeDistance>Ea.spikeDistance)&&(ce.hLinePoint=Ea))}}}}}Ce();function Pe(ar,Jr,Xr){for(var $r=null,Rt=1/0,$t,ft=0;ftar.trace.index===qe.trace.index):I=[qe];var He=I.length,Je=TD("x",qe,l),We=TD("y",qe,l);Ce(Je,We);var Ze=[],lr={},rr=0,er=function(ar){var Jr=mD[ar.trace.type]?MD(ar):ar.trace.index;if(!lr[Jr])rr++,lr[Jr]=rr,Ze.push(ar);else{var Xr=lr[Jr]-1,$r=Ze[Xr];Xr>0&&Math.abs(ar.distance)He-1;Ie--)er(I[Ie]);I=Ze,De()}var ne=e._hoverdata,de=[],Re=LD(e),Fe=CD(e);for(let ar of I){var Ke=lo.makeEventData(ar,ar.trace,ar.cd);if(ar.hovertemplate!==!1){var cr=!1;ar.cd[ar.index]&&ar.cd[ar.index].ht&&(cr=ar.cd[ar.index].ht),ar.hovertemplate=cr||ar.trace.hovertemplate||!1}if(ar.xa&&ar.ya){var ur=ar.x0+ar.xa._offset,Mr=ar.x1+ar.xa._offset,Ir=ar.y0+ar.ya._offset,Gr=ar.y1+ar.ya._offset,et=Math.min(ur,Mr),qt=Math.max(ur,Mr),ct=Math.min(Ir,Gr),Ot=Math.max(Ir,Gr);Ke.bbox={x0:et+Fe,x1:qt+Fe,y0:ct+Re,y1:Ot+Re},Ke.xPixel=(ur+Mr)/2,Ke.yPixel=(Ir+Gr)/2}ar.eventData=[Ke],de.push(Ke)}e._hoverdata=de;var gt=v==="y"&&(B.length>1||I.length>1)||v==="closest"&&he&&I.length>1,wa=ka.combine(l.plot_bgcolor||ka.background,l.paper_bgcolor),Zt=kD(I,{gd:e,hovermode:v,rotateLabels:gt,bgColor:wa,container:l._hoverlayer,outerContainer:l._paper.node(),commonLabelOpts:l.hoverlabel,hoverdistance:l.hoverdistance}),Xt=Zt.hoverLabels;if(lo.isUnifiedHover(v)||(d0e(Xt,gt,l,Zt.commonLabelBoundingBox),qD(Xt,gt,l._invScaleX,l._invScaleY)),n&&n.tagName){var Na=mc.getComponentMethod("annotations","hasClickToShow")(e,de);n0e(Su.select(n),Na?"pointer":"")}var ua=m0e(e,r,ne);if(!n||a||!ua&&!l.hoveranywhere)return;ne&&ua&&e.emit("plotly_unhover",{event:r,points:ne}),Jt(e._hoverdata);function Jt(ar){e.emit("plotly_hover",{event:r,points:ar,xaxes:M,yaxes:q,xvals:G,yvals:Y})}}function MD(e){return[e.trace.index,e.index,e.x0,e.y0,e.name,e.attr,e.xa?e.xa._id:"",e.ya?e.ya._id:""].join(",")}var h0e=/([\s\S]*)<\/extra>/;function kD(e,r){var t=r.gd,a=t._fullLayout,n=r.hovermode,i=r.rotateLabels,o=r.bgColor,l=r.container,s=r.outerContainer,u=r.commonLabelOpts||{};if(e.length===0)return[[]];var f=r.fontFamily||qu.HOVERFONT,c=r.fontSize||qu.HOVERFONTSIZE,v=r.fontWeight||a.font.weight,d=r.fontStyle||a.font.style,p=r.fontVariant||a.font.variant,y=r.fontTextcase||a.font.textcase,m=r.fontLineposition||a.font.lineposition,x=r.fontShadow||a.font.shadow,T=e[0],_=T.xa,b=T.ya,w=n.charAt(0),k=w+"Label",M=T[k];if(M===void 0&&_.type==="multicategory")for(var q=0;qa.width-de&&(Re=a.width-de),Te.attr("d","M"+(er-Re)+",0L"+(er-Re+Et)+","+ne+Et+"H"+de+"v"+ne+(Vr*2+rr.height)+"H"+-de+"V"+ne+Et+"H"+(er-Re-Et)+"Z"),er=Re,H.minX=er-de,H.maxX=er+de,_.side==="top"?(H.minY=Ie-(Vr*2+rr.height),H.maxY=Ie-Vr):(H.minY=Ie+Vr,H.maxY=Ie+(Vr*2+rr.height))}else{var Fe,Ke,cr;b.side==="right"?(Fe="start",Ke=1,cr="",er=_._offset+_._length):(Fe="end",Ke=-1,cr="-",er=_._offset),Ie=b._offset+(T.y0+T.y1)/2,qe.attr("text-anchor",Fe),Te.attr("d","M0,0L"+cr+Et+","+Et+"V"+(Vr+rr.height/2)+"h"+cr+(Vr*2+rr.width)+"V-"+(Vr+rr.height/2)+"H"+cr+Et+"V-"+Et+"Z"),H.minY=Ie-(Vr+rr.height/2),H.maxY=Ie+(Vr+rr.height/2),b.side==="right"?(H.minX=er+Et,H.maxX=er+Et+(Vr*2+rr.width)):(H.minX=er-Et-(Vr*2+rr.width),H.maxX=er-Et);var ur=rr.height/2,Mr=D-rr.top-ur,Ir="clip"+a._uid+"commonlabel"+b._id,Gr;if(erTe.hoverinfo!=="none");if(Ne.length===0)return[];var X=a.hoverlabel,j=X.font,ee=Ne[0],fe=((n==="x unified"?ee.xa:ee.ya).unifiedhovertitle||{}).text,ie=fe?Ht.hovertemplateString({data:n==="x unified"?[{xa:ee.xa,x:ee.xVal}]:[{ya:ee.ya,y:ee.yVal}],fallback:ee.trace.hovertemplatefallback,locale:a._d3locale,template:fe}):M,ue={showlegend:!0,legend:{title:{text:ie,font:j},font:j,bgcolor:X.bgcolor,bordercolor:X.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},K={font:j};o0e(ue,K,t._fullData);var we=K.legend;we.entries=[];for(var se=0;se=0?Ae=De:Oe+ve=0?Ae=Oe:Ue+ve=0?Xe=Be:Ge+me=0?Xe=Ge:oe+me=0,(Ne.idealAlign==="top"||!ct)&&Ot?(cr-=Mr/2,Ne.anchor="end"):ct?(cr+=Mr/2,Ne.anchor="start"):Ne.anchor="middle",Ne.crossPos=cr;else{if(Ne.pos=cr,ct=Ke+ur/2+qt<=P,Ot=Ke-ur/2-qt>=0,(Ne.idealAlign==="left"||!ct)&&Ot)Ke-=ur/2,Ne.anchor="end";else if(ct)Ke+=ur/2,Ne.anchor="start";else{Ne.anchor="middle";var gt=qt/2,wa=Ke+gt-P,Zt=Ke-gt;wa>0&&(Ke-=wa),Zt<0&&(Ke+=-Zt)}Ne.crossPos=Ke}Ie.attr("text-anchor",Ne.anchor),de&&ne.attr("text-anchor",Ne.anchor),Te.attr("transform",L5(Ke,cr)+(i?t0e(AD):""))}),{hoverLabels:dr,commonLabelBoundingBox:H}}function bD(e,r,t,a,n,i){var c,v;var o="",l="";e.nameOverride!==void 0&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=Ht.templateString(e.name,e.trace._meta)),o=wD(e.name,e.nameLength));var s=t.charAt(0),u=s==="x"?"y":"x";e.zLabel!==void 0?(e.xLabel!==void 0&&(l+="x: "+e.xLabel+"
"),e.yLabel!==void 0&&(l+="y: "+e.yLabel+"
"),e.trace.type!=="choropleth"&&e.trace.type!=="choroplethmapbox"&&e.trace.type!=="choroplethmap"&&(l+=(l?"z: ":"")+e.zLabel)):r&&e[s+"Label"]===n?l=e[u+"Label"]||"":e.xLabel===void 0?e.yLabel!==void 0&&e.trace.type!=="scattercarpet"&&(l=e.yLabel):e.yLabel===void 0?l=e.xLabel:l="("+e.xLabel+", "+e.yLabel+")",(e.text||e.text===0)&&!Array.isArray(e.text)&&(l+=(l?"
":"")+e.text),e.extraText!==void 0&&(l+=(l?"
":"")+e.extraText),i&&l===""&&!e.hovertemplate&&(o===""&&i.remove(),l=o),(v=(c=e.trace)==null?void 0:c.hoverlabel)!=null&&v.split&&(e.hovertemplate="");let{hovertemplate:f=!1}=e;if(f){let d=e.hovertemplateLabels||e;e[s+"Label"]!==n&&(d[s+"other"]=d[s+"Val"],d[s+"otherLabel"]=d[s+"Label"]),l=Ht.hovertemplateString({data:[e.eventData[0]||{},e.trace._meta],fallback:e.trace.hovertemplatefallback,labels:d,locale:a._d3locale,template:f}),l=l.replace(h0e,(p,y)=>(o=wD(y,e.nameLength),""))}return[l,o]}function d0e(e,r,t,a){var n=r?"xa":"ya",i=r?"ya":"xa",o=0,l=1,s=e.size(),u=new Array(s),f=0,c=a.minX,v=a.maxX,d=a.minY,p=a.maxY,y=function(G){return G*t._invScaleX},m=function(G){return G*t._invScaleY};e.each(function(G){var Y=G[n],V=G[i],H=Y._id.charAt(0)==="x",X=Y.range;f===0&&X&&X[0]>X[1]!==H&&(l=-1);var j=0,ee=H?t.width:t.height;if(t.hovermode==="x"||t.hovermode==="y"){var fe=SD(G,r),ie=G.anchor,ue=ie==="end"?-1:1,K,we;if(ie==="middle")K=G.crossPos+(H?m(fe.y-G.by/2):y(G.bx/2+G.tx2width/2)),we=K+(H?m(G.by):y(G.bx));else if(H)K=G.crossPos+m(Et+fe.y)-m(G.by/2-Et),we=K+m(G.by);else{var se=y(ue*Et+fe.x),ce=se+y(ue*G.bx);K=G.crossPos+Math.min(se,ce),we=G.crossPos+Math.max(se,ce)}H?d!==void 0&&p!==void 0&&Math.min(we,p)-Math.max(K,d)>1&&(V.side==="left"?(j=V._mainLinePosition,ee=t.width):ee=V._mainLinePosition):c!==void 0&&v!==void 0&&Math.min(we,v)-Math.max(K,c)>1&&(V.side==="top"?(j=V._mainLinePosition,ee=t.height):ee=V._mainLinePosition)}u[f++]=[{datum:G,traceIndex:G.trace.index,dp:0,pos:G.pos,posref:G.posref,size:G.by*(H?s0e:1)/2,pmin:j,pmax:ee}]}),u.sort(function(G,Y){return G[0].posref-Y[0].posref||l*(Y[0].traceIndex-G[0].traceIndex)});var x,T,_,b,w,k,M;function q(G){var Y=G[0],V=G[G.length-1];if(T=Y.pmin-Y.pos-Y.dp+Y.size,_=V.pos+V.dp+V.size-Y.pmax,T>.01){for(w=G.length-1;w>=0;w--)G[w].dp+=T;x=!1}if(!(_<.01)){if(T<-.01){for(w=G.length-1;w>=0;w--)G[w].dp-=_;x=!1}if(x){var H=0;for(b=0;bY.pmax&&H++;for(b=G.length-1;b>=0&&!(H<=0);b--)k=G[b],k.pos>Y.pmax-1&&(k.del=!0,H--);for(b=0;b=0;w--)G[w].dp-=_;for(b=G.length-1;b>=0&&!(H<=0);b--)k=G[b],k.pos+k.dp+k.size>Y.pmax&&(k.del=!0,H--)}}}for(;!x&&o<=s;){for(o++,x=!0,b=0;b.01){for(w=D.length-1;w>=0;w--)D[w].dp+=T;for(E.push.apply(E,D),u.splice(b+1,1),M=0,w=E.length-1;w>=0;w--)M+=E[w].dp;for(_=M/E.length,w=E.length-1;w>=0;w--)E[w].dp-=_;x=!1}else b++}u.forEach(q)}for(b=u.length-1;b>=0;b--){var z=u[b];for(w=z.length-1;w>=0;w--){var I=z[w],B=I.datum;B.offset=I.dp,B.del=I.del}}}function SD(e,r){var t=0,a=e.offset;return r&&(a*=-f0e,t=e.offset*u0e),{x:t,y:a}}function p0e(e){var r={start:1,end:-1,middle:0}[e.anchor],t=r*(Et+Vr),a=t+r*(e.txwidth+Vr),n=e.anchor==="middle";return n&&(t-=e.tx2width/2,a+=e.txwidth/2+Vr),{alignShift:r,textShiftX:t,text2ShiftX:a}}function qD(e,r,t,a){var n=function(o){return o*t},i=function(o){return o*a};e.each(function(o){var l=Su.select(this);if(o.del)return l.remove();var s=l.select("text.nums"),u=o.anchor,f=u==="end"?-1:1,c=p0e(o),v=SD(o,r),d=v.x,p=v.y,y=u==="middle",m="hoverlabel"in o.trace?o.trace.hoverlabel.showarrow:!0,x;y?x="M-"+n(o.bx/2+o.tx2width/2)+","+i(p-o.by/2)+"h"+n(o.bx)+"v"+i(o.by)+"h-"+n(o.bx)+"Z":m?x="M0,0L"+n(f*Et+d)+","+i(Et+p)+"v"+i(o.by/2-Et)+"h"+n(f*o.bx)+"v-"+i(o.by)+"H"+n(f*Et+d)+"V"+i(p-Et)+"Z":x="M"+n(f*Et+d)+","+i(p-o.by/2)+"h"+n(f*o.bx)+"v"+i(o.by)+"h"+n(-f*o.bx)+"Z",l.select("path").attr("d",x);var T=d+c.textShiftX,_=p+o.ty0-o.by/2+Vr,b=o.textAlign||"auto";b!=="auto"&&(b==="left"&&u!=="start"?(s.attr("text-anchor","start"),T=y?-o.bx/2-o.tx2width/2+Vr:-o.bx-Vr):b==="right"&&u!=="end"&&(s.attr("text-anchor","end"),T=y?o.bx/2-o.tx2width/2-Vr:o.bx+Vr)),s.call(bi.positionText,n(T),i(_)),o.tx2width&&(l.select("text.name").call(bi.positionText,n(c.text2ShiftX+c.alignShift*Vr+d),i(p+o.ty0-o.by/2+Vr)),l.select("rect").call(Io.setRect,n(c.text2ShiftX+(c.alignShift-1)*o.tx2width/2+d),i(p-o.by/2-1),n(o.tx2width),i(o.by+2)))})}function y0e(e,r){var t=e.index,a=e.trace||{},n=e.cd[0],i=e.cd[t]||{};function o(v){return v||ml(v)&&v===0}var l=Array.isArray(t)?function(v,d){var p=Ht.castOption(n,t,v);return o(p)?p:Ht.extractOption({},a,"",d)}:function(v,d){return Ht.extractOption(i,a,v,d)};function s(v,d,p){var y=l(d,p);o(y)&&(e[v]=y)}if(s("hoverinfo","hi","hoverinfo"),s("bgcolor","hbg","hoverlabel.bgcolor"),s("borderColor","hbc","hoverlabel.bordercolor"),s("fontFamily","htf","hoverlabel.font.family"),s("fontSize","hts","hoverlabel.font.size"),s("fontColor","htc","hoverlabel.font.color"),s("fontWeight","htw","hoverlabel.font.weight"),s("fontStyle","hty","hoverlabel.font.style"),s("fontVariant","htv","hoverlabel.font.variant"),s("nameLength","hnl","hoverlabel.namelength"),s("textAlign","hta","hoverlabel.align"),e.posref=r==="y"||r==="closest"&&a.orientation==="h"?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=Ht.constrain(e.x0,0,e.xa._length),e.x1=Ht.constrain(e.x1,0,e.xa._length),e.y0=Ht.constrain(e.y0,0,e.ya._length),e.y1=Ht.constrain(e.y1,0,e.ya._length),e.xLabelVal!==void 0&&(e.xLabel="xLabel"in e?e.xLabel:zo.hoverLabelText(e.xa,e.xLabelVal,a.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),e.yLabelVal!==void 0&&(e.yLabel="yLabel"in e?e.yLabel:zo.hoverLabelText(e.ya,e.yLabelVal,a.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),e.zLabelVal!==void 0&&e.zLabel===void 0&&(e.zLabel=String(e.zLabelVal)),!isNaN(e.xerr)&&!(e.xa.type==="log"&&e.xerr<=0)){var u=zo.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;e.xerrneg!==void 0?e.xLabel+=" +"+u+" / -"+zo.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xB1 "+u,r==="x"&&(e.distance+=1)}if(!isNaN(e.yerr)&&!(e.ya.type==="log"&&e.yerr<=0)){var f=zo.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;e.yerrneg!==void 0?e.yLabel+=" +"+f+" / -"+zo.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xB1 "+f,r==="y"&&(e.distance+=1)}var c=e.hoverinfo||e.trace.hoverinfo;return c&&c!=="all"&&(c=Array.isArray(c)?c:c.split("+"),c.indexOf("x")===-1&&(e.xLabel=void 0),c.indexOf("y")===-1&&(e.yLabel=void 0),c.indexOf("z")===-1&&(e.zLabel=void 0),c.indexOf("text")===-1&&(e.text=void 0),c.indexOf("name")===-1&&(e.name=void 0)),e}function xD(e,r,t){var a=t.container,n=t.fullLayout,i=n._size,o=t.event,l=!!r.hLinePoint,s=!!r.vLinePoint,u,f;if(a.selectAll(".spikeline").remove(),!!(s||l)){var c=ka.combine(n.plot_bgcolor,n.paper_bgcolor);if(l){var v=r.hLinePoint,d,p;u=v&&v.xa,f=v&&v.ya;var y=f.spikesnap;y==="cursor"?(d=o.pointerX,p=o.pointerY):(d=u._offset+v.x,p=f._offset+v.y);var m=yD.readability(v.color,c)<1.5?ka.contrast(c):v.color,x=f.spikemode,T=f.spikethickness,_=f.spikecolor||m,b=zo.getPxPosition(e,f),w,k;if(x.indexOf("toaxis")!==-1||x.indexOf("across")!==-1){if(x.indexOf("toaxis")!==-1&&(w=b,k=d),x.indexOf("across")!==-1){var M=f._counterDomainMin,q=f._counterDomainMax;f.anchor==="free"&&(M=Math.min(M,f.position),q=Math.max(q,f.position)),w=i.l+M*i.w,k=i.l+q*i.w}a.insert("line",":first-child").attr({x1:w,x2:k,y1:p,y2:p,"stroke-width":T,stroke:_,"stroke-dasharray":Io.dashStyle(f.spikedash,T)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:w,x2:k,y1:p,y2:p,"stroke-width":T+2,stroke:c}).classed("spikeline",!0).classed("crisp",!0)}x.indexOf("marker")!==-1&&a.insert("circle",":first-child").attr({cx:b+(f.side!=="right"?T:-T),cy:p,r:T,fill:_}).classed("spikeline",!0)}if(s){var E=r.vLinePoint,D,P;u=E&&E.xa,f=E&&E.ya;var R=u.spikesnap;R==="cursor"?(D=o.pointerX,P=o.pointerY):(D=u._offset+E.x,P=f._offset+E.y);var z=yD.readability(E.color,c)<1.5?ka.contrast(c):E.color,I=u.spikemode,B=u.spikethickness,G=u.spikecolor||z,Y=zo.getPxPosition(e,u),V,H;if(I.indexOf("toaxis")!==-1||I.indexOf("across")!==-1){if(I.indexOf("toaxis")!==-1&&(V=Y,H=P),I.indexOf("across")!==-1){var X=u._counterDomainMin,j=u._counterDomainMax;u.anchor==="free"&&(X=Math.min(X,u.position),j=Math.max(j,u.position)),V=i.t+(1-j)*i.h,H=i.t+(1-X)*i.h}a.insert("line",":first-child").attr({x1:D,x2:D,y1:V,y2:H,"stroke-width":B,stroke:G,"stroke-dasharray":Io.dashStyle(u.spikedash,B)}).classed("spikeline",!0).classed("crisp",!0),a.insert("line",":first-child").attr({x1:D,x2:D,y1:V,y2:H,"stroke-width":B+2,stroke:c}).classed("spikeline",!0).classed("crisp",!0)}I.indexOf("marker")!==-1&&a.insert("circle",":first-child").attr({cx:D,cy:Y-(u.side!=="top"?B:-B),r:B,fill:G}).classed("spikeline",!0)}}}function m0e(e,r,t){if(!t||t.length!==e._hoverdata.length)return!0;for(var a=t.length-1;a>=0;a--){var n=t[a],i=e._hoverdata[a];if(n.curveNumber!==i.curveNumber||String(n.pointNumber)!==String(i.pointNumber)||String(n.pointNumbers)!==String(i.pointNumbers)||n.binNumber!==i.binNumber)return!0}return!1}function _D(e,r){return!r||r.vLinePoint!==e._spikepoints.vLinePoint||r.hLinePoint!==e._spikepoints.hLinePoint}function wD(e,r){return bi.plainText(e||"",{len:r,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function g0e(e,r){for(var t=r.charAt(0),a=[],n=[],i=[],o=0;oe.offsetTop+e.clientTop,CD=e=>e.offsetLeft+e.clientLeft;function yc(e,r){var t=e._fullLayout,a=r.getBoundingClientRect(),n=a.left,i=a.top,o=n+a.width,l=i+a.height,s=Ht.apply3DTransform(t._invTransform)(n,i),u=Ht.apply3DTransform(t._invTransform)(o,l),f=s[0],c=s[1],v=u[0],d=u[1];return{x:f,y:c,width:v-f,height:d-c,top:Math.min(c,d),left:Math.min(f,v),right:Math.max(f,v),bottom:Math.max(c,d)}}});var ly=N((HRe,ED)=>{"use strict";var b0e=Ee(),x0e=Tr(),_0e=Eo().isUnifiedHover;ED.exports=function(r,t,a,n){n=n||{};var i=t.legend;function o(l){n.font[l]||(n.font[l]=i?t.legend.font[l]:t.font[l])}t&&_0e(t.hovermode)&&(n.font||(n.font={}),o("size"),o("family"),o("color"),o("weight"),o("style"),o("variant"),i?(n.bgcolor||(n.bgcolor=x0e.combine(t.legend.bgcolor,t.paper_bgcolor)),n.bordercolor||(n.bordercolor=t.legend.bordercolor)):n.bgcolor||(n.bgcolor=t.paper_bgcolor)),a("hoverlabel.bgcolor",n.bgcolor),a("hoverlabel.bordercolor",n.bordercolor),a("hoverlabel.namelength",n.namelength),a("hoverlabel.showarrow",n.showarrow),b0e.coerceFont(a,"hoverlabel.font",n.font),a("hoverlabel.align",n.align)}});var RD=N((URe,DD)=>{"use strict";var w0e=Ee(),T0e=ly(),A0e=Pf();DD.exports=function(r,t){function a(n,i){return w0e.coerce(r,t,A0e,n,i)}T0e(r,t,a)}});var ND=N((GRe,FD)=>{"use strict";var PD=Ee(),M0e=Lp(),k0e=ly();FD.exports=function(r,t,a,n){function i(l,s){return PD.coerce(r,t,M0e,l,s)}var o=PD.extendFlat({},n.hoverlabel);t.hovertemplate&&(o.namelength=-1),k0e(r,t,i,o)}});var R5=N((VRe,ID)=>{"use strict";var S0e=Ee(),q0e=Pf();ID.exports=function(r,t){function a(n,i){return t[n]!==void 0?t[n]:S0e.coerce(r,t,q0e,n,i)}return a("clickmode"),a("hoversubplots"),a("hoveranywhere"),a("clickanywhere"),a("hovermode")}});var BD=N((YRe,OD)=>{"use strict";var zD=Ee(),L0e=Pf(),C0e=R5(),E0e=ly();OD.exports=function(r,t){function a(f,c){return zD.coerce(r,t,L0e,f,c)}var n=C0e(r,t);n&&(a("hoverdistance"),a("spikedistance"));var i=a("dragmode");i==="select"&&a("selectdirection");var o=t._has("mapbox"),l=t._has("map"),s=t._has("geo"),u=t._basePlotModules.length;t.dragmode==="zoom"&&((o||l||s)&&u===1||(o||l)&&s&&u===2)&&(t.dragmode="pan"),E0e(r,t,a),zD.coerceFont(a,"hoverlabel.grouptitlefont",t.hoverlabel.font)}});var GD=N((WRe,UD)=>{"use strict";var P5=Ee(),HD=br();UD.exports=function(r){var t=r.calcdata,a=r._fullLayout;function n(u){return function(f){return P5.coerceHoverinfo({hoverinfo:f},{_module:u._module},a)}}for(var i=0;i{"use strict";var R0e=br(),P0e=D5().hover;VD.exports=function(r,t,a){var n=R0e.getComponentMethod("annotations","onClick")(r,r._hoverdata),i=r._fullLayout;a!==void 0&&P0e(r,t,a,!0);function o(){var s,u,f,c;var l={points:r._hoverdata,event:t};(s=l.xaxes)!=null||(l.xaxes=r._hoverXAxes),(u=l.yaxes)!=null||(l.yaxes=r._hoverYAxes),(f=l.xvals)!=null||(l.xvals=r._hoverXVals),(c=l.yvals)!=null||(l.yvals=r._hoverYVals),r.emit("plotly_click",l)}(r._hoverdata||i.clickanywhere)&&t&&t.target&&(r._hoverdata||(r._hoverdata=[]),n&&n.then?n.then(o):o(),t.stopImmediatePropagation&&t.stopImmediatePropagation())}});var Fn=N((ZRe,ZD)=>{"use strict";var F0e=Sr(),sy=Ee(),N0e=mi(),Rh=Eo(),WD=Pf(),jD=D5();ZD.exports={moduleType:"component",name:"fx",constants:eh(),schema:{layout:WD},attributes:Lp(),layoutAttributes:WD,supplyLayoutGlobalDefaults:RD(),supplyDefaults:ND(),supplyLayoutDefaults:BD(),calc:GD(),getDistanceFunction:Rh.getDistanceFunction,getClosest:Rh.getClosest,inbox:Rh.inbox,quadrature:Rh.quadrature,appendArrayPointValue:Rh.appendArrayPointValue,castHoverOption:z0e,castHoverinfo:O0e,hover:jD.hover,unhover:N0e.unhover,loneHover:jD.loneHover,loneUnhover:I0e,click:YD()};function I0e(e){var r=sy.isD3Selection(e)?e:F0e.select(e);r.selectAll("g.hovertext").remove(),r.selectAll(".spikeline").remove()}function z0e(e,r,t){return sy.castOption(e,r,"hoverlabel."+t)}function O0e(e,r,t){function a(n){return sy.coerceHoverinfo({hoverinfo:n},{_module:e._module},r)}return sy.castOption(e,t,"hoverinfo",a)}});var Lu=N(gl=>{"use strict";gl.selectMode=function(e){return e==="lasso"||e==="select"};gl.drawMode=function(e){return e==="drawclosedpath"||e==="drawopenpath"||e==="drawline"||e==="drawrect"||e==="drawcircle"};gl.openMode=function(e){return e==="drawline"||e==="drawopenpath"};gl.rectMode=function(e){return e==="select"||e==="drawline"||e==="drawrect"||e==="drawcircle"};gl.freeMode=function(e){return e==="lasso"||e==="drawclosedpath"||e==="drawopenpath"};gl.selectingOrDrawing=function(e){return gl.freeMode(e)||gl.rectMode(e)}});var uy=N((JRe,XD)=>{"use strict";XD.exports=function(r){var t=r._fullLayout;t._glcanvas&&t._glcanvas.size()&&t._glcanvas.each(function(a){a.regl&&a.regl.clear({color:!0,depth:!0})})}});var fy=N(($Re,JD)=>{"use strict";JD.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:[""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}});var vy=N((KRe,$D)=>{"use strict";var cy=32;$D.exports={CIRCLE_SIDES:cy,i000:0,i090:cy/4,i180:cy/2,i270:cy/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}});var hy=N((QRe,QD)=>{"use strict";var B0e=Ee().strTranslate;function KD(e,r){switch(e.type){case"log":return e.p2d(r);case"date":return e.p2r(r,0,e.calendar);default:return e.p2r(r)}}function H0e(e,r){switch(e.type){case"log":return e.d2p(r);case"date":return e.r2p(r,0,e.calendar);default:return e.r2p(r)}}function U0e(e){var r=e._id.charAt(0)==="y"?1:0;return function(t){return KD(e,t[r])}}function G0e(e){return B0e(e.xaxis._offset,e.yaxis._offset)}QD.exports={p2r:KD,r2p:H0e,axValue:U0e,getTransform:G0e}});var fs=N(bl=>{"use strict";var V0e=Tx(),tR=vy(),gc=tR.CIRCLE_SIDES,F5=tR.SQRT2,aR=hy(),eR=aR.p2r,rR=aR.r2p,Y0e=[0,3,4,5,6,1,2],W0e=[0,3,4,1,2];bl.writePaths=function(e){var r=e.length;if(!r)return"M0,0Z";for(var t="",a=0;a0&&s{"use strict";var nR=fa(),uR=Lu(),j0e=uR.drawMode,Z0e=uR.openMode,bc=vy(),iR=bc.i000,oR=bc.i090,lR=bc.i180,sR=bc.i270,X0e=bc.cos45,J0e=bc.sin45,fR=hy(),py=fR.p2r,cs=fR.r2p,$0e=rs(),K0e=$0e.clearOutline,yy=fs(),Q0e=yy.readPaths,ede=yy.writePaths,rde=yy.ellipseOver,tde=yy.fixDatesForPaths;function ade(e,r){if(e.length){var t=e[0][0];if(t){var a=r.gd,n=r.isActiveShape,i=r.dragmode,o=(a.layout||{}).shapes||[];if(!j0e(i)&&n!==void 0){var l=a._fullLayout._activeShapeIndex;if(l{"use strict";var nde=Lu(),ide=nde.selectMode,ode=rs(),lde=ode.clearOutline,N5=fs(),sde=N5.readPaths,ude=N5.writePaths,fde=N5.fixDatesForPaths;hR.exports=function(r,t){if(r.length){var a=r[0][0];if(a){var n=a.getAttribute("d"),i=t.gd,o=i._fullLayout.newselection,l=t.plotinfo,s=l.xaxis,u=l.yaxis,f=t.isActiveSelection,c=t.dragmode,v=(i.layout||{}).selections||[];if(!ide(c)&&f!==void 0){var d=i._fullLayout._activeSelectionIndex;if(d{"use strict";dR.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:3},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}});var hs=N(Va=>{"use strict";var Oo=Fh(),pR=Ee(),vs=zr();Va.rangeToShapePosition=function(e){return e.type==="log"?e.r2d:function(r){return r}};Va.shapePositionToRange=function(e){return e.type==="log"?e.d2r:function(r){return r}};Va.decodeDate=function(e){return function(r){return r.replace&&(r=r.replace("_"," ")),e(r)}};Va.encodeDate=function(e){return function(r){return e(r).replace(" ","_")}};Va.extractPathCoords=function(e,r,t){var a=[],n=e.match(Oo.segmentRE);return n.forEach(function(i){var o=r[i.charAt(0)].drawn;if(o!==void 0){var l=i.slice(1).match(Oo.paramRE);if(!(!l||l.length{let l=o.charAt(0),s=n[l].drawn!==void 0;return i+(s?1:0)},0)};Va.getDataToPixel=function(e,r,t,a,n){var i=e._fullLayout._size,o;if(r)if(n==="domain")o=function(s){return r._length*(a?1-s:s)+r._offset};else{var l=Va.shapePositionToRange(r);o=function(s){var u=xl(r,t);return r._offset+r.r2p(l(s,!0))+u},r.type==="date"&&(o=Va.decodeDate(o))}else a?o=function(s){return i.t+i.h*(1-s)}:o=function(s){return i.l+i.w*s};return o};Va.getPixelToData=function(e,r,t,a){var n=e._fullLayout._size,i;if(r)if(a==="domain")i=function(l){var s=(l-r._offset)/r._length;return t?1-s:s};else{var o=Va.rangeToShapePosition(r);i=function(l){return o(r.p2r(l-r._offset))}}else t?i=function(l){return 1-(l-n.t)/n.h}:i=function(l){return(l-n.l)/n.w};return i};Va.roundPositionForSharpStrokeRendering=function(e,r){var t=Math.round(r%2)===1,a=Math.round(e);return t?a+.5:a};Va.makeShapesOptionsAndPlotinfo=function(e,r){var t=e._fullLayout.shapes[r]||{},a=e._fullLayout._plots[t.xref+t.yref],n=!!a;return n?a._hadPlotinfo=!0:(a={},t.xref&&t.xref!=="paper"&&(a.xaxis=e._fullLayout[t.xref+"axis"]),t.yref&&t.yref!=="paper"&&(a.yaxis=e._fullLayout[t.yref+"axis"])),a.xsizemode=t.xsizemode,a.ysizemode=t.ysizemode,a.xanchor=t.xanchor,a.yanchor=t.yanchor,{options:t,plotinfo:a}};Va.makeSelectionsOptionsAndPlotinfo=function(e,r){var t=e._fullLayout.selections[r]||{},a=e._fullLayout._plots[t.xref+t.yref],n=!!a;return n?a._hadPlotinfo=!0:(a={},t.xref&&(a.xaxis=e._fullLayout[t.xref+"axis"]),t.yref&&(a.yaxis=e._fullLayout[t.yref+"axis"])),{options:t,plotinfo:a}};Va.getPathString=function(e,r){let t=r.type,a=vs.getRefType(r.xref),n=vs.getRefType(r.yref),i=e._fullLayout._size;var o,l,s,u,f,c,v,d,p,y,m,x;function T(D,P,R,z){var I;if(D)if(P==="domain")z?I=function(B){return D._offset+D._length*(1-B)}:I=function(B){return D._offset+D._length*B};else{let B=Va.shapePositionToRange(D);I=function(G){return D._offset+D.r2p(B(G,!0))},R==="path"&&D.type==="date"&&(I=Va.decodeDate(I))}else z?I=function(B){return i.t+i.h*(1-B)}:I=function(B){return i.l+i.w*B};return I}if(a==="array"?(v=[],o=r.xref.map(function(D){return vs.getFromId(e,D)}),v=r.xref.map(function(D,P){return T(o[P],vs.getRefType(D),t,!1)})):(o=vs.getFromId(e,r.xref),v=T(o,a,t,!1)),n==="array"?(d=[],l=r.yref.map(function(D){return vs.getFromId(e,D)}),d=r.yref.map(function(D,P){return T(l[P],vs.getRefType(D),t,!0)})):(l=vs.getFromId(e,r.yref),d=T(l,n,t,!0)),t==="path")return cde(r,v,d);if(a==="array")s=xl(o[0],r.x0shift),u=xl(o[1],r.x1shift),p=v[0](r.x0)+s,y=v[1](r.x1)+u;else if(s=xl(o,r.x0shift),u=xl(o,r.x1shift),r.xsizemode==="pixel"){let D=v(r.xanchor);p=D+r.x0+s,y=D+r.x1+u}else p=v(r.x0)+s,y=v(r.x1)+u;if(n==="array")f=xl(l[0],r.y0shift),c=xl(l[1],r.y1shift),m=d[0](r.y0)+f,x=d[1](r.y1)+c;else if(f=xl(l,r.y0shift),c=xl(l,r.y1shift),r.ysizemode==="pixel"){let D=d(r.yanchor);m=D-r.y0+f,x=D-r.y1+c}else m=d(r.y0)+f,x=d(r.y1)+c;if(t==="line")return"M"+p+","+m+"L"+y+","+x;if(t==="rect")return"M"+p+","+m+"H"+y+"V"+x+"H"+p+"Z";var _=(p+y)/2,b=(m+x)/2,w=Math.abs(_-p),k=Math.abs(b-m),M="A"+w+","+k,q=_+w+","+b,E=_+","+(b-k);return"M"+q+M+" 0 1,1 "+E+M+" 0 0,1 "+q+"Z"};function cde(e,r,t){let a=e.path,n=e.xsizemode,i=e.ysizemode,o=e.xanchor,l=e.yanchor,s=Array.isArray(e.xref),u=Array.isArray(e.yref);var f=0,c=0;return a.replace(Oo.segmentRE,function(v){var d=0,p=v.charAt(0),y=Oo.paramIsX[p],m=Oo.paramIsY[p],x=Oo.numParams[p];let T=y.drawn!==void 0,_=m.drawn!==void 0,b=s?r[f]:r,w=u?t[c]:t;var k=v.slice(1).replace(Oo.paramRE,function(M){return y[d]?n==="pixel"?M=b(o)+Number(M):M=b(M):m[d]&&(i==="pixel"?M=w(l)-Number(M):M=w(M)),d++,d>x&&(M="X"),M});return d>x&&(k=k.replace(/[\s,]*X.*/,""),pR.log("Ignoring extra params in segment "+v)),T&&f++,_&&c++,p+k})}function xl(e,r){r=r||0;var t=0;return r&&e&&(e.type==="category"||e.type==="multicategory")&&(t=(e.r2p(1)-e.r2p(0))*r),t}});var O5=N((iPe,gR)=>{"use strict";var vde=Ee(),Bo=zr(),yR=Aa(),mR=Yr(),hde=fs().readPaths,z5=hs(),dde=z5.getPathString,Nh=zp(),pde=Ha().FROM_TL;gR.exports=function(r,t,a,n){if(n.selectAll(".shape-label").remove(),!!(a.label.text||a.label.texttemplate)){var i;if(a.label.texttemplate){var o={};if(a.type!=="path"){var l=Bo.getFromId(r,a.xref),s=Bo.getFromId(r,a.yref);let j=Array.isArray(a.xref),ee=Array.isArray(a.yref);for(var u in Nh){var f=typeof Nh[u]=="function",c=!j||Nh.simpleXVariables.includes(u),v=!ee||Nh.simpleYVariables.includes(u);if(f&&c&&v){var d=Nh[u](a,l,s);d!==void 0&&(o[u]=d)}}}i=vde.texttemplateStringForShapes({data:[o],fallback:a.label.texttemplatefallback,locale:r._fullLayout._d3locale,template:a.label.texttemplate})}else i=a.label.text;var p={"data-index":t},y=a.label.font,m={"data-notex":1},x=n.append("g").attr(p).classed("shape-label",!0),T=x.append("text").attr(m).classed("shape-label-text",!0).text(i),_,b,w,k;if(a.path){var M=dde(r,a),q=hde(M,r);_=1/0,w=1/0,b=-1/0,k=-1/0;for(var E=0;E=e?n=r-a:n=a-r,-180/Math.PI*Math.atan2(n,i)}function mde(e,r,t,a,n,i,o){var l=n.label.textposition,s=n.label.textangle,u=n.label.padding,f=n.type,c=Math.PI/180*i,v=Math.sin(c),d=Math.cos(c),p=n.label.xanchor,y=n.label.yanchor,m,x,T,_;if(f==="line"){l==="start"?(m=e,x=r):l==="end"?(m=t,x=a):(m=(e+t)/2,x=(r+a)/2),p==="auto"&&(l==="start"?s==="auto"?t>e?p="left":te?p="right":te?p="right":te?p="left":t{"use strict";var gde=Ee(),bde=gde.strTranslate,bR=mi(),wR=Lu(),xde=wR.drawMode,TR=wR.selectMode,AR=br(),xR=Tr(),by=vy(),_de=by.i000,wde=by.i090,Tde=by.i180,Ade=by.i270,Mde=rs(),MR=Mde.clearOutlineControllers,H5=fs(),gy=H5.pointsOnRectangle,B5=H5.pointsOnEllipse,kde=H5.writePaths,Sde=my().newShapes,qde=my().createShapeObj,Lde=I5(),Cde=O5();kR.exports=function e(r,t,a,n){n||(n=0);var i=a.gd;function o(){e(r,t,a,n++),(B5(r[0])||a.hasText)&&l({redrawing:!0})}function l(Y){var V={};a.isActiveShape!==void 0&&(a.isActiveShape=!1,V=Sde(t,a)),a.isActiveSelection!==void 0&&(a.isActiveSelection=!1,V=Lde(t,a),i._fullLayout._reselect=!0),Object.keys(V).length&&AR.call((Y||{}).redrawing?"relayout":"_guiRelayout",i,V)}var s=i._fullLayout,u=s._zoomlayer,f=a.dragmode,c=xde(f),v=TR(f);(c||v)&&(i._fullLayout._outlining=!0),MR(i),t.attr("d",kde(r));var d,p,y,m,x;if(!n&&(a.isActiveShape||a.isActiveSelection)){x=Ede([],r);var T=u.append("g").attr("class","outline-controllers");D(T),G()}if(c&&a.hasText){var _=u.select(".label-temp"),b=qde(t,a,a.dragmode);Cde(i,"label-temp",b,_)}function w(Y){y=+Y.srcElement.getAttribute("data-i"),m=+Y.srcElement.getAttribute("data-j"),d[y][m].moveFn=k}function k(Y,V){if(r.length){var H=x[y][m][1],X=x[y][m][2],j=r[y],ee=j.length;if(gy(j)){var fe=Y,ie=V;if(a.isActiveSelection){var ue=_R(j,m);ue[1]===j[m][1]?ie=0:fe=0}for(var K=0;K1&&!(Y.length===2&&Y[1][0]==="Z")&&(m===0&&(Y[0][0]="M"),r[y]=Y,o(),l())}}function E(Y,V){if(Y===2){y=+V.srcElement.getAttribute("data-i"),m=+V.srcElement.getAttribute("data-j");var H=r[y];!gy(H)&&!B5(H)&&q()}}function D(Y){d=[];for(var V=0;V{"use strict";var Rde=Sr(),ER=br(),G5=Ee(),Cu=zr(),Pde=fs().readPaths,Fde=xy(),wy=O5(),DR=rs().clearOutlineControllers,U5=Tr(),Ty=Yr(),Nde=wt().arrayEditor,SR=mi(),qR=ss(),Eu=Fh(),Nn=hs(),V5=Nn.getPathString;FR.exports={draw:Y5,drawOne:RR,eraseActiveShape:Bde,drawLabel:wy};function Y5(e){var r=e._fullLayout;r._shapeUpperLayer.selectAll("path").remove(),r._shapeLowerLayer.selectAll("path").remove(),r._shapeUpperLayer.selectAll("text").remove(),r._shapeLowerLayer.selectAll("text").remove();for(var t in r._plots){var a=r._plots[t].shapelayer;a&&(a.selectAll("path").remove(),a.selectAll("text").remove())}for(var n=0;nCu.getFromId(e,v)).filter(Boolean);if(!u.length)return s?[a.t,a.t+a.h]:[a.l,a.l+a.w];let f=u.map(function(v){return v._offset}),c=u.map(function(v){return v._offset+v._length});return[Math.min(...f),Math.max(...c)]}let i=n(r,!1),o=n(t,!0);return{x:i[0],y:o[0],width:i[1]-i[0],height:o[1]-o[0]}}function zde(e,r,t,a,n,i){var o=10,l=10,s=t.xsizemode==="pixel",u=t.ysizemode==="pixel",f=t.type==="line",c=t.type==="path",v=i.modifyItem,d,p,y,m,x,T,_,b,w,k,M,q,E,D,P,R=Rde.select(r.node().parentNode),z=Cu.getFromId(e,t.xref),I=Cu.getRefType(t.xref),B=Cu.getFromId(e,t.yref),G=Cu.getRefType(t.yref),Y=t.x0shift,V=t.x1shift,H=t.y0shift,X=t.y1shift,j=function(Pe,Le){var ze=Nn.getDataToPixel(e,z,Le,!1,I);return ze(Pe)},ee=function(Pe,Le){var ze=Nn.getDataToPixel(e,B,Le,!0,G);return ze(Pe)},fe=Nn.getPixelToData(e,z,!1,I),ie=Nn.getPixelToData(e,B,!0,G),ue=se(),K={element:ue.node(),gd:e,prepFn:ye,doneFn:W,clickFn:Q},we;SR.init(K),ue.node().onmousemove=he;function se(){return f?ce():r}function ce(){var Pe=10,Le=Math.max(t.line.width,Pe),ze=n.append("g").attr("data-index",a).attr("drag-helper",!0);ze.append("path").attr("d",r.attr("d")).style({cursor:"move","stroke-width":Le,"stroke-opacity":"0"});var Be={"fill-opacity":"0"},Ge=Math.max(Le/2,Pe);return ze.append("circle").attr({"data-line-point":"start-point",cx:s?j(t.xanchor)+t.x0:j(t.x0,Y),cy:u?ee(t.yanchor)-t.y0:ee(t.y0,H),r:Ge}).style(Be).classed("cursor-grab",!0),ze.append("circle").attr({"data-line-point":"end-point",cx:s?j(t.xanchor)+t.x1:j(t.x1,V),cy:u?ee(t.yanchor)-t.y1:ee(t.y1,X),r:Ge}).style(Be).classed("cursor-grab",!0),ze}function he(Pe){if(_y(e)){we=null;return}if(f)Pe.target.tagName==="path"?we="move":we=Pe.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var Le=K.element.getBoundingClientRect(),ze=Le.right-Le.left,Be=Le.bottom-Le.top,Ge=Pe.clientX-Le.left,De=Pe.clientY-Le.top,Oe=!c&&ze>o&&Be>l&&!Pe.shiftKey?SR.getCursor(Ge/ze,1-De/Be):"move";qR(r,Oe),we=Oe.split("-")[0]}}function ye(Pe){_y(e)||(s&&(x=j(t.xanchor)),u&&(T=ee(t.yanchor)),t.type==="path"?P=t.path:(d=s?t.x0:j(t.x0),p=u?t.y0:ee(t.y0),y=s?t.x1:j(t.x1),m=u?t.y1:ee(t.y1)),dm?(_=p,M="y0",b=m,q="y1"):(_=m,M="y1",b=p,q="y0"),he(Pe),ve(n,t),Ce(r,t,e),K.moveFn=we==="move"?Z:le,K.altKey=Pe.altKey)}function W(){_y(e)||(qR(r),me(n),PR(r,e,t),ER.call("_guiRelayout",e,i.getUpdateObj()))}function Q(){_y(e)||me(n)}function Z(Pe,Le){if(t.type==="path"){var ze=function(De){return De},Be=ze,Ge=ze;s?v("xanchor",t.xanchor=fe(x+Pe)):(Be=function(Oe){return fe(j(Oe)+Pe)},z&&z.type==="date"&&(Be=Nn.encodeDate(Be))),u?v("yanchor",t.yanchor=ie(T+Le)):(Ge=function(Oe){return ie(ee(Oe)+Le)},B&&B.type==="date"&&(Ge=Nn.encodeDate(Ge))),v("path",t.path=LR(P,Be,Ge))}else s?v("xanchor",t.xanchor=fe(x+Pe)):(v("x0",t.x0=fe(d+Pe)),v("x1",t.x1=fe(y+Pe))),u?v("yanchor",t.yanchor=ie(T+Le)):(v("y0",t.y0=ie(p+Le)),v("y1",t.y1=ie(m+Le)));r.attr("d",V5(e,t)),ve(n,t),wy(e,a,t,R)}function le(Pe,Le){if(c){var ze=function(Ze){return Ze},Be=ze,Ge=ze;s?v("xanchor",t.xanchor=fe(x+Pe)):(Be=function(lr){return fe(j(lr)+Pe)},z&&z.type==="date"&&(Be=Nn.encodeDate(Be))),u?v("yanchor",t.yanchor=ie(T+Le)):(Ge=function(lr){return ie(ee(lr)+Le)},B&&B.type==="date"&&(Ge=Nn.encodeDate(Ge))),v("path",t.path=LR(P,Be,Ge))}else if(f){if(we==="resize-over-start-point"){var De=d+Pe,Oe=u?p-Le:p+Le;v("x0",t.x0=s?De:fe(De)),v("y0",t.y0=u?Oe:ie(Oe))}else if(we==="resize-over-end-point"){var Ue=y+Pe,oe=u?m-Le:m+Le;v("x1",t.x1=s?Ue:fe(Ue)),v("y1",t.y1=u?oe:ie(oe))}}else{var Ae=function(Ze){return we.indexOf(Ze)!==-1},Xe=Ae("n"),dr=Ae("s"),Ne=Ae("w"),Te=Ae("e"),qe=Xe?_+Le:_,He=dr?b+Le:b,Je=Ne?w+Pe:w,We=Te?k+Pe:k;u&&(Xe&&(qe=_-Le),dr&&(He=b-Le)),(!u&&He-qe>l||u&&qe-He>l)&&(v(M,t[M]=u?qe:ie(qe)),v(q,t[q]=u?He:ie(He))),We-Je>o&&(v(E,t[E]=s?Je:fe(Je)),v(D,t[D]=s?We:fe(We)))}r.attr("d",V5(e,t)),ve(n,t),wy(e,a,t,R)}function ve(Pe,Le){(s||u)&&ze();function ze(){var Be=Le.type!=="path",Ge=Pe.selectAll(".visual-cue").data([0]),De=1;Ge.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":De}).classed("visual-cue",!0);var Oe=j(s?Le.xanchor:G5.midRange(Be?[Le.x0,Le.x1]:Nn.extractPathCoords(Le.path,Eu.paramIsX))),Ue=ee(u?Le.yanchor:G5.midRange(Be?[Le.y0,Le.y1]:Nn.extractPathCoords(Le.path,Eu.paramIsY)));if(Oe=Nn.roundPositionForSharpStrokeRendering(Oe,De),Ue=Nn.roundPositionForSharpStrokeRendering(Ue,De),s&&u){var oe="M"+(Oe-1-De)+","+(Ue-1-De)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Ge.attr("d",oe)}else if(s){var Ae="M"+(Oe-1-De)+","+(Ue-9-De)+"v18 h2 v-18 Z";Ge.attr("d",Ae)}else{var Xe="M"+(Oe-9-De)+","+(Ue-1-De)+"h18 v2 h-18 Z";Ge.attr("d",Xe)}}}function me(Pe){Pe.selectAll(".visual-cue").remove()}function Ce(Pe,Le,ze){var Be=Le.xref,Ge=Le.yref,De=Cu.getFromId(ze,Be),Oe=Cu.getFromId(ze,Ge),Ue="";Be!=="paper"&&!De.autorange&&(Ue+=Be),Ge!=="paper"&&!Oe.autorange&&(Ue+=Ge),Ty.setClipUrl(Pe,Ue?"clip"+ze._fullLayout._uid+Ue:null,ze)}}function LR(e,r,t){return e.replace(Eu.segmentRE,function(a){var n=0,i=a.charAt(0),o=Eu.paramIsX[i],l=Eu.paramIsY[i],s=Eu.numParams[i],u=a.slice(1).replace(Eu.paramRE,function(f){return n>=s||(o[n]?f=r(f):l[n]&&(f=t(f)),n++),f});return i+u})}function Ode(e,r){if(Ay(e)){var t=r.node(),a=+t.getAttribute("data-index");if(a>=0){if(a===e._fullLayout._activeShapeIndex){CR(e);return}e._fullLayout._activeShapeIndex=a,e._fullLayout._deactivateShape=CR,Y5(e)}}}function CR(e){if(Ay(e)){var r=e._fullLayout._activeShapeIndex;r>=0&&(DR(e),delete e._fullLayout._activeShapeIndex,Y5(e))}}function Bde(e){if(Ay(e)){DR(e);var r=e._fullLayout._activeShapeIndex,t=(e.layout||{}).shapes||[];if(r{"use strict";var xi=br(),NR=aa(),IR=fa(),jr=fy(),Hde=My().eraseActiveShape,ky=Ee(),Hr=ky._,Zr=VR.exports={};Zr.toImage={name:"toImage",title:function(e){var r=e._context.toImageButtonOptions||{},t=r.format||"png";return t==="png"?Hr(e,"Download plot as a PNG"):Hr(e,"Download plot")},icon:jr.camera,click:function(e){var r=e._context.toImageButtonOptions,t={format:r.format||"png"};ky.notifier(Hr(e,"Taking snapshot - this may take a few seconds"),"long",e),["filename","width","height","scale"].forEach(function(a){a in r&&(t[a]=r[a])}),xi.call("downloadImage",e,t).then(function(a){ky.notifier(Hr(e,"Snapshot succeeded")+" - "+a,"long",e)}).catch(function(){ky.notifier(Hr(e,"Sorry, there was a problem downloading your snapshot!"),"long",e)})}};Zr.sendDataToCloud={name:"sendDataToCloud",title:function(e){return Hr(e,"Edit in Chart Studio")},icon:jr.disk,click:function(e){NR.sendDataToCloud(e)}};Zr.editInChartStudio={name:"editInChartStudio",title:function(e){return Hr(e,"Edit in Chart Studio")},icon:jr.pencil,click:function(e){NR.sendDataToCloud(e)}};Zr.zoom2d={name:"zoom2d",_cat:"zoom",title:function(e){return Hr(e,"Zoom")},attr:"dragmode",val:"zoom",icon:jr.zoombox,click:un};Zr.pan2d={name:"pan2d",_cat:"pan",title:function(e){return Hr(e,"Pan")},attr:"dragmode",val:"pan",icon:jr.pan,click:un};Zr.select2d={name:"select2d",_cat:"select",title:function(e){return Hr(e,"Box Select")},attr:"dragmode",val:"select",icon:jr.selectbox,click:un};Zr.lasso2d={name:"lasso2d",_cat:"lasso",title:function(e){return Hr(e,"Lasso Select")},attr:"dragmode",val:"lasso",icon:jr.lasso,click:un};Zr.drawclosedpath={name:"drawclosedpath",title:function(e){return Hr(e,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:jr.drawclosedpath,click:un};Zr.drawopenpath={name:"drawopenpath",title:function(e){return Hr(e,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:jr.drawopenpath,click:un};Zr.drawline={name:"drawline",title:function(e){return Hr(e,"Draw line")},attr:"dragmode",val:"drawline",icon:jr.drawline,click:un};Zr.drawrect={name:"drawrect",title:function(e){return Hr(e,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:jr.drawrect,click:un};Zr.drawcircle={name:"drawcircle",title:function(e){return Hr(e,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:jr.drawcircle,click:un};Zr.eraseshape={name:"eraseshape",title:function(e){return Hr(e,"Erase active shape")},icon:jr.eraseshape,click:Hde};Zr.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(e){return Hr(e,"Zoom in")},attr:"zoom",val:"in",icon:jr.zoom_plus,click:un};Zr.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(e){return Hr(e,"Zoom out")},attr:"zoom",val:"out",icon:jr.zoom_minus,click:un};Zr.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(e){return Hr(e,"Autoscale")},attr:"zoom",val:"auto",icon:jr.autoscale,click:un};Zr.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(e){return Hr(e,"Reset axes")},attr:"zoom",val:"reset",icon:jr.home,click:un};Zr.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(e){return Hr(e,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:jr.tooltip_basic,gravity:"ne",click:un};Zr.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(e){return Hr(e,"Compare data on hover")},attr:"hovermode",val:function(e){return e._fullLayout._isHoriz?"y":"x"},icon:jr.tooltip_compare,gravity:"ne",click:un};function un(e,r){var t=r.currentTarget,a=t.getAttribute("data-attr"),n=t.getAttribute("data-val")||!0,i=e._fullLayout,o={},l=IR.list(e,null,!0),s=i._cartesianSpikesEnabled,u,f;if(a==="zoom"){var c=n==="in"?.5:2,v=(1+c)/2,d=(1-c)/2,p,y;for(f=0;f{"use strict";var YR=Z5(),Vde=Object.keys(YR),WR=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],jR=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(WR),_c=[],Yde=function(e){if(jR.indexOf(e._cat||e.name)===-1){var r=e.name,t=(e._cat||e.name).toLowerCase();_c.indexOf(r)===-1&&_c.push(r),_c.indexOf(t)===-1&&_c.push(t)}};Vde.forEach(function(e){Yde(YR[e])});_c.sort();ZR.exports={DRAW_MODES:WR,backButtons:jR,foreButtons:_c}});var J5=N((cPe,XR)=>{"use strict";var fPe=X5();XR.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}});var $R=N((vPe,JR)=>{"use strict";var Wde=Ee(),Ih=Tr(),jde=wt(),Zde=J5();JR.exports=function(r,t){var a=r.modebar||{},n=jde.newContainer(t,"modebar");function i(l,s){return Wde.coerce(a,n,Zde,l,s)}i("orientation"),i("bgcolor",Ih.addOpacity(t.paper_bgcolor,.5));var o=Ih.contrast(Ih.rgb(t.modebar.bgcolor));i("color",Ih.addOpacity(o,.3)),i("activecolor",Ih.addOpacity(o,.7)),i("uirevision",t.uirevision),i("add"),i("remove")}});var rP=N((hPe,eP)=>{"use strict";var $5=Sr(),Xde=Rr(),qy=Ee(),KR=fy(),Jde=mp().version,$de=new DOMParser;function QR(e){this.container=e.container,this.element=document.createElement("div"),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var Ho=QR.prototype;Ho.update=function(e,r){this.graphInfo=e;var t=this.graphInfo._context,a=this.graphInfo._fullLayout,n="modebar-"+a._uid;this.element.setAttribute("id",n),this.element.setAttribute("role","toolbar"),this._uid=n,this.element.className="modebar modebar--custom",t.displayModeBar==="hover"&&(this.element.className+=" modebar--hover ease-bg"),a.modebar.orientation==="v"&&(this.element.className+=" vertical",r=r.reverse());var i=a.modebar,o="#"+n+" .modebar-group";document.querySelectorAll(o).forEach(function(c){c.style.backgroundColor=i.bgcolor});var l=!this.hasButtons(r),s=this.hasLogo!==t.displaylogo,u=this.locale!==t.locale;if(this.locale=t.locale,(l||s||u)&&(this.removeAllButtons(),this.updateButtons(r),t.watermark||t.displaylogo)){var f=this.getLogo();t.watermark&&(f.className=f.className+" watermark"),a.modebar.orientation==="v"?this.element.insertBefore(f,this.element.childNodes[0]):this.element.appendChild(f),this.hasLogo=!0}this.updateActiveButton(),qy.setStyleOnHover("#"+n+" .modebar-btn",".active",".icon path","fill: "+i.activecolor,"fill: "+i.color,this.element)};Ho.updateButtons=function(e){var r=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach(function(t){var a=r.createGroup();t.forEach(function(n){var i=n.name;if(!i)throw new Error("must provide button 'name' in button config");if(r.buttonsNames.indexOf(i)!==-1)throw new Error("button name '"+i+"' is taken");r.buttonsNames.push(i);var o=r.createButton(n);r.buttonElements.push(o),a.appendChild(o)}),r.element.appendChild(a)})};Ho.createGroup=function(){var e=document.createElement("div");e.className="modebar-group";var r=this.graphInfo._fullLayout.modebar;return e.style.backgroundColor=r.bgcolor,e};Ho.createButton=function(e){var r=this,t=document.createElement("button");t.setAttribute("type","button"),t.setAttribute("rel","tooltip"),t.className="modebar-btn";var a=e.title;a===void 0?a=e.name:typeof a=="function"&&(a=a(this.graphInfo)),(a||a===0)&&(t.setAttribute("data-title",a),t.setAttribute("aria-label",a)),e.attr!==void 0&&t.setAttribute("data-attr",e.attr);var n=e.val;n!==void 0&&(typeof n=="function"&&(n=n(this.graphInfo)),t.setAttribute("data-val",n));var i=e.click;if(typeof i!="function")throw new Error("must provide button 'click' function in button config");t.addEventListener("click",function(l){e.click(r.graphInfo,l),r.updateActiveButton(l.currentTarget)}),t.setAttribute("data-toggle",e.toggle||!1),e.toggle&&$5.select(t).classed("active",!0);var o=e.icon;return typeof o=="function"?t.appendChild(o()):t.appendChild(this.createIcon(o||KR.question)),t.setAttribute("data-gravity",e.gravity||"n"),t};Ho.createIcon=function(e){var r=Xde(e.height)?Number(e.height):e.ascent-e.descent,t="http://www.w3.org/2000/svg",a;if(e.path){a=document.createElementNS(t,"svg"),a.setAttribute("viewBox",[0,0,e.width,r].join(" ")),a.setAttribute("class","icon");var n=document.createElementNS(t,"path");n.setAttribute("d",e.path),e.transform?n.setAttribute("transform",e.transform):e.ascent!==void 0&&n.setAttribute("transform","matrix(1 0 0 -1 0 "+e.ascent+")"),a.appendChild(n)}if(e.svg){var i=$de.parseFromString(e.svg,"application/xml");a=i.childNodes[0]}return a.setAttribute("height","1em"),a.setAttribute("width","1em"),a};Ho.updateActiveButton=function(e){var r=this.graphInfo._fullLayout,t=e!==void 0?e.getAttribute("data-attr"):null;this.buttonElements.forEach(function(a){var n=a.getAttribute("data-val")||!0,i=a.getAttribute("data-attr"),o=a.getAttribute("data-toggle")==="true",l=$5.select(a),s=function(c,v){var d=r.modebar,p=c.querySelector(".icon path");p&&(v||c.matches(":hover")?p.style.fill=d.activecolor:p.style.fill=d.color)};if(o){if(i===t){var u=!l.classed("active");l.classed("active",u),s(a,u)}}else{var f=i===null?i:qy.nestedProperty(r,i).get();l.classed("active",f===n),s(a,f===n)}})};Ho.hasButtons=function(e){var r=this.buttons;if(!r||e.length!==r.length)return!1;for(var t=0;t{"use strict";var epe=fa(),tP=Pn(),K5=br(),rpe=Eo().isUnifiedHover,tpe=rP(),Ly=Z5(),ape=X5().DRAW_MODES,npe=Ee().extendDeep;aP.exports=function(r){var t=r._fullLayout,a=r._context,n=t._modeBar;if(!a.displayModeBar&&!a.watermark){n&&(n.destroy(),delete t._modeBar);return}if(!Array.isArray(a.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(a.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var i=a.modeBarButtons,o;Array.isArray(i)&&i.length?o=fpe(i):!a.displayModeBar&&a.watermark?o=[]:o=ipe(r),n?n.update(r,o):t._modeBar=tpe(r,o)};function ipe(e){var r=e._fullLayout,t=e._fullData,a=e._context;function n(V,H){if(typeof H=="string"){if(H.toLowerCase()===V.toLowerCase())return!0}else{var X=H.name,j=H._cat||H.name;if(X===V||j===V.toLowerCase())return!0}return!1}var i=r.modebar.add;typeof i=="string"&&(i=[i]);var o=r.modebar.remove;typeof o=="string"&&(o=[o]);var l=a.modeBarButtonsToAdd.concat(i.filter(function(V){for(var H=0;H1?(D=["toggleHover"],P=["resetViews"]):c?(E=["zoomInGeo","zoomOutGeo"],D=["hoverClosestGeo"],P=["resetGeo"]):f?(D=["hoverClosest3d"],P=["resetCameraDefault3d","resetCameraLastSave3d"]):y?(E=["zoomInMapbox","zoomOutMapbox"],D=["toggleHover"],P=["resetViewMapbox"]):m?(E=["zoomInMap","zoomOutMap"],D=["toggleHover"],P=["resetViewMap"]):v?D=["hoverClosestPie"]:_?(D=["hoverClosestCartesian","hoverCompareCartesian"],P=["resetViewSankey"]):D=["toggleHover"],u&&D.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(spe(t)||w)&&(D=[]),u&&!b&&(E=["zoomIn2d","zoomOut2d","autoScale2d"],P[0]!=="resetViews"&&(P=["resetScale2d"])),f?R=["zoom3d","pan3d","orbitRotation","tableRotation"]:u&&!b||p?R=["zoom2d","pan2d"]:y||m||c?R=["pan2d"]:x&&(R=["zoom2d"]),lpe(t)&&R.push("select2d","lasso2d");var z=[],I=function(V){z.indexOf(V)===-1&&D.indexOf(V)!==-1&&z.push(V)};if(Array.isArray(l)){for(var B=[],G=0;G{"use strict";iP.exports={moduleType:"component",name:"modebar",layoutAttributes:J5(),supplyLayoutDefaults:$R(),manage:nP()}});var e_=N((yPe,oP)=>{"use strict";var cpe=Ha().FROM_BL;oP.exports=function(r,t,a){a===void 0&&(a=cpe[r.constraintoward||"center"]);var n=[r.r2l(r.range[0]),r.r2l(r.range[1])],i=n[0]+(n[1]-n[0])*a;r.range=r._input.range=[r.l2r(i+(n[0]-i)*t),r.l2r(i+(n[1]-i)*t)],r.setScale()}});var Ru=N(zh=>{"use strict";var Du=Ee(),r_=_h(),so=fa().id2name,vpe=pi(),lP=e_(),hpe=lc(),dpe=Ft().ALMOST_EQUAL,ppe=Ha().FROM_BL;zh.handleDefaults=function(e,r,t){var a=t.axIds,n=t.axHasImage,i=r._axisConstraintGroups=[],o=r._axisMatchGroups=[],l,s,u,f,c,v,d,p;for(l=0;li?t.slice(i):a.slice(n))+o}function mpe(e,r){for(var t=r._size,a=t.h/t.w,n={},i=Object.keys(e),o=0;odpe*p&&!T)){for(i=0;iR&&XD&&(D=X);var ee=(D-E)/(2*P);c/=ee,E=s.l2r(E),D=s.l2r(D),s.range=s._input.range=k{"use strict";var Ey=Sr(),fn=br(),Qn=aa(),_i=Ee(),n_=Aa(),i_=uy(),Oh=Tr(),wc=Yr(),cP=oc(),yP=Q5(),Bh=zr(),_l=Ha(),mP=Ru(),gpe=mP.enforce,bpe=mP.clean,vP=_h().doAutoRange,gP="start",xpe="middle",bP="end",_pe=xa().zindexSeparator;Sa.layoutStyles=function(e){return _i.syncOrAsync([Qn.doAutoMargin,Tpe],e)};function wpe(e,r,t){for(var a=0;a=e[1]||n[1]<=e[0])&&i[0]r[0])return!0}return!1}function Tpe(e){var r=e._fullLayout,t=r._size,a=t.p,n=Bh.list(e,"",!0),i,o,l,s,u,f;if(r._paperdiv.style({width:e._context.responsive&&r.autosize&&!e._context._hasZeroWidth&&!e.layout.width?"100%":r.width+"px",height:e._context.responsive&&r.autosize&&!e._context._hasZeroHeight&&!e.layout.height?"100%":r.height+"px"}).selectAll(".main-svg").call(wc.setSize,r.width,r.height),e._context.setBackground(e,r.paper_bgcolor),Sa.drawMainTitle(e),yP.manage(e),!r._has("cartesian"))return Qn.previousPromises(e);function c(ye,W,Q){var Z=ye._lw/2;if(ye._id.charAt(0)==="x"){if(W){if(Q==="top")return W._offset-a-Z}else return t.t+t.h*(1-(ye.position||0))+Z%1;return W._offset+W._length+a+Z}if(W){if(Q==="right")return W._offset+W._length+a+Z}else return t.l+t.w*(ye.position||0)+Z%1;return W._offset-a-Z}for(i=0;i0){Spe(e,i,u,s),l.attr({x:o,y:i,"text-anchor":a,dy:pP(r.yanchor)}).call(n_.positionText,o,i);var f=(r.text.match(n_.BR_TAG_ALL)||[]).length;if(f){var c=_l.LINE_SPACING*f+_l.MID_SHIFT;r.y===0&&(c=-c),l.selectAll(".line").each(function(){var m=+this.getAttribute("dy").slice(0,-2)-c+"em";this.setAttribute("dy",m)})}var v=Ey.select(e).selectAll(".gtitle-subtitle");if(v.node()){var d=l.node().getBBox(),p=d.y+d.height,y=p+cP.SUBTITLE_PADDING_EM*r.subtitle.font.size;v.attr({x:o,y,"text-anchor":a,dy:pP(r.yanchor)}).call(n_.positionText,o,y)}}}};function Ape(e,r,t,a,n){var i=r.yref==="paper"?e._fullLayout._size.h:e._fullLayout.height,o=_i.isTopAnchor(r)?a:a-n,l=t==="b"?i-o:o;return _i.isTopAnchor(r)&&t==="t"||_i.isBottomAnchor(r)&&t==="b"?!1:l.5?"t":"b",o=e._fullLayout.margin[i],l=0;return r.yref==="paper"?l=t+r.pad.t+r.pad.b:r.yref==="container"&&(l=Mpe(i,a,n,e._fullLayout.height,t)+r.pad.t+r.pad.b),l>o?l:0}function Spe(e,r,t,a){var n="title.automargin",i=e._fullLayout.title,o=i.y>.5?"t":"b",l={x:i.x,y:i.y,t:0,b:0},s={};i.yref==="paper"&&Ape(e,i,o,r,a)?l[o]=t:i.yref==="container"&&(s[o]=t,e._fullLayout._reservedMargin[n]=s),Qn.allowAutoMargin(e,n),Qn.autoMargin(e,n,l)}function qpe(e,r){var t=e.title,a=e._size,n=0;switch(r===gP?n=t.pad.l:r===bP&&(n=-t.pad.r),t.xref){case"paper":return a.l+a.w*t.x+n;case"container":default:return e.width*t.x+n}}function Lpe(e,r){var t=e.title,a=e._size,n=0;if(r==="0em"||!r?n=-t.pad.b:r===_l.CAP_SHIFT+"em"&&(n=t.pad.t),t.y==="auto")return a.t/2;switch(t.yref){case"paper":return a.t+a.h-a.h*t.y+n;case"container":default:return e.height-e.height*t.y+n}}function pP(e){return e==="top"?_l.CAP_SHIFT+.3+"em":e==="bottom"?"-0.3em":_l.MID_SHIFT+"em"}function Cpe(e){var r=e.title,t=xpe;return _i.isRightAnchor(r)?t=bP:_i.isLeftAnchor(r)&&(t=gP),t}function Epe(e){var r=e.title,t="0em";return _i.isTopAnchor(r)?t=_l.CAP_SHIFT+"em":_i.isMiddleAnchor(r)&&(t=_l.MID_SHIFT+"em"),t}Sa.doTraceStyle=function(e){var r=e.calcdata,t=[],a;for(a=0;a{"use strict";var Dpe=fs().readPaths,Rpe=xy(),xP=rs().clearOutlineControllers,o_=Tr(),_P=Yr(),Ppe=wt().arrayEditor,wP=hs(),Fpe=wP.getPathString;AP.exports={draw:Ry,drawOne:TP,activateLastSelection:zpe};function Ry(e){var r=e._fullLayout;xP(e),r._selectionLayer.selectAll("path").remove();for(var t in r._plots){var a=r._plots[t].selectionLayer;a&&a.selectAll("path").remove()}for(var n=0;n=0;m--){var x=o.append("path").attr(s).style("opacity",m?.1:u).call(o_.stroke,c).call(o_.fill,f).call(_P.dashLine,m?"solid":d,m?4+v:v);if(Npe(x,e,a),p){var T=Ppe(e.layout,"selections",a);x.style({cursor:"move"});var _={element:x.node(),plotinfo:n,gd:e,editHelpers:T,isActiveSelection:!0},b=Dpe(l,e);Rpe(b,x,_)}else x.style("pointer-events",m?"all":"none");y[m]=x}var w=y[0],k=y[1];k.node().addEventListener("click",function(){return Ipe(e,w)})}}function Npe(e,r,t){var a=t.xref+t.yref;_P.setClipUrl(e,"clip"+r._fullLayout._uid+a,r)}function Ipe(e,r){if(Py(e)){var t=r.node(),a=+t.getAttribute("data-index");if(a>=0){if(a===e._fullLayout._activeSelectionIndex){l_(e);return}e._fullLayout._activeSelectionIndex=a,e._fullLayout._deactivateSelection=l_,Ry(e)}}}function zpe(e){if(Py(e)){var r=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=r,e._fullLayout._deactivateSelection=l_,Ry(e)}}function l_(e){if(Py(e)){var r=e._fullLayout._activeSelectionIndex;r>=0&&(xP(e),delete e._fullLayout._activeSelectionIndex,Ry(e))}}});var kP=N((xPe,MP)=>{function Ope(){var e,r=0,t=!1;function a(n,i){return e.list.push({type:n,data:i?JSON.parse(JSON.stringify(i)):void 0}),e}return e={list:[],segmentId:function(){return r++},checkIntersection:function(n,i){return a("check",{seg1:n,seg2:i})},segmentChop:function(n,i){return a("div_seg",{seg:n,pt:i}),a("chop",{seg:n,pt:i})},statusRemove:function(n){return a("pop_seg",{seg:n})},segmentUpdate:function(n){return a("seg_update",{seg:n})},segmentNew:function(n,i){return a("new_seg",{seg:n,primary:i})},segmentRemove:function(n){return a("rem_seg",{seg:n})},tempStatus:function(n,i,o){return a("temp_status",{seg:n,above:i,below:o})},rewind:function(n){return a("rewind",{seg:n})},status:function(n,i,o){return a("status",{seg:n,above:i,below:o})},vert:function(n){return n===t?e:(t=n,a("vert",{x:n}))},log:function(n){return typeof n!="string"&&(n=JSON.stringify(n,!1," ")),a("log",{txt:n})},reset:function(){return a("reset")},selected:function(n){return a("selected",{segs:n})},chainStart:function(n){return a("chain_start",{seg:n})},chainRemoveHead:function(n,i){return a("chain_rem_head",{index:n,pt:i})},chainRemoveTail:function(n,i){return a("chain_rem_tail",{index:n,pt:i})},chainNew:function(n,i){return a("chain_new",{pt1:n,pt2:i})},chainMatch:function(n){return a("chain_match",{index:n})},chainClose:function(n){return a("chain_close",{index:n})},chainAddHead:function(n,i){return a("chain_add_head",{index:n,pt:i})},chainAddTail:function(n,i){return a("chain_add_tail",{index:n,pt:i})},chainConnect:function(n,i){return a("chain_con",{index1:n,index2:i})},chainReverse:function(n){return a("chain_rev",{index:n})},chainJoin:function(n,i){return a("chain_join",{index1:n,index2:i})},done:function(){return a("done")}},e}MP.exports=Ope});var qP=N((_Pe,SP)=>{function Bpe(e){typeof e!="number"&&(e=1e-10);var r={epsilon:function(t){return typeof t=="number"&&(e=t),e},pointAboveOrOnLine:function(t,a,n){var i=a[0],o=a[1],l=n[0],s=n[1],u=t[0],f=t[1];return(l-i)*(f-o)-(s-o)*(u-i)>=-e},pointBetween:function(t,a,n){var i=t[1]-a[1],o=n[0]-a[0],l=t[0]-a[0],s=n[1]-a[1],u=l*o+i*s;if(u-e)},pointsSameX:function(t,a){return Math.abs(t[0]-a[0])e!=l-i>e&&(o-f)*(i-c)/(l-c)+f-n>e&&(s=!s),o=f,l=c}return s}};return r}SP.exports=Bpe});var CP=N((wPe,LP)=>{var Hpe={create:function(){var e={root:{root:!0,next:null},exists:function(r){return!(r===null||r===e.root)},isEmpty:function(){return e.root.next===null},getHead:function(){return e.root.next},insertBefore:function(r,t){for(var a=e.root,n=e.root.next;n!==null;){if(t(n)){r.prev=n.prev,r.next=n,n.prev.next=r,n.prev=r;return}a=n,n=n.next}a.next=r,r.prev=a,r.next=null},findTransition:function(r){for(var t=e.root,a=e.root.next;a!==null&&!r(a);)t=a,a=a.next;return{before:t===e.root?null:t,after:a,insert:function(n){return n.prev=t,n.next=a,t.next=n,a!==null&&(a.prev=n),n}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}};LP.exports=Hpe});var DP=N((TPe,EP)=>{var Hh=CP();function Upe(e,r,t){function a(p,y){return{id:t?t.segmentId():-1,start:p,end:y,myFill:{above:null,below:null},otherFill:null}}function n(p,y,m){return{id:t?t.segmentId():-1,start:p,end:y,myFill:{above:m.myFill.above,below:m.myFill.below},otherFill:null}}var i=Hh.create();function o(p,y,m,x,T,_){var b=r.pointsCompare(y,T);return b!==0?b:r.pointsSame(m,_)?0:p!==x?p?1:-1:r.pointAboveOrOnLine(m,x?T:_,x?_:T)?1:-1}function l(p,y){i.insertBefore(p,function(m){var x=o(p.isStart,p.pt,y,m.isStart,m.pt,m.other.pt);return x<0})}function s(p,y){var m=Hh.node({isStart:!0,pt:p.start,seg:p,primary:y,other:null,status:null});return l(m,p.end),m}function u(p,y,m){var x=Hh.node({isStart:!1,pt:y.end,seg:y,primary:m,other:p,status:null});p.other=x,l(x,p.pt)}function f(p,y){var m=s(p,y);return u(m,p,y),m}function c(p,y){t&&t.segmentChop(p.seg,y),p.other.remove(),p.seg.end=y,p.other.pt=y,l(p.other,p.pt)}function v(p,y){var m=n(y,p.seg.end,p.seg);return c(p,y),f(m,p.primary)}function d(p,y){var m=Hh.create();function x(B,G){var Y=B.seg.start,V=B.seg.end,H=G.seg.start,X=G.seg.end;return r.pointsCollinear(Y,H,X)?r.pointsCollinear(V,H,X)||r.pointAboveOrOnLine(V,H,X)?1:-1:r.pointAboveOrOnLine(Y,H,X)?1:-1}function T(B){return m.findTransition(function(G){var Y=x(B,G.ev);return Y>0})}function _(B,G){var Y=B.seg,V=G.seg,H=Y.start,X=Y.end,j=V.start,ee=V.end;t&&t.checkIntersection(Y,V);var fe=r.linesIntersect(H,X,j,ee);if(fe===!1){if(!r.pointsCollinear(H,X,j)||r.pointsSame(H,ee)||r.pointsSame(X,j))return!1;var ie=r.pointsSame(H,j),ue=r.pointsSame(X,ee);if(ie&&ue)return G;var K=!ie&&r.pointBetween(H,j,ee),we=!ue&&r.pointBetween(X,j,ee);if(ie)return we?v(G,X):v(B,ee),G;K&&(ue||(we?v(G,X):v(B,ee)),v(G,H))}else fe.alongA===0&&(fe.alongB===-1?v(B,j):fe.alongB===0?v(B,fe.pt):fe.alongB===1&&v(B,ee)),fe.alongB===0&&(fe.alongA===-1?v(G,H):fe.alongA===0?v(G,fe.pt):fe.alongA===1&&v(G,X));return!1}for(var b=[];!i.isEmpty();){var w=i.getHead();if(t&&t.vert(w.pt[0]),w.isStart){let B=function(){if(M){var G=_(w,M);if(G)return G}return q?_(w,q):!1};var I=B;t&&t.segmentNew(w.seg,w.primary);var k=T(w),M=k.before?k.before.ev:null,q=k.after?k.after.ev:null;t&&t.tempStatus(w.seg,M?M.seg:!1,q?q.seg:!1);var E=B();if(E){if(e){var D;w.seg.myFill.below===null?D=!0:D=w.seg.myFill.above!==w.seg.myFill.below,D&&(E.seg.myFill.above=!E.seg.myFill.above)}else E.seg.otherFill=w.seg.myFill;t&&t.segmentUpdate(E.seg),w.other.remove(),w.remove()}if(i.getHead()!==w){t&&t.rewind(w.seg);continue}if(e){var D;w.seg.myFill.below===null?D=!0:D=w.seg.myFill.above!==w.seg.myFill.below,q?w.seg.myFill.below=q.seg.myFill.above:w.seg.myFill.below=p,D?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var P;q?w.primary===q.primary?P=q.seg.otherFill.above:P=q.seg.myFill.above:P=w.primary?y:p,w.seg.otherFill={above:P,below:P}}t&&t.status(w.seg,M?M.seg:!1,q?q.seg:!1),w.other.status=k.insert(Hh.node({ev:w}))}else{var R=w.status;if(R===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(m.exists(R.prev)&&m.exists(R.next)&&_(R.prev.ev,R.next.ev),t&&t.statusRemove(R.ev.seg),R.remove(),!w.primary){var z=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=z}b.push(w.seg)}i.getHead().remove()}return t&&t.done(),b}return e?{addRegion:function(p){for(var y,m=p[p.length-1],x=0;x{function Gpe(e,r,t){var a=[],n=[];return e.forEach(function(i){var o=i.start,l=i.end;if(r.pointsSame(o,l)){console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");return}t&&t.chainStart(i);var s={index:0,matches_head:!1,matches_pt1:!1},u={index:0,matches_head:!1,matches_pt1:!1},f=s;function c(I,B,G){return f.index=I,f.matches_head=B,f.matches_pt1=G,f===s?(f=u,!1):(f=null,!0)}for(var v=0;v{function Uh(e,r,t){var a=[];return e.forEach(function(n){var i=(n.myFill.above?8:0)+(n.myFill.below?4:0)+(n.otherFill&&n.otherFill.above?2:0)+(n.otherFill&&n.otherFill.below?1:0);r[i]!==0&&a.push({id:t?t.segmentId():-1,start:n.start,end:n.end,myFill:{above:r[i]===1,below:r[i]===2},otherFill:null})}),t&&t.selected(a),a}var Vpe={union:function(e,r){return Uh(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],r)},intersect:function(e,r){return Uh(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],r)},difference:function(e,r){return Uh(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],r)},differenceRev:function(e,r){return Uh(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],r)},xor:function(e,r){return Uh(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],r)}};FP.exports=Vpe});var zP=N((kPe,IP)=>{var Ype={toPolygon:function(e,r){function t(i){if(i.length<=0)return e.segments({inverted:!1,regions:[]});function o(u){var f=u.slice(0,u.length-1);return e.segments({inverted:!1,regions:[f]})}for(var l=o(i[0]),s=1;s{var Wpe=kP(),jpe=qP(),OP=DP(),Zpe=PP(),Gh=NP(),BP=zP(),wi=!1,Vh=jpe(),In;In={buildLog:function(e){return e===!0?wi=Wpe():e===!1&&(wi=!1),wi===!1?!1:wi.list},epsilon:function(e){return Vh.epsilon(e)},segments:function(e){var r=OP(!0,Vh,wi);return e.regions.forEach(r.addRegion),{segments:r.calculate(e.inverted),inverted:e.inverted}},combine:function(e,r){var t=OP(!1,Vh,wi);return{combined:t.calculate(e.segments,e.inverted,r.segments,r.inverted),inverted1:e.inverted,inverted2:r.inverted}},selectUnion:function(e){return{segments:Gh.union(e.combined,wi),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:Gh.intersect(e.combined,wi),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:Gh.difference(e.combined,wi),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:Gh.differenceRev(e.combined,wi),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:Gh.xor(e.combined,wi),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:Zpe(e.segments,Vh,wi),inverted:e.inverted}},polygonFromGeoJSON:function(e){return BP.toPolygon(In,e)},polygonToGeoJSON:function(e){return BP.fromPolygon(In,Vh,e)},union:function(e,r){return Yh(e,r,In.selectUnion)},intersect:function(e,r){return Yh(e,r,In.selectIntersect)},difference:function(e,r){return Yh(e,r,In.selectDifference)},differenceRev:function(e,r){return Yh(e,r,In.selectDifferenceRev)},xor:function(e,r){return Yh(e,r,In.selectXor)}};function Yh(e,r,t){var a=In.segments(e),n=In.segments(r),i=In.combine(a,n),o=t(i);return In.polygon(o)}typeof window=="object"&&(window.PolyBool=In);HP.exports=In});var VP=N((qPe,GP)=>{GP.exports=function(r,t,a,n){var i=r[0],o=r[1],l=!1;a===void 0&&(a=0),n===void 0&&(n=t.length);for(var s=n-a,u=0,f=s-1;uo!=p>o&&i<(d-c)*(o-v)/(p-v)+c;y&&(l=!l)}return l}});var f_=N((LPe,YP)=>{"use strict";var u_=Fp().dot,Fy=Ft().BADNUM,Ny=YP.exports={};Ny.tester=function(r){var t=r.slice(),a=t[0][0],n=a,i=t[0][1],o=i,l;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),l=1;ln||x===Fy||xo||y&&u(p))}function c(p,y){var m=p[0],x=p[1];if(m===Fy||mn||x===Fy||xo)return!1;var T=t.length,_=t[0][0],b=t[0][1],w=0,k,M,q,E,D;for(k=1;kMath.max(M,_)||x>Math.max(q,b)))if(xl||Math.abs(u_(c,u))>n)return!0;return!1};Ny.filter=function(r,t){var a=[r[0]],n=0,i=0;function o(s){r.push(s);var u=a.length,f=n;a.splice(i+1);for(var c=f+1;c1){var l=r.pop();o(l)}return{addPt:o,raw:r,filtered:a}}});var jP=N((CPe,WP)=>{"use strict";WP.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}});var pF=N((EPe,dF)=>{"use strict";var ZP=UP(),Xpe=VP(),Zh=br(),Jpe=Yr().dashStyle,Wh=Tr(),$pe=Fn(),Kpe=Eo().makeEventData,Qh=Lu(),Qpe=Qh.freeMode,e1e=Qh.rectMode,Xh=Qh.drawMode,d_=Qh.openMode,p_=Qh.selectMode,XP=hs(),JP=Fh(),rF=xy(),tF=rs().clearOutline,aF=fs(),c_=aF.handleEllipse,r1e=aF.readPaths,t1e=my().newShapes,a1e=I5(),n1e=s_().activateLastSelection,zy=Ee(),i1e=zy.sorterAsc,nF=f_(),jh=jp(),Ti=fa().getFromId,o1e=uy(),l1e=Dy().redrawReglTraces,Oy=jP(),Uo=Oy.MINSELECT,s1e=nF.filter,y_=nF.tester,m_=hy(),$P=m_.p2r,u1e=m_.axValue,f1e=m_.getTransform;function g_(e){return e.subplot!==void 0}function c1e(e,r,t,a,n){var i=!g_(a),o=Qpe(n),l=e1e(n),s=d_(n),u=Xh(n),f=p_(n),c=n==="drawline",v=n==="drawcircle",d=c||v,p=a.gd,y=p._fullLayout,m=f&&y.newselection.mode==="immediate"&&i,x=y._zoomlayer,T=a.element.getBoundingClientRect(),_=a.plotinfo,b=f1e(_),w=r-T.left,k=t-T.top;y._calcInverseTransform(p);var M=zy.apply3DTransform(y._invTransform)(w,k);w=M[0],k=M[1];var q=y._invScaleX,E=y._invScaleY,D=w,P=k,R="M"+w+","+k,z=a.xaxes[0],I=a.yaxes[0],B=z._length,G=I._length,Y=e.altKey&&!(Xh(n)&&s),V,H,X,j,ee,fe,ie;oF(e,p,a),o&&(V=s1e([[w,k]],Oy.BENDPX));var ue=x.selectAll("path.select-outline-"+_.id).data([1]),K=u?y.newshape:y.newselection;u&&(a.hasText=K.label.text||K.label.texttemplate);var we=u&&!s?K.fillcolor:"rgba(0,0,0,0)",se=K.line.color||(i?Wh.contrast(p._fullLayout.plot_bgcolor):"#7f7f7f");ue.enter().append("path").attr("class","select-outline select-outline-"+_.id).style({opacity:u?K.opacity/2:1,"stroke-dasharray":Jpe(K.line.dash,K.line.width),"stroke-width":K.line.width+"px","shape-rendering":"crispEdges"}).call(Wh.stroke,se).call(Wh.fill,we).attr("fill-rule","evenodd").classed("cursor-move",!!u).attr("transform",b).attr("d",R+"Z");var ce=x.append("path").attr("class","zoombox-corners").style({fill:Wh.background,stroke:Wh.defaultLine,"stroke-width":1}).attr("transform",b).attr("d","M0,0Z");if(u&&a.hasText){var he=x.select(".label-temp");he.empty()&&(he=x.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var ye=y._uid+Oy.SELECTID,W=[],Q=By(p,a.xaxes,a.yaxes,a.subplot);m&&!e.shiftKey&&(a._clearSubplotSelections=function(){if(i){var le=z._id,ve=I._id;cF(p,le,ve,Q);for(var me=(p.layout||{}).selections||[],Ce=[],Pe=!1,Le=0;Le=0){p._fullLayout._deactivateShape(p);return}if(!u){var me=y.clickmode;jh.done(ye).then(function(){if(jh.clear(ye),le===2){for(ue.remove(),ee=0;ee-1&&iF(ve,p,a.xaxes,a.yaxes,a.subplot,a,ue),me==="event"&&Kh(p,void 0);$pe.click(p,ve,_.id)}).catch(zy.error)}},a.doneFn=function(){ce.remove(),jh.done(ye).then(function(){jh.clear(ye),!m&&j&&a.selectionDefs&&(j.subtract=Y,a.selectionDefs.push(j),a.mergedPolygons.length=0,[].push.apply(a.mergedPolygons,X)),(m||u)&&Jh(a,m),a.doneFnCompleted&&a.doneFnCompleted(W),f&&Kh(p,ie)}).catch(zy.error)}}function iF(e,r,t,a,n,i,o){var l=r._hoverdata,s=r._fullLayout,u=s.clickmode,f=u.indexOf("event")>-1,c=[],v,d,p,y,m,x,T,_,b,w;if(y1e(l)){oF(e,r,i),v=By(r,t,a,n);var k=m1e(l,v),M=k.pointNumbers.length>0;if(M?g1e(v,k):b1e(v)&&(T=QP(k))){for(o&&o.remove(),w=0;w=0}function p1e(e){return e._fullLayout._activeSelectionIndex>=0}function Jh(e,r){var t=e.dragmode,a=e.plotinfo,n=e.gd;d1e(n)&&n._fullLayout._deactivateShape(n),p1e(n)&&n._fullLayout._deactivateSelection(n);var i=n._fullLayout,o=i._zoomlayer,l=Xh(t),s=p_(t);if(l||s){var u=o.selectAll(".select-outline-"+a.id);if(u&&n._fullLayout._outlining){var f;l&&(f=t1e(u,e)),f&&Zh.call("_guiRelayout",n,{shapes:f});var c;s&&!g_(e)&&(c=a1e(u,e)),c&&(n._fullLayout._noEmitSelectedAtStart=!0,Zh.call("_guiRelayout",n,{selections:c}).then(function(){r&&n1e(n)})),n._fullLayout._outlining=!1}}a.selection={},a.selection.selectionDefs=e.selectionDefs=[],a.selection.mergedPolygons=e.mergedPolygons=[]}function KP(e){return e._id}function By(e,r,t,a){if(!e.calcdata)return[];var n=[],i=r.map(KP),o=t.map(KP),l,s,u;for(u=0;u0,i=n?a[0]:t;return r.selectedpoints?r.selectedpoints.indexOf(i)>-1:!1}function g1e(e,r){var t=[],a,n,i,o;for(o=0;o0&&t.push(a);if(t.length===1&&(i=t[0]===r.searchInfo,i&&(n=r.searchInfo.cd[0].trace,n.selectedpoints.length===r.pointNumbers.length))){for(o=0;o1||(r+=a.selectedpoints.length,r>1)))return!1;return r===1}function $h(e,r,t){var a;for(a=0;a-1&&r;if(!o&&r){var le=eF(e,!0);if(le.length){var ve=le[0].xref,me=le[0].yref;if(ve&&me){var Ce=vF(le),Pe=hF([Ti(e,ve,"x"),Ti(e,me,"y")]);Pe(W,Ce)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:Z&&Kh(e,W),v._reselect=!1}if(!o&&v._deselect){var Le=v._deselect;l=Le.xref,s=Le.yref,w1e(l,s,f)||cF(e,l,s,a),Z&&(W.points.length?Kh(e,W):__(e)),v._deselect=!1}return{eventData:W,selectionTesters:t}}function _1e(e){var r=e.calcdata;if(r)for(var t=0;t{"use strict";yF.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]});var e0=N((RPe,mF)=>{"use strict";mF.exports={axisRefDescription:function(e,r,t){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",r,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",r,"("+t+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",r,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",r,"and the",t,"of the domain of the","second",e,"axis."].join(" ")}}});var Tc=N((FPe,xF)=>{"use strict";var gF=w_(),bF=ga(),Hy=xa(),S1e=wt().templatedArray,PPe=e0();xF.exports=S1e("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:bF({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:gF.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:gF.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",Hy.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",Hy.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",Hy.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",Hy.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:bF({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})});var r0=N((NPe,_F)=>{"use strict";_F.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}});var Uy=N((IPe,wF)=>{"use strict";wF.exports=function(r){return{valType:"color",editType:"style",anim:!0}}});var Ai=N((zPe,CF)=>{"use strict";var TF=no().axisHoverFormat,{hovertemplateAttrs:q1e,texttemplateAttrs:L1e,templatefallbackAttrs:AF}=Wn(),MF=Lo(),C1e=ga(),kF=ci().dash,E1e=ci().pattern,D1e=Yr(),R1e=r0(),t0=bt().extendFlat,P1e=Uy();function SF(e){return{valType:"any",dflt:0,editType:"calc"}}function qF(e){return{valType:"any",editType:"calc"}}function LF(e){return{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"}}CF.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:SF("x"),yperiod:SF("y"),xperiod0:qF("x0"),yperiod0:qF("y0"),xperiodalignment:LF("x"),yperiodalignment:LF("y"),xhoverformat:TF("x"),yhoverformat:TF("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:L1e(),texttemplatefallback:AF({editType:"calc"}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:q1e({},{keys:R1e.eventDataKeys}),hovertemplatefallback:AF(),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:t0({},kF,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:P1e(!0),fillgradient:t0({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:E1e,marker:t0({symbol:{valType:"enumerated",values:D1e.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:t0({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},dash:t0({},kF,{arrayOk:!0}),editType:"calc"},MF("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},MF("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:C1e({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}});var T_=N((BPe,RF)=>{"use strict";var EF=Tc(),DF=Ai().line,F1e=ci().dash,Gy=bt().extendFlat,N1e=eo().overrideAll,I1e=wt().templatedArray,OPe=e0();RF.exports=N1e(I1e("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:Gy({},EF.xref,{}),yref:Gy({},EF.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:DF.color,width:Gy({},DF.width,{min:1,dflt:1}),dash:Gy({},F1e,{dflt:"dot"})}}),"arraydraw","from-root")});var IF=N((HPe,NF)=>{"use strict";var PF=Ee(),Vy=zr(),z1e=io(),O1e=T_(),FF=hs();NF.exports=function(r,t){z1e(r,t,{name:"selections",handleItemDefaults:B1e});for(var a=t.selections,n=0;n{"use strict";zF.exports=function(r,t,a){a("newselection.mode");var n=a("newselection.line.width");n&&(a("newselection.line.color"),a("newselection.line.dash")),a("activeselection.fillcolor"),a("activeselection.opacity")}});var a0=N((GPe,UF)=>{"use strict";var H1e=br(),BF=Ee(),HF=fa();UF.exports=function(r){return function(a,n){var i=a[r];if(Array.isArray(i))for(var o=H1e.subplotsRegistry.cartesian,l=o.idRegex,s=n._subplots,u=s.xaxis,f=s.yaxis,c=s.cartesian,v=n._has("cartesian"),d=0;d{"use strict";var GF=s_(),n0=pF();VF.exports={moduleType:"component",name:"selections",layoutAttributes:T_(),supplyLayoutDefaults:IF(),supplyDrawNewSelectionDefaults:OF(),includeBasePlot:a0()("selections"),draw:GF.draw,drawOne:GF.drawOne,reselect:n0.reselect,prepSelect:n0.prepSelect,clearOutline:n0.clearOutline,clearSelectionsCache:n0.clearSelectionsCache,selectOnClick:n0.selectOnClick}});var cN=N((YPe,fN)=>{"use strict";var q_=Sr(),Mi=Ee(),YF=Mi.numberFormat,U1e=qn(),G1e=s5(),Yy=br(),eN=Mi.strTranslate,V1e=Aa(),WF=Tr(),ps=Yr(),Y1e=Fn(),jF=zr(),W1e=ss(),j1e=mi(),rN=Lu(),Wy=rN.selectingOrDrawing,Z1e=rN.freeMode,X1e=Ha().FROM_TL,J1e=uy(),$1e=Dy().redrawReglTraces,K1e=aa(),M_=fa().getFromId,Q1e=Go().prepSelect,eye=Go().clearOutline,rye=Go().selectOnClick,A_=e_(),L_=xa(),ZF=L_.MINDRAG,xn=L_.MINZOOM,XF=!0;function tye(e,r,t,a,n,i,o,l){var s=e._fullLayout._zoomlayer,u=o+l==="nsew",f=(o+l).length===1,c,v,d,p,y,m,x,T,_,b,w,k,M,q,E,D,P,R,z,I,B,G,Y;t+=r.yaxis._shift;function V(){if(c=r.xaxis,v=r.yaxis,_=c._length,b=v._length,x=c._offset,T=v._offset,d={},d[c._id]=c,p={},p[v._id]=v,o&&l)for(var Te=r.overlays,qe=0;qe=0){He._fullLayout._deactivateShape(He);return}var Je=He._fullLayout.clickmode;if(S_(He),Te===2&&!f&&Ue(),u)Je.indexOf("select")>-1&&rye(qe,He,y,m,r.id,j),Je.indexOf("event")>-1&&Y1e.click(He,qe,r.id);else if(Te===1&&f){var We=o?v:c,Ze=o==="s"||l==="w"?0:1,lr=We._name+".range["+Ze+"]",rr=aye(We,Ze),er="left",Ie="middle";if(We.fixedrange)return;o?(Ie=o==="n"?"top":"bottom",We.side==="right"&&(er="right")):l==="e"&&(er="right"),He._context.showAxisRangeEntryBoxes&&q_.select(X).call(V1e.makeEditable,{gd:He,immediate:!0,background:He._fullLayout.paper_bgcolor,text:String(rr),fill:We.tickfont?We.tickfont.color:"#444",horizontalAlign:er,verticalAlign:Ie}).on("edit",function(ne){var de=We.d2r(ne);de!==void 0&&Yy.call("_guiRelayout",He,lr,de)})}}j1e.init(j);var ie,ue,K,we,se,ce,he,ye,W,Q;function Z(Te,qe,He){var Je=X.getBoundingClientRect();ie=qe-Je.left,ue=He-Je.top,e._fullLayout._calcInverseTransform(e);var We=Mi.apply3DTransform(e._fullLayout._invTransform)(ie,ue);ie=We[0],ue=We[1],K={l:ie,r:ie,w:0,t:ue,b:ue,h:0},we=e._hmpixcount?e._hmlumcount/e._hmpixcount:U1e(e._fullLayout.plot_bgcolor).getLuminance(),se="M0,0H"+_+"V"+b+"H0V0",ce=!1,he="xy",Q=!1,ye=nN(s,we,x,T,se),W=iN(s,x,T)}function le(Te,qe){if(e._transitioningWithDuration)return!1;var He=Math.max(0,Math.min(_,G*Te+ie)),Je=Math.max(0,Math.min(b,Y*qe+ue)),We=Math.abs(He-ie),Ze=Math.abs(Je-ue);K.l=Math.min(ie,He),K.r=Math.max(ie,He),K.t=Math.min(ue,Je),K.b=Math.max(ue,Je);function lr(){he="",K.r=K.l,K.t=K.b,W.attr("d","M0,0Z")}if(w.isSubplotConstrained)We>xn||Ze>xn?(he="xy",We/_>Ze/b?(Ze=We*b/_,ue>Je?K.t=ue-Ze:K.b=ue+Ze):(We=Ze*_/b,ie>He?K.l=ie-We:K.r=ie+We),W.attr("d",jy(K))):lr();else if(k.isSubplotConstrained)if(We>xn||Ze>xn){he="xy";var rr=Math.min(K.l/_,(b-K.b)/b),er=Math.max(K.r/_,(b-K.t)/b);K.l=rr*_,K.r=er*_,K.b=(1-rr)*b,K.t=(1-er)*b,W.attr("d",jy(K))}else lr();else!q||Ze0){var ne;if(k.isSubplotConstrained||!M&&q.length===1){for(ne=0;ne1&&(lr.maxallowed!==void 0&&D===(lr.range[0]1&&(rr.maxallowed!==void 0&&P===(rr.range[0]=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function iye(e,r,t){return e?e==="nsew"?t?"":r==="pan"?"move":"crosshair":e.toLowerCase()+"-resize":"pointer"}function nN(e,r,t,a,n){return e.append("path").attr("class","zoombox").style({fill:r>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",eN(t,a)).attr("d",n+"Z")}function iN(e,r,t){return e.append("path").attr("class","zoombox-corners").style({fill:WF.background,stroke:WF.defaultLine,"stroke-width":1,opacity:0}).attr("transform",eN(r,t)).attr("d","M0,0Z")}function oN(e,r,t,a,n,i){e.attr("d",a+"M"+t.l+","+t.t+"v"+t.h+"h"+t.w+"v-"+t.h+"h-"+t.w+"Z"),lN(e,r,n,i)}function lN(e,r,t,a){t||(e.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),r.transition().style("opacity",1).duration(200))}function S_(e){q_.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function sN(e){XF&&e.data&&e._context.showTips&&(Mi.notifier(Mi._(e,"Double-click to zoom back out"),"long",e),XF=!1)}function oye(e,r){return"M"+(e.l-.5)+","+(r-xn-.5)+"h-3v"+(2*xn+1)+"h3ZM"+(e.r+.5)+","+(r-xn-.5)+"h3v"+(2*xn+1)+"h-3Z"}function lye(e,r){return"M"+(r-xn-.5)+","+(e.t-.5)+"v-3h"+(2*xn+1)+"v3ZM"+(r-xn-.5)+","+(e.b+.5)+"v3h"+(2*xn+1)+"v-3Z"}function jy(e){var r=Math.floor(Math.min(e.b-e.t,e.r-e.l,xn)/2);return"M"+(e.l-3.5)+","+(e.t-.5+r)+"h3v"+-r+"h"+r+"v-3h-"+(r+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+r)+"h-3v"+-r+"h"+-r+"v-3h"+(r+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-r)+"h-3v"+r+"h"+-r+"v3h"+(r+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-r)+"h3v"+r+"h"+r+"v3h-"+(r+3)+"Z"}function KF(e,r,t,a,n){for(var i=!1,o={},l={},s,u,f,c,v=(n||{}).xaHash,d=(n||{}).yaHash,p=0;p{"use strict";var sye=Sr(),Zy=Fn(),uye=mi(),fye=ss(),uo=cN().makeDragBox,qa=xa().DRAGGERSIZE;Xy.initInteractions=function(r){var t=r._fullLayout;if(r._context.staticPlot){sye.select(r).selectAll(".drag").remove();return}if(!(!t._has("cartesian")&&!t._has("splom"))){var a=Object.keys(t._plots||{}).sort(function(i,o){if((t._plots[i].mainplot&&!0)===(t._plots[o].mainplot&&!0)){var l=i.split("y"),s=o.split("y");return l[0]===s[0]?Number(l[1]||1)-Number(s[1]||1):Number(l[0]||1)-Number(s[0]||1)}return t._plots[i].mainplot?1:-1});a.forEach(function(i){var o=t._plots[i],l=o.xaxis,s=o.yaxis;if(!o.mainplot){var u=uo(r,o,l._offset,s._offset,l._length,s._length,"ns","ew");u.onmousemove=function(v){r._fullLayout._rehover=function(){r._fullLayout._hoversubplot===i&&r._fullLayout._plots[i]&&Zy.hover(r,v,i)},Zy.hover(r,v,i),r._fullLayout._lasthover=u,r._fullLayout._hoversubplot=i},u.onmouseout=function(v){r._dragging||(r._fullLayout._hoversubplot=null,uye.unhover(r,v))},r._context.showAxisDragHandles&&(uo(r,o,l._offset-qa,s._offset-qa,qa,qa,"n","w"),uo(r,o,l._offset+l._length,s._offset-qa,qa,qa,"n","e"),uo(r,o,l._offset-qa,s._offset+s._length,qa,qa,"s","w"),uo(r,o,l._offset+l._length,s._offset+s._length,qa,qa,"s","e"))}if(r._context.showAxisDragHandles){if(i===l._mainSubplot){var f=l._mainLinePosition;l.side==="top"&&(f-=qa),uo(r,o,l._offset+l._length*.1,f,l._length*.8,qa,"","ew"),uo(r,o,l._offset,f,l._length*.1,qa,"","w"),uo(r,o,l._offset+l._length*.9,f,l._length*.1,qa,"","e")}if(i===s._mainSubplot){var c=s._mainLinePosition;s.side!=="right"&&(c-=qa),uo(r,o,c,s._offset+s._length*.1,qa,s._length*.8,"ns",""),uo(r,o,c,s._offset+s._length*.9,qa,s._length*.1,"s",""),uo(r,o,c,s._offset,qa,s._length*.1,"n","")}}});var n=t._hoverlayer.node();n.onmousemove=function(i){i.target=r._fullLayout._lasthover,Zy.hover(r,i,t._hoversubplot)},n.onclick=function(i){i.target=r._fullLayout._lasthover,Zy.click(r,i)},n.onmousedown=function(i){r._fullLayout._lasthover.onmousedown(i)},Xy.updateFx(r)}};Xy.updateFx=function(e){var r=e._fullLayout,t=r.dragmode==="pan"?"move":"crosshair";fye(r._draggers,t)}});var dN=N((jPe,hN)=>{"use strict";var vN=br();hN.exports=function(r){for(var t=vN.layoutArrayContainers,a=vN.layoutArrayRegexes,n=r.split("[")[0],i,o,l=0;l{"use strict";var cye=Vl(),E_=Pp(),i0=au(),vye=Eb().sorterAsc,D_=br();o0.containerArrayMatch=dN();var hye=o0.isAddVal=function(r){return r==="add"||cye(r)},pN=o0.isRemoveVal=function(r){return r===null||r==="remove"};o0.applyContainerArrayChanges=function(r,t,a,n,i){var o=t.astr,l=D_.getComponentMethod(o,"supplyLayoutDefaults"),s=D_.getComponentMethod(o,"draw"),u=D_.getComponentMethod(o,"drawOne"),f=n.replot||n.recalc||l===E_||s===E_,c=r.layout,v=r._fullLayout;if(a[""]){Object.keys(a).length>1&&i0.warn("Full array edits are incompatible with other edits",o);var d=a[""][""];if(pN(d))t.set(null);else if(Array.isArray(d))t.set(d);else return i0.warn("Unrecognized full array edit value",o,d),!0;return f?!1:(l(c,v),s(r),!0)}var p=Object.keys(a).map(Number).sort(vye),y=t.get(),m=y||[],x=i(v,o).get(),T=[],_=-1,b=m.length,w,k,M,q,E,D,P,R;for(w=0;wm.length-(P?0:1)){i0.warn("index out of range",o,M);continue}if(D!==void 0)E.length>1&&i0.warn("Insertion & removal are incompatible with edits to the same index.",o,M),pN(D)?T.push(M):P?(D==="add"&&(D={}),m.splice(M,0,D),x&&x.splice(M,0,{})):i0.warn("Unrecognized full object edit value",o,M,D),_===-1&&(_=M);else for(k=0;k=0;w--)m.splice(T[w],1),x&&x.splice(T[w],1);if(m.length?y||t.set(m):t.set(null),f)return!1;if(l(c,v),u!==E_){var z;if(_===-1)z=p;else{for(b=Math.max(m.length,b),z=[],w=0;w=_));w++)z.push(M);for(w=_;w{"use strict";var xN=Rr(),_N=br(),cn=Ee(),l0=aa(),wN=fa(),TN=Tr(),s0=wN.cleanId,dye=wN.getFromTrace,R_=_N.traceIs,pye=["x","y","z"];ki.clearPromiseQueue=function(e){Array.isArray(e._promises)&&e._promises.length>0&&cn.log("Clearing previous rejected promises from queue."),e._promises=[]};ki.cleanLayout=function(e){var r,t;e||(e={}),e.xaxis1&&(e.xaxis||(e.xaxis=e.xaxis1),delete e.xaxis1),e.yaxis1&&(e.yaxis||(e.yaxis=e.yaxis1),delete e.yaxis1),e.scene1&&(e.scene||(e.scene=e.scene1),delete e.scene1);var a=(l0.subplotsRegistry.cartesian||{}).attrRegex,n=(l0.subplotsRegistry.polar||{}).attrRegex,i=(l0.subplotsRegistry.ternary||{}).attrRegex,o=(l0.subplotsRegistry.gl3d||{}).attrRegex,l=Object.keys(e);for(r=0;r3?(m.x=1.02,m.xanchor="left"):m.x<-2&&(m.x=-.02,m.xanchor="right"),m.y>3?(m.y=1.02,m.yanchor="bottom"):m.y<-2&&(m.y=-.02,m.yanchor="top")),e.dragmode==="rotate"&&(e.dragmode="orbit"),TN.clean(e),e.template&&e.template.layout&&ki.cleanLayout(e.template.layout),e};function Ac(e,r,t=!1){var a=e[r],n=r.charAt(0);t&&Array.isArray(a)||a&&a!=="paper"&&(e[r]=s0(a,n,!0))}ki.cleanData=function(e){for(var r=0;r0)return e.slice(0,r)}ki.hasParent=function(e,r){for(var t=bN(r);t;){if(t in e)return!0;t=bN(t)}return!1};ki.clearAxisTypes=function(e,r,t){for(var a=0;a{let t=(...a)=>a.every(n=>cn.isPlainObject(n))||a.every(n=>Array.isArray(n));if([e,r].every(a=>Array.isArray(a))){if(e.length!==r.length)return!1;for(let a=0;acn.isPlainObject(a))){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(let a in e){if(a.startsWith("_"))continue;let n=e[a],i=r[a];if(n!==i&&!(t(n,i)?P_(n,i):!1))return!1}return!0}return!1};ki.collectionsAreEqual=P_});var B_=N(Wr=>{"use strict";var Qy=Sr(),gye=Rr(),bye=Yb(),ir=Ee(),Mt=ir.nestedProperty,I_=vh(),_n=iq(),Si=br(),om=Jf(),_r=aa(),vn=zr(),xye=l5(),_ye=pi(),F_=Yr(),wye=Tr(),Tye=C_().initInteractions,Aye=dl(),Mye=Go().clearOutline,LN=tu().dfltConfig,$y=yN(),oa=AN(),dt=Dy(),ys=eo(),kye=xa().AX_NAME_PATTERN,N_=0,MN=5;function Sye(e,r,t,a){var n;if(e=ir.getGraphDiv(e),I_.init(e),ir.isPlainObject(r)){var i=r;r=i.data,t=i.layout,a=i.config,n=i.frames}var o=I_.triggerHandler(e,"plotly_beforeplot",[r,t,a]);if(o===!1)return Promise.reject();!r&&!t&&!ir.isPlotDiv(e)&&ir.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",e);function l(){if(n)return Wr.addFrames(e,n)}EN(e,a),t||(t={}),Qy.select(e).classed("js-plotly-plot",!0),F_.makeTester(),Array.isArray(e._promises)||(e._promises=[]);var s=(e.data||[]).length===0&&Array.isArray(r);Array.isArray(r)&&(oa.cleanData(r),s?e.data=r:e.data.push.apply(e.data,r),e.empty=!1),(!e.layout||s)&&(e.layout=oa.cleanLayout(t)),_r.supplyDefaults(e);var u=e._fullLayout,f=u._has("cartesian");u._replotting=!0,(s||u._shouldCreateBgLayer)&&(Jye(e),u._shouldCreateBgLayer&&delete u._shouldCreateBgLayer),F_.initGradients(e),F_.initPatterns(e),s&&vn.saveShowSpikeInitial(e);var c=!e.calcdata||e.calcdata.length!==(e._fullData||[]).length;c&&_r.doCalcdata(e);for(var v=0;v=e.data.length||n<-e.data.length)throw new Error(t+" must be valid indices for gd.data.");if(r.indexOf(n,a+1)>-1||n>=0&&r.indexOf(-e.data.length+n)>-1||n<0&&r.indexOf(e.data.length+n)>-1)throw new Error("each index in "+t+" must be unique.")}}function DN(e,r,t){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(typeof r=="undefined")throw new Error("currentIndices is a required argument.");if(Array.isArray(r)||(r=[r]),rm(e,r,"currentIndices"),typeof t!="undefined"&&!Array.isArray(t)&&(t=[t]),typeof t!="undefined"&&rm(e,t,"newIndices"),typeof t!="undefined"&&r.length!==t.length)throw new Error("current and new indices must be of equal length.")}function Dye(e,r,t){var a,n;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if(typeof r=="undefined")throw new Error("traces must be defined.");for(Array.isArray(r)||(r=[r]),a=0;a=0&&f=0&&f0&&typeof q.parts[P]!="string";)P--;var R=q.parts[P],z=q.parts[P-1]+"."+R,I=q.parts.slice(0,P).join("."),B=Mt(e.layout,I).get(),G=Mt(a,I).get(),Y=q.get();if(E!==void 0){x[M]=E,T[M]=R==="reverse"?E:wl(Y);var V=om.getLayoutValObject(a,q.parts);if(V&&V.impliedEdits&&E!==null)for(var H in V.impliedEdits)_(ir.relativeAttr(M,H),V.impliedEdits[H]);if(["width","height"].indexOf(M)!==-1)if(E){_("autosize",null);var X=M==="height"?"width":"height";_(X,a[X])}else a[M]=e._initialAutoSize[M];else if(M==="autosize")_("width",E?null:a.width),_("height",E?null:a.height);else if(z.match(HN))k(z),Mt(a,I+"._inputRange").set(null);else if(z.match(UN)){k(z),Mt(a,I+"._inputRange").set(null);var j=Mt(a,I).get();j._inputDomain&&(j._input.domain=j._inputDomain.slice())}else z.match(Nye)&&Mt(a,I+"._inputDomain").set(null);if(R==="type"){w=B;var ee=G.type==="linear"&&E==="log",fe=G.type==="log"&&E==="linear";if(ee||fe){if(!w||!w.range)_(I+".autorange",!0);else if(G.autorange)ee&&(w.range=w.range[1]>w.range[0]?[1,2]:[2,1]);else{var ie=w.range[0],ue=w.range[1];ee?(ie<=0&&ue<=0&&_(I+".autorange",!0),ie<=0?ie=ue/1e6:ue<=0&&(ue=ie/1e6),_(I+".range[0]",Math.log(ie)/Math.LN10),_(I+".range[1]",Math.log(ue)/Math.LN10)):(_(I+".range[0]",Math.pow(10,ie)),_(I+".range[1]",Math.pow(10,ue)))}Array.isArray(a._subplots.polar)&&a._subplots.polar.length&&a[q.parts[0]]&&q.parts[1]==="radialaxis"&&delete a[q.parts[0]]._subplot.viewInitial["radialaxis.range"],Si.getComponentMethod("annotations","convertCoords")(e,G,E,_),Si.getComponentMethod("images","convertCoords")(e,G,E,_)}else _(I+".autorange",!0),_(I+".range",null);Mt(a,I+"._inputRange").set(null)}else if(R.match(kye)){var K=Mt(a,M).get(),we=(E||{}).type;(!we||we==="-")&&(we="linear"),Si.getComponentMethod("annotations","convertCoords")(e,K,we,_),Si.getComponentMethod("images","convertCoords")(e,K,we,_)}var se=$y.containerArrayMatch(M);if(se){f=se.array,c=se.index;var ce=se.property,he=V||{editType:"calc"};c!==""&&ce===""&&($y.isAddVal(E)?T[M]=null:$y.isRemoveVal(E)?T[M]=(Mt(t,f).get()||[])[c]:ir.warn("unrecognized full object value",r)),ys.update(m,he),u[f]||(u[f]={});var ye=u[f][c];ye||(ye=u[f][c]={}),ye[ce]=E,delete r[M]}else R==="reverse"?(B.range?B.range.reverse():(_(I+".autorange",!0),B.range=[1,0]),G.autorange?m.calc=!0:m.plot=!0):(M==="dragmode"&&(E===!1&&Y!==!1||E!==!1&&Y===!1)||a._has("scatter-like")&&a._has("regl")&&M==="dragmode"&&(E==="lasso"||E==="select")&&!(Y==="lasso"||Y==="select")?m.plot=!0:V?ys.update(m,V):m.calc=!0,q.set(E))}}for(f in u){var W=$y.applyContainerArrayChanges(e,i(t,f),u[f],m,i);W||(m.plot=!0)}for(var Q in b){w=vn.getFromId(e,Q);var Z=w&&w._constraintGroup;if(Z){m.calc=!0;for(var le in Z)b[le]||(vn.getFromId(e,le)._constraintShrinkable=!0)}}(VN(e)||r.height||r.width)&&(m.plot=!0);var ve=a.shapes;for(c=0;c1;)if(a.pop(),t=Mt(r,a.join(".")+".uirevision").get(),t!==void 0)return t;return r.uirevision}function Oye(e,r){for(var t=0;t[I,e._ev.listeners(I)]);i=Wr.newPlot(e,r,t,a).then(()=>{for(let[I,B]of z)B.forEach(G=>e.on(I,G));return Wr.react(e,r,t,a)})}else{e.data=r||[],oa.cleanData(e.data),e.layout=t||{},oa.cleanLayout(e.layout),Hye(e.data,e.layout,l,s),_r.supplyDefaults(e,{skipUpdateCalc:!0});var c=e._fullData,v=e._fullLayout,d=v.datarevision===void 0,p=v.transition,y=Vye(e,s,v,d,p),m=y.newDataRevision,x=Gye(e,l,c,d,p,m);if(VN(e)&&(y.layoutReplot=!0),x.calc||y.calc){e.calcdata=void 0;for(var T=Object.getOwnPropertyNames(v),_=0;_(f||e.emit("plotly_react",{config:a,data:r,layout:t}),e))}function Gye(e,r,t,a,n,i){var o=r.length===t.length;if(!n&&!o)return{fullReplot:!0,calc:!0};var l=ys.traceFlags();l.arrays={},l.nChanges=0,l.nChangesAnim=0;var s,u;function f(d){var p=om.getTraceValObject(u,d);return!u._module.animatable&&p.anim&&(p.anim=!1),p}var c={getValObject:f,flags:l,immutable:a,transition:n,newDataRevision:i,gd:e},v={};for(s=0;s=n.length?n[0]:n[u]:n}function l(u){return Array.isArray(i)?u>=i.length?i[0]:i[u]:i}function s(u,f){var c=0;return function(){if(u&&++c===f)return u()}}return new Promise(function(u,f){function c(){if(a._frameQueue.length!==0){for(;a._frameQueue.length;){var R=a._frameQueue.pop();R.onInterrupt&&R.onInterrupt()}e.emit("plotly_animationinterrupted",[])}}function v(R){if(R.length!==0){for(var z=0;za._timeToNext&&p()};R()}var m=0;function x(R){return Array.isArray(n)?m>=n.length?R.transitionOpts=n[m]:R.transitionOpts=n[0]:R.transitionOpts=n,m++,R}var T,_,b=[],w=r==null,k=Array.isArray(r),M=!w&&!k&&ir.isPlainObject(r);if(M)b.push({type:"object",data:x(ir.extendFlat({},r))});else if(w||["string","number"].indexOf(typeof r)!==-1)for(T=0;T0&&DD)&&P.push(_);b=P}}b.length>0?v(b):(e.emit("plotly_animated"),u())})}function Wye(e,r,t){if(e=ir.getGraphDiv(e),r==null)return Promise.resolve();if(!ir.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var a,n,i,o,l=e._transitionData._frames,s=e._transitionData._frameHash;if(!Array.isArray(r))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+r);var u=l.length+r.length*2,f=[],c={};for(a=r.length-1;a>=0;a--)if(ir.isPlainObject(r[a])){var v=r[a].name,d=(s[v]||c[v]||{}).name,p=r[a].name,y=s[d]||c[d];d&&p&&typeof p=="number"&&y&&N_q.index?-1:M.index=0;a--){if(n=f[a].frame,typeof n.name=="number"&&ir.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!n.name)for(;s[n.name="frame "+e._transitionData._counter++];);if(s[n.name]){for(i=0;i=0;t--)a=r[t],i.push({type:"delete",index:a}),o.unshift({type:"insert",index:a,value:n[a]});var l=_r.modifyFrames,s=_r.modifyFrames,u=[e,o],f=[e,i];return _n&&_n.add(e,l,u,s,f),_r.modifyFrames(e,i)}function Zye(e){e=ir.getGraphDiv(e);var r=e._fullLayout||{},t=e._fullData||[];return _r.cleanPlot([],{},t,r),_r.purge(e),I_.purge(e),r._container&&r._container.remove(),delete e._context,e}function Xye(e){var r=e._fullLayout,t=e.getBoundingClientRect();if(!ir.equalDomRects(t,r._lastBBox)){var a=r._invTransform=ir.inverseTransformMatrix(ir.getFullTransformMatrix(e));r._invScaleX=Math.sqrt(a[0][0]*a[0][0]+a[0][1]*a[0][1]+a[0][2]*a[0][2]),r._invScaleY=Math.sqrt(a[1][0]*a[1][0]+a[1][1]*a[1][1]+a[1][2]*a[1][2]),r._lastBBox=t}}function Jye(e){var r=Qy.select(e),t=e._fullLayout;if(t._calcInverseTransform=Xye,t._calcInverseTransform(e),t._container=r.selectAll(".plot-container").data([0]),t._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),t._paperdiv=t._container.selectAll(".svg-container").data([0]),t._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),t._glcontainer=t._paperdiv.selectAll(".gl-container").data([{}]),t._glcontainer.enter().append("div").classed("gl-container",!0),t._paperdiv.selectAll(".main-svg").remove(),t._paperdiv.select(".modebar-container").remove(),t._paper=t._paperdiv.insert("svg",":first-child").classed("main-svg",!0),t._toppaper=t._paperdiv.append("svg").classed("main-svg",!0),t._modebardiv=t._paperdiv.append("div"),delete t._modeBar,t._hoverpaper=t._paperdiv.append("svg").classed("main-svg",!0),!t._uid){var a={};Qy.selectAll("defs").each(function(){this.id&&(a[this.id.split("-")[1]]=1)}),t._uid=ir.randstr(a)}t._paperdiv.selectAll(".main-svg").attr(Aye.svgAttrs),t._defs=t._paper.append("defs").attr("id","defs-"+t._uid),t._clips=t._defs.append("g").classed("clips",!0),t._topdefs=t._toppaper.append("defs").attr("id","topdefs-"+t._uid),t._topclips=t._topdefs.append("g").classed("clips",!0),t._bgLayer=t._paper.append("g").classed("bglayer",!0),t._draggers=t._paper.append("g").classed("draglayer",!0);var n=t._paper.append("g").classed("layer-below",!0);t._imageLowerLayer=n.append("g").classed("imagelayer",!0),t._shapeLowerLayer=n.append("g").classed("shapelayer",!0),t._cartesianlayer=t._paper.append("g").classed("cartesianlayer",!0),t._polarlayer=t._paper.append("g").classed("polarlayer",!0),t._smithlayer=t._paper.append("g").classed("smithlayer",!0),t._ternarylayer=t._paper.append("g").classed("ternarylayer",!0),t._geolayer=t._paper.append("g").classed("geolayer",!0),t._funnelarealayer=t._paper.append("g").classed("funnelarealayer",!0),t._pielayer=t._paper.append("g").classed("pielayer",!0),t._iciclelayer=t._paper.append("g").classed("iciclelayer",!0),t._treemaplayer=t._paper.append("g").classed("treemaplayer",!0),t._sunburstlayer=t._paper.append("g").classed("sunburstlayer",!0),t._indicatorlayer=t._toppaper.append("g").classed("indicatorlayer",!0),t._glimages=t._paper.append("g").classed("glimages",!0);var i=t._toppaper.append("g").classed("layer-above",!0);t._imageUpperLayer=i.append("g").classed("imagelayer",!0),t._shapeUpperLayer=i.append("g").classed("shapelayer",!0),t._selectionLayer=t._toppaper.append("g").classed("selectionlayer",!0),t._infolayer=t._toppaper.append("g").classed("infolayer",!0),t._menulayer=t._toppaper.append("g").classed("menulayer",!0),t._zoomlayer=t._toppaper.append("g").classed("zoomlayer",!0),t._hoverlayer=t._hoverpaper.append("g").classed("hoverlayer",!0),t._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),e.emit("plotly_framework")}Wr.animate=Yye;Wr.addFrames=Wye;Wr.deleteFrames=jye;Wr.addTraces=IN;Wr.deleteTraces=zN;Wr.extendTraces=FN;Wr.moveTraces=z_;Wr.prependTraces=NN;Wr.newPlot=Eye;Wr._doPlot=Sye;Wr.purge=Zye;Wr.react=Uye;Wr.redraw=Cye;Wr.relayout=u0;Wr.restyle=tm;Wr.setPlotConfig=qye;Wr.update=nm;Wr._guiRelayout=O_(u0);Wr._guiRestyle=O_(tm);Wr._guiUpdate=O_(nm);Wr._storeDirectGUIEdit=Fye});var Tl=N(Vo=>{"use strict";var $ye=br();Vo.getDelay=function(e){return e._has&&(e._has("gl3d")||e._has("mapbox")||e._has("map"))?500:0};Vo.getRedrawFunc=function(e){return function(){$ye.getComponentMethod("colorbar","draw")(e)}};Vo.encodeSVG=function(e){return"data:image/svg+xml,"+encodeURIComponent(e)};Vo.encodeJSON=function(e){return"data:application/json,"+encodeURIComponent(e)};var YN=window.URL||window.webkitURL;Vo.createObjectURL=function(e){return YN.createObjectURL(e)};Vo.revokeObjectURL=function(e){return YN.revokeObjectURL(e)};Vo.createBlob=function(e,r){if(r==="svg")return new window.Blob([e],{type:"image/svg+xml;charset=utf-8"});if(r==="full-json")return new window.Blob([e],{type:"application/json;charset=utf-8"});var t=Kye(window.atob(e));return new window.Blob([t],{type:"image/"+r})};Vo.octetStream=function(e){document.location.href="data:application/octet-stream"+e};function Kye(e){for(var r=e.length,t=new ArrayBuffer(r),a=new Uint8Array(t),n=0;n{"use strict";var U_=Sr(),KPe=Ee(),Qye=Yr(),eme=Tr(),QPe=dl(),H_=/"/g,c0="TOBESTRIPPED",rme=new RegExp('("'+c0+")|("+c0+'")',"g");function tme(e){var r=U_.select("body").append("div").style({display:"none"}).html(""),t=e.replace(/(&[^;]*;)/gi,function(a){return a==="<"?"<":a==="&rt;"?">":a.indexOf("<")!==-1||a.indexOf(">")!==-1?"":r.html(a).text()});return r.remove(),t}function ame(e){return e.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}WN.exports=function(r,t,a){var n=r._fullLayout,i=n._paper,o=n._toppaper,l=n.width,s=n.height,u;i.insert("rect",":first-child").call(Qye.setRect,0,0,l,s).call(eme.fill,n.paper_bgcolor);var f=n._basePlotModules||[];for(u=0;u{"use strict";var nme=Ee(),ime=su().EventEmitter,v0=Tl();function ome(e){var r=e.emitter||new ime,t=new Promise(function(a,n){var i=window.Image,o=e.svg,l=e.format||"png",s=e.canvas,u=e.scale||1,f=e.width||300,c=e.height||150,v=u*f,d=u*c,p=s.getContext("2d",{willReadFrequently:!0}),y=new i,m,x;l==="svg"||nme.isSafari()?x=v0.encodeSVG(o):(m=v0.createBlob(o,"svg"),x=v0.createObjectURL(m)),s.width=v,s.height=d,y.onload=function(){var T;switch(m=null,v0.revokeObjectURL(x),l!=="svg"&&p.drawImage(y,0,0,v,d),l){case"jpeg":T=s.toDataURL("image/jpeg");break;case"png":T=s.toDataURL("image/png");break;case"webp":T=s.toDataURL("image/webp");break;case"svg":T=x;break;default:var _="Image format is not jpeg, png, svg or webp.";if(n(new Error(_)),!e.promise)return r.emit("error",_)}a(T),e.promise||r.emit("success",T)},y.onerror=function(T){if(m=null,v0.revokeObjectURL(x),n(T),!e.promise)return r.emit("error",T)},y.src=x});return e.promise?t:r}jN.exports=ome});var V_=N((tFe,JN)=>{"use strict";var ZN=Rr(),XN=B_(),lme=aa(),Yo=Ee(),h0=Tl(),sme=sm(),ume=um(),fme=mp().version,G_={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};function cme(e,r){r=r||{};var t,a,n,i;Yo.isPlainObject(e)?(t=e.data||[],a=e.layout||{},n=e.config||{},i={}):(e=Yo.getGraphDiv(e),t=Yo.extendDeep([],e.data),a=Yo.extendDeep({},e.layout),n=e._context,i=e._fullLayout||{});function o(k){return!(k in r)||Yo.validate(r[k],G_[k])}if(!o("width")&&r.width!==null||!o("height")&&r.height!==null)throw new Error("Height and width should be pixel values.");if(!o("format"))throw new Error("Export format is not "+Yo.join2(G_.format.values,", "," or ")+".");var l={};function s(k,M){return Yo.coerce(r,l,G_,k,M)}var u=s("format"),f=s("width"),c=s("height"),v=s("scale"),d=s("setBackground"),p=s("imageDataOnly"),y=document.createElement("div");y.style.position="absolute",y.style.left="-5000px",document.body.appendChild(y);var m=Yo.extendFlat({},a);f?m.width=f:r.width===null&&ZN(i.width)&&(m.width=i.width),c?m.height=c:r.height===null&&ZN(i.height)&&(m.height=i.height);var x=Yo.extendFlat({},n,{_exportedPlot:!0,staticPlot:!0,setBackground:d}),T=h0.getRedrawFunc(y);function _(){return new Promise(function(k){setTimeout(k,h0.getDelay(y._fullLayout))})}function b(){return new Promise(function(k,M){var q=sme(y,u,v),E=y._fullLayout.width,D=y._fullLayout.height;function P(){XN.purge(y),document.body.removeChild(y)}if(u==="full-json"){var R=lme.graphJson(y,!1,"keepdata","object",!0,!0);return R.version=fme,R=JSON.stringify(R),P(),k(p?R:h0.encodeJSON(R))}if(P(),u==="svg")return k(p?q:h0.encodeSVG(q));var z=document.createElement("canvas");z.id=Yo.randstr(),ume({format:u,width:E,height:D,scale:v,canvas:z,svg:q,promise:!0}).then(k).catch(M)})}function w(k){return p?k.replace(h0.IMAGE_URL_PREFIX,""):k}return new Promise(function(k,M){XN.newPlot(y,t,m,x).then(T).then(_).then(b).then(function(q){k(w(q))}).catch(function(q){M(q)})})}JN.exports=cme});var QN=N((aFe,KN)=>{"use strict";var qi=Ee(),vme=aa(),hme=Jf(),dme=tu().dfltConfig,fo=qi.isPlainObject,Fu=Array.isArray,Y_=qi.isArrayOrTypedArray;KN.exports=function(r,t){r===void 0&&(r=[]),t===void 0&&(t={});var a=hme.get(),n=[],i={_context:qi.extendFlat({},dme)},o,l;Fu(r)?(i.data=qi.extendDeep([],r),o=r):(i.data=[],o=[],n.push(La("array","data"))),fo(t)?(i.layout=qi.extendDeep({},t),l=t):(i.layout={},l={},arguments.length>1&&n.push(La("object","layout"))),vme.supplyDefaults(i);for(var s=i._fullData,u=o.length,f=0;fc.length&&a.push(La("unused",n,u.concat(c.length)));var x=c.length,T=Array.isArray(m);T&&(x=Math.min(x,m.length));var _,b,w,k,M;if(v.dimensions===2)for(b=0;bc[b].length&&a.push(La("unused",n,u.concat(b,c[b].length)));var q=c[b].length;for(_=0;_<(T?Math.min(q,m[b].length):q);_++)w=T?m[b][_]:m,k=f[b][_],M=c[b][_],qi.validate(k,w)?M!==k&&M!==+k&&a.push(La("dynamic",n,u.concat(b,_),k,M)):a.push(La("value",n,u.concat(b,_),k))}else a.push(La("array",n,u.concat(b),f[b]));else for(b=0;b{"use strict";var _me=Ee(),cm=Tl();function wme(e,r,t){var a=document.createElement("a"),n="download"in a,i=new Promise(function(o,l){var s,u;if(n)return s=cm.createBlob(e,t),u=cm.createObjectURL(s),a.href=u,a.download=r,document.body.appendChild(a),a.click(),document.body.removeChild(a),cm.revokeObjectURL(u),s=null,o(r);if(_me.isSafari()){var f=t==="svg"?",":";base64,";return cm.octetStream(f+encodeURIComponent(e)),o(r)}l(new Error("download error"))});return i}eI.exports=wme});var W_=N((oFe,aI)=>{"use strict";var tI=Ee(),Tme=V_(),Ame=rI(),iFe=Tl();function Mme(e,r){var t;return tI.isPlainObject(e)||(t=tI.getGraphDiv(e)),r=r||{},r.format=r.format||"png",r.width=r.width||null,r.height=r.height||null,r.imageDataOnly=!0,new Promise(function(a,n){t&&t._snapshotInProgress&&n(new Error("Snapshotting already in progress.")),t&&(t._snapshotInProgress=!0);var i=Tme(e,r),o=r.filename||e.fn||"newplot";o+="."+r.format.replace("-","."),i.then(function(l){return t&&(t._snapshotInProgress=!1),Ame(l,o,r.format)}).then(function(l){a(l)}).catch(function(l){t&&(t._snapshotInProgress=!1),n(l)})})}aI.exports=Mme});var sI=N(j_=>{"use strict";var zn=Ee(),On=zn.isPlainObject,nI=Jf(),iI=aa(),kme=gn(),oI=wt(),lI=tu().dfltConfig;j_.makeTemplate=function(e){e=zn.isPlainObject(e)?e:zn.getGraphDiv(e),e=zn.extendDeep({_context:lI},{data:e.data,layout:e.layout}),iI.supplyDefaults(e);var r=e.data||[],t=e.layout||{};t._basePlotModules=e._fullLayout._basePlotModules,t._modules=e._fullLayout._modules;var a={data:{},layout:{}};r.forEach(function(d){var p={};d0(d,p,qme.bind(null,d));var y=zn.coerce(d,{},kme,"type"),m=a.data[y];m||(m=a.data[y]=[]),m.push(p)}),d0(t,a.layout,Sme.bind(null,t)),delete a.layout.template;var n=t.template;if(On(n)){var i=n.layout,o,l,s,u,f,c;On(i)&&vm(i,a.layout);var v=n.data;if(On(v)){for(l in a.data)if(s=v[l],Array.isArray(s)){for(f=a.data[l],c=f.length,u=s.length,o=0;ox?o.push({code:"unused",traceType:d,templateCount:m,dataCount:x}):x>m&&o.push({code:"reused",traceType:d,templateCount:m,dataCount:x})}}function T(_,b){for(var w in _)if(w.charAt(0)!=="_"){var k=_[w],M=Li(_,w,b);On(k)?(Array.isArray(_)&&k._template===!1&&k.templateitemname&&o.push({code:"missing",path:M,templateitemname:k.templateitemname}),T(k,M)):Array.isArray(k)&&Lme(k)&&T(k,M)}}if(T({data:s,layout:l},""),o.length)return o.map(Cme)};function Lme(e){for(var r=0;r{"use strict";var _a=B_();Dt._doPlot=_a._doPlot;Dt.newPlot=_a.newPlot;Dt.restyle=_a.restyle;Dt.relayout=_a.relayout;Dt.redraw=_a.redraw;Dt.update=_a.update;Dt._guiRestyle=_a._guiRestyle;Dt._guiRelayout=_a._guiRelayout;Dt._guiUpdate=_a._guiUpdate;Dt._storeDirectGUIEdit=_a._storeDirectGUIEdit;Dt.react=_a.react;Dt.extendTraces=_a.extendTraces;Dt.prependTraces=_a.prependTraces;Dt.addTraces=_a.addTraces;Dt.deleteTraces=_a.deleteTraces;Dt.moveTraces=_a.moveTraces;Dt.purge=_a.purge;Dt.addFrames=_a.addFrames;Dt.deleteFrames=_a.deleteFrames;Dt.animate=_a.animate;Dt.setPlotConfig=_a.setPlotConfig;var Eme=nh().getGraphDiv,Dme=My().eraseActiveShape;Dt.deleteActiveShape=function(e){return Dme(Eme(e))};Dt.toImage=V_();Dt.validate=QN();Dt.downloadImage=W_();var uI=sI();Dt.makeTemplate=uI.makeTemplate;Dt.validateTemplate=uI.validateTemplate});var X_=N((uFe,cI)=>{"use strict";var Z_=Ee(),Rme=br();cI.exports=function(r,t,a,n){var i=n("x"),o=n("y"),l,s=Rme.getComponentMethod("calendars","handleTraceDefaults");if(s(r,t,["x","y"],a),i){var u=Z_.minRowLength(i);o?l=Math.min(u,Z_.minRowLength(o)):(l=u,n("y0"),n("dy"))}else{if(!o)return 0;l=Z_.minRowLength(o),n("x0"),n("dx")}return t._length=l,l}});var Mc=N((fFe,dI)=>{"use strict";var vI=Ee().dateTick0,Pme=Ft(),Fme=Pme.ONEWEEK;function hI(e,r){return e%Fme===0?vI(r,1):vI(r,0)}dI.exports=function(r,t,a,n,i){if(i||(i={x:!0,y:!0}),i.x){var o=n("xperiod");o&&(n("xperiod0",hI(o,t.xcalendar)),n("xperiodalignment"))}if(i.y){var l=n("yperiod");l&&(n("yperiod0",hI(l,t.ycalendar)),n("yperiodalignment"))}}});var mI=N((cFe,yI)=>{"use strict";var pI=["orientation","groupnorm","stackgaps"];yI.exports=function(r,t,a,n){var i=a._scatterStackOpts,o=n("stackgroup");if(o){var l=t.xaxis+t.yaxis,s=i[l];s||(s=i[l]={});var u=s[o],f=!1;u?u.traces.push(t):(u=s[o]={traceIndices:[],traces:[t]},f=!0);for(var c={orientation:t.x&&!t.y?"h":"v"},v=0;v{"use strict";var gI=Tr(),bI=Zn().hasColorscale,xI=yl(),Nme=Pn();_I.exports=function(r,t,a,n,i,o={}){var l=Nme.isBubble(r),s=(r.line||{}).color,u;if(s&&(a=s),i("marker.symbol"),i("marker.opacity",l?.7:1),i("marker.size"),o.noAngle||(i("marker.angle"),o.noAngleRef||i("marker.angleref"),o.noStandOff||i("marker.standoff")),i("marker.color",a),bI(r,"marker")&&xI(r,t,n,i,{prefix:"marker.",cLetter:"c"}),o.noSelect||(i("selected.marker.color"),i("unselected.marker.color"),i("selected.marker.size"),i("unselected.marker.size")),o.noLine||(s&&!Array.isArray(s)&&t.marker.color!==s?u=s:l?u=gI.background:u=gI.defaultLine,i("marker.line.color",u),bI(r,"marker.line")&&xI(r,t,n,i,{prefix:"marker.line.",cLetter:"c"}),i("marker.line.width",l?1:0),o.noLineDash||i("marker.line.dash")),l&&(i("marker.sizeref"),i("marker.sizemin"),i("marker.sizemode")),o.gradient){var f=i("marker.gradient.type");f!=="none"&&i("marker.gradient.color")}}});var $_=N((hFe,wI)=>{"use strict";var Ime=Ee().isArrayOrTypedArray,zme=Zn().hasColorscale,Ome=yl();wI.exports=function(r,t,a,n,i,o){o||(o={});var l=(r.marker||{}).color;if(l&&l._inputArray&&(l=l._inputArray),i("line.color",a),zme(r,"line"))Ome(r,t,n,i,{prefix:"line.",cLetter:"c"});else{var s=(Ime(l)?!1:l)||a;i("line.color",s)}i("line.width"),o.noDash||i("line.dash"),o.backoff&&i("line.backoff")}});var K_=N((dFe,TI)=>{"use strict";TI.exports=function(r,t,a){var n=a("line.shape");n==="spline"&&a("line.smoothing")}});var Q_=N((pFe,AI)=>{"use strict";var Bme=Ee();AI.exports=function(e,r,t,a,n){n=n||{},a("textposition"),Bme.coerceFont(a,"textfont",n.font||t.font,n),n.noSelect||(a("selected.textfont.color"),a("unselected.textfont.color"))}});var e4=N((yFe,kI)=>{"use strict";var dm=Tr(),MI=Ee().isArrayOrTypedArray;function Hme(e){for(var r=dm.interpolate(e[0][1],e[1][1],.5),t=2;t{"use strict";var SI=Ee(),Ume=br(),Gme=Ai(),Vme=r0(),kc=Pn(),Yme=X_(),Wme=Mc(),jme=mI(),Zme=J_(),Xme=$_(),qI=K_(),Jme=Q_(),$me=e4(),Kme=Ee().coercePattern;LI.exports=function(r,t,a,n){function i(d,p){return SI.coerce(r,t,Gme,d,p)}var o=Yme(r,t,n,i);if(o||(t.visible=!1),!!t.visible){Wme(r,t,n,i),i("xhoverformat"),i("yhoverformat"),i("zorder");var l=jme(r,t,n,i);n.scattermode==="group"&&t.orientation===void 0&&i("orientation","v");var s=!l&&o{"use strict";var Qme=Ru().getAxisGroup;EI.exports=function(r,t,a,n,i){var o=t.orientation,l=t[{v:"x",h:"y"}[o]+"axis"],s=Qme(a,l)+o,u=a._alignmentOpts||{},f=n("alignmentgroup"),c=u[s];c||(c=u[s]={});var v=c[f];v?v.traces.push(t):v=c[f]={traces:[t],alignmentIndex:Object.keys(c).length,offsetGroups:{}};var d=n("offsetgroup")||"",p=v.offsetGroups,y=p[d];t._offsetIndex=0,(i!=="group"||d)&&(y||(y=p[d]={offsetIndex:Object.keys(p).length}),t._offsetIndex=y.offsetIndex)}});var RI=N((bFe,DI)=>{"use strict";var ege=Ee(),rge=p0(),tge=Ai();DI.exports=function(r,t){var a,n,i,o=t.scattermode;function l(v){return ege.coerce(n._input,n,tge,v)}if(t.scattermode==="group")for(i=0;i=0;f--){var c=r[f];if(c.type==="scatter"&&c.xaxis===s.xaxis&&c.yaxis===s.yaxis){c.opacity=void 0;break}}}}}});var FI=N((xFe,PI)=>{"use strict";var age=Ee(),nge=n1();PI.exports=function(e,r){function t(n,i){return age.coerce(e,r,nge,n,i)}var a=r.barmode==="group";r.scattermode==="group"&&t("scattergap",a?r.bargap:.2)}});var Sc=N((_Fe,II)=>{"use strict";var ige=Rr(),NI=Ee(),oge=NI.dateTime2ms,pm=NI.incrementMonth,lge=Ft(),sge=lge.ONEAVGMONTH;II.exports=function(r,t,a,n){if(t.type!=="date")return{vals:n};var i=r[a+"periodalignment"];if(!i)return{vals:n};var o=r[a+"period"],l;if(ige(o)){if(o=+o,o<=0)return{vals:n}}else if(typeof o=="string"&&o.charAt(0)==="M"){var s=+o.substring(1);if(s>0&&Math.round(s)===s)l=s;else return{vals:n}}for(var u=t.calendar,f=i==="start",c=i==="end",v=r[a+"period0"],d=oge(v,u)||0,p=[],y=[],m=[],x=n.length,T=0;T_;)k=pm(k,-l,u);for(;k<=_;)k=pm(k,l,u);w=pm(k,-l,u)}else{for(b=Math.round((_-d)/o),k=d+b*o;k>_;)k-=o;for(;k<=_;)k+=o;w=k-o}p[T]=f?w:c?k:(w+k)/2,y[T]=w,m[T]=k}return{vals:p,starts:y,ends:m}}});var a4=N((wFe,OI)=>{"use strict";var r4=Zn().hasColorscale,t4=ec(),zI=Pn();OI.exports=function(r,t){zI.hasLines(t)&&r4(t,"line")&&t4(r,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),zI.hasMarkers(t)&&(r4(t,"marker")&&t4(r,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),r4(t,"marker.line")&&t4(r,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}});var ym=N((TFe,BI)=>{"use strict";var Ut=Ee();BI.exports=function(r,t){for(var a=0;a{"use strict";var HI=Ee();UI.exports=function(r,t){HI.isArrayOrTypedArray(t.selectedpoints)&&HI.tagSelected(r,t)}});var gm=N((MFe,XI)=>{"use strict";var GI=Rr(),i4=Ee(),y0=zr(),VI=Sc(),n4=Ft().BADNUM,o4=Pn(),uge=a4(),fge=ym(),cge=mm();function vge(e,r){var t=e._fullLayout,a=r._xA=y0.getFromId(e,r.xaxis||"x","x"),n=r._yA=y0.getFromId(e,r.yaxis||"y","y"),i=a.makeCalcdata(r,"x"),o=n.makeCalcdata(r,"y"),l=VI(r,a,"x",i),s=VI(r,n,"y",o),u=l.vals,f=s.vals,c=r._length,v=new Array(c),d=r.ids,p=l4(r,t,a,n),y=!1,m,x,T,_,b,w;jI(t,r);var k="x",M="y",q;if(p)i4.pushUnique(p.traceIndices,r.index),m=p.orientation==="v",m?(M="s",q="x"):(k="s",q="y"),b=p.stackgaps==="interpolate";else{var E=WI(r,c);YI(e,r,a,n,u,f,E)}var D=!!r.xperiodalignment,P=!!r.yperiodalignment;for(x=0;xx&&v[_].gap;)_--;for(w=v[_].s,T=v.length-1;T>_;T--)v[T].s=w;for(;x<_;)if(x++,v[x].gap){for(T=x+1;v[T].gap;)T++;for(var B=v[x-1][q],G=v[x-1].s,Y=(v[T].s-G)/(v[T][q]-B);x{"use strict";JI.exports=bm;var hge=Ee().distinctVals;function bm(e,r){this.traces=e,this.sepNegVal=r.sepNegVal,this.overlapNoMerge=r.overlapNoMerge;for(var t=1/0,a=r.posAxis._id.charAt(0),n=[],i=0;i{"use strict";KI.exports={TEXTPAD:3,eventDataKeys:["value","label"]}});var _m=N((qFe,tz)=>{"use strict";var Ci=Rr(),{isArrayOrTypedArray:Al}=Ee(),{BADNUM:qc}=Ft(),dge=br(),g0=zr(),{getAxisGroup:pge}=Ru(),xm=$I(),{TEXTPAD:yge}=m0(),{LINE_SPACING:mge}=Ha(),{BR_TAG_ALL:gge}=Aa();function bge(e,r){for(var t=r.xaxis,a=r.yaxis,n=e._fullLayout,i=e._fullData,o=e.calcdata,l=[],s=[],u=0;us+o||!Ci(l))}for(var f=0;fa(i))):a(e.text);let n=e.outsidetextfont.size*mge*t+yge;return{ppadplus:r.some(i=>i.s<0)?n:0,ppadminus:r.some(i=>i.s>=0)?n:0}}return{ppadplus:void 0,ppadminus:void 0}}function Lge(e,r,t,a){for(var n=Lc(a),i=0;i{"use strict";var az=gm(),nz=_m().setGroupPositions;function Ege(e,r){for(var t=r.xaxis,a=r.yaxis,n=e._fullLayout,i=e._fullData,o=e.calcdata,l=[],s=[],u=0;uE[f]&&f{"use strict";var Rge=Yr(),fz=Ft(),b0=fz.BADNUM,cz=fz.LOG_CLIP,lz=cz+.5,sz=cz-.5,wm=Ee(),Pge=wm.segmentsIntersect,uz=wm.constrain,d4=r0();vz.exports=function(r,t){var a=t.trace||{},n=t.xaxis,i=t.yaxis,o=n.type==="log",l=i.type==="log",s=n._length,u=i._length,f=t.backoff,c=a.marker,v=t.connectGaps,d=t.baseTolerance,p=t.shape,y=p==="linear",m=a.fill&&a.fill!=="none",x=[],T=d4.minTolerance,_=r.length,b=new Array(_),w=0,k,M,q,E,D,P,R,z,I,B,G,Y,V,H,X,j;function ee(Ie){var ne=r[Ie];if(!ne)return!1;var de=t.linearized?n.l2p(ne.x):n.c2p(ne.x),Re=t.linearized?i.l2p(ne.y):i.c2p(ne.y);if(de===b0){if(o&&(de=n.c2p(ne.x,!0)),de===b0)return!1;l&&Re===b0&&(de*=Math.abs(n._m*u*(n._m>0?lz:sz)/(i._m*s*(i._m>0?lz:sz)))),de*=1e3}if(Re===b0){if(l&&(Re=i.c2p(ne.y,!0)),Re===b0)return!1;Re*=1e3}return[de,Re]}function fe(Ie,ne,de,Re){var Fe=de-Ie,Ke=Re-ne,cr=.5-Ie,ur=.5-ne,Mr=Fe*Fe+Ke*Ke,Ir=Fe*cr+Ke*ur;if(Ir>0&&Ir1||Math.abs(cr.y-de[0][1])>1)&&(cr=[cr.x,cr.y],Re&&we(cr,Ie)he||Ie[1]W)return[uz(Ie[0],ce,he),uz(Ie[1],ye,W)]}function Be(Ie,ne){if(Ie[0]===ne[0]&&(Ie[0]===ce||Ie[0]===he)||Ie[1]===ne[1]&&(Ie[1]===ye||Ie[1]===W))return!0}function Ge(Ie,ne){var de=[],Re=ze(Ie),Fe=ze(ne);return Re&&Fe&&Be(Re,Fe)||(Re&&de.push(Re),Fe&&de.push(Fe)),de}function De(Ie,ne,de){return function(Re,Fe){var Ke=ze(Re),cr=ze(Fe),ur=[];if(Ke&&cr&&Be(Ke,cr))return ur;Ke&&ur.push(Ke),cr&&ur.push(cr);var Mr=2*wm.constrain((Re[Ie]+Fe[Ie])/2,ne,de)-((Ke||Re)[Ie]+(cr||Fe)[Ie]);if(Mr){var Ir;Ke&&cr?Ir=Mr>0==Ke[Ie]>cr[Ie]?Ke:cr:Ir=Ke||cr,Ir[Ie]+=Mr}return ur}}var Oe;p==="linear"||p==="spline"?Oe=Le:p==="hv"||p==="vh"?Oe=Ge:p==="hvh"?Oe=De(0,ce,he):p==="vhv"&&(Oe=De(1,ye,W));function Ue(Ie,ne){var de=ne[0]-Ie[0],Re=(ne[1]-Ie[1])/de,Fe=(Ie[1]*ne[0]-ne[1]*Ie[0])/de;return Fe>0?[Re>0?ce:he,W]:[Re>0?he:ce,ye]}function oe(Ie){var ne=Ie[0],de=Ie[1],Re=ne===b[w-1][0],Fe=de===b[w-1][1];if(!(Re&&Fe))if(w>1){var Ke=ne===b[w-2][0],cr=de===b[w-2][1];Re&&(ne===ce||ne===he)&&Ke?cr?w--:b[w-1]=Ie:Fe&&(de===ye||de===W)&&cr?Ke?w--:b[w-1]=Ie:b[w++]=Ie}else b[w++]=Ie}function Ae(Ie){b[w-1][0]!==Ie[0]&&b[w-1][1]!==Ie[1]&&oe([ve,me]),oe(Ie),Ce=null,ve=me=0}var Xe=wm.isArrayOrTypedArray(c);function dr(Ie){if(Ie&&f&&(Ie.i=k,Ie.d=r,Ie.trace=a,Ie.marker=Xe?c[Ie.i]:c,Ie.backoff=f),ie=Ie[0]/s,ue=Ie[1]/u,Z=Ie[0]he?he:0,le=Ie[1]W?W:0,Z||le){if(!w)b[w++]=[Z||Ie[0],le||Ie[1]];else if(Ce){var ne=Oe(Ce,Ie);ne.length>1&&(Ae(ne[0]),b[w++]=ne[1])}else Pe=Oe(b[w-1],Ie)[0],b[w++]=Pe;var de=b[w-1];Z&&le&&(de[0]!==Z||de[1]!==le)?(Ce&&(ve!==Z&&me!==le?oe(ve&&me?Ue(Ce,Ie):[ve||Z,me||le]):ve&&me&&oe([ve,me])),oe([Z,le])):ve-Z&&me-le&&oe([Z||ve,le||me]),Ce=Ie,ve=Z,me=le}else Ce&&Ae(Oe(Ce,Ie)[0]),b[w++]=Ie}for(k=0;k<_;k++)if(M=ee(k),!!M){for(w=0,Ce=null,dr(M),k++;k<_;k++){if(E=ee(k),!E){if(v)continue;break}if(!y||!t.simplify){dr(E);continue}var Ne=ee(k+1);if(B=we(E,M),!(!(m&&(w===0||w===_-1))&&BK(P,Ne))break;q=P,V=I[0]*z[0]+I[1]*z[1],V>G?(G=V,E=P,R=!1):V=r.length||!P)break;dr(P),M=P}}Ce&&oe([ve||Ce[0],me||Ce[1]]),x.push(b.slice(0,w))}var Te=p.slice(p.length-1);if(f&&Te!=="h"&&Te!=="v"){for(var qe=!1,He=-1,Je=[],We=0;We{"use strict";var hz={tonextx:1,tonexty:1,tonext:1};dz.exports=function(r,t,a){var n,i,o,l,s,u={},f=!1,c=-1,v=0,d=-1;for(i=0;i=0?s=d:(s=d=v,v++),s{"use strict";var co=Sr(),Fge=br(),x0=Ee(),Cc=x0.ensureSingle,mz=x0.identity,Wt=Yr(),Ec=Pn(),Nge=p4(),Ige=pz(),Tm=f_().tester;gz.exports=function(r,t,a,n,i,o){var l,s,u=!i,f=!!i&&i.duration>0,c=Ige(r,t,a);if(l=n.selectAll("g.trace").data(c,function(d){return d[0].trace.uid}),l.enter().append("g").attr("class",function(d){return"trace scatter trace"+d[0].trace.uid}).style("stroke-miterlimit",2),l.order(),zge(r,l,t),f){o&&(s=o());var v=co.transition().duration(i.duration).ease(i.easing).each("end",function(){s&&s()}).each("interrupt",function(){s&&s()});v.each(function(){n.selectAll("g.trace").each(function(d,p){yz(r,p,t,d,c,this,i)})})}else l.each(function(d,p){yz(r,p,t,d,c,this,i)});u&&l.exit().remove(),n.selectAll("path:not([d])").remove()};function zge(e,r,t){r.each(function(a){var n=Cc(co.select(this),"g","fills");Wt.setClipUrl(n,t.layerClipId,e);var i=a[0].trace;i._ownFill=null,i._nextFill=null;var o=[];i._ownfill&&o.push("_ownFill"),i._nexttrace&&o.push("_nextFill");var l=n.selectAll("g").data(o,mz);l.enter().append("g"),l.exit().remove(),l.order().each(function(s){i[s]=Cc(co.select(this),"path","js-fill")})})}function yz(e,r,t,a,n,i,o){var l=e._context.staticPlot,s;Oge(e,r,t,a,n);var u=!!o&&o.duration>0;function f(De){return u?De.transition():De}var c=t.xaxis,v=t.yaxis,d=a[0].trace,p=d.line,y=co.select(i),m=Cc(y,"g","errorbars"),x=Cc(y,"g","lines"),T=Cc(y,"g","points"),_=Cc(y,"g","text");if(Fge.getComponentMethod("errorbars","plot")(e,m,t,o),d.visible!==!0)return;f(y).style("opacity",d.opacity);var b,w,k=d.fill.charAt(d.fill.length-1);k!=="x"&&k!=="y"&&(k="");var M,q;k==="y"?(M=1,q=v.c2p(0,!0)):k==="x"&&(M=0,q=c.c2p(0,!0)),a[0][t.isRangePlot?"nodeRangePlot3":"node3"]=y;var E="",D=[],P=d._prevtrace,R=null,z=null;P&&(E=P._prevRevpath||"",w=P._nextFill,D=P._ownPolygons,R=P._fillsegments,z=P._fillElement);var I,B,G="",Y="",V,H,X,j,ee,fe,ie=[];d._polygons=[];var ue=[],K=[],we=x0.noop;if(b=d._ownFill,Ec.hasLines(d)||d.fill!=="none"){w&&w.datum(a),["hv","vh","hvh","vhv"].indexOf(p.shape)!==-1?(V=Wt.steps(p.shape),H=Wt.steps(p.shape.split("").reverse().join(""))):p.shape==="spline"?V=H=function(De){var Oe=De[De.length-1];return De.length>1&&De[0][0]===Oe[0]&&De[0][1]===Oe[1]?Wt.smoothclosed(De.slice(1),p.smoothing):Wt.smoothopen(De,p.smoothing)}:V=H=function(De){return"M"+De.join("L")},X=function(De){return H(De.reverse())},K=Nge(a,{xaxis:c,yaxis:v,trace:d,connectGaps:d.connectgaps,baseTolerance:Math.max(p.width||1,3)/4,shape:p.shape,backoff:p.backoff,simplify:p.simplify,fill:d.fill}),ue=new Array(K.length);var se=0;for(s=0;s=l[0]&&y.x<=l[1]&&y.y>=s[0]&&y.y<=s[1]}),v=Math.ceil(c.length/f),d=0;n.forEach(function(y,m){var x=y[0].trace;Ec.hasMarkers(x)&&x.marker.maxdisplayed>0&&m{"use strict";bz.exports={container:"marker",min:"cmin",max:"cmax"}});var m4=N((PFe,xz)=>{"use strict";var Am=zr();xz.exports=function(r,t,a){var n={},i={_fullLayout:a},o=Am.getFromTrace(i,t,"x"),l=Am.getFromTrace(i,t,"y"),s=r.orig_x;s===void 0&&(s=r.x);var u=r.orig_y;return u===void 0&&(u=r.y),n.xLabel=Am.tickText(o,o.c2l(s),!0).text,n.yLabel=Am.tickText(l,l.c2l(u),!0).text,n}});var Nu=N((FFe,_z)=>{"use strict";var g4=Sr(),Dc=Yr(),Bge=br();function Hge(e){var r=g4.select(e).selectAll("g.trace.scatter");r.style("opacity",function(t){return t[0].trace.opacity}),r.selectAll("g.points").each(function(t){var a=g4.select(this),n=t.trace||t[0].trace;b4(a,n,e)}),r.selectAll("g.text").each(function(t){var a=g4.select(this),n=t.trace||t[0].trace;x4(a,n,e)}),r.selectAll("g.trace path.js-line").call(Dc.lineGroupStyle),r.selectAll("g.trace path.js-fill").call(Dc.fillGroupStyle,e,!1),Bge.getComponentMethod("errorbars","style")(r)}function b4(e,r,t){Dc.pointStyle(e.selectAll("path.point"),r,t)}function x4(e,r,t){Dc.textPointStyle(e.selectAll("text"),r,t)}function Uge(e,r,t){var a=r[0].trace;a.selectedpoints?(Dc.selectedPointStyle(t.selectAll("path.point"),a),Dc.selectedTextStyle(t.selectAll("text"),a)):(b4(t,a,e),x4(t,a,e))}_z.exports={style:Hge,stylePoints:b4,styleText:x4,styleOnSelect:Uge}});var Tz=N((NFe,wz)=>{"use strict";var Rc=Tr(),Gge=Pn();wz.exports=function(r,t){var a,n;if(r.mode==="lines")return a=r.line.color,a&&Rc.opacity(a)?a:r.fillcolor;if(r.mode==="none")return r.fill?r.fillcolor:"";var i=t.mcc||(r.marker||{}).color,o=t.mlcc||((r.marker||{}).line||{}).color;return n=i&&Rc.opacity(i)?i:o&&Rc.opacity(o)&&(t.mlw||((r.marker||{}).line||{}).width)?o:"",n?Rc.opacity(n)<.3?Rc.addOpacity(n,.3):n:(a=(r.line||{}).color,a&&Rc.opacity(a)&&Gge.hasLines(r)&&r.line.width?a:r.fillcolor)}});var w4=N((IFe,Mz)=>{"use strict";var Mm=Ee(),Az=Fn(),Vge=br(),Yge=Tz(),_4=Tr(),Wge=Mm.fillText;Mz.exports=function(r,t,a,n){var i=r.cd,o=i[0].trace,l=r.xa,s=r.ya,u=l.c2p(t),f=s.c2p(a),c=[u,f],v=o.hoveron||"",d=o.mode.indexOf("markers")!==-1?3:.5,p=!!o.xperiodalignment,y=!!o.yperiodalignment;if(v.indexOf("points")!==-1){var m=function(Y){if(p){var V=l.c2p(Y.xStart),H=l.c2p(Y.xEnd);return u>=Math.min(V,H)&&u<=Math.max(V,H)?0:1/0}var X=Math.max(3,Y.mrc||0),j=1-1/X,ee=Math.abs(l.c2p(Y.x)-u);return ee=Math.min(V,H)&&f<=Math.max(V,H)?0:1/0}var X=Math.max(3,Y.mrc||0),j=1-1/X,ee=Math.abs(s.c2p(Y.y)-f);return eeie!=W>=ie&&(ce=we[K-1][0],he=we[K][0],W-ye&&(se=ce+(he-ce)*(ie-ye)/(W-ye),X=Math.min(X,se),j=Math.max(j,se)));return X=Math.max(X,0),j=Math.min(j,l._length),{x0:X,x1:j,y0:ie,y1:ie}}if(v.indexOf("fills")!==-1&&o._fillElement){var I=R(o._fillElement)&&!R(o._fillExclusionElement);if(I){var B=z(o._polygons);B===null&&(B={x0:c[0],x1:c[0],y0:c[1],y1:c[1]});var G=_4.defaultLine;return _4.opacity(o.fillcolor)?G=o.fillcolor:_4.opacity((o.line||{}).color)&&(G=o.line.color),Mm.extendFlat(r,{distance:r.maxHoverDistance,x0:B.x0,x1:B.x1,y0:B.y0,y1:B.y1,color:G,hovertemplate:!1}),delete r.index,o.text&&!Mm.isArrayOrTypedArray(o.text)?r.text=String(o.text):r.text=o.name,[r]}}}});var T4=N((zFe,Sz)=>{"use strict";var kz=Pn();Sz.exports=function(r,t){var a=r.cd,n=r.xaxis,i=r.yaxis,o=[],l=a[0].trace,s,u,f,c,v=!kz.hasMarkers(l)&&!kz.hasText(l);if(v)return[];if(t===!1)for(s=0;s{"use strict";qz.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}});var Rz=N((BFe,Dz)=>{"use strict";var w0=br().traceIs,A4=F1();Dz.exports=function(r,t,a,n){a("autotypenumbers",n.autotypenumbersDflt);var i=a("type",(n.splomStash||{}).type);i==="-"&&(jge(t,n.data),t.type==="-"?t.type="linear":r.type=t.type)};function jge(e,r){if(e.type==="-"){var t=e._id,a=t.charAt(0),n;t.indexOf("scene")!==-1&&(t=a);var i=Zge(r,t,a);if(i){if(i.type==="histogram"&&a==={v:"y",h:"x"}[i.orientation||"v"]){e.type="linear";return}var o=a+"calendar",l=i[o],s={noMultiCategory:!w0(i,"cartesian")||w0(i,"noMultiCategory")};if(i.type==="box"&&i._hasPreCompStats&&a==={h:"x",v:"y"}[i.orientation||"v"]&&(s.noMultiCategory=!0),s.autotypenumbers=e.autotypenumbers,Ez(i,a)){var u=Cz(i),f=[];for(n=0;n0&&(n["_"+t+"axes"]||{})[r])return n;if((n[t+"axis"]||t)===r){if(Ez(n,t))return n;if((n[t]||[]).length||n[t+"0"])return n}}}function Cz(e){return{v:"x",h:"y"}[e.orientation||"v"]}function Ez(e,r){var t=Cz(e),a=w0(e,"box-violin"),n=w0(e._fullInput||{},"candlestick");return a&&!n&&r===t&&e[t]===void 0&&e[t+"0"]===void 0}});var Fz=N((HFe,Pz)=>{"use strict";var Xge=Yn().isTypedArraySpec;function Jge(e,r){var t=r.dataAttr||e._id.charAt(0),a={},n,i,o;if(r.axData)n=r.axData;else for(n=[],i=0;i0||Xge(i),l;o&&(l="array");var s=a("categoryorder",l),u;s==="array"&&(u=a("categoryarray")),!o&&s==="array"&&(s=t.categoryorder="trace"),s==="trace"?t._initialCategories=[]:s==="array"?t._initialCategories=u.slice():(u=Jge(t,n).sort(),s==="category ascending"?t._initialCategories=u:s==="category descending"&&(t._initialCategories=u.reverse()))}}});var M4=N((UFe,Iz)=>{"use strict";var Nz=qn().mix,$ge=fi(),Kge=Ee();Iz.exports=function(r,t,a,n){n=n||{};var i=n.dfltColor;function o(q,E){return Kge.coerce2(r,t,n.attributes,q,E)}var l=o("linecolor",i),s=o("linewidth"),u=a("showline",n.showLine||!!l||!!s);u||(delete t.linecolor,delete t.linewidth);var f=Nz(i,n.bgColor,n.blend||$ge.lightFraction).toRgbString(),c=o("gridcolor",f),v=o("gridwidth"),d=o("griddash"),p=a("showgrid",n.showGrid||!!c||!!v||!!d);if(p||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),n.hasMinor){var y=Nz(t.gridcolor,n.bgColor,67).toRgbString(),m=o("minor.gridcolor",y),x=o("minor.gridwidth",t.gridwidth||1),T=o("minor.griddash",t.griddash||"solid"),_=a("minor.showgrid",!!m||!!x||!!T);_||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!n.noZeroLine){var b=o("zerolinelayer"),w=o("zerolinecolor",i),k=o("zerolinewidth"),M=a("zeroline",n.showGrid||!!w||!!k);M||(delete t.zerolinelayer,delete t.zerolinecolor,delete t.zerolinewidth)}}});var S4=N((GFe,Gz)=>{"use strict";var zz=Rr(),Qge=br(),T0=Ee(),e2e=wt(),r2e=io(),k4=pi(),Oz=p1(),Bz=y1(),t2e=g1(),a2e=b1(),n2e=Fz(),i2e=M4(),o2e=l5(),Hz=lc(),km=xa().WEEKDAY_PATTERN,l2e=xa().HOUR_PATTERN;Gz.exports=function(r,t,a,n,i){var o=n.letter,l=n.font||{},s=n.splomStash||{},u=a("visible",!n.visibleDflt),f=t._template||{},c=t.type||f.type||"-",v;if(c==="date"){var d=Qge.getComponentMethod("calendars","handleDefaults");d(r,t,"calendar",n.calendar),n.noTicklabelmode||(v=a("ticklabelmode"))}!n.noTicklabelindex&&(c==="date"||c==="linear")&&a("ticklabelindex");var p="";(!n.noTicklabelposition||c==="multicategory")&&(p=T0.coerce(r,t,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:v==="period"?["outside","inside"]:o==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),n.noTicklabeloverflow||a("ticklabeloverflow",p.indexOf("inside")!==-1?"hide past domain":c==="category"||c==="multicategory"?"allow":"hide past div"),Hz(t,i),o2e(r,t,a,n),n2e(r,t,a,n),n.noHover||(c!=="category"&&a("hoverformat"),n.noUnifiedhovertitle||a("unifiedhovertitle.text"));var y=a("color"),m=y!==k4.color.dflt?y:l.color,x=s.label||i._dfltTitle[o];if(a2e(r,t,a,c,n),!u)return t;a("title.text",x),T0.coerceFont(a,"title.font",l,{overrideDflt:{size:T0.bigFont(l.size),color:m}}),Oz(r,t,a,c);var T=n.hasMinor;if(T&&(e2e.newContainer(t,"minor"),Oz(r,t,a,c,{isMinor:!0})),t2e(r,t,a,c,n),Bz(r,t,a,n),T){var _=n.isMinor;n.isMinor=!0,Bz(r,t,a,n),n.isMinor=_}i2e(r,t,a,{dfltColor:y,bgColor:n.bgColor,showGrid:n.showGrid,hasMinor:T,attributes:k4}),T&&!t.minor.ticks&&!t.minor.showgrid&&delete t.minor,(t.showline||t.ticks)&&a("mirror");var b=c==="multicategory";if(!n.noTickson&&(c==="category"||b)&&(t.ticks||t.showgrid)&&(b?(a("tickson","boundaries"),delete t.ticklabelposition):a("tickson")),b){var w=a("showdividers");w&&(a("dividercolor"),a("dividerwidth"))}if(c==="date")if(r2e(r,t,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:s2e}),!t.rangebreaks.length)delete t.rangebreaks;else{for(var k=0;k=2){var o="",l,s;if(i.length===2){for(l=0;l<2;l++)if(s=Uz(i[l]),s){o=km;break}}var u=a("pattern",o);if(u===km)for(l=0;l<2;l++)s=Uz(i[l]),s&&(r.bounds[l]=i[l]=s-1);if(u)for(l=0;l<2;l++)switch(s=i[l],u){case km:if(!zz(s)){r.enabled=!1;return}if(s=+s,s!==Math.floor(s)||s<0||s>=7){r.enabled=!1;return}r.bounds[l]=i[l]=s;break;case l2e:if(!zz(s)){r.enabled=!1;return}if(s=+s,s<0||s>24){r.enabled=!1;return}r.bounds[l]=i[l]=s;break}if(t.autorange===!1){var f=t.range;if(f[0]f[1]){r.enabled=!1;return}}else if(i[0]>f[0]&&i[1]{"use strict";var f2e=Rr(),Sm=Ee();Vz.exports=function(r,t,a,n){var i=n.counterAxes||[],o=n.overlayableAxes||[],l=n.letter,s=n.grid,u=n.overlayingDomain,f,c,v,d,p,y;s&&(c=s._domains[l][s._axisMap[t._id]],f=s._anchors[t._id],c&&(v=s[l+"side"].split(" ")[0],d=s.domain[l][v==="right"||v==="top"?1:0])),c=c||[0,1],f=f||(f2e(r.position)?"free":i[0]||"free"),v=v||(l==="x"?"bottom":"left"),d=d||0,p=0,y=!1;var m=Sm.coerce(r,t,{anchor:{valType:"enumerated",values:["free"].concat(i),dflt:f}},"anchor"),x=Sm.coerce(r,t,{side:{valType:"enumerated",values:l==="x"?["bottom","top"]:["left","right"],dflt:v}},"side");if(m==="free"){if(l==="y"){var T=a("autoshift");T&&(d=x==="left"?u[0]:u[1],y=t.automargin?t.automargin:!0,p=x==="left"?-3:3),a("shift",p)}a("position",d)}a("automargin",y);var _=!1;if(o.length&&(_=Sm.coerce(r,t,{overlaying:{valType:"enumerated",values:[!1].concat(o),dflt:!1}},"overlaying")),!_){var b=a("domain",c);b[0]>b[1]-1/4096&&(t.domain=c),Sm.noneOrAll(r.domain,t.domain,c),t.tickmode==="sync"&&(t.tickmode="auto")}return a("layer"),t}});var Qz=N((YFe,Kz)=>{"use strict";var Iu=Ee(),Yz=Tr(),c2e=Eo().isUnifiedHover,v2e=R5(),Wz=wt(),h2e=Of(),jz=pi(),d2e=Rz(),Zz=S4(),p2e=Ru(),Xz=q4(),C4=fa(),Wo=C4.id2name,Jz=C4.name2id,y2e=xa().AX_ID_PATTERN,$z=br(),qm=$z.traceIs,L4=$z.getComponentMethod;function Lm(e,r,t){Array.isArray(e[r])?e[r].push(t):e[r]=[t]}Kz.exports=function(r,t,a){var n=t.autotypenumbers,i={},o={},l={},s={},u={},f={},c={},v={},d={},p={},y,m;for(y=0;y{"use strict";var m2e=Sr(),eO=br(),Cm=Ee(),ei=Yr(),Em=zr();rO.exports=function(r,t,a,n){var i=r._fullLayout;if(t.length===0){Em.redrawComponents(r);return}function o(m){var x=m.xaxis,T=m.yaxis;i._defs.select("#"+m.clipId+"> rect").call(ei.setTranslate,0,0).call(ei.setScale,1,1),m.plot.call(ei.setTranslate,x._offset,T._offset).call(ei.setScale,1,1);var _=m.plot.selectAll(".scatterlayer .trace");_.selectAll(".point").call(ei.setPointGroupScale,1,1),_.selectAll(".textpoint").call(ei.setTextPointsScale,1,1),_.call(ei.hideOutsideRangePoints,m)}function l(m,x){var T=m.plotinfo,_=T.xaxis,b=T.yaxis,w=_._length,k=b._length,M=!!m.xr1,q=!!m.yr1,E=[];if(M){var D=Cm.simpleMap(m.xr0,_.r2l),P=Cm.simpleMap(m.xr1,_.r2l),R=D[1]-D[0],z=P[1]-P[0];E[0]=(D[0]*(1-x)+x*P[0]-D[0])/(D[1]-D[0])*w,E[2]=w*(1-x+x*z/R),_.range[0]=_.l2r(D[0]*(1-x)+x*P[0]),_.range[1]=_.l2r(D[1]*(1-x)+x*P[1])}else E[0]=0,E[2]=w;if(q){var I=Cm.simpleMap(m.yr0,b.r2l),B=Cm.simpleMap(m.yr1,b.r2l),G=I[1]-I[0],Y=B[1]-B[0];E[1]=(I[1]*(1-x)+x*B[1]-I[1])/(I[0]-I[1])*k,E[3]=k*(1-x+x*Y/G),b.range[0]=_.l2r(I[0]*(1-x)+x*B[0]),b.range[1]=b.l2r(I[1]*(1-x)+x*B[1])}else E[1]=0,E[3]=k;Em.drawOne(r,_,{skipTitle:!0}),Em.drawOne(r,b,{skipTitle:!0}),Em.redrawComponents(r,[_._id,b._id]);var V=M?w/E[2]:1,H=q?k/E[3]:1,X=M?E[0]:0,j=q?E[1]:0,ee=M?E[0]/E[2]*w:0,fe=q?E[1]/E[3]*k:0,ie=_._offset-ee,ue=b._offset-fe;T.clipRect.call(ei.setTranslate,X,j).call(ei.setScale,1/V,1/H),T.plot.call(ei.setTranslate,ie,ue).call(ei.setScale,V,H),ei.setPointGroupScale(T.zoomScalePts,1/V,1/H),ei.setTextPointsScale(T.zoomScaleTxt,1/V,1/H)}var s;n&&(s=n());function u(){for(var m={},x=0;xa.duration?(u(),d=window.cancelAnimationFrame(y)):d=window.requestAnimationFrame(y)}return c=Date.now(),d=window.requestAnimationFrame(y),Promise.resolve()}});var Ei=N(Qa=>{"use strict";var Rm=Sr(),aO=br(),zu=Ee(),g2e=aa(),b2e=Yr(),nO=l1().getModuleCalcData,ms=fa(),vo=xa(),x2e=dl(),rt=zu.ensureSingle;function Dm(e,r,t){return zu.ensureSingle(e,r,t,function(a){a.datum(t)})}var Ou=vo.zindexSeparator;Qa.name="cartesian";Qa.attr=["xaxis","yaxis"];Qa.idRoot=["x","y"];Qa.idRegex=vo.idRegex;Qa.attrRegex=vo.attrRegex;Qa.attributes=Lz();Qa.layoutAttributes=pi();Qa.supplyLayoutDefaults=Qz();Qa.transitionAxes=tO();Qa.finalizeSubplots=function(e,r){var t=r._subplots,a=t.xaxis,n=t.yaxis,i=t.cartesian,o=i,l={},s={},u,f,c;for(u=0;u0){var d=v.id;if(d.indexOf(Ou)!==-1)continue;d+=Ou+(u+1),v=zu.extendFlat({},v,{id:d,plot:n._cartesianlayer.selectAll(".subplot").select("."+d)})}for(var p=[],y,m=0;m1&&(w+=Ou+b),_.push(l+w),o=0;o1,c=r.mainplotinfo;if(!r.mainplot||f)if(u)r.xlines=rt(a,"path","xlines-above"),r.ylines=rt(a,"path","ylines-above"),r.xaxislayer=rt(a,"g","xaxislayer-above"),r.yaxislayer=rt(a,"g","yaxislayer-above");else{if(!o){var v=rt(a,"g","layer-subplot");r.shapelayer=rt(v,"g","shapelayer"),r.imagelayer=rt(v,"g","imagelayer"),c&&f?(r.minorGridlayer=c.minorGridlayer,r.gridlayer=c.gridlayer,r.zerolinelayer=c.zerolinelayer):(r.minorGridlayer=rt(a,"g","minor-gridlayer"),r.gridlayer=rt(a,"g","gridlayer"),r.zerolinelayer=rt(a,"g","zerolinelayer"));var d=rt(a,"g","layer-between");r.shapelayerBetween=rt(d,"g","shapelayer"),r.imagelayerBetween=rt(d,"g","imagelayer"),rt(a,"path","xlines-below"),rt(a,"path","ylines-below"),r.overlinesBelow=rt(a,"g","overlines-below"),rt(a,"g","xaxislayer-below"),rt(a,"g","yaxislayer-below"),r.overaxesBelow=rt(a,"g","overaxes-below")}r.overplot=rt(a,"g","overplot"),r.plot=rt(r.overplot,"g",n),c&&f?r.zerolinelayerAbove=c.zerolinelayerAbove:r.zerolinelayerAbove=rt(a,"g","zerolinelayer-above"),o||(r.xlines=rt(a,"path","xlines-above"),r.ylines=rt(a,"path","ylines-above"),r.overlinesAbove=rt(a,"g","overlines-above"),rt(a,"g","xaxislayer-above"),rt(a,"g","yaxislayer-above"),r.overaxesAbove=rt(a,"g","overaxes-above"),r.xlines=a.select(".xlines-"+l),r.ylines=a.select(".ylines-"+s),r.xaxislayer=a.select(".xaxislayer-"+l),r.yaxislayer=a.select(".yaxislayer-"+s))}else{var p=c.plotgroup,y=n+"-x",m=n+"-y";r.minorGridlayer=c.minorGridlayer,r.gridlayer=c.gridlayer,r.zerolinelayer=c.zerolinelayer,r.zerolinelayerAbove=c.zerolinelayerAbove,rt(c.overlinesBelow,"path",y),rt(c.overlinesBelow,"path",m),rt(c.overaxesBelow,"g",y),rt(c.overaxesBelow,"g",m),r.plot=rt(c.overplot,"g",n),rt(c.overlinesAbove,"path",y),rt(c.overlinesAbove,"path",m),rt(c.overaxesAbove,"g",y),rt(c.overaxesAbove,"g",m),r.xlines=p.select(".overlines-"+l).select("."+y),r.ylines=p.select(".overlines-"+s).select("."+m),r.xaxislayer=p.select(".overaxes-"+l).select("."+y),r.yaxislayer=p.select(".overaxes-"+s).select("."+m)}o||(u||(Dm(r.minorGridlayer,"g",r.xaxis._id),Dm(r.minorGridlayer,"g",r.yaxis._id),r.minorGridlayer.selectAll("g").map(function(x){return x[0]}).sort(ms.idSort),Dm(r.gridlayer,"g",r.xaxis._id),Dm(r.gridlayer,"g",r.yaxis._id),r.gridlayer.selectAll("g").map(function(x){return x[0]}).sort(ms.idSort)),r.xlines.style("fill","none").classed("crisp",!0),r.ylines.style("fill","none").classed("crisp",!0))}function lO(e,r){if(e){var t={};e.each(function(s){var u=s[0],f=Rm.select(this);f.remove(),sO(u,r),t[u]=!0});for(var a in r._plots)for(var n=r._plots[a],i=n.overlays||[],o=0;o{"use strict";var Pm=Pn();uO.exports={hasLines:Pm.hasLines,hasMarkers:Pm.hasMarkers,hasText:Pm.hasText,isBubble:Pm.isBubble,attributes:Ai(),layoutAttributes:n1(),supplyDefaults:CI(),crossTraceDefaults:RI(),supplyLayoutDefaults:FI(),calc:gm().calc,crossTraceCalc:oz(),arraysToCalcdata:ym(),plot:y4(),colorbar:_0(),formatLabels:m4(),style:Nu().style,styleOnSelect:Nu().styleOnSelect,hoverPoints:w4(),selectPoints:T4(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Ei(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}});var hO=N((XFe,vO)=>{"use strict";var w2e=Sr(),T2e=Tr(),cO=w_(),E4=Ee(),A2e=E4.strScale,M2e=E4.strRotate,k2e=E4.strTranslate;vO.exports=function(r,t,a){var n=r.node(),i=cO[a.arrowhead||0],o=cO[a.startarrowhead||0],l=(a.arrowwidth||1)*(a.arrowsize||1),s=(a.arrowwidth||1)*(a.startarrowsize||1),u=t.indexOf("start")>=0,f=t.indexOf("end")>=0,c=i.backoff*l+a.standoff,v=o.backoff*s+a.startstandoff,d,p,y,m;if(n.nodeName==="line"){d={x:+r.attr("x1"),y:+r.attr("y1")},p={x:+r.attr("x2"),y:+r.attr("y2")};var x=d.x-p.x,T=d.y-p.y;if(y=Math.atan2(T,x),m=y+Math.PI,c&&v&&c+v>Math.sqrt(x*x+T*T)){I();return}if(c){if(c*c>x*x+T*T){I();return}var _=c*Math.cos(y),b=c*Math.sin(y);p.x+=_,p.y+=b,r.attr({x2:p.x,y2:p.y})}if(v){if(v*v>x*x+T*T){I();return}var w=v*Math.cos(y),k=v*Math.sin(y);d.x-=w,d.y-=k,r.attr({x1:d.x,y1:d.y})}}else if(n.nodeName==="path"){var M=n.getTotalLength(),q="";if(M{"use strict";var dO=Sr(),D4=br(),S2e=aa(),bs=Ee(),R4=bs.strTranslate,M0=zr(),Bu=Tr(),Ml=Yr(),pO=Fn(),P4=Aa(),F4=ss(),A0=mi(),q2e=wt().arrayEditor,L2e=hO();gO.exports={draw:C2e,drawOne:yO,drawRaw:mO};function C2e(e){var r=e._fullLayout;r._infolayer.selectAll(".annotation").remove();for(var t=0;t2/3?Fe="right":Fe="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Fe]}for(var ye=!1,W=["x","y"],Q=0;Q1)&&(ve===le?(Ne=me.r2fraction(r["a"+Z]),(Ne<0||Ne>1)&&(ye=!0)):ye=!0),Oe=me._offset+me.r2p(r[Z]),Ae=.5}else{var Te=dr==="domain";Z==="x"?(oe=r[Z],Oe=Te?me._offset+me._length*oe:Oe=l.l+l.w*oe):(oe=1-r[Z],Oe=Te?me._offset+me._length*oe:Oe=l.t+l.h*oe),Ae=r.showarrow?.5:oe}if(r.showarrow){De.head=Oe;var qe=r["a"+Z];if(Xe=Pe*he(.5,r.xanchor)-Le*he(.5,r.yanchor),ve===le){var He=M0.getRefType(ve);He==="domain"?(Z==="y"&&(qe=1-qe),De.tail=me._offset+me._length*qe):He==="paper"?Z==="y"?(qe=1-qe,De.tail=l.t+l.h*qe):De.tail=l.l+l.w*qe:De.tail=me._offset+me.r2p(qe),Ue=Xe}else De.tail=Oe+qe,Ue=Xe+qe;De.text=De.tail+Xe;var Je=o[Z==="x"?"width":"height"];if(le==="paper"&&(De.head=bs.constrain(De.head,1,Je-1)),ve==="pixel"){var We=-Math.max(De.tail-3,De.text),Ze=Math.min(De.tail+3,De.text)-Je;We>0?(De.tail+=We,De.text+=We):Ze>0&&(De.tail-=Ze,De.text-=Ze)}De.tail+=Ge,De.head+=Ge}else Xe=ze*he(Ae,Be),Ue=Xe,De.text=Oe+Xe;De.text+=Ge,Xe+=Ge,Ue+=Ge,r["_"+Z+"padplus"]=ze/2+Ue,r["_"+Z+"padminus"]=ze/2-Ue,r["_"+Z+"size"]=ze,r["_"+Z+"shift"]=Xe}if(ye){M.remove();return}var lr=0,rr=0;if(r.align!=="left"&&(lr=(K-ie)*(r.align==="center"?.5:1)),r.valign!=="top"&&(rr=(we-ue)*(r.valign==="middle"?.5:1)),ee)j.select("svg").attr({x:D+lr-1,y:D+rr}).call(Ml.setClipUrl,R?y:null,e);else{var er=D+rr-fe.top,Ie=D+lr-fe.left;G.call(P4.positionText,Ie,er).call(Ml.setClipUrl,R?y:null,e)}z.select("rect").call(Ml.setRect,D,D,K,we),P.call(Ml.setRect,q/2,q/2,se-q,ce-q),M.call(Ml.setTranslate,Math.round(m.x.text-se/2),Math.round(m.y.text-ce/2)),_.attr({transform:"rotate("+x+","+m.x.text+","+m.y.text+")"});var ne=function(Re,Fe){T.selectAll(".annotation-arrow-g").remove();var Ke=m.x.head,cr=m.y.head,ur=m.x.tail+Re,Mr=m.y.tail+Fe,Ir=m.x.text+Re,Gr=m.y.text+Fe,et=bs.rotationXYMatrix(x,Ir,Gr),qt=bs.apply2DTransform(et),ct=bs.apply2DTransform2(et),Ot=+P.attr("width"),gt=+P.attr("height"),wa=Ir-.5*Ot,Zt=wa+Ot,Xt=Gr-.5*gt,Na=Xt+gt,ua=[[wa,Xt,wa,Na],[wa,Na,Zt,Na],[Zt,Na,Zt,Xt],[Zt,Xt,wa,Xt]].map(ct);if(!ua.reduce(function(_t,Vt){return _t^!!bs.segmentsIntersect(Ke,cr,Ke+1e6,cr+1e6,Vt[0],Vt[1],Vt[2],Vt[3])},!1)){ua.forEach(function(_t){var Vt=bs.segmentsIntersect(ur,Mr,Ke,cr,_t[0],_t[1],_t[2],_t[3]);Vt&&(ur=Vt.x,Mr=Vt.y)});var Jt=r.arrowwidth,ar=r.arrowcolor,Jr=r.arrowside,Xr=T.append("g").style({opacity:Bu.opacity(ar)}).classed("annotation-arrow-g",!0),$r=Xr.append("path").attr("d","M"+ur+","+Mr+"L"+Ke+","+cr).style("stroke-width",Jt+"px").call(Bu.stroke,Bu.rgb(ar));if(L2e($r,Jr,r),s.annotationPosition&&$r.node().parentNode&&!a){var Rt=Ke,$t=cr;if(r.standoff){var ft=Math.sqrt(Math.pow(Ke-ur,2)+Math.pow(cr-Mr,2));Rt+=r.standoff*(ur-Ke)/ft,$t+=r.standoff*(Mr-cr)/ft}var Ea=Xr.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(ur-Rt)+","+(Mr-$t),transform:R4(Rt,$t)}).style("stroke-width",Jt+6+"px").call(Bu.stroke,"rgba(0,0,0,0)").call(Bu.fill,"rgba(0,0,0,0)"),An,Kt;A0.init({element:Ea.node(),gd:e,prepFn:function(){var _t=Ml.getTranslate(M);An=_t.x,Kt=_t.y,n&&n.autorange&&v(n._name+".autorange",!0),i&&i.autorange&&v(i._name+".autorange",!0)},moveFn:function(_t,Vt){var Xa=qt(An,Kt),ol=Xa[0]+_t,vt=Xa[1]+Vt;M.call(Ml.setTranslate,ol,vt),d("x",gs(n,_t,"x",l,r)),d("y",gs(i,Vt,"y",l,r)),r.axref===r.xref&&d("ax",gs(n,_t,"ax",l,r)),r.ayref===r.yref&&d("ay",gs(i,Vt,"ay",l,r)),Xr.attr("transform",R4(_t,Vt)),_.attr({transform:"rotate("+x+","+ol+","+vt+")"})},doneFn:function(){D4.call("_guiRelayout",e,p());var _t=document.querySelector(".js-notes-box-panel");_t&&_t.redraw(_t.selectedObj)}})}}};if(r.showarrow&&ne(0,0),b){var de;A0.init({element:M.node(),gd:e,prepFn:function(){de=_.attr("transform")},moveFn:function(Re,Fe){var Ke="pointer";if(r.showarrow)r.axref===r.xref?d("ax",gs(n,Re,"ax",l,r)):d("ax",r.ax+Re),r.ayref===r.yref?d("ay",gs(i,Fe,"ay",l.w,r)):d("ay",r.ay+Fe),ne(Re,Fe);else{if(a)return;var cr,ur;if(n)cr=gs(n,Re,"x",l,r);else{var Mr=r._xsize/l.w,Ir=r.x+(r._xshift-r.xshift)/l.w-Mr/2;cr=A0.align(Ir+Re/l.w,Mr,0,1,r.xanchor)}if(i)ur=gs(i,Fe,"y",l,r);else{var Gr=r._ysize/l.h,et=r.y-(r._yshift+r.yshift)/l.h-Gr/2;ur=A0.align(et-Fe/l.h,Gr,0,1,r.yanchor)}d("x",cr),d("y",ur),(!n||!i)&&(Ke=A0.getCursor(n?.5:cr,i?.5:ur,r.xanchor,r.yanchor))}_.attr({transform:R4(Re,Fe)+de}),F4(M,Ke)},clickFn:function(Re,Fe){r.captureevents&&e.emit("plotly_clickannotation",k(Fe))},doneFn:function(){F4(M),D4.call("_guiRelayout",e,p());var Re=document.querySelector(".js-notes-box-panel");Re&&Re.redraw(Re.selectedObj)}})}}s.annotationText?G.call(P4.makeEditable,{delegate:M,gd:e}).call(Y).on("edit",function(H){r.text=H,this.call(Y),d("text",H),n&&n.autorange&&v(n._name+".autorange",!0),i&&i.autorange&&v(i._name+".autorange",!0),D4.call("_guiRelayout",e,p())}):G.call(Y)}});var AO=N(($Fe,TO)=>{"use strict";var bO=Ee(),E2e=br(),xO=wt().arrayEditor;TO.exports={hasClickToShow:D2e,onClick:R2e};function D2e(e,r){var t=wO(e,r);return t.on.length>0||t.explicitOff.length>0}function R2e(e,r){var t=wO(e,r),a=t.on,n=t.off.concat(t.explicitOff),i={},o=e._fullLayout.annotations,l,s;if(a.length||n.length){for(l=0;l{"use strict";var N4=Ee(),Pc=Tr();MO.exports=function(r,t,a,n){n("opacity");var i=n("bgcolor"),o=n("bordercolor"),l=Pc.opacity(o);n("borderpad");var s=n("borderwidth"),u=n("showarrow");n("text",u?" ":a._dfltTitle.annotation),n("textangle"),N4.coerceFont(n,"font",a.font),n("width"),n("align");var f=n("height");if(f&&n("valign"),u){var c=n("arrowside"),v,d;c.indexOf("end")!==-1&&(v=n("arrowhead"),d=n("arrowsize")),c.indexOf("start")!==-1&&(n("startarrowhead",v),n("startarrowsize",d)),n("arrowcolor",l?t.bordercolor:Pc.defaultLine),n("arrowwidth",(l&&s||1)*2),n("standoff"),n("startstandoff")}var p=n("hovertext"),y=a.hoverlabel||{};if(p){var m=n("hoverlabel.bgcolor",y.bgcolor||(Pc.opacity(i)?Pc.rgb(i):Pc.defaultLine)),x=n("hoverlabel.bordercolor",y.bordercolor||Pc.contrast(m)),T=N4.extendFlat({},y.font);T.color||(T.color=x),N4.coerceFont(n,"hoverlabel.font",T)}n("captureevents",!!p)}});var SO=N((QFe,kO)=>{"use strict";var z4=Ee(),Hu=zr(),P2e=io(),F2e=I4(),N2e=Tc();kO.exports=function(r,t){P2e(r,t,{name:"annotations",handleItemDefaults:I2e})};function I2e(e,r,t){function a(_,b){return z4.coerce(e,r,N2e,_,b)}var n=a("visible"),i=a("clicktoshow");if(n||i){F2e(e,r,t,a);for(var o=r.showarrow,l=["x","y"],s=[-10,-30],u={_fullLayout:t},f=0;f<2;f++){var c=l[f],v=Hu.coerceRef(e,r,u,c,"","paper");if(v!=="paper"){var d=Hu.getFromId(u,v);d._annIndices.push(r._index)}if(Hu.coercePosition(r,u,a,v,c,.5),o){var p="a"+c,y=Hu.coerceRef(e,r,u,p,"pixel",["pixel","paper"]);y!=="pixel"&&y!==v&&(y=r[p]="pixel");var m=y==="pixel"?s[f]:.4;Hu.coercePosition(r,u,a,y,p,m)}a(c+"anchor"),a(c+"shift")}if(z4.noneOrAll(e,r,["x","y"]),o&&z4.noneOrAll(e,r,["ax","ay"]),i){var x=a("xclick"),T=a("yclick");r._xclick=x===void 0?r.x:Hu.cleanPosition(x,u,r.xref),r._yclick=T===void 0?r.y:Hu.cleanPosition(T,u,r.yref)}}}});var CO=N((eNe,LO)=>{"use strict";var O4=Ee(),Uu=zr(),z2e=Fm().draw;LO.exports=function(r){var t=r._fullLayout,a=O4.filterVisible(t.annotations);if(a.length&&r._fullData.length)return O4.syncOrAsync([z2e,O2e],r)};function O2e(e){var r=e._fullLayout;O4.filterVisible(r.annotations).forEach(function(t){var a=Uu.getFromId(e,t.xref),n=Uu.getFromId(e,t.yref),i=Uu.getRefType(t.xref),o=Uu.getRefType(t.yref);t._extremes={},i==="range"&&qO(t,a),o==="range"&&qO(t,n)})}function qO(e,r){var t=r._id,a=t.charAt(0),n=e[a],i=e["a"+a],o=e[a+"ref"],l=e["a"+a+"ref"],s=e["_"+a+"padplus"],u=e["_"+a+"padminus"],f={x:1,y:-1}[a]*e[a+"shift"],c=3*e.arrowsize*e.arrowwidth||0,v=c+f,d=c-f,p=3*e.startarrowsize*e.arrowwidth||0,y=p+f,m=p-f,x;if(l===o){var T=Uu.findExtremes(r,[r.r2c(n)],{ppadplus:v,ppadminus:d}),_=Uu.findExtremes(r,[r.r2c(i)],{ppadplus:Math.max(s,y),ppadminus:Math.max(u,m)});x={min:[T.min[0],_.min[0]],max:[T.max[0],_.max[0]]}}else y=i?y+i:y,m=i?m-i:m,x=Uu.findExtremes(r,[r.r2c(n)],{ppadplus:Math.max(s,v,y),ppadminus:Math.max(u,d,m)});e._extremes[t]=x}});var DO=N((rNe,EO)=>{"use strict";var B2e=Rr(),H2e=Sp();EO.exports=function(r,t,a,n){t=t||{};var i=a==="log"&&t.type==="linear",o=a==="linear"&&t.type==="log";if(!(i||o))return;var l=r._fullLayout.annotations,s=t._id.charAt(0),u,f;function c(d){var p=u[d],y=null;i?y=H2e(p,t.range):y=Math.pow(10,p),B2e(y)||(y=null),n(f+d,y)}for(var v=0;v{"use strict";var B4=Fm(),RO=AO();PO.exports={moduleType:"component",name:"annotations",layoutAttributes:Tc(),supplyLayoutDefaults:SO(),includeBasePlot:a0()("annotations"),calcAutorange:CO(),draw:B4.draw,drawOne:B4.drawOne,drawRaw:B4.drawRaw,hasClickToShow:RO.hasClickToShow,onClick:RO.onClick,convertCoords:DO()}});var Nm=N((aNe,NO)=>{"use strict";var kt=Tc(),U2e=eo().overrideAll,G2e=wt().templatedArray;NO.exports=U2e(G2e("annotation",{visible:kt.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:kt.xanchor,xshift:kt.xshift,yanchor:kt.yanchor,yshift:kt.yshift,text:kt.text,textangle:kt.textangle,font:kt.font,width:kt.width,height:kt.height,opacity:kt.opacity,align:kt.align,valign:kt.valign,bgcolor:kt.bgcolor,bordercolor:kt.bordercolor,borderpad:kt.borderpad,borderwidth:kt.borderwidth,showarrow:kt.showarrow,arrowcolor:kt.arrowcolor,arrowhead:kt.arrowhead,startarrowhead:kt.startarrowhead,arrowside:kt.arrowside,arrowsize:kt.arrowsize,startarrowsize:kt.startarrowsize,arrowwidth:kt.arrowwidth,standoff:kt.standoff,startstandoff:kt.startstandoff,hovertext:kt.hovertext,hoverlabel:kt.hoverlabel,captureevents:kt.captureevents}),"calc","from-root")});var zO=N((nNe,IO)=>{"use strict";var H4=Ee(),V2e=zr(),Y2e=io(),W2e=I4(),j2e=Nm();IO.exports=function(r,t,a){Y2e(r,t,{name:"annotations",handleItemDefaults:Z2e,fullLayout:a.fullLayout})};function Z2e(e,r,t,a){function n(l,s){return H4.coerce(e,r,j2e,l,s)}function i(l){var s=l+"axis",u={_fullLayout:{}};return u._fullLayout[s]=t[s],V2e.coercePosition(r,u,n,l,l,.5)}var o=n("visible");o&&(W2e(e,r,a.fullLayout,n),i("x"),i("y"),i("z"),H4.noneOrAll(e,r,["x","y","z"]),r.xref="x",r.yref="y",r.zref="z",n("xanchor"),n("yanchor"),n("xshift"),n("yshift"),r.showarrow&&(r.axref="pixel",r.ayref="pixel",n("ax",-10),n("ay",-30),H4.noneOrAll(e,r,["ax","ay"])))}});var UO=N((iNe,HO)=>{"use strict";var OO=Ee(),BO=zr();HO.exports=function(r){for(var t=r.fullSceneLayout,a=t.annotations,n=0;n{"use strict";function U4(e,r){var t=[0,0,0,0],a,n;for(a=0;a<4;++a)for(n=0;n<4;++n)t[n]+=e[4*a+n]*r[a];return t}function J2e(e,r){var t=U4(e.projection,U4(e.view,U4(e.model,[r[0],r[1],r[2],1])));return t}GO.exports=J2e});var WO=N((lNe,YO)=>{"use strict";var $2e=Fm().drawRaw,K2e=VO(),Q2e=["x","y","z"];YO.exports=function(r){for(var t=r.fullSceneLayout,a=r.dataScale,n=t.annotations,i=0;i1){l=!0;break}}l?r.fullLayout._infolayer.select(".annotation-"+r.id+'[data-index="'+i+'"]').remove():(o._pdata=K2e(r.glplot.cameraParams,[t.xaxis.r2l(o.x)*a[0],t.yaxis.r2l(o.y)*a[1],t.zaxis.r2l(o.z)*a[2]]),$2e(r.graphDiv,o,i,r.id,o._xa,o._ya))}}});var XO=N((sNe,ZO)=>{"use strict";var e3e=br(),jO=Ee();ZO.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Nm()}}},layoutAttributes:Nm(),handleDefaults:zO(),includeBasePlot:r3e,convert:UO(),draw:WO()};function r3e(e,r){var t=e3e.subplotsRegistry.gl3d;if(t)for(var a=t.attrRegex,n=Object.keys(e),i=0;i{"use strict";var uNe=xa(),JO=ga(),$O=Ai().line,t3e=ci().dash,ho=bt().extendFlat,a3e=wt().templatedArray,fNe=e0(),Fc=gn(),KO=Tc(),{shapeTexttemplateAttrs:n3e,templatefallbackAttrs:i3e}=Wn(),o3e=zp();QO.exports=a3e("shape",{visible:ho({},Fc.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:ho({},Fc.legend,{editType:"calc+arraydraw"}),legendgroup:ho({},Fc.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:ho({},Fc.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:JO({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:ho({},Fc.legendrank,{editType:"calc+arraydraw"}),legendwidth:ho({},Fc.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:ho({},KO.xref,{arrayOk:!0}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:ho({},KO.yref,{arrayOk:!0}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:ho({},$O.color,{editType:"arraydraw"}),width:ho({},$O.width,{editType:"calc+arraydraw"}),dash:ho({},t3e,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:n3e({},{keys:Object.keys(o3e)}),texttemplatefallback:i3e({editType:"arraydraw"}),font:JO({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})});var rB=N((vNe,eB)=>{"use strict";var Nc=Ee(),ri=zr(),l3e=io(),s3e=G4(),k0=hs();eB.exports=function(r,t){l3e(r,t,{name:"shapes",handleItemDefaults:f3e})};function u3e(e,r){return e?"bottom":r.indexOf("top")!==-1?"top":r.indexOf("bottom")!==-1?"bottom":"middle"}function f3e(e,r,t){function a(_,b){return Nc.coerce(e,r,s3e,_,b)}r._isShape=!0;var n=a("visible");if(!n)return;var i=a("showlegend");i&&(a("legend"),a("legendwidth"),a("legendgroup"),a("legendgrouptitle.text"),Nc.coerceFont(a,"legendgrouptitle.font"),a("legendrank"));var o=a("path"),l=o?"path":"rect",s=a("type",l),u=s!=="path";u&&delete r.path,a("editable"),a("layer"),a("opacity"),a("fillcolor"),a("fillrule");var f=a("line.width");f&&(a("line.color"),a("line.dash"));var c=a("xsizemode"),v=a("ysizemode");let d=[.25,.75],p=[0,10];["x","y"].forEach(_=>{var b=_+"anchor",w=_==="x"?c:v,k={_fullLayout:t},M,q,E,D;let P=_+"ref",R=e[P];if(Array.isArray(R)&&R.length>0){let z=k0.countDefiningCoords(s,o,_);D=ri.coerceRefArray(e,r,k,_,void 0,"paper",z),r["_"+_+"refArray"]=!0}else D=ri.coerceRef(e,r,k,_,void 0,"paper");if(Array.isArray(D))D.forEach(function(z){ri.getRefType(z)==="range"&&(M=ri.getFromId(k,z),M&&M._shapeIndices.indexOf(r._index)===-1&&M._shapeIndices.push(r._index))}),u&&[0,1].forEach(function(z){let I=D[z];ri.getRefType(I)==="range"?(M=ri.getFromId(k,I),q=k0.shapePositionToRange(M),E=k0.rangeToShapePosition(M),(M.type==="category"||M.type==="multicategory")&&a(_+z+"shift")):q=E=Nc.identity;let G=_+z,Y=e[G];if(e[G]=q(e[G],!0),w==="pixel"?a(G,p[z]):ri.coercePosition(r,k,a,I,G,d[z]),r[G]=E(r[G]),e[G]=Y,z===0&&w==="pixel"){let V=e[b];e[b]=q(e[b],!0),ri.coercePosition(r,k,a,I,b,.25),r[b]=E(r[b]),e[b]=V}});else{if(ri.getRefType(D)==="range"?(M=ri.getFromId(k,D),M._shapeIndices.push(r._index),E=k0.rangeToShapePosition(M),q=k0.shapePositionToRange(M),u&&(M.type==="category"||M.type==="multicategory")&&(a(_+"0shift"),a(_+"1shift"))):q=E=Nc.identity,u){let I=_+"0",B=_+"1",G=e[I],Y=e[B];e[I]=q(e[I],!0),e[B]=q(e[B],!0),w==="pixel"?(a(I,p[0]),a(B,p[1])):(ri.coercePosition(r,k,a,D,I,d[0]),ri.coercePosition(r,k,a,D,B,d[1])),r[I]=E(r[I]),r[B]=E(r[B]),e[I]=G,e[B]=Y}if(w==="pixel"){let I=e[b];e[b]=q(e[b],!0),ri.coercePosition(r,k,a,D,b,.25),r[b]=E(r[b]),e[b]=I}}}),u&&Nc.noneOrAll(e,r,["x0","x1","y0","y1"]);var y=s==="line",m,x;if(u&&(m=a("label.texttemplate"),a("label.texttemplatefallback")),m||(x=a("label.text")),x||m){a("label.textangle");var T=a("label.textposition",y?"middle":"middle center");a("label.xanchor"),a("label.yanchor",u3e(y,T)),a("label.padding"),Nc.coerceFont(a,"label.font",t.font)}}});var nB=N((hNe,aB)=>{"use strict";var c3e=Tr(),tB=Ee();function v3e(e,r){return e?"bottom":r.indexOf("top")!==-1?"top":r.indexOf("bottom")!==-1?"bottom":"middle"}aB.exports=function(r,t,a){a("newshape.visible"),a("newshape.name"),a("newshape.showlegend"),a("newshape.legend"),a("newshape.legendwidth"),a("newshape.legendgroup"),a("newshape.legendgrouptitle.text"),tB.coerceFont(a,"newshape.legendgrouptitle.font"),a("newshape.legendrank"),a("newshape.drawdirection"),a("newshape.layer"),a("newshape.fillcolor"),a("newshape.fillrule"),a("newshape.opacity");var n=a("newshape.line.width");if(n){var i=(r||{}).plot_bgcolor||"#FFF";a("newshape.line.color",c3e.contrast(i)),a("newshape.line.dash")}var o=r.dragmode==="drawline",l=a("newshape.label.text"),s=a("newshape.label.texttemplate");if(a("newshape.label.texttemplatefallback"),l||s){a("newshape.label.textangle");var u=a("newshape.label.textposition",o?"middle":"middle center");a("newshape.label.xanchor"),a("newshape.label.yanchor",v3e(o,u)),a("newshape.label.padding"),tB.coerceFont(a,"newshape.label.font",t.font)}a("activeshape.fillcolor"),a("activeshape.opacity")}});var cB=N((dNe,fB)=>{"use strict";var V4=Ee(),Di=zr(),jo=Fh(),Y4=hs();fB.exports=function(r){var t=r._fullLayout,a=V4.filterVisible(t.shapes);if(!(!a.length||!r._fullData.length))for(var n=0;n{o=Di.getFromId(r,c),i._extremes[o._id]=Di.findExtremes(o,v,oB(i))})}else i.xref!=="paper"&&s!=="domain"&&(o=Di.getFromId(r,i.xref),l=sB(o,i,jo.paramIsX),l&&(i._extremes[o._id]=Di.findExtremes(o,l,oB(i))));if(u==="array"){let f=iB(r,i,"y");Object.entries(f).forEach(([c,v])=>{o=Di.getFromId(r,c),i._extremes[o._id]=Di.findExtremes(o,v,lB(i))})}else i.yref!=="paper"&&u!=="domain"&&(o=Di.getFromId(r,i.yref),l=sB(o,i,jo.paramIsY),l&&(i._extremes[o._id]=Di.findExtremes(o,l,lB(i))))}};function iB(e,r,t){let a=r[t+"ref"],n=t==="x"?jo.paramIsX:jo.paramIsY;function i(c,v){c==="paper"||Di.getRefType(c)==="domain"||(o[c]||(o[c]=[]),o[c].push(v))}let o={};if(r.type==="path"&&r.path){let c=r.path.match(jo.segmentRE)||[];for(var l=0,s=0;sp&&(i(a[l],y[p]),l++)}}else i(a[0],r[t+"0"]),i(a[1],r[t+"1"]);let u={};for(let c in o){let v=Di.getFromId(e,c);if(v){var f=v.type==="category"||v.type==="multicategory"?v.r2c:v.d2c;v.type==="date"&&(f=Y4.decodeDate(f)),u[v._id]=o[c].map(f)}}return u}function oB(e){return uB(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function lB(e){return uB(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function uB(e,r,t,a,n,i){var o=e/2,l=i;if(r==="pixel"){var s=n?Y4.extractPathCoords(n,i?jo.paramIsY:jo.paramIsX):[t,a],u=V4.aggNums(Math.max,null,s),f=V4.aggNums(Math.min,null,s),c=f<0?Math.abs(f)+o:o,v=u>0?u+o:o;return{ppad:o,ppadplus:l?c:v,ppadminus:l?v:c}}else return{ppad:o}}function sB(e,r,t){var a=e._id.charAt(0)==="x"?"x":"y",n=e.type==="category"||e.type==="multicategory",i,o,l=0,s=0,u=n?e.r2c:e.d2c,f=r[a+"sizemode"]==="scaled";if(f?(i=r[a+"0"],o=r[a+"1"],n&&(l=r[a+"0shift"],s=r[a+"1shift"])):(i=r[a+"anchor"],o=r[a+"anchor"]),i!==void 0)return[u(i)+l,u(o)+s];if(r.path){var c=1/0,v=-1/0,d=r.path.match(jo.segmentRE),p,y,m,x,T;for(e.type==="date"&&(u=Y4.decodeDate(u)),p=0;pv&&(v=T)));if(v>=c)return[c,v]}}});var dB=N((pNe,hB)=>{"use strict";var vB=My();hB.exports={moduleType:"component",name:"shapes",layoutAttributes:G4(),supplyLayoutDefaults:rB(),supplyDrawNewShapeDefaults:nB(),includeBasePlot:a0()("shapes"),calcAutorange:cB(),draw:vB.draw,drawOne:vB.drawOne}});var W4=N((mNe,yB)=>{"use strict";var pB=xa(),h3e=wt().templatedArray,yNe=e0();yB.exports=h3e("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",pB.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",pB.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})});var gB=N((gNe,mB)=>{"use strict";var d3e=Ee(),j4=zr(),p3e=io(),y3e=W4(),m3e="images";mB.exports=function(r,t){var a={name:m3e,handleItemDefaults:g3e};p3e(r,t,a)};function g3e(e,r,t){function a(v,d){return d3e.coerce(e,r,y3e,v,d)}var n=a("source"),i=a("visible",!!n);if(!i)return r;a("layer"),a("xanchor"),a("yanchor"),a("sizex"),a("sizey"),a("sizing"),a("opacity");for(var o={_fullLayout:t},l=["x","y"],s=0;s<2;s++){var u=l[s],f=j4.coerceRef(e,r,o,u,"paper",void 0);if(f!=="paper"){var c=j4.getFromId(o,f);c._imgIndices.push(r._index)}j4.coercePosition(r,o,a,f,u,0)}return r}});var wB=N((bNe,_B)=>{"use strict";var bB=Sr(),b3e=Yr(),Ic=zr(),xB=fa(),x3e=dl();_B.exports=function(r){var t=r._fullLayout,a=[],n={},i=[],o,l;for(l=0;l{"use strict";var TB=Rr(),_3e=Sp();AB.exports=function(r,t,a,n){t=t||{};var i=a==="log"&&t.type==="linear",o=a==="linear"&&t.type==="log";if(i||o){for(var l=r._fullLayout.images,s=t._id.charAt(0),u,f,c=0;c{"use strict";kB.exports={moduleType:"component",name:"images",layoutAttributes:W4(),supplyLayoutDefaults:gB(),includeBasePlot:a0()("images"),draw:wB(),convertCoords:MB()}});var Im=N((wNe,qB)=>{"use strict";qB.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25C4",right:"\u25BA",up:"\u25B2",down:"\u25BC"}}});var Z4=N((TNe,CB)=>{"use strict";var w3e=ga(),T3e=fi(),A3e=bt().extendFlat,M3e=eo().overrideAll,k3e=Op(),LB=wt().templatedArray,S3e=LB("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});CB.exports=M3e(LB("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:S3e,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:A3e(k3e({editType:"arraydraw"}),{}),font:w3e({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:T3e.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")});var PB=N((ANe,RB)=>{"use strict";var zm=Ee(),EB=io(),DB=Z4(),q3e=Im(),L3e=q3e.name,C3e=DB.buttons;RB.exports=function(r,t){var a={name:L3e,handleItemDefaults:E3e};EB(r,t,a)};function E3e(e,r,t){function a(o,l){return zm.coerce(e,r,DB,o,l)}var n=EB(e,r,{name:"buttons",handleItemDefaults:D3e}),i=a("visible",n.length>0);i&&(a("active"),a("direction"),a("type"),a("showactive"),a("x"),a("y"),zm.noneOrAll(e,r,["x","y"]),a("xanchor"),a("yanchor"),a("pad.t"),a("pad.r"),a("pad.b"),a("pad.l"),zm.coerceFont(a,"font",t.font),a("bgcolor",t.paper_bgcolor),a("bordercolor"),a("borderwidth"))}function D3e(e,r){function t(n,i){return zm.coerce(e,r,C3e,n,i)}var a=t("visible",e.method==="skip"||Array.isArray(e.args));a&&(t("method"),t("args"),t("args2"),t("label"),t("execute"))}});var IB=N((MNe,NB)=>{"use strict";NB.exports=It;var po=Sr(),FB=Tr(),zc=Yr(),Om=Ee();function It(e,r,t){this.gd=e,this.container=r,this.id=t,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}It.barWidth=2;It.barLength=20;It.barRadius=2;It.barPad=1;It.barColor="#808BA4";It.prototype.enable=function(r,t,a){var n=this.gd._fullLayout,i=n.width,o=n.height;this.position=r;var l=this.position.l,s=this.position.w,u=this.position.t,f=this.position.h,c=this.position.direction,v=c==="down",d=c==="left",p=c==="right",y=c==="up",m=s,x=f,T,_,b,w;!v&&!d&&!p&&!y&&(this.position.direction="down",v=!0);var k=v||y;k?(T=l,_=T+m,v?(b=u,w=Math.min(b+x,o),x=w-b):(w=u+x,b=Math.max(w-x,0),x=w-b)):(b=u,w=b+x,d?(_=l+m,T=Math.max(_-m,0),m=_-T):(T=l,_=Math.min(T+m,i),m=_-T)),this._box={l:T,t:b,w:m,h:x};var M=s>m,q=It.barLength+2*It.barPad,E=It.barWidth+2*It.barPad,D=l,P=u+f;P+E>o&&(P=o-E);var R=this.container.selectAll("rect.scrollbar-horizontal").data(M?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-horizontal",!0).call(FB.fill,It.barColor),M?(this.hbar=R.attr({rx:It.barRadius,ry:It.barRadius,x:D,y:P,width:q,height:E}),this._hbarXMin=D+q/2,this._hbarTranslateMax=m-q):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var z=f>x,I=It.barWidth+2*It.barPad,B=It.barLength+2*It.barPad,G=l+s,Y=u;G+I>i&&(G=i-I);var V=this.container.selectAll("rect.scrollbar-vertical").data(z?[0]:[]);V.exit().on(".drag",null).remove(),V.enter().append("rect").classed("scrollbar-vertical",!0).call(FB.fill,It.barColor),z?(this.vbar=V.attr({rx:It.barRadius,ry:It.barRadius,x:G,y:Y,width:I,height:B}),this._vbarYMin=Y+B/2,this._vbarTranslateMax=x-B):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var H=this.id,X=T-.5,j=z?_+I+.5:_+.5,ee=b-.5,fe=M?w+E+.5:w+.5,ie=n._topdefs.selectAll("#"+H).data(M||z?[0]:[]);if(ie.exit().remove(),ie.enter().append("clipPath").attr("id",H).append("rect"),M||z?(this._clipRect=ie.select("rect").attr({x:Math.floor(X),y:Math.floor(ee),width:Math.ceil(j)-Math.floor(X),height:Math.ceil(fe)-Math.floor(ee)}),this.container.call(zc.setClipUrl,H,this.gd),this.bg.attr({x:l,y:u,width:s,height:f})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(zc.setClipUrl,null),delete this._clipRect),M||z){var ue=po.behavior.drag().on("dragstart",function(){po.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(ue);var K=po.behavior.drag().on("dragstart",function(){po.event.sourceEvent.preventDefault(),po.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));M&&this.hbar.on(".drag",null).call(K),z&&this.vbar.on(".drag",null).call(K)}this.setTranslate(t,a)};It.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(zc.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)};It.prototype._onBoxDrag=function(){var r=this.translateX,t=this.translateY;this.hbar&&(r-=po.event.dx),this.vbar&&(t-=po.event.dy),this.setTranslate(r,t)};It.prototype._onBoxWheel=function(){var r=this.translateX,t=this.translateY;this.hbar&&(r+=po.event.deltaY),this.vbar&&(t+=po.event.deltaY),this.setTranslate(r,t)};It.prototype._onBarDrag=function(){var r=this.translateX,t=this.translateY;if(this.hbar){var a=r+this._hbarXMin,n=a+this._hbarTranslateMax,i=Om.constrain(po.event.x,a,n),o=(i-a)/(n-a),l=this.position.w-this._box.w;r=o*l}if(this.vbar){var s=t+this._vbarYMin,u=s+this._vbarTranslateMax,f=Om.constrain(po.event.y,s,u),c=(f-s)/(u-s),v=this.position.h-this._box.h;t=c*v}this.setTranslate(r,t)};It.prototype.setTranslate=function(r,t){var a=this.position.w-this._box.w,n=this.position.h-this._box.h;if(r=Om.constrain(r||0,0,a),t=Om.constrain(t||0,0,n),this.translateX=r,this.translateY=t,this.container.call(zc.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var i=r/a;this.hbar.call(zc.setTranslate,r+i*this._hbarTranslateMax,t)}if(this.vbar){var o=t/n;this.vbar.call(zc.setTranslate,r,t+o*this._vbarTranslateMax)}}});var jB=N((kNe,WB)=>{"use strict";var Oc=Sr(),S0=aa(),q0=Tr(),Bc=Yr(),ti=Ee(),Bm=Aa(),R3e=wt().arrayEditor,OB=Ha().LINE_SPACING,wr=Im(),P3e=IB();WB.exports=function(r){var t=r._fullLayout,a=ti.filterVisible(t[wr.name]);function n(v){S0.autoMargin(r,VB(v))}var i=t._menulayer.selectAll("g."+wr.containerClassName).data(a.length>0?[0]:[]);if(i.enter().append("g").classed(wr.containerClassName,!0).style("cursor","pointer"),i.exit().each(function(){Oc.select(this).selectAll("g."+wr.headerGroupClassName).each(n)}).remove(),a.length!==0){var o=i.selectAll("g."+wr.headerGroupClassName).data(a,F3e);o.enter().append("g").classed(wr.headerGroupClassName,!0);for(var l=ti.ensureSingle(i,"g",wr.dropdownButtonGroupClassName,function(v){v.style("pointer-events","all")}),s=0;s{"use strict";var U3e=Im();ZB.exports={moduleType:"component",name:U3e.name,layoutAttributes:Z4(),supplyLayoutDefaults:PB(),draw:jB()}});var C0=N((qNe,JB)=>{"use strict";JB.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}});var K4=N((LNe,QB)=>{"use strict";var $B=ga(),G3e=Op(),V3e=bt().extendDeepAll,Y3e=eo().overrideAll,W3e=ih(),KB=wt().templatedArray,Gu=C0(),j3e=KB("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});QB.exports=Y3e(KB("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:j3e,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:V3e(G3e({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:W3e.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:$B({})},font:$B({}),activebgcolor:{valType:"color",dflt:Gu.gripBgActiveColor},bgcolor:{valType:"color",dflt:Gu.railBgColor},bordercolor:{valType:"color",dflt:Gu.railBorderColor},borderwidth:{valType:"number",min:0,dflt:Gu.railBorderWidth},ticklen:{valType:"number",min:0,dflt:Gu.tickLength},tickcolor:{valType:"color",dflt:Gu.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:Gu.minorTickLength}}),"arraydraw","from-root")});var aH=N((CNe,tH)=>{"use strict";var Hc=Ee(),eH=io(),rH=K4(),Z3e=C0(),X3e=Z3e.name,J3e=rH.steps;tH.exports=function(r,t){eH(r,t,{name:X3e,handleItemDefaults:$3e})};function $3e(e,r,t){function a(c,v){return Hc.coerce(e,r,rH,c,v)}for(var n=eH(e,r,{name:"steps",handleItemDefaults:K3e}),i=0,o=0;o{"use strict";var yo=Sr(),Hm=aa(),xs=Tr(),mo=Yr(),ai=Ee(),Q3e=ai.strTranslate,E0=Aa(),ebe=wt().arrayEditor,Fr=C0(),rw=Ha(),oH=rw.LINE_SPACING,Q4=rw.FROM_TL,ew=rw.FROM_BR;vH.exports=function(r){var t=r._context.staticPlot,a=r._fullLayout,n=rbe(a,r),i=a._infolayer.selectAll("g."+Fr.containerClassName).data(n.length>0?[0]:[]);i.enter().append("g").classed(Fr.containerClassName,!0).style("cursor",t?null:"ew-resize");function o(f){f._commandObserver&&(f._commandObserver.remove(),delete f._commandObserver),Hm.autoMargin(r,lH(f))}if(i.exit().each(function(){yo.select(this).selectAll("g."+Fr.groupClassName).each(o)}).remove(),n.length!==0){var l=i.selectAll("g."+Fr.groupClassName).data(n,tbe);l.enter().append("g").classed(Fr.groupClassName,!0),l.exit().each(o).remove();for(var s=0;s0&&(l=l.transition().duration(r.transition.duration).ease(r.transition.easing)),l.attr("transform",Q3e(o-Fr.gripWidth*.5,r._dims.currentValueTotalHeight))}}function tw(e,r){var t=e._dims;return t.inputAreaStart+Fr.stepInset+(t.inputAreaLength-2*Fr.stepInset)*Math.min(1,Math.max(0,r))}function iH(e,r){var t=e._dims;return Math.min(1,Math.max(0,(r-Fr.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*Fr.stepInset-2*t.inputAreaStart)))}function ube(e,r,t){var a=t._dims,n=ai.ensureSingle(e,"rect",Fr.railTouchRectClass,function(i){i.call(fH,r,e,t).style("pointer-events","all")});n.attr({width:a.inputAreaLength,height:Math.max(a.inputAreaWidth,Fr.tickOffset+t.ticklen+a.labelHeight)}).call(xs.fill,t.bgcolor).attr("opacity",0),mo.setTranslate(n,0,a.currentValueTotalHeight)}function fbe(e,r){var t=r._dims,a=t.inputAreaLength-Fr.railInset*2,n=ai.ensureSingle(e,"rect",Fr.railRectClass);n.attr({width:a,height:Fr.railWidth,rx:Fr.railRadius,ry:Fr.railRadius,"shape-rendering":"crispEdges"}).call(xs.stroke,r.bordercolor).call(xs.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px"),mo.setTranslate(n,Fr.railInset,(t.inputAreaWidth-Fr.railWidth)*.5+t.currentValueTotalHeight)}});var pH=N((DNe,dH)=>{"use strict";var cbe=C0();dH.exports={moduleType:"component",name:cbe.name,layoutAttributes:K4(),supplyLayoutDefaults:aH(),draw:hH()}});var Gm=N((RNe,mH)=>{"use strict";var yH=fi();mH.exports={bgcolor:{valType:"color",dflt:yH.background,editType:"plot"},bordercolor:{valType:"color",dflt:yH.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}});var aw=N((PNe,gH)=>{"use strict";gH.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}});var Vm=N((FNe,bH)=>{"use strict";bH.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}});var wH=N(Wm=>{"use strict";var vbe=fa(),hbe=Aa(),xH=Vm(),dbe=Ha().LINE_SPACING,Ym=xH.name;function _H(e){var r=e&&e[Ym];return r&&r.visible}Wm.isVisible=_H;Wm.makeData=function(e){for(var r=vbe.list({_fullLayout:e},"x",!0),t=e.margin,a=[],n=0;n{"use strict";var jm=Ee(),TH=wt(),AH=fa(),pbe=Gm(),ybe=aw();MH.exports=function(r,t,a){var n=r[a],i=t[a];if(!(n.rangeslider||t._requestRangeslider[i._id]))return;jm.isPlainObject(n.rangeslider)||(n.rangeslider={});var o=n.rangeslider,l=TH.newContainer(i,"rangeslider");function s(w,k){return jm.coerce(o,l,pbe,w,k)}var u,f;function c(w,k){return jm.coerce(u,f,ybe,w,k)}var v=s("visible");if(v){s("bgcolor",t.plot_bgcolor),s("bordercolor"),s("borderwidth"),s("thickness"),s("autorange",!i.isValidRange(o.range)),s("range");var d=t._subplots;if(d)for(var p=d.cartesian.filter(function(w){return w.slice(0,Math.max(0,w.indexOf("y")))===AH.name2id(a)}).map(function(w){return w.slice(w.indexOf("y"),w.length)}),y=jm.simpleMap(p,AH.id2name),m=0;m{"use strict";var mbe=fa().list,gbe=_h().getAutoRange,bbe=Vm();SH.exports=function(r){for(var t=mbe(r,"x",!0),a=0;a{"use strict";var Zm=Sr(),xbe=br(),_be=aa(),jt=Ee(),Xm=jt.strTranslate,CH=Yr(),_s=Tr(),wbe=oc(),Tbe=Ei(),nw=fa(),Abe=mi(),Mbe=ss(),Ur=Vm();EH.exports=function(e){for(var r=e._fullLayout,t=r._rangeSliderData,a=0;a=V.max)G=P[Y+1];else if(B=V.pmax)G=P[Y+1];else if(B0?e.touches[0].clientX:0}function kbe(e,r,t,a){if(r._context.staticPlot)return;var n=e.select("rect."+Ur.slideBoxClassName).node(),i=e.select("rect."+Ur.grabAreaMinClassName).node(),o=e.select("rect."+Ur.grabAreaMaxClassName).node();function l(){var s=Zm.event,u=s.target,f=LH(s),c=f-e.node().getBoundingClientRect().left,v=a.d2p(t._rl[0]),d=a.d2p(t._rl[1]),p=Abe.coverSlip();this.addEventListener("touchmove",y),this.addEventListener("touchend",m),p.addEventListener("mousemove",y),p.addEventListener("mouseup",m);function y(x){var T=LH(x),_=+T-f,b,w,k;switch(u){case n:if(k="ew-resize",v+_>t._length||d+_<0)return;b=v+_,w=d+_;break;case i:if(k="col-resize",v+_>t._length)return;b=v+_,w=d;break;case o:if(k="col-resize",d+_<0)return;b=v,w=d+_;break;default:k="ew-resize",b=c,w=c+_;break}if(w{"use strict";var Nbe=Ee(),Ibe=Gm(),zbe=aw(),iw=wH();RH.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:Nbe.extendFlat({},Ibe,{yaxis:zbe})}}},layoutAttributes:Gm(),handleDefaults:kH(),calcAutorange:qH(),draw:DH(),isVisible:iw.isVisible,makeData:iw.makeData,autoMarginOpts:iw.autoMarginOpts}});var Jm=N((HNe,NH)=>{"use strict";var Obe=ga(),FH=fi(),Bbe=wt().templatedArray,Hbe=Bbe("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});NH.exports={visible:{valType:"boolean",editType:"plot"},buttons:Hbe,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:Obe({editType:"plot"}),bgcolor:{valType:"color",dflt:FH.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:FH.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}});var ow=N((UNe,IH)=>{"use strict";IH.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}});var BH=N((GNe,OH)=>{"use strict";var $m=Ee(),Ube=Tr(),Gbe=wt(),Vbe=io(),zH=Jm(),lw=ow();OH.exports=function(r,t,a,n,i){var o=r.rangeselector||{},l=Gbe.newContainer(t,"rangeselector");function s(d,p){return $m.coerce(o,l,zH,d,p)}var u=Vbe(o,l,{name:"buttons",handleItemDefaults:Ybe,calendar:i}),f=s("visible",u.length>0);if(f){var c=Wbe(t,a,n);s("x",c[0]),s("y",c[1]),$m.noneOrAll(r,t,["x","y"]),s("xanchor"),s("yanchor"),$m.coerceFont(s,"font",a.font);var v=s("bgcolor");s("activecolor",Ube.contrast(v,lw.lightAmount,lw.darkAmount)),s("bordercolor"),s("borderwidth")}};function Ybe(e,r,t,a){var n=a.calendar;function i(s,u){return $m.coerce(e,r,zH.buttons,s,u)}var o=i("visible");if(o){var l=i("step");l!=="all"&&(n&&n!=="gregorian"&&(l==="month"||l==="year")?r.stepmode="backward":i("stepmode"),i("count")),i("label")}}function Wbe(e,r,t){for(var a=t.filter(function(l){return r[l].anchor===e._id}),n=0,i=0;i{"use strict";var jbe=ob(),Zbe=Ee().titleCase;HH.exports=function(r,t){var a=r._name,n={};if(t.step==="all")n[a+".autorange"]=!0;else{var i=Xbe(r,t);n[a+".range[0]"]=i[0],n[a+".range[1]"]=i[1]}return n};function Xbe(e,r){var t=e.range,a=new Date(e.r2l(t[1])),n=r.step,i=jbe["utc"+Zbe(n)],o=r.count,l;switch(r.stepmode){case"backward":l=e.l2r(+i.offset(a,-o));break;case"todate":var s=i.offset(a,-o);l=e.l2r(+i.ceil(s));break}var u=t[1];return[l,u]}});var JH=N((YNe,XH)=>{"use strict";var Qm=Sr(),Jbe=br(),$be=aa(),GH=Tr(),ZH=Yr(),kl=Ee(),VH=kl.strTranslate,Km=Aa(),Kbe=fa(),fw=Ha(),YH=fw.LINE_SPACING,WH=fw.FROM_TL,jH=fw.FROM_BR,uw=ow(),Qbe=UH();XH.exports=function(r){var t=r._fullLayout,a=t._infolayer.selectAll(".rangeselector").data(exe(r),rxe);a.enter().append("g").classed("rangeselector",!0),a.exit().remove(),a.style({cursor:"pointer","pointer-events":"all"}),a.each(function(n){var i=Qm.select(this),o=n,l=o.rangeselector,s=i.selectAll("g.button").data(kl.filterVisible(l.buttons));s.enter().append("g").classed("button",!0),s.exit().remove(),s.each(function(u){var f=Qm.select(this),c=Qbe(o,u);u._isActive=txe(o,u,c),f.call(sw,l,u),f.call(nxe,l,u,r),f.on("click",function(){r._dragged||Jbe.call("_guiRelayout",r,c)}),f.on("mouseover",function(){u._isHovered=!0,f.call(sw,l,u)}),f.on("mouseout",function(){u._isHovered=!1,f.call(sw,l,u)})}),oxe(r,s,l,o._name,i)})};function exe(e){for(var r=Kbe.list(e,"x",!0),t=[],a=0;a{"use strict";$H.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:Jm()}}},layoutAttributes:Jm(),handleDefaults:BH(),draw:JH()}});var Uc=N(cw=>{"use strict";var QH=bt().extendFlat;cw.attributes=function(e,r){e=e||{},r=r||{};var t={valType:"info_array",editType:e.editType,items:[{valType:"number",min:0,max:1,editType:e.editType},{valType:"number",min:0,max:1,editType:e.editType}],dflt:[0,1]},a=e.name?e.name+" ":"",n=e.trace?"trace ":"subplot ",i=r.description?" "+r.description:"",o={x:QH({},t,{}),y:QH({},t,{}),editType:e.editType};return e.noGridCell||(o.row={valType:"integer",min:0,dflt:0,editType:e.editType},o.column={valType:"integer",min:0,dflt:0,editType:e.editType}),o};cw.defaults=function(e,r,t,a){var n=a&&a.x||[0,1],i=a&&a.y||[0,1],o=r.grid;if(o){var l=t("domain.column");l!==void 0&&(l{"use strict";var lxe=Ee(),sxe=Ff().counter,uxe=Uc().attributes,eU=xa().idRegex,fxe=wt(),vw={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[sxe("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[eU.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[eU.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:uxe({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function eg(e,r,t){var a=r[t+"axes"],n=Object.keys((e._splomAxes||{})[t]||{});if(Array.isArray(a))return a;if(n.length)return n}function cxe(e,r){var t=e.grid||{},a=eg(r,t,"x"),n=eg(r,t,"y");if(!e.grid&&!a&&!n)return;var i=Array.isArray(t.subplots)&&Array.isArray(t.subplots[0]),o=Array.isArray(a),l=Array.isArray(n),s=o&&a!==t.xaxes&&l&&n!==t.yaxes,u,f;i?(u=t.subplots.length,f=t.subplots[0].length):(l&&(u=n.length),o&&(f=a.length));var c=fxe.newContainer(r,"grid");function v(k,M){return lxe.coerce(t,c,vw,k,M)}var d=v("rows",u),p=v("columns",f);if(!(d*p>1)){delete r.grid;return}if(!i&&!o&&!l){var y=v("pattern")==="independent";y&&(i=!0)}c._hasSubplotGrid=i;var m=v("roworder"),x=m==="top to bottom",T=i?.2:.1,_=i?.3:.1,b,w;s&&r._splomGridDflt&&(b=r._splomGridDflt.xside,w=r._splomGridDflt.yside),c._domains={x:rU("x",v,T,b,p),y:rU("y",v,_,w,d,x)}}function rU(e,r,t,a,n,i){var o=r(e+"gap",t),l=r("domain."+e);r(e+"side",a);for(var s=new Array(n),u=l[0],f=(l[1]-u)/(n-o),c=f*(1-o),v=0;v{"use strict";iU.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}});var sU=N((JNe,lU)=>{"use strict";var oU=Rr(),hxe=br(),dxe=Ee(),pxe=wt(),yxe=hw();lU.exports=function(e,r,t,a){var n="error_"+a.axis,i=pxe.newContainer(r,n),o=e[n]||{};function l(p,y){return dxe.coerce(o,i,yxe,p,y)}var s=o.array!==void 0||o.value!==void 0||o.type==="sqrt",u=l("visible",s);if(u!==!1){var f=l("type","array"in o?"data":"percent"),c=!0;f!=="sqrt"&&(c=l("symmetric",!((f==="data"?"arrayminus":"valueminus")in o))),f==="data"?(l("array"),l("traceref"),c||(l("arrayminus"),l("tracerefminus"))):(f==="percent"||f==="constant")&&(l("value"),c||l("valueminus"));var v="copy_"+a.inherit+"style";if(a.inherit){var d=r["error_"+a.inherit];(d||{}).visible&&l(v,!(o.color||oU(o.thickness)||oU(o.width)))}(!a.inherit||!i[v])&&(l("color",t),l("thickness"),l("width",hxe.traceIs(r,"gl3d")?0:4))}}});var dw=N(($Ne,fU)=>{"use strict";fU.exports=function(r){var t=r.type,a=r.symmetric;if(t==="data"){var n=r.array||[];if(a)return function(u,f){var c=+n[f];return[c,c]};var i=r.arrayminus||[];return function(u,f){var c=+n[f],v=+i[f];return!isNaN(c)||!isNaN(v)?[v||0,c||0]:[NaN,NaN]}}else{var o=uU(t,r.value),l=uU(t,r.valueminus);return a||r.valueminus===void 0?function(u){var f=o(u);return[f,f]}:function(u){return[l(u),o(u)]}}};function uU(e,r){if(e==="percent")return function(t){return Math.abs(t*r/100)};if(e==="constant")return function(){return Math.abs(r)};if(e==="sqrt")return function(t){return Math.sqrt(Math.abs(t))}}});var hU=N((KNe,vU)=>{"use strict";var pw=Rr(),mxe=br(),yw=zr(),gxe=Ee(),bxe=dw();vU.exports=function(r){for(var t=r.calcdata,a=0;a{"use strict";var dU=Sr(),ws=Rr(),xxe=Yr(),_xe=Pn();pU.exports=function(r,t,a,n){var i,o=a.xaxis,l=a.yaxis,s=n&&n.duration>0,u=r._context.staticPlot;t.each(function(f){var c=f[0].trace,v=c.error_x||{},d=c.error_y||{},p;c.ids&&(p=function(T){return T.id});var y=_xe.hasMarkers(c)&&c.marker.maxdisplayed>0;!d.visible&&!v.visible&&(f=[]);var m=dU.select(this).selectAll("g.errorbar").data(f,p);if(m.exit().remove(),!!f.length){v.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var x=m.enter().append("g").classed("errorbar",!0);s&&x.style("opacity",0).transition().duration(n.duration).style("opacity",1),xxe.setClipUrl(m,a.layerClipId,r),m.each(function(T){var _=dU.select(this),b=wxe(T,o,l);if(!(y&&!T.vis)){var w,k=_.select("path.yerror");if(d.visible&&ws(b.x)&&ws(b.yh)&&ws(b.ys)){var M=d.width;w="M"+(b.x-M)+","+b.yh+"h"+2*M+"m-"+M+",0V"+b.ys,b.noYS||(w+="m-"+M+",0h"+2*M),i=!k.size(),i?k=_.append("path").style("vector-effect",u?"none":"non-scaling-stroke").classed("yerror",!0):s&&(k=k.transition().duration(n.duration).ease(n.easing)),k.attr("d",w)}else k.remove();var q=_.select("path.xerror");if(v.visible&&ws(b.y)&&ws(b.xh)&&ws(b.xs)){var E=(v.copy_ystyle?d:v).width;w="M"+b.xh+","+(b.y-E)+"v"+2*E+"m0,-"+E+"H"+b.xs,b.noXS||(w+="m0,-"+E+"v"+2*E),i=!q.size(),i?q=_.append("path").style("vector-effect",u?"none":"non-scaling-stroke").classed("xerror",!0):s&&(q=q.transition().duration(n.duration).ease(n.easing)),q.attr("d",w)}else q.remove()}})}})};function wxe(e,r,t){var a={x:r.c2p(e.x),y:t.c2p(e.y)};return e.yh!==void 0&&(a.yh=t.c2p(e.yh),a.ys=t.c2p(e.ys),ws(a.ys)||(a.noYS=!0,a.ys=t.c2p(e.ys,!0))),e.xh!==void 0&&(a.xh=r.c2p(e.xh),a.xs=r.c2p(e.xs),ws(a.xs)||(a.noXS=!0,a.xs=r.c2p(e.xs,!0))),a}});var bU=N((eIe,gU)=>{"use strict";var Txe=Sr(),mU=Tr();gU.exports=function(r){r.each(function(t){var a=t[0].trace,n=a.error_y||{},i=a.error_x||{},o=Txe.select(this);o.selectAll("path.yerror").style("stroke-width",n.thickness+"px").call(mU.stroke,n.color),i.copy_ystyle&&(i=n),o.selectAll("path.xerror").style("stroke-width",i.thickness+"px").call(mU.stroke,i.color)})}});var wU=N((rIe,_U)=>{"use strict";var D0=Ee(),xU=eo().overrideAll,R0=hw(),Vu={error_x:D0.extendFlat({},R0),error_y:D0.extendFlat({},R0)};delete Vu.error_x.copy_zstyle;delete Vu.error_y.copy_zstyle;delete Vu.error_y.copy_ystyle;var P0={error_x:D0.extendFlat({},R0),error_y:D0.extendFlat({},R0),error_z:D0.extendFlat({},R0)};delete P0.error_x.copy_ystyle;delete P0.error_y.copy_ystyle;delete P0.error_z.copy_ystyle;delete P0.error_z.copy_zstyle;_U.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:Vu,bar:Vu,histogram:Vu,scatter3d:xU(P0,"calc","nested"),scattergl:xU(Vu,"calc","nested")}},supplyDefaults:sU(),calc:hU(),makeComputeError:dw(),plot:yU(),style:bU(),hoverInfo:Axe};function Axe(e,r,t){(r.error_y||{}).visible&&(t.yerr=e.yh-e.y,r.error_y.symmetric||(t.yerrneg=e.y-e.ys)),(r.error_x||{}).visible&&(t.xerr=e.xh-e.x,r.error_x.symmetric||(t.xerrneg=e.x-e.xs))}});var AU=N((tIe,TU)=>{"use strict";TU.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}});var EU=N((aIe,CU)=>{"use strict";var Ts=Sr(),mw=qn(),tg=aa(),MU=br(),Sl=zr(),rg=mi(),Ri=Ee(),bo=Ri.strTranslate,LU=bt().extendFlat,gw=ss(),go=Yr(),bw=Tr(),Mxe=oc(),kxe=Aa(),Sxe=Zn().flipScale,qxe=S4(),Lxe=q4(),Cxe=pi(),xw=Ha(),kU=xw.LINE_SPACING,SU=xw.FROM_TL,qU=xw.FROM_BR,Nt=AU().cn;function Exe(e){var r=e._fullLayout,t=r._infolayer.selectAll("g."+Nt.colorbar).data(Dxe(e),function(a){return a._id});t.enter().append("g").attr("class",function(a){return a._id}).classed(Nt.colorbar,!0),t.each(function(a){var n=Ts.select(this);Ri.ensureSingle(n,"rect",Nt.cbbg),Ri.ensureSingle(n,"g",Nt.cbfills),Ri.ensureSingle(n,"g",Nt.cblines),Ri.ensureSingle(n,"g",Nt.cbaxis,function(o){o.classed(Nt.crisp,!0)}),Ri.ensureSingle(n,"g",Nt.cbtitleunshift,function(o){o.append("g").classed(Nt.cbtitle,!0)}),Ri.ensureSingle(n,"rect",Nt.cboutline);var i=Rxe(n,a,e);i&&i.then&&(e._promises||[]).push(i),e._context.edits.colorbarPosition&&Pxe(n,a,e)}),t.exit().each(function(a){tg.autoMargin(e,a._id)}).remove(),t.order()}function Dxe(e){var r=e._fullLayout,t=e.calcdata,a=[],n,i,o,l;function s(_){return LU(_,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function u(){typeof l.calc=="function"?l.calc(e,o,n):(n._fillgradient=i.reversescale?Sxe(i.colorscale):i.colorscale,n._zrange=[i[l.min],i[l.max]])}for(var f=0;f1){var Q=Math.pow(10,Math.floor(Math.log(W)/Math.LN10));he*=Q*Ri.roundUp(W/Q,[2,5,10]),(Math.abs(R.start)/R.size+1e-6)%1<2e-6&&(se.tick0=0)}se.dtick=he}se.domain=a?[K+p/b.h,K+H-p/b.h]:[K+d/b.w,K+H-d/b.w],se.setScale(),e.attr("transform",bo(Math.round(b.l),Math.round(b.t)));var Z=e.select("."+Nt.cbtitleunshift).attr("transform",bo(-Math.round(b.l),-Math.round(b.t))),le=se.ticklabelposition,ve=se.title.font.size,me=e.select("."+Nt.cbaxis),Ce,Pe=0,Le=0;function ze(Ue,oe){var Ae={propContainer:se,propName:r._propPrefix+"title.text",traceIndex:r._traceIndex,_meta:r._meta,placeholder:_._dfltTitle.colorbar,containerGroup:e.select("."+Nt.cbtitle)},Xe=Ue.charAt(0)==="h"?Ue.slice(1):"h"+Ue;e.selectAll("."+Xe+",."+Xe+"-math-group").remove(),Mxe.draw(t,Ue,LU(Ae,oe||{}))}function Be(){if(a&&ce||!a&&!ce){var Ue,oe;q==="top"&&(Ue=d+b.l+X*y,oe=p+b.t+j*(1-K-H)+3+ve*.75),q==="bottom"&&(Ue=d+b.l+X*y,oe=p+b.t+j*(1-K)-3-ve*.25),q==="right"&&(oe=p+b.t+j*m+3+ve*.75,Ue=d+b.l+X*K),ze(se._id+"title",{attributes:{x:Ue,y:oe,"text-anchor":a?"start":"middle"}})}}function Ge(){if(a&&!ce||!a&&ce){var Ue=se.position||0,oe=se._offset+se._length/2,Ae,Xe;if(q==="right")Xe=oe,Ae=b.l+X*Ue+10+ve*(se.showticklabels?1:.5);else if(Ae=oe,q==="bottom"&&(Xe=b.t+j*Ue+10+(le.indexOf("inside")===-1?se.tickfont.size:0)+(se.ticks!=="inside"&&r.ticklen||0)),q==="top"){var dr=M.text.split("
").length;Xe=b.t+j*Ue+10-G-kU*ve*dr}ze((a?"h":"v")+se._id+"title",{avoid:{selection:Ts.select(t).selectAll("g."+se._id+"tick"),side:q,offsetTop:a?0:b.t,offsetLeft:a?b.l:0,maxShift:a?_.width:_.height},attributes:{x:Ae,y:Xe,"text-anchor":"middle"},transform:{rotate:a?-90:0,offset:0}})}}function De(){if(!a&&!ce||a&&ce){var Ue=e.select("."+Nt.cbtitle),oe=Ue.select("text"),Ae=[-s/2,s/2],Xe=Ue.select(".h"+se._id+"title-math-group").node(),dr=15.6;oe.node()&&(dr=parseInt(oe.node().style.fontSize,10)*kU);var Ne;if(Xe?(Ne=go.bBox(Xe),Le=Ne.width,Pe=Ne.height,Pe>dr&&(Ae[1]-=(Pe-dr)/2)):oe.node()&&!oe.classed(Nt.jsPlaceholder)&&(Ne=go.bBox(oe.node()),Le=Ne.width,Pe=Ne.height),a){if(Pe){if(Pe+=5,q==="top")se.domain[1]-=Pe/b.h,Ae[1]*=-1;else{se.domain[0]+=Pe/b.h;var Te=kxe.lineCount(oe);Ae[1]+=(1-Te)*dr}Ue.attr("transform",bo(Ae[0],Ae[1])),se.setScale()}}else Le&&(q==="right"&&(se.domain[0]+=(Le+ve/2)/b.w),Ue.attr("transform",bo(Ae[0],Ae[1])),se.setScale())}e.selectAll("."+Nt.cbfills+",."+Nt.cblines).attr("transform",a?bo(0,Math.round(b.h*(1-se.domain[1]))):bo(Math.round(b.w*se.domain[0]),0)),me.attr("transform",a?bo(0,Math.round(-b.t)):bo(Math.round(-b.l),0));var qe=e.select("."+Nt.cbfills).selectAll("rect."+Nt.cbfill).attr("style","").data(I);qe.enter().append("rect").classed(Nt.cbfill,!0).attr("style",""),qe.exit().remove();var He=E.map(se.c2p).map(Math.round).sort(function(rr,er){return rr-er});qe.each(function(rr,er){var Ie=[er===0?E[0]:(I[er]+I[er-1])/2,er===I.length-1?E[1]:(I[er]+I[er+1])/2].map(se.c2p).map(Math.round);a&&(Ie[1]=Ri.constrain(Ie[1]+(Ie[1]>Ie[0])?1:-1,He[0],He[1]));var ne=Ts.select(this).attr(a?"x":"y",ee).attr(a?"y":"x",Ts.min(Ie)).attr(a?"width":"height",Math.max(G,2)).attr(a?"height":"width",Math.max(Ts.max(Ie)-Ts.min(Ie),2));if(r._fillgradient)go.gradient(ne,t,r._id,a?"vertical":"horizontalreversed",r._fillgradient,"fill");else{var de=P(rr).replace("e-","");ne.attr("fill",mw(de).toHexString())}});var Je=e.select("."+Nt.cblines).selectAll("path."+Nt.cbline).data(k.color&&k.width?B:[]);Je.enter().append("path").classed(Nt.cbline,!0),Je.exit().remove(),Je.each(function(rr){var er=ee,Ie=Math.round(se.c2p(rr))+k.width/2%1;Ts.select(this).attr("d","M"+(a?er+","+Ie:Ie+","+er)+(a?"h":"v")+G).call(go.lineGroupStyle,k.width,D(rr),k.dash)}),me.selectAll("g."+se._id+"tick,path").remove();var We=ee+G+(s||0)/2-(r.ticks==="outside"?1:0),Ze=Sl.calcTicks(se),lr=Sl.getTickSigns(se)[2];return Sl.drawTicks(t,se,{vals:se.ticks==="inside"?Sl.clipEnds(se,Ze):Ze,layer:me,path:Sl.makeTickPath(se,We,lr),transFn:Sl.makeTransTickFn(se)}),Sl.drawLabels(t,se,{vals:Ze,layer:me,transFn:Sl.makeTransTickLabelFn(se),labelFns:Sl.makeLabelFns(se,We)})}function Oe(){var Ue,oe=G+s/2;le.indexOf("inside")===-1&&(Ue=go.bBox(me.node()),oe+=a?Ue.width:Ue.height),Ce=Z.select("text");var Ae=0,Xe=a&&q==="top",dr=!a&&q==="right",Ne=0;if(Ce.node()&&!Ce.classed(Nt.jsPlaceholder)){var Te,qe=Z.select(".h"+se._id+"title-math-group").node();qe&&(a&&ce||!a&&!ce)?(Ue=go.bBox(qe),Ae=Ue.width,Te=Ue.height):(Ue=go.bBox(Z.node()),Ae=Ue.right-b.l-(a?ee:we),Te=Ue.bottom-b.t-(a?we:ee),!a&&q==="top"&&(oe+=Ue.height,Ne=Ue.height)),dr&&(Ce.attr("transform",bo(Ae/2+ve/2,0)),Ae*=2),oe=Math.max(oe,a?Ae:Te)}var He=(a?d:p)*2+oe+u+s/2,Je=0;!a&&M.text&&v==="bottom"&&m<=0&&(Je=He/2,He+=Je,Ne+=Je),_._hColorbarMoveTitle=Je,_._hColorbarMoveCBTitle=Ne;var We=u+s,Ze=(a?ee:we)-We/2-(a?d:0),lr=(a?we:ee)-(a?V:p+Ne-Je);e.select("."+Nt.cbbg).attr("x",Ze).attr("y",lr).attr(a?"width":"height",Math.max(He-Je,2)).attr(a?"height":"width",Math.max(V+We,2)).call(bw.fill,f).call(bw.stroke,r.bordercolor).style("stroke-width",u);var rr=dr?Math.max(Ae-10,0):0;e.selectAll("."+Nt.cboutline).attr("x",(a?ee:we+d)+rr).attr("y",(a?we+p-V:ee)+(Xe?Pe:0)).attr(a?"width":"height",Math.max(G,2)).attr(a?"height":"width",Math.max(V-(a?2*p+Pe:2*d+rr),2)).call(bw.stroke,r.outlinecolor).style({fill:"none","stroke-width":s});var er=a?fe*He:0,Ie=a?0:(1-ie)*He-Ne;if(er=T?b.l-er:-er,Ie=x?b.t-Ie:-Ie,e.attr("transform",bo(er,Ie)),!a&&(u||mw(f).getAlpha()&&!mw.equals(_.paper_bgcolor,f))){var ne=me.selectAll("text"),de=ne[0].length,Re=e.select("."+Nt.cbbg).node(),Fe=go.bBox(Re),Ke=go.getTranslate(e),cr=2;ne.each(function(wa,Zt){var Xt=0,Na=de-1;if(Zt===Xt||Zt===Na){var ua=go.bBox(this),Jt=go.getTranslate(this),ar;if(Zt===Na){var Jr=ua.right+Jt.x,Xr=Fe.right+Ke.x+we-u-cr+y;ar=Xr-Jr,ar>0&&(ar=0)}else if(Zt===Xt){var $r=ua.left+Jt.x,Rt=Fe.left+Ke.x+we+u+cr;ar=Rt-$r,ar<0&&(ar=0)}ar&&(de<3?this.setAttribute("transform","translate("+ar+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var ur={},Mr=SU[c],Ir=qU[c],Gr=SU[v],et=qU[v],qt=He-G;a?(i==="pixels"?(ur.y=m,ur.t=V*Gr,ur.b=V*et):(ur.t=ur.b=0,ur.yt=m+n*Gr,ur.yb=m-n*et),l==="pixels"?(ur.x=y,ur.l=He*Mr,ur.r=He*Ir):(ur.l=qt*Mr,ur.r=qt*Ir,ur.xl=y-o*Mr,ur.xr=y+o*Ir)):(i==="pixels"?(ur.x=y,ur.l=V*Mr,ur.r=V*Ir):(ur.l=ur.r=0,ur.xl=y+n*Mr,ur.xr=y-n*Ir),l==="pixels"?(ur.y=1-m,ur.t=He*Gr,ur.b=He*et):(ur.t=qt*Gr,ur.b=qt*et,ur.yt=m-o*Gr,ur.yb=m+o*et));var ct=r.y<.5?"b":"t",Ot=r.x<.5?"l":"r";t._fullLayout._reservedMargin[r._id]={};var gt={r:_.width-Ze-er,l:Ze+ur.r,b:_.height-lr-Ie,t:lr+ur.b};T&&x?tg.autoMargin(t,r._id,ur):T?t._fullLayout._reservedMargin[r._id][ct]=gt[ct]:x||a?t._fullLayout._reservedMargin[r._id][Ot]=gt[Ot]:t._fullLayout._reservedMargin[r._id][ct]=gt[ct]}return Ri.syncOrAsync([tg.previousPromises,Be,De,Ge,tg.previousPromises,Oe],t)}function Pxe(e,r,t){var a=r.orientation==="v",n=t._fullLayout,i=n._size,o,l,s;rg.init({element:e.node(),gd:t,prepFn:function(){o=e.attr("transform"),gw(e)},moveFn:function(u,f){e.attr("transform",o+bo(u,f)),l=rg.align((a?r._uFrac:r._vFrac)+u/i.w,a?r._thickFrac:r._lenFrac,0,1,r.xanchor),s=rg.align((a?r._vFrac:1-r._uFrac)-f/i.h,a?r._lenFrac:r._thickFrac,0,1,r.yanchor);var c=rg.getCursor(l,s,r.xanchor,r.yanchor);gw(e,c)},doneFn:function(){if(gw(e),l!==void 0&&s!==void 0){var u={};u[r._propPrefix+"x"]=l,u[r._propPrefix+"y"]=s,r._traceIndex!==void 0?MU.call("_guiRestyle",t,u,r._traceIndex):MU.call("_guiRelayout",t,u)}}})}function Fxe(e,r,t){var a=r._levels,n=[],i=[],o,l,s=a.end+a.size/100,u=a.size,f=1.001*t[0]-.001*t[1],c=1.001*t[1]-.001*t[0];for(l=0;l<1e5&&(o=a.start+l*u,!(u>0?o>=s:o<=s));l++)o>f&&o0?o>=s:o<=s));l++)o>t[0]&&o{"use strict";DU.exports={moduleType:"component",name:"colorbar",attributes:h1(),supplyDefaults:gx(),draw:EU().draw,hasColorbar:cx()}});var FU=N((iIe,PU)=>{"use strict";PU.exports={moduleType:"component",name:"legend",layoutAttributes:h5(),supplyLayoutDefaults:p5(),draw:q5(),style:A5()}});var IU=N((oIe,NU)=>{"use strict";NU.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}});var OU=N((lIe,zU)=>{"use strict";zU.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}});var ww=N((sIe,GU)=>{"use strict";var Ixe=br(),UU=Ee(),_w=UU.extendFlat,BU=UU.extendDeep;function HU(e){var r;switch(e){case"themes__thumb":r={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":r={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:r={}}return r}function zxe(e){var r=["xaxis","yaxis","zaxis"];return r.indexOf(e.slice(0,5))>-1}GU.exports=function(r,t){var a,n=r.data,i=r.layout,o=BU([],n),l=BU({},i,HU(t.tileClass)),s=r._context||{};if(t.width&&(l.width=t.width),t.height&&(l.height=t.height),t.tileClass==="thumbnail"||t.tileClass==="themes__thumb"){l.annotations=[];var u=Object.keys(l);for(a=0;a{"use strict";var Oxe=su().EventEmitter,Bxe=br(),Hxe=Ee(),VU=Tl(),Uxe=ww(),Gxe=sm(),Vxe=um();function Yxe(e,r){var t=new Oxe,a=Uxe(e,{format:"png"}),n=a.gd;n.style.position="absolute",n.style.left="-5000px",document.body.appendChild(n);function i(){var l=VU.getDelay(n._fullLayout);setTimeout(function(){var s=Gxe(n),u=document.createElement("canvas");u.id=Hxe.randstr(),t=Vxe({format:r.format,width:n._fullLayout.width,height:n._fullLayout.height,canvas:u,emitter:t,svg:s}),t.clean=function(){n&&document.body.removeChild(n)}},l)}var o=VU.getRedrawFunc(n);return Bxe.call("_doPlot",n,a.data,a.layout,a.config).then(o).then(i).catch(function(l){t.emit("error",l)}),t}YU.exports=Yxe});var XU=N((fIe,ZU)=>{"use strict";var jU=Tl(),Wxe={getDelay:jU.getDelay,getRedrawFunc:jU.getRedrawFunc,clone:ww(),toSVG:sm(),svgToImg:um(),toImage:WU(),downloadImage:W_()};ZU.exports=Wxe});var $U=N(ql=>{"use strict";ql.version=mp().version;eM();GS();var jxe=br(),F0=ql.register=jxe.register,Aw=fI(),JU=Object.keys(Aw);for(ag=0;ag{"use strict";KU.exports=$U()});var Wu=N((hIe,nG)=>{"use strict";var Gt=Ai(),eG=no().axisHoverFormat,{hovertemplateAttrs:Zxe,texttemplateAttrs:Xxe,templatefallbackAttrs:rG}=Wn(),aG=Lo(),Jxe=ga(),tG=m0(),$xe=ci().pattern,Yu=bt().extendFlat,Mw=Jxe({editType:"calc",arrayOk:!0,colorEditType:"style"}),Kxe=Gt.marker,Qxe=Kxe.line,e5e=Yu({},Qxe.width,{dflt:0}),r5e=Yu({width:e5e,editType:"calc"},aG("marker.line")),t5e=Yu({line:r5e,editType:"calc"},aG("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:$xe,cornerradius:{valType:"any",editType:"calc"}});nG.exports={x:Gt.x,x0:Gt.x0,dx:Gt.dx,y:Gt.y,y0:Gt.y0,dy:Gt.dy,xperiod:Gt.xperiod,yperiod:Gt.yperiod,xperiod0:Gt.xperiod0,yperiod0:Gt.yperiod0,xperiodalignment:Gt.xperiodalignment,yperiodalignment:Gt.yperiodalignment,xhoverformat:eG("x"),yhoverformat:eG("y"),text:Gt.text,texttemplate:Xxe({editType:"plot"},{keys:tG.eventDataKeys}),texttemplatefallback:rG({editType:"plot"}),hovertext:Gt.hovertext,hovertemplate:Zxe({},{keys:tG.eventDataKeys}),hovertemplatefallback:rG(),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:Yu({},Mw,{}),insidetextfont:Yu({},Mw,{}),outsidetextfont:Yu({},Mw,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:Yu({},Gt.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:t5e,offsetgroup:Gt.offsetgroup,alignmentgroup:Gt.alignmentgroup,selected:{marker:{opacity:Gt.selected.marker.opacity,color:Gt.selected.marker.color,editType:"style"},textfont:Gt.selected.textfont,editType:"style"},unselected:{marker:{opacity:Gt.unselected.marker.opacity,color:Gt.unselected.marker.color,editType:"style"},textfont:Gt.unselected.textfont,editType:"style"},zorder:Gt.zorder}});var ig=N((dIe,iG)=>{"use strict";iG.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}});var kw=N((pIe,sG)=>{"use strict";var a5e=Tr(),oG=Zn().hasColorscale,lG=yl(),n5e=Ee().coercePattern;sG.exports=function(r,t,a,n,i){var o=a("marker.color",n),l=oG(r,"marker");l&&lG(r,t,i,a,{prefix:"marker.",cLetter:"c"}),a("marker.line.color",a5e.defaultLine),oG(r,"marker.line")&&lG(r,t,i,a,{prefix:"marker.line.",cLetter:"c"}),a("marker.line.width"),a("marker.opacity"),n5e(a,"marker.pattern",o,l),a("selected.marker.color"),a("unselected.marker.color")}});var ju=N((yIe,dG)=>{"use strict";var uG=Rr(),Vc=Ee(),fG=Tr(),i5e=br(),o5e=X_(),l5e=Mc(),s5e=kw(),u5e=p0(),cG=Wu(),og=Vc.coerceFont;function f5e(e,r,t,a){function n(u,f){return Vc.coerce(e,r,cG,u,f)}var i=o5e(e,r,a,n);if(!i){r.visible=!1;return}l5e(e,r,a,n),n("xhoverformat"),n("yhoverformat"),n("zorder"),n("orientation",r.x&&!r.y?"h":"v"),n("base"),n("offset"),n("width"),n("text"),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback");var o=n("textposition");hG(e,r,a,n,o,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),s5e(e,r,n,t,a);var l=(r.marker.line||{}).color,s=i5e.getComponentMethod("errorbars","supplyDefaults");s(e,r,l||fG.defaultLine,{axis:"y"}),s(e,r,l||fG.defaultLine,{axis:"x",inherit:"y"}),Vc.coerceSelectionMarkerOpacity(r,n)}function c5e(e,r){var t,a;function n(l,s){return Vc.coerce(a._input,a,cG,l,s)}for(var i=0;i=0)return e}else if(typeof e=="string"&&(e=e.trim(),e.slice(-1)==="%"&&uG(e.slice(0,-1))&&(e=+e.slice(0,-1),e>=0)))return e+"%"}function hG(e,r,t,a,n,i){i=i||{};var o=i.moduleHasSelected!==!1,l=i.moduleHasUnselected!==!1,s=i.moduleHasConstrain!==!1,u=i.moduleHasCliponaxis!==!1,f=i.moduleHasTextangle!==!1,c=i.moduleHasInsideanchor!==!1,v=!!i.hasPathbar,d=Array.isArray(n)||n==="auto",p=d||n==="inside",y=d||n==="outside";if(p||y){var m=og(a,"textfont",t.font),x=Vc.extendFlat({},m),T=e.textfont&&e.textfont.color,_=!T;if(_&&delete x.color,og(a,"insidetextfont",x),v){var b=Vc.extendFlat({},m);_&&delete b.color,og(a,"pathbar.textfont",b)}y&&og(a,"outsidetextfont",m),o&&a("selected.textfont.color"),l&&a("unselected.textfont.color"),s&&a("constraintext"),u&&a("cliponaxis"),f&&a("textangle"),a("texttemplate"),a("texttemplatefallback")}p&&c&&a("insidetextanchor")}dG.exports={supplyDefaults:f5e,crossTraceDefaults:c5e,handleText:hG,validateCornerradius:vG}});var Sw=N((mIe,pG)=>{"use strict";var v5e=br(),h5e=zr(),d5e=Ee(),p5e=ig(),y5e=ju().validateCornerradius;pG.exports=function(e,r,t){function a(y,m){return d5e.coerce(e,r,p5e,y,m)}for(var n=!1,i=!1,o=!1,l={},s=a("barmode"),u=s==="group",f=0;f0&&!l[v]&&(o=!0),l[v]=!0),c.visible&&c.type==="histogram"){var d=h5e.getFromId({_fullLayout:r},c[c.orientation==="v"?"xaxis":"yaxis"]);d.type!=="category"&&(i=!0)}}if(!n){delete r.barmode;return}s!=="overlay"&&a("barnorm"),a("bargap",i&&!o?0:.2),a("bargroupgap");var p=a("barcornerradius");r.barcornerradius=y5e(p)}});var lg=N((gIe,yG)=>{"use strict";var Yc=Ee();yG.exports=function(r,t){for(var a=0;a{"use strict";var mG=zr(),gG=Sc(),bG=Zn().hasColorscale,xG=ec(),m5e=lg(),g5e=mm();_G.exports=function(r,t){var a=mG.getFromId(r,t.xaxis||"x"),n=mG.getFromId(r,t.yaxis||"y"),i,o,l,s,u,f,c={msUTC:!!(t.base||t.base===0)};t.orientation==="h"?(i=a.makeCalcdata(t,"x",c),l=n.makeCalcdata(t,"y"),s=gG(t,n,"y",l),u=!!t.yperiodalignment,f="y"):(i=n.makeCalcdata(t,"y",c),l=a.makeCalcdata(t,"x"),s=gG(t,a,"x",l),u=!!t.xperiodalignment,f="x"),o=s.vals;for(var v=Math.min(o.length,i.length),d=new Array(v),p=0;p{"use strict";var b5e=Sr(),x5e=Ee();function _5e(e,r,t){var a=e._fullLayout,n=a["_"+t+"Text_minsize"];if(n){var i=a.uniformtext.mode==="hide",o;switch(t){case"funnelarea":case"pie":case"sunburst":o="g.slice";break;case"treemap":case"icicle":o="g.slice, g.pathbar";break;default:o="g.points > g.point"}r.selectAll(o).each(function(l){var s=l.transform;if(s){s.scale=i&&s.hide?0:n/s.fontSize;var u=b5e.select(this).select("text");x5e.setTransormAndDisplay(u,s)}})}}function w5e(e,r,t){if(t.uniformtext.mode){var a=TG(e),n=t.uniformtext.minsize,i=r.scale*r.fontSize;r.hide=i{"use strict";var A5e=Rr(),M5e=qn(),MG=Ee().isArrayOrTypedArray;Zu.coerceString=function(e,r,t){if(typeof r=="string"){if(r||!e.noBlank)return r}else if((typeof r=="number"||r===!0)&&!e.strict)return String(r);return t!==void 0?t:e.dflt};Zu.coerceNumber=function(e,r,t){if(A5e(r)){r=+r;var a=e.min,n=e.max,i=a!==void 0&&rn;if(!i)return r}return t!==void 0?t:e.dflt};Zu.coerceColor=function(e,r,t){return M5e(r).isValid()?r:t!==void 0?t:e.dflt};Zu.coerceEnumerated=function(e,r,t){return e.coerceNumber&&(r=+r),e.values.indexOf(r)!==-1?r:t!==void 0?t:e.dflt};Zu.getValue=function(e,r){var t;return MG(e)?r{"use strict";var I0=Sr(),k5e=Tr(),z0=Yr(),kG=Ee(),SG=br(),qG=N0().resizeText,qw=Wu(),S5e=qw.textfont,q5e=qw.insidetextfont,L5e=qw.outsidetextfont,Ya=sg();function C5e(e){var r=I0.select(e).selectAll('g[class^="barlayer"]').selectAll("g.trace");qG(e,r,"bar");var t=r.size(),a=e._fullLayout;r.style("opacity",function(n){return n[0].trace.opacity}).each(function(n){(a.barmode==="stack"&&t>1||a.bargap===0&&a.bargroupgap===0&&!n[0].trace.marker.line.width)&&I0.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(n){var i=I0.select(this),o=n[0].trace;LG(i,o,e)}),SG.getComponentMethod("errorbars","style")(r)}function LG(e,r,t){z0.pointStyle(e.selectAll("path"),r,t),CG(e,r,t)}function CG(e,r,t){e.selectAll("text").each(function(a){var n=I0.select(this),i=kG.ensureUniformFontSize(t,EG(n,a,r,t));z0.font(n,i)})}function E5e(e,r,t){var a=r[0].trace;a.selectedpoints?D5e(t,a,e):(LG(t,a,e),SG.getComponentMethod("errorbars","style")(t))}function D5e(e,r,t){z0.selectedPointStyle(e.selectAll("path"),r),R5e(e.selectAll("text"),r,t)}function R5e(e,r,t){e.each(function(a){var n=I0.select(this),i;if(a.selected){i=kG.ensureUniformFontSize(t,EG(n,a,r,t));var o=r.selected.textfont&&r.selected.textfont.color;o&&(i.color=o),z0.font(n,i)}else z0.selectedTextStyle(n,r)})}function EG(e,r,t,a){var n=a._fullLayout.font,i=t.textfont;if(e.classed("bartext-inside")){var o=FG(r,t);i=RG(t,r.i,n,o)}else e.classed("bartext-outside")&&(i=PG(t,r.i,n));return i}function DG(e,r,t){return Lw(S5e,e.textfont,r,t)}function RG(e,r,t,a){var n=DG(e,r,t),i=e._input.textfont===void 0||e._input.textfont.color===void 0||Array.isArray(e.textfont.color)&&e.textfont.color[r]===void 0;return i&&(n={color:k5e.contrast(a),family:n.family,size:n.size,weight:n.weight,style:n.style,variant:n.variant,textcase:n.textcase,lineposition:n.lineposition,shadow:n.shadow}),Lw(q5e,e.insidetextfont,r,n)}function PG(e,r,t){var a=DG(e,r,t);return Lw(L5e,e.outsidetextfont,r,a)}function Lw(e,r,t,a){r=r||{};var n=Ya.getValue(r.family,t),i=Ya.getValue(r.size,t),o=Ya.getValue(r.color,t),l=Ya.getValue(r.weight,t),s=Ya.getValue(r.style,t),u=Ya.getValue(r.variant,t),f=Ya.getValue(r.textcase,t),c=Ya.getValue(r.lineposition,t),v=Ya.getValue(r.shadow,t);return{family:Ya.coerceString(e.family,n,a.family),size:Ya.coerceNumber(e.size,i,a.size),color:Ya.coerceColor(e.color,o,a.color),weight:Ya.coerceString(e.weight,l,a.weight),style:Ya.coerceString(e.style,s,a.style),variant:Ya.coerceString(e.variant,u,a.variant),textcase:Ya.coerceString(e.variant,f,a.textcase),lineposition:Ya.coerceString(e.variant,c,a.lineposition),shadow:Ya.coerceString(e.variant,v,a.shadow)}}function FG(e,r){return r.type==="waterfall"?r[e.dir].marker.color:e.mcc||e.mc||r.marker.color}NG.exports={style:C5e,styleTextPoints:CG,styleOnSelect:E5e,getInsideTextFont:RG,getOutsideTextFont:PG,getBarColor:FG,resizeText:qG}});var Dw=N((TIe,VG)=>{"use strict";var ug=Sr(),fg=Rr(),Ra=Ee(),P5e=Aa(),F5e=Tr(),As=Yr(),N5e=br(),cg=zr().tickText,IG=N0(),I5e=IG.recordMinTextSize,z5e=IG.clearMinTextSize,Cw=Wc(),jc=sg(),O5e=m0(),zG=Wu(),B5e=zG.text,H5e=zG.textposition,U5e=Eo().appendArrayPointValue,hn=O5e.TEXTPAD;function G5e(e){return e.id}function V5e(e){if(e.ids)return G5e}function Ew(e){return(e>0)-(e<0)}function Zo(e,r){return e0}function W5e(e,r,t,a,n,i){var o=r.xaxis,l=r.yaxis,s=e._fullLayout,u=e._context.staticPlot;n||(n={mode:s.barmode,norm:s.barmode,gap:s.bargap,groupgap:s.bargroupgap},z5e("bar",s));var f=Ra.makeTraceGroups(a,t,"trace bars").each(function(c){var v=ug.select(this),d=c[0].trace,p=c[0].t,y=d.type==="waterfall",m=d.type==="funnel",x=d.type==="histogram",T=d.type==="bar",_=T||m,b=0;y&&d.connector.visible&&d.connector.mode==="between"&&(b=d.connector.line.width/2);var w=d.orientation==="h",k=BG(n),M=Ra.ensureSingle(v,"g","points"),q=V5e(d),E=M.selectAll("g.point").data(Ra.identity,q);E.enter().append("g").classed("point",!0),E.exit().remove(),E.each(function(P,R){var z=ug.select(this),I=Y5e(P,o,l,w),B=I[0][0],G=I[0][1],Y=I[1][0],V=I[1][1],H=(w?G-B:V-Y)===0;H&&_&&jc.getLineWidth(d,P)&&(H=!1),H||(H=!fg(B)||!fg(G)||!fg(Y)||!fg(V)),P.isBlank=H,H&&(w?G=B:V=Y),b&&!H&&(w?(B-=Zo(B,G)*b,G+=Zo(B,G)*b):(Y-=Zo(Y,V)*b,V+=Zo(Y,V)*b));var X,j;if(d.type==="waterfall"){if(!H){var ee=d[P.dir].marker;X=ee.line.width,j=ee.color}}else X=jc.getLineWidth(d,P),j=P.mc||d.marker.color;function fe(oe){var Ae=ug.round(X/2%1,2);return n.gap===0&&n.groupgap===0?ug.round(Math.round(oe)-Ae,2):oe}function ie(oe,Ae,Xe){return Xe&&oe===Ae?oe:Math.abs(oe-Ae)>=2?fe(oe):oe>Ae?Math.ceil(oe):Math.floor(oe)}var ue=F5e.opacity(j),K=ue<1||X>.01?fe:ie;e._context.staticPlot||(B=K(B,G,w),G=K(G,B,w),Y=K(Y,V,!w),V=K(V,Y,!w));var we=w?o.c2p:l.c2p,se;P.s0>0?se=P._sMax:P.s0<0?se=P._sMin:se=P.s1>0?P._sMax:P._sMin;function ce(oe,Ae){if(!oe)return 0;var Xe=Math.abs(w?V-Y:G-B),dr=Math.abs(w?G-B:V-Y),Ne=K(Math.abs(we(se,!0)-we(0,!0))),Te=P.hasB?Math.min(Xe/2,dr/2):Math.min(Xe/2,Ne),qe;if(Ae==="%"){var He=Math.min(50,oe);qe=Xe*(He/100)}else qe=oe;return K(Math.max(Math.min(qe,Te),0))}var he=T||x?ce(p.cornerradiusvalue,p.cornerradiusform):0,ye,W,Q="M"+B+","+Y+"V"+V+"H"+G+"V"+Y+"Z",Z=0;if(he&&P.s){var le=Ew(P.s0)===0||Ew(P.s)===Ew(P.s0)?P.s1:P.s0;if(Z=K(P.hasB?0:Math.abs(we(se,!0)-we(le,!0))),Z0?Math.sqrt(Z*(2*he-Z)):0,ze=ve>0?Math.max:Math.min;ye="M"+B+","+Y+"V"+(V-Pe*me)+"H"+ze(G-(he-Z)*ve,B)+"A "+he+","+he+" 0 0 "+Ce+" "+G+","+(V-he*me-Le)+"V"+(Y+he*me+Le)+"A "+he+","+he+" 0 0 "+Ce+" "+ze(G-(he-Z)*ve,B)+","+(Y+Pe*me)+"Z"}else if(P.hasB)ye="M"+(B+he*ve)+","+Y+"A "+he+","+he+" 0 0 "+Ce+" "+B+","+(Y+he*me)+"V"+(V-he*me)+"A "+he+","+he+" 0 0 "+Ce+" "+(B+he*ve)+","+V+"H"+(G-he*ve)+"A "+he+","+he+" 0 0 "+Ce+" "+G+","+(V-he*me)+"V"+(Y+he*me)+"A "+he+","+he+" 0 0 "+Ce+" "+(G-he*ve)+","+Y+"Z";else{W=Math.abs(V-Y)+Z;var Be=W0?Math.sqrt(Z*(2*he-Z)):0,De=me>0?Math.max:Math.min;ye="M"+(B+Be*ve)+","+Y+"V"+De(V-(he-Z)*me,Y)+"A "+he+","+he+" 0 0 "+Ce+" "+(B+he*ve-Ge)+","+V+"H"+(G-he*ve+Ge)+"A "+he+","+he+" 0 0 "+Ce+" "+(G-Be*ve)+","+De(V-(he-Z)*me,Y)+"V"+Y+"Z"}}else ye=Q}else ye=Q;var Oe=OG(Ra.ensureSingle(z,"path"),s,n,i);if(Oe.style("vector-effect",u?"none":"non-scaling-stroke").attr("d",isNaN((G-B)*(V-Y))||H&&e._context.staticPlot?"M0,0Z":ye).call(As.setClipUrl,r.layerClipId,e),!s.uniformtext.mode&&k){var Ue=As.makePointStyleFns(d);As.singlePointStyle(P,Oe,d,Ue,e)}j5e(e,r,z,c,R,B,G,Y,V,he,Z,n,i),r.layerClipId&&As.hideOutsideRangePoint(P,z.select("text"),o,l,d.xcalendar,d.ycalendar)});var D=d.cliponaxis===!1;As.setClipUrl(v,D?null:r.layerClipId,e)});N5e.getComponentMethod("errorbars","plot")(e,f,r,n)}function j5e(e,r,t,a,n,i,o,l,s,u,f,c,v){var d=r.xaxis,p=r.yaxis,y=e._fullLayout,m;function x(W,Q,Z){var le=Ra.ensureSingle(W,"text").text(Q).attr({class:"bartext bartext-"+m,"text-anchor":"middle","data-notex":1}).call(As.font,Z).call(P5e.convertToTspans,e);return le}var T=a[0].trace,_=T.orientation==="h",b=J5e(y,a,n,d,p);m=$5e(T,n);var w=c.mode==="stack"||c.mode==="relative",k=a[n],M=!w||k._outmost,q=k.hasB,E=u&&u-f>hn;if(!b||m==="none"||(k.isBlank||i===o||l===s)&&(m==="auto"||m==="inside")){t.select("text").remove();return}var D=y.font,P=Cw.getBarColor(a[n],T),R=Cw.getInsideTextFont(T,n,D,P),z=Cw.getOutsideTextFont(T,n,D),I=T.insidetextanchor||"end",B=t.datum();_?d.type==="log"&&B.s0<=0&&(d.range[0]0&&fe>0,K;E?q?K=Xu(V-2*u,H,ee,fe,_)||Xu(V,H-2*u,ee,fe,_):_?K=Xu(V-(u-f),H,ee,fe,_)||Xu(V,H-2*(u-f),ee,fe,_):K=Xu(V,H-(u-f),ee,fe,_)||Xu(V-2*(u-f),H,ee,fe,_):K=Xu(V,H,ee,fe,_),ue&&K?m="inside":(m="outside",X.remove(),X=null)}else m="inside";if(!X){ie=Ra.ensureUniformFontSize(e,m==="outside"?z:R),X=x(t,b,ie);var we=X.attr("transform");if(X.attr("transform",""),j=As.bBox(X.node()),ee=j.width,fe=j.height,X.attr("transform",we),ee<=0||fe<=0){X.remove();return}}var se=T.textangle,ce,he;m==="outside"?(he=T.constraintext==="both"||T.constraintext==="outside",ce=X5e(i,o,l,s,j,{isHorizontal:_,constrained:he,angle:se})):(he=T.constraintext==="both"||T.constraintext==="inside",ce=GG(i,o,l,s,j,{isHorizontal:_,constrained:he,angle:se,anchor:I,hasB:q,r:u,overhead:f})),ce.fontSize=ie.size,I5e(T.type==="histogram"?"bar":T.type,ce,y),k.transform=ce;var ye=OG(X,y,c,v);Ra.setTransormAndDisplay(ye,ce)}function Xu(e,r,t,a,n){if(e<0||r<0)return!1;var i=t<=e&&a<=r,o=t<=r&&a<=e,l=n?e>=t*(r/a):r>=a*(e/t);return i||o||l}function HG(e){return e==="auto"?0:e}function UG(e,r){var t=Math.PI/180*r,a=Math.abs(Math.sin(t)),n=Math.abs(Math.cos(t));return{x:e.width*n+e.height*a,y:e.width*a+e.height*n}}function GG(e,r,t,a,n,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,u=i.anchor,f=u==="end",c=u==="start",v=i.leftToRight||0,d=(v+1)/2,p=1-d,y=i.hasB,m=i.r,x=i.overhead,T=n.width,_=n.height,b=Math.abs(r-e),w=Math.abs(a-t),k=b>2*hn&&w>2*hn?hn:0;b-=2*k,w-=2*k;var M=HG(s);s==="auto"&&!(T<=b&&_<=w)&&(T>b||_>w)&&(!(T>w||_>b)||T<_!=bhn){var P=Z5e(e,r,t,a,q,m,x,o,y);E=P.scale,D=P.pad}else E=1,l&&(E=Math.min(1,b/q.x,w/q.y)),D=0;var R=n.left*p+n.right*d,z=(n.top+n.bottom)/2,I=(e+hn)*p+(r-hn)*d,B=(t+a)/2,G=0,Y=0;if(c||f){var V=(o?q.x:q.y)/2;m&&(f||y)&&(k+=D);var H=o?Zo(e,r):Zo(t,a);o?c?(I=e+H*k,G=-H*V):(I=r-H*k,G=H*V):c?(B=t+H*k,Y=-H*V):(B=a-H*k,Y=H*V)}return{textX:R,textY:z,targetX:I,targetY:B,anchorX:G,anchorY:Y,scale:E,rotate:M}}function Z5e(e,r,t,a,n,i,o,l,s){var u=Math.max(0,Math.abs(r-e)-2*hn),f=Math.max(0,Math.abs(a-t)-2*hn),c=i-hn,v=o?c-Math.sqrt(c*c-(c-o)*(c-o)):c,d=s?c*2:l?c-o:2*v,p=s?c*2:l?2*v:c-o,y,m,x,T,_;return n.y/n.x>=f/(u-d)?T=f/n.y:n.y/n.x<=(f-p)/u?T=u/n.x:!s&&l?(y=n.x*n.x+n.y*n.y/4,m=-2*n.x*(u-c)-n.y*(f/2-c),x=(u-c)*(u-c)+(f/2-c)*(f/2-c)-c*c,T=(-m+Math.sqrt(m*m-4*y*x))/(2*y)):s?(y=(n.x*n.x+n.y*n.y)/4,m=-n.x*(u/2-c)-n.y*(f/2-c),x=(u/2-c)*(u/2-c)+(f/2-c)*(f/2-c)-c*c,T=(-m+Math.sqrt(m*m-4*y*x))/(2*y)):(y=n.x*n.x/4+n.y*n.y,m=-n.x*(u/2-c)-2*n.y*(f-c),x=(u/2-c)*(u/2-c)+(f-c)*(f-c)-c*c,T=(-m+Math.sqrt(m*m-4*y*x))/(2*y)),T=Math.min(1,T),l?_=Math.max(0,c-Math.sqrt(Math.max(0,c*c-(c-(f-n.y*T)/2)*(c-(f-n.y*T)/2)))-o):_=Math.max(0,c-Math.sqrt(Math.max(0,c*c-(c-(u-n.x*T)/2)*(c-(u-n.x*T)/2)))-o),{scale:T,pad:_}}function X5e(e,r,t,a,n,i){var o=!!i.isHorizontal,l=!!i.constrained,s=i.angle||0,u=n.width,f=n.height,c=Math.abs(r-e),v=Math.abs(a-t),d;o?d=v>2*hn?hn:0:d=c>2*hn?hn:0;var p=1;l&&(p=o?Math.min(1,v/f):Math.min(1,c/u));var y=HG(s),m=UG(n,y),x=(o?m.x:m.y)/2,T=(n.left+n.right)/2,_=(n.top+n.bottom)/2,b=(e+r)/2,w=(t+a)/2,k=0,M=0,q=o?Zo(r,e):Zo(t,a);return o?(b=r-q*d,k=q*x):(w=a+q*d,M=-q*x),{textX:T,textY:_,targetX:b,targetY:w,anchorX:k,anchorY:M,scale:p,rotate:y}}function J5e(e,r,t,a,n){var i=r[0].trace,o=i.texttemplate,l;return o?l=K5e(e,r,t,a,n):i.textinfo?l=Q5e(r,t,a,n):l=jc.getValue(i.text,t),jc.coerceString(B5e,l)}function $5e(e,r){var t=jc.getValue(e.textposition,r);return jc.coerceEnumerated(H5e,t)}function K5e(e,r,t,a,n){var i=r[0].trace,o=Ra.castOption(i,t,"texttemplate");if(!o)return"";var l=i.type==="histogram",s=i.type==="waterfall",u=i.type==="funnel",f=i.orientation==="h",c,v,d,p;f?(c="y",v=n,d="x",p=a):(c="x",v=a,d="y",p=n);function y(k){return cg(v,v.c2l(k),!0).text}function m(k){return cg(p,p.c2l(k),!0).text}var x=r[t],T={};T.label=x.p,T.labelLabel=T[c+"Label"]=y(x.p);var _=Ra.castOption(i,x.i,"text");(_===0||_)&&(T.text=_),T.value=x.s,T.valueLabel=T[d+"Label"]=m(x.s);var b={};U5e(b,i,x.i),(l||b.x===void 0)&&(b.x=f?T.value:T.label),(l||b.y===void 0)&&(b.y=f?T.label:T.value),(l||b.xLabel===void 0)&&(b.xLabel=f?T.valueLabel:T.labelLabel),(l||b.yLabel===void 0)&&(b.yLabel=f?T.labelLabel:T.valueLabel),s&&(T.delta=+x.rawS||x.s,T.deltaLabel=m(T.delta),T.final=x.v,T.finalLabel=m(T.final),T.initial=T.final-T.delta,T.initialLabel=m(T.initial)),u&&(T.value=x.s,T.valueLabel=m(T.value),T.percentInitial=x.begR,T.percentInitialLabel=Ra.formatPercent(x.begR),T.percentPrevious=x.difR,T.percentPreviousLabel=Ra.formatPercent(x.difR),T.percentTotal=x.sumR,T.percenTotalLabel=Ra.formatPercent(x.sumR));var w=Ra.castOption(i,x.i,"customdata");return w&&(T.customdata=w),Ra.texttemplateString({data:[b,T,i._meta],fallback:i.texttemplatefallback,labels:T,locale:e._d3locale,template:o})}function Q5e(e,r,t,a){var n=e[0].trace,i=n.orientation==="h",o=n.type==="waterfall",l=n.type==="funnel";function s(w){var k=i?a:t;return cg(k,w,!0).text}function u(w){var k=i?t:a;return cg(k,+w,!0).text}var f=n.textinfo,c=e[r],v=f.split("+"),d=[],p,y=function(w){return v.indexOf(w)!==-1};if(y("label")&&d.push(s(e[r].p)),y("text")&&(p=Ra.castOption(n,c.i,"text"),(p===0||p)&&d.push(p)),o){var m=+c.rawS||c.s,x=c.v,T=x-m;y("initial")&&d.push(u(T)),y("delta")&&d.push(u(m)),y("final")&&d.push(u(x))}if(l){y("value")&&d.push(u(c.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var b=_>1;y("percent initial")&&(p=Ra.formatPercent(c.begR),b&&(p+=" of initial"),d.push(p)),y("percent previous")&&(p=Ra.formatPercent(c.difR),b&&(p+=" of previous"),d.push(p)),y("percent total")&&(p=Ra.formatPercent(c.sumR),b&&(p+=" of total"),d.push(p))}return d.join("
")}VG.exports={plot:W5e,toMoveInsideBar:GG}});var Pw=N((AIe,ZG)=>{"use strict";var O0=Fn(),e_e=br(),YG=Tr(),r_e=Ee().fillText,t_e=sg().getLineWidth,Rw=zr().hoverLabelText,a_e=Ft().BADNUM;function n_e(e,r,t,a,n){var i=WG(e,r,t,a,n);if(i){var o=i.cd,l=o[0].trace,s=o[i.index];return i.color=jG(l,s),e_e.getComponentMethod("errorbars","hoverInfo")(s,l,i),[i]}}function WG(e,r,t,a,n){var i=e.cd,o=i[0].trace,l=i[0].t,s=a==="closest",u=o.type==="waterfall",f=e.maxHoverDistance,c=e.maxSpikeDistance,v,d,p,y,m,x,T;o.orientation==="h"?(v=t,d=r,p="y",y="x",m=B,x=R):(v=r,d=t,p="x",y="y",x=B,m=R);var _=o[p+"period"],b=s||_;function w(K){return M(K,-1)}function k(K){return M(K,1)}function M(K,we){var se=K.w;return K[p]+we*se/2}function q(K){return K[p+"End"]-K[p+"Start"]}var E=s?w:_?function(K){return K.p-q(K)/2}:function(K){return Math.min(w(K),K.p-l.bardelta/2)},D=s?k:_?function(K){return K.p+q(K)/2}:function(K){return Math.max(k(K),K.p+l.bardelta/2)};function P(K,we,se){return n.finiteRange&&(se=0),O0.inbox(K-v,we-v,se+Math.min(1,Math.abs(we-K)/T)-1)}function R(K){return P(E(K),D(K),f)}function z(K){return P(w(K),k(K),c)}function I(K){var we=K[y];if(u){var se=Math.abs(K.rawS)||0;d>0?we+=se:d<0&&(we-=se)}return we}function B(K){var we=d,se=K.b,ce=I(K);return O0.inbox(se-we,ce-we,f+(ce-we)/(ce-se)-1)}function G(K){var we=d,se=K.b,ce=I(K);return O0.inbox(se-we,ce-we,c+(ce-we)/(ce-se)-1)}var Y=e[p+"a"],V=e[y+"a"];T=Math.abs(Y.r2c(Y.range[1])-Y.r2c(Y.range[0]));function H(K){return(m(K)+x(K))/2}var X=O0.getDistanceFunction(a,m,x,H);if(O0.getClosest(i,X,e),e.index!==!1&&i[e.index].p!==a_e){b||(E=function(K){return Math.min(w(K),K.p-l.bargroupwidth/2)},D=function(K){return Math.max(k(K),K.p+l.bargroupwidth/2)});var j=e.index,ee=i[j],fe=o.base?ee.b+ee.s:ee.s;e[y+"0"]=e[y+"1"]=V.c2p(ee[y],!0),e[y+"LabelVal"]=fe;var ie=l.extents[l.extents.round(ee.p)];e[p+"0"]=Y.c2p(s?E(ee):ie[0],!0),e[p+"1"]=Y.c2p(s?D(ee):ie[1],!0);var ue=ee.orig_p!==void 0;return e[p+"LabelVal"]=ue?ee.orig_p:ee.p,e.labelLabel=Rw(Y,e[p+"LabelVal"],o[p+"hoverformat"]),e.valueLabel=Rw(V,e[y+"LabelVal"],o[y+"hoverformat"]),e.baseLabel=Rw(V,ee.b,o[y+"hoverformat"]),e.spikeDistance=(G(ee)+z(ee))/2,e[p+"Spike"]=Y.c2p(ee.p,!0),r_e(ee,o,e),e.hovertemplate=o.hovertemplate,e}}function jG(e,r){var t=r.mcc||e.marker.color,a=r.mlcc||e.marker.line.color,n=t_e(e,r);if(YG.opacity(t))return t;if(YG.opacity(a)&&n)return a}ZG.exports={hoverPoints:n_e,hoverOnBars:WG,getTraceColor:jG}});var JG=N((MIe,XG)=>{"use strict";XG.exports=function(r,t,a){return r.x="xVal"in t?t.xVal:t.x,r.y="yVal"in t?t.yVal:t.y,t.xa&&(r.xaxis=t.xa),t.ya&&(r.yaxis=t.ya),a.orientation==="h"?(r.label=r.y,r.value=r.x):(r.label=r.x,r.value=r.y),r}});var Fw=N((kIe,$G)=>{"use strict";$G.exports=function(r,t){var a=r.cd,n=r.xaxis,i=r.yaxis,o=a[0].trace,l=o.type==="funnel",s=o.orientation==="h",u=[],f;if(t===!1)for(f=0;f{"use strict";KG.exports={attributes:Wu(),layoutAttributes:ig(),supplyDefaults:ju().supplyDefaults,crossTraceDefaults:ju().crossTraceDefaults,supplyLayoutDefaults:Sw(),calc:wG(),crossTraceCalc:_m().crossTraceCalc,colorbar:_0(),arraysToCalcdata:lg(),plot:Dw().plot,style:Wc().style,styleOnSelect:Wc().styleOnSelect,hoverPoints:Pw().hoverPoints,eventData:JG(),selectPoints:Fw(),moduleType:"trace",name:"bar",basePlotModule:Ei(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}});var rV=N((qIe,eV)=>{"use strict";eV.exports=QG()});var vg=N((LIe,iV)=>{"use strict";var o_e=Uy(),Pi=Ai(),tV=Wu(),l_e=fi(),aV=no().axisHoverFormat,{hovertemplateAttrs:s_e,templatefallbackAttrs:u_e}=Wn(),Ll=bt().extendFlat,Zc=Pi.marker,nV=Zc.line;iV.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:Pi.xperiod,yperiod:Pi.yperiod,xperiod0:Pi.xperiod0,yperiod0:Pi.yperiod0,xperiodalignment:Pi.xperiodalignment,yperiodalignment:Pi.yperiodalignment,xhoverformat:aV("x"),yhoverformat:aV("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:Ll({},Zc.symbol,{arrayOk:!1,editType:"plot"}),opacity:Ll({},Zc.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:Ll({},Zc.angle,{arrayOk:!1,editType:"calc"}),size:Ll({},Zc.size,{arrayOk:!1,editType:"calc"}),color:Ll({},Zc.color,{arrayOk:!1,editType:"style"}),line:{color:Ll({},nV.color,{arrayOk:!1,dflt:l_e.defaultLine,editType:"style"}),width:Ll({},nV.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:o_e(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:tV.offsetgroup,alignmentgroup:tV.alignmentgroup,selected:{marker:Pi.selected.marker,editType:"style"},unselected:{marker:Pi.unselected.marker,editType:"style"},text:Ll({},Pi.text,{}),hovertext:Ll({},Pi.hovertext,{}),hovertemplate:s_e({}),hovertemplatefallback:u_e(),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:Pi.zorder}});var hg=N((CIe,oV)=>{"use strict";oV.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}});var H0=N((EIe,fV)=>{"use strict";var Fi=Ee(),f_e=br(),c_e=Tr(),v_e=Mc(),h_e=p0(),lV=F1(),B0=vg();function d_e(e,r,t,a){function n(p,y){return Fi.coerce(e,r,B0,p,y)}if(sV(e,r,n,a),r.visible!==!1){v_e(e,r,a,n),n("xhoverformat"),n("yhoverformat");var i=r._hasPreCompStats;i&&(n("lowerfence"),n("upperfence")),n("line.color",(e.marker||{}).color||t),n("line.width"),n("fillcolor",c_e.addOpacity(r.line.color,.5));var o=!1;if(i){var l=n("mean"),s=n("sd");l&&l.length&&(o=!0,s&&s.length&&(o="sd"))}n("whiskerwidth");var u=n("sizemode"),f;u==="quartiles"&&(f=n("boxmean",o)),n("showwhiskers",u==="quartiles"),(u==="sd"||f==="sd")&&n("sdmultiple"),n("width"),n("quartilemethod");var c=!1;if(i){var v=n("notchspan");v&&v.length&&(c=!0)}else Fi.validate(e.notchwidth,B0.notchwidth)&&(c=!0);var d=n("notched",c);d&&n("notchwidth"),uV(e,r,n,{prefix:"box"}),n("zorder")}}function sV(e,r,t,a){function n(D){var P=0;return D&&D.length&&(P+=1,Fi.isArrayOrTypedArray(D[0])&&D[0].length&&(P+=1)),P}function i(D){return Fi.validate(e[D],B0[D])}var o=t("y"),l=t("x"),s;if(r.type==="box"){var u=t("q1"),f=t("median"),c=t("q3");r._hasPreCompStats=u&&u.length&&f&&f.length&&c&&c.length,s=Math.min(Fi.minRowLength(u),Fi.minRowLength(f),Fi.minRowLength(c))}var v=n(o),d=n(l),p=v&&Fi.minRowLength(o),y=d&&Fi.minRowLength(l),m=a.calendar,x={autotypenumbers:a.autotypenumbers},T,_;if(r._hasPreCompStats)switch(String(d)+String(v)){case"00":var b=i("x0")||i("dx"),w=i("y0")||i("dy");w&&!b?T="h":T="v",_=s;break;case"10":T="v",_=Math.min(s,y);break;case"20":T="h",_=Math.min(s,l.length);break;case"01":T="h",_=Math.min(s,p);break;case"02":T="v",_=Math.min(s,o.length);break;case"12":T="v",_=Math.min(s,y,o.length);break;case"21":T="h",_=Math.min(s,l.length,p);break;case"11":_=0;break;case"22":var k=!1,M;for(M=0;M0?(T="v",d>0?_=Math.min(y,p):_=Math.min(p)):d>0?(T="h",_=Math.min(y)):_=0;if(!_){r.visible=!1;return}r._length=_;var q=t("orientation",T);r._hasPreCompStats?q==="v"&&d===0?(t("x0",0),t("dx",1)):q==="h"&&v===0&&(t("y0",0),t("dy",1)):q==="v"&&d===0?t("x0"):q==="h"&&v===0&&t("y0");var E=f_e.getComponentMethod("calendars","handleTraceDefaults");E(e,r,["x","y"],a)}function uV(e,r,t,a){var n=a.prefix,i=Fi.coerce2(e,r,B0,"marker.outliercolor"),o=t("marker.line.outliercolor"),l="outliers";r._hasPreCompStats?l="all":(i||o)&&(l="suspectedoutliers");var s=t(n+"points",l);s?(t("jitter",s==="all"?.3:0),t("pointpos",s==="all"?-1.5:0),t("marker.symbol"),t("marker.opacity"),t("marker.size"),t("marker.angle"),t("marker.color",r.line.color),t("marker.line.color"),t("marker.line.width"),s==="suspectedoutliers"&&(t("marker.line.outliercolor",r.marker.color),t("marker.line.outlierwidth")),t("selected.marker.color"),t("unselected.marker.color"),t("selected.marker.size"),t("unselected.marker.size"),t("text"),t("hovertext")):delete r.marker;var u=t("hoveron");(u==="all"||u.indexOf("points")!==-1)&&(t("hovertemplate"),t("hovertemplatefallback")),Fi.coerceSelectionMarkerOpacity(r,t)}function p_e(e,r){var t,a;function n(s){return Fi.coerce(a._input,a,B0,s)}for(var i=0;i{"use strict";var y_e=br(),m_e=Ee(),g_e=hg();function cV(e,r,t,a,n){for(var i=n+"Layout",o=!1,l=0;l{"use strict";var zw=Rr(),dg=zr(),x_e=Sc(),la=Ee(),ni=Ft().BADNUM,Cl=la._;_V.exports=function(r,t){var a=r._fullLayout,n=dg.getFromId(r,t.xaxis||"x"),i=dg.getFromId(r,t.yaxis||"y"),o=[],l=t.type==="violin"?"_numViolins":"_numBoxes",s,u,f,c,v,d,p;t.orientation==="h"?(f=n,c="x",v=i,d="y",p=!!t.yperiodalignment):(f=i,c="y",v=n,d="x",p=!!t.xperiodalignment);var y=__e(t,d,v,a[l]),m=y[0],x=y[1],T=la.distinctVals(m,v),_=T.vals,b=T.minDiff/2,w,k,M,q,E,D,P=(t.boxpoints||t.points)==="all"?la.identity:function(Ce){return Ce.vw.uf};if(t._hasPreCompStats){var R=t[c],z=function(Ce){return f.d2c((t[Ce]||[])[s])},I=1/0,B=-1/0;for(s=0;s=w.q1&&w.q3>=w.med){var Y=z("lowerfence");w.lf=Y!==ni&&Y<=w.q1?Y:yV(w,M,q);var V=z("upperfence");w.uf=V!==ni&&V>=w.q3?V:mV(w,M,q);var H=z("mean");w.mean=H!==ni?H:q?la.mean(M,q):(w.q1+w.q3)/2;var X=z("sd");w.sd=H!==ni&&X>=0?X:q?la.stdev(M,q,w.mean):w.q3-w.q1,w.lo=gV(w),w.uo=bV(w);var j=z("notchspan");j=j!==ni&&j>0?j:xV(w,q),w.ln=w.med-j,w.un=w.med+j;var ee=w.lf,fe=w.uf;t.boxpoints&&M.length&&(ee=Math.min(ee,M[0]),fe=Math.max(fe,M[q-1])),t.notched&&(ee=Math.min(ee,w.ln),fe=Math.max(fe,w.un)),w.min=ee,w.max=fe}else{la.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+w.q1,"median = "+w.med,"q3 = "+w.q3].join(` +`));var ie;w.med!==ni?ie=w.med:w.q1!==ni?w.q3!==ni?ie=(w.q1+w.q3)/2:ie=w.q1:w.q3!==ni?ie=w.q3:ie=0,w.med=ie,w.q1=w.q3=ie,w.lf=w.uf=ie,w.mean=w.sd=ie,w.ln=w.un=ie,w.min=w.max=ie}I=Math.min(I,w.min),B=Math.max(B,w.max),w.pts2=k.filter(P),o.push(w)}}t._extremes[f._id]=dg.findExtremes(f,[I,B],{padded:!0})}else{var ue=f.makeCalcdata(t,c),K=w_e(_,b),we=_.length,se=T_e(we);for(s=0;s=0&&ce0){if(w={},w.pos=w[d]=_[s],k=w.pts=se[s].sort(dV),M=w[c]=k.map(pV),q=M.length,w.min=M[0],w.max=M[q-1],w.mean=la.mean(M,q),w.sd=la.stdev(M,q,w.mean)*t.sdmultiple,w.med=la.interp(M,.5),q%2&&(Q||Z)){var le,ve;Q?(le=M.slice(0,q/2),ve=M.slice(q/2+1)):Z&&(le=M.slice(0,q/2+1),ve=M.slice(q/2)),w.q1=la.interp(le,.5),w.q3=la.interp(ve,.5)}else w.q1=la.interp(M,.25),w.q3=la.interp(M,.75);w.lf=yV(w,M,q),w.uf=mV(w,M,q),w.lo=gV(w),w.uo=bV(w);var me=xV(w,q);w.ln=w.med-me,w.un=w.med+me,he=Math.min(he,w.ln),ye=Math.max(ye,w.un),w.pts2=k.filter(P),o.push(w)}t.notched&&la.isTypedArray(ue)&&(ue=Array.from(ue)),t._extremes[f._id]=dg.findExtremes(f,t.notched?ue.concat([he,ye]):ue,{padded:!0})}return A_e(o,t),o.length>0?(o[0].t={num:a[l],dPos:b,posLetter:d,valLetter:c,labels:{med:Cl(r,"median:"),min:Cl(r,"min:"),q1:Cl(r,"q1:"),q3:Cl(r,"q3:"),max:Cl(r,"max:"),mean:t.boxmean==="sd"||t.sizemode==="sd"?Cl(r,"mean \xB1 \u03C3:").replace("\u03C3",t.sdmultiple===1?"\u03C3":t.sdmultiple+"\u03C3"):Cl(r,"mean:"),lf:Cl(r,"lower fence:"),uf:Cl(r,"upper fence:")}},a[l]++,o):[{t:{empty:!0}}]};function __e(e,r,t,a){var n=r in e,i=r+"0"in e,o="d"+r in e;if(n||i&&o){var l=t.makeCalcdata(e,r),s=x_e(e,t,r,l).vals;return[s,l]}var u;i?u=e[r+"0"]:"name"in e&&(t.type==="category"||zw(e.name)&&["linear","log"].indexOf(t.type)!==-1||la.isDateTime(e.name)&&t.type==="date")?u=e.name:u=a;for(var f=t.type==="multicategory"?t.r2c_just_indices(u):t.d2c(u,0,e[r+"calendar"]),c=e._length,v=new Array(c),d=0;d{"use strict";var wV=zr(),M_e=Ee(),k_e=Ru().getAxisGroup,TV=["v","h"];function S_e(e,r){for(var t=e.calcdata,a=r.xaxis,n=r.yaxis,i=0;i1,T=1-i[e+"gap"],_=1-i[e+"groupgap"];for(s=0;s0;if(M==="positive"?(V=q*(k?1:.5),j=X,H=j=D):M==="negative"?(V=j=D,H=q*(k?1:.5),ee=X):(V=H=q,j=ee=X),se){var ce=b.pointpos,he=b.jitter,ye=b.marker.size/2,W=0;ce+he>=0&&(W=X*(ce+he),W>V?(we=!0,ue=ye,fe=W):W>j&&(ue=ye,fe=V)),W<=V&&(fe=V);var Q=0;ce-he<=0&&(Q=-X*(ce-he),Q>H?(we=!0,K=ye,ie=Q):Q>ee&&(K=ye,ie=H)),Q<=H&&(ie=H)}else fe=V,ie=H;var Z=new Array(f.length);for(u=0;u{"use strict";var Xc=Sr(),Ju=Ee(),q_e=Yr(),kV=5,L_e=.01;function C_e(e,r,t,a){var n=e._context.staticPlot,i=r.xaxis,o=r.yaxis;Ju.makeTraceGroups(a,t,"trace boxes").each(function(l){var s=Xc.select(this),u=l[0],f=u.t,c=u.trace;if(f.wdPos=f.bdPos*c.whiskerwidth,c.visible!==!0||f.empty){s.remove();return}var v,d;c.orientation==="h"?(v=o,d=i):(v=i,d=o),SV(s,{pos:v,val:d},c,f,n),qV(s,{x:i,y:o},c,f),LV(s,{pos:v,val:d},c,f)})}function SV(e,r,t,a,n){var i=t.orientation==="h",o=r.val,l=r.pos,s=!!l.rangebreaks,u=a.bPos,f=a.wdPos||0,c=a.bPosPxOffset||0,v=t.whiskerwidth||0,d=t.showwhiskers!==!1,p=t.notched||!1,y=p?1-2*t.notchwidth:1,m,x;Array.isArray(a.bdPos)?(m=a.bdPos[0],x=a.bdPos[1]):(m=a.bdPos,x=a.bdPos);var T=e.selectAll("path.box").data(t.type!=="violin"||t.box.visible?Ju.identity:[]);T.enter().append("path").style("vector-effect",n?"none":"non-scaling-stroke").attr("class","box"),T.exit().remove(),T.each(function(_){if(_.empty)return Xc.select(this).attr("d","M0,0Z");var b=l.c2l(_.pos+u,!0),w=l.l2p(b-m)+c,k=l.l2p(b+x)+c,M=s?(w+k)/2:l.l2p(b)+c,q=t.whiskerwidth,E=s?w*q+(1-q)*M:l.l2p(b-f)+c,D=s?k*q+(1-q)*M:l.l2p(b+f)+c,P=l.l2p(b-m*y)+c,R=l.l2p(b+x*y)+c,z=t.sizemode==="sd",I=o.c2p(z?_.mean-_.sd:_.q1,!0),B=z?o.c2p(_.mean+_.sd,!0):o.c2p(_.q3,!0),G=Ju.constrain(z?o.c2p(_.mean,!0):o.c2p(_.med,!0),Math.min(I,B)+1,Math.max(I,B)-1),Y=_.lf===void 0||t.boxpoints===!1||z,V=o.c2p(Y?_.min:_.lf,!0),H=o.c2p(Y?_.max:_.uf,!0),X=o.c2p(_.ln,!0),j=o.c2p(_.un,!0);i?Xc.select(this).attr("d","M"+G+","+P+"V"+R+"M"+I+","+w+"V"+k+(p?"H"+X+"L"+G+","+R+"L"+j+","+k:"")+"H"+B+"V"+w+(p?"H"+j+"L"+G+","+P+"L"+X+","+w:"")+"Z"+(d?"M"+I+","+M+"H"+V+"M"+B+","+M+"H"+H+(v===0?"":"M"+V+","+E+"V"+D+"M"+H+","+E+"V"+D):"")):Xc.select(this).attr("d","M"+P+","+G+"H"+R+"M"+w+","+I+"H"+k+(p?"V"+X+"L"+R+","+G+"L"+k+","+j:"")+"V"+B+"H"+w+(p?"V"+j+"L"+P+","+G+"L"+w+","+X:"")+"Z"+(d?"M"+M+","+I+"V"+V+"M"+M+","+B+"V"+H+(v===0?"":"M"+E+","+V+"H"+D+"M"+E+","+H+"H"+D):""))})}function qV(e,r,t,a){var n=r.x,i=r.y,o=a.bdPos,l=a.bPos,s=t.boxpoints||t.points;Ju.seedPseudoRandom();var u=function(v){return v.forEach(function(d){d.t=a,d.trace=t}),v},f=e.selectAll("g.points").data(s?u:[]);f.enter().append("g").attr("class","points"),f.exit().remove();var c=f.selectAll("path").data(function(v){var d,p=v.pts2,y=Math.max((v.max-v.min)/10,v.q3-v.q1),m=y*1e-9,x=y*L_e,T=[],_=0,b;if(t.jitter){if(y===0)for(_=1,T=new Array(p.length),d=0;dv.lo&&(D.so=!0)}return p});c.enter().append("path").classed("point",!0),c.exit().remove(),c.call(q_e.translatePoints,n,i)}function LV(e,r,t,a){var n=r.val,i=r.pos,o=!!i.rangebreaks,l=a.bPos,s=a.bPosPxOffset||0,u=t.boxmean||(t.meanline||{}).visible,f,c;Array.isArray(a.bdPos)?(f=a.bdPos[0],c=a.bdPos[1]):(f=a.bdPos,c=a.bdPos);var v=e.selectAll("path.mean").data(t.type==="box"&&t.boxmean||t.type==="violin"&&t.box.visible&&t.meanline.visible?Ju.identity:[]);v.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),v.exit().remove(),v.each(function(d){var p=i.c2l(d.pos+l,!0),y=i.l2p(p-f)+s,m=i.l2p(p+c)+s,x=o?(y+m)/2:i.l2p(p)+s,T=n.c2p(d.mean,!0),_=n.c2p(d.mean-d.sd,!0),b=n.c2p(d.mean+d.sd,!0);t.orientation==="h"?Xc.select(this).attr("d","M"+T+","+y+"V"+m+(u==="sd"?"m0,0L"+_+","+x+"L"+T+","+y+"L"+b+","+x+"Z":"")):Xc.select(this).attr("d","M"+y+","+T+"H"+m+(u==="sd"?"m0,0L"+x+","+_+"L"+y+","+T+"L"+x+","+b+"Z":""))})}CV.exports={plot:C_e,plotBoxAndWhiskers:SV,plotPoints:qV,plotBoxMean:LV}});var Yw=N((NIe,EV)=>{"use strict";var Uw=Sr(),Gw=Tr(),Vw=Yr();function E_e(e,r,t){var a=t||Uw.select(e).selectAll("g.trace.boxes");a.style("opacity",function(n){return n[0].trace.opacity}),a.each(function(n){var i=Uw.select(this),o=n[0].trace,l=o.line.width;function s(c,v,d,p){c.style("stroke-width",v+"px").call(Gw.stroke,d).call(Gw.fill,p)}var u=i.selectAll("path.box");if(o.type==="candlestick")u.each(function(c){if(!c.empty){var v=Uw.select(this),d=o[c.dir];s(v,d.line.width,d.line.color,d.fillcolor),v.style("opacity",o.selectedpoints&&!c.selected?.3:1)}});else{s(u,l,o.line.color,o.fillcolor),i.selectAll("path.mean").style({"stroke-width":l,"stroke-dasharray":2*l+"px,"+l+"px"}).call(Gw.stroke,o.line.color);var f=i.selectAll("path.point");Vw.pointStyle(f,o,e)}})}function D_e(e,r,t){var a=r[0].trace,n=t.selectAll("path.point");a.selectedpoints?Vw.selectedPointStyle(n,a):Vw.pointStyle(n,a,e)}EV.exports={style:E_e,styleOnSelect:D_e}});var jw=N((IIe,FV)=>{"use strict";var R_e=zr(),Ww=Ee(),Ms=Fn(),DV=Tr(),P_e=Ww.fillText;function F_e(e,r,t,a){var n=e.cd,i=n[0].trace,o=i.hoveron,l=[],s;return o.indexOf("boxes")!==-1&&(l=l.concat(RV(e,r,t,a))),o.indexOf("points")!==-1&&(s=PV(e,r,t)),a==="closest"?s?[s]:l:(s&&l.push(s),l)}function RV(e,r,t,a){var n=e.cd,i=e.xa,o=e.ya,l=n[0].trace,s=n[0].t,u=l.type==="violin",f,c,v,d,p,y,m,x,T,_,b,w=s.bdPos,k,M,q=s.wHover,E=function(ye){return v.c2l(ye.pos)+s.bPos-v.c2l(y)};u&&l.side!=="both"?(l.side==="positive"&&(T=function(ye){var W=E(ye);return Ms.inbox(W,W+q,_)},k=w,M=0),l.side==="negative"&&(T=function(ye){var W=E(ye);return Ms.inbox(W-q,W,_)},k=0,M=w)):(T=function(ye){var W=E(ye);return Ms.inbox(W-q,W+q,_)},k=M=w);var D;u?D=function(ye){return Ms.inbox(ye.span[0]-p,ye.span[1]-p,_)}:D=function(ye){return Ms.inbox(ye.min-p,ye.max-p,_)},l.orientation==="h"?(p=r,y=t,m=D,x=T,f="y",v=o,c="x",d=i):(p=t,y=r,m=T,x=D,f="x",v=i,c="y",d=o);var P=Math.min(1,w/Math.abs(v.r2c(v.range[1])-v.r2c(v.range[0])));_=e.maxHoverDistance-P,b=e.maxSpikeDistance-P;function R(ye){return(m(ye)+x(ye))/2}var z=Ms.getDistanceFunction(a,m,x,R);if(Ms.getClosest(n,z,e),e.index===!1)return[];var I=n[e.index],B=l.line.color,G=(l.marker||{}).color;DV.opacity(B)&&l.line.width?e.color=B:DV.opacity(G)&&l.boxpoints?e.color=G:e.color=l.fillcolor,e[f+"0"]=v.c2p(I.pos+s.bPos-M,!0),e[f+"1"]=v.c2p(I.pos+s.bPos+k,!0),e[f+"LabelVal"]=I.orig_p!==void 0?I.orig_p:I.pos;var Y=f+"Spike";e.spikeDistance=R(I)*b/_,e[Y]=v.c2p(I.pos,!0);var V=l.boxmean||l.sizemode==="sd"||(l.meanline||{}).visible,H=l.boxpoints||l.points,X=H&&V?["max","uf","q3","med","mean","q1","lf","min"]:H&&!V?["max","uf","q3","med","q1","lf","min"]:!H&&V?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],j=d.range[1]{"use strict";NV.exports=function(r,t){return t.hoverOnBox&&(r.hoverOnBox=t.hoverOnBox),"xVal"in t&&(r.x=t.xVal),"yVal"in t&&(r.y=t.yVal),t.xa&&(r.xaxis=t.xa),t.ya&&(r.yaxis=t.ya),r}});var Zw=N((OIe,zV)=>{"use strict";zV.exports=function(r,t){var a=r.cd,n=r.xaxis,i=r.yaxis,o=[],l,s;if(t===!1)for(l=0;l{"use strict";OV.exports={attributes:vg(),layoutAttributes:hg(),supplyDefaults:H0().supplyDefaults,crossTraceDefaults:H0().crossTraceDefaults,supplyLayoutDefaults:Nw().supplyLayoutDefaults,calc:Ow(),crossTraceCalc:Bw().crossTraceCalc,plot:Hw().plot,style:Yw().style,styleOnSelect:Yw().styleOnSelect,hoverPoints:jw().hoverPoints,eventData:IV(),selectPoints:Zw(),moduleType:"trace",name:"box",basePlotModule:Ei(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}});var UV=N((HIe,HV)=>{"use strict";HV.exports=BV()});var U0=N((UIe,VV)=>{"use strict";var N_e=Lo(),{extendFlat:Bn}=bt(),I_e=gn(),{axisHoverFormat:Xw}=no(),z_e=ga(),{hovertemplateAttrs:O_e,templatefallbackAttrs:GV,texttemplateAttrs:B_e}=Wn(),ii=Ai();VV.exports=Bn({z:{valType:"data_array",editType:"calc"},x:Bn({},ii.x,{impliedEdits:{xtype:"array"}}),x0:Bn({},ii.x0,{impliedEdits:{xtype:"scaled"}}),dx:Bn({},ii.dx,{impliedEdits:{xtype:"scaled"}}),y:Bn({},ii.y,{impliedEdits:{ytype:"array"}}),y0:Bn({},ii.y0,{impliedEdits:{ytype:"scaled"}}),dy:Bn({},ii.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:Bn({},ii.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:Bn({},ii.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:Bn({},ii.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:Bn({},ii.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:Bn({},ii.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:Bn({},ii.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:Xw("x"),yhoverformat:Xw("y"),zhoverformat:Xw("z",1),hovertemplate:O_e(),hovertemplatefallback:GV(),texttemplate:B_e({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),texttemplatefallback:GV({editType:"plot"}),textfont:z_e({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:Bn({},I_e.showlegend,{dflt:!1}),zorder:ii.zorder},N_e("",{cLetter:"z",autoColorDflt:!1}))});var Jw=N((GIe,WV)=>{"use strict";var H_e=Rr(),pg=Ee(),U_e=br();WV.exports=function(r,t,a,n,i,o){var l=a("z");i=i||"x",o=o||"y";var s,u;if(l===void 0||!l.length)return 0;if(pg.isArray1D(l)){s=a(i),u=a(o);var f=pg.minRowLength(s),c=pg.minRowLength(u);if(f===0||c===0)return 0;t._length=Math.min(f,c,l.length)}else{if(s=YV(i,a),u=YV(o,a),!G_e(l))return 0;a("transpose"),t._length=null}var v=U_e.getComponentMethod("calendars","handleTraceDefaults");return v(r,t,[i,o],n),!0};function YV(e,r){var t=r(e),a=t?r(e+"type","array"):"scaled";return a==="scaled"&&(r(e+"0"),r("d"+e)),t}function G_e(e){for(var r=!0,t=!1,a=!1,n,i=0;i0&&(t=!0);for(var o=0;o{"use strict";var jV=Ee();ZV.exports=function(r,t){r("texttemplate"),r("texttemplatefallback");var a=jV.extendFlat({},t.font,{color:"auto",size:"auto"});jV.coerceFont(r,"textfont",a)}});var $w=N((YIe,XV)=>{"use strict";XV.exports=function(r,t,a){var n=a("zsmooth");n===!1&&(a("xgap"),a("ygap")),a("zhoverformat")}});var KV=N((WIe,$V)=>{"use strict";var JV=Ee(),V_e=Jw(),Y_e=G0(),W_e=Mc(),j_e=$w(),Z_e=yl(),X_e=U0();$V.exports=function(r,t,a,n){function i(l,s){return JV.coerce(r,t,X_e,l,s)}var o=V_e(r,t,i,n);if(!o){t.visible=!1;return}W_e(r,t,n,i),i("xhoverformat"),i("yhoverformat"),i("text"),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),Y_e(i,n),j_e(r,t,i,n),i("hoverongaps"),i("connectgaps",JV.isArray1D(t.z)&&t.zsmooth!==!1),Z_e(r,t,n,i,{prefix:"",cLetter:"z"}),i("zorder")}});var Kw=N((jIe,QV)=>{"use strict";var Jc=Rr();QV.exports={count:function(e,r,t){return t[e]++,1},sum:function(e,r,t,a){var n=a[r];return Jc(n)?(n=Number(n),t[e]+=n,n):0},avg:function(e,r,t,a,n){var i=a[r];return Jc(i)&&(i=Number(i),t[e]+=i,n[e]++),0},min:function(e,r,t,a){var n=a[r];if(Jc(n))if(n=Number(n),Jc(t[e])){if(t[e]>n){var i=n-t[e];return t[e]=n,i}}else return t[e]=n,n;return 0},max:function(e,r,t,a){var n=a[r];if(Jc(n))if(n=Number(n),Jc(t[e])){if(t[e]{"use strict";eY.exports={percent:function(e,r){for(var t=e.length,a=100/r,n=0;n{"use strict";rY.exports=function(r,t){for(var a=r.length,n=0,i=0;i{"use strict";var $c=Ft(),$u=$c.ONEAVGYEAR,tY=$c.ONEAVGMONTH,mg=$c.ONEDAY,aY=$c.ONEHOUR,nY=$c.ONEMIN,iY=$c.ONESEC,oY=zr().tickIncrement;uY.exports=function(r,t,a,n,i){var o=-1.1*t,l=-.1*t,s=r-l,u=a[0],f=a[1],c=Math.min(yg(u+l,u+s,n,i),yg(f+l,f+s,n,i)),v=Math.min(yg(u+o,u+l,n,i),yg(f+o,f+l,n,i)),d,p;if(c>v&&vmg){var y=d===$u?1:6,m=d===$u?"M12":"M1";return function(x,T){var _=n.c2d(x,$u,i),b=_.indexOf("-",y);b>0&&(_=_.slice(0,b));var w=n.d2c(_,0,i);if(wiY?e>mg?e>$u*1.1?$u:e>tY*1.1?tY:mg:e>aY?aY:e>nY?nY:iY:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function J_e(e,r,t,a,n,i){if(a&&e>mg){var o=sY(r,n,i),l=sY(t,n,i),s=e===$u?0:1;return o[s]!==l[s]}return Math.floor(t/e)-Math.floor(r/e)>.1}function sY(e,r,t){var a=r.c2d(e,$u,t).split("-");return a[0]===""&&(a.unshift(),a[0]="-"+a[0]),a}});var n6=N(($Ie,dY)=>{"use strict";var t6=Rr(),dn=Ee(),fY=br(),Ni=zr(),{hasColorscale:cY}=Zn(),vY=ec(),$_e=lg(),hY=Kw(),K_e=Qw(),Q_e=e6(),e4e=r6();function r4e(e,r){var t=[],a=[],n=r.orientation==="h",i=Ni.getFromId(e,n?r.yaxis:r.xaxis),o=n?"y":"x",l={x:"y",y:"x"}[o],s=r[o+"calendar"],u=r.cumulative,f,c=a6(e,r,i,o),v=c[0],d=c[1],p=typeof v.size=="string",y=[],m=p?y:v,x=[],T=[],_=[],b=0,w=r.histnorm,k=r.histfunc,M=w.indexOf("density")!==-1,q,E,D;u.enabled&&M&&(w=w.replace(/ ?density$/,""),M=!1);var P=k==="max"||k==="min",R=P?null:0,z=hY.count,I=K_e[w],B=!1,G=function(W){return i.r2c(W,0,s)},Y;for(dn.isArrayOrTypedArray(r[l])&&k!=="count"&&(Y=r[l],B=k==="avg",z=hY[k]),f=G(v.start),E=G(v.end)+(f-Ni.tickIncrement(f,v.size,!1,s))/1e6;f=0&&D=ce;f--)if(a[f]){he=f;break}for(f=ce;f<=he;f++)if(t6(t[f])&&t6(a[f])){var ye={p:t[f],s:a[f],b:0};u.enabled||(ye.pts=_[f],j?ye.ph0=ye.ph1=_[f].length?d[_[f][0]]:t[f]:(r._computePh=!0,ye.ph0=K(y[f]),ye.ph1=K(y[f+1],!0))),se.push(ye)}return se.length===1&&(se[0].width1=Ni.tickIncrement(se[0].p,v.size,!1,s)-se[0].p),cY(r,"marker")&&vY(e,r,{vals:r.marker.color,containerStr:"marker",cLetter:"c"}),cY(r,"marker.line")&&vY(e,r,{vals:r.marker.line.color,containerStr:"marker.line",cLetter:"c"}),$_e(se,r),dn.isArrayOrTypedArray(r.selectedpoints)&&dn.tagSelected(se,r,ie),se}function a6(e,r,t,a,n){var i=a+"bins",o=e._fullLayout,l=r["_"+a+"bingroup"],s=o._histogramBinOpts[l],u=o.barmode==="overlay",f,c,v,d,p,y,m,x=function(ue){return t.r2c(ue,0,d)},T=function(ue){return t.c2r(ue,0,d)},_=t.type==="date"?function(ue){return ue||ue===0?dn.cleanDate(ue,null,d):null}:function(ue){return t6(ue)?Number(ue):null};function b(ue,K,we){K[ue+"Found"]?(K[ue]=_(K[ue]),K[ue]===null&&(K[ue]=we[ue])):(y[ue]=K[ue]=we[ue],dn.nestedProperty(c[0],i+"."+ue).set(we[ue]))}if(r["_"+a+"autoBinFinished"])delete r["_"+a+"autoBinFinished"];else{c=s.traces;var w=[],k=!0,M=!1,q=!1;for(f=0;ft.r2l(Y)&&(H=Ni.tickIncrement(H,s.size,!0,d)),z.start=t.l2r(H),G||dn.nestedProperty(r,i+".start").set(z.start)}var X=s.end,j=t.r2l(R.end),ee=j!==void 0;if((s.endFound||ee)&&j!==t.r2l(X)){var fe=ee?j:dn.aggNums(Math.max,null,p);z.end=t.l2r(fe),ee||dn.nestedProperty(r,i+".start").set(z.end)}var ie="autobin"+a;return r._input[ie]===!1&&(r._input[i]=dn.extendFlat({},r[i]||{}),delete r._input[ie],delete r[ie]),[z,p]}function t4e(e,r,t,a,n){var i=e._fullLayout,o=a4e(e,r),l=!1,s=1/0,u=[r],f,c,v;for(f=0;f=0;a--)l(a);else if(r==="increasing"){for(a=1;a=0;a--)e[a]+=e[a+1];t==="exclude"&&(e.push(0),e.shift())}}dY.exports={calc:r4e,calcAllAutoBins:a6}});var wY=N((KIe,_Y)=>{"use strict";var pY=Ee(),Kc=zr(),yY=Kw(),i4e=Qw(),o4e=e6(),l4e=r6(),mY=n6().calcAllAutoBins;_Y.exports=function(r,t){var a=Kc.getFromId(r,t.xaxis),n=Kc.getFromId(r,t.yaxis),i=t.xcalendar,o=t.ycalendar,l=function(Te){return a.r2c(Te,0,i)},s=function(Te){return n.r2c(Te,0,o)},u=function(Te){return a.c2r(Te,0,i)},f=function(Te){return n.c2r(Te,0,o)},c,v,d,p,y=mY(r,t,a,"x"),m=y[0],x=y[1],T=mY(r,t,n,"y"),_=T[0],b=T[1],w=t._length;x.length>w&&x.splice(w,x.length-w),b.length>w&&b.splice(w,b.length-w);var k=[],M=[],q=[],E=typeof m.size=="string",D=typeof _.size=="string",P=[],R=[],z=E?P:m,I=D?R:_,B=0,G=[],Y=[],V=t.histnorm,H=t.histfunc,X=V.indexOf("density")!==-1,j=H==="max"||H==="min",ee=j?null:0,fe=yY.count,ie=i4e[V],ue=!1,K=[],we=[],se="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";se&&H!=="count"&&(ue=H==="avg",fe=yY[H]);var ce=m.size,he=l(m.start),ye=l(m.end)+(he-Kc.tickIncrement(he,ce,!1,i))/1e6;for(c=he;c=0&&d=0&&p{"use strict";var Xo=Ee(),TY=Ft().BADNUM,AY=Sc();MY.exports=function(r,t,a,n,i,o){var l=r._length,s=t.makeCalcdata(r,n),u=a.makeCalcdata(r,i);s=AY(r,t,n,s).vals,u=AY(r,a,i,u).vals;var f=r.text,c=f!==void 0&&Xo.isArray1D(f),v=r.hovertext,d=v!==void 0&&Xo.isArray1D(v),p,y,m=Xo.distinctVals(s),x=m.vals,T=Xo.distinctVals(u),_=T.vals,b=[],w,k,M=_.length,q=x.length;for(p=0;p{"use strict";var s4e=Rr(),u4e=Ee(),gg=Ft().BADNUM;SY.exports=function(r,t,a,n){var i,o,l,s,u,f;function c(x){if(s4e(x))return+x}if(t&&t.transpose){for(i=0,u=0;u{"use strict";var f4e=Ee(),LY=.01,c4e=[[-1,0],[1,0],[0,-1],[0,1]];function v4e(e){return .5-.25*Math.min(1,e*.5)}EY.exports=function(r,t){var a=1,n;for(CY(r,t),n=0;nLY;n++)a=CY(r,t,v4e(a));return a>LY&&f4e.log("interp2d didn't converge quickly",a),r};function CY(e,r,t){var a=0,n,i,o,l,s,u,f,c,v,d,p,y,m;for(l=0;ly&&(a=Math.max(a,Math.abs(e[i][o]-p)/(m-y))))}return a}});var PY=N((tze,RY)=>{"use strict";var h4e=Ee().maxRowLength;RY.exports=function(r){var t=[],a={},n=[],i=r[0],o=[],l=[0,0,0],s=h4e(r),u,f,c,v,d,p,y,m;for(f=0;f=0;d--)v=n[d],f=v[0],c=v[1],p=((a[[f-1,c]]||l)[2]+(a[[f+1,c]]||l)[2]+(a[[f,c-1]]||l)[2]+(a[[f,c+1]]||l)[2])/20,p&&(y[v]=[f,c,p],n.splice(d,1),m=!0);if(!m)throw"findEmpties iterated with no new neighbors";for(v in y)a[v]=y[v],t.push(y[v])}return t.sort(function(x,T){return T[2]-x[2]})}});var zY=N((aze,IY)=>{"use strict";var FY=br(),NY=Ee().isArrayOrTypedArray;IY.exports=function(r,t,a,n,i,o){var l=[],s=FY.traceIs(r,"contour"),u=FY.traceIs(r,"histogram"),f,c,v,d=NY(t)&&t.length>1;if(d&&!u&&o.type!=="category"){var p=t.length;if(p<=i){if(s)l=Array.from(t).slice(0,i);else if(i===1)o.type==="log"?l=[.5*t[0],2*t[0]]:l=[t[0]-.5,t[0]+.5];else if(o.type==="log"){for(l=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],v=1;v{"use strict";var OY=br(),i6=Ee(),bg=zr(),BY=Sc(),d4e=wY(),p4e=ec(),y4e=kY(),m4e=qY(),g4e=DY(),b4e=PY(),xg=zY(),o6=Ft().BADNUM;UY.exports=function(r,t){var a=bg.getFromId(r,t.xaxis||"x"),n=bg.getFromId(r,t.yaxis||"y"),i=OY.traceIs(t,"contour"),o=OY.traceIs(t,"histogram"),l=i?"best":t.zsmooth,s,u,f,c,v,d,p,y,m,x,T;if(a._minDtick=0,n._minDtick=0,o)T=d4e(r,t),c=T.orig_x,s=T.x,u=T.x0,f=T.dx,y=T.orig_y,v=T.y,d=T.y0,p=T.dy,m=T.z;else{var _=t.z;i6.isArray1D(_)?(y4e(t,a,n,"x","y",["z"]),s=t._x,v=t._y,_=t._z):(c=t.x?a.makeCalcdata(t,"x"):[],y=t.y?n.makeCalcdata(t,"y"):[],s=BY(t,a,"x",c).vals,v=BY(t,n,"y",y).vals,t._x=s,t._y=v),u=t.x0,f=t.dx,d=t.y0,p=t.dy,m=m4e(_,t,a,n)}(a.rangebreaks||n.rangebreaks)&&(m=x4e(s,v,m),o||(s=HY(s),v=HY(v),t._x=s,t._y=v)),!o&&(i||t.connectgaps)&&(t._emptypoints=b4e(m),g4e(m,t._emptypoints));function b(z){l=t._input.zsmooth=t.zsmooth=!1,i6.warn('cannot use zsmooth: "fast": '+z)}function w(z){if(z.length>1){var I=(z[z.length-1]-z[0])/(z.length-1),B=Math.abs(I/100);for(x=0;xB)return!1}return!0}t._islinear=!1,a.type==="log"||n.type==="log"?l==="fast"&&b("log axis found"):w(s)?w(v)?t._islinear=!0:l==="fast"&&b("y scale is not linear"):l==="fast"&&b("x scale is not linear");var k=i6.maxRowLength(m),M=t.xtype==="scaled"?"":s,q=xg(t,M,u,f,k,a),E=t.ytype==="scaled"?"":v,D=xg(t,E,d,p,m.length,n);t._extremes[a._id]=bg.findExtremes(a,q),t._extremes[n._id]=bg.findExtremes(n,D);var P={x:q,y:D,z:m,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&c&&(P.orig_x=c),t.yperiodalignment&&y&&(P.orig_y=y),M&&M.length===q.length-1&&(P.xCenter=M),E&&E.length===D.length-1&&(P.yCenter=E),o&&(P.xRanges=T.xRanges,P.yRanges=T.yRanges,P.pts=T.pts),i||p4e(r,t,{vals:m,cLetter:"z"}),i&&t.contours&&t.contours.coloring==="heatmap"){var R={type:t.type==="contour"?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};P.xfill=xg(R,M,u,f,k,a),P.yfill=xg(R,E,d,p,m.length,n)}return[P]};function HY(e){for(var r=[],t=e.length,a=0;a{"use strict";wg.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]];wg.STYLE=wg.CSS_DECLARATIONS.map(function(e){return e.join(": ")+"; "}).join("")});var s6=N((oze,VY)=>{"use strict";var GY=Tg(),_4e=Yr(),l6=Ee(),Qc=null;function w4e(){if(Qc!==null)return Qc;Qc=!1;var e=l6.isSafari()||l6.isMacWKWebView()||l6.isIOS();if(window.navigator.userAgent&&!e){var r=Array.from(GY.CSS_DECLARATIONS).reverse(),t=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof t=="function")Qc=r.some(function(o){return t.apply(null,o)});else{var a=_4e.tester.append("image").attr("style",GY.STYLE),n=window.getComputedStyle(a.node()),i=n.imageRendering;Qc=r.some(function(o){var l=o[1];return i===l||i===l.toLowerCase()}),a.remove()}}return Qc}VY.exports=w4e});var Ag=N((lze,QY)=>{"use strict";var YY=Sr(),T4e=qn(),A4e=br(),M4e=Yr(),k4e=zr(),Ii=Ee(),WY=Aa(),S4e=m4(),q4e=Tr(),L4e=Co().extractOpts,C4e=Co().makeColorScaleFuncFromTrace,E4e=dl(),D4e=Ha(),u6=D4e.LINE_SPACING,R4e=s6(),P4e=Tg().STYLE,$Y="heatmap-label";function KY(e){return e.selectAll("g."+$Y)}function jY(e){KY(e).remove()}QY.exports=function(e,r,t,a){var n=r.xaxis,i=r.yaxis;Ii.makeTraceGroups(a,t,"hm").each(function(o){var l=YY.select(this),s=o[0],u=s.trace,f=u.xgap||0,c=u.ygap||0,v=s.z,d=s.x,p=s.y,y=s.xCenter,m=s.yCenter,x=A4e.traceIs(u,"contour"),T=x?"best":u.zsmooth,_=v.length,b=Ii.maxRowLength(v),w=!1,k=!1,M,q,E,D,P,R,z,I;for(R=0;M===void 0&&R0;)q=n.c2p(d[R]),R--;for(q0;)P=i.c2p(p[R]),R--;P=n._length||q<=0||D>=i._length||P<=0;if(H){var X=l.selectAll("image").data([]);X.exit().remove(),jY(l);return}var j,ee;B==="fast"?(j=b,ee=_):(j=Y,ee=V);var fe=document.createElement("canvas");fe.width=j,fe.height=ee;var ie=fe.getContext("2d",{willReadFrequently:!0}),ue=C4e(u,{noNumericCheck:!0,returnArray:!0}),K,we;B==="fast"?(K=w?function(vt){return b-1-vt}:Ii.identity,we=k?function(vt){return _-1-vt}:Ii.identity):(K=function(vt){return Ii.constrain(Math.round(n.c2p(d[vt])-M),0,Y)},we=function(vt){return Ii.constrain(Math.round(i.c2p(p[vt])-D),0,V)});var se=we(0),ce=[se,se],he=w?0:1,ye=k?0:1,W=0,Q=0,Z=0,le=0,ve,me,Ce,Pe,Le;function ze(vt,Mn){if(vt!==void 0){var Pt=ue(vt);return Pt[0]=Math.round(Pt[0]),Pt[1]=Math.round(Pt[1]),Pt[2]=Math.round(Pt[2]),W+=Mn,Q+=Pt[0]*Mn,Z+=Pt[1]*Mn,le+=Pt[2]*Mn,Pt}return[0,0,0,0]}function Be(vt,Mn,Pt,Ys){var yn=vt[Pt.bin0];if(yn===void 0)return ze(void 0,1);var ji=vt[Pt.bin1],Yt=Mn[Pt.bin0],Zi=Mn[Pt.bin1],Bl=ji-yn||0,Hl=Yt-yn||0,mr;return ji===void 0?Zi===void 0?mr=0:Yt===void 0?mr=2*(Zi-yn):mr=(2*Zi-Yt-yn)*2/3:Zi===void 0?Yt===void 0?mr=0:mr=(2*yn-ji-Yt)*2/3:Yt===void 0?mr=(2*Zi-ji-yn)*2/3:mr=Zi+yn-ji-Yt,ze(yn+Pt.frac*Bl+Ys.frac*(Hl+Pt.frac*mr))}if(B!=="default"){var Ge=0,De;try{De=new Uint8Array(j*ee*4)}catch(vt){De=new Array(j*ee*4)}if(B==="smooth"){var Oe=y||d,Ue=m||p,oe=new Array(Oe.length),Ae=new Array(Ue.length),Xe=new Array(Y),dr=y?XY:ZY,Ne=m?XY:ZY,Te,qe,He;for(R=0;Rqt||qt>i._length))for(z=Mr;zOt||Ot>n._length)){var gt=S4e({x:ct,y:et},u,e._fullLayout);gt.x=ct,gt.y=et;var wa=s.z[R][z];wa===void 0?(gt.z="",gt.zLabel=""):(gt.z=wa,gt.zLabel=k4e.tickText(Re,wa,"hover").text);var Zt=s.text&&s.text[R]&&s.text[R][z];(Zt===void 0||Zt===!1)&&(Zt=""),gt.text=Zt;var Xt=Ii.texttemplateString({data:[gt,u._meta],fallback:u.texttemplatefallback,labels:gt,locale:e._fullLayout._d3locale,template:ne});if(Xt){var Na=Xt.split("
"),ua=Na.length,Jt=0;for(I=0;I{"use strict";eW.exports={min:"zmin",max:"zmax"}});var Mg=N((uze,rW)=>{"use strict";var F4e=Sr();rW.exports=function(r){F4e.select(r).selectAll(".hm image").style("opacity",function(t){return t.trace.opacity})}});var Sg=N((fze,aW)=>{"use strict";var tW=Fn(),V0=Ee(),kg=V0.isArrayOrTypedArray,N4e=zr(),I4e=Co().extractOpts;aW.exports=function(r,t,a,n,i){i||(i={});var o=i.isContour,l=r.cd[0],s=l.trace,u=r.xa,f=r.ya,c=l.x,v=l.y,d=l.z,p=l.xCenter,y=l.yCenter,m=l.zmask,x=s.zhoverformat,T=c,_=v,b,w,k,M;if(r.index!==!1){try{k=Math.round(r.index[1]),M=Math.round(r.index[0])}catch(X){V0.error("Error hovering on heatmap, pointNumber must be [row,col], found:",r.index);return}if(k<0||k>=d[0].length||M<0||M>d.length)return}else{if(tW.inbox(t-c[0],t-c[c.length-1],0)>0||tW.inbox(a-v[0],a-v[v.length-1],0)>0)return;if(o){var q;for(T=[2*c[0]-c[1]],q=1;q{"use strict";nW.exports={attributes:U0(),supplyDefaults:KV(),calc:_g(),plot:Ag(),colorbar:f6(),style:Mg(),hoverPoints:Sg(),moduleType:"trace",name:"heatmap",basePlotModule:Ei(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}});var lW=N((vze,oW)=>{"use strict";oW.exports=iW()});var c6=N((hze,sW)=>{"use strict";sW.exports=function(r,t){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}});var fW=N((dze,uW)=>{"use strict";uW.exports={eventDataKeys:["binNumber"]}});var qg=N((pze,dW)=>{"use strict";var Hn=Wu(),cW=no().axisHoverFormat,{hovertemplateAttrs:z4e,texttemplateAttrs:O4e,templatefallbackAttrs:vW}=Wn(),v6=ga(),hW=c6(),B4e=fW(),h6=bt().extendFlat;dW.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:cW("x"),yhoverformat:cW("y"),text:h6({},Hn.text,{}),hovertext:h6({},Hn.hovertext,{}),orientation:Hn.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:hW("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:hW("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:z4e({},{keys:B4e.eventDataKeys}),hovertemplatefallback:vW(),texttemplate:O4e({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),texttemplatefallback:vW({editType:"plot"}),textposition:h6({},Hn.textposition,{arrayOk:!1}),textfont:v6({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:v6({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:v6({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:Hn.insidetextanchor,textangle:Hn.textangle,cliponaxis:Hn.cliponaxis,constraintext:Hn.constraintext,marker:Hn.marker,offsetgroup:Hn.offsetgroup,alignmentgroup:Hn.alignmentgroup,selected:Hn.selected,unselected:Hn.unselected,zorder:Hn.zorder}});var gW=N((yze,mW)=>{"use strict";var pW=br(),Y0=Ee(),yW=Tr(),H4e=ju().handleText,U4e=kw(),G4e=qg();mW.exports=function(r,t,a,n){function i(T,_){return Y0.coerce(r,t,G4e,T,_)}var o=i("x"),l=i("y"),s=i("cumulative.enabled");s&&(i("cumulative.direction"),i("cumulative.currentbin")),i("text");var u=i("textposition");H4e(r,t,n,i,u,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),i("hovertext"),i("hovertemplate"),i("hovertemplatefallback"),i("xhoverformat"),i("yhoverformat");var f=i("orientation",l&&!o?"h":"v"),c=f==="v"?"x":"y",v=f==="v"?"y":"x",d=o&&l?Math.min(Y0.minRowLength(o)&&Y0.minRowLength(l)):Y0.minRowLength(t[c]||[]);if(!d){t.visible=!1;return}t._length=d;var p=pW.getComponentMethod("calendars","handleTraceDefaults");p(r,t,["x","y"],n);var y=t[v];y&&i("histfunc"),i("histnorm"),i("autobin"+c),U4e(r,t,i,a,n),Y0.coerceSelectionMarkerOpacity(t,i);var m=(t.marker.line||{}).color,x=pW.getComponentMethod("errorbars","supplyDefaults");x(r,t,m||yW.defaultLine,{axis:"y"}),x(r,t,m||yW.defaultLine,{axis:"x",inherit:"y"}),i("zorder")}});var Cg=N((mze,_W)=>{"use strict";var W0=Ee(),V4e=fa(),Lg=br().traceIs,Y4e=p0(),W4e=ju().validateCornerradius,bW=W0.nestedProperty,d6=Ru().getAxisGroup,xW=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],j4e=["x","y"];_W.exports=function(r,t){var a=t._histogramBinOpts={},n=[],i={},o=[],l,s,u,f,c,v,d;function p(B,G){return W0.coerce(l._input,l,l._module.attributes,B,G)}function y(B){return B.orientation==="v"?"x":"y"}function m(B,G){var Y=V4e.getFromTrace({_fullLayout:t},B,G);return Y.type}function x(B,G,Y){var V=B.uid+"__"+Y;G||(G=V);var H=m(B,Y),X=B[Y+"calendar"]||"",j=a[G],ee=!0;j&&(H===j.axType&&X===j.calendar?(ee=!1,j.traces.push(B),j.dirs.push(Y)):(G=V,H!==j.axType&&W0.warn(["Attempted to group the bins of trace",B.index,"set on a","type:"+H,"axis","with bins on","type:"+j.axType,"axis."].join(" ")),X!==j.calendar&&W0.warn(["Attempted to group the bins of trace",B.index,"set with a",X,"calendar","with bins",j.calendar?"on a "+j.calendar+" calendar":"w/o a set calendar"].join(" ")))),ee&&(a[G]={traces:[B],dirs:[Y],axType:H,calendar:B[Y+"calendar"]||""}),B["_"+Y+"bingroup"]=G}for(c=0;c{"use strict";var Z4e=Pw().hoverPoints,X4e=zr().hoverLabelText;wW.exports=function(r,t,a,n,i){var o=Z4e(r,t,a,n,i);if(o){r=o[0];var l=r.cd[r.index],s=r.cd[0].trace;if(!s.cumulative.enabled){var u=s.orientation==="h"?"y":"x";r[u+"Label"]=X4e(r[u+"a"],[l.ph0,l.ph1],s[u+"hoverformat"])}return o}}});var p6=N((bze,AW)=>{"use strict";AW.exports=function(r,t,a,n,i){if(r.x="xVal"in t?t.xVal:t.x,r.y="yVal"in t?t.yVal:t.y,"zLabelVal"in t&&(r.z=t.zLabelVal),t.xa&&(r.xaxis=t.xa),t.ya&&(r.yaxis=t.ya),!(a.cumulative||{}).enabled){var o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;r.pointNumbers=o,r.binNumber=r.pointNumber,delete r.pointNumber,delete r.pointIndex;var l;if(a._indexToPoints){l=[];for(var s=0;s{"use strict";MW.exports={attributes:qg(),layoutAttributes:ig(),supplyDefaults:gW(),crossTraceDefaults:Cg(),supplyLayoutDefaults:Sw(),calc:n6().calc,crossTraceCalc:_m().crossTraceCalc,plot:Dw().plot,layerName:"barlayer",style:Wc().style,styleOnSelect:Wc().styleOnSelect,colorbar:_0(),hoverPoints:TW(),selectPoints:Fw(),eventData:p6(),moduleType:"trace",name:"histogram",basePlotModule:Ei(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}});var qW=N((_ze,SW)=>{"use strict";SW.exports=kW()});var Dg=N((wze,EW)=>{"use strict";var xo=qg(),LW=c6(),Eg=U0(),J4e=gn(),y6=no().axisHoverFormat,{hovertemplateAttrs:$4e,texttemplateAttrs:K4e,templatefallbackAttrs:CW}=Wn(),Q4e=Lo(),j0=bt().extendFlat;EW.exports=j0({x:xo.x,y:xo.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:xo.histnorm,histfunc:xo.histfunc,nbinsx:xo.nbinsx,xbins:LW("x"),nbinsy:xo.nbinsy,ybins:LW("y"),autobinx:xo.autobinx,autobiny:xo.autobiny,bingroup:j0({},xo.bingroup,{}),xbingroup:j0({},xo.bingroup,{}),ybingroup:j0({},xo.bingroup,{}),xgap:Eg.xgap,ygap:Eg.ygap,zsmooth:Eg.zsmooth,xhoverformat:y6("x"),yhoverformat:y6("y"),zhoverformat:y6("z",1),hovertemplate:$4e({},{keys:["z"]}),hovertemplatefallback:CW(),texttemplate:K4e({arrayOk:!1,editType:"plot"},{keys:["z"]}),texttemplatefallback:CW({editType:"plot"}),textfont:Eg.textfont,showlegend:j0({},J4e.showlegend,{dflt:!1})},Q4e("",{cLetter:"z",autoColorDflt:!1}))});var m6=N((Tze,RW)=>{"use strict";var ewe=br(),DW=Ee();RW.exports=function(r,t,a,n){var i=a("x"),o=a("y"),l=DW.minRowLength(i),s=DW.minRowLength(o);if(!l||!s){t.visible=!1;return}t._length=Math.min(l,s);var u=ewe.getComponentMethod("calendars","handleTraceDefaults");u(r,t,["x","y"],n);var f=a("z")||a("marker.color");f&&a("histfunc"),a("histnorm"),a("autobinx"),a("autobiny")}});var FW=N((Aze,PW)=>{"use strict";var rwe=Ee(),twe=m6(),awe=$w(),nwe=yl(),iwe=G0(),owe=Dg();PW.exports=function(r,t,a,n){function i(o,l){return rwe.coerce(r,t,owe,o,l)}twe(r,t,i,n),t.visible!==!1&&(awe(r,t,i,n),nwe(r,t,n,i,{prefix:"",cLetter:"z"}),i("hovertemplate"),i("hovertemplatefallback"),iwe(i,n),i("xhoverformat"),i("yhoverformat"))}});var zW=N((Mze,IW)=>{"use strict";var lwe=Sg(),NW=zr().hoverLabelText;IW.exports=function(r,t,a,n,i){var o=lwe(r,t,a,n,i);if(o){r=o[0];var l=r.index,s=l[0],u=l[1],f=r.cd[0],c=f.trace,v=f.xRanges[u],d=f.yRanges[s];return r.xLabel=NW(r.xa,[v[0],v[1]],c.xhoverformat),r.yLabel=NW(r.ya,[d[0],d[1]],c.yhoverformat),o}}});var BW=N((kze,OW)=>{"use strict";OW.exports={attributes:Dg(),supplyDefaults:FW(),crossTraceDefaults:Cg(),calc:_g(),plot:Ag(),layerName:"heatmaplayer",colorbar:f6(),style:Mg(),hoverPoints:zW(),eventData:p6(),moduleType:"trace",name:"histogram2d",basePlotModule:Ei(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}});var UW=N((Sze,HW)=>{"use strict";HW.exports=BW()});var Rg=N((qze,GW)=>{"use strict";GW.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}});var Fg=N((Lze,jW)=>{"use strict";var sa=U0(),Pg=Ai(),YW=no(),g6=YW.axisHoverFormat,swe=YW.descriptionOnlyNumbers,uwe=Lo(),fwe=ci().dash,cwe=ga(),ev=bt().extendFlat,WW=Rg(),vwe=WW.COMPARISON_OPS2,hwe=WW.INTERVAL_OPS,VW=Pg.line;jW.exports=ev({z:sa.z,x:sa.x,x0:sa.x0,dx:sa.dx,y:sa.y,y0:sa.y0,dy:sa.dy,xperiod:sa.xperiod,yperiod:sa.yperiod,xperiod0:Pg.xperiod0,yperiod0:Pg.yperiod0,xperiodalignment:sa.xperiodalignment,yperiodalignment:sa.yperiodalignment,text:sa.text,hovertext:sa.hovertext,transpose:sa.transpose,xtype:sa.xtype,ytype:sa.ytype,xhoverformat:g6("x"),yhoverformat:g6("y"),zhoverformat:g6("z",1),hovertemplate:sa.hovertemplate,hovertemplatefallback:sa.hovertemplatefallback,texttemplate:ev({},sa.texttemplate,{}),texttemplatefallback:sa.texttemplatefallback,textfont:ev({},sa.textfont,{}),hoverongaps:sa.hoverongaps,connectgaps:ev({},sa.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:cwe({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:swe("contour label")},operation:{valType:"enumerated",values:[].concat(vwe).concat(hwe),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:ev({},VW.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:fwe,smoothing:ev({},VW.smoothing,{}),editType:"plot"},zorder:Pg.zorder},uwe("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))});var x6=N((Cze,XW)=>{"use strict";var en=Dg(),Jo=Fg(),dwe=Lo(),b6=no().axisHoverFormat,ZW=bt().extendFlat;XW.exports=ZW({x:en.x,y:en.y,z:en.z,marker:en.marker,histnorm:en.histnorm,histfunc:en.histfunc,nbinsx:en.nbinsx,xbins:en.xbins,nbinsy:en.nbinsy,ybins:en.ybins,autobinx:en.autobinx,autobiny:en.autobiny,bingroup:en.bingroup,xbingroup:en.xbingroup,ybingroup:en.ybingroup,autocontour:Jo.autocontour,ncontours:Jo.ncontours,contours:Jo.contours,line:{color:Jo.line.color,width:ZW({},Jo.line.width,{dflt:.5}),dash:Jo.line.dash,smoothing:Jo.line.smoothing,editType:"plot"},xhoverformat:b6("x"),yhoverformat:b6("y"),zhoverformat:b6("z",1),hovertemplate:en.hovertemplate,hovertemplatefallback:en.hovertemplatefallback,texttemplate:Jo.texttemplate,texttemplatefallback:Jo.texttemplatefallback,textfont:Jo.textfont},dwe("",{cLetter:"z",editTypeOverride:"calc"}))});var _6=N((Eze,JW)=>{"use strict";JW.exports=function(r,t,a,n){var i=n("contours.start"),o=n("contours.end"),l=i===!1||o===!1,s=a("contours.size"),u;l?u=t.autocontour=!0:u=a("autocontour",!1),(u||!s)&&a("ncontours")}});var w6=N((Dze,$W)=>{"use strict";var pwe=Ee();$W.exports=function(r,t,a,n){n||(n={});var i=r("contours.showlabels");if(i){var o=t.font;pwe.coerceFont(r,"contours.labelfont",o,{overrideDflt:{color:a}}),r("contours.labelformat")}n.hasHover!==!1&&r("zhoverformat")}});var T6=N((Rze,KW)=>{"use strict";var ywe=yl(),mwe=w6();KW.exports=function(r,t,a,n,i){var o=a("contours.coloring"),l,s="";o==="fill"&&(l=a("contours.showlines")),l!==!1&&(o!=="lines"&&(s=a("line.color","#000")),a("line.width",.5),a("line.dash")),o!=="none"&&(r.showlegend!==!0&&(t.showlegend=!1),t._dfltShowLegend=!1,ywe(r,t,n,a,{prefix:"",cLetter:"z"})),a("line.smoothing"),mwe(a,n,s,i)}});var tj=N((Pze,rj)=>{"use strict";var QW=Ee(),gwe=m6(),bwe=_6(),xwe=T6(),_we=G0(),ej=x6();rj.exports=function(r,t,a,n){function i(l,s){return QW.coerce(r,t,ej,l,s)}function o(l){return QW.coerce2(r,t,ej,l)}gwe(r,t,i,n),t.visible!==!1&&(bwe(r,t,i,o),xwe(r,t,i,n),i("xhoverformat"),i("yhoverformat"),i("hovertemplate"),i("hovertemplatefallback"),t.contours&&t.contours.coloring==="heatmap"&&_we(i,n))}});var ij=N((Fze,nj)=>{"use strict";var M6=zr(),A6=Ee();nj.exports=function(r,t){var a=r.contours;if(r.autocontour){var n=r.zmin,i=r.zmax;(r.zauto||n===void 0)&&(n=A6.aggNums(Math.min,null,t)),(r.zauto||i===void 0)&&(i=A6.aggNums(Math.max,null,t));var o=aj(n,i,r.ncontours);a.size=o.dtick,a.start=M6.tickFirst(o),o.range.reverse(),a.end=M6.tickFirst(o),a.start===n&&(a.start+=a.size),a.end===i&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),r._input.contours||(r._input.contours={}),A6.extendFlat(r._input.contours,{start:a.start,end:a.end,size:a.size}),r._input.autocontour=!0}else if(a.type!=="constraint"){var l=a.start,s=a.end,u=r._input.contours;if(l>s&&(a.start=u.start=s,s=a.end=u.end=l,l=a.start),!(a.size>0)){var f;l===s?f=1:f=aj(l,s,r.ncontours).dtick,u.size=a.size=f}}};function aj(e,r,t){var a={type:"linear",range:[e,r]};return M6.autoTicks(a,(r-e)/(t||15)),a}});var Z0=N((Nze,oj)=>{"use strict";oj.exports=function(r){return r.end+r.size/1e6}});var k6=N((Ize,sj)=>{"use strict";var lj=Co(),wwe=_g(),Twe=ij(),Awe=Z0();sj.exports=function(r,t){var a=wwe(r,t),n=a[0].z;Twe(t,n);var i=t.contours,o=lj.extractOpts(t),l;if(i.coloring==="heatmap"&&o.auto&&t.autocontour===!1){var s=i.start,u=Awe(i),f=i.size||1,c=Math.floor((u-s)/f)+1;isFinite(f)||(f=1,c=1);var v=s-f/2,d=v+c*f;l=[v,d]}else l=n;return lj.calc(r,t,{vals:l,cLetter:"z"}),a}});var Ng=N((zze,uj)=>{"use strict";uj.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}});var cj=N((Oze,fj)=>{"use strict";var Ig=Ng();fj.exports=function(r){var t=r[0].z,a=t.length,n=t[0].length,i=a===2||n===2,o,l,s,u,f,c,v,d,p;for(l=0;le?0:1)+(r[0][1]>e?0:2)+(r[1][1]>e?0:4)+(r[1][0]>e?0:8);if(t===5||t===10){var a=(r[0][0]+r[0][1]+r[1][0]+r[1][1])/4;return e>a?t===5?713:1114:t===5?104:208}return t===15?0:t}});var pj=N((Bze,dj)=>{"use strict";var zg=Ee(),rv=Ng();dj.exports=function(r,t,a){var n,i,o,l,s;for(t=t||.01,a=a||.01,o=0;o20?(o=rv.CHOOSESADDLE[o][(l[0]||l[1])<0?0:1],e.crossings[i]=rv.SADDLEREMAINDER[o]):delete e.crossings[i],l=rv.NEWDELTA[o],!l){zg.log("Found bad marching index:",o,r,e.level);break}s.push(hj(e,r,l)),r[0]+=l[0],r[1]+=l[1],i=r.join(","),X0(s[s.length-1],s[s.length-2],a,n)&&s.pop();var p=l[0]&&(r[0]<0||r[0]>f-2)||l[1]&&(r[1]<0||r[1]>u-2),y=r[0]===c[0]&&r[1]===c[1]&&l[0]===v[0]&&l[1]===v[1];if(y||t&&p)break;o=e.crossings[i]}d===1e4&&zg.log("Infinite loop in contour?");var m=X0(s[0],s[s.length-1],a,n),x=0,T=.2*e.smoothing,_=[],b=0,w,k,M,q,E,D,P,R,z,I,B;for(d=1;d=b;d--)if(w=_[d],w=b&&w+_[k]R&&z--,e.edgepaths[z]=B.concat(s,I));break}H||(e.edgepaths[R]=s.concat(I))}for(R=0;R20&&r?e===208||e===1114?a=t[0]===0?1:-1:n=t[1]===0?1:-1:rv.BOTTOMSTART.indexOf(e)!==-1?n=1:rv.LEFTSTART.indexOf(e)!==-1?a=1:rv.TOPSTART.indexOf(e)!==-1?n=-1:a=-1,[a,n]}function hj(e,r,t){var a=r[0]+Math.max(t[0],0),n=r[1]+Math.max(t[1],0),i=e.z[n][a],o=e.xaxis,l=e.yaxis;if(t[1]){var s=(e.level-i)/(e.z[n][a+1]-i),u=(s!==1?(1-s)*o.c2l(e.x[a]):0)+(s!==0?s*o.c2l(e.x[a+1]):0);return[o.c2p(o.l2c(u),!0),l.c2p(e.y[n],!0),a+s,n]}else{var f=(e.level-i)/(e.z[n+1][a]-i),c=(f!==1?(1-f)*l.c2l(e.y[n]):0)+(f!==0?f*l.c2l(e.y[n+1]):0);return[o.c2p(e.x[a],!0),l.c2p(l.l2c(c),!0),a,n+f]}}});var bj=N((Hze,gj)=>{"use strict";var S6=Rg(),qwe=Rr();gj.exports={"[]":yj("[]"),"][":yj("]["),">":q6(">"),"<":q6("<"),"=":q6("=")};function mj(e,r){var t=Array.isArray(r),a;function n(i){return qwe(i)?+i:null}return S6.COMPARISON_OPS2.indexOf(e)!==-1?a=n(t?r[0]:r):S6.INTERVAL_OPS.indexOf(e)!==-1?a=t?[n(r[0]),n(r[1])]:[n(r),n(r)]:S6.SET_OPS.indexOf(e)!==-1&&(a=t?r.map(n):[n(r)]),a}function yj(e){return function(r){r=mj(e,r);var t=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:t,end:a,size:a-t}}}function q6(e){return function(r){return r=mj(e,r),{start:r,end:1/0,size:1/0}}}});var wj=N((Uze,_j)=>{"use strict";var xj=Ee(),Lwe=bj(),Cwe=Z0();_j.exports=function(r,t,a){for(var n=r.type==="constraint"?Lwe[r._operation](r.value):r,i=n.size,o=[],l=Cwe(n),s=a.trace._carpetTrace,u=s?{xaxis:s.aaxis,yaxis:s.baxis,x:a.a,y:a.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y},f=n.start;f1e3){xj.warn("Too many contours, clipping at 1000",r);break}return o}});var Mj=N((Gze,Aj)=>{"use strict";var tv=Ee();Aj.exports=function(e,r){var t,a,n,i=function(s){return s.reverse()},o=function(s){return s};switch(r){case"=":case"<":return e;case">":for(e.length!==1&&tv.warn("Contour data invalid for the specified inequality operation."),a=e[0],t=0;t{"use strict";kj.exports=function(e,r){var t=e[0],a=t.z,n;switch(r.type){case"levels":var i=Math.min(a[0][0],a[0][1]);for(n=0;no.level||o.starts.length&&i===o.level)}break;case"constraint":if(t.prefixBoundary=!1,t.edgepaths.length)return;var l=t.x.length,s=t.y.length,u=-1/0,f=1/0;for(n=0;n":c>u&&(t.prefixBoundary=!0);break;case"<":(cu||t.starts.length&&d===f)&&(t.prefixBoundary=!0);break;case"][":v=Math.min(c[0],c[1]),d=Math.max(c[0],c[1]),vu&&(t.prefixBoundary=!0);break}break}}});var L6=N(pn=>{"use strict";var $0=Sr(),Pa=Ee(),El=Yr(),Ewe=Co(),Cj=Aa(),qj=zr(),Lj=lc(),Dwe=Ag(),Ej=cj(),Dj=pj(),Rwe=wj(),Pwe=Mj(),Rj=Sj(),J0=Ng(),$o=J0.LABELOPTIMIZER;pn.plot=function(r,t,a,n){var i=t.xaxis,o=t.yaxis;Pa.makeTraceGroups(n,a,"contour").each(function(l){var s=$0.select(this),u=l[0],f=u.trace,c=u.x,v=u.y,d=f.contours,p=Rwe(d,t,u),y=Pa.ensureSingle(s,"g","heatmapcoloring"),m=[];d.coloring==="heatmap"&&(m=[l]),Dwe(r,t,m,y),Ej(p),Dj(p);var x=i.c2p(c[0],!0),T=i.c2p(c[c.length-1],!0),_=o.c2p(v[0],!0),b=o.c2p(v[v.length-1],!0),w=[[x,b],[T,b],[T,_],[x,_]],k=p;d.type==="constraint"&&(k=Pwe(p,d._operation)),Fwe(s,w,d),Nwe(s,k,w,d),Iwe(s,p,r,u,d),Owe(s,t,r,u,w)})};function Fwe(e,r,t){var a=Pa.ensureSingle(e,"g","contourbg"),n=a.selectAll("path").data(t.coloring==="fill"?[0]:[]);n.enter().append("path"),n.exit().remove(),n.attr("d","M"+r.join("L")+"Z").style("stroke","none")}function Nwe(e,r,t,a){var n=a.coloring==="fill"||a.type==="constraint"&&a._operation!=="=",i="M"+t.join("L")+"Z";n&&Rj(r,a);var o=Pa.ensureSingle(e,"g","contourfill"),l=o.selectAll("path").data(n?r:[]);l.enter().append("path"),l.exit().remove(),l.each(function(s){var u=(s.prefixBoundary?i:"")+Pj(s,t);u?$0.select(this).attr("d",u).style("stroke","none"):$0.select(this).remove()})}function Pj(e,r){var t="",a=0,n=e.edgepaths.map(function(x,T){return T}),i=!0,o,l,s,u,f,c;function v(x){return Math.abs(x[1]-r[0][1])<.01}function d(x){return Math.abs(x[1]-r[2][1])<.01}function p(x){return Math.abs(x[0]-r[0][0])<.01}function y(x){return Math.abs(x[0]-r[2][0])<.01}for(;n.length;){for(c=El.smoothopen(e.edgepaths[a],e.smoothing),t+=i?c:c.replace(/^M/,"L"),n.splice(n.indexOf(a),1),o=e.edgepaths[a][e.edgepaths[a].length-1],u=-1,s=0;s<4;s++){if(!o){Pa.log("Missing end?",a,e);break}for(v(o)&&!y(o)?l=r[1]:p(o)?l=r[0]:d(o)?l=r[3]:y(o)&&(l=r[2]),f=0;f=0&&(l=m,u=f):Math.abs(o[1]-l[1])<.01?Math.abs(o[1]-m[1])<.01&&(m[0]-o[0])*(l[0]-m[0])>=0&&(l=m,u=f):Pa.log("endpt to newendpt is not vert. or horz.",o,l,m)}if(o=l,u>=0)break;t+="L"+l}if(u===e.edgepaths.length){Pa.log("unclosed perimeter path");break}a=u,i=n.indexOf(a)===-1,i&&(a=n[0],t+="Z")}for(a=0;a$o.MAXCOST*2)break;v&&(l/=2),o=u-l/2,s=o+l*1.5}if(c<=$o.MAXCOST)return f};function zwe(e,r,t,a){var n=r.width/2,i=r.height/2,o=e.x,l=e.y,s=e.theta,u=Math.cos(s)*n,f=Math.sin(s)*n,c=(o>a.center?a.right-o:o-a.left)/(u+Math.abs(Math.sin(s)*i)),v=(l>a.middle?a.bottom-l:l-a.top)/(Math.abs(f)+Math.cos(s)*i);if(c<1||v<1)return 1/0;var d=$o.EDGECOST*(1/(c-1)+1/(v-1));d+=$o.ANGLECOST*s*s;for(var p=o-u,y=l-f,m=o+u,x=l+f,T=0;T{"use strict";var Hwe=Sr(),C6=Co(),Uwe=Z0();Fj.exports=function(r){var t=r.contours,a=t.start,n=Uwe(t),i=t.size||1,o=Math.floor((n-a)/i)+1,l=t.coloring==="lines"?0:1,s=C6.extractOpts(r);isFinite(i)||(i=1,o=1);var u=s.reversescale?C6.flipScale(s.colorscale):s.colorscale,f=u.length,c=new Array(f),v=new Array(f),d,p,y=s.min,m=s.max;if(t.coloring==="heatmap"){for(p=0;p=m)&&(a<=y&&(a=y),n>=m&&(n=m),o=Math.floor((n-a)/i)+1,l=0),p=0;py&&(c.unshift(y),v.unshift(v[0])),c[c.length-1]{"use strict";var Og=Sr(),Nj=Yr(),Gwe=Mg(),Vwe=E6();Ij.exports=function(r){var t=Og.select(r).selectAll("g.contour");t.style("opacity",function(a){return a[0].trace.opacity}),t.each(function(a){var n=Og.select(this),i=a[0].trace,o=i.contours,l=i.line,s=o.size||1,u=o.start,f=o.type==="constraint",c=!f&&o.coloring==="lines",v=!f&&o.coloring==="fill",d=c||v?Vwe(i):null;n.selectAll("g.contourlevel").each(function(m){Og.select(this).selectAll("path").call(Nj.lineGroupStyle,l.width,c?d(m.level):l.color,l.dash)});var p=o.labelfont;if(n.selectAll("g.contourlabels text").each(function(m){Nj.font(Og.select(this),{weight:p.weight,style:p.style,variant:p.variant,textcase:p.textcase,lineposition:p.lineposition,shadow:p.shadow,family:p.family,size:p.size,color:p.color||(c?d(m.level):l.color)})}),f)n.selectAll("g.contourfill path").style("fill",i.fillcolor);else if(v){var y;n.selectAll("g.contourfill path").style("fill",function(m){return y===void 0&&(y=m.level),d(m.level+.5*s)}),y===void 0&&(y=u),n.selectAll("g.contourbg path").style("fill",d(y-.5*s))}}),Gwe(r)}});var R6=N((Zze,Oj)=>{"use strict";var zj=Co(),Ywe=E6(),Wwe=Z0();function jwe(e,r,t){var a=r.contours,n=r.line,i=a.size||1,o=a.coloring,l=Ywe(r,{isColorbar:!0});if(o==="heatmap"){var s=zj.extractOpts(r);t._fillgradient=s.reversescale?zj.flipScale(s.colorscale):s.colorscale,t._zrange=[s.min,s.max]}else o==="fill"&&(t._fillcolor=l);t._line={color:o==="lines"?l:n.color,width:a.showlines!==!1?n.width:0,dash:n.dash},t._levels={start:a.start,end:Wwe(a),size:i}}Oj.exports={min:"zmin",max:"zmax",calc:jwe}});var P6=N((Xze,Bj)=>{"use strict";var Bg=Tr(),Zwe=Sg();Bj.exports=function(r,t,a,n,i){i||(i={}),i.isContour=!0;var o=Zwe(r,t,a,n,i);return o&&o.forEach(function(l){var s=l.trace;s.contours.type==="constraint"&&(s.fillcolor&&Bg.opacity(s.fillcolor)?l.color=Bg.addOpacity(s.fillcolor,1):s.contours.showlines&&Bg.opacity(s.line.color)&&(l.color=Bg.addOpacity(s.line.color,1)))}),o}});var Uj=N((Jze,Hj)=>{"use strict";Hj.exports={attributes:x6(),supplyDefaults:tj(),crossTraceDefaults:Cg(),calc:k6(),plot:L6().plot,layerName:"contourlayer",style:D6(),colorbar:R6(),hoverPoints:P6(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Ei(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}});var Vj=N(($ze,Gj)=>{"use strict";Gj.exports=Uj()});var $j=N((Kze,Jj)=>{"use strict";var Yj=Rr(),Xwe=w6(),Zj=Tr(),Wj=Zj.addOpacity,Jwe=Zj.opacity,Xj=Rg(),jj=Ee().isArrayOrTypedArray,$we=Xj.CONSTRAINT_REDUCTION,Kwe=Xj.COMPARISON_OPS2;Jj.exports=function(r,t,a,n,i,o){var l=t.contours,s,u,f,c=a("contours.operation");if(l._operation=$we[c],Qwe(a,l),c==="="?s=l.showlines=!0:(s=a("contours.showlines"),f=a("fillcolor",Wj((r.line||{}).color||i,.5))),s){var v=f&&Jwe(f)?Wj(t.fillcolor,1):i;u=a("line.color",v),a("line.width",2),a("line.dash")}a("line.smoothing"),Xwe(a,n,u,o)};function Qwe(e,r){var t;Kwe.indexOf(r.operation)===-1?(e("contours.value",[0,1]),jj(r.value)?r.value.length>2?r.value=r.value.slice(2):r.length===0?r.value=[0,1]:r.length<2?(t=parseFloat(r.value[0]),r.value=[t,t+1]):r.value=[parseFloat(r.value[0]),parseFloat(r.value[1])]:Yj(r.value)&&(t=parseFloat(r.value),r.value=[t,t+1])):(e("contours.value",0),Yj(r.value)||(jj(r.value)?r.value=parseFloat(r.value[0]):r.value=0))}});var eZ=N((Qze,Qj)=>{"use strict";var F6=Ee(),e6e=Jw(),r6e=Mc(),t6e=$j(),a6e=_6(),n6e=T6(),i6e=G0(),Kj=Fg();Qj.exports=function(r,t,a,n){function i(u,f){return F6.coerce(r,t,Kj,u,f)}function o(u){return F6.coerce2(r,t,Kj,u)}var l=e6e(r,t,i,n);if(!l){t.visible=!1;return}r6e(r,t,n,i),i("xhoverformat"),i("yhoverformat"),i("text"),i("hovertext"),i("hoverongaps"),i("hovertemplate"),i("hovertemplatefallback");var s=i("contours.type")==="constraint";i("connectgaps",F6.isArray1D(t.z)),s?t6e(r,t,i,n,a):(a6e(r,t,i,o),n6e(r,t,i,n)),t.contours&&t.contours.coloring==="heatmap"&&i6e(i,n),i("zorder")}});var tZ=N((eOe,rZ)=>{"use strict";rZ.exports={attributes:Fg(),supplyDefaults:eZ(),calc:k6(),plot:L6().plot,style:D6(),colorbar:R6(),hoverPoints:P6(),moduleType:"trace",name:"contour",basePlotModule:Ei(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}});var nZ=N((rOe,aZ)=>{"use strict";aZ.exports=tZ()});var N6=N((tOe,sZ)=>{"use strict";var{hovertemplateAttrs:o6e,texttemplateAttrs:l6e,templatefallbackAttrs:iZ}=Wn(),s6e=Uy(),oi=Ai(),u6e=gn(),oZ=Lo(),f6e=ci().dash,ks=bt().extendFlat,zi=oi.marker,K0=oi.line,lZ=zi.line;sZ.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:ks({},oi.mode,{dflt:"markers"}),text:ks({},oi.text,{}),texttemplate:l6e({editType:"plot"},{keys:["a","b","c","text"]}),texttemplatefallback:iZ({editType:"plot"}),hovertext:ks({},oi.hovertext,{}),line:{color:K0.color,width:K0.width,dash:f6e,backoff:K0.backoff,shape:ks({},K0.shape,{values:["linear","spline"]}),smoothing:K0.smoothing,editType:"calc"},connectgaps:oi.connectgaps,cliponaxis:oi.cliponaxis,fill:ks({},oi.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:s6e(),marker:ks({symbol:zi.symbol,opacity:zi.opacity,angle:zi.angle,angleref:zi.angleref,standoff:zi.standoff,maxdisplayed:zi.maxdisplayed,size:zi.size,sizeref:zi.sizeref,sizemin:zi.sizemin,sizemode:zi.sizemode,line:ks({width:lZ.width,dash:lZ.dash,editType:"calc"},oZ("marker.line")),gradient:zi.gradient,editType:"calc"},oZ("marker")),textfont:oi.textfont,textposition:oi.textposition,selected:oi.selected,unselected:oi.unselected,hoverinfo:ks({},u6e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:oi.hoveron,hovertemplate:o6e(),hovertemplatefallback:iZ()}});var vZ=N((aOe,cZ)=>{"use strict";var uZ=Ee(),c6e=r0(),av=Pn(),v6e=J_(),h6e=$_(),fZ=K_(),d6e=Q_(),p6e=e4(),y6e=N6();cZ.exports=function(r,t,a,n){function i(v,d){return uZ.coerce(r,t,y6e,v,d)}var o=i("a"),l=i("b"),s=i("c"),u;if(o?(u=o.length,l?(u=Math.min(u,l.length),s&&(u=Math.min(u,s.length))):s?u=Math.min(u,s.length):u=0):l&&s&&(u=Math.min(l.length,s.length)),!u){t.visible=!1;return}t._length=u,i("sum"),i("text"),i("hovertext"),t.hoveron!=="fills"&&(i("hovertemplate"),i("hovertemplatefallback"));var f=u{"use strict";var I6=zr();hZ.exports=function(r,t,a){var n={},i=a[t.subplot]._subplot;return n.aLabel=I6.tickText(i.aaxis,r.a,!0).text,n.bLabel=I6.tickText(i.baxis,r.b,!0).text,n.cLabel=I6.tickText(i.caxis,r.c,!0).text,n}});var gZ=N((iOe,mZ)=>{"use strict";var z6=Rr(),m6e=a4(),g6e=ym(),b6e=mm(),x6e=gm().calcMarkerSize,pZ=["a","b","c"],yZ={a:["b","c"],b:["a","c"],c:["a","b"]};mZ.exports=function(r,t){var a=r._fullLayout[t.subplot],n=a.sum,i=t.sum||n,o={a:t.a,b:t.b,c:t.c},l=t.ids,s,u,f,c,v,d;for(s=0;s{"use strict";var _6e=y4();bZ.exports=function(r,t,a){var n=t.plotContainer;n.select(".scatterlayer").selectAll("*").remove();for(var i=t.xaxis,o=t.yaxis,l={xaxis:i,yaxis:o,plot:n,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},s=t.layers.frontplot.select("g.scatterlayer"),u=0;u{"use strict";var w6e=w4();_Z.exports=function(r,t,a,n){var i=w6e(r,t,a,n);if(!i||i[0].index===!1)return;var o=i[0];if(o.index===void 0){var l=1-o.y0/r.ya._length,s=r.xa._length,u=s*l/2,f=s-u;return o.x0=Math.max(Math.min(o.x0,f),u),o.x1=Math.max(Math.min(o.x1,f),u),i}var c=o.cd[o.index],v=o.trace,d=o.subplot;o.a=c.a,o.b=c.b,o.c=c.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var p={};p[v.subplot]={_subplot:d};var y=v._module.formatLabels(c,v,p);o.aLabel=y.aLabel,o.bLabel=y.bLabel,o.cLabel=y.cLabel;var m=c.hi||v.hoverinfo,x=[];function T(b,w){x.push(b._hovertitle+": "+w)}if(!v.hovertemplate){var _=m.split("+");_.indexOf("all")!==-1&&(_=["a","b","c"]),_.indexOf("a")!==-1&&T(d.aaxis,o.aLabel),_.indexOf("b")!==-1&&T(d.baxis,o.bLabel),_.indexOf("c")!==-1&&T(d.caxis,o.cLabel)}return o.extraText=x.join("
"),o.hovertemplate=v.hovertemplate,i}});var AZ=N((sOe,TZ)=>{"use strict";TZ.exports=function(r,t,a,n,i){if(t.xa&&(r.xaxis=t.xa),t.ya&&(r.yaxis=t.ya),n[i]){var o=n[i];r.a=o.a,r.b=o.b,r.c=o.c}else r.a=t.a,r.b=t.b,r.c=t.c;return r}});var FZ=N((uOe,PZ)=>{"use strict";var CZ=Sr(),T6e=qn(),O6=br(),Dl=Ee(),Ko=Dl.strTranslate,Hg=Dl._,iv=Tr(),Ug=Yr(),Q0=lc(),B6=bt().extendFlat,A6e=aa(),Ss=zr(),MZ=mi(),kZ=Fn(),EZ=Lu(),SZ=EZ.freeMode,M6e=EZ.rectMode,H6=oc(),k6e=Go().prepSelect,S6e=Go().selectOnClick,q6e=Go().clearOutline,L6e=Go().clearSelectionsCache,DZ=xa();function RZ(e,r){this.id=e.id,this.graphDiv=e.graphDiv,this.init(r),this.makeFramework(r),this.updateFx(r),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}PZ.exports=RZ;var Qo=RZ.prototype;Qo.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}};Qo.plot=function(e,r){var t=this,a=r[t.id],n=r._size;t._hasClipOnAxisFalse=!1;for(var i=0;inv*u?(x=u,m=x*nv):(m=s,x=m/nv),T=o*m/s,_=l*x/u,p=r.l+r.w*n-m/2,y=r.t+r.h*(1-i)-x/2,t.x0=p,t.y0=y,t.w=m,t.h=x,t.sum=f,t.xaxis={type:"linear",range:[c+2*d-f,f-c-2*v],domain:[n-T/2,n+T/2],_id:"x"},Q0(t.xaxis,t.graphDiv._fullLayout),t.xaxis.setScale(),t.xaxis.isPtWithinRange=function(I){return I.a>=t.aaxis.range[0]&&I.a<=t.aaxis.range[1]&&I.b>=t.baxis.range[1]&&I.b<=t.baxis.range[0]&&I.c>=t.caxis.range[1]&&I.c<=t.caxis.range[0]},t.yaxis={type:"linear",range:[c,f-v-d],domain:[i-_/2,i+_/2],_id:"y"},Q0(t.yaxis,t.graphDiv._fullLayout),t.yaxis.setScale(),t.yaxis.isPtWithinRange=function(){return!0};var b=t.yaxis.domain[0],w=t.aaxis=B6({},e.aaxis,{range:[c,f-v-d],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[b,b+_*nv],anchor:"free",position:0,_id:"y",_length:m});Q0(w,t.graphDiv._fullLayout),w.setScale();var k=t.baxis=B6({},e.baxis,{range:[f-c-d,v],side:"bottom",domain:t.xaxis.domain,anchor:"free",position:0,_id:"x",_length:m});Q0(k,t.graphDiv._fullLayout),k.setScale();var M=t.caxis=B6({},e.caxis,{range:[f-c-v,d],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[b,b+_*nv],anchor:"free",position:0,_id:"y",_length:m});Q0(M,t.graphDiv._fullLayout),M.setScale();var q="M"+p+","+(y+x)+"h"+m+"l-"+m/2+",-"+x+"Z";t.clipDef.select("path").attr("d",q),t.layers.plotbg.select("path").attr("d",q);var E="M0,"+x+"h"+m+"l-"+m/2+",-"+x+"Z";t.clipDefRelative.select("path").attr("d",E);var D=Ko(p,y);t.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",D),t.clipDefRelative.select("path").attr("transform",null);var P=Ko(p-k._offset,y+x);t.layers.baxis.attr("transform",P),t.layers.bgrid.attr("transform",P);var R=Ko(p+m/2,y)+"rotate(30)"+Ko(0,-w._offset);t.layers.aaxis.attr("transform",R),t.layers.agrid.attr("transform",R);var z=Ko(p+m/2,y)+"rotate(-30)"+Ko(0,-M._offset);t.layers.caxis.attr("transform",z),t.layers.cgrid.attr("transform",z),t.drawAxes(!0),t.layers.aline.select("path").attr("d",w.showline?"M"+p+","+(y+x)+"l"+m/2+",-"+x:"M0,0").call(iv.stroke,w.linecolor||"#000").style("stroke-width",(w.linewidth||0)+"px"),t.layers.bline.select("path").attr("d",k.showline?"M"+p+","+(y+x)+"h"+m:"M0,0").call(iv.stroke,k.linecolor||"#000").style("stroke-width",(k.linewidth||0)+"px"),t.layers.cline.select("path").attr("d",M.showline?"M"+(p+m/2)+","+y+"l"+m/2+","+x:"M0,0").call(iv.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),t.graphDiv._context.staticPlot||t.initInteractions(),Ug.setClipUrl(t.layers.frontplot,t._hasClipOnAxisFalse?null:t.clipId,t.graphDiv)};Qo.drawAxes=function(e){var r=this,t=r.graphDiv,a=r.id.slice(7)+"title",n=r.layers,i=r.aaxis,o=r.baxis,l=r.caxis;if(r.drawAx(i),r.drawAx(o),r.drawAx(l),e){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(l.showticklabels?l.tickfont.size*.75:0)+(l.ticks==="outside"?l.ticklen*.87:0)),u=(o.showticklabels?o.tickfont.size:0)+(o.ticks==="outside"?o.ticklen:0)+3;n["a-title"]=H6.draw(t,"a"+a,{propContainer:i,propName:r.id+".aaxis.title.text",placeholder:Hg(t,"Click to enter Component A title"),attributes:{x:r.x0+r.w/2,y:r.y0-i.title.font.size/3-s,"text-anchor":"middle"}}),n["b-title"]=H6.draw(t,"b"+a,{propContainer:o,propName:r.id+".baxis.title.text",placeholder:Hg(t,"Click to enter Component B title"),attributes:{x:r.x0-u,y:r.y0+r.h+o.title.font.size*.83+u,"text-anchor":"middle"}}),n["c-title"]=H6.draw(t,"c"+a,{propContainer:l,propName:r.id+".caxis.title.text",placeholder:Hg(t,"Click to enter Component C title"),attributes:{x:r.x0+r.w+u,y:r.y0+r.h+l.title.font.size*.83+u,"text-anchor":"middle"}})}};Qo.drawAx=function(e){var r=this,t=r.graphDiv,a=e._name,n=a.charAt(0),i=e._id,o=r.layers[a],l=30,s=n+"tickLayout",u=C6e(e);r[s]!==u&&(o.selectAll("."+i+"tick").remove(),r[s]=u),e.setScale();var f=Ss.calcTicks(e),c=Ss.clipEnds(e,f),v=Ss.makeTransTickFn(e),d=Ss.getTickSigns(e)[2],p=Dl.deg2rad(l),y=d*(e.linewidth||1)/2,m=d*e.ticklen,x=r.w,T=r.h,_=n==="b"?"M0,"+y+"l"+Math.sin(p)*m+","+Math.cos(p)*m:"M"+y+",0l"+Math.cos(p)*m+","+-Math.sin(p)*m,b={a:"M0,0l"+T+",-"+x/2,b:"M0,0l-"+x/2+",-"+T,c:"M0,0l-"+T+","+x/2}[n];Ss.drawTicks(t,e,{vals:e.ticks==="inside"?c:f,layer:o,path:_,transFn:v,crisp:!1}),Ss.drawGrid(t,e,{vals:c,layer:r.layers[n+"grid"],path:b,transFn:v,crisp:!1}),Ss.drawLabels(t,e,{vals:f,layer:o,transFn:v,labelFns:Ss.makeLabelFns(e,0,l)})};function C6e(e){return e.ticks+String(e.ticklen)+String(e.showticklabels)}var Ca=DZ.MINZOOM/2+.87,E6e="m-0.87,.5h"+Ca+"v3h-"+(Ca+5.2)+"l"+(Ca/2+2.6)+",-"+(Ca*.87+4.5)+"l2.6,1.5l-"+Ca/2+","+Ca*.87+"Z",D6e="m0.87,.5h-"+Ca+"v3h"+(Ca+5.2)+"l-"+(Ca/2+2.6)+",-"+(Ca*.87+4.5)+"l-2.6,1.5l"+Ca/2+","+Ca*.87+"Z",R6e="m0,1l"+Ca/2+","+Ca*.87+"l2.6,-1.5l-"+(Ca/2+2.6)+",-"+(Ca*.87+4.5)+"l-"+(Ca/2+2.6)+","+(Ca*.87+4.5)+"l2.6,1.5l"+Ca/2+",-"+Ca*.87+"Z",P6e="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",qZ=!0;Qo.clearOutline=function(){L6e(this.dragOptions),q6e(this.dragOptions.gd)};Qo.initInteractions=function(){var e=this,r=e.layers.plotbg.select("path").node(),t=e.graphDiv,a=t._fullLayout._zoomlayer,n,i;this.dragOptions={element:r,gd:t,plotinfo:{id:e.id,domain:t._fullLayout[e.id].domain,xaxis:e.xaxis,yaxis:e.yaxis},subplot:e.id,prepFn:function(P,R,z){e.dragOptions.xaxes=[e.xaxis],e.dragOptions.yaxes=[e.yaxis],n=t._fullLayout._invScaleX,i=t._fullLayout._invScaleY;var I=e.dragOptions.dragmode=t._fullLayout.dragmode;SZ(I)?e.dragOptions.minDrag=1:e.dragOptions.minDrag=void 0,I==="zoom"?(e.dragOptions.moveFn=k,e.dragOptions.clickFn=x,e.dragOptions.doneFn=M,T(P,R,z)):I==="pan"?(e.dragOptions.moveFn=E,e.dragOptions.clickFn=x,e.dragOptions.doneFn=D,q(),e.clearOutline(t)):(M6e(I)||SZ(I))&&k6e(P,R,z,e.dragOptions,I)}};var o,l,s,u,f,c,v,d,p,y;function m(P){var R={};return R[e.id+".aaxis.min"]=P.a,R[e.id+".baxis.min"]=P.b,R[e.id+".caxis.min"]=P.c,R}function x(P,R){var z=t._fullLayout.clickmode;LZ(t),P===2&&(t.emit("plotly_doubleclick",null),O6.call("_guiRelayout",t,m({a:0,b:0,c:0}))),z.indexOf("select")>-1&&P===1&&S6e(R,t,[e.xaxis],[e.yaxis],e.id,e.dragOptions),z.indexOf("event")>-1&&kZ.click(t,R,e.id)}function T(P,R,z){var I=r.getBoundingClientRect();o=R-I.left,l=z-I.top,t._fullLayout._calcInverseTransform(t);var B=t._fullLayout._invTransform,G=Dl.apply3DTransform(B)(o,l);o=G[0],l=G[1],s={a:e.aaxis.range[0],b:e.baxis.range[1],c:e.caxis.range[1]},f=s,u=e.aaxis.range[1]-s.a,c=T6e(e.graphDiv._fullLayout[e.id].bgcolor).getLuminance(),v="M0,"+e.h+"L"+e.w/2+", 0L"+e.w+","+e.h+"Z",d=!1,p=a.append("path").attr("class","zoombox").attr("transform",Ko(e.x0,e.y0)).style({fill:c>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),y=a.append("path").attr("class","zoombox-corners").attr("transform",Ko(e.x0,e.y0)).style({fill:iv.background,stroke:iv.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),e.clearOutline(t)}function _(P,R){return 1-R/e.h}function b(P,R){return 1-(P+(e.h-R)/Math.sqrt(3))/e.w}function w(P,R){return(P-(e.h-R)/Math.sqrt(3))/e.w}function k(P,R){var z=o+P*n,I=l+R*i,B=Math.max(0,Math.min(1,_(o,l),_(z,I))),G=Math.max(0,Math.min(1,b(o,l),b(z,I))),Y=Math.max(0,Math.min(1,w(o,l),w(z,I))),V=(B/2+Y)*e.w,H=(1-B/2-G)*e.w,X=(V+H)/2,j=H-V,ee=(1-B)*e.h,fe=ee-j/nv;j.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),y.transition().style("opacity",1).duration(200),d=!0),t.emit("plotly_relayouting",m(f))}function M(){LZ(t),f!==s&&(O6.call("_guiRelayout",t,m(f)),qZ&&t.data&&t._context.showTips&&(Dl.notifier(Hg(t,"Double-click to zoom back out"),"long",t),qZ=!1))}function q(){s={a:e.aaxis.range[0],b:e.baxis.range[1],c:e.caxis.range[1]},f=s}function E(P,R){var z=P/e.xaxis._m,I=R/e.yaxis._m;f={a:s.a-I,b:s.b+(z+I)/2,c:s.c-(z-I)/2};var B=[f.a,f.b,f.c].sort(Dl.sorterAsc),G={a:B.indexOf(f.a),b:B.indexOf(f.b),c:B.indexOf(f.c)};B[0]<0&&(B[1]+B[0]/2<0?(B[2]+=B[0]+B[1],B[0]=B[1]=0):(B[2]+=B[0]/2,B[1]+=B[0]/2,B[0]=0),f={a:B[G.a],b:B[G.b],c:B[G.c]},R=(s.a-f.a)*e.yaxis._m,P=(s.c-f.c-s.b+f.b)*e.xaxis._m);var Y=Ko(e.x0+P,e.y0+R);e.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Y);var V=Ko(-P,-R);e.clipDefRelative.select("path").attr("transform",V),e.aaxis.range=[f.a,e.sum-f.b-f.c],e.baxis.range=[e.sum-f.a-f.c,f.b],e.caxis.range=[e.sum-f.a-f.b,f.c],e.drawAxes(!1),e._hasClipOnAxisFalse&&e.plotContainer.select(".scatterlayer").selectAll(".trace").call(Ug.hideOutsideRangePoints,e),t.emit("plotly_relayouting",m(f))}function D(){O6.call("_guiRelayout",t,m(f))}r.onmousemove=function(P){kZ.hover(t,P,e.id),t._fullLayout._lasthover=r,t._fullLayout._hoversubplot=e.id},r.onmouseout=function(P){t._dragging||MZ.unhover(t,P)},MZ.init(this.dragOptions)};function LZ(e){CZ.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}});var V6=N((fOe,NZ)=>{"use strict";var F6e=fi(),N6e=Uc().attributes,it=pi(),I6e=eo().overrideAll,U6=bt().extendFlat,G6={title:{text:it.title.text,font:it.title.font},color:it.color,tickmode:it.minor.tickmode,nticks:U6({},it.nticks,{dflt:6,min:1}),tick0:it.tick0,dtick:it.dtick,tickvals:it.tickvals,ticktext:it.ticktext,ticks:it.ticks,ticklen:it.ticklen,tickwidth:it.tickwidth,tickcolor:it.tickcolor,ticklabelstep:it.ticklabelstep,showticklabels:it.showticklabels,labelalias:it.labelalias,showtickprefix:it.showtickprefix,tickprefix:it.tickprefix,showticksuffix:it.showticksuffix,ticksuffix:it.ticksuffix,showexponent:it.showexponent,exponentformat:it.exponentformat,minexponent:it.minexponent,separatethousands:it.separatethousands,tickfont:it.tickfont,tickangle:it.tickangle,tickformat:it.tickformat,tickformatstops:it.tickformatstops,hoverformat:it.hoverformat,showline:U6({},it.showline,{dflt:!0}),linecolor:it.linecolor,linewidth:it.linewidth,showgrid:U6({},it.showgrid,{dflt:!0}),gridcolor:it.gridcolor,gridwidth:it.gridwidth,griddash:it.griddash,layer:it.layer,min:{valType:"number",dflt:0,min:0}},Gg=NZ.exports=I6e({domain:N6e({name:"ternary"}),bgcolor:{valType:"color",dflt:F6e.background},sum:{valType:"number",dflt:1,min:0},aaxis:G6,baxis:G6,caxis:G6},"plot","from-root");Gg.uirevision={valType:"any",editType:"none"};Gg.aaxis.uirevision=Gg.baxis.uirevision=Gg.caxis.uirevision={valType:"any",editType:"none"}});var zZ=N((cOe,IZ)=>{"use strict";var z6e=Ee(),O6e=wt(),B6e=Uc().defaults;IZ.exports=function(r,t,a,n){var i=n.type,o=n.attributes,l=n.handleDefaults,s=n.partition||"x",u=t._subplots[i],f=u.length,c=f&&u[0].replace(/\d+$/,""),v,d;function p(T,_){return z6e.coerce(v,d,o,T,_)}for(var y=0;y{"use strict";var H6e=Tr(),U6e=wt(),Vg=Ee(),G6e=zZ(),V6e=g1(),Y6e=b1(),W6e=y1(),j6e=p1(),Z6e=M4(),BZ=V6(),OZ=["aaxis","baxis","caxis"];HZ.exports=function(r,t,a){G6e(r,t,a,{type:"ternary",attributes:BZ,handleDefaults:X6e,font:t.font,paper_bgcolor:t.paper_bgcolor})};function X6e(e,r,t,a){var n=t("bgcolor"),i=t("sum");a.bgColor=H6e.combine(n,a.paper_bgcolor);for(var o,l,s,u=0;u=i&&(f.min=0,c.min=0,v.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function J6e(e,r,t,a){var n=BZ[r._name];function i(d,p){return Vg.coerce(e,r,n,d,p)}i("uirevision",a.uirevision),r.type="linear";var o=i("color"),l=o!==n.color.dflt?o:t.font.color,s=r._name,u=s.charAt(0).toUpperCase(),f="Component "+u,c=i("title.text",f);r._hovertitle=c===f?c:u,Vg.coerceFont(i,"title.font",t.font,{overrideDflt:{size:Vg.bigFont(t.font.size),color:l}}),i("min"),j6e(e,r,i,"linear"),Y6e(e,r,i,"linear"),V6e(e,r,i,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),W6e(e,r,i,{outerTicks:!0});var v=i("showticklabels");v&&(Vg.coerceFont(i,"tickfont",t.font,{overrideDflt:{color:l}}),i("tickangle"),i("tickformat")),Z6e(e,r,i,{dfltColor:o,bgColor:t.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:n}),i("hoverformat"),i("layer")}});var GZ=N(Oi=>{"use strict";var $6e=FZ(),K6e=l1().getSubplotCalcData,Q6e=Ee().counterRegex,ov="ternary";Oi.name=ov;var e7e=Oi.attr="subplot";Oi.idRoot=ov;Oi.idRegex=Oi.attrRegex=Q6e(ov);var r7e=Oi.attributes={};r7e[e7e]={valType:"subplotid",dflt:"ternary",editType:"calc"};Oi.layoutAttributes=V6();Oi.supplyLayoutDefaults=UZ();Oi.plot=function(r){for(var t=r._fullLayout,a=r.calcdata,n=t._subplots[ov],i=0;i{"use strict";VZ.exports={attributes:N6(),supplyDefaults:vZ(),colorbar:_0(),formatLabels:dZ(),calc:gZ(),plot:xZ(),style:Nu().style,styleOnSelect:Nu().styleOnSelect,hoverPoints:wZ(),selectPoints:T4(),eventData:AZ(),moduleType:"trace",name:"scatterternary",basePlotModule:GZ(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}});var jZ=N((pOe,WZ)=>{"use strict";WZ.exports=YZ()});var Y6=N((yOe,XZ)=>{"use strict";var da=vg(),lv=bt().extendFlat,ZZ=no().axisHoverFormat;XZ.exports={y:da.y,x:da.x,x0:da.x0,y0:da.y0,xhoverformat:ZZ("x"),yhoverformat:ZZ("y"),name:lv({},da.name,{}),orientation:lv({},da.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:da.fillcolor,points:lv({},da.boxpoints,{}),jitter:lv({},da.jitter,{}),pointpos:lv({},da.pointpos,{}),width:lv({},da.width,{}),marker:da.marker,text:da.text,hovertext:da.hovertext,hovertemplate:da.hovertemplate,hovertemplatefallback:da.hovertemplatefallback,quartilemethod:da.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:da.offsetgroup,alignmentgroup:da.alignmentgroup,selected:da.selected,unselected:da.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:da.zorder}});var Z6=N((mOe,JZ)=>{"use strict";var W6=hg(),j6=Ee().extendFlat;JZ.exports={violinmode:j6({},W6.boxmode,{}),violingap:j6({},W6.boxgap,{}),violingroupgap:j6({},W6.boxgroupgap,{})}});var rX=N((gOe,eX)=>{"use strict";var $Z=Ee(),t7e=Tr(),KZ=H0(),QZ=Y6();eX.exports=function(r,t,a,n){function i(w,k){return $Z.coerce(r,t,QZ,w,k)}function o(w,k){return $Z.coerce2(r,t,QZ,w,k)}if(KZ.handleSampleDefaults(r,t,i,n),t.visible!==!1){i("bandwidth"),i("side");var l=i("width");l||(i("scalegroup",t.name),i("scalemode"));var s=i("span"),u;Array.isArray(s)&&(u="manual"),i("spanmode",u);var f=i("line.color",(r.marker||{}).color||a),c=i("line.width"),v=i("fillcolor",t7e.addOpacity(t.line.color,.5));KZ.handlePointsDefaults(r,t,i,{prefix:""});var d=o("box.width"),p=o("box.fillcolor",v),y=o("box.line.color",f),m=o("box.line.width",c),x=i("box.visible",!!(d||p||y||m));x||(t.box={visible:!1});var T=o("meanline.color",f),_=o("meanline.width",c),b=i("meanline.visible",!!(T||_));b||(t.meanline={visible:!1}),i("quartilemethod"),i("zorder")}}});var aX=N((bOe,tX)=>{"use strict";var a7e=Ee(),n7e=Z6(),i7e=Nw();tX.exports=function(r,t,a){function n(i,o){return a7e.coerce(r,t,n7e,i,o)}i7e._supply(r,t,a,n,"violin")}});var Yg=N(Ku=>{"use strict";var o7e=Ee(),l7e={gaussian:function(e){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*e*e)}};Ku.makeKDE=function(e,r,t){var a=t.length,n=l7e.gaussian,i=e.bandwidth,o=1/(a*i);return function(l){for(var s=0,u=0;u{"use strict";var X6=Ee(),J6=zr(),s7e=Ow(),nX=Yg(),u7e=Ft().BADNUM;iX.exports=function(r,t){var a=s7e(r,t);if(a[0].t.empty)return a;for(var n=r._fullLayout,i=J6.getFromId(r,t[t.orientation==="h"?"xaxis":"yaxis"]),o=1/0,l=-1/0,s=0,u=0,f=0;f{"use strict";var h7e=Bw().setPositionOffset,lX=["v","h"];sX.exports=function(r,t){for(var a=r.calcdata,n=t.xaxis,i=t.yaxis,o=0;o{"use strict";var $6=Sr(),K6=Ee(),d7e=Yr(),Q6=Hw(),p7e=p4(),y7e=Yg();fX.exports=function(r,t,a,n){var i=r._context.staticPlot,o=r._fullLayout,l=t.xaxis,s=t.yaxis;function u(f,c){var v=p7e(f,{xaxis:l,yaxis:s,trace:c,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return d7e.smoothopen(v[0],1)}K6.makeTraceGroups(n,a,"trace violins").each(function(f){var c=$6.select(this),v=f[0],d=v.t,p=v.trace;if(p.visible!==!0||d.empty){c.remove();return}var y=d.bPos,m=d.bdPos,x=t[d.valLetter+"axis"],T=t[d.posLetter+"axis"],_=p.side==="both",b=_||p.side==="positive",w=_||p.side==="negative",k=c.selectAll("path.violin").data(K6.identity);k.enter().append("path").style("vector-effect",i?"none":"non-scaling-stroke").attr("class","violin"),k.exit().remove(),k.each(function(I){var B=$6.select(this),G=I.density,Y=G.length,V=T.c2l(I.pos+y,!0),H=T.l2p(V),X;if(p.width)X=d.maxKDE/m;else{var j=o._violinScaleGroupStats[p.scalegroup];X=p.scalemode==="count"?j.maxKDE/m*(j.maxCount/I.pts.length):j.maxKDE/m}var ee,fe,ie,ue,K,we,se;if(b){for(we=new Array(Y),ue=0;ue{"use strict";var vX=Sr(),sv=Tr(),m7e=Nu().stylePoints;hX.exports=function(r){var t=vX.select(r).selectAll("g.trace.violins");t.style("opacity",function(a){return a[0].trace.opacity}),t.each(function(a){var n=a[0].trace,i=vX.select(this),o=n.box||{},l=o.line||{},s=n.meanline||{},u=s.width;i.selectAll("path.violin").style("stroke-width",n.line.width+"px").call(sv.stroke,n.line.color).call(sv.fill,n.fillcolor),i.selectAll("path.box").style("stroke-width",l.width+"px").call(sv.stroke,l.color).call(sv.fill,o.fillcolor);var f={"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};i.selectAll("path.mean").style(f).call(sv.stroke,s.color),i.selectAll("path.meanline").style(f).call(sv.stroke,s.color),m7e(i,n,r)})}});var gX=N((MOe,mX)=>{"use strict";var g7e=Tr(),e7=Ee(),b7e=zr(),pX=jw(),yX=Yg();mX.exports=function(r,t,a,n,i){i||(i={});var o=i.hoverLayer,l=r.cd,s=l[0].trace,u=s.hoveron,f=u.indexOf("violins")!==-1,c=u.indexOf("kde")!==-1,v=[],d,p;if(f||c){var y=pX.hoverOnBoxes(r,t,a,n);if(c&&y.length>0){var m=r.xa,x=r.ya,T,_,b,w,k;s.orientation==="h"?(k=t,T="y",b=x,_="x",w=m):(k=a,T="x",b=m,_="y",w=x);var M=l[r.index];if(k>=M.span[0]&&k<=M.span[1]){var q=e7.extendFlat({},r),E=w.c2p(k,!0),D=yX.getKdeValue(M,s,k),P=yX.getPositionOnKdePath(M,s,E),R=b._offset,z=b._length;q[T+"0"]=P[0],q[T+"1"]=P[1],q[_+"0"]=q[_+"1"]=E,q[_+"Label"]=_+": "+b7e.hoverLabelText(w,k,s[_+"hoverformat"])+", "+l[0].t.labels.kde+" "+D.toFixed(3);for(var I=0,B=0;B{"use strict";bX.exports={attributes:Y6(),layoutAttributes:Z6(),supplyDefaults:rX(),crossTraceDefaults:H0().crossTraceDefaults,supplyLayoutDefaults:aX(),calc:oX(),crossTraceCalc:uX(),plot:cX(),style:dX(),styleOnSelect:Nu().styleOnSelect,hoverPoints:gX(),selectPoints:Zw(),moduleType:"trace",name:"violin",basePlotModule:Ei(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}});var wX=N((SOe,_X)=>{"use strict";_X.exports=xX()});var uv=N((qOe,TX)=>{"use strict";TX.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(e){return e.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(e){var r=e.slice(0,3);return r[1]=r[1]+"%",r[2]=r[2]+"%",r},suffix:["\xB0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(e){var r=e.slice(0,4);return r[1]=r[1]+"%",r[2]=r[2]+"%",r},suffix:["\xB0","%","%",""]}}}});var r7=N((LOe,MX)=>{"use strict";var x7e=gn(),_7e=Ai().zorder,{hovertemplateAttrs:w7e,templatefallbackAttrs:T7e}=Wn(),AX=bt().extendFlat,A7e=uv().colormodel,rd=["rgb","rgba","rgba256","hsl","hsla"],M7e=[],k7e=[];for(fv=0;fv{"use strict";var S7e=Ee(),q7e=r7(),kX=uv(),L7e=Tl().IMAGE_URL_PREFIX;SX.exports=function(r,t){function a(o,l){return S7e.coerce(r,t,q7e,o,l)}a("source"),t.source&&!t.source.match(L7e)&&delete t.source,t._hasSource=!!t.source;var n=a("z");if(t._hasZ=!(n===void 0||!n.length||!n[0]||!n[0].length),!t._hasZ&&!t._hasSource){t.visible=!1;return}a("x0"),a("y0"),a("dx"),a("dy");var i;t._hasZ?(a("colormodel","rgb"),i=kX.colormodel[t.colormodel],a("zmin",i.zminDflt||i.min),a("zmax",i.zmaxDflt||i.max)):t._hasSource&&(t.colormodel="rgba256",i=kX.colormodel[t.colormodel],t.zmin=i.zminDflt,t.zmax=i.zmaxDflt),a("zsmooth"),a("text"),a("hovertext"),a("hovertemplate"),a("hovertemplatefallback"),t._length=null,a("zorder")}});var Rl=N((EOe,t7)=>{typeof Object.create=="function"?t7.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t7.exports=function(r,t){if(t){r.super_=t;var a=function(){};a.prototype=t.prototype,r.prototype=new a,r.prototype.constructor=r}}});var a7=N((DOe,LX)=>{LX.exports=su().EventEmitter});var DX=N(Wg=>{"use strict";Wg.byteLength=E7e;Wg.toByteArray=R7e;Wg.fromByteArray=N7e;var el=[],Bi=[],C7e=typeof Uint8Array!="undefined"?Uint8Array:Array,n7="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Qu=0,CX=n7.length;Qu0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var a=t===r?0:4-t%4;return[t,a]}function E7e(e){var r=EX(e),t=r[0],a=r[1];return(t+a)*3/4-a}function D7e(e,r,t){return(r+t)*3/4-t}function R7e(e){var r,t=EX(e),a=t[0],n=t[1],i=new C7e(D7e(e,a,n)),o=0,l=n>0?a-4:a,s;for(s=0;s>16&255,i[o++]=r>>8&255,i[o++]=r&255;return n===2&&(r=Bi[e.charCodeAt(s)]<<2|Bi[e.charCodeAt(s+1)]>>4,i[o++]=r&255),n===1&&(r=Bi[e.charCodeAt(s)]<<10|Bi[e.charCodeAt(s+1)]<<4|Bi[e.charCodeAt(s+2)]>>2,i[o++]=r>>8&255,i[o++]=r&255),i}function P7e(e){return el[e>>18&63]+el[e>>12&63]+el[e>>6&63]+el[e&63]}function F7e(e,r,t){for(var a,n=[],i=r;il?l:o+i));return a===1?(r=e[t-1],n.push(el[r>>2]+el[r<<4&63]+"==")):a===2&&(r=(e[t-2]<<8)+e[t-1],n.push(el[r>>10]+el[r>>4&63]+el[r<<2&63]+"=")),n.join("")}});var RX=N(i7=>{i7.read=function(e,r,t,a,n){var i,o,l=n*8-a-1,s=(1<>1,f=-7,c=t?n-1:0,v=t?-1:1,d=e[r+c];for(c+=v,i=d&(1<<-f)-1,d>>=-f,f+=l;f>0;i=i*256+e[r+c],c+=v,f-=8);for(o=i&(1<<-f)-1,i>>=-f,f+=a;f>0;o=o*256+e[r+c],c+=v,f-=8);if(i===0)i=1-u;else{if(i===s)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,a),i=i-u}return(d?-1:1)*o*Math.pow(2,i-a)};i7.write=function(e,r,t,a,n,i){var o,l,s,u=i*8-n-1,f=(1<>1,v=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=a?0:i-1,p=a?1:-1,y=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-o))<1&&(o--,s*=2),o+c>=1?r+=v/s:r+=v*Math.pow(2,1-c),r*s>=2&&(o++,s/=2),o+c>=f?(l=0,o=f):o+c>=1?(l=(r*s-1)*Math.pow(2,n),o=o+c):(l=r*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;e[t+d]=l&255,d+=p,l/=256,n-=8);for(o=o<0;e[t+d]=o&255,d+=p,o/=256,u-=8);e[t+d-p]|=y*128}});var pv=N(dv=>{"use strict";var o7=DX(),vv=RX(),PX=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;dv.Buffer=je;dv.SlowBuffer=U7e;dv.INSPECT_MAX_BYTES=50;var jg=2147483647;dv.kMaxLength=jg;je.TYPED_ARRAY_SUPPORT=I7e();!je.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function I7e(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch(e){return!1}}Object.defineProperty(je.prototype,"parent",{enumerable:!0,get:function(){if(je.isBuffer(this))return this.buffer}});Object.defineProperty(je.prototype,"offset",{enumerable:!0,get:function(){if(je.isBuffer(this))return this.byteOffset}});function Pl(e){if(e>jg)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,je.prototype),r}function je(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f7(e)}return zX(e,r,t)}je.poolSize=8192;function zX(e,r,t){if(typeof e=="string")return O7e(e,r);if(ArrayBuffer.isView(e))return B7e(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(rl(e,ArrayBuffer)||e&&rl(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(rl(e,SharedArrayBuffer)||e&&rl(e.buffer,SharedArrayBuffer)))return s7(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let a=e.valueOf&&e.valueOf();if(a!=null&&a!==e)return je.from(a,r,t);let n=H7e(e);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return je.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}je.from=function(e,r,t){return zX(e,r,t)};Object.setPrototypeOf(je.prototype,Uint8Array.prototype);Object.setPrototypeOf(je,Uint8Array);function OX(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function z7e(e,r,t){return OX(e),e<=0?Pl(e):r!==void 0?typeof t=="string"?Pl(e).fill(r,t):Pl(e).fill(r):Pl(e)}je.alloc=function(e,r,t){return z7e(e,r,t)};function f7(e){return OX(e),Pl(e<0?0:c7(e)|0)}je.allocUnsafe=function(e){return f7(e)};je.allocUnsafeSlow=function(e){return f7(e)};function O7e(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!je.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=BX(e,r)|0,a=Pl(t),n=a.write(e,r);return n!==t&&(a=a.slice(0,n)),a}function l7(e){let r=e.length<0?0:c7(e.length)|0,t=Pl(r);for(let a=0;a=jg)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+jg.toString(16)+" bytes");return e|0}function U7e(e){return+e!=e&&(e=0),je.alloc(+e)}je.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==je.prototype};je.compare=function(r,t){if(rl(r,Uint8Array)&&(r=je.from(r,r.offset,r.byteLength)),rl(t,Uint8Array)&&(t=je.from(t,t.offset,t.byteLength)),!je.isBuffer(r)||!je.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let a=r.length,n=t.length;for(let i=0,o=Math.min(a,n);in.length?(je.isBuffer(o)||(o=je.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(je.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function BX(e,r){if(je.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||rl(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let t=e.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&t===0)return 0;let n=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return u7(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return XX(e).length;default:if(n)return a?-1:u7(e).length;r=(""+r).toLowerCase(),n=!0}}je.byteLength=BX;function G7e(e,r,t){let a=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return Q7e(this,r,t);case"utf8":case"utf-8":return UX(this,r,t);case"ascii":return $7e(this,r,t);case"latin1":case"binary":return K7e(this,r,t);case"base64":return X7e(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eTe(this,r,t);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}je.prototype._isBuffer=!0;function ef(e,r,t){let a=e[r];e[r]=e[t],e[t]=a}je.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};PX&&(je.prototype[PX]=je.prototype.inspect);je.prototype.compare=function(r,t,a,n,i){if(rl(r,Uint8Array)&&(r=je.from(r,r.offset,r.byteLength)),!je.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),a===void 0&&(a=r?r.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||a>r.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=a)return 0;if(n>=i)return-1;if(t>=a)return 1;if(t>>>=0,a>>>=0,n>>>=0,i>>>=0,this===r)return 0;let o=i-n,l=a-t,s=Math.min(o,l),u=this.slice(n,i),f=r.slice(t,a);for(let c=0;c2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,h7(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=je.from(r,a)),je.isBuffer(r))return r.length===0?-1:FX(e,r,t,a,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):FX(e,[r],t,a,n);throw new TypeError("val must be string, number or Buffer")}function FX(e,r,t,a,n){let i=1,o=e.length,l=r.length;if(a!==void 0&&(a=String(a).toLowerCase(),a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(e.length<2||r.length<2)return-1;i=2,o/=2,l/=2,t/=2}function s(f,c){return i===1?f[c]:f.readUInt16BE(c*i)}let u;if(n){let f=-1;for(u=t;uo&&(t=o-l),u=t;u>=0;u--){let f=!0;for(let c=0;cn&&(a=n)):a=n;let i=r.length;a>i/2&&(a=i/2);let o;for(o=0;o>>0,isFinite(a)?(a=a>>>0,n===void 0&&(n="utf8")):(n=a,a=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((a===void 0||a>i)&&(a=i),r.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return V7e(this,r,t,a);case"utf8":case"utf-8":return Y7e(this,r,t,a);case"ascii":case"latin1":case"binary":return W7e(this,r,t,a);case"base64":return j7e(this,r,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z7e(this,r,t,a);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};je.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function X7e(e,r,t){return r===0&&t===e.length?o7.fromByteArray(e):o7.fromByteArray(e.slice(r,t))}function UX(e,r,t){t=Math.min(e.length,t);let a=[],n=r;for(;n239?4:i>223?3:i>191?2:1;if(n+l<=t){let s,u,f,c;switch(l){case 1:i<128&&(o=i);break;case 2:s=e[n+1],(s&192)===128&&(c=(i&31)<<6|s&63,c>127&&(o=c));break;case 3:s=e[n+1],u=e[n+2],(s&192)===128&&(u&192)===128&&(c=(i&15)<<12|(s&63)<<6|u&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:s=e[n+1],u=e[n+2],f=e[n+3],(s&192)===128&&(u&192)===128&&(f&192)===128&&(c=(i&15)<<18|(s&63)<<12|(u&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,l=1):o>65535&&(o-=65536,a.push(o>>>10&1023|55296),o=56320|o&1023),a.push(o),n+=l}return J7e(a)}var NX=4096;function J7e(e){let r=e.length;if(r<=NX)return String.fromCharCode.apply(String,e);let t="",a=0;for(;aa)&&(t=a);let n="";for(let i=r;ia&&(r=a),t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a),tt)throw new RangeError("Trying to access beyond buffer length")}je.prototype.readUintLE=je.prototype.readUIntLE=function(r,t,a){r=r>>>0,t=t>>>0,a||Wa(r,t,this.length);let n=this[r],i=1,o=0;for(;++o>>0,t=t>>>0,a||Wa(r,t,this.length);let n=this[r+--t],i=1;for(;t>0&&(i*=256);)n+=this[r+--t]*i;return n};je.prototype.readUint8=je.prototype.readUInt8=function(r,t){return r=r>>>0,t||Wa(r,1,this.length),this[r]};je.prototype.readUint16LE=je.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||Wa(r,2,this.length),this[r]|this[r+1]<<8};je.prototype.readUint16BE=je.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||Wa(r,2,this.length),this[r]<<8|this[r+1]};je.prototype.readUint32LE=je.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||Wa(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};je.prototype.readUint32BE=je.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||Wa(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};je.prototype.readBigUInt64LE=qs(function(r){r=r>>>0,hv(r,"offset");let t=this[r],a=this[r+7];(t===void 0||a===void 0)&&td(r,this.length-8);let n=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,i=this[++r]+this[++r]*2**8+this[++r]*2**16+a*2**24;return BigInt(n)+(BigInt(i)<>>0,hv(r,"offset");let t=this[r],a=this[r+7];(t===void 0||a===void 0)&&td(r,this.length-8);let n=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],i=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+a;return(BigInt(n)<>>0,t=t>>>0,a||Wa(r,t,this.length);let n=this[r],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};je.prototype.readIntBE=function(r,t,a){r=r>>>0,t=t>>>0,a||Wa(r,t,this.length);let n=t,i=1,o=this[r+--n];for(;n>0&&(i*=256);)o+=this[r+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};je.prototype.readInt8=function(r,t){return r=r>>>0,t||Wa(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};je.prototype.readInt16LE=function(r,t){r=r>>>0,t||Wa(r,2,this.length);let a=this[r]|this[r+1]<<8;return a&32768?a|4294901760:a};je.prototype.readInt16BE=function(r,t){r=r>>>0,t||Wa(r,2,this.length);let a=this[r+1]|this[r]<<8;return a&32768?a|4294901760:a};je.prototype.readInt32LE=function(r,t){return r=r>>>0,t||Wa(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};je.prototype.readInt32BE=function(r,t){return r=r>>>0,t||Wa(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};je.prototype.readBigInt64LE=qs(function(r){r=r>>>0,hv(r,"offset");let t=this[r],a=this[r+7];(t===void 0||a===void 0)&&td(r,this.length-8);let n=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(a<<24);return(BigInt(n)<>>0,hv(r,"offset");let t=this[r],a=this[r+7];(t===void 0||a===void 0)&&td(r,this.length-8);let n=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(n)<>>0,t||Wa(r,4,this.length),vv.read(this,r,!0,23,4)};je.prototype.readFloatBE=function(r,t){return r=r>>>0,t||Wa(r,4,this.length),vv.read(this,r,!1,23,4)};je.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||Wa(r,8,this.length),vv.read(this,r,!0,52,8)};je.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||Wa(r,8,this.length),vv.read(this,r,!1,52,8)};function Un(e,r,t,a,n,i){if(!je.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||re.length)throw new RangeError("Index out of range")}je.prototype.writeUintLE=je.prototype.writeUIntLE=function(r,t,a,n){if(r=+r,t=t>>>0,a=a>>>0,!n){let l=Math.pow(2,8*a)-1;Un(this,r,t,a,l,0)}let i=1,o=0;for(this[t]=r&255;++o>>0,a=a>>>0,!n){let l=Math.pow(2,8*a)-1;Un(this,r,t,a,l,0)}let i=a-1,o=1;for(this[t+i]=r&255;--i>=0&&(o*=256);)this[t+i]=r/o&255;return t+a};je.prototype.writeUint8=je.prototype.writeUInt8=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,1,255,0),this[t]=r&255,t+1};je.prototype.writeUint16LE=je.prototype.writeUInt16LE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};je.prototype.writeUint16BE=je.prototype.writeUInt16BE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};je.prototype.writeUint32LE=je.prototype.writeUInt32LE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};je.prototype.writeUint32BE=je.prototype.writeUInt32BE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function GX(e,r,t,a,n){ZX(r,a,n,e,t,7);let i=Number(r&BigInt(4294967295));e[t++]=i,i=i>>8,e[t++]=i,i=i>>8,e[t++]=i,i=i>>8,e[t++]=i;let o=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,t}function VX(e,r,t,a,n){ZX(r,a,n,e,t,7);let i=Number(r&BigInt(4294967295));e[t+7]=i,i=i>>8,e[t+6]=i,i=i>>8,e[t+5]=i,i=i>>8,e[t+4]=i;let o=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=o,o=o>>8,e[t+2]=o,o=o>>8,e[t+1]=o,o=o>>8,e[t]=o,t+8}je.prototype.writeBigUInt64LE=qs(function(r,t=0){return GX(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});je.prototype.writeBigUInt64BE=qs(function(r,t=0){return VX(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});je.prototype.writeIntLE=function(r,t,a,n){if(r=+r,t=t>>>0,!n){let s=Math.pow(2,8*a-1);Un(this,r,t,a,s-1,-s)}let i=0,o=1,l=0;for(this[t]=r&255;++i>0)-l&255;return t+a};je.prototype.writeIntBE=function(r,t,a,n){if(r=+r,t=t>>>0,!n){let s=Math.pow(2,8*a-1);Un(this,r,t,a,s-1,-s)}let i=a-1,o=1,l=0;for(this[t+i]=r&255;--i>=0&&(o*=256);)r<0&&l===0&&this[t+i+1]!==0&&(l=1),this[t+i]=(r/o>>0)-l&255;return t+a};je.prototype.writeInt8=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};je.prototype.writeInt16LE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};je.prototype.writeInt16BE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};je.prototype.writeInt32LE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};je.prototype.writeInt32BE=function(r,t,a){return r=+r,t=t>>>0,a||Un(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};je.prototype.writeBigInt64LE=qs(function(r,t=0){return GX(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});je.prototype.writeBigInt64BE=qs(function(r,t=0){return VX(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function YX(e,r,t,a,n,i){if(t+a>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function WX(e,r,t,a,n){return r=+r,t=t>>>0,n||YX(e,r,t,4,34028234663852886e22,-34028234663852886e22),vv.write(e,r,t,a,23,4),t+4}je.prototype.writeFloatLE=function(r,t,a){return WX(this,r,t,!0,a)};je.prototype.writeFloatBE=function(r,t,a){return WX(this,r,t,!1,a)};function jX(e,r,t,a,n){return r=+r,t=t>>>0,n||YX(e,r,t,8,17976931348623157e292,-17976931348623157e292),vv.write(e,r,t,a,52,8),t+8}je.prototype.writeDoubleLE=function(r,t,a){return jX(this,r,t,!0,a)};je.prototype.writeDoubleBE=function(r,t,a){return jX(this,r,t,!1,a)};je.prototype.copy=function(r,t,a,n){if(!je.isBuffer(r))throw new TypeError("argument should be a Buffer");if(a||(a=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t>>0,a=a===void 0?this.length:a>>>0,r||(r=0);let i;if(typeof r=="number")for(i=t;i2**32?n=IX(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=IX(n)),n+="n"),a+=` It must be ${r}. Received ${n}`,a},RangeError);function IX(e){let r="",t=e.length,a=e[0]==="-"?1:0;for(;t>=a+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function rTe(e,r,t){hv(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&td(r,e.length-(t+1))}function ZX(e,r,t,a,n,i){if(e>t||e3?r===0||r===BigInt(0)?l=`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:l=`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:l=`>= ${r}${o} and <= ${t}${o}`,new cv.ERR_OUT_OF_RANGE("value",l,e)}rTe(a,n,i)}function hv(e,r){if(typeof e!="number")throw new cv.ERR_INVALID_ARG_TYPE(r,"number",e)}function td(e,r,t){throw Math.floor(e)!==e?(hv(e,t),new cv.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new cv.ERR_BUFFER_OUT_OF_BOUNDS:new cv.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var tTe=/[^+/0-9A-Za-z-_]/g;function aTe(e){if(e=e.split("=")[0],e=e.trim().replace(tTe,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function u7(e,r){r=r||1/0;let t,a=e.length,n=null,i=[];for(let o=0;o55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&i.push(239,191,189);continue}else if(o+1===a){(r-=3)>-1&&i.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&i.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&i.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;i.push(t)}else if(t<2048){if((r-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function nTe(e){let r=[];for(let t=0;t>8,n=t%256,i.push(n),i.push(a);return i}function XX(e){return o7.toByteArray(aTe(e))}function Zg(e,r,t,a){let n;for(n=0;n=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function rl(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function h7(e){return e!==e}var oTe=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let a=t*16;for(let n=0;n<16;++n)r[a+n]=e[t]+e[n]}return r}();function qs(e){return typeof BigInt=="undefined"?lTe:e}function lTe(){throw new Error("BigInt not supported")}});var Xg=N((IOe,JX)=>{"use strict";JX.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),a=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var n=42;r[t]=n;for(var i in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var o=Object.getOwnPropertySymbols(r);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(r,t);if(l.value!==n||l.enumerable!==!0)return!1}return!0}});var ad=N((zOe,$X)=>{"use strict";var sTe=Xg();$X.exports=function(){return sTe()&&!!Symbol.toStringTag}});var d7=N((OOe,KX)=>{"use strict";KX.exports=Object});var eJ=N((BOe,QX)=>{"use strict";QX.exports=Error});var tJ=N((HOe,rJ)=>{"use strict";rJ.exports=EvalError});var nJ=N((UOe,aJ)=>{"use strict";aJ.exports=RangeError});var oJ=N((GOe,iJ)=>{"use strict";iJ.exports=ReferenceError});var p7=N((VOe,lJ)=>{"use strict";lJ.exports=SyntaxError});var yv=N((YOe,sJ)=>{"use strict";sJ.exports=TypeError});var fJ=N((WOe,uJ)=>{"use strict";uJ.exports=URIError});var vJ=N((jOe,cJ)=>{"use strict";cJ.exports=Math.abs});var dJ=N((ZOe,hJ)=>{"use strict";hJ.exports=Math.floor});var yJ=N((XOe,pJ)=>{"use strict";pJ.exports=Math.max});var gJ=N((JOe,mJ)=>{"use strict";mJ.exports=Math.min});var xJ=N(($Oe,bJ)=>{"use strict";bJ.exports=Math.pow});var wJ=N((KOe,_J)=>{"use strict";_J.exports=Math.round});var AJ=N((QOe,TJ)=>{"use strict";TJ.exports=Number.isNaN||function(r){return r!==r}});var kJ=N((eBe,MJ)=>{"use strict";var uTe=AJ();MJ.exports=function(r){return uTe(r)||r===0?r:r<0?-1:1}});var qJ=N((rBe,SJ)=>{"use strict";SJ.exports=Object.getOwnPropertyDescriptor});var rf=N((tBe,LJ)=>{"use strict";var Jg=qJ();if(Jg)try{Jg([],"length")}catch(e){Jg=null}LJ.exports=Jg});var nd=N((aBe,CJ)=>{"use strict";var $g=Object.defineProperty||!1;if($g)try{$g({},"a",{value:1})}catch(e){$g=!1}CJ.exports=$g});var RJ=N((nBe,DJ)=>{"use strict";var EJ=typeof Symbol!="undefined"&&Symbol,fTe=Xg();DJ.exports=function(){return typeof EJ!="function"||typeof Symbol!="function"||typeof EJ("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:fTe()}});var y7=N((iBe,PJ)=>{"use strict";PJ.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var m7=N((oBe,FJ)=>{"use strict";var cTe=d7();FJ.exports=cTe.getPrototypeOf||null});var zJ=N((lBe,IJ)=>{"use strict";var vTe="Function.prototype.bind called on incompatible ",hTe=Object.prototype.toString,dTe=Math.max,pTe="[object Function]",NJ=function(r,t){for(var a=[],n=0;n{"use strict";var gTe=zJ();OJ.exports=Function.prototype.bind||gTe});var Kg=N((uBe,BJ)=>{"use strict";BJ.exports=Function.prototype.call});var g7=N((fBe,HJ)=>{"use strict";HJ.exports=Function.prototype.apply});var GJ=N((cBe,UJ)=>{"use strict";UJ.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var YJ=N((vBe,VJ)=>{"use strict";var bTe=mv(),xTe=g7(),_Te=Kg(),wTe=GJ();VJ.exports=wTe||bTe.call(_Te,xTe)});var jJ=N((hBe,WJ)=>{"use strict";var TTe=mv(),ATe=yv(),MTe=Kg(),kTe=YJ();WJ.exports=function(r){if(r.length<1||typeof r[0]!="function")throw new ATe("a function is required");return kTe(TTe,MTe,r)}});var QJ=N((dBe,KJ)=>{"use strict";var STe=jJ(),ZJ=rf(),JJ;try{JJ=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var b7=!!JJ&&ZJ&&ZJ(Object.prototype,"__proto__"),$J=Object,XJ=$J.getPrototypeOf;KJ.exports=b7&&typeof b7.get=="function"?STe([b7.get]):typeof XJ=="function"?function(r){return XJ(r==null?r:$J(r))}:!1});var n$=N((pBe,a$)=>{"use strict";var e$=y7(),r$=m7(),t$=QJ();a$.exports=e$?function(r){return e$(r)}:r$?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return r$(r)}:t$?function(r){return t$(r)}:null});var o$=N((yBe,i$)=>{"use strict";var qTe=Function.prototype.call,LTe=Object.prototype.hasOwnProperty,CTe=mv();i$.exports=CTe.call(qTe,LTe)});var r2=N((mBe,v$)=>{"use strict";var ot,ETe=d7(),DTe=eJ(),RTe=tJ(),PTe=nJ(),FTe=oJ(),_v=p7(),xv=yv(),NTe=fJ(),ITe=vJ(),zTe=dJ(),OTe=yJ(),BTe=gJ(),HTe=xJ(),UTe=wJ(),GTe=kJ(),f$=Function,x7=function(e){try{return f$('"use strict"; return ('+e+").constructor;")()}catch(r){}},id=rf(),VTe=nd(),_7=function(){throw new xv},YTe=id?function(){try{return arguments.callee,_7}catch(e){try{return id(arguments,"callee").get}catch(r){return _7}}}():_7,gv=RJ()(),ja=n$(),WTe=m7(),jTe=y7(),c$=g7(),od=Kg(),bv={},ZTe=typeof Uint8Array=="undefined"||!ja?ot:ja(Uint8Array),tf={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?ot:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?ot:ArrayBuffer,"%ArrayIteratorPrototype%":gv&&ja?ja([][Symbol.iterator]()):ot,"%AsyncFromSyncIteratorPrototype%":ot,"%AsyncFunction%":bv,"%AsyncGenerator%":bv,"%AsyncGeneratorFunction%":bv,"%AsyncIteratorPrototype%":bv,"%Atomics%":typeof Atomics=="undefined"?ot:Atomics,"%BigInt%":typeof BigInt=="undefined"?ot:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?ot:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?ot:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?ot:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":DTe,"%eval%":eval,"%EvalError%":RTe,"%Float16Array%":typeof Float16Array=="undefined"?ot:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?ot:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?ot:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?ot:FinalizationRegistry,"%Function%":f$,"%GeneratorFunction%":bv,"%Int8Array%":typeof Int8Array=="undefined"?ot:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?ot:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?ot:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gv&&ja?ja(ja([][Symbol.iterator]())):ot,"%JSON%":typeof JSON=="object"?JSON:ot,"%Map%":typeof Map=="undefined"?ot:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!gv||!ja?ot:ja(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ETe,"%Object.getOwnPropertyDescriptor%":id,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?ot:Promise,"%Proxy%":typeof Proxy=="undefined"?ot:Proxy,"%RangeError%":PTe,"%ReferenceError%":FTe,"%Reflect%":typeof Reflect=="undefined"?ot:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?ot:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!gv||!ja?ot:ja(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?ot:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gv&&ja?ja(""[Symbol.iterator]()):ot,"%Symbol%":gv?Symbol:ot,"%SyntaxError%":_v,"%ThrowTypeError%":YTe,"%TypedArray%":ZTe,"%TypeError%":xv,"%Uint8Array%":typeof Uint8Array=="undefined"?ot:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?ot:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?ot:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?ot:Uint32Array,"%URIError%":NTe,"%WeakMap%":typeof WeakMap=="undefined"?ot:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?ot:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?ot:WeakSet,"%Function.prototype.call%":od,"%Function.prototype.apply%":c$,"%Object.defineProperty%":VTe,"%Object.getPrototypeOf%":WTe,"%Math.abs%":ITe,"%Math.floor%":zTe,"%Math.max%":OTe,"%Math.min%":BTe,"%Math.pow%":HTe,"%Math.round%":UTe,"%Math.sign%":GTe,"%Reflect.getPrototypeOf%":jTe};if(ja)try{null.error}catch(e){l$=ja(ja(e)),tf["%Error.prototype%"]=l$}var l$,XTe=function e(r){var t;if(r==="%AsyncFunction%")t=x7("async function () {}");else if(r==="%GeneratorFunction%")t=x7("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=x7("async function* () {}");else if(r==="%AsyncGenerator%"){var a=e("%AsyncGeneratorFunction%");a&&(t=a.prototype)}else if(r==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&ja&&(t=ja(n.prototype))}return tf[r]=t,t},s$={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ld=mv(),Qg=o$(),JTe=ld.call(od,Array.prototype.concat),$Te=ld.call(c$,Array.prototype.splice),u$=ld.call(od,String.prototype.replace),e2=ld.call(od,String.prototype.slice),KTe=ld.call(od,RegExp.prototype.exec),QTe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,eAe=/\\(\\)?/g,rAe=function(r){var t=e2(r,0,1),a=e2(r,-1);if(t==="%"&&a!=="%")throw new _v("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&t!=="%")throw new _v("invalid intrinsic syntax, expected opening `%`");var n=[];return u$(r,QTe,function(i,o,l,s){n[n.length]=l?u$(s,eAe,"$1"):o||i}),n},tAe=function(r,t){var a=r,n;if(Qg(s$,a)&&(n=s$[a],a="%"+n[0]+"%"),Qg(tf,a)){var i=tf[a];if(i===bv&&(i=XTe(a)),typeof i=="undefined"&&!t)throw new xv("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:n,name:a,value:i}}throw new _v("intrinsic "+r+" does not exist!")};v$.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new xv("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new xv('"allowMissing" argument must be a boolean');if(KTe(/^%?[^%]*%?$/,r)===null)throw new _v("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=rAe(r),n=a.length>0?a[0]:"",i=tAe("%"+n+"%",t),o=i.name,l=i.value,s=!1,u=i.alias;u&&(n=u[0],$Te(a,JTe([0,1],u)));for(var f=1,c=!0;f=a.length){var y=id(l,v);c=!!y,c&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[v]}else c=Qg(l,v),l=l[v];c&&!s&&(tf[o]=l)}}return l}});var y$=N((gBe,p$)=>{"use strict";var h$=nd(),aAe=p7(),wv=yv(),d$=rf();p$.exports=function(r,t,a){if(!r||typeof r!="object"&&typeof r!="function")throw new wv("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new wv("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new wv("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new wv("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new wv("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new wv("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,s=!!d$&&d$(r,t);if(h$)h$(r,t,{configurable:o===null&&s?s.configurable:!o,enumerable:n===null&&s?s.enumerable:!n,value:a,writable:i===null&&s?s.writable:!i});else if(l||!n&&!i&&!o)r[t]=a;else throw new aAe("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var T7=N((bBe,g$)=>{"use strict";var w7=nd(),m$=function(){return!!w7};m$.hasArrayLengthDefineBug=function(){if(!w7)return null;try{return w7([],"length",{value:1}).length!==1}catch(r){return!0}};g$.exports=m$});var T$=N((xBe,w$)=>{"use strict";var nAe=r2(),b$=y$(),iAe=T7()(),x$=rf(),_$=yv(),oAe=nAe("%Math.floor%");w$.exports=function(r,t){if(typeof r!="function")throw new _$("`fn` is not a function");if(typeof t!="number"||t<0||t>4294967295||oAe(t)!==t)throw new _$("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],n=!0,i=!0;if("length"in r&&x$){var o=x$(r,"length");o&&!o.configurable&&(n=!1),o&&!o.writable&&(i=!1)}return(n||i||!a)&&(iAe?b$(r,"length",t,!0,!0):b$(r,"length",t)),r}});var sd=N((_Be,t2)=>{"use strict";var A7=mv(),a2=r2(),lAe=T$(),sAe=yv(),k$=a2("%Function.prototype.apply%"),S$=a2("%Function.prototype.call%"),q$=a2("%Reflect.apply%",!0)||A7.call(S$,k$),A$=nd(),uAe=a2("%Math.max%");t2.exports=function(r){if(typeof r!="function")throw new sAe("a function is required");var t=q$(A7,S$,arguments);return lAe(t,1+uAe(0,r.length-(arguments.length-1)),!0)};var M$=function(){return q$(A7,k$,arguments)};A$?A$(t2.exports,"apply",{value:M$}):t2.exports.apply=M$});var Tv=N((wBe,E$)=>{"use strict";var L$=r2(),C$=sd(),fAe=C$(L$("String.prototype.indexOf"));E$.exports=function(r,t){var a=L$(r,!!t);return typeof a=="function"&&fAe(r,".prototype.")>-1?C$(a):a}});var P$=N((TBe,R$)=>{"use strict";var cAe=ad()(),vAe=Tv(),M7=vAe("Object.prototype.toString"),n2=function(r){return cAe&&r&&typeof r=="object"&&Symbol.toStringTag in r?!1:M7(r)==="[object Arguments]"},D$=function(r){return n2(r)?!0:r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&M7(r)!=="[object Array]"&&M7(r.callee)==="[object Function]"},hAe=function(){return n2(arguments)}();n2.isLegacyArguments=D$;R$.exports=hAe?n2:D$});var I$=N((ABe,N$)=>{"use strict";var dAe=Object.prototype.toString,pAe=Function.prototype.toString,yAe=/^\s*(?:function)?\*/,F$=ad()(),k7=Object.getPrototypeOf,mAe=function(){if(!F$)return!1;try{return Function("return function*() {}")()}catch(e){}},S7;N$.exports=function(r){if(typeof r!="function")return!1;if(yAe.test(pAe.call(r)))return!0;if(!F$){var t=dAe.call(r);return t==="[object GeneratorFunction]"}if(!k7)return!1;if(typeof S7=="undefined"){var a=mAe();S7=a?k7(a):!1}return k7(r)===S7}});var H$=N((MBe,B$)=>{"use strict";var O$=Function.prototype.toString,Av=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,L7,i2;if(typeof Av=="function"&&typeof Object.defineProperty=="function")try{L7=Object.defineProperty({},"length",{get:function(){throw i2}}),i2={},Av(function(){throw 42},null,L7)}catch(e){e!==i2&&(Av=null)}else Av=null;var gAe=/^\s*class\b/,C7=function(r){try{var t=O$.call(r);return gAe.test(t)}catch(a){return!1}},q7=function(r){try{return C7(r)?!1:(O$.call(r),!0)}catch(t){return!1}},o2=Object.prototype.toString,bAe="[object Object]",xAe="[object Function]",_Ae="[object GeneratorFunction]",wAe="[object HTMLAllCollection]",TAe="[object HTML document.all class]",AAe="[object HTMLCollection]",MAe=typeof Symbol=="function"&&!!Symbol.toStringTag,kAe=!(0 in[,]),E7=function(){return!1};typeof document=="object"&&(z$=document.all,o2.call(z$)===o2.call(document.all)&&(E7=function(r){if((kAe||!r)&&(typeof r=="undefined"||typeof r=="object"))try{var t=o2.call(r);return(t===wAe||t===TAe||t===AAe||t===bAe)&&r("")==null}catch(a){}return!1}));var z$;B$.exports=Av?function(r){if(E7(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;try{Av(r,null,L7)}catch(t){if(t!==i2)return!1}return!C7(r)&&q7(r)}:function(r){if(E7(r))return!0;if(!r||typeof r!="function"&&typeof r!="object")return!1;if(MAe)return q7(r);if(C7(r))return!1;var t=o2.call(r);return t!==xAe&&t!==_Ae&&!/^\[object HTML/.test(t)?!1:q7(r)}});var D7=N((kBe,G$)=>{"use strict";var SAe=H$(),qAe=Object.prototype.toString,U$=Object.prototype.hasOwnProperty,LAe=function(r,t,a){for(var n=0,i=r.length;n=3&&(n=a),qAe.call(r)==="[object Array]"?LAe(r,t,n):typeof r=="string"?CAe(r,t,n):EAe(r,t,n)};G$.exports=DAe});var P7=N((SBe,V$)=>{"use strict";var R7=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],RAe=typeof globalThis=="undefined"?window:globalThis;V$.exports=function(){for(var r=[],t=0;t{"use strict";var s2=D7(),PAe=P7(),Y$=sd(),I7=Tv(),l2=rf(),FAe=I7("Object.prototype.toString"),j$=ad()(),W$=typeof globalThis=="undefined"?window:globalThis,N7=PAe(),z7=I7("String.prototype.slice"),F7=Object.getPrototypeOf,NAe=I7("Array.prototype.indexOf",!0)||function(r,t){for(var a=0;a-1?t:t!=="Object"?!1:zAe(r)}return l2?IAe(r):null}});var rK=N((LBe,eK)=>{"use strict";var J$=D7(),OAe=P7(),B7=Tv(),BAe=B7("Object.prototype.toString"),$$=ad()(),f2=rf(),HAe=typeof globalThis=="undefined"?window:globalThis,K$=OAe(),UAe=B7("Array.prototype.indexOf",!0)||function(r,t){for(var a=0;a-1}return f2?VAe(r):!1}});var G7=N(lt=>{"use strict";var YAe=P$(),WAe=I$(),_o=X$(),tK=rK();function Mv(e){return e.call.bind(e)}var aK=typeof BigInt!="undefined",nK=typeof Symbol!="undefined",Hi=Mv(Object.prototype.toString),jAe=Mv(Number.prototype.valueOf),ZAe=Mv(String.prototype.valueOf),XAe=Mv(Boolean.prototype.valueOf);aK&&(iK=Mv(BigInt.prototype.valueOf));var iK;nK&&(oK=Mv(Symbol.prototype.valueOf));var oK;function fd(e,r){if(typeof e!="object")return!1;try{return r(e),!0}catch(t){return!1}}lt.isArgumentsObject=YAe;lt.isGeneratorFunction=WAe;lt.isTypedArray=tK;function JAe(e){return typeof Promise!="undefined"&&e instanceof Promise||e!==null&&typeof e=="object"&&typeof e.then=="function"&&typeof e.catch=="function"}lt.isPromise=JAe;function $Ae(e){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?ArrayBuffer.isView(e):tK(e)||sK(e)}lt.isArrayBufferView=$Ae;function KAe(e){return _o(e)==="Uint8Array"}lt.isUint8Array=KAe;function QAe(e){return _o(e)==="Uint8ClampedArray"}lt.isUint8ClampedArray=QAe;function e8e(e){return _o(e)==="Uint16Array"}lt.isUint16Array=e8e;function r8e(e){return _o(e)==="Uint32Array"}lt.isUint32Array=r8e;function t8e(e){return _o(e)==="Int8Array"}lt.isInt8Array=t8e;function a8e(e){return _o(e)==="Int16Array"}lt.isInt16Array=a8e;function n8e(e){return _o(e)==="Int32Array"}lt.isInt32Array=n8e;function i8e(e){return _o(e)==="Float32Array"}lt.isFloat32Array=i8e;function o8e(e){return _o(e)==="Float64Array"}lt.isFloat64Array=o8e;function l8e(e){return _o(e)==="BigInt64Array"}lt.isBigInt64Array=l8e;function s8e(e){return _o(e)==="BigUint64Array"}lt.isBigUint64Array=s8e;function c2(e){return Hi(e)==="[object Map]"}c2.working=typeof Map!="undefined"&&c2(new Map);function u8e(e){return typeof Map=="undefined"?!1:c2.working?c2(e):e instanceof Map}lt.isMap=u8e;function v2(e){return Hi(e)==="[object Set]"}v2.working=typeof Set!="undefined"&&v2(new Set);function f8e(e){return typeof Set=="undefined"?!1:v2.working?v2(e):e instanceof Set}lt.isSet=f8e;function h2(e){return Hi(e)==="[object WeakMap]"}h2.working=typeof WeakMap!="undefined"&&h2(new WeakMap);function c8e(e){return typeof WeakMap=="undefined"?!1:h2.working?h2(e):e instanceof WeakMap}lt.isWeakMap=c8e;function U7(e){return Hi(e)==="[object WeakSet]"}U7.working=typeof WeakSet!="undefined"&&U7(new WeakSet);function v8e(e){return U7(e)}lt.isWeakSet=v8e;function d2(e){return Hi(e)==="[object ArrayBuffer]"}d2.working=typeof ArrayBuffer!="undefined"&&d2(new ArrayBuffer);function lK(e){return typeof ArrayBuffer=="undefined"?!1:d2.working?d2(e):e instanceof ArrayBuffer}lt.isArrayBuffer=lK;function p2(e){return Hi(e)==="[object DataView]"}p2.working=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"&&p2(new DataView(new ArrayBuffer(1),0,1));function sK(e){return typeof DataView=="undefined"?!1:p2.working?p2(e):e instanceof DataView}lt.isDataView=sK;var H7=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:void 0;function ud(e){return Hi(e)==="[object SharedArrayBuffer]"}function uK(e){return typeof H7=="undefined"?!1:(typeof ud.working=="undefined"&&(ud.working=ud(new H7)),ud.working?ud(e):e instanceof H7)}lt.isSharedArrayBuffer=uK;function h8e(e){return Hi(e)==="[object AsyncFunction]"}lt.isAsyncFunction=h8e;function d8e(e){return Hi(e)==="[object Map Iterator]"}lt.isMapIterator=d8e;function p8e(e){return Hi(e)==="[object Set Iterator]"}lt.isSetIterator=p8e;function y8e(e){return Hi(e)==="[object Generator]"}lt.isGeneratorObject=y8e;function m8e(e){return Hi(e)==="[object WebAssembly.Module]"}lt.isWebAssemblyCompiledModule=m8e;function fK(e){return fd(e,jAe)}lt.isNumberObject=fK;function cK(e){return fd(e,ZAe)}lt.isStringObject=cK;function vK(e){return fd(e,XAe)}lt.isBooleanObject=vK;function hK(e){return aK&&fd(e,iK)}lt.isBigIntObject=hK;function dK(e){return nK&&fd(e,oK)}lt.isSymbolObject=dK;function g8e(e){return fK(e)||cK(e)||vK(e)||hK(e)||dK(e)}lt.isBoxedPrimitive=g8e;function b8e(e){return typeof Uint8Array!="undefined"&&(lK(e)||uK(e))}lt.isAnyArrayBuffer=b8e;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(lt,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})});var V7=N((EBe,pK)=>{pK.exports=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"}});var J7=N(st=>{var yK=Object.getOwnPropertyDescriptors||function(r){for(var t=Object.keys(r),a={},n=0;n=n)return l;switch(l){case"%s":return String(a[t++]);case"%d":return Number(a[t++]);case"%j":try{return JSON.stringify(a[t++])}catch(s){return"[Circular]"}default:return l}}),o=a[t];t=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Z7(r)?t.showHidden=r:r&&st._extend(t,r),nf(t.showHidden)&&(t.showHidden=!1),nf(t.depth)&&(t.depth=2),nf(t.colors)&&(t.colors=!1),nf(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=_8e),b2(t,e,t.depth)}st.inspect=Ls;Ls.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Ls.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function _8e(e,r){var t=Ls.styles[r];return t?"\x1B["+Ls.colors[t][0]+"m"+e+"\x1B["+Ls.colors[t][1]+"m":e}function w8e(e,r){return e}function T8e(e){var r={};return e.forEach(function(t,a){r[t]=!0}),r}function b2(e,r,t){if(e.customInspect&&r&&g2(r.inspect)&&r.inspect!==st.inspect&&!(r.constructor&&r.constructor.prototype===r)){var a=r.inspect(t,e);return w2(a)||(a=b2(e,a,t)),a}var n=A8e(e,r);if(n)return n;var i=Object.keys(r),o=T8e(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(r)),vd(r)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Y7(r);if(i.length===0){if(g2(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(cd(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x2(r))return e.stylize(Date.prototype.toString.call(r),"date");if(vd(r))return Y7(r)}var s="",u=!1,f=["{","}"];if(gK(r)&&(u=!0,f=["[","]"]),g2(r)){var c=r.name?": "+r.name:"";s=" [Function"+c+"]"}if(cd(r)&&(s=" "+RegExp.prototype.toString.call(r)),x2(r)&&(s=" "+Date.prototype.toUTCString.call(r)),vd(r)&&(s=" "+Y7(r)),i.length===0&&(!u||r.length==0))return f[0]+s+f[1];if(t<0)return cd(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var v;return u?v=M8e(e,r,t,o,i):v=i.map(function(d){return j7(e,r,t,o,d,u)}),e.seen.pop(),k8e(v,s,f)}function A8e(e,r){if(nf(r))return e.stylize("undefined","undefined");if(w2(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(bK(r))return e.stylize(""+r,"number");if(Z7(r))return e.stylize(""+r,"boolean");if(_2(r))return e.stylize("null","null")}function Y7(e){return"["+Error.prototype.toString.call(e)+"]"}function M8e(e,r,t,a,n){for(var i=[],o=0,l=r.length;o-1&&(i?l=l.split(` +`).map(function(u){return" "+u}).join(` +`).slice(2):l=` +`+l.split(` +`).map(function(u){return" "+u}).join(` +`))):l=e.stylize("[Circular]","special")),nf(o)){if(i&&n.match(/^\d+$/))return l;o=JSON.stringify(""+n),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+l}function k8e(e,r,t){var a=0,n=e.reduce(function(i,o){return a++,o.indexOf(` +`)>=0&&a++,i+o.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(r===""?"":r+` + `)+" "+e.join(`, + `)+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}st.types=G7();function gK(e){return Array.isArray(e)}st.isArray=gK;function Z7(e){return typeof e=="boolean"}st.isBoolean=Z7;function _2(e){return e===null}st.isNull=_2;function S8e(e){return e==null}st.isNullOrUndefined=S8e;function bK(e){return typeof e=="number"}st.isNumber=bK;function w2(e){return typeof e=="string"}st.isString=w2;function q8e(e){return typeof e=="symbol"}st.isSymbol=q8e;function nf(e){return e===void 0}st.isUndefined=nf;function cd(e){return kv(e)&&X7(e)==="[object RegExp]"}st.isRegExp=cd;st.types.isRegExp=cd;function kv(e){return typeof e=="object"&&e!==null}st.isObject=kv;function x2(e){return kv(e)&&X7(e)==="[object Date]"}st.isDate=x2;st.types.isDate=x2;function vd(e){return kv(e)&&(X7(e)==="[object Error]"||e instanceof Error)}st.isError=vd;st.types.isNativeError=vd;function g2(e){return typeof e=="function"}st.isFunction=g2;function L8e(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}st.isPrimitive=L8e;st.isBuffer=V7();function X7(e){return Object.prototype.toString.call(e)}function W7(e){return e<10?"0"+e.toString(10):e.toString(10)}var C8e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E8e(){var e=new Date,r=[W7(e.getHours()),W7(e.getMinutes()),W7(e.getSeconds())].join(":");return[e.getDate(),C8e[e.getMonth()],r].join(" ")}st.log=function(){console.log("%s - %s",E8e(),st.format.apply(st,arguments))};st.inherits=Rl();st._extend=function(e,r){if(!r||!kv(r))return e;for(var t=Object.keys(r),a=t.length;a--;)e[t[a]]=r[t[a]];return e};function xK(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var af=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;st.promisify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(af&&r[af]){var t=r[af];if(typeof t!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,af,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var a,n,i=new Promise(function(s,u){a=s,n=u}),o=[],l=0;l{"use strict";function _K(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,a)}return t}function P8e(e){for(var r=1;r0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(t){var a={data:t,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var a=this.head,n=""+a.data;a=a.next;)n+=t+a.data;return n}},{key:"concat",value:function(t){if(this.length===0)return T2.alloc(0);for(var a=T2.allocUnsafe(t>>>0),n=this.head,i=0;n;)H8e(n.data,a,i),i+=n.data.length,n=n.next;return a}},{key:"consume",value:function(t,a){var n;return to.length?o.length:t;if(l===o.length?i+=o:i+=o.slice(0,t),t-=l,t===0){l===o.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=o.slice(l));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(t){var a=T2.allocUnsafe(t),n=this.head,i=1;for(n.data.copy(a),t-=n.data.length;n=n.next;){var o=n.data,l=t>o.length?o.length:t;if(o.copy(a,a.length-t,0,l),t-=l,t===0){l===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(l));break}++i}return this.length-=i,a}},{key:B8e,value:function(t,a){return $7(this,P8e({},a,{depth:0,customInspect:!1}))}}]),e}()});var Q7=N((PBe,kK)=>{"use strict";function U8e(e,r){var t=this,a=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return a||n?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(K7,this,e)):process.nextTick(K7,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(i){!r&&i?t._writableState?t._writableState.errorEmitted?process.nextTick(A2,t):(t._writableState.errorEmitted=!0,process.nextTick(MK,t,i)):process.nextTick(MK,t,i):r?(process.nextTick(A2,t),r(i)):process.nextTick(A2,t)}),this)}function MK(e,r){K7(e,r),A2(e)}function A2(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function G8e(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function K7(e,r){e.emit("error",r)}function V8e(e,r){var t=e._readableState,a=e._writableState;t&&t.autoDestroy||a&&a.autoDestroy?e.destroy(r):e.emit("error",r)}kK.exports={destroy:U8e,undestroy:G8e,errorOrDestroy:V8e}});var of=N((FBe,LK)=>{"use strict";function Y8e(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}var qK={};function Ui(e,r,t){t||(t=Error);function a(i,o,l){return typeof r=="string"?r:r(i,o,l)}var n=function(i){Y8e(o,i);function o(l,s,u){return i.call(this,a(l,s,u))||this}return o}(t);n.prototype.name=t.name,n.prototype.code=e,qK[e]=n}function SK(e,r){if(Array.isArray(e)){var t=e.length;return e=e.map(function(a){return String(a)}),t>2?"one of ".concat(r," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:t===2?"one of ".concat(r," ").concat(e[0]," or ").concat(e[1]):"of ".concat(r," ").concat(e[0])}else return"of ".concat(r," ").concat(String(e))}function W8e(e,r,t){return e.substr(!t||t<0?0:+t,r.length)===r}function j8e(e,r,t){return(t===void 0||t>e.length)&&(t=e.length),e.substring(t-r.length,t)===r}function Z8e(e,r,t){return typeof t!="number"&&(t=0),t+r.length>e.length?!1:e.indexOf(r,t)!==-1}Ui("ERR_INVALID_OPT_VALUE",function(e,r){return'The value "'+r+'" is invalid for option "'+e+'"'},TypeError);Ui("ERR_INVALID_ARG_TYPE",function(e,r,t){var a;typeof r=="string"&&W8e(r,"not ")?(a="must not be",r=r.replace(/^not /,"")):a="must be";var n;if(j8e(e," argument"))n="The ".concat(e," ").concat(a," ").concat(SK(r,"type"));else{var i=Z8e(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(i," ").concat(a," ").concat(SK(r,"type"))}return n+=". Received type ".concat(typeof t),n},TypeError);Ui("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ui("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ui("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ui("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ui("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ui("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ui("ERR_STREAM_WRITE_AFTER_END","write after end");Ui("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ui("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ui("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");LK.exports.codes=qK});var eT=N((NBe,CK)=>{"use strict";var X8e=of().codes.ERR_INVALID_OPT_VALUE;function J8e(e,r,t){return e.highWaterMark!=null?e.highWaterMark:r?e[t]:null}function $8e(e,r,t,a){var n=J8e(r,a,t);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var i=a?t:"highWaterMark";throw new X8e(i,n)}return Math.floor(n)}return e.objectMode?16:16*1024}CK.exports={getHighWaterMark:$8e}});var DK=N((IBe,EK)=>{EK.exports=K8e;function K8e(e,r){if(rT("noDeprecation"))return e;var t=!1;function a(){if(!t){if(rT("throwDeprecation"))throw new Error(r);rT("traceDeprecation")?console.trace(r):console.warn(r),t=!0}return e.apply(this,arguments)}return a}function rT(e){try{if(!window.localStorage)return!1}catch(t){return!1}var r=window.localStorage[e];return r==null?!1:String(r).toLowerCase()==="true"}});var nT=N((zBe,zK)=>{"use strict";zK.exports=pa;function PK(e){var r=this;this.next=null,this.entry=null,this.finish=function(){MMe(r,e)}}var Sv;pa.WritableState=dd;var Q8e={deprecate:DK()},FK=a7(),k2=pv().Buffer,eMe=window.Uint8Array||function(){};function rMe(e){return k2.from(e)}function tMe(e){return k2.isBuffer(e)||e instanceof eMe}var aT=Q7(),aMe=eT(),nMe=aMe.getHighWaterMark,Cs=of().codes,iMe=Cs.ERR_INVALID_ARG_TYPE,oMe=Cs.ERR_METHOD_NOT_IMPLEMENTED,lMe=Cs.ERR_MULTIPLE_CALLBACK,sMe=Cs.ERR_STREAM_CANNOT_PIPE,uMe=Cs.ERR_STREAM_DESTROYED,fMe=Cs.ERR_STREAM_NULL_VALUES,cMe=Cs.ERR_STREAM_WRITE_AFTER_END,vMe=Cs.ERR_UNKNOWN_ENCODING,qv=aT.errorOrDestroy;Rl()(pa,FK);function hMe(){}function dd(e,r,t){Sv=Sv||lf(),e=e||{},typeof t!="boolean"&&(t=r instanceof Sv),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=nMe(this,e,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){xMe(r,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new PK(this)}dd.prototype.getBuffer=function(){for(var r=this.bufferedRequest,t=[];r;)t.push(r),r=r.next;return t};(function(){try{Object.defineProperty(dd.prototype,"buffer",{get:Q8e.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}})();var M2;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M2=Function.prototype[Symbol.hasInstance],Object.defineProperty(pa,Symbol.hasInstance,{value:function(r){return M2.call(this,r)?!0:this!==pa?!1:r&&r._writableState instanceof dd}})):M2=function(r){return r instanceof this};function pa(e){Sv=Sv||lf();var r=this instanceof Sv;if(!r&&!M2.call(pa,this))return new pa(e);this._writableState=new dd(e,this,r),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),FK.call(this)}pa.prototype.pipe=function(){qv(this,new sMe)};function dMe(e,r){var t=new cMe;qv(e,t),process.nextTick(r,t)}function pMe(e,r,t,a){var n;return t===null?n=new fMe:typeof t!="string"&&!r.objectMode&&(n=new iMe("chunk",["string","Buffer"],t)),n?(qv(e,n),process.nextTick(a,n),!1):!0}pa.prototype.write=function(e,r,t){var a=this._writableState,n=!1,i=!a.objectMode&&tMe(e);return i&&!k2.isBuffer(e)&&(e=rMe(e)),typeof r=="function"&&(t=r,r=null),i?r="buffer":r||(r=a.defaultEncoding),typeof t!="function"&&(t=hMe),a.ending?dMe(this,t):(i||pMe(this,a,e,t))&&(a.pendingcb++,n=mMe(this,a,i,e,r,t)),n};pa.prototype.cork=function(){this._writableState.corked++};pa.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&NK(this,e))};pa.prototype.setDefaultEncoding=function(r){if(typeof r=="string"&&(r=r.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new vMe(r);return this._writableState.defaultEncoding=r,this};Object.defineProperty(pa.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function yMe(e,r,t){return!e.objectMode&&e.decodeStrings!==!1&&typeof r=="string"&&(r=k2.from(r,t)),r}Object.defineProperty(pa.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function mMe(e,r,t,a,n,i){if(!t){var o=yMe(r,a,n);a!==o&&(t=!0,n="buffer",a=o)}var l=r.objectMode?1:a.length;r.length+=l;var s=r.length{"use strict";var kMe=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};BK.exports=tl;var OK=lT(),oT=nT();Rl()(tl,OK);for(iT=kMe(oT.prototype),S2=0;S2{var L2=pv(),al=L2.Buffer;function HK(e,r){for(var t in e)r[t]=e[t]}al.from&&al.alloc&&al.allocUnsafe&&al.allocUnsafeSlow?UK.exports=L2:(HK(L2,sT),sT.Buffer=sf);function sf(e,r,t){return al(e,r,t)}sf.prototype=Object.create(al.prototype);HK(al,sf);sf.from=function(e,r,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return al(e,r,t)};sf.alloc=function(e,r,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var a=al(e);return r!==void 0?typeof t=="string"?a.fill(r,t):a.fill(r):a.fill(0),a};sf.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return al(e)};sf.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return L2.SlowBuffer(e)}});var cT=N(YK=>{"use strict";var fT=GK().Buffer,VK=fT.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function LMe(e){if(!e)return"utf8";for(var r;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(r)return;e=(""+e).toLowerCase(),r=!0}}function CMe(e){var r=LMe(e);if(typeof r!="string"&&(fT.isEncoding===VK||!VK(e)))throw new Error("Unknown encoding: "+e);return r||e}YK.StringDecoder=pd;function pd(e){this.encoding=CMe(e);var r;switch(this.encoding){case"utf16le":this.text=NMe,this.end=IMe,r=4;break;case"utf8":this.fillLast=RMe,r=4;break;case"base64":this.text=zMe,this.end=OMe,r=3;break;default:this.write=BMe,this.end=HMe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=fT.allocUnsafe(r)}pd.prototype.write=function(e){if(e.length===0)return"";var r,t;if(this.lastNeed){if(r=this.fillLast(e),r===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function EMe(e,r,t){var a=r.length-1;if(a=0?(n>0&&(e.lastNeed=n-1),n):--a=0?(n>0&&(e.lastNeed=n-2),n):--a=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function DMe(e,r,t){if((r[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&r.length>1){if((r[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&r.length>2&&(r[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function RMe(e){var r=this.lastTotal-this.lastNeed,t=DMe(this,e,r);if(t!==void 0)return t;if(this.lastNeed<=e.length)return e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,r,0,e.length),this.lastNeed-=e.length}function PMe(e,r){var t=EMe(this,e,r);if(!this.lastNeed)return e.toString("utf8",r);this.lastTotal=t;var a=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",r,a)}function FMe(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+"\uFFFD":r}function NMe(e,r){if((e.length-r)%2===0){var t=e.toString("utf16le",r);if(t){var a=t.charCodeAt(t.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",r,e.length-1)}function IMe(e){var r=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,t)}return r}function zMe(e,r){var t=(e.length-r)%3;return t===0?e.toString("base64",r):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",r,e.length-t))}function OMe(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function BMe(e){return e.toString(this.encoding)}function HMe(e){return e&&e.length?this.write(e):""}});var C2=N((HBe,ZK)=>{"use strict";var WK=of().codes.ERR_STREAM_PREMATURE_CLOSE;function UMe(e){var r=!1;return function(){if(!r){r=!0;for(var t=arguments.length,a=new Array(t),n=0;n{"use strict";var E2;function Es(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var YMe=C2(),Ds=Symbol("lastResolve"),uf=Symbol("lastReject"),yd=Symbol("error"),D2=Symbol("ended"),ff=Symbol("lastPromise"),vT=Symbol("handlePromise"),cf=Symbol("stream");function Rs(e,r){return{value:e,done:r}}function WMe(e){var r=e[Ds];if(r!==null){var t=e[cf].read();t!==null&&(e[ff]=null,e[Ds]=null,e[uf]=null,r(Rs(t,!1)))}}function jMe(e){process.nextTick(WMe,e)}function ZMe(e,r){return function(t,a){e.then(function(){if(r[D2]){t(Rs(void 0,!0));return}r[vT](t,a)},a)}}var XMe=Object.getPrototypeOf(function(){}),JMe=Object.setPrototypeOf((E2={get stream(){return this[cf]},next:function(){var r=this,t=this[yd];if(t!==null)return Promise.reject(t);if(this[D2])return Promise.resolve(Rs(void 0,!0));if(this[cf].destroyed)return new Promise(function(o,l){process.nextTick(function(){r[yd]?l(r[yd]):o(Rs(void 0,!0))})});var a=this[ff],n;if(a)n=new Promise(ZMe(a,this));else{var i=this[cf].read();if(i!==null)return Promise.resolve(Rs(i,!1));n=new Promise(this[vT])}return this[ff]=n,n}},Es(E2,Symbol.asyncIterator,function(){return this}),Es(E2,"return",function(){var r=this;return new Promise(function(t,a){r[cf].destroy(null,function(n){if(n){a(n);return}t(Rs(void 0,!0))})})}),E2),XMe),$Me=function(r){var t,a=Object.create(JMe,(t={},Es(t,cf,{value:r,writable:!0}),Es(t,Ds,{value:null,writable:!0}),Es(t,uf,{value:null,writable:!0}),Es(t,yd,{value:null,writable:!0}),Es(t,D2,{value:r._readableState.endEmitted,writable:!0}),Es(t,vT,{value:function(i,o){var l=a[cf].read();l?(a[ff]=null,a[Ds]=null,a[uf]=null,i(Rs(l,!1))):(a[Ds]=i,a[uf]=o)},writable:!0}),t));return a[ff]=null,YMe(r,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var i=a[uf];i!==null&&(a[ff]=null,a[Ds]=null,a[uf]=null,i(n)),a[yd]=n;return}var o=a[Ds];o!==null&&(a[ff]=null,a[Ds]=null,a[uf]=null,o(Rs(void 0,!0))),a[D2]=!0}),r.on("readable",jMe.bind(null,a)),a};XK.exports=$Me});var KK=N((GBe,$K)=>{$K.exports=function(){throw new Error("Readable.from is not available in the browser")}});var lT=N((YBe,sQ)=>{"use strict";sQ.exports=mt;var Lv;mt.ReadableState=tQ;var VBe=su().EventEmitter,rQ=function(r,t){return r.listeners(t).length},gd=a7(),R2=pv().Buffer,KMe=window.Uint8Array||function(){};function QMe(e){return R2.from(e)}function e9e(e){return R2.isBuffer(e)||e instanceof KMe}var hT=J7(),tt;hT&&hT.debuglog?tt=hT.debuglog("stream"):tt=function(){};var r9e=AK(),xT=Q7(),t9e=eT(),a9e=t9e.getHighWaterMark,P2=of().codes,n9e=P2.ERR_INVALID_ARG_TYPE,i9e=P2.ERR_STREAM_PUSH_AFTER_EOF,o9e=P2.ERR_METHOD_NOT_IMPLEMENTED,l9e=P2.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Cv,dT,pT;Rl()(mt,gd);var md=xT.errorOrDestroy,yT=["error","close","destroy","pause","resume"];function s9e(e,r,t){if(typeof e.prependListener=="function")return e.prependListener(r,t);!e._events||!e._events[r]?e.on(r,t):Array.isArray(e._events[r])?e._events[r].unshift(t):e._events[r]=[t,e._events[r]]}function tQ(e,r,t){Lv=Lv||lf(),e=e||{},typeof t!="boolean"&&(t=r instanceof Lv),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=a9e(this,e,"readableHighWaterMark",t),this.buffer=new r9e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Cv||(Cv=cT().StringDecoder),this.decoder=new Cv(e.encoding),this.encoding=e.encoding)}function mt(e){if(Lv=Lv||lf(),!(this instanceof mt))return new mt(e);var r=this instanceof Lv;this._readableState=new tQ(e,this,r),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),gd.call(this)}Object.defineProperty(mt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(r){this._readableState&&(this._readableState.destroyed=r)}});mt.prototype.destroy=xT.destroy;mt.prototype._undestroy=xT.undestroy;mt.prototype._destroy=function(e,r){r(e)};mt.prototype.push=function(e,r){var t=this._readableState,a;return t.objectMode?a=!0:typeof e=="string"&&(r=r||t.defaultEncoding,r!==t.encoding&&(e=R2.from(e,r),r=""),a=!0),aQ(this,e,r,!1,a)};mt.prototype.unshift=function(e){return aQ(this,e,null,!0,!1)};function aQ(e,r,t,a,n){tt("readableAddChunk",r);var i=e._readableState;if(r===null)i.reading=!1,c9e(e,i);else{var o;if(n||(o=u9e(i,r)),o)md(e,o);else if(i.objectMode||r&&r.length>0)if(typeof r!="string"&&!i.objectMode&&Object.getPrototypeOf(r)!==R2.prototype&&(r=QMe(r)),a)i.endEmitted?md(e,new l9e):mT(e,i,r,!0);else if(i.ended)md(e,new i9e);else{if(i.destroyed)return!1;i.reading=!1,i.decoder&&!t?(r=i.decoder.write(r),i.objectMode||r.length!==0?mT(e,i,r,!1):bT(e,i)):mT(e,i,r,!1)}else a||(i.reading=!1,bT(e,i))}return!i.ended&&(i.length=QK?e=QK:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function eQ(e,r){return e<=0||r.length===0&&r.ended?0:r.objectMode?1:e!==e?r.flowing&&r.length?r.buffer.head.data.length:r.length:(e>r.highWaterMark&&(r.highWaterMark=f9e(e)),e<=r.length?e:r.ended?r.length:(r.needReadable=!0,0))}mt.prototype.read=function(e){tt("read",e),e=parseInt(e,10);var r=this._readableState,t=e;if(e!==0&&(r.emittedReadable=!1),e===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended))return tt("read: emitReadable",r.length,r.ended),r.length===0&&r.ended?gT(this):F2(this),null;if(e=eQ(e,r),e===0&&r.ended)return r.length===0&&gT(this),null;var a=r.needReadable;tt("need readable",a),(r.length===0||r.length-e0?n=oQ(e,r):n=null,n===null?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),r.length===0&&(r.ended||(r.needReadable=!0),t!==e&&r.ended&&gT(this)),n!==null&&this.emit("data",n),n};function c9e(e,r){if(tt("onEofChunk"),!r.ended){if(r.decoder){var t=r.decoder.end();t&&t.length&&(r.buffer.push(t),r.length+=r.objectMode?1:t.length)}r.ended=!0,r.sync?F2(e):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,nQ(e)))}}function F2(e){var r=e._readableState;tt("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(tt("emitReadable",r.flowing),r.emittedReadable=!0,process.nextTick(nQ,e))}function nQ(e){var r=e._readableState;tt("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(e.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,_T(e)}function bT(e,r){r.readingMore||(r.readingMore=!0,process.nextTick(v9e,e,r))}function v9e(e,r){for(;!r.reading&&!r.ended&&(r.length1&&lQ(a.pipes,e)!==-1)&&!u&&(tt("false write response, pause",a.awaitDrain),a.awaitDrain++),t.pause())}function v(m){tt("onerror",m),y(),e.removeListener("error",v),rQ(e,"error")===0&&md(e,m)}s9e(e,"error",v);function d(){e.removeListener("finish",p),y()}e.once("close",d);function p(){tt("onfinish"),e.removeListener("close",d),y()}e.once("finish",p);function y(){tt("unpipe"),t.unpipe(e)}return e.emit("pipe",t),a.flowing||(tt("pipe resume"),t.resume()),e};function h9e(e){return function(){var t=e._readableState;tt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&rQ(e,"data")&&(t.flowing=!0,_T(e))}}mt.prototype.unpipe=function(e){var r=this._readableState,t={hasUnpiped:!1};if(r.pipesCount===0)return this;if(r.pipesCount===1)return e&&e!==r.pipes?this:(e||(e=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,e&&e.emit("unpipe",this,t),this);if(!e){var a=r.pipes,n=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var i=0;i0,a.flowing!==!1&&this.resume()):e==="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,tt("on readable",a.length,a.reading),a.length?F2(this):a.reading||process.nextTick(d9e,this)),t};mt.prototype.addListener=mt.prototype.on;mt.prototype.removeListener=function(e,r){var t=gd.prototype.removeListener.call(this,e,r);return e==="readable"&&process.nextTick(iQ,this),t};mt.prototype.removeAllListeners=function(e){var r=gd.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(iQ,this),r};function iQ(e){var r=e._readableState;r.readableListening=e.listenerCount("readable")>0,r.resumeScheduled&&!r.paused?r.flowing=!0:e.listenerCount("data")>0&&e.resume()}function d9e(e){tt("readable nexttick read 0"),e.read(0)}mt.prototype.resume=function(){var e=this._readableState;return e.flowing||(tt("resume"),e.flowing=!e.readableListening,p9e(this,e)),e.paused=!1,this};function p9e(e,r){r.resumeScheduled||(r.resumeScheduled=!0,process.nextTick(y9e,e,r))}function y9e(e,r){tt("resume",r.reading),r.reading||e.read(0),r.resumeScheduled=!1,e.emit("resume"),_T(e),r.flowing&&!r.reading&&e.read(0)}mt.prototype.pause=function(){return tt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(tt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _T(e){var r=e._readableState;for(tt("flow",r.flowing);r.flowing&&e.read()!==null;);}mt.prototype.wrap=function(e){var r=this,t=this._readableState,a=!1;e.on("end",function(){if(tt("wrapped end"),t.decoder&&!t.ended){var o=t.decoder.end();o&&o.length&&r.push(o)}r.push(null)}),e.on("data",function(o){if(tt("wrapped data"),t.decoder&&(o=t.decoder.write(o)),!(t.objectMode&&o==null)&&!(!t.objectMode&&(!o||!o.length))){var l=r.push(o);l||(a=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=function(l){return function(){return e[l].apply(e,arguments)}}(n));for(var i=0;i=r.length?(r.decoder?t=r.buffer.join(""):r.buffer.length===1?t=r.buffer.first():t=r.buffer.concat(r.length),r.buffer.clear()):t=r.buffer.consume(e,r.decoder),t}function gT(e){var r=e._readableState;tt("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,process.nextTick(m9e,r,e))}function m9e(e,r){if(tt("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,r.readable=!1,r.emit("end"),e.autoDestroy)){var t=r._writableState;(!t||t.autoDestroy&&t.finished)&&r.destroy()}}typeof Symbol=="function"&&(mt.from=function(e,r){return pT===void 0&&(pT=KK()),pT(mt,e,r)});function lQ(e,r){for(var t=0,a=e.length;t{"use strict";fQ.exports=Fl;var N2=of().codes,g9e=N2.ERR_METHOD_NOT_IMPLEMENTED,b9e=N2.ERR_MULTIPLE_CALLBACK,x9e=N2.ERR_TRANSFORM_ALREADY_TRANSFORMING,_9e=N2.ERR_TRANSFORM_WITH_LENGTH_0,I2=lf();Rl()(Fl,I2);function w9e(e,r){var t=this._transformState;t.transforming=!1;var a=t.writecb;if(a===null)return this.emit("error",new b9e);t.writechunk=null,t.writecb=null,r!=null&&this.push(r),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";vQ.exports=bd;var cQ=wT();Rl()(bd,cQ);function bd(e){if(!(this instanceof bd))return new bd(e);cQ.call(this,e)}bd.prototype._transform=function(e,r,t){t(null,e)}});var gQ=N((ZBe,mQ)=>{"use strict";var TT;function A9e(e){var r=!1;return function(){r||(r=!0,e.apply(void 0,arguments))}}var yQ=of().codes,M9e=yQ.ERR_MISSING_ARGS,k9e=yQ.ERR_STREAM_DESTROYED;function dQ(e){if(e)throw e}function S9e(e){return e.setHeader&&typeof e.abort=="function"}function q9e(e,r,t,a){a=A9e(a);var n=!1;e.on("close",function(){n=!0}),TT===void 0&&(TT=C2()),TT(e,{readable:r,writable:t},function(o){if(o)return a(o);n=!0,a()});var i=!1;return function(o){if(!n&&!i){if(i=!0,S9e(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();a(o||new k9e("pipe"))}}}function pQ(e){e()}function L9e(e,r){return e.pipe(r)}function C9e(e){return!e.length||typeof e[e.length-1]!="function"?dQ:e.pop()}function E9e(){for(var e=arguments.length,r=new Array(e),t=0;t0;return q9e(o,s,u,function(f){n||(n=f),f&&i.forEach(pQ),!s&&(i.forEach(pQ),a(n))})});return r.reduce(L9e)}mQ.exports=E9e});var xQ=N((XBe,bQ)=>{bQ.exports=Gi;var AT=su().EventEmitter,D9e=Rl();D9e(Gi,AT);Gi.Readable=lT();Gi.Writable=nT();Gi.Duplex=lf();Gi.Transform=wT();Gi.PassThrough=hQ();Gi.finished=C2();Gi.pipeline=gQ();Gi.Stream=Gi;function Gi(){AT.call(this)}Gi.prototype.pipe=function(e,r){var t=this;function a(f){e.writable&&e.write(f)===!1&&t.pause&&t.pause()}t.on("data",a);function n(){t.readable&&t.resume&&t.resume()}e.on("drain",n),!e._isStdio&&(!r||r.end!==!1)&&(t.on("end",o),t.on("close",l));var i=!1;function o(){i||(i=!0,e.end())}function l(){i||(i=!0,typeof e.destroy=="function"&&e.destroy())}function s(f){if(u(),AT.listenerCount(this,"error")===0)throw f}t.on("error",s),e.on("error",s);function u(){t.removeListener("data",a),e.removeListener("drain",n),t.removeListener("end",o),t.removeListener("close",l),t.removeListener("error",s),e.removeListener("error",s),t.removeListener("end",u),t.removeListener("close",u),e.removeListener("close",u)}return t.on("end",u),t.on("close",u),e.on("close",u),e.emit("pipe",t),e}});var Dv=N(ut=>{var _Q=Object.getOwnPropertyDescriptors||function(r){for(var t=Object.keys(r),a={},n=0;n=n)return l;switch(l){case"%s":return String(a[t++]);case"%d":return Number(a[t++]);case"%j":try{return JSON.stringify(a[t++])}catch(s){return"[Circular]"}default:return l}}),o=a[t];t=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),qT(r)?t.showHidden=r:r&&ut._extend(t,r),hf(t.showHidden)&&(t.showHidden=!1),hf(t.depth)&&(t.depth=2),hf(t.colors)&&(t.colors=!1),hf(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=P9e),H2(t,e,t.depth)}ut.inspect=Ps;Ps.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Ps.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function P9e(e,r){var t=Ps.styles[r];return t?"\x1B["+Ps.colors[t][0]+"m"+e+"\x1B["+Ps.colors[t][1]+"m":e}function F9e(e,r){return e}function N9e(e){var r={};return e.forEach(function(t,a){r[t]=!0}),r}function H2(e,r,t){if(e.customInspect&&r&&B2(r.inspect)&&r.inspect!==ut.inspect&&!(r.constructor&&r.constructor.prototype===r)){var a=r.inspect(t,e);return V2(a)||(a=H2(e,a,t)),a}var n=I9e(e,r);if(n)return n;var i=Object.keys(r),o=N9e(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(r)),_d(r)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return MT(r);if(i.length===0){if(B2(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(xd(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(U2(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_d(r))return MT(r)}var s="",u=!1,f=["{","}"];if(TQ(r)&&(u=!0,f=["[","]"]),B2(r)){var c=r.name?": "+r.name:"";s=" [Function"+c+"]"}if(xd(r)&&(s=" "+RegExp.prototype.toString.call(r)),U2(r)&&(s=" "+Date.prototype.toUTCString.call(r)),_d(r)&&(s=" "+MT(r)),i.length===0&&(!u||r.length==0))return f[0]+s+f[1];if(t<0)return xd(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var v;return u?v=z9e(e,r,t,o,i):v=i.map(function(d){return ST(e,r,t,o,d,u)}),e.seen.pop(),O9e(v,s,f)}function I9e(e,r){if(hf(r))return e.stylize("undefined","undefined");if(V2(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(AQ(r))return e.stylize(""+r,"number");if(qT(r))return e.stylize(""+r,"boolean");if(G2(r))return e.stylize("null","null")}function MT(e){return"["+Error.prototype.toString.call(e)+"]"}function z9e(e,r,t,a,n){for(var i=[],o=0,l=r.length;o-1&&(i?l=l.split(` +`).map(function(u){return" "+u}).join(` +`).slice(2):l=` +`+l.split(` +`).map(function(u){return" "+u}).join(` +`))):l=e.stylize("[Circular]","special")),hf(o)){if(i&&n.match(/^\d+$/))return l;o=JSON.stringify(""+n),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+l}function O9e(e,r,t){var a=0,n=e.reduce(function(i,o){return a++,o.indexOf(` +`)>=0&&a++,i+o.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(r===""?"":r+` + `)+" "+e.join(`, + `)+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}ut.types=G7();function TQ(e){return Array.isArray(e)}ut.isArray=TQ;function qT(e){return typeof e=="boolean"}ut.isBoolean=qT;function G2(e){return e===null}ut.isNull=G2;function B9e(e){return e==null}ut.isNullOrUndefined=B9e;function AQ(e){return typeof e=="number"}ut.isNumber=AQ;function V2(e){return typeof e=="string"}ut.isString=V2;function H9e(e){return typeof e=="symbol"}ut.isSymbol=H9e;function hf(e){return e===void 0}ut.isUndefined=hf;function xd(e){return Ev(e)&<(e)==="[object RegExp]"}ut.isRegExp=xd;ut.types.isRegExp=xd;function Ev(e){return typeof e=="object"&&e!==null}ut.isObject=Ev;function U2(e){return Ev(e)&<(e)==="[object Date]"}ut.isDate=U2;ut.types.isDate=U2;function _d(e){return Ev(e)&&(LT(e)==="[object Error]"||e instanceof Error)}ut.isError=_d;ut.types.isNativeError=_d;function B2(e){return typeof e=="function"}ut.isFunction=B2;function U9e(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e=="undefined"}ut.isPrimitive=U9e;ut.isBuffer=V7();function LT(e){return Object.prototype.toString.call(e)}function kT(e){return e<10?"0"+e.toString(10):e.toString(10)}var G9e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V9e(){var e=new Date,r=[kT(e.getHours()),kT(e.getMinutes()),kT(e.getSeconds())].join(":");return[e.getDate(),G9e[e.getMonth()],r].join(" ")}ut.log=function(){console.log("%s - %s",V9e(),ut.format.apply(ut,arguments))};ut.inherits=Rl();ut._extend=function(e,r){if(!r||!Ev(r))return e;for(var t=Object.keys(r),a=t.length;a--;)e[t[a]]=r[t[a]];return e};function MQ(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var vf=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;ut.promisify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(vf&&r[vf]){var t=r[vf];if(typeof t!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,vf,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var a,n,i=new Promise(function(s,u){a=s,n=u}),o=[],l=0;l{"use strict";function Fs(e){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fs(e)}function kQ(e,r){for(var t=0;t2?"one of ".concat(r," ").concat(e.slice(0,t-1).join(", "),", or ")+e[t-1]:t===2?"one of ".concat(r," ").concat(e[0]," or ").concat(e[1]):"of ".concat(r," ").concat(e[0])}else return"of ".concat(r," ").concat(String(e))}function tke(e,r,t){return e.substr(!t||t<0?0:+t,r.length)===r}function ake(e,r,t){return(t===void 0||t>e.length)&&(t=e.length),e.substring(t-r.length,t)===r}function nke(e,r,t){return typeof t!="number"&&(t=0),t+r.length>e.length?!1:e.indexOf(r,t)!==-1}wd("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError);wd("ERR_INVALID_ARG_TYPE",function(e,r,t){Rv===void 0&&(Rv=W2()),Rv(typeof e=="string","'name' must be a string");var a;typeof r=="string"&&tke(r,"not ")?(a="must not be",r=r.replace(/^not /,"")):a="must be";var n;if(ake(e," argument"))n="The ".concat(e," ").concat(a," ").concat(SQ(r,"type"));else{var i=nke(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(i," ").concat(a," ").concat(SQ(r,"type"))}return n+=". Received type ".concat(Fs(t)),n},TypeError);wd("ERR_INVALID_ARG_VALUE",function(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";CT===void 0&&(CT=Dv());var a=CT.inspect(r);return a.length>128&&(a="".concat(a.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(t,". Received ").concat(a)},TypeError,RangeError);wd("ERR_INVALID_RETURN_VALUE",function(e,r,t){var a;return t&&t.constructor&&t.constructor.name?a="instance of ".concat(t.constructor.name):a="type ".concat(Fs(t)),"Expected ".concat(e,' to be returned from the "').concat(r,'"')+" function but got ".concat(a,".")},TypeError);wd("ERR_MISSING_ARGS",function(){for(var e=arguments.length,r=new Array(e),t=0;t0,"At least one arg needs to be specified");var a="The ",n=r.length;switch(r=r.map(function(i){return'"'.concat(i,'"')}),n){case 1:a+="".concat(r[0]," argument");break;case 2:a+="".concat(r[0]," and ").concat(r[1]," arguments");break;default:a+=r.slice(0,n-1).join(", "),a+=", and ".concat(r[n-1]," arguments");break}return"".concat(a," must be specified")},TypeError);LQ.exports.codes=qQ});var OQ=N((KBe,zQ)=>{"use strict";function CQ(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,a)}return t}function EQ(e){for(var r=1;re.length)&&(t=e.length),e.substring(t-r.length,t)===r}function pke(e,r){if(r=Math.floor(r),e.length==0||r==0)return"";var t=e.length*r;for(r=Math.floor(Math.log(r)/Math.log(2));r;)e+=e,r--;return e+=e.substring(0,t-e.length),e}var wo="",Td="",Ad="",rn="",df={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},yke=10;function PQ(e){var r=Object.keys(e),t=Object.create(Object.getPrototypeOf(e));return r.forEach(function(a){t[a]=e[a]}),Object.defineProperty(t,"message",{value:e.message}),t}function Md(e){return FT(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function mke(e,r,t){var a="",n="",i=0,o="",l=!1,s=Md(e),u=s.split(` +`),f=Md(r).split(` +`),c=0,v="";if(t==="strictEqual"&&Gn(e)==="object"&&Gn(r)==="object"&&e!==null&&r!==null&&(t="strictEqualObject"),u.length===1&&f.length===1&&u[0]!==f[0]){var d=u[0].length+f[0].length;if(d<=yke){if((Gn(e)!=="object"||e===null)&&(Gn(r)!=="object"||r===null)&&(e!==0||r!==0))return"".concat(df[t],` + +`)+"".concat(u[0]," !== ").concat(f[0],` +`)}else if(t!=="strictEqualObject"){var p=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(d2&&(v=` + `.concat(pke(" ",c),"^"),c=0)}}}for(var y=u[u.length-1],m=f[f.length-1];y===m&&(c++<2?o=` + `.concat(y).concat(o):a=y,u.pop(),f.pop(),!(u.length===0||f.length===0));)y=u[u.length-1],m=f[f.length-1];var x=Math.max(u.length,f.length);if(x===0){var T=s.split(` +`);if(T.length>30)for(T[26]="".concat(wo,"...").concat(rn);T.length>27;)T.pop();return"".concat(df.notIdentical,` + +`).concat(T.join(` +`),` +`)}c>3&&(o=` +`.concat(wo,"...").concat(rn).concat(o),l=!0),a!==""&&(o=` + `.concat(a).concat(o),a="");var _=0,b=df[t]+` +`.concat(Td,"+ actual").concat(rn," ").concat(Ad,"- expected").concat(rn),w=" ".concat(wo,"...").concat(rn," Lines skipped");for(c=0;c1&&c>2&&(k>4?(n+=` +`.concat(wo,"...").concat(rn),l=!0):k>3&&(n+=` + `.concat(f[c-2]),_++),n+=` + `.concat(f[c-1]),_++),i=c,a+=` +`.concat(Ad,"-").concat(rn," ").concat(f[c]),_++;else if(f.length1&&c>2&&(k>4?(n+=` +`.concat(wo,"...").concat(rn),l=!0):k>3&&(n+=` + `.concat(u[c-2]),_++),n+=` + `.concat(u[c-1]),_++),i=c,n+=` +`.concat(Td,"+").concat(rn," ").concat(u[c]),_++;else{var M=f[c],q=u[c],E=q!==M&&(!RQ(q,",")||q.slice(0,-1)!==M);E&&RQ(M,",")&&M.slice(0,-1)===q&&(E=!1,q+=","),E?(k>1&&c>2&&(k>4?(n+=` +`.concat(wo,"...").concat(rn),l=!0):k>3&&(n+=` + `.concat(u[c-2]),_++),n+=` + `.concat(u[c-1]),_++),i=c,n+=` +`.concat(Td,"+").concat(rn," ").concat(q),a+=` +`.concat(Ad,"-").concat(rn," ").concat(M),_+=2):(n+=a,a="",(k===1||c===0)&&(n+=` + `.concat(q),_++))}if(_>20&&c30)for(d[26]="".concat(wo,"...").concat(rn);d.length>27;)d.pop();d.length===1?i=t.call(this,"".concat(v," ").concat(d[0])):i=t.call(this,"".concat(v,` + +`).concat(d.join(` +`),` +`))}else{var p=Md(u),y="",m=df[l];l==="notDeepEqual"||l==="notEqual"?(p="".concat(df[l],` + +`).concat(p),p.length>1024&&(p="".concat(p.slice(0,1021),"..."))):(y="".concat(Md(f)),p.length>512&&(p="".concat(p.slice(0,509),"...")),y.length>512&&(y="".concat(y.slice(0,509),"...")),l==="deepEqual"||l==="equal"?p="".concat(m,` + +`).concat(p,` + +should equal + +`):y=" ".concat(l," ").concat(y)),i=t.call(this,"".concat(p).concat(y))}return Error.stackTraceLimit=c,i.generatedMessage=!o,Object.defineProperty(RT(i),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),i.code="ERR_ASSERTION",i.actual=u,i.expected=f,i.operator=l,Error.captureStackTrace&&Error.captureStackTrace(RT(i),s),i.stack,i.name="AssertionError",NQ(i)}return lke(a,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:r,value:function(i,o){return FT(this,EQ(EQ({},o),{},{customInspect:!1,depth:0}))}}]),a}(PT(Error),FT.custom);zQ.exports=gke});var NT=N((QBe,HQ)=>{"use strict";var BQ=Object.prototype.toString;HQ.exports=function(r){var t=BQ.call(r),a=t==="[object Arguments]";return a||(a=t!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&BQ.call(r.callee)==="[object Function]"),a}});var JQ=N((eHe,XQ)=>{"use strict";var ZQ;Object.keys||(qd=Object.prototype.hasOwnProperty,IT=Object.prototype.toString,UQ=NT(),zT=Object.prototype.propertyIsEnumerable,GQ=!zT.call({toString:null},"toString"),VQ=zT.call(function(){},"prototype"),Ld=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Z2=function(e){var r=e.constructor;return r&&r.prototype===e},YQ={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},WQ=function(){if(typeof window=="undefined")return!1;for(var e in window)try{if(!YQ["$"+e]&&qd.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Z2(window[e])}catch(r){return!0}}catch(r){return!0}return!1}(),jQ=function(e){if(typeof window=="undefined"||!WQ)return Z2(e);try{return Z2(e)}catch(r){return!1}},ZQ=function(r){var t=r!==null&&typeof r=="object",a=IT.call(r)==="[object Function]",n=UQ(r),i=t&&IT.call(r)==="[object String]",o=[];if(!t&&!a&&!n)throw new TypeError("Object.keys called on a non-object");var l=VQ&&a;if(i&&r.length>0&&!qd.call(r,0))for(var s=0;s0)for(var u=0;u{"use strict";var bke=Array.prototype.slice,xke=NT(),$Q=Object.keys,X2=$Q?function(r){return $Q(r)}:JQ(),KQ=Object.keys;X2.shim=function(){if(Object.keys){var r=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);r||(Object.keys=function(a){return xke(a)?KQ(bke.call(a)):KQ(a)})}else Object.keys=X2;return Object.keys||X2};QQ.exports=X2});var iee=N((tHe,nee)=>{"use strict";var _ke=OT(),tee=Xg()(),aee=Tv(),eee=Object,wke=aee("Array.prototype.push"),ree=aee("Object.prototype.propertyIsEnumerable"),Tke=tee?Object.getOwnPropertySymbols:null;nee.exports=function(r,t){if(r==null)throw new TypeError("target must be an object");var a=eee(r);if(arguments.length===1)return a;for(var n=1;n{"use strict";var BT=iee(),Ake=function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",r=e.split(""),t={},a=0;a{"use strict";var see=function(e){return e!==e};uee.exports=function(r,t){return r===0&&t===0?1/r===1/t:!!(r===t||see(r)&&see(t))}});var J2=N((iHe,fee)=>{"use strict";var kke=HT();fee.exports=function(){return typeof Object.is=="function"?Object.is:kke}});var Cd=N((oHe,dee)=>{"use strict";var Ske=OT(),qke=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Lke=Object.prototype.toString,Cke=Array.prototype.concat,cee=Object.defineProperty,Eke=function(e){return typeof e=="function"&&Lke.call(e)==="[object Function]"},Dke=T7()(),vee=cee&&Dke,Rke=function(e,r,t,a){if(r in e){if(a===!0){if(e[r]===t)return}else if(!Eke(a)||!a())return}vee?cee(e,r,{configurable:!0,enumerable:!1,value:t,writable:!0}):e[r]=t},hee=function(e,r){var t=arguments.length>2?arguments[2]:{},a=Ske(r);qke&&(a=Cke.call(a,Object.getOwnPropertySymbols(r)));for(var n=0;n{"use strict";var Pke=J2(),Fke=Cd();pee.exports=function(){var r=Pke();return Fke(Object,{is:r},{is:function(){return Object.is!==r}}),r}});var xee=N((sHe,bee)=>{"use strict";var Nke=Cd(),Ike=sd(),zke=HT(),mee=J2(),Oke=yee(),gee=Ike(mee(),Object);Nke(gee,{getPolyfill:mee,implementation:zke,shim:Oke});bee.exports=gee});var UT=N((uHe,_ee)=>{"use strict";_ee.exports=function(r){return r!==r}});var GT=N((fHe,wee)=>{"use strict";var Bke=UT();wee.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:Bke}});var Aee=N((cHe,Tee)=>{"use strict";var Hke=Cd(),Uke=GT();Tee.exports=function(){var r=Uke();return Hke(Number,{isNaN:r},{isNaN:function(){return Number.isNaN!==r}}),r}});var qee=N((vHe,See)=>{"use strict";var Gke=sd(),Vke=Cd(),Yke=UT(),Mee=GT(),Wke=Aee(),kee=Gke(Mee(),Number);Vke(kee,{getPolyfill:Mee,implementation:Yke,shim:Wke});See.exports=kee});var Zee=N((hHe,jee)=>{"use strict";function Lee(e,r){return Jke(e)||Xke(e,r)||Zke(e,r)||jke()}function jke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zke(e,r){if(e){if(typeof e=="string")return Cee(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cee(e,r)}}function Cee(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,a=new Array(r);t10)return!0;for(var r=0;r57)return!0}return e.length===10&&e>=Math.pow(2,32)}function Q2(e){return Object.keys(e).filter(iSe).concat(r3(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function Gee(e,r){if(e===r)return 0;for(var t=e.length,a=r.length,n=0,i=Math.min(t,a);n{"use strict";function To(e){"@babel/helpers - typeof";return To=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},To(e)}function Xee(e,r){for(var t=0;t1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n1?t-1:0),n=1;n{var Fd=1e3,Nd=Fd*60,Id=Nd*60,zd=Id*24,ESe=zd*365.25;hre.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return DSe(e);if(t==="number"&&isNaN(e)===!1)return r.long?PSe(e):RSe(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function DSe(e){if(e=String(e),!(e.length>100)){var r=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(r){var t=parseFloat(r[1]),a=(r[2]||"ms").toLowerCase();switch(a){case"years":case"year":case"yrs":case"yr":case"y":return t*ESe;case"days":case"day":case"d":return t*zd;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Id;case"minutes":case"minute":case"mins":case"min":case"m":return t*Nd;case"seconds":case"second":case"secs":case"sec":case"s":return t*Fd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function RSe(e){return e>=zd?Math.round(e/zd)+"d":e>=Id?Math.round(e/Id)+"h":e>=Nd?Math.round(e/Nd)+"m":e>=Fd?Math.round(e/Fd)+"s":e+"ms"}function PSe(e){return u3(e,zd,"day")||u3(e,Id,"hour")||u3(e,Nd,"minute")||u3(e,Fd,"second")||e+" ms"}function u3(e,r,t){if(!(e{St=pre.exports=JT.debug=JT.default=JT;St.coerce=OSe;St.disable=ISe;St.enable=NSe;St.enabled=zSe;St.humanize=dre();St.names=[];St.skips=[];St.formatters={};var XT;function FSe(e){var r=0,t;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return St.colors[Math.abs(r)%St.colors.length]}function JT(e){function r(){if(r.enabled){var t=r,a=+new Date,n=a-(XT||a);t.diff=n,t.prev=XT,t.curr=a,XT=a;for(var i=new Array(arguments.length),o=0;o{Tn=gre.exports=yre();Tn.log=USe;Tn.formatArgs=HSe;Tn.save=GSe;Tn.load=mre;Tn.useColors=BSe;Tn.storage=typeof chrome!="undefined"&&typeof chrome.storage!="undefined"?chrome.storage.local:VSe();Tn.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function BSe(){return typeof window!="undefined"&&window.process&&window.process.type==="renderer"?!0:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Tn.formatters.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}};function HSe(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+Tn.humanize(this.diff),!!r){var t="color: "+this.color;e.splice(1,0,t,"color: inherit");var a=0,n=0;e[0].replace(/%[a-zA-Z%]/g,function(i){i!=="%%"&&(a++,i==="%c"&&(n=a))}),e.splice(n,0,t)}}function USe(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function GSe(e){try{e==null?Tn.storage.removeItem("debug"):Tn.storage.debug=e}catch(r){}}function mre(){var e;try{e=Tn.storage.debug}catch(r){}return!e&&typeof process!="undefined"&&"env"in process&&(e=process.env.DEBUG),e}Tn.enable(mre());function VSe(){try{return window.localStorage}catch(e){}}});var Sre=N((yHe,kre)=>{var Fv=W2(),Os=bre()("stream-parser");kre.exports=WSe;var _re=-1,f3=0,YSe=1,wre=2;function WSe(e){var r=e&&typeof e._transform=="function",t=e&&typeof e._write=="function";if(!r&&!t)throw new Error("must pass a Writable or Transform stream in");Os("extending Parser into stream"),e._bytes=jSe,e._skipBytes=ZSe,r&&(e._passthrough=XSe),r?e._transform=$Se:e._write=JSe}function Od(e){Os("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=_re,e._parserCallback=null,typeof e.push=="function"&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function jSe(e,r){Fv(!this._parserCallback,'there is already a "callback" set!'),Fv(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||Od(this),Os("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=r,this._parserState=f3}function ZSe(e,r){Fv(!this._parserCallback,'there is already a "callback" set!'),Fv(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||Od(this),Os("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=r,this._parserState=YSe}function XSe(e,r){Fv(!this._parserCallback,'There is already a "callback" set!'),Fv(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||Od(this),Os("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=r,this._parserState=wre}function JSe(e,r,t){this._parserInit||Od(this),Os("write(%o bytes)",e.length),typeof r=="function"&&(t=r),Are(this,e,null,t)}function $Se(e,r,t){this._parserInit||Od(this),Os("transform(%o bytes)",e.length),typeof r!="function"&&(r=this._parserOutput),Are(this,e,r,t)}function Tre(e,r,t,a){return e._parserBytesLeft<=0?a(new Error("got data but not currently parsing anything")):r.length<=e._parserBytesLeft?function(){return xre(e,r,t,a)}:function(){var n=r.slice(0,e._parserBytesLeft);return xre(e,n,t,function(i){if(i)return a(i);if(r.length>n.length)return function(){return Tre(e,r.slice(n.length),t,a)}})}}function xre(e,r,t,a){if(e._parserBytesLeft-=r.length,Os("%o bytes left for stream piece",e._parserBytesLeft),e._parserState===f3?(e._parserBuffers.push(r),e._parserBuffered+=r.length):e._parserState===wre&&t(r),e._parserBytesLeft===0){var n=e._parserCallback;if(n&&e._parserState===f3&&e._parserBuffers.length>1&&(r=Buffer.concat(e._parserBuffers,e._parserBuffered)),e._parserState!==f3&&(r=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=_re,e._parserBuffers.splice(0),n){var i=[];r&&i.push(r),t&&i.push(t);var o=n.length>i.length;o&&i.push(Mre(a));var l=n.apply(e,i);if(!o||a===l)return a}}else return a}var Are=Mre(Tre);function Mre(e){return function(){for(var r=e.apply(this,arguments);typeof r=="function";)r=r();return r}}});var xt=N(Nl=>{"use strict";var qre=xQ().Transform,KSe=Sre();function Bd(){qre.call(this,{readableObjectMode:!0})}Bd.prototype=Object.create(qre.prototype);Bd.prototype.constructor=Bd;KSe(Bd.prototype);Nl.ParserStream=Bd;Nl.sliceEq=function(e,r,t){for(var a=r,n=0;n{"use strict";var Nv=xt().readUInt16BE,KT=xt().readUInt32BE;function Hd(e,r){if(e.length<4+r)return null;var t=KT(e,r);return e.length>4&15,a=e[4]&15,n=e[5]>>4&15,i=Nv(e,6),o=8,l=0;li.width||n.width===i.width&&n.height>i.height?n:i}),t=e.reduce(function(n,i){return n.height>i.height||n.height===i.height&&n.width>i.width?n:i}),a;return r.width>t.height||r.width===t.height&&r.height>t.width?a=r:a=t,a}v3.exports.readSizeFromMeta=function(e){var r={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(aqe(e,r),!!r.sizes.length){var t=nqe(r.sizes),a=1;r.transforms.forEach(function(i){var o={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(i.type==="imir"&&(i.value===0?a=l[a]:(a=l[a],a=o[a],a=o[a])),i.type==="irot")for(var s=0;s{"use strict";function h3(e,r){var t=new Error(e);return t.code=r,t}function iqe(e){try{return decodeURIComponent(escape(e))}catch(r){return e}}function Il(e,r,t){this.input=e.subarray(r,t),this.start=r;var a=String.fromCharCode.apply(null,this.input.subarray(0,4));if(a!=="II*\0"&&a!=="MM\0*")throw h3("invalid TIFF signature","EBADDATA");this.big_endian=a[0]==="M"}Il.prototype.each=function(e){this.aborted=!1;var r=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:r}];this.ifds_to_read.length>0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,e)}};Il.prototype.read_uint16=function(e){var r=this.input;if(e+2>r.length)throw h3("unexpected EOF","EBADDATA");return this.big_endian?r[e]*256+r[e+1]:r[e]+r[e+1]*256};Il.prototype.read_uint32=function(e){var r=this.input;if(e+4>r.length)throw h3("unexpected EOF","EBADDATA");return this.big_endian?r[e]*16777216+r[e+1]*65536+r[e+2]*256+r[e+3]:r[e]+r[e+1]*256+r[e+2]*65536+r[e+3]*16777216};Il.prototype.is_subifd_link=function(e,r){return e===0&&r===34665||e===0&&r===34853||e===34665&&r===40965};Il.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}};Il.prototype.exif_format_read=function(e,r){var t;switch(e){case 1:case 2:return t=this.input[r],t;case 6:return t=this.input[r],t|(t&128)*33554430;case 3:return t=this.read_uint16(r),t;case 8:return t=this.read_uint16(r),t|(t&32768)*131070;case 4:return t=this.read_uint32(r),t;case 9:return t=this.read_uint32(r),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}};Il.prototype.scan_ifd=function(e,r,t){var a=this.read_uint16(r);r+=2;for(var n=0;nthis.input.length)throw h3("unexpected EOF","EBADDATA");for(var v=[],d=f,p=0;p0&&(this.ifds_to_read.push({id:i,offset:v[0]}),c=!0);var m={is_big_endian:this.big_endian,ifd:e,tag:i,format:o,count:l,entry_offset:r+this.start,data_length:u,data_offset:f+this.start,value:v,is_subifd_link:c};if(t(m)===!1){this.aborted=!0;return}r+=12}e===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(r)})};QT.exports.ExifParser=Il;QT.exports.get_orientation=function(e){var r=0;try{return new Il(e,0,e.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return r=t.value[0],!1}),r}catch(t){return-1}}});var Ere=N((xHe,Cre)=>{"use strict";var oqe=xt().str2arr,lqe=xt().sliceEq,sqe=xt().readUInt32BE,p3=Lre(),uqe=d3(),fqe=oqe("ftyp");Cre.exports=function(e){if(lqe(e,4,fqe)){var r=p3.unbox(e,0);if(r){var t=p3.getMimeType(r.data);if(t){for(var a,n=r.end;;){var i=p3.unbox(e,n);if(!i)break;if(n=i.end,i.boxtype==="mdat")return;if(i.boxtype==="meta"){a=i.data;break}}if(a){var o=p3.readSizeFromMeta(a);if(o){var l={width:o.width,height:o.height,type:t.type,mime:t.mime,wUnits:"px",hUnits:"px"};if(o.variants.length>1&&(l.variants=o.variants),o.orientation&&(l.orientation=o.orientation),o.exif_location&&o.exif_location.offset+o.exif_location.length<=e.length){var s=sqe(e,o.exif_location.offset),u=e.slice(o.exif_location.offset+s+4,o.exif_location.offset+o.exif_location.length),f=uqe.get_orientation(u);f>0&&(l.orientation=f)}return l}}}}}}});var Pre=N((_He,Rre)=>{"use strict";var cqe=xt().str2arr,vqe=xt().sliceEq,Dre=xt().readUInt16LE,hqe=cqe("BM");Rre.exports=function(e){if(!(e.length<26)&&vqe(e,0,hqe))return{width:Dre(e,18),height:Dre(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}});var Ore=N((wHe,zre)=>{"use strict";var Ire=xt().str2arr,Fre=xt().sliceEq,Nre=xt().readUInt16LE,dqe=Ire("GIF87a"),pqe=Ire("GIF89a");zre.exports=function(e){if(!(e.length<10)&&!(!Fre(e,0,dqe)&&!Fre(e,0,pqe)))return{width:Nre(e,6),height:Nre(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}});var Ure=N((THe,Hre)=>{"use strict";var eA=xt().readUInt16LE,yqe=0,mqe=1,Bre=16;Hre.exports=function(e){var r=eA(e,0),t=eA(e,2),a=eA(e,4);if(!(r!==yqe||t!==mqe||!a)){for(var n=[],i={width:0,height:0},o=0;oi.width||s>i.height)&&(i=u)}return{width:i.width,height:i.height,variants:n,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}});var Vre=N((AHe,Gre)=>{"use strict";var rA=xt().readUInt16BE,gqe=xt().str2arr,bqe=xt().sliceEq,xqe=d3(),_qe=gqe("Exif\0\0");Gre.exports=function(e){if(!(e.length<2)&&!(e[0]!==255||e[1]!==216||e[2]!==255))for(var r=2;;){for(;;){if(e.length-r<2)return;if(e[r++]===255)break}for(var t=e[r++],a;t===255;)t=e[r++];if(208<=t&&t<=217||t===1)a=0;else if(192<=t&&t<=254){if(e.length-r<2)return;a=rA(e,r)-2,r+=2}else return;if(t===217||t===218)return;var n;if(t===225&&a>=10&&bqe(e,r,_qe)&&(n=xqe.get_orientation(e.slice(r+6,r+a))),a>=5&&192<=t&&t<=207&&t!==196&&t!==200&&t!==204){if(e.length-r0&&(i.orientation=n),i}r+=a}}});var Xre=N((MHe,Zre)=>{"use strict";var jre=xt().str2arr,Yre=xt().sliceEq,Wre=xt().readUInt32BE,wqe=jre(`\x89PNG\r + +`),Tqe=jre("IHDR");Zre.exports=function(e){if(!(e.length<24)&&Yre(e,0,wqe)&&Yre(e,12,Tqe))return{width:Wre(e,16),height:Wre(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}});var Kre=N((kHe,$re)=>{"use strict";var Aqe=xt().str2arr,Mqe=xt().sliceEq,Jre=xt().readUInt32BE,kqe=Aqe("8BPS\0");$re.exports=function(e){if(!(e.length<22)&&Mqe(e,0,kqe))return{width:Jre(e,18),height:Jre(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}});var rte=N((SHe,ete)=>{"use strict";function Sqe(e){return e===32||e===9||e===13||e===10}function Iv(e){return typeof e=="number"&&isFinite(e)&&e>0}function qqe(e){var r=0,t=e.length;for(e[0]===239&&e[1]===187&&e[2]===191&&(r=3);r]*>/,Cqe=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,Eqe=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,Dqe=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,Rqe=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,Qre=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function Pqe(e){var r=e.match(Eqe),t=e.match(Dqe),a=e.match(Rqe);return{width:r&&(r[1]||r[2]),height:t&&(t[1]||t[2]),viewbox:a&&(a[1]||a[2])}}function nl(e){return Qre.test(e)?e.match(Qre)[0]:"px"}ete.exports=function(e){if(qqe(e)){for(var r="",t=0;t{"use strict";var nte=xt().str2arr,tte=xt().sliceEq,Fqe=xt().readUInt16LE,Nqe=xt().readUInt16BE,Iqe=xt().readUInt32LE,zqe=xt().readUInt32BE,Oqe=nte("II*\0"),Bqe=nte("MM\0*");function y3(e,r,t){return t?Nqe(e,r):Fqe(e,r)}function tA(e,r,t){return t?zqe(e,r):Iqe(e,r)}function ate(e,r,t){var a=y3(e,r+2,t),n=tA(e,r+4,t);return n!==1||a!==3&&a!==4?null:a===3?y3(e,r+8,t):tA(e,r+8,t)}ite.exports=function(e){if(!(e.length<8)&&!(!tte(e,0,Oqe)&&!tte(e,0,Bqe))){var r=e[0]===77,t=tA(e,4,r)-8;if(!(t<0)){var a=t+8;if(!(e.length-a<2)){var n=y3(e,a+0,r)*12;if(!(n<=0)&&(a+=2,!(e.length-a{"use strict";var ute=xt().str2arr,lte=xt().sliceEq,ste=xt().readUInt16LE,aA=xt().readUInt32LE,Hqe=d3(),Uqe=ute("RIFF"),Gqe=ute("WEBP");function Vqe(e,r){if(!(e[r+3]!==157||e[r+4]!==1||e[r+5]!==42))return{width:ste(e,r+6)&16383,height:ste(e,r+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function Yqe(e,r){if(e[r]===47){var t=aA(e,r+1);return{width:(t&16383)+1,height:(t>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function Wqe(e,r){return{width:(e[r+6]<<16|e[r+5]<<8|e[r+4])+1,height:(e[r+9]<e.length)){for(;r+8=10?t=t||Vqe(e,r+8):i==="VP8L"&&o>=9?t=t||Yqe(e,r+8):i==="VP8X"&&o>=10?t=t||Wqe(e,r+8):i==="EXIF"&&(a=Hqe.get_orientation(e.slice(r+8,r+8+o)),r=1/0),r+=8+o}if(t)return a>0&&(t.orientation=a),t}}}});var hte=N((CHe,vte)=>{"use strict";vte.exports={avif:Ere(),bmp:Pre(),gif:Ore(),ico:Ure(),jpeg:Vre(),png:Xre(),psd:Kre(),svg:rte(),tiff:ote(),webp:cte()}});var dte=N((EHe,iA)=>{"use strict";var nA=hte();function jqe(e){for(var r=Object.keys(nA),t=0;t{"use strict";var Zqe=dte(),Xqe=Tl().IMAGE_URL_PREFIX,Jqe=pv().Buffer;pte.getImageSize=function(e){var r=e.replace(Xqe,""),t=new Jqe(r,"base64");return Zqe(t)}});var bte=N((RHe,gte)=>{"use strict";var mte=Ee(),$qe=uv(),Kqe=Rr(),m3=zr(),Qqe=Ee().maxRowLength,eLe=yte().getImageSize;gte.exports=function(r,t){var a,n;if(t._hasZ)a=t.z.length,n=Qqe(t.z);else if(t._hasSource){var i=eLe(t.source);a=i.height,n=i.width}var o=m3.getFromId(r,t.xaxis||"x"),l=m3.getFromId(r,t.yaxis||"y"),s=o.d2c(t.x0)-t.dx/2,u=l.d2c(t.y0)-t.dy/2,f,c=[s,s+n*t.dx],v=[u,u+a*t.dy];if(o&&o.type==="log")for(f=0;f{"use strict";var nLe=Sr(),pf=Ee(),xte=pf.strTranslate,iLe=dl(),oLe=uv(),lLe=s6(),sLe=Tg().STYLE;_te.exports=function(r,t,a,n){var i=t.xaxis,o=t.yaxis,l=!r._context._exportedPlot&&lLe();pf.makeTraceGroups(n,a,"im").each(function(s){var u=nLe.select(this),f=s[0],c=f.trace,v=(c.zsmooth==="fast"||c.zsmooth===!1&&l)&&!c._hasZ&&c._hasSource&&i.type==="linear"&&o.type==="linear";c._realImage=v;var d=f.z,p=f.x0,y=f.y0,m=f.w,x=f.h,T=c.dx,_=c.dy,b,w,k,M,q,E;for(E=0;b===void 0&&E0;)w=i.c2p(p+E*T),E--;for(E=0;M===void 0&&E0;)q=o.c2p(y+E*_),E--;if(wH[0];if(X||j){var ee=b+P/2,fe=M+R/2;Y+="transform:"+xte(ee+"px",fe+"px")+"scale("+(X?-1:1)+","+(j?-1:1)+")"+xte(-ee+"px",-fe+"px")+";"}}G.attr("style",Y);var ie=new Promise(function(ue){if(c._hasZ)ue();else if(c._hasSource)if(c._canvas&&c._canvas.el.width===m&&c._canvas.el.height===x&&c._canvas.source===c.source)ue();else{var K=document.createElement("canvas");K.width=m,K.height=x;var we=K.getContext("2d",{willReadFrequently:!0});c._image=c._image||new Image;var se=c._image;se.onload=function(){we.drawImage(se,0,0),c._canvas={el:K,source:c.source},ue()},se.setAttribute("src",c.source)}}).then(function(){var ue,K;if(c._hasZ)K=B(function(ce,he){var ye=d[he][ce];return pf.isTypedArray(ye)&&(ye=Array.from(ye)),ye}),ue=K.toDataURL("image/png");else if(c._hasSource)if(v)ue=c.source;else{var we=c._canvas.el.getContext("2d",{willReadFrequently:!0}),se=we.getImageData(0,0,m,x).data;K=B(function(ce,he){var ye=4*(he*m+ce);return[se[ye],se[ye+1],se[ye+2],se[ye+3]]}),ue=K.toDataURL("image/png")}G.attr({"xlink:href":ue,height:R,width:P,x:b,y:M})});r._promises.push(ie)})}});var Ate=N((FHe,Tte)=>{"use strict";var uLe=Sr();Tte.exports=function(r){uLe.select(r).selectAll(".im image").style("opacity",function(t){return t[0].trace.opacity})}});var qte=N((NHe,Ste)=>{"use strict";var Mte=Fn(),kte=Ee(),g3=kte.isArrayOrTypedArray,fLe=uv();Ste.exports=function(r,t,a){var n=r.cd[0],i=n.trace,o=r.xa,l=r.ya;if(!(Mte.inbox(t-n.x0,t-(n.x0+n.w*i.dx),0)>0||Mte.inbox(a-n.y0,a-(n.y0+n.h*i.dy),0)>0)){var s=Math.floor((t-n.x0)/i.dx),u=Math.floor(Math.abs(a-n.y0)/i.dy),f;if(i._hasZ?f=n.z[u][s]:i._hasSource&&(f=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(s,u,1,1).data),!!f){var c=n.hi||i.hoverinfo,v;if(c){var d=c.split("+");d.indexOf("all")!==-1&&(d=["color"]),d.indexOf("color")!==-1&&(v=!0)}var p=fLe.colormodel[i.colormodel],y=p.colormodel||i.colormodel,m=y.length,x=i._scaler(f),T=p.suffix,_=[];(i.hovertemplate||v)&&(_.push("["+[x[0]+T[0],x[1]+T[1],x[2]+T[2]].join(", ")),m===4&&_.push(", "+x[3]+T[3]),_.push("]"),_=_.join(""),r.extraText=y.toUpperCase()+": "+_);var b;g3(i.hovertext)&&g3(i.hovertext[u])?b=i.hovertext[u][s]:g3(i.text)&&g3(i.text[u])&&(b=i.text[u][s]);var w=l.c2p(n.y0+(u+.5)*i.dy),k=n.x0+(s+.5)*i.dx,M=n.y0+(u+.5)*i.dy,q="["+f.slice(0,i.colormodel.length).join(", ")+"]";return[kte.extendFlat(r,{index:[u,s],x0:o.c2p(n.x0+s*i.dx),x1:o.c2p(n.x0+(s+1)*i.dx),y0:w,y1:w,color:x,xVal:k,xLabelVal:k,yVal:M,yLabelVal:M,zLabelVal:q,text:b,hovertemplateLabels:{zLabel:q,colorLabel:_,"color[0]Label":x[0]+T[0],"color[1]Label":x[1]+T[1],"color[2]Label":x[2]+T[2],"color[3]Label":x[3]+T[3]}})]}}}});var Cte=N((IHe,Lte)=>{"use strict";Lte.exports=function(r,t){return"xVal"in t&&(r.x=t.xVal),"yVal"in t&&(r.y=t.yVal),t.xa&&(r.xaxis=t.xa),t.ya&&(r.yaxis=t.ya),r.color=t.color,r.colormodel=t.trace.colormodel,r.z||(r.z=t.color),r}});var Dte=N((zHe,Ete)=>{"use strict";Ete.exports={attributes:r7(),supplyDefaults:qX(),calc:bte(),plot:wte(),style:Ate(),hoverPoints:qte(),eventData:Cte(),moduleType:"trace",name:"image",basePlotModule:Ei(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}});var Pte=N((OHe,Rte)=>{"use strict";Rte.exports=Dte()});var lA=N((BHe,Nte)=>{"use strict";var oA=gn(),cLe=Uc().attributes,vLe=ga(),hLe=fi(),{hovertemplateAttrs:dLe,texttemplateAttrs:pLe,templatefallbackAttrs:Fte}=Wn(),yf=bt().extendFlat,yLe=ci().pattern,b3=vLe({editType:"plot",arrayOk:!0,colorEditType:"plot"});Nte.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:hLe.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:yLe,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:yf({},oA.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:dLe({},{keys:["label","color","value","percent","text"]}),hovertemplatefallback:Fte(),texttemplate:pLe({editType:"plot"},{keys:["label","color","value","percent","text"]}),texttemplatefallback:Fte({editType:"plot"}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:yf({},b3,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:yf({},b3,{}),outsidetextfont:yf({},b3,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:yf({},oA.showlegend,{arrayOk:!0}),legend:yf({},oA.legend,{arrayOk:!0}),title:{text:{valType:"string",dflt:"",editType:"plot"},font:yf({},b3,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:cLe({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}});var Bte=N((HHe,Ote)=>{"use strict";var mLe=Rr(),Ud=Ee(),gLe=lA(),bLe=Uc().defaults,xLe=ju().handleText,_Le=Ee().coercePattern;function Ite(e,r){var t=Ud.isArrayOrTypedArray(e),a=Ud.isArrayOrTypedArray(r),n=Math.min(t?e.length:1/0,a?r.length:1/0);if(isFinite(n)||(n=0),n&&a){for(var i,o=0;o0){i=!0;break}}i||(n=0)}return{hasLabels:t,hasValues:a,len:n}}function zte(e,r,t,a,n){var i=a("marker.line.width");i&&a("marker.line.color",n?void 0:t.paper_bgcolor);var o=a("marker.colors");_Le(a,"marker.pattern",o),e.marker&&!r.marker.pattern.fgcolor&&(r.marker.pattern.fgcolor=e.marker.colors),r.marker.pattern.bgcolor||(r.marker.pattern.bgcolor=t.paper_bgcolor)}function wLe(e,r,t,a){function n(T,_){return Ud.coerce(e,r,gLe,T,_)}var i=n("labels"),o=n("values"),l=Ite(i,o),s=l.len;if(r._hasLabels=l.hasLabels,r._hasValues=l.hasValues,!r._hasLabels&&r._hasValues&&(n("label0"),n("dlabel")),!s){r.visible=!1;return}r._length=s,zte(e,r,a,n,!0),n("scalegroup");var u=n("text"),f=n("texttemplate");n("texttemplatefallback");var c;if(f||(c=n("textinfo",Ud.isArrayOrTypedArray(u)?"text+percent":"percent")),n("hovertext"),n("hovertemplate"),n("hovertemplatefallback"),f||c&&c!=="none"){var v=n("textposition");xLe(e,r,a,n,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var d=Array.isArray(v)||v==="auto",p=d||v==="outside";p&&n("automargin"),(v==="inside"||v==="auto"||Array.isArray(v))&&n("insidetextorientation")}else c==="none"&&n("textposition","none");bLe(r,a,n);var y=n("hole"),m=n("title.text");if(m){var x=n("title.position",y?"middle center":"top center");!y&&x==="middle center"&&(r.title.position="top center"),Ud.coerceFont(n,"title.font",a.font)}n("sort"),n("direction"),n("rotation"),n("pull")}Ote.exports={handleLabelsAndValues:Ite,handleMarkerDefaults:zte,supplyDefaults:wLe}});var sA=N((UHe,Hte)=>{"use strict";Hte.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}});var Gte=N((GHe,Ute)=>{"use strict";var TLe=Ee(),ALe=sA();Ute.exports=function(r,t){function a(n,i){return TLe.coerce(r,t,ALe,n,i)}a("hiddenlabels"),a("piecolorway",t.colorway),a("extendpiecolors")}});var fA=N((VHe,Wte)=>{"use strict";var MLe=Rr(),uA=qn(),kLe=Tr(),SLe={};function qLe(e,r){var t=[],a=e._fullLayout,n=a.hiddenlabels||[],i=r.labels,o=r.marker.colors||[],l=r.values,s=r._length,u=r._hasValues&&s,f,c;if(r.dlabel)for(i=new Array(s),f=0;f=0});var b=r.type==="funnelarea"?y:r.sort;return b&&t.sort(function(w,k){return k.v-w.v}),t[0]&&(t[0].vTotal=p),t}function Vte(e){return function(t,a){return!t||(t=uA(t),!t.isValid())?!1:(t=kLe.addOpacity(t,t.getAlpha()),e[a]||(e[a]=t),t)}}function LLe(e,r){var t=(r||{}).type;t||(t="pie");var a=e._fullLayout,n=e.calcdata,i=a[t+"colorway"],o=a["_"+t+"colormap"];a["extend"+t+"colors"]&&(i=Yte(i,SLe));for(var l=0,s=0;s{"use strict";var CLe=Eo().appendArrayMultiPointValues;jte.exports=function(r,t){var a={curveNumber:t.index,pointNumbers:r.pts,data:t._input,fullData:t,label:r.label,color:r.color,value:r.v,percent:r.percent,text:r.text,bbox:r.bbox,v:r.v};return r.pts.length===1&&(a.pointNumber=a.i=r.pts[0]),CLe(a,t,r.pts),t.type==="funnelarea"&&(delete a.v,delete a.i),a}});var yae=N((WHe,pae)=>{"use strict";var Vn=Sr(),ELe=aa(),x3=Fn(),eae=Tr(),zl=Yr(),Za=Ee(),DLe=Za.strScale,Xte=Za.strTranslate,cA=Aa(),rae=N0(),RLe=rae.recordMinTextSize,PLe=rae.clearMinTextSize,tae=m0().TEXTPAD,Ar=K1(),_3=Zte(),Jte=Ee().isValidTextValue;function FLe(e,r){var t=e._context.staticPlot,a=e._fullLayout,n=a._size;PLe("pie",a),iae(r,e),vae(r,n);var i=Za.makeTraceGroups(a._pielayer,r,"trace").each(function(o){var l=Vn.select(this),s=o[0],u=s.trace;VLe(o),l.attr("stroke-linejoin","round"),l.each(function(){var f=Vn.select(this).selectAll("g.slice").data(o);f.enter().append("g").classed("slice",!0),f.exit().remove();var c=[[[],[]],[[],[]]],v=!1;f.each(function(b,w){if(b.hidden){Vn.select(this).selectAll("path,g").remove();return}b.pointNumber=b.i,b.curveNumber=u.index,c[b.pxmid[1]<0?0:1][b.pxmid[0]<0?0:1].push(b);var k=s.cx,M=s.cy,q=Vn.select(this),E=q.selectAll("path.surface").data([b]);if(E.enter().append("path").classed("surface",!0).style({"pointer-events":t?"none":"all"}),q.call(aae,e,o),u.pull){var D=+Ar.castOption(u.pull,b.pts)||0;D>0&&(k+=D*b.pxmid[0],M+=D*b.pxmid[1])}b.cxFinal=k,b.cyFinal=M;function P(V,H,X,j){var ee=j*(H[0]-V[0]),fe=j*(H[1]-V[1]);return"a"+j*s.r+","+j*s.r+" 0 "+b.largeArc+(X?" 1 ":" 0 ")+ee+","+fe}var R=u.hole;if(b.v===s.vTotal){var z="M"+(k+b.px0[0])+","+(M+b.px0[1])+P(b.px0,b.pxmid,!0,1)+P(b.pxmid,b.px0,!0,1)+"Z";R?E.attr("d","M"+(k+R*b.px0[0])+","+(M+R*b.px0[1])+P(b.px0,b.pxmid,!1,R)+P(b.pxmid,b.px0,!1,R)+"Z"+z):E.attr("d",z)}else{var I=P(b.px0,b.px1,!0,1);if(R){var B=1-R;E.attr("d","M"+(k+R*b.px1[0])+","+(M+R*b.px1[1])+P(b.px1,b.px0,!1,R)+"l"+B*b.px0[0]+","+B*b.px0[1]+I+"Z")}else E.attr("d","M"+k+","+M+"l"+b.px0[0]+","+b.px0[1]+I+"Z")}hae(e,b,s);var G=Ar.castOption(u.textposition,b.pts),Y=q.selectAll("g.slicetext").data(b.text&&G!=="none"?[0]:[]);Y.enter().append("g").classed("slicetext",!0),Y.exit().remove(),Y.each(function(){var V=Za.ensureSingle(Vn.select(this),"text","",function(K){K.attr("data-notex",1)}),H=Za.ensureUniformFontSize(e,G==="outside"?ILe(u,b,a.font):nae(u,b,a.font));V.text(b.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(zl.font,H).call(cA.convertToTspans,e);var X=zl.bBox(V.node()),j;if(G==="outside")j=Qte(X,b);else if(j=oae(X,b,s),G==="auto"&&j.scale<1){var ee=Za.ensureUniformFontSize(e,u.outsidetextfont);V.call(zl.font,ee),X=zl.bBox(V.node()),j=Qte(X,b)}var fe=j.textPosAngle,ie=fe===void 0?b.pxmid:w3(s.r,fe);if(j.targetX=k+ie[0]*j.rCenter+(j.x||0),j.targetY=M+ie[1]*j.rCenter+(j.y||0),dae(j,X),j.outside){var ue=j.targetY;b.yLabelMin=ue-X.height/2,b.yLabelMid=ue,b.yLabelMax=ue+X.height/2,b.labelExtraX=0,b.labelExtraY=0,v=!0}j.fontSize=H.size,RLe(u.type,j,a),o[w].transform=j,Za.setTransormAndDisplay(V,j)})});var d=Vn.select(this).selectAll("g.titletext").data(u.title.text?[0]:[]);if(d.enter().append("g").classed("titletext",!0),d.exit().remove(),d.each(function(){var b=Za.ensureSingle(Vn.select(this),"text","",function(M){M.attr("data-notex",1)}),w=u.title.text;u._meta&&(w=Za.templateString(w,u._meta)),b.text(w).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(zl.font,u.title.font).call(cA.convertToTspans,e);var k;u.title.position==="middle center"?k=BLe(s):k=fae(s,n),b.attr("transform",Xte(k.x,k.y)+DLe(Math.min(1,k.scale))+Xte(k.tx,k.ty))}),v&&ULe(c,u),NLe(f,u),v&&u.automargin){var p=zl.bBox(l.node()),y=u.domain,m=n.w*(y.x[1]-y.x[0]),x=n.h*(y.y[1]-y.y[0]),T=(.5*m-s.r)/n.w,_=(.5*x-s.r)/n.h;ELe.autoMargin(e,"pie."+u.uid+".automargin",{xl:y.x[0]-T,xr:y.x[1]+T,yb:y.y[0]-_,yt:y.y[1]+_,l:Math.max(s.cx-s.r-p.left,0),r:Math.max(p.right-(s.cx+s.r),0),b:Math.max(p.bottom-(s.cy+s.r),0),t:Math.max(s.cy-s.r-p.top,0),pad:5})}})});setTimeout(function(){i.selectAll("tspan").each(function(){var o=Vn.select(this);o.attr("dy")&&o.attr("dy",o.attr("dy"))})},0)}function NLe(e,r){e.each(function(t){var a=Vn.select(this);if(!t.labelExtraX&&!t.labelExtraY){a.select("path.textline").remove();return}var n=a.select("g.slicetext text");t.transform.targetX+=t.labelExtraX,t.transform.targetY+=t.labelExtraY,Za.setTransormAndDisplay(n,t.transform);var i=t.cxFinal+t.pxmid[0],o=t.cyFinal+t.pxmid[1],l="M"+i+","+o,s=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var u=t.labelExtraX*t.pxmid[1]/t.pxmid[0],f=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(u)>Math.abs(f)?l+="l"+f*t.pxmid[0]/t.pxmid[1]+","+f+"H"+(i+t.labelExtraX+s):l+="l"+t.labelExtraX+","+u+"v"+(f-u)+"h"+s}else l+="V"+(t.yLabelMid+t.labelExtraY)+"h"+s;Za.ensureSingle(a,"path","textline").call(eae.stroke,r.outsidetextfont.color).attr({"stroke-width":Math.min(2,r.outsidetextfont.size/8),d:l,fill:"none"})})}function aae(e,r,t){var a=t[0],n=a.cx,i=a.cy,o=a.trace,l=o.type==="funnelarea";"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),e.on("mouseover",function(s){var u=r._fullLayout,f=r._fullData[o.index];if(!(r._dragging||u.hovermode===!1)){var c=f.hoverinfo;if(Array.isArray(c)&&(c=x3.castHoverinfo({hoverinfo:[Ar.castOption(c,s.pts)],_module:o._module},u,0)),c==="all"&&(c="label+text+value+percent+name"),f.hovertemplate||c!=="none"&&c!=="skip"&&c){var v=s.rInscribed||0,d=n+s.pxmid[0]*(1-v),p=i+s.pxmid[1]*(1-v),y=u.separators,m=[];if(c&&c.indexOf("label")!==-1&&m.push(s.label),s.text=Ar.castOption(f.hovertext||f.text,s.pts),c&&c.indexOf("text")!==-1){var x=s.text;Za.isValidTextValue(x)&&m.push(x)}s.value=s.v,s.valueLabel=Ar.formatPieValue(s.v,y),c&&c.indexOf("value")!==-1&&m.push(s.valueLabel),s.percent=s.v/a.vTotal,s.percentLabel=Ar.formatPiePercent(s.percent,y),c&&c.indexOf("percent")!==-1&&m.push(s.percentLabel);var T=f.hoverlabel,_=T.font,b=[];x3.loneHover({trace:o,x0:d-v*a.r,x1:d+v*a.r,y:p,_x0:l?n+s.TL[0]:d-v*a.r,_x1:l?n+s.TR[0]:d+v*a.r,_y0:l?i+s.TL[1]:p-v*a.r,_y1:l?i+s.BL[1]:p+v*a.r,text:m.join("
"),name:f.hovertemplate||c.indexOf("name")!==-1?f.name:void 0,idealAlign:s.pxmid[0]<0?"left":"right",color:Ar.castOption(T.bgcolor,s.pts)||s.color,borderColor:Ar.castOption(T.bordercolor,s.pts),fontFamily:Ar.castOption(_.family,s.pts),fontSize:Ar.castOption(_.size,s.pts),fontColor:Ar.castOption(_.color,s.pts),nameLength:Ar.castOption(T.namelength,s.pts),textAlign:Ar.castOption(T.align,s.pts),hovertemplate:Ar.castOption(f.hovertemplate,s.pts),hovertemplateLabels:s,eventData:[_3(s,f)]},{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:r,inOut_bbox:b}),s.bbox=b[0],o._hasHoverLabel=!0}o._hasHoverEvent=!0,r.emit("plotly_hover",{points:[_3(s,f)],event:Vn.event})}}),e.on("mouseout",function(s){var u=r._fullLayout,f=r._fullData[o.index],c=Vn.select(this).datum();o._hasHoverEvent&&(s.originalEvent=Vn.event,r.emit("plotly_unhover",{points:[_3(c,f)],event:Vn.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(x3.loneUnhover(u._hoverlayer.node()),o._hasHoverLabel=!1)}),e.on("click",function(s){var u=r._fullLayout,f=r._fullData[o.index];r._dragging||u.hovermode===!1||(r._hoverdata=[_3(s,f)],x3.click(r,Vn.event))})}function ILe(e,r,t){var a=Ar.castOption(e.outsidetextfont.color,r.pts)||Ar.castOption(e.textfont.color,r.pts)||t.color,n=Ar.castOption(e.outsidetextfont.family,r.pts)||Ar.castOption(e.textfont.family,r.pts)||t.family,i=Ar.castOption(e.outsidetextfont.size,r.pts)||Ar.castOption(e.textfont.size,r.pts)||t.size,o=Ar.castOption(e.outsidetextfont.weight,r.pts)||Ar.castOption(e.textfont.weight,r.pts)||t.weight,l=Ar.castOption(e.outsidetextfont.style,r.pts)||Ar.castOption(e.textfont.style,r.pts)||t.style,s=Ar.castOption(e.outsidetextfont.variant,r.pts)||Ar.castOption(e.textfont.variant,r.pts)||t.variant,u=Ar.castOption(e.outsidetextfont.textcase,r.pts)||Ar.castOption(e.textfont.textcase,r.pts)||t.textcase,f=Ar.castOption(e.outsidetextfont.lineposition,r.pts)||Ar.castOption(e.textfont.lineposition,r.pts)||t.lineposition,c=Ar.castOption(e.outsidetextfont.shadow,r.pts)||Ar.castOption(e.textfont.shadow,r.pts)||t.shadow;return{color:a,family:n,size:i,weight:o,style:l,variant:s,textcase:u,lineposition:f,shadow:c}}function nae(e,r,t){var a=Ar.castOption(e.insidetextfont.color,r.pts);!a&&e._input.textfont&&(a=Ar.castOption(e._input.textfont.color,r.pts));var n=Ar.castOption(e.insidetextfont.family,r.pts)||Ar.castOption(e.textfont.family,r.pts)||t.family,i=Ar.castOption(e.insidetextfont.size,r.pts)||Ar.castOption(e.textfont.size,r.pts)||t.size,o=Ar.castOption(e.insidetextfont.weight,r.pts)||Ar.castOption(e.textfont.weight,r.pts)||t.weight,l=Ar.castOption(e.insidetextfont.style,r.pts)||Ar.castOption(e.textfont.style,r.pts)||t.style,s=Ar.castOption(e.insidetextfont.variant,r.pts)||Ar.castOption(e.textfont.variant,r.pts)||t.variant,u=Ar.castOption(e.insidetextfont.textcase,r.pts)||Ar.castOption(e.textfont.textcase,r.pts)||t.textcase,f=Ar.castOption(e.insidetextfont.lineposition,r.pts)||Ar.castOption(e.textfont.lineposition,r.pts)||t.lineposition,c=Ar.castOption(e.insidetextfont.shadow,r.pts)||Ar.castOption(e.textfont.shadow,r.pts)||t.shadow;return{color:a||eae.contrast(r.color),family:n,size:i,weight:o,style:l,variant:s,textcase:u,lineposition:f,shadow:c}}function iae(e,r){for(var t,a,n=0;n=-4;T-=2)x(Math.PI*T,"tan");for(T=4;T>=-4;T-=2)x(Math.PI*(T+1),"tan")}if(c||d){for(T=4;T>=-4;T-=2)x(Math.PI*(T+1.5),"rad");for(T=4;T>=-4;T-=2)x(Math.PI*(T+.5),"rad")}}if(l||p||c){var _=Math.sqrt(e.width*e.width+e.height*e.height);if(m={scale:n*a*2/_,rCenter:1-n,rotate:0},m.textPosAngle=(r.startangle+r.stopangle)/2,m.scale>=1)return m;y.push(m)}(p||d)&&(m=$te(e,a,o,s,u),m.textPosAngle=(r.startangle+r.stopangle)/2,y.push(m)),(p||v)&&(m=Kte(e,a,o,s,u),m.textPosAngle=(r.startangle+r.stopangle)/2,y.push(m));for(var b=0,w=0,k=0;k=1)break}return y[b]}function zLe(e,r){var t=e.startangle,a=e.stopangle;return t>r&&r>a||t0?1:-1)/2,y:i/(1+t*t/(a*a)),outside:!0}}function BLe(e){var r=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/r,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}function fae(e,r){var t=1,a=1,n,i=e.trace,o={x:e.cx,y:e.cy},l={tx:0,ty:0};l.ty+=i.title.font.size,n=cae(i),i.title.position.indexOf("top")!==-1?(o.y-=(1+n)*e.r,l.ty-=e.titleBox.height):i.title.position.indexOf("bottom")!==-1&&(o.y+=(1+n)*e.r);var s=HLe(e.r,e.trace.aspectratio),u=r.w*(i.domain.x[1]-i.domain.x[0])/2;return i.title.position.indexOf("left")!==-1?(u=u+s,o.x-=(1+n)*s,l.tx+=e.titleBox.width/2):i.title.position.indexOf("center")!==-1?u*=2:i.title.position.indexOf("right")!==-1&&(u=u+s,o.x+=(1+n)*s,l.tx-=e.titleBox.width/2),t=u/e.titleBox.width,a=vA(e,r)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(t,a),tx:l.tx,ty:l.ty}}function HLe(e,r){return e/(r===void 0?1:r)}function vA(e,r){var t=e.trace,a=r.h*(t.domain.y[1]-t.domain.y[0]);return Math.min(e.titleBox.height,a/2)}function cae(e){var r=e.pull;if(!r)return 0;var t;if(Za.isArrayOrTypedArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function ULe(e,r){var t,a,n,i,o,l,s,u,f,c,v,d,p;function y(_,b){return _.pxmid[1]-b.pxmid[1]}function m(_,b){return b.pxmid[1]-_.pxmid[1]}function x(_,b){b||(b={});var w=b.labelExtraY+(a?b.yLabelMax:b.yLabelMin),k=a?_.yLabelMin:_.yLabelMax,M=a?_.yLabelMax:_.yLabelMin,q=_.cyFinal+o(_.px0[1],_.px1[1]),E=w-k,D,P,R,z,I,B;if(E*s>0&&(_.labelExtraY=E),!!Za.isArrayOrTypedArray(r.pull))for(P=0;P=(Ar.castOption(r.pull,R.pts)||0))&&((_.pxmid[1]-R.pxmid[1])*s>0?(z=R.cyFinal+o(R.px0[1],R.px1[1]),E=z-k-_.labelExtraY,E*s>0&&(_.labelExtraY+=E)):(M+_.labelExtraY-q)*s>0&&(D=3*l*Math.abs(P-c.indexOf(_)),I=R.cxFinal+i(R.px0[0],R.px1[0]),B=I+D-(_.cxFinal+_.pxmid[0])-_.labelExtraX,B*l>0&&(_.labelExtraX+=B)))}for(a=0;a<2;a++)for(n=a?y:m,o=a?Math.max:Math.min,s=a?1:-1,t=0;t<2;t++){for(i=t?Math.max:Math.min,l=t?1:-1,u=e[a][t],u.sort(n),f=e[1-a][t],c=f.concat(u),d=[],v=0;v1?(u=t.r,f=u/n.aspectratio):(f=t.r,u=f*n.aspectratio),u*=(1+n.baseratio)/2,s=u*f}o=Math.min(o,s/t.vTotal)}for(a=0;ar.vTotal/2?1:0,u.halfangle=Math.PI*Math.min(u.v/r.vTotal,.5),u.ring=1-a.hole,u.rInscribed=OLe(u,r))}function w3(e,r){return[e*Math.sin(r),-e*Math.cos(r)]}function hae(e,r,t){var a=e._fullLayout,n=t.trace,i=n.texttemplate,o=n.textinfo;if(!i&&o&&o!=="none"){var l=o.split("+"),s=function(b){return l.indexOf(b)!==-1},u=s("label"),f=s("text"),c=s("value"),v=s("percent"),d=a.separators,p;if(p=u?[r.label]:[],f){var y=Ar.getFirstFilled(n.text,r.pts);Jte(y)&&p.push(y)}c&&p.push(Ar.formatPieValue(r.v,d)),v&&p.push(Ar.formatPiePercent(r.v/t.vTotal,d)),r.text=p.join("
")}function m(b){return{label:b.label,value:b.v,valueLabel:Ar.formatPieValue(b.v,a.separators),percent:b.v/t.vTotal,percentLabel:Ar.formatPiePercent(b.v/t.vTotal,a.separators),color:b.color,text:b.text,customdata:Za.castOption(n,b.i,"customdata")}}if(i){var x=Za.castOption(n,r.i,"texttemplate");if(!x)r.text="";else{var T=m(r),_=Ar.getFirstFilled(n.text,r.pts);(Jte(_)||_==="")&&(T.text=_),r.text=Za.texttemplateString({data:[T,n._meta],fallback:n.texttemplatefallback,labels:T,locale:e._fullLayout._d3locale,template:x})}}}function dae(e,r){var t=e.rotate*Math.PI/180,a=Math.cos(t),n=Math.sin(t),i=(r.left+r.right)/2,o=(r.top+r.bottom)/2;e.textX=i*a-o*n,e.textY=i*n+o*a,e.noCenter=!0}pae.exports={plot:FLe,formatSliceLabel:hae,transformInsideText:oae,determineInsideTextFont:nae,positionTitleOutside:fae,prerenderTitles:iae,layoutAreas:vae,attachFxHandlers:aae,computeTransform:dae}});var bae=N((jHe,gae)=>{"use strict";var mae=Sr(),YLe=Q1(),WLe=N0().resizeText;gae.exports=function(r){var t=r._fullLayout._pielayer.selectAll(".trace");WLe(r,t,"pie"),t.each(function(a){var n=a[0],i=n.trace,o=mae.select(this);o.style({opacity:i.opacity}),o.selectAll("path.surface").each(function(l){mae.select(this).call(YLe,l,i,r)})})}});var _ae=N(zv=>{"use strict";var xae=aa();zv.name="pie";zv.plot=function(e,r,t,a){xae.plotBasePlot(zv.name,e,r,t,a)};zv.clean=function(e,r,t,a){xae.cleanBasePlot(zv.name,e,r,t,a)}});var Tae=N((XHe,wae)=>{"use strict";wae.exports={attributes:lA(),supplyDefaults:Bte().supplyDefaults,supplyLayoutDefaults:Gte(),layoutAttributes:sA(),calc:fA().calc,crossTraceCalc:fA().crossTraceCalc,plot:yae().plot,style:bae(),styleOne:Q1(),moduleType:"trace",name:"pie",basePlotModule:_ae(),categories:["pie-like","pie","showLegend"],meta:{}}});var Mae=N((JHe,Aae)=>{"use strict";Aae.exports=Tae()});var tn=N(($He,Sae)=>{"use strict";var kae=Object.getOwnPropertySymbols,jLe=Object.prototype.hasOwnProperty,ZLe=Object.prototype.propertyIsEnumerable;function XLe(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function JLe(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var a=Object.getOwnPropertyNames(r).map(function(i){return r[i]});if(a.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(i){n[i]=i}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch(i){return!1}}Sae.exports=JLe()?Object.assign:function(e,r){for(var t,a=XLe(e),n,i=1;i{var A3=tn();function qae(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}A3(qae.prototype,{instance:function(e,r){e=(e||"gregorian").toLowerCase(),r=r||"";var t=this._localCals[e+"-"+r];if(!t&&this.calendars[e]&&(t=new this.calendars[e](r),this._localCals[e+"-"+r]=t),!t)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return t},newDate:function(e,r,t,a,n){return a=(e!=null&&e.year?e.calendar():typeof a=="string"?this.instance(a,n):a)||this.instance(),a.newDate(e,r,t)},substituteDigits:function(e){return function(r){return(r+"").replace(/[0-9]/g,function(t){return e[t]})}},substituteChineseDigits:function(e,r){return function(t){for(var a="",n=0;t>0;){var i=t%10;a=(i===0?"":e[i]+r[n])+a,n++,t=Math.floor(t/10)}return a.indexOf(e[1]+r[1])===0&&(a=a.substr(1)),a||e[0]}}});function hA(e,r,t,a){if(this._calendar=e,this._year=r,this._month=t,this._day=a,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function T3(e,r){return e=""+e,"000000".substring(0,r-e.length)+e}A3(hA.prototype,{newDate:function(e,r,t){return this._calendar.newDate(e==null?this:e,r,t)},year:function(e){return arguments.length===0?this._year:this.set(e,"y")},month:function(e){return arguments.length===0?this._month:this.set(e,"m")},day:function(e){return arguments.length===0?this._day:this.set(e,"d")},date:function(e,r,t){if(!this._calendar.isValid(e,r,t))throw(Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=r,this._day=t,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,r){return this._calendar.add(this,e,r)},set:function(e,r){return this._calendar.set(this,e,r)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(Nr.local.differentCalendars||Nr.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var r=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return r===0?0:r<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+T3(Math.abs(this.year()),4)+"-"+T3(this.month(),2)+"-"+T3(this.day(),2)}});function dA(){this.shortYearCutoff="+10"}A3(dA.prototype,{_validateLevel:0,newDate:function(e,r,t){return e==null?this.today():(e.year&&(this._validate(e,r,t,Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate),t=e.day(),r=e.month(),e=e.year()),new hA(this,e,r,t))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){var r=this._validate(e,this.minMonth,this.minDay,Nr.local.invalidYear||Nr.regionalOptions[""].invalidYear);return r.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Nr.local.invalidYear||Nr.regionalOptions[""].invalidYear);return(r.year()<0?"-":"")+T3(Math.abs(r.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Nr.local.invalidYear||Nr.regionalOptions[""].invalidYear),12},monthOfYear:function(e,r){var t=this._validate(e,r,this.minDay,Nr.local.invalidMonth||Nr.regionalOptions[""].invalidMonth);return(t.month()+this.monthsInYear(t)-this.firstMonth)%this.monthsInYear(t)+this.minMonth},fromMonthOfYear:function(e,r){var t=(r+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,t,this.minDay,Nr.local.invalidMonth||Nr.regionalOptions[""].invalidMonth),t},daysInYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Nr.local.invalidYear||Nr.regionalOptions[""].invalidYear);return this.leapYear(r)?366:365},dayOfYear:function(e,r,t){var a=this._validate(e,r,t,Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate);return a.toJD()-this.newDate(a.year(),this.fromMonthOfYear(a.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,r,t){var a=this._validate(e,r,t,Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(a))+2)%this.daysInWeek()},extraInfo:function(e,r,t){return this._validate(e,r,t,Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate),{}},add:function(e,r,t){return this._validate(e,this.minMonth,this.minDay,Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,r,t),r,t)},_add:function(e,r,t){if(this._validateLevel++,t==="d"||t==="w"){var a=e.toJD()+r*(t==="w"?this.daysInWeek():1),n=e.calendar().fromJD(a);return this._validateLevel--,[n.year(),n.month(),n.day()]}try{var i=e.year()+(t==="y"?r:0),o=e.monthOfYear()+(t==="m"?r:0),n=e.day(),l=function(f){for(;oc-1+f.minMonth;)i++,o-=c,c=f.monthsInYear(i)};t==="y"?(e.month()!==this.fromMonthOfYear(i,o)&&(o=this.newDate(i,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(i)),n=Math.min(n,this.daysInMonth(i,this.fromMonthOfYear(i,o)))):t==="m"&&(l(this),n=Math.min(n,this.daysInMonth(i,this.fromMonthOfYear(i,o))));var s=[i,this.fromMonthOfYear(i,o),n];return this._validateLevel--,s}catch(u){throw this._validateLevel--,u}},_correctAdd:function(e,r,t,a){if(!this.hasYearZero&&(a==="y"||a==="m")&&(r[0]===0||e.year()>0!=r[0]>0)){var n={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[a],i=t<0?-1:1;r=this._add(e,t*n[0]+i*n[1],n[2])}return e.date(r[0],r[1],r[2])},set:function(e,r,t){this._validate(e,this.minMonth,this.minDay,Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate);var a=t==="y"?r:e.year(),n=t==="m"?r:e.month(),i=t==="d"?r:e.day();return(t==="y"||t==="m")&&(i=Math.min(i,this.daysInMonth(a,n))),e.date(a,n,i)},isValid:function(e,r,t){this._validateLevel++;var a=this.hasYearZero||e!==0;if(a){var n=this.newDate(e,r,this.minDay);a=r>=this.minMonth&&r-this.minMonth=this.minDay&&t-this.minDay13.5?13:1),u=n-(s>2.5?4716:4715);return u<=0&&u--,this.newDate(u,s,l)},toJSDate:function(e,r,t){var a=this._validate(e,r,t,Nr.local.invalidDate||Nr.regionalOptions[""].invalidDate),n=new Date(a.year(),a.month()-1,a.day());return n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0),n.setHours(n.getHours()>12?n.getHours()+2:0),n},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var Nr=Lae.exports=new qae;Nr.cdate=hA;Nr.baseCalendar=dA;Nr.calendars.gregorian=pA});var Cae=N(()=>{var yA=tn(),Fa=an();yA(Fa.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"});Fa.local=Fa.regionalOptions[""];yA(Fa.cdate.prototype,{formatDate:function(e,r){return typeof e!="string"&&(r=e,e=""),this._calendar.formatDate(e||"",this,r)}});yA(Fa.baseCalendar.prototype,{UNIX_EPOCH:Fa.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:Fa.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,r,t){if(typeof e!="string"&&(t=r,r=e,e=""),!r)return"";if(r.calendar()!==this)throw Fa.local.invalidFormat||Fa.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat,t=t||{};for(var a=t.dayNamesShort||this.local.dayNamesShort,n=t.dayNames||this.local.dayNames,i=t.monthNumbers||this.local.monthNumbers,o=t.monthNamesShort||this.local.monthNamesShort,l=t.monthNames||this.local.monthNames,s=t.calculateWeek||this.local.calculateWeek,u=function(b,w){for(var k=1;_+k1},f=function(b,w,k,M){var q=""+w;if(u(b,M))for(;q.length1},T=function(R,z){var I=x(R,z),B=[2,3,I?4:2,I?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],G=new RegExp("^-?\\d{1,"+B+"}"),Y=r.substring(q).match(G);if(!Y)throw(Fa.local.missingNumberAt||Fa.regionalOptions[""].missingNumberAt).replace(/\{0\}/,q);return q+=Y[0].length,parseInt(Y[0],10)},_=this,b=function(){if(typeof l=="function"){x("m");var R=l.call(_,r.substring(q));return q+=R.length,R}return T("m")},w=function(R,z,I,B){for(var G=x(R,B)?I:z,Y=0;Y-1){v=1,d=p;for(var P=this.daysInMonth(c,v);d>P;P=this.daysInMonth(c,v))v++,d-=P}return f>-1?this.fromJD(f):this.newDate(c,v,d)},determineDate:function(e,r,t,a,n){t&&typeof t!="object"&&(n=a,a=t,t=null),typeof a!="string"&&(n=a,a="");var i=this,o=function(l){try{return i.parseDate(a,l,n)}catch(c){}l=l.toLowerCase();for(var s=(l.match(/^c/)&&t?t.newDate():null)||i.today(),u=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,f=u.exec(l);f;)s.add(parseInt(f[1],10),f[2]||"d"),f=u.exec(l);return s};return r=r?r.newDate():null,e=e==null?r:typeof e=="string"?o(e):typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?r:i.today().add(e,"d"):i.newDate(e),e}})});var Eae=N(()=>{var Bs=an(),$Le=tn(),mA=Bs.instance();function M3(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}M3.prototype=new Bs.baseCalendar;$Le(M3.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,r){if(typeof e=="string"){var t=e.match(QLe);return t?t[0]:""}var a=this._validateYear(e),n=e.month(),i=""+this.toChineseMonth(a,n);return r&&i.length<2&&(i="0"+i),this.isIntercalaryMonth(a,n)&&(i+="i"),i},monthNames:function(e){if(typeof e=="string"){var r=e.match(eCe);return r?r[0]:""}var t=this._validateYear(e),a=e.month(),n=this.toChineseMonth(t,a),i=["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"][n-1];return this.isIntercalaryMonth(t,a)&&(i="\u95F0"+i),i},monthNamesShort:function(e){if(typeof e=="string"){var r=e.match(rCe);return r?r[0]:""}var t=this._validateYear(e),a=e.month(),n=this.toChineseMonth(t,a),i=["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"][n-1];return this.isIntercalaryMonth(t,a)&&(i="\u95F0"+i),i},parseMonth:function(e,r){e=this._validateYear(e);var t=parseInt(r),a;if(isNaN(t))r[0]==="\u95F0"&&(a=!0,r=r.substring(1)),r[r.length-1]==="\u6708"&&(r=r.substring(0,r.length-1)),t=1+["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341","\u5341\u4E00","\u5341\u4E8C"].indexOf(r);else{var n=r[r.length-1];a=n==="i"||n==="I"}var i=this.toMonthIndex(e,t,a);return i},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,r){if(e.year&&(e=e.year()),typeof e!="number"||e<1888||e>2111)throw r.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(e,r,t){var a=this.intercalaryMonth(e),n=t&&r!==a;if(n||r<1||r>12)throw Bs.local.invalidMonth.replace(/\{0\}/,this.local.name);var i;return a?!t&&r<=a?i=r-1:i=r:i=r-1,i},toChineseMonth:function(e,r){e.year&&(e=e.year(),r=e.month());var t=this.intercalaryMonth(e),a=t?12:11;if(r<0||r>a)throw Bs.local.invalidMonth.replace(/\{0\}/,this.local.name);var n;return t?r>13;return t},isIntercalaryMonth:function(e,r){e.year&&(e=e.year(),r=e.month());var t=this.intercalaryMonth(e);return!!t&&t===r},leapYear:function(e){return this.intercalaryMonth(e)!==0},weekOfYear:function(e,r,t){var a=this._validateYear(e,Bs.local.invalidyear),n=Us[a-Us[0]],i=n>>9&4095,o=n>>5&15,l=n&31,s;s=mA.newDate(i,o,l),s.add(4-(s.dayOfWeek()||7),"d");var u=this.toJD(e,r,t)-s.toJD();return 1+Math.floor(u/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(e,r){e.year&&(r=e.month(),e=e.year()),e=this._validateYear(e);var t=Hs[e-Hs[0]],a=t>>13,n=a?12:11;if(r>n)throw Bs.local.invalidMonth.replace(/\{0\}/,this.local.name);var i=t&1<<12-r?30:29;return i},weekDay:function(e,r,t){return(this.dayOfWeek(e,r,t)||7)<6},toJD:function(e,r,t){var a=this._validate(e,i,t,Bs.local.invalidDate);e=this._validateYear(a.year()),r=a.month(),t=a.day();var n=this.isIntercalaryMonth(e,r),i=this.toChineseMonth(e,r),o=aCe(e,i,t,n);return mA.toJD(o.year,o.month,o.day)},fromJD:function(e){var r=mA.fromJD(e),t=tCe(r.year(),r.month(),r.day()),a=this.toMonthIndex(t.year,t.month,t.isIntercalary);return this.newDate(t.year,a,t.day)},fromString:function(e){var r=e.match(KLe),t=this._validateYear(+r[1]),a=+r[2],n=!!r[3],i=this.toMonthIndex(t,a,n),o=+r[4];return this.newDate(t,i,o)},add:function(e,r,t){var a=e.year(),n=e.month(),i=this.isIntercalaryMonth(a,n),o=this.toChineseMonth(a,n),l=Object.getPrototypeOf(M3.prototype).add.call(this,e,r,t);if(t==="y"){var s=l.year(),u=l.month(),f=this.isIntercalaryMonth(s,o),c=i&&f?this.toMonthIndex(s,o,!0):this.toMonthIndex(s,o,!1);c!==u&&l.month(c)}return l}});var KLe=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,QLe=/^\d?\d[iI]?/m,eCe=/^闰?十?[一二三四五六七八九]?月/m,rCe=/^闰?十?[一二三四五六七八九]?/m;Bs.calendars.chinese=M3;var Hs=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],Us=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function tCe(e,r,t,a){var n,i;if(typeof e=="object")n=e,i=r||{};else{var o=typeof e=="number"&&e>=1888&&e<=2111;if(!o)throw new Error("Solar year outside range 1888-2111");var l=typeof r=="number"&&r>=1&&r<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var s=typeof t=="number"&&t>=1&&t<=31;if(!s)throw new Error("Solar day outside range 1 - 31");n={year:e,month:r,day:t},i=a||{}}var u=Us[n.year-Us[0]],f=n.year<<9|n.month<<5|n.day;i.year=f>=u?n.year:n.year-1,u=Us[i.year-Us[0]];var c=u>>9&4095,v=u>>5&15,d=u&31,p,y=new Date(c,v-1,d),m=new Date(n.year,n.month-1,n.day);p=Math.round((m-y)/(24*3600*1e3));var x=Hs[i.year-Hs[0]],T;for(T=0;T<13;T++){var _=x&1<<12-T?30:29;if(p<_)break;p-=_}var b=x>>13;return!b||T=1888&&e<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var s=typeof r=="number"&&r>=1&&r<=12;if(!s)throw new Error("Lunar month outside range 1 - 12");var u=typeof t=="number"&&t>=1&&t<=30;if(!u)throw new Error("Lunar day outside range 1 - 30");var f;typeof a=="object"?(f=!1,i=a):(f=!!a,i=n||{}),o={year:e,month:r,day:t,isIntercalary:f}}var c;c=o.day-1;var v=Hs[o.year-Hs[0]],d=v>>13,p;d&&(o.month>d||o.isIntercalary)?p=o.month:p=o.month-1;for(var y=0;y>9&4095,_=x>>5&15,b=x&31,w=new Date(T,_-1,b+c);return i.year=w.getFullYear(),i.month=1+w.getMonth(),i.day=w.getDate(),i}});var Dae=N(()=>{var mf=an(),nCe=tn();function gA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}gA.prototype=new mf.baseCalendar;nCe(gA.prototype,{name:"Coptic",jdEpoch:18250295e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,mf.local.invalidYear),t=r.year()+(r.year()<0?1:0);return t%4===3||t%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,mf.local.invalidYear||mf.regionalOptions[""].invalidYear),13},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,mf.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===13&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return(this.dayOfWeek(e,r,t)||7)<6},toJD:function(e,r,t){var a=this._validate(e,r,t,mf.local.invalidDate);return e=a.year(),e<0&&e++,a.day()+(a.month()-1)*30+(e-1)*365+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var r=Math.floor(e)+.5-this.jdEpoch,t=Math.floor((r-Math.floor((r+366)/1461))/365)+1;t<=0&&t--,r=Math.floor(e)+.5-this.newDate(t,1,1).toJD();var a=Math.floor(r/30)+1,n=r-(a-1)*30+1;return this.newDate(t,a,n)}});mf.calendars.coptic=gA});var Rae=N(()=>{var Ol=an(),iCe=tn();function bA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}bA.prototype=new Ol.baseCalendar;iCe(bA.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,Ol.local.invalidYear),!1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Ol.local.invalidYear),13},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Ol.local.invalidYear),400},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/8)+1},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,Ol.local.invalidMonth);return this.daysPerMonth[t.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(e,r,t){var a=this._validate(e,r,t,Ol.local.invalidDate);return(a.day()+1)%8},weekDay:function(e,r,t){var a=this.dayOfWeek(e,r,t);return a>=2&&a<=6},extraInfo:function(e,r,t){var a=this._validate(e,r,t,Ol.local.invalidDate);return{century:oCe[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(e,r,t){var a=this._validate(e,r,t,Ol.local.invalidDate);return e=a.year()+(a.year()<0?1:0),r=a.month(),t=a.day(),t+(r>1?16:0)+(r>2?(r-2)*32:0)+(e-1)*400+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var r=Math.floor(e/400)+1;e-=(r-1)*400,e+=e>15?16:0;var t=Math.floor(e/32)+1,a=e-(t-1)*32+1;return this.newDate(r<=0?r-1:r,t,a)}});var oCe={20:"Fruitbat",21:"Anchovy"};Ol.calendars.discworld=bA});var Pae=N(()=>{var gf=an(),lCe=tn();function xA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}xA.prototype=new gf.baseCalendar;lCe(xA.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,gf.local.invalidYear),t=r.year()+(r.year()<0?1:0);return t%4===3||t%4===-1},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,gf.local.invalidYear||gf.regionalOptions[""].invalidYear),13},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,gf.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===13&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return(this.dayOfWeek(e,r,t)||7)<6},toJD:function(e,r,t){var a=this._validate(e,r,t,gf.local.invalidDate);return e=a.year(),e<0&&e++,a.day()+(a.month()-1)*30+(e-1)*365+Math.floor(e/4)+this.jdEpoch-1},fromJD:function(e){var r=Math.floor(e)+.5-this.jdEpoch,t=Math.floor((r-Math.floor((r+366)/1461))/365)+1;t<=0&&t--,r=Math.floor(e)+.5-this.newDate(t,1,1).toJD();var a=Math.floor(r/30)+1,n=r-(a-1)*30+1;return this.newDate(t,a,n)}});gf.calendars.ethiopian=xA});var Fae=N(()=>{var Gs=an(),sCe=tn();function _A(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}_A.prototype=new Gs.baseCalendar;sCe(_A.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Gs.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(e){return e=e<0?e+1:e,k3(e*7+1,19)<7},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Gs.local.invalidYear),this._leapYear(e.year?e.year():e)?13:12},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Gs.local.invalidYear);return e=r.year(),this.toJD(e===-1?1:e+1,7,1)-this.toJD(e,7,1)},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,Gs.local.invalidMonth),r===12&&this.leapYear(e)||r===8&&k3(this.daysInYear(e),10)===5?30:r===9&&k3(this.daysInYear(e),10)===3?29:this.daysPerMonth[r-1]},weekDay:function(e,r,t){return this.dayOfWeek(e,r,t)!==6},extraInfo:function(e,r,t){var a=this._validate(e,r,t,Gs.local.invalidDate);return{yearType:(this.leapYear(a)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(a)%10-3]}},toJD:function(e,r,t){var a=this._validate(e,r,t,Gs.local.invalidDate);e=a.year(),r=a.month(),t=a.day();var n=e<=0?e+1:e,i=this.jdEpoch+this._delay1(n)+this._delay2(n)+t+1;if(r<7){for(var o=7;o<=this.monthsInYear(e);o++)i+=this.daysInMonth(e,o);for(var o=1;o=this.toJD(r===-1?1:r+1,7,1);)r++;for(var t=ethis.toJD(r,t,this.daysInMonth(r,t));)t++;var a=e-this.toJD(r,t,1)+1;return this.newDate(r,t,a)}});function k3(e,r){return e-r*Math.floor(e/r)}Gs.calendars.hebrew=_A});var Nae=N(()=>{var Gd=an(),uCe=tn();function wA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}wA.prototype=new Gd.baseCalendar;uCe(wA.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012Bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Gd.local.invalidYear);return(r.year()*11+14)%30<11},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,Gd.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return this.dayOfWeek(e,r,t)!==5},toJD:function(e,r,t){var a=this._validate(e,r,t,Gd.local.invalidDate);return e=a.year(),r=a.month(),t=a.day(),e=e<=0?e+1:e,t+Math.ceil(29.5*(r-1))+(e-1)*354+Math.floor((3+11*e)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var r=Math.floor((30*(e-this.jdEpoch)+10646)/10631);r=r<=0?r-1:r;var t=Math.min(12,Math.ceil((e-29-this.toJD(r,1,1))/29.5)+1),a=e-this.toJD(r,t,1)+1;return this.newDate(r,t,a)}});Gd.calendars.islamic=wA});var Iae=N(()=>{var Vd=an(),fCe=tn();function TA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}TA.prototype=new Vd.baseCalendar;fCe(TA.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,Vd.local.invalidYear),t=r.year()<0?r.year()+1:r.year();return t%4===0},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(4-(a.dayOfWeek()||7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,Vd.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return(this.dayOfWeek(e,r,t)||7)<6},toJD:function(e,r,t){var a=this._validate(e,r,t,Vd.local.invalidDate);return e=a.year(),r=a.month(),t=a.day(),e<0&&e++,r<=2&&(e--,r+=12),Math.floor(365.25*(e+4716))+Math.floor(30.6001*(r+1))+t-1524.5},fromJD:function(e){var r=Math.floor(e+.5),t=r+1524,a=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*a),i=Math.floor((t-n)/30.6001),o=i-Math.floor(i<14?1:13),l=a-Math.floor(o>2?4716:4715),s=t-n-Math.floor(30.6001*i);return l<=0&&l--,this.newDate(l,o,s)}});Vd.calendars.julian=TA});var Oae=N(()=>{var Wi=an(),cCe=tn();function MA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}MA.prototype=new Wi.baseCalendar;cCe(MA.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(e){return this._validate(e,this.minMonth,this.minDay,Wi.local.invalidYear),!1},formatYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Wi.local.invalidYear);e=r.year();var t=Math.floor(e/400);e=e%400,e+=e<0?400:0;var a=Math.floor(e/20);return t+"."+a+"."+e%20},forYear:function(e){if(e=e.split("."),e.length<3)throw"Invalid Mayan year";for(var r=0,t=0;t19||t>0&&a<0)throw"Invalid Mayan year";r=r*20+a}return r},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Wi.local.invalidYear),18},weekOfYear:function(e,r,t){return this._validate(e,r,t,Wi.local.invalidDate),0},daysInYear:function(e){return this._validate(e,this.minMonth,this.minDay,Wi.local.invalidYear),360},daysInMonth:function(e,r){return this._validate(e,r,this.minDay,Wi.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(e,r,t){var a=this._validate(e,r,t,Wi.local.invalidDate);return a.day()},weekDay:function(e,r,t){return this._validate(e,r,t,Wi.local.invalidDate),!0},extraInfo:function(e,r,t){var a=this._validate(e,r,t,Wi.local.invalidDate),n=a.toJD(),i=this._toHaab(n),o=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){e-=this.jdEpoch;var r=AA(e+8+17*20,365);return[Math.floor(r/20)+1,AA(r,20)]},_toTzolkin:function(e){return e-=this.jdEpoch,[zae(e+20,20),zae(e+4,13)]},toJD:function(e,r,t){var a=this._validate(e,r,t,Wi.local.invalidDate);return a.day()+a.month()*20+a.year()*360+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var r=Math.floor(e/360);e=e%360,e+=e<0?360:0;var t=Math.floor(e/20),a=e%20;return this.newDate(r,t,a)}});function AA(e,r){return e-r*Math.floor(e/r)}function zae(e,r){return AA(e-1,r)+1}Wi.calendars.mayan=MA});var Hae=N(()=>{var bf=an(),vCe=tn();function kA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}kA.prototype=new bf.baseCalendar;var Bae=bf.instance("gregorian");vCe(kA.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,bf.local.invalidYear||bf.regionalOptions[""].invalidYear);return Bae.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(1-(a.dayOfWeek()||7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,bf.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return(this.dayOfWeek(e,r,t)||7)<6},toJD:function(n,r,t){var a=this._validate(n,r,t,bf.local.invalidMonth),n=a.year();n<0&&n++;for(var i=a.day(),o=1;o=this.toJD(r+1,1,1);)r++;for(var t=e-Math.floor(this.toJD(r,1,1)+.5)+1,a=1;t>this.daysInMonth(r,a);)t-=this.daysInMonth(r,a),a++;return this.newDate(r,a,t)}});bf.calendars.nanakshahi=kA});var Uae=N(()=>{var xf=an(),hCe=tn();function SA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}SA.prototype=new xf.baseCalendar;hCe(SA.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,xf.local.invalidYear);if(e=r.year(),typeof this.NEPALI_CALENDAR_DATA[e]=="undefined")return this.daysPerYear;for(var t=0,a=this.minMonth;a<=12;a++)t+=this.NEPALI_CALENDAR_DATA[e][a];return t},daysInMonth:function(e,r){return e.year&&(r=e.month(),e=e.year()),this._validate(e,r,this.minDay,xf.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[e]=="undefined"?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[e][r]},weekDay:function(e,r,t){return this.dayOfWeek(e,r,t)!==6},toJD:function(e,r,t){var a=this._validate(e,r,t,xf.local.invalidDate);e=a.year(),r=a.month(),t=a.day();var n=xf.instance(),i=0,o=r,l=e;this._createMissingCalendarData(e);var s=e-(o>9||o===9&&t>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(r!==9&&(i=t,o--);o!==9;)o<=0&&(o=12,l--),i+=this.NEPALI_CALENDAR_DATA[l][o],o--;return r===9?(i+=t-this.NEPALI_CALENDAR_DATA[l][0],i<0&&(i+=n.daysInYear(s))):i+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],n.newDate(s,1,1).add(i,"d").toJD()},fromJD:function(e){var r=xf.instance(),t=r.fromJD(e),a=t.year(),n=t.dayOfYear(),i=a+56;this._createMissingCalendarData(i);for(var o=9,l=this.NEPALI_CALENDAR_DATA[i][0],s=this.NEPALI_CALENDAR_DATA[i][o]-l+1;n>s;)o++,o>12&&(o=1,i++),s+=this.NEPALI_CALENDAR_DATA[i][o];var u=this.NEPALI_CALENDAR_DATA[i][o]-(s-n);return this.newDate(i,o,u)},_createMissingCalendarData:function(e){var r=this.daysPerMonth.slice(0);r.unshift(17);for(var t=e-1;t{var Ov=an(),dCe=tn();function q3(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function S3(e){var r=e-475;e<0&&r++;var t=.242197,a=t*r,n=t*(r+1),i=a-Math.floor(a),o=n-Math.floor(n);return i>o}q3.prototype=new Ov.baseCalendar;dCe(q3.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Dey","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Dey","Bah","Esf"],dayNames:["Yekshanbeh","Doshanbeh","Seshanbeh","Chah\u0101rshanbeh","Panjshanbeh","Jom'eh","Shanbeh"],dayNamesShort:["Yek","Do","Se","Cha","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Ov.local.invalidYear);return S3(r.year())},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-((a.dayOfWeek()+1)%7),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,Ov.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===12&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return this.dayOfWeek(e,r,t)!==5},toJD:function(e,r,t){var a=this._validate(e,r,t,Ov.local.invalidDate);e=a.year(),r=a.month(),t=a.day();var n=0;if(e>0)for(var i=1;i0?e-1:e)*365+n+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var r=475+(e-this.toJD(475,1,1))/365.242197,t=Math.floor(r);t<=0&&t--,e>this.toJD(t,12,S3(t)?30:29)&&(t++,t===0&&t++);var a=e-this.toJD(t,1,1)+1,n=a<=186?Math.ceil(a/31):Math.ceil((a-6)/30),i=e-this.toJD(t,n,1)+1;return this.newDate(t,n,i)}});Ov.calendars.persian=q3;Ov.calendars.jalali=q3});var Vae=N(()=>{var _f=an(),pCe=tn(),L3=_f.instance();function qA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}qA.prototype=new _f.baseCalendar;pCe(qA.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,_f.local.invalidYear),t=this._t2gYear(r.year());return L3.leapYear(t)},weekOfYear:function(n,r,t){var a=this._validate(n,this.minMonth,this.minDay,_f.local.invalidYear),n=this._t2gYear(a.year());return L3.weekOfYear(n,a.month(),a.day())},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,_f.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return(this.dayOfWeek(e,r,t)||7)<6},toJD:function(n,r,t){var a=this._validate(n,r,t,_f.local.invalidDate),n=this._t2gYear(a.year());return L3.toJD(n,a.month(),a.day())},fromJD:function(e){var r=L3.fromJD(e),t=this._g2tYear(r.year());return this.newDate(t,r.month(),r.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}});_f.calendars.taiwan=qA});var Yae=N(()=>{var wf=an(),yCe=tn(),C3=wf.instance();function LA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}LA.prototype=new wf.baseCalendar;yCe(LA.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,wf.local.invalidYear),t=this._t2gYear(r.year());return C3.leapYear(t)},weekOfYear:function(n,r,t){var a=this._validate(n,this.minMonth,this.minDay,wf.local.invalidYear),n=this._t2gYear(a.year());return C3.weekOfYear(n,a.month(),a.day())},daysInMonth:function(e,r){var t=this._validate(e,r,this.minDay,wf.local.invalidMonth);return this.daysPerMonth[t.month()-1]+(t.month()===2&&this.leapYear(t.year())?1:0)},weekDay:function(e,r,t){return(this.dayOfWeek(e,r,t)||7)<6},toJD:function(n,r,t){var a=this._validate(n,r,t,wf.local.invalidDate),n=this._t2gYear(a.year());return C3.toJD(n,a.month(),a.day())},fromJD:function(e){var r=C3.fromJD(e),t=this._g2tYear(r.year());return this.newDate(t,r.month(),r.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}});wf.calendars.thai=LA});var Wae=N(()=>{var Tf=an(),mCe=tn();function CA(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}CA.prototype=new Tf.baseCalendar;mCe(CA.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012Bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(e){var r=this._validate(e,this.minMonth,this.minDay,Tf.local.invalidYear);return this.daysInYear(r.year())===355},weekOfYear:function(e,r,t){var a=this.newDate(e,r,t);return a.add(-a.dayOfWeek(),"d"),Math.floor((a.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var r=0,t=1;t<=12;t++)r+=this.daysInMonth(e,t);return r},daysInMonth:function(e,r){for(var t=this._validate(e,r,this.minDay,Tf.local.invalidMonth),a=t.toJD()-24e5+.5,n=0,i=0;ia)return Vs[n]-Vs[n-1];n++}return 30},weekDay:function(e,r,t){return this.dayOfWeek(e,r,t)!==5},toJD:function(e,r,t){var a=this._validate(e,r,t,Tf.local.invalidDate),n=12*(a.year()-1)+a.month()-15292,i=a.day()+Vs[n-1]-1;return i+24e5-.5},fromJD:function(e){for(var r=e-24e5+.5,t=0,a=0;ar);a++)t++;var n=t+15292,i=Math.floor((n-1)/12),o=i+1,l=n-12*i,s=r-Vs[t-1]+1;return this.newDate(o,l,s)},isValid:function(e,r,t){var a=Tf.baseCalendar.prototype.isValid.apply(this,arguments);return a&&(e=e.year!=null?e.year:e,a=e>=1276&&e<=1500),a},_validate:function(e,r,t,a){var n=Tf.baseCalendar.prototype._validate.apply(this,arguments);if(n.year<1276||n.year>1500)throw a.replace(/\{0\}/,this.local.name);return n}});Tf.calendars.ummalqura=CA;var Vs=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]});var Zae=N((LUe,jae)=>{"use strict";jae.exports=an();Cae();Eae();Dae();Rae();Pae();Fae();Nae();Iae();Oae();Hae();Uae();Gae();Vae();Yae();Wae()});var rne=N((CUe,ene)=>{"use strict";var Jae=Zae(),Yd=Ee(),$ae=Ft(),gCe=$ae.EPOCHJD,bCe=$ae.ONEDAY,RA={valType:"enumerated",values:Yd.sortObjectKeys(Jae.calendars),editType:"calc",dflt:"gregorian"},Kae=function(e,r,t,a){var n={};return n[t]=RA,Yd.coerce(e,r,n,t,a)},xCe=function(e,r,t,a){for(var n=0;n{"use strict";tne.exports=rne()});var kCe=N((DUe,ine)=>{var nne=QU();nne.register([rV(),UV(),lW(),qW(),UW(),Vj(),nZ(),jZ(),wX(),Pte(),Mae(),ane()]);ine.exports=nne});return kCe();})(); +/*! Bundled license information: + +native-promise-only/lib/npo.src.js: + (*! Native Promise Only + v0.8.1 (c) Kyle Simpson + MIT License: http://getify.mit-license.org + *) + +polybooljs/index.js: + (* + * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc + * @license MIT + * @preserve Project Home: https://github.com/voidqk/polybooljs + *) + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +assert/build/internal/util/comparisons.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +object-assign/index.js: + (* + object-assign + (c) Sindre Sorhus + @license MIT + *) +*/ + +window.Plotly = Plotly; +return Plotly; +})); \ No newline at end of file diff --git a/src/easydiffraction/display/structure/renderers/vendor/threejs/LICENSES.md b/src/easydiffraction/display/structure/renderers/vendor/threejs/LICENSES.md index eb518245b..110a5ec0a 100644 --- a/src/easydiffraction/display/structure/renderers/vendor/threejs/LICENSES.md +++ b/src/easydiffraction/display/structure/renderers/vendor/threejs/LICENSES.md @@ -1,8 +1,6 @@ # Vendored Three.js -Pinned, bundled Three.js so the structure view renders autonomously with -no network (notebook and standalone HTML). Fetched verbatim from jsDelivr -(npm `three@0.160.0`): +Pinned, bundled snapshot fetched verbatim from jsDelivr (npm `three@0.160.0`). Generated by `tools/bump_vendored_js.py`; do not edit by hand — replace only by re-fetching the pinned version with `pixi run vendor-update-js`. | File | Source URL | | --- | --- | @@ -10,12 +8,8 @@ no network (notebook and standalone HTML). Fetched verbatim from jsDelivr | `OrbitControls.js` | `https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/controls/OrbitControls.js` | | `CSS2DRenderer.js` | `https://cdn.jsdelivr.net/npm/three@0.160.0/examples/jsm/renderers/CSS2DRenderer.js` | -**Version:** three r160 (0.160.0). +**Version:** 0.160.0. -**Licence:** MIT — Copyright © 2010-2024 three.js authors. See -`https://github.com/mrdoob/three.js/blob/dev/LICENSE`. +**Licence:** MIT — Copyright © 2010-2024 three.js authors. See `https://github.com/mrdoob/three.js/blob/dev/LICENSE`. -These are upstream snapshots, not project-owned code: do not edit or -reformat them (they are excluded from linting, formatting, coverage, and -test-structure mirroring in `pyproject.toml`). Replace only by re-fetching -the pinned version. +These are upstream snapshots, not project-owned code: they are excluded from linting, formatting, coverage, and test-structure mirroring in `pyproject.toml`. From 6b5e0dc2b332a0162540d9cc6eed44db4267a783 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:07:58 +0200 Subject: [PATCH 07/50] Add docs-sync-vendored-js task and wiring --- .github/workflows/docs.yml | 6 +++ .gitignore | 4 ++ docs/dev/plans/plotting-docs-performance.md | 2 +- pixi.toml | 7 ++- tools/sync_docs_vendored_js.py | 52 +++++++++++++++++++++ 5 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 tools/sync_docs_vendored_js.py diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ea6bdad11..27a9f9543 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -121,6 +121,12 @@ jobs: # if: false # Temporarily disabled to speed up the docs build run: pixi run notebook-exec-ci + # Sync the canonical Three.js snapshot into the docs assets so + # MkDocs can serve it (belt-and-braces; docs-build also depends on + # this task). + - name: Sync vendored JS into docs assets + run: pixi run docs-sync-vendored-js + # Build the static files for the documentation site for local inspection # Input: docs/ directory containing the Markdown files # Output: site/ directory containing the generated HTML files diff --git a/.gitignore b/.gitignore index cb7130005..22e2be679 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,10 @@ build/ # MkDocs docs/site/ +# Generated docs-serving copy of the canonical Three.js (synced from +# src/ by `pixi run docs-sync-vendored-js`; the source of truth is src/) +docs/docs/assets/javascripts/vendor/threejs/ + # Jupyter Notebooks .ipynb_checkpoints diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index e1d673871..2de41b663 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -172,7 +172,7 @@ dependency the plan does not name, **stop and ask**. assets explicitly. Commit: `Vendor plotly-cartesian and refresh three.js` -- [ ] **P1.4 — Add `docs-sync-vendored-js` and wire it.** Add the pixi +- [x] **P1.4 — Add `docs-sync-vendored-js` and wire it.** Add the pixi task copying canonical Three.js → `docs/docs/assets/javascripts/ vendor/threejs/`; git-ignore that path; add `depends-on` on `docs-build` and `docs-serve`; add a diff --git a/pixi.toml b/pixi.toml index 4e56bace6..1d2b64b2c 100644 --- a/pixi.toml +++ b/pixi.toml @@ -211,9 +211,12 @@ notebook-prepare = { depends-on = [ docs-vars = "JUPYTER_PLATFORM_DIRS=1 PYTHONWARNINGS='ignore::RuntimeWarning'" docs-pre = 'pixi run docs-vars python -m mkdocs' -docs-serve = 'pixi run docs-pre serve -f docs/mkdocs.yml' +# Copy the canonical Three.js snapshot into the (git-ignored) docs +# assets before any build/serve so MkDocs can serve it. +docs-sync-vendored-js = 'python tools/sync_docs_vendored_js.py' +docs-serve = { cmd = 'pixi run docs-pre serve -f docs/mkdocs.yml', depends-on = ['docs-sync-vendored-js'] } docs-serve-dirty = 'pixi run docs-serve --dirty' -docs-build = 'pixi run docs-pre build -f docs/mkdocs.yml' +docs-build = { cmd = 'pixi run docs-pre build -f docs/mkdocs.yml', depends-on = ['docs-sync-vendored-js'] } docs-build-local = 'pixi run docs-build --no-directory-urls' docs-deploy-pre = 'mike deploy -F docs/mkdocs.yml --push --branch gh-pages --update-aliases --alias-type redirect' diff --git a/tools/sync_docs_vendored_js.py b/tools/sync_docs_vendored_js.py new file mode 100644 index 000000000..ffd7ab207 --- /dev/null +++ b/tools/sync_docs_vendored_js.py @@ -0,0 +1,52 @@ +""" +Sync the canonical vendored Three.js into the docs assets. + +MkDocs can only serve files under ``docs/docs``, so the canonical +Three.js snapshot — which ships in the wheel from ``src/`` — is copied +into ``docs/docs/assets/javascripts/vendor/threejs/`` for the site to +serve. That docs copy is generated (git-ignored); the single source of +truth is ``src/``. Plotly needs no sync: its docs-only bundle already +lives under ``docs/docs/assets``. + +Run automatically before ``mkdocs build``/``serve`` via the +``docs-sync-vendored-js`` pixi task; the asset names come from the same +pinned table as ``tools/bump_vendored_js.py``. +""" + +from __future__ import annotations + +import shutil +import sys +from pathlib import Path + +from bump_vendored_js import THREEJS + +_REPO_ROOT = Path(__file__).resolve().parent.parent +_DOCS_VENDOR_DIR = Path('docs/docs/assets/javascripts/vendor/threejs') + + +def sync() -> int: + """ + Copy the canonical Three.js files into the docs assets. + + Returns + ------- + int + ``0`` on success; ``1`` if a canonical source file is missing. + """ + src_dir = _REPO_ROOT / THREEJS.dest_dir + dest_dir = _REPO_ROOT / _DOCS_VENDOR_DIR + dest_dir.mkdir(parents=True, exist_ok=True) + for asset in THREEJS.assets: + source = src_dir / asset.filename + if not source.is_file(): + print(f'missing canonical source: {THREEJS.dest_dir / asset.filename}') + print('Run `pixi run vendor-update-js` first.') + return 1 + shutil.copy2(source, dest_dir / asset.filename) + print(f' synced {_DOCS_VENDOR_DIR / asset.filename}') + return 0 + + +if __name__ == '__main__': + sys.exit(sync()) From 25e1d57d21d60e2b21428039618f8cf51d071fe6 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:12:43 +0200 Subject: [PATCH 08/50] Add shared ed-figures.js lazy figure loader --- docs/dev/plans/plotting-docs-performance.md | 2 +- docs/docs/assets/javascripts/ed-figures.js | 346 ++++++++++++++++++++ docs/docs/assets/stylesheets/extra.css | 32 ++ 3 files changed, 379 insertions(+), 1 deletion(-) create mode 100644 docs/docs/assets/javascripts/ed-figures.js diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 2de41b663..bf84a9a1a 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -179,7 +179,7 @@ dependency the plan does not name, **stop and ask**. sync step before `mkdocs build` in `docs.yml`. Commit: `Add docs-sync-vendored-js task and wiring` -- [ ] **P1.5 — Add the shared `ed-figures.js` loader + skeleton CSS.** +- [x] **P1.5 — Add the shared `ed-figures.js` loader + skeleton CSS.** Implement `IntersectionObserver` lazy activation for `data-ed-figure` placeholders (Plotly `newPlot` + Three.js boot), centralized theme-sync / resize / legend logic, eager fallback diff --git a/docs/docs/assets/javascripts/ed-figures.js b/docs/docs/assets/javascripts/ed-figures.js new file mode 100644 index 000000000..35ecf94b0 --- /dev/null +++ b/docs/docs/assets/javascripts/ed-figures.js @@ -0,0 +1,346 @@ +/* + * Shared lazy loader for EasyDiffraction interactive figures. + * + * Loaded once per docs page (mkdocs `extra_javascript`). Plotly figures + * emitted in SHARED embedding mode are inert placeholders carrying their + * spec as `application/json`; this loader renders each one lazily when it + * scrolls near the viewport (IntersectionObserver), behind a "Loading…" + * skeleton. It also centralizes the theme-sync, resize, and legend-toggle + * behavior that used to be duplicated inline in every figure. + * + * Three.js structure scenes manage their own lazy boot (they are ES + * modules resolved through the page-level import map); this file handles + * Plotly only. + * + * Source of truth for behavior: + * src/easydiffraction/display/plotters/plotly.py. Theme colors arrive in + * each figure's payload (`edTheme`) so Python stays the single source. + */ +(function () { + 'use strict'; + + var FIGURE_SELECTOR = '.ed-figure[data-ed-figure="plotly"]'; + var ROOT_MARGIN = '200px'; + + function plotlyConfig() { + return { + displayModeBar: true, + displaylogo: false, + responsive: true, + modeBarButtonsToRemove: [ + 'select2d', + 'lasso2d', + 'zoomIn2d', + 'zoomOut2d', + 'autoScale2d', + ], + }; + } + + function readSpec(figureEl) { + var specEl = figureEl.querySelector('script.ed-figure-spec'); + if (!specEl) { + return null; + } + try { + return JSON.parse(specEl.textContent); + } catch (err) { + return null; + } + } + + function hostTheme() { + var scheme = + (document.body && document.body.getAttribute('data-md-color-scheme')) || + (document.documentElement && + document.documentElement.getAttribute('data-md-color-scheme')); + return scheme === 'slate' ? 'dark' : 'light'; + } + + // ---- Theme sync ----------------------------------------------------- + + function axisNames(graphDiv) { + var names = { xaxis: true, yaxis: true }; + [graphDiv.layout, graphDiv._fullLayout].forEach(function (layout) { + if (!layout) { + return; + } + Object.keys(layout).forEach(function (key) { + if (/^[xyz]axis[0-9]*$/.test(key)) { + names[key] = true; + } + }); + }); + return Object.keys(names); + } + + function correlationColorscale(colors) { + return [ + [0.0, '#d73027'], + [0.5, colors.background], + [1.0, '#4575b4'], + ]; + } + + function applyTheme(graphDiv, theme, themeSync) { + if (!graphDiv || !window.Plotly || !theme) { + return; + } + var mode = hostTheme(); + var colors = theme[mode] || theme.light; + if (!colors) { + return; + } + var update = { + paper_bgcolor: colors.background, + plot_bgcolor: colors.background, + 'modebar.bgcolor': colors.background, + 'font.color': colors.foreground, + 'title.font.color': colors.foreground, + 'legend.bgcolor': colors.legend, + 'legend.font.color': colors.foreground, + 'hoverlabel.bgcolor': colors.hoverBackground, + 'hoverlabel.font.color': colors.foreground, + }; + axisNames(graphDiv).forEach(function (name) { + update[name + '.color'] = colors.foreground; + update[name + '.gridcolor'] = colors.innerTickGrid; + update[name + '.linecolor'] = colors.axisFrame; + update[name + '.zerolinecolor'] = colors.innerTickGrid; + update[name + '.title.font.color'] = colors.foreground; + update[name + '.tickfont.color'] = colors.foreground; + }); + var annotations = + (graphDiv.layout && graphDiv.layout.annotations) || + (graphDiv._fullLayout && graphDiv._fullLayout.annotations) || + []; + annotations.forEach(function (_unused, index) { + update['annotations[' + index + '].font.color'] = colors.foreground; + }); + if (themeSync && Array.isArray(themeSync.axisFrameShapeIndexes)) { + themeSync.axisFrameShapeIndexes.forEach(function (shapeIndex) { + if (Number.isInteger(shapeIndex) && shapeIndex >= 0) { + update['shapes[' + shapeIndex + '].line.color'] = colors.axisFrame; + } + }); + } + try { + var pending = [window.Plotly.relayout(graphDiv, update)]; + if (themeSync && themeSync.correlationHeatmap) { + (graphDiv.data || []).forEach(function (trace, index) { + if (trace && trace.type === 'heatmap') { + pending.push( + window.Plotly.restyle( + graphDiv, + { colorscale: [correlationColorscale(colors)] }, + [index], + ), + ); + } + }); + } + Promise.all( + pending.filter(function (item) { + return item && typeof item.then === 'function'; + }), + ); + } catch (err) { + /* keep theme switching from breaking interaction with the figure */ + } + } + + function watchTheme(graphDiv, theme, themeSync) { + applyTheme(graphDiv, theme, themeSync); + if (!window.MutationObserver) { + return; + } + var observer = new MutationObserver(function () { + applyTheme(graphDiv, theme, themeSync); + }); + var filter = { + attributes: true, + attributeFilter: ['data-md-color-scheme'], + }; + observer.observe(document.documentElement, filter); + if (document.body) { + observer.observe(document.body, filter); + } + } + + // ---- Resize --------------------------------------------------------- + + function watchResize(graphDiv) { + if (!window.Plotly || !window.Plotly.Plots) { + return; + } + var pending = false; + function resize() { + if (pending) { + return; + } + pending = true; + window.requestAnimationFrame(function () { + pending = false; + if (!graphDiv.isConnected || graphDiv.offsetParent === null) { + return; + } + window.Plotly.Plots.resize(graphDiv); + }); + } + if (window.ResizeObserver) { + var observer = new ResizeObserver(resize); + observer.observe(graphDiv); + if (graphDiv.parentElement) { + observer.observe(graphDiv.parentElement); + } + } + document.addEventListener('visibilitychange', function () { + if (!document.hidden) { + resize(); + } + }); + window.addEventListener('pageshow', resize); + } + + // ---- Legend toggle modebar button ----------------------------------- + + function readLegendVisible(graphDiv) { + var legend = graphDiv.querySelector('.legend'); + if (legend) { + var style = window.getComputedStyle(legend); + return style.display !== 'none' && style.visibility !== 'hidden'; + } + if (graphDiv._fullLayout && typeof graphDiv._fullLayout.showlegend === 'boolean') { + return graphDiv._fullLayout.showlegend; + } + return true; + } + + function setLegendVisible(graphDiv, visible) { + var legend = graphDiv.querySelector('.legend'); + if (legend) { + legend.style.display = visible ? 'inline' : 'none'; + legend.style.visibility = visible ? 'visible' : 'hidden'; + legend.style.pointerEvents = visible ? '' : 'none'; + } + if (graphDiv.layout) { + graphDiv.layout.showlegend = visible; + } + var button = graphDiv.querySelector('[data-legend-toggle="true"]'); + if (button) { + button.classList.toggle('active', visible); + button.setAttribute('aria-pressed', String(visible)); + } + } + + function installLegendToggle(graphDiv) { + function build() { + var modebar = graphDiv.querySelector('.modebar'); + if (!modebar || !modebar.querySelector('.modebar-group')) { + return; + } + var button = modebar.querySelector('[data-legend-toggle="true"]'); + if (!button) { + var group = document.createElement('div'); + group.className = 'modebar-group'; + button = document.createElement('a'); + button.className = 'modebar-btn'; + button.href = 'javascript:void(0)'; + button.setAttribute('data-title', 'Toggle legend'); + button.setAttribute('data-legend-toggle', 'true'); + button.setAttribute('aria-label', 'Toggle legend'); + button.setAttribute('role', 'button'); + button.setAttribute('tabindex', '0'); + button.innerHTML = + ''; + group.appendChild(button); + modebar.appendChild(group); + } + function toggle(event) { + if (event) { + event.preventDefault(); + event.stopPropagation(); + } + setLegendVisible(graphDiv, !readLegendVisible(graphDiv)); + } + button.onclick = toggle; + button.onkeydown = function (event) { + if (event.key === 'Enter' || event.key === ' ') { + toggle(event); + } + }; + setLegendVisible(graphDiv, readLegendVisible(graphDiv)); + } + if (graphDiv.on) { + graphDiv.on('plotly_afterplot', build); + } + window.requestAnimationFrame(build); + } + + // ---- Activation ----------------------------------------------------- + + function render(figureEl) { + if (figureEl.getAttribute('data-ed-rendered') === 'true') { + return; + } + var spec = readSpec(figureEl); + var target = figureEl.querySelector('.ed-figure-target'); + if (!spec || !target || !window.Plotly) { + return; + } + figureEl.setAttribute('data-ed-rendered', 'true'); + var config = spec.config || plotlyConfig(); + window.Plotly.newPlot(target, spec.data || [], spec.layout || {}, config).then( + function () { + figureEl.classList.add('ed-figure--ready'); + watchTheme(target, spec.edTheme, spec.edThemeSync); + watchResize(target); + if (spec.edHasLegend) { + installLegendToggle(target); + } + }, + ); + } + + function activate() { + var figures = document.querySelectorAll(FIGURE_SELECTOR); + if (!figures.length) { + return; + } + var list = Array.prototype.slice.call(figures); + var eager = + !('IntersectionObserver' in window) || + (window.matchMedia && window.matchMedia('print').matches); + if (eager) { + list.forEach(render); + return; + } + var observer = new IntersectionObserver( + function (entries, obs) { + entries.forEach(function (entry) { + if (entry.isIntersecting) { + render(entry.target); + obs.unobserve(entry.target); + } + }); + }, + { rootMargin: ROOT_MARGIN }, + ); + list.forEach(function (figureEl) { + observer.observe(figureEl); + }); + // Render everything before printing so off-screen figures appear. + window.addEventListener('beforeprint', function () { + list.forEach(render); + }); + } + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', activate); + } else { + activate(); + } +})(); diff --git a/docs/docs/assets/stylesheets/extra.css b/docs/docs/assets/stylesheets/extra.css index 70aeda52f..57e022f24 100644 --- a/docs/docs/assets/stylesheets/extra.css +++ b/docs/docs/assets/stylesheets/extra.css @@ -433,3 +433,35 @@ h1 .label-experiment { .label-experiment:hover { color: white !important; } + +/* ---------------------------------------------------------------------- + * Lazy interactive figures (ed-figures.js, SHARED embedding mode). + * The skeleton reserves the figure height (set inline) to avoid layout + * shift, and is hidden once the figure renders. + * ------------------------------------------------------------------- */ + +.ed-figure { + position: relative; + margin: 0.6rem 0; +} + +.ed-figure-skeleton { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + min-height: 120px; + color: var(--md-default-fg-color--light); + background: var(--md-default-fg-color--lightest); + border-radius: 2px; + font-size: 0.75rem; + letter-spacing: 0.04em; +} + +.ed-figure--ready .ed-figure-skeleton { + display: none; +} + +.ed-figure-target { + width: 100%; +} From acfb3349695ae604759b262ed139e752f8b8e59e Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:13:36 +0200 Subject: [PATCH 09/50] Wire docs runtime assets and page importmap --- docs/dev/plans/plotting-docs-performance.md | 2 +- docs/mkdocs.yml | 4 ++++ docs/overrides/main.html | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index bf84a9a1a..8d9d09d6a 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -187,7 +187,7 @@ dependency the plan does not name, **stop and ask**. styles to `extra.css`. Commit: `Add shared ed-figures.js lazy figure loader` -- [ ] **P1.6 — Wire docs runtime assets and the page importmap.** Add +- [x] **P1.6 — Wire docs runtime assets and the page importmap.** Add the Plotly bundle + `ed-figures.js` to `extra_javascript` (and skeleton CSS to `extra_css` if separate) in `mkdocs.yml`; add the `{% block extrahead %}` importmap to `overrides/main.html`. (Leave diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 7694791e8..7dc3c0b90 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -87,6 +87,10 @@ extra_css: extra_javascript: - assets/javascripts/extra.js + # Self-hosted Plotly (cartesian bundle) plus the shared lazy loader for + # SHARED-mode figures. Plotly must load before ed-figures.js, which uses it. + - assets/javascripts/vendor/plotly/plotly-cartesian.min.js + - assets/javascripts/ed-figures.js # MathJax for rendering mathematical expressions - assets/javascripts/mathjax.js # Custom MathJax config to ensure compatibility with mkdocs-jupyter - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js # Official MathJax CDN diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 2e1468273..07acc6194 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -1,5 +1,23 @@ {% extends "base.html" %} +{% block extrahead %} + {{ super() }} + {# Page-level import map for the self-hosted Three.js modules (see the + plotting-docs-performance ADR). One per page is the only reliable + way to deliver an import map; it is inert on pages with no structure + view. Paths resolve against base_url so they stay correct under the + mike-versioned site. #} + +{% endblock %} + {% block content %} {% if page.nb_url %} From be0f1bcc87793ad24d1bfaf8cac5d3a589e6428d Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:18:00 +0200 Subject: [PATCH 10/50] Add SHARED embedding mode to Plotly serializer --- docs/dev/plans/plotting-docs-performance.md | 2 +- .../display/plotters/plotly.py | 116 +++++++++++++++++- 2 files changed, 116 insertions(+), 2 deletions(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 8d9d09d6a..fdd458d61 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -194,7 +194,7 @@ dependency the plan does not name, **stop and ask**. `include_requirejs` in place for now — Phase 2 removes it.) Commit: `Wire docs runtime assets and page importmap` -- [ ] **P1.7 — Add `SHARED` mode to the Plotly serializer.** Thread the +- [x] **P1.7 — Add `SHARED` mode to the Plotly serializer.** Thread the mode through `serialize_html` and `_show_figure`; in `SHARED` emit placeholder + `application/json` payload + `data-ed-figure`, `include_plotlyjs=False`, no per-figure post-scripts. diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index b6b478e35..f68645aa6 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -10,6 +10,8 @@ from __future__ import annotations +import json +import uuid from dataclasses import dataclass import darkdetect @@ -17,6 +19,7 @@ import plotly.graph_objects as go import plotly.io as pio from plotly.subplots import make_subplots +from plotly.utils import PlotlyJSONEncoder try: from IPython.display import HTML @@ -46,8 +49,10 @@ from easydiffraction.display.theme import display_theme_colors from easydiffraction.display.theme import display_theme_colors_for_template from easydiffraction.utils._vendored.theme_detect import is_dark +from easydiffraction.utils.environment import FigureEmbedMode from easydiffraction.utils.environment import in_jupyter from easydiffraction.utils.environment import in_pycharm +from easydiffraction.utils.environment import resolve_figure_embed_mode DEFAULT_COLORS = { 'meas': 'rgb(31, 119, 180)', @@ -1670,12 +1675,115 @@ def _show_figure( if in_pycharm() or display is None or HTML is None: fig.show(config=config) + return + + # Docs notebook execution sets SHARED so the baked cell HTML is a + # lazy placeholder; live Jupyter stays INLINE (eager, runtime via + # the CDN as before). + if resolve_figure_embed_mode() is FigureEmbedMode.SHARED: + html_fig = self.serialize_html( + fig, + include_plotlyjs=False, + mode=FigureEmbedMode.SHARED, + ) else: html_fig = self.serialize_html( fig, include_plotlyjs='cdn', + mode=FigureEmbedMode.INLINE, ) - display(HTML(html_fig)) + display(HTML(html_fig)) + + @staticmethod + def _ed_theme_payload() -> dict: + """Return light and dark theme colors for the shared loader.""" + return { + 'light': { + 'background': LIGHT_BACKGROUND_COLOR, + 'foreground': LIGHT_FOREGROUND_COLOR, + 'axisFrame': LIGHT_AXIS_FRAME_COLOR, + 'innerTickGrid': LIGHT_INNER_TICK_GRID_COLOR, + 'hoverBackground': LIGHT_HOVER_BACKGROUND_COLOR, + 'legend': LIGHT_LEGEND_BACKGROUND_COLOR, + }, + 'dark': { + 'background': DARK_BACKGROUND_COLOR, + 'foreground': DARK_FOREGROUND_COLOR, + 'axisFrame': DARK_AXIS_FRAME_COLOR, + 'innerTickGrid': DARK_INNER_TICK_GRID_COLOR, + 'hoverBackground': DARK_HOVER_BACKGROUND_COLOR, + 'legend': DARK_LEGEND_BACKGROUND_COLOR, + }, + } + + @classmethod + def _ed_theme_sync_payload(cls, fig: object) -> dict: + """Return live theme-sync metadata for the shared loader.""" + meta = cls._figure_meta(fig) + theme_sync = meta.get(THEME_SYNC_META_KEY) if isinstance(meta, dict) else None + if not isinstance(theme_sync, dict): + return {} + payload: dict = {} + indexes = theme_sync.get(THEME_SYNC_AXIS_FRAME_SHAPE_INDEXES_KEY) + if isinstance(indexes, list): + payload['axisFrameShapeIndexes'] = indexes + if theme_sync.get(THEME_SYNC_CORRELATION_HEATMAP_KEY): + payload['correlationHeatmap'] = True + return payload + + @staticmethod + def _figure_height(fig: object) -> int: + """Return the figure height in pixels for the loading skeleton.""" + layout = getattr(fig, 'layout', None) + height = getattr(layout, 'height', None) if layout is not None else None + if isinstance(height, (int, float)) and not isinstance(height, bool) and height > 0: + return int(height) + return DEFAULT_HEIGHT + + @classmethod + def _serialize_html_shared(cls, fig: object) -> str: + """ + Serialize a figure as a lazy SHARED-mode placeholder. + + Emits a skeleton plus the figure spec as ``application/json`` for + the shared ``ed-figures.js`` loader to render on demand. No Plotly + bundle or per-figure post-script is embedded; the runtime loads + once per page and the loader owns theme-sync, resize, and legend. + + Parameters + ---------- + fig : object + Plotly figure to serialize. + + Returns + ------- + str + Placeholder HTML carrying the figure spec. + """ + figure_dict = fig.to_plotly_json() + spec = { + 'data': figure_dict.get('data', []), + 'layout': figure_dict.get('layout', {}), + 'config': cls._get_config(), + 'edTheme': cls._ed_theme_payload(), + 'edThemeSync': cls._ed_theme_sync_payload(fig), + 'edHasLegend': cls._has_visible_legend(fig), + } + # Escape '<' so the JSON cannot terminate the ' + '' + ) + return cls._wrap_html_figure(fig, html_fig) @classmethod def serialize_html( @@ -1683,6 +1791,7 @@ def serialize_html( fig: object, *, include_plotlyjs: bool | str, + mode: FigureEmbedMode = FigureEmbedMode.STANDALONE, force_template: str | None = None, axis_frame_color: str | None = None, grid_color: str | None = None, @@ -1696,6 +1805,9 @@ def serialize_html( Plotly figure to serialize. include_plotlyjs : bool | str Plotly JavaScript inclusion mode passed to Plotly. + mode : FigureEmbedMode, default=STANDALONE + Embedding mode. ``SHARED`` emits a lazy placeholder for the + docs loader; ``INLINE``/``STANDALONE`` serialize eagerly. force_template : str | None, default=None Optional template name applied before serialization. axis_frame_color : str | None, default=None @@ -1708,6 +1820,8 @@ def serialize_html( str Inline HTML containing the figure and helper scripts. """ + if mode is FigureEmbedMode.SHARED: + return cls._serialize_html_shared(fig) background_color = None if force_template is not None: fig.update_layout(template=force_template) From 20152136ce2047ba415756f0f54f2d516f3076a2 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:44:09 +0200 Subject: [PATCH 11/50] Add SHARED embedding mode to Three.js renderer --- .../accepted/plotting-docs-performance.md | 7 +++++++ docs/dev/plans/plotting-docs-performance.md | 13 ++++++++----- .../display/structure/renderers/threejs.py | 19 ++++++++++++++++++- .../structure/templates/structure.html.j2 | 5 +++++ 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/docs/dev/adrs/accepted/plotting-docs-performance.md b/docs/dev/adrs/accepted/plotting-docs-performance.md index 1d4cd9a78..7d7979c06 100644 --- a/docs/dev/adrs/accepted/plotting-docs-performance.md +++ b/docs/dev/adrs/accepted/plotting-docs-performance.md @@ -414,6 +414,13 @@ Settled in discussion on 2026-06-02: - Static-image-first placeholders (kaleido) if skeletons prove insufficient on the heaviest pages. +- Lazy on-scroll download of the Three.js runtime. The docs `SHARED` + three.js view self-hosts (page-level import map) and shows a loading + skeleton but renders **eagerly** — P1.8 was scoped to this low-risk + path. Deferring the runtime download behind an `IntersectionObserver` + (dynamic `import('three')`) is a follow-up; Plotly already loads + lazily and structure views are rare, so the win is small relative to + the module-rewrite risk. - Trace downsampling for very dense series in the docs view (smaller payload + faster draw) — a separate, data-side optimization. - A docs CI budget check (page weight / figure count) to catch diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index fdd458d61..e75bc7b6a 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -202,11 +202,14 @@ dependency the plan does not name, **stop and ask**. `resolve_figure_embed_mode()`. Commit: `Add SHARED embedding mode to Plotly serializer` -- [ ] **P1.8 — Add `SHARED` mode to the Three.js renderer.** Thread the - mode through `render(...)` (`viewing.py` + `threejs.py`) and - `structure.html.j2`; `SHARED` drops the per-scene importmap (bare - specifiers) and emits a placeholder + lazy boot; `STANDALONE` - keeps the inline data-URL importmap. Commit: +- [x] **P1.8 — Add `SHARED` mode to the Three.js renderer.** Add a + `mode` arg to `threejs.py` `render(...)` that resolves from the + environment when unset (so `viewing.py` and the ASCII/raster + renderers stay untouched); `SHARED` drops the per-scene importmap + (the page-level one resolves the bare specifiers) and shows a + loading skeleton — eager render, with the lazy on-scroll download + deferred per the ADR; `STANDALONE`/`INLINE` keep the per-scene + import map per `offline`. Commit: `Add SHARED embedding mode to Three.js renderer` - [ ] **P1.9 — Pass `STANDALONE` from the report renderer.** Update diff --git a/src/easydiffraction/display/structure/renderers/threejs.py b/src/easydiffraction/display/structure/renderers/threejs.py index fb154f996..59a38e64a 100644 --- a/src/easydiffraction/display/structure/renderers/threejs.py +++ b/src/easydiffraction/display/structure/renderers/threejs.py @@ -21,6 +21,8 @@ from easydiffraction.display.structure.enums import ColorSchemeEnum from easydiffraction.display.structure.renderers.base import StructureRendererBase from easydiffraction.utils._vendored.theme_detect import is_dark +from easydiffraction.utils.environment import FigureEmbedMode +from easydiffraction.utils.environment import resolve_figure_embed_mode if TYPE_CHECKING: from easydiffraction.display.structure.scene import StructureScene @@ -175,6 +177,7 @@ def render( features: frozenset[str], offline: bool = True, dark: bool | None = None, + mode: FigureEmbedMode | None = None, ) -> str: """ Render the scene as a self-contained interactive HTML document. @@ -194,6 +197,11 @@ def render( Force the dark (``True``) or light (``False``) theme. When ``None`` (default), auto-detect from the environment. Reports pass ``False`` so the view matches their light page. + mode : FigureEmbedMode | None, default=None + Embedding mode; ``None`` resolves from the environment. + ``SHARED`` (docs) omits the per-scene import map and relies + on the page-level one; ``INLINE``/``STANDALONE`` emit a + per-scene import map per ``offline``. Returns ------- @@ -202,11 +210,20 @@ def render( """ if dark is None: dark = is_dark() + if mode is None: + mode = resolve_figure_embed_mode() colours = theme_colors(dark=dark) light_colours = theme_colors(dark=False) dark_colours = theme_colors(dark=True) payload = json.dumps(_scene_payload(scene)).replace('
+
Loading 3D view…
@@ -114,7 +115,9 @@ } +{% if import_map %} +{% endif %} From 19c285a41280045ec91f68f59317d59a27a2fae1 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:45:17 +0200 Subject: [PATCH 12/50] Pass STANDALONE mode from report renderer --- docs/dev/plans/plotting-docs-performance.md | 2 +- src/easydiffraction/report/html_renderer.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index e75bc7b6a..483fd3f57 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -212,7 +212,7 @@ dependency the plan does not name, **stop and ask**. import map per `offline`. Commit: `Add SHARED embedding mode to Three.js renderer` -- [ ] **P1.9 — Pass `STANDALONE` from the report renderer.** Update +- [x] **P1.9 — Pass `STANDALONE` from the report renderer.** Update `report/html_renderer.py` to pass `STANDALONE` into `serialize_html` / `render`, preserving the `offline` contract exactly. Commit: `Pass STANDALONE mode from report renderer` diff --git a/src/easydiffraction/report/html_renderer.py b/src/easydiffraction/report/html_renderer.py index b7080b49c..d20656a90 100644 --- a/src/easydiffraction/report/html_renderer.py +++ b/src/easydiffraction/report/html_renderer.py @@ -18,6 +18,7 @@ from easydiffraction.display.plotting import DEFAULT_BRAGG_ROW from easydiffraction.display.plotting import DEFAULT_RESID_HEIGHT from easydiffraction.report.style import report_style_context +from easydiffraction.utils.environment import FigureEmbedMode _TEMPLATE_NAME = 'html/report.html.j2' _MATHJAX_FILENAME = 'mathjax-tex-mml-chtml.js' @@ -225,6 +226,7 @@ def _structure_figure_html_context( features=features, offline=offline, dark=False, + mode=FigureEmbedMode.STANDALONE, ) return rendered @@ -323,6 +325,7 @@ def _figure_html( return PlotlyPlotter.serialize_html( figure, include_plotlyjs=include_plotlyjs, + mode=FigureEmbedMode.STANDALONE, force_template='plotly_white', axis_frame_color=str(report_style['axis_hex']), grid_color=str(report_style['chart_grid_hex']), From 54f1f4ec7f5359f14ef446f80aaf76e1e64f9316 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:45:54 +0200 Subject: [PATCH 13/50] Route docs notebook execution to SHARED mode --- docs/dev/plans/plotting-docs-performance.md | 2 +- pixi.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 483fd3f57..a5e8b4472 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -217,7 +217,7 @@ dependency the plan does not name, **stop and ask**. `serialize_html` / `render`, preserving the `offline` contract exactly. Commit: `Pass STANDALONE mode from report renderer` -- [ ] **P1.10 — Route docs notebook execution to `SHARED`.** Set +- [x] **P1.10 — Route docs notebook execution to `SHARED`.** Set `EASYDIFFRACTION_FIGURE_EMBED_MODE=shared` on `notebook-exec-ci` and `notebook-exec` in `pixi.toml`. This is the switch that makes baked cell HTML carry `SHARED` output; live Jupyter stays diff --git a/pixi.toml b/pixi.toml index 1d2b64b2c..c0eb494d0 100644 --- a/pixi.toml +++ b/pixi.toml @@ -196,8 +196,8 @@ jupyter = { cmd = 'jupyter', env = { EASYDIFFRACTION_ARTIFACT_ROOT = 'tmp/tutori notebook-convert = 'jupytext docs/docs/tutorials/*.py --from py:percent --to ipynb' notebook-strip = 'nbstripout docs/docs/tutorials/*.ipynb' notebook-tweak = 'python tools/tweak_notebooks.py docs/docs/tutorials/' -notebook-exec = { cmd = 'python -m pytest --nbmake docs/docs/tutorials/ --overwrite --color=yes -n auto -v', env = { EASYDIFFRACTION_ARTIFACT_ROOT = 'tmp/tutorials' } } -notebook-exec-ci = { cmd = 'python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=1200 --overwrite --color=yes -n auto -v', env = { EASYDIFFRACTION_ARTIFACT_ROOT = '.' } } +notebook-exec = { cmd = 'python -m pytest --nbmake docs/docs/tutorials/ --overwrite --color=yes -n auto -v', env = { EASYDIFFRACTION_ARTIFACT_ROOT = 'tmp/tutorials', EASYDIFFRACTION_FIGURE_EMBED_MODE = 'shared' } } +notebook-exec-ci = { cmd = 'python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=1200 --overwrite --color=yes -n auto -v', env = { EASYDIFFRACTION_ARTIFACT_ROOT = '.', EASYDIFFRACTION_FIGURE_EMBED_MODE = 'shared' } } notebook-prepare = { depends-on = [ 'notebook-convert', From 0aaf7b752aa2b58820a34432688e5bc0971f30af Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:46:14 +0200 Subject: [PATCH 14/50] Reach Phase 1 review gate --- docs/dev/plans/plotting-docs-performance.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index a5e8b4472..2365ab6bf 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -223,7 +223,7 @@ dependency the plan does not name, **stop and ask**. baked cell HTML carry `SHARED` output; live Jupyter stays `INLINE`. Commit: `Route docs notebook execution to SHARED mode` -- [ ] **P1.11 — Phase 1 review gate (no code).** Mark this item `[x]`, +- [x] **P1.11 — Phase 1 review gate (no code).** Mark this item `[x]`, commit the checklist update alone, then hand off to `/review-impl-1`. Commit: `Reach Phase 1 review gate` @@ -292,7 +292,7 @@ and `docs/site/` untracked. For tutorial project-path collisions in ## Status checklist -- [ ] Phase 1 complete (P1.1–P1.11 committed) +- [x] Phase 1 complete (P1.1–P1.11 committed) - [ ] Phase 1 review cycle closed (`/review-impl-1` sentinel) - [ ] Phase 2 tests added; `test-structure-check` + the five task commands clean From f4c4b61b2f1139f372aff5ee5d3c8a9464194a02 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 15:54:23 +0200 Subject: [PATCH 15/50] Guard LICENSES.md drift in vendor-check-js --- tools/bump_vendored_js.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/bump_vendored_js.py b/tools/bump_vendored_js.py index 9c0fdcbbd..b62ae11a4 100644 --- a/tools/bump_vendored_js.py +++ b/tools/bump_vendored_js.py @@ -171,7 +171,10 @@ def _bump_runtime(runtime: VendoredRuntime) -> None: def _check_runtime(runtime: VendoredRuntime) -> list[str]: """ - Return drift messages for a runtime's vendored files. + Return drift messages for a runtime's vendored files and license. + + Checks both the asset hashes and that ``LICENSES.md`` exists and + matches the regenerated text from the pinned table. Parameters ---------- @@ -196,6 +199,14 @@ def _check_runtime(runtime: VendoredRuntime) -> list[str]: f'hash drift: {runtime.dest_dir / asset.filename} ' f'(expected {asset.sha256}, actual {actual})' ) + license_path = dest_dir / 'LICENSES.md' + if not license_path.is_file(): + problems.append(f'missing: {runtime.dest_dir / "LICENSES.md"}') + elif license_path.read_text(encoding='utf-8') != _license_text(runtime): + problems.append( + f'license drift: {runtime.dest_dir / "LICENSES.md"} ' + f'(does not match the pinned table; run vendor-update-js)' + ) return problems From 7e9b711ac19262b3a498693c9a09d16b9f7b7d39 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 18:11:10 +0200 Subject: [PATCH 16/50] Downcast SHARED figure data to float32 --- .../display/plotters/plotly.py | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index f68645aa6..c2acab907 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -10,6 +10,7 @@ from __future__ import annotations +import base64 import json import uuid from dataclasses import dataclass @@ -126,6 +127,42 @@ THEME_SYNC_CORRELATION_HEATMAP_KEY = 'correlation_heatmap' +def _typed_arrays_to_float32(value: object) -> object: + """ + Recursively transcode float64 Plotly typed-array specs to float32. + + Plotly serializes numpy arrays as base64 typed-array specs + (``{'dtype': 'f8', 'bdata': ...}``). For the docs display, float32 + (~7 significant figures) is visually lossless and halves the bulk + data size. Scalars and small inline lists are left untouched. + + Parameters + ---------- + value : object + A figure dict, list, or leaf from ``fig.to_plotly_json()``. + + Returns + ------- + object + The same structure with float64 typed arrays downcast to float32. + """ + if isinstance(value, dict): + if value.get('dtype') == 'f8' and 'bdata' in value: + downcast = np.frombuffer( + base64.b64decode(value['bdata']), + dtype=' str: the shared ``ed-figures.js`` loader to render on demand. No Plotly bundle or per-figure post-script is embedded; the runtime loads once per page and the loader owns theme-sync, resize, and legend. + Bulk float64 arrays are downcast to float32 (visually lossless, + ~7 significant figures) to roughly halve the embedded data. Parameters ---------- @@ -1760,7 +1799,7 @@ def _serialize_html_shared(cls, fig: object) -> str: str Placeholder HTML carrying the figure spec. """ - figure_dict = fig.to_plotly_json() + figure_dict = _typed_arrays_to_float32(fig.to_plotly_json()) spec = { 'data': figure_dict.get('data', []), 'layout': figure_dict.get('layout', {}), From 0f3bc269cb4f4cde050ca3c8338c44277b1ed126 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 18:22:38 +0200 Subject: [PATCH 17/50] Finalize Wyckoff letter detection ADR --- .../suggestions/wyckoff-letter-detection.md | 304 +++++++++++++----- .../wyckoff-letter-detection_reply-1.md | 92 ++++++ .../wyckoff-letter-detection_reply-11.md | 53 +++ .../wyckoff-letter-detection_reply-12.md | 50 +++ .../wyckoff-letter-detection_reply-13.md | 26 ++ .../wyckoff-letter-detection_reply-14.md | 15 + .../wyckoff-letter-detection_reply-15.md | 12 + .../wyckoff-letter-detection_reply-2.md | 47 +++ .../wyckoff-letter-detection_reply-4.md | 57 ++++ .../wyckoff-letter-detection_reply-5.md | 36 +++ .../wyckoff-letter-detection_reply-7.md | 36 +++ .../wyckoff-letter-detection_reply-8.md | 40 +++ .../wyckoff-letter-detection_reply-9.md | 29 ++ .../wyckoff-letter-detection_review-1.md | 78 +++++ .../wyckoff-letter-detection_review-10.md | 11 + .../wyckoff-letter-detection_review-11.md | 48 +++ .../wyckoff-letter-detection_review-12.md | 70 ++++ .../wyckoff-letter-detection_review-13.md | 46 +++ .../wyckoff-letter-detection_review-14.md | 28 ++ .../wyckoff-letter-detection_review-15.md | 29 ++ .../wyckoff-letter-detection_review-16.md | 12 + .../wyckoff-letter-detection_review-2.md | 36 +++ .../wyckoff-letter-detection_review-3.md | 11 + .../wyckoff-letter-detection_review-4.md | 41 +++ .../wyckoff-letter-detection_review-5.md | 27 ++ .../wyckoff-letter-detection_review-6.md | 11 + .../wyckoff-letter-detection_review-7.md | 26 ++ .../wyckoff-letter-detection_review-8.md | 26 ++ .../wyckoff-letter-detection_review-9.md | 24 ++ 29 files changed, 1234 insertions(+), 87 deletions(-) create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md create mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md index f5f671d33..88b51a748 100644 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md @@ -72,11 +72,12 @@ single calculator backend. ### 1. EasyDiffraction owns the Wyckoff position The library — not a calculator — is the single source of truth for an -atom site's Wyckoff **letter**, **multiplicity**, and **site symmetry**. -Calculators consume these model values and must not re-derive them. -Deriving them model-side, from the un-normalized fractional coordinates, -is also the _correct_ place: it avoids the `[0, 1)` normalization that -forces the cryspy override to exist today. +atom site's Wyckoff **letter** and **multiplicity**, and for the +space-group Wyckoff table that exposes **site symmetry**. Calculators +consume these model values and must not re-derive them. Deriving them +model-side, from the un-normalized fractional coordinates, is also the +_correct_ place: it avoids the `[0, 1)` normalization that forces the +cryspy override to exist today. ### 2. Detection lives in the crystallography submodule @@ -88,21 +89,30 @@ Add to key normalisation below); returns `None` only when that pair is genuinely absent from `SPACE_GROUPS`, preserving today's "no letter, skip constraints" behaviour. Otherwise it tests the coordinate for - membership in each Wyckoff orbit and returns the matched position. -- `wyckoff_position_info(name_hm, coord_code, letter) -> WyckoffPosition | None` - — a plain table lookup that returns the same record for an - already-known letter (auto-detected or user-set), used to populate the - derived descriptors without re-running the matcher. + membership in each Wyckoff orbit and returns the matched position plus + the nearest matched representative template. +- `wyckoff_position_info(name_hm, coord_code, letter, fract_xyz=None, tol=...) -> WyckoffPosition | None` + — a table lookup for an already-known letter (auto-detected or + user-set). When `fract_xyz` is supplied, it selects the nearest orbit + representative for that letter before returning the record; when + `fract_xyz` is omitted, it returns the record without a selected + representative. This populates derived values and supports explicit- + letter snapping without re-running the all-letter matcher. Both return a small frozen -`WyckoffPosition(letter, multiplicity, site_symmetry)` dataclass rather -than bare tuples: the three values are always consumed together (to fill -the letter, multiplicity, and site-symmetry descriptors), named fields -read better at the call sites, and the record can later carry the -equivalent-position orbit without a breaking positional change. This -matches the project's frozen-dataclass metadata idiom (`TypeInfo`, -`Compatibility`); the bare-tuple alternative is rejected as less -readable and fragile to extension. +`WyckoffPosition(letter, multiplicity, site_symmetry, coord_template)` +dataclass rather +than bare tuples: the named values are consumed together when a position +is detected or looked up (the atom site stores the letter and +multiplicity; the derived `space_group_Wyckoff` table exposes the +site-symmetry symbol), and the selected `coord_template` is what +coordinate snapping and constrained-axis flags use. `coord_template` is +`None` only for plain table lookups that do not provide coordinates. +Named fields read better at the call sites, and the record can later +carry the equivalent-position orbit without a breaking positional +change. This matches the project's frozen-dataclass metadata idiom +(`TypeInfo`, `Compatibility`); the bare-tuple alternative is rejected as +less readable and fragile to extension. **Orbit-membership test.** For a coordinate `p = (x, y, z)` and an orbit template parsed into rotation `R` and translation `b`, the point lies on @@ -123,6 +133,16 @@ Refusing to guess (raising) was rejected because it would break the and an arbitrary table-order pick was rejected as less physical than nearest-position. +**Representative selection.** The matcher also records the nearest +template inside the winning orbit. That selected `coord_template`, not +the first `coords_xyz[0]` entry in the table, drives the existing +coordinate-snap and constrained-axis logic. For example, in Pm-3m +letter `6e`, a point near `(0,x,0)` must snap and constrain according to +the `(0,x,0)` representative, not the first table representative +`(x,0,0)`. The explicit-letter path uses +`wyckoff_position_info(..., fract_xyz=current_coords)` to select the +nearest representative for the chosen letter before snapping. + **Numeric kernel.** Solve the modular linear system with NumPy least-squares and check the residual modulo 1 against `tol` (reduce `p − b` to its nearest unit cell, solve `R·v = d`, require the residual @@ -150,12 +170,13 @@ should adopt it too, since they currently miss the `None`-keyed groups. The `wyckoff_letter` descriptor holds a concrete value whenever the space group is supported — there is no persistent "auto vs explicit" mode and no marker bit. The one exception is a space group absent from -`SPACE_GROUPS` (§8), which splits in two: auto-detection is a no-op -there, so **without** an explicit letter the value stays empty, while an -explicit Python/CIF letter is stored verbatim (but carries no -multiplicity, site symmetry, or constraints — §6). §9 defines how each -of those cases serialises. For a supported group the letter changes in -three ways: +`SPACE_GROUPS` (§8), where auto-detection is a no-op. If no letter is +currently stored, the value stays empty; if any non-empty letter is +stored, whether supplied by Python/CIF input or preserved after a later +change from a supported key into an unsupported one, it is kept verbatim +but carries no Wyckoff record, derived multiplicity, or constraints +(§6). §9 defines how each of those cases serialises. For a supported +group the letter changes in three ways: - **Creation or load without a letter.** When `atom_sites.create()` is called without `wyckoff_letter`, or a CIF row has no @@ -170,15 +191,27 @@ three ways: honest as the structure is edited. The trigger is update-flow change-tracking, not a single setter (§4), so every public coordinate edit is covered. +- **User edits the space group or setting.** A change to + `structure.space_group.name_h_m` or + `structure.space_group.it_coordinate_system_code` invalidates every + atom site's Wyckoff record even when coordinates are unchanged. For a + supported new key, all sites re-detect from their current coordinates + and refresh letter, multiplicity, and selected representative. For an + unsupported new key, auto-detection is a no-op: existing letters are + preserved verbatim as unvalidated values, multiplicities become + `None`, constraints are skipped, and a warning records that the group + is untabulated. Preserving the stored letter is chosen over clearing it + because, without a persistent auto/provided marker, deleting it could + remove valid user or CIF input. - **User edits the letter** (public letter setter). The chosen letter is applied as-is and persists. Its site-symmetry constraints snap the constrained axes onto the special position (§5); if the pre-set coordinates lay beyond `tol` of that letter's orbit — they did not fit — a warning is logged that the coordinates were adjusted, but the change is still made. A user-set letter is not re-detected until the - user next edits the coordinates. (For a space group absent from the - table the letter is accepted unvalidated and carries no derived data - or constraints — §8.) + user next edits the coordinates or space-group key. (For a space group + absent from the table the letter is accepted unvalidated and carries no + derived data or constraints — §8.) Detection writes the resolved letter through a dedicated internal mutator, `_set_wyckoff_letter_detected()`, modelled on the existing @@ -190,14 +223,14 @@ next update. ### 4. Detection triggers -Both triggers live in the atom-site update flow +All triggers live in the atom-site update flow ([`default.py:674`](../../../../src/easydiffraction/datablocks/structure/categories/atom_sites/default.py)), not on any individual setter. A single setter hook would be wrong: a coordinate is a live `Parameter`, so `atom.fract_x = 0.1` and `atom.fract_x.value = 0.1` are both public edits — and the latter is the -common one — yet neither must be missed. Both mark the owner dirty and -run `_update()`, so the update flow is the single place that sees every -edit. +common one — yet neither must be missed. Both coordinate paths mark the +owner dirty and run `_update()`, so the update flow is the single place +that sees every edit. - **Fill-if-empty.** An empty letter on a site whose space group is supported is detected and stored. Idempotent — a no-op once the letter @@ -212,6 +245,13 @@ edit. (including the constraint snap that follows in the same pass) — so only a genuine _later_ coordinate change re-detects, and a freshly loaded or user-set letter is not re-detected spuriously. +- **Re-detect on a space-group key change.** The flow also records the + `(name_hm, coord_code)` key used for the last Wyckoff derivation. If + that key changes, every atom site re-runs the supported/unsupported + policy from §3 even when coordinates are unchanged. A supported new + key re-detects all letters and multiplicities; an unsupported key + preserves stored letters as unvalidated values, clears derived + multiplicity to `None`, and skips constraints. Two write paths are deliberately excluded. The minimizer runs `_update()` with `called_by_minimizer=True`, which skips re-detection @@ -220,8 +260,10 @@ varies throughout a fit while the letter stays fixed. The constraint pipeline's snap does not re-trigger detection because it writes within the same pass and its result becomes the new baseline. A user-set letter — even a deliberately less-special one — is therefore never silently -overwritten by an internal recompute; only a real change in the stored -coordinates re-detects. +overwritten by a minimizer update or by the same-pass constraint snap. +It can be re-detected only by a later user coordinate edit or a later +space-group / setting key edit, both of which are explicit model changes +tracked by the stored baselines above. ### 5. Lenient proximity matching, with transparent snapping @@ -236,32 +278,74 @@ project-level tolerance setting is intentionally deferred (see Deferred Work) until users ask for it. Once a letter is assigned, the existing constraint step snaps the constrained axes onto their exact special values. Neither the letter nor the coordinates change silently in -response to a user edit; two `log.warning` messages cover the cases (per -the project's "safe defaults, clear errors" principle): +response to a user edit; `log.warning` messages cover the cases (per the +project's "safe defaults, clear errors" principle): -- a user coordinate edit that changes the detected letter → _"coordinate - change moved the Wyckoff letter of from X to Y"_; +- a user coordinate edit or supported space-group edit that changes the + detected letter → _"change moved the Wyckoff letter of from X + to Y"_; - a user letter change whose snap moves coordinates beyond `tol` → - _"coordinates of did not fit letter L and were adjusted"_. + _"coordinates of did not fit letter L and were adjusted"_; +- a user coordinate edit whose constraint snap changes coordinates even + when the letter stays the same → _"coordinates of were adjusted + to satisfy Wyckoff letter L"_; +- a space-group change into an unsupported key with a stored letter → + _"Wyckoff letter of is stored but not validated because the + space group is untabulated"_. Fill-if-empty detection on `create()` / load is the expected baseline and is not warned per atom. -### 6. Multiplicity and site symmetry become read-only derived descriptors +### 6. Per-atom multiplicity, and a new `space_group_Wyckoff` category -`AtomSite` gains read-only `multiplicity` and `site_symmetry` -descriptors, populated from the `WyckoffPosition` record (via +The per-atom **multiplicity** stays on `AtomSite` as a read-only derived +descriptor, populated from the `WyckoffPosition` record (via `wyckoff_position_info()`) for the resolved letter and re-derived -alongside it. They are read-only (getter only, no setter) per the -guarded-public-properties contract: the user influences them only -through the coordinates and the (optional) explicit letter. - -When there is no `WyckoffPosition` record — an unsupported space group, -or a transient empty letter before the first update — both descriptors -take their empty form: `multiplicity` is `None` and `site_symmetry` is -the empty string. They follow the letter's empty state in lockstep, both -serialise to CIF `?` (§9), and the calculator skips a `None` -multiplicity (§7). +alongside it. It is read-only (getter only, no setter) per the +guarded-public-properties contract — the user influences it only through +the coordinates and the (optional) stored letter — and carries the +standard CIF tag `_atom_site.site_symmetry_multiplicity`. Its empty form +is `None`, and that empty state follows **record availability**, not the +letter: a no-record site (an unsupported space group, with or without a +stored non-empty letter; or a transient empty letter before the first +update) has `None` multiplicity whether its letter is empty or stored but +unvalidated (§8). `None` serialises to CIF `?` (§9) and the calculator +skips it (§7). + +The **site-symmetry symbol is not an atom-site quantity.** In the CIF core +dictionary it belongs to the `space_group_Wyckoff` loop +(`_space_group_Wyckoff.site_symmetry` — "the subgroup of the space group +that leaves the point fixed"), alongside the Wyckoff `letter`, +`multiplicity`, and `coords_xyz`. EasyDiffraction therefore gains a new +read-only `space_group_Wyckoff` category on the crystal structure (a +sibling of `space_group`, `cell`, `atom_sites`). It lists every Wyckoff +position of the structure's current space group — `id` (the CIF category +key, e.g. `6e`), `letter`, `multiplicity`, `site_symmetry`, and the +representative `coords_xyz` — sourced from `SPACE_GROUPS[key]` (`key` via +the §2 normalisation). This is the symbol's correct home and the natural +place for the deferred "expose the full orbit" work. + +The collection key is `id`, serialized as `_space_group_Wyckoff.id`. +That follows the CIF category-key identity rather than using `letter` as +a Python-only shortcut: the `letter` field remains a meaningful +descriptor, but `id` is the stable row identity (for example `6e`) and +keeps the runtime key aligned with the CIF key rule from +[`loop-category-key-identity.md`](../accepted/loop-category-key-identity.md). + +The category is **derived and read-only**: the user neither creates nor +edits its entries. Every item descriptor is getter-only, and the +collection rejects public mutation paths (`add()`, `create()`, +`remove()`, `__setitem__`, and `__delitem__`) with a clear `ValueError`. +`Structure._update_categories()` rebuilds it from the current space +group through a private collection method (for example +`_replace_from_space_group()` using internal adoption) before running +ordinary category update hooks, so no special `_update_priority` is +needed and no other category depends on it for detection. This +read-only, auto-populated collection is a **new pattern** in the model — +no prior instance exists (the closest, `atom_site_aniso`, is +sync-managed but user-editable) — and is justified by being a CIF-defined +category whose contents are fully determined by the space group. When +the space group is absent from `SPACE_GROUPS`, the category is empty. `site_symmetry` stores the International Tables site-symmetry symbol **verbatim** from the table, including its positional dots (for example @@ -293,17 +377,22 @@ already returns early when the group is absent from `SPACE_GROUPS`. instead returns the empty placeholder value plus the tabulated letters for the current space group, `list(SPACE_GROUPS[key]['Wyckoff_positions'])`, where `key` applies the -§2 coordinate-code normalisation. When the space group is genuinely +§2 coordinate-code normalisation. The bundled table now covers all 230 +groups, so a genuinely absent group is rare — an exotic non-standard +setting, or a transient pre-update state — and the absent-group path +below is a guard, not a common case. When the space group is genuinely absent from the table its letters cannot be enumerated, so membership validation is not applied — the validator accepts whatever the user or a CIF supplies. Auto-detection is still a no-op there, but an explicit -letter (a Python assignment or a CIF `Wyckoff_symbol`) is stored -verbatim rather than rejected, because blocking a valid assignment or -failing to load an otherwise-valid CIF is worse than keeping an -unverifiable letter. Such a letter carries no `multiplicity` / -`site_symmetry` (no record, §6) and drives no symmetry constraints, and -a `log.warning` records that the group is untabulated so the letter -could not be validated. Rejecting with a validation error was the +letter from Python/CIF input is stored verbatim rather than rejected, and +a previously stored letter is preserved when a later space-group change +moves the site into an unsupported key. Blocking a valid assignment, +failing to load an otherwise-valid CIF, or deleting a possibly valid +stored value is worse than keeping an unverifiable letter. A stored +non-empty letter in this no-record state carries no `multiplicity` (§6), +drives no symmetry constraints, and a `log.warning` records that the +group is untabulated so the letter could not be validated. Rejecting with +a validation error was the considered alternative, declined as too brittle for boundary input that Python assignment and CIF loading routinely produce. The atom site reaches its space group through the parent chain @@ -321,19 +410,21 @@ and Because the letter is concrete for every supported space group (§3), the project CIF treats it as an ordinary value — none of the earlier draft's column-omission or null-token juggling is needed. An unsupported group -is the only special case, and it splits in two — no explicit letter -stays empty, while an explicit letter is written verbatim — both of +is the only special case, and it splits in two — no stored letter stays +empty, while any stored non-empty letter is written verbatim — both of which fall out naturally below. - **Write.** Emit `_atom_site.Wyckoff_symbol` for every atom, plus the standard `_atom_site.site_symmetry_multiplicity` derived from the model multiplicity (written as `?` when that multiplicity is `None`). **Any** non-empty letter is written verbatim — whether detected for a - supported group or supplied explicitly for an unsupported one (§8); - only the latter carries a `None` multiplicity. A letter is empty, and - serialises as the CIF null `?`, only when it is neither detected nor - explicitly supplied — an unsupported group with no user letter, or a - transient not-yet-updated state. `?` is already the serializer's + supported group, supplied explicitly for an unsupported one, or + preserved after a later change into an unsupported key (§3, §8). A + non-empty letter in an unsupported group carries a `None` + multiplicity because it is stored but unvalidated. A letter is empty, + and serialises as the CIF null `?`, only when it is neither detected + nor otherwise stored — an unsupported group with no stored letter, or + a transient not-yet-updated state. `?` is already the serializer's output for an empty string ([`serialize.py:62`](../../../../src/easydiffraction/io/cif/serialize.py)) and reads back as empty. The column is therefore always present and @@ -355,10 +446,20 @@ which fall out naturally below. ([`iucr_writer.py:876`](../../../../src/easydiffraction/io/cif/iucr_writer.py)) already emits the resolved `Wyckoff_symbol` for every atom and now also emits `_atom_site.site_symmetry_multiplicity`. -- **Derived values on read.** Multiplicity and site symmetry are - recomputed from the letter, so any incoming - `_atom_site.site_symmetry_multiplicity` is ignored rather than trusted - — the library does not validate its own derived output at runtime. +- **`space_group_Wyckoff` loop.** The derived category is model-owned and + report-facing, but it is not persisted in project CIF. `Structure` + explicitly excludes it from project-save serialization via + `_serializable_categories()`, overriding `CategoryOwner`'s default of + serializing all owned categories. The IUCr/report writer emits the + `_space_group_Wyckoff.*` loop from the derived category because that + loop is useful report output even though it is redundant persisted + state. +- **Derived values on read.** Multiplicity is recomputed from the letter, + so any incoming `_atom_site.site_symmetry_multiplicity` is ignored + rather than trusted; the `space_group_Wyckoff` category is re-derived + from the space group, so any incoming `_space_group_Wyckoff.*` values + are ignored/overwritten too — the library does not validate its own + derived output at runtime. ## Open Questions @@ -387,17 +488,23 @@ which fall out naturally below. surfaced by a warning but is a behavioural change for atoms that previously had no letter and were left untouched. - A user-set letter is **not** a permanent pin: editing the coordinates - re-detects the letter and may change it (with a warning). A user who - needs a letter held must avoid editing its coordinates, or re-set the - letter afterwards. This is the deliberate cost of keeping the letter - and coordinates consistent. -- `AtomSite` gains two read-only derived descriptors (`multiplicity` and - `site_symmetry`). + or changing the space-group key re-detects the letter and may change + it (with a warning). A user who needs a letter held must avoid editing + its coordinates or space-group setting, or re-set the letter + afterwards. This is the deliberate cost of keeping the letter, + coordinates, and space-group key consistent. +- `AtomSite` gains one read-only derived descriptor (`multiplicity`), and + a new read-only, auto-populated `space_group_Wyckoff` category exposes + the per-position `site_symmetry` (and the full Wyckoff table) — a new + derived-collection pattern in the model. ### Compatibility Outcomes -- Projects that already specify every Wyckoff letter are unaffected: - explicit letters are respected and produce identical constraints. +- Projects that already specify every Wyckoff letter keep those letters: + explicit letters are respected and reload verbatim. Their constraints + remain unchanged except where the current first-representative shortcut + was wrong for coordinates on another representative of the same orbit; + that case is intentionally fixed by nearest-representative selection. - A saved project reloads to the same letters: every letter is written (whether the user supplied it or detection filled it), so all reload verbatim — and an auto-filled one would re-derive to the same value @@ -425,9 +532,9 @@ which fall out naturally below. - **A persistent auto/provided marker** (an earlier draft of this ADR). Rejected as unnecessary complexity: it required an empty-sentinel state, a marker bit, and column-omission / null-token rules in the - project CIF. Always materialising the letter and re-detecting on a - user coordinate edit yields the same user-facing behaviour with no - marker and a plain, fully-populated CIF column. + project CIF. Always materialising the letter and re-detecting on user + coordinate or space-group-key edits yields the same user-facing + behaviour with no marker and a plain, fully-populated CIF column. - **Keep the letter purely derived and never stored.** Rejected: the calculator and the Python↔CIF correspondence read `.value`, and users need to be able to override the letter; a never-stored value cannot be @@ -452,6 +559,9 @@ may miss: - general vs special positions, and the lowest-multiplicity / nearest tie-break (§2); +- non-first orbit representatives, including auto-detection of a point + near a representative such as `(0,x,0)` and explicit-letter snapping + via the nearest representative rather than `coords_xyz[0]` (§2, §5); - lenient matching of rounded inputs (`0.3333 → 1/3`, `0.4999 → 1/2`) at the `1e-3` tolerance (§5); - the `''`→`None` coordinate-code normalisation — P1/P-1 under their @@ -460,13 +570,25 @@ may miss: - the §3–§4 behaviours: fill-if-empty on `create()` / load; re-detect on a user coordinate edit via _both_ `atom.fract_x = …` and `atom.fract_x.value = …`, with the change warning; the user letter - override with the snap warning; and the minimizer leaving the letter - fixed; -- the no-record contract (§6–§7, §9): empty `multiplicity` / - `site_symmetry`, `?` in CIF, and the calculator skip; + override with the snap warning; same-letter coordinate edits whose + snap moves stored coordinates; supported space-group / setting changes + re-detecting all atom sites; unsupported space-group transitions + preserving stored letters as unvalidated values with `None` + multiplicity; and the minimizer leaving the letter fixed; +- the no-record contract (§6–§7, §9): `None` `multiplicity`, `?` in CIF, + the calculator skip, and an empty `space_group_Wyckoff` category for an + absent group; +- the new `space_group_Wyckoff` category: it auto-populates from the + structure's space group (each entry's letter / multiplicity / + site_symmetry / coords match `SPACE_GROUPS`), rebuilds when the space + group changes, refuses all public mutation paths, is empty for an + absent group, is omitted from project CIF, and is emitted in + IUCr/report output; - CIF round-trip stability — a written letter reloads verbatim, an omitted one re-derives to the same value, and an unsupported-group row - stays empty. + keeps `None` multiplicity whether its letter is empty, explicitly + supplied, or preserved from prior supported detection; non-empty + unsupported letters round-trip verbatim. The edge-case tests are unit-level (no calculation engine, no network, no sleeping) per the test-strategy ADR; the tutorial-corpus checks fit @@ -486,6 +608,12 @@ already built. ## Related ADRs +- [`space-group-database.md`](../accepted/space-group-database.md) — the + complete, self-owned `SPACE_GROUPS` reference table (all 230 groups, + every setting and full Wyckoff orbit) that this detection reads. +- [`category-owner-sections.md`](../accepted/category-owner-sections.md) — + the new read-only, auto-populated `space_group_Wyckoff` category is a + `CategoryOwner`-held sibling category on the crystal structure. - [`iucr-cif-tag-alignment.md`](../accepted/iucr-cif-tag-alignment.md) — `_atom_site.Wyckoff_symbol` and `_atom_site.site_symmetry_multiplicity` tags. @@ -499,4 +627,6 @@ already built. — why Wyckoff letters are a dynamic, space-group-dependent selector rather than a project-owned enum. - [`guarded-public-properties.md`](../accepted/guarded-public-properties.md) - — read-only `multiplicity` and `site_symmetry` (getter only). + — read-only `AtomSite.multiplicity` and read-only + `space_group_Wyckoff` row descriptors, including `site_symmetry` + (getter only). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md new file mode 100644 index 000000000..4c7b29b50 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md @@ -0,0 +1,92 @@ +# Reply 1: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-1.md`](wyckoff-letter-detection_review-1.md). +All five findings accepted; the ADR was updated as described below. One +finding (P2 key normalisation) was verified empirically against the +bundled table before editing. + +## [P1] Persisting resolved letters loses auto-mode semantics + +**Verdict:** Agree. + +**Action taken.** Rewrote §9 "CIF behaviour". The project (round-trip) +CIF now writes `_atom_site.Wyckoff_symbol` **only for provided +(explicit) letters**; auto-mode atoms write no symbol and are +deterministically re-derived on load (same coordinates + space group → +same letter). This preserves both the value and the auto/provided +behaviour across save/load, so the contradiction with persisted-state +restore is gone. I also updated §4 (load is a non-minimizer update that +rebuilds the omitted letter), the Positive bullet on round-trips, and +the Compatibility Outcomes bullet to match the new rule. The IUCr report +export still emits every resolved letter, but it is now explicitly +described as a non-round-trip archival path. + +**Pointer:** §9, §4, Consequences → Positive and Compatibility Outcomes. + +## [P1] Empty string cannot both mean auto and explicit assignment + +**Verdict:** Agree. + +**Action taken.** Rewrote §3 to give the empty sentinel a single, +documented reset meaning: assigning a non-empty letter sets +`provided = True`; assigning `''` clears the marker and returns the site +to auto mode. The empty sentinel is in the validator's allowed set (§8), +so the reset assignment validates. The section now states the invariant +explicitly: empty value ⟺ auto (`provided = False`); non-empty user +assignment ⟺ `provided = True`. + +**Pointer:** §3. + +## [P2] No-code space groups need an explicit key normalisation rule + +**Verdict:** Agree — and it caught a factual error in the draft. + +**Action taken.** Verified against the bundled table: it contains +exactly two `None`-coord-code keys, `(1, None)` (P1, Wyckoff `a`, +multiplicity 1) and `(2, None)` (P-1), and **zero** empty-string keys, +while `SpaceGroup` reports no-code groups as `''`. My draft's "P 1 is +absent from the table" claim was therefore wrong. Added a "Key +normalisation" rule to §2: `''` is normalised to `None` (via a shared +`_normalize_coord_code()` helper) before indexing `SPACE_GROUPS`, so +P1/P-1 resolve to their real positions; corrected the +`detect_wyckoff_letter` bullet to say "genuinely absent"; updated §8 to +key through the same normalisation. Noted that the existing +`_get_wyckoff_exprs()` / `_get_general_position_ops()` lookups should +adopt the helper, since they currently miss the `None`-keyed groups. + +**Pointer:** §2 (Key normalisation + `detect_wyckoff_letter` bullet), +§8. + +## [P2] CIF presence tracking is underspecified for the marker + +**Verdict:** Agree. + +**Action taken.** §9 now names the boundary owner: the collection's +`_after_from_cif()` hook, already invoked by +`category_collection_from_cif` +([`serialize.py:1218`](../../../../src/easydiffraction/io/cif/serialize.py)). +Because auto letters are never written (P1 fix above), a present symbol +loads as a non-empty value, so the hook can set `provided = True` for +every atom with a non-empty loaded `wyckoff_letter` — presence ⟺ +non-empty value — without threading tag-presence through the generic +loader. CIF-null (`?` / `.`) loads as empty and stays auto. + +**Pointer:** §9, read bullets. + +## [P3] The auto-fill path names an API that does not exist + +**Verdict:** Agree. + +**Action taken.** Confirmed there is no `set_value_directly` in +`variable.py`; the real non-validating internal writer is +`_set_value_from_minimizer` +([`variable.py:171`](../../../../src/easydiffraction/core/variable.py)). +§3 now specifies a dedicated private mutator, +`_set_wyckoff_letter_detected()`, modelled on that writer (sets the +value and marks the owner dirty, leaves the provided marker untouched), +and explicitly notes that `set_value_directly` does not exist so the +detected-state write gets its own named path rather than reusing the +minimizer one. + +**Pointer:** §3, auto-mode bullet. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md new file mode 100644 index 000000000..24178f5f7 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md @@ -0,0 +1,53 @@ +# Reply 11: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-11.md`](wyckoff-letter-detection_review-11.md). + +## [P1] `space_group_Wyckoff` still has unresolved structural decisions + +**Verdict:** Agree. + +**Action taken.** The ADR now settles the `space_group_Wyckoff` +structural decisions instead of deferring them: + +- The collection key is `id`, serialized as `_space_group_Wyckoff.id`, + so runtime identity follows the CIF category key rather than using the + non-key `letter` descriptor. +- The category is explicitly read-only: row descriptors are getter-only, + and public collection mutation paths (`add()`, `create()`, `remove()`, + `__setitem__`, and `__delitem__`) raise a clear `ValueError`. +- `Structure._update_categories()` rebuilds the collection from the + current space group via a private collection method before ordinary + category update hooks run, so no special `_update_priority` is needed + and no other category depends on this collection for detection. +- Project CIF excludes the derived loop via + `Structure._serializable_categories()`, while IUCr/report output emits + `_space_group_Wyckoff.*`; incoming loop values are ignored/overwritten + because the category is re-derived from the space group. + +The open questions about persistence, key choice, read-only mechanism, +and update priority were removed. Tests now explicitly cover the read-only +mutation paths, project-CIF omission, and report emission. + +**Pointer:** Decision §6 (`space_group_Wyckoff` key/read-only/rebuild +paragraphs), Decision §9 (CIF behaviour), Open Questions, Testing. + +## [P2] Stale atom-site `site_symmetry` wording remains + +**Verdict:** Agree. + +**Action taken.** Reworded the stale passages so `AtomSite` owns only the +read-only `multiplicity` descriptor, while `site_symmetry` is exposed on +read-only `space_group_Wyckoff` rows: + +- Decision §1 now distinguishes atom-site letter/multiplicity from the + space-group Wyckoff table that exposes site symmetry. +- Decision §2 no longer says the dataclass fills site-symmetry + descriptors on atom sites. +- Decision §3 no longer describes unsupported explicit atom-site letters + as carrying "site symmetry". +- The Related ADR entry for `guarded-public-properties.md` now names + read-only `AtomSite.multiplicity` and read-only + `space_group_Wyckoff` row descriptors. + +**Pointer:** Decision §§1-3 and Related ADRs. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md new file mode 100644 index 000000000..bea967154 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md @@ -0,0 +1,50 @@ +# Reply 12: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-12.md`](wyckoff-letter-detection_review-12.md). + +## [P1] Detected letters can still snap through the wrong orbit representative + +**Verdict:** Agree. + +**Action taken.** The ADR now requires representative selection. The +`WyckoffPosition` record carries a selected `coord_template`; +`detect_wyckoff_position()` returns the nearest matched representative +inside the winning orbit, and explicit-letter snapping calls +`wyckoff_position_info(..., fract_xyz=current_coords)` to choose the +nearest representative for that letter. The ADR explicitly rejects using +`coords_xyz[0]` for snapping and calls out the Pm-3m `6e` non-first +representative case. Tests now include auto-detection and explicit-letter +snapping through a non-first representative. + +**Pointer:** Decision §2 ("Representative selection") and Testing. + +## [P1] Space-group and setting edits do not trigger redetection + +**Verdict:** Agree. + +**Action taken.** The ADR now treats space-group key changes as a +first-class trigger. The update flow records the `(name_hm, coord_code)` +key used for the last Wyckoff derivation. If the key changes, every atom +site re-runs the supported/unsupported policy even when coordinates are +unchanged. Supported new keys re-detect all letters and multiplicities; +unsupported new keys preserve stored letters verbatim as unvalidated +values, set multiplicity to `None`, skip constraints, and warn that the +group is untabulated. The user-set-letter persistence language was +updated to include space-group-key edits as a re-detection trigger. + +**Pointer:** Decision §§3-5, Trade-offs, Alternatives Considered, and +Testing. + +## [P2] Same-letter coordinate snaps are still silent + +**Verdict:** Agree. + +**Action taken.** The ADR now adds an explicit warning for user +coordinate edits whose constraint snap changes stored coordinates even +when the detected letter stays the same: +_"coordinates of were adjusted to satisfy Wyckoff letter L"_. +Testing now covers same-letter coordinate edits whose snap moves stored +coordinates. + +**Pointer:** Decision §5 and Testing. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md new file mode 100644 index 000000000..4f1629c4d --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md @@ -0,0 +1,26 @@ +# Reply 13: Automatic Wyckoff Position Detection + +## [P2] Unsupported-group stored letters are still described as explicit-only + +Verdict: agree. + +Action taken: the unsupported-group policy now consistently uses +"stored" non-empty letters rather than "explicit" letters only. §3 now +states that unsupported groups keep any stored non-empty letter, +including a letter preserved after a supported-to-unsupported +space-group change. §9 now writes any stored non-empty unsupported +letter verbatim and assigns it `None` multiplicity, and the CIF +round-trip test bullet covers explicit and preserved stored letters. + +Affected sections: §3 "The letter is always set, and tracks the +coordinates", §9 "CIF behaviour", and "Testing". + +## [P2] The trigger summary still says only coordinates re-detect + +Verdict: agree. + +Action taken: the closing paragraph of §4 now keeps the minimizer and +same-pass constraint-snap exclusions, but states that later coordinate +edits and later space-group / setting key edits can both re-detect. + +Affected section: §4 "Detection triggers". diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md new file mode 100644 index 000000000..153c35ab6 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md @@ -0,0 +1,15 @@ +# Reply 14: Automatic Wyckoff Position Detection + +## [P2] Two unsupported-letter passages still say explicit-only + +Verdict: agree. + +Action taken: §6 now describes no-record multiplicity in terms of stored +non-empty letters, not explicit-only values. §8 now covers both explicit +Python/CIF input and letters preserved after a later change into an +unsupported space-group key; both become stored but unvalidated letters +with `None` multiplicity and no constraints. + +Affected sections: §6 "Per-atom multiplicity, and a new +`space_group_Wyckoff` category" and §8 "Allowed letters come from the +current space group (closes #51)". diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md new file mode 100644 index 000000000..aac0222c8 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md @@ -0,0 +1,12 @@ +# Reply 15: Automatic Wyckoff Position Detection + +## [P2] Compatibility still says explicit-letter projects are unaffected + +Verdict: agree. + +Action taken: the compatibility outcome now says explicit letters remain +respected and reload verbatim, while constraints remain unchanged except +for the intentional nearest-representative fix where the old +first-representative shortcut was wrong. + +Affected section: "Compatibility Outcomes". diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md new file mode 100644 index 000000000..9186a8e19 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md @@ -0,0 +1,47 @@ +# Reply 2: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-2.md`](wyckoff-letter-detection_review-2.md). +Both findings accepted and addressed in the ADR. The CIF null-token +behaviour was verified against the serializer before editing. + +## [P1] The auto-mode invariant contradicts detected letters + +**Verdict:** Agree. + +**Action taken.** The §3 invariant was stated against the stored value +("empty value ⟺ auto"), which is wrong once detection fills a non-empty +value while the atom is still in auto mode. Rephrased §3 so the +invariant is about the **provided marker**, not the value: +`provided = True` exactly when the user supplied the letter; +`provided = False` is auto mode, in which the stored value may be empty +(unresolved) or a non-empty detected letter that downstream consumers +use — both are valid auto states. The empty `= ''` assignment is +described purely as the public reset command (forces `provided = False`, +drops the value to empty until the next detection). Also softened the +section's lead-in from "one invariant tying it to the value" to "kept +distinct from the stored descriptor value". + +**Pointer:** §3 (lead-in sentence and closing invariant paragraph). + +## [P2] Project CIF needs a row-level rule for mixed auto/explicit loops + +**Verdict:** Agree. + +**Action taken.** Confirmed that atom-site loops are emitted through the +ADP-family loop path (`_adp_family_loop_to_cif`, `serialize.py:301`) and +that the project's null token is `?` (`serialize.py:54`), which reads +back as the descriptor default (`serialize.py:1091`) — i.e. the empty +sentinel for the Wyckoff string descriptor. Replaced §9's per-atom +"write no symbol" rule with a concrete per-loop, columnar rule: + +- the `_atom_site.Wyckoff_symbol` column is emitted for an emitted loop + iff at least one row in it has a provided letter; +- when present, provided rows write the letter and auto rows write `?`; +- when no row has a provided letter, the column is omitted. + +Updated the read bullet to match: a non-empty cell means explicit, while +`?` / `.` / absent loads as empty and stays auto. This keeps the +"non-empty loaded value ⟺ explicit" rule implementable for mixed loops. + +**Pointer:** §9 (write and read bullets). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md new file mode 100644 index 000000000..fea30aa72 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md @@ -0,0 +1,57 @@ +# Reply 4: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-4.md`](wyckoff-letter-detection_review-4.md). +Both findings accepted. The serializer's empty-string behaviour was +verified before editing. + +## [P1] Live descriptor edits can bypass re-detection + +**Verdict:** Agree. + +**Action taken.** This is the reason the §4 mechanism was previously +left open; the finding settles it. A coordinate is a live `Parameter`, +so `atom.fract_x.value = 0.1` is a normal public edit that never reaches +an `AtomSite.fract_x` property setter — a setter hook would silently +miss it and leave a stale letter. Rewrote §4 to put both triggers in the +**update flow** instead: every public coordinate edit (property _or_ +`.value`) marks the owner dirty and runs `_update()`, so that is the one +place that sees them all. Re-detection now compares the current +coordinates against a per-atom baseline (the coordinates the letter was +last detected from) and fires when they differ. The baseline is +refreshed whenever the letter is set or detected — on load, on a user +letter-set, and after auto-detection including the constraint snap — so +a freshly loaded or user-set letter is not re-detected spuriously. The +minimizer (`called_by_minimizer=True`) and the constraint snap are +explicitly excluded. Updated the §3 coordinate bullet to name both +public paths and point to §4. + +**Pointer:** §4 (rewritten), §3 (coordinate bullet). + +## [P2] Unsupported groups contradict "always concrete" CIF writes + +**Verdict:** Agree. + +**Action taken.** Qualified the over-broad "concrete at all times" +claim. §3 now reads: concrete for every _supported_ space group; a group +absent from `SPACE_GROUPS` (§8) is the one exception — detection is a +no-op and the letter stays empty, with §9 defining how that serialises. +Verified that the serializer already renders an empty string as the CIF +null `?` +([`serialize.py:62`](../../../../src/easydiffraction/io/cif/serialize.py)) +and reads `?` back as the empty default +([`serialize.py:1091`](../../../../src/easydiffraction/io/cif/serialize.py)). +§9's write rule is now explicit: a resolved letter is written as-is; an +empty letter (unsupported group, or a transient not-yet-updated state) +is written as `?`, reads back empty, and round-trips as empty (detection +stays a no-op on reload). The column is always present and well-defined +for the columnar loops, and saving never fails on an unsupported group. +The §9 read bullet now notes the "stays empty when unsupported" case. + +**Pointer:** §3 (opening), §9 (intro, write and read bullets). + +## Note + +The §4-mechanism item in Open Questions is now resolved by this round +(it is decided in §4), so it was removed; the only remaining open +question is tuning the `1e-3` tolerance value. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md new file mode 100644 index 000000000..a152fcf1d --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md @@ -0,0 +1,36 @@ +# Reply 5: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-5.md`](wyckoff-letter-detection_review-5.md). +The single finding is accepted and addressed. + +## [P2] Empty-letter sites need derived descriptor semantics + +**Verdict:** Agree. + +**Action taken.** Review 4 defined the empty/unsupported escape hatch +for the letter only; this extends it to the values that depend on it. +Three edits: + +- **§6** now states the no-record case explicitly: when there is no + `WyckoffPosition` record (unsupported group, or a transient empty + letter before the first update), `multiplicity` is `None` and + `site_symmetry` is the empty string. They track the letter's empty + state in lockstep, and both serialise to CIF `?`. +- **§7** now specifies that the calculator skips a `None` multiplicity — + it leaves the backend's own inferred value in place rather than + writing `None` into the array. This is behaviour-preserving: today's + `_update_atom_multiplicity()` already returns early when the group is + absent from `SPACE_GROUPS`, so the no-override-on-unsupported + behaviour is unchanged. +- **§9** write rule now notes that + `_atom_site.site_symmetry_multiplicity` is written as `?` when the + multiplicity is `None` — the same unsupported-group case as the + letter. (Both are derived and ignored on read, per the existing §9 + rule, so they are recomputed rather than trusted.) + +The unsupported-group escape hatch is now defined for the letter and for +both derived model values that build on it. + +**Pointer:** §6 (new no-record paragraph), §7 (None-skip clause), §9 +(write bullet). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md new file mode 100644 index 000000000..a5b4f3a61 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md @@ -0,0 +1,36 @@ +# Reply 7: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-7.md`](wyckoff-letter-detection_review-7.md). +The single finding is accepted and addressed. + +## [P2] Explicit letters for unsupported groups are undefined + +**Verdict:** Agree. + +**Decision.** Of the two options the review named, the ADR now chooses +**accept the letter verbatim** rather than reject. Rejecting would fail +to load an otherwise-valid CIF that carries a `Wyckoff_symbol` for a +setting we simply do not tabulate, and would block a legitimate Python +assignment — both are boundary inputs the public API and CIF loading +routinely produce, which the project's edge-case rule says to handle +gracefully, not refuse. + +**Action taken.** §8 now states that when the space group is absent from +the table its letters cannot be enumerated, so membership validation is +not applied: the validator accepts whatever the user or a CIF supplies. +Auto-detection stays a no-op, but an explicit letter (Python or CIF) is +stored verbatim, carries no `multiplicity` / `site_symmetry` (no record, +§6) and drives no symmetry constraints, and a `log.warning` records that +the group is untabulated and the letter could not be validated. The +rejected "validation error" alternative is documented inline. §3's +letter-edit bullet gained a cross-reference to §8 for this case. + +The four surfaces the finding worried about now agree for unsupported +groups: Python assignment and CIF loading both store the letter verbatim +(§3, §8, §9), allowed-value discovery does not restrict it (§8), and +derived-descriptor handling plus the calculator skip already cover the +no-record case (§6, §7, §9). + +**Pointer:** §8 (unsupported-group rule), §3 (letter-edit +cross-reference). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md new file mode 100644 index 000000000..e83851cab --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md @@ -0,0 +1,40 @@ +# Reply 8: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-8.md`](wyckoff-letter-detection_review-8.md). +The single finding is accepted and addressed. + +## [P2] Unsupported groups are still described as always empty + +**Verdict:** Agree. + +**Action taken.** Reply 7 added the "explicit letter on an unsupported +group is stored verbatim" path (§8), which made the older "unsupported → +empty" wording in §3 and §9 only half true. Split that case into its two +sub-cases in both sections: + +- **§3 opening** now says the unsupported-group exception splits in two: + auto-detection is a no-op, so _without_ an explicit letter the value + stays empty, while an _explicit_ Python/CIF letter is stored verbatim + (carrying no multiplicity, site symmetry, or constraints — §6). +- **§9 intro** now states the unsupported group splits — no explicit + letter stays empty, an explicit letter is written verbatim. +- **§9 write bullet** now says **any** non-empty letter is written + verbatim (whether detected for a supported group or supplied + explicitly for an unsupported one; only the latter has a `None` + multiplicity), and a letter serialises as CIF `?` only when it is + _neither_ detected _nor_ explicitly supplied — an unsupported group + with no user letter, or a transient pre-update state. + +The §9 read bullet already handled both (a present symbol loads as the +letter; an absent/`?` cell stays empty, and fill-if-empty is a no-op for +an unsupported group), so it needed no change. + +**Note (context, not a scope change):** the companion +[`space-group-database.md`](space-group-database.md) ADR — whose review +cycle has now closed — makes the bundled table complete for all 230 +groups, so in practice "unsupported group" shrinks to genuinely-exotic +settings (and transient pre-update states). The split wording above is +what keeps those residual cases well-defined. + +**Pointer:** §3 (opening), §9 (intro and write bullet). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md new file mode 100644 index 000000000..9bfdb8c2d --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md @@ -0,0 +1,29 @@ +# Reply 9: Automatic Wyckoff Position Detection + +Reply to +[`wyckoff-letter-detection_review-9.md`](wyckoff-letter-detection_review-9.md). +The single finding is accepted and addressed. + +## [P2] No-record descriptors still imply an empty letter + +**Verdict:** Agree. + +**Action taken.** §6 said the empty `multiplicity` / `site_symmetry` +descriptors "follow the letter's empty state in lockstep," which is +wrong for the §8 path where an unsupported group carries a non-empty +explicit letter but still has no `WyckoffPosition` record. Rephrased +both spots so the derived state tracks **record availability**, not +letter emptiness: + +- **§6** now states the empty descriptors follow record availability, + not the letter: a no-record site has empty `multiplicity` / + `site_symmetry` whether its letter is empty or a non-empty unvalidated + explicit value (§8). The no-record causes now read "an unsupported + space group (with or without an explicit letter), or a transient empty + letter." +- **Testing** (CIF round-trip bullet) now says an unsupported-group row + keeps empty `multiplicity` / `site_symmetry` whether its letter is + empty or an explicit value that round-trips verbatim, instead of + "stays empty." + +**Pointer:** §6 (no-record paragraph); Testing (CIF round-trip bullet). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md new file mode 100644 index 000000000..476c2a048 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md @@ -0,0 +1,78 @@ +# Review 1: Automatic Wyckoff Position Detection + +## Findings + +### [P1] Persisting resolved letters loses auto-mode semantics + +The ADR defines auto mode as "provided marker false" and says auto-mode +letters re-detect after user edits, but the CIF write/read contract +materialises every resolved `_atom_site.Wyckoff_symbol` and then treats +any present symbol as explicit on reload (`wyckoff-letter-detection.md`, +sections 3, 4, and 9). That means a project saved while an atom is in +auto mode reloads with the same letter value but different behaviour: +future coordinate edits no longer re-detect the letter. This conflicts +with the persisted-state restore requirement and with the compatibility +claim that saved projects reload to the same model state. The ADR needs +to decide whether project persistence stores the auto/provided marker +separately, or whether save intentionally collapses auto-derived letters +into explicit letters and documents that behavioural change. + +### [P1] Empty string cannot both mean auto and explicit assignment + +Section 3 makes the empty `wyckoff_letter` value the auto sentinel, but +also says any API assignment marks the letter as provided. With that +contract, a user who previously set an explicit letter has no documented +way to clear it and return the site to auto mode: assigning +`atom.wyckoff_letter = ''` would set the provided marker true while +leaving the value empty, so detection would remain disabled and the +current "skip constraints" path would persist. The ADR should define the +public reset behaviour explicitly, for example by making assignment of +the empty sentinel clear the provided marker, or by adding a named +method/property for returning to auto mode. + +### [P2] No-code space groups need an explicit key normalisation rule + +Sections 2 and 8 describe direct `SPACE_GROUPS[(IT_number, coord_code)]` +lookups and use `P 1` as the example of a missing coordinate-system +code. In the current model, however, `SpaceGroup` represents +no-coordinate-code groups as the empty string because +`_it_coordinate_system_code_allowed_values` returns `codes or ['']` +(`src/easydiffraction/datablocks/structure/categories/space_group/default.py`). +The bundled table uses `None` keys for at least the no-code triclinic +groups, so an implementation that follows the ADR literally will look up +`(1, '')`, miss the tabulated `(1, None)` entry, and expose only the +empty sentinel instead of the real `a` Wyckoff position. The ADR should +state whether detection and allowed-letter discovery normalise `''` to +`None`, or intentionally treat no-code groups as unsupported despite the +packaged table containing them. + +### [P2] CIF presence tracking is underspecified for the marker + +Section 9 depends on distinguishing a present +`_atom_site.Wyckoff_symbol` from an absent one so the provided marker +can be set correctly. The generic CIF loader currently sets descriptor +values directly from loop cells and sets missing tags to descriptor +defaults in `category_collection_from_cif` +(`src/easydiffraction/io/cif/serialize.py`); it does not surface tag +presence to `AtomSite` or call a marker-aware setter. Without a specific +hook, a plan can easily mark defaulted missing values as user-provided, +or fail to mark present values as explicit. The ADR should name the +intended loading hook or item-level override that owns this boundary +case. + +### [P3] The auto-fill path names an API that does not exist + +Section 3 says auto-fill writes through `set_value_directly`, but the +current descriptor API exposes the public `value` setter plus private +paths such as `_set_value_from_minimizer`; there is no +`set_value_directly` symbol in `src/easydiffraction/core/variable.py`. +Because this write is central to avoiding a false "provided" marker, the +ADR should specify the actual private mutator to add or use, preferably +with a name tied to this derived-state update rather than the minimizer +path. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md new file mode 100644 index 000000000..5f1b2f1fd --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md @@ -0,0 +1,11 @@ +# Review 10: Automatic Wyckoff Position Detection + +**No findings. Ready to commit.** + +The review-9 finding was addressed: no-record derived descriptor state +now follows `WyckoffPosition` record availability rather than letter +emptiness, including the unsupported-group explicit-letter case. + +Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source +review only; no tests, `pixi run fix`, `pixi run check`, or other +verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md new file mode 100644 index 000000000..a800ee5f0 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md @@ -0,0 +1,48 @@ +# Review 11: Automatic Wyckoff Position Detection + +## Findings + +### [P1] `space_group_Wyckoff` still has unresolved structural decisions + +The ADR now introduces `space_group_Wyckoff` as a new read-only, +auto-populated `CategoryOwner` sibling category, but then leaves its +implementation-critical choices open: whether the loop is persisted or +report-only, whether the row key is `_space_group_Wyckoff.id` or +`letter`, how `add()` / `create()` are blocked, and what update priority +rebuilt-from-space-group categories need (`wyckoff-letter-detection.md` +386-412). These are not just implementation details. Current +`CategoryOwner._serializable_categories()` serialises every owned +category by default, current `CategoryCollection` exposes mutating +`__setitem__` / `remove` paths in addition to any subclass `add()` / +`create()`, and `loop-category-key-identity.md` requires every concrete +loop collection to have a documented key field that normally serialises. + +Please settle these decisions in the ADR before it is accepted: choose +whether `space_group_Wyckoff` is persisted, report-only, or explicitly +excluded from project CIF; choose and justify the collection key; and +state the read-only collection mechanism at the category/collection API +level, not only item `add()` / `create()`. Otherwise two implementers can +both follow the ADR and produce incompatible public/CIF behaviour. + +### [P2] Stale atom-site `site_symmetry` wording remains + +The updated ADR correctly says the site-symmetry symbol is **not** an +atom-site quantity and belongs in `space_group_Wyckoff` +(`wyckoff-letter-detection.md` 266-289). But earlier/later text still +reads like `site_symmetry` is an atom-site descriptor: the dataclass +motivation says it fills "the letter, multiplicity, and site-symmetry +descriptors" (`wyckoff-letter-detection.md` 97-101), and the Related ADR +entry for `guarded-public-properties.md` says "read-only `multiplicity` +and `site_symmetry` (getter only)" (`wyckoff-letter-detection.md` +561-562). That stale wording risks reintroducing the older +`AtomSite.site_symmetry` design that review 5 on the plan just rejected. + +Please reword those passages so `multiplicity` is the atom-site +descriptor, while `site_symmetry` is the read-only descriptor on +`space_group_Wyckoff` rows. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md new file mode 100644 index 000000000..f7dd280d7 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md @@ -0,0 +1,70 @@ +# Review 12: Automatic Wyckoff Position Detection + +## Findings + +### [P1] Detected letters can still snap through the wrong orbit representative + +The ADR correctly says the database stores the **full orbit** for each +Wyckoff position and that detection tests membership in every orbit +template (`wyckoff-letter-detection.md` 49-58, 87-92). But the snapping +decision still delegates to the "existing constraint step" after only the +letter is stored (`wyckoff-letter-detection.md` 239-240), while the +current constraint helper reads only `coords_xyz[0]` for that letter +(`crystallography.py` 177-218). That leaves a silent corruption path: +for Pm-3m `6e`, a coordinate near `(0,x,0)` can be correctly detected as +letter `e`, then `_get_wyckoff_exprs()` applies the first template +`(x,0,0)`, treats `y` and `z` as fixed, and snaps the atom toward +`(0,0,0)` instead of the matched orbit representative. + +Please make the ADR settle how coordinate snapping and constrained-axis +flags choose the orbit representative. The implementation needs either +the matched/nearest template returned with the detection result or a +separate helper that selects the nearest template for an already-known +letter before snapping. The tests should include a non-first +representative, plus the explicit-letter path, so an implementer cannot +follow the ADR and leave the current `coords_xyz[0]` behavior in place. + +### [P1] Space-group and setting edits do not trigger redetection + +The ADR makes the Wyckoff letter, multiplicity, and +`space_group_Wyckoff` table depend on the current space-group key, but +the trigger/baseline design only tracks coordinate changes +(`wyckoff-letter-detection.md` 151-227). A public edit to +`structure.space_group.name_h_m` or +`structure.space_group.it_coordinate_system_code` marks the structure +dirty, yet the atom coordinates can be unchanged, so fill-if-empty is a +no-op and the coordinate baseline does not force re-detection. The result +can be a stale letter from the old group: it may be invalid in the new +group, or worse, still be a valid letter with different multiplicity, +site symmetry, or constrained coordinates. + +Please define the space-group-change path explicitly. For example, record +the `(name_hm, coord_code)` key alongside the coordinates used for the +last detection, and re-detect/re-derive all atom-site Wyckoff values when +that key changes. The ADR also needs to settle the warning and +unsupported-group behavior for transitions into an untabulated group, +because without an auto/provided marker the old stored letter may be a +previously detected value rather than an explicit user value. + +### [P2] Same-letter coordinate snaps are still silent + +The ADR says neither the letter nor the coordinates change silently after +a user edit and that lenient matching movement is surfaced by a warning +(`wyckoff-letter-detection.md` 241-248, 437-439). The listed warnings do +not cover a common case: the user edits a coordinate, detection keeps the +same letter because the point is still within tolerance, and the +constraint pass snaps the coordinate back to the exact special value. In +that path the coordinate changes but the letter does not, so the +"letter changed" warning never fires. + +Please either add a warning for any user coordinate edit whose constraint +snap changes stored coordinates, or narrow the ADR text so it no longer +claims this movement is surfaced. Given the project audience and the +critical-software guidance in `AGENTS.md`, warning on user-edited +coordinate movement seems like the safer policy. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md new file mode 100644 index 000000000..f9d4ecc1d --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md @@ -0,0 +1,46 @@ +# Review 13: Automatic Wyckoff Position Detection + +## Findings + +### [P2] Unsupported-group stored letters are still described as explicit-only + +Reply 12 added the right policy for a space-group change into an +unsupported key: preserve any existing stored letter verbatim, even when +that letter was previously auto-detected, because there is no +auto/provided marker (`wyckoff-letter-detection.md` 193-204, 247-253). +Several later passages still describe the unsupported non-empty-letter +case as only an explicit Python/CIF input. Section 3's opening split says +"without an explicit letter" stays empty while an "explicit Python/CIF +letter" is stored (`wyckoff-letter-detection.md` 170-176). The CIF write +rules say any non-empty unsupported letter is written when it was +"supplied explicitly" and that "only the latter" carries `None` +multiplicity (`wyckoff-letter-detection.md` 412-419), which is now false +for a preserved auto-detected letter after a supported-to-unsupported +space-group edit. The CIF round-trip test bullet has the same explicit- +only framing (`wyckoff-letter-detection.md` 577-580). + +Please reword those passages around **stored non-empty letters** rather +than **explicit letters**: unsupported groups with no stored letter stay +empty; unsupported groups with any stored letter, whether explicit or +preserved from a previous supported key, write it verbatim and carry +`None` multiplicity. That keeps §3, §4, §8, §9, and Testing aligned. + +### [P2] The trigger summary still says only coordinates re-detect + +The new space-group-key trigger is clear earlier in §3 and §4, but the +closing paragraph of §4 still says a user-set letter is "never silently +overwritten by an internal recompute" and that "only a real change in the +stored coordinates re-detects" (`wyckoff-letter-detection.md` 255-263). +That now contradicts the accepted Review-12 fix: a real change in the +stored `(name_hm, coord_code)` key also re-detects and may overwrite a +user-set letter for a supported new key. + +Please update that paragraph so the excluded minimizer/same-pass-snap +paths remain clear while the final trigger summary includes both later +coordinate edits and later space-group-key edits. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md new file mode 100644 index 000000000..5d700baaf --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md @@ -0,0 +1,28 @@ +# Review 14: Automatic Wyckoff Position Detection + +## Findings + +### [P2] Two unsupported-letter passages still say explicit-only + +Review 13's main issue is mostly fixed, but two nearby passages still use +the old explicit-only framing. The no-record paragraph in §6 says a +non-empty no-record letter is a "non-empty unvalidated explicit value" +(`wyckoff-letter-detection.md` 301-313). After the Review-12/13 policy, +that value may also be a previously detected letter preserved when the +space-group key changed into an unsupported one. Section 8 similarly says +the unsupported path stores "an explicit letter" and "such a letter" +carries no multiplicity (`wyckoff-letter-detection.md` 383-393), while +the same no-record behavior also applies to preserved stored letters. + +Please update those two passages to use the same "stored non-empty +letter" wording now used in §3 and §9. The implementation-facing rule +should be one rule everywhere: when no `WyckoffPosition` record is +available, multiplicity is `None` and constraints are skipped whether the +stored letter came from Python/CIF input or was preserved from a previous +supported key. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md new file mode 100644 index 000000000..4974a8d28 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md @@ -0,0 +1,29 @@ +# Review 15: Automatic Wyckoff Position Detection + +## Findings + +### [P2] Compatibility still says explicit-letter projects are unaffected + +The ADR now intentionally changes the explicit-letter snapping path for +non-first orbit representatives: explicit-letter snapping must choose the +nearest representative rather than `coords_xyz[0]` +(`wyckoff-letter-detection.md` 136-144, 557-561). That is the right +decision, but the Compatibility Outcomes still say projects that already +specify every Wyckoff letter are "unaffected" and "produce identical +constraints" (`wyckoff-letter-detection.md` 501-504). That is no longer +strictly true for an existing project whose explicit letter is paired +with coordinates on a non-first representative, such as Pm-3m `6e` +`(0,x,0)`: the new behavior deliberately fixes the current +`coords_xyz[0]` snap. + +Please soften that compatibility claim. A more accurate outcome is that +explicit letters remain respected and reload verbatim, while constraints +are unchanged except where the current first-representative shortcut was +wrong for coordinates on a different representative. That makes the +intended compatibility surface clear without hiding the bug fix. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md new file mode 100644 index 000000000..60b3b3f97 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md @@ -0,0 +1,12 @@ +# Review 16: Automatic Wyckoff Position Detection + +**No findings. Ready to commit.** + +The review-15 compatibility finding is addressed: explicit letters remain +respected and reload verbatim, while the only called-out constraint change +is the intentional nearest-representative fix for coordinates that were +previously snapped through the first table representative. + +Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source +review only; no tests, `pixi run fix`, `pixi run check`, or other +verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md new file mode 100644 index 000000000..421e0bc55 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md @@ -0,0 +1,36 @@ +# Review 2: Automatic Wyckoff Position Detection + +## Findings + +### [P1] The auto-mode invariant contradicts detected letters + +The updated §3 now says `empty value ⟺ auto (provided = False)`, but the +same section also says auto mode re-derives the letter and writes the +detected non-empty value through `_set_wyckoff_letter_detected()`. Those +two rules cannot both be true: after a successful auto-detection, an +auto-mode atom must have `provided = False` and a non-empty +`wyckoff_letter.value`, because calculators, constraints, displays, and +exports consume the resolved value. The invariant should be about the +provided marker, not the stored descriptor value. Please rephrase §3 so +the empty assignment is the public reset command, while auto mode itself +can hold either an empty unresolved value or a non-empty detected value. + +### [P2] Project CIF needs a row-level rule for mixed auto/explicit loops + +The revised §9 says project CIF writes `_atom_site.Wyckoff_symbol` only +for provided letters and writes "no symbol" for auto-mode atoms. CIF +loops are columnar, so if one atom in an atom-site loop has an explicit +symbol, every row in that loop still needs a cell for that tag. The +current project serializer also routes atom-site loops through the +ADP-family loop path in `serialize.py`, which emits the same parameter +columns for every row. The ADR should define the concrete row-level +encoding: for example, auto rows write the CIF null token (`?` or `.`) +when the column is present, and the column is omitted only when no row +in that emitted loop has a provided letter. That keeps the read-side +"non-empty loaded value means explicit" rule implementable. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md new file mode 100644 index 000000000..c0c4ef150 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md @@ -0,0 +1,11 @@ +# Review 3: Automatic Wyckoff Position Detection + +**No findings. Ready to commit.** + +The review-2 findings were addressed: the auto/provided marker is now +distinct from the stored detected value, and project CIF writes now have +a concrete columnar rule for mixed auto/explicit atom-site loops. + +Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source +review only; no tests, `pixi run fix`, `pixi run check`, or other +verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md new file mode 100644 index 000000000..0e7b78cab --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md @@ -0,0 +1,41 @@ +# Review 4: Automatic Wyckoff Position Detection + +## Findings + +### [P1] Live descriptor edits can bypass re-detection + +Sections 3 and 4 make "public coordinate setter" edits the trigger for +re-detecting an existing Wyckoff letter. In the current public API, +however, `atom.fract_x` returns the live `Parameter`, and assigning +`atom.fract_x.value = ...` is also a normal public edit path. That path +goes through `GenericDescriptorBase.value`, marks the owner dirty, and +does not call the `AtomSite.fract_x` property setter. If implementation +follows the ADR literally, `atom.fract_x = 0.1` would re-detect but +`atom.fract_x.value = 0.1` would leave a stale non-empty +`wyckoff_letter`, because the fill-if-empty update path is a no-op once +the letter is populated. The ADR should state that **all public +coordinate value edits**, including live descriptor `.value` assignment, +are user coordinate edits for this purpose, or choose an update-flow +change-tracking mechanism that covers both property assignment and +descriptor-value assignment while still excluding minimizer and symmetry +constraint writes. + +### [P2] Unsupported groups contradict "always concrete" CIF writes + +The revised decision says the `wyckoff_letter` descriptor holds a +concrete value at all times and that project CIF always emits the +resolved `_atom_site.Wyckoff_symbol` for every atom. Section 8 still +preserves the unsupported-space-group path: when the space group is +absent from `SPACE_GROUPS`, only the empty placeholder is allowed, +detection is a no-op, and the site keeps no letter. Those two rules +conflict. An implementation needs a defined behaviour for genuinely +unsupported groups and for any pre-update transient empty value: should +project CIF write `?`, omit the column, or fail with a clear error? The +ADR should qualify "always concrete" and the §9 write rule so this +boundary case is explicit rather than left to the serializer default. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md new file mode 100644 index 000000000..82ce89e4e --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md @@ -0,0 +1,27 @@ +# Review 5: Automatic Wyckoff Position Detection + +## Findings + +### [P2] Empty-letter sites need derived descriptor semantics + +Review 4 resolved how an unsupported space group serialises the +`wyckoff_letter`: detection is a no-op, the letter stays empty, and CIF +writes `?`. The ADR still does not define what happens to the derived +`multiplicity` and `site_symmetry` descriptors in that same path. +Section 6 says they are populated from a `WyckoffPosition` record, but +unsupported groups and transient empty letters have no such record; §7 +then replaces cryspy's private lookup with +`atom_site.multiplicity.value`, and §9 says project CIF emits +`_atom_site.site_symmetry_multiplicity` derived from the model +multiplicity. An implementation needs a clear contract for the no-record +case: for example, multiplicity/site symmetry become empty/`None`, CIF +writes `?` for multiplicity, and calculators skip over the missing value +instead of writing it into backend arrays. Without that rule, the +unsupported-group escape hatch is only defined for the letter, not for +the model values that now depend on it. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md new file mode 100644 index 000000000..4541b3689 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md @@ -0,0 +1,11 @@ +# Review 6: Automatic Wyckoff Position Detection + +**No findings. Ready to commit.** + +The review-5 finding was addressed: empty-letter sites now have explicit +derived descriptor semantics, CIF output, and calculator handling for +the no-`WyckoffPosition` case. + +Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source +review only; no tests, `pixi run fix`, `pixi run check`, or other +verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md new file mode 100644 index 000000000..fcd1599c9 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md @@ -0,0 +1,26 @@ +# Review 7: Automatic Wyckoff Position Detection + +## Findings + +### [P2] Explicit letters for unsupported groups are undefined + +Sections 3 and 9 say a user-set letter is applied as-is and a present +`_atom_site.Wyckoff_symbol` is loaded as the letter. Section 8 says that +when the space group is absent from `SPACE_GROUPS`, only the empty +placeholder is allowed, detection is a no-op, and the site keeps no +letter. Those rules conflict for boundary input the public API can +produce: a user can set `atom.wyckoff_letter = 'a'` after choosing an +unsupported group, or load a CIF that contains a Wyckoff symbol for a +group not present in the bundled table. The ADR should explicitly choose +the behaviour for this case — for example, reject the explicit letter +with a clear validation error, or allow the stored letter while leaving +`multiplicity` / `site_symmetry` empty and skipping calculator +multiplicity overrides. Without that decision, implementation can +accidentally make Python assignment, CIF loading, allowed-value +discovery, and derived descriptor handling disagree. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md new file mode 100644 index 000000000..5e7f6ef05 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md @@ -0,0 +1,26 @@ +# Review 8: Automatic Wyckoff Position Detection + +## Findings + +### [P2] Unsupported groups are still described as always empty + +Reply 7 chose the right policy for unsupported groups: auto-detection is +a no-op, but an explicit Python/CIF letter is stored verbatim and +carries no derived record. The ADR still has broad wording that +contradicts that policy. Section 3 says that when the group is absent +from `SPACE_GROUPS`, "the letter stays empty"; §9 says "the one empty +case (an unsupported group)" and describes "an empty letter — an +unsupported space group". Those statements are only true for unsupported +groups with no explicit letter. They are false for the new +explicit-letter path in §8, where an unsupported group may have a +non-empty stored letter. Please qualify the §3 and §9 wording so +unsupported groups split into two cases: no explicit letter stays empty +/ serialises as `?`, while an explicit letter is stored and written +verbatim but has no multiplicity, site symmetry, or symmetry +constraints. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md new file mode 100644 index 000000000..e0f0a5183 --- /dev/null +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md @@ -0,0 +1,24 @@ +# Review 9: Automatic Wyckoff Position Detection + +## Findings + +### [P2] No-record descriptors still imply an empty letter + +Reply 8 correctly splits unsupported groups into empty/no-explicit and +non-empty/explicit-letter cases in §3 and §9. Section 6 still says the +empty `multiplicity` / `site_symmetry` descriptors "follow the letter's +empty state in lockstep." That is no longer true for an unsupported +group with an explicit Python/CIF letter: the stored letter is +non-empty, but there is still no `WyckoffPosition` record, so +multiplicity remains `None` and site symmetry remains empty. The Testing +section has the same minor drift in the CIF round-trip bullet, which +only says an unsupported-group row stays empty. Please rephrase these +spots so the derived descriptor state follows **record availability**, +not letter emptiness: no record means empty derived descriptors whether +the letter is empty or an unvalidated explicit value. + +## Checks skipped + +Per `AGENTS.md` review-shortcut rules, this was a static ADR/source +review only. I did not run tests, `pixi run fix`, `pixi run check`, or +other verification commands. From f94376f4ca6f6395e36fa98e8fcc3cb09ef72922 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 18:22:38 +0200 Subject: [PATCH 18/50] Record and bound float32 display-precision decision --- .../accepted/plotting-docs-performance.md | 24 +++++++++++++++++++ docs/dev/plans/plotting-docs-performance.md | 13 ++++++++++ 2 files changed, 37 insertions(+) diff --git a/docs/dev/adrs/accepted/plotting-docs-performance.md b/docs/dev/adrs/accepted/plotting-docs-performance.md index 7d7979c06..eb6ba45f1 100644 --- a/docs/dev/adrs/accepted/plotting-docs-performance.md +++ b/docs/dev/adrs/accepted/plotting-docs-performance.md @@ -261,6 +261,30 @@ delivered together** in one change. Concretely: scene consumes it (the tiny JSON is inert), keeping the override simple. +7. **SHARED figures downcast bulk float64 arrays to float32 (a bounded, + display-only precision decision).** In `SHARED` mode only, the + serializer transcodes the figure spec's float64 typed arrays to + float32 (~7 significant figures) before embedding, roughly halving + the payload (measured: ed-6 5.5 MB → 3.4 MB; 2.2 → 1.4 MB gzipped). + This is an explicit **display** decision, not a change to stored + data, and it is bounded: + - It operates on a **copy** of the serialized figure + (`fig.to_plotly_json()`), never the source parameters, CIF, or any + computation. + - It applies **only** to docs `SHARED` figures. Live notebooks + (`INLINE`), reports (`STANDALONE`), and every CIF/state file keep + full float64. + - It is **visually lossless**: screens resolve ~3 significant + figures, and the tutorials' hover templates format to a few + decimals (e.g. `:,.2f`), so float32 changes no displayed or + hover-visible value at the precision actually shown. + + Storage-side numeric precision is a separate, deliberate decision + tracked in [`cif-numeric-precision.md`](cif-numeric-precision.md). + Phase 2 adds coverage for the `f8`→`f4` transcode (shape preserved, + round-trips through Plotly) and a representative hover/range-sensitive + figure whose formatted values are unchanged. + This pays the network bill once per page from the same origin, removes the per-figure JS duplication, and turns first paint from "render every figure" into "render nothing until seen" — addressing both bottlenecks diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 2365ab6bf..f7d5d695e 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -66,6 +66,13 @@ commit with message `Promote plotting-docs-performance ADR to accepted`. `{% block extrahead %}` in `docs/overrides/main.html`, paths resolved against `{{ base_url }}`; `SHARED` scenes drop their per-scene importmap. +7. **SHARED figures downcast bulk float64 arrays to float32** + (ADR Decision 7) — a bounded, display-only precision reduction + (~2× payload). Operates on a copy of the serialized figure; source + data/CIF/reports keep full float64; visually lossless at shown + precision. Storage-side precision is the separate + [`cif-numeric-precision`](../adrs/suggestions/cif-numeric-precision.md) + ADR. ## No new dependencies @@ -252,6 +259,12 @@ with the zsh-safe pattern and preserve the exit code. - A `tools/` test for `bump_vendored_js.py --check` drift detection (no network — monkeypatch/`pooch` fixture), mirroring `tools/test_structure_check.py`. +- `_typed_arrays_to_float32()` (SHARED float32 downcast, ADR Decision 7): + every `f8` typed-array spec becomes `f4` with `shape` preserved and + round-trips through Plotly; integer specs and inline scalars are + untouched. Plus a representative powder/correlation figure whose + **hover-template-formatted** values are identical under f64 vs f32 + (proving the loss is display-only). **Trace-type audit** — confirm no WebGL/3D/map trace types are used anywhere; if any are found, switch the vendored bundle from From a1eca568e8f871b21d29bd2e08bb285d7f491e80 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 18:28:23 +0200 Subject: [PATCH 19/50] Drop broken cif-numeric-precision ADR links --- docs/dev/adrs/accepted/plotting-docs-performance.md | 5 +++-- docs/dev/plans/plotting-docs-performance.md | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/dev/adrs/accepted/plotting-docs-performance.md b/docs/dev/adrs/accepted/plotting-docs-performance.md index eb6ba45f1..84c910d42 100644 --- a/docs/dev/adrs/accepted/plotting-docs-performance.md +++ b/docs/dev/adrs/accepted/plotting-docs-performance.md @@ -279,8 +279,9 @@ delivered together** in one change. Concretely: decimals (e.g. `:,.2f`), so float32 changes no displayed or hover-visible value at the precision actually shown. - Storage-side numeric precision is a separate, deliberate decision - tracked in [`cif-numeric-precision.md`](cif-numeric-precision.md). + Storage-side numeric precision is a separate, deliberate decision, + proposed in a `cif-numeric-precision` ADR suggestion (out of scope + for this change, not committed on this branch). Phase 2 adds coverage for the `f8`→`f4` transcode (shape preserved, round-trips through Plotly) and a representative hover/range-sensitive figure whose formatted values are unchanged. diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index f7d5d695e..36f19c5f5 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -70,9 +70,8 @@ commit with message `Promote plotting-docs-performance ADR to accepted`. (ADR Decision 7) — a bounded, display-only precision reduction (~2× payload). Operates on a copy of the serialized figure; source data/CIF/reports keep full float64; visually lossless at shown - precision. Storage-side precision is the separate - [`cif-numeric-precision`](../adrs/suggestions/cif-numeric-precision.md) - ADR. + precision. Storage-side precision is a separate `cif-numeric-precision` + ADR suggestion (out of scope here, not committed on this branch). ## No new dependencies From 1765eb7a90e9889c96e311930d4ac5d3d0e814f2 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 18:40:49 +0200 Subject: [PATCH 20/50] Apply pixi run fix lint and format fixes --- .../accepted/plotting-docs-performance.md | 26 +++++++++--------- docs/dev/plans/plotting-docs-performance.md | 17 ++++++------ pixi.toml | 8 ++++-- .../display/plotters/plotly.py | 27 ++++++++++--------- .../display/structure/renderers/threejs.py | 4 +-- src/easydiffraction/utils/environment.py | 9 +++---- 6 files changed, 48 insertions(+), 43 deletions(-) diff --git a/docs/dev/adrs/accepted/plotting-docs-performance.md b/docs/dev/adrs/accepted/plotting-docs-performance.md index 84c910d42..3d68101a4 100644 --- a/docs/dev/adrs/accepted/plotting-docs-performance.md +++ b/docs/dev/adrs/accepted/plotting-docs-performance.md @@ -29,8 +29,8 @@ appear progressively. 1. Tutorial sources are `docs/docs/tutorials/ed-*.py`; notebooks are generated artifacts (per - [`notebook-generation.md`](notebook-generation.md)) and - are committed with **outputs stripped** (`notebook-strip`). + [`notebook-generation.md`](notebook-generation.md)) and are committed + with **outputs stripped** (`notebook-strip`). 2. The docs CI ([`.github/workflows/docs.yml`](../../../../.github/workflows/docs.yml)) runs `notebook-exec-ci` to **execute** every notebook, baking the @@ -76,10 +76,10 @@ appear progressively. The same serialization paths feed three contexts with **conflicting** runtime needs, which is the crux of any robust fix: -| Target | Who | Runtime requirement | -| --------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Live notebook** | `_show_figure` in Jupyter | Runtime must be reachable from the running kernel/browser (today: Plotly via CDN; Three.js inlined). | -| **MkDocs site** | executed-notebook HTML embedded by `mkdocs-jupyter` | Wants the runtime loaded **once per page** and figures rendered **lazily**. | +| Target | Who | Runtime requirement | +| --------------------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Live notebook** | `_show_figure` in Jupyter | Runtime must be reachable from the running kernel/browser (today: Plotly via CDN; Three.js inlined). | +| **MkDocs site** | executed-notebook HTML embedded by `mkdocs-jupyter` | Wants the runtime loaded **once per page** and figures rendered **lazily**. | | **Standalone report** | `report/html_renderer.py` → `PlotlyPlotter.serialize_html` / Three.js `render(offline=...)` | Delivery set by the existing `offline` flag — embedded/self-contained when `offline=True`, CDN when `offline=False` (default). Authoritative per [`project-summary-rendering.md`](project-summary-rendering.md). | A useful precedent already lives in the report renderer @@ -281,10 +281,10 @@ delivered together** in one change. Concretely: Storage-side numeric precision is a separate, deliberate decision, proposed in a `cif-numeric-precision` ADR suggestion (out of scope - for this change, not committed on this branch). - Phase 2 adds coverage for the `f8`→`f4` transcode (shape preserved, - round-trips through Plotly) and a representative hover/range-sensitive - figure whose formatted values are unchanged. + for this change, not committed on this branch). Phase 2 adds coverage + for the `f8`→`f4` transcode (shape preserved, round-trips through + Plotly) and a representative hover/range-sensitive figure whose + formatted values are unchanged. This pays the network bill once per page from the same origin, removes the per-figure JS duplication, and turns first paint from "render every @@ -454,9 +454,9 @@ Settled in discussion on 2026-06-02: - Hoist a single importmap into the **report** template `` for standalone reports that render multiple Three.js scenes (the same per-scene-importmap bug as docs, but governed by - [`project-summary-rendering.md`](project-summary-rendering.md)). - Out of scope here since it touches the report contract; flagged so it - is not lost. + [`project-summary-rendering.md`](project-summary-rendering.md)). Out + of scope here since it touches the report contract; flagged so it is + not lost. ## Alternatives considered diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 36f19c5f5..5ca268648 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -66,12 +66,13 @@ commit with message `Promote plotting-docs-performance ADR to accepted`. `{% block extrahead %}` in `docs/overrides/main.html`, paths resolved against `{{ base_url }}`; `SHARED` scenes drop their per-scene importmap. -7. **SHARED figures downcast bulk float64 arrays to float32** - (ADR Decision 7) — a bounded, display-only precision reduction - (~2× payload). Operates on a copy of the serialized figure; source +7. **SHARED figures downcast bulk float64 arrays to float32** (ADR + Decision 7) — a bounded, display-only precision reduction (~2× + payload). Operates on a copy of the serialized figure; source data/CIF/reports keep full float64; visually lossless at shown - precision. Storage-side precision is a separate `cif-numeric-precision` - ADR suggestion (out of scope here, not committed on this branch). + precision. Storage-side precision is a separate + `cif-numeric-precision` ADR suggestion (out of scope here, not + committed on this branch). ## No new dependencies @@ -258,9 +259,9 @@ with the zsh-safe pattern and preserve the exit code. - A `tools/` test for `bump_vendored_js.py --check` drift detection (no network — monkeypatch/`pooch` fixture), mirroring `tools/test_structure_check.py`. -- `_typed_arrays_to_float32()` (SHARED float32 downcast, ADR Decision 7): - every `f8` typed-array spec becomes `f4` with `shape` preserved and - round-trips through Plotly; integer specs and inline scalars are +- `_typed_arrays_to_float32()` (SHARED float32 downcast, ADR Decision + 7): every `f8` typed-array spec becomes `f4` with `shape` preserved + and round-trips through Plotly; integer specs and inline scalars are untouched. Plus a representative powder/correlation figure whose **hover-template-formatted** values are identical under f64 vs f32 (proving the loss is display-only). diff --git a/pixi.toml b/pixi.toml index c0eb494d0..bb0f0b629 100644 --- a/pixi.toml +++ b/pixi.toml @@ -214,9 +214,13 @@ docs-pre = 'pixi run docs-vars python -m mkdocs' # Copy the canonical Three.js snapshot into the (git-ignored) docs # assets before any build/serve so MkDocs can serve it. docs-sync-vendored-js = 'python tools/sync_docs_vendored_js.py' -docs-serve = { cmd = 'pixi run docs-pre serve -f docs/mkdocs.yml', depends-on = ['docs-sync-vendored-js'] } +docs-serve = { cmd = 'pixi run docs-pre serve -f docs/mkdocs.yml', depends-on = [ + 'docs-sync-vendored-js', +] } docs-serve-dirty = 'pixi run docs-serve --dirty' -docs-build = { cmd = 'pixi run docs-pre build -f docs/mkdocs.yml', depends-on = ['docs-sync-vendored-js'] } +docs-build = { cmd = 'pixi run docs-pre build -f docs/mkdocs.yml', depends-on = [ + 'docs-sync-vendored-js', +] } docs-build-local = 'pixi run docs-build --no-directory-urls' docs-deploy-pre = 'mike deploy -F docs/mkdocs.yml --push --branch gh-pages --update-aliases --alias-type redirect' diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index c2acab907..afa96946a 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -144,7 +144,8 @@ def _typed_arrays_to_float32(value: object) -> object: Returns ------- object - The same structure with float64 typed arrays downcast to float32. + The same structure with float64 typed arrays downcast to + float32. """ if isinstance(value, dict): if value.get('dtype') == 'f8' and 'bdata' in value: @@ -1714,9 +1715,8 @@ def _show_figure( fig.show(config=config) return - # Docs notebook execution sets SHARED so the baked cell HTML is a - # lazy placeholder; live Jupyter stays INLINE (eager, runtime via - # the CDN as before). + # Docs execution sets SHARED, baking a lazy placeholder into + # the cell HTML. Live Jupyter stays INLINE (eager, CDN). if resolve_figure_embed_mode() is FigureEmbedMode.SHARED: html_fig = self.serialize_html( fig, @@ -1770,7 +1770,9 @@ def _ed_theme_sync_payload(cls, fig: object) -> dict: @staticmethod def _figure_height(fig: object) -> int: - """Return the figure height in pixels for the loading skeleton.""" + """ + Return the figure height in pixels for the loading skeleton. + """ layout = getattr(fig, 'layout', None) height = getattr(layout, 'height', None) if layout is not None else None if isinstance(height, (int, float)) and not isinstance(height, bool) and height > 0: @@ -1782,12 +1784,13 @@ def _serialize_html_shared(cls, fig: object) -> str: """ Serialize a figure as a lazy SHARED-mode placeholder. - Emits a skeleton plus the figure spec as ``application/json`` for - the shared ``ed-figures.js`` loader to render on demand. No Plotly - bundle or per-figure post-script is embedded; the runtime loads - once per page and the loader owns theme-sync, resize, and legend. - Bulk float64 arrays are downcast to float32 (visually lossless, - ~7 significant figures) to roughly halve the embedded data. + Emits a skeleton plus the figure spec as ``application/json`` + for the shared ``ed-figures.js`` loader to render on demand. No + Plotly bundle or per-figure post-script is embedded; the runtime + loads once per page and the loader owns theme-sync, resize, and + legend. Bulk float64 arrays are downcast to float32 (visually + lossless, ~7 significant figures) to roughly halve the embedded + data. Parameters ---------- @@ -1844,7 +1847,7 @@ def serialize_html( Plotly figure to serialize. include_plotlyjs : bool | str Plotly JavaScript inclusion mode passed to Plotly. - mode : FigureEmbedMode, default=STANDALONE + mode : FigureEmbedMode, default=FigureEmbedMode.STANDALONE Embedding mode. ``SHARED`` emits a lazy placeholder for the docs loader; ``INLINE``/``STANDALONE`` serialize eagerly. force_template : str | None, default=None diff --git a/src/easydiffraction/display/structure/renderers/threejs.py b/src/easydiffraction/display/structure/renderers/threejs.py index 59a38e64a..3b29c7127 100644 --- a/src/easydiffraction/display/structure/renderers/threejs.py +++ b/src/easydiffraction/display/structure/renderers/threejs.py @@ -217,8 +217,8 @@ def render( dark_colours = theme_colors(dark=True) payload = json.dumps(_scene_payload(scene)).replace(' Path: # ---------------------------------------------------------------------- -class FigureEmbedMode(str, Enum): +class FigureEmbedMode(StrEnum): """ How interactive figure HTML embeds its JavaScript runtime. @@ -252,10 +252,7 @@ def resolve_figure_embed_mode() -> FigureEmbedMode: return FigureEmbedMode(raw.lower()) except ValueError: supported = ', '.join(mode.value for mode in FigureEmbedMode) - message = ( - f'Invalid {_FIGURE_EMBED_MODE_ENV_VAR}={raw!r}; ' - f'supported values: {supported}.' - ) + message = f'Invalid {_FIGURE_EMBED_MODE_ENV_VAR}={raw!r}; supported values: {supported}.' raise ValueError(message) from None From 13dc80fe486eb2d3bf701c070244ef4bcdd297de Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 18:47:28 +0200 Subject: [PATCH 21/50] Add Phase 2 tests for embedding mode and float32 --- .../display/plotters/test_plotly.py | 64 +++++++++++++++++++ .../structure/renderers/test_threejs.py | 27 ++++++++ .../easydiffraction/utils/test_environment.py | 38 +++++++++++ 3 files changed, 129 insertions(+) diff --git a/tests/unit/easydiffraction/display/plotters/test_plotly.py b/tests/unit/easydiffraction/display/plotters/test_plotly.py index 17faf6381..02e34604d 100644 --- a/tests/unit/easydiffraction/display/plotters/test_plotly.py +++ b/tests/unit/easydiffraction/display/plotters/test_plotly.py @@ -1123,3 +1123,67 @@ def fake_show_figure(self, fig): assert len(fig.data) == 3 assert fig.layout.yaxis2.range[0] == pytest.approx(-1.0) assert fig.layout.yaxis2.range[1] == pytest.approx(1.0) + + +def test_typed_arrays_to_float32_transcodes_and_preserves_shape(): + import base64 + + import easydiffraction.display.plotters.plotly as pp + + values = np.arange(6, dtype=' Date: Tue, 2 Jun 2026 18:49:20 +0200 Subject: [PATCH 22/50] Resolve RequireJS open question (kept, removal deferred) --- docs/dev/plans/plotting-docs-performance.md | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 5ca268648..419fad09d 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -87,10 +87,14 @@ need a new dependency, stop and ask per `AGENTS.md` §Planning. 1. **Activation trigger.** Scroll-near lazy only (lean: yes); click-to-activate deferred unless a page proves pathological. -2. **RequireJS.** Keep `include_requirejs: true` through Phase 1; in - Phase 2, after confirming the self-hosted `include_plotlyjs=False` - output renders under `mkdocs-jupyter`, remove it. If removal breaks - rendering, keep it and note why. +2. **RequireJS — resolved (Phase 2): kept.** The SHARED output uses the + global `window.Plotly` (self-hosted bundle) loaded by a classic + script, so it does not itself need RequireJS. But confirming nothing + else under `mkdocs-jupyter` relies on `include_requirejs` requires a + browser render check this environment cannot perform. Rather than + risk breaking rendering, `include_requirejs: true` is **kept**, and + its removal is deferred to a browser-verified follow-up (cost of + keeping: one small cached script). ## Concrete files likely to change @@ -275,9 +279,10 @@ line: git grep -nE "go\.(Scattergl|Scatter3d|Surface|Mesh3d|Cone|Streamtube|Volume|Isosurface|Scattermapbox|Choroplethmapbox|Densitymapbox|Scattergeo|Choropleth)" -- src docs || echo "no gl/3d/map traces; plotly-cartesian suffices" ``` -**RequireJS** — after confirming docs render with the self-hosted -`include_plotlyjs=False` output, remove `include_requirejs: true` from -`mkdocs.yml` (open question 2). Commit separately. +**RequireJS** — **kept** (open question 2 resolved). Removing +`include_requirejs: true` needs a browser render check this environment +cannot run, so it is deferred to a browser-verified follow-up rather +than risk breaking rendering. **Command suite** (run in order; fix → commit → re-run until clean): @@ -310,7 +315,8 @@ and `docs/site/` untracked. For tutorial project-path collisions in - [ ] Phase 2 tests added; `test-structure-check` + the five task commands clean - [ ] Docs build smoke passes; figures load lazily -- [ ] RequireJS decision applied +- [x] RequireJS decision applied (kept; removal deferred to + browser-verified follow-up) - [ ] Phase 2 review cycle closed (`/review-impl-2` sentinel) - [ ] ADR promoted to `accepted/` and indexed - [ ] PR opened against `develop` From b89054e146cd5cc1093cf24278bc26844efb540e Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 19:11:01 +0200 Subject: [PATCH 23/50] Add float32 fidelity, report STANDALONE, and bump drift tests --- .../display/plotters/test_plotly.py | 56 +++++++++++++++++ .../report/test_html_renderer.py | 21 +++++++ tests/unit/tools/test_bump_vendored_js.py | 63 +++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 tests/unit/tools/test_bump_vendored_js.py diff --git a/tests/unit/easydiffraction/display/plotters/test_plotly.py b/tests/unit/easydiffraction/display/plotters/test_plotly.py index 02e34604d..9a7494dcf 100644 --- a/tests/unit/easydiffraction/display/plotters/test_plotly.py +++ b/tests/unit/easydiffraction/display/plotters/test_plotly.py @@ -1187,3 +1187,59 @@ def test_serialize_html_inline_is_eager_self_contained(): assert 'data-ed-figure' not in html # Eager render embeds the plot div / runtime call. assert 'plotly-graph-div' in html or 'newPlot' in html + + +def test_typed_arrays_to_float32_leaves_integer_specs_untouched(): + import base64 + + import easydiffraction.display.plotters.plotly as pp + + ints = np.arange(5, dtype=' +# SPDX-License-Identifier: BSD-3-Clause +"""Tests for tools/bump_vendored_js.py drift detection (no network).""" + +from __future__ import annotations + +import hashlib +import importlib.util +import sys +from pathlib import Path + + +def _load_bump(): + repo_root = Path(__file__).resolve().parents[3] + module_path = repo_root / 'tools' / 'bump_vendored_js.py' + spec = importlib.util.spec_from_file_location('bump_vendored_js', module_path) + module = importlib.util.module_from_spec(spec) + # Register before exec so the module's dataclasses can resolve their + # own module via sys.modules. + sys.modules[spec.name] = module + spec.loader.exec_module(module) + return module + + +def _runtime(bump, dest_dir, content): + asset = bump.VendoredAsset( + 'a.js', + 'https://example.invalid/a.js', + hashlib.sha256(content).hexdigest(), + ) + return bump.VendoredRuntime( + name='Example', + package='example', + version='1.0.0', + dest_dir=dest_dir, + licence='MIT — Example.', + assets=(asset,), + ) + + +def test_check_runtime_flags_missing_then_passes_then_detects_drift(tmp_path): + bump = _load_bump() + content = b'console.log("hi");\n' + runtime = _runtime(bump, tmp_path, content) + + # Missing asset -> drift reported. + assert bump._check_runtime(runtime) + + # Correct asset + regenerated licence -> clean. + (tmp_path / 'a.js').write_bytes(content) + (tmp_path / 'LICENSES.md').write_text(bump._license_text(runtime), encoding='utf-8') + assert bump._check_runtime(runtime) == [] + + # Tampered asset -> hash drift. + (tmp_path / 'a.js').write_bytes(b'tampered\n') + problems = bump._check_runtime(runtime) + assert any('hash drift' in problem for problem in problems) + + # Restore asset, tamper licence -> licence drift. + (tmp_path / 'a.js').write_bytes(content) + (tmp_path / 'LICENSES.md').write_text('stale\n', encoding='utf-8') + problems = bump._check_runtime(runtime) + assert any('license drift' in problem for problem in problems) From d5dd1ab27a2f4cd06f7b3f2d91d50b48628d1f9c Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 19:21:17 +0200 Subject: [PATCH 24/50] Finalize Wyckoff ADR, add CIF precision ADR --- .../dev/adrs/accepted/space-group-database.md | 28 +- docs/dev/adrs/index.md | 2 +- .../adrs/suggestions/cif-numeric-precision.md | 129 ++++++ .../wyckoff-letter-detection_reply-1.md | 92 ----- .../wyckoff-letter-detection_reply-11.md | 53 --- .../wyckoff-letter-detection_reply-12.md | 50 --- .../wyckoff-letter-detection_reply-13.md | 26 -- .../wyckoff-letter-detection_reply-14.md | 15 - .../wyckoff-letter-detection_reply-15.md | 12 - .../wyckoff-letter-detection_reply-2.md | 47 --- .../wyckoff-letter-detection_reply-4.md | 57 --- .../wyckoff-letter-detection_reply-5.md | 36 -- .../wyckoff-letter-detection_reply-7.md | 36 -- .../wyckoff-letter-detection_reply-8.md | 40 -- .../wyckoff-letter-detection_reply-9.md | 29 -- .../wyckoff-letter-detection_review-1.md | 78 ---- .../wyckoff-letter-detection_review-10.md | 11 - .../wyckoff-letter-detection_review-11.md | 48 --- .../wyckoff-letter-detection_review-12.md | 70 ---- .../wyckoff-letter-detection_review-13.md | 46 --- .../wyckoff-letter-detection_review-14.md | 28 -- .../wyckoff-letter-detection_review-15.md | 29 -- .../wyckoff-letter-detection_review-16.md | 12 - .../wyckoff-letter-detection_review-2.md | 36 -- .../wyckoff-letter-detection_review-3.md | 11 - .../wyckoff-letter-detection_review-4.md | 41 -- .../wyckoff-letter-detection_review-5.md | 27 -- .../wyckoff-letter-detection_review-6.md | 11 - .../wyckoff-letter-detection_review-7.md | 26 -- .../wyckoff-letter-detection_review-8.md | 26 -- .../wyckoff-letter-detection_review-9.md | 24 -- docs/dev/plans/space-group-database.md | 3 +- docs/dev/plans/wyckoff-letter-detection.md | 382 ++++++++++++++++++ 33 files changed, 528 insertions(+), 1033 deletions(-) create mode 100644 docs/dev/adrs/suggestions/cif-numeric-precision.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md delete mode 100644 docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md create mode 100644 docs/dev/plans/wyckoff-letter-detection.md diff --git a/docs/dev/adrs/accepted/space-group-database.md b/docs/dev/adrs/accepted/space-group-database.md index 011dde5d1..74083fd76 100644 --- a/docs/dev/adrs/accepted/space-group-database.md +++ b/docs/dev/adrs/accepted/space-group-database.md @@ -8,9 +8,9 @@ Structure model. > This ADR follows [`AGENTS.md`](../../../../AGENTS.md). It was a > prerequisite for -> [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md): Wyckoff -> detection can only resolve letters for space groups present in the -> bundled table, which this ADR's implementation completed for all +> [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md): +> Wyckoff detection can only resolve letters for space groups present in +> the bundled table, which this ADR's implementation completed for all > 230 groups. ## Context @@ -103,7 +103,8 @@ Coordinates and operators stay **strings** (e.g. `'(x,1/2,0)'`, `sympify`) in `crystallography.py` and to keep the file JSON-native (§2). Triclinic no-setting groups keep the `None` coordinate code, as today (see the `''`→`None` normalisation in -[`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) §2). +[`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) +§2). **Query surface preserved.** On disk the JSON is a list of setting records, each carrying the canonical `IT_number` and @@ -285,9 +286,10 @@ coordinate-system code": EasyDiffraction's `SpaceGroup` category uses the empty string `''`, while the table key uses `None`. The database keeps `(1, None)` and `(2, None)`; callers normalise `''` to `None` at lookup boundaries, as specified in -[`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md). This is -the least surprising solution because it keeps "no setting" distinct -from any real coordinate-code string without inventing a sentinel value. +[`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md). +This is the least surprising solution because it keeps "no setting" +distinct from any real coordinate-code string without inventing a +sentinel value. ### 8. The database file is generated, not hand-edited @@ -344,9 +346,9 @@ and the documented decisions in sync. early when `coord_code is None` and `_get_general_position_ops()` indexes the raw key, so they need the `''`→`None` normalisation defined in - [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) §2 (which - also updates these call sites). This ADR delivers the data; that ADR - delivers the `None`-code consumer handling. + [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) + §2 (which also updates these call sites). This ADR delivers the data; + that ADR delivers the `None`-code consumer handling. ## Alternatives Considered @@ -509,8 +511,8 @@ respectively. ## Related ADRs -- [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) — the - dependent feature; its `''`→`None` coordinate-code normalisation and - its "unsupported group" handling both build on this database. +- [`wyckoff-letter-detection.md`](../suggestions/wyckoff-letter-detection.md) + — the dependent feature; its `''`→`None` coordinate-code normalisation + and its "unsupported group" handling both build on this database. - [`iucr-cif-tag-alignment.md`](../accepted/iucr-cif-tag-alignment.md) — consumes space-group and Wyckoff data on export. diff --git a/docs/dev/adrs/index.md b/docs/dev/adrs/index.md index 8aedc2e57..2175fa8e3 100644 --- a/docs/dev/adrs/index.md +++ b/docs/dev/adrs/index.md @@ -46,7 +46,7 @@ folders. | Quality | Accepted | Test Strategy | Defines layered unit, functional, integration, script, and notebook testing. | [`test-strategy.md`](accepted/test-strategy.md) | | Structure model | Accepted | Type-Neutral ADP Parameters | Keeps ADP parameter object identities stable across B/U and iso/ani switches. | [`type-neutral-adp-parameters.md`](accepted/type-neutral-adp-parameters.md) | | Structure model | Suggestion | Automatic Wyckoff Position Detection | Detects Wyckoff letter, multiplicity, and site symmetry from space group and coordinates; calculators consume them. | [`wyckoff-letter-detection.md`](suggestions/wyckoff-letter-detection.md) | -| Structure model | Accepted | Complete Space-Group Reference Database | One-time build of a complete space_groups.json.gz (all 230 groups) from cctbx, verified against multiple sources. | [`space-group-database.md`](accepted/space-group-database.md) | +| Structure model | Accepted | Complete Space-Group Reference Database | One-time build of a complete space_groups.json.gz (all 230 groups) from cctbx, verified against multiple sources. | [`space-group-database.md`](accepted/space-group-database.md) | | User-facing API | Accepted | Crystal Structure 3D Visualization | Adds a renderer-neutral scene model drawn by ASCII and interactive Three.js engines for viewing crystal structures. | [`crysview-structure-visualization.md`](accepted/crysview-structure-visualization.md) | | User-facing API | Accepted | Display UX Facade | Defines `project.display` and `project.rendering` responsibilities and display method names. | [`display-ux.md`](accepted/display-ux.md) | | User-facing API | Accepted | Fit Results Display Naming | Short, IUCr/GUM-aligned column headers (`s.u.`, `value`, `95% CI`) with a footnote glossary on every fit table. | [`fit-results-display-naming.md`](accepted/fit-results-display-naming.md) | diff --git a/docs/dev/adrs/suggestions/cif-numeric-precision.md b/docs/dev/adrs/suggestions/cif-numeric-precision.md new file mode 100644 index 000000000..f2d078545 --- /dev/null +++ b/docs/dev/adrs/suggestions/cif-numeric-precision.md @@ -0,0 +1,129 @@ +# ADR: Meaningful Numeric Precision in CIF Serialization + +**Status:** Proposed **Date:** 2026-06-02 + +## Group + +Core model. + +> This ADR follows [`AGENTS.md`](../../../../AGENTS.md). It is the +> data-side counterpart to +> [`plotting-docs-performance.md`](plotting-docs-performance.md), which +> handles **display** precision (downcasting plot arrays to float32). +> This ADR concerns the precision of numbers we **store and serialize** +> in CIF, which is a separate decision because CIF is a data +> source-of-truth, not a throwaway view. + +## Context + +Numbers written to CIF (and to the figure data derived from them) carry +far more digits than is meaningful. Calculated intensities, profile +points, and derived quantities are serialized at essentially full +float64 precision (~15–17 digits), even though only a few digits are +significant. Two costs follow: + +1. **File and payload bloat.** Profile arrays dominate CIF size and the + embedded plot data (a single powder pattern serialized at full + precision is hundreds of KB of digits that nobody reads). +2. **Meaningless precision.** A calculated intensity printed as + `1234.5678901234567` implies a precision the calculation does not + have, and a _fixed_ number of decimals is wrong at both ends of the + scale (it over-prints small values and under-prints large ones). + +The right notion is **relative precision** — significant figures tied to +the value's actual significance — not a fixed decimal count. For refined +parameters the significance is already known: the standard uncertainty +(s.u.). + +**Important boundary.** Precision needed to _restore fit state_ +(reload-and-continue) is not the same as precision a human or a +publication needs. Any reduction must not silently break round-tripping +of state files. See **Risks**. + +## Options considered + +| # | Option | Adapts to scale? | Best for | Notes | +| --- | ----------------------------------------------------------- | ---------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| A | Status quo — full float64 repr | n/a | nothing | Baseline; bloated, meaningless precision. | +| B | Fixed decimal places (`%.4f`) | ❌ | nothing | Wrong at both ends of the scale. | +| C | Significant figures (`%.Ng`) | ✅ | derived/calculated values without s.u. | Simple, relative precision; the elegant default. | +| D | Uncertainty-aware (IUCr/GUM): quote value to match its s.u. | ✅ | refined parameters **with** s.u. | `1.2345(12)`; the crystallographic standard. | +| E | Range/variation-based (per array) | ✅ | profile/array data (calc patterns) | Pick the quantum from the array's dynamic range so the step is below the meaningful/visual threshold. The idea raised in discussion. | +| F | Per-tag policy (dictionary-driven) | ✅ | everything, centrally | Different tags need different precision; drive defaults from the CIF dictionary (`cif_core.dic`) where it specifies a type/precision. | +| G | float32 for arrays (display only) | ✅ | the plot path | Already adopted for the docs view in the plotting ADR; not a CIF-storage change. | + +## Decision (proposed — direction, not yet locked) + +A layered policy, applied at CIF serialization: + +1. **Refined parameters with an s.u. → uncertainty-aware (D).** Print + the value to the precision implied by its s.u. (IUCr convention). + This is both correct and concise, and it is what scientists expect. +2. **Derived/calculated scalars without s.u. → significant figures + (C).** A sensible default (e.g. 6 s.f.), configurable. +3. **Profile/array data → range-aware significant figures (E).** Choose + the per-array precision from its dynamic range so the quantization is + invisible (and pair with float32 on the display side, option G). +4. **Central policy object (F).** One place defines the default s.f. and + per-category/per-tag overrides, seeded from the CIF dictionary where + it constrains a tag. No scattered `round()` calls. Aligns with the + memory that the dictionaries (`cif_core.dic`, `cif_pow.dic`) are the + spec. +5. **Two precision profiles.** A **human/published** profile (concise, + the above) and a **state-restore** profile (full precision) for files + whose job is to reproduce a fit exactly. The active profile is chosen + by the writer, not guessed. + +This keeps stored numbers meaningful and small without risking +reproducibility, and gives the docs/plots smaller inputs at the source. + +## Consequences + +### Positive + +- Smaller CIF files and smaller derived plot payloads, at the source. +- Numbers convey real significance (s.u.-matched), aiding readability + and publication. +- One precision policy instead of ad-hoc formatting. + +### Negative / cost + +- A precision policy and per-tag configuration to design and maintain. +- Tests that assert exact serialized strings must move to + tolerance-based comparisons. +- The human-vs-state-restore split must be explicit everywhere CIF is + written. + +## Risks and mitigations + +- **Round-trip / fit restart.** Reducing precision on a file used to + restore state can change results. _Mitigation:_ the state-restore + profile keeps full precision; only human/published output is reduced. + Cover with a save→load→save round-trip test on the state profile. +- **Reproducibility / regression diffs.** Existing golden-file tests and + CIF diffs assume exact digits. _Mitigation:_ update them to the policy + and tolerance comparisons in the same change. +- **Over-aggressive rounding.** Choosing too few s.f. for coordinates or + cell parameters loses science. _Mitigation:_ per-tag floors from the + dictionary; conservative defaults. + +## Open questions + +1. Default significant-figure count for the human profile (5? 6?). +2. Whether the policy is per-`CategoryItem`, per-tag, or both. +3. How to source per-tag precision from `cif_core.dic` (does it specify + enough), versus a hand-maintained table. +4. Whether to expose the active profile to users (e.g. + `project.save(..., precision='full' | 'concise')`). + +## Alternatives considered + +See **Options A–G**. A (status quo) and B (fixed decimals) are rejected. +G (float32 arrays) is display-only and already handled by the plotting +ADR; it is complementary, not a substitute, for storage precision. + +## Deferred work + +- Binary/columnar storage for large profile arrays (e.g. HDF5 datasets + with an explicit dtype) instead of text CIF, where round-tripping + exact arrays matters and text is the wrong container. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md deleted file mode 100644 index 4c7b29b50..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-1.md +++ /dev/null @@ -1,92 +0,0 @@ -# Reply 1: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-1.md`](wyckoff-letter-detection_review-1.md). -All five findings accepted; the ADR was updated as described below. One -finding (P2 key normalisation) was verified empirically against the -bundled table before editing. - -## [P1] Persisting resolved letters loses auto-mode semantics - -**Verdict:** Agree. - -**Action taken.** Rewrote §9 "CIF behaviour". The project (round-trip) -CIF now writes `_atom_site.Wyckoff_symbol` **only for provided -(explicit) letters**; auto-mode atoms write no symbol and are -deterministically re-derived on load (same coordinates + space group → -same letter). This preserves both the value and the auto/provided -behaviour across save/load, so the contradiction with persisted-state -restore is gone. I also updated §4 (load is a non-minimizer update that -rebuilds the omitted letter), the Positive bullet on round-trips, and -the Compatibility Outcomes bullet to match the new rule. The IUCr report -export still emits every resolved letter, but it is now explicitly -described as a non-round-trip archival path. - -**Pointer:** §9, §4, Consequences → Positive and Compatibility Outcomes. - -## [P1] Empty string cannot both mean auto and explicit assignment - -**Verdict:** Agree. - -**Action taken.** Rewrote §3 to give the empty sentinel a single, -documented reset meaning: assigning a non-empty letter sets -`provided = True`; assigning `''` clears the marker and returns the site -to auto mode. The empty sentinel is in the validator's allowed set (§8), -so the reset assignment validates. The section now states the invariant -explicitly: empty value ⟺ auto (`provided = False`); non-empty user -assignment ⟺ `provided = True`. - -**Pointer:** §3. - -## [P2] No-code space groups need an explicit key normalisation rule - -**Verdict:** Agree — and it caught a factual error in the draft. - -**Action taken.** Verified against the bundled table: it contains -exactly two `None`-coord-code keys, `(1, None)` (P1, Wyckoff `a`, -multiplicity 1) and `(2, None)` (P-1), and **zero** empty-string keys, -while `SpaceGroup` reports no-code groups as `''`. My draft's "P 1 is -absent from the table" claim was therefore wrong. Added a "Key -normalisation" rule to §2: `''` is normalised to `None` (via a shared -`_normalize_coord_code()` helper) before indexing `SPACE_GROUPS`, so -P1/P-1 resolve to their real positions; corrected the -`detect_wyckoff_letter` bullet to say "genuinely absent"; updated §8 to -key through the same normalisation. Noted that the existing -`_get_wyckoff_exprs()` / `_get_general_position_ops()` lookups should -adopt the helper, since they currently miss the `None`-keyed groups. - -**Pointer:** §2 (Key normalisation + `detect_wyckoff_letter` bullet), -§8. - -## [P2] CIF presence tracking is underspecified for the marker - -**Verdict:** Agree. - -**Action taken.** §9 now names the boundary owner: the collection's -`_after_from_cif()` hook, already invoked by -`category_collection_from_cif` -([`serialize.py:1218`](../../../../src/easydiffraction/io/cif/serialize.py)). -Because auto letters are never written (P1 fix above), a present symbol -loads as a non-empty value, so the hook can set `provided = True` for -every atom with a non-empty loaded `wyckoff_letter` — presence ⟺ -non-empty value — without threading tag-presence through the generic -loader. CIF-null (`?` / `.`) loads as empty and stays auto. - -**Pointer:** §9, read bullets. - -## [P3] The auto-fill path names an API that does not exist - -**Verdict:** Agree. - -**Action taken.** Confirmed there is no `set_value_directly` in -`variable.py`; the real non-validating internal writer is -`_set_value_from_minimizer` -([`variable.py:171`](../../../../src/easydiffraction/core/variable.py)). -§3 now specifies a dedicated private mutator, -`_set_wyckoff_letter_detected()`, modelled on that writer (sets the -value and marks the owner dirty, leaves the provided marker untouched), -and explicitly notes that `set_value_directly` does not exist so the -detected-state write gets its own named path rather than reusing the -minimizer one. - -**Pointer:** §3, auto-mode bullet. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md deleted file mode 100644 index 24178f5f7..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-11.md +++ /dev/null @@ -1,53 +0,0 @@ -# Reply 11: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-11.md`](wyckoff-letter-detection_review-11.md). - -## [P1] `space_group_Wyckoff` still has unresolved structural decisions - -**Verdict:** Agree. - -**Action taken.** The ADR now settles the `space_group_Wyckoff` -structural decisions instead of deferring them: - -- The collection key is `id`, serialized as `_space_group_Wyckoff.id`, - so runtime identity follows the CIF category key rather than using the - non-key `letter` descriptor. -- The category is explicitly read-only: row descriptors are getter-only, - and public collection mutation paths (`add()`, `create()`, `remove()`, - `__setitem__`, and `__delitem__`) raise a clear `ValueError`. -- `Structure._update_categories()` rebuilds the collection from the - current space group via a private collection method before ordinary - category update hooks run, so no special `_update_priority` is needed - and no other category depends on this collection for detection. -- Project CIF excludes the derived loop via - `Structure._serializable_categories()`, while IUCr/report output emits - `_space_group_Wyckoff.*`; incoming loop values are ignored/overwritten - because the category is re-derived from the space group. - -The open questions about persistence, key choice, read-only mechanism, -and update priority were removed. Tests now explicitly cover the read-only -mutation paths, project-CIF omission, and report emission. - -**Pointer:** Decision §6 (`space_group_Wyckoff` key/read-only/rebuild -paragraphs), Decision §9 (CIF behaviour), Open Questions, Testing. - -## [P2] Stale atom-site `site_symmetry` wording remains - -**Verdict:** Agree. - -**Action taken.** Reworded the stale passages so `AtomSite` owns only the -read-only `multiplicity` descriptor, while `site_symmetry` is exposed on -read-only `space_group_Wyckoff` rows: - -- Decision §1 now distinguishes atom-site letter/multiplicity from the - space-group Wyckoff table that exposes site symmetry. -- Decision §2 no longer says the dataclass fills site-symmetry - descriptors on atom sites. -- Decision §3 no longer describes unsupported explicit atom-site letters - as carrying "site symmetry". -- The Related ADR entry for `guarded-public-properties.md` now names - read-only `AtomSite.multiplicity` and read-only - `space_group_Wyckoff` row descriptors. - -**Pointer:** Decision §§1-3 and Related ADRs. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md deleted file mode 100644 index bea967154..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-12.md +++ /dev/null @@ -1,50 +0,0 @@ -# Reply 12: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-12.md`](wyckoff-letter-detection_review-12.md). - -## [P1] Detected letters can still snap through the wrong orbit representative - -**Verdict:** Agree. - -**Action taken.** The ADR now requires representative selection. The -`WyckoffPosition` record carries a selected `coord_template`; -`detect_wyckoff_position()` returns the nearest matched representative -inside the winning orbit, and explicit-letter snapping calls -`wyckoff_position_info(..., fract_xyz=current_coords)` to choose the -nearest representative for that letter. The ADR explicitly rejects using -`coords_xyz[0]` for snapping and calls out the Pm-3m `6e` non-first -representative case. Tests now include auto-detection and explicit-letter -snapping through a non-first representative. - -**Pointer:** Decision §2 ("Representative selection") and Testing. - -## [P1] Space-group and setting edits do not trigger redetection - -**Verdict:** Agree. - -**Action taken.** The ADR now treats space-group key changes as a -first-class trigger. The update flow records the `(name_hm, coord_code)` -key used for the last Wyckoff derivation. If the key changes, every atom -site re-runs the supported/unsupported policy even when coordinates are -unchanged. Supported new keys re-detect all letters and multiplicities; -unsupported new keys preserve stored letters verbatim as unvalidated -values, set multiplicity to `None`, skip constraints, and warn that the -group is untabulated. The user-set-letter persistence language was -updated to include space-group-key edits as a re-detection trigger. - -**Pointer:** Decision §§3-5, Trade-offs, Alternatives Considered, and -Testing. - -## [P2] Same-letter coordinate snaps are still silent - -**Verdict:** Agree. - -**Action taken.** The ADR now adds an explicit warning for user -coordinate edits whose constraint snap changes stored coordinates even -when the detected letter stays the same: -_"coordinates of were adjusted to satisfy Wyckoff letter L"_. -Testing now covers same-letter coordinate edits whose snap moves stored -coordinates. - -**Pointer:** Decision §5 and Testing. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md deleted file mode 100644 index 4f1629c4d..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-13.md +++ /dev/null @@ -1,26 +0,0 @@ -# Reply 13: Automatic Wyckoff Position Detection - -## [P2] Unsupported-group stored letters are still described as explicit-only - -Verdict: agree. - -Action taken: the unsupported-group policy now consistently uses -"stored" non-empty letters rather than "explicit" letters only. §3 now -states that unsupported groups keep any stored non-empty letter, -including a letter preserved after a supported-to-unsupported -space-group change. §9 now writes any stored non-empty unsupported -letter verbatim and assigns it `None` multiplicity, and the CIF -round-trip test bullet covers explicit and preserved stored letters. - -Affected sections: §3 "The letter is always set, and tracks the -coordinates", §9 "CIF behaviour", and "Testing". - -## [P2] The trigger summary still says only coordinates re-detect - -Verdict: agree. - -Action taken: the closing paragraph of §4 now keeps the minimizer and -same-pass constraint-snap exclusions, but states that later coordinate -edits and later space-group / setting key edits can both re-detect. - -Affected section: §4 "Detection triggers". diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md deleted file mode 100644 index 153c35ab6..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-14.md +++ /dev/null @@ -1,15 +0,0 @@ -# Reply 14: Automatic Wyckoff Position Detection - -## [P2] Two unsupported-letter passages still say explicit-only - -Verdict: agree. - -Action taken: §6 now describes no-record multiplicity in terms of stored -non-empty letters, not explicit-only values. §8 now covers both explicit -Python/CIF input and letters preserved after a later change into an -unsupported space-group key; both become stored but unvalidated letters -with `None` multiplicity and no constraints. - -Affected sections: §6 "Per-atom multiplicity, and a new -`space_group_Wyckoff` category" and §8 "Allowed letters come from the -current space group (closes #51)". diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md deleted file mode 100644 index aac0222c8..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-15.md +++ /dev/null @@ -1,12 +0,0 @@ -# Reply 15: Automatic Wyckoff Position Detection - -## [P2] Compatibility still says explicit-letter projects are unaffected - -Verdict: agree. - -Action taken: the compatibility outcome now says explicit letters remain -respected and reload verbatim, while constraints remain unchanged except -for the intentional nearest-representative fix where the old -first-representative shortcut was wrong. - -Affected section: "Compatibility Outcomes". diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md deleted file mode 100644 index 9186a8e19..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-2.md +++ /dev/null @@ -1,47 +0,0 @@ -# Reply 2: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-2.md`](wyckoff-letter-detection_review-2.md). -Both findings accepted and addressed in the ADR. The CIF null-token -behaviour was verified against the serializer before editing. - -## [P1] The auto-mode invariant contradicts detected letters - -**Verdict:** Agree. - -**Action taken.** The §3 invariant was stated against the stored value -("empty value ⟺ auto"), which is wrong once detection fills a non-empty -value while the atom is still in auto mode. Rephrased §3 so the -invariant is about the **provided marker**, not the value: -`provided = True` exactly when the user supplied the letter; -`provided = False` is auto mode, in which the stored value may be empty -(unresolved) or a non-empty detected letter that downstream consumers -use — both are valid auto states. The empty `= ''` assignment is -described purely as the public reset command (forces `provided = False`, -drops the value to empty until the next detection). Also softened the -section's lead-in from "one invariant tying it to the value" to "kept -distinct from the stored descriptor value". - -**Pointer:** §3 (lead-in sentence and closing invariant paragraph). - -## [P2] Project CIF needs a row-level rule for mixed auto/explicit loops - -**Verdict:** Agree. - -**Action taken.** Confirmed that atom-site loops are emitted through the -ADP-family loop path (`_adp_family_loop_to_cif`, `serialize.py:301`) and -that the project's null token is `?` (`serialize.py:54`), which reads -back as the descriptor default (`serialize.py:1091`) — i.e. the empty -sentinel for the Wyckoff string descriptor. Replaced §9's per-atom -"write no symbol" rule with a concrete per-loop, columnar rule: - -- the `_atom_site.Wyckoff_symbol` column is emitted for an emitted loop - iff at least one row in it has a provided letter; -- when present, provided rows write the letter and auto rows write `?`; -- when no row has a provided letter, the column is omitted. - -Updated the read bullet to match: a non-empty cell means explicit, while -`?` / `.` / absent loads as empty and stays auto. This keeps the -"non-empty loaded value ⟺ explicit" rule implementable for mixed loops. - -**Pointer:** §9 (write and read bullets). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md deleted file mode 100644 index fea30aa72..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-4.md +++ /dev/null @@ -1,57 +0,0 @@ -# Reply 4: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-4.md`](wyckoff-letter-detection_review-4.md). -Both findings accepted. The serializer's empty-string behaviour was -verified before editing. - -## [P1] Live descriptor edits can bypass re-detection - -**Verdict:** Agree. - -**Action taken.** This is the reason the §4 mechanism was previously -left open; the finding settles it. A coordinate is a live `Parameter`, -so `atom.fract_x.value = 0.1` is a normal public edit that never reaches -an `AtomSite.fract_x` property setter — a setter hook would silently -miss it and leave a stale letter. Rewrote §4 to put both triggers in the -**update flow** instead: every public coordinate edit (property _or_ -`.value`) marks the owner dirty and runs `_update()`, so that is the one -place that sees them all. Re-detection now compares the current -coordinates against a per-atom baseline (the coordinates the letter was -last detected from) and fires when they differ. The baseline is -refreshed whenever the letter is set or detected — on load, on a user -letter-set, and after auto-detection including the constraint snap — so -a freshly loaded or user-set letter is not re-detected spuriously. The -minimizer (`called_by_minimizer=True`) and the constraint snap are -explicitly excluded. Updated the §3 coordinate bullet to name both -public paths and point to §4. - -**Pointer:** §4 (rewritten), §3 (coordinate bullet). - -## [P2] Unsupported groups contradict "always concrete" CIF writes - -**Verdict:** Agree. - -**Action taken.** Qualified the over-broad "concrete at all times" -claim. §3 now reads: concrete for every _supported_ space group; a group -absent from `SPACE_GROUPS` (§8) is the one exception — detection is a -no-op and the letter stays empty, with §9 defining how that serialises. -Verified that the serializer already renders an empty string as the CIF -null `?` -([`serialize.py:62`](../../../../src/easydiffraction/io/cif/serialize.py)) -and reads `?` back as the empty default -([`serialize.py:1091`](../../../../src/easydiffraction/io/cif/serialize.py)). -§9's write rule is now explicit: a resolved letter is written as-is; an -empty letter (unsupported group, or a transient not-yet-updated state) -is written as `?`, reads back empty, and round-trips as empty (detection -stays a no-op on reload). The column is always present and well-defined -for the columnar loops, and saving never fails on an unsupported group. -The §9 read bullet now notes the "stays empty when unsupported" case. - -**Pointer:** §3 (opening), §9 (intro, write and read bullets). - -## Note - -The §4-mechanism item in Open Questions is now resolved by this round -(it is decided in §4), so it was removed; the only remaining open -question is tuning the `1e-3` tolerance value. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md deleted file mode 100644 index a152fcf1d..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-5.md +++ /dev/null @@ -1,36 +0,0 @@ -# Reply 5: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-5.md`](wyckoff-letter-detection_review-5.md). -The single finding is accepted and addressed. - -## [P2] Empty-letter sites need derived descriptor semantics - -**Verdict:** Agree. - -**Action taken.** Review 4 defined the empty/unsupported escape hatch -for the letter only; this extends it to the values that depend on it. -Three edits: - -- **§6** now states the no-record case explicitly: when there is no - `WyckoffPosition` record (unsupported group, or a transient empty - letter before the first update), `multiplicity` is `None` and - `site_symmetry` is the empty string. They track the letter's empty - state in lockstep, and both serialise to CIF `?`. -- **§7** now specifies that the calculator skips a `None` multiplicity — - it leaves the backend's own inferred value in place rather than - writing `None` into the array. This is behaviour-preserving: today's - `_update_atom_multiplicity()` already returns early when the group is - absent from `SPACE_GROUPS`, so the no-override-on-unsupported - behaviour is unchanged. -- **§9** write rule now notes that - `_atom_site.site_symmetry_multiplicity` is written as `?` when the - multiplicity is `None` — the same unsupported-group case as the - letter. (Both are derived and ignored on read, per the existing §9 - rule, so they are recomputed rather than trusted.) - -The unsupported-group escape hatch is now defined for the letter and for -both derived model values that build on it. - -**Pointer:** §6 (new no-record paragraph), §7 (None-skip clause), §9 -(write bullet). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md deleted file mode 100644 index a5b4f3a61..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-7.md +++ /dev/null @@ -1,36 +0,0 @@ -# Reply 7: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-7.md`](wyckoff-letter-detection_review-7.md). -The single finding is accepted and addressed. - -## [P2] Explicit letters for unsupported groups are undefined - -**Verdict:** Agree. - -**Decision.** Of the two options the review named, the ADR now chooses -**accept the letter verbatim** rather than reject. Rejecting would fail -to load an otherwise-valid CIF that carries a `Wyckoff_symbol` for a -setting we simply do not tabulate, and would block a legitimate Python -assignment — both are boundary inputs the public API and CIF loading -routinely produce, which the project's edge-case rule says to handle -gracefully, not refuse. - -**Action taken.** §8 now states that when the space group is absent from -the table its letters cannot be enumerated, so membership validation is -not applied: the validator accepts whatever the user or a CIF supplies. -Auto-detection stays a no-op, but an explicit letter (Python or CIF) is -stored verbatim, carries no `multiplicity` / `site_symmetry` (no record, -§6) and drives no symmetry constraints, and a `log.warning` records that -the group is untabulated and the letter could not be validated. The -rejected "validation error" alternative is documented inline. §3's -letter-edit bullet gained a cross-reference to §8 for this case. - -The four surfaces the finding worried about now agree for unsupported -groups: Python assignment and CIF loading both store the letter verbatim -(§3, §8, §9), allowed-value discovery does not restrict it (§8), and -derived-descriptor handling plus the calculator skip already cover the -no-record case (§6, §7, §9). - -**Pointer:** §8 (unsupported-group rule), §3 (letter-edit -cross-reference). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md deleted file mode 100644 index e83851cab..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-8.md +++ /dev/null @@ -1,40 +0,0 @@ -# Reply 8: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-8.md`](wyckoff-letter-detection_review-8.md). -The single finding is accepted and addressed. - -## [P2] Unsupported groups are still described as always empty - -**Verdict:** Agree. - -**Action taken.** Reply 7 added the "explicit letter on an unsupported -group is stored verbatim" path (§8), which made the older "unsupported → -empty" wording in §3 and §9 only half true. Split that case into its two -sub-cases in both sections: - -- **§3 opening** now says the unsupported-group exception splits in two: - auto-detection is a no-op, so _without_ an explicit letter the value - stays empty, while an _explicit_ Python/CIF letter is stored verbatim - (carrying no multiplicity, site symmetry, or constraints — §6). -- **§9 intro** now states the unsupported group splits — no explicit - letter stays empty, an explicit letter is written verbatim. -- **§9 write bullet** now says **any** non-empty letter is written - verbatim (whether detected for a supported group or supplied - explicitly for an unsupported one; only the latter has a `None` - multiplicity), and a letter serialises as CIF `?` only when it is - _neither_ detected _nor_ explicitly supplied — an unsupported group - with no user letter, or a transient pre-update state. - -The §9 read bullet already handled both (a present symbol loads as the -letter; an absent/`?` cell stays empty, and fill-if-empty is a no-op for -an unsupported group), so it needed no change. - -**Note (context, not a scope change):** the companion -[`space-group-database.md`](space-group-database.md) ADR — whose review -cycle has now closed — makes the bundled table complete for all 230 -groups, so in practice "unsupported group" shrinks to genuinely-exotic -settings (and transient pre-update states). The split wording above is -what keeps those residual cases well-defined. - -**Pointer:** §3 (opening), §9 (intro and write bullet). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md deleted file mode 100644 index 9bfdb8c2d..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_reply-9.md +++ /dev/null @@ -1,29 +0,0 @@ -# Reply 9: Automatic Wyckoff Position Detection - -Reply to -[`wyckoff-letter-detection_review-9.md`](wyckoff-letter-detection_review-9.md). -The single finding is accepted and addressed. - -## [P2] No-record descriptors still imply an empty letter - -**Verdict:** Agree. - -**Action taken.** §6 said the empty `multiplicity` / `site_symmetry` -descriptors "follow the letter's empty state in lockstep," which is -wrong for the §8 path where an unsupported group carries a non-empty -explicit letter but still has no `WyckoffPosition` record. Rephrased -both spots so the derived state tracks **record availability**, not -letter emptiness: - -- **§6** now states the empty descriptors follow record availability, - not the letter: a no-record site has empty `multiplicity` / - `site_symmetry` whether its letter is empty or a non-empty unvalidated - explicit value (§8). The no-record causes now read "an unsupported - space group (with or without an explicit letter), or a transient empty - letter." -- **Testing** (CIF round-trip bullet) now says an unsupported-group row - keeps empty `multiplicity` / `site_symmetry` whether its letter is - empty or an explicit value that round-trips verbatim, instead of - "stays empty." - -**Pointer:** §6 (no-record paragraph); Testing (CIF round-trip bullet). diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md deleted file mode 100644 index 476c2a048..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-1.md +++ /dev/null @@ -1,78 +0,0 @@ -# Review 1: Automatic Wyckoff Position Detection - -## Findings - -### [P1] Persisting resolved letters loses auto-mode semantics - -The ADR defines auto mode as "provided marker false" and says auto-mode -letters re-detect after user edits, but the CIF write/read contract -materialises every resolved `_atom_site.Wyckoff_symbol` and then treats -any present symbol as explicit on reload (`wyckoff-letter-detection.md`, -sections 3, 4, and 9). That means a project saved while an atom is in -auto mode reloads with the same letter value but different behaviour: -future coordinate edits no longer re-detect the letter. This conflicts -with the persisted-state restore requirement and with the compatibility -claim that saved projects reload to the same model state. The ADR needs -to decide whether project persistence stores the auto/provided marker -separately, or whether save intentionally collapses auto-derived letters -into explicit letters and documents that behavioural change. - -### [P1] Empty string cannot both mean auto and explicit assignment - -Section 3 makes the empty `wyckoff_letter` value the auto sentinel, but -also says any API assignment marks the letter as provided. With that -contract, a user who previously set an explicit letter has no documented -way to clear it and return the site to auto mode: assigning -`atom.wyckoff_letter = ''` would set the provided marker true while -leaving the value empty, so detection would remain disabled and the -current "skip constraints" path would persist. The ADR should define the -public reset behaviour explicitly, for example by making assignment of -the empty sentinel clear the provided marker, or by adding a named -method/property for returning to auto mode. - -### [P2] No-code space groups need an explicit key normalisation rule - -Sections 2 and 8 describe direct `SPACE_GROUPS[(IT_number, coord_code)]` -lookups and use `P 1` as the example of a missing coordinate-system -code. In the current model, however, `SpaceGroup` represents -no-coordinate-code groups as the empty string because -`_it_coordinate_system_code_allowed_values` returns `codes or ['']` -(`src/easydiffraction/datablocks/structure/categories/space_group/default.py`). -The bundled table uses `None` keys for at least the no-code triclinic -groups, so an implementation that follows the ADR literally will look up -`(1, '')`, miss the tabulated `(1, None)` entry, and expose only the -empty sentinel instead of the real `a` Wyckoff position. The ADR should -state whether detection and allowed-letter discovery normalise `''` to -`None`, or intentionally treat no-code groups as unsupported despite the -packaged table containing them. - -### [P2] CIF presence tracking is underspecified for the marker - -Section 9 depends on distinguishing a present -`_atom_site.Wyckoff_symbol` from an absent one so the provided marker -can be set correctly. The generic CIF loader currently sets descriptor -values directly from loop cells and sets missing tags to descriptor -defaults in `category_collection_from_cif` -(`src/easydiffraction/io/cif/serialize.py`); it does not surface tag -presence to `AtomSite` or call a marker-aware setter. Without a specific -hook, a plan can easily mark defaulted missing values as user-provided, -or fail to mark present values as explicit. The ADR should name the -intended loading hook or item-level override that owns this boundary -case. - -### [P3] The auto-fill path names an API that does not exist - -Section 3 says auto-fill writes through `set_value_directly`, but the -current descriptor API exposes the public `value` setter plus private -paths such as `_set_value_from_minimizer`; there is no -`set_value_directly` symbol in `src/easydiffraction/core/variable.py`. -Because this write is central to avoiding a false "provided" marker, the -ADR should specify the actual private mutator to add or use, preferably -with a name tied to this derived-state update rather than the minimizer -path. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md deleted file mode 100644 index 5f1b2f1fd..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-10.md +++ /dev/null @@ -1,11 +0,0 @@ -# Review 10: Automatic Wyckoff Position Detection - -**No findings. Ready to commit.** - -The review-9 finding was addressed: no-record derived descriptor state -now follows `WyckoffPosition` record availability rather than letter -emptiness, including the unsupported-group explicit-letter case. - -Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source -review only; no tests, `pixi run fix`, `pixi run check`, or other -verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md deleted file mode 100644 index a800ee5f0..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-11.md +++ /dev/null @@ -1,48 +0,0 @@ -# Review 11: Automatic Wyckoff Position Detection - -## Findings - -### [P1] `space_group_Wyckoff` still has unresolved structural decisions - -The ADR now introduces `space_group_Wyckoff` as a new read-only, -auto-populated `CategoryOwner` sibling category, but then leaves its -implementation-critical choices open: whether the loop is persisted or -report-only, whether the row key is `_space_group_Wyckoff.id` or -`letter`, how `add()` / `create()` are blocked, and what update priority -rebuilt-from-space-group categories need (`wyckoff-letter-detection.md` -386-412). These are not just implementation details. Current -`CategoryOwner._serializable_categories()` serialises every owned -category by default, current `CategoryCollection` exposes mutating -`__setitem__` / `remove` paths in addition to any subclass `add()` / -`create()`, and `loop-category-key-identity.md` requires every concrete -loop collection to have a documented key field that normally serialises. - -Please settle these decisions in the ADR before it is accepted: choose -whether `space_group_Wyckoff` is persisted, report-only, or explicitly -excluded from project CIF; choose and justify the collection key; and -state the read-only collection mechanism at the category/collection API -level, not only item `add()` / `create()`. Otherwise two implementers can -both follow the ADR and produce incompatible public/CIF behaviour. - -### [P2] Stale atom-site `site_symmetry` wording remains - -The updated ADR correctly says the site-symmetry symbol is **not** an -atom-site quantity and belongs in `space_group_Wyckoff` -(`wyckoff-letter-detection.md` 266-289). But earlier/later text still -reads like `site_symmetry` is an atom-site descriptor: the dataclass -motivation says it fills "the letter, multiplicity, and site-symmetry -descriptors" (`wyckoff-letter-detection.md` 97-101), and the Related ADR -entry for `guarded-public-properties.md` says "read-only `multiplicity` -and `site_symmetry` (getter only)" (`wyckoff-letter-detection.md` -561-562). That stale wording risks reintroducing the older -`AtomSite.site_symmetry` design that review 5 on the plan just rejected. - -Please reword those passages so `multiplicity` is the atom-site -descriptor, while `site_symmetry` is the read-only descriptor on -`space_group_Wyckoff` rows. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md deleted file mode 100644 index f7dd280d7..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-12.md +++ /dev/null @@ -1,70 +0,0 @@ -# Review 12: Automatic Wyckoff Position Detection - -## Findings - -### [P1] Detected letters can still snap through the wrong orbit representative - -The ADR correctly says the database stores the **full orbit** for each -Wyckoff position and that detection tests membership in every orbit -template (`wyckoff-letter-detection.md` 49-58, 87-92). But the snapping -decision still delegates to the "existing constraint step" after only the -letter is stored (`wyckoff-letter-detection.md` 239-240), while the -current constraint helper reads only `coords_xyz[0]` for that letter -(`crystallography.py` 177-218). That leaves a silent corruption path: -for Pm-3m `6e`, a coordinate near `(0,x,0)` can be correctly detected as -letter `e`, then `_get_wyckoff_exprs()` applies the first template -`(x,0,0)`, treats `y` and `z` as fixed, and snaps the atom toward -`(0,0,0)` instead of the matched orbit representative. - -Please make the ADR settle how coordinate snapping and constrained-axis -flags choose the orbit representative. The implementation needs either -the matched/nearest template returned with the detection result or a -separate helper that selects the nearest template for an already-known -letter before snapping. The tests should include a non-first -representative, plus the explicit-letter path, so an implementer cannot -follow the ADR and leave the current `coords_xyz[0]` behavior in place. - -### [P1] Space-group and setting edits do not trigger redetection - -The ADR makes the Wyckoff letter, multiplicity, and -`space_group_Wyckoff` table depend on the current space-group key, but -the trigger/baseline design only tracks coordinate changes -(`wyckoff-letter-detection.md` 151-227). A public edit to -`structure.space_group.name_h_m` or -`structure.space_group.it_coordinate_system_code` marks the structure -dirty, yet the atom coordinates can be unchanged, so fill-if-empty is a -no-op and the coordinate baseline does not force re-detection. The result -can be a stale letter from the old group: it may be invalid in the new -group, or worse, still be a valid letter with different multiplicity, -site symmetry, or constrained coordinates. - -Please define the space-group-change path explicitly. For example, record -the `(name_hm, coord_code)` key alongside the coordinates used for the -last detection, and re-detect/re-derive all atom-site Wyckoff values when -that key changes. The ADR also needs to settle the warning and -unsupported-group behavior for transitions into an untabulated group, -because without an auto/provided marker the old stored letter may be a -previously detected value rather than an explicit user value. - -### [P2] Same-letter coordinate snaps are still silent - -The ADR says neither the letter nor the coordinates change silently after -a user edit and that lenient matching movement is surfaced by a warning -(`wyckoff-letter-detection.md` 241-248, 437-439). The listed warnings do -not cover a common case: the user edits a coordinate, detection keeps the -same letter because the point is still within tolerance, and the -constraint pass snaps the coordinate back to the exact special value. In -that path the coordinate changes but the letter does not, so the -"letter changed" warning never fires. - -Please either add a warning for any user coordinate edit whose constraint -snap changes stored coordinates, or narrow the ADR text so it no longer -claims this movement is surfaced. Given the project audience and the -critical-software guidance in `AGENTS.md`, warning on user-edited -coordinate movement seems like the safer policy. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md deleted file mode 100644 index f9d4ecc1d..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-13.md +++ /dev/null @@ -1,46 +0,0 @@ -# Review 13: Automatic Wyckoff Position Detection - -## Findings - -### [P2] Unsupported-group stored letters are still described as explicit-only - -Reply 12 added the right policy for a space-group change into an -unsupported key: preserve any existing stored letter verbatim, even when -that letter was previously auto-detected, because there is no -auto/provided marker (`wyckoff-letter-detection.md` 193-204, 247-253). -Several later passages still describe the unsupported non-empty-letter -case as only an explicit Python/CIF input. Section 3's opening split says -"without an explicit letter" stays empty while an "explicit Python/CIF -letter" is stored (`wyckoff-letter-detection.md` 170-176). The CIF write -rules say any non-empty unsupported letter is written when it was -"supplied explicitly" and that "only the latter" carries `None` -multiplicity (`wyckoff-letter-detection.md` 412-419), which is now false -for a preserved auto-detected letter after a supported-to-unsupported -space-group edit. The CIF round-trip test bullet has the same explicit- -only framing (`wyckoff-letter-detection.md` 577-580). - -Please reword those passages around **stored non-empty letters** rather -than **explicit letters**: unsupported groups with no stored letter stay -empty; unsupported groups with any stored letter, whether explicit or -preserved from a previous supported key, write it verbatim and carry -`None` multiplicity. That keeps §3, §4, §8, §9, and Testing aligned. - -### [P2] The trigger summary still says only coordinates re-detect - -The new space-group-key trigger is clear earlier in §3 and §4, but the -closing paragraph of §4 still says a user-set letter is "never silently -overwritten by an internal recompute" and that "only a real change in the -stored coordinates re-detects" (`wyckoff-letter-detection.md` 255-263). -That now contradicts the accepted Review-12 fix: a real change in the -stored `(name_hm, coord_code)` key also re-detects and may overwrite a -user-set letter for a supported new key. - -Please update that paragraph so the excluded minimizer/same-pass-snap -paths remain clear while the final trigger summary includes both later -coordinate edits and later space-group-key edits. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md deleted file mode 100644 index 5d700baaf..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-14.md +++ /dev/null @@ -1,28 +0,0 @@ -# Review 14: Automatic Wyckoff Position Detection - -## Findings - -### [P2] Two unsupported-letter passages still say explicit-only - -Review 13's main issue is mostly fixed, but two nearby passages still use -the old explicit-only framing. The no-record paragraph in §6 says a -non-empty no-record letter is a "non-empty unvalidated explicit value" -(`wyckoff-letter-detection.md` 301-313). After the Review-12/13 policy, -that value may also be a previously detected letter preserved when the -space-group key changed into an unsupported one. Section 8 similarly says -the unsupported path stores "an explicit letter" and "such a letter" -carries no multiplicity (`wyckoff-letter-detection.md` 383-393), while -the same no-record behavior also applies to preserved stored letters. - -Please update those two passages to use the same "stored non-empty -letter" wording now used in §3 and §9. The implementation-facing rule -should be one rule everywhere: when no `WyckoffPosition` record is -available, multiplicity is `None` and constraints are skipped whether the -stored letter came from Python/CIF input or was preserved from a previous -supported key. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md deleted file mode 100644 index 4974a8d28..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-15.md +++ /dev/null @@ -1,29 +0,0 @@ -# Review 15: Automatic Wyckoff Position Detection - -## Findings - -### [P2] Compatibility still says explicit-letter projects are unaffected - -The ADR now intentionally changes the explicit-letter snapping path for -non-first orbit representatives: explicit-letter snapping must choose the -nearest representative rather than `coords_xyz[0]` -(`wyckoff-letter-detection.md` 136-144, 557-561). That is the right -decision, but the Compatibility Outcomes still say projects that already -specify every Wyckoff letter are "unaffected" and "produce identical -constraints" (`wyckoff-letter-detection.md` 501-504). That is no longer -strictly true for an existing project whose explicit letter is paired -with coordinates on a non-first representative, such as Pm-3m `6e` -`(0,x,0)`: the new behavior deliberately fixes the current -`coords_xyz[0]` snap. - -Please soften that compatibility claim. A more accurate outcome is that -explicit letters remain respected and reload verbatim, while constraints -are unchanged except where the current first-representative shortcut was -wrong for coordinates on a different representative. That makes the -intended compatibility surface clear without hiding the bug fix. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md deleted file mode 100644 index 60b3b3f97..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-16.md +++ /dev/null @@ -1,12 +0,0 @@ -# Review 16: Automatic Wyckoff Position Detection - -**No findings. Ready to commit.** - -The review-15 compatibility finding is addressed: explicit letters remain -respected and reload verbatim, while the only called-out constraint change -is the intentional nearest-representative fix for coordinates that were -previously snapped through the first table representative. - -Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source -review only; no tests, `pixi run fix`, `pixi run check`, or other -verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md deleted file mode 100644 index 421e0bc55..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-2.md +++ /dev/null @@ -1,36 +0,0 @@ -# Review 2: Automatic Wyckoff Position Detection - -## Findings - -### [P1] The auto-mode invariant contradicts detected letters - -The updated §3 now says `empty value ⟺ auto (provided = False)`, but the -same section also says auto mode re-derives the letter and writes the -detected non-empty value through `_set_wyckoff_letter_detected()`. Those -two rules cannot both be true: after a successful auto-detection, an -auto-mode atom must have `provided = False` and a non-empty -`wyckoff_letter.value`, because calculators, constraints, displays, and -exports consume the resolved value. The invariant should be about the -provided marker, not the stored descriptor value. Please rephrase §3 so -the empty assignment is the public reset command, while auto mode itself -can hold either an empty unresolved value or a non-empty detected value. - -### [P2] Project CIF needs a row-level rule for mixed auto/explicit loops - -The revised §9 says project CIF writes `_atom_site.Wyckoff_symbol` only -for provided letters and writes "no symbol" for auto-mode atoms. CIF -loops are columnar, so if one atom in an atom-site loop has an explicit -symbol, every row in that loop still needs a cell for that tag. The -current project serializer also routes atom-site loops through the -ADP-family loop path in `serialize.py`, which emits the same parameter -columns for every row. The ADR should define the concrete row-level -encoding: for example, auto rows write the CIF null token (`?` or `.`) -when the column is present, and the column is omitted only when no row -in that emitted loop has a provided letter. That keeps the read-side -"non-empty loaded value means explicit" rule implementable. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md deleted file mode 100644 index c0c4ef150..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-3.md +++ /dev/null @@ -1,11 +0,0 @@ -# Review 3: Automatic Wyckoff Position Detection - -**No findings. Ready to commit.** - -The review-2 findings were addressed: the auto/provided marker is now -distinct from the stored detected value, and project CIF writes now have -a concrete columnar rule for mixed auto/explicit atom-site loops. - -Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source -review only; no tests, `pixi run fix`, `pixi run check`, or other -verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md deleted file mode 100644 index 0e7b78cab..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-4.md +++ /dev/null @@ -1,41 +0,0 @@ -# Review 4: Automatic Wyckoff Position Detection - -## Findings - -### [P1] Live descriptor edits can bypass re-detection - -Sections 3 and 4 make "public coordinate setter" edits the trigger for -re-detecting an existing Wyckoff letter. In the current public API, -however, `atom.fract_x` returns the live `Parameter`, and assigning -`atom.fract_x.value = ...` is also a normal public edit path. That path -goes through `GenericDescriptorBase.value`, marks the owner dirty, and -does not call the `AtomSite.fract_x` property setter. If implementation -follows the ADR literally, `atom.fract_x = 0.1` would re-detect but -`atom.fract_x.value = 0.1` would leave a stale non-empty -`wyckoff_letter`, because the fill-if-empty update path is a no-op once -the letter is populated. The ADR should state that **all public -coordinate value edits**, including live descriptor `.value` assignment, -are user coordinate edits for this purpose, or choose an update-flow -change-tracking mechanism that covers both property assignment and -descriptor-value assignment while still excluding minimizer and symmetry -constraint writes. - -### [P2] Unsupported groups contradict "always concrete" CIF writes - -The revised decision says the `wyckoff_letter` descriptor holds a -concrete value at all times and that project CIF always emits the -resolved `_atom_site.Wyckoff_symbol` for every atom. Section 8 still -preserves the unsupported-space-group path: when the space group is -absent from `SPACE_GROUPS`, only the empty placeholder is allowed, -detection is a no-op, and the site keeps no letter. Those two rules -conflict. An implementation needs a defined behaviour for genuinely -unsupported groups and for any pre-update transient empty value: should -project CIF write `?`, omit the column, or fail with a clear error? The -ADR should qualify "always concrete" and the §9 write rule so this -boundary case is explicit rather than left to the serializer default. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md deleted file mode 100644 index 82ce89e4e..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-5.md +++ /dev/null @@ -1,27 +0,0 @@ -# Review 5: Automatic Wyckoff Position Detection - -## Findings - -### [P2] Empty-letter sites need derived descriptor semantics - -Review 4 resolved how an unsupported space group serialises the -`wyckoff_letter`: detection is a no-op, the letter stays empty, and CIF -writes `?`. The ADR still does not define what happens to the derived -`multiplicity` and `site_symmetry` descriptors in that same path. -Section 6 says they are populated from a `WyckoffPosition` record, but -unsupported groups and transient empty letters have no such record; §7 -then replaces cryspy's private lookup with -`atom_site.multiplicity.value`, and §9 says project CIF emits -`_atom_site.site_symmetry_multiplicity` derived from the model -multiplicity. An implementation needs a clear contract for the no-record -case: for example, multiplicity/site symmetry become empty/`None`, CIF -writes `?` for multiplicity, and calculators skip over the missing value -instead of writing it into backend arrays. Without that rule, the -unsupported-group escape hatch is only defined for the letter, not for -the model values that now depend on it. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md deleted file mode 100644 index 4541b3689..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-6.md +++ /dev/null @@ -1,11 +0,0 @@ -# Review 6: Automatic Wyckoff Position Detection - -**No findings. Ready to commit.** - -The review-5 finding was addressed: empty-letter sites now have explicit -derived descriptor semantics, CIF output, and calculator handling for -the no-`WyckoffPosition` case. - -Checks skipped per `AGENTS.md` review-shortcut rules: static ADR/source -review only; no tests, `pixi run fix`, `pixi run check`, or other -verification commands were run. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md deleted file mode 100644 index fcd1599c9..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-7.md +++ /dev/null @@ -1,26 +0,0 @@ -# Review 7: Automatic Wyckoff Position Detection - -## Findings - -### [P2] Explicit letters for unsupported groups are undefined - -Sections 3 and 9 say a user-set letter is applied as-is and a present -`_atom_site.Wyckoff_symbol` is loaded as the letter. Section 8 says that -when the space group is absent from `SPACE_GROUPS`, only the empty -placeholder is allowed, detection is a no-op, and the site keeps no -letter. Those rules conflict for boundary input the public API can -produce: a user can set `atom.wyckoff_letter = 'a'` after choosing an -unsupported group, or load a CIF that contains a Wyckoff symbol for a -group not present in the bundled table. The ADR should explicitly choose -the behaviour for this case — for example, reject the explicit letter -with a clear validation error, or allow the stored letter while leaving -`multiplicity` / `site_symmetry` empty and skipping calculator -multiplicity overrides. Without that decision, implementation can -accidentally make Python assignment, CIF loading, allowed-value -discovery, and derived descriptor handling disagree. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md deleted file mode 100644 index 5e7f6ef05..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-8.md +++ /dev/null @@ -1,26 +0,0 @@ -# Review 8: Automatic Wyckoff Position Detection - -## Findings - -### [P2] Unsupported groups are still described as always empty - -Reply 7 chose the right policy for unsupported groups: auto-detection is -a no-op, but an explicit Python/CIF letter is stored verbatim and -carries no derived record. The ADR still has broad wording that -contradicts that policy. Section 3 says that when the group is absent -from `SPACE_GROUPS`, "the letter stays empty"; §9 says "the one empty -case (an unsupported group)" and describes "an empty letter — an -unsupported space group". Those statements are only true for unsupported -groups with no explicit letter. They are false for the new -explicit-letter path in §8, where an unsupported group may have a -non-empty stored letter. Please qualify the §3 and §9 wording so -unsupported groups split into two cases: no explicit letter stays empty -/ serialises as `?`, while an explicit letter is stored and written -verbatim but has no multiplicity, site symmetry, or symmetry -constraints. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md deleted file mode 100644 index e0f0a5183..000000000 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection_review-9.md +++ /dev/null @@ -1,24 +0,0 @@ -# Review 9: Automatic Wyckoff Position Detection - -## Findings - -### [P2] No-record descriptors still imply an empty letter - -Reply 8 correctly splits unsupported groups into empty/no-explicit and -non-empty/explicit-letter cases in §3 and §9. Section 6 still says the -empty `multiplicity` / `site_symmetry` descriptors "follow the letter's -empty state in lockstep." That is no longer true for an unsupported -group with an explicit Python/CIF letter: the stored letter is -non-empty, but there is still no `WyckoffPosition` record, so -multiplicity remains `None` and site symmetry remains empty. The Testing -section has the same minor drift in the CIF round-trip bullet, which -only says an unsupported-group row stays empty. Please rephrase these -spots so the derived descriptor state follows **record availability**, -not letter emptiness: no record means empty derived descriptors whether -the letter is empty or an unvalidated explicit value. - -## Checks skipped - -Per `AGENTS.md` review-shortcut rules, this was a static ADR/source -review only. I did not run tests, `pixi run fix`, `pixi run check`, or -other verification commands. diff --git a/docs/dev/plans/space-group-database.md b/docs/dev/plans/space-group-database.md index 81346acd6..fe2a4b93f 100644 --- a/docs/dev/plans/space-group-database.md +++ b/docs/dev/plans/space-group-database.md @@ -1,8 +1,7 @@ # Plan: Complete Space-Group Reference Database This plan follows [`AGENTS.md`](../../../AGENTS.md) and implements the -[`space-group-database`](../adrs/accepted/space-group-database.md) -ADR. +[`space-group-database`](../adrs/accepted/space-group-database.md) ADR. **Deliberate exception to note for `/draft-impl-1`:** Phase 1 contains a **maintainer-only curation gate** (P1.4). The disagreement report is diff --git a/docs/dev/plans/wyckoff-letter-detection.md b/docs/dev/plans/wyckoff-letter-detection.md new file mode 100644 index 000000000..2816224c1 --- /dev/null +++ b/docs/dev/plans/wyckoff-letter-detection.md @@ -0,0 +1,382 @@ +# Plan: Automatic Wyckoff Position Detection + +This plan follows [`AGENTS.md`](../../../AGENTS.md) and implements the +[`wyckoff-letter-detection`](../adrs/suggestions/wyckoff-letter-detection.md) +ADR. No deliberate exception to `AGENTS.md` is taken. + +## Status + +- [x] ADR review gate closed +- [ ] Phase 1 — Implementation (code + docs) +- [ ] Phase 1 review gate +- [ ] Phase 2 — Verification (tests + `pixi` checks) + +## ADR + +This plan implements the +[`wyckoff-letter-detection`](../adrs/suggestions/wyckoff-letter-detection.md) +ADR. The ADR review cycle previously closed at review 10, but the ADR +then changed to add the derived `space_group_Wyckoff` category and +space-group-key re-detection. That later ADR review cycle closed at +`wyckoff-letter-detection_review-16.md`, whose second non-blank line is +the final-review sentinel. The closed ADR text was committed as +`0f3bc269c` (`Finalize Wyckoff letter detection ADR`). + +Its prerequisite — the +[`space-group-database`](../adrs/accepted/space-group-database.md) ADR +(the complete, self-owned 230-group `SPACE_GROUPS` table) — is already +accepted and merged (PR #187), and its ADR promotion is already +committed on this branch (`c84183662`). No new dependency is introduced: +detection reuses `SPACE_GROUPS`, NumPy, and the existing +rotation/translation parser. + +## Branch and PR + +- Target implementation branch: `wyckoff-letter-detection` (off + `develop`; already exists and already carries the space-group ADR + promotion commit `c84183662`). +- Implementation shortcuts must stay on the current branch. Before + `/draft-impl-1` starts code work, verify + `git branch --show-current` is `wyckoff-letter-detection`. If it is + not, stop before editing and ask the user to switch to the target + branch outside the shortcut. This planning session is currently on + `plotting-docs-performance`, so implementation must not start from the + current branch. +- PR targets `develop` (not `master`). Scope label: + `[scope] enhancement` (adds a user-facing feature and closes #51). +- Do not push the branch until the user asks. + +## Decisions + +1. **EasyDiffraction owns the Wyckoff position.** The model owns the + atom-site Wyckoff letter and multiplicity, plus the per-space-group + site-symmetry table. Calculators consume these model values and never + re-derive them. +2. **Detection lives in `crystallography.py`.** Add + `detect_wyckoff_position(name_hm, coord_code, fract_xyz, tol=...)` + and + `wyckoff_position_info(name_hm, coord_code, letter, fract_xyz=None, tol=...)`, + returning a frozen + `WyckoffPosition(letter, multiplicity, site_symmetry, coord_template)`. + When coordinates are supplied, `coord_template` is the nearest + representative in the matched orbit and drives snapping/constraints. +3. **Orbit test.** Test `R·v + b ≡ p (mod 1)` with NumPy least-squares; + choose by `(multiplicity ascending, residual ascending)`; + same-multiplicity ties within `tol` log a warning. +4. **Coordinate-code normalisation.** A shared `_normalize_coord_code()` + maps the empty string `''` to `None` and is used by detection, allowed + letter discovery, `_get_wyckoff_exprs()`, and + `_get_general_position_ops()`. +5. **The atom-site letter is concrete for supported groups.** Missing + letters are filled on create/load, coordinate edits re-detect with a + warning when the letter changes, space-group / setting edits + re-detect all sites for supported new keys, and user letter edits + persist until a later coordinate edit or space-group-key edit. +6. **Detection triggers live in the atom-site update flow.** The flow + tracks both the coordinate baseline and the `(name_hm, coord_code)` + key used for each atom site's last Wyckoff derivation. Fill-if-empty, + later coordinate edits, and later supported space-group / setting + edits all derive from this one update path; unsupported key changes + preserve stored letters as unvalidated values. The currently unused + `called_by_minimizer` flag at `default.py:674` is honoured so + minimizer-driven updates skip re-detection. +7. **`AtomSite` gains only read-only `multiplicity`.** It carries the + `_atom_site.site_symmetry_multiplicity` CIF tag, has empty form + `None`, and tracks record availability rather than letter emptiness. + `site_symmetry` is **not** an `AtomSite` descriptor. +8. **`space_group_Wyckoff` owns site symmetry.** Add a derived, + read-only structure sibling category exposed as + `structure.space_group_wyckoff` with CIF category code + `space_group_Wyckoff`. It lists every Wyckoff position for the + current space group with `id` (e.g. `6e`), `letter`, `multiplicity`, + `site_symmetry`, and representative `coords_xyz`. +9. **`space_group_Wyckoff` identity and mutability.** The collection key + is `id`, serialized as `_space_group_Wyckoff.id`, because the letter + alone is not the CIF category key and `id` keeps the row identity + stable. Public mutation paths (`add`, `create`, `remove`, + `__setitem__`, `__delitem__`) raise `ValueError`, while a private + `_replace_from_space_group()` path rebuilds the derived collection + through internal adoption. +10. **`space_group_Wyckoff` serialization policy.** The category is + model-owned and report-facing, but not persisted in project CIF. + `Structure._serializable_categories()` excludes it from + `structure.as_cif` / project saves, the IUCr/report writer emits the + `_space_group_Wyckoff.*` loop from the derived category, and incoming + `_space_group_Wyckoff.*` values are ignored/overwritten on project + load because the category is re-derived from the space group. +11. **Allowed letters come from the current space group.** + `_wyckoff_letter_allowed_values` returns `['', *tabulated_letters]` + for supported groups and `[]` for absent groups. +12. **Unsupported-group validation is explicit.** The stock + `MembershipValidator` falls back on mismatch, so `_wyckoff_letter` + uses a dedicated permissive-when-empty validator: an empty allowed + set accepts explicit user/CIF letters verbatim, and the update flow + preserves any stored non-empty letter when a later space-group change + moves the site into an unsupported key. Those stored letters are + unvalidated, carry `None` multiplicity, skip constraints, and warn; + a non-empty allowed set enforces membership. A temporary no-parent + context during `atom_sites.create(..., wyckoff_letter=...)` is not + treated as unsupported: the raw letter is marked as requiring + context validation and is checked against the parent structure's + space group on the first parented update. +13. **CIF atom-site behaviour.** Project CIF writes + `_atom_site.Wyckoff_symbol` and + `_atom_site.site_symmetry_multiplicity` for every atom (`?` for + `None` multiplicity). Read loads the letter but ignores incoming + `site_symmetry_multiplicity` by re-populating multiplicity from the + resolved Wyckoff record during update. Unsupported groups write any + stored non-empty letter verbatim with `?` multiplicity. +14. **Tolerance.** `_WYCKOFF_DETECTION_TOL = 1e-3` is the default; a + user/project-level tolerance setting remains deferred. + +## Open questions + +- **Tolerance default.** `1e-3` is the ADR's starting point; it may be + tuned against the tutorial corpus during Phase 2. Not a blocker. + +## Concrete files likely to change + +Phase 1 (implementation): + +- `src/easydiffraction/crystallography/crystallography.py` — detection, + `WyckoffPosition` including the selected `coord_template`, + `_WYCKOFF_DETECTION_TOL`, `_normalize_coord_code`, and normalisation + adopted by `_get_wyckoff_exprs` / `_get_general_position_ops`; reuse + `_parse_rotation_matrix`. +- `src/easydiffraction/crystallography/__init__.py` — export the new + public names if they are part of the public surface. +- `src/easydiffraction/datablocks/structure/categories/atom_sites/default.py` + — read-only `multiplicity`, `_set_wyckoff_letter_detected`, dynamic + `_wyckoff_letter_allowed_values`, permissive unsupported-group + validator wiring, pending parent-context validation for + `create(wyckoff_letter=...)`, coordinate and space-group-key + baselines, update-flow detection triggers, and nearest-template + coordinate snapping. Do **not** add `site_symmetry` to `AtomSite`. +- `src/easydiffraction/datablocks/structure/categories/space_group_wyckoff/default.py` + — new `SpaceGroupWyckoff` item and read-only + `SpaceGroupWyckoffCollection` with `id`, `letter`, `multiplicity`, + `site_symmetry`, and `coords_xyz` descriptors plus private rebuild. +- `src/easydiffraction/datablocks/structure/categories/space_group_wyckoff/factory.py` + and `src/easydiffraction/datablocks/structure/categories/space_group_wyckoff/__init__.py` + — register/import the new concrete collection. +- `src/easydiffraction/datablocks/structure/item/base.py` — add the + `space_group_wyckoff` sibling category, expose it read-only, rebuild + it from the current `space_group` before ordinary category update + hooks, and exclude it from project CIF through + `_serializable_categories()`. +- `src/easydiffraction/analysis/calculators/cryspy.py` — + `_update_atom_multiplicity` reads `atom_site.multiplicity.value`. +- `src/easydiffraction/io/cif/serialize.py` — only if atom-site CIF read + needs an explicit post-load hook to ignore incoming + `_atom_site.site_symmetry_multiplicity`; avoid changing the ADP loop + path solely to omit `site_symmetry`. +- `src/easydiffraction/io/cif/iucr_writer.py` — emit + `_atom_site.site_symmetry_multiplicity` and the report-only + `_space_group_Wyckoff.*` loop. +- `docs/dev/issues/open.md` → `docs/dev/issues/closed.md` — move #51 and + remove the resolved TODOs at `default.py` ~200–211, ~225, ~569. +- `docs/dev/adrs/suggestions/wyckoff-letter-detection.md` → + `docs/dev/adrs/accepted/wyckoff-letter-detection.md` and + `docs/dev/adrs/index.md` — ADR promotion after the ADR review cycle + closes. + +Phase 2 (tests): + +- `tests/unit/easydiffraction/crystallography/test_crystallography_wyckoff.py` + (+ `_coverage.py` if needed) — matcher edge cases. +- `tests/unit/easydiffraction/datablocks/structure/categories/test_atom_sites.py` + — atom-site descriptor/update-flow behaviours. +- `tests/unit/easydiffraction/datablocks/structure/categories/test_space_group_wyckoff.py` + — derived category rows, read-only mutation paths, rebuild on space + group change, absent-group emptiness, and project-CIF exclusion. +- A tutorial-corpus regression check (functional/script level) that + strips each declared letter and asserts re-detection reproduces it. + +## Implementation steps (Phase 1) + +Code and docs only — **no tests in Phase 1** (they belong to Phase 2). +When an AI agent executes this plan, **every completed step below must +be staged with explicit paths (`git add …`) and committed locally +before moving to the next step or the Phase 1 review gate**, per +`AGENTS.md` §Commits. Keep each commit atomic and aligned with its step. +The ADR commit + design-phase review/reply cleanup are handled by +`/draft-impl-1` Phase A before P1.1. + +- [ ] **P1.0 — Re-close the ADR review gate.** No code. Ensure + `git branch --show-current` is `wyckoff-letter-detection`; if not, + stop before editing and ask the user to switch to the target branch + outside the shortcut. Then ensure + `wyckoff-letter-detection_review-16.md` remains the latest ADR + review and has the final-review sentinel. If any newer ADR review + appears before implementation, update this plan and re-review it + before P1.1. + Commit: `Confirm wyckoff letter detection ADR gate` +- [ ] **P1.1 — Orbit matcher in the crystallography submodule.** Add to + `crystallography.py`: frozen + `WyckoffPosition(letter, multiplicity, site_symmetry, coord_template)`, + `_WYCKOFF_DETECTION_TOL = 1e-3`, `_normalize_coord_code()`, + `detect_wyckoff_position(...)`, and `wyckoff_position_info(...)`. + Match all representatives in an orbit, choose by lowest + multiplicity then nearest residual, and return the selected + representative template for snapping. Make `_get_wyckoff_exprs` + and `_get_general_position_ops` use `_normalize_coord_code`. + Export new public names via `crystallography/__init__.py` if + public. + Commit: `Add Wyckoff orbit detection to crystallography module` +- [ ] **P1.2 — Derived `space_group_wyckoff` category.** Add the + `space_group_wyckoff` package with a `SpaceGroupWyckoff` item + keyed by `id` (`_space_group_Wyckoff.id`) and read-only + descriptors for `id`, `letter`, `multiplicity`, `site_symmetry`, + and `coords_xyz`. Add `SpaceGroupWyckoffCollection` with public + mutation methods raising and a private `_replace_from_space_group` + rebuild method that creates/adopts rows from `SPACE_GROUPS[key]`. + Commit: `Add derived space group Wyckoff category` +- [ ] **P1.3 — Wire `space_group_wyckoff` into `Structure`.** Add it as + a read-only sibling category on `Structure`, rebuild it when + structure categories update so it tracks the current space group, + keep it empty for absent groups, and exclude it from project CIF by + overriding `_serializable_categories()`. Rebuild it from + `Structure._update_categories()` before ordinary category update + hooks, with no special `_update_priority`; atom-site detection reads + `SPACE_GROUPS` through the crystallography helpers rather than + depending on this collection. + Commit: `Wire derived Wyckoff table into Structure` +- [ ] **P1.4 — Read-only multiplicity + detection mutator on + `AtomSite`.** Add only `multiplicity` as a read-only derived + descriptor on `AtomSite` with `CifHandler` for + `_atom_site.site_symmetry_multiplicity`, empty form `None`, and no + public setter. Add `_set_wyckoff_letter_detected()` modelled on + `_set_value_from_minimizer`. Do not add `site_symmetry` to + `AtomSite`. + Commit: `Add read-only multiplicity to AtomSite` +- [ ] **P1.5 — Dynamic allowed letters + unsupported-group validation.** + Make `_wyckoff_letter_allowed_values` return + `['', *list(SPACE_GROUPS[key]['Wyckoff_positions'])]` for a + supported group and `[]` for an absent one. Add the + permissive-when-empty Wyckoff-letter validator so explicit + unsupported-group letters are stored verbatim, and so later + supported-to-unsupported transitions can preserve stored non-empty + letters as unvalidated values with a warning. When a public + `atom_sites.create(..., wyckoff_letter=...)` call sets the letter + before parent context exists, store the raw value with a private + "needs context validation" marker instead of treating missing + context as an unsupported group. + Commit: `Derive allowed Wyckoff letters from the space group` +- [ ] **P1.6 — Detection triggers in the atom-site update flow.** In + `_update(*, called_by_minimizer=False)`, implement fill-if-empty, + re-detect-on-coordinate-change, and re-detect-on-space-group-key + change with per-atom coordinate and `(name_hm, coord_code)` + baselines. First resolve any pending no-parent-context + `wyckoff_letter` value: for a supported key, validate it against + the parent structure's allowed letters and raise `ValueError` if it + is invalid; for an unsupported key, keep it as an unvalidated + stored letter. For supported keys, refresh letter, multiplicity, + and selected representative; for unsupported keys, preserve stored + letters as unvalidated values, set multiplicity to `None`, skip + constraints, and warn. Use the selected `coord_template` for + snapping and constrained-axis flags. Warn when coordinate or + supported space-group edits move the letter, when a user letter-set + snaps coordinates, and when a same-letter coordinate edit snaps + coordinates. Honour `called_by_minimizer=True`; populate + `multiplicity` from `wyckoff_position_info`. Site-symmetry display + data comes from `structure.space_group_wyckoff`, not from + `AtomSite`. + Commit: `Detect and track Wyckoff letters in the update flow` +- [ ] **P1.7 — Calculator consumes model multiplicity.** Replace the + `SPACE_GROUPS` lookup in `cryspy._update_atom_multiplicity` with + `atom_site.multiplicity.value`; when it is `None`, leave the + backend's inferred multiplicity in place. + Commit: `Read multiplicity from the model in the cryspy calculator` +- [ ] **P1.8 — CIF and report output.** Ensure project CIF writes + `_atom_site.Wyckoff_symbol` and + `_atom_site.site_symmetry_multiplicity` but excludes the derived + `space_group_Wyckoff` loop. Ensure read ignores incoming + `_atom_site.site_symmetry_multiplicity` by re-deriving + multiplicity during update, and ignores/overwrites incoming + `_space_group_Wyckoff.*` values because the category is derived + from the space group. Extend IUCr/report output with + `_atom_site.site_symmetry_multiplicity` and the report-only + `_space_group_Wyckoff.{id,letter,multiplicity,site_symmetry,coords_xyz}` + loop. + Commit: `Serialize Wyckoff multiplicity and report Wyckoff table` +- [ ] **P1.9 — Promote ADR, close #51, remove stale TODOs.** `git mv` + `wyckoff-letter-detection.md` from `suggestions/` to `accepted/`, + set `**Status:** Accepted`, flip its `docs/dev/adrs/index.md` row + to `Accepted`, and fix links with `git grep -n`. Move issue #51 + from `open.md` to `closed.md` and delete the resolved TODOs in + `default.py` (~200–211, ~225, ~569). + Commit: `Promote wyckoff-letter-detection ADR and close issue #51` +- [ ] **P1.10 — Phase 1 review gate.** No code. Mark this `[x]`, commit + the checklist update alone, then stop for the Phase 1 review. + Commit: `Reach Phase 1 review gate` + +## Phase 2 — Verification + +Add/update tests (per the ADR _Testing_ section), then run the checks. +Stop after Phase 1 for review before starting Phase 2. + +Tests to add or update: + +- **Tutorial-corpus regression** (functional/script level): for each + `docs/docs/tutorials/*.py` structure with a declared letter, strip it + and assert `detect_wyckoff_position` reproduces the declared letter. +- **Targeted crystallography unit tests** in + `tests/unit/easydiffraction/crystallography/test_crystallography_wyckoff.py`: + general vs special positions and the `(multiplicity, residual)` + tie-break; non-first orbit representatives, including auto-detection + and explicit-letter lookup selecting the nearest representative rather + than `coords_xyz[0]`; rounded inputs (`0.3333→1/3`, `0.4999→1/2`) at + `1e-3`; `''`→`None` normalisation; genuinely absent group returns no + record. +- **Atom-site behaviours** in + `tests/unit/easydiffraction/datablocks/structure/categories/test_atom_sites.py`: + fill-if-empty on create/load; re-detect via both `atom.fract_x = …` + and `atom.fract_x.value = …` with the warning; user letter override + with the snap warning; `atom_sites.create(..., wyckoff_letter=...)` + validating against the parent structure once context exists; same-letter + coordinate edits whose snap moves stored coordinates; supported + space-group / setting edits re-detecting all atom sites; unsupported + space-group transitions preserving stored non-empty letters as + unvalidated values with `None` multiplicity; minimizer leaves the + letter fixed; no-record contract (`None` multiplicity, `?` in CIF, + calculator skip); CIF round-trip stability. +- **`space_group_wyckoff` behaviours** in + `tests/unit/easydiffraction/datablocks/structure/categories/test_space_group_wyckoff.py`: + auto-populates from `SPACE_GROUPS`, uses `id` keys, preserves + site-symmetry dots verbatim, rebuilds when the space group changes, + refuses all public mutation paths, stays empty for absent groups, is + omitted from project CIF, and appears in report/IUCr output if that + output is generated. + +Verification commands (capture logs with the zsh-safe pattern when +output is needed for analysis): + +``` +pixi run fix +pixi run test-structure-check > /tmp/easydiffraction-test-structure.log 2>&1; test_structure_exit_code=$?; tail -n 50 /tmp/easydiffraction-test-structure.log; exit $test_structure_exit_code +pixi run check > /tmp/easydiffraction-check.log 2>&1; check_exit_code=$?; tail -n 200 /tmp/easydiffraction-check.log; exit $check_exit_code +pixi run unit-tests > /tmp/easydiffraction-unit.log 2>&1; unit_tests_exit_code=$?; tail -n 100 /tmp/easydiffraction-unit.log; exit $unit_tests_exit_code +pixi run integration-tests > /tmp/easydiffraction-integration.log 2>&1; integration_exit_code=$?; tail -n 100 /tmp/easydiffraction-integration.log; exit $integration_exit_code +pixi run script-tests > /tmp/easydiffraction-script.log 2>&1; script_tests_exit_code=$?; tail -n 100 /tmp/easydiffraction-script.log; exit $script_tests_exit_code +``` + +`pixi run fix` regenerates `docs/dev/package-structure/{full,short}.md` +automatically — include those in the fix commit; never edit by hand. +`pixi run check` already runs `test-structure-check` among its +pre-commit hooks; the standalone line above gives an early, focused +signal that the new unit tests mirror the source tree (`AGENTS.md` +§Testing, review-2 [P2]). + +## Suggested Pull Request + +**Title:** Detect Wyckoff positions automatically from coordinates + +**Description:** When you build or load a crystal structure, +EasyDiffraction can work out each atom site's Wyckoff letter and +multiplicity from its coordinates and the space group. The full +space-group Wyckoff table is also available as a read-only derived +category, including site-symmetry symbols with their International +Tables notation. Existing projects and CIF files keep their supplied +letters, unsupported groups can still preserve stored letters safely, +and the same multiplicity is used consistently across calculators and +reports. From 1aeef1ef07db3bbc2a215250a4bc5d62032f59bd Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 19:21:52 +0200 Subject: [PATCH 25/50] Add match to resolver test pytest.raises (PT011) --- tests/unit/easydiffraction/utils/test_environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/easydiffraction/utils/test_environment.py b/tests/unit/easydiffraction/utils/test_environment.py index 14f6d7f08..d74d40025 100644 --- a/tests/unit/easydiffraction/utils/test_environment.py +++ b/tests/unit/easydiffraction/utils/test_environment.py @@ -157,7 +157,7 @@ def test_unknown_value_raises_with_details(self, monkeypatch): from easydiffraction.utils.environment import resolve_figure_embed_mode monkeypatch.setenv('EASYDIFFRACTION_FIGURE_EMBED_MODE', 'bogus') - with pytest.raises(ValueError) as exc_info: + with pytest.raises(ValueError, match='bogus') as exc_info: resolve_figure_embed_mode() message = str(exc_info.value) assert 'bogus' in message From 48939df732d8756dfc6f725677d2a607c3bf547c Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 19:24:17 +0200 Subject: [PATCH 26/50] Record Phase 2 verification results in plan --- docs/dev/plans/plotting-docs-performance.md | 36 +++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/docs/dev/plans/plotting-docs-performance.md b/docs/dev/plans/plotting-docs-performance.md index 419fad09d..def4c027d 100644 --- a/docs/dev/plans/plotting-docs-performance.md +++ b/docs/dev/plans/plotting-docs-performance.md @@ -312,15 +312,45 @@ and `docs/site/` untracked. For tutorial project-path collisions in - [x] Phase 1 complete (P1.1–P1.11 committed) - [ ] Phase 1 review cycle closed (`/review-impl-1` sentinel) -- [ ] Phase 2 tests added; `test-structure-check` + the five task - commands clean -- [ ] Docs build smoke passes; figures load lazily +- [x] Phase 2 tests added; `test-structure-check` + the five task + commands clean (see Verification results) +- [x] Docs build smoke passes; figures load lazily (ed-6 manual build) - [x] RequireJS decision applied (kept; removal deferred to browser-verified follow-up) - [ ] Phase 2 review cycle closed (`/review-impl-2` sentinel) - [ ] ADR promoted to `accepted/` and indexed - [ ] PR opened against `develop` +## Verification results (Phase 2) + +Run on the final Phase 2 state (commit `1aeef1ef0`): + +- `pixi run fix` — applied (deliverable files formatted). +- `pixi run test-structure-check` — **pass** (206/206 modules mirrored, + incl. the new `tests/unit/tools/` test). +- `pixi run check` — **pass for this change**: `pyproject`, `license`, + `py-lint`, `py-format`, `docstring`, `notebook-lint`, + `test-structure`, `unit-tests`, `functional-tests` all green. The only + failing hook is `nonpy-format-check`, and **every file it lists is an + unrelated untracked artifact** (the parallel Wyckoff review/reply + files and transient `_impl-*`/`_verify-*` deliberation files), not + part of this change — left untouched per `AGENTS.md` "leave unrelated + dirty files untouched". The deliverable files are prettier-clean. +- `pixi run unit-tests` — **1997 passed**. +- `pixi run functional-tests` — **70 passed**. +- `pixi run integration-tests` — **163 passed**. +- `pixi run script-tests` — **25 passed**. +- Trace-type audit — no WebGL/3D/map traces; `plotly-cartesian` + confirmed sufficient. +- Docs-build smoke — verified manually on `ed-6` (SHARED build: 3.4 MB / + 1.4 MB gzipped, single import map, lazy placeholders, text cells + present). A full all-notebook SHARED build was not re-run (each + notebook is a real fit; ed-6 is representative). + +**Environment-limited deferral:** RequireJS removal needs a browser +render check this environment cannot run, so `include_requirejs` is kept +(open question 2). + ## Suggested Pull Request **Title:** Faster, progressively-loading tutorial and documentation From b84201176b8ea5dab9e0b63ff6a8684e646261e2 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 19:29:19 +0200 Subject: [PATCH 27/50] Add plotting-docs-performance ADR index row --- docs/dev/adrs/index.md | 87 +++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/docs/dev/adrs/index.md b/docs/dev/adrs/index.md index 2175fa8e3..f14cb0be0 100644 --- a/docs/dev/adrs/index.md +++ b/docs/dev/adrs/index.md @@ -13,46 +13,47 @@ folders. ## ADR Index -| Group | Status | Title | Short description | Link | -| -------------------- | ---------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| Analysis and fitting | Accepted | Fit Mode Categories and Fit Execution API | Splits fitting configuration from execution and defines active sibling fit-mode categories. | [`fit-mode-categories.md`](accepted/fit-mode-categories.md) | -| Analysis and fitting | Accepted | Runtime Fit Results | Keeps full fit outputs runtime-only in the current design unless a narrower persistence ADR is accepted. | [`runtime-fit-results.md`](accepted/runtime-fit-results.md) | -| Analysis and fitting | Accepted | Analysis CIF Fit State | Defines the persisted fit-state projection in `analysis/analysis.cif` and `analysis/results.h5`. | [`analysis-cif-fit-state.md`](accepted/analysis-cif-fit-state.md) | -| Analysis and fitting | Accepted | Parameter Correlation Persistence | Persists deterministic and posterior correlation summaries in `_fit_parameter_correlation` | [`parameter-correlation-persistence.md`](accepted/parameter-correlation-persistence.md) | -| Analysis and fitting | Suggestion | Fit Output Files and Data Exports | Narrows remaining archive/export questions after adopting `results.csv` and `results.h5`. | [`fit-output-files-and-data-exports.md`](suggestions/fit-output-files-and-data-exports.md) | -| Analysis and fitting | Accepted | Minimizer Category Consolidation | Collapses the seven Bayesian categories into one owner-level switchable `minimizer` category with HDF5 sidecar. | [`minimizer-category-consolidation.md`](accepted/minimizer-category-consolidation.md) | -| Analysis and fitting | Accepted | Minimizer Input/Output Split | Keeps `analysis.minimizer` input-only and moves scalar fit outputs to paired `analysis.fit_result` classes. | [`minimizer-input-output-split.md`](accepted/minimizer-input-output-split.md) | -| Analysis and fitting | Superseded | Parameter-Level Posterior Projection | Superseded by minimizer-category consolidation; kept as historical context for `parameter.posterior`. | [`parameter-posterior-summary.md`](suggestions/parameter-posterior-summary.md) | -| Analysis and fitting | Accepted | Undo Fit | Builds rollback semantics and CLI behavior on already-persisted pre-fit scalar snapshots. | [`undo-fit.md`](accepted/undo-fit.md) | -| Core model | Accepted | Category Owners and Real Datablocks | Introduces `CategoryOwner` so singleton sections do not pretend to be real CIF datablocks. | [`category-owner-sections.md`](accepted/category-owner-sections.md) | -| Core model | Accepted | Enum-Backed Closed Value Sets | Requires finite option sets to use `(str, Enum)` classes for validation and dispatch. | [`enum-backed-closed-values.md`](accepted/enum-backed-closed-values.md) | -| Core model | Accepted | Guarded Public Properties | Uses property setters as the public writability contract for guarded objects. | [`guarded-public-properties.md`](accepted/guarded-public-properties.md) | -| Core model | Accepted | Two-Level Category Parameter Access | Keeps parameter access to `datablock.category.parameter` or `datablock.collection[id].parameter`. | [`category-parameter-access.md`](accepted/category-parameter-access.md) | -| Documentation | Accepted | Descriptor Property Docstring Template | Makes descriptor metadata the source of truth for public property docstrings and annotations. | [`property-docstring-template.md`](accepted/property-docstring-template.md) | -| Documentation | Accepted | Development Documentation Structure | Defines the `docs/dev` layout for ADRs, issues, plans, package structure, and roadmap. | [`development-docs-structure.md`](accepted/development-docs-structure.md) | -| Documentation | Accepted | Help Method Discoverability | Requires primary public objects and facades to expose consistent `help()` output. | [`help-discoverability.md`](accepted/help-discoverability.md) | -| Documentation | Accepted | Notebook Generation Source of Truth | Treats tutorial `.py` files as editable sources and notebooks as generated artifacts. | [`notebook-generation.md`](accepted/notebook-generation.md) | -| Documentation | Suggestion | Documentation CI and Build Verification | Proposes strict MkDocs builds, API-derived docs, snippet smoke tests, link checks, and prose/spelling checks. | [`documentation-ci-build.md`](suggestions/documentation-ci-build.md) | -| Experiment model | Accepted | Immutable Experiment Type | Makes experiment type axes creation-time state rather than mutable runtime state. | [`immutable-experiment-type.md`](accepted/immutable-experiment-type.md) | -| Experiment model | Suggestion | Automatic Line-Segment Background Estimation | Detects line-segment background control points from the measured pattern, peak-insensitive and editable. | [`background-auto-estimate.md`](suggestions/background-auto-estimate.md) | -| Factories | Accepted | Factory Contracts and Metadata | Standardizes factory construction, metadata, compatibility, and registration behavior. | [`factory-contracts.md`](accepted/factory-contracts.md) | -| Naming | Accepted | Factory Tag Naming | Defines canonical factory tag style and standard abbreviations. | [`factory-tag-naming.md`](accepted/factory-tag-naming.md) | -| Persistence | Accepted | Free-Flag CIF Encoding | Encodes fit free/fixed state through CIF uncertainty syntax instead of a separate free list. | [`free-flag-cif-encoding.md`](accepted/free-flag-cif-encoding.md) | -| Persistence | Accepted | Loop Category Keys and Identity Naming | Documents loop collection keys and naming rules aligned with CIF category keys. | [`loop-category-key-identity.md`](accepted/loop-category-key-identity.md) | -| Persistence | Accepted | Project Facade and Persistence Layout | Documents the current `Project` facade and saved directory layout. | [`project-facade-and-persistence.md`](accepted/project-facade-and-persistence.md) | -| Persistence | Accepted | IUCr CIF Tag Alignment | Aligns default CIF tags with IUCr dictionaries and adds a clean IUCr-aligned report export. | [`iucr-cif-tag-alignment.md`](accepted/iucr-cif-tag-alignment.md) | -| Persistence | Accepted | Python and CIF Category Correspondence | Compares current Python paths and CIF tags, then records scoped one-to-one mapping for project-level categories. | [`python-cif-category-correspondence.md`](accepted/python-cif-category-correspondence.md) | -| Quality | Accepted | Lint Complexity Thresholds | Treats ruff PLR complexity limits as design guardrails that should not be bypassed. | [`lint-complexity-thresholds.md`](accepted/lint-complexity-thresholds.md) | -| Quality | Accepted | Test Strategy | Defines layered unit, functional, integration, script, and notebook testing. | [`test-strategy.md`](accepted/test-strategy.md) | -| Structure model | Accepted | Type-Neutral ADP Parameters | Keeps ADP parameter object identities stable across B/U and iso/ani switches. | [`type-neutral-adp-parameters.md`](accepted/type-neutral-adp-parameters.md) | -| Structure model | Suggestion | Automatic Wyckoff Position Detection | Detects Wyckoff letter, multiplicity, and site symmetry from space group and coordinates; calculators consume them. | [`wyckoff-letter-detection.md`](suggestions/wyckoff-letter-detection.md) | -| Structure model | Accepted | Complete Space-Group Reference Database | One-time build of a complete space_groups.json.gz (all 230 groups) from cctbx, verified against multiple sources. | [`space-group-database.md`](accepted/space-group-database.md) | -| User-facing API | Accepted | Crystal Structure 3D Visualization | Adds a renderer-neutral scene model drawn by ASCII and interactive Three.js engines for viewing crystal structures. | [`crysview-structure-visualization.md`](accepted/crysview-structure-visualization.md) | -| User-facing API | Accepted | Display UX Facade | Defines `project.display` and `project.rendering` responsibilities and display method names. | [`display-ux.md`](accepted/display-ux.md) | -| User-facing API | Accepted | Fit Results Display Naming | Short, IUCr/GUM-aligned column headers (`s.u.`, `value`, `95% CI`) with a footnote glossary on every fit table. | [`fit-results-display-naming.md`](accepted/fit-results-display-naming.md) | -| User-facing API | Accepted | Project Summary Rendering | Defines project report configuration plus terminal, HTML, TeX, PDF, and clean report-CIF metadata policy. | [`project-summary-rendering.md`](accepted/project-summary-rendering.md) | -| User-facing API | Accepted | Selector Families | Distinguishes backend selectors, switchable-category selectors, and active-sibling selectors. | [`selector-families.md`](accepted/selector-families.md) | -| User-facing API | Accepted | String Paths and Live Descriptors | Separates persisted field selectors from references to live model parameters. | [`string-paths-and-live-descriptors.md`](accepted/string-paths-and-live-descriptors.md) | -| User-facing API | Accepted | Switchable Category API | Places multi-type category selectors on the owner and omits public selectors for fixed or single-type categories. | [`switchable-category-api.md`](accepted/switchable-category-api.md) | -| User-facing API | Accepted | Switchable Category Owned Selectors | Moves the writable `type` selector and `show_supported()` onto the category itself; collapses the CIF duplication. | [`switchable-category-owned-selectors.md`](accepted/switchable-category-owned-selectors.md) | -| User-facing API | Accepted | Value-Selector Discovery | Gives enumerated value fields a per-descriptor `show_supported()`, beside the three category-level selector families. | [`value-selector-discovery.md`](accepted/value-selector-discovery.md) | +| Group | Status | Title | Short description | Link | +| -------------------- | ---------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| Analysis and fitting | Accepted | Fit Mode Categories and Fit Execution API | Splits fitting configuration from execution and defines active sibling fit-mode categories. | [`fit-mode-categories.md`](accepted/fit-mode-categories.md) | +| Analysis and fitting | Accepted | Runtime Fit Results | Keeps full fit outputs runtime-only in the current design unless a narrower persistence ADR is accepted. | [`runtime-fit-results.md`](accepted/runtime-fit-results.md) | +| Analysis and fitting | Accepted | Analysis CIF Fit State | Defines the persisted fit-state projection in `analysis/analysis.cif` and `analysis/results.h5`. | [`analysis-cif-fit-state.md`](accepted/analysis-cif-fit-state.md) | +| Analysis and fitting | Accepted | Parameter Correlation Persistence | Persists deterministic and posterior correlation summaries in `_fit_parameter_correlation` | [`parameter-correlation-persistence.md`](accepted/parameter-correlation-persistence.md) | +| Analysis and fitting | Suggestion | Fit Output Files and Data Exports | Narrows remaining archive/export questions after adopting `results.csv` and `results.h5`. | [`fit-output-files-and-data-exports.md`](suggestions/fit-output-files-and-data-exports.md) | +| Analysis and fitting | Accepted | Minimizer Category Consolidation | Collapses the seven Bayesian categories into one owner-level switchable `minimizer` category with HDF5 sidecar. | [`minimizer-category-consolidation.md`](accepted/minimizer-category-consolidation.md) | +| Analysis and fitting | Accepted | Minimizer Input/Output Split | Keeps `analysis.minimizer` input-only and moves scalar fit outputs to paired `analysis.fit_result` classes. | [`minimizer-input-output-split.md`](accepted/minimizer-input-output-split.md) | +| Analysis and fitting | Superseded | Parameter-Level Posterior Projection | Superseded by minimizer-category consolidation; kept as historical context for `parameter.posterior`. | [`parameter-posterior-summary.md`](suggestions/parameter-posterior-summary.md) | +| Analysis and fitting | Accepted | Undo Fit | Builds rollback semantics and CLI behavior on already-persisted pre-fit scalar snapshots. | [`undo-fit.md`](accepted/undo-fit.md) | +| Core model | Accepted | Category Owners and Real Datablocks | Introduces `CategoryOwner` so singleton sections do not pretend to be real CIF datablocks. | [`category-owner-sections.md`](accepted/category-owner-sections.md) | +| Core model | Accepted | Enum-Backed Closed Value Sets | Requires finite option sets to use `(str, Enum)` classes for validation and dispatch. | [`enum-backed-closed-values.md`](accepted/enum-backed-closed-values.md) | +| Core model | Accepted | Guarded Public Properties | Uses property setters as the public writability contract for guarded objects. | [`guarded-public-properties.md`](accepted/guarded-public-properties.md) | +| Core model | Accepted | Two-Level Category Parameter Access | Keeps parameter access to `datablock.category.parameter` or `datablock.collection[id].parameter`. | [`category-parameter-access.md`](accepted/category-parameter-access.md) | +| Documentation | Accepted | Descriptor Property Docstring Template | Makes descriptor metadata the source of truth for public property docstrings and annotations. | [`property-docstring-template.md`](accepted/property-docstring-template.md) | +| Documentation | Accepted | Development Documentation Structure | Defines the `docs/dev` layout for ADRs, issues, plans, package structure, and roadmap. | [`development-docs-structure.md`](accepted/development-docs-structure.md) | +| Documentation | Accepted | Help Method Discoverability | Requires primary public objects and facades to expose consistent `help()` output. | [`help-discoverability.md`](accepted/help-discoverability.md) | +| Documentation | Accepted | Notebook Generation Source of Truth | Treats tutorial `.py` files as editable sources and notebooks as generated artifacts. | [`notebook-generation.md`](accepted/notebook-generation.md) | +| Documentation | Accepted | Plotting & Docs Performance for Interactive Figures | Self-hosts a lazy, shared figure runtime so docs pages load fast and progressively while staying interactive. | [`plotting-docs-performance.md`](accepted/plotting-docs-performance.md) | +| Documentation | Suggestion | Documentation CI and Build Verification | Proposes strict MkDocs builds, API-derived docs, snippet smoke tests, link checks, and prose/spelling checks. | [`documentation-ci-build.md`](suggestions/documentation-ci-build.md) | +| Experiment model | Accepted | Immutable Experiment Type | Makes experiment type axes creation-time state rather than mutable runtime state. | [`immutable-experiment-type.md`](accepted/immutable-experiment-type.md) | +| Experiment model | Suggestion | Automatic Line-Segment Background Estimation | Detects line-segment background control points from the measured pattern, peak-insensitive and editable. | [`background-auto-estimate.md`](suggestions/background-auto-estimate.md) | +| Factories | Accepted | Factory Contracts and Metadata | Standardizes factory construction, metadata, compatibility, and registration behavior. | [`factory-contracts.md`](accepted/factory-contracts.md) | +| Naming | Accepted | Factory Tag Naming | Defines canonical factory tag style and standard abbreviations. | [`factory-tag-naming.md`](accepted/factory-tag-naming.md) | +| Persistence | Accepted | Free-Flag CIF Encoding | Encodes fit free/fixed state through CIF uncertainty syntax instead of a separate free list. | [`free-flag-cif-encoding.md`](accepted/free-flag-cif-encoding.md) | +| Persistence | Accepted | Loop Category Keys and Identity Naming | Documents loop collection keys and naming rules aligned with CIF category keys. | [`loop-category-key-identity.md`](accepted/loop-category-key-identity.md) | +| Persistence | Accepted | Project Facade and Persistence Layout | Documents the current `Project` facade and saved directory layout. | [`project-facade-and-persistence.md`](accepted/project-facade-and-persistence.md) | +| Persistence | Accepted | IUCr CIF Tag Alignment | Aligns default CIF tags with IUCr dictionaries and adds a clean IUCr-aligned report export. | [`iucr-cif-tag-alignment.md`](accepted/iucr-cif-tag-alignment.md) | +| Persistence | Accepted | Python and CIF Category Correspondence | Compares current Python paths and CIF tags, then records scoped one-to-one mapping for project-level categories. | [`python-cif-category-correspondence.md`](accepted/python-cif-category-correspondence.md) | +| Quality | Accepted | Lint Complexity Thresholds | Treats ruff PLR complexity limits as design guardrails that should not be bypassed. | [`lint-complexity-thresholds.md`](accepted/lint-complexity-thresholds.md) | +| Quality | Accepted | Test Strategy | Defines layered unit, functional, integration, script, and notebook testing. | [`test-strategy.md`](accepted/test-strategy.md) | +| Structure model | Accepted | Type-Neutral ADP Parameters | Keeps ADP parameter object identities stable across B/U and iso/ani switches. | [`type-neutral-adp-parameters.md`](accepted/type-neutral-adp-parameters.md) | +| Structure model | Suggestion | Automatic Wyckoff Position Detection | Detects Wyckoff letter, multiplicity, and site symmetry from space group and coordinates; calculators consume them. | [`wyckoff-letter-detection.md`](suggestions/wyckoff-letter-detection.md) | +| Structure model | Accepted | Complete Space-Group Reference Database | One-time build of a complete space_groups.json.gz (all 230 groups) from cctbx, verified against multiple sources. | [`space-group-database.md`](accepted/space-group-database.md) | +| User-facing API | Accepted | Crystal Structure 3D Visualization | Adds a renderer-neutral scene model drawn by ASCII and interactive Three.js engines for viewing crystal structures. | [`crysview-structure-visualization.md`](accepted/crysview-structure-visualization.md) | +| User-facing API | Accepted | Display UX Facade | Defines `project.display` and `project.rendering` responsibilities and display method names. | [`display-ux.md`](accepted/display-ux.md) | +| User-facing API | Accepted | Fit Results Display Naming | Short, IUCr/GUM-aligned column headers (`s.u.`, `value`, `95% CI`) with a footnote glossary on every fit table. | [`fit-results-display-naming.md`](accepted/fit-results-display-naming.md) | +| User-facing API | Accepted | Project Summary Rendering | Defines project report configuration plus terminal, HTML, TeX, PDF, and clean report-CIF metadata policy. | [`project-summary-rendering.md`](accepted/project-summary-rendering.md) | +| User-facing API | Accepted | Selector Families | Distinguishes backend selectors, switchable-category selectors, and active-sibling selectors. | [`selector-families.md`](accepted/selector-families.md) | +| User-facing API | Accepted | String Paths and Live Descriptors | Separates persisted field selectors from references to live model parameters. | [`string-paths-and-live-descriptors.md`](accepted/string-paths-and-live-descriptors.md) | +| User-facing API | Accepted | Switchable Category API | Places multi-type category selectors on the owner and omits public selectors for fixed or single-type categories. | [`switchable-category-api.md`](accepted/switchable-category-api.md) | +| User-facing API | Accepted | Switchable Category Owned Selectors | Moves the writable `type` selector and `show_supported()` onto the category itself; collapses the CIF duplication. | [`switchable-category-owned-selectors.md`](accepted/switchable-category-owned-selectors.md) | +| User-facing API | Accepted | Value-Selector Discovery | Gives enumerated value fields a per-descriptor `show_supported()`, beside the three category-level selector families. | [`value-selector-discovery.md`](accepted/value-selector-discovery.md) | From fe1b677bdf5227e949e062d264c4dbef377897bb Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 20:32:04 +0200 Subject: [PATCH 28/50] Rewrap documentation paragraphs --- .../suggestions/wyckoff-letter-detection.md | 139 +++++++++--------- docs/dev/package-structure/full.md | 1 + docs/dev/plans/wyckoff-letter-detection.md | 116 +++++++-------- 3 files changed, 129 insertions(+), 127 deletions(-) diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md index 88b51a748..732c8896a 100644 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md @@ -101,18 +101,17 @@ Add to Both return a small frozen `WyckoffPosition(letter, multiplicity, site_symmetry, coord_template)` -dataclass rather -than bare tuples: the named values are consumed together when a position -is detected or looked up (the atom site stores the letter and -multiplicity; the derived `space_group_Wyckoff` table exposes the -site-symmetry symbol), and the selected `coord_template` is what -coordinate snapping and constrained-axis flags use. `coord_template` is -`None` only for plain table lookups that do not provide coordinates. -Named fields read better at the call sites, and the record can later -carry the equivalent-position orbit without a breaking positional -change. This matches the project's frozen-dataclass metadata idiom -(`TypeInfo`, `Compatibility`); the bare-tuple alternative is rejected as -less readable and fragile to extension. +dataclass rather than bare tuples: the named values are consumed +together when a position is detected or looked up (the atom site stores +the letter and multiplicity; the derived `space_group_Wyckoff` table +exposes the site-symmetry symbol), and the selected `coord_template` is +what coordinate snapping and constrained-axis flags use. +`coord_template` is `None` only for plain table lookups that do not +provide coordinates. Named fields read better at the call sites, and the +record can later carry the equivalent-position orbit without a breaking +positional change. This matches the project's frozen-dataclass metadata +idiom (`TypeInfo`, `Compatibility`); the bare-tuple alternative is +rejected as less readable and fragile to extension. **Orbit-membership test.** For a coordinate `p = (x, y, z)` and an orbit template parsed into rotation `R` and translation `b`, the point lies on @@ -136,10 +135,10 @@ nearest-position. **Representative selection.** The matcher also records the nearest template inside the winning orbit. That selected `coord_template`, not the first `coords_xyz[0]` entry in the table, drives the existing -coordinate-snap and constrained-axis logic. For example, in Pm-3m -letter `6e`, a point near `(0,x,0)` must snap and constrain according to -the `(0,x,0)` representative, not the first table representative -`(x,0,0)`. The explicit-letter path uses +coordinate-snap and constrained-axis logic. For example, in Pm-3m letter +`6e`, a point near `(0,x,0)` must snap and constrain according to the +`(0,x,0)` representative, not the first table representative `(x,0,0)`. +The explicit-letter path uses `wyckoff_position_info(..., fract_xyz=current_coords)` to select the nearest representative for the chosen letter before snapping. @@ -200,9 +199,9 @@ group the letter changes in three ways: unsupported new key, auto-detection is a no-op: existing letters are preserved verbatim as unvalidated values, multiplicities become `None`, constraints are skipped, and a warning records that the group - is untabulated. Preserving the stored letter is chosen over clearing it - because, without a persistent auto/provided marker, deleting it could - remove valid user or CIF input. + is untabulated. Preserving the stored letter is chosen over clearing + it because, without a persistent auto/provided marker, deleting it + could remove valid user or CIF input. - **User edits the letter** (public letter setter). The chosen letter is applied as-is and persists. Its site-symmetry constraints snap the constrained axes onto the special position (§5); if the pre-set @@ -210,8 +209,8 @@ group the letter changes in three ways: — a warning is logged that the coordinates were adjusted, but the change is still made. A user-set letter is not re-detected until the user next edits the coordinates or space-group key. (For a space group - absent from the table the letter is accepted unvalidated and carries no - derived data or constraints — §8.) + absent from the table the letter is accepted unvalidated and carries + no derived data or constraints — §8.) Detection writes the resolved letter through a dedicated internal mutator, `_set_wyckoff_letter_detected()`, modelled on the existing @@ -308,12 +307,12 @@ standard CIF tag `_atom_site.site_symmetry_multiplicity`. Its empty form is `None`, and that empty state follows **record availability**, not the letter: a no-record site (an unsupported space group, with or without a stored non-empty letter; or a transient empty letter before the first -update) has `None` multiplicity whether its letter is empty or stored but -unvalidated (§8). `None` serialises to CIF `?` (§9) and the calculator -skips it (§7). +update) has `None` multiplicity whether its letter is empty or stored +but unvalidated (§8). `None` serialises to CIF `?` (§9) and the +calculator skips it (§7). -The **site-symmetry symbol is not an atom-site quantity.** In the CIF core -dictionary it belongs to the `space_group_Wyckoff` loop +The **site-symmetry symbol is not an atom-site quantity.** In the CIF +core dictionary it belongs to the `space_group_Wyckoff` loop (`_space_group_Wyckoff.site_symmetry` — "the subgroup of the space group that leaves the point fixed"), alongside the Wyckoff `letter`, `multiplicity`, and `coords_xyz`. EasyDiffraction therefore gains a new @@ -321,9 +320,9 @@ read-only `space_group_Wyckoff` category on the crystal structure (a sibling of `space_group`, `cell`, `atom_sites`). It lists every Wyckoff position of the structure's current space group — `id` (the CIF category key, e.g. `6e`), `letter`, `multiplicity`, `site_symmetry`, and the -representative `coords_xyz` — sourced from `SPACE_GROUPS[key]` (`key` via -the §2 normalisation). This is the symbol's correct home and the natural -place for the deferred "expose the full orbit" work. +representative `coords_xyz` — sourced from `SPACE_GROUPS[key]` (`key` +via the §2 normalisation). This is the symbol's correct home and the +natural place for the deferred "expose the full orbit" work. The collection key is `id`, serialized as `_space_group_Wyckoff.id`. That follows the CIF category-key identity rather than using `letter` as @@ -343,9 +342,10 @@ ordinary category update hooks, so no special `_update_priority` is needed and no other category depends on it for detection. This read-only, auto-populated collection is a **new pattern** in the model — no prior instance exists (the closest, `atom_site_aniso`, is -sync-managed but user-editable) — and is justified by being a CIF-defined -category whose contents are fully determined by the space group. When -the space group is absent from `SPACE_GROUPS`, the category is empty. +sync-managed but user-editable) — and is justified by being a +CIF-defined category whose contents are fully determined by the space +group. When the space group is absent from `SPACE_GROUPS`, the category +is empty. `site_symmetry` stores the International Tables site-symmetry symbol **verbatim** from the table, including its positional dots (for example @@ -384,18 +384,18 @@ below is a guard, not a common case. When the space group is genuinely absent from the table its letters cannot be enumerated, so membership validation is not applied — the validator accepts whatever the user or a CIF supplies. Auto-detection is still a no-op there, but an explicit -letter from Python/CIF input is stored verbatim rather than rejected, and -a previously stored letter is preserved when a later space-group change -moves the site into an unsupported key. Blocking a valid assignment, -failing to load an otherwise-valid CIF, or deleting a possibly valid -stored value is worse than keeping an unverifiable letter. A stored -non-empty letter in this no-record state carries no `multiplicity` (§6), -drives no symmetry constraints, and a `log.warning` records that the -group is untabulated so the letter could not be validated. Rejecting with -a validation error was the -considered alternative, declined as too brittle for boundary input that -Python assignment and CIF loading routinely produce. The atom site -reaches its space group through the parent chain +letter from Python/CIF input is stored verbatim rather than rejected, +and a previously stored letter is preserved when a later space-group +change moves the site into an unsupported key. Blocking a valid +assignment, failing to load an otherwise-valid CIF, or deleting a +possibly valid stored value is worse than keeping an unverifiable +letter. A stored non-empty letter in this no-record state carries no +`multiplicity` (§6), drives no symmetry constraints, and a `log.warning` +records that the group is untabulated so the letter could not be +validated. Rejecting with a validation error was the considered +alternative, declined as too brittle for boundary input that Python +assignment and CIF loading routinely produce. The atom site reaches its +space group through the parent chain `atom → atom_sites → structure → space_group`, the same access already used for ADP synchronisation ([`default.py:252`](../../../../src/easydiffraction/datablocks/structure/categories/atom_sites/default.py)). @@ -420,11 +420,11 @@ which fall out naturally below. **Any** non-empty letter is written verbatim — whether detected for a supported group, supplied explicitly for an unsupported one, or preserved after a later change into an unsupported key (§3, §8). A - non-empty letter in an unsupported group carries a `None` - multiplicity because it is stored but unvalidated. A letter is empty, - and serialises as the CIF null `?`, only when it is neither detected - nor otherwise stored — an unsupported group with no stored letter, or - a transient not-yet-updated state. `?` is already the serializer's + non-empty letter in an unsupported group carries a `None` multiplicity + because it is stored but unvalidated. A letter is empty, and + serialises as the CIF null `?`, only when it is neither detected nor + otherwise stored — an unsupported group with no stored letter, or a + transient not-yet-updated state. `?` is already the serializer's output for an empty string ([`serialize.py:62`](../../../../src/easydiffraction/io/cif/serialize.py)) and reads back as empty. The column is therefore always present and @@ -446,20 +446,20 @@ which fall out naturally below. ([`iucr_writer.py:876`](../../../../src/easydiffraction/io/cif/iucr_writer.py)) already emits the resolved `Wyckoff_symbol` for every atom and now also emits `_atom_site.site_symmetry_multiplicity`. -- **`space_group_Wyckoff` loop.** The derived category is model-owned and - report-facing, but it is not persisted in project CIF. `Structure` +- **`space_group_Wyckoff` loop.** The derived category is model-owned + and report-facing, but it is not persisted in project CIF. `Structure` explicitly excludes it from project-save serialization via `_serializable_categories()`, overriding `CategoryOwner`'s default of serializing all owned categories. The IUCr/report writer emits the `_space_group_Wyckoff.*` loop from the derived category because that loop is useful report output even though it is redundant persisted state. -- **Derived values on read.** Multiplicity is recomputed from the letter, - so any incoming `_atom_site.site_symmetry_multiplicity` is ignored - rather than trusted; the `space_group_Wyckoff` category is re-derived - from the space group, so any incoming `_space_group_Wyckoff.*` values - are ignored/overwritten too — the library does not validate its own - derived output at runtime. +- **Derived values on read.** Multiplicity is recomputed from the + letter, so any incoming `_atom_site.site_symmetry_multiplicity` is + ignored rather than trusted; the `space_group_Wyckoff` category is + re-derived from the space group, so any incoming + `_space_group_Wyckoff.*` values are ignored/overwritten too — the + library does not validate its own derived output at runtime. ## Open Questions @@ -493,18 +493,19 @@ which fall out naturally below. its coordinates or space-group setting, or re-set the letter afterwards. This is the deliberate cost of keeping the letter, coordinates, and space-group key consistent. -- `AtomSite` gains one read-only derived descriptor (`multiplicity`), and - a new read-only, auto-populated `space_group_Wyckoff` category exposes - the per-position `site_symmetry` (and the full Wyckoff table) — a new - derived-collection pattern in the model. +- `AtomSite` gains one read-only derived descriptor (`multiplicity`), + and a new read-only, auto-populated `space_group_Wyckoff` category + exposes the per-position `site_symmetry` (and the full Wyckoff table) + — a new derived-collection pattern in the model. ### Compatibility Outcomes - Projects that already specify every Wyckoff letter keep those letters: explicit letters are respected and reload verbatim. Their constraints - remain unchanged except where the current first-representative shortcut - was wrong for coordinates on another representative of the same orbit; - that case is intentionally fixed by nearest-representative selection. + remain unchanged except where the current first-representative + shortcut was wrong for coordinates on another representative of the + same orbit; that case is intentionally fixed by nearest-representative + selection. - A saved project reloads to the same letters: every letter is written (whether the user supplied it or detection filled it), so all reload verbatim — and an auto-filled one would re-derive to the same value @@ -576,8 +577,8 @@ may miss: preserving stored letters as unvalidated values with `None` multiplicity; and the minimizer leaving the letter fixed; - the no-record contract (§6–§7, §9): `None` `multiplicity`, `?` in CIF, - the calculator skip, and an empty `space_group_Wyckoff` category for an - absent group; + the calculator skip, and an empty `space_group_Wyckoff` category for + an absent group; - the new `space_group_Wyckoff` category: it auto-populates from the structure's space group (each entry's letter / multiplicity / site_symmetry / coords match `SPACE_GROUPS`), rebuilds when the space @@ -611,9 +612,9 @@ already built. - [`space-group-database.md`](../accepted/space-group-database.md) — the complete, self-owned `SPACE_GROUPS` reference table (all 230 groups, every setting and full Wyckoff orbit) that this detection reads. -- [`category-owner-sections.md`](../accepted/category-owner-sections.md) — - the new read-only, auto-populated `space_group_Wyckoff` category is a - `CategoryOwner`-held sibling category on the crystal structure. +- [`category-owner-sections.md`](../accepted/category-owner-sections.md) + — the new read-only, auto-populated `space_group_Wyckoff` category is + a `CategoryOwner`-held sibling category on the crystal structure. - [`iucr-cif-tag-alignment.md`](../accepted/iucr-cif-tag-alignment.md) — `_atom_site.Wyckoff_symbol` and `_atom_site.site_symmetry_multiplicity` tags. diff --git a/docs/dev/package-structure/full.md b/docs/dev/package-structure/full.md index 202823ea6..cad676efe 100644 --- a/docs/dev/package-structure/full.md +++ b/docs/dev/package-structure/full.md @@ -686,6 +686,7 @@ │ ├── 📄 enums.py │ │ └── 🏷️ class VerbosityEnum │ ├── 📄 environment.py +│ │ └── 🏷️ class FigureEmbedMode │ ├── 📄 logging.py │ │ ├── 🏷️ class IconifiedRichHandler │ │ ├── 🏷️ class ConsoleManager diff --git a/docs/dev/plans/wyckoff-letter-detection.md b/docs/dev/plans/wyckoff-letter-detection.md index 2816224c1..40cb0d7e5 100644 --- a/docs/dev/plans/wyckoff-letter-detection.md +++ b/docs/dev/plans/wyckoff-letter-detection.md @@ -36,12 +36,11 @@ rotation/translation parser. `develop`; already exists and already carries the space-group ADR promotion commit `c84183662`). - Implementation shortcuts must stay on the current branch. Before - `/draft-impl-1` starts code work, verify - `git branch --show-current` is `wyckoff-letter-detection`. If it is - not, stop before editing and ask the user to switch to the target - branch outside the shortcut. This planning session is currently on - `plotting-docs-performance`, so implementation must not start from the - current branch. + `/draft-impl-1` starts code work, verify `git branch --show-current` + is `wyckoff-letter-detection`. If it is not, stop before editing and + ask the user to switch to the target branch outside the shortcut. This + planning session is currently on `plotting-docs-performance`, so + implementation must not start from the current branch. - PR targets `develop` (not `master`). Scope label: `[scope] enhancement` (adds a user-facing feature and closes #51). - Do not push the branch until the user asks. @@ -64,8 +63,8 @@ rotation/translation parser. choose by `(multiplicity ascending, residual ascending)`; same-multiplicity ties within `tol` log a warning. 4. **Coordinate-code normalisation.** A shared `_normalize_coord_code()` - maps the empty string `''` to `None` and is used by detection, allowed - letter discovery, `_get_wyckoff_exprs()`, and + maps the empty string `''` to `None` and is used by detection, + allowed letter discovery, `_get_wyckoff_exprs()`, and `_get_general_position_ops()`. 5. **The atom-site letter is concrete for supported groups.** Missing letters are filled on create/load, coordinate edits re-detect with a @@ -101,9 +100,10 @@ rotation/translation parser. model-owned and report-facing, but not persisted in project CIF. `Structure._serializable_categories()` excludes it from `structure.as_cif` / project saves, the IUCr/report writer emits the - `_space_group_Wyckoff.*` loop from the derived category, and incoming - `_space_group_Wyckoff.*` values are ignored/overwritten on project - load because the category is re-derived from the space group. + `_space_group_Wyckoff.*` loop from the derived category, and + incoming `_space_group_Wyckoff.*` values are ignored/overwritten on + project load because the category is re-derived from the space + group. 11. **Allowed letters come from the current space group.** `_wyckoff_letter_allowed_values` returns `['', *tabulated_letters]` for supported groups and `[]` for absent groups. @@ -111,14 +111,15 @@ rotation/translation parser. `MembershipValidator` falls back on mismatch, so `_wyckoff_letter` uses a dedicated permissive-when-empty validator: an empty allowed set accepts explicit user/CIF letters verbatim, and the update flow - preserves any stored non-empty letter when a later space-group change - moves the site into an unsupported key. Those stored letters are - unvalidated, carry `None` multiplicity, skip constraints, and warn; - a non-empty allowed set enforces membership. A temporary no-parent - context during `atom_sites.create(..., wyckoff_letter=...)` is not - treated as unsupported: the raw letter is marked as requiring - context validation and is checked against the parent structure's - space group on the first parented update. + preserves any stored non-empty letter when a later space-group + change moves the site into an unsupported key. Those stored letters + are unvalidated, carry `None` multiplicity, skip constraints, and + warn; a non-empty allowed set enforces membership. A temporary + no-parent context during + `atom_sites.create(..., wyckoff_letter=...)` is not treated as + unsupported: the raw letter is marked as requiring context + validation and is checked against the parent structure's space group + on the first parented update. 13. **CIF atom-site behaviour.** Project CIF writes `_atom_site.Wyckoff_symbol` and `_atom_site.site_symmetry_multiplicity` for every atom (`?` for @@ -157,7 +158,8 @@ Phase 1 (implementation): `SpaceGroupWyckoffCollection` with `id`, `letter`, `multiplicity`, `site_symmetry`, and `coords_xyz` descriptors plus private rebuild. - `src/easydiffraction/datablocks/structure/categories/space_group_wyckoff/factory.py` - and `src/easydiffraction/datablocks/structure/categories/space_group_wyckoff/__init__.py` + and + `src/easydiffraction/datablocks/structure/categories/space_group_wyckoff/__init__.py` — register/import the new concrete collection. - `src/easydiffraction/datablocks/structure/item/base.py` — add the `space_group_wyckoff` sibling category, expose it read-only, rebuild @@ -204,13 +206,12 @@ The ADR commit + design-phase review/reply cleanup are handled by - [ ] **P1.0 — Re-close the ADR review gate.** No code. Ensure `git branch --show-current` is `wyckoff-letter-detection`; if not, - stop before editing and ask the user to switch to the target branch - outside the shortcut. Then ensure + stop before editing and ask the user to switch to the target + branch outside the shortcut. Then ensure `wyckoff-letter-detection_review-16.md` remains the latest ADR review and has the final-review sentinel. If any newer ADR review appears before implementation, update this plan and re-review it - before P1.1. - Commit: `Confirm wyckoff letter detection ADR gate` + before P1.1. Commit: `Confirm wyckoff letter detection ADR gate` - [ ] **P1.1 — Orbit matcher in the crystallography submodule.** Add to `crystallography.py`: frozen `WyckoffPosition(letter, multiplicity, site_symmetry, coord_template)`, @@ -221,8 +222,8 @@ The ADR commit + design-phase review/reply cleanup are handled by representative template for snapping. Make `_get_wyckoff_exprs` and `_get_general_position_ops` use `_normalize_coord_code`. Export new public names via `crystallography/__init__.py` if - public. - Commit: `Add Wyckoff orbit detection to crystallography module` + public. Commit: + `Add Wyckoff orbit detection to crystallography module` - [ ] **P1.2 — Derived `space_group_wyckoff` category.** Add the `space_group_wyckoff` package with a `SpaceGroupWyckoff` item keyed by `id` (`_space_group_Wyckoff.id`) and read-only @@ -234,21 +235,20 @@ The ADR commit + design-phase review/reply cleanup are handled by - [ ] **P1.3 — Wire `space_group_wyckoff` into `Structure`.** Add it as a read-only sibling category on `Structure`, rebuild it when structure categories update so it tracks the current space group, - keep it empty for absent groups, and exclude it from project CIF by - overriding `_serializable_categories()`. Rebuild it from + keep it empty for absent groups, and exclude it from project CIF + by overriding `_serializable_categories()`. Rebuild it from `Structure._update_categories()` before ordinary category update - hooks, with no special `_update_priority`; atom-site detection reads - `SPACE_GROUPS` through the crystallography helpers rather than - depending on this collection. - Commit: `Wire derived Wyckoff table into Structure` + hooks, with no special `_update_priority`; atom-site detection + reads `SPACE_GROUPS` through the crystallography helpers rather + than depending on this collection. Commit: + `Wire derived Wyckoff table into Structure` - [ ] **P1.4 — Read-only multiplicity + detection mutator on `AtomSite`.** Add only `multiplicity` as a read-only derived descriptor on `AtomSite` with `CifHandler` for `_atom_site.site_symmetry_multiplicity`, empty form `None`, and no public setter. Add `_set_wyckoff_letter_detected()` modelled on `_set_value_from_minimizer`. Do not add `site_symmetry` to - `AtomSite`. - Commit: `Add read-only multiplicity to AtomSite` + `AtomSite`. Commit: `Add read-only multiplicity to AtomSite` - [ ] **P1.5 — Dynamic allowed letters + unsupported-group validation.** Make `_wyckoff_letter_allowed_values` return `['', *list(SPACE_GROUPS[key]['Wyckoff_positions'])]` for a @@ -260,33 +260,33 @@ The ADR commit + design-phase review/reply cleanup are handled by `atom_sites.create(..., wyckoff_letter=...)` call sets the letter before parent context exists, store the raw value with a private "needs context validation" marker instead of treating missing - context as an unsupported group. - Commit: `Derive allowed Wyckoff letters from the space group` + context as an unsupported group. Commit: + `Derive allowed Wyckoff letters from the space group` - [ ] **P1.6 — Detection triggers in the atom-site update flow.** In `_update(*, called_by_minimizer=False)`, implement fill-if-empty, re-detect-on-coordinate-change, and re-detect-on-space-group-key change with per-atom coordinate and `(name_hm, coord_code)` baselines. First resolve any pending no-parent-context `wyckoff_letter` value: for a supported key, validate it against - the parent structure's allowed letters and raise `ValueError` if it - is invalid; for an unsupported key, keep it as an unvalidated + the parent structure's allowed letters and raise `ValueError` if + it is invalid; for an unsupported key, keep it as an unvalidated stored letter. For supported keys, refresh letter, multiplicity, and selected representative; for unsupported keys, preserve stored letters as unvalidated values, set multiplicity to `None`, skip constraints, and warn. Use the selected `coord_template` for snapping and constrained-axis flags. Warn when coordinate or - supported space-group edits move the letter, when a user letter-set - snaps coordinates, and when a same-letter coordinate edit snaps - coordinates. Honour `called_by_minimizer=True`; populate - `multiplicity` from `wyckoff_position_info`. Site-symmetry display - data comes from `structure.space_group_wyckoff`, not from - `AtomSite`. - Commit: `Detect and track Wyckoff letters in the update flow` + supported space-group edits move the letter, when a user + letter-set snaps coordinates, and when a same-letter coordinate + edit snaps coordinates. Honour `called_by_minimizer=True`; + populate `multiplicity` from `wyckoff_position_info`. + Site-symmetry display data comes from + `structure.space_group_wyckoff`, not from `AtomSite`. Commit: + `Detect and track Wyckoff letters in the update flow` - [ ] **P1.7 — Calculator consumes model multiplicity.** Replace the `SPACE_GROUPS` lookup in `cryspy._update_atom_multiplicity` with `atom_site.multiplicity.value`; when it is `None`, leave the - backend's inferred multiplicity in place. - Commit: `Read multiplicity from the model in the cryspy calculator` + backend's inferred multiplicity in place. Commit: + `Read multiplicity from the model in the cryspy calculator` - [ ] **P1.8 — CIF and report output.** Ensure project CIF writes `_atom_site.Wyckoff_symbol` and `_atom_site.site_symmetry_multiplicity` but excludes the derived @@ -297,15 +297,15 @@ The ADR commit + design-phase review/reply cleanup are handled by from the space group. Extend IUCr/report output with `_atom_site.site_symmetry_multiplicity` and the report-only `_space_group_Wyckoff.{id,letter,multiplicity,site_symmetry,coords_xyz}` - loop. - Commit: `Serialize Wyckoff multiplicity and report Wyckoff table` + loop. Commit: + `Serialize Wyckoff multiplicity and report Wyckoff table` - [ ] **P1.9 — Promote ADR, close #51, remove stale TODOs.** `git mv` `wyckoff-letter-detection.md` from `suggestions/` to `accepted/`, set `**Status:** Accepted`, flip its `docs/dev/adrs/index.md` row to `Accepted`, and fix links with `git grep -n`. Move issue #51 from `open.md` to `closed.md` and delete the resolved TODOs in - `default.py` (~200–211, ~225, ~569). - Commit: `Promote wyckoff-letter-detection ADR and close issue #51` + `default.py` (~200–211, ~225, ~569). Commit: + `Promote wyckoff-letter-detection ADR and close issue #51` - [ ] **P1.10 — Phase 1 review gate.** No code. Mark this `[x]`, commit the checklist update alone, then stop for the Phase 1 review. Commit: `Reach Phase 1 review gate` @@ -333,13 +333,13 @@ Tests to add or update: fill-if-empty on create/load; re-detect via both `atom.fract_x = …` and `atom.fract_x.value = …` with the warning; user letter override with the snap warning; `atom_sites.create(..., wyckoff_letter=...)` - validating against the parent structure once context exists; same-letter - coordinate edits whose snap moves stored coordinates; supported - space-group / setting edits re-detecting all atom sites; unsupported - space-group transitions preserving stored non-empty letters as - unvalidated values with `None` multiplicity; minimizer leaves the - letter fixed; no-record contract (`None` multiplicity, `?` in CIF, - calculator skip); CIF round-trip stability. + validating against the parent structure once context exists; + same-letter coordinate edits whose snap moves stored coordinates; + supported space-group / setting edits re-detecting all atom sites; + unsupported space-group transitions preserving stored non-empty + letters as unvalidated values with `None` multiplicity; minimizer + leaves the letter fixed; no-record contract (`None` multiplicity, `?` + in CIF, calculator skip); CIF round-trip stability. - **`space_group_wyckoff` behaviours** in `tests/unit/easydiffraction/datablocks/structure/categories/test_space_group_wyckoff.py`: auto-populates from `SPACE_GROUPS`, uses `id` keys, preserves From 9882c50cbb09edfc47a63b69180c33b17a91ffb6 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 20:59:53 +0200 Subject: [PATCH 29/50] Document Wyckoff coords_xyz operator-form regression and fix --- .../suggestions/wyckoff-letter-detection.md | 83 ++++++++++++++++++- docs/dev/plans/wyckoff-letter-detection.md | 19 +++++ 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md index 732c8896a..cb8333f27 100644 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md @@ -461,6 +461,84 @@ which fall out naturally below. `_space_group_Wyckoff.*` values are ignored/overwritten too — the library does not validate its own derived output at runtime. +### 10. Wyckoff coordinate templates use canonical parametric form + +Every consumer of the table's `coords_xyz` templates assumes each one is +written in **canonical International Tables parametric form**: a free +axis appears as a bare signed variable (`x`, `-x`, `2*x`), and a +symmetry-fixed axis is a constant or a function of the _other_ (free) +axes in which its **own** variable never appears. The constrained-axis +test is exactly that — axis _i_ is fixed when symbol _i_ is absent from +all three components, so `(x,-x,z)` marks `fract_y` constrained, +`(0,0,z)` marks `fract_x`/`fract_y` constrained, and `(x,y,z)` marks +none. Three places rely on this spelling: the existing coordinate +constraints (`_fract_constrained_flags()` / +`_apply_fract_constraints()`, +[`crystallography.py:221`](../../../../src/easydiffraction/crystallography/crystallography.py)), +the §2 orbit matcher and representative selection, and the §3 coordinate +snapping. + +**A regression makes this a live problem, not just a guideline.** The +complete `space_groups.json.gz` produced by the space-group-database +work ([`space-group-database.md`](../accepted/space-group-database.md)) +stores cctbx's special-position **operator** form for coupled sites +instead of the canonical form. R-3m letter `h` is tabulated as +`(1/2*x-1/2*y, -1/2*x+1/2*y, z)` rather than `(x,-x,z)`, and +`(x,x,z)`-type sites as `(1/2*x+1/2*y, 1/2*x+1/2*y, …)`. In the operator +form a coupled component carries **all** of its participating variables, +so the "own symbol absent" test never fires: +`_fract_constrained_flags()` reports the dependent axis as free and +`_apply_fract_constraints()` never slaves it. After a refinement step +moves the free coordinate, the dependent one (here `fract_y = -fract_x`) +goes stale, the atom drifts off its special position, and — because the +per-atom multiplicity is still forced to the special-position value +(today's `_update_atom_multiplicity()`, §7) — the recalculated structure +factors become inconsistent and blow up. This is observable in the +`ed-6` HS / R-3m tutorial: refining the O and H `fract_x` / `fract_z` +(its third fit) leaves `fract_y` stale, so the post-fit pattern +recalculation jumps from a good fit to a badly wrong one and the next +fit restarts from a far worse reduced χ². The scope is every coupled +special position — **288 of 5600 tabulated positions (5.1 %), across 117 +space-group IT numbers**; fully-fixed sites (`(0,0,z)`) and general +positions are unaffected because their constrained-axis detection does +not depend on the spelling. + +**Decision — regenerate the table in canonical parametric form**, and +add a generation-time invariant check that rejects any `coords_xyz` +component whose own axis variable appears in a coupled term (operator- +form leakage). The canonical strings are recoverable for the whole +table: cctbx exposes the standard ITA Wyckoff representatives directly, +and independently each operator template is a linear projection that +re-parametrises deterministically to a canonical representative +(verified: all 288 affected templates reduce to canonical parametric +form). **Copying the pre-#187 pickle back is not a fix** — it stored +canonical strings for only 236 of the 288 affected positions and covered +just 613 of today's 816 keys (missing 203), so the canonical form must +be (re)generated for the complete table, not restored from the old +snapshot. This keeps the cheap symbol-presence detection and every +current consumer unchanged, and it is the form §2's matcher, §3's +snapping, and §6–§7's multiplicity contract already assume. + +The recorded fallback, if a future need for the raw operator form +arises, is to make the kernel operator-form-aware: replace the +symbol-presence heuristic with a rank / null-space analysis of the +parsed linear map `R·v + b` (degrees of freedom = `rank(R)`; the +dependent axes are those outside a chosen free-axis basis), align the §2 +matcher to the same analysis, and still re-parametrise to a single +canonical representative before snapping so downstream consumers see a +stable form. This is the more general solution but more code, and it +must be proven against both representations; it is unnecessary while the +table is canonical. + +Either path is a **prerequisite for the detection and snapping in §2–§3 +and the multiplicity contract in §6–§7**, which all assume canonical +templates and an atom that actually sits on its special position. A +coupled-special-position regression test (for example R-3m `h`, +asserting `fract_y` is flagged constrained and tracks `-fract_x` after a +`fract_x` edit) belongs in the targeted suite below, since the current +constraint tests cover only all-fixed and all-free sites — which behave +identically in both spellings and so never exercised the gap. + ## Open Questions - The default tolerance value (`1e-3`) is a reasonable starting point @@ -611,7 +689,10 @@ already built. - [`space-group-database.md`](../accepted/space-group-database.md) — the complete, self-owned `SPACE_GROUPS` reference table (all 230 groups, - every setting and full Wyckoff orbit) that this detection reads. + every setting and full Wyckoff orbit) that this detection reads. §10 + requires its `coords_xyz` templates in canonical parametric form; the + table currently ships cctbx operator-form entries for coupled special + positions, which must be regenerated. - [`category-owner-sections.md`](../accepted/category-owner-sections.md) — the new read-only, auto-populated `space_group_Wyckoff` category is a `CategoryOwner`-held sibling category on the crystal structure. diff --git a/docs/dev/plans/wyckoff-letter-detection.md b/docs/dev/plans/wyckoff-letter-detection.md index 40cb0d7e5..dfe172b43 100644 --- a/docs/dev/plans/wyckoff-letter-detection.md +++ b/docs/dev/plans/wyckoff-letter-detection.md @@ -129,11 +129,30 @@ rotation/translation parser. stored non-empty letter verbatim with `?` multiplicity. 14. **Tolerance.** `_WYCKOFF_DETECTION_TOL = 1e-3` is the default; a user/project-level tolerance setting remains deferred. +15. **Canonical Wyckoff templates are a prerequisite (ADR §10).** The + orbit matcher (Decisions 2–3), snapping (Decision 5), and the + existing coordinate constraints assume `coords_xyz` in canonical ITA + parametric form (`(x,-x,z)`), but the bundled `space_groups.json.gz` + ships cctbx operator-form templates (`(1/2*x-1/2*y,…)`) for 288 + coupled special positions across 117 IT numbers. That spelling + silently breaks `_fract_constrained_flags()` / + `_apply_fract_constraints()`, so a refined special-position + coordinate drifts off-site (the `ed-6` fit-3 → fit-4 regression). + The table must be regenerated in canonical form — with a + generation-time invariant check rejecting operator-form leakage — + before detection/snapping can be trusted, and a coupled-position + regression test (e.g. R-3m `h`) added. This touches the + space-group-database, so treat it as a coordinated change with that + ADR. ## Open questions - **Tolerance default.** `1e-3` is the ADR's starting point; it may be tuned against the tutorial corpus during Phase 2. Not a blocker. +- **Canonical-form regeneration ownership.** §10's fix lives in the + space-group-database generator, not this feature's code. Decide + whether to land it as a standalone fix ahead of this plan or fold it + into Phase 1 — it is a hard prerequisite either way. ## Concrete files likely to change From 79345ce59587ba50fd1c27516cbcaa27c3faae4a Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 21:11:11 +0200 Subject: [PATCH 30/50] Make axes and scene background opaque, paper transparent --- docs/docs/assets/javascripts/ed-figures.js | 5 ++-- .../display/plotters/plotly.py | 19 +++++++++--- .../display/structure/assets/colors.py | 19 ++++++++++-- .../structure/templates/structure.html.j2 | 4 +-- src/easydiffraction/display/theme.py | 29 +++++++++++++++++-- .../display/plotters/test_plotly.py | 2 +- .../display/structure/assets/test_colors.py | 8 +++-- .../structure/renderers/test_threejs.py | 18 ++++++------ .../easydiffraction/display/test_theme.py | 20 +++++++++++++ 9 files changed, 98 insertions(+), 26 deletions(-) diff --git a/docs/docs/assets/javascripts/ed-figures.js b/docs/docs/assets/javascripts/ed-figures.js index 35ecf94b0..bbd84d6ee 100644 --- a/docs/docs/assets/javascripts/ed-figures.js +++ b/docs/docs/assets/javascripts/ed-figures.js @@ -91,10 +91,11 @@ if (!colors) { return; } + var paperBackground = colors.paperBackground || 'rgba(0, 0, 0, 0)'; var update = { - paper_bgcolor: colors.background, + paper_bgcolor: paperBackground, plot_bgcolor: colors.background, - 'modebar.bgcolor': colors.background, + 'modebar.bgcolor': paperBackground, 'font.color': colors.foreground, 'title.font.color': colors.foreground, 'legend.bgcolor': colors.legend, diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index afa96946a..fb419e2df 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -46,6 +46,7 @@ from easydiffraction.display.theme import LIGHT_HOVER_BACKGROUND_COLOR from easydiffraction.display.theme import LIGHT_INNER_TICK_GRID_COLOR from easydiffraction.display.theme import LIGHT_LEGEND_BACKGROUND_COLOR +from easydiffraction.display.theme import PAPER_BACKGROUND_COLOR from easydiffraction.display.theme import DisplayThemeColors from easydiffraction.display.theme import display_theme_colors from easydiffraction.display.theme import display_theme_colors_for_template @@ -363,6 +364,11 @@ def _background_color(cls) -> str: """Return the plot background color for the active theme.""" return cls._theme_colors().background + @staticmethod + def _paper_background_color() -> str: + """Return the transparent figure-paper (outer margin) color.""" + return PAPER_BACKGROUND_COLOR + @classmethod def _inner_tick_grid_color(cls) -> str: """Return the inner tick-grid color for the active theme.""" @@ -1197,6 +1203,7 @@ def _theme_sync_post_script() -> str: if (theme === 'dark') { return { background: '__DARK_BACKGROUND_COLOR__', + paperBackground: '__PAPER_BACKGROUND_COLOR__', foreground: '__DARK_FOREGROUND_COLOR__', axisFrame: '__DARK_AXIS_FRAME_COLOR__', innerTickGrid: '__DARK_INNER_TICK_GRID_COLOR__', @@ -1206,6 +1213,7 @@ def _theme_sync_post_script() -> str: } return { background: '__LIGHT_BACKGROUND_COLOR__', + paperBackground: '__PAPER_BACKGROUND_COLOR__', foreground: '__LIGHT_FOREGROUND_COLOR__', axisFrame: '__LIGHT_AXIS_FRAME_COLOR__', innerTickGrid: '__LIGHT_INNER_TICK_GRID_COLOR__', @@ -1349,9 +1357,9 @@ def _theme_sync_post_script() -> str: graphDiv.dataset.edPlotlyTheme = theme; const update = { - paper_bgcolor: colors.background, + paper_bgcolor: colors.paperBackground, plot_bgcolor: colors.background, - 'modebar.bgcolor': colors.background, + 'modebar.bgcolor': colors.paperBackground, 'font.color': colors.foreground, 'title.font.color': colors.foreground, 'legend.bgcolor': colors.legend, @@ -1429,6 +1437,7 @@ def _theme_sync_post_script() -> str: '__THEME_SYNC_CORRELATION_HEATMAP_KEY__', THEME_SYNC_CORRELATION_HEATMAP_KEY, ) + .replace('__PAPER_BACKGROUND_COLOR__', PAPER_BACKGROUND_COLOR) .replace('__DARK_BACKGROUND_COLOR__', DARK_BACKGROUND_COLOR) .replace('__DARK_FOREGROUND_COLOR__', DARK_FOREGROUND_COLOR) .replace('__DARK_AXIS_FRAME_COLOR__', DARK_AXIS_FRAME_COLOR) @@ -1737,6 +1746,7 @@ def _ed_theme_payload() -> dict: return { 'light': { 'background': LIGHT_BACKGROUND_COLOR, + 'paperBackground': PAPER_BACKGROUND_COLOR, 'foreground': LIGHT_FOREGROUND_COLOR, 'axisFrame': LIGHT_AXIS_FRAME_COLOR, 'innerTickGrid': LIGHT_INNER_TICK_GRID_COLOR, @@ -1745,6 +1755,7 @@ def _ed_theme_payload() -> dict: }, 'dark': { 'background': DARK_BACKGROUND_COLOR, + 'paperBackground': PAPER_BACKGROUND_COLOR, 'foreground': DARK_FOREGROUND_COLOR, 'axisFrame': DARK_AXIS_FRAME_COLOR, 'innerTickGrid': DARK_INNER_TICK_GRID_COLOR, @@ -1921,7 +1932,7 @@ def _apply_background_color( if resolved_background is None: resolved_background = cls._background_color() update_layout( - paper_bgcolor=resolved_background, + paper_bgcolor=cls._paper_background_color(), plot_bgcolor=resolved_background, ) @@ -2003,7 +2014,7 @@ def _get_layout( 'text': title, 'font': {'size': TITLE_FONT_SIZE}, }, - paper_bgcolor=cls._background_color(), + paper_bgcolor=cls._paper_background_color(), plot_bgcolor=cls._background_color(), legend={ 'bgcolor': cls._legend_background_color(), diff --git a/src/easydiffraction/display/structure/assets/colors.py b/src/easydiffraction/display/structure/assets/colors.py index 5474c43aa..460c47c31 100644 --- a/src/easydiffraction/display/structure/assets/colors.py +++ b/src/easydiffraction/display/structure/assets/colors.py @@ -7,6 +7,11 @@ from __future__ import annotations from easydiffraction.display.structure.assets.elements import ELEMENT_COLORS +from easydiffraction.display.theme import DARK_BACKGROUND_COLOR +from easydiffraction.display.theme import DARK_FOREGROUND_COLOR +from easydiffraction.display.theme import LIGHT_BACKGROUND_COLOR +from easydiffraction.display.theme import LIGHT_FOREGROUND_COLOR +from easydiffraction.display.theme import hex_to_rgb Rgb = tuple[int, int, int] @@ -19,9 +24,17 @@ # Neutral wedge colour for the vacant fraction of a mixed site. VACANCY_COLOR: Rgb = (210, 210, 210) -# Parent-independent annotation contrast colours for light/dark themes. -LIGHT_THEME: dict[str, Rgb] = {'background': (255, 255, 255), 'foreground': (33, 33, 33)} -DARK_THEME: dict[str, Rgb] = {'background': (33, 33, 33), 'foreground': (235, 235, 235)} +# Light/dark annotation contrast colours, derived from the shared +# display theme (``display/theme.py``) so plots and the structure +# view share one background/foreground source of truth. +LIGHT_THEME: dict[str, Rgb] = { + 'background': hex_to_rgb(LIGHT_BACKGROUND_COLOR), + 'foreground': hex_to_rgb(LIGHT_FOREGROUND_COLOR), +} +DARK_THEME: dict[str, Rgb] = { + 'background': hex_to_rgb(DARK_BACKGROUND_COLOR), + 'foreground': hex_to_rgb(DARK_FOREGROUND_COLOR), +} def color_for(element: str, scheme: str) -> Rgb: diff --git a/src/easydiffraction/display/structure/templates/structure.html.j2 b/src/easydiffraction/display/structure/templates/structure.html.j2 index d05da334a..00ae2e058 100644 --- a/src/easydiffraction/display/structure/templates/structure.html.j2 +++ b/src/easydiffraction/display/structure/templates/structure.html.j2 @@ -22,7 +22,7 @@ --cv-axis-letter-size: 18px; } #{{ container_id }}.cv-theme-dark { - --cv-scene-bg: transparent; + --cv-scene-bg: {{ dark_background }}; --cv-scene-fg: {{ dark_foreground }}; --cv-label-shadow-bg: {{ dark_background }}; --cv-panel-bg: {{ dark_panel_background }}; @@ -38,7 +38,7 @@ --cv-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%23ebebeb' stroke-width='1.3'/%3E%3C/svg%3E"); } #{{ container_id }}.cv-theme-light { - --cv-scene-bg: transparent; + --cv-scene-bg: {{ light_background }}; --cv-scene-fg: {{ light_foreground }}; --cv-label-shadow-bg: {{ light_background }}; --cv-panel-bg: {{ light_panel_background }}; diff --git a/src/easydiffraction/display/theme.py b/src/easydiffraction/display/theme.py index 727dbf36f..d08d58329 100644 --- a/src/easydiffraction/display/theme.py +++ b/src/easydiffraction/display/theme.py @@ -6,8 +6,12 @@ from dataclasses import dataclass -LIGHT_BACKGROUND_COLOR = 'rgba(0, 0, 0, 0)' -DARK_BACKGROUND_COLOR = 'rgba(0, 0, 0, 0)' +# Background inside the axes rectangle (the plotted area / 3D scene). +LIGHT_BACKGROUND_COLOR = '#ffffff' +DARK_BACKGROUND_COLOR = '#111111' +# Figure paper (margins around the axes) stays transparent so charts +# blend into the host page; only the plotted area is opaque. +PAPER_BACKGROUND_COLOR = 'rgba(0, 0, 0, 0)' LIGHT_FOREGROUND_COLOR = '#222222' DARK_FOREGROUND_COLOR = '#e6e8ee' LIGHT_AXIS_FRAME_COLOR = '#e0e0e0' @@ -22,6 +26,27 @@ TABLE_AXIS_FRAME_CSS_VAR = '--ed-axis-frame-color' +def hex_to_rgb(value: str) -> tuple[int, int, int]: + """ + Return the RGB triple for a hex color string. + + Parameters + ---------- + value : str + Hex color in ``#rgb`` or ``#rrggbb`` form. + + Returns + ------- + tuple[int, int, int] + Red, green, and blue components in the 0-255 range. + """ + shorthand_length = 3 + digits = value.lstrip('#') + if len(digits) == shorthand_length: + digits = ''.join(channel * 2 for channel in digits) + return (int(digits[0:2], 16), int(digits[2:4], 16), int(digits[4:6], 16)) + + @dataclass(frozen=True) class DisplayThemeColors: """ diff --git a/tests/unit/easydiffraction/display/plotters/test_plotly.py b/tests/unit/easydiffraction/display/plotters/test_plotly.py index 9a7494dcf..6b5780509 100644 --- a/tests/unit/easydiffraction/display/plotters/test_plotly.py +++ b/tests/unit/easydiffraction/display/plotters/test_plotly.py @@ -43,7 +43,7 @@ def test_get_layout_sets_title_axis_and_theme_colors( assert layout.title.font.size == pp.TITLE_FONT_SIZE assert layout.xaxis.title.font.size == pp.AXIS_TITLE_FONT_SIZE assert layout.yaxis.title.font.size == pp.AXIS_TITLE_FONT_SIZE - assert layout.paper_bgcolor == background_color + assert layout.paper_bgcolor == pp.PAPER_BACKGROUND_COLOR assert layout.plot_bgcolor == background_color assert layout.xaxis.linecolor == axis_color assert layout.yaxis.linecolor == axis_color diff --git a/tests/unit/easydiffraction/display/structure/assets/test_colors.py b/tests/unit/easydiffraction/display/structure/assets/test_colors.py index 2d723716b..82e6c10eb 100644 --- a/tests/unit/easydiffraction/display/structure/assets/test_colors.py +++ b/tests/unit/easydiffraction/display/structure/assets/test_colors.py @@ -85,12 +85,14 @@ def test_dark_theme_keys(self): assert set(DARK_THEME) == {'background', 'foreground'} def test_light_theme_values(self): + # Derived from display/theme.py (#ffffff / #222222). assert LIGHT_THEME['background'] == (255, 255, 255) - assert LIGHT_THEME['foreground'] == (33, 33, 33) + assert LIGHT_THEME['foreground'] == (34, 34, 34) def test_dark_theme_values(self): - assert DARK_THEME['background'] == (33, 33, 33) - assert DARK_THEME['foreground'] == (235, 235, 235) + # Derived from display/theme.py (#111111 / #e6e8ee). + assert DARK_THEME['background'] == (17, 17, 17) + assert DARK_THEME['foreground'] == (230, 232, 238) def test_theme_values_all_rgb(self): for theme in (LIGHT_THEME, DARK_THEME): diff --git a/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py b/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py index 9b34bbf90..5d34e6092 100644 --- a/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py +++ b/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py @@ -754,21 +754,21 @@ def test_render_returns_html_document(self): assert '>' in html assert 'crysview-' in html - def test_light_theme_embeds_transparent_canvas_and_contrast_colours(self): - # ``theme_colors(dark=False)`` returns LIGHT_THEME; its background - # and foreground must be wired into the document for labels. + def test_light_theme_embeds_scene_background_and_contrast_colours(self): + # ``theme_colors(dark=False)`` returns LIGHT_THEME; its opaque + # scene background and foreground must be wired into the document. html = ThreeJsStructureRenderer().render( _identity_scene(), features=frozenset(), offline=True, dark=False, ) - assert '--cv-scene-bg: transparent;' in html + assert '--cv-scene-bg: rgb(255, 255, 255);' in html assert '--cv-label-shadow-bg: rgb(255, 255, 255);' in html - assert 'rgb(33, 33, 33)' in html # LIGHT_THEME foreground + assert 'rgb(34, 34, 34)' in html # LIGHT_THEME foreground assert 'light' in html - def test_dark_theme_embeds_transparent_canvas_and_contrast_colours(self): + def test_dark_theme_embeds_scene_background_and_contrast_colours(self): # ``theme_colors(dark=True)`` returns DARK_THEME instead. html = ThreeJsStructureRenderer().render( _identity_scene(), @@ -776,9 +776,9 @@ def test_dark_theme_embeds_transparent_canvas_and_contrast_colours(self): offline=True, dark=True, ) - assert '--cv-scene-bg: transparent;' in html - assert '--cv-label-shadow-bg: rgb(33, 33, 33);' in html - assert 'rgb(235, 235, 235)' in html # DARK_THEME foreground + assert '--cv-scene-bg: rgb(17, 17, 17);' in html + assert '--cv-label-shadow-bg: rgb(17, 17, 17);' in html + assert 'rgb(230, 232, 238)' in html # DARK_THEME foreground assert 'dark' in html diff --git a/tests/unit/easydiffraction/display/test_theme.py b/tests/unit/easydiffraction/display/test_theme.py index e1ce1b99e..6c9fa267d 100644 --- a/tests/unit/easydiffraction/display/test_theme.py +++ b/tests/unit/easydiffraction/display/test_theme.py @@ -24,3 +24,23 @@ def test_display_theme_colors_for_template_maps_plotly_templates(): assert theme.display_theme_colors_for_template('plotly_white') is theme.LIGHT_THEME_COLORS assert theme.display_theme_colors_for_template('plotly_dark') is theme.DARK_THEME_COLORS assert theme.display_theme_colors_for_template('custom') is None + + +def test_plot_backgrounds_opaque_and_paper_transparent(): + import easydiffraction.display.theme as theme + + # Inside the axes rectangle is opaque; the figure paper stays + # transparent so charts blend into the host page. + assert theme.LIGHT_BACKGROUND_COLOR == '#ffffff' + assert theme.DARK_BACKGROUND_COLOR == '#111111' + assert theme.PAPER_BACKGROUND_COLOR == 'rgba(0, 0, 0, 0)' + + +def test_hex_to_rgb_expands_short_and_full_forms(): + from easydiffraction.display.theme import hex_to_rgb + + assert hex_to_rgb('#ffffff') == (255, 255, 255) + assert hex_to_rgb('#111111') == (17, 17, 17) + assert hex_to_rgb('#e6e8ee') == (230, 232, 238) + assert hex_to_rgb('#fff') == (255, 255, 255) + assert hex_to_rgb('#111') == (17, 17, 17) From c45b8441521ba7a18e538386b30bed6939bc2cf6 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 21:11:19 +0200 Subject: [PATCH 31/50] =?UTF-8?q?Display=20squared=20degrees=20as=20deg?= =?UTF-8?q?=C2=B2=20instead=20of=20deg^2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../experiment/categories/peak/cwl_mixins.py | 12 ++++++------ src/easydiffraction/report/data_context.py | 12 ++++++------ .../experiment/categories/peak/test_cwl_mixins.py | 2 ++ .../unit/easydiffraction/report/test_data_context.py | 9 +++++++++ 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py b/src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py index 2285b31b7..020a4e9ea 100644 --- a/src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py +++ b/src/easydiffraction/datablocks/experiment/categories/peak/cwl_mixins.py @@ -27,7 +27,7 @@ def __init__(self) -> None: units='degrees_squared', display_handler=DisplayHandler( display_name='U', - display_units='deg^2', + display_units='deg²', latex_name=r'$U$', latex_units=r'\mathrm{deg}^2', ), @@ -46,7 +46,7 @@ def __init__(self) -> None: units='degrees_squared', display_handler=DisplayHandler( display_name='V', - display_units='deg^2', + display_units='deg²', latex_name=r'$V$', latex_units=r'\mathrm{deg}^2', ), @@ -65,7 +65,7 @@ def __init__(self) -> None: units='degrees_squared', display_handler=DisplayHandler( display_name='W', - display_units='deg^2', + display_units='deg²', latex_name=r'$W$', latex_units=r'\mathrm{deg}^2', ), @@ -124,7 +124,7 @@ def __init__(self) -> None: @property def broad_gauss_u(self) -> Parameter: """ - Gaussian broadening from sample size and resolution (deg^2). + Gaussian broadening from sample size and resolution (deg²). Reading this property returns the underlying ``Parameter`` object. Assigning to it updates the parameter value. @@ -138,7 +138,7 @@ def broad_gauss_u(self, value: float) -> None: @property def broad_gauss_v(self) -> Parameter: """ - Gaussian broadening instrumental contribution (deg^2). + Gaussian broadening instrumental contribution (deg²). Reading this property returns the underlying ``Parameter`` object. Assigning to it updates the parameter value. @@ -152,7 +152,7 @@ def broad_gauss_v(self, value: float) -> None: @property def broad_gauss_w(self) -> Parameter: """ - Gaussian broadening instrumental contribution (deg^2). + Gaussian broadening instrumental contribution (deg²). Reading this property returns the underlying ``Parameter`` object. Assigning to it updates the parameter value. diff --git a/src/easydiffraction/report/data_context.py b/src/easydiffraction/report/data_context.py index ce6fe4ca9..2cbe44ac5 100644 --- a/src/easydiffraction/report/data_context.py +++ b/src/easydiffraction/report/data_context.py @@ -1020,14 +1020,14 @@ def _plain_unit_text(value: str) -> str: """Return plain unit text normalized for report display.""" return ( value - .replace('degrees_squared', 'deg^2') - .replace('degree_squared', 'deg^2') - .replace('degrees squared', 'deg^2') - .replace('degree squared', 'deg^2') + .replace('degrees_squared', 'deg²') + .replace('degree_squared', 'deg²') + .replace('degrees squared', 'deg²') + .replace('degree squared', 'deg²') .replace('degrees', 'deg') .replace('degree', 'deg') - .replace('deg²', 'deg^2') - .replace('°²', 'deg^2') + .replace('deg^2', 'deg²') + .replace('°²', 'deg²') .replace('°', 'deg') ) diff --git a/tests/unit/easydiffraction/datablocks/experiment/categories/peak/test_cwl_mixins.py b/tests/unit/easydiffraction/datablocks/experiment/categories/peak/test_cwl_mixins.py index 253bb4565..cc7201052 100644 --- a/tests/unit/easydiffraction/datablocks/experiment/categories/peak/test_cwl_mixins.py +++ b/tests/unit/easydiffraction/datablocks/experiment/categories/peak/test_cwl_mixins.py @@ -14,6 +14,8 @@ def test_cwl_pseudo_voigt_params_exist_and_settable(): assert peak.broad_gauss_u.name == 'broad_gauss_u' peak.broad_gauss_u = 0.123 assert peak.broad_gauss_u.value == 0.123 + # Squared-degree units render with a Unicode superscript. + assert peak.broad_gauss_u.resolve_display_units('gui') == 'deg²' def test_cwl_split_pseudo_voigt_adds_empirical_asymmetry(): diff --git a/tests/unit/easydiffraction/report/test_data_context.py b/tests/unit/easydiffraction/report/test_data_context.py index ff34c0be8..fe2e2c8fe 100644 --- a/tests/unit/easydiffraction/report/test_data_context.py +++ b/tests/unit/easydiffraction/report/test_data_context.py @@ -476,3 +476,12 @@ def test_report_descriptor_rows_preserve_mixed_mathjax_label_text(): assert rows[0]['html_label'] == r'\(2\theta\) offset' assert rows[0]['html_units'] == r'\(\mathrm{deg}\)' + + +def test_plain_unit_text_renders_squared_degrees_with_superscript(): + from easydiffraction.report.data_context import _plain_unit_text + + assert _plain_unit_text('degrees_squared') == 'deg²' + assert _plain_unit_text('deg^2') == 'deg²' + assert _plain_unit_text('deg²') == 'deg²' + assert _plain_unit_text('degrees') == 'deg' From eba0a58980aa0d24374052763895d13deec87316 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 21:29:24 +0200 Subject: [PATCH 32/50] Standardize tutorial section headings --- docs/docs/tutorials/ed-1.ipynb | 40 +++++++++------ docs/docs/tutorials/ed-1.py | 15 +++--- docs/docs/tutorials/ed-10.ipynb | 66 +++++++++++++++--------- docs/docs/tutorials/ed-10.py | 22 +++++--- docs/docs/tutorials/ed-11.ipynb | 74 ++++++++++++++++----------- docs/docs/tutorials/ed-11.py | 24 +++++---- docs/docs/tutorials/ed-12.ipynb | 80 +++++++++++++++++------------ docs/docs/tutorials/ed-12.py | 24 +++++---- docs/docs/tutorials/ed-13.ipynb | 30 +++++------ docs/docs/tutorials/ed-13.py | 30 +++++------ docs/docs/tutorials/ed-14.ipynb | 70 +++++++++++++------------ docs/docs/tutorials/ed-14.py | 21 ++++---- docs/docs/tutorials/ed-15.ipynb | 60 ++++++++++++---------- docs/docs/tutorials/ed-15.py | 15 +++--- docs/docs/tutorials/ed-16.ipynb | 38 +++++++------- docs/docs/tutorials/ed-16.py | 38 +++++++------- docs/docs/tutorials/ed-17.ipynb | 56 ++++++++++---------- docs/docs/tutorials/ed-17.py | 56 ++++++++++---------- docs/docs/tutorials/ed-18.ipynb | 50 +++++++++++------- docs/docs/tutorials/ed-18.py | 18 ++++--- docs/docs/tutorials/ed-2.ipynb | 68 ++++++++++++++----------- docs/docs/tutorials/ed-2.py | 19 ++++--- docs/docs/tutorials/ed-20.ipynb | 48 +++++++++--------- docs/docs/tutorials/ed-20.py | 48 +++++++++--------- docs/docs/tutorials/ed-21.ipynb | 16 +++--- docs/docs/tutorials/ed-21.py | 16 +++--- docs/docs/tutorials/ed-22.ipynb | 16 +++--- docs/docs/tutorials/ed-22.py | 16 +++--- docs/docs/tutorials/ed-23.ipynb | 64 ++++++++++++++--------- docs/docs/tutorials/ed-23.py | 20 +++++--- docs/docs/tutorials/ed-24.ipynb | 64 ++++++++++++++--------- docs/docs/tutorials/ed-24.py | 22 +++++--- docs/docs/tutorials/ed-25.ipynb | 16 +++--- docs/docs/tutorials/ed-25.py | 16 +++--- docs/docs/tutorials/ed-26.ipynb | 90 +++++++++++++++++++++------------ docs/docs/tutorials/ed-26.py | 29 +++++++---- docs/docs/tutorials/ed-3.ipynb | 82 +++++++++++++++--------------- docs/docs/tutorials/ed-3.py | 82 +++++++++++++++--------------- docs/docs/tutorials/ed-4.ipynb | 36 ++++++------- docs/docs/tutorials/ed-4.py | 36 ++++++------- docs/docs/tutorials/ed-5.ipynb | 50 +++++++++--------- docs/docs/tutorials/ed-5.py | 50 +++++++++--------- docs/docs/tutorials/ed-6.ipynb | 50 +++++++++--------- docs/docs/tutorials/ed-6.py | 50 +++++++++--------- docs/docs/tutorials/ed-7.ipynb | 54 ++++++++++---------- docs/docs/tutorials/ed-7.py | 54 ++++++++++---------- docs/docs/tutorials/ed-8.ipynb | 52 +++++++++---------- docs/docs/tutorials/ed-8.py | 52 +++++++++---------- docs/docs/tutorials/ed-9.ipynb | 40 +++++++-------- docs/docs/tutorials/ed-9.py | 40 +++++++-------- 50 files changed, 1166 insertions(+), 957 deletions(-) diff --git a/docs/docs/tutorials/ed-1.ipynb b/docs/docs/tutorials/ed-1.ipynb index 3da28c97d..39de4d787 100644 --- a/docs/docs/tutorials/ed-1.ipynb +++ b/docs/docs/tutorials/ed-1.ipynb @@ -47,7 +47,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -65,7 +65,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Define Project" + "## 📦 Define Project" ] }, { @@ -84,7 +84,7 @@ "id": "6", "metadata": {}, "source": [ - "## Step 2: Define Crystal Structure" + "## 🧩 Define Structure" ] }, { @@ -125,7 +125,7 @@ "id": "10", "metadata": {}, "source": [ - "## Step 3: Define Experiment" + "## 🔬 Define Experiment" ] }, { @@ -155,13 +155,21 @@ "id": "13", "metadata": {}, "source": [ - "## Step 4: Perform Analysis (no constraints)" + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "14", + "metadata": {}, + "source": [ + "### Without Constraints" ] }, { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -173,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -184,7 +192,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -194,16 +202,16 @@ }, { "cell_type": "markdown", - "id": "17", + "id": "18", "metadata": {}, "source": [ - "## Step 5: Perform Analysis (with constraints)" + "### With Constraints" ] }, { "cell_type": "code", "execution_count": null, - "id": "18", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -228,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -251,7 +259,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +270,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +281,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23", + "id": "24", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-1.py b/docs/docs/tutorials/ed-1.py index 5d552dc3a..07e1830b3 100644 --- a/docs/docs/tutorials/ed-1.py +++ b/docs/docs/tutorials/ed-1.py @@ -17,20 +17,20 @@ # explanation of the code, please refer to the other tutorials. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Define Project +# ## 📦 Define Project # %% # Create minimal project without name and description project = ed.Project() # %% [markdown] -# ## Step 2: Define Crystal Structure +# ## 🧩 Define Structure # %% # Download CIF file from repository @@ -45,7 +45,7 @@ project.display.structure(struct_name='lbco') # %% [markdown] -# ## Step 3: Define Experiment +# ## 🔬 Define Experiment # %% # Download CIF file from repository @@ -56,7 +56,10 @@ project.experiments.add_from_cif_path(expt_path) # %% [markdown] -# ## Step 4: Perform Analysis (no constraints) +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### Without Constraints # %% # Start refinement. All parameters, which have standard uncertainties @@ -72,7 +75,7 @@ project.display.fit.correlations() # %% [markdown] -# ## Step 5: Perform Analysis (with constraints) +# ### With Constraints # %% # As can be seen from the parameter-correlation plot, the isotropic diff --git a/docs/docs/tutorials/ed-10.ipynb b/docs/docs/tutorials/ed-10.ipynb index debd33e35..e2b947d23 100644 --- a/docs/docs/tutorials/ed-10.ipynb +++ b/docs/docs/tutorials/ed-10.ipynb @@ -39,7 +39,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -57,13 +57,21 @@ "id": "4", "metadata": {}, "source": [ - "## Create Project" + "## 📦 Define Project" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### Create Project" ] }, { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -72,16 +80,16 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "7", "metadata": {}, "source": [ - "## Add Structure" + "### Add Structure" ] }, { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -91,7 +99,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -111,16 +119,16 @@ }, { "cell_type": "markdown", - "id": "9", + "id": "10", "metadata": {}, "source": [ - "## Plot Structure" + "### Display Structure" ] }, { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -129,16 +137,16 @@ }, { "cell_type": "markdown", - "id": "11", + "id": "12", "metadata": {}, "source": [ - "## Add Experiment" + "### Add Experiment" ] }, { "cell_type": "code", "execution_count": null, - "id": "12", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +156,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -165,7 +173,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -180,16 +188,24 @@ }, { "cell_type": "markdown", - "id": "15", + "id": "16", "metadata": {}, "source": [ - "## Select Fitting Parameters" + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "17", + "metadata": {}, + "source": [ + "### Set Free Parameters" ] }, { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -200,7 +216,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -211,16 +227,16 @@ }, { "cell_type": "markdown", - "id": "18", + "id": "20", "metadata": {}, "source": [ - "## Run Fitting" + "### Run Fitting" ] }, { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -231,16 +247,16 @@ }, { "cell_type": "markdown", - "id": "20", + "id": "22", "metadata": {}, "source": [ - "## Plot Measured vs Calculated" + "### Display Pattern" ] }, { "cell_type": "code", "execution_count": null, - "id": "21", + "id": "23", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-10.py b/docs/docs/tutorials/ed-10.py index fc788d923..1b5077fb8 100644 --- a/docs/docs/tutorials/ed-10.py +++ b/docs/docs/tutorials/ed-10.py @@ -9,19 +9,22 @@ # https://github.com/diffpy/cmi_exchange/tree/main/cmi_scripts/fitNiPDF # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Create Project +# ## 📦 Define Project + +# %% [markdown] +# ### Create Project # %% project = ed.Project() # %% [markdown] -# ## Add Structure +# ### Add Structure # %% project.structures.create(name='ni') @@ -41,13 +44,13 @@ ) # %% [markdown] -# ## Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='ni') # %% [markdown] -# ## Add Experiment +# ### Add Experiment # %% data_path = ed.download_data(id=6, destination='data') @@ -72,7 +75,10 @@ project.experiments['pdf'].peak.damp_particle_diameter = 0 # %% [markdown] -# ## Select Fitting Parameters +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### Set Free Parameters # %% project.structures['ni'].cell.length_a.free = True @@ -84,7 +90,7 @@ project.experiments['pdf'].peak.sharp_delta_2.free = True # %% [markdown] -# ## Run Fitting +# ### Run Fitting # %% project.analysis.fit() @@ -92,7 +98,7 @@ project.display.fit.correlations(threshold=0.75) # %% [markdown] -# ## Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='pdf') diff --git a/docs/docs/tutorials/ed-11.ipynb b/docs/docs/tutorials/ed-11.ipynb index 0e9d8cf6d..13f867925 100644 --- a/docs/docs/tutorials/ed-11.ipynb +++ b/docs/docs/tutorials/ed-11.ipynb @@ -36,7 +36,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -54,13 +54,21 @@ "id": "4", "metadata": {}, "source": [ - "## Create Project" + "## 📦 Define Project" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### Create Project" ] }, { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -69,16 +77,16 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "7", "metadata": {}, "source": [ - "## Set Plotting Engine" + "### Set Plotting Engine" ] }, { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -88,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -98,16 +106,16 @@ }, { "cell_type": "markdown", - "id": "9", + "id": "10", "metadata": {}, "source": [ - "## Add Structure" + "### Add Structure" ] }, { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +125,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -138,16 +146,16 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "13", "metadata": {}, "source": [ - "## Plot Structure" + "### Display Structure" ] }, { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -156,16 +164,16 @@ }, { "cell_type": "markdown", - "id": "14", + "id": "15", "metadata": {}, "source": [ - "## Add Experiment" + "### Add Experiment" ] }, { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -175,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -192,7 +200,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -208,16 +216,24 @@ }, { "cell_type": "markdown", - "id": "18", + "id": "19", + "metadata": {}, + "source": [ + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "20", "metadata": {}, "source": [ - "## Select Fitting Parameters" + "### Set Free Parameters" ] }, { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -229,7 +245,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -241,16 +257,16 @@ }, { "cell_type": "markdown", - "id": "21", + "id": "23", "metadata": {}, "source": [ - "## Run Fitting" + "### Run Fitting" ] }, { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -261,16 +277,16 @@ }, { "cell_type": "markdown", - "id": "23", + "id": "25", "metadata": {}, "source": [ - "## Plot Measured vs Calculated" + "### Display Pattern" ] }, { "cell_type": "code", "execution_count": null, - "id": "24", + "id": "26", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-11.py b/docs/docs/tutorials/ed-11.py index 9125b432b..e8d878f27 100644 --- a/docs/docs/tutorials/ed-11.py +++ b/docs/docs/tutorials/ed-11.py @@ -6,19 +6,22 @@ # diffraction experiment at NOMAD at SNS. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Create Project +# ## 📦 Define Project + +# %% [markdown] +# ### Create Project # %% project = ed.Project() # %% [markdown] -# ## Set Plotting Engine +# ### Set Plotting Engine # %% project.rendering_plot.show_supported() @@ -28,7 +31,7 @@ project.rendering_plot.plotter.x_max = 40 # %% [markdown] -# ## Add Structure +# ### Add Structure # %% project.structures.create(name='si') @@ -49,13 +52,13 @@ ) # %% [markdown] -# ## Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='si') # %% [markdown] -# ## Add Experiment +# ### Add Experiment # %% data_path = ed.download_data(id=5, destination='data') @@ -81,7 +84,10 @@ experiment.peak.damp_particle_diameter = 0 # %% [markdown] -# ## Select Fitting Parameters +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### Set Free Parameters # %% project.structures['si'].cell.length_a.free = True @@ -95,7 +101,7 @@ experiment.peak.sharp_delta_2.free = True # %% [markdown] -# ## Run Fitting +# ### Run Fitting # %% project.analysis.fit() @@ -103,7 +109,7 @@ project.display.fit.correlations() # %% [markdown] -# ## Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='nomad', include=('measured', 'calculated')) diff --git a/docs/docs/tutorials/ed-12.ipynb b/docs/docs/tutorials/ed-12.ipynb index 28b12b58c..4724b20b6 100644 --- a/docs/docs/tutorials/ed-12.ipynb +++ b/docs/docs/tutorials/ed-12.ipynb @@ -39,7 +39,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -57,13 +57,21 @@ "id": "4", "metadata": {}, "source": [ - "## Create Project" + "## 📦 Define Project" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### Create Project" ] }, { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -72,16 +80,16 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "7", "metadata": {}, "source": [ - "## Set Plotting Engine" + "### Set Plotting Engine" ] }, { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -93,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -104,16 +112,16 @@ }, { "cell_type": "markdown", - "id": "9", + "id": "10", "metadata": {}, "source": [ - "## Add Structure" + "### Add Structure" ] }, { "cell_type": "code", "execution_count": null, - "id": "10", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -123,7 +131,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -152,16 +160,16 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "13", "metadata": {}, "source": [ - "## Plot Structure" + "### Display Structure" ] }, { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -170,16 +178,16 @@ }, { "cell_type": "markdown", - "id": "14", + "id": "15", "metadata": {}, "source": [ - "## Add Experiment" + "### Add Experiment" ] }, { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -189,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -206,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -226,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -241,7 +249,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -250,16 +258,24 @@ }, { "cell_type": "markdown", - "id": "21", + "id": "22", "metadata": {}, "source": [ - "## Select Fitting Parameters" + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "23", + "metadata": {}, + "source": [ + "### Set Free Parameters" ] }, { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -271,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -282,16 +298,16 @@ }, { "cell_type": "markdown", - "id": "24", + "id": "26", "metadata": {}, "source": [ - "## Run Fitting" + "### Run Fitting" ] }, { "cell_type": "code", "execution_count": null, - "id": "25", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -302,16 +318,16 @@ }, { "cell_type": "markdown", - "id": "26", + "id": "28", "metadata": {}, "source": [ - "## Plot Measured vs Calculated" + "### Display Pattern" ] }, { "cell_type": "code", "execution_count": null, - "id": "27", + "id": "29", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-12.py b/docs/docs/tutorials/ed-12.py index 834adfcd3..2e38828ea 100644 --- a/docs/docs/tutorials/ed-12.py +++ b/docs/docs/tutorials/ed-12.py @@ -9,19 +9,22 @@ # https://github.com/diffpy/add2019-diffpy-cmi/tree/master # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Create Project +# ## 📦 Define Project + +# %% [markdown] +# ### Create Project # %% project = ed.Project() # %% [markdown] -# ## Set Plotting Engine +# ### Set Plotting Engine # %% # Keep the auto-selected engine. Alternatively, you can uncomment the @@ -34,7 +37,7 @@ project.rendering_plot.plotter.x_max = 30.0 # %% [markdown] -# ## Add Structure +# ### Add Structure # %% project.structures.create(name='nacl') @@ -63,13 +66,13 @@ ) # %% [markdown] -# ## Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='nacl') # %% [markdown] -# ## Add Experiment +# ### Add Experiment # %% data_path = ed.download_data(id=4, destination='data') @@ -102,7 +105,10 @@ project.experiments['xray_pdf'].linked_phases.create(id='nacl', scale=0.5) # %% [markdown] -# ## Select Fitting Parameters +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### Set Free Parameters # %% project.structures['nacl'].cell.length_a.free = True @@ -115,7 +121,7 @@ project.experiments['xray_pdf'].peak.sharp_delta_2.free = True # %% [markdown] -# ## Run Fitting +# ### Run Fitting # %% project.analysis.fit() @@ -123,7 +129,7 @@ project.display.fit.correlations() # %% [markdown] -# ## Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='xray_pdf') diff --git a/docs/docs/tutorials/ed-13.ipynb b/docs/docs/tutorials/ed-13.ipynb index ad016e87f..1ac483d2c 100644 --- a/docs/docs/tutorials/ed-13.ipynb +++ b/docs/docs/tutorials/ed-13.ipynb @@ -349,7 +349,7 @@ "id": "25", "metadata": {}, "source": [ - "#### Set Instrument Parameters\n", + "#### Set Instrument\n", "\n", "After the experiment is created and measured data is loaded, we need\n", "to set the instrument parameters.\n", @@ -470,7 +470,7 @@ "id": "34", "metadata": {}, "source": [ - "#### Set Peak Profile Parameters\n", + "#### Set Peak Profile\n", "\n", "The next set of parameters is needed to define the peak profile used\n", "in the fitting process. The peak profile describes the shape of the\n", @@ -787,7 +787,7 @@ "id": "52", "metadata": {}, "source": [ - "#### Set Lattice Parameters" + "#### Set Unit Cell" ] }, { @@ -851,7 +851,7 @@ "id": "58", "metadata": {}, "source": [ - "#### Visualize Structure\n", + "#### Display Structure\n", "\n", "Render the Si structure to confirm the model was built correctly before\n", "linking it to the experiment." @@ -954,7 +954,7 @@ "id": "66", "metadata": {}, "source": [ - "#### Set Fit Parameters\n", + "#### Set Free Parameters\n", "\n", "To perform the fit, we need to specify the refinement parameters.\n", "These are the parameters that will be adjusted during the fitting\n", @@ -997,7 +997,7 @@ "id": "68", "metadata": {}, "source": [ - "#### Show Free Parameters\n", + "#### Display Free Parameters\n", "\n", "We can check which parameters are free to be refined by calling the\n", "`free` method of the `display.parameters` object of the project." @@ -1031,7 +1031,7 @@ "id": "71", "metadata": {}, "source": [ - "#### Visualize Diffraction Patterns\n", + "#### Display Pattern\n", "\n", "Before performing the fit, we can visually compare the measured\n", "diffraction pattern with the calculated diffraction pattern based on\n", @@ -1088,7 +1088,7 @@ "id": "76", "metadata": {}, "source": [ - "#### Check Fit Results\n", + "#### Display Fit Results\n", "\n", "You can see that the agreement between the measured and calculated\n", "diffraction patterns is now much improved and that the intensities of\n", @@ -1107,7 +1107,7 @@ "id": "77", "metadata": {}, "source": [ - "#### Visualize Fit Results\n", + "#### Display Fit Results\n", "\n", "After the fit is completed, we can plot the comparison between the\n", "measured and calculated diffraction patterns again to see how well the\n", @@ -1382,7 +1382,7 @@ "id": "98", "metadata": {}, "source": [ - "#### Exercise 2.2: Set Instrument Parameters\n", + "#### Exercise 2.2: Set Instrument\n", "\n", "Set the instrument parameters for the LBCO experiment." ] @@ -1432,7 +1432,7 @@ "id": "103", "metadata": {}, "source": [ - "#### Exercise 2.3: Set Peak Profile Parameters\n", + "#### Exercise 2.3: Set Peak Profile\n", "\n", "Set the peak profile parameters for the LBCO experiment." ] @@ -1718,7 +1718,7 @@ "id": "126", "metadata": {}, "source": [ - "#### Exercise 3.3: Set Lattice Parameters\n", + "#### Exercise 3.3: Set Unit Cell\n", "\n", "Set the lattice parameters for the LBCO structure." ] @@ -1844,7 +1844,7 @@ "id": "136", "metadata": {}, "source": [ - "#### Visualize Structure\n", + "#### Display Structure\n", "\n", "Render the LBCO structure you just built before linking it to the\n", "experiment." @@ -1912,7 +1912,7 @@ "source": [ "### 🚀 Exercise 5: Analyze and Fit the Data\n", "\n", - "#### Exercise 5.1: Set Fit Parameters\n", + "#### Exercise 5.1: Set Free Parameters\n", "\n", "Select the initial set of parameters to be refined during the fitting\n", "process." @@ -2155,7 +2155,7 @@ "id": "165", "metadata": {}, "source": [ - "#### Exercise 5.5: Visualize the Fit Results in d-spacing\n", + "#### Exercise 5.5: Display Fit Results (d-spacing)\n", "\n", "Plot measured vs calculated diffraction patterns in d-spacing instead\n", "of TOF." diff --git a/docs/docs/tutorials/ed-13.py b/docs/docs/tutorials/ed-13.py index a72473422..454f82502 100644 --- a/docs/docs/tutorials/ed-13.py +++ b/docs/docs/tutorials/ed-13.py @@ -186,7 +186,7 @@ project_1.display.pattern(expt_name='sim_si', include=('measured', 'excluded')) # %% [markdown] -# #### Set Instrument Parameters +# #### Set Instrument # # After the experiment is created and measured data is loaded, we need # to set the instrument parameters. @@ -256,7 +256,7 @@ # attributes. # %% [markdown] -# #### Set Peak Profile Parameters +# #### Set Peak Profile # # The next set of parameters is needed to define the peak profile used # in the fitting process. The peak profile describes the shape of the @@ -471,7 +471,7 @@ project_1.structures['si'].space_group.it_coordinate_system_code = '2' # %% [markdown] -# #### Set Lattice Parameters +# #### Set Unit Cell # %% [markdown] tags=["doc-link"] # 📖 See @@ -501,7 +501,7 @@ ) # %% [markdown] -# #### Visualize Structure +# #### Display Structure # # Render the Si structure to confirm the model was built correctly before # linking it to the experiment. @@ -558,7 +558,7 @@ # for more details about the fitting process in EasyDiffraction. # %% [markdown] -# #### Set Fit Parameters +# #### Set Free Parameters # # To perform the fit, we need to specify the refinement parameters. # These are the parameters that will be adjusted during the fitting @@ -589,7 +589,7 @@ project_1.experiments['sim_si'].peak.exp_rise_alpha_1.free = True # %% [markdown] -# #### Show Free Parameters +# #### Display Free Parameters # # We can check which parameters are free to be refined by calling the # `free` method of the `display.parameters` object of the project. @@ -606,7 +606,7 @@ project_1.display.parameters.free() # %% [markdown] -# #### Visualize Diffraction Patterns +# #### Display Pattern # # Before performing the fit, we can visually compare the measured # diffraction pattern with the calculated diffraction pattern based on @@ -634,7 +634,7 @@ project_1.display.fit.results() # %% [markdown] -# #### Check Fit Results +# #### Display Fit Results # # You can see that the agreement between the measured and calculated # diffraction patterns is now much improved and that the intensities of @@ -648,7 +648,7 @@ # 1, indicating a good fit. # %% [markdown] -# #### Visualize Fit Results +# #### Display Fit Results # # After the fit is completed, we can plot the comparison between the # measured and calculated diffraction patterns again to see how well the @@ -806,7 +806,7 @@ project_2.display.pattern(expt_name='sim_lbco', include=('measured', 'excluded')) # %% [markdown] -# #### Exercise 2.2: Set Instrument Parameters +# #### Exercise 2.2: Set Instrument # # Set the instrument parameters for the LBCO experiment. @@ -829,7 +829,7 @@ ) # %% [markdown] -# #### Exercise 2.3: Set Peak Profile Parameters +# #### Exercise 2.3: Set Peak Profile # # Set the peak profile parameters for the LBCO experiment. @@ -992,7 +992,7 @@ project_2.structures['lbco'].space_group.it_coordinate_system_code = '1' # %% [markdown] -# #### Exercise 3.3: Set Lattice Parameters +# #### Exercise 3.3: Set Unit Cell # # Set the lattice parameters for the LBCO structure. @@ -1064,7 +1064,7 @@ ) # %% [markdown] -# #### Visualize Structure +# #### Display Structure # # Render the LBCO structure you just built before linking it to the # experiment. @@ -1093,7 +1093,7 @@ # %% [markdown] # ### 🚀 Exercise 5: Analyze and Fit the Data # -# #### Exercise 5.1: Set Fit Parameters +# #### Exercise 5.1: Set Free Parameters # # Select the initial set of parameters to be refined during the fitting # process. @@ -1218,7 +1218,7 @@ # substantial impact on the quality of the fit. # %% [markdown] -# #### Exercise 5.5: Visualize the Fit Results in d-spacing +# #### Exercise 5.5: Display Fit Results (d-spacing) # # Plot measured vs calculated diffraction patterns in d-spacing instead # of TOF. diff --git a/docs/docs/tutorials/ed-14.ipynb b/docs/docs/tutorials/ed-14.ipynb index d3700c264..2c744b0da 100644 --- a/docs/docs/tutorials/ed-14.ipynb +++ b/docs/docs/tutorials/ed-14.ipynb @@ -35,7 +35,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -53,7 +53,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Define Project" + "## 📦 Define Project" ] }, { @@ -78,7 +78,7 @@ "id": "6", "metadata": {}, "source": [ - "## Step 2: Define Structure" + "## 🧩 Define Structure" ] }, { @@ -173,7 +173,7 @@ "id": "15", "metadata": {}, "source": [ - "### Structure View (ADP mode)\n", + "### Display Structure (ADP)\n", "\n", "Select the ADP atom view. With the starting isotropic displacements every\n", "atom is drawn as a sphere; after the anisotropic refinement below, the same\n", @@ -205,7 +205,7 @@ "id": "18", "metadata": {}, "source": [ - "## Step 3: Define Experiment" + "## 🔬 Define Experiment" ] }, { @@ -282,13 +282,21 @@ "id": "25", "metadata": {}, "source": [ - "## Step 4: Perform Analysis I (ADP iso)" + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "26", + "metadata": {}, + "source": [ + "### ADP iso" ] }, { "cell_type": "code", "execution_count": null, - "id": "26", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -298,7 +306,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -317,7 +325,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +336,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +348,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +359,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -361,7 +369,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -381,7 +389,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -390,16 +398,16 @@ }, { "cell_type": "markdown", - "id": "35", + "id": "36", "metadata": {}, "source": [ - "## Step 5: Perform Analysis (ADP aniso)" + "### ADP aniso" ] }, { "cell_type": "code", "execution_count": null, - "id": "36", + "id": "37", "metadata": {}, "outputs": [], "source": [ @@ -412,7 +420,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -422,7 +430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38", + "id": "39", "metadata": {}, "outputs": [], "source": [ @@ -439,7 +447,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39", + "id": "40", "metadata": {}, "outputs": [], "source": [ @@ -449,7 +457,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40", + "id": "41", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +467,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41", + "id": "42", "metadata": {}, "outputs": [], "source": [ @@ -469,7 +477,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42", + "id": "43", "metadata": {}, "outputs": [], "source": [ @@ -479,7 +487,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43", + "id": "44", "metadata": {}, "outputs": [], "source": [ @@ -488,10 +496,10 @@ }, { "cell_type": "markdown", - "id": "44", + "id": "45", "metadata": {}, "source": [ - "### Structure View after refinement\n", + "### Display Structure (final)\n", "\n", "Tb, Ti and O1 were refined with anisotropic displacements (`Uani`), so the\n", "ADP view now draws them as probability ellipsoids, while O2 stayed isotropic\n", @@ -502,7 +510,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45", + "id": "46", "metadata": {}, "outputs": [], "source": [ @@ -511,16 +519,16 @@ }, { "cell_type": "markdown", - "id": "46", + "id": "47", "metadata": {}, "source": [ - "## Step 6: Generate Report" + "## 📊 Report" ] }, { "cell_type": "code", "execution_count": null, - "id": "47", + "id": "48", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-14.py b/docs/docs/tutorials/ed-14.py index 24017b691..f0b214526 100644 --- a/docs/docs/tutorials/ed-14.py +++ b/docs/docs/tutorials/ed-14.py @@ -5,13 +5,13 @@ # diffraction data from HEiDi at FRM II. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Define Project +# ## 📦 Define Project # %% # Create minimal project without name and description @@ -24,7 +24,7 @@ project.save_as('projects/tbti_heidi') # %% [markdown] -# ## Step 2: Define Structure +# ## 🧩 Define Structure # %% # Download CIF file from repository @@ -58,7 +58,7 @@ structure.atom_sites['O2'].adp_iso = 0.0 # %% [markdown] -# ### Structure View (ADP mode) +# ### Display Structure (ADP) # # Select the ADP atom view. With the starting isotropic displacements every # atom is drawn as a sphere; after the anisotropic refinement below, the same @@ -71,7 +71,7 @@ project.display.structure(struct_name='tbti') # %% [markdown] -# ## Step 3: Define Experiment +# ## 🔬 Define Experiment # %% # Download data file from repository @@ -101,7 +101,10 @@ experiment.extinction.radius = 10 # %% [markdown] -# ## Step 4: Perform Analysis I (ADP iso) +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### ADP iso # %% project.display.pattern(expt_name='heidi') @@ -144,7 +147,7 @@ project.display.pattern(expt_name='heidi') # %% [markdown] -# ## Step 5: Perform Analysis (ADP aniso) +# ### ADP aniso # %% structure.atom_sites['Tb'].adp_type = 'Uani' @@ -181,7 +184,7 @@ structure.show_as_cif() # %% [markdown] -# ### Structure View after refinement +# ### Display Structure (final) # # Tb, Ti and O1 were refined with anisotropic displacements (`Uani`), so the # ADP view now draws them as probability ellipsoids, while O2 stayed isotropic @@ -192,7 +195,7 @@ project.display.structure(struct_name='tbti') # %% [markdown] -# ## Step 6: Generate Report +# ## 📊 Report # %% # Enable PDF report generation before the last save (time consuming) diff --git a/docs/docs/tutorials/ed-15.ipynb b/docs/docs/tutorials/ed-15.ipynb index 90fbc0d1c..821429bd9 100644 --- a/docs/docs/tutorials/ed-15.ipynb +++ b/docs/docs/tutorials/ed-15.ipynb @@ -35,7 +35,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -53,7 +53,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Define Project" + "## 📦 Define Project" ] }, { @@ -72,7 +72,7 @@ "id": "6", "metadata": {}, "source": [ - "## Step 2: Define Structure" + "## 🧩 Define Structure" ] }, { @@ -141,7 +141,7 @@ "id": "13", "metadata": {}, "source": [ - "## Step 3: Define Experiment" + "## 🔬 Define Experiment" ] }, { @@ -208,13 +208,21 @@ "id": "19", "metadata": {}, "source": [ - "## Step 4: Perform Analysis I (ADP iso)" + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "20", + "metadata": {}, + "source": [ + "### ADP iso" ] }, { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +232,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +243,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -245,7 +253,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +263,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -266,7 +274,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -289,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -299,7 +307,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -309,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "29", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -318,16 +326,16 @@ }, { "cell_type": "markdown", - "id": "30", + "id": "31", "metadata": {}, "source": [ - "## Step 5: Perform Analysis (ADP aniso)" + "### ADP aniso" ] }, { "cell_type": "code", "execution_count": null, - "id": "31", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -338,7 +346,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +359,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -361,7 +369,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35", + "id": "36", "metadata": {}, "outputs": [], "source": [ @@ -381,7 +389,7 @@ { "cell_type": "code", "execution_count": null, - "id": "36", + "id": "37", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +399,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +409,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38", + "id": "39", "metadata": {}, "outputs": [], "source": [ @@ -411,7 +419,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39", + "id": "40", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-15.py b/docs/docs/tutorials/ed-15.py index 611e46941..2fcf91934 100644 --- a/docs/docs/tutorials/ed-15.py +++ b/docs/docs/tutorials/ed-15.py @@ -5,20 +5,20 @@ # crystal neutron diffraction data from SENJU at J-PARC. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Define Project +# ## 📦 Define Project # %% # Create minimal project without name and description project = ed.Project() # %% [markdown] -# ## Step 2: Define Structure +# ## 🧩 Define Structure # %% # Download CIF file from repository @@ -40,7 +40,7 @@ project.display.structure(struct_name='taurine') # %% [markdown] -# ## Step 3: Define Experiment +# ## 🔬 Define Experiment # %% # Download data file from repository @@ -67,7 +67,10 @@ experiment.extinction.radius = 100.0 # %% [markdown] -# ## Step 4: Perform Analysis I (ADP iso) +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### ADP iso # %% project.display.pattern(expt_name='senju') @@ -105,7 +108,7 @@ project.display.pattern(expt_name='senju') # %% [markdown] -# ## Step 5: Perform Analysis (ADP aniso) +# ### ADP aniso # %% for atom_site in structure.atom_sites: diff --git a/docs/docs/tutorials/ed-16.ipynb b/docs/docs/tutorials/ed-16.ipynb index ade621279..92092f299 100644 --- a/docs/docs/tutorials/ed-16.ipynb +++ b/docs/docs/tutorials/ed-16.ipynb @@ -39,7 +39,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -60,13 +60,13 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structure\n", + "## 🧩 Define Structure\n", "\n", "A single Si structure is shared between the Bragg and PDF\n", "experiments. Structural parameters refined against both datasets\n", "simultaneously.\n", "\n", - "#### Create Structure" + "### Create Structure" ] }, { @@ -84,7 +84,7 @@ "id": "6", "metadata": {}, "source": [ - "#### Set Space Group" + "### Set Space Group" ] }, { @@ -103,7 +103,7 @@ "id": "8", "metadata": {}, "source": [ - "#### Set Unit Cell" + "### Set Unit Cell" ] }, { @@ -121,7 +121,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Set Atom Sites" + "### Set Atom Sites" ] }, { @@ -147,7 +147,7 @@ "id": "12", "metadata": {}, "source": [ - "## Define Experiments\n", + "## 🔬 Define Experiments\n", "\n", "Two experiments are defined: one for Bragg diffraction and one for\n", "PDF analysis. Both are linked to the same Si structure.\n", @@ -360,12 +360,12 @@ "id": "32", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object manages the shared structure, both experiments,\n", "and the analysis.\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -383,7 +383,7 @@ "id": "34", "metadata": {}, "source": [ - "#### Add Structure" + "### Add Structure" ] }, { @@ -401,7 +401,7 @@ "id": "36", "metadata": {}, "source": [ - "#### Add Experiments" + "### Add Experiments" ] }, { @@ -420,12 +420,12 @@ "id": "38", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section shows the joint analysis process. The calculator is\n", "auto-resolved per experiment: CrysPy for Bragg, PDFfit for PDF.\n", "\n", - "#### Set Fit Mode and Weights" + "### Set Fit Mode and Weights" ] }, { @@ -445,7 +445,7 @@ "id": "40", "metadata": {}, "source": [ - "#### Plot Structure" + "### Display Structure" ] }, { @@ -463,7 +463,7 @@ "id": "42", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated (Before Fit)" + "### Display Pattern (Before Fit)" ] }, { @@ -491,7 +491,7 @@ "id": "45", "metadata": {}, "source": [ - "#### Set Fitting Parameters\n", + "### Set Free Parameters\n", "\n", "Shared structural parameters are refined against both datasets\n", "simultaneously." @@ -559,7 +559,7 @@ "id": "51", "metadata": {}, "source": [ - "#### Show Free Parameters" + "### Display Free Parameters" ] }, { @@ -577,7 +577,7 @@ "id": "53", "metadata": {}, "source": [ - "#### Run Fitting" + "### Run Fitting" ] }, { @@ -597,7 +597,7 @@ "id": "55", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated (After Fit)" + "### Display Pattern (After Fit)" ] }, { diff --git a/docs/docs/tutorials/ed-16.py b/docs/docs/tutorials/ed-16.py index f7345b7f2..2ede48cfb 100644 --- a/docs/docs/tutorials/ed-16.py +++ b/docs/docs/tutorials/ed-16.py @@ -9,7 +9,7 @@ # is refined simultaneously against both datasets. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -18,32 +18,32 @@ from easydiffraction import download_data # %% [markdown] -# ## Define Structure +# ## 🧩 Define Structure # # A single Si structure is shared between the Bragg and PDF # experiments. Structural parameters refined against both datasets # simultaneously. # -# #### Create Structure +# ### Create Structure # %% structure = StructureFactory.from_scratch(name='si') # %% [markdown] -# #### Set Space Group +# ### Set Space Group # %% structure.space_group.name_h_m = 'F d -3 m' structure.space_group.it_coordinate_system_code = '1' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # %% structure.cell.length_a = 5.42 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # %% structure.atom_sites.create( @@ -57,7 +57,7 @@ ) # %% [markdown] -# ## Define Experiments +# ## 🔬 Define Experiments # # Two experiments are defined: one for Bragg diffraction and one for # PDF analysis. Both are linked to the same Si structure. @@ -150,36 +150,36 @@ pdf_expt.linked_phases.create(id='si', scale=1.0) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object manages the shared structure, both experiments, # and the analysis. # -# #### Create Project +# ### Create Project # %% project = Project() # %% [markdown] -# #### Add Structure +# ### Add Structure # %% project.structures.add(structure) # %% [markdown] -# #### Add Experiments +# ### Add Experiments # %% project.experiments.add(bragg_expt) project.experiments.add(pdf_expt) # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section shows the joint analysis process. The calculator is # auto-resolved per experiment: CrysPy for Bragg, PDFfit for PDF. # -# #### Set Fit Mode and Weights +# ### Set Fit Mode and Weights # %% project.analysis.fitting_mode.type = 'joint' @@ -187,13 +187,13 @@ project.analysis.joint_fit.create(experiment_id='nomad', weight=0.3) # %% [markdown] -# #### Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='si') # %% [markdown] -# #### Plot Measured vs Calculated (Before Fit) +# ### Display Pattern (Before Fit) # %% project.display.pattern(expt_name='sepd') @@ -202,7 +202,7 @@ project.display.pattern(expt_name='nomad') # %% [markdown] -# #### Set Fitting Parameters +# ### Set Free Parameters # # Shared structural parameters are refined against both datasets # simultaneously. @@ -234,13 +234,13 @@ pdf_expt.peak.sharp_delta_2.free = True # %% [markdown] -# #### Show Free Parameters +# ### Display Free Parameters # %% project.display.parameters.free() # %% [markdown] -# #### Run Fitting +# ### Run Fitting # %% project.analysis.fit() @@ -248,7 +248,7 @@ project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated (After Fit) +# ### Display Pattern (After Fit) # %% project.display.pattern(expt_name='sepd') diff --git a/docs/docs/tutorials/ed-17.ipynb b/docs/docs/tutorials/ed-17.ipynb index 1e9e140a9..0c69f1348 100644 --- a/docs/docs/tutorials/ed-17.ipynb +++ b/docs/docs/tutorials/ed-17.ipynb @@ -38,7 +38,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -56,7 +56,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Define Project\n", + "## 📦 Define Project\n", "\n", "The project object manages structures, experiments, analysis, display,\n", "and other related components." @@ -98,12 +98,12 @@ "id": "8", "metadata": {}, "source": [ - "## Step 2: Define Crystal Structure\n", + "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters.\n", "\n", - "#### Create Structure" + "### Create Structure" ] }, { @@ -122,7 +122,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Set Space Group" + "### Set Space Group" ] }, { @@ -141,7 +141,7 @@ "id": "12", "metadata": {}, "source": [ - "#### Set Unit Cell" + "### Set Unit Cell" ] }, { @@ -161,7 +161,7 @@ "id": "14", "metadata": {}, "source": [ - "#### Set Atom Sites" + "### Set Atom Sites" ] }, { @@ -232,7 +232,7 @@ "id": "16", "metadata": {}, "source": [ - "#### Plot Structure" + "### Display Structure" ] }, { @@ -251,14 +251,14 @@ "id": "18", "metadata": {}, "source": [ - "## Step 3: Define Template Experiment\n", + "## 🔬 Define Experiment\n", "\n", "For sequential fitting, we create a single template experiment from\n", "the first data file. This template defines the instrument, peak\n", "profile, background, and linked phases that will be reused for every\n", "data file in the scan.\n", "\n", - "#### Download Measured Data" + "### Download Data" ] }, { @@ -276,7 +276,7 @@ "id": "20", "metadata": {}, "source": [ - "#### Extract Data Files" + "### Extract Data Files" ] }, { @@ -298,7 +298,7 @@ "id": "22", "metadata": {}, "source": [ - "#### Create Template Experiment from the First File" + "### Create Template Experiment" ] }, { @@ -320,7 +320,7 @@ "id": "24", "metadata": {}, "source": [ - "#### Set Instrument" + "### Set Instrument" ] }, { @@ -339,7 +339,7 @@ "id": "26", "metadata": {}, "source": [ - "#### Set Peak Profile" + "### Set Peak Profile" ] }, { @@ -360,7 +360,7 @@ "id": "28", "metadata": {}, "source": [ - "#### Set Excluded Regions" + "### Set Excluded Regions" ] }, { @@ -379,7 +379,7 @@ "id": "30", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -410,7 +410,7 @@ "id": "32", "metadata": {}, "source": [ - "#### Set Linked Phases" + "### Set Linked Phases" ] }, { @@ -428,7 +428,7 @@ "id": "34", "metadata": {}, "source": [ - "## Step 4: Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section shows how to set free parameters, define constraints,\n", "and run the sequential refinement." @@ -439,7 +439,7 @@ "id": "35", "metadata": {}, "source": [ - "#### Set Free Parameters" + "### Set Free Parameters" ] }, { @@ -498,7 +498,7 @@ "id": "38", "metadata": {}, "source": [ - "#### Set Constraints\n", + "### Set Constraints\n", "\n", "Set aliases for parameters." ] @@ -543,7 +543,7 @@ "id": "42", "metadata": {}, "source": [ - "#### Set Minimizer" + "### Set Minimizer" ] }, { @@ -561,7 +561,7 @@ "id": "44", "metadata": {}, "source": [ - "#### Run Single Fitting\n", + "### Run Fitting\n", "\n", "This is the fitting of the first dataset to optimize the initial\n", "parameters for the sequential fitting. This step is optional but can\n", @@ -594,7 +594,7 @@ "id": "47", "metadata": {}, "source": [ - "#### Show parameter correlations" + "### Display Correlations" ] }, { @@ -612,7 +612,7 @@ "id": "49", "metadata": {}, "source": [ - "#### Compare measured and calculated patterns for the first fit." + "### Display Pattern" ] }, { @@ -630,7 +630,7 @@ "id": "51", "metadata": {}, "source": [ - "#### Plot structure after the first fit." + "### Display Structure" ] }, { @@ -649,7 +649,7 @@ "id": "53", "metadata": {}, "source": [ - "#### Run Sequential Fitting\n", + "### Run Sequential Fitting\n", "\n", "Set output verbosity level to \"short\" to show only one-line status\n", "messages during the analysis process." @@ -746,7 +746,7 @@ "id": "62", "metadata": {}, "source": [ - "#### Replay a Dataset\n", + "### Replay a Dataset\n", "\n", "Apply fitted parameters from the first CSV row and plot the result." ] @@ -787,7 +787,7 @@ "id": "66", "metadata": {}, "source": [ - "#### Plot Parameter Evolution\n", + "### Display Parameter Evolution\n", "\n", "Reuse the extracted diffrn path as the x-axis in the following plots." ] diff --git a/docs/docs/tutorials/ed-17.py b/docs/docs/tutorials/ed-17.py index fb4438a75..e1879bd20 100644 --- a/docs/docs/tutorials/ed-17.py +++ b/docs/docs/tutorials/ed-17.py @@ -8,13 +8,13 @@ # file independently without loading all datasets into memory at once. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Define Project +# ## 📦 Define Project # # The project object manages structures, experiments, analysis, display, # and other related components. @@ -32,26 +32,26 @@ project.save_as(dir_path='projects/cosio_d20_scan') # %% [markdown] -# ## Step 2: Define Crystal Structure +# ## 🧩 Define Structure # # This section shows how to add structures and modify their # parameters. # -# #### Create Structure +# ### Create Structure # %% project.structures.create(name='cosio') struct = project.structures['cosio'] # %% [markdown] -# #### Set Space Group +# ### Set Space Group # %% struct.space_group.name_h_m = 'P n m a' struct.space_group.it_coordinate_system_code = 'abc' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # %% struct.cell.length_a = 10.31 @@ -59,7 +59,7 @@ struct.cell.length_c = 4.79 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # %% struct.atom_sites.create( @@ -118,27 +118,27 @@ ) # %% [markdown] -# #### Plot Structure +# ### Display Structure # %% project.structure_style.atom_view = 'adp' project.display.structure(struct_name='cosio') # %% [markdown] -# ## Step 3: Define Template Experiment +# ## 🔬 Define Experiment # # For sequential fitting, we create a single template experiment from # the first data file. This template defines the instrument, peak # profile, background, and linked phases that will be reused for every # data file in the scan. # -# #### Download Measured Data +# ### Download Data # %% zip_path = ed.download_data(id=25, destination='data') # %% [markdown] -# #### Extract Data Files +# ### Extract Data Files # %% scan_data_dir = 'experiments/d20_scan' @@ -148,7 +148,7 @@ ) # %% [markdown] -# #### Create Template Experiment from the First File +# ### Create Template Experiment # %% project.experiments.add_from_data_path( @@ -158,14 +158,14 @@ expt = project.experiments['d20'] # %% [markdown] -# #### Set Instrument +# ### Set Instrument # %% expt.instrument.setup_wavelength = 1.87 expt.instrument.calib_twotheta_offset = 0.29 # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # %% expt.peak.broad_gauss_u = 0.24 @@ -174,14 +174,14 @@ expt.peak.broad_lorentz_y = 0.02 # %% [markdown] -# #### Set Excluded Regions +# ### Set Excluded Regions # %% expt.excluded_regions.create(id='1', start=0, end=8) expt.excluded_regions.create(id='2', start=150, end=180) # %% [markdown] -# #### Set Background +# ### Set Background # %% expt.background.create(id='1', x=8, y=609) @@ -200,19 +200,19 @@ expt.background.create(id='14', x=150, y=241) # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # %% expt.linked_phases.create(id='cosio', scale=1.2) # %% [markdown] -# ## Step 4: Perform Analysis +# ## 🚀 Perform Analysis # # This section shows how to set free parameters, define constraints, # and run the sequential refinement. # %% [markdown] -# #### Set Free Parameters +# ### Set Free Parameters # %% struct.cell.length_a.free = True @@ -252,7 +252,7 @@ point.y.free = True # %% [markdown] -# #### Set Constraints +# ### Set Constraints # # Set aliases for parameters. @@ -273,13 +273,13 @@ analysis.constraints.create(expression='biso_Co2 = biso_Co1') # %% [markdown] -# #### Set Minimizer +# ### Set Minimizer # %% analysis.minimizer.type = 'bumps (lm)' # %% [markdown] -# #### Run Single Fitting +# ### Run Fitting # # This is the fitting of the first dataset to optimize the initial # parameters for the sequential fitting. This step is optional but can @@ -293,26 +293,26 @@ display.fit.results() # %% [markdown] -# #### Show parameter correlations +# ### Display Correlations # %% display.fit.correlations() # %% [markdown] -# #### Compare measured and calculated patterns for the first fit. +# ### Display Pattern # %% display.pattern(expt_name='d20') # %% [markdown] -# #### Plot structure after the first fit. +# ### Display Structure # %% project.structure_style.atom_view = 'adp' project.display.structure(struct_name='cosio') # %% [markdown] -# #### Run Sequential Fitting +# ### Run Sequential Fitting # # Set output verbosity level to "short" to show only one-line status # messages during the analysis process. @@ -353,7 +353,7 @@ analysis.fit() # %% [markdown] -# #### Replay a Dataset +# ### Replay a Dataset # # Apply fitted parameters from the first CSV row and plot the result. @@ -370,7 +370,7 @@ display.pattern(expt_name='d20') # %% [markdown] -# #### Plot Parameter Evolution +# ### Display Parameter Evolution # # Reuse the extracted diffrn path as the x-axis in the following plots. diff --git a/docs/docs/tutorials/ed-18.ipynb b/docs/docs/tutorials/ed-18.ipynb index e4b40ffbb..86d6cb69d 100644 --- a/docs/docs/tutorials/ed-18.ipynb +++ b/docs/docs/tutorials/ed-18.ipynb @@ -42,7 +42,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Modules" + "## 🛠️ Import Library" ] }, { @@ -61,13 +61,21 @@ "id": "4", "metadata": {}, "source": [ - "## Download Saved Project" + "## 📂 Load Project" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### Download Project" ] }, { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -76,16 +84,16 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "7", "metadata": {}, "source": [ - "## Load Project" + "### Load Project" ] }, { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -94,16 +102,24 @@ }, { "cell_type": "markdown", - "id": "8", + "id": "9", + "metadata": {}, + "source": [ + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "10", "metadata": {}, "source": [ - "## View Structure" + "### Display Structure" ] }, { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -112,16 +128,16 @@ }, { "cell_type": "markdown", - "id": "10", + "id": "12", "metadata": {}, "source": [ - "## Perform Analysis" + "### Run Fitting" ] }, { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -130,16 +146,16 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "14", "metadata": {}, "source": [ - "## Show Results" + "### Display Fit Results" ] }, { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -149,7 +165,7 @@ { "cell_type": "code", "execution_count": null, - "id": "14", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "17", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-18.py b/docs/docs/tutorials/ed-18.py index 0ab4d168b..f3caa2e09 100644 --- a/docs/docs/tutorials/ed-18.py +++ b/docs/docs/tutorials/ed-18.py @@ -12,38 +12,44 @@ # comments or explanations — these can be found in the other tutorials. # %% [markdown] -# ## Import Modules +# ## 🛠️ Import Library # %% from easydiffraction import Project from easydiffraction import download_data # %% [markdown] -# ## Download Saved Project +# ## 📂 Load Project + +# %% [markdown] +# ### Download Project # %% project_dir = download_data(id=36, destination='projects') # %% [markdown] -# ## Load Project +# ### Load Project # %% project = Project.load(project_dir) # %% [markdown] -# ## View Structure +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### Display Structure # %% project.display.structure(struct_name='lbco') # %% [markdown] -# ## Perform Analysis +# ### Run Fitting # %% project.analysis.fit() # %% [markdown] -# ## Show Results +# ### Display Fit Results # %% project.display.fit.results() diff --git a/docs/docs/tutorials/ed-2.ipynb b/docs/docs/tutorials/ed-2.ipynb index 017a5ae43..b2ca221f2 100644 --- a/docs/docs/tutorials/ed-2.ipynb +++ b/docs/docs/tutorials/ed-2.ipynb @@ -52,7 +52,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -70,7 +70,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Define Project" + "## 📦 Define Project" ] }, { @@ -88,7 +88,7 @@ "id": "6", "metadata": {}, "source": [ - "## Step 2: Define Structure" + "## 🧩 Define Structure" ] }, { @@ -194,7 +194,7 @@ "id": "13", "metadata": {}, "source": [ - "## Step 3: Define Experiment" + "## 🔬 Define Experiment" ] }, { @@ -297,13 +297,21 @@ "id": "22", "metadata": {}, "source": [ - "## Step 4: Perform Analysis (no constraints)" + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "23", + "metadata": {}, + "source": [ + "### Without Constraints" ] }, { "cell_type": "code", "execution_count": null, - "id": "23", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -318,7 +326,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -351,7 +359,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -361,7 +369,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -371,7 +379,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -380,16 +388,16 @@ }, { "cell_type": "markdown", - "id": "29", + "id": "30", "metadata": {}, "source": [ - "## Step 5: Perform Analysis (with constraints)" + "### With Constraints" ] }, { "cell_type": "code", "execution_count": null, - "id": "30", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -414,7 +422,7 @@ { "cell_type": "code", "execution_count": null, - "id": "31", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "32", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -435,7 +443,7 @@ { "cell_type": "code", "execution_count": null, - "id": "33", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -445,7 +453,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -455,7 +463,7 @@ { "cell_type": "code", "execution_count": null, - "id": "35", + "id": "36", "metadata": {}, "outputs": [], "source": [ @@ -464,16 +472,16 @@ }, { "cell_type": "markdown", - "id": "36", + "id": "37", "metadata": {}, "source": [ - "## Step 6: Switch calculator engine" + "### Switch Calculator" ] }, { "cell_type": "code", "execution_count": null, - "id": "37", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -483,7 +491,7 @@ { "cell_type": "code", "execution_count": null, - "id": "38", + "id": "39", "metadata": {}, "outputs": [], "source": [ @@ -493,7 +501,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39", + "id": "40", "metadata": {}, "outputs": [], "source": [ @@ -503,7 +511,7 @@ { "cell_type": "code", "execution_count": null, - "id": "40", + "id": "41", "metadata": {}, "outputs": [], "source": [ @@ -513,7 +521,7 @@ { "cell_type": "code", "execution_count": null, - "id": "41", + "id": "42", "metadata": {}, "outputs": [], "source": [ @@ -523,7 +531,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42", + "id": "43", "metadata": {}, "outputs": [], "source": [ @@ -532,16 +540,16 @@ }, { "cell_type": "markdown", - "id": "43", + "id": "44", "metadata": {}, "source": [ - "## Step 7: Save Project" + "## 💾 Save Project" ] }, { "cell_type": "code", "execution_count": null, - "id": "44", + "id": "45", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-2.py b/docs/docs/tutorials/ed-2.py index 21fd3184b..5ede4537b 100644 --- a/docs/docs/tutorials/ed-2.py +++ b/docs/docs/tutorials/ed-2.py @@ -22,19 +22,19 @@ # the code, please refer to the other tutorials. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Define Project +# ## 📦 Define Project # %% project = ed.Project() # %% [markdown] -# ## Step 2: Define Structure +# ## 🧩 Define Structure # %% project.structures.create(name='lbco') @@ -93,7 +93,7 @@ project.display.structure(struct_name='lbco') # %% [markdown] -# ## Step 3: Define Experiment +# ## 🔬 Define Experiment # %% data_path = ed.download_data(id=3, destination='data') @@ -135,7 +135,10 @@ experiment.linked_phases.create(id='lbco', scale=10.0) # %% [markdown] -# ## Step 4: Perform Analysis (no constraints) +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### Without Constraints # %% structure.cell.length_a.free = True @@ -174,7 +177,7 @@ project.display.pattern(expt_name='hrpt') # %% [markdown] -# ## Step 5: Perform Analysis (with constraints) +# ### With Constraints # %% # As can be seen from the parameter-correlation plot, the isotropic @@ -211,7 +214,7 @@ project.display.pattern(expt_name='hrpt') # %% [markdown] -# ## Step 6: Switch calculator engine +# ### Switch Calculator # %% experiment.calculator.show_supported() @@ -232,7 +235,7 @@ project.display.pattern(expt_name='hrpt') # %% [markdown] -# ## Step 7: Save Project +# ## 💾 Save Project # %% project.save_as('projects/lbco_hrpt') diff --git a/docs/docs/tutorials/ed-20.ipynb b/docs/docs/tutorials/ed-20.ipynb index f4f596dbb..4c32724d0 100644 --- a/docs/docs/tutorials/ed-20.ipynb +++ b/docs/docs/tutorials/ed-20.ipynb @@ -39,7 +39,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -62,12 +62,12 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structures\n", + "## 🧩 Define Structures\n", "\n", "This section covers how to add structures and modify their\n", "parameters.\n", "\n", - "#### Create Ferrite Structure" + "### Create Ferrite Structure" ] }, { @@ -101,7 +101,7 @@ "id": "6", "metadata": {}, "source": [ - "#### Create Austenite Structure" + "### Create Austenite Structure" ] }, { @@ -135,12 +135,12 @@ "id": "8", "metadata": {}, "source": [ - "## Define Experiments\n", + "## 🔬 Define Experiments\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step.\n", "\n", - "#### Download Measured Data" + "### Download Data" ] }, { @@ -162,7 +162,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Create Experiment" + "### Create Experiment" ] }, { @@ -198,7 +198,7 @@ "id": "13", "metadata": {}, "source": [ - "#### Set Instrument" + "### Set Instrument" ] }, { @@ -236,7 +236,7 @@ "id": "16", "metadata": {}, "source": [ - "#### Set Peak Profile" + "### Set Peak Profile" ] }, { @@ -298,7 +298,7 @@ "id": "22", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -383,7 +383,7 @@ "id": "27", "metadata": {}, "source": [ - "#### Set Linked Phases" + "### Set Linked Phases" ] }, { @@ -413,7 +413,7 @@ "id": "30", "metadata": {}, "source": [ - "#### Set Excluded Regions" + "### Set Excluded Regions" ] }, { @@ -443,12 +443,12 @@ "id": "33", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object is used to manage the structure, experiments,\n", "and analysis\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -467,7 +467,7 @@ "id": "35", "metadata": {}, "source": [ - "#### Add Structures" + "### Add Structures" ] }, { @@ -486,7 +486,7 @@ "id": "37", "metadata": {}, "source": [ - "#### Add Experiments" + "### Add Experiments" ] }, { @@ -505,7 +505,7 @@ "id": "39", "metadata": {}, "source": [ - "#### Plot Structures" + "### Display Structure" ] }, { @@ -524,7 +524,7 @@ "id": "41", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -552,12 +552,12 @@ "id": "44", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section shows the analysis process, including how to set up\n", "calculation and fitting engines.\n", "\n", - "#### Set Fit Mode" + "### Set Fit Mode" ] }, { @@ -585,7 +585,7 @@ "id": "47", "metadata": {}, "source": [ - "#### Set Free Parameters" + "### Set Free Parameters" ] }, { @@ -656,7 +656,7 @@ "id": "52", "metadata": {}, "source": [ - "#### Add Constraints" + "### Add Constraints" ] }, { @@ -689,7 +689,7 @@ "id": "54", "metadata": {}, "source": [ - "#### Run Fitting\n", + "### Run Fitting\n", "\n", "Run full fitting with all free parameters." ] @@ -759,7 +759,7 @@ "id": "61", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated\n", + "### Display Pattern\n", "\n", "Show full range in TOF." ] diff --git a/docs/docs/tutorials/ed-20.py b/docs/docs/tutorials/ed-20.py index da4a663ce..b54a090b3 100644 --- a/docs/docs/tutorials/ed-20.py +++ b/docs/docs/tutorials/ed-20.py @@ -9,7 +9,7 @@ # the BEER instrument are analyzed in this tutorial. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -20,12 +20,12 @@ from easydiffraction import extract_metadata # %% [markdown] -# ## Define Structures +# ## 🧩 Define Structures # # This section covers how to add structures and modify their # parameters. # -# #### Create Ferrite Structure +# ### Create Ferrite Structure # %% ferrite = StructureFactory.from_scratch(name='ferrite') @@ -47,7 +47,7 @@ ) # %% [markdown] -# #### Create Austenite Structure +# ### Create Austenite Structure # %% austenite = StructureFactory.from_scratch(name='austenite') @@ -69,12 +69,12 @@ ) # %% [markdown] -# ## Define Experiments +# ## 🔬 Define Experiments # # This section shows how to add experiments, configure their parameters, # and link the structures defined in the previous step. # -# #### Download Measured Data +# ### Download Data # %% zip_path = download_data(id=33, destination='data') @@ -84,7 +84,7 @@ data_path_n2 = data_paths[0] # 'Duplex_in_HR_for_IRF_N2.dat' # %% [markdown] -# #### Create Experiment +# ### Create Experiment # %% expt_s2 = ExperimentFactory.from_data_path( @@ -101,7 +101,7 @@ ) # %% [markdown] -# #### Set Instrument +# ### Set Instrument # %% expt_s2.instrument.setup_twotheta_bank = extract_metadata( @@ -120,7 +120,7 @@ ) # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # %% expt_s2.peak.show_supported() @@ -142,7 +142,7 @@ expt_n2.peak.broad_gauss_sigma_2 = 900 # %% [markdown] -# #### Set Background +# ### Set Background # %% expt_s2.background.show_supported() @@ -194,7 +194,7 @@ expt_n2.background.create(id=point.id.value, x=point.x.value, y=point.y.value) # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # %% expt_s2.linked_phases.create(id='ferrite', scale=10) @@ -205,7 +205,7 @@ expt_n2.linked_phases.create(id='austenite', scale=10) # %% [markdown] -# #### Set Excluded Regions +# ### Set Excluded Regions # %% expt_s2.excluded_regions.create(id='1', start=0, end=40500) @@ -216,40 +216,40 @@ expt_n2.excluded_regions.create(id='2', start=130000, end=180000) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object is used to manage the structure, experiments, # and analysis # -# #### Create Project +# ### Create Project # %% project = Project(name='beer') project.save_as(dir_path='projects/beer_mcstas') # %% [markdown] -# #### Add Structures +# ### Add Structures # %% project.structures.add(ferrite) project.structures.add(austenite) # %% [markdown] -# #### Add Experiments +# ### Add Experiments # %% project.experiments.add(expt_s2) project.experiments.add(expt_n2) # %% [markdown] -# #### Plot Structures +# ### Display Structure # %% project.display.structure(struct_name='ferrite') project.display.structure(struct_name='austenite') # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='expt_s2') @@ -258,12 +258,12 @@ project.display.pattern(expt_name='expt_n2') # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section shows the analysis process, including how to set up # calculation and fitting engines. # -# #### Set Fit Mode +# ### Set Fit Mode # %% project.analysis.fitting_mode.show_supported() @@ -272,7 +272,7 @@ project.analysis.fitting_mode.type = 'joint' # %% [markdown] -# #### Set Free Parameters +# ### Set Free Parameters # %% project.display.parameters.fittable() @@ -310,7 +310,7 @@ segment.y.free = True # %% [markdown] -# #### Add Constraints +# ### Add Constraints # %% project.analysis.aliases.create( @@ -331,7 +331,7 @@ project.analysis.constraints.create(expression='n2_austenite_scale = s2_austenite_scale') # %% [markdown] -# #### Run Fitting +# ### Run Fitting # # Run full fitting with all free parameters. @@ -358,7 +358,7 @@ project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # # Show full range in TOF. diff --git a/docs/docs/tutorials/ed-21.ipynb b/docs/docs/tutorials/ed-21.ipynb index 7dea23531..697851df6 100644 --- a/docs/docs/tutorials/ed-21.ipynb +++ b/docs/docs/tutorials/ed-21.ipynb @@ -52,7 +52,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -70,7 +70,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Create a Project Container\n", + "## 📦 Define Project\n", "\n", "The project object keeps structures, experiments, fit settings, and\n", "plotting utilities together in a single place. We will build the full\n", @@ -105,7 +105,7 @@ "id": "7", "metadata": {}, "source": [ - "## Step 2: Build the Structural Model\n", + "## 🧩 Define Structure\n", "\n", "We define a simple cubic perovskite model for LBCO. La and Ba share the\n", "same crystallographic site with equal occupancy, while Co and O occupy\n", @@ -238,7 +238,7 @@ "id": "16", "metadata": {}, "source": [ - "## Step 3: Define the Diffraction Experiment\n", + "## 🔬 Define Experiment\n", "\n", "Next we download the measured powder pattern, create a neutron powder\n", "experiment, and configure the instrument, profile, background, and\n", @@ -393,7 +393,7 @@ "id": "30", "metadata": {}, "source": [ - "## Step 4: Run an Initial Local Refinement\n", + "## 🚀 Initial Refinement\n", "\n", "Before Bayesian sampling, it is useful to run a deterministic fit. This\n", "gives us:\n", @@ -516,7 +516,7 @@ "id": "41", "metadata": {}, "source": [ - "## Step 5: Prepare for Bayesian Sampling\n", + "## 🎲 Prepare Sampling\n", "\n", "DREAM requires finite bounds for the free parameters. Instead of\n", "setting them manually, we derive them from the uncertainties estimated\n", @@ -589,7 +589,7 @@ "id": "47", "metadata": {}, "source": [ - "## Step 6: Configure and Run DREAM\n", + "## 🎲 Run Sampling\n", "\n", "We now switch from the local minimizer to the Bayesian DREAM sampler.\n", "\n", @@ -655,7 +655,7 @@ "id": "52", "metadata": {}, "source": [ - "## Step 7: Inspect Bayesian Results\n", + "## 📊 Inspect Results\n", "\n", "The fit-results display now includes sampler settings, convergence\n", "diagnostics, committed parameter values, and posterior summary\n", diff --git a/docs/docs/tutorials/ed-21.py b/docs/docs/tutorials/ed-21.py index 341f4896f..efce4cacd 100644 --- a/docs/docs/tutorials/ed-21.py +++ b/docs/docs/tutorials/ed-21.py @@ -22,13 +22,13 @@ # pattern? # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Create a Project Container +# ## 📦 Define Project # # The project object keeps structures, experiments, fit settings, and # plotting utilities together in a single place. We will build the full @@ -44,7 +44,7 @@ project.save_as('projects/lbco_hrpt_bumps-dream') # %% [markdown] -# ## Step 2: Build the Structural Model +# ## 🧩 Define Structure # # We define a simple cubic perovskite model for LBCO. La and Ba share the # same crystallographic site with equal occupancy, while Co and O occupy @@ -120,7 +120,7 @@ project.display.structure(struct_name='lbco') # %% [markdown] -# ## Step 3: Define the Diffraction Experiment +# ## 🔬 Define Experiment # # Next we download the measured powder pattern, create a neutron powder # experiment, and configure the instrument, profile, background, and @@ -189,7 +189,7 @@ experiment.excluded_regions.create(id='2', start=100, end=180) # %% [markdown] -# ## Step 4: Run an Initial Local Refinement +# ## 🚀 Initial Refinement # # Before Bayesian sampling, it is useful to run a deterministic fit. This # gives us: @@ -241,7 +241,7 @@ project.display.pattern(expt_name='hrpt') # %% [markdown] -# ## Step 5: Prepare for Bayesian Sampling +# ## 🎲 Prepare Sampling # # DREAM requires finite bounds for the free parameters. Instead of # setting them manually, we derive them from the uncertainties estimated @@ -278,7 +278,7 @@ project.display.parameters.free() # %% [markdown] -# ## Step 6: Configure and Run DREAM +# ## 🎲 Run Sampling # # We now switch from the local minimizer to the Bayesian DREAM sampler. # @@ -311,7 +311,7 @@ project.analysis.fit() # %% [markdown] -# ## Step 7: Inspect Bayesian Results +# ## 📊 Inspect Results # # The fit-results display now includes sampler settings, convergence # diagnostics, committed parameter values, and posterior summary diff --git a/docs/docs/tutorials/ed-22.ipynb b/docs/docs/tutorials/ed-22.ipynb index 7df92a7ff..1a70e189e 100644 --- a/docs/docs/tutorials/ed-22.ipynb +++ b/docs/docs/tutorials/ed-22.ipynb @@ -52,7 +52,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -70,7 +70,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Create a Project Container\n", + "## 📦 Define Project\n", "\n", "The project object keeps structures, experiments, fit settings, and\n", "plotting utilities together in a single place. We will build the full\n", @@ -102,7 +102,7 @@ "id": "7", "metadata": {}, "source": [ - "## Step 2: Build the Structural Model\n", + "## 🧩 Define Structure\n", "\n", "For this example we start from a CIF file describing the Tb2TiO7\n", "pyrochlore structure. Loading the structure from CIF is convenient\n", @@ -164,7 +164,7 @@ "id": "13", "metadata": {}, "source": [ - "## Step 3: Define the Diffraction Experiment\n", + "## 🔬 Define Experiment\n", "\n", "Next we download the measured reflection data, create a neutron\n", "single-crystal experiment, and configure the crystal link,\n", @@ -262,7 +262,7 @@ "id": "22", "metadata": {}, "source": [ - "## Step 4: Run an Initial Local Refinement\n", + "## 🚀 Initial Refinement\n", "\n", "Before Bayesian sampling, it is useful to run a deterministic fit. This\n", "gives us:\n", @@ -391,7 +391,7 @@ "id": "33", "metadata": {}, "source": [ - "## Step 5: Prepare for Bayesian Sampling\n", + "## 🎲 Prepare Sampling\n", "\n", "Bayesian samplers require finite bounds for the free parameters. Instead of\n", "setting them manually, we derive them from the uncertainties estimated\n", @@ -466,7 +466,7 @@ "id": "39", "metadata": {}, "source": [ - "## Step 6: Configure and Run emcee\n", + "## 🎲 Run Sampling\n", "\n", "We now switch from the local minimizer to the Bayesian emcee sampler.\n", "\n", @@ -528,7 +528,7 @@ "id": "44", "metadata": {}, "source": [ - "## Step 7: Inspect Bayesian Results\n", + "## 📊 Inspect Results\n", "\n", "The fit-results display now includes sampler settings, convergence\n", "diagnostics, committed parameter values, and posterior summary\n", diff --git a/docs/docs/tutorials/ed-22.py b/docs/docs/tutorials/ed-22.py index 855a791a5..e1b3f8abe 100644 --- a/docs/docs/tutorials/ed-22.py +++ b/docs/docs/tutorials/ed-22.py @@ -22,13 +22,13 @@ # intensities? # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Create a Project Container +# ## 📦 Define Project # # The project object keeps structures, experiments, fit settings, and # plotting utilities together in a single place. We will build the full @@ -41,7 +41,7 @@ project.save_as('projects/tbti_heidi_emcee') # %% [markdown] -# ## Step 2: Build the Structural Model +# ## 🧩 Define Structure # # For this example we start from a CIF file describing the Tb2TiO7 # pyrochlore structure. Loading the structure from CIF is convenient @@ -65,7 +65,7 @@ project.display.structure(struct_name='tbti') # %% [markdown] -# ## Step 3: Define the Diffraction Experiment +# ## 🔬 Define Experiment # # Next we download the measured reflection data, create a neutron # single-crystal experiment, and configure the crystal link, @@ -106,7 +106,7 @@ experiment.extinction.radius = 10 # %% [markdown] -# ## Step 4: Run an Initial Local Refinement +# ## 🚀 Initial Refinement # # Before Bayesian sampling, it is useful to run a deterministic fit. This # gives us: @@ -166,7 +166,7 @@ project.display.pattern(expt_name='heidi') # %% [markdown] -# ## Step 5: Prepare for Bayesian Sampling +# ## 🎲 Prepare Sampling # # Bayesian samplers require finite bounds for the free parameters. Instead of # setting them manually, we derive them from the uncertainties estimated @@ -205,7 +205,7 @@ project.display.parameters.free() # %% [markdown] -# ## Step 6: Configure and Run emcee +# ## 🎲 Run Sampling # # We now switch from the local minimizer to the Bayesian emcee sampler. # @@ -234,7 +234,7 @@ project.analysis.fit() # %% [markdown] -# ## Step 7: Inspect Bayesian Results +# ## 📊 Inspect Results # # The fit-results display now includes sampler settings, convergence # diagnostics, committed parameter values, and posterior summary diff --git a/docs/docs/tutorials/ed-23.ipynb b/docs/docs/tutorials/ed-23.ipynb index 4a49a859f..368150181 100644 --- a/docs/docs/tutorials/ed-23.ipynb +++ b/docs/docs/tutorials/ed-23.ipynb @@ -38,7 +38,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -56,7 +56,15 @@ "id": "4", "metadata": {}, "source": [ - "## Download Saved Project\n", + "## 📂 Load Project" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### Download Project\n", "\n", "The returned path points directly to the saved project directory with\n", "a partially completed sequential fit, including\n", @@ -66,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -75,16 +83,16 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "7", "metadata": {}, "source": [ - "## Load Saved Project" + "### Load Project" ] }, { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -93,10 +101,18 @@ }, { "cell_type": "markdown", - "id": "8", + "id": "9", "metadata": {}, "source": [ - "## View Structure\n", + "## 🚀 Perform Analysis" + ] + }, + { + "cell_type": "markdown", + "id": "10", + "metadata": {}, + "source": [ + "### Display Structure\n", "\n", "Render the Co2SiO4 structure restored from the saved project." ] @@ -104,7 +120,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -113,10 +129,10 @@ }, { "cell_type": "markdown", - "id": "10", + "id": "12", "metadata": {}, "source": [ - "## Resume Sequential Analysis\n", + "### Resume Sequential Analysis\n", "\n", "This project already stores the template experiment, sequential-fit\n", "settings, and the partial `analysis/results.csv` from the previous\n", @@ -127,7 +143,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -136,10 +152,10 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "14", "metadata": {}, "source": [ - "## Replay Fitted Datasets\n", + "### Replay Fitted Datasets\n", "\n", "Apply fitted parameters from the first CSV row and plot the result." ] @@ -147,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -157,7 +173,7 @@ }, { "cell_type": "markdown", - "id": "14", + "id": "16", "metadata": {}, "source": [ "\n", @@ -167,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -177,10 +193,10 @@ }, { "cell_type": "markdown", - "id": "16", + "id": "18", "metadata": {}, "source": [ - "## Plot Parameter Evolution\n", + "### Display Parameter Evolution\n", "\n", "Use the same persisted diffrn path stored in `analysis/results.csv`\n", "for the x-axis." @@ -189,7 +205,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "18", + "id": "20", "metadata": {}, "source": [ "Plot fit quality metrics vs. temperature." @@ -207,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "19", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -227,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "20", + "id": "22", "metadata": {}, "source": [ "Omitting `param` plots every fitted parameter one after another." @@ -236,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "21", + "id": "23", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-23.py b/docs/docs/tutorials/ed-23.py index 581a1003a..f7e01bc66 100644 --- a/docs/docs/tutorials/ed-23.py +++ b/docs/docs/tutorials/ed-23.py @@ -8,13 +8,16 @@ # datasets and appends the missing results. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Download Saved Project +# ## 📂 Load Project + +# %% [markdown] +# ### Download Project # # The returned path points directly to the saved project directory with # a partially completed sequential fit, including @@ -24,13 +27,16 @@ project_dir = ed.download_data(id=37, destination='projects') # %% [markdown] -# ## Load Saved Project +# ### Load Project # %% project = ed.Project.load(project_dir) # %% [markdown] -# ## View Structure +# ## 🚀 Perform Analysis + +# %% [markdown] +# ### Display Structure # # Render the Co2SiO4 structure restored from the saved project. @@ -38,7 +44,7 @@ project.display.structure(struct_name='cosio') # %% [markdown] -# ## Resume Sequential Analysis +# ### Resume Sequential Analysis # # This project already stores the template experiment, sequential-fit # settings, and the partial `analysis/results.csv` from the previous @@ -49,7 +55,7 @@ project.analysis.fit() # %% [markdown] -# ## Replay Fitted Datasets +# ### Replay Fitted Datasets # # Apply fitted parameters from the first CSV row and plot the result. @@ -66,7 +72,7 @@ project.display.pattern(expt_name='d20') # %% [markdown] -# ## Plot Parameter Evolution +# ### Display Parameter Evolution # # Use the same persisted diffrn path stored in `analysis/results.csv` # for the x-axis. diff --git a/docs/docs/tutorials/ed-24.ipynb b/docs/docs/tutorials/ed-24.ipynb index 72e16dc06..e21fd7ed6 100644 --- a/docs/docs/tutorials/ed-24.ipynb +++ b/docs/docs/tutorials/ed-24.ipynb @@ -39,7 +39,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -57,7 +57,15 @@ "id": "4", "metadata": {}, "source": [ - "## Download Saved Project\n", + "## 📂 Load Project" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### Download Project\n", "\n", "The returned path points directly to the saved project directory with\n", "the completed Bayesian fit and persisted posterior samples and plot\n", @@ -67,7 +75,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -76,10 +84,10 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "7", "metadata": {}, "source": [ - "## Load the Saved Bayesian Project\n", + "### Load Project\n", "\n", "Loading restores the persisted fit state, posterior samples, and plot\n", "caches. No new fit is launched in this tutorial." @@ -88,7 +96,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -97,10 +105,18 @@ }, { "cell_type": "markdown", - "id": "8", + "id": "9", + "metadata": {}, + "source": [ + "## 📊 Inspect Results" + ] + }, + { + "cell_type": "markdown", + "id": "10", "metadata": {}, "source": [ - "## View Structure\n", + "### Display Structure\n", "\n", "Render the La0.5Ba0.5CoO3 structure restored from the saved project." ] @@ -108,7 +124,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -117,10 +133,10 @@ }, { "cell_type": "markdown", - "id": "10", + "id": "12", "metadata": {}, "source": [ - "## Review the Saved Fit Summary\n", + "### Display Fit Results\n", "\n", "The fit summary reports the committed point estimate, sampler\n", "settings, convergence diagnostics, and posterior parameter summaries\n", @@ -130,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -139,10 +155,10 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "14", "metadata": {}, "source": [ - "## Show Correlations\n", + "### Display Correlations\n", "\n", "The correlation matrix is restored from the saved project state." ] @@ -150,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -159,10 +175,10 @@ }, { "cell_type": "markdown", - "id": "14", + "id": "16", "metadata": {}, "source": [ - "## Inspect Posterior Densities and Pair Structure\n", + "### Display Posterior Densities\n", "\n", "The pair plot and one-dimensional posterior distributions now load\n", "from the persisted caches generated when the Bayesian fit was saved." @@ -171,7 +187,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +197,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -190,10 +206,10 @@ }, { "cell_type": "markdown", - "id": "17", + "id": "19", "metadata": {}, "source": [ - "## Plot Posterior Predictive Checks\n", + "### Display Posterior Predictive\n", "\n", "The posterior predictive view reuses the cached predictive summary\n", "stored in the project rather than recalculating it on first display.\n", @@ -204,7 +220,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -213,7 +229,7 @@ }, { "cell_type": "markdown", - "id": "19", + "id": "21", "metadata": {}, "source": [ "A zoomed view is useful for checking the propagated uncertainty in a\n", @@ -223,7 +239,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "22", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-24.py b/docs/docs/tutorials/ed-24.py index e900b9000..95cfff7d7 100644 --- a/docs/docs/tutorials/ed-24.py +++ b/docs/docs/tutorials/ed-24.py @@ -9,13 +9,16 @@ # restored directly from disk. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Download Saved Project +# ## 📂 Load Project + +# %% [markdown] +# ### Download Project # # The returned path points directly to the saved project directory with # the completed Bayesian fit and persisted posterior samples and plot @@ -25,7 +28,7 @@ project_dir = ed.download_data(id=39, destination='projects') # %% [markdown] -# ## Load the Saved Bayesian Project +# ### Load Project # # Loading restores the persisted fit state, posterior samples, and plot # caches. No new fit is launched in this tutorial. @@ -34,7 +37,10 @@ project = ed.Project.load(project_dir) # %% [markdown] -# ## View Structure +# ## 📊 Inspect Results + +# %% [markdown] +# ### Display Structure # # Render the La0.5Ba0.5CoO3 structure restored from the saved project. @@ -42,7 +48,7 @@ project.display.structure(struct_name='lbco') # %% [markdown] -# ## Review the Saved Fit Summary +# ### Display Fit Results # # The fit summary reports the committed point estimate, sampler # settings, convergence diagnostics, and posterior parameter summaries @@ -52,7 +58,7 @@ project.display.fit.results() # %% [markdown] -# ## Show Correlations +# ### Display Correlations # # The correlation matrix is restored from the saved project state. @@ -60,7 +66,7 @@ project.display.fit.correlations() # %% [markdown] -# ## Inspect Posterior Densities and Pair Structure +# ### Display Posterior Densities # # The pair plot and one-dimensional posterior distributions now load # from the persisted caches generated when the Bayesian fit was saved. @@ -72,7 +78,7 @@ project.display.posterior.distribution() # %% [markdown] -# ## Plot Posterior Predictive Checks +# ### Display Posterior Predictive # # The posterior predictive view reuses the cached predictive summary # stored in the project rather than recalculating it on first display. diff --git a/docs/docs/tutorials/ed-25.ipynb b/docs/docs/tutorials/ed-25.ipynb index e1f46e151..7f94ff8d9 100644 --- a/docs/docs/tutorials/ed-25.ipynb +++ b/docs/docs/tutorials/ed-25.ipynb @@ -52,7 +52,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -70,7 +70,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Create a Project Container\n", + "## 📦 Define Project\n", "\n", "The project object keeps structures, experiments, fit settings, and\n", "plotting utilities together in a single place. We will build the full\n", @@ -105,7 +105,7 @@ "id": "7", "metadata": {}, "source": [ - "## Step 2: Build the Structural Model\n", + "## 🧩 Define Structure\n", "\n", "We define a simple cubic perovskite model for LBCO. La and Ba share the\n", "same crystallographic site with equal occupancy, while Co and O occupy\n", @@ -238,7 +238,7 @@ "id": "16", "metadata": {}, "source": [ - "## Step 3: Define the Diffraction Experiment\n", + "## 🔬 Define Experiment\n", "\n", "Next we download the measured powder pattern, create a neutron powder\n", "experiment, and configure the instrument, profile, background, and\n", @@ -393,7 +393,7 @@ "id": "30", "metadata": {}, "source": [ - "## Step 4: Run an Initial Local Refinement\n", + "## 🚀 Initial Refinement\n", "\n", "Before Bayesian sampling, it is useful to run a deterministic fit. This\n", "gives us:\n", @@ -506,7 +506,7 @@ "id": "40", "metadata": {}, "source": [ - "## Step 5: Prepare for Bayesian Sampling\n", + "## 🎲 Prepare Sampling\n", "\n", "Bayesian samplers require finite bounds for the free parameters. Instead of\n", "setting them manually, we derive them from the uncertainties estimated\n", @@ -579,7 +579,7 @@ "id": "46", "metadata": {}, "source": [ - "## Step 6: Configure and Run emcee\n", + "## 🎲 Run Sampling\n", "\n", "We now switch from the local minimizer to the Bayesian emcee sampler.\n", "\n", @@ -641,7 +641,7 @@ "id": "51", "metadata": {}, "source": [ - "## Step 7: Inspect Bayesian Results\n", + "## 📊 Inspect Results\n", "\n", "The fit-results display now includes sampler settings, convergence\n", "diagnostics, committed parameter values, and posterior summary\n", diff --git a/docs/docs/tutorials/ed-25.py b/docs/docs/tutorials/ed-25.py index 2eb8d0a49..8806d05cc 100644 --- a/docs/docs/tutorials/ed-25.py +++ b/docs/docs/tutorials/ed-25.py @@ -22,13 +22,13 @@ # pattern? # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Create a Project Container +# ## 📦 Define Project # # The project object keeps structures, experiments, fit settings, and # plotting utilities together in a single place. We will build the full @@ -44,7 +44,7 @@ project.save_as('projects/lbco_hrpt_emcee') # %% [markdown] -# ## Step 2: Build the Structural Model +# ## 🧩 Define Structure # # We define a simple cubic perovskite model for LBCO. La and Ba share the # same crystallographic site with equal occupancy, while Co and O occupy @@ -120,7 +120,7 @@ project.display.structure(struct_name='lbco') # %% [markdown] -# ## Step 3: Define the Diffraction Experiment +# ## 🔬 Define Experiment # # Next we download the measured powder pattern, create a neutron powder # experiment, and configure the instrument, profile, background, and @@ -189,7 +189,7 @@ experiment.excluded_regions.create(id='2', start=100, end=180) # %% [markdown] -# ## Step 4: Run an Initial Local Refinement +# ## 🚀 Initial Refinement # # Before Bayesian sampling, it is useful to run a deterministic fit. This # gives us: @@ -238,7 +238,7 @@ project.display.pattern(expt_name='hrpt') # %% [markdown] -# ## Step 5: Prepare for Bayesian Sampling +# ## 🎲 Prepare Sampling # # Bayesian samplers require finite bounds for the free parameters. Instead of # setting them manually, we derive them from the uncertainties estimated @@ -275,7 +275,7 @@ project.display.parameters.free() # %% [markdown] -# ## Step 6: Configure and Run emcee +# ## 🎲 Run Sampling # # We now switch from the local minimizer to the Bayesian emcee sampler. # @@ -304,7 +304,7 @@ project.analysis.fit() # %% [markdown] -# ## Step 7: Inspect Bayesian Results +# ## 📊 Inspect Results # # The fit-results display now includes sampler settings, convergence # diagnostics, committed parameter values, and posterior summary diff --git a/docs/docs/tutorials/ed-26.ipynb b/docs/docs/tutorials/ed-26.ipynb index 224fd618e..f9a778aa3 100644 --- a/docs/docs/tutorials/ed-26.ipynb +++ b/docs/docs/tutorials/ed-26.ipynb @@ -56,7 +56,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -74,7 +74,15 @@ "id": "4", "metadata": {}, "source": [ - "## Download Saved Project\n", + "## 📂 Load Project" + ] + }, + { + "cell_type": "markdown", + "id": "5", + "metadata": {}, + "source": [ + "### Download Project\n", "\n", "The returned path points directly to the saved project directory with\n", "the completed Bayesian fit and persisted posterior samples and plot\n", @@ -84,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -93,10 +101,10 @@ }, { "cell_type": "markdown", - "id": "6", + "id": "7", "metadata": {}, "source": [ - "## Load the Saved Bayesian Project\n", + "### Load Project\n", "\n", "Loading restores the persisted fit state, posterior samples, and plot\n", "caches. No new fit is launched in this tutorial." @@ -105,7 +113,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -114,10 +122,18 @@ }, { "cell_type": "markdown", - "id": "8", + "id": "9", + "metadata": {}, + "source": [ + "## 📊 Inspect Results" + ] + }, + { + "cell_type": "markdown", + "id": "10", "metadata": {}, "source": [ - "## View Structure\n", + "### Display Structure\n", "\n", "Render the La0.5Ba0.5CoO3 structure restored from the saved project." ] @@ -125,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -134,10 +150,10 @@ }, { "cell_type": "markdown", - "id": "10", + "id": "12", "metadata": {}, "source": [ - "## Review the Saved Fit Summary\n", + "### Display Fit Results\n", "\n", "The fit summary reports the committed point estimate, sampler\n", "settings, convergence diagnostics, and posterior parameter summaries\n", @@ -147,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "11", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -156,10 +172,10 @@ }, { "cell_type": "markdown", - "id": "12", + "id": "14", "metadata": {}, "source": [ - "## Show Correlations\n", + "### Display Correlations\n", "\n", "The correlation matrix is restored from the saved project state." ] @@ -167,7 +183,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -176,10 +192,10 @@ }, { "cell_type": "markdown", - "id": "14", + "id": "16", "metadata": {}, "source": [ - "## Inspect Posterior Densities and Pair Structure\n", + "### Display Posterior Densities\n", "\n", "The pair plot and one-dimensional posterior distributions now load\n", "from the persisted caches generated when the Bayesian fit was saved." @@ -188,7 +204,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -198,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -207,10 +223,10 @@ }, { "cell_type": "markdown", - "id": "17", + "id": "19", "metadata": {}, "source": [ - "## Plot Posterior Predictive Checks\n", + "### Display Posterior Predictive\n", "\n", "The posterior predictive view reuses the cached predictive summary\n", "stored in the project rather than recalculating it on first display.\n", @@ -221,7 +237,7 @@ { "cell_type": "code", "execution_count": null, - "id": "18", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -230,7 +246,7 @@ }, { "cell_type": "markdown", - "id": "19", + "id": "21", "metadata": {}, "source": [ "A zoomed view is useful for checking the propagated uncertainty in a\n", @@ -240,7 +256,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -249,10 +265,18 @@ }, { "cell_type": "markdown", - "id": "21", + "id": "23", "metadata": {}, "source": [ - "## Resume emcee Sampling\n", + "## 🎲 Resume Sampling" + ] + }, + { + "cell_type": "markdown", + "id": "24", + "metadata": {}, + "source": [ + "### Run Sampling\n", "\n", "Resume from the saved backend and append 100 more emcee steps to the\n", "existing chain. We use only 100 steps here to keep the tutorial fast,\n", @@ -263,7 +287,7 @@ { "cell_type": "code", "execution_count": null, - "id": "22", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -273,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "23", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -282,10 +306,10 @@ }, { "cell_type": "markdown", - "id": "24", + "id": "27", "metadata": {}, "source": [ - "## Inspect the Resumed Posterior\n", + "### Display Resumed Posterior\n", "\n", "After resume, the posterior plots use the extended chain." ] @@ -293,7 +317,7 @@ { "cell_type": "code", "execution_count": null, - "id": "25", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -303,7 +327,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -313,7 +337,7 @@ { "cell_type": "code", "execution_count": null, - "id": "27", + "id": "30", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/docs/tutorials/ed-26.py b/docs/docs/tutorials/ed-26.py index bac28bb82..c3d994d62 100644 --- a/docs/docs/tutorials/ed-26.py +++ b/docs/docs/tutorials/ed-26.py @@ -26,13 +26,16 @@ # - inspect posterior plots after each sampling stage. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Download Saved Project +# ## 📂 Load Project + +# %% [markdown] +# ### Download Project # # The returned path points directly to the saved project directory with # the completed Bayesian fit and persisted posterior samples and plot @@ -42,7 +45,7 @@ project_dir = ed.download_data(id=38, destination='projects') # %% [markdown] -# ## Load the Saved Bayesian Project +# ### Load Project # # Loading restores the persisted fit state, posterior samples, and plot # caches. No new fit is launched in this tutorial. @@ -51,7 +54,10 @@ project = ed.Project.load(project_dir) # %% [markdown] -# ## View Structure +# ## 📊 Inspect Results + +# %% [markdown] +# ### Display Structure # # Render the La0.5Ba0.5CoO3 structure restored from the saved project. @@ -59,7 +65,7 @@ project.display.structure(struct_name='lbco') # %% [markdown] -# ## Review the Saved Fit Summary +# ### Display Fit Results # # The fit summary reports the committed point estimate, sampler # settings, convergence diagnostics, and posterior parameter summaries @@ -69,7 +75,7 @@ project.display.fit.results() # %% [markdown] -# ## Show Correlations +# ### Display Correlations # # The correlation matrix is restored from the saved project state. @@ -77,7 +83,7 @@ project.display.fit.correlations() # %% [markdown] -# ## Inspect Posterior Densities and Pair Structure +# ### Display Posterior Densities # # The pair plot and one-dimensional posterior distributions now load # from the persisted caches generated when the Bayesian fit was saved. @@ -89,7 +95,7 @@ project.display.posterior.distribution() # %% [markdown] -# ## Plot Posterior Predictive Checks +# ### Display Posterior Predictive # # The posterior predictive view reuses the cached predictive summary # stored in the project rather than recalculating it on first display. @@ -107,7 +113,10 @@ project.display.posterior.predictive(expt_name='hrpt', x_min=92, x_max=93) # %% [markdown] -# ## Resume emcee Sampling +# ## 🎲 Resume Sampling + +# %% [markdown] +# ### Run Sampling # # Resume from the saved backend and append 100 more emcee steps to the # existing chain. We use only 100 steps here to keep the tutorial fast, @@ -121,7 +130,7 @@ project.display.fit.results() # %% [markdown] -# ## Inspect the Resumed Posterior +# ### Display Resumed Posterior # # After resume, the posterior plots use the extended chain. diff --git a/docs/docs/tutorials/ed-3.ipynb b/docs/docs/tutorials/ed-3.ipynb index 08b84e8a7..8076de33a 100644 --- a/docs/docs/tutorials/ed-3.ipynb +++ b/docs/docs/tutorials/ed-3.ipynb @@ -49,7 +49,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -67,7 +67,7 @@ "id": "4", "metadata": {}, "source": [ - "## Step 1: Create a Project\n", + "## 📦 Define Project\n", "\n", "This section explains how to create a project and define its metadata." ] @@ -77,7 +77,7 @@ "id": "5", "metadata": {}, "source": [ - "#### Create Project" + "### Create Project" ] }, { @@ -95,7 +95,7 @@ "id": "7", "metadata": {}, "source": [ - "#### Set Project Metadata" + "### Set Project Metadata" ] }, { @@ -117,7 +117,7 @@ "id": "9", "metadata": {}, "source": [ - "#### Show Project Metadata as CIF" + "### Show Project Metadata as CIF" ] }, { @@ -135,7 +135,7 @@ "id": "11", "metadata": {}, "source": [ - "#### Save Project\n", + "### Save Project\n", "\n", "When saving the project for the first time, you need to specify the\n", "directory path." @@ -156,7 +156,7 @@ "id": "13", "metadata": {}, "source": [ - "## Step 2: Define Structure\n", + "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters." @@ -167,7 +167,7 @@ "id": "14", "metadata": {}, "source": [ - "#### Add Structure" + "### Add Structure" ] }, { @@ -185,7 +185,7 @@ "id": "16", "metadata": {}, "source": [ - "#### Show Defined Structures\n", + "### Show Defined Structures\n", "\n", "Show the names of the crystal structures added. These names are used\n", "to access the structure using the syntax:\n", @@ -208,7 +208,7 @@ "id": "18", "metadata": {}, "source": [ - "#### Set Space Group\n", + "### Set Space Group\n", "\n", "Modify the default space group parameters." ] @@ -229,7 +229,7 @@ "id": "20", "metadata": {}, "source": [ - "#### Set Unit Cell\n", + "### Set Unit Cell\n", "\n", "Modify the default unit cell parameters." ] @@ -249,7 +249,7 @@ "id": "22", "metadata": {}, "source": [ - "#### Set Atom Sites\n", + "### Set Atom Sites\n", "\n", "Add atom sites to the structure." ] @@ -306,7 +306,7 @@ "id": "24", "metadata": {}, "source": [ - "#### Show Structure as CIF" + "### Show Structure as CIF" ] }, { @@ -324,7 +324,7 @@ "id": "26", "metadata": {}, "source": [ - "#### View Structure\n", + "### Display Structure\n", "\n", "EasyDiffraction can draw the structure that has just been defined. The\n", "renderer engine is selected through `project.rendering_structure`. The default `auto`\n", @@ -493,7 +493,7 @@ "id": "43", "metadata": {}, "source": [ - "#### Save Project State\n", + "### Save Project State\n", "\n", "Save the project state after adding the structure. This ensures\n", "that all changes are stored and can be accessed later. The project\n", @@ -515,7 +515,7 @@ "id": "45", "metadata": {}, "source": [ - "## Step 3: Define Experiment\n", + "## 🔬 Define Experiment\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step." @@ -526,7 +526,7 @@ "id": "46", "metadata": {}, "source": [ - "#### Download Measured Data\n", + "### Download Data\n", "\n", "Download the data file from the EasyDiffraction repository on GitHub." ] @@ -546,7 +546,7 @@ "id": "48", "metadata": {}, "source": [ - "#### Add Diffraction Experiment" + "### Create Experiment" ] }, { @@ -570,7 +570,7 @@ "id": "50", "metadata": {}, "source": [ - "#### Show Defined Experiments" + "### Show Defined Experiments" ] }, { @@ -588,7 +588,7 @@ "id": "52", "metadata": {}, "source": [ - "#### Show Measured Data" + "### Show Measured Data" ] }, { @@ -606,7 +606,7 @@ "id": "54", "metadata": {}, "source": [ - "#### Set Instrument\n", + "### Set Instrument\n", "\n", "Modify the default instrument parameters." ] @@ -627,7 +627,7 @@ "id": "56", "metadata": {}, "source": [ - "#### Set Peak Profile\n", + "### Set Peak Profile\n", "\n", "Show supported peak profile types." ] @@ -687,7 +687,7 @@ "id": "62", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -771,7 +771,7 @@ "id": "71", "metadata": {}, "source": [ - "#### Set Linked Phases\n", + "### Set Linked Phases\n", "\n", "Link the structure defined in the previous step to the experiment." ] @@ -791,7 +791,7 @@ "id": "73", "metadata": {}, "source": [ - "#### Show Experiment as CIF" + "### Show Experiment as CIF" ] }, { @@ -809,7 +809,7 @@ "id": "75", "metadata": {}, "source": [ - "#### Save Project State" + "### Save Project State" ] }, { @@ -827,12 +827,12 @@ "id": "77", "metadata": {}, "source": [ - "## Step 4: Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section explains the analysis process, including how to set up\n", "calculation and fitting engines.\n", "\n", - "#### Set Calculator\n", + "### Set Calculator\n", "\n", "Show supported calculation engines for this experiment." ] @@ -870,7 +870,7 @@ "id": "81", "metadata": {}, "source": [ - "#### Set Up Data Rendering Engine\n", + "### Set Plotting Engine\n", "\n", "EasyDiffraction can plot the measured and calculated patterns using different rendering engines.\n", "The default `auto` engine resolves to an interactive `plotly` view inside Jupyter and a\n", @@ -912,7 +912,7 @@ "id": "85", "metadata": {}, "source": [ - "#### Show Calculated Data" + "### Show Calculated Data" ] }, { @@ -930,7 +930,7 @@ "id": "87", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -958,7 +958,7 @@ "id": "90", "metadata": {}, "source": [ - "#### Show Parameters\n", + "### Display Parameters\n", "\n", "Show all parameters of the project." ] @@ -1032,7 +1032,7 @@ "id": "98", "metadata": {}, "source": [ - "#### Set Fit Mode\n", + "### Set Fit Mode\n", "\n", "Show supported fit modes." ] @@ -1070,7 +1070,7 @@ "id": "102", "metadata": {}, "source": [ - "#### Set Minimizer\n", + "### Set Minimizer\n", "\n", "Show supported fitting engines." ] @@ -1189,7 +1189,7 @@ "id": "114", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -1277,7 +1277,7 @@ "id": "123", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -1383,7 +1383,7 @@ "id": "134", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -1513,7 +1513,7 @@ "id": "147", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -1666,7 +1666,7 @@ "id": "162", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -1704,7 +1704,7 @@ "id": "166", "metadata": {}, "source": [ - "#### Plot Structure" + "#### Display Structure" ] }, { @@ -1722,7 +1722,7 @@ "id": "168", "metadata": {}, "source": [ - "## Step 5: Generate Report\n", + "## 📊 Report\n", "\n", "This final section shows how to review the results of the analysis.\n", "\n", diff --git a/docs/docs/tutorials/ed-3.py b/docs/docs/tutorials/ed-3.py index 1e1d61711..dff71180b 100644 --- a/docs/docs/tutorials/ed-3.py +++ b/docs/docs/tutorials/ed-3.py @@ -19,24 +19,24 @@ # the main container for all information. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% import easydiffraction as ed # %% [markdown] -# ## Step 1: Create a Project +# ## 📦 Define Project # # This section explains how to create a project and define its metadata. # %% [markdown] -# #### Create Project +# ### Create Project # %% project = ed.Project(name='lbco_hrpt') # %% [markdown] -# #### Set Project Metadata +# ### Set Project Metadata # %% project.info.title = 'La0.5Ba0.5CoO3 at HRPT@PSI' @@ -46,13 +46,13 @@ wavelength mode at the HRPT diffractometer (PSI).""" # %% [markdown] -# #### Show Project Metadata as CIF +# ### Show Project Metadata as CIF # %% project.info.show_as_cif() # %% [markdown] -# #### Save Project +# ### Save Project # # When saving the project for the first time, you need to specify the # directory path. @@ -61,19 +61,19 @@ project.save_as(dir_path='projects/lbco_hrpt') # %% [markdown] -# ## Step 2: Define Structure +# ## 🧩 Define Structure # # This section shows how to add structures and modify their # parameters. # %% [markdown] -# #### Add Structure +# ### Add Structure # %% project.structures.create(name='lbco') # %% [markdown] -# #### Show Defined Structures +# ### Show Defined Structures # # Show the names of the crystal structures added. These names are used # to access the structure using the syntax: @@ -84,7 +84,7 @@ project.structures.show_names() # %% [markdown] -# #### Set Space Group +# ### Set Space Group # # Modify the default space group parameters. @@ -93,7 +93,7 @@ project.structures['lbco'].space_group.it_coordinate_system_code = '1' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # # Modify the default unit cell parameters. @@ -101,7 +101,7 @@ project.structures['lbco'].cell.length_a = 3.88 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # # Add atom sites to the structure. @@ -146,13 +146,13 @@ ) # %% [markdown] -# #### Show Structure as CIF +# ### Show Structure as CIF # %% project.structures['lbco'].show_as_cif() # %% [markdown] -# #### View Structure +# ### Display Structure # # EasyDiffraction can draw the structure that has just been defined. The # renderer engine is selected through `project.rendering_structure`. The default `auto` @@ -216,7 +216,7 @@ project.rendering_structure.type = 'auto' # %% [markdown] -# #### Save Project State +# ### Save Project State # # Save the project state after adding the structure. This ensures # that all changes are stored and can be accessed later. The project @@ -226,13 +226,13 @@ project.save() # %% [markdown] -# ## Step 3: Define Experiment +# ## 🔬 Define Experiment # # This section shows how to add experiments, configure their parameters, # and link the structures defined in the previous step. # %% [markdown] -# #### Download Measured Data +# ### Download Data # # Download the data file from the EasyDiffraction repository on GitHub. @@ -240,7 +240,7 @@ data_path = ed.download_data(id=3, destination='data') # %% [markdown] -# #### Add Diffraction Experiment +# ### Create Experiment # %% project.experiments.add_from_data_path( @@ -252,19 +252,19 @@ ) # %% [markdown] -# #### Show Defined Experiments +# ### Show Defined Experiments # %% project.experiments.show_names() # %% [markdown] -# #### Show Measured Data +# ### Show Measured Data # %% project.display.pattern(expt_name='hrpt', include='measured') # %% [markdown] -# #### Set Instrument +# ### Set Instrument # # Modify the default instrument parameters. @@ -273,7 +273,7 @@ project.experiments['hrpt'].instrument.calib_twotheta_offset = 0.6 # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # # Show supported peak profile types. @@ -297,7 +297,7 @@ project.experiments['hrpt'].peak.broad_lorentz_y = 0.1 # %% [markdown] -# #### Set Background +# ### Set Background # %% [markdown] # Show supported background types. @@ -328,7 +328,7 @@ project.experiments['hrpt'].background.show() # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # # Link the structure defined in the previous step to the experiment. @@ -336,24 +336,24 @@ project.experiments['hrpt'].linked_phases.create(id='lbco', scale=10.0) # %% [markdown] -# #### Show Experiment as CIF +# ### Show Experiment as CIF # %% project.experiments['hrpt'].show_as_cif() # %% [markdown] -# #### Save Project State +# ### Save Project State # %% project.save() # %% [markdown] -# ## Step 4: Perform Analysis +# ## 🚀 Perform Analysis # # This section explains the analysis process, including how to set up # calculation and fitting engines. # -# #### Set Calculator +# ### Set Calculator # # Show supported calculation engines for this experiment. @@ -367,7 +367,7 @@ project.experiments['hrpt'].calculator.type = 'cryspy' # %% [markdown] -# #### Set Up Data Rendering Engine +# ### Set Plotting Engine # # EasyDiffraction can plot the measured and calculated patterns using different rendering engines. # The default `auto` engine resolves to an interactive `plotly` view inside Jupyter and a @@ -385,13 +385,13 @@ project.rendering_plot.help() # %% [markdown] -# #### Show Calculated Data +# ### Show Calculated Data # %% project.display.pattern(expt_name='hrpt', include='calculated') # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -400,7 +400,7 @@ project.display.pattern(expt_name='hrpt', x_min=38, x_max=41) # %% [markdown] -# #### Show Parameters +# ### Display Parameters # # Show all parameters of the project. @@ -426,7 +426,7 @@ project.display.parameters.access() # %% [markdown] -# #### Set Fit Mode +# ### Set Fit Mode # # Show supported fit modes. @@ -440,7 +440,7 @@ project.analysis.fitting_mode.type = 'single' # %% [markdown] -# #### Set Minimizer +# ### Set Minimizer # # Show supported fitting engines. @@ -487,7 +487,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -520,7 +520,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -559,7 +559,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -610,7 +610,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -671,7 +671,7 @@ project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -683,13 +683,13 @@ project.display.structure(struct_name='lbco') # %% [markdown] -# #### Plot Structure +# #### Display Structure # %% project.display.structure(struct_name='lbco') # %% [markdown] -# ## Step 5: Generate Report +# ## 📊 Report # # This final section shows how to review the results of the analysis. # diff --git a/docs/docs/tutorials/ed-4.ipynb b/docs/docs/tutorials/ed-4.ipynb index d7bb2c771..2bc849990 100644 --- a/docs/docs/tutorials/ed-4.ipynb +++ b/docs/docs/tutorials/ed-4.ipynb @@ -42,7 +42,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -63,12 +63,12 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structure\n", + "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters.\n", "\n", - "#### Create Structure" + "### Create Structure" ] }, { @@ -86,7 +86,7 @@ "id": "6", "metadata": {}, "source": [ - "#### Set Space Group" + "### Set Space Group" ] }, { @@ -104,7 +104,7 @@ "id": "8", "metadata": {}, "source": [ - "#### Set Unit Cell" + "### Set Unit Cell" ] }, { @@ -124,7 +124,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Set Atom Sites" + "### Set Atom Sites" ] }, { @@ -188,7 +188,7 @@ "id": "12", "metadata": {}, "source": [ - "## Define Experiments\n", + "## 🔬 Define Experiments\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step.\n", @@ -501,12 +501,12 @@ "id": "42", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object is used to manage structures, experiments, and\n", "analysis.\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -524,7 +524,7 @@ "id": "44", "metadata": {}, "source": [ - "#### Add Structure" + "### Add Structure" ] }, { @@ -542,7 +542,7 @@ "id": "46", "metadata": {}, "source": [ - "#### Add Experiments" + "### Add Experiments" ] }, { @@ -561,12 +561,12 @@ "id": "48", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section outlines the analysis process, including how to configure\n", "calculation and fitting engines.\n", "\n", - "#### Set Fit Mode" + "### Set Fit Mode" ] }, { @@ -584,7 +584,7 @@ "id": "50", "metadata": {}, "source": [ - "#### Set Minimizer" + "### Set Minimizer" ] }, { @@ -602,7 +602,7 @@ "id": "52", "metadata": {}, "source": [ - "#### Set Fitting Parameters\n", + "### Set Free Parameters\n", "\n", "Set structure parameters to be optimized." ] @@ -669,7 +669,7 @@ "id": "57", "metadata": {}, "source": [ - "#### Perform Fit" + "### Run Fitting" ] }, { @@ -677,7 +677,7 @@ "id": "58", "metadata": {}, "source": [ - "#### Plot Structure" + "### Display Structure" ] }, { @@ -695,7 +695,7 @@ "id": "60", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { diff --git a/docs/docs/tutorials/ed-4.py b/docs/docs/tutorials/ed-4.py index b6beefa68..39ea4b150 100644 --- a/docs/docs/tutorials/ed-4.py +++ b/docs/docs/tutorials/ed-4.py @@ -12,7 +12,7 @@ # based on the joint fit of both X-ray and neutron diffraction data. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -21,24 +21,24 @@ from easydiffraction import download_data # %% [markdown] -# ## Define Structure +# ## 🧩 Define Structure # # This section shows how to add structures and modify their # parameters. # -# #### Create Structure +# ### Create Structure # %% structure = StructureFactory.from_scratch(name='pbso4') # %% [markdown] -# #### Set Space Group +# ### Set Space Group # %% structure.space_group.name_h_m = 'P n m a' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # %% structure.cell.length_a = 8.47 @@ -46,7 +46,7 @@ structure.cell.length_c = 6.95 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # %% structure.atom_sites.create( @@ -97,7 +97,7 @@ # %% [markdown] -# ## Define Experiments +# ## 🔬 Define Experiments # # This section shows how to add experiments, configure their parameters, # and link the structures defined in the previous step. @@ -232,48 +232,48 @@ expt2.linked_phases.create(id='pbso4', scale=0.001) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object is used to manage structures, experiments, and # analysis. # -# #### Create Project +# ### Create Project # %% project = Project() # %% [markdown] -# #### Add Structure +# ### Add Structure # %% project.structures.add(structure) # %% [markdown] -# #### Add Experiments +# ### Add Experiments # %% project.experiments.add(expt1) project.experiments.add(expt2) # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section outlines the analysis process, including how to configure # calculation and fitting engines. # -# #### Set Fit Mode +# ### Set Fit Mode # %% project.analysis.fitting_mode.type = 'joint' # %% [markdown] -# #### Set Minimizer +# ### Set Minimizer # %% project.analysis.minimizer.type = 'lmfit' # %% [markdown] -# #### Set Fitting Parameters +# ### Set Free Parameters # # Set structure parameters to be optimized. @@ -309,16 +309,16 @@ term.coef.free = True # %% [markdown] -# #### Perform Fit +# ### Run Fitting # %% [markdown] -# #### Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='pbso4') # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='npd', x_min=35.5, x_max=38.3) diff --git a/docs/docs/tutorials/ed-5.ipynb b/docs/docs/tutorials/ed-5.ipynb index 930d73d9a..6aa0fedb2 100644 --- a/docs/docs/tutorials/ed-5.ipynb +++ b/docs/docs/tutorials/ed-5.ipynb @@ -39,7 +39,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -60,12 +60,12 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structure\n", + "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters.\n", "\n", - "#### Create Structure" + "### Create Structure" ] }, { @@ -83,7 +83,7 @@ "id": "6", "metadata": {}, "source": [ - "#### Set Space Group" + "### Set Space Group" ] }, { @@ -102,7 +102,7 @@ "id": "8", "metadata": {}, "source": [ - "#### Set Unit Cell" + "### Set Unit Cell" ] }, { @@ -122,7 +122,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Set Atom Sites" + "### Set Atom Sites" ] }, { @@ -193,12 +193,12 @@ "id": "12", "metadata": {}, "source": [ - "## Define Experiment\n", + "## 🔬 Define Experiment\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step.\n", "\n", - "#### Download Measured Data" + "### Download Data" ] }, { @@ -216,7 +216,7 @@ "id": "14", "metadata": {}, "source": [ - "#### Create Experiment" + "### Create Experiment" ] }, { @@ -234,7 +234,7 @@ "id": "16", "metadata": {}, "source": [ - "#### Set Instrument" + "### Set Instrument" ] }, { @@ -253,7 +253,7 @@ "id": "18", "metadata": {}, "source": [ - "#### Set Peak Profile" + "### Set Peak Profile" ] }, { @@ -293,7 +293,7 @@ "id": "22", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -334,7 +334,7 @@ "id": "25", "metadata": {}, "source": [ - "#### Set Linked Phases" + "### Set Linked Phases" ] }, { @@ -352,12 +352,12 @@ "id": "27", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object is used to manage the structure, experiment, and\n", "analysis.\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -385,7 +385,7 @@ "id": "30", "metadata": {}, "source": [ - "#### Add Structure" + "### Add Structure" ] }, { @@ -403,7 +403,7 @@ "id": "32", "metadata": {}, "source": [ - "#### Add Experiment" + "### Add Experiment" ] }, { @@ -421,12 +421,12 @@ "id": "34", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section shows the analysis process, including how to set up\n", "calculation and fitting engines.\n", "\n", - "#### Plot Structure" + "### Display Structure" ] }, { @@ -444,7 +444,7 @@ "id": "36", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -472,7 +472,7 @@ "id": "39", "metadata": {}, "source": [ - "#### Set Free Parameters" + "### Set Free Parameters" ] }, { @@ -543,7 +543,7 @@ "id": "44", "metadata": {}, "source": [ - "#### Set Constraints\n", + "### Set Constraints\n", "\n", "Set aliases for parameters." ] @@ -590,7 +590,7 @@ "id": "48", "metadata": {}, "source": [ - "#### Run Fitting" + "### Run Fitting" ] }, { @@ -628,7 +628,7 @@ "id": "52", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -656,7 +656,7 @@ "id": "55", "metadata": {}, "source": [ - "## Report\n", + "## 📊 Report\n", "\n", "The HTML report is written automatically when the project is saved;\n", "enable `project.report.pdf` as well for a PDF version." diff --git a/docs/docs/tutorials/ed-5.py b/docs/docs/tutorials/ed-5.py index 0a657ee02..1e1c27dda 100644 --- a/docs/docs/tutorials/ed-5.py +++ b/docs/docs/tutorials/ed-5.py @@ -9,7 +9,7 @@ # one-by-one and batch setting. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -18,25 +18,25 @@ from easydiffraction import download_data # %% [markdown] -# ## Define Structure +# ## 🧩 Define Structure # # This section shows how to add structures and modify their # parameters. # -# #### Create Structure +# ### Create Structure # %% structure = StructureFactory.from_scratch(name='cosio') # %% [markdown] -# #### Set Space Group +# ### Set Space Group # %% structure.space_group.name_h_m = 'P n m a' structure.space_group.it_coordinate_system_code = 'abc' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # %% structure.cell.length_a = 10.3 @@ -44,7 +44,7 @@ structure.cell.length_c = 4.8 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # %% structure.atom_sites.create( @@ -103,31 +103,31 @@ ) # %% [markdown] -# ## Define Experiment +# ## 🔬 Define Experiment # # This section shows how to add experiments, configure their parameters, # and link the structures defined in the previous step. # -# #### Download Measured Data +# ### Download Data # %% data_path = download_data(id=12, destination='data') # %% [markdown] -# #### Create Experiment +# ### Create Experiment # %% expt = ExperimentFactory.from_data_path(name='d20', data_path=data_path) # %% [markdown] -# #### Set Instrument +# ### Set Instrument # %% expt.instrument.setup_wavelength = 1.87 expt.instrument.calib_twotheta_offset = 0.1 # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # %% expt.peak.show_supported() @@ -141,7 +141,7 @@ expt.peak.broad_gauss_w = 0.4 # %% [markdown] -# #### Set Background +# ### Set Background # %% expt.background.show_supported() @@ -163,18 +163,18 @@ expt.background.create(id='14', x=150, y=500) # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # %% expt.linked_phases.create(id='cosio', scale=1.0) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object is used to manage the structure, experiment, and # analysis. # -# #### Create Project +# ### Create Project # %% project = Project() @@ -183,30 +183,30 @@ project.save_as('projects/cosio_d20') # %% [markdown] -# #### Add Structure +# ### Add Structure # %% project.structures.add(structure) # %% [markdown] -# #### Add Experiment +# ### Add Experiment # %% project.experiments.add(expt) # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section shows the analysis process, including how to set up # calculation and fitting engines. # -# #### Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='cosio') # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='d20') @@ -215,7 +215,7 @@ project.display.pattern(expt_name='d20', x_min=41, x_max=54) # %% [markdown] -# #### Set Free Parameters +# ### Set Free Parameters # %% structure.cell.length_a.free = True @@ -255,7 +255,7 @@ project.display.parameters.free() # %% [markdown] -# #### Set Constraints +# ### Set Constraints # # Set aliases for parameters. @@ -277,7 +277,7 @@ # %% [markdown] -# #### Run Fitting +# ### Run Fitting # %% project.analysis.fit() @@ -289,7 +289,7 @@ project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='d20') @@ -298,7 +298,7 @@ project.display.pattern(expt_name='d20', x_min=42, x_max=52) # %% [markdown] -# ## Report +# ## 📊 Report # # The HTML report is written automatically when the project is saved; # enable `project.report.pdf` as well for a PDF version. diff --git a/docs/docs/tutorials/ed-6.ipynb b/docs/docs/tutorials/ed-6.ipynb index 62780be9b..488690968 100644 --- a/docs/docs/tutorials/ed-6.ipynb +++ b/docs/docs/tutorials/ed-6.ipynb @@ -36,7 +36,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -57,12 +57,12 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structure\n", + "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters.\n", "\n", - "#### Create Structure" + "### Create Structure" ] }, { @@ -80,7 +80,7 @@ "id": "6", "metadata": {}, "source": [ - "#### Set Space Group" + "### Set Space Group" ] }, { @@ -101,7 +101,7 @@ "lines_to_next_cell": 2 }, "source": [ - "#### Set Unit Cell" + "### Set Unit Cell" ] }, { @@ -120,7 +120,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Set Atom Sites" + "### Set Atom Sites" ] }, { @@ -182,12 +182,12 @@ "id": "12", "metadata": {}, "source": [ - "## Define Experiment\n", + "## 🔬 Define Experiment\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step.\n", "\n", - "#### Download Measured Data" + "### Download Data" ] }, { @@ -205,7 +205,7 @@ "id": "14", "metadata": {}, "source": [ - "#### Create Experiment" + "### Create Experiment" ] }, { @@ -223,7 +223,7 @@ "id": "16", "metadata": {}, "source": [ - "#### Set Instrument" + "### Set Instrument" ] }, { @@ -242,7 +242,7 @@ "id": "18", "metadata": {}, "source": [ - "#### Set Peak Profile" + "### Set Peak Profile" ] }, { @@ -266,7 +266,7 @@ "id": "20", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -292,7 +292,7 @@ "id": "22", "metadata": {}, "source": [ - "#### Set Linked Phases" + "### Set Linked Phases" ] }, { @@ -310,12 +310,12 @@ "id": "24", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object is used to manage the structure, experiment, and\n", "analysis.\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -333,7 +333,7 @@ "id": "26", "metadata": {}, "source": [ - "#### Add Structure" + "### Add Structure" ] }, { @@ -351,7 +351,7 @@ "id": "28", "metadata": {}, "source": [ - "#### Add Experiment" + "### Add Experiment" ] }, { @@ -369,13 +369,13 @@ "id": "30", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section shows the analysis process, including how to set up\n", "calculation and fitting engines.\n", "\n", "\n", - "#### Plot Structure" + "### Display Structure" ] }, { @@ -393,7 +393,7 @@ "id": "32", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -491,7 +491,7 @@ "id": "42", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -591,7 +591,7 @@ "id": "52", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -689,7 +689,7 @@ "id": "62", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -802,7 +802,7 @@ "id": "73", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -830,7 +830,7 @@ "id": "76", "metadata": {}, "source": [ - "## Report\n", + "## 📊 Report\n", "\n", "The HTML report is written automatically when the project is saved;\n", "enable `project.report.pdf` as well for a PDF version." diff --git a/docs/docs/tutorials/ed-6.py b/docs/docs/tutorials/ed-6.py index 898b488da..b57c56952 100644 --- a/docs/docs/tutorials/ed-6.py +++ b/docs/docs/tutorials/ed-6.py @@ -6,7 +6,7 @@ # from HRPT at PSI. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -15,25 +15,25 @@ from easydiffraction import download_data # %% [markdown] -# ## Define Structure +# ## 🧩 Define Structure # # This section shows how to add structures and modify their # parameters. # -# #### Create Structure +# ### Create Structure # %% structure = StructureFactory.from_scratch(name='hs') # %% [markdown] -# #### Set Space Group +# ### Set Space Group # %% structure.space_group.name_h_m = 'R -3 m' structure.space_group.it_coordinate_system_code = 'h' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # %% @@ -41,7 +41,7 @@ structure.cell.length_c = 14.1 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # %% structure.atom_sites.create( @@ -91,31 +91,31 @@ ) # %% [markdown] -# ## Define Experiment +# ## 🔬 Define Experiment # # This section shows how to add experiments, configure their parameters, # and link the structures defined in the previous step. # -# #### Download Measured Data +# ### Download Data # %% data_path = download_data(id=11, destination='data') # %% [markdown] -# #### Create Experiment +# ### Create Experiment # %% expt = ExperimentFactory.from_data_path(name='hrpt', data_path=data_path) # %% [markdown] -# #### Set Instrument +# ### Set Instrument # %% expt.instrument.setup_wavelength = 1.89 expt.instrument.calib_twotheta_offset = 0.0 # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # %% expt.peak.show_supported() @@ -127,7 +127,7 @@ expt.peak.broad_lorentz_y = 0 # %% [markdown] -# #### Set Background +# ### Set Background # %% expt.background.create(id='1', x=4.4196, y=500) @@ -141,48 +141,48 @@ expt.background.create(id='9', x=159.4116, y=500) # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # %% expt.linked_phases.create(id='hs', scale=0.5) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object is used to manage the structure, experiment, and # analysis. # -# #### Create Project +# ### Create Project # %% project = Project() # %% [markdown] -# #### Add Structure +# ### Add Structure # %% project.structures.add(structure) # %% [markdown] -# #### Add Experiment +# ### Add Experiment # %% project.experiments.add(expt) # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section shows the analysis process, including how to set up # calculation and fitting engines. # # -# #### Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='hs') # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -218,7 +218,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -256,7 +256,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -292,7 +292,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -336,7 +336,7 @@ project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='hrpt') @@ -345,7 +345,7 @@ project.display.pattern(expt_name='hrpt', x_min=48, x_max=51) # %% [markdown] -# ## Report +# ## 📊 Report # # The HTML report is written automatically when the project is saved; # enable `project.report.pdf` as well for a PDF version. diff --git a/docs/docs/tutorials/ed-7.ipynb b/docs/docs/tutorials/ed-7.ipynb index 843ca694d..e0902a8e7 100644 --- a/docs/docs/tutorials/ed-7.ipynb +++ b/docs/docs/tutorials/ed-7.ipynb @@ -38,7 +38,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -59,12 +59,12 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structure\n", + "## 🧩 Define Structure\n", "\n", "This section shows how to add structures and modify their\n", "parameters.\n", "\n", - "#### Create Structure" + "### Create Structure" ] }, { @@ -82,7 +82,7 @@ "id": "6", "metadata": {}, "source": [ - "#### Set Space Group" + "### Set Space Group" ] }, { @@ -101,7 +101,7 @@ "id": "8", "metadata": {}, "source": [ - "#### Set Unit Cell" + "### Set Unit Cell" ] }, { @@ -119,7 +119,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Set Atom Sites" + "### Set Atom Sites" ] }, { @@ -144,12 +144,12 @@ "id": "12", "metadata": {}, "source": [ - "## Define Experiment\n", + "## 🔬 Define Experiment\n", "\n", "This section shows how to add experiments, configure their\n", "parameters, and link the structures defined in the previous step.\n", "\n", - "#### Download Measured Data" + "### Download Data" ] }, { @@ -167,7 +167,7 @@ "id": "14", "metadata": {}, "source": [ - "#### Create Experiment" + "### Create Experiment" ] }, { @@ -187,7 +187,7 @@ "id": "16", "metadata": {}, "source": [ - "#### Set Instrument" + "### Set Instrument" ] }, { @@ -208,7 +208,7 @@ "id": "18", "metadata": {}, "source": [ - "#### Set Peak Profile" + "### Set Peak Profile" ] }, { @@ -233,7 +233,7 @@ "id": "20", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -253,7 +253,7 @@ "id": "22", "metadata": {}, "source": [ - "#### Set Linked Phases" + "### Set Linked Phases" ] }, { @@ -271,12 +271,12 @@ "id": "24", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object is used to manage the structure, experiment, and\n", "analysis.\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -294,7 +294,7 @@ "id": "26", "metadata": {}, "source": [ - "#### Add Structure" + "### Add Structure" ] }, { @@ -312,7 +312,7 @@ "id": "28", "metadata": {}, "source": [ - "#### Add Experiment" + "### Add Experiment" ] }, { @@ -330,12 +330,12 @@ "id": "30", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section shows the analysis process, including how to set up\n", "calculation and fitting engines.\n", "\n", - "#### Plot Structure" + "### Display Structure" ] }, { @@ -353,7 +353,7 @@ "id": "32", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -432,7 +432,7 @@ "id": "40", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -518,7 +518,7 @@ "id": "49", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -624,7 +624,7 @@ "id": "60", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -713,7 +713,7 @@ "id": "69", "metadata": {}, "source": [ - "#### Show parameter correlations" + "#### Display Correlations" ] }, { @@ -731,7 +731,7 @@ "id": "71", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { @@ -886,7 +886,7 @@ "id": "86", "metadata": {}, "source": [ - "#### Show parameter correlations" + "#### Display Correlations" ] }, { @@ -904,7 +904,7 @@ "id": "88", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "#### Display Pattern" ] }, { diff --git a/docs/docs/tutorials/ed-7.py b/docs/docs/tutorials/ed-7.py index 45974a561..a8d568805 100644 --- a/docs/docs/tutorials/ed-7.py +++ b/docs/docs/tutorials/ed-7.py @@ -8,7 +8,7 @@ # It also shows how to switch calculation engine and peak profile type. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -17,31 +17,31 @@ from easydiffraction import download_data # %% [markdown] -# ## Define Structure +# ## 🧩 Define Structure # # This section shows how to add structures and modify their # parameters. # -# #### Create Structure +# ### Create Structure # %% structure = StructureFactory.from_scratch(name='si') # %% [markdown] -# #### Set Space Group +# ### Set Space Group # %% structure.space_group.name_h_m = 'F d -3 m' structure.space_group.it_coordinate_system_code = '2' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # %% structure.cell.length_a = 5.431 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # %% structure.atom_sites.create( @@ -54,18 +54,18 @@ ) # %% [markdown] -# ## Define Experiment +# ## 🔬 Define Experiment # # This section shows how to add experiments, configure their # parameters, and link the structures defined in the previous step. # -# #### Download Measured Data +# ### Download Data # %% data_path = download_data(id=7, destination='data') # %% [markdown] -# #### Create Experiment +# ### Create Experiment # %% expt = ExperimentFactory.from_data_path( @@ -73,7 +73,7 @@ ) # %% [markdown] -# #### Set Instrument +# ### Set Instrument # %% expt.instrument.setup_twotheta_bank = 144.845 @@ -82,7 +82,7 @@ expt.instrument.calib_d_to_tof_quad = -1.54 # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # %% expt.peak.show_supported() @@ -95,7 +95,7 @@ expt.peak.exp_rise_alpha_1 = 0.5971 # %% [markdown] -# #### Set Background +# ### Set Background # %% expt.background.type = 'line-segment' @@ -103,47 +103,47 @@ expt.background.create(id=str(x), x=x, y=200) # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # %% expt.linked_phases.create(id='si', scale=10.0) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object is used to manage the structure, experiment, and # analysis. # -# #### Create Project +# ### Create Project # %% project = Project() # %% [markdown] -# #### Add Structure +# ### Add Structure # %% project.structures.add(structure) # %% [markdown] -# #### Add Experiment +# ### Add Experiment # %% project.experiments.add(expt) # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section shows the analysis process, including how to set up # calculation and fitting engines. # -# #### Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='si') # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='sepd') @@ -174,7 +174,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='sepd') @@ -205,7 +205,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='sepd') @@ -244,7 +244,7 @@ project.display.fit.results() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='sepd') @@ -278,13 +278,13 @@ project.display.fit.results() # %% [markdown] -# #### Show parameter correlations +# #### Display Correlations # %% project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='sepd') @@ -343,13 +343,13 @@ project.display.fit.results() # %% [markdown] -# #### Show parameter correlations +# #### Display Correlations # %% project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# #### Display Pattern # %% project.display.pattern(expt_name='sepd', x_min=23200, x_max=23700) diff --git a/docs/docs/tutorials/ed-8.ipynb b/docs/docs/tutorials/ed-8.ipynb index f61c4ea9a..e564ca387 100644 --- a/docs/docs/tutorials/ed-8.ipynb +++ b/docs/docs/tutorials/ed-8.ipynb @@ -39,7 +39,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -60,12 +60,12 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structure\n", + "## 🧩 Define Structure\n", "\n", "This section covers how to add structures and modify their\n", "parameters.\n", "\n", - "#### Create Structure" + "### Create Structure" ] }, { @@ -83,7 +83,7 @@ "id": "6", "metadata": {}, "source": [ - "#### Set Space Group" + "### Set Space Group" ] }, { @@ -102,7 +102,7 @@ "id": "8", "metadata": {}, "source": [ - "#### Set Unit Cell" + "### Set Unit Cell" ] }, { @@ -120,7 +120,7 @@ "id": "10", "metadata": {}, "source": [ - "#### Set Atom Sites" + "### Set Atom Sites" ] }, { @@ -191,12 +191,12 @@ "id": "12", "metadata": {}, "source": [ - "## Define Experiment\n", + "## 🔬 Define Experiment\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step.\n", "\n", - "#### Download Measured Data" + "### Download Data" ] }, { @@ -224,7 +224,7 @@ "id": "15", "metadata": {}, "source": [ - "#### Create Experiment" + "### Create Experiment" ] }, { @@ -260,7 +260,7 @@ "id": "18", "metadata": {}, "source": [ - "#### Set Instrument" + "### Set Instrument" ] }, { @@ -294,7 +294,7 @@ "id": "21", "metadata": {}, "source": [ - "#### Set Peak Profile" + "### Set Peak Profile" ] }, { @@ -335,7 +335,7 @@ "id": "24", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -431,7 +431,7 @@ "id": "27", "metadata": {}, "source": [ - "#### Set Linked Phases" + "### Set Linked Phases" ] }, { @@ -459,7 +459,7 @@ "id": "30", "metadata": {}, "source": [ - "#### Set Excluded Regions" + "### Set Excluded Regions" ] }, { @@ -489,12 +489,12 @@ "id": "33", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object is used to manage the structure, experiments,\n", "and analysis\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -512,7 +512,7 @@ "id": "35", "metadata": {}, "source": [ - "#### Add Structure" + "### Add Structure" ] }, { @@ -530,7 +530,7 @@ "id": "37", "metadata": {}, "source": [ - "#### Add Experiment" + "### Add Experiment" ] }, { @@ -549,12 +549,12 @@ "id": "39", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section shows the analysis process, including how to set up\n", "calculation and fitting engines.\n", "\n", - "#### Set Fit Mode" + "### Set Fit Mode" ] }, { @@ -573,7 +573,7 @@ "id": "41", "metadata": {}, "source": [ - "#### Set Free Parameters" + "### Set Free Parameters" ] }, { @@ -620,7 +620,7 @@ "id": "44", "metadata": {}, "source": [ - "#### Plot Structure" + "### Display Structure" ] }, { @@ -638,7 +638,7 @@ "id": "46", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -666,7 +666,7 @@ "id": "49", "metadata": {}, "source": [ - "#### Run Fitting" + "### Run Fitting" ] }, { @@ -686,7 +686,7 @@ "id": "51", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { @@ -714,7 +714,7 @@ "id": "54", "metadata": {}, "source": [ - "## Report\n", + "## 📊 Report\n", "\n", "The HTML report is written automatically when the project is saved;\n", "enable `project.report.pdf` as well for a PDF version." diff --git a/docs/docs/tutorials/ed-8.py b/docs/docs/tutorials/ed-8.py index 0988ffd71..09917e35c 100644 --- a/docs/docs/tutorials/ed-8.py +++ b/docs/docs/tutorials/ed-8.py @@ -9,7 +9,7 @@ # fitting. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -18,31 +18,31 @@ from easydiffraction import download_data # %% [markdown] -# ## Define Structure +# ## 🧩 Define Structure # # This section covers how to add structures and modify their # parameters. # -# #### Create Structure +# ### Create Structure # %% structure = StructureFactory.from_scratch(name='ncaf') # %% [markdown] -# #### Set Space Group +# ### Set Space Group # %% structure.space_group.name_h_m = 'I 21 3' structure.space_group.it_coordinate_system_code = '1' # %% [markdown] -# #### Set Unit Cell +# ### Set Unit Cell # %% structure.cell.length_a = 10.250256 # %% [markdown] -# #### Set Atom Sites +# ### Set Atom Sites # %% structure.atom_sites.create( @@ -101,12 +101,12 @@ ) # %% [markdown] -# ## Define Experiment +# ## 🔬 Define Experiment # # This section shows how to add experiments, configure their parameters, # and link the structures defined in the previous step. # -# #### Download Measured Data +# ### Download Data # %% data_path56 = download_data(id=9, destination='data') @@ -115,7 +115,7 @@ data_path47 = download_data(id=10, destination='data') # %% [markdown] -# #### Create Experiment +# ### Create Experiment # %% expt56 = ExperimentFactory.from_data_path( @@ -132,7 +132,7 @@ ) # %% [markdown] -# #### Set Instrument +# ### Set Instrument # %% expt56.instrument.setup_twotheta_bank = 152.827 @@ -147,7 +147,7 @@ expt47.instrument.calib_d_to_tof_quad = -0.47488 # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # %% expt56.peak.show_supported() @@ -169,7 +169,7 @@ expt47.peak.exp_rise_alpha_1 = 0.1 # %% [markdown] -# #### Set Background +# ### Set Background # %% expt56.background.show_supported() @@ -246,7 +246,7 @@ expt47.background.create(id=str(idx), x=x, y=y) # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # %% expt56.linked_phases.create(id='ncaf', scale=1.0) @@ -255,7 +255,7 @@ expt47.linked_phases.create(id='ncaf', scale=2.0) # %% [markdown] -# #### Set Excluded Regions +# ### Set Excluded Regions # %% expt56.excluded_regions.create(id='1', start=0, end=10010) @@ -266,43 +266,43 @@ expt47.excluded_regions.create(id='2', start=100004, end=200000) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object is used to manage the structure, experiments, # and analysis # -# #### Create Project +# ### Create Project # %% project = Project() # %% [markdown] -# #### Add Structure +# ### Add Structure # %% project.structures.add(structure) # %% [markdown] -# #### Add Experiment +# ### Add Experiment # %% project.experiments.add(expt56) project.experiments.add(expt47) # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section shows the analysis process, including how to set up # calculation and fitting engines. # -# #### Set Fit Mode +# ### Set Fit Mode # %% project.analysis.fitting_mode.show_supported() project.analysis.fitting_mode.type = 'joint' # %% [markdown] -# #### Set Free Parameters +# ### Set Free Parameters # %% structure.atom_sites['Ca'].adp_iso.free = True @@ -330,13 +330,13 @@ expt47.peak.exp_rise_alpha_1.free = True # %% [markdown] -# #### Plot Structure +# ### Display Structure # %% project.display.structure(struct_name='ncaf') # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='wish_5_6') @@ -345,7 +345,7 @@ project.display.pattern(expt_name='wish_4_7') # %% [markdown] -# #### Run Fitting +# ### Run Fitting # %% project.analysis.fit() @@ -353,7 +353,7 @@ project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='wish_5_6') @@ -362,7 +362,7 @@ project.display.pattern(expt_name='wish_4_7') # %% [markdown] -# ## Report +# ## 📊 Report # # The HTML report is written automatically when the project is saved; # enable `project.report.pdf` as well for a PDF version. diff --git a/docs/docs/tutorials/ed-9.ipynb b/docs/docs/tutorials/ed-9.ipynb index 6737251b3..8722b614e 100644 --- a/docs/docs/tutorials/ed-9.ipynb +++ b/docs/docs/tutorials/ed-9.ipynb @@ -36,7 +36,7 @@ "id": "2", "metadata": {}, "source": [ - "## Import Library" + "## 🛠️ Import Library" ] }, { @@ -57,7 +57,7 @@ "id": "4", "metadata": {}, "source": [ - "## Define Structures\n", + "## 🧩 Define Structures\n", "\n", "This section shows how to add structures and modify their\n", "parameters.\n", @@ -253,12 +253,12 @@ "id": "20", "metadata": {}, "source": [ - "## Define Experiment\n", + "## 🔬 Define Experiment\n", "\n", "This section shows how to add experiments, configure their parameters,\n", "and link the structures defined in the previous step.\n", "\n", - "#### Download Data" + "### Download Data" ] }, { @@ -276,7 +276,7 @@ "id": "22", "metadata": {}, "source": [ - "#### Create Experiment" + "### Create Experiment" ] }, { @@ -301,7 +301,7 @@ "id": "24", "metadata": {}, "source": [ - "#### Set Instrument" + "### Set Instrument" ] }, { @@ -320,7 +320,7 @@ "id": "26", "metadata": {}, "source": [ - "#### Set Peak Profile" + "### Set Peak Profile" ] }, { @@ -344,7 +344,7 @@ "id": "28", "metadata": {}, "source": [ - "#### Set Background" + "### Set Background" ] }, { @@ -400,7 +400,7 @@ "id": "33", "metadata": {}, "source": [ - "#### Set Linked Phases" + "### Set Linked Phases" ] }, { @@ -419,12 +419,12 @@ "id": "35", "metadata": {}, "source": [ - "## Define Project\n", + "## 📦 Define Project\n", "\n", "The project object is used to manage structures, experiments, and\n", "analysis.\n", "\n", - "#### Create Project" + "### Create Project" ] }, { @@ -442,7 +442,7 @@ "id": "37", "metadata": {}, "source": [ - "#### Add Structures" + "### Add Structures" ] }, { @@ -461,7 +461,7 @@ "id": "39", "metadata": {}, "source": [ - "#### Show Structures" + "### Show Structures" ] }, { @@ -479,7 +479,7 @@ "id": "41", "metadata": {}, "source": [ - "#### Add Experiments" + "### Add Experiments" ] }, { @@ -497,7 +497,7 @@ "id": "43", "metadata": {}, "source": [ - "#### Plot Structures" + "### Display Structure" ] }, { @@ -516,7 +516,7 @@ "id": "45", "metadata": {}, "source": [ - "#### Set Excluded Regions\n", + "### Set Excluded Regions\n", "\n", "Show measured data as loaded from the file." ] @@ -609,12 +609,12 @@ "id": "55", "metadata": {}, "source": [ - "## Perform Analysis\n", + "## 🚀 Perform Analysis\n", "\n", "This section outlines the analysis process, including how to configure\n", "calculation and fitting engines.\n", "\n", - "#### Set Fitting Parameters\n", + "### Set Free Parameters\n", "\n", "Set structure parameters to be optimized." ] @@ -668,7 +668,7 @@ "id": "59", "metadata": {}, "source": [ - "#### Perform Fit" + "### Run Fitting" ] }, { @@ -688,7 +688,7 @@ "id": "61", "metadata": {}, "source": [ - "#### Plot Measured vs Calculated" + "### Display Pattern" ] }, { diff --git a/docs/docs/tutorials/ed-9.py b/docs/docs/tutorials/ed-9.py index be0cfa6ff..083bde68f 100644 --- a/docs/docs/tutorials/ed-9.py +++ b/docs/docs/tutorials/ed-9.py @@ -6,7 +6,7 @@ # neutron powder diffraction data simulated with McStas. # %% [markdown] -# ## Import Library +# ## 🛠️ Import Library # %% from easydiffraction import ExperimentFactory @@ -15,7 +15,7 @@ from easydiffraction import download_data # %% [markdown] -# ## Define Structures +# ## 🧩 Define Structures # # This section shows how to add structures and modify their # parameters. @@ -115,18 +115,18 @@ ) # %% [markdown] -# ## Define Experiment +# ## 🔬 Define Experiment # # This section shows how to add experiments, configure their parameters, # and link the structures defined in the previous step. # -# #### Download Data +# ### Download Data # %% data_path = download_data(id=8, destination='data') # %% [markdown] -# #### Create Experiment +# ### Create Experiment # %% experiment = ExperimentFactory.from_data_path( @@ -139,14 +139,14 @@ ) # %% [markdown] -# #### Set Instrument +# ### Set Instrument # %% experiment.instrument.setup_twotheta_bank = 94.90931761529106 experiment.instrument.calib_d_to_tof_linear = 58724.76869981215 # %% [markdown] -# #### Set Peak Profile +# ### Set Peak Profile # %% experiment.peak.broad_gauss_sigma_0 = 45137 @@ -158,7 +158,7 @@ experiment.peak.exp_rise_alpha_1 = 0.0097 # %% [markdown] -# #### Set Background +# ### Set Background # %% [markdown] # Select the background type. @@ -185,51 +185,51 @@ experiment.background.create(id='13', x=110000, y=0.2) # %% [markdown] -# #### Set Linked Phases +# ### Set Linked Phases # %% experiment.linked_phases.create(id='lbco', scale=4.0) experiment.linked_phases.create(id='si', scale=0.2) # %% [markdown] -# ## Define Project +# ## 📦 Define Project # # The project object is used to manage structures, experiments, and # analysis. # -# #### Create Project +# ### Create Project # %% project = Project() # %% [markdown] -# #### Add Structures +# ### Add Structures # %% project.structures.add(structure_1) project.structures.add(structure_2) # %% [markdown] -# #### Show Structures +# ### Show Structures # %% project.structures.show_names() # %% [markdown] -# #### Add Experiments +# ### Add Experiments # %% project.experiments.add(experiment) # %% [markdown] -# #### Plot Structures +# ### Display Structure # %% project.display.structure(struct_name='lbco') project.display.structure(struct_name='si') # %% [markdown] -# #### Set Excluded Regions +# ### Set Excluded Regions # # Show measured data as loaded from the file. @@ -262,12 +262,12 @@ project.experiments['mcstas'].show_as_cif() # %% [markdown] -# ## Perform Analysis +# ## 🚀 Perform Analysis # # This section outlines the analysis process, including how to configure # calculation and fitting engines. # -# #### Set Fitting Parameters +# ### Set Free Parameters # # Set structure parameters to be optimized. @@ -297,7 +297,7 @@ point.y.free = True # %% [markdown] -# #### Perform Fit +# ### Run Fitting # %% project.analysis.fit() @@ -305,7 +305,7 @@ project.display.fit.correlations() # %% [markdown] -# #### Plot Measured vs Calculated +# ### Display Pattern # %% project.display.pattern(expt_name='mcstas') From 7fdd96209d54876f3debccaf9e4eb2b2724d0f5c Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 21:29:24 +0200 Subject: [PATCH 33/50] Limit tutorial notebook TOC to two levels --- docs/mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 7dc3c0b90..7b0c70697 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -144,6 +144,7 @@ plugins: include_requirejs: true # Required for Plotly #custom_mathjax_url: 'https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js' # See 'extra_javascript' above ignore_h1_titles: true # Use titles defined in the nav section below + toc_depth: 3 # Notebook-only TOC depth: show `##`/`###`, hide deeper steps (`####`) remove_tag_config: remove_input_tags: - hide-in-docs From 041ab8100a25efa303298672fbc28c8319c8db8d Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 21:41:53 +0200 Subject: [PATCH 34/50] Theme modebar icons; clear background outside correlation cells --- docs/docs/assets/javascripts/ed-figures.js | 5 +++- .../display/plotters/plotly.py | 25 ++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/docs/assets/javascripts/ed-figures.js b/docs/docs/assets/javascripts/ed-figures.js index bbd84d6ee..2dc377a0f 100644 --- a/docs/docs/assets/javascripts/ed-figures.js +++ b/docs/docs/assets/javascripts/ed-figures.js @@ -92,10 +92,13 @@ return; } var paperBackground = colors.paperBackground || 'rgba(0, 0, 0, 0)'; + var transparentPlot = themeSync && themeSync.correlationHeatmap === true; var update = { paper_bgcolor: paperBackground, - plot_bgcolor: colors.background, + plot_bgcolor: transparentPlot ? paperBackground : colors.background, 'modebar.bgcolor': paperBackground, + 'modebar.color': colors.foreground, + 'modebar.activecolor': colors.foreground, 'font.color': colors.foreground, 'title.font.color': colors.foreground, 'legend.bgcolor': colors.legend, diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index fb419e2df..3946f4f21 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -1356,10 +1356,13 @@ def _theme_sync_post_script() -> str: } graphDiv.dataset.edPlotlyTheme = theme; + const transparentPlot = syncMeta.__THEME_SYNC_CORRELATION_HEATMAP_KEY__ === true; const update = { paper_bgcolor: colors.paperBackground, - plot_bgcolor: colors.background, + plot_bgcolor: transparentPlot ? colors.paperBackground : colors.background, 'modebar.bgcolor': colors.paperBackground, + 'modebar.color': colors.foreground, + 'modebar.activecolor': colors.foreground, 'font.color': colors.foreground, 'title.font.color': colors.foreground, 'legend.bgcolor': colors.legend, @@ -1931,11 +1934,26 @@ def _apply_background_color( resolved_background = background_color if resolved_background is None: resolved_background = cls._background_color() + if cls._figure_is_correlation_heatmap(fig): + # Correlation cells carry their own colors; keep the + # area outside the cells transparent. + resolved_background = cls._paper_background_color() update_layout( paper_bgcolor=cls._paper_background_color(), plot_bgcolor=resolved_background, ) + @classmethod + def _figure_is_correlation_heatmap(cls, fig: object) -> bool: + """ + Return whether a figure is flagged as a correlation heatmap. + """ + meta = cls._figure_meta(fig) + theme_sync = meta.get(THEME_SYNC_META_KEY) if isinstance(meta, dict) else None + if not isinstance(theme_sync, dict): + return False + return bool(theme_sync.get(THEME_SYNC_CORRELATION_HEATMAP_KEY)) + @classmethod def _get_layout( cls, @@ -2016,6 +2034,11 @@ def _get_layout( }, paper_bgcolor=cls._paper_background_color(), plot_bgcolor=cls._background_color(), + modebar={ + 'bgcolor': cls._paper_background_color(), + 'color': cls._theme_colors().foreground, + 'activecolor': cls._theme_colors().foreground, + }, legend={ 'bgcolor': cls._legend_background_color(), 'xanchor': 'right', From 2683857d5e689f659c9e305d5315abc80525e912 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 21:59:26 +0200 Subject: [PATCH 35/50] Inset Plotly plot legend from the top-right corner --- src/easydiffraction/display/plotters/plotly.py | 8 ++++---- src/easydiffraction/display/plotting.py | 4 ++-- tests/unit/easydiffraction/display/test_plotting.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index 3946f4f21..b89290b75 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -2042,9 +2042,9 @@ def _get_layout( legend={ 'bgcolor': cls._legend_background_color(), 'xanchor': 'right', - 'x': 1.0, + 'x': 0.99, 'yanchor': 'top', - 'y': 1.0, + 'y': 0.97, }, xaxis=xaxis, yaxis=yaxis, @@ -2652,9 +2652,9 @@ def _configure_powder_composite_layout( legend={ 'bgcolor': self._legend_background_color(), 'xanchor': 'right', - 'x': 1.0, + 'x': 0.99, 'yanchor': 'top', - 'y': 1.0, + 'y': 0.97, }, ) diff --git a/src/easydiffraction/display/plotting.py b/src/easydiffraction/display/plotting.py index d7f3078b1..4cdd7452b 100644 --- a/src/easydiffraction/display/plotting.py +++ b/src/easydiffraction/display/plotting.py @@ -3992,9 +3992,9 @@ def _plot_posterior_predictive_summary( legend={ 'bgcolor': self._plot_legend_background_color(), 'xanchor': 'right', - 'x': 1.0, + 'x': 0.99, 'yanchor': 'top', - 'y': 1.0, + 'y': 0.97, }, xaxis_title=axes_labels[0], yaxis_title=axes_labels[1], diff --git a/tests/unit/easydiffraction/display/test_plotting.py b/tests/unit/easydiffraction/display/test_plotting.py index 08df9477d..756ea6d5b 100644 --- a/tests/unit/easydiffraction/display/test_plotting.py +++ b/tests/unit/easydiffraction/display/test_plotting.py @@ -877,8 +877,8 @@ def test_plot_posterior_predictive_summary_uses_consistent_labels_and_styles(mon assert measured_trace.legendrank == 10 assert max_posterior_trace.legendrank == 20 assert max_posterior_trace.line.dash == POSTERIOR_POINT_ESTIMATE_LINE_DASH - assert fig.layout.legend.x == 1.0 - assert fig.layout.legend.y == 1.0 + assert fig.layout.legend.x == 0.99 + assert fig.layout.legend.y == 0.97 assert fig.layout.legend.bgcolor == PlotlyPlotter._legend_background_color() assert fig.layout.margin.r == 30 assert fig.layout.margin.t == 40 From c248711c8d3441c1324df57d1059644d63c821ea Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 21:59:26 +0200 Subject: [PATCH 36/50] Use #212121 for dark background inside the axes --- src/easydiffraction/display/theme.py | 2 +- .../easydiffraction/display/structure/assets/test_colors.py | 4 ++-- .../display/structure/renderers/test_threejs.py | 4 ++-- tests/unit/easydiffraction/display/test_theme.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/easydiffraction/display/theme.py b/src/easydiffraction/display/theme.py index d08d58329..dd255f09c 100644 --- a/src/easydiffraction/display/theme.py +++ b/src/easydiffraction/display/theme.py @@ -8,7 +8,7 @@ # Background inside the axes rectangle (the plotted area / 3D scene). LIGHT_BACKGROUND_COLOR = '#ffffff' -DARK_BACKGROUND_COLOR = '#111111' +DARK_BACKGROUND_COLOR = '#212121' # Figure paper (margins around the axes) stays transparent so charts # blend into the host page; only the plotted area is opaque. PAPER_BACKGROUND_COLOR = 'rgba(0, 0, 0, 0)' diff --git a/tests/unit/easydiffraction/display/structure/assets/test_colors.py b/tests/unit/easydiffraction/display/structure/assets/test_colors.py index 82e6c10eb..5246a37d7 100644 --- a/tests/unit/easydiffraction/display/structure/assets/test_colors.py +++ b/tests/unit/easydiffraction/display/structure/assets/test_colors.py @@ -90,8 +90,8 @@ def test_light_theme_values(self): assert LIGHT_THEME['foreground'] == (34, 34, 34) def test_dark_theme_values(self): - # Derived from display/theme.py (#111111 / #e6e8ee). - assert DARK_THEME['background'] == (17, 17, 17) + # Derived from display/theme.py (#212121 / #e6e8ee). + assert DARK_THEME['background'] == (33, 33, 33) assert DARK_THEME['foreground'] == (230, 232, 238) def test_theme_values_all_rgb(self): diff --git a/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py b/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py index 5d34e6092..32f182ad5 100644 --- a/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py +++ b/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py @@ -776,8 +776,8 @@ def test_dark_theme_embeds_scene_background_and_contrast_colours(self): offline=True, dark=True, ) - assert '--cv-scene-bg: rgb(17, 17, 17);' in html - assert '--cv-label-shadow-bg: rgb(17, 17, 17);' in html + assert '--cv-scene-bg: rgb(33, 33, 33);' in html + assert '--cv-label-shadow-bg: rgb(33, 33, 33);' in html assert 'rgb(230, 232, 238)' in html # DARK_THEME foreground assert 'dark' in html diff --git a/tests/unit/easydiffraction/display/test_theme.py b/tests/unit/easydiffraction/display/test_theme.py index 6c9fa267d..3a2b3288d 100644 --- a/tests/unit/easydiffraction/display/test_theme.py +++ b/tests/unit/easydiffraction/display/test_theme.py @@ -32,7 +32,7 @@ def test_plot_backgrounds_opaque_and_paper_transparent(): # Inside the axes rectangle is opaque; the figure paper stays # transparent so charts blend into the host page. assert theme.LIGHT_BACKGROUND_COLOR == '#ffffff' - assert theme.DARK_BACKGROUND_COLOR == '#111111' + assert theme.DARK_BACKGROUND_COLOR == '#212121' assert theme.PAPER_BACKGROUND_COLOR == 'rgba(0, 0, 0, 0)' From 00b48a9f3499f964cdf61195661cda9f48cf6ed0 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 22:21:21 +0200 Subject: [PATCH 37/50] Theme modebar icons via native Plotly colors, drop CSS hack --- .../suggestions/wyckoff-letter-detection.md | 16 +++ docs/dev/plans/wyckoff-letter-detection.md | 122 +++++++++++++----- docs/docs/assets/javascripts/ed-figures.js | 36 +++++- .../display/plotters/plotly.py | 69 ++++------ .../display/plotters/test_plotly.py | 7 +- 5 files changed, 169 insertions(+), 81 deletions(-) diff --git a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md index cb8333f27..a838598e1 100644 --- a/docs/dev/adrs/suggestions/wyckoff-letter-detection.md +++ b/docs/dev/adrs/suggestions/wyckoff-letter-detection.md @@ -584,6 +584,14 @@ identically in both spellings and so never exercised the gap. shortcut was wrong for coordinates on another representative of the same orbit; that case is intentionally fixed by nearest-representative selection. +- Projects with explicit letters on a coupled special position currently + stored in operator form (for example R-3m `h`) keep their letters, but + their constraint behaviour changes once the table is regenerated to + canonical form (§10): the dependent coordinate stops drifting under + refinement and is slaved to the free coordinate + (`fract_y = -fract_x`). This is the intended fix for the ed-6 + regression and, like nearest-representative selection, is a deliberate + constraint change to call out rather than a silent one. - A saved project reloads to the same letters: every letter is written (whether the user supplied it or detection filled it), so all reload verbatim — and an auto-filled one would re-derive to the same value @@ -641,6 +649,14 @@ may miss: - non-first orbit representatives, including auto-detection of a point near a representative such as `(0,x,0)` and explicit-letter snapping via the nearest representative rather than `coords_xyz[0]` (§2, §5); +- the §10 canonical-template invariant: a coupled special position such + as R-3m `h` (`(x,-x,z)`) flags `fract_y` symmetry-constrained and + re-slaves it to `-fract_x` after a `fract_x` edit — the ed-6 + regression guard — and a data check that every `SPACE_GROUPS` + `coords_xyz` template is canonical parametric form, i.e. no component + contains its own axis variable in a coupled term (operator-form + leakage), so a future table regeneration cannot silently reintroduce + the bug; - lenient matching of rounded inputs (`0.3333 → 1/3`, `0.4999 → 1/2`) at the `1e-3` tolerance (§5); - the `''`→`None` coordinate-code normalisation — P1/P-1 under their diff --git a/docs/dev/plans/wyckoff-letter-detection.md b/docs/dev/plans/wyckoff-letter-detection.md index dfe172b43..11b115ec7 100644 --- a/docs/dev/plans/wyckoff-letter-detection.md +++ b/docs/dev/plans/wyckoff-letter-detection.md @@ -15,12 +15,20 @@ ADR. No deliberate exception to `AGENTS.md` is taken. This plan implements the [`wyckoff-letter-detection`](../adrs/suggestions/wyckoff-letter-detection.md) -ADR. The ADR review cycle previously closed at review 10, but the ADR -then changed to add the derived `space_group_Wyckoff` category and -space-group-key re-detection. That later ADR review cycle closed at -`wyckoff-letter-detection_review-16.md`, whose second non-blank line is -the final-review sentinel. The closed ADR text was committed as -`0f3bc269c` (`Finalize Wyckoff letter detection ADR`). +ADR. Earlier ADR review cycles closed at review 10 and then review 16 +(adding the derived `space_group_Wyckoff` category and space-group-key +re-detection); that text was committed as `0f3bc269c` +(`Finalize Wyckoff letter detection ADR`). The ADR was then **extended +with §10 (canonical `coords_xyz` templates)** after the coupled +special-position regression was found in the `ed-6` tutorial. That §10 +`draft-adr` cycle closed with the final-review sentinel in +`wyckoff-letter-detection_review-2.md`; its §10 text was committed as +`9882c50cb`, with a small Testing/Compatibility follow-up still in the +worktree at planning time. The ADR `_review-*` / `_reply-*` siblings are +transient and are removed by `/draft-impl-1` Phase A before the +checklist runs, so P1.0 verifies durable signals (§10 present and +committed, and the §10 prerequisite landed) rather than a specific +review file. Its prerequisite — the [`space-group-database`](../adrs/accepted/space-group-database.md) ADR @@ -129,30 +137,35 @@ rotation/translation parser. stored non-empty letter verbatim with `?` multiplicity. 14. **Tolerance.** `_WYCKOFF_DETECTION_TOL = 1e-3` is the default; a user/project-level tolerance setting remains deferred. -15. **Canonical Wyckoff templates are a prerequisite (ADR §10).** The - orbit matcher (Decisions 2–3), snapping (Decision 5), and the - existing coordinate constraints assume `coords_xyz` in canonical ITA - parametric form (`(x,-x,z)`), but the bundled `space_groups.json.gz` - ships cctbx operator-form templates (`(1/2*x-1/2*y,…)`) for 288 - coupled special positions across 117 IT numbers. That spelling - silently breaks `_fract_constrained_flags()` / - `_apply_fract_constraints()`, so a refined special-position - coordinate drifts off-site (the `ed-6` fit-3 → fit-4 regression). - The table must be regenerated in canonical form — with a - generation-time invariant check rejecting operator-form leakage — - before detection/snapping can be trusted, and a coupled-position - regression test (e.g. R-3m `h`) added. This touches the - space-group-database, so treat it as a coordinated change with that - ADR. +15. **Canonical Wyckoff templates are a prerequisite (ADR §10), owned by + the space-group database.** The orbit matcher (Decisions 2–3), + snapping (Decision 5), and the existing coordinate constraints + assume `coords_xyz` in canonical ITA parametric form (`(x,-x,z)`), + but the bundled `space_groups.json.gz` ships cctbx operator-form + templates (`(1/2*x-1/2*y,…)`) for 288 coupled special positions + across 117 IT numbers. That spelling silently breaks + `_fract_constrained_flags()` / `_apply_fract_constraints()`, so a + refined special-position coordinate drifts off-site (the `ed-6` + fit-3 → fit-4 regression). **Decision: fix this as a standalone + prerequisite** against the + [`space-group-database`](../adrs/accepted/space-group-database.md) + ADR, not inside this feature. The generator + (`tmp/space-groups/helper-tools/generate_space_groups.py`, cctbx- + dependent and not in this repo's environment) and the bundled + `space_groups.json.gz` are that ADR's artifacts, and the live + refinement regression should ship on its own small PR rather than + wait for this feature. That fix re-parametrises every operator-form + template to canonical form (deterministic; verified for all 288), + adds a generation-time invariant check (and a + `tools/check_packaged_db.py` assertion) rejecting operator-form + leakage, and adds a coupled- position constraint regression. This + plan **depends on** that fix, **verifies it at P1.0**, and does not + modify the database generator itself. ## Open questions - **Tolerance default.** `1e-3` is the ADR's starting point; it may be tuned against the tutorial corpus during Phase 2. Not a blocker. -- **Canonical-form regeneration ownership.** §10's fix lives in the - space-group-database generator, not this feature's code. Decide - whether to land it as a standalone fix ahead of this plan or fold it - into Phase 1 — it is a hard prerequisite either way. ## Concrete files likely to change @@ -212,6 +225,19 @@ Phase 2 (tests): group change, absent-group emptiness, and project-CIF exclusion. - A tutorial-corpus regression check (functional/script level) that strips each declared letter and asserts re-detection reproduces it. +- `tests/unit/easydiffraction/crystallography/test_space_groups.py` (or + `_coverage.py`) — the §10 canonical-template data invariant (no + operator-form `coords_xyz`). + +**Prerequisite, out of scope for this plan (Decision 15).** The +canonical-table regeneration itself — +`tmp/space-groups/helper-tools/generate_space_groups.py`, +`src/easydiffraction/crystallography/space_groups.json.gz`, +`tools/check_packaged_db.py`, and +[`space-group-database.md`](../adrs/accepted/space-group-database.md) — +lands as a standalone space-group-database fix. This plan only +**verifies** it (P1.0) and guards it from the consuming side (the Phase +2 invariant test). ## Implementation steps (Phase 1) @@ -223,14 +249,21 @@ before moving to the next step or the Phase 1 review gate**, per The ADR commit + design-phase review/reply cleanup are handled by `/draft-impl-1` Phase A before P1.1. -- [ ] **P1.0 — Re-close the ADR review gate.** No code. Ensure - `git branch --show-current` is `wyckoff-letter-detection`; if not, - stop before editing and ask the user to switch to the target - branch outside the shortcut. Then ensure - `wyckoff-letter-detection_review-16.md` remains the latest ADR - review and has the final-review sentinel. If any newer ADR review - appears before implementation, update this plan and re-review it - before P1.1. Commit: `Confirm wyckoff letter detection ADR gate` +- [ ] **P1.0 — Verify the ADR gate and the §10 prerequisite.** No code. + Ensure `git branch --show-current` is `wyckoff-letter-detection`; + if not, stop before editing and ask the user to switch to the + target branch outside the shortcut. Confirm the ADR on disk + includes §10 (the canonical-`coords_xyz` decision) and that its + most recent `draft-adr` cycle closed with a final-review sentinel. + **Gate on the §10 prerequisite (Decision 15):** confirm the + standalone canonical-table fix has landed by asserting no bundled + `SPACE_GROUPS` `coords_xyz` template is in operator form — every + component is canonical parametric, with no component containing + its own axis variable in a coupled term, so R-3m `h` reads + `(x,-x,z)`, not `(1/2*x-1/2*y,…)`. If any operator-form template + remains, **stop**: the space-group-database prerequisite must land + before this plan's detection and snapping can be implemented. + Commit: `Confirm wyckoff letter detection ADR gate` - [ ] **P1.1 — Orbit matcher in the crystallography submodule.** Add to `crystallography.py`: frozen `WyckoffPosition(letter, multiplicity, site_symmetry, coord_template)`, @@ -346,7 +379,20 @@ Tests to add or update: and explicit-letter lookup selecting the nearest representative rather than `coords_xyz[0]`; rounded inputs (`0.3333→1/3`, `0.4999→1/2`) at `1e-3`; `''`→`None` normalisation; genuinely absent group returns no - record. + record; and the **§10 coupled-position guard** — a coupled special + position (R-3m `h`, `(x,-x,z)`) flags `fract_y` symmetry-constrained + and re-slaves it to `-fract_x` after a `fract_x` edit (the `ed-6` + regression). This unit-level guard complements the prerequisite fix in + the space-group-database (Decision 15); the existing constraint tests + covered only all-fixed and all-free sites, which never exercised the + coupled case. +- **Canonical-template data invariant (§10)** in + `tests/unit/easydiffraction/crystallography/test_space_groups.py` (or + its `_coverage.py`): assert every `SPACE_GROUPS` `coords_xyz` template + is canonical parametric form — no component contains its own axis + variable in a coupled term (operator-form leakage) — so a future table + regeneration cannot silently reintroduce the bug. This is the same + invariant P1.0 gates on, asserted from the test side. - **Atom-site behaviours** in `tests/unit/easydiffraction/datablocks/structure/categories/test_atom_sites.py`: fill-if-empty on create/load; re-detect via both `atom.fract_x = …` @@ -399,3 +445,11 @@ Tables notation. Existing projects and CIF files keep their supplied letters, unsupported groups can still preserve stored letters safely, and the same multiplicity is used consistently across calculators and reports. + +**Scope note (per Decision 15).** The special-position constraint +correction for coupled sites (the `ed-6` regression, where a refined +atom at a site like `(x, -x, z)` drifted off its symmetry position) is +**not** part of this PR. It ships first as a standalone +space-group-database correction, and this feature builds on it; that +user-facing benefit belongs in the prerequisite's PR description, not +here. diff --git a/docs/docs/assets/javascripts/ed-figures.js b/docs/docs/assets/javascripts/ed-figures.js index 2dc377a0f..691da7503 100644 --- a/docs/docs/assets/javascripts/ed-figures.js +++ b/docs/docs/assets/javascripts/ed-figures.js @@ -82,6 +82,36 @@ ]; } + function rgbaFromColor(color, alpha) { + var hexMatch = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i); + var red; + var green; + var blue; + if (hexMatch) { + var hex = hexMatch[1]; + if (hex.length === 3) { + hex = hex + .split('') + .map(function (part) { + return part + part; + }) + .join(''); + } + red = parseInt(hex.slice(0, 2), 16); + green = parseInt(hex.slice(2, 4), 16); + blue = parseInt(hex.slice(4, 6), 16); + } else { + var parts = color.match(/(\d+(?:\.\d+)?)/g); + if (!parts || parts.length < 3) { + return color; + } + red = Number(parts[0]); + green = Number(parts[1]); + blue = Number(parts[2]); + } + return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + alpha + ')'; + } + function applyTheme(graphDiv, theme, themeSync) { if (!graphDiv || !window.Plotly || !theme) { return; @@ -93,12 +123,14 @@ } var paperBackground = colors.paperBackground || 'rgba(0, 0, 0, 0)'; var transparentPlot = themeSync && themeSync.correlationHeatmap === true; + var modebarColor = rgbaFromColor(colors.foreground, mode === 'dark' ? 0.62 : 0.42); + var modebarActiveColor = rgbaFromColor(colors.foreground, mode === 'dark' ? 0.95 : 0.85); var update = { paper_bgcolor: paperBackground, plot_bgcolor: transparentPlot ? paperBackground : colors.background, 'modebar.bgcolor': paperBackground, - 'modebar.color': colors.foreground, - 'modebar.activecolor': colors.foreground, + 'modebar.color': modebarColor, + 'modebar.activecolor': modebarActiveColor, 'font.color': colors.foreground, 'title.font.color': colors.foreground, 'legend.bgcolor': colors.legend, diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index b89290b75..673213c33 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -1309,47 +1309,37 @@ def _theme_sync_post_script() -> str: }); }; -const installModebarThemeStyle = function () { - const styleId = 'ed-plotly-modebar-theme-style'; - if (document.getElementById(styleId)) { - return; +const rgbaFromColor = function (color, alpha) { + const hexMatch = color.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i); + let red; + let green; + let blue; + if (hexMatch) { + let hex = hexMatch[1]; + if (hex.length === 3) { + hex = hex.split('').map(function (part) { + return part + part; + }).join(''); + } + red = parseInt(hex.slice(0, 2), 16); + green = parseInt(hex.slice(2, 4), 16); + blue = parseInt(hex.slice(4, 6), 16); + } else { + const parts = color.match(/(\d+(?:\.\d+)?)/g); + if (!parts || parts.length < 3) { + return color; + } + red = Number(parts[0]); + green = Number(parts[1]); + blue = Number(parts[2]); } - - const style = document.createElement('style'); - style.id = styleId; - style.textContent = [ - '.plotly-graph-div.ed-plotly-themed-modebar .modebar-btn path {', - ' fill: var(--ed-plotly-modebar-icon-color) !important;', - ' opacity: var(--ed-plotly-modebar-icon-opacity) !important;', - '}', - '.plotly-graph-div.ed-plotly-themed-modebar .modebar-btn:hover path,', - '.plotly-graph-div.ed-plotly-themed-modebar .modebar-btn.active path {', - ' fill: var(--ed-plotly-modebar-icon-color) !important;', - ' opacity: var(--ed-plotly-modebar-icon-hover-opacity) !important;', - '}', - ].join('\n'); - document.head.appendChild(style); -}; - -const applyModebarTheme = function (theme, colors) { - installModebarThemeStyle(); - graphDiv.classList.add('ed-plotly-themed-modebar'); - graphDiv.style.setProperty('--ed-plotly-modebar-icon-color', colors.foreground); - graphDiv.style.setProperty( - '--ed-plotly-modebar-icon-opacity', - theme === 'dark' ? '0.62' : '0.42', - ); - graphDiv.style.setProperty( - '--ed-plotly-modebar-icon-hover-opacity', - theme === 'dark' ? '0.95' : '0.85', - ); + return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + alpha + ')'; }; const applyTheme = function () { const theme = hostTheme(); const colors = themeColors(theme); const syncMeta = themeSyncMeta(); - applyModebarTheme(theme, colors); if (graphDiv.dataset.edPlotlyTheme === theme) { return; @@ -1357,12 +1347,14 @@ def _theme_sync_post_script() -> str: graphDiv.dataset.edPlotlyTheme = theme; const transparentPlot = syncMeta.__THEME_SYNC_CORRELATION_HEATMAP_KEY__ === true; + const modebarColor = rgbaFromColor(colors.foreground, theme === 'dark' ? 0.62 : 0.42); + const modebarActiveColor = rgbaFromColor(colors.foreground, theme === 'dark' ? 0.95 : 0.85); const update = { paper_bgcolor: colors.paperBackground, plot_bgcolor: transparentPlot ? colors.paperBackground : colors.background, 'modebar.bgcolor': colors.paperBackground, - 'modebar.color': colors.foreground, - 'modebar.activecolor': colors.foreground, + 'modebar.color': modebarColor, + 'modebar.activecolor': modebarActiveColor, 'font.color': colors.foreground, 'title.font.color': colors.foreground, 'legend.bgcolor': colors.legend, @@ -2034,11 +2026,6 @@ def _get_layout( }, paper_bgcolor=cls._paper_background_color(), plot_bgcolor=cls._background_color(), - modebar={ - 'bgcolor': cls._paper_background_color(), - 'color': cls._theme_colors().foreground, - 'activecolor': cls._theme_colors().foreground, - }, legend={ 'bgcolor': cls._legend_background_color(), 'xanchor': 'right', diff --git a/tests/unit/easydiffraction/display/plotters/test_plotly.py b/tests/unit/easydiffraction/display/plotters/test_plotly.py index 6b5780509..bd85d3635 100644 --- a/tests/unit/easydiffraction/display/plotters/test_plotly.py +++ b/tests/unit/easydiffraction/display/plotters/test_plotly.py @@ -242,10 +242,9 @@ def __init__(self, html): assert f"innerTickGrid: '{pp.LIGHT_INNER_TICK_GRID_COLOR}'" in captured['post_script'] assert f"hoverBackground: '{pp.DARK_HOVER_BACKGROUND_COLOR}'" in captured['post_script'] assert f"legend: '{pp.DARK_LEGEND_BACKGROUND_COLOR}'" in captured['post_script'] - assert 'ed-plotly-modebar-theme-style' in captured['post_script'] - assert 'ed-plotly-themed-modebar' in captured['post_script'] - assert '--ed-plotly-modebar-icon-color' in captured['post_script'] - assert '--ed-plotly-modebar-icon-hover-opacity' in captured['post_script'] + assert "'modebar.color'" in captured['post_script'] + assert "'modebar.activecolor'" in captured['post_script'] + assert 'rgbaFromColor' in captured['post_script'] assert 'const correlationColorscale = function (colors) {' in captured['post_script'] assert 'const themeSync = meta.ed_plotly_theme_sync;' in captured['post_script'] assert 'const applyAnnotationTheme = function (update, colors) {' in captured['post_script'] From 656f7d927b6cedc564e60fb50291009df43c757c Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 22:28:10 +0200 Subject: [PATCH 38/50] Match Plotly legend top inset to its right inset --- src/easydiffraction/display/plotters/plotly.py | 4 ++-- src/easydiffraction/display/plotting.py | 2 +- tests/unit/easydiffraction/display/test_plotting.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index 673213c33..fd05a462a 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -2031,7 +2031,7 @@ def _get_layout( 'xanchor': 'right', 'x': 0.99, 'yanchor': 'top', - 'y': 0.97, + 'y': 0.99, }, xaxis=xaxis, yaxis=yaxis, @@ -2641,7 +2641,7 @@ def _configure_powder_composite_layout( 'xanchor': 'right', 'x': 0.99, 'yanchor': 'top', - 'y': 0.97, + 'y': 0.99, }, ) diff --git a/src/easydiffraction/display/plotting.py b/src/easydiffraction/display/plotting.py index 4cdd7452b..de9ab1a13 100644 --- a/src/easydiffraction/display/plotting.py +++ b/src/easydiffraction/display/plotting.py @@ -3994,7 +3994,7 @@ def _plot_posterior_predictive_summary( 'xanchor': 'right', 'x': 0.99, 'yanchor': 'top', - 'y': 0.97, + 'y': 0.99, }, xaxis_title=axes_labels[0], yaxis_title=axes_labels[1], diff --git a/tests/unit/easydiffraction/display/test_plotting.py b/tests/unit/easydiffraction/display/test_plotting.py index 756ea6d5b..cf016324f 100644 --- a/tests/unit/easydiffraction/display/test_plotting.py +++ b/tests/unit/easydiffraction/display/test_plotting.py @@ -878,7 +878,7 @@ def test_plot_posterior_predictive_summary_uses_consistent_labels_and_styles(mon assert max_posterior_trace.legendrank == 20 assert max_posterior_trace.line.dash == POSTERIOR_POINT_ESTIMATE_LINE_DASH assert fig.layout.legend.x == 0.99 - assert fig.layout.legend.y == 0.97 + assert fig.layout.legend.y == 0.99 assert fig.layout.legend.bgcolor == PlotlyPlotter._legend_background_color() assert fig.layout.margin.r == 30 assert fig.layout.margin.t == 40 From 4b147effbe737b6427e2bfe5f8ddad285651bbad Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 22:31:28 +0200 Subject: [PATCH 39/50] Exclude vendored JS licenses from docs nav --- docs/mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 7b0c70697..8dba57ab1 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -174,6 +174,7 @@ watch: not_in_nav: | index.md user-guide/parameters + assets/javascripts/vendor/**/*.md # Format and layout of the global navigation for the site nav: From 4f65d301a1f95f8350208d1b2389eb60f57e23fd Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 22:54:55 +0200 Subject: [PATCH 40/50] Paint structure scene background via WebGL clear color --- .../display/structure/templates/structure.html.j2 | 5 +++++ .../display/structure/renderers/test_threejs.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/easydiffraction/display/structure/templates/structure.html.j2 b/src/easydiffraction/display/structure/templates/structure.html.j2 index 00ae2e058..51e8b9aa5 100644 --- a/src/easydiffraction/display/structure/templates/structure.html.j2 +++ b/src/easydiffraction/display/structure/templates/structure.html.j2 @@ -705,6 +705,11 @@ const applyTheme = (name) => { root.classList.toggle('cv-theme-dark', themeName === 'dark'); root.classList.toggle('cv-theme-light', themeName !== 'dark'); cellMaterial.color.setStyle(cssVar('--cv-scene-fg', '{{ foreground }}')); + // Paint the scene background via the renderer clear color so it always + // matches the Plotly axes-rectangle background, independent of any + // host-page CSS that might otherwise leave the canvas transparent. + const sceneBg = themeName === 'dark' ? '{{ dark_background }}' : '{{ light_background }}'; + renderer.setClearColor(new THREE.Color().setStyle(sceneBg), 1); }; root.__crysviewApplyTheme = applyTheme; diff --git a/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py b/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py index 32f182ad5..3460665dd 100644 --- a/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py +++ b/tests/unit/easydiffraction/display/structure/renderers/test_threejs.py @@ -767,6 +767,8 @@ def test_light_theme_embeds_scene_background_and_contrast_colours(self): assert '--cv-label-shadow-bg: rgb(255, 255, 255);' in html assert 'rgb(34, 34, 34)' in html # LIGHT_THEME foreground assert 'light' in html + # Scene background is also painted via the WebGL clear color. + assert 'renderer.setClearColor' in html def test_dark_theme_embeds_scene_background_and_contrast_colours(self): # ``theme_colors(dark=True)`` returns DARK_THEME instead. @@ -780,6 +782,8 @@ def test_dark_theme_embeds_scene_background_and_contrast_colours(self): assert '--cv-label-shadow-bg: rgb(33, 33, 33);' in html assert 'rgb(230, 232, 238)' in html # DARK_THEME foreground assert 'dark' in html + # Scene background is also painted via the WebGL clear color. + assert 'renderer.setClearColor' in html class TestSharedEmbedMode: From 55a3638816f62fea901eb64fbd1de95dff7b1ba7 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:15:06 +0200 Subject: [PATCH 41/50] Theme modebar icons via class CSS overriding Plotly inline fill --- docs/docs/assets/javascripts/ed-figures.js | 18 ++++++++++++++ .../display/plotters/plotly.py | 24 +++++++++++++++++++ .../display/plotters/test_plotly.py | 3 +++ 3 files changed, 45 insertions(+) diff --git a/docs/docs/assets/javascripts/ed-figures.js b/docs/docs/assets/javascripts/ed-figures.js index 691da7503..12881648c 100644 --- a/docs/docs/assets/javascripts/ed-figures.js +++ b/docs/docs/assets/javascripts/ed-figures.js @@ -112,6 +112,23 @@ return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + alpha + ')'; } + function installModebarIconStyle(graphDiv, mode, colors) { + graphDiv.classList.add('ed-plotly-themed-modebar'); + var styleId = 'ed-plotly-modebar-icon-style'; + var style = document.getElementById(styleId); + if (!style) { + style = document.createElement('style'); + style.id = styleId; + document.head.appendChild(style); + } + var inactive = rgbaFromColor(colors.foreground, mode === 'dark' ? 0.62 : 0.55); + var active = rgbaFromColor(colors.foreground, mode === 'dark' ? 0.95 : 0.9); + style.textContent = + '.ed-plotly-themed-modebar .modebar-btn path { fill: ' + inactive + ' !important; }' + + '.ed-plotly-themed-modebar .modebar-btn:hover path,' + + '.ed-plotly-themed-modebar .modebar-btn.active path { fill: ' + active + ' !important; }'; + } + function applyTheme(graphDiv, theme, themeSync) { if (!graphDiv || !window.Plotly || !theme) { return; @@ -121,6 +138,7 @@ if (!colors) { return; } + installModebarIconStyle(graphDiv, mode, colors); var paperBackground = colors.paperBackground || 'rgba(0, 0, 0, 0)'; var transparentPlot = themeSync && themeSync.correlationHeatmap === true; var modebarColor = rgbaFromColor(colors.foreground, mode === 'dark' ? 0.62 : 0.42); diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index fd05a462a..1844c7b8c 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -1336,10 +1336,34 @@ def _theme_sync_post_script() -> str: return 'rgba(' + red + ', ' + green + ', ' + blue + ', ' + alpha + ')'; }; +const installModebarIconStyle = function (theme, colors) { + // Plotly paints modebar icon fills with non-important inline styles + // (and re-paints on hover), and the host plot id can start with a + // digit, so an id-based rule is invalid. A class-based !important + // rule with direct colors reliably themes every icon, inactive and + // hovered, in both light and dark hosts. + graphDiv.classList.add('ed-plotly-themed-modebar'); + const styleId = 'ed-plotly-modebar-icon-style'; + let style = document.getElementById(styleId); + if (!style) { + style = document.createElement('style'); + style.id = styleId; + document.head.appendChild(style); + } + const inactive = rgbaFromColor(colors.foreground, theme === 'dark' ? 0.62 : 0.55); + const active = rgbaFromColor(colors.foreground, theme === 'dark' ? 0.95 : 0.9); + style.textContent = ( + '.ed-plotly-themed-modebar .modebar-btn path { fill: ' + inactive + ' !important; }' + + '.ed-plotly-themed-modebar .modebar-btn:hover path,' + + '.ed-plotly-themed-modebar .modebar-btn.active path { fill: ' + active + ' !important; }' + ); +}; + const applyTheme = function () { const theme = hostTheme(); const colors = themeColors(theme); const syncMeta = themeSyncMeta(); + installModebarIconStyle(theme, colors); if (graphDiv.dataset.edPlotlyTheme === theme) { return; diff --git a/tests/unit/easydiffraction/display/plotters/test_plotly.py b/tests/unit/easydiffraction/display/plotters/test_plotly.py index bd85d3635..51245c04c 100644 --- a/tests/unit/easydiffraction/display/plotters/test_plotly.py +++ b/tests/unit/easydiffraction/display/plotters/test_plotly.py @@ -245,6 +245,9 @@ def __init__(self, html): assert "'modebar.color'" in captured['post_script'] assert "'modebar.activecolor'" in captured['post_script'] assert 'rgbaFromColor' in captured['post_script'] + # Modebar icons are also themed via a class-based !important rule so + # they stay visible regardless of Plotly's inline fills. + assert 'ed-plotly-themed-modebar' in captured['post_script'] assert 'const correlationColorscale = function (colors) {' in captured['post_script'] assert 'const themeSync = meta.ed_plotly_theme_sync;' in captured['post_script'] assert 'const applyAnnotationTheme = function (update, colors) {' in captured['post_script'] From 9407d6677e0d7b8da5d13787178fa5bdfa098fbe Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:25:45 +0200 Subject: [PATCH 42/50] Add themed code-cell border colors to docs extra.css --- docs/docs/assets/stylesheets/extra.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/docs/assets/stylesheets/extra.css b/docs/docs/assets/stylesheets/extra.css index 57e022f24..ebbb81e7d 100644 --- a/docs/docs/assets/stylesheets/extra.css +++ b/docs/docs/assets/stylesheets/extra.css @@ -9,6 +9,7 @@ --sz-body-text-color--lightmode: #525252; --sz-body-heading-color--lightmode: #434343; --sz-code-background-color--lightmode: #ececec; + --sz-code-border-color--lightmode: #d3d3d3; --sz-link-color--darkmode: #37bdf9; --sz-hovered-link-color--darkmode: #2890c0; @@ -16,6 +17,7 @@ --sz-body-text-color--darkmode: #a3a3a3; --sz-body-heading-color--darkmode: #e5e5e5; --sz-code-background-color--darkmode: #212121; + --sz-code-border-color--darkmode: #444; } /****************/ @@ -223,6 +225,20 @@ Adjust the margins and paddings to fit the defaults in MkDocs Material and do no display: flex !important; } +/* Jupyter code-cell (input) border color, per theme. + mkdocs-jupyter inlines its own index.css inside the notebook body, + after this stylesheet, and already sets --jp-cell-editor-border-color + on `[data-md-color-scheme=slate] .jupyter-wrapper` (same specificity, + later in source order, so an equal-specificity override would lose). + Prefix `body` (which carries data-md-color-scheme) to out-specify the + plugin's rule and win the cascade. */ +body[data-md-color-scheme="default"] .jupyter-wrapper { + --jp-cell-editor-border-color: var(--sz-code-border-color--lightmode); +} +body[data-md-color-scheme="slate"] .jupyter-wrapper { + --jp-cell-editor-border-color: var(--sz-code-border-color--darkmode); +} + .jp-Notebook { padding: 0 !important; margin-top: -3em !important; From 70fdbedc18eda70dbd7c868de502364827bf8d36 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:25:45 +0200 Subject: [PATCH 43/50] Convert shared figure-height fallback from units to pixels --- src/easydiffraction/display/plotters/plotly.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index 1844c7b8c..ef818ff87 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -1807,7 +1807,10 @@ def _figure_height(fig: object) -> int: height = getattr(layout, 'height', None) if layout is not None else None if isinstance(height, (int, float)) and not isinstance(height, bool) and height > 0: return int(height) - return DEFAULT_HEIGHT + # DEFAULT_HEIGHT is a unit count; convert to pixels like the + # non-shared default so height-less figures (e.g. posterior + # distribution plots) don't collapse into a tiny skeleton. + return DEFAULT_HEIGHT * PLOTLY_HEIGHT_PER_UNIT @classmethod def _serialize_html_shared(cls, fig: object) -> str: From c810e136d3afb656f0818ee0682845e4dbee153f Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:36:13 +0200 Subject: [PATCH 44/50] Sync Plotly tooltip border to axis-frame in docs loader --- docs/docs/assets/javascripts/ed-figures.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs/assets/javascripts/ed-figures.js b/docs/docs/assets/javascripts/ed-figures.js index 12881648c..738f78010 100644 --- a/docs/docs/assets/javascripts/ed-figures.js +++ b/docs/docs/assets/javascripts/ed-figures.js @@ -154,6 +154,7 @@ 'legend.bgcolor': colors.legend, 'legend.font.color': colors.foreground, 'hoverlabel.bgcolor': colors.hoverBackground, + 'hoverlabel.bordercolor': colors.axisFrame, 'hoverlabel.font.color': colors.foreground, }; axisNames(graphDiv).forEach(function (name) { From 8f7ff7476c8780668d23ed3e8e816dcbd7e513e0 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:38:54 +0200 Subject: [PATCH 45/50] Update report style test for new axis-frame color --- tests/unit/easydiffraction/report/test_style.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/easydiffraction/report/test_style.py b/tests/unit/easydiffraction/report/test_style.py index 826789c9c..7e97f95ff 100644 --- a/tests/unit/easydiffraction/report/test_style.py +++ b/tests/unit/easydiffraction/report/test_style.py @@ -11,8 +11,8 @@ def test_report_style_context_exposes_hex_and_rgb_values(): assert context['axis_hex'] == '#bec7d0' assert context['axis_rgb'] == '190,199,208' - assert context['grid_hex'] == '#e0e0e0' - assert context['grid_rgb'] == '224,224,224' + assert context['grid_hex'] == '#d3d3d3' + assert context['grid_rgb'] == '211,211,211' assert context['chart_grid_rgb'] == '235,240,248' assert context['subtitle'] == 'EasyDiffraction Report' assert 'PT Sans' in context['html_font_family'] From 5048f69bcda0ccedf5672ba69e2b96e7f6daffcd Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:38:54 +0200 Subject: [PATCH 46/50] Fall back to baked theme for modebar when host theme hidden --- .../display/plotters/plotly.py | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index ef818ff87..2218f0620 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -73,6 +73,13 @@ SINGLE_CRYSTAL_MARKER_LINE_WIDTH = 0.5 MEASURED_ERROR_BAR_THICKNESS = 0.5 MEASURED_ERROR_BAR_WIDTH = 2 +# Correlation-heatmap cell borders. Internal cell separators sit inside +# the plot area and render at their full width. The outer frame sits on +# the plot-area boundary, where Plotly clips half of the stroke, so it +# is drawn at double width to keep its visible half matching the +# internal separators. +CORRELATION_GRID_LINE_WIDTH = 1 +CORRELATION_FRAME_LINE_WIDTH = 2 * CORRELATION_GRID_LINE_WIDTH # Single source for the y=x reference-line colour, shared with the # report axis gray (report.style.REPORT_AXIS_RGB) and imported by # report.fit_plot so the diagonal looks identical in the Plotly and @@ -507,7 +514,7 @@ def plot_correlation_heatmap( 'xref': 'x', 'yref': 'y', 'layer': 'above', - 'line': {'color': grid_color, 'width': 1}, + 'line': {'color': grid_color, 'width': CORRELATION_GRID_LINE_WIDTH}, } for x_pos in x_edges[1:-1] ] @@ -521,7 +528,7 @@ def plot_correlation_heatmap( 'xref': 'x', 'yref': 'y', 'layer': 'above', - 'line': {'color': grid_color, 'width': 1}, + 'line': {'color': grid_color, 'width': CORRELATION_GRID_LINE_WIDTH}, } for y_pos in y_edges[1:-1] ) @@ -534,7 +541,7 @@ def plot_correlation_heatmap( 'xref': 'paper', 'yref': 'paper', 'layer': 'above', - 'line': {'color': grid_color, 'width': 1}, + 'line': {'color': grid_color, 'width': CORRELATION_FRAME_LINE_WIDTH}, 'fillcolor': 'rgba(0, 0, 0, 0)', }) @@ -1168,6 +1175,15 @@ def _theme_sync_post_script() -> str: return; } +// Theme this figure was rendered with (Python-detected), used as the +// fallback when the host page exposes no detectable theme attribute -- +// e.g. some Jupyter front-ends -- so icons match the baked plot instead +// of defaulting to light. +const bakedThemeLayout = graphDiv._fullLayout || graphDiv.layout || {}; +const bakedTheme = bakedThemeLayout.plot_bgcolor === '__DARK_BACKGROUND_COLOR__' + ? 'dark' + : 'light'; + const hostTheme = function () { const materialScheme = ( (document.body && document.body.getAttribute('data-md-color-scheme')) @@ -1196,7 +1212,7 @@ def _theme_sync_post_script() -> str: if (jupyterThemeLight === 'true') { return 'light'; } - return 'light'; + return bakedTheme; }; const themeColors = function (theme) { From 1130227eaea516c86c4dda1c79c98fe806cd9ae6 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:41:33 +0200 Subject: [PATCH 47/50] Refine chart theme background and grid colors --- docs/docs/assets/javascripts/extra.js | 10 +++++----- src/easydiffraction/display/theme.py | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/docs/docs/assets/javascripts/extra.js b/docs/docs/assets/javascripts/extra.js index 32c1b2dda..6cf2caa6a 100644 --- a/docs/docs/assets/javascripts/extra.js +++ b/docs/docs/assets/javascripts/extra.js @@ -31,18 +31,18 @@ function themeColors() { if (themeName() === 'dark') { return { - background: 'rgba(0, 0, 0, 0)', // DARK_BACKGROUND_COLOR + background: '#212121', // 'rgba(0, 0, 0, 0)', // DARK_BACKGROUND_COLOR foreground: '#e6e8ee', // DARK_FOREGROUND_COLOR - axisFrame: '#333', // DARK_AXIS_FRAME_COLOR - innerTickGrid: '#222', // DARK_INNER_TICK_GRID_COLOR + axisFrame: '#444', // DARK_AXIS_FRAME_COLOR + innerTickGrid: '#2a2a2a', // DARK_INNER_TICK_GRID_COLOR hoverBackground: '#212121', // DARK_HOVER_BACKGROUND_COLOR legend: 'rgba(33, 33, 33, 0.5)', // DARK_LEGEND_BACKGROUND_COLOR } } return { - background: 'rgba(0, 0, 0, 0)', // LIGHT_BACKGROUND_COLOR + background: '#ffffff', // 'rgba(0, 0, 0, 0)', // LIGHT_BACKGROUND_COLOR foreground: '#222222', // LIGHT_FOREGROUND_COLOR - axisFrame: '#e0e0e0', // LIGHT_AXIS_FRAME_COLOR + axisFrame: '#d3d3d3', // LIGHT_AXIS_FRAME_COLOR innerTickGrid: '#f2f2f2', // LIGHT_INNER_TICK_GRID_COLOR hoverBackground: '#ffffff', // LIGHT_HOVER_BACKGROUND_COLOR legend: 'rgba(255, 255, 255, 0.5)', // LIGHT_LEGEND_BACKGROUND_COLOR diff --git a/src/easydiffraction/display/theme.py b/src/easydiffraction/display/theme.py index dd255f09c..3b8f4620f 100644 --- a/src/easydiffraction/display/theme.py +++ b/src/easydiffraction/display/theme.py @@ -7,22 +7,26 @@ from dataclasses import dataclass # Background inside the axes rectangle (the plotted area / 3D scene). -LIGHT_BACKGROUND_COLOR = '#ffffff' -DARK_BACKGROUND_COLOR = '#212121' +# Legend background mirrors the opaque theme base surface at 50% opacity # Figure paper (margins around the axes) stays transparent so charts # blend into the host page; only the plotted area is opaque. -PAPER_BACKGROUND_COLOR = 'rgba(0, 0, 0, 0)' -LIGHT_FOREGROUND_COLOR = '#222222' + +DARK_BACKGROUND_COLOR = '#212121' DARK_FOREGROUND_COLOR = '#e6e8ee' -LIGHT_AXIS_FRAME_COLOR = '#e0e0e0' -DARK_AXIS_FRAME_COLOR = '#333' +DARK_AXIS_FRAME_COLOR = '#444' +DARK_INNER_TICK_GRID_COLOR = '#2a2a2a' +DARK_HOVER_BACKGROUND_COLOR = '#212121' +DARK_LEGEND_BACKGROUND_COLOR = 'rgba(33, 33, 33, 0.5)' + +LIGHT_BACKGROUND_COLOR = '#ffffff' +LIGHT_FOREGROUND_COLOR = '#222222' +LIGHT_AXIS_FRAME_COLOR = '#d3d3d3' LIGHT_INNER_TICK_GRID_COLOR = '#f2f2f2' -DARK_INNER_TICK_GRID_COLOR = '#1c1c1c' LIGHT_HOVER_BACKGROUND_COLOR = '#ffffff' -DARK_HOVER_BACKGROUND_COLOR = '#212121' -# Legend background mirrors the opaque theme base surface at 50% opacity LIGHT_LEGEND_BACKGROUND_COLOR = 'rgba(255, 255, 255, 0.5)' -DARK_LEGEND_BACKGROUND_COLOR = 'rgba(33, 33, 33, 0.5)' + +PAPER_BACKGROUND_COLOR = 'rgba(0, 0, 0, 0)' + TABLE_AXIS_FRAME_CSS_VAR = '--ed-axis-frame-color' From 1eb11d3fd0a5973cfd5e1c127ff51c235b86e32f Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:46:57 +0200 Subject: [PATCH 48/50] Blend shared-mode loading skeleton with page background --- docs/docs/assets/stylesheets/extra.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/docs/assets/stylesheets/extra.css b/docs/docs/assets/stylesheets/extra.css index ebbb81e7d..59e5b0929 100644 --- a/docs/docs/assets/stylesheets/extra.css +++ b/docs/docs/assets/stylesheets/extra.css @@ -468,7 +468,12 @@ h1 .label-experiment { width: 100%; min-height: 120px; color: var(--md-default-fg-color--light); - background: var(--md-default-fg-color--lightest); + /* Blend with the page background (the figure paper is transparent), + so the loading box tracks light/dark. Do not use + --md-default-fg-color--lightest here: this site repurposes that + variable as a text color, which painted a solid grey block that + ignored the theme. */ + background: var(--md-default-bg-color); border-radius: 2px; font-size: 0.75rem; letter-spacing: 0.04em; From 56b984ad5930d9be3f71b407303886231d94c54b Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:49:41 +0200 Subject: [PATCH 49/50] Size posterior distribution plots to single main panel --- .../display/plotters/plotly.py | 27 +++++++++++++++++++ src/easydiffraction/display/plotting.py | 3 +++ 2 files changed, 30 insertions(+) diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index 2218f0620..c930edd9f 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -2241,6 +2241,33 @@ def _base_composite_height_pixels(plot_spec: PowderMeasVsCalcSpec) -> float: return float(DEFAULT_HEIGHT * PLOTLY_HEIGHT_PER_UNIT) return float(plot_spec.height) + @classmethod + def _single_main_panel_height_pixels(cls, residual_height_fraction: float) -> int: + """ + Return the default 3-row composite's main-panel height. + + Standalone single-panel figures (e.g. posterior distribution + plots) use this so they match the pattern plot's top panel + rather than the full three-row composite height. Mirrors the + baseline main-row math in ``_baseline_non_bragg_row_heights`` + for the default main + Bragg ticks + residual layout. + + Parameters + ---------- + residual_height_fraction : float + Residual-to-main row ratio of the reference composite. + + Returns + ------- + int + Main-panel height in pixels. + """ + base = float(DEFAULT_HEIGHT * PLOTLY_HEIGHT_PER_UNIT) + plot_area = cls._composite_plot_area_height(base) + available = plot_area * cls._subplot_available_height_fraction(3) + non_bragg = max(available - cls._bragg_tick_symbol_height_pixels(), 1.0) + return round(non_bragg / (1.0 + residual_height_fraction)) + @staticmethod def _composite_plot_area_height(full_height: float) -> float: """ diff --git a/src/easydiffraction/display/plotting.py b/src/easydiffraction/display/plotting.py index de9ab1a13..90b0c8aca 100644 --- a/src/easydiffraction/display/plotting.py +++ b/src/easydiffraction/display/plotting.py @@ -2824,6 +2824,9 @@ def _build_param_distribution_plot( x_axis_range=x_axis_range, y_axis_range=y_axis_range, ) + panel_height = getattr(self._backend, '_single_main_panel_height_pixels', None) + if callable(panel_height): + fig.update_layout(height=panel_height(DEFAULT_RESID_HEIGHT)) return fig def _plot_ascii_param_distribution( From 51bfe054b5c11db7a55cb808a3165d3829e0d1e6 Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Tue, 2 Jun 2026 23:59:59 +0200 Subject: [PATCH 50/50] Size posterior distribution plots to single main panel --- src/easydiffraction/display/plotters/plotly.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/easydiffraction/display/plotters/plotly.py b/src/easydiffraction/display/plotters/plotly.py index c930edd9f..61bd915c6 100644 --- a/src/easydiffraction/display/plotters/plotly.py +++ b/src/easydiffraction/display/plotters/plotly.py @@ -2244,13 +2244,15 @@ def _base_composite_height_pixels(plot_spec: PowderMeasVsCalcSpec) -> float: @classmethod def _single_main_panel_height_pixels(cls, residual_height_fraction: float) -> int: """ - Return the default 3-row composite's main-panel height. + Return figure height matching the composite main panel. Standalone single-panel figures (e.g. posterior distribution - plots) use this so they match the pattern plot's top panel - rather than the full three-row composite height. Mirrors the + plots) use this so their plot area matches the pattern plot's + top panel rather than the full three-row composite. Mirrors the baseline main-row math in ``_baseline_non_bragg_row_heights`` - for the default main + Bragg ticks + residual layout. + for the default main + Bragg ticks + residual layout, then adds + the figure's vertical margins so the drawable area (not the + outer height) equals that panel. Parameters ---------- @@ -2260,13 +2262,14 @@ def _single_main_panel_height_pixels(cls, residual_height_fraction: float) -> in Returns ------- int - Main-panel height in pixels. + Figure height in pixels. """ base = float(DEFAULT_HEIGHT * PLOTLY_HEIGHT_PER_UNIT) plot_area = cls._composite_plot_area_height(base) available = plot_area * cls._subplot_available_height_fraction(3) non_bragg = max(available - cls._bragg_tick_symbol_height_pixels(), 1.0) - return round(non_bragg / (1.0 + residual_height_fraction)) + main = non_bragg / (1.0 + residual_height_fraction) + return round(main + COMPOSITE_MARGIN_TOP + COMPOSITE_MARGIN_BOTTOM) @staticmethod def _composite_plot_area_height(full_height: float) -> float: