@the-bearded-bear/claude-craft 8.23.1 → 8.23.2-next.3f5278b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dev/i18n/de/Common/rules/12-context-management.md +4 -2
- package/Dev/i18n/en/Common/rules/12-context-management.md +4 -2
- package/Dev/i18n/es/Common/rules/12-context-management.md +4 -2
- package/Dev/i18n/fr/Common/rules/12-context-management.md +4 -2
- package/Dev/i18n/pt/Common/rules/12-context-management.md +4 -2
- package/README.md +7 -0
- package/bundles/cursor/.cursorrules +1 -1
- package/bundles/windsurf/.windsurfrules +1 -1
- package/cli/kanban/client/dist/assets/BurndownView-BBl1LOfu.js +3 -0
- package/cli/kanban/client/dist/assets/{DepsView-DEAS0a20.js → DepsView-DXREli3v.js} +1 -1
- package/cli/kanban/client/dist/assets/{DocsView-BsXYPJAu.js → DocsView--bhcgCS3.js} +1 -1
- package/cli/kanban/client/dist/assets/SprintsView-CLKf2BTm.js +1 -0
- package/cli/kanban/client/dist/assets/cytoscape-dagre-Br_seqxP.js +2 -0
- package/cli/kanban/client/dist/assets/cytoscape.esm-BaNnhyvu.js +321 -0
- package/cli/kanban/client/dist/assets/index-DI89vrQ2.js +4 -0
- package/cli/kanban/client/dist/assets/{marked.esm-CYIZq5lG.js → marked.esm-2LEqwveT.js} +6 -6
- package/cli/kanban/client/dist/assets/purify.es-Dqk5qvad.js +3 -0
- package/cli/kanban/client/dist/index.html +1 -1
- package/package.json +3 -3
- package/cli/kanban/client/dist/assets/BurndownView-CQyFME8U.js +0 -3
- package/cli/kanban/client/dist/assets/SprintsView-Bo2p1NbV.js +0 -1
- package/cli/kanban/client/dist/assets/cytoscape-dagre-8BvEs68F.js +0 -2
- package/cli/kanban/client/dist/assets/cytoscape.esm-BiK1LiYw.js +0 -321
- package/cli/kanban/client/dist/assets/index-CI2O6JO9.js +0 -4
- package/cli/kanban/client/dist/assets/purify.es-ChwZkWde.js +0 -3
|
@@ -492,12 +492,14 @@ Bei der Kompaktierung immer erhalten:
|
|
|
492
492
|
|
|
493
493
|
| Variable | Beschreibung |
|
|
494
494
|
|----------|-------------|
|
|
495
|
-
| `CLAUDE_CODE_SUBAGENT_MODEL` | **Standard**-Modell für nicht typisierte Sub-Agents (z. B. `sonnet`). **
|
|
495
|
+
| `CLAUDE_CODE_SUBAGENT_MODEL` | **Standard**-Modell für nicht typisierte Sub-Agents (z. B. `sonnet`). **Seit Claude Code 2.1.251** hat das `model:`-Frontmatter eines Agents Vorrang: die 11 Reviewer mit `model: haiku` bleiben auf Haiku. **Vor 2.1.251 war es umgekehrt** — diese Variable überschrieb das Frontmatter. |
|
|
496
496
|
| `CLAUDE_CODE_FORK_SUBAGENT` | `1`, um den Kontext von Sub-Agents zu isolieren (Forked Subagents, v2.1.117+) |
|
|
497
497
|
| `ENABLE_PROMPT_CACHING_1H` / `FORCE_PROMPT_CACHING_5M` | Prompt-Caching verlängern/erzwingen (−40 % bei wiederholenden Sitzungen) |
|
|
498
498
|
| `CLAUDE_CODE_DISABLE_AUTO_MEMORY` | Auf `1` setzen, um automatischen Speicher zu deaktivieren |
|
|
499
499
|
|
|
500
|
-
> **Modell-Vorrang
|
|
500
|
+
> **Modell-Vorrang — gültig seit Claude Code 2.1.251:** `model:` aus dem Aufruf > `model:` im Agent-Frontmatter (wobei `inherit` das Modell der Hauptkonversation übernimmt) > `CLAUDE_CODE_SUBAGENT_MODEL` > Sitzungsmodell.
|
|
501
|
+
>
|
|
502
|
+
> **⚠️ Vor 2.1.251 war die Reihenfolge umgekehrt:** `CLAUDE_CODE_SUBAGENT_MODEL` stand an erster Stelle und überschrieb sowohl den Aufrufparameter als auch das Frontmatter, einschließlich `model: inherit`. Auf diesen Versionen liefen die `model: haiku`-Reviewer mit `SUBAGENT_MODEL=sonnet` tatsächlich auf Sonnet — das Gegenteil der Absicht. Prüfe `claude --version`, bevor du dich auf diese Tabelle verlässt. Quelle: [Sub-Agents-Doku](https://code.claude.com/docs/en/sub-agents).
|
|
501
503
|
|
|
502
504
|
---
|
|
503
505
|
|
|
@@ -492,12 +492,14 @@ During compaction, always preserve:
|
|
|
492
492
|
|
|
493
493
|
| Variable | Description |
|
|
494
494
|
|----------|-------------|
|
|
495
|
-
| `CLAUDE_CODE_SUBAGENT_MODEL` | **Default** model for untyped sub-agents (e.g., `sonnet`). **
|
|
495
|
+
| `CLAUDE_CODE_SUBAGENT_MODEL` | **Default** model for untyped sub-agents (e.g., `sonnet`). **Since Claude Code 2.1.251**, agent frontmatter `model:` takes precedence: the 11 reviewers with `model: haiku` stay on Haiku. **Before 2.1.251 it was the other way round** — this variable overrode the frontmatter. |
|
|
496
496
|
| `CLAUDE_CODE_FORK_SUBAGENT` | `1` to isolate sub-agent contexts (forked subagents, v2.1.117+) |
|
|
497
497
|
| `ENABLE_PROMPT_CACHING_1H` / `FORCE_PROMPT_CACHING_5M` | Extend/force prompt caching (−40% on repetitive sessions) |
|
|
498
498
|
| `CLAUDE_CODE_DISABLE_AUTO_MEMORY` | Set to `1` to disable automatic memory |
|
|
499
499
|
|
|
500
|
-
> **Model precedence
|
|
500
|
+
> **Model precedence — valid since Claude Code 2.1.251:** per-invocation `model:` > agent frontmatter `model:` (where `inherit` picks the main conversation's model) > `CLAUDE_CODE_SUBAGENT_MODEL` > session model.
|
|
501
|
+
>
|
|
502
|
+
> **⚠️ Before 2.1.251 the order was reversed:** `CLAUDE_CODE_SUBAGENT_MODEL` came first and overrode both the per-invocation parameter and the frontmatter, including `model: inherit`. On those versions `SUBAGENT_MODEL=sonnet` really did run the `model: haiku` reviewers on Sonnet — the opposite of the intent. Check `claude --version` before relying on this table. Source: [sub-agents docs](https://code.claude.com/docs/en/sub-agents).
|
|
501
503
|
|
|
502
504
|
---
|
|
503
505
|
|
|
@@ -492,12 +492,14 @@ Durante la compactacion, siempre preservar:
|
|
|
492
492
|
|
|
493
493
|
| Variable | Descripción |
|
|
494
494
|
|----------|-------------|
|
|
495
|
-
| `CLAUDE_CODE_SUBAGENT_MODEL` | Modelo **por defecto** para sub-agentes sin tipo (ej: `sonnet`). **
|
|
495
|
+
| `CLAUDE_CODE_SUBAGENT_MODEL` | Modelo **por defecto** para sub-agentes sin tipo (ej: `sonnet`). **Desde Claude Code 2.1.251**, el frontmatter `model:` de un agente tiene precedencia: los 11 reviewers con `model: haiku` permanecen en Haiku. **Antes de 2.1.251 era al revés** — esta variable sobrescribía el frontmatter. |
|
|
496
496
|
| `CLAUDE_CODE_FORK_SUBAGENT` | `1` para aislar el contexto de los sub-agentes (forked subagents, v2.1.117+) |
|
|
497
497
|
| `ENABLE_PROMPT_CACHING_1H` / `FORCE_PROMPT_CACHING_5M` | Ampliar/forzar el prompt caching (−40 % en sesiones repetitivas) |
|
|
498
498
|
| `CLAUDE_CODE_DISABLE_AUTO_MEMORY` | Poner a `1` para desactivar la memoria automática |
|
|
499
499
|
|
|
500
|
-
> **Precedencia de modelos
|
|
500
|
+
> **Precedencia de modelos — válida desde Claude Code 2.1.251:** `model:` pasado en la invocación > `model:` del frontmatter del agente (donde `inherit` toma el modelo de la conversación) > `CLAUDE_CODE_SUBAGENT_MODEL` > modelo de sesión.
|
|
501
|
+
>
|
|
502
|
+
> **⚠️ Antes de 2.1.251 el orden era el inverso:** `CLAUDE_CODE_SUBAGENT_MODEL` iba primero y sobrescribía tanto el parámetro de invocación como el frontmatter, incluido `model: inherit`. En esas versiones, `SUBAGENT_MODEL=sonnet` sí ejecutaba en Sonnet los reviewers `model: haiku` — lo contrario de la intención. Comprueba `claude --version` antes de fiarte de esta tabla. Fuente: [documentación de sub-agents](https://code.claude.com/docs/en/sub-agents).
|
|
501
503
|
|
|
502
504
|
---
|
|
503
505
|
|
|
@@ -492,12 +492,14 @@ Lors de la compaction, toujours preserver:
|
|
|
492
492
|
|
|
493
493
|
| Variable | Description |
|
|
494
494
|
|----------|-------------|
|
|
495
|
-
| `CLAUDE_CODE_SUBAGENT_MODEL` | Modèle **par défaut** des sous-agents non typés (ex : `sonnet`). **
|
|
495
|
+
| `CLAUDE_CODE_SUBAGENT_MODEL` | Modèle **par défaut** des sous-agents non typés (ex : `sonnet`). **Depuis Claude Code 2.1.251**, le frontmatter `model:` d'un agent prévaut : les 11 reviewers `model: haiku` restent sur Haiku. **Avant 2.1.251, c'était l'inverse** — cette variable écrasait le frontmatter. |
|
|
496
496
|
| `CLAUDE_CODE_FORK_SUBAGENT` | `1` pour isoler le contexte des sous-agents (forked subagents, v2.1.117+) |
|
|
497
497
|
| `ENABLE_PROMPT_CACHING_1H` / `FORCE_PROMPT_CACHING_5M` | Étendre/forcer le prompt caching (−40 % sur les sessions répétitives) |
|
|
498
498
|
| `CLAUDE_CODE_DISABLE_AUTO_MEMORY` | Mettre à `1` pour désactiver la mémoire automatique |
|
|
499
499
|
|
|
500
|
-
> **Précédence modèle
|
|
500
|
+
> **Précédence modèle — valable depuis Claude Code 2.1.251 :** `model:` passé à l'invocation > `model:` du frontmatter de l'agent (où `inherit` reprend le modèle de la conversation) > `CLAUDE_CODE_SUBAGENT_MODEL` > modèle de la session.
|
|
501
|
+
>
|
|
502
|
+
> **⚠️ Avant 2.1.251, l'ordre était inversé :** `CLAUDE_CODE_SUBAGENT_MODEL` arrivait en tête et écrasait à la fois le paramètre d'invocation et le frontmatter, y compris `model: inherit`. Sur ces versions, `SUBAGENT_MODEL=sonnet` faisait bel et bien tourner sur Sonnet les reviewers `model: haiku` — l'inverse de l'intention. Vérifier `claude --version` avant de se fier à cette table. Source : [doc sub-agents](https://code.claude.com/docs/en/sub-agents).
|
|
501
503
|
|
|
502
504
|
---
|
|
503
505
|
|
|
@@ -492,12 +492,14 @@ Durante a compactacao, sempre preservar:
|
|
|
492
492
|
|
|
493
493
|
| Variável | Descrição |
|
|
494
494
|
|----------|-----------|
|
|
495
|
-
| `CLAUDE_CODE_SUBAGENT_MODEL` | Modelo **padrão** para sub-agentes sem tipo (ex: `sonnet`). **
|
|
495
|
+
| `CLAUDE_CODE_SUBAGENT_MODEL` | Modelo **padrão** para sub-agentes sem tipo (ex: `sonnet`). **Desde o Claude Code 2.1.251**, o frontmatter `model:` de um agente tem prioridade: os 11 revisores com `model: haiku` permanecem no Haiku. **Antes de 2.1.251 era o contrário** — esta variável sobrescrevia o frontmatter. |
|
|
496
496
|
| `CLAUDE_CODE_FORK_SUBAGENT` | `1` para isolar o contexto dos sub-agentes (forked subagents, v2.1.117+) |
|
|
497
497
|
| `ENABLE_PROMPT_CACHING_1H` / `FORCE_PROMPT_CACHING_5M` | Ampliar/forçar o prompt caching (−40 % em sessões repetitivas) |
|
|
498
498
|
| `CLAUDE_CODE_DISABLE_AUTO_MEMORY` | Definir como `1` para desativar a memória automática |
|
|
499
499
|
|
|
500
|
-
> **Precedência de modelos
|
|
500
|
+
> **Precedência de modelos — válida desde o Claude Code 2.1.251:** `model:` passado na invocação > `model:` do frontmatter do agente (onde `inherit` assume o modelo da conversa) > `CLAUDE_CODE_SUBAGENT_MODEL` > modelo de sessão.
|
|
501
|
+
>
|
|
502
|
+
> **⚠️ Antes de 2.1.251 a ordem era inversa:** `CLAUDE_CODE_SUBAGENT_MODEL` vinha primeiro e sobrescrevia tanto o parâmetro de invocação quanto o frontmatter, incluindo `model: inherit`. Nessas versões, `SUBAGENT_MODEL=sonnet` de facto executava em Sonnet os revisores `model: haiku` — o oposto da intenção. Verifique `claude --version` antes de confiar nesta tabela. Fonte: [documentação de sub-agents](https://code.claude.com/docs/en/sub-agents).
|
|
501
503
|
|
|
502
504
|
---
|
|
503
505
|
|
package/README.md
CHANGED
|
@@ -28,6 +28,13 @@ Plus **11 stack-specific reviewers** (@symfony-reviewer, @react-reviewer, @pytho
|
|
|
28
28
|
|
|
29
29
|
A comprehensive framework for AI-assisted development with [Claude Code](https://claude.ai/code). Install standardized rules, agents, and commands for your projects across multiple technology stacks — **33 specialized agents (+39 infra agents on-demand), 140 commands across 17 namespaces (234 total), 55 skills**, all token-optimized via `context: fork` and sub-agent model routing.
|
|
30
30
|
|
|
31
|
+
## What's New in v8.23.2
|
|
32
|
+
|
|
33
|
+
**Correctif de sécurité (2026-10-26, v8.23.2) :**
|
|
34
|
+
|
|
35
|
+
- **`zod` 4.6.7** : corrige GHSA-mrhx-c7xc-m3w5 (*high*, épuisement mémoire à la validation).
|
|
36
|
+
- **Précédence modèle des sous-agents** bornée à Claude Code 2.1.251+ dans la règle 12 (5 langues) et la FAQ, avec un garde-fou CI (`claimDenylist`) contre le retour d'affirmations périmées sur les modèles. Détails : [CHANGELOG](CHANGELOG.md#8232---2026-10-26).
|
|
37
|
+
|
|
31
38
|
## What's New in v8.23.1
|
|
32
39
|
|
|
33
40
|
**Correctifs d'installation, Kanban et workflow (2026-10-22, v8.23.1) :**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
# Claude-Craft - Multi-Technology Framework
|
|
10
10
|
|
|
11
|
-
**Version:** 8.23.
|
|
11
|
+
**Version:** 8.23.2 | **Languages:** en, fr, es, de, pt
|
|
12
12
|
|
|
13
13
|
A comprehensive AI-assisted development framework for Claude Code with 13 technology stacks, 33 specialized agents (+39 infra agents on-demand), 140 commands across 17 namespaces, and BMAD v6 project management.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
# Claude-Craft - Multi-Technology Framework
|
|
10
10
|
|
|
11
|
-
**Version:** 8.23.
|
|
11
|
+
**Version:** 8.23.2 | **Languages:** en, fr, es, de, pt
|
|
12
12
|
|
|
13
13
|
A comprehensive AI-assisted development framework for Claude Code with 13 technology stacks, 33 specialized agents (+39 infra agents on-demand), 140 commands across 17 namespaces, and BMAD v6 project management.
|
|
14
14
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{A as e,C as t,E as n,M as r,O as i,P as a,S as o,c as s,f as c,g as l,h as u,i as d,j as f,k as p,l as m,m as h,p as g,s as _,v,w as y,x as b}from"./index-DI89vrQ2.js";function x(e=[],t=[]){let n=new Map(e.map(e=>[e.date,e.points])),r=new Map(t.map(e=>[e.date,e.points]));return[...new Set([...n.keys(),...r.keys()])].sort((e,t)=>e.localeCompare(t)).map(e=>({date:e,ideal:n.has(e)?n.get(e):null,actual:r.has(e)?r.get(e):null}))}var S=!0,C=`uplot`,w=`u-hz`,T=`u-vt`,E=`u-title`,D=`u-wrap`,O=`u-under`,ee=`u-over`,te=`u-axis`,k=`u-off`,ne=`u-select`,re=`u-cursor-x`,ie=`u-cursor-y`,ae=`u-cursor-pt`,oe=`u-legend`,se=`u-live`,ce=`u-inline`,le=`u-series`,ue=`u-marker`,de=`u-label`,fe=`u-value`,A=`width`,pe=`height`,me=`top`,he=`bottom`,ge=`left`,_e=`right`,ve=`#000`,ye=`#0000`,be=`mousemove`,xe=`mousedown`,Se=`mouseup`,Ce=`mouseenter`,we=`mouseleave`,Te=`dblclick`,Ee=`resize`,De=`scroll`,Oe=`change`,ke=`dppxchange`,Ae=`--`,j=typeof window<`u`,je=j?document:null,Me=j?window:null,Ne=j?navigator:null,M,Pe;function Fe(){let e=devicePixelRatio;M!=e&&(M=e,Pe&&Je(Oe,Pe,Fe),Pe=matchMedia(`(min-resolution: ${M-.001}dppx) and (max-resolution: ${M+.001}dppx)`),qe(Oe,Pe,Fe),Me.dispatchEvent(new CustomEvent(ke)))}function Ie(e,t){if(t!=null){let n=e.classList;!n.contains(t)&&n.add(t)}}function Le(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function N(e,t,n){e.style[t]=n+`px`}function Re(e,t,n,r){let i=je.createElement(e);return t!=null&&Ie(i,t),n?.insertBefore(i,r),i}function ze(e,t){return Re(`div`,e,t)}var P=new WeakMap;function Be(e,t,n,r,i){let a=`translate(`+t+`px,`+n+`px)`;a!=P.get(e)&&(e.style.transform=a,P.set(e,a),t<0||n<0||t>r||n>i?Ie(e,k):Le(e,k))}var Ve=new WeakMap;function He(e,t,n){let r=t+n;r!=Ve.get(e)&&(Ve.set(e,r),e.style.background=t,e.style.borderColor=n)}var Ue=new WeakMap;function We(e,t,n,r){let i=t+``+n;i!=Ue.get(e)&&(Ue.set(e,i),e.style.height=n+`px`,e.style.width=t+`px`,e.style.marginLeft=r?-t/2+`px`:0,e.style.marginTop=r?-n/2+`px`:0)}var Ge={passive:!0},Ke={...Ge,capture:!0};function qe(e,t,n,r){t.addEventListener(e,n,r?Ke:Ge)}function Je(e,t,n,r){t.removeEventListener(e,n,Ge)}j&&Fe();function Ye(e,t,n,r){let i;n||=0,r||=t.length-1;let a=r<=2147483647;for(;r-n>1;)i=a?n+r>>1:ft((n+r)/2),t[i]<e?n=i:r=i;return e-t[n]<=t[r]-e?n:r}function Xe(e){return(t,n,r)=>{let i=-1,a=-1;for(let a=n;a<=r;a++)if(e(t[a])){i=a;break}for(let i=r;i>=n;i--)if(e(t[i])){a=i;break}return[i,a]}}var Ze=e=>e!=null,F=e=>e!=null&&e>0,I=Xe(Ze),Qe=Xe(F);function $e(e,t,n,r=0,i=!1){let a=i?Qe:I,o=i?F:Ze;[t,n]=a(e,t,n);let s=e[t],c=e[t];if(t>-1){if(r==1)s=e[t],c=e[n];else if(r==-1)s=e[n],c=e[t];else for(let r=t;r<=n;r++){let t=e[r];o(t)&&(t<s?s=t:t>c&&(c=t))}}return[s??V,c??-V]}function et(e,t,n,r){let i=_t(e),a=_t(t);e==t&&(i==-1?(e*=n,t/=n):(e/=n,t*=n));let o=n==10?vt:yt,s=i==1?ft:pt,c=a==1?pt:ft,l=s(o(z(e))),u=c(o(z(t))),d=gt(n,l),f=gt(n,u);return n==10&&(l<0&&(d=U(d,-l)),u<0&&(f=U(f,-u))),r||n==2?(e=d*i,t=f*a):(e=Ft(e,d),t=Pt(t,f)),[e,t]}function tt(e,t,n,r){let i=et(e,t,n,r);return e==0&&(i[0]=0),t==0&&(i[1]=0),i}var nt=.1,rt={mode:3,pad:nt},it={pad:0,soft:null,mode:0},at={min:it,max:it};function ot(e,t,n,r){return Kt(n)?ct(e,t,n):(it.pad=n,it.soft=r?0:null,it.mode=r?3:0,ct(e,t,at))}function L(e,t){return e??t}function st(e,t,n){for(t=L(t,0),n=L(n,e.length-1);t<=n;){if(e[t]!=null)return!0;t++}return!1}function ct(e,t,n){let r=n.min,i=n.max,a=L(r.pad,0),o=L(i.pad,0),s=L(r.hard,-V),c=L(i.hard,V),l=L(r.soft,V),u=L(i.soft,-V),d=L(r.mode,0),f=L(i.mode,0),p=t-e,m=vt(p),h=ht(z(e),z(t)),g=z(vt(h)-m);(p<1e-24||g>10)&&(p=0,(e==0||t==0)&&(p=1e-24,d==2&&l!=V&&(a=0),f==2&&u!=-V&&(o=0)));let _=p||h||1e3,v=gt(10,ft(vt(_))),y=U(Ft(e-_*(p==0?e==0?.1:1:a),v/10),24),b=e>=l&&(d==1||d==3&&y<=l||d==2&&y>=l)?l:V,x=ht(s,y<b&&e>=b?b:mt(b,y)),S=U(Pt(t+_*(p==0?t==0?.1:1:o),v/10),24),C=t<=u&&(f==1||f==3&&S>=u||f==2&&S<=u)?u:-V,w=mt(c,S>C&&t<=C?C:ht(C,S));return x==w&&x==0&&(w=100),[x,w]}var lt=new Intl.NumberFormat(j?Ne.language:`en-US`),ut=e=>lt.format(e),R=Math,dt=R.PI,z=R.abs,ft=R.floor,B=R.round,pt=R.ceil,mt=R.min,ht=R.max,gt=R.pow,_t=R.sign,vt=R.log10,yt=R.log2,bt=(e,t=1)=>R.sinh(e)*t,xt=(e,t=1)=>R.asinh(e/t),V=1/0;function St(e){return(vt((e^e>>31)-(e>>31))|0)+1}function Ct(e,t,n){return mt(ht(e,t),n)}function wt(e){return typeof e==`function`}function H(e){return wt(e)?e:()=>e}var Tt=()=>{},Et=e=>e,Dt=(e,t)=>t,Ot=e=>null,kt=e=>!0,At=(e,t)=>e==t,jt=/\.\d*?(?=9{6,}|0{6,})/gm,Mt=e=>{if(Ut(e)||It.has(e))return e;let t=`${e}`,n=t.match(jt);if(n==null)return e;let r=n[0].length-1;if(t.indexOf(`e-`)!=-1){let[e,n]=t.split(`e`);return+`${Mt(e)}e${n}`}return U(e,r)};function Nt(e,t){return Mt(U(Mt(e/t))*t)}function Pt(e,t){return Mt(pt(Mt(e/t))*t)}function Ft(e,t){return Mt(ft(Mt(e/t))*t)}function U(e,t=0){if(Ut(e))return e;let n=10**t;return B(e*n*(1+2**-52))/n}var It=new Map;function Lt(e){return((``+e).split(`.`)[1]||``).length}function Rt(e,t,n,r){let i=[],a=r.map(Lt);for(let o=t;o<n;o++){let t=z(o),n=U(gt(e,o),t);for(let s=0;s<r.length;s++){let c=e==10?+`${r[s]}e${o}`:r[s]*n,l=(o>=0?0:t)+(o>=a[s]?0:a[s]),u=e==10?c:U(c,l);i.push(u),It.set(u,l)}}return i}var zt={},Bt=[],Vt=[null,null],Ht=Array.isArray,Ut=Number.isInteger,Wt=e=>e===void 0;function Gt(e){return typeof e==`string`}function Kt(e){let t=!1;if(e!=null){let n=e.constructor;t=n==null||n==Object}return t}function qt(e){return typeof e==`object`&&!!e}var Jt=Object.getPrototypeOf(Uint8Array),W=`__proto__`;function Yt(e,t=Kt){let n;if(Ht(e)){let r=e.find(e=>e!=null);if(Ht(r)||t(r)){n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=Yt(e[r],t)}else n=e.slice()}else if(e instanceof Jt)n=e.slice();else if(t(e)){n={};for(let r in e)r!=W&&(n[r]=Yt(e[r],t))}else n=e;return n}function G(e){let t=arguments;for(let n=1;n<t.length;n++){let r=t[n];for(let t in r)t!=W&&(Kt(e[t])?G(e[t],Yt(r[t])):e[t]=Yt(r[t]))}return e}var K=0,Xt=1,Zt=2;function Qt(e,t,n){for(let r=0,i,a=-1;r<t.length;r++){let o=t[r];if(o>a){for(i=o-1;i>=0&&e[i]==null;)e[i--]=null;for(i=o+1;i<n&&e[i]==null;)e[a=i++]=null}}}function $t(e,t){if(nn(e)){let t=e[0].slice();for(let n=1;n<e.length;n++)t.push(...e[n].slice(1));return rn(t[0])||(t=tn(t)),t}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t][0],i=r.length;for(let e=0;e<i;e++)n.add(r[e])}let r=[Array.from(n).sort((e,t)=>e-t)],i=r[0].length,a=new Map;for(let e=0;e<i;e++)a.set(r[0][e],e);for(let n=0;n<e.length;n++){let o=e[n],s=o[0];for(let e=1;e<o.length;e++){let c=o[e],l=Array(i).fill(void 0),u=t?t[n][e]:Xt,d=[];for(let e=0;e<c.length;e++){let t=c[e],n=a.get(s[e]);t===null?u!=K&&(l[n]=t,u==Zt&&d.push(n)):l[n]=t}Qt(l,d,i),r.push(l)}}return r}var en=typeof queueMicrotask>`u`?e=>Promise.resolve().then(e):queueMicrotask;function tn(e){let t=e[0],n=t.length,r=Array(n);for(let e=0;e<r.length;e++)r[e]=e;r.sort((e,n)=>t[e]-t[n]);let i=[];for(let t=0;t<e.length;t++){let a=e[t],o=Array(n);for(let e=0;e<n;e++)o[e]=a[r[e]];i.push(o)}return i}function nn(e){let t=e[0][0],n=t.length;for(let r=1;r<e.length;r++){let i=e[r][0];if(i.length!=n)return!1;if(i!=t){for(let e=0;e<n;e++)if(i[e]!=t[e])return!1}}return!0}function rn(e,t=100){let n=e.length;if(n<=1)return!0;let r=0,i=n-1;for(;r<=i&&e[r]==null;)r++;for(;i>=r&&e[i]==null;)i--;if(i<=r)return!0;let a=ht(1,ft((i-r+1)/t));for(let t=e[r],n=r+a;n<=i;n+=a){let r=e[n];if(r!=null){if(r<=t)return!1;t=r}}return!0}var an=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],on=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function sn(e){return e.slice(0,3)}var cn=on.map(sn),ln={MMMM:an,MMM:an.map(sn),WWWW:on,WWW:cn};function un(e){return(e<10?`0`:``)+e}function dn(e){return(e<10?`00`:e<100?`0`:``)+e}var fn={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+``).slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>un(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>un(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>un(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?`PM`:`AM`,aa:e=>e.getHours()>=12?`pm`:`am`,a:e=>e.getHours()>=12?`p`:`a`,mm:e=>un(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>un(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>dn(e.getMilliseconds())};function pn(e,t){t||=ln;let n=[],r=/\{([a-z]+)\}|[^{]+/gi,i;for(;i=r.exec(e);)n.push(i[0][0]==`{`?fn[i[1]]:i[0]);return e=>{let r=``;for(let i=0;i<n.length;i++)r+=typeof n[i]==`string`?n[i]:n[i](e,t);return r}}var mn=new Intl.DateTimeFormat().resolvedOptions().timeZone;function hn(e,t){let n;return t==`UTC`||t==`Etc/UTC`?n=new Date(+e+e.getTimezoneOffset()*6e4):t==mn?n=e:(n=new Date(e.toLocaleString(`en-US`,{timeZone:t})),n.setMilliseconds(e.getMilliseconds())),n}var gn=e=>e%1==0,_n=[1,2,2.5,5],vn=Rt(10,-32,0,_n),yn=Rt(10,0,32,_n),bn=yn.filter(gn),xn=vn.concat(yn),Sn=`
|
|
2
|
+
`,Cn=`{YYYY}`,wn=Sn+Cn,Tn=`{M}/{D}`,En=Sn+Tn,Dn=En+`/{YY}`,On=`{aa}`,kn=`{h}:{mm}`+On,An=Sn+kn,jn=`:{ss}`,q=null;function Mn(e){let t=e*1e3,n=t*60,r=n*60,i=r*24,a=i*30,o=i*365,s=(e==1?Rt(10,0,3,_n).filter(gn):Rt(10,-3,0,_n)).concat([t,t*5,t*10,t*15,t*30,n,n*5,n*10,n*15,n*30,r,r*2,r*3,r*4,r*6,r*8,r*12,i,i*2,i*3,i*4,i*5,i*6,i*7,i*8,i*9,i*10,i*15,a,a*2,a*3,a*4,a*6,o,o*2,o*5,o*10,o*25,o*50,o*100]),c=[[o,Cn,q,q,q,q,q,q,1],[i*28,`{MMM}`,wn,q,q,q,q,q,1],[i,Tn,wn,q,q,q,q,q,1],[r,`{h}`+On,Dn,q,En,q,q,q,1],[n,kn,Dn,q,En,q,q,q,1],[t,jn,Dn+` `+kn,q,En+` `+kn,q,An,q,1],[e,jn+`.{fff}`,Dn+` `+kn,q,En+` `+kn,q,An,q,1]];function l(t){return(s,c,l,u,d,f)=>{let p=[],m=d>=o,h=d>=a&&d<o,g=t(l),_=U(g*e,3),v=Hn(g.getFullYear(),m?0:g.getMonth(),h||m?1:g.getDate()),y=U(v*e,3);if(h||m){let n=h?d/a:0,r=m?d/o:0,i=_==y?_:U(Hn(v.getFullYear()+r,v.getMonth()+n,1)*e,3),s=new Date(B(i/e)),c=s.getFullYear(),l=s.getMonth();for(let a=0;i<=u;a++){let o=Hn(c+r*a,l+n*a,1),s=o-t(U(o*e,3));i=U((+o+s)*e,3),i<=u&&p.push(i)}}else{let a=d>=i?i:d,o=y+(ft(l)-ft(_))+Pt(_-y,a);p.push(o);let m=t(o),h=m.getHours()+m.getMinutes()/n+m.getSeconds()/r,g=d/r,v=f/s.axes[c]._space;for(;o=U(o+d,e==1?0:3),!(o>u);)if(g>1){let e=ft(U(h+g,6))%24,n=t(o).getHours()-e;n>1&&(n=-1),o-=n*r,h=(h+g)%24;let i=p[p.length-1];U((o-i)/d,3)*v>=.7&&p.push(o)}else p.push(o)}return p}}return[s,c,l]}var[Nn,Pn,Fn]=Mn(1),[In,Ln,Rn]=Mn(.001);Rt(2,-53,53,[1]);function zn(e,t){return e.map(e=>e.map((n,r)=>r==0||r==8||n==null?n:t(r==1||e[8]==0?n:e[1]+n)))}function Bn(e,t){return(n,r,i,a,o)=>{let s=t.find(e=>o>=e[0])||t[t.length-1],c,l,u,d,f,p;return r.map(t=>{let n=e(t),r=n.getFullYear(),i=n.getMonth(),a=n.getDate(),o=n.getHours(),m=n.getMinutes(),h=n.getSeconds(),g=r!=c&&s[2]||i!=l&&s[3]||a!=u&&s[4]||o!=d&&s[5]||m!=f&&s[6]||h!=p&&s[7]||s[1];return c=r,l=i,u=a,d=o,f=m,p=h,g(n)})}}function Vn(e,t){let n=pn(t);return(t,r,i,a,o)=>r.map(t=>n(e(t)))}function Hn(e,t,n){return new Date(e,t,n)}function Un(e,t){return t(e)}var Wn=`{YYYY}-{MM}-{DD} {h}:{mm}{aa}`;function Gn(e,t){return(n,r,i,a)=>a==null?Ae:t(e(r))}function Kn(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null}function qn(e,t){return e.series[t].fill(e,t)}var Jn={show:!0,live:!0,isolate:!1,mount:Tt,markers:{show:!0,width:2,stroke:Kn,fill:qn,dash:`solid`},idx:null,idxs:null,values:[]};function Yn(e,t){let n=e.cursor.points,r=ze(),i=n.size(e,t);N(r,A,i),N(r,pe,i);let a=i/-2;N(r,`marginLeft`,a),N(r,`marginTop`,a);let o=n.width(e,t,i);return o&&N(r,`borderWidth`,o),r}function Xn(e,t){let n=e.series[t].points;return n._fill||n._stroke}function Zn(e,t){let n=e.series[t].points;return n._stroke||n._fill}function Qn(e,t){return e.series[t].points.size}var J=[0,0];function Y(e,t,n){return J[0]=t,J[1]=n,J}function $n(e,t,n,r=!0){return e=>{e.button!=0||r&&e.target!=t||n(e)}}function er(e,t,n,r=!0){return e=>{r&&e.target!=t||n(e)}}var tr={show:!0,x:!0,y:!0,lock:!1,move:Y,points:{one:!1,show:Yn,size:Qn,width:0,stroke:Zn,fill:Xn},bind:{mousedown:$n,mouseup:$n,click:$n,dblclick:$n,mousemove:er,mouseleave:er,mouseenter:er},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,n,r,i)=>r-i,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},nr={show:!0,stroke:`rgba(0,0,0,0.07)`,width:2},rr=G({},nr,{filter:Dt}),ir=G({},rr,{size:10}),ar=G({},nr,{show:!1}),or=`12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,sr=`bold `+or,cr=1.5,lr={show:!0,scale:`x`,stroke:ve,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:sr,side:2,grid:rr,ticks:ir,border:ar,font:or,lineGap:cr,rotate:0},ur=`Value`,dr=`Time`,fr={show:!0,scale:`x`,auto:!1,sorted:1,min:V,max:-1/0,idxs:[]};function pr(e,t,n,r,i){return t.map(e=>e==null?``:ut(e))}function mr(e,t,n,r,i,a,o){let s=[],c=It.get(i)||0;n=o?n:U(Pt(n,i),c);for(let e=n;e<=r;e=U(e+i,c))s.push(Object.is(e,-0)?0:e);return s}function hr(e,t,n,r,i,a,o){let s=[],c=e.scales[e.axes[t].scale].log;i=gt(c,ft((c==10?vt:yt)(n))),c==10&&(i=xn[Ye(i,xn)]);let l=n,u=i*c;c==10&&(u=xn[Ye(u,xn)]);do s.push(l),l+=i,c==10&&!It.has(l)&&(l=U(l,It.get(i))),l>=u&&(i=l,u=i*c,c==10&&(u=xn[Ye(u,xn)]));while(l<=r);return s}function gr(e,t,n,r,i,a,o){let s=e.scales[e.axes[t].scale].asinh,c=r>s?hr(e,t,ht(s,n),r,i):[s],l=r>=0&&n<=0?[0]:[];return(n<-s?hr(e,t,ht(s,-r),-n,i):[s]).reverse().map(e=>-e).concat(l,c)}var _r=/./,vr=/[12357]/,yr=/[125]/,br=/1/,xr=(e,t,n,r)=>e.map((e,i)=>t==4&&e==0||i%r==0&&n.test(e.toExponential()[+(e<0)])?e:null);function Sr(e,t,n,r,i){let a=e.axes[n],o=a.scale,s=e.scales[o],c=e.valToPos,l=a._space,u=c(10,o),d=c(9,o)-u>=l?_r:c(7,o)-u>=l?vr:c(5,o)-u>=l?yr:br;if(d==br){let e=z(c(1,o)-u);if(e<l)return xr(t.slice().reverse(),s.distr,d,pt(l/e)).reverse()}return xr(t,s.distr,d,1)}function Cr(e,t,n,r,i){let a=e.axes[n],o=a.scale,s=a._space,c=e.valToPos,l=z(c(1,o)-c(2,o));return l<s?xr(t.slice().reverse(),3,_r,pt(s/l)).reverse():t}function wr(e,t,n,r){return r==null?Ae:t==null?``:ut(t)}var Tr={show:!0,scale:`y`,stroke:ve,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:sr,side:3,grid:rr,ticks:ir,border:ar,font:or,lineGap:cr,rotate:0};function Er(e,t){return U((3+(e||1)*2)*t,3)}function Dr(e,t){let{scale:n,idxs:r}=e.series[0],i=e._data[0],a=e.valToPos(i[r[0]],n,!0),o=z(e.valToPos(i[r[1]],n,!0)-a)/(e.series[t].points.space*M);return r[1]-r[0]<=o}var Or={scale:null,auto:!0,sorted:0,min:V,max:-1/0},kr=(e,t,n,r,i)=>i,Ar={show:!0,auto:!0,sorted:0,gaps:kr,alpha:1,facets:[G({},Or,{scale:`x`}),G({},Or,{scale:`y`})]},jr={scale:`y`,auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:kr,alpha:1,points:{show:Dr,filter:null},values:null,min:V,max:-1/0,idxs:[],path:null,clip:null};function Mr(e,t,n,r,i){return n/10}var Nr={time:S,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Pr=G({},Nr,{time:!1,ori:1}),Fr={};function Ir(e,t){let n=Fr[e];return n||(n={key:e,plots:[],sub(e){n.plots.push(e)},unsub(e){n.plots=n.plots.filter(t=>t!=e)},pub(e,t,r,i,a,o,s){for(let c=0;c<n.plots.length;c++)n.plots[c]!=t&&n.plots[c].pub(e,t,r,i,a,o,s)}},e!=null&&(Fr[e]=n)),n}var Lr=1,Rr=2;function zr(e,t,n){let r=e.mode,i=e.series[t],a=r==2?e._data[t]:e._data,o=e.scales,s=e.bbox,c=a[0],l=r==2?a[1]:a[t],u=r==2?o[i.facets[0].scale]:o[e.series[0].scale],d=r==2?o[i.facets[1].scale]:o[i.scale],f=s.left,p=s.top,m=s.width,h=s.height,g=e.valToPosH,_=e.valToPosV;return u.ori==0?n(i,c,l,u,d,g,_,f,p,m,h,Jr,Xr,Qr,ei,ni):n(i,c,l,u,d,_,g,p,f,h,m,Yr,Zr,$r,ti,ri)}function Br(e,t){let n=0,r=0,i=L(e.bands,Bt);for(let e=0;e<i.length;e++){let a=i[e];a.series[0]==t?n=a.dir:a.series[1]==t&&(a.dir==1?r|=1:r|=2)}return[n,r==1?-1:r==2?1:r==3?2:0]}function Vr(e,t,n,r,i){let a=e.mode,o=e.series[t],s=a==2?o.facets[1].scale:o.scale,c=e.scales[s];return i==-1?c.min:i==1?c.max:c.distr==3?c.dir==1?c.min:c.max:0}function Hr(e,t,n,r,i,a){return zr(e,t,(e,t,o,s,c,l,u,d,f,p,m)=>{let h=e.pxRound,g=s.dir*(s.ori==0?1:-1),_=s.ori==0?Xr:Zr,v,y;g==1?(v=n,y=r):(v=r,y=n);let b=h(l(t[v],s,p,d)),x=h(u(o[v],c,m,f)),S=h(l(t[y],s,p,d)),C=h(u(a==1?c.max:c.min,c,m,f)),w=new Path2D(i);return _(w,S,C),_(w,b,C),_(w,b,x),w})}function Ur(e,t,n,r,i,a){let o=null;if(e.length>0){o=new Path2D;let s=t==0?Qr:$r,c=n;for(let t=0;t<e.length;t++){let n=e[t];if(n[1]>n[0]){let e=n[0]-c;e>0&&s(o,c,r,e,r+a),c=n[1]}}let l=n+i-c;l>0&&s(o,c,r-5,l,r+a+10)}return o}function Wr(e,t,n){let r=e[e.length-1];r&&r[0]==t?r[1]=n:e.push([t,n])}function Gr(e,t,n,r,i,a,o){let s=[],c=e.length;for(let l=i==1?n:r;l>=n&&l<=r;l+=i)if(t[l]===null){let u=l,d=l;if(i==1)for(;++l<=r&&t[l]===null;)d=l;else for(;--l>=n&&t[l]===null;)d=l;let f=a(e[u]),p=d==u?f:a(e[d]),m=u-i;f=o<=0&&m>=0&&m<c?a(e[m]):f;let h=d+i;p=o>=0&&h>=0&&h<c?a(e[h]):p,p>=f&&s.push([f,p])}return s}function Kr(e){return e==0?Et:e==1?B:t=>Nt(t,e)}function qr(e){let t=e==0?Jr:Yr,n=e==0?(e,t,n,r,i,a)=>{e.arcTo(t,n,r,i,a)}:(e,t,n,r,i,a)=>{e.arcTo(n,t,i,r,a)},r=e==0?(e,t,n,r,i)=>{e.rect(t,n,r,i)}:(e,t,n,r,i)=>{e.rect(n,t,i,r)};return(e,i,a,o,s,c=0,l=0)=>{c==0&&l==0?r(e,i,a,o,s):(c=mt(c,o/2,s/2),l=mt(l,o/2,s/2),t(e,i+c,a),n(e,i+o,a,i+o,a+s,c),n(e,i+o,a+s,i,a+s,l),n(e,i,a+s,i,a,l),n(e,i,a,i+o,a,c),e.closePath())}}var Jr=(e,t,n)=>{e.moveTo(t,n)},Yr=(e,t,n)=>{e.moveTo(n,t)},Xr=(e,t,n)=>{e.lineTo(t,n)},Zr=(e,t,n)=>{e.lineTo(n,t)},Qr=qr(0),$r=qr(1),ei=(e,t,n,r,i,a)=>{e.arc(t,n,r,i,a)},ti=(e,t,n,r,i,a)=>{e.arc(n,t,r,i,a)},ni=(e,t,n,r,i,a,o)=>{e.bezierCurveTo(t,n,r,i,a,o)},ri=(e,t,n,r,i,a,o)=>{e.bezierCurveTo(n,t,i,r,o,a)};function ii(e){return(e,t,n,r,i)=>zr(e,t,(t,a,o,s,c,l,u,d,f,p,m)=>{let{pxRound:h,points:g}=t,_,v;s.ori==0?(_=Jr,v=ei):(_=Yr,v=ti);let y=U(g.width*M,3),b=(g.size-g.width)/2*M,x=U(b*2,3),S=new Path2D,C=new Path2D,{left:w,top:T,width:E,height:D}=e.bbox;Qr(C,w-x,T-x,E+x*2,D+x*2);let O=e=>{if(o[e]!=null){let t=h(l(a[e],s,p,d)),n=h(u(o[e],c,m,f));_(S,t+b,n),v(S,t,n,b,0,dt*2)}};if(i)i.forEach(O);else for(let e=n;e<=r;e++)O(e);return{stroke:y>0?S:null,fill:S,clip:C,flags:3}})}function ai(e){return(t,n,r,i,a,o)=>{r!=i&&(a!=r&&o!=r&&e(t,n,r),a!=i&&o!=i&&e(t,n,i),e(t,n,o))}}var oi=ai(Xr),si=ai(Zr);function ci(e){let t=L(e?.alignGaps,0);return(e,n,r,i)=>zr(e,n,(a,o,s,c,l,u,d,f,p,m,h)=>{[r,i]=I(s,r,i);let g=a.pxRound,_=e=>g(u(e,c,m,f)),v=e=>g(d(e,l,h,p)),y,b;c.ori==0?(y=Xr,b=oi):(y=Zr,b=si);let x=c.dir*(c.ori==0?1:-1),S={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Lr},C=S.stroke,w=!1;if(i-r>=m*4){let t=t=>e.posToVal(t,c.key,!0),n=null,a=null,l,u,d,f=_(o[x==1?r:i]),p=_(o[r]),m=_(o[i]),h=t(x==1?p+1:m-1);for(let e=x==1?r:i;e>=r&&e<=i;e+=x){let r=o[e],i=(x==1?r<h:r>h)?f:_(r),c=s[e];i==f?c==null?c===null&&(w=!0):(u=c,n==null?(y(C,i,v(u)),l=n=a=u):u<n?n=u:u>a&&(a=u)):(n!=null&&b(C,f,v(n),v(a),v(l),v(u)),c==null?(n=a=null,c===null&&(w=!0)):(u=c,y(C,i,v(u)),n=a=l=u),f=i,h=t(f+x))}n!=null&&n!=a&&d!=f&&b(C,f,v(n),v(a),v(l),v(u))}else for(let e=x==1?r:i;e>=r&&e<=i;e+=x){let t=s[e];t===null?w=!0:t!=null&&y(C,_(o[e]),v(t))}let[T,E]=Br(e,n);if(a.fill!=null||T!=0){let t=S.fill=new Path2D(C),s=v(a.fillTo(e,n,a.min,a.max,T)),c=_(o[r]),l=_(o[i]);x==-1&&([l,c]=[c,l]),y(t,l,s),y(t,c,s)}if(!a.spanGaps){let l=[];w&&l.push(...Gr(o,s,r,i,x,_,t)),S.gaps=l=a.gaps(e,n,r,i,l),S.clip=Ur(l,c.ori,f,p,m,h)}return E!=0&&(S.band=E==2?[Hr(e,n,r,i,C,-1),Hr(e,n,r,i,C,1)]:Hr(e,n,r,i,C,E)),S})}function li(e){let t=L(e.align,1),n=L(e.ascDesc,!1),r=L(e.alignGaps,0),i=L(e.extend,!1);return(e,a,o,s)=>zr(e,a,(c,l,u,d,f,p,m,h,g,_,v)=>{[o,s]=I(u,o,s);let y=c.pxRound,{left:b,width:x}=e.bbox,S=e=>y(p(e,d,_,h)),C=e=>y(m(e,f,v,g)),w=d.ori==0?Xr:Zr,T={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Lr},E=T.stroke,D=d.dir*(d.ori==0?1:-1),O=C(u[D==1?o:s]),ee=S(l[D==1?o:s]),te=ee,k=ee;i&&t==-1&&(k=b,w(E,k,O)),w(E,ee,O);for(let e=D==1?o:s;e>=o&&e<=s;e+=D){let n=u[e];if(n==null)continue;let r=S(l[e]),i=C(n);t==1?w(E,r,O):w(E,te,i),w(E,r,i),O=i,te=r}let ne=te;i&&t==1&&(ne=b+x,w(E,ne,O));let[re,ie]=Br(e,a);if(c.fill!=null||re!=0){let t=T.fill=new Path2D(E),n=C(c.fillTo(e,a,c.min,c.max,re));w(t,ne,n),w(t,k,n)}if(!c.spanGaps){let i=[];i.push(...Gr(l,u,o,s,D,S,r));let f=c.width*M/2,p=n||t==1?f:-f,m=n||t==-1?-f:f;i.forEach(e=>{e[0]+=p,e[1]+=m}),T.gaps=i=c.gaps(e,a,o,s,i),T.clip=Ur(i,d.ori,h,g,_,v)}return ie!=0&&(T.band=ie==2?[Hr(e,a,o,s,E,-1),Hr(e,a,o,s,E,1)]:Hr(e,a,o,s,E,ie)),T})}function ui(e,t,n,r,i,a,o=V){if(e.length>1){let s=null;for(let c=0,l=1/0;c<e.length;c++)if(t[c]!==void 0){if(s!=null){let t=z(e[c]-e[s]);t<l&&(l=t,o=z(n(e[c],r,i,a)-n(e[s],r,i,a)))}s=c}}return o}function di(e){e||=zt;let t=L(e.size,[.6,V,1]),n=e.align||0,r=e.gap||0,i=e.radius;i=i==null?[0,0]:typeof i==`number`?[i,0]:i;let a=H(i),o=1-t[0],s=L(t[1],V),c=L(t[2],1),l=L(e.disp,zt),u=L(e.each,e=>{}),{fill:d,stroke:f}=l;return(e,t,i,p)=>zr(e,t,(m,h,g,_,v,y,b,x,S,C,w)=>{let T=m.pxRound,E=n,D=r*M,O=s*M,ee=c*M,te,k;_.ori==0?[te,k]=a(e,t):[k,te]=a(e,t);let ne=_.dir*(_.ori==0?1:-1),re=_.ori==0?Qr:$r,ie=_.ori==0?u:(e,t,n,r,i,a,o)=>{u(e,t,n,i,r,o,a)},ae=L(e.bands,Bt).find(e=>e.series[0]==t),oe=ae==null?0:ae.dir,se=m.fillTo(e,t,m.min,m.max,oe),ce=T(b(se,v,w,S)),le,ue,de,fe=C,A=T(m.width*M),pe=!1,me=null,he=null,ge=null,_e=null;d!=null&&(A==0||f!=null)&&(pe=!0,me=d.values(e,t,i,p),he=new Map,new Set(me).forEach(e=>{e!=null&&he.set(e,new Path2D)}),A>0&&(ge=f.values(e,t,i,p),_e=new Map,new Set(ge).forEach(e=>{e!=null&&_e.set(e,new Path2D)})));let{x0:ve,size:ye}=l;if(ve!=null&&ye!=null){E=1,h=ve.values(e,t,i,p),ve.unit==2&&(h=h.map(t=>e.posToVal(x+t*C,_.key,!0)));let n=ye.values(e,t,i,p);ue=ye.unit==2?n[0]*C:y(n[0],_,C,x)-y(0,_,C,x),fe=ui(h,g,y,_,C,x,fe),de=fe-ue+D}else fe=ui(h,g,y,_,C,x,fe),de=fe*o+D,ue=fe-de;de<1&&(de=0),A>=ue/2&&(A=0),de<5&&(T=Et);let be=de>0,xe=fe-de-(be?A:0);ue=T(Ct(xe,ee,O)),le=(E==0?ue/2:E==ne?0:ue)-E*ne*((E==0?D/2:0)+(be?A/2:0));let Se={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Ce=pe?null:new Path2D,we=null;if(ae!=null)we=e.data[ae.series[1]];else{let{y0:n,y1:r}=l;n!=null&&r!=null&&(g=r.values(e,t,i,p),we=n.values(e,t,i,p))}let Te=te*ue,Ee=k*ue;for(let n=ne==1?i:p;n>=i&&n<=p;n+=ne){let r=g[n];if(r==null)continue;if(we!=null){let e=we[n]??0;if(r-e==0)continue;ce=b(e,v,w,S)}let i=y(_.distr!=2||l!=null?h[n]:n,_,C,x),a=b(L(r,se),v,w,S),o=T(i-le),s=T(ht(a,ce)),c=T(mt(a,ce)),u=s-c;if(r!=null){let i=r<0?Ee:Te,a=r<0?Te:Ee;pe?(A>0&&ge[n]!=null&&re(_e.get(ge[n]),o,c+ft(A/2),ue,ht(0,u-A),i,a),me[n]!=null&&re(he.get(me[n]),o,c+ft(A/2),ue,ht(0,u-A),i,a)):re(Ce,o,c+ft(A/2),ue,ht(0,u-A),i,a),ie(e,t,n,o-A/2,c,ue+A,u)}}return A>0?Se.stroke=pe?_e:Ce:pe||(Se._fill=m.width==0?m._fill:m._stroke??m._fill,Se.width=0),Se.fill=pe?he:Ce,Se})}function fi(e,t){let n=L(t?.alignGaps,0);return(t,r,i,a)=>zr(t,r,(o,s,c,l,u,d,f,p,m,h,g)=>{[i,a]=I(c,i,a);let _=o.pxRound,v=e=>_(d(e,l,h,p)),y=e=>_(f(e,u,g,m)),b,x,S;l.ori==0?(b=Jr,S=Xr,x=ni):(b=Yr,S=Zr,x=ri);let C=l.dir*(l.ori==0?1:-1),w=v(s[C==1?i:a]),T=w,E=[],D=[];for(let e=C==1?i:a;e>=i&&e<=a;e+=C)if(c[e]!=null){let t=s[e],n=v(t);E.push(T=n),D.push(y(c[e]))}let O={stroke:e(E,D,b,S,x,_),fill:null,clip:null,band:null,gaps:null,flags:Lr},ee=O.stroke,[te,k]=Br(t,r);if(o.fill!=null||te!=0){let e=O.fill=new Path2D(ee),n=y(o.fillTo(t,r,o.min,o.max,te));S(e,T,n),S(e,w,n)}if(!o.spanGaps){let e=[];e.push(...Gr(s,c,i,a,C,v,n)),O.gaps=e=o.gaps(t,r,i,a,e),O.clip=Ur(e,l.ori,p,m,h,g)}return k!=0&&(O.band=k==2?[Hr(t,r,i,a,ee,-1),Hr(t,r,i,a,ee,1)]:Hr(t,r,i,a,ee,k)),O})}function pi(e){return fi(mi,e)}function mi(e,t,n,r,i,a){let o=e.length;if(o<2)return null;let s=new Path2D;if(n(s,e[0],t[0]),o==2)r(s,e[1],t[1]);else{let n=Array(o),r=Array(o-1),a=Array(o-1),c=Array(o-1);for(let n=0;n<o-1;n++)a[n]=t[n+1]-t[n],c[n]=e[n+1]-e[n],r[n]=a[n]/c[n];n[0]=r[0];for(let e=1;e<o-1;e++)r[e]===0||r[e-1]===0||r[e-1]>0!=r[e]>0?n[e]=0:(n[e]=3*(c[e-1]+c[e])/((2*c[e]+c[e-1])/r[e-1]+(c[e]+2*c[e-1])/r[e]),isFinite(n[e])||(n[e]=0));n[o-1]=r[o-2];for(let r=0;r<o-1;r++)i(s,e[r]+c[r]/3,t[r]+n[r]*c[r]/3,e[r+1]-c[r]/3,t[r+1]-n[r+1]*c[r]/3,e[r+1],t[r+1])}return s}var hi=new Set;function gi(){for(let e of hi)e.syncRect(!0)}j&&(qe(Ee,Me,gi),qe(De,Me,gi,!0),qe(ke,Me,()=>{Mi.pxRatio=M}));var _i=ci(),vi=ii();function yi(e,t,n,r){return(r?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((e,r)=>xi(e,r,t,n))}function bi(e,t){return e.map((e,n)=>n==0?{}:G({},t,e))}function xi(e,t,n,r){return G({},t==0?n:r,e)}function Si(e,t,n){return t==null?Vt:[t,n]}var Ci=Si;function wi(e,t,n){return t==null?Vt:ot(t,n,nt,!0)}function Ti(e,t,n,r){return t==null?Vt:et(t,n,e.scales[r].log,!1)}var Ei=Ti;function Di(e,t,n,r){return t==null?Vt:tt(t,n,e.scales[r].log,!1)}var Oi=Di;function ki(e,t,n,r,i){let a=ht(St(e),St(t)),o=t-e,s=Ye(i/r*o,n);do{let e=n[s],t=r*e/o;if(t>=i&&a+(e<5?It.get(e):0)<=17)return[e,t]}while(++s<n.length);return[0,0]}function Ai(e){let t,n;return e=e.replace(/(\d+)px/,(e,r)=>(t=B((n=+r)*M))+`px`),[e,t,n]}function ji(e){e.show&&[e.font,e.labelFont].forEach(e=>{let t=U(e[2]*M,1);e[0]=e[0].replace(/[0-9.]+px/,t+`px`),e[1]=t})}function Mi(e,t,n){let r={mode:L(e.mode,1)},i=r.mode;function a(e,t,n,r){let i=t.valToPct(e);return r+n*(t.dir==-1?1-i:i)}function o(e,t,n,r){let i=t.valToPct(e);return r+n*(t.dir==-1?i:1-i)}function s(e,t,n,r){return t.ori==0?a(e,t,n,r):o(e,t,n,r)}r.valToPosH=a,r.valToPosV=o;let c=!1;r.status=0;let l=r.root=ze(C);if(e.id!=null&&(l.id=e.id),Ie(l,e.class),e.title){let t=ze(E,l);t.textContent=e.title}let u=Re(`canvas`),d=r.ctx=u.getContext(`2d`),f=ze(D,l);qe(`click`,f,e=>{e.target===m&&(X!=Ni||Z!=Pi)&&Ri.click(r,e)},!0);let p=r.under=ze(O,f);f.appendChild(u);let m=r.over=ze(ee,f);e=Yt(e);let h=+L(e.pxAlign,1),g=Kr(h);(e.plugins||[]).forEach(t=>{t.opts&&(e=t.opts(r,e)||e)});let _=e.ms||.001,v=r.series=i==1?yi(e.series||[],fr,jr,!1):bi(e.series||[null],Ar),y=r.axes=yi(e.axes||[],lr,Tr,!0),b=r.scales={},x=r.bands=e.bands||[];x.forEach(e=>{e.fill=H(e.fill||null),e.dir=L(e.dir,-1)});let S=i==2?v[1].facets[0].scale:v[0].scale,ve={axes:ti,series:Ur},Ee=(e.drawOrder||[`axes`,`series`]).map(e=>ve[e]);function De(e){let t=e.distr==3?t=>vt(t>0?t:e.clamp(r,t,e.min,e.max,e.key)):e.distr==4?t=>xt(t,e.asinh):e.distr==100?t=>e.fwd(t):e=>e;return n=>{let r=t(n),{_min:i,_max:a}=e,o=a-i;return(r-i)/o}}function Oe(t){let n=b[t];if(n==null){let r=(e.scales||zt)[t]||zt;if(r.from!=null){Oe(r.from);let e=G({},b[r.from],r,{key:t});e.valToPct=De(e),b[t]=e}else{n=b[t]=G({},t==S?Nr:Pr,r),n.key=t;let e=n.time,a=n.range,o=Ht(a);if((t!=S||i==2&&!e)&&(o&&(a[0]==null||a[1]==null)&&(a={min:a[0]==null?rt:{mode:1,hard:a[0],soft:a[0]},max:a[1]==null?rt:{mode:1,hard:a[1],soft:a[1]}},o=!1),!o&&Kt(a))){let e=a;a=(t,n,r)=>n==null?Vt:ot(n,r,e)}n.range=H(a||(e?Ci:t==S?n.distr==3?Ei:n.distr==4?Oi:Si:n.distr==3?Ti:n.distr==4?Di:wi)),n.auto=H(!o&&n.auto),n.clamp=H(n.clamp||Mr),n._min=n._max=null,n.valToPct=De(n)}}}Oe(`x`),Oe(`y`),i==1&&v.forEach(e=>{Oe(e.scale)}),y.forEach(e=>{Oe(e.scale)});for(let t in e.scales)Oe(t);let j=b[S],Ne=j.distr,Pe,Fe;j.ori==0?(Ie(l,w),Pe=a,Fe=o):(Ie(l,T),Pe=o,Fe=a);let P={};for(let e in b){let t=b[e];(t.min!=null||t.max!=null)&&(P[e]={min:t.min,max:t.max},t.min=t.max=null)}let Ve=e.tzDate||(e=>new Date(B(e/_))),Ue=e.fmtDate||pn,Ge=_==1?Fn(Ve):Rn(Ve),Ke=Bn(Ve,zn(_==1?Pn:Ln,Ue)),Xe=Gn(Ve,Un(Wn,Ue)),Ze=[],F=r.legend=G({},Jn,e.legend),I=r.cursor=G({},tr,{drag:{y:i==2}},e.cursor),Qe=F.show,it=I.show,at=F.markers;F.idxs=Ze,at.width=H(at.width),at.dash=H(at.dash),at.stroke=H(at.stroke),at.fill=H(at.fill);let ct,lt,ut,R=[],ft=[],_t,yt=!1,St={};if(F.live){let e=v[1]?v[1].values:null;yt=e!=null,_t=yt?e(r,1,0):{_:0};for(let e in _t)St[e]=Ae}if(Qe){if(ct=Re(`table`,oe,l),ut=Re(`tbody`,null,ct),F.mount(r,ct),yt){lt=Re(`thead`,null,ct,ut);let e=Re(`tr`,null,lt);for(var Tt in Re(`th`,null,e),_t)Re(`th`,de,e).textContent=Tt}else Ie(ct,ce),F.live&&Ie(ct,se)}let Et={show:!0},jt={show:!1};function Mt(e,t){if(t==0&&(yt||!F.live||i==2))return Vt;let n=[],a=Re(`tr`,le,ut,ut.childNodes[t]);Ie(a,e.class),e.show||Ie(a,k);let o=Re(`th`,null,a);if(at.show){let e=ze(ue,o);if(t>0){let n=at.width(r,t);n&&(e.style.border=n+`px `+at.dash(r,t)+` `+at.stroke(r,t)),e.style.background=at.fill(r,t)}}let s=ze(de,o);for(var c in e.label instanceof HTMLElement?s.appendChild(e.label):s.textContent=e.label,t>0&&(at.show||(s.style.color=e.width>0?at.stroke(r,t):at.fill(r,t)),Ft(`click`,o,t=>{if(I._lock)return;Cn(t);let n=v.indexOf(e);if((t.ctrlKey||t.metaKey)!=F.isolate){let e=v.some((e,t)=>t>0&&t!=n&&e.show);v.forEach((t,r)=>{r>0&&Gi(r,e?r==n?Et:jt:Et,!0,$.setSeries)})}else Gi(n,{show:!e.show},!0,$.setSeries)},!1),En&&Ft(Ce,o,t=>{I._lock||(Cn(t),Gi(v.indexOf(e),$i,!0,$.setSeries))},!1)),_t){let e=Re(`td`,fe,a);e.textContent=`--`,n.push(e)}return[a,n]}let Pt=new Map;function Ft(e,t,n,i=!0){let a=Pt.get(t)||{},o=I.bind[e](r,t,n,i);o&&(qe(e,t,a[e]=o),Pt.set(t,a))}function Rt(e,t,n){let r=Pt.get(t)||{};for(let n in r)(e==null||n==e)&&(Je(n,t,r[n]),delete r[n]);e??Pt.delete(t)}let Ut=0,Jt=0,W=0,K=0,Xt=0,Zt=0,Qt=Xt,$t=Zt,tn=W,nn=K,rn=0,an=0,on=0,sn=0;r.bbox={};let cn=!1,ln=!1,un=!1,dn=!1,fn=!1,mn=!1;function hn(e,t,n){(n||e!=r.width||t!=r.height)&&gn(e,t),ni(!1),un=!0,ln=!0,si()}function gn(e,t){r.width=Ut=W=e,r.height=Jt=K=t,Xt=Zt=0,yn(),Sn();let n=r.bbox;rn=n.left=Nt(Xt*M,.5),an=n.top=Nt(Zt*M,.5),on=n.width=Nt(W*M,.5),sn=n.height=Nt(K*M,.5)}function _n(){let e=!1,t=0;for(;!e;){t++;let n=$r(t),i=ei(t);e=t==3||n&&i,e||(gn(r.width,r.height),ln=!0)}}function vn({width:e,height:t}){hn(e,t)}r.setSize=vn;function yn(){let e=!1,t=!1,n=!1,r=!1;y.forEach((i,a)=>{if(i.show&&i._show){let{side:a,_size:o}=i,s=a%2,c=o+(i.label==null?0:i.labelSize);c>0&&(s?(W-=c,a==3?(Xt+=c,r=!0):n=!0):(K-=c,a==0?(Zt+=c,e=!0):t=!0))}}),Kn[0]=e,Kn[1]=n,Kn[2]=t,Kn[3]=r,W-=Zn[1]+Zn[3],Xt+=Zn[3],K-=Zn[2]+Zn[0],Zt+=Zn[0]}function Sn(){let e=Xt+W,t=Zt+K,n=Xt,r=Zt;function i(i,a){switch(i){case 1:return e+=a,e-a;case 2:return t+=a,t-a;case 3:return n-=a,n+a;case 0:return r-=a,r+a}}y.forEach((e,t)=>{if(e.show&&e._show){let t=e.side;e._pos=i(t,e._size),e.label!=null&&(e._lpos=i(t,e.labelSize))}})}if(I.dataIdx==null){let e=I.hover,n=e.skip=new Set(e.skip??[]);n.add(void 0);let r=e.prox=H(e.prox),i=e.bias??=0;I.dataIdx=(e,a,o,s)=>{if(a==0)return o;let c=o,l=r(e,a,o,s)??V,u=l>=0&&l<V,d=j.ori==0?W:K,f=I.left,p=t[0],m=t[a];if(n.has(m[o])){c=null;let e=null,t=null,r;if(i==0||i==-1)for(r=o;e==null&&r-->0;)n.has(m[r])||(e=r);if(i==0||i==1)for(r=o;t==null&&r++<m.length;)n.has(m[r])||(t=r);if(e!=null||t!=null){if(u){let n=e==null?-1/0:Pe(p[e],j,d,0),r=t==null?1/0:Pe(p[t],j,d,0),i=f-n,a=r-f;i<=a?i<=l&&(c=e):a<=l&&(c=t)}else c=t==null?e:e==null?t:o-e<=t-o?e:t}}else u&&z(f-Pe(p[o],j,d,0))>l&&(c=null);return c}}let Cn=e=>{I.event=e};I.idxs=Ze,I._lock=!1;let wn=I.points;wn.show=H(wn.show),wn.size=H(wn.size),wn.stroke=H(wn.stroke),wn.width=H(wn.width),wn.fill=H(wn.fill);let Tn=r.focus=G({},e.focus||{alpha:.3},I.focus),En=Tn.prox>=0,Dn=En&&wn.one,On=[],kn=[],An=[];function jn(e,t){let n=wn.show(r,t);if(n instanceof HTMLElement)return Ie(n,ae),Ie(n,e.class),Be(n,-10,-10,W,K),m.insertBefore(n,On[t]),n}function q(e,t){if(i==1||t>0){let t=i==1&&b[e.scale].time,n=e.value;e.value=t?Gt(n)?Gn(Ve,Un(n,Ue)):n||Xe:n||wr,e.label=e.label||(t?dr:ur)}if(Dn||t>0){e.width=e.width==null?1:e.width,e.paths=e.paths||_i||Ot,e.fillTo=H(e.fillTo||Vr),e.pxAlign=+L(e.pxAlign,h),e.pxRound=Kr(e.pxAlign),e.stroke=H(e.stroke||null),e.fill=H(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=Er(ht(1,e.width),1),n=e.points=G({},{size:t,width:ht(1,t*.2),stroke:e.stroke,space:t*2,paths:vi,_stroke:null,_fill:null},e.points);n.show=H(n.show),n.filter=H(n.filter),n.fill=H(n.fill),n.stroke=H(n.stroke),n.paths=H(n.paths),n.pxAlign=e.pxAlign}if(Qe){let n=Mt(e,t);R.splice(t,0,n[0]),ft.splice(t,0,n[1]),F.values.push(null)}if(it){Ze.splice(t,0,null);let n=null;Dn?t==0&&(n=jn(e,t)):t>0&&(n=jn(e,t)),On.splice(t,0,n),kn.splice(t,0,0),An.splice(t,0,0)}Oa(`addSeries`,t)}function Mn(e,t){t??=v.length,e=i==1?xi(e,t,fr,jr):xi(e,t,{},Ar),v.splice(t,0,e),q(v[t],t)}r.addSeries=Mn;function Hn(e){if(v.splice(e,1),Qe){F.values.splice(e,1),ft.splice(e,1);let t=R.splice(e,1)[0];Rt(null,t.firstChild),t.remove()}it&&(Ze.splice(e,1),On.splice(e,1)[0].remove(),kn.splice(e,1),An.splice(e,1)),Oa(`delSeries`,e)}r.delSeries=Hn;let Kn=[!1,!1,!1,!1];function qn(e,t){if(e._show=e.show,e.show){let n=e.side%2,i=b[e.scale];i??=(e.scale=n?v[1].scale:S,b[e.scale]);let a=i.time;e.size=H(e.size),e.space=H(e.space),e.rotate=H(e.rotate),Ht(e.incrs)&&e.incrs.forEach(e=>{!It.has(e)&&It.set(e,Lt(e))}),e.incrs=H(e.incrs||(i.distr==2?bn:a?_==1?Nn:In:xn)),e.splits=H(e.splits||(a&&i.distr==1?Ge:i.distr==3?hr:i.distr==4?gr:mr)),e.stroke=H(e.stroke),e.grid.stroke=H(e.grid.stroke),e.ticks.stroke=H(e.ticks.stroke),e.border.stroke=H(e.border.stroke);let o=e.values;e.values=Ht(o)&&!Ht(o[0])?H(o):a?Ht(o)?Bn(Ve,zn(o,Ue)):Gt(o)?Vn(Ve,o):o||Ke:o||pr,e.filter=H(e.filter||(i.distr>=3&&i.log==10?Sr:i.distr==3&&i.log==2?Cr:Dt)),e.font=Ai(e.font),e.labelFont=Ai(e.labelFont),e._size=e.size(r,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(Kn[t]=!0,e._el=ze(te,f))}}function Yn(e,t,n,r){let[i,a,o,s]=n,c=t%2,l=0;return c==0&&(s||a)&&(l=t==0&&!i||t==2&&!o?B(lr.size/3):0),c==1&&(i||o)&&(l=t==1&&!a||t==3&&!s?B(Tr.size/2):0),l}let Xn=r.padding=(e.padding||[Yn,Yn,Yn,Yn]).map(e=>H(L(e,Yn))),Zn=r._padding=Xn.map((e,t)=>e(r,t,Kn,0)),Qn,J=null,Y=null,$n=i==1?v[0].idxs:null,er=null,nr=!1;function rr(e,n){if(t=e??[],r.data=r._data=t,i==2){Qn=0;for(let e=1;e<v.length;e++)Qn+=t[e][0].length}else{t.length==0&&(r.data=r._data=t=[[]]),er=t[0],Qn=er.length;let e=t;if(Ne==2){e=t.slice();let n=e[0]=Array(Qn);for(let e=0;e<Qn;e++)n[e]=e}r._data=t=e}if(ni(!0),Oa(`setData`),Ne==2&&(un=!0),n!==!1){let e=j;e.auto(r,nr)?ir():Wi(S,e.min,e.max),dn||=I.left>=0,mn=!0,si()}}r.setData=rr;function ir(){nr=!0;let e,n;i==1&&(Qn>0?(J=$n[0]=0,Y=$n[1]=Qn-1,e=t[0][J],n=t[0][Y],Ne==2?(e=J,n=Y):e==n&&(Ne==3?[e,n]=et(e,e,j.log,!1):Ne==4?[e,n]=tt(e,e,j.log,!1):j.time?n=e+B(86400/_):[e,n]=ot(e,n,nt,!0))):(J=$n[0]=e=null,Y=$n[1]=n=null)),Wi(S,e,n)}let ar,or,sr,cr,_r,vr,yr,br,xr,Dr;function Or(e,t,n,r,i,a){e??=ye,n??=Bt,r??=`butt`,i??=ye,a??=`round`,e!=ar&&(d.strokeStyle=ar=e),i!=or&&(d.fillStyle=or=i),t!=sr&&(d.lineWidth=sr=t),a!=_r&&(d.lineJoin=_r=a),r!=vr&&(d.lineCap=vr=r),n!=cr&&d.setLineDash(cr=n)}function kr(e,t,n,r){t!=or&&(d.fillStyle=or=t),e!=yr&&(d.font=yr=e),n!=br&&(d.textAlign=br=n),r!=xr&&(d.textBaseline=xr=r)}function Fr(e,t,n,i,a=0){if(i.length>0&&e.auto(r,nr)&&(t==null||t.min==null)){let t=L(J,0),r=L(Y,i.length-1),o=n.min==null?$e(i,t,r,a,e.distr==3):[n.min,n.max];e.min=mt(e.min,n.min=o[0]),e.max=ht(e.max,n.max=o[1])}}let zr={min:null,max:null};function Br(){for(let e in b){let t=b[e];P[e]==null&&(t.min==null||P[S]!=null&&t.auto(r,nr))&&(P[e]=zr)}for(let e in b){let t=b[e];P[e]==null&&t.from!=null&&P[t.from]!=null&&(P[e]=zr)}P[S]!=null&&ni(!0);let e={};for(let t in P){let n=P[t];if(n!=null){let a=e[t]=Yt(b[t],qt);if(n.min!=null)G(a,n);else if(t!=S||i==2){if(Qn==0&&a.from==null){let e=a.range(r,null,null,t);a.min=e[0],a.max=e[1]}else a.min=V,a.max=-1/0}}}if(Qn>0){v.forEach((n,a)=>{if(i==1){let i=n.scale,o=P[i];if(o==null)return;let s=e[i];if(a==0){let e=s.range(r,s.min,s.max,i);s.min=e[0],s.max=e[1],J=Ye(s.min,t[0]),Y=Ye(s.max,t[0]),Y-J>1&&(t[0][J]<s.min&&J++,t[0][Y]>s.max&&Y--),n.min=er[J],n.max=er[Y]}else n.show&&n.auto&&Fr(s,o,n,t[a],n.sorted);n.idxs[0]=J,n.idxs[1]=Y}else if(a>0&&n.show&&n.auto){let[r,i]=n.facets,o=r.scale,s=i.scale,[c,l]=t[a],u=e[o],d=e[s];u!=null&&Fr(u,P[o],r,c,r.sorted),d!=null&&Fr(d,P[s],i,l,i.sorted),n.min=i.min,n.max=i.max}});for(let t in e){let n=e[t],i=P[t];if(n.from==null&&(i==null||i.min==null)){let e=n.range(r,n.min==V?null:n.min,n.max==-1/0?null:n.max,t);n.min=e[0],n.max=e[1]}}}for(let t in e){let n=e[t];if(n.from!=null){let i=e[n.from];if(i.min==null)n.min=n.max=null;else{let e=n.range(r,i.min,i.max,t);n.min=e[0],n.max=e[1]}}}let n={},a=!1;for(let t in e){let r=e[t],i=b[t];if(i.min!=r.min||i.max!=r.max){i.min=r.min,i.max=r.max;let e=i.distr;i._min=e==3?vt(i.min):e==4?xt(i.min,i.asinh):e==100?i.fwd(i.min):i.min,i._max=e==3?vt(i.max):e==4?xt(i.max,i.asinh):e==100?i.fwd(i.max):i.max,n[t]=a=!0}}if(a){v.forEach((e,t)=>{i==2?t>0&&n.y&&(e._paths=null):n[e.scale]&&(e._paths=null)});for(let e in n)un=!0,Oa(`setScale`,e);it&&I.left>=0&&(dn=mn=!0)}for(let e in P)P[e]=null}function Hr(e){let t=Ct(J-1,0,Qn-1),n=Ct(Y+1,0,Qn-1);for(;e[t]==null&&t>0;)t--;for(;e[n]==null&&n<Qn-1;)n++;return[t,n]}function Ur(){if(Qn>0){let e=v.some(e=>e._focus)&&Dr!=Tn.alpha;e&&(d.globalAlpha=Dr=Tn.alpha),v.forEach((e,n)=>{if(n>0&&e.show&&(Wr(n,!1),Wr(n,!0),e._paths==null)){let a=Dr;Dr!=e.alpha&&(d.globalAlpha=Dr=e.alpha);let o=i==2?[0,t[n][0].length-1]:Hr(t[n]);e._paths=e.paths(r,n,o[0],o[1]),Dr!=a&&(d.globalAlpha=Dr=a)}}),v.forEach((e,t)=>{if(t>0&&e.show){let n=Dr;Dr!=e.alpha&&(d.globalAlpha=Dr=e.alpha),e._paths!=null&&Gr(t,!1);{let n=e._paths==null?null:e._paths.gaps,i=e.points.show(r,t,J,Y,n),a=e.points.filter(r,t,i,n);(i||a)&&(e.points._paths=e.points.paths(r,t,J,Y,a),Gr(t,!0))}Dr!=n&&(d.globalAlpha=Dr=n),Oa(`drawSeries`,t)}}),e&&(d.globalAlpha=Dr=1)}}function Wr(e,t){let n=t?v[e].points:v[e];n._stroke=n.stroke(r,e),n._fill=n.fill(r,e)}function Gr(e,t){let n=t?v[e].points:v[e],{stroke:r,fill:i,clip:a,flags:o,_stroke:s=n._stroke,_fill:c=n._fill,_width:l=n.width}=n._paths;l=U(l*M,3);let u=null,f=l%2/2;t&&c==null&&(c=l>0?`#fff`:s);let p=n.pxAlign==1&&f>0;if(p&&d.translate(f,f),!t){let e=rn-l/2,t=an-l/2,n=on+l,r=sn+l;u=new Path2D,u.rect(e,t,n,r)}t?Jr(s,l,n.dash,n.cap,c,r,i,o,a):qr(e,s,l,n.dash,n.cap,c,r,i,o,u,a),p&&d.translate(-f,-f)}function qr(e,n,i,a,o,s,c,l,u,d,f){let p=!1;u!=0&&x.forEach((m,h)=>{if(m.series[0]==e){let e=v[m.series[1]],g=t[m.series[1]],_=(e._paths||zt).band;Ht(_)&&(_=m.dir==1?_[0]:_[1]);let y,b=null;e.show&&_&&st(g,J,Y)?(b=m.fill(r,h)||s,y=e._paths.clip):_=null,Jr(n,i,a,o,b,c,l,u,d,f,y,_),p=!0}}),p||Jr(n,i,a,o,s,c,l,u,d,f)}function Jr(e,t,n,r,i,a,o,s,c,l,u,f){Or(e,t,n,r,i),(c||l||f)&&(d.save(),c&&d.clip(c),l&&d.clip(l)),f?(s&3)==3?(d.clip(f),u&&d.clip(u),Xr(i,o),Yr(e,a,t)):s&Rr?(Xr(i,o),d.clip(f),Yr(e,a,t)):s&Lr&&(d.save(),d.clip(f),u&&d.clip(u),Xr(i,o),d.restore(),Yr(e,a,t)):(Xr(i,o),Yr(e,a,t)),(c||l||f)&&d.restore()}function Yr(e,t,n){n>0&&(t instanceof Map?t.forEach((e,t)=>{d.strokeStyle=ar=t,d.stroke(e)}):t!=null&&e&&d.stroke(t))}function Xr(e,t){t instanceof Map?t.forEach((e,t)=>{d.fillStyle=or=t,d.fill(e)}):t!=null&&e&&d.fill(t)}function Zr(e,t,n,i){let a=y[e],o;if(i<=0)o=[0,0];else{let s=a._space=a.space(r,e,t,n,i);o=ki(t,n,a._incrs=a.incrs(r,e,t,n,i,s),i,s)}return a._found=o}function Qr(e,t,n,r,i,a,o,s,c,l){let u=o%2/2;h==1&&d.translate(u,u),Or(s,o,c,l,s),d.beginPath();let f,p,m,g,_=i+(r==0||r==3?-a:a);n==0?(p=i,g=_):(f=i,m=_);for(let r=0;r<e.length;r++)t[r]!=null&&(n==0?f=m=e[r]:p=g=e[r],d.moveTo(f,p),d.lineTo(m,g));d.stroke(),h==1&&d.translate(-u,-u)}function $r(e){let t=!0;return y.forEach((n,i)=>{if(!n.show)return;let a=b[n.scale];if(a.min==null){n._show&&(t=!1,n._show=!1,ni(!1));return}n._show||(t=!1,n._show=!0,ni(!1));let o=n.side,s=o%2,{min:c,max:l}=a,[u,d]=Zr(i,c,l,s==0?W:K);if(d==0)return;let f=a.distr==2,p=n._splits=n.splits(r,i,c,l,u,d,f),m=a.distr==2?p.map(e=>er[e]):p,h=a.distr==2?er[p[1]]-er[p[0]]:u,g=n._values=n.values(r,n.filter(r,m,i,d,h),i,d,h);n._rotate=o==2?n.rotate(r,g,i,d):0;let _=n._size;n._size=pt(n.size(r,g,i,e)),_!=null&&n._size!=_&&(t=!1)}),t}function ei(e){let t=!0;return Xn.forEach((n,i)=>{let a=n(r,i,Kn,e);a!=Zn[i]&&(t=!1),Zn[i]=a}),t}function ti(){for(let e=0;e<y.length;e++){let t=y[e];if(!t.show||!t._show)continue;let n=t.side,i=n%2,a,o,c=t.stroke(r,e),l=n==0||n==3?-1:1,[u,f]=t._found;if(t.label!=null){let s=t.labelGap*l,p=B((t._lpos+s)*M);kr(t.labelFont[0],c,`center`,n==2?me:he),d.save(),i==1?(a=o=0,d.translate(p,B(an+sn/2)),d.rotate((n==3?-dt:dt)/2)):(a=B(rn+on/2),o=p);let m=wt(t.label)?t.label(r,e,u,f):t.label;d.fillText(m,a,o),d.restore()}if(f==0)continue;let p=b[t.scale],m=i==0?on:sn,h=i==0?rn:an,_=t._splits,v=p.distr==2?_.map(e=>er[e]):_,x=p.distr==2?er[_[1]]-er[_[0]]:u,S=t.ticks,C=t.border,w=S.show?S.size:0,T=B(w*M),E=B((t.alignTo==2?t._size-w-t.gap:t.gap)*M),D=t._rotate*-dt/180,O=g(t._pos*M),ee=O+(T+E)*l;o=i==0?ee:0,a=i==1?ee:0;let te=t.font[0];kr(te,c,t.align==1?ge:t.align==2?_e:D>0?ge:D<0?_e:i==0?`center`:n==3?_e:ge,D||i==1?`middle`:n==2?me:he);let k=t.font[1]*t.lineGap,ne=_.map(e=>g(s(e,p,m,h))),re=t._values;for(let e=0;e<re.length;e++){let t=re[e];if(t!=null){i==0?a=ne[e]:o=ne[e],t=``+t;let n=t.indexOf(`
|
|
3
|
+
`)==-1?[t]:t.split(/\n/gm);for(let e=0;e<n.length;e++){let t=n[e];D?(d.save(),d.translate(a,o+e*k),d.rotate(D),d.fillText(t,0,0),d.restore()):d.fillText(t,a,o+e*k)}}}S.show&&Qr(ne,S.filter(r,v,e,f,x),i,n,O,T,U(S.width*M,3),S.stroke(r,e),S.dash,S.cap);let ie=t.grid;ie.show&&Qr(ne,ie.filter(r,v,e,f,x),i,i==0?2:1,i==0?an:rn,i==0?sn:on,U(ie.width*M,3),ie.stroke(r,e),ie.dash,ie.cap),C.show&&Qr([O],[1],+(i==0),i==0?1:2,i==1?an:rn,i==1?sn:on,U(C.width*M,3),C.stroke(r,e),C.dash,C.cap)}Oa(`drawAxes`)}function ni(e){v.forEach((t,n)=>{n>0&&(t._paths=null,e&&(i==1?(t.min=null,t.max=null):t.facets.forEach(e=>{e.min=null,e.max=null})))})}let ri=!1,ii=!1,ai=[];function oi(){ii=!1;for(let e=0;e<ai.length;e++)Oa(...ai[e]);ai.length=0}function si(){ri||=(en(li),!0)}function ci(e,t=!1){ri=!0,ii=t,e(r),li(),t&&ai.length>0&&queueMicrotask(oi)}r.batch=ci;function li(){if(cn&&=(Br(),!1),un&&=(_n(),!1),ln){if(N(p,ge,Xt),N(p,me,Zt),N(p,A,W),N(p,pe,K),N(m,ge,Xt),N(m,me,Zt),N(m,A,W),N(m,pe,K),N(f,A,Ut),N(f,pe,Jt),u.width=B(Ut*M),u.height=B(Jt*M),y.forEach(({_el:e,_show:t,_size:n,_pos:r,side:i})=>{if(e!=null){if(t){let t=i===3||i===0?n:0,a=i%2==1;N(e,a?`left`:`top`,r-t),N(e,a?`width`:`height`,n),N(e,a?`top`:`left`,a?Zt:Xt),N(e,a?`height`:`width`,a?K:W),Le(e,k)}else Ie(e,k)}}),ar=or=sr=_r=vr=yr=br=xr=cr=null,Dr=1,fa(!0),Xt!=Qt||Zt!=$t||W!=tn||K!=nn){ni(!1);let e=W/tn,t=K/nn;if(it&&!dn&&I.left>=0){I.left*=e,I.top*=t,pi&&Be(pi,B(I.left),0,W,K),mi&&Be(mi,0,B(I.top),W,K);for(let n=0;n<On.length;n++){let r=On[n];r!=null&&(kn[n]*=e,An[n]*=t,Be(r,pt(kn[n]),pt(An[n]),W,K))}}if(Q.show&&!fn&&Q.left>=0&&Q.width>0){Q.left*=e,Q.width*=e,Q.top*=t,Q.height*=t;for(let e in ha)N(Vi,e,Q[e])}Qt=Xt,$t=Zt,tn=W,nn=K}Oa(`setSize`),ln=!1}Ut>0&&Jt>0&&(d.clearRect(0,0,u.width,u.height),Oa(`drawClear`),Ee.forEach(e=>e()),Oa(`draw`)),Q.show&&fn&&(Hi(Q),fn=!1),it&&dn&&(ua(null,!0,!1),dn=!1),F.show&&F.live&&mn&&(ca(),mn=!1),c||(c=!0,r.status=1,Oa(`ready`)),nr=!1,ri=!1}r.redraw=(e,t)=>{un=t||!1,e===!1?si():Wi(S,j.min,j.max)};function ui(e,n){let i=b[e];if(i.from==null){if(Qn==0){let t=i.range(r,n.min,n.max,e);n.min=t[0],n.max=t[1]}if(n.min>n.max){let e=n.min;n.min=n.max,n.max=e}if(Qn>1&&n.min!=null&&n.max!=null&&n.max-n.min<1e-16)return;e==S&&i.distr==2&&Qn>0&&(n.min=Ye(n.min,t[0]),n.max=Ye(n.max,t[0]),n.min==n.max&&n.max++),P[e]=n,cn=!0,si()}}r.setScale=ui;let di,fi,pi,mi,gi,Mi,Ni,Pi,Fi,Ii,X,Z,Li=!1,Ri=I.drag,zi=Ri.x,Bi=Ri.y;it&&(I.x&&(di=ze(re,m)),I.y&&(fi=ze(ie,m)),j.ori==0?(pi=di,mi=fi):(pi=fi,mi=di),X=I.left,Z=I.top);let Q=r.select=G({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Vi=Q.show?ze(ne,Q.over?m:p):null;function Hi(e,t){if(Q.show){for(let t in e)Q[t]=e[t],t in ha&&N(Vi,t,e[t]);t!==!1&&Oa(`setSelect`)}}r.setSelect=Hi;function Ui(e){if(v[e].show)Qe&&Le(R[e],k);else if(Qe&&Ie(R[e],k),it){let t=Dn?On[0]:On[e];t!=null&&Be(t,-10,-10,W,K)}}function Wi(e,t,n){ui(e,{min:t,max:n})}function Gi(e,t,n,a){t.focus!=null&&ea(e),t.show!=null&&v.forEach((n,r)=>{r>0&&(e==r||e==null)&&(n.show=t.show,Ui(r),i==2?(Wi(n.facets[0].scale,null,null),Wi(n.facets[1].scale,null,null)):Wi(n.scale,null,null),si())}),n!==!1&&Oa(`setSeries`,e,t),a&&Ma(`setSeries`,r,e,t)}r.setSeries=Gi;function Ki(e,t){G(x[e],t)}function qi(e,t){e.fill=H(e.fill||null),e.dir=L(e.dir,-1),t??=x.length,x.splice(t,0,e)}function Ji(e){e==null?x.length=0:x.splice(e,1)}r.addBand=qi,r.setBand=Ki,r.delBand=Ji;function Yi(e,t){v[e].alpha=t,it&&On[e]!=null&&(On[e].style.opacity=t),Qe&&R[e]&&(R[e].style.opacity=t)}let Xi,Zi,Qi,$i={focus:!0};function ea(e){if(e!=Qi){let t=e==null,n=Tn.alpha!=1;v.forEach((r,a)=>{if(i==1||a>0){let i=t||a==0||a==e;r._focus=t?null:i,n&&Yi(a,i?1:Tn.alpha)}}),Qi=e,n&&si()}}Qe&&En&&Ft(we,ct,e=>{I._lock||(Cn(e),Qi!=null&&Gi(null,$i,!0,$.setSeries))});function ta(e,t,n){let r=b[t];n&&(e=e/M-(r.ori==1?Zt:Xt));let i=W;r.ori==1&&(i=K,e=i-e),r.dir==-1&&(e=i-e);let a=r._min,o=r._max,s=e/i,c=a+(o-a)*s,l=r.distr;return l==3?gt(10,c):l==4?bt(c,r.asinh):l==100?r.bwd(c):c}function na(e,n){return Ye(ta(e,S,n),t[0],J,Y)}r.valToIdx=e=>Ye(e,t[0]),r.posToIdx=na,r.posToVal=ta,r.valToPos=(e,t,n)=>b[t].ori==0?a(e,b[t],n?on:W,n?rn:0):o(e,b[t],n?sn:K,n?an:0),r.setCursor=(e,t,n)=>{X=e.left,Z=e.top,ua(null,t,n)};function ra(e,t){N(Vi,ge,Q.left=e),N(Vi,A,Q.width=t)}function ia(e,t){N(Vi,me,Q.top=e),N(Vi,pe,Q.height=t)}let aa=j.ori==0?ra:ia,oa=j.ori==1?ra:ia;function sa(){if(Qe&&F.live)for(let e=+(i==2);e<v.length;e++){if(e==0&&yt)continue;let t=F.values[e],n=0;for(let r in t)ft[e][n++].firstChild.nodeValue=t[r]}}function ca(e,t){if(e!=null&&(e.idxs?e.idxs.forEach((e,t)=>{Ze[t]=e}):Wt(e.idx)||Ze.fill(e.idx),F.idx=Ze[0]),Qe&&F.live){for(let e=0;e<v.length;e++)(e>0||i==1&&!yt)&&la(e,Ze[e]);sa()}mn=!1,t!==!1&&Oa(`setLegend`)}r.setLegend=ca;function la(e,n){let i=v[e],a=e==0&&Ne==2?er:t[e],o;yt?o=i.values(r,e,n)??St:(o=i.value(r,n==null?null:a[n],e,n),o=o==null?St:{_:o}),F.values[e]=o}function ua(e,n,a){Fi=X,Ii=Z,[X,Z]=I.move(r,X,Z),I.left=X,I.top=Z,it&&(pi&&Be(pi,B(X),0,W,K),mi&&Be(mi,0,B(Z),W,K));let o,s=J>Y;Xi=V,Zi=null;let c=j.ori==0?W:K,l=j.ori==1?W:K;if(X<0||Qn==0||s){o=I.idx=null;for(let e=0;e<v.length;e++){let t=On[e];t!=null&&Be(t,-10,-10,W,K)}En&&Gi(null,$i,!0,e==null&&$.setSeries),F.live&&(Ze.fill(o),mn=!0)}else{let e,n,a;i==1&&(e=j.ori==0?X:Z,n=ta(e,S),o=I.idx=Ye(n,t[0],J,Y),a=Pe(t[0][o],j,c,0));let s=-10,u=-10,d=0,f=0,p=!0,m=``,h=``;for(let e=+(i==2);e<v.length;e++){let g=v[e],_=Ze[e],y=_==null?null:i==1?t[e][_]:t[e][1][_],x=I.dataIdx(r,e,o,n),S=x==null?null:i==1?t[e][x]:t[e][1][x];if(mn=mn||S!=y||x!=_,Ze[e]=x,e>0&&g.show){let n=x==null?-10:x==o?a:Pe(i==1?t[0][x]:t[e][0][x],j,c,0),_=S==null?-10:Fe(S,i==1?b[g.scale]:b[g.facets[1].scale],l,0);if(En&&S!=null){let t=j.ori==1?X:Z,n=z(Tn.dist(r,e,x,_,t));if(n<Xi){let r=Tn.bias;if(r!=0){let i=ta(t,g.scale),a=S>=0?1:-1,o=i>=0?1:-1;o==a&&(o==1?r==1?S>=i:S<=i:r==1?S<=i:S>=i)&&(Xi=n,Zi=e)}else Xi=n,Zi=e}}if(mn||Dn){let t,i;j.ori==0?(t=n,i=_):(t=_,i=n);let a,o,c,l,g,v,y=!0,b=wn.bbox;if(b!=null){y=!1;let t=b(r,e);c=t.left,l=t.top,a=t.width,o=t.height}else c=t,l=i,a=o=wn.size(r,e);if(v=wn.fill(r,e),g=wn.stroke(r,e),Dn)e==Zi&&Xi<=Tn.prox&&(s=c,u=l,d=a,f=o,p=y,m=v,h=g);else{let t=On[e];t!=null&&(kn[e]=c,An[e]=l,We(t,a,o,y),He(t,v,g),Be(t,pt(c),pt(l),W,K))}}}}if(Dn){let e=Tn.prox;if(mn||(Qi==null?Xi<=e:Xi>e||Zi!=Qi)){let e=On[0];e!=null&&(kn[0]=s,An[0]=u,We(e,d,f,p),He(e,m,h),Be(e,pt(s),pt(u),W,K))}}}if(Q.show&&Li){if(e!=null){let[t,n]=$.scales,[r,i]=$.match,[a,o]=e.cursor.sync.scales,s=e.cursor.drag;if(zi=s._x,Bi=s._y,zi||Bi){let{left:s,top:u,width:d,height:f}=e.select,p=e.scales[a].ori,m=e.posToVal,h,g,_,v,y,x=t!=null&&r(t,a),S=n!=null&&i(n,o);x&&zi?(p==0?(h=s,g=d):(h=u,g=f),_=b[t],v=Pe(m(h,a),_,c,0),y=Pe(m(h+g,a),_,c,0),aa(mt(v,y),z(y-v))):aa(0,c),S&&Bi?(p==1?(h=s,g=d):(h=u,g=f),_=b[n],v=Fe(m(h,o),_,l,0),y=Fe(m(h+g,o),_,l,0),oa(mt(v,y),z(y-v))):oa(0,l)}else ga()}else{let e=z(Fi-gi),t=z(Ii-Mi);if(j.ori==1){let n=e;e=t,t=n}zi=Ri.x&&e>=Ri.dist,Bi=Ri.y&&t>=Ri.dist;let n=Ri.uni;n==null?Ri.x&&Ri.y&&(zi||Bi)&&(zi=Bi=!0):zi&&Bi&&(zi=e>=n,Bi=t>=n,!zi&&!Bi&&(t>e?Bi=!0:zi=!0));let r,i;zi&&(j.ori==0?(r=Ni,i=X):(r=Pi,i=Z),aa(mt(r,i),z(i-r)),Bi||oa(0,l)),Bi&&(j.ori==1?(r=Ni,i=X):(r=Pi,i=Z),oa(mt(r,i),z(i-r)),zi||aa(0,c)),!zi&&!Bi&&(aa(0,0),oa(0,0))}}if(Ri._x=zi,Ri._y=Bi,e==null){if(a){if(Aa!=null){let[e,t]=$.scales;$.values[0]=e==null?null:ta(j.ori==0?X:Z,e),$.values[1]=t==null?null:ta(j.ori==1?X:Z,t)}Ma(be,r,X,Z,W,K,o)}if(En){let e=a&&$.setSeries,t=Tn.prox;Qi==null?Xi<=t&&Gi(Zi,$i,!0,e):Xi>t?Gi(null,$i,!0,e):Zi!=Qi&&Gi(Zi,$i,!0,e)}}mn&&(F.idx=o,ca()),n!==!1&&Oa(`setCursor`)}let da=null;Object.defineProperty(r,"rect",{get(){return da??fa(!1),da}});function fa(e=!1){e?da=null:(da=m.getBoundingClientRect(),Oa(`syncRect`,da))}function pa(e,t,n,r,i,a,o){I._lock||Li&&e!=null&&e.movementX==0&&e.movementY==0||(ma(e,t,n,r,i,a,o,!1,e!=null),e==null?ua(t,!0,!1):ua(null,!0,!0))}function ma(e,t,n,i,a,o,c,l,u){if(da??fa(!1),Cn(e),e!=null)n=e.clientX-da.left,i=e.clientY-da.top;else{if(n<0||i<0){X=-10,Z=-10;return}let[e,r]=$.scales,c=t.cursor.sync,[l,u]=c.values,[d,f]=c.scales,[p,m]=$.match,h=t.axes[0].side%2==1,g=j.ori==0?W:K,_=j.ori==1?W:K,v=h?o:a,y=h?a:o,x=h?i:n,S=h?n:i;if(n=d==null?x/v*g:p(e,d)?s(l,b[e],g,0):-10,i=f==null?S/y*_:m(r,f)?s(u,b[r],_,0):-10,j.ori==1){let e=n;n=i,i=e}}u&&(t==null||t.cursor.event.type==be)&&((n<=1||n>=W-1)&&(n=Nt(n,W)),(i<=1||i>=K-1)&&(i=Nt(i,K))),l?(gi=n,Mi=i,[Ni,Pi]=I.move(r,n,i)):(X=n,Z=i)}let ha={width:0,height:0,left:0,top:0};function ga(){Hi(ha,!1)}let _a,va,ya,ba;function xa(e,t,n,i,a,o,s){Li=!0,zi=Bi=Ri._x=Ri._y=!1,ma(e,t,n,i,a,o,s,!0,!1),e!=null&&(Ft(Se,je,Sa,!1),Ma(xe,r,Ni,Pi,W,K,null));let{left:c,top:l,width:u,height:d}=Q;_a=c,va=l,ya=u,ba=d}function Sa(e,t,n,i,a,o,s){Li=Ri._x=Ri._y=!1,ma(e,t,n,i,a,o,s,!1,!0);let{left:c,top:l,width:u,height:d}=Q,f=u>0||d>0,p=_a!=c||va!=l||ya!=u||ba!=d;if(f&&p&&Hi(Q),Ri.setScale&&f&&p){let e=c,t=u,n=l,r=d;if(j.ori==1&&(e=l,t=d,n=c,r=u),zi&&Wi(S,ta(e,S),ta(e+t,S)),Bi)for(let e in b){let t=b[e];e!=S&&t.from==null&&t.min!=V&&Wi(e,ta(n+r,e),ta(n,e))}ga()}else I.lock&&(I._lock=!I._lock,ua(t,!0,e!=null));e!=null&&(Rt(Se,je),Ma(Se,r,X,Z,W,K,null))}function Ca(e,t,n,r,i,a,o){if(I._lock)return;Cn(e);let s=Li;if(Li){let e=!0,t=!0,n,r;j.ori==0?(n=zi,r=Bi):(n=Bi,r=zi),n&&r&&(e=X<=10||X>=W-10,t=Z<=10||Z>=K-10),n&&e&&(X=X<Ni?0:W),r&&t&&(Z=Z<Pi?0:K),ua(null,!0,!0),Li=!1}X=-10,Z=-10,Ze.fill(null),ua(null,!0,!0),s&&(Li=s)}function wa(e,t,n,i,a,o,s){I._lock||(Cn(e),ir(),ga(),e!=null&&Ma(Te,r,X,Z,W,K,null))}function Ta(){y.forEach(ji),hn(r.width,r.height,!0)}qe(ke,Me,Ta);let Ea={};Ea.mousedown=xa,Ea.mousemove=pa,Ea.mouseup=Sa,Ea.dblclick=wa,Ea.setSeries=(e,t,n,i)=>{let a=$.match[2];n=a(r,t,n),n!=-1&&Gi(n,i,!0,!1)},it&&(Ft(xe,m,xa),Ft(be,m,pa),Ft(Ce,m,e=>{Cn(e),fa(!1)}),Ft(we,m,Ca),Ft(Te,m,wa),hi.add(r),r.syncRect=fa);let Da=r.hooks=e.hooks||{};function Oa(e,t,n){ii?ai.push([e,t,n]):e in Da&&Da[e].forEach(e=>{e.call(null,r,t,n)})}(e.plugins||[]).forEach(e=>{for(let t in e.hooks)Da[t]=(Da[t]||[]).concat(e.hooks[t])});let ka=(e,t,n)=>n,$=G({key:null,setSeries:!1,filters:{pub:kt,sub:kt},scales:[S,v[1]?v[1].scale:null],match:[At,At,ka],values:[null,null]},I.sync);$.match.length==2&&$.match.push(ka),I.sync=$;let Aa=$.key,ja=Ir(Aa);function Ma(e,t,n,r,i,a,o){$.filters.pub(e,t,n,r,i,a,o)&&ja.pub(e,t,n,r,i,a,o)}ja.sub(r);function Na(e,t,n,r,i,a,o){$.filters.sub(e,t,n,r,i,a,o)&&Ea[e](null,t,n,r,i,a,o)}r.pub=Na;function Pa(){ja.unsub(r),hi.delete(r),Pt.clear(),Je(ke,Me,Ta),l.remove(),ct?.remove(),Oa(`destroy`)}r.destroy=Pa;function Fa(){Oa(`init`,e,t),rr(t||e.data,!1),P[S]?ui(S,P[S]):ir(),fn=Q.show&&(Q.width>0||Q.height>0),dn=mn=!0,hn(e.width,e.height)}return v.forEach(q),y.forEach(qn),n?n instanceof HTMLElement?(n.appendChild(l),Fa()):n(r,Fa):Fa(),r}Mi.assign=G,Mi.fmtNum=ut,Mi.rangeNum=ot,Mi.rangeLog=et,Mi.rangeAsinh=tt,Mi.orient=zr,Mi.pxRatio=M,Mi.join=$t,Mi.fmtDate=pn,Mi.tzDate=hn,Mi.sync=Ir;{Mi.addGap=Wr,Mi.clipGaps=Ur;let e=Mi.paths={points:ii};e.linear=ci,e.stepped=li,e.bars=di,e.spline=pi}var Ni=v(`<div class="empty">No burndown data (sprint not started or no start/end date)</div>`),Pi=v(`<tr><td> </td><td> </td><td> </td></tr>`),Fi=v(`<div class="burn-card"><header class="burn-header"><h2> </h2> <div class="meta"><span class="on-track-badge"> </span> <span> </span></div></header> <div class="burn-legend"><span class="k"><i style="background: var(--fg-faint)"></i> Idéal</span> <span class="k"><i style="background: var(--accent)"></i> Réel</span></div> <div class="chart-wrapper svelte-n2xgw7" role="img" aria-describedby="burndown-data-table"></div> <table class="sr-only" id="burndown-data-table" aria-label="Données du burndown"><caption>Burndown — idéal vs réel</caption><thead><tr><th scope="col">Date</th><th scope="col">Points idéal</th><th scope="col">Points réel</th></tr></thead><tbody></tbody></table></div>`),Ii=v(`<div class="view-pad"><div class="burn-wrap"><!></div></div>`);function X(v,S){r(S,!0);let C=e(()=>x(d.burndown?.ideal??[],d.burndown?.actual??[])),w=p(null),T=null,E=e(()=>d.burndown?.ideal?.length>0),D=e(()=>d.burndown?.on_track===`on-track`?`var(--success)`:d.burndown?.on_track===`at-risk`?`var(--warning)`:d.burndown?.on_track===`behind`?`var(--danger)`:`var(--fg-dim)`);t(()=>{if(!b(w)||!b(E)){T&&=(T.destroy(),null);return}let e=getComputedStyle(b(w)),t=(t,n)=>e.getPropertyValue(t).trim()||n,n=t(`--fg-faint`,`#888`),r=t(`--accent`,`#bdf03d`),i=t(`--border-faint`,`#333`),a=d.burndown.ideal.map(e=>({ts:Math.floor(Date.parse(e.date)/1e3),pts:e.points})),o=d.burndown.actual.map(e=>({ts:Math.floor(Date.parse(e.date)/1e3),pts:e.points})),s=new Set([...a.map(e=>e.ts),...o.map(e=>e.ts)]),c=Array.from(s).sort((e,t)=>e-t),l=[c,c.map(e=>a.find(t=>t.ts===e)?.pts??null),c.map(e=>o.find(t=>t.ts===e)?.pts??null)],u={width:b(w).clientWidth||800,height:320,scales:{x:{time:!0}},axes:[{stroke:n,grid:{stroke:i},ticks:{stroke:i},values:(e,t)=>t.map(e=>{let t=new Date(e*1e3);return`${String(t.getDate()).padStart(2,`0`)}/${String(t.getMonth()+1).padStart(2,`0`)}`})},{stroke:n,grid:{stroke:i},ticks:{stroke:i}}],series:[{label:`Date`},{label:`Ideal`,stroke:n,width:1.5,dash:[5,5],points:{show:!1}},{label:`Actual`,stroke:r,width:3,spanGaps:!0,points:{show:!0,size:6,fill:r,stroke:r}}],legend:{show:!0}};T&&T.destroy(),T=new Mi(u,l,b(w));let f=new ResizeObserver(()=>{T&&b(w)&&T.setSize({width:b(w).clientWidth,height:320})});return f.observe(b(w)),()=>{f.disconnect(),T&&=(T.destroy(),null)}});var O=Ii(),ee=y(O),te=y(ee),k=e=>{var t=Ni();l(e,t)},ne=e=>{var t=Fi(),r=y(t),f=y(r),p=y(f,!0);a(f);var h=n(f,2),v=y(h),x=y(v,!0);a(v);var S=n(v,2),T=y(S);a(S),a(h),a(r);var E=n(r,4);_(E,e=>i(w,e),()=>b(w));var O=n(E,2),ee=n(y(O),2);c(ee,21,()=>b(C),g,(e,t)=>{var r=Pi(),i=y(r),s=y(i,!0);a(i);var c=n(i),d=y(c,!0);a(c);var f=n(c),p=y(f,!0);a(f),a(r),o(()=>{u(s,b(t).date),u(d,b(t).ideal??`—`),u(p,b(t).actual??`—`)}),l(e,r)}),a(ee),a(O),a(t),o(()=>{u(p,d.sprint?.name||`Current Sprint`),m(v,`background: color-mix(in oklch, ${b(D)??``} 16%, transparent); color: ${b(D)??``}`),u(x,d.burndown.on_track||`unknown`),u(T,`${d.burndown.total_points??``}p total`),s(E,`aria-label`,`Graphique de burndown du sprint ${(d.sprint?.name||`courant`)??``} : idéal vs réel`)}),l(e,t)};h(te,e=>{!d.burndown||!b(E)?e(k):e(ne,-1)}),a(ee),a(O),l(v,O),f()}export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,M as i,N as a,O as o,P as s,S as c,T as l,b as u,c as d,f,g as p,h as m,j as h,k as g,l as ee,m as _,p as v,r as y,s as b,t as x,u as S,v as C,w,x as T,y as E}from"./index-
|
|
1
|
+
import{A as e,C as t,D as n,E as r,M as i,N as a,O as o,P as s,S as c,T as l,b as u,c as d,f,g as p,h as m,j as h,k as g,l as ee,m as _,p as v,r as y,s as b,t as x,u as S,v as C,w,x as T,y as E}from"./index-DI89vrQ2.js";function D(e=[],t=[],n=[]){let r=new Set(e.map(e=>e.id)),i=t.filter(e=>r.has(e.from)&&r.has(e.to)),a=new Set;for(let e of i)a.add(e.from),a.add(e.to);let o=new Set(n.flat()),s=e.filter(e=>a.has(e.id));return{elements:[...s.map(e=>({data:{id:e.id,label:e.id},classes:o.has(e.id)?`in-cycle`:``})),...i.map(e=>({data:{source:e.from,target:e.to}}))],keptNodes:s,hiddenCount:e.length-s.length,cycleSet:o}}var O=/\b(?:lab|lch|oklab|oklch|color)\(/i;function k(e){return typeof e==`string`&&O.test(e)}function A(e,t){if(!k(e)||!t||typeof t.getImageData!=`function`)return e;t.fillStyle=e,t.fillRect(0,0,1,1);let[n,r,i,a]=t.getImageData(0,0,1,1).data;return a===255?`rgb(${n}, ${r}, ${i})`:`rgba(${n}, ${r}, ${i}, ${+(a/255).toFixed(3)})`}var j=6.7,M=20,N=24;function P(e,{charW:t=j,padX:n=M,min:r=N}={}){return Math.max(r,Math.round(String(e??``).length*t+n))}var F=!1,I=null;function L(){return I||=(async()=>{let[{default:e},{default:t}]=await Promise.all([x(()=>import(`./cytoscape.esm-BaNnhyvu.js`),[]),x(()=>import(`./cytoscape-dagre-Br_seqxP.js`),[])]);return F||=(e.use(t),!0),e})(),I}var R=C(`<div class="empty">Loading dependencies…</div>`),z=C(`<div class="empty" style="color: var(--danger)"> </div>`),B=C(`<div class="empty">No dependencies found</div>`),V=C(`<span class="stat muted" title="Stories sans dépendance — masquées pour garder le graphe lisible"> </span>`),H=C(`<div class="empty">Aucune dépendance entre stories — rien à afficher dans le graphe.</div>`),U=C(`<dt>Epic</dt> <dd class="mono svelte-skjirc"> </dd>`,1),W=C(`<dt>⚠</dt> <dd style="color: var(--danger)" class="svelte-skjirc">Fait partie d'un cycle de dépendances</dd>`,1),G=C(`<aside class="node-details svelte-skjirc"><header class="details-header"><strong class="mono"> </strong> <button class="close-btn svelte-skjirc" aria-label="Fermer">×</button></header> <dl class="svelte-skjirc"><dt>Titre</dt> <dd class="svelte-skjirc"> </dd> <dt>Statut</dt> <dd class="svelte-skjirc"><span class="chip"><i class="swatch"></i> </span></dd> <!> <!></dl></aside>`),K=C(`<div class="deps-content"><div class="deps-canvas" role="img"></div> <!></div>`),q=C(`<li> </li>`),J=C(`<div class="deps-wrap svelte-skjirc"><header class="deps-header"><span class="stat"> </span> <span class="stat"> </span> <span> </span> <!></header> <!> <div class="sr-only"><h2>Dependency edges (text fallback)</h2> <ul></ul></div></div>`),Y=C(`<div class="deps-pad svelte-skjirc"><!></div>`);function X(x,C){i(C,!0);let E=g(null),O=null,k=!1,j=g(n([])),M=g(n([])),N=g(n([])),F=g(null),I=g(!0),X=g(null),Z=e(()=>({nodes:T(j).length,edges:T(M).length,cycles:T(N).length})),Q=e(()=>D(T(j),T(M),T(N)).hiddenCount),te=e=>`var(${y[e]?.cssVar||`--fg-faint`})`;async function ne(){o(I,!0),o(X,null);try{let e=await fetch(`/api/dependencies`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();o(j,t.nodes||[],!0),o(M,t.edges||[],!0),o(N,t.cycles||[],!0)}catch(e){o(X,e.message,!0)}finally{o(I,!1)}}function re(e){return T(N).some(t=>t.includes(e))}t(()=>{ne()});function ie(e){let t=()=>typeof requestIdleCallback==`function`?requestIdleCallback(e,{timeout:1e3}):setTimeout(e,1);document.readyState===`complete`?t():window.addEventListener(`load`,t,{once:!0})}t(()=>{if(!T(E)||T(j).length===0||!T(M)||k)return;k=!0;let e=!1,t=T(E),n=document.createElement(`canvas`).getContext(`2d`),r=e=>A(e,n),i=getComputedStyle(document.documentElement),a=(e,t)=>r(i.getPropertyValue(e).trim()||t),s=e=>a(y[e]?.cssVar||`--fg-faint`,`#888`),c=a(`--bg-inset`,`#111`),l=a(`--border-faint`,`#333`),u=a(`--border-strong`,`#555`),d=a(`--danger`,`#e5484d`),f=a(`--mono`,`monospace`),{elements:p}=D(T(j),T(M),T(N));if(p.length===0){k=!1;return}let m=null;return ie(()=>{e||L().then(n=>{e||(m=n({container:t,elements:p,style:[{selector:`node`,style:{label:`data(label)`,shape:`round-rectangle`,"background-color":e=>{let t=T(j).find(t=>t.id===e.id());return t?s(t.status):`#888`},color:c,"text-valign":`center`,"text-halign":`center`,"font-size":`11px`,"font-weight":`600`,"font-family":f,width:e=>P(e.data(`label`)),height:28,"text-max-width":`200px`,"border-width":1,"border-color":l}},{selector:`node.in-cycle`,style:{"border-width":3,"border-color":d}},{selector:`edge`,style:{width:1.6,"line-color":u,"target-arrow-color":u,"target-arrow-shape":`triangle`,"curve-style":`bezier`}}],layout:{name:`dagre`,rankDir:`LR`,spacingFactor:1.3,nodeDimensionsIncludeLabels:!0,fit:!0,padding:30}}),m.ready(()=>m.fit(void 0,40)),m.on(`tap`,`node`,e=>{let t=T(j).find(t=>t.id===e.target.id());t&&o(F,t,!0)}),O=m)})}),()=>{e=!0,k=!1;let t=O||m;t&&t.destroy(),O=null}});var $=Y(),ae=w($),oe=e=>{var t=R();p(e,t)},se=e=>{var t=z(),n=w(t);s(t),c(()=>m(n,`Error: ${T(X)??``}`)),p(e,t)},ce=e=>{var t=B();p(e,t)},le=t=>{var n=J(),i=w(n),h=w(i),g=w(h);s(h);var x=r(h,2),C=w(x);s(x);var D=r(x,2);let O;var k=w(D);s(D);var A=r(D,2),j=e=>{var t=V(),n=w(t);s(t),c(()=>m(n,`${T(Q)??``} isolée${T(Q)>1?`s`:``} masquée${T(Q)>1?`s`:``}`)),p(e,t)};_(A,e=>{T(Q)>0&&e(j)}),s(i);var N=r(i,2),P=e=>{var t=H();p(e,t)},I=t=>{var n=K(),i=w(n);b(i,e=>o(E,e),()=>T(E));var f=r(i,2),h=t=>{var n=G(),i=w(n),d=w(i),f=w(d,!0);s(d);var h=r(d,2);s(i);var g=r(i,2),v=r(w(g),2),b=w(v,!0);s(v);var x=r(v,4),S=w(x),C=w(S),E=r(C,1,!0);s(S),s(x);var D=r(x,2),O=e=>{var t=U(),n=r(l(t),2),i=w(n,!0);s(n),c(()=>m(i,T(F).epic_id)),p(e,t)};_(D,e=>{T(F).epic_id&&e(O)});var k=r(D,2),A=e=>{var t=W();a(2),p(e,t)},j=e(()=>re(T(F).id));_(k,e=>{T(j)&&e(A)}),s(g),s(n),c(e=>{m(f,T(F).id),m(b,T(F).title||`—`),ee(C,`background: ${e??``}`),m(E,y[T(F).status]?.label||T(F).status)},[()=>te(T(F).status)]),u(`click`,h,()=>o(F,null)),p(t,n)};_(f,e=>{T(F)&&e(h)}),s(n),c(()=>d(i,`aria-label`,`Dependency graph with ${T(Z).nodes??``} nodes, ${T(Z).edges??``} edges, and ${T(Z).cycles??``} cycles`)),p(t,n)};_(N,e=>{T(Z).edges===0?e(P):e(I,-1)});var L=r(N,2),R=r(w(L),2);f(R,21,()=>T(M),v,(e,t)=>{var n=q(),r=w(n);s(n),c(()=>m(r,`${T(t).to??``} depends on ${T(t).from??``}`)),p(e,n)}),s(R),s(L),s(n),c(()=>{m(g,`Nodes: ${T(Z).nodes??``}`),m(C,`Edges: ${T(Z).edges??``}`),O=S(D,1,`stat`,null,O,{danger:T(Z).cycles>0}),m(k,`Cycles: ${T(Z).cycles??``}`)}),p(t,n)};_(ae,e=>{T(I)?e(oe):T(X)?e(se,1):T(j).length===0?e(ce,2):e(le,-1)}),s($),p(x,$),h()}E([`click`]);export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,M as i,O as a,P as o,S as s,T as c,b as l,c as u,d,f,g as p,h as m,j as h,k as g,m as _,n as v,p as y,s as b,u as x,v as S,w as C,x as w,y as T}from"./index-
|
|
1
|
+
import{A as e,C as t,D as n,E as r,M as i,O as a,P as o,S as s,T as c,b as l,c as u,d,f,g as p,h as m,j as h,k as g,m as _,n as v,p as y,s as b,u as x,v as S,w as C,x as w,y as T}from"./index-DI89vrQ2.js";import{marked as ee}from"./marked.esm-2LEqwveT.js";import te from"./purify.es-Dqk5qvad.js";var ne=S(`<div class="empty" style="padding:20px 8px">Chargement…</div>`),E=S(`<div class="empty" style="padding:20px 8px; color: var(--danger)"> </div>`),D=S(`<button><!> </button>`),O=S(`<button> </button>`),k=S(`<div class="group-children"></div>`),A=S(`<div class="tree-group"><button class="tree-item group-header"><span class="group-icon svelte-1jkogc1"> </span> </button> <!></div>`),j=S(`<!> <!>`,1),M=S(`<div class="empty">Sélectionnez un document</div>`),N=S(`<div class="empty">Chargement du document…</div>`),P=S(`<div class="doc-paper"></div>`),re=S(`<div class="doc-toolbar svelte-1jkogc1"><span class="doc-path mono svelte-1jkogc1"> </span> <button class="btn btn-ghost" aria-label="Copier le contenu"><!> </button></div> <!>`,1),ie=S(`<div class="docs-pad svelte-1jkogc1"><div class="docs-layout svelte-1jkogc1"><aside class="docs-tree" aria-label="Navigation des documents"><!></aside> <div class="doc-view" role="region" aria-label="Contenu du document"><!></div></div></div>`);function F(S,T){i(T,!0);let F=g(n([])),I=g(null),L=g(``),R=g(!0),z=g(!1),B=g(null),V=g(null),H=e(()=>{let e=[],t={};for(let n of w(F)){let r=n.rel.split(`/`);if(r.length===1)e.push(n);else{let e=r[0];t[e]||(t[e]={name:e,children:[]}),t[e].children.push(n)}}return{root:e,groups:Object.values(t)}});async function U(){a(R,!0),a(B,null);try{let e=await fetch(`/api/docs`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();a(F,t.docs||[],!0)}catch(e){a(B,e.message,!0)}finally{a(R,!1)}}async function W(e){a(I,e,!0),a(z,!0);try{let t=await fetch(`/api/docs/${encodeURIComponent(e.rel)}`);if(!t.ok)throw Error(`HTTP ${t.status}`);a(L,await t.text(),!0)}catch(e){a(L,`Error loading document: ${e.message}`)}finally{a(z,!1)}}let G=e(()=>{if(!w(L))return``;try{return te.sanitize(ee.parse(w(L)))}catch{return`<p>Error rendering markdown</p>`}}),K=g(!1);function q(){w(L)&&navigator.clipboard&&navigator.clipboard.writeText(w(L)).then(()=>{a(K,!0),setTimeout(()=>a(K,!1),1500)})}t(()=>{U()}),t(()=>{if(!w(V)||!w(G))return;let e=w(V).querySelectorAll(`a`);for(let t of e){let e=t.textContent?.trim()||``;/^US-\d+$/.test(e)&&(t.href=`#/kanban`,t.dataset.storyId=e,t.addEventListener(`click`,e=>{e.preventDefault(),window.location.hash=`#/kanban`}))}});let J=g(n(new Set));function ae(e){w(J).has(e)?w(J).delete(e):w(J).add(e),a(J,new Set(w(J)),!0)}var Y=ie(),X=C(Y),Z=C(X),oe=C(Z),se=e=>{var t=ne();p(e,t)},ce=e=>{var t=E(),n=C(t);o(t),s(()=>m(n,`Erreur : ${w(B)??``}`)),p(e,t)},le=t=>{var n=j(),i=c(n);f(i,17,()=>w(H).root,y,(e,t)=>{var n=D();let i;var a=C(n);v(a,{name:`file`,cls:`ico`,size:15});var c=r(a,1,!0);o(n),s(()=>{i=x(n,1,`tree-item`,null,i,{active:w(I)?.rel===w(t).rel}),m(c,w(t).rel)}),l(`click`,n,()=>W(w(t))),p(e,n)});var a=r(i,2);f(a,17,()=>w(H).groups,y,(t,n)=>{var i=A(),a=C(i),c=C(a),d=C(c,!0);o(c);var h=r(c);o(a);var g=r(a,2),v=e=>{var t=k();f(t,21,()=>w(n).children,y,(e,t)=>{var n=O();let r;var i=C(n,!0);o(n),s(e=>{r=x(n,1,`tree-item nested`,null,r,{active:w(I)?.rel===w(t).rel}),m(i,e)},[()=>w(t).rel.split(`/`).slice(1).join(`/`)]),l(`click`,n,()=>W(w(t))),p(e,n)}),o(t),p(e,t)},b=e(()=>w(J).has(w(n).name));_(g,e=>{w(b)&&e(v)}),o(i),s((e,t)=>{u(a,`aria-expanded`,e),m(d,t),m(h,`${w(n).name??``}/`)},[()=>w(J).has(w(n).name),()=>w(J).has(w(n).name)?`▼`:`▶`]),l(`click`,a,()=>ae(w(n).name)),p(t,i)}),p(t,n)};_(oe,e=>{w(R)?e(se):w(B)?e(ce,1):e(le,-1)}),o(Z);var Q=r(Z,2),$=C(Q),ue=e=>{var t=M();p(e,t)},de=e=>{var t=re(),n=c(t),i=C(n),u=C(i,!0);o(i);var f=r(i,2),h=C(f);v(h,{name:`copy`,size:15});var g=r(h,1,!0);o(f),o(n);var y=r(n,2),x=e=>{var t=N();p(e,t)},S=e=>{var t=P();d(t,()=>w(G),!0),o(t),b(t,e=>a(V,e),()=>w(V)),p(e,t)};_(y,e=>{w(z)?e(x):e(S,-1)}),s(()=>{m(u,w(I).rel),m(g,w(K)?`Copié !`:`Copier`)}),l(`click`,f,q),p(e,t)};_($,e=>{w(I)?e(de,-1):e(ue)}),o(Q),o(X),o(Y),p(S,Y),h()}T([`click`]);export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,C as t,D as n,E as r,M as i,N as a,O as o,P as s,S as c,T as l,_ as u,a as d,b as f,c as p,d as m,f as h,g,h as _,j as v,k as y,l as ee,m as b,o as x,p as S,r as C,u as w,v as T,w as E,x as D,y as O}from"./index-DI89vrQ2.js";import{marked as k}from"./marked.esm-2LEqwveT.js";import A from"./purify.es-Dqk5qvad.js";function j(e){return[...e].sort((e,t)=>t.id.localeCompare(e.id,void 0,{numeric:!0,sensitivity:`base`}))}var M=T(`<div class="empty">Chargement…</div>`),N=T(`<div class="empty"> </div>`),P=T(`<div class="empty">Aucun sprint</div>`),F=T(`<span class="tag-mini svelte-1yxo9kf">goal</span>`),te=T(`<span class="tag-mini svelte-1yxo9kf">review</span>`),ne=T(`<span class="tag-mini svelte-1yxo9kf">retro</span>`),re=T(`<div class="si-tags svelte-1yxo9kf"><!> <!> <!></div>`),I=T(`<button class="sprint-item"><div class="si-top"><span class="si-name"> </span> <span> </span></div> <div class="si-stat"><span> </span> <span> </span></div> <div class="proj-bar" style="margin-top:9px"><span></span></div> <!></button>`),L=T(`<div class="empty">Sélectionnez un sprint</div>`),ie=T(`<span class="tag-mini svelte-1yxo9kf"> </span>`),R=T(`<span> </span>`),ae=T(`<div class="sd-panel"><h3>Goal</h3> <div class="md-body"></div></div>`),oe=T(`<p style="color: var(--fg-faint); font-size:13px">Aucune story dans ce sprint.</p>`),se=T(`<button class="toggle svelte-1yxo9kf"> </button>`),ce=T(`<span class="toggle-spacer svelte-1yxo9kf"></span>`),le=T(`<span class="s-assignee mono svelte-1yxo9kf"> </span>`),ue=T(`<tr><td class="t-name mono"> </td><td> </td><td> </td><td class="t-hrs"> </td><td class="t-hrs"> </td><td> </td></tr>`),de=T(`<table class="tasks sprint-tasks svelte-1yxo9kf"><thead><tr><th>Task</th><th>Type</th><th>Statut</th><th style="text-align:right">Est</th><th style="text-align:right">Réel</th><th>Assigné</th></tr></thead><tbody></tbody></table>`),fe=T(`<div class="sd-story-wrap"><div class="sd-story svelte-1yxo9kf"><!> <span class="s-id mono"> </span> <span class="s-t"> </span> <!> <span class="s-status"><i></i> </span> <span class="points mono svelte-1yxo9kf"> </span></div> <!></div>`),pe=T(`<div class="sd-panel"><h3>Review <span class="pill" style="background: var(--success-soft); color: var(--success)">review</span></h3> <div class="md-body review-md"></div></div>`),me=T(`<div class="sd-panel"><h3>Retro <span class="pill" style="background: var(--accent-soft); color: var(--accent)">team</span></h3> <div class="md-body review-md"></div></div>`),he=T(`<div class="sd-head"><div style="flex:1"><div style="display:flex; align-items:center; gap:11px"><h2> </h2> <span style="font-size:11px"> </span></div> <div class="sd-sub svelte-1yxo9kf"><span class="mono"> </span> <!> <!> <!></div></div></div> <div class="sd-metrics"><div class="metric"><div class="mk">Points</div><div class="mv"> <small>pts</small></div></div> <div class="metric"><div class="mk">Complétés</div><div class="mv"> <small>pts</small></div><div class="msub"> </div></div> <div class="metric"><div class="mk">Stories</div><div class="mv"> </div></div></div> <!> <div class="sd-panel"><h3>Stories & Tasks <span class="pill" style="background: var(--accent-soft); color: var(--accent)"> </span></h3> <!></div> <!> <!>`,1),z=T(`<div class="view-pad"><div class="sprints-layout"><aside class="sprint-list" aria-label="Liste des sprints"><!></aside> <section class="sprint-detail" aria-label="Détail du sprint"><!></section></div></div>`);function B(T,O){i(O,!0);let B=y(n([])),V=y(!0),H=y(null),U=y(null),W=y(!1),G=y(null),K=e(()=>x.parts[1]??null);function ge(e){return e.total_points>0&&e.done_points>=e.total_points?`done`:e.done_points>0?`active`:`planned`}let q=e=>e.total_points?Math.round(e.done_points/e.total_points*100):0;async function _e(){o(V,!0),o(H,null);try{let e=await fetch(`/api/sprints`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();o(B,j(t.sprints||[]),!0)}catch(e){o(H,e.message,!0)}finally{o(V,!1)}}async function ve(e){if(!e)o(U,null);else{o(W,!0),o(G,null);try{let t=await fetch(`/api/sprints/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`HTTP ${t.status}`);o(U,await t.json(),!0)}catch(e){o(G,e.message,!0),o(U,null)}finally{o(W,!1)}}}function ye(e){if(!e)return``;try{return A.sanitize(k.parse(e))}catch{return`<p>Error rendering markdown</p>`}}let be=e(()=>{let e={};for(let t of D(U)?.tasks??[])(e[t.us_id]??=[]).push(t);return e}),J=e(()=>{let e=D(U)?.stories??[],t=e.reduce((e,t)=>e+(t.story_points||0),0),n=e.filter(e=>e.status===`done`).reduce((e,t)=>e+(t.story_points||0),0);return{total:t,done:n,count:e.length,pct:t?Math.round(n/t*100):0}}),Y=y(n(new Set));function xe(e){D(Y).has(e)?D(Y).delete(e):D(Y).add(e),o(Y,new Set(D(Y)),!0)}t(()=>{_e()}),t(()=>{ve(D(K))});var X=z(),Se=E(X),Z=E(Se),Q=E(Z),Ce=e=>{var t=M();g(e,t)},we=e=>{var t=N(),n=E(t);s(t),c(()=>_(n,`Erreur : ${D(H)??``}`)),g(e,t)},Te=e=>{var t=P();g(e,t)},Ee=t=>{var n=u(),i=l(n);h(i,17,()=>D(B),S,(t,n)=>{let i=e(()=>ge(D(n)));var a=I(),o=E(a),l=E(o),u=E(l,!0);s(l);var m=r(l,2),h=E(m,!0);s(m),s(o);var v=r(o,2),y=E(v),x=E(y);s(y);var S=r(y,2),C=E(S);s(S),s(v);var T=r(v,2),O=E(T);s(T);var k=r(T,2),A=e=>{var t=re(),i=E(t),a=e=>{var t=F();g(e,t)};b(i,e=>{D(n).has_goal&&e(a)});var o=r(i,2),c=e=>{var t=te();g(e,t)};b(o,e=>{D(n).has_review&&e(c)});var l=r(o,2),u=e=>{var t=ne();g(e,t)};b(l,e=>{D(n).has_retro&&e(u)}),s(t),g(e,t)};b(k,e=>{(D(n).has_goal||D(n).has_review||D(n).has_retro)&&e(A)}),s(a),c(e=>{p(a,`aria-current`,D(K)===D(n).id),_(u,D(n).id),w(m,1,`si-state ${D(i)??``}`,`svelte-1yxo9kf`),_(h,D(i)),_(x,`${D(n).story_count??``} US`),_(C,`${D(n).done_points??``}/${D(n).total_points??``} pts`),ee(O,`width: ${e??``}%`)},[()=>q(D(n))]),f(`click`,a,()=>d(`/sprints/${D(n).id}`)),g(t,a)}),g(t,n)};b(Q,e=>{D(V)?e(Ce):D(H)?e(we,1):D(B).length===0?e(Te,2):e(Ee,-1)}),s(Z);var De=r(Z,2),$=E(De),Oe=e=>{var t=L();g(e,t)},ke=e=>{var t=M();g(e,t)},Ae=e=>{var t=N(),n=E(t);s(t),c(()=>_(n,`Erreur : ${D(G)??``}`)),g(e,t)},je=t=>{let n=e(()=>ge({total_points:D(J).total,done_points:D(J).done}));var i=he(),o=l(i),d=E(o),v=E(d),y=E(v),x=E(y,!0);s(y);var T=r(y,2),O=E(T,!0);s(T),s(v);var k=r(v,2),A=E(k),j=E(A,!0);s(A);var M=r(A,2),N=e=>{var t=ie(),n=E(t,!0);s(t),c(()=>_(n,D(U).sprint.epic)),g(e,t)};b(M,e=>{D(U).sprint.epic&&e(N)});var P=r(M,2),F=e=>{var t=R(),n=E(t);s(t),c(()=>_(n,`${D(U).sprint.start_date??``} → ${(D(U).sprint.end_date||`…`)??``}`)),g(e,t)},te=e=>{var t=R(),n=E(t);s(t),c(()=>_(n,`clôturé le ${D(U).sprint.end_date??``}`)),g(e,t)};b(P,e=>{D(U).sprint.start_date?e(F):D(U).sprint.end_date&&e(te,1)});var ne=r(P,2),re=e=>{var t=R(),n=E(t);s(t),c(()=>_(n,`${D(U).sprint.points_delivered??``} pts livrés`)),g(e,t)};b(ne,e=>{D(U).sprint.points_delivered!=null&&e(re)}),s(k),s(d),s(o);var I=r(o,2),L=E(I),z=r(E(L)),B=E(z,!0);a(),s(z),s(L);var V=r(L,2),H=r(E(V)),W=E(H,!0);a(),s(H);var G=r(H),K=E(G);s(G),s(V);var q=r(V,2),_e=r(E(q)),ve=E(_e,!0);s(_e),s(q),s(I);var X=r(I,2),Se=e=>{var t=ae(),n=r(E(t),2);m(n,()=>ye(D(U).goal),!0),s(n),s(t),g(e,t)};b(X,e=>{D(U).goal&&e(Se)});var Z=r(X,2),Q=E(Z),Ce=r(E(Q)),we=E(Ce,!0);s(Ce),s(Q);var Te=r(Q,2),Ee=e=>{var t=oe();g(e,t)},De=t=>{var n=u(),i=l(n);h(i,17,()=>D(U).stories,S,(t,n)=>{let i=e(()=>D(be)[D(n).id]??[]);var a=fe(),o=E(a),l=E(o),u=e=>{var t=se(),r=E(t,!0);s(t),c((e,i)=>{p(t,`aria-expanded`,e),p(t,`aria-label`,`Afficher les tâches de ${D(n).id??``}`),_(r,i)},[()=>D(Y).has(D(n).id),()=>D(Y).has(D(n).id)?`▼`:`▶`]),f(`click`,t,()=>xe(D(n).id)),g(e,t)},d=e=>{var t=ce();g(e,t)};b(l,e=>{D(i).length?e(u):e(d,-1)});var m=r(l,2),v=E(m,!0);s(m);var y=r(m,2),x=E(y,!0);s(y);var w=r(y,2),T=e=>{var t=le(),r=E(t,!0);s(t),c(()=>_(r,D(n).assigned_to)),g(e,t)};b(w,e=>{D(n).assigned_to&&e(T)});var O=r(w,2),k=E(O),A=r(k,1,!0);s(O);var j=r(O,2),M=E(j,!0);s(j),s(o);var N=r(o,2),P=e=>{var t=de(),n=r(E(t));h(n,21,()=>D(i),S,(e,t)=>{var n=ue(),i=E(n),a=E(i,!0);s(i);var o=r(i),l=E(o,!0);s(o);var u=r(o),d=E(u,!0);s(u);var f=r(u),p=E(f,!0);s(f);var m=r(f),h=E(m,!0);s(m);var v=r(m),y=E(v,!0);s(v),s(n),c(()=>{_(a,D(t).id),_(l,D(t).type),_(d,D(t).status),_(p,D(t).estimation_hours??`—`),_(h,D(t).actual_hours??`—`),_(y,D(t).assigned_to||`—`)}),g(e,n)}),s(n),s(t),g(e,t)},F=e(()=>D(Y).has(D(n).id)&&D(i).length);b(N,e=>{D(F)&&e(P)}),s(a),c(()=>{_(v,D(n).id),_(x,D(n).title),ee(k,`width:8px;height:8px;border-radius:50%;background: var(${(C[D(n).status]?.cssVar||`--fg-faint`)??``});display:inline-block`),_(A,C[D(n).status]?.label||D(n).status),_(M,D(n).story_points??`—`)}),g(t,a)}),g(t,n)};b(Te,e=>{D(U).stories.length===0?e(Ee):e(De,-1)}),s(Z);var $=r(Z,2),Oe=e=>{var t=pe(),n=r(E(t),2);m(n,()=>ye(D(U).review),!0),s(n),s(t),g(e,t)};b($,e=>{D(U).review&&e(Oe)});var ke=r($,2),Ae=e=>{var t=me(),n=r(E(t),2);m(n,()=>ye(D(U).retro),!0),s(n),s(t),g(e,t)};b(ke,e=>{D(U).retro&&e(Ae)}),c(()=>{_(x,D(U).sprint.name||D(U).sprint.id),w(T,1,`si-state ${D(n)??``}`,`svelte-1yxo9kf`),_(O,D(n)),_(j,D(U).sprint.id),_(B,D(J).total),_(W,D(J).done),_(K,`${D(J).pct??``}% du total`),_(ve,D(J).count),_(we,D(U).stories.length)}),g(t,i)};b($,e=>{D(K)?D(W)?e(ke,1):D(G)?e(Ae,2):D(U)&&e(je,3):e(Oe)}),s(De),s(Se),s(X),g(T,X),v()}O([`click`]);export{B as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=r(e))||t){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||n.return==null||n.return()}finally{if(c)throw o}}}}function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}function r(t,n){if(t){if(typeof t==`string`)return e(t,n);var r={}.toString.call(t).slice(8,-1);return r===`Object`&&t.constructor&&(r=t.constructor.name),r===`Map`||r===`Set`?Array.from(t):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,useDagreEdgeControlPoints:!1,automaticDagreEdgeStyle:!1,dagreEdgeStyle:{"curve-style":`unbundled-bezier`,"control-point-weights":function(e){return e.scratch(`controlPointWeights`)},"control-point-distances":function(e){return e.scratch(`controlPointDistances`)},"edge-distances":`intersection`,"edge-ends-overlap":!1},animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},sort:void 0,stop:function(){}},a=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object),o=Object.defineProperty,s=(e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},l=(e,t,n)=>s(e,t+``,n),u={};c(u,{Graph:()=>p,alg:()=>C,json:()=>y,version:()=>ee});var d=Object.defineProperty,f=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},p=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=g(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=_(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,m(this._preds[a],i),m(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?v(this._isDirected,e):g(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r==`object`?r:{label:r}}hasEdge(e,t,n){return(arguments.length===1?v(this._isDirected,e):g(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?v(this._isDirected,e):g(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],h(this._preds[t],e),h(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function m(e,t){e[t]?e[t]++:e[t]=1}function h(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function g(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function _(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function v(e,t){return g(e,t.v,t.w,t.name)}var ee=`4.0.1`,y={};f(y,{read:()=>te,write:()=>b});function b(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:x(e),edges:S(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function x(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function S(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function te(e){let t=new p(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var C={};f(C,{CycleException:()=>E,bellmanFord:()=>w,components:()=>ie,dijkstra:()=>T,dijkstraAll:()=>ce,findCycles:()=>ue,floydWarshall:()=>fe,isAcyclic:()=>he,postorder:()=>ye,preorder:()=>be,prim:()=>xe,shortestPaths:()=>Se,tarjan:()=>le,topsort:()=>me});var ne=()=>1;function w(e,t,n,r){return re(e,String(t),n||ne,r||function(t){return e.outEdges(t)})}function re(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function ie(e){let t={},n=[],r;function i(n){n in t||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var ae=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},oe=()=>1;function T(e,t,n,r){return se(e,String(t),n||oe,r||function(t){return e.outEdges(t)})}function se(e,t,n,r){let i={},a=new ae,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t],c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0&&(o=a.removeMin(),s=i[o],s.distance!==1/0);)r(o).forEach(c);return i}function ce(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=T(e,i,t,n),r},{})}function le(e){let t=0,n=[],r={},i=[];function a(o){let s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){e in r?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){let e=[],t;do t=n.pop(),r[t].onStack=!1,e.push(t);while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function ue(e){return le(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var de=()=>1;function fe(e,t,n){return pe(e,t||de,n||function(t){return e.outEdges(t)})}function pe(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){let t=r[e];i.forEach(function(n){let a=r[n];i.forEach(function(n){let r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}var E=class extends Error{constructor(...e){super(...e)}};function me(e){let t={},n={},r=[];function i(a){if(a in n)throw new E;a in t||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new E;return r}function he(e){try{me(e)}catch(e){if(e instanceof E)return!1;throw e}return!0}function ge(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=_e(e,t,n===`post`,o,a,r,i)}),i}function _e(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=_e(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function ve(e,t,n){return ge(e,t,n,function(e,t){return e.push(t),e},[])}function ye(e,t){return ve(e,t,`post`)}function be(e,t){return ve(e,t,`pre`)}function xe(e,t){let n=new p,r={},i=new ae,a;function o(e){let n=e.v===a?e.w:e.v,o=i.priority(n);if(o!==void 0){let s=t(e);s<o&&(r[n]=a,i.decrease(n,s))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(e){i.add(e,1/0),n.setNode(e)}),i.decrease(e.nodes()[0],0);let s=!1;for(;i.size()>0;){if(a=i.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw Error(`Input graph is not connected: `+e);s=!0}e.nodeEdges(a).forEach(o)}return n}function Se(e,t,n,r){return Ce(e,t,n,r??(t=>e.outEdges(t)??[]))}function Ce(e,t,n,r){if(n===void 0)return T(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=r(a[o]);for(let e=0;e<s.length;e++){let t=s[e],r=t.v===a[o]?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return w(e,t,n,r)}return T(e,t,n,r)}function D(e,t,n,r){let i=r;for(;e.hasNode(i);)i=N(r);return n.dummy=t,e.setNode(i,n),i}function we(e){let t=new p().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function O(e){let t=new p({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function k(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function A(e){let t=P(ke(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function Te(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=M(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Ee(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=M(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function j(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),D(e,`border`,i,t)}function De(e,t=Oe){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Oe=65535;function M(e,t){return t.length>Oe?e(...De(t).map(t=>e(...t))):e(...t)}function ke(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return M(Math.max,t)}function Ae(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function je(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function Me(e,t){return t()}var Ne=0;function N(e){return e+(``+ ++Ne)}function P(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function F(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function I(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Pe(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var L=`\0`,Fe=`3.0.0`,Ie=class{constructor(){l(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Le(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Le(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Re)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Le(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Re(e,t){if(e!==`_next`&&e!==`_prev`)return t}var ze=Ie,Be=()=>1;function Ve(e,t){if(e.nodeCount()<=1)return[];let n=Ue(e,t||Be);return He(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function He(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)R(e,t,n,o);for(;o=i.dequeue();)R(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(R(e,t,n,o,!0)||[]);break}}}return r}function R(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,z(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,z(t,n,o)}),e.removeNode(r.v),o}function Ue(e,t){let n=new p,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=We(i+r+3).map(()=>new ze),o=r+1;return n.nodes().forEach(e=>{z(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function z(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function We(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function Ge(e){(e.graph().acyclicer===`greedy`?Ve(e,t(e)):Ke(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,N(`rev`))});function t(e){return t=>e.edge(t).weight}}function Ke(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function qe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Je(e){e.graph().dummyChains=[],e.edges().forEach(t=>Ye(e,t))}function Ye(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=D(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function Xe(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function B(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=M(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function V(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Ze=Qe;function Qe(e){let t=new p({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;$e(t,e)<i&&(a=et(t,e),a);)o=t.hasNode(a.v)?V(e,a):-V(e,a),tt(t,e,o);return t}function $e(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!V(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function et(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=V(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function tt(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:nt,postorder:rt}=C,it=H;H.initLowLimValues=W,H.initCutValues=U,H.calcCutValue=ot,H.leaveEdge=ct,H.enterEdge=G,H.exchangeEdges=lt;function H(e){e=we(e),B(e);let t=Ze(e);W(t),U(t,e);let n,r;for(;n=ct(t);)r=G(t,e,n),lt(t,e,n,r)}function U(e,t){let n=rt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>at(e,t,n))}function at(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=ot(e,t,n)}function ot(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,dt(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function W(e,t){arguments.length<2&&(t=e.nodes()[0]),st(e,{},1,t)}function st(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=st(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function ct(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function G(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===ft(e,e.node(t.v),s)&&c!==ft(e,e.node(t.w),s)).reduce((e,n)=>V(t,n)<V(t,e)?n:e)}function lt(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),W(e),U(e,t),ut(e,t)}function ut(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=nt(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function dt(e,t,n){return e.hasEdge(t,n)}function ft(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var pt=mt;function mt(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:_t(e);break;case`tight-tree`:gt(e);break;case`longest-path`:ht(e);break;case`none`:break;default:_t(e)}}var ht=B;function gt(e){B(e),Ze(e)}function _t(e){it(e)}var vt=yt;function yt(e){let t=xt(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=bt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function bt(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function xt(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(L).forEach(r),t}function St(e){let t=D(e,`root`,{},`_root`),n=wt(e),r=Object.values(n),i=M(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=Tt(e)+1;e.children(L).forEach(r=>Ct(e,t,a,o,i,n,r)),e.graph().nodeRankFactor=a}function Ct(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=j(e,`_bt`),l=j(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Ct(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function wt(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(L).forEach(e=>n(e,1)),t}function Tt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Et(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var Dt=Ot;function Ot(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)kt(e,`borderLeft`,`_bl`,n,i,t),kt(e,`borderRight`,`_br`,n,i,t)}}e.children(L).forEach(t)}function kt(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=D(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function At(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&Mt(e)}function jt(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Pt(e),(t===`lr`||t===`rl`)&&(Ft(e),Mt(e))}function Mt(e){e.nodes().forEach(t=>Nt(e.node(t))),e.edges().forEach(t=>Nt(e.edge(t)))}function Nt(e){let t=e.width;e.width=e.height,e.height=t}function Pt(e){e.nodes().forEach(t=>K(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(K),Object.hasOwn(r,`y`)&&K(r)})}function K(e){e.y=-e.y}function Ft(e){e.nodes().forEach(t=>q(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(q),Object.hasOwn(r,`x`)&&q(r)})}function q(e){let t=e.x;e.x=e.y,e.y=t}function It(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),r=n.map(t=>e.node(t).rank),i=P(M(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n);let o=e.successors(n);o&&o.forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function Lt(e,t){let n=0;for(let r=1;r<t.length;++r)n+=Rt(e,t[r-1],t[r]);return n}function Rt(e,t,n){let r=Pe(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function zt(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function Bt(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),Vt(Object.values(n).filter(e=>!e.indegree))}function Vt(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&Ht(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>F(e,[`vs`,`i`,`barycenter`,`weight`]))}function Ht(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Ut(e,t){let n=Ae(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(Gt(!!t)),c=Wt(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=Wt(a,i,c)});let l={vs:a.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function Wt(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Gt(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function Kt(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=zt(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=Kt(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&Jt(t,i)}});let u=Bt(l,n);qt(u,c);let d=Ut(u,r);if(o&&s){d.vs=[o,d.vs,s].flat(1);let t=e.predecessors(o);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(s),i=e.node(r[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+n.order+i.order)/(d.weight+2),d.weight+=2}}return d}function qt(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Jt(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Yt(e,t,n,r){r||=e.nodes();let i=Xt(e),a=new p({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Xt(e){let t;for(;e.hasNode(t=N(`_root`)););return t}function Zt(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Qt(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,Qt);return}let n=ke(e),r=$t(e,P(1,n+1),`inEdges`),i=$t(e,P(n-1,-1,-1),`outEdges`),a=It(e);if(tn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){en(t%2?r:i,t%4>=2,c),a=A(e);let l=Lt(e,a);l<o?(n=0,s=Object.assign({},a),o=l):l===o&&(s=structuredClone(a))}tn(e,s)}function $t(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return Yt(e,t,n,r.get(t)||[])})}function en(e,t,n){let r=new p;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=Kt(e,i,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),Zt(e,r,a.vs)})}function tn(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function nn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=an(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&on(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function rn(e,t){let n={};function r(t,r,i,a,o){P(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&on(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function an(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function on(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function sn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function cn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s&&s.length){let r=s.sort((e,t)=>{let n=o[e],r=o[t];return(n===void 0?0:n)-(r===void 0?0:r)}),c=(r.length-1)/2;for(let s=Math.floor(c),l=Math.ceil(c);s<=l;++s){let c=r[s];if(c===void 0)continue;let l=o[c];if(l!==void 0&&a[e]===e&&t<l&&!sn(n,e,c)){let n=i[c];n!==void 0&&(a[c]=e,a[e]=i[e]=n,t=l)}}}})}),{root:i,align:a}}function ln(e,t,n,r,i=!1){let a={},o=un(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function un(e,t,n,r){let i=new p,a=e.graph(),o=hn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function dn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=gn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function fn(e,t){let n=Object.values(t),r=M(Math.min,n),i=M(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-M(Math.min,c);a!==`l`&&(l=i-M(Math.max,c)),l&&(e[o]=I(s,e=>e+l))})})}function pn(e,t=void 0){let n=e.ul;return n?I(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function mn(e){let t=A(e),n=Object.assign(nn(e,t),rn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(i=i.map(e=>Object.values(e).reverse()));let o=cn(e,i,n,t=>(a===`u`?e.predecessors(t):e.successors(t))||[]),s=ln(e,i,o.root,o.align,t===`r`);t===`r`&&(s=I(s,e=>-e)),r[a+t]=s})}),fn(r,dn(e,r)),pn(r,e.graph().align)}function hn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function gn(e,t){return e.node(t).width}function _n(e){e=O(e),vn(e),Object.entries(mn(e)).forEach(([t,n])=>e.node(t).x=n)}function vn(e){let t=A(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}function yn(e,t={}){let n=t.debugTiming?je:Me;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>An(e));return n(` runLayout`,()=>bn(r,n,t)),n(` updateInputGraph`,()=>xn(e,r)),r})}function bn(e,t,n){t(` makeSpaceForEdgeLabels`,()=>jn(e)),t(` removeSelfEdges`,()=>Bn(e)),t(` acyclic`,()=>Ge(e)),t(` nestingGraph.run`,()=>St(e)),t(` rank`,()=>pt(O(e))),t(` injectEdgeLabelProxies`,()=>Mn(e)),t(` removeEmptyRanks`,()=>Ee(e)),t(` nestingGraph.cleanup`,()=>Et(e)),t(` normalizeRanks`,()=>Te(e)),t(` assignRankMinMax`,()=>Nn(e)),t(` removeEdgeLabelProxies`,()=>Pn(e)),t(` normalize.run`,()=>Je(e)),t(` parentDummyChains`,()=>vt(e)),t(` addBorderSegments`,()=>Dt(e)),t(` order`,()=>Qt(e,n)),t(` insertSelfEdges`,()=>Vn(e)),t(` adjustCoordinateSystem`,()=>At(e)),t(` position`,()=>_n(e)),t(` positionSelfEdges`,()=>Hn(e)),t(` removeBorderNodes`,()=>zn(e)),t(` normalize.undo`,()=>Xe(e)),t(` fixupEdgeLabelCoords`,()=>Ln(e)),t(` undoCoordinateSystem`,()=>jt(e)),t(` translateGraph`,()=>Fn(e)),t(` assignNodeIntersects`,()=>In(e)),t(` reversePoints`,()=>Rn(e)),t(` acyclic.undo`,()=>qe(e))}function xn(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Sn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],Cn={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},wn=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],Tn=[`width`,`height`,`rank`],En={width:0,height:0},Dn=[`minlen`,`weight`,`width`,`height`,`labeloffset`],On={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},kn=[`labelpos`];function An(e){let t=new p({multigraph:!0,compound:!0}),n=Y(e.graph());return t.setGraph(Object.assign({},Cn,J(n,Sn),F(n,wn))),e.nodes().forEach(n=>{let r=J(Y(e.node(n)),Tn);Object.keys(En).forEach(e=>{r[e]===void 0&&(r[e]=En[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Y(e.edge(n));t.setEdge(n,Object.assign({},On,J(r,Dn),F(r,kn)))}),t}function jn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Mn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);D(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Nn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Pn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Fn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function In(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(k(r,a)),n.points.push(k(i,o))})}function Ln(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function Rn(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function zn(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function Bn(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Vn(e){A(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{D(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Hn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=n,i=e.node(r.e.v),a=i.x+i.width/2,o=i.y,s=n.x-a,c=i.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:o-c},{x:a+5*s/6,y:o-c},{x:a+s,y:o},{x:a+5*s/6,y:o+c},{x:a+2*s/3,y:o+c}],r.label.x=n.x,r.label.y=n.y}})}function J(e,t){return I(F(e,t),Number)}function Y(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function Un(e){let t=A(e),n=new p({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var Wn={graphlib:u,version:Fe,layout:yn,debug:Un,util:{time:je,notime:Me}},X=function(e){return typeof e==`function`},Z=.001;function Q(e){if(e.isParent()){var t=e.children();if(t.length>0)return Q(t[0])}return e}function Gn(e){this.options=a({},i,e)}function Kn(e,t){return{x:$(e.x-t.x),y:$(e.y-t.y)}}function qn(e,t){return $(e.x*t.x)+$(e.y*t.y)}function Jn(e){var t=Math.hypot(e.x,e.y)||1;return{x:e.x/t,y:e.y/t,len:t}}function Yn(e){return{x:-e.y,y:e.x}}function Xn(e,t){var n=Jn(Kn(t,e)),r=n.x,i=n.y,a=n.len,o={x:r,y:i};return{src:e,tgt:t,dir:o,normal:Yn(o),len:a}}function $(e){return Math.abs(e)<Z?e<0?-Z:Z:e}function Zn(e,t){var n=Kn(e,t.src);return{weight:$(qn(n,t.dir)/t.len),distance:$(qn(n,t.normal))}}function Qn(e){var n=1/0,r=-1/0,i=t(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.weight<n&&(n=o.weight),o.weight>r&&(r=o.weight)}}catch(e){i.e(e)}finally{i.f()}var s=r-n||1;return e.map(function(e){return{distance:e.distance,weight:(e.weight-n)/s}})}function $n(e,t){var n=Xn(t.source().position(),t.target().position()),r=Qn(e.points.map(function(e){return Zn(e,n)}));return{controlPointWeights:r.slice(1,-1).map(function(e){return e.weight}),controlPointDistances:r.slice(1,-1).map(function(e){return e.distance})}}Gn.prototype.run=function(){var e=this.options,t=this,r=e.cy,i=e.eles,a=function(e,t){return X(t)?t.apply(e,[e]):t},o=e.boundingBox||{x1:0,y1:0,w:r.width(),h:r.height()};o.x2===void 0&&(o.x2=o.x1+o.w),o.w===void 0&&(o.w=o.x2-o.x1),o.y2===void 0&&(o.y2=o.y1+o.h),o.h===void 0&&(o.h=o.y2-o.y1);var s=new Wn.graphlib.Graph({multigraph:!0,compound:!0}),c={},l=function(e,t){t!=null&&(c[e]=t)};l(`nodesep`,e.nodeSep),l(`edgesep`,e.edgeSep),l(`ranksep`,e.rankSep),l(`rankdir`,e.rankDir),l(`align`,e.align),l(`ranker`,e.ranker),l(`acyclicer`,e.acyclicer),s.setGraph(c),s.setDefaultEdgeLabel(function(){return{}}),s.setDefaultNodeLabel(function(){return{}});var u=i.nodes();X(e.sort)&&(u=u.sort(e.sort));for(var d=0;d<u.length;d++){var f=u[d],p=f.layoutDimensions(e);s.setNode(f.id(),{width:p.w,height:p.h,shape:`ellipse`,name:f.id()})}for(var m=0;m<u.length;m++){var h=u[m];h.isChild()&&s.setParent(h.id(),h.parent().id())}var g=i.edges();X(e.sort)&&(g=g.sort(e.sort));for(var _=0;_<g.length;_++){var v=g[_],ee=Q(v.source()),y=Q(v.target());s.setEdge(ee.id(),y.id(),{minlen:a(v,e.minLen),weight:a(v,e.edgeWeight),name:v.id()},v.id())}Wn.layout(s);for(var b=s.nodes(),x=0;x<b.length;x++){var S=b[x],te=s.node(S);r.getElementById(S).scratch().dagre=te}var C;e.boundingBox?(C={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},u.forEach(function(e){var t=e.scratch().dagre;C.x1=Math.min(C.x1,t.x),C.x2=Math.max(C.x2,t.x),C.y1=Math.min(C.y1,t.y),C.y2=Math.max(C.y2,t.y)}),C.w=C.x2-C.x1,C.h=C.y2-C.y1):C=o;var ne=function(t){if(e.boundingBox){var n=C.w===0?0:(t.x-C.x1)/C.w,r=C.h===0?0:(t.y-C.y1)/C.h;return{x:o.x1+n*o.w,y:o.y1+r*o.h}}return t};return u.layoutPositions(t,e,function(e){e=n(e)===`object`?e:this;var t=e.scratch().dagre;return ne({x:t.x,y:t.y})}),e.useDagreEdgeControlPoints&&(e.automaticDagreEdgeStyle&&(r.edges().addClass(`useDagreEdgeControlPoints`),r.style().selector(`edge.useDagreEdgeControlPoints`).style(e.dagreEdgeStyle).update()),s.edges().forEach(function(e){var t=r.getElementById(e.name),n=s.edge(e);n&&n.points&&t.scratch($n(n,t))})),this};var er=function(e){e&&e(`layout`,`dagre`,Gn)};typeof window<`u`&&window.cytoscape!==void 0&&er(window.cytoscape);export{er as default};
|