studiograph 1.1.3 → 1.2.0-beta.10
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/README.md +2 -8
- package/dist/agent/orchestrator.d.ts +53 -0
- package/dist/agent/orchestrator.js +197 -12
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/prompts/system.md +43 -11
- package/dist/agent/skill-loader.d.ts +48 -0
- package/dist/agent/skill-loader.js +166 -0
- package/dist/agent/skill-loader.js.map +1 -0
- package/dist/agent/skills/{bundled/enrich-entities.md → enrich-entities.md} +12 -0
- package/dist/agent/skills/entity-schema.md +502 -0
- package/dist/agent/skills/obsidian-source-setup.md +246 -0
- package/dist/agent/skills/sync-configuration.md +144 -0
- package/dist/agent/skills/sync-setup.md +84 -0
- package/dist/agent/tools/connector-tools.d.ts +37 -0
- package/dist/agent/tools/connector-tools.js +132 -0
- package/dist/agent/tools/connector-tools.js.map +1 -0
- package/dist/agent/tools/fs-tools.d.ts +39 -0
- package/dist/agent/tools/fs-tools.js +106 -0
- package/dist/agent/tools/fs-tools.js.map +1 -0
- package/dist/agent/tools/graph-tools.d.ts +33 -1
- package/dist/agent/tools/graph-tools.js +192 -44
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/agent/tools/load-skill.d.ts +1 -1
- package/dist/agent/tools/load-skill.js +1 -1
- package/dist/agent/tools/load-skill.js.map +1 -1
- package/dist/agent/tools/ops-tools.d.ts +24 -0
- package/dist/agent/tools/ops-tools.js +542 -0
- package/dist/agent/tools/ops-tools.js.map +1 -0
- package/dist/agent/tools/sync-tools.d.ts +33 -0
- package/dist/agent/tools/sync-tools.js +947 -0
- package/dist/agent/tools/sync-tools.js.map +1 -0
- package/dist/auth/github.d.ts +11 -8
- package/dist/auth/github.js +56 -75
- package/dist/auth/github.js.map +1 -1
- package/dist/cli/colors.d.ts +54 -0
- package/dist/cli/colors.js +133 -0
- package/dist/cli/colors.js.map +1 -0
- package/dist/cli/commands/app.js +121 -18
- package/dist/cli/commands/app.js.map +1 -1
- package/dist/cli/commands/auth.d.ts +1 -1
- package/dist/cli/commands/auth.js +26 -10
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/clone.d.ts +9 -0
- package/dist/cli/commands/clone.js +167 -0
- package/dist/cli/commands/clone.js.map +1 -0
- package/dist/cli/commands/commit.d.ts +8 -0
- package/dist/cli/commands/commit.js +44 -0
- package/dist/cli/commands/commit.js.map +1 -0
- package/dist/cli/commands/connector.js +10 -2
- package/dist/cli/commands/connector.js.map +1 -1
- package/dist/cli/commands/deploy.d.ts +4 -6
- package/dist/cli/commands/deploy.js +292 -115
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/enrich.d.ts +11 -0
- package/dist/cli/commands/enrich.js +135 -0
- package/dist/cli/commands/enrich.js.map +1 -0
- package/dist/cli/commands/graphrag.d.ts +12 -0
- package/dist/cli/commands/graphrag.js +122 -0
- package/dist/cli/commands/graphrag.js.map +1 -0
- package/dist/cli/commands/init.js +29 -196
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/join.js +23 -3
- package/dist/cli/commands/join.js.map +1 -1
- package/dist/cli/commands/orphans.d.ts +8 -0
- package/dist/cli/commands/orphans.js +125 -0
- package/dist/cli/commands/orphans.js.map +1 -0
- package/dist/cli/commands/provision.js +11 -7
- package/dist/cli/commands/provision.js.map +1 -1
- package/dist/cli/commands/r2.js +8 -2
- package/dist/cli/commands/r2.js.map +1 -1
- package/dist/cli/commands/redeploy.d.ts +9 -0
- package/dist/cli/commands/redeploy.js +203 -0
- package/dist/cli/commands/redeploy.js.map +1 -0
- package/dist/cli/commands/reset.d.ts +12 -0
- package/dist/cli/commands/reset.js +137 -0
- package/dist/cli/commands/reset.js.map +1 -0
- package/dist/cli/commands/resolve.d.ts +8 -0
- package/dist/cli/commands/resolve.js +85 -0
- package/dist/cli/commands/resolve.js.map +1 -0
- package/dist/cli/commands/review.d.ts +19 -0
- package/dist/cli/commands/review.js +128 -0
- package/dist/cli/commands/review.js.map +1 -0
- package/dist/cli/commands/serve.js +55 -8
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/source.d.ts +16 -0
- package/dist/cli/commands/source.js +159 -0
- package/dist/cli/commands/source.js.map +1 -0
- package/dist/cli/commands/start.js +307 -55
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/sync-entities.d.ts +13 -0
- package/dist/cli/commands/sync-entities.js +242 -0
- package/dist/cli/commands/sync-entities.js.map +1 -0
- package/dist/cli/commands/sync.js +81 -5
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/index.js +45 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/scaffolding.d.ts +2 -1
- package/dist/cli/scaffolding.js +38 -23
- package/dist/cli/scaffolding.js.map +1 -1
- package/dist/cli/setup-wizard.d.ts +30 -0
- package/dist/cli/setup-wizard.js +244 -0
- package/dist/cli/setup-wizard.js.map +1 -0
- package/dist/cli/sync-review-interactive.d.ts +31 -0
- package/dist/cli/sync-review-interactive.js +393 -0
- package/dist/cli/sync-review-interactive.js.map +1 -0
- package/dist/cli/theme.d.ts +31 -0
- package/dist/cli/theme.js +116 -0
- package/dist/cli/theme.js.map +1 -0
- package/dist/core/graph.d.ts +40 -12
- package/dist/core/graph.js +344 -104
- package/dist/core/graph.js.map +1 -1
- package/dist/core/migration-runner.d.ts +4 -1
- package/dist/core/migration-runner.js +14 -3
- package/dist/core/migration-runner.js.map +1 -1
- package/dist/core/types.d.ts +2 -4
- package/dist/core/types.js +1 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-config.d.ts +12 -0
- package/dist/core/user-config.js.map +1 -1
- package/dist/core/workspace-manager.d.ts +6 -1
- package/dist/core/workspace-manager.js +29 -4
- package/dist/core/workspace-manager.js.map +1 -1
- package/dist/core/workspace.d.ts +13 -5
- package/dist/core/workspace.js +115 -33
- package/dist/core/workspace.js.map +1 -1
- package/dist/lib/lib/utils.d.ts +2 -0
- package/dist/lib/lib/utils.js +6 -0
- package/dist/lib/lib/utils.js.map +1 -0
- package/dist/mcp/connector-manager.d.ts +7 -3
- package/dist/mcp/connector-manager.js +61 -16
- package/dist/mcp/connector-manager.js.map +1 -1
- package/dist/mcp/connectors/asana.d.ts +2 -0
- package/dist/mcp/connectors/asana.js +20 -0
- package/dist/mcp/connectors/asana.js.map +1 -0
- package/dist/mcp/connectors/definitions.d.ts +3 -1
- package/dist/mcp/connectors/definitions.js +19 -127
- package/dist/mcp/connectors/definitions.js.map +1 -1
- package/dist/mcp/connectors/figma.d.ts +5 -0
- package/dist/mcp/connectors/figma.js +21 -0
- package/dist/mcp/connectors/figma.js.map +1 -0
- package/dist/mcp/connectors/gdrive.d.ts +2 -0
- package/dist/mcp/connectors/gdrive.js +20 -0
- package/dist/mcp/connectors/gdrive.js.map +1 -0
- package/dist/mcp/connectors/granola.d.ts +2 -0
- package/dist/mcp/connectors/granola.js +12 -0
- package/dist/mcp/connectors/granola.js.map +1 -0
- package/dist/mcp/connectors/linear.d.ts +2 -0
- package/dist/mcp/connectors/linear.js +19 -0
- package/dist/mcp/connectors/linear.js.map +1 -0
- package/dist/mcp/connectors/obsidian.d.ts +2 -0
- package/dist/mcp/connectors/obsidian.js +19 -0
- package/dist/mcp/connectors/obsidian.js.map +1 -0
- package/dist/mcp/connectors/pipedrive.d.ts +2 -0
- package/dist/mcp/connectors/pipedrive.js +20 -0
- package/dist/mcp/connectors/pipedrive.js.map +1 -0
- package/dist/mcp/connectors/slack.d.ts +2 -0
- package/dist/mcp/connectors/slack.js +21 -0
- package/dist/mcp/connectors/slack.js.map +1 -0
- package/dist/mcp/oauth-provider.d.ts +41 -0
- package/dist/mcp/oauth-provider.js +160 -0
- package/dist/mcp/oauth-provider.js.map +1 -0
- package/dist/server/index.js +97 -11
- package/dist/server/index.js.map +1 -1
- package/dist/server/plugin-loader.d.ts +8 -0
- package/dist/server/plugin-loader.js +54 -2
- package/dist/server/plugin-loader.js.map +1 -1
- package/dist/server/routes/chat.d.ts +3 -2
- package/dist/server/routes/chat.js +67 -16
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/git-api.d.ts +9 -0
- package/dist/server/routes/git-api.js +82 -0
- package/dist/server/routes/git-api.js.map +1 -0
- package/dist/server/routes/graph-api.d.ts +2 -2
- package/dist/server/routes/graph-api.js +164 -3
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/routes/workspace-api.d.ts +9 -0
- package/dist/server/routes/workspace-api.js +170 -0
- package/dist/server/routes/workspace-api.js.map +1 -0
- package/dist/services/assets/base.d.ts +2 -2
- package/dist/services/assets/base.js +4 -4
- package/dist/services/assets/base.js.map +1 -1
- package/dist/services/assets/index.d.ts +6 -6
- package/dist/services/assets/index.js +12 -12
- package/dist/services/assets/index.js.map +1 -1
- package/dist/services/git.d.ts +31 -0
- package/dist/services/git.js +92 -3
- package/dist/services/git.js.map +1 -1
- package/dist/services/github-provisioner.d.ts +8 -3
- package/dist/services/github-provisioner.js +35 -8
- package/dist/services/github-provisioner.js.map +1 -1
- package/dist/services/lint-service.js +8 -1
- package/dist/services/lint-service.js.map +1 -1
- package/dist/services/markdown.js +3 -3
- package/dist/services/markdown.js.map +1 -1
- package/dist/services/memory-service.d.ts +1 -1
- package/dist/services/memory-service.js +2 -3
- package/dist/services/memory-service.js.map +1 -1
- package/dist/services/orphan-service.d.ts +31 -0
- package/dist/services/orphan-service.js +100 -0
- package/dist/services/orphan-service.js.map +1 -0
- package/dist/services/sync/commit.d.ts +60 -0
- package/dist/services/sync/commit.js +370 -0
- package/dist/services/sync/commit.js.map +1 -0
- package/dist/services/sync/context-index.d.ts +69 -0
- package/dist/services/sync/context-index.js +280 -0
- package/dist/services/sync/context-index.js.map +1 -0
- package/dist/services/sync/derive.d.ts +34 -0
- package/dist/services/sync/derive.js +164 -0
- package/dist/services/sync/derive.js.map +1 -0
- package/dist/services/sync/enrichment-state.d.ts +31 -0
- package/dist/services/sync/enrichment-state.js +63 -0
- package/dist/services/sync/enrichment-state.js.map +1 -0
- package/dist/services/sync/enrichment.d.ts +25 -0
- package/dist/services/sync/enrichment.js +121 -0
- package/dist/services/sync/enrichment.js.map +1 -0
- package/dist/services/sync/frontmatter-extractor.d.ts +40 -0
- package/dist/services/sync/frontmatter-extractor.js +273 -0
- package/dist/services/sync/frontmatter-extractor.js.map +1 -0
- package/dist/services/sync/graph-match-state.d.ts +33 -0
- package/dist/services/sync/graph-match-state.js +61 -0
- package/dist/services/sync/graph-match-state.js.map +1 -0
- package/dist/services/sync/graph-match.d.ts +53 -0
- package/dist/services/sync/graph-match.js +316 -0
- package/dist/services/sync/graph-match.js.map +1 -0
- package/dist/services/sync/graphrag-client.d.ts +43 -0
- package/dist/services/sync/graphrag-client.js +94 -0
- package/dist/services/sync/graphrag-client.js.map +1 -0
- package/dist/services/sync/graphrag-config.d.ts +16 -0
- package/dist/services/sync/graphrag-config.js +39 -0
- package/dist/services/sync/graphrag-config.js.map +1 -0
- package/dist/services/sync/graphrag-context.d.ts +14 -0
- package/dist/services/sync/graphrag-context.js +109 -0
- package/dist/services/sync/graphrag-context.js.map +1 -0
- package/dist/services/sync/graphrag-indexer.d.ts +30 -0
- package/dist/services/sync/graphrag-indexer.js +358 -0
- package/dist/services/sync/graphrag-indexer.js.map +1 -0
- package/dist/services/sync/llm.d.ts +32 -0
- package/dist/services/sync/llm.js +115 -0
- package/dist/services/sync/llm.js.map +1 -0
- package/dist/services/sync/mcp-client.d.ts +59 -0
- package/dist/services/sync/mcp-client.js +285 -0
- package/dist/services/sync/mcp-client.js.map +1 -0
- package/dist/services/sync/model-factory.d.ts +10 -0
- package/dist/services/sync/model-factory.js +24 -0
- package/dist/services/sync/model-factory.js.map +1 -0
- package/dist/services/sync/name-quality.d.ts +31 -0
- package/dist/services/sync/name-quality.js +60 -0
- package/dist/services/sync/name-quality.js.map +1 -0
- package/dist/services/sync/output-schemas.d.ts +92 -0
- package/dist/services/sync/output-schemas.js +43 -0
- package/dist/services/sync/output-schemas.js.map +1 -0
- package/dist/services/sync/prompts.d.ts +19 -0
- package/dist/services/sync/prompts.js +128 -0
- package/dist/services/sync/prompts.js.map +1 -0
- package/dist/services/sync/reconciler.d.ts +48 -0
- package/dist/services/sync/reconciler.js +295 -0
- package/dist/services/sync/reconciler.js.map +1 -0
- package/dist/services/sync/source-config.d.ts +45 -0
- package/dist/services/sync/source-config.js +208 -0
- package/dist/services/sync/source-config.js.map +1 -0
- package/dist/services/sync/source-definitions/asana.d.ts +15 -0
- package/dist/services/sync/source-definitions/asana.js +48 -0
- package/dist/services/sync/source-definitions/asana.js.map +1 -0
- package/dist/services/sync/source-definitions/definitions.d.ts +21 -0
- package/dist/services/sync/source-definitions/definitions.js +26 -0
- package/dist/services/sync/source-definitions/definitions.js.map +1 -0
- package/dist/services/sync/source-definitions/gdrive.d.ts +16 -0
- package/dist/services/sync/source-definitions/gdrive.js +68 -0
- package/dist/services/sync/source-definitions/gdrive.js.map +1 -0
- package/dist/services/sync/source-definitions/granola.d.ts +2 -0
- package/dist/services/sync/source-definitions/granola.js +28 -0
- package/dist/services/sync/source-definitions/granola.js.map +1 -0
- package/dist/services/sync/source-definitions/linear.d.ts +2 -0
- package/dist/services/sync/source-definitions/linear.js +60 -0
- package/dist/services/sync/source-definitions/linear.js.map +1 -0
- package/dist/services/sync/source-definitions/obsidian.d.ts +2 -0
- package/dist/services/sync/source-definitions/obsidian.js +55 -0
- package/dist/services/sync/source-definitions/obsidian.js.map +1 -0
- package/dist/services/sync/source-definitions/pipedrive.d.ts +2 -0
- package/dist/services/sync/source-definitions/pipedrive.js +52 -0
- package/dist/services/sync/source-definitions/pipedrive.js.map +1 -0
- package/dist/services/sync/staging.d.ts +53 -0
- package/dist/services/sync/staging.js +131 -0
- package/dist/services/sync/staging.js.map +1 -0
- package/dist/services/sync/structured-extractor.d.ts +49 -0
- package/dist/services/sync/structured-extractor.js +344 -0
- package/dist/services/sync/structured-extractor.js.map +1 -0
- package/dist/services/sync/sync-runner.d.ts +32 -0
- package/dist/services/sync/sync-runner.js +195 -0
- package/dist/services/sync/sync-runner.js.map +1 -0
- package/dist/services/sync/sync-state.d.ts +43 -0
- package/dist/services/sync/sync-state.js +154 -0
- package/dist/services/sync/sync-state.js.map +1 -0
- package/dist/services/sync/types.d.ts +203 -0
- package/dist/services/sync/types.js +8 -0
- package/dist/services/sync/types.js.map +1 -0
- package/dist/services/sync/unstructured-extractor.d.ts +29 -0
- package/dist/services/sync/unstructured-extractor.js +197 -0
- package/dist/services/sync/unstructured-extractor.js.map +1 -0
- package/dist/services/vector-service.d.ts +11 -0
- package/dist/services/vector-service.js +42 -0
- package/dist/services/vector-service.js.map +1 -1
- package/dist/utils/git.d.ts +31 -4
- package/dist/utils/git.js +65 -7
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/merge-resolver.d.ts +60 -0
- package/dist/utils/merge-resolver.js +304 -0
- package/dist/utils/merge-resolver.js.map +1 -0
- package/dist/utils/preflight.d.ts +2 -1
- package/dist/utils/preflight.js +8 -1
- package/dist/utils/preflight.js.map +1 -1
- package/dist/utils/workspace-config.d.ts +8 -0
- package/dist/utils/workspace-config.js +22 -0
- package/dist/utils/workspace-config.js.map +1 -0
- package/dist/web/_app/env.js +1 -0
- package/dist/web/_app/immutable/assets/0.BwJV4fvl.css +1 -0
- package/dist/web/_app/immutable/assets/2.DRHi7ABa.css +1 -0
- package/dist/web/_app/immutable/assets/3.CnAQdPKU.css +1 -0
- package/dist/web/_app/immutable/assets/4.BG92MufE.css +1 -0
- package/dist/web/_app/immutable/assets/5.CfrQIPYs.css +1 -0
- package/dist/web/_app/immutable/assets/ChatPanel.BNzaCFTL.css +1 -0
- package/dist/web/_app/immutable/assets/editor.D6Rjo7RE.css +1 -0
- package/dist/web/_app/immutable/chunks/4QY4j-jX.js +1 -0
- package/dist/web/_app/immutable/chunks/B4G4uWkV.js +1 -0
- package/dist/web/_app/immutable/chunks/BB_5th5W.js +3383 -0
- package/dist/web/_app/immutable/chunks/CUzqHQY_.js +1 -0
- package/dist/web/_app/immutable/chunks/CYrVHOHA.js +1 -0
- package/dist/web/_app/immutable/chunks/CksE5s8n.js +1 -0
- package/dist/web/_app/immutable/chunks/CqkleIqs.js +1 -0
- package/dist/web/_app/immutable/chunks/D0JBkEPE.js +86 -0
- package/dist/web/_app/immutable/chunks/D2K5GzLj.js +1 -0
- package/dist/web/_app/immutable/chunks/DEkoussQ.js +2 -0
- package/dist/web/_app/immutable/chunks/DW-KmHRi.js +1 -0
- package/dist/web/_app/immutable/chunks/DcCr4z9k.js +1 -0
- package/dist/web/_app/immutable/chunks/Dg2wWwJu.js +2 -0
- package/dist/web/_app/immutable/chunks/Dh_H7Owr.js +18 -0
- package/dist/web/_app/immutable/chunks/DnlgZ_Tk.js +5 -0
- package/dist/web/_app/immutable/chunks/DtVH--hH.js +6 -0
- package/dist/web/_app/immutable/chunks/PPVm8Dsz.js +1 -0
- package/dist/web/_app/immutable/chunks/SBEriEQR.js +1 -0
- package/dist/web/_app/immutable/chunks/WSUKABI_.js +1 -0
- package/dist/web/_app/immutable/chunks/YTERt3Ul.js +6 -0
- package/dist/web/_app/immutable/chunks/m_R7HatS.js +1 -0
- package/dist/web/_app/immutable/chunks/vlmEnjfO.js +1 -0
- package/dist/web/_app/immutable/entry/app.B9pwpU_x.js +2 -0
- package/dist/web/_app/immutable/entry/start.CDuNCEco.js +1 -0
- package/dist/web/_app/immutable/nodes/0.YEQhw1us.js +1 -0
- package/dist/web/_app/immutable/nodes/1.CvmHhpRy.js +1 -0
- package/dist/web/_app/immutable/nodes/2.c5k1r7dq.js +1 -0
- package/dist/web/_app/immutable/nodes/3.B24tcdLK.js +1 -0
- package/dist/web/_app/immutable/nodes/4.kX2m5Pp9.js +16 -0
- package/dist/web/_app/immutable/nodes/5.DELt6wTD.js +2 -0
- package/dist/web/_app/version.json +1 -0
- package/dist/web/index.html +41 -0
- package/package.json +21 -7
- /package/dist/agent/skills/{bundled/gather-context.md → gather-context.md} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DtVH--hH.js","./DnlgZ_Tk.js","./Dh_H7Owr.js","./4QY4j-jX.js","./CUzqHQY_.js","./CksE5s8n.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{d as ei,b as wt,e as De,a as x,j as N,f as K,q as lt,s as gn}from"./SBEriEQR.js";import{b0 as wo,h as bo,a as xo,br as So,b as Ao,au as Eo,B as tn,n as ut,P as L,Q as Xt,A as vt,aM as ni,t as R,u as nt,w as M,F as c,U as m,q as dt,V as D,x as yt,Y as _,bs as Er,a0 as Oo,a1 as Te,bt as Po,o as Ln,R as _o,z as Co,bp as pt,bu as To,bv as ri,S as ii,X as ko,v as _n,W as Xe,b8 as Mo}from"./D2K5GzLj.js";import{s as ht,c as oi,m as Fo,u as Ro}from"./DEkoussQ.js";import{p as b,i as at,b as Yn,s as Ct,r as ie,l as oe}from"./DW-KmHRi.js";import{b as si,e as Yt,i as te,I as se,s as ae,d as Do,P as Or,g as Pr}from"./D0JBkEPE.js";import{c as ue}from"./DcCr4z9k.js";import{r as Bn,b as Qe,w as ai,k as Cn,s as st,i as he,e as Io,h as Tn,a as No,u as Lo,l as Bo}from"./Dg2wWwJu.js";import{g as Wo}from"./B4G4uWkV.js";import{B as zo}from"./m_R7HatS.js";import"./vlmEnjfO.js";import{_ as be}from"./PPVm8Dsz.js";function Vo(){return Symbol(wo)}const Ko=Symbol("NaN");function Ho(e,t,n){bo&&xo();var r=new zo(e),i=!So();Ao(()=>{var s=t();s!==s&&(s=Ko),i&&s!==null&&typeof s=="object"&&(s={}),r.ensure(s,n)})}function Uo(e,t,n){Eo(()=>{var r=tn(()=>t(e,n?.())||{});if(r?.destroy)return()=>r.destroy()})}var jo=K('<span class="chip svelte-84vb17"> <button class="chip-remove svelte-84vb17">×</button></span>'),Yo=K('<div><span class="entity-title svelte-84vb17"> </span> <span class="entity-meta svelte-84vb17"><span class="entity-type-badge svelte-84vb17"> </span> <span class="entity-repo svelte-84vb17"> </span></span></div>'),Go=K('<div class="dropdown svelte-84vb17"></div>'),Xo=K('<div class="autocomplete svelte-84vb17"><div class="input-row svelte-84vb17"><!> <input class="ac-input svelte-84vb17" type="text" placeholder="Search entities..."/></div> <!></div>');function qo(e,t){ut(t,!0);let n=b(t,"multi",3,!1),r=L(""),i=L(0),s;const o=_(()=>ai.repos.flatMap(E=>E.entities.map(T=>({id:T.id,title:T.title,entityType:T.entityType,repo:E.name})))),a=_(()=>()=>{const E=c(r).toLowerCase().trim();return E?c(o).filter(T=>T.title.toLowerCase().includes(E)||T.id.toLowerCase().includes(E)).slice(0,20):c(o).slice(0,20)}),l=Array.isArray(t.value)?[...t.value]:t.value?[t.value]:[];let u=L(Xt(l));vt(()=>{ni().then(()=>s?.focus())});function h(E){n()?(c(u).includes(E)||m(u,[...c(u),E],!0),m(r,""),m(i,0),s?.focus()):t.onselect(E)}function d(E){m(u,c(u).filter(T=>T!==E),!0)}function f(){t.onselect(c(u))}function v(E){const T=c(a)();E.key==="ArrowDown"?(E.preventDefault(),m(i,Math.min(c(i)+1,T.length-1),!0)):E.key==="ArrowUp"?(E.preventDefault(),m(i,Math.max(c(i)-1,0),!0)):E.key==="Enter"?(E.preventDefault(),T.length>0?h(T[c(i)].id):n()&&f()):E.key==="Escape"?n()&&c(u).length>0?f():t.oncancel():E.key==="Backspace"&&!c(r)&&n()&&c(u).length>0&&m(u,c(u).slice(0,-1),!0)}var p=Xo(),g=R(p),w=R(g);{var A=E=>{var T=N(),Q=D(T);Yt(Q,17,()=>c(u),te,(k,I)=>{var W=jo(),H=R(W),$=nt(H);M(W),yt(()=>ht(H,`${c(I)??""} `)),wt("click",$,()=>d(c(I))),x(k,W)}),x(E,T)};at(w,E=>{n()&&E(A)})}var C=nt(w,2);Bn(C),Yn(C,E=>s=E,()=>s),M(g);var F=nt(g,2);{var S=E=>{var T=Go();Yt(T,21,()=>c(a)(),te,(Q,k,I)=>{var W=Yo();let H;var $=R(W),tt=R($,!0);M($);var X=nt($,2),z=R(X),Y=R(z,!0);M(z);var G=nt(z,2),At=R(G,!0);M(G),M(X),M(W),yt(()=>{H=Qe(W,1,"dropdown-item svelte-84vb17",null,H,{highlighted:I===c(i)}),ht(tt,c(k).title),ht(Y,c(k).entityType),ht(At,c(k).repo)}),wt("mousedown",W,Pe=>{Pe.preventDefault(),h(c(k).id)}),De("mouseenter",W,()=>m(i,I,!0)),x(Q,W)}),M(T),x(E,T)},B=_(()=>c(a)().length>0);at(F,E=>{c(B)&&E(S)})}M(p),wt("keydown",C,v),De("blur",C,()=>{setTimeout(()=>{n()&&c(u).length>0?f():n()||t.oncancel()},150)}),si(C,()=>c(r),E=>m(r,E)),x(e,p),dt()}ei(["click","keydown","mousedown"]);function Zo(e){return typeof e=="function"}function Be(e){return e!==null&&typeof e=="object"}const Jo=["string","number","bigint","boolean"];function Wn(e){return e==null||Jo.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>Wn(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Se=Symbol("box"),vn=Symbol("is-writable");function O(e,t){const n=_(e);return t?{[Se]:!0,[vn]:!0,get current(){return c(n)},set current(r){t(r)}}:{[Se]:!0,get current(){return e()}}}function We(e){return Be(e)&&Se in e}function Gn(e){return We(e)&&vn in e}function ci(e){return We(e)?e:Zo(e)?O(e):Wt(e)}function Qo(e){return Object.entries(e).reduce((t,[n,r])=>We(r)?(Gn(r)?Object.defineProperty(t,n,{get(){return r.current},set(i){r.current=i}}):Object.defineProperty(t,n,{get(){return r.current}}),t):Object.assign(t,{[n]:r}),{})}function $o(e){return Gn(e)?{[Se]:!0,get current(){return e.current}}:e}function Wt(e){let t=L(Xt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}function ye(e){let t=L(Xt(e));return{[Se]:!0,[vn]:!0,get current(){return c(t)},set current(n){m(t,n,!0)}}}ye.from=ci;ye.with=O;ye.flatten=Qo;ye.readonly=$o;ye.isBox=We;ye.isWritableBox=Gn;function li(...e){return function(t){for(const n of e)if(n){if(t.defaultPrevented)return;typeof n=="function"?n.call(this,t):n.current?.call(this,t)}}}var _r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ts=/\n/g,es=/^\s*/,ns=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,rs=/^:\s*/,is=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,os=/^[;\s]*/,ss=/^\s+|\s+$/g,as=`
|
|
3
|
+
`,Cr="/",Tr="*",fe="",cs="comment",ls="declaration";function us(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var g=p.match(ts);g&&(n+=g.length);var w=p.lastIndexOf(as);r=~w?p.length-w:r+p.length}function s(){var p={line:n,column:r};return function(g){return g.position=new o(p),u(),g}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(p){var g=p.exec(e);if(g){var w=g[0];return i(w),e=e.slice(w.length),g}}function u(){l(es)}function h(p){var g;for(p=p||[];g=d();)g!==!1&&p.push(g);return p}function d(){var p=s();if(!(Cr!=e.charAt(0)||Tr!=e.charAt(1))){for(var g=2;fe!=e.charAt(g)&&(Tr!=e.charAt(g)||Cr!=e.charAt(g+1));)++g;if(g+=2,fe===e.charAt(g-1))return a("End of comment missing");var w=e.slice(2,g-2);return r+=2,i(w),e=e.slice(g),r+=2,p({type:cs,comment:w})}}function f(){var p=s(),g=l(ns);if(g){if(d(),!l(rs))return a("property missing ':'");var w=l(is),A=p({type:ls,property:kr(g[0].replace(_r,fe)),value:w?kr(w[0].replace(_r,fe)):fe});return l(os),A}}function v(){var p=[];h(p);for(var g;g=f();)g!==!1&&(p.push(g),h(p));return p}return u(),v()}function kr(e){return e?e.replace(ss,fe):fe}function ds(e,t){let n=null;if(!e||typeof e!="string")return n;const r=us(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}const fs=/\d/,hs=["-","_","/","."];function gs(e=""){if(!fs.test(e))return e!==e.toLowerCase()}function vs(e){const t=[];let n="",r,i;for(const s of e){const o=hs.includes(s);if(o===!0){t.push(n),n="",r=void 0;continue}const a=gs(s);if(i===!1){if(r===!1&&a===!0){t.push(n),n=s,r=a;continue}if(r===!0&&a===!1&&n.length>1){const l=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=l+s,r=a;continue}}n+=s,r=a,i=o}return t.push(n),t}function ui(e){return e?vs(e).map(t=>ms(t)).join(""):""}function ps(e){return ys(ui(e||""))}function ms(e){return e?e[0].toUpperCase()+e.slice(1):""}function ys(e){return e?e[0].toLowerCase()+e.slice(1):""}function Re(e){if(!e)return{};const t={};function n(r,i){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){t[ui(r)]=i;return}if(r.startsWith("--")){t[r]=i;return}t[ps(r)]=i}return ds(e,n),t}function ge(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}function ws(e,t){const n=RegExp(e,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,t):r}}const bs=ws(/[A-Z]/,e=>`-${e.toLowerCase()}`);function xs(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${bs(t)}: ${e[t]};`).join(`
|
|
4
|
+
`)}function di(e={}){return xs(e).replace(`
|
|
5
|
+
`," ")}const Ss=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],As=new Set(Ss);function Es(e){return As.has(e)}function qt(...e){const t={...e[0]};for(let n=1;n<e.length;n++){const r=e[n];if(r){for(const i of Object.keys(r)){const s=t[i],o=r[i],a=typeof s=="function",l=typeof o=="function";if(a&&Es(i)){const u=s,h=o;t[i]=li(u,h)}else if(a&&l)t[i]=ge(s,o);else if(i==="class"){const u=Wn(s),h=Wn(o);u&&h?t[i]=Cn(s,o):u?t[i]=Cn(s):h&&(t[i]=Cn(o))}else if(i==="style"){const u=typeof s=="object",h=typeof o=="object",d=typeof s=="string",f=typeof o=="string";if(u&&h)t[i]={...s,...o};else if(u&&f){const v=Re(o);t[i]={...s,...v}}else if(d&&h){const v=Re(s);t[i]={...v,...o}}else if(d&&f){const v=Re(s),p=Re(o);t[i]={...v,...p}}else u?t[i]=s:h?t[i]=o:d?t[i]=s:f&&(t[i]=o)}else t[i]=o!==void 0?o:s}for(const i of Object.getOwnPropertySymbols(r)){const s=t[i],o=r[i];t[i]=o!==void 0?o:s}}}return typeof t.style=="object"&&(t.style=di(t.style).replaceAll(`
|
|
6
|
+
`," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const fi=typeof window<"u"?window:void 0;function Os(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Ps extends Map{#t=new Map;#e=L(0);#n=L(0);#r=Er||-1;constructor(t){if(super(),t){for(var[n,r]of t)super.set(n,r);this.#n.v=super.size}}#i(t){return Er===this.#r?L(t):Oo(t)}has(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else return c(this.#e),!1;return c(r),!0}forEach(t,n){this.#o(),super.forEach(t,n)}get(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#i(0),n.set(t,r);else{c(this.#e);return}return c(r),super.get(t)}set(t,n){var r=this.#t,i=r.get(t),s=super.get(t),o=super.set(t,n),a=this.#e;if(i===void 0)i=this.#i(0),r.set(t,i),m(this.#n,super.size),Te(a);else if(s!==n){Te(i);var l=a.reactions===null?null:new Set(a.reactions),u=l===null||!i.reactions?.every(h=>l.has(h));u&&Te(a)}return o}delete(t){var n=this.#t,r=n.get(t),i=super.delete(t);return r!==void 0&&(n.delete(t),m(r,-1)),i&&(m(this.#n,super.size),Te(this.#e)),i}clear(){if(super.size!==0){super.clear();var t=this.#t;m(this.#n,0);for(var n of t.values())m(n,-1);Te(this.#e),t.clear()}}#o(){c(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var n of super.keys())if(!t.has(n)){var r=this.#i(0);t.set(n,r)}}for([,r]of this.#t)c(r)}keys(){return c(this.#e),super.keys()}values(){return this.#o(),super.values()}entries(){return this.#o(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return c(this.#n),super.size}}class _s{#t;#e;constructor(t={}){const{window:n=fi,document:r=n?.document}=t;n!==void 0&&(this.#t=r,this.#e=oi(i=>{const s=lt(n,"focusin",i),o=lt(n,"focusout",i);return()=>{s(),o()}}))}get current(){return this.#e?.(),this.#t?Os(this.#t):null}}new _s;function Cs(e){return typeof e=="function"}class we{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return Po(this.#e)}get(){const t=Ln(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const n=Ln(this.#e);return n===void 0?t:n}set(t){return _o(this.#e,t)}}function Ts(e,t){switch(e){case"post":vt(t);break;case"pre":Co(t);break}}function hi(e,t,n,r={}){const{lazy:i=!1}=r;let s=!i,o=Array.isArray(e)?[]:void 0;Ts(t,()=>{const a=Array.isArray(e)?e.map(u=>u()):e();if(!s){s=!0,o=a;return}const l=tn(()=>n(a,o));return o=a,l})}function St(e,t,n){hi(e,"post",t,n)}function ks(e,t,n){hi(e,"pre",t,n)}St.pre=ks;function Mr(e){return Cs(e)?e():e}class Ms{#t={width:0,height:0};#e=!1;#n;#r;#i;#o=_(()=>(c(this.#s)?.(),this.getSize().width));#a=_(()=>(c(this.#s)?.(),this.getSize().height));#s=_(()=>{const t=Mr(this.#r);if(t)return oi(n=>{if(!this.#i)return;const r=new this.#i.ResizeObserver(i=>{this.#e=!0;for(const s of i){const o=this.#n.box==="content-box"?s.contentBoxSize:s.borderBoxSize,a=Array.isArray(o)?o:[o];this.#t.width=a.reduce((l,u)=>Math.max(l,u.inlineSize),0),this.#t.height=a.reduce((l,u)=>Math.max(l,u.blockSize),0)}n()});return r.observe(t),()=>{this.#e=!1,r.disconnect()}})});constructor(t,n={box:"border-box"}){this.#i=n.window??fi,this.#n=n,this.#r=t,this.#t={width:0,height:0}}calculateSize(){const t=Mr(this.#r);if(!t||!this.#i)return;const n=t.offsetWidth,r=t.offsetHeight;if(this.#n.box==="border-box")return{width:n,height:r};const i=this.#i.getComputedStyle(t),s=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),o=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),a=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),l=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),u=n-s-a,h=r-o-l;return{width:u,height:h}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return c(this.#s)?.(),this.getSize()}get width(){return c(this.#o)}get height(){return c(this.#a)}}function ze(e){vt(()=>()=>{e()})}function Fs(e,t){return setTimeout(t,e)}function Gt(e){ni().then(e)}const Rs=1,Ds=9,Is=11;function zn(e){return Be(e)&&e.nodeType===Rs&&typeof e.nodeName=="string"}function gi(e){return Be(e)&&e.nodeType===Ds}function Ns(e){return Be(e)&&e.constructor?.name==="VisualViewport"}function Ls(e){return Be(e)&&e.nodeType!==void 0}function vi(e){return Ls(e)&&e.nodeType===Is&&"host"in e}function Bs(e,t){if(!e||!t||!zn(e)||!zn(t))return!1;const n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&vi(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ve(e){return gi(e)?e:Ns(e)?e.document:e?.ownerDocument??document}function Xn(e){return vi(e)?Xn(e.host):gi(e)?e.defaultView??window:zn(e)?e.ownerDocument?.defaultView??window:window}function Ws(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class qn{element;#t=_(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return c(this.#t)}set root(t){m(this.#t,t)}constructor(t){typeof t=="function"?this.element=O(t):this.element=t}getDocument=()=>Ve(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>Ws(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,n)=>this.getWindow().setTimeout(t,n);clearTimeout=t=>this.getWindow().clearTimeout(t)}function ve(e,t){return{[Vo()]:n=>We(e)?(e.current=n,tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),tn(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e(null),t?.(null))})}}function pi(e){return e?"true":"false"}function mi(e){return e?"":void 0}function yi(e){return e?"open":"closed"}class zs{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(n=>[n,this.getAttr(n)]))}getAttr(t,n){return n?`data-${n}-${t}`:`${this.#e}${t}`}selector(t,n){return`[${this.getAttr(t,n)}]`}}function Vs(e){const t=new zs(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const Ne="ArrowDown",Zn="ArrowLeft",Jn="ArrowRight",en="ArrowUp",wi="End",bi="Enter",Ks="Escape",xi="Home",Hs="PageDown",Us="PageUp",Qn=" ",js="Tab";function Ys(e){return window.getComputedStyle(e).getPropertyValue("direction")}function Gs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Zn:Jn,vertical:Ne}[t]}function Xs(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Jn:Zn,vertical:en}[t]}function qs(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:Gs(e,t),prevKey:Xs(e,t)}}const Si=typeof document<"u",Fr=Zs();function Zs(){return Si&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function Zt(e){return e instanceof HTMLElement}function Vn(e){return e instanceof Element}function Ai(e){return e instanceof Element||e instanceof SVGElement}function Js(e){return e!==null}function Qs(e){return e instanceof HTMLInputElement&&"select"in e}class $s{#t;#e=ye(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,n,r=!1){const i=this.#t.rootNode.current;if(!i||!t)return;const s=this.getCandidateNodes();if(!s.length)return;const o=s.indexOf(t),a=Ys(i),{nextKey:l,prevKey:u}=qs(a,this.#t.orientation.current),h=this.#t.loop.current,d={[l]:o+1,[u]:o-1,[xi]:0,[wi]:s.length-1};if(r){const p=l===Ne?Jn:Ne,g=u===en?Zn:en;d[p]=o+1,d[g]=o-1}let f=d[n.key];if(f===void 0)return;n.preventDefault(),f<0&&h?f=s.length-1:f===s.length&&h&&(f=0);const v=s[f];if(v)return v.focus(),this.#e.current=v.id,this.#t.onCandidateFocus?.(v),v}getTabIndex(t){const n=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&n[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const n=this.#t.rootNode.current?.querySelector(`#${t}`);!n||!Zt(n)||n.focus()}}class ta{#t;#e=null;constructor(t){this.#t=t,ze(()=>this.#n())}#n(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#n();const n=this.#t.ref.current;if(n){if(typeof n.getAnimations!="function"){this.#r(t);return}this.#e=window.requestAnimationFrame(()=>{const r=n.getAnimations();if(r.length===0){this.#r(t);return}Promise.allSettled(r.map(i=>i.finished)).then(()=>{this.#r(t)})})}}#r(t){const n=()=>{t()};this.#t.afterTick?Gt(n):n()}}class ea{#t;#e;#n;#r=L(!1);constructor(t){this.#t=t,m(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new ta({ref:this.#t.ref,afterTick:this.#t.open}),St(()=>this.#t.open.current,n=>{n&&m(this.#r,!0),this.#e&&this.#n.run(()=>{n===this.#t.open.current&&(this.#t.open.current||m(this.#r,!1),this.#t.onComplete?.())})})}get shouldRender(){return c(this.#r)}}function ct(){}function pn(e,t){return`bits-${e}`}function na(e,t){var n=N(),r=D(n);Ho(r,()=>t.children,i=>{var s=N(),o=D(s);st(o,()=>t.children??pt),x(i,s)}),x(e,n)}const ra=new we("BitsConfig");function ia(){const e=new oa(null,{});return ra.getOr(e).opts}class oa{opts;constructor(t,n){const r=sa(t,n);this.opts={defaultPortalTo:r(i=>i.defaultPortalTo),defaultLocale:r(i=>i.defaultLocale)}}}function sa(e,t){return n=>O(()=>{const i=n(t)?.current;if(i!==void 0)return i;if(e!==null)return n(e.opts)?.current})}function aa(e,t){return n=>{const r=ia();return O(()=>{const i=n();if(i!==void 0)return i;const s=e(r).current;return s!==void 0?s:t})}}const ca=aa(e=>e.defaultPortalTo,"body");function la(e,t){ut(t,!0);const n=ca(()=>t.to),r=To();let i=_(s);function s(){if(!Si||t.disabled)return null;let d=null;return typeof n.current=="string"?d=document.querySelector(n.current):d=n.current,d}let o;function a(){o&&(Ro(o),o=null)}St([()=>c(i),()=>t.disabled],([d,f])=>{if(!d||f){a();return}return o=Fo(na,{target:d,props:{children:t.children},context:r}),()=>{a()}});var l=N(),u=D(l);{var h=d=>{var f=N(),v=D(f);st(v,()=>t.children??pt),x(d,f)};at(u,d=>{t.disabled&&d(h)})}x(e,l),dt()}class ua{eventName;options;constructor(t,n={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=n}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,n){const r=this.createEvent(n);return t.dispatchEvent(r),r}listen(t,n,r){const i=s=>{n(s)};return lt(t,this.eventName,i,r)}}function Rr(e,t=500){let n=null;const r=(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function Ei(e,t){return e===t||e.contains(t)}function Oi(e){return e?.ownerDocument??document}function da(e,t){const{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}const fa=[bi,Qn],ha=[Ne,Us,xi],Pi=[en,Hs,wi],ga=[...ha,...Pi];function Dr(e){return e.pointerType==="mouse"}function va(e,{select:t=!1}={}){if(!e||!e.focus)return;const n=Ve(e);if(n.activeElement===e)return;const r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&Qs(e)&&t&&e.select()}function pa(e,{select:t=!1}={},n){const r=n();for(const i of e)if(va(i,{select:t}),n()!==r)return!0}let ke=L(!1);class ee{static _refs=0;static _cleanup;constructor(){vt(()=>(ee._refs===0&&(ee._cleanup=ri(()=>{const t=[],n=i=>{m(ke,!1)},r=i=>{m(ke,!0)};return t.push(lt(document,"pointerdown",n,{capture:!0}),lt(document,"pointermove",n,{capture:!0}),lt(document,"keydown",r,{capture:!0})),ge(...t)})),ee._refs++,()=>{ee._refs--,ee._refs===0&&(m(ke,!1),ee._cleanup?.())}))}get current(){return c(ke)}set current(t){m(ke,t,!0)}}var _i=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],nn=_i.join(","),Ci=typeof Element>"u",pe=Ci?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rn=!Ci&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},on=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):on(t.parentNode));return o},ma=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Ti=function(t,n,r){if(on(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(nn));return n&&pe.call(t,nn)&&i.unshift(t),i=i.filter(r),i},sn=function(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!on(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,u=sn(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:o,candidates:u})}else{var h=pe.call(o,nn);h&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),f=!on(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&f){var v=sn(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return i},ki=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Mi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ma(t))&&!ki(t)?0:t.tabIndex},ya=function(t,n){var r=Mi(t);return r<0&&n&&!ki(t)?0:r},wa=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Fi=function(t){return t.tagName==="INPUT"},ba=function(t){return Fi(t)&&t.type==="hidden"},xa=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Sa=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Aa=function(t){if(!t.name)return!0;var n=t.form||rn(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Sa(i,t.form);return!s||s===t},Ea=function(t){return Fi(t)&&t.type==="radio"},Oa=function(t){return Ea(t)&&!Aa(t)},Pa=function(t){var n,r=t&&rn(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var u,h,d;r=rn(i),i=(u=r)===null||u===void 0?void 0:u.host,s=!!((h=i)!==null&&h!==void 0&&(d=h.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},Ir=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},_a=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var o=pe.call(t,"details>summary:first-of-type"),a=o?t.parentElement:t;if(pe.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,h=rn(t);if(u&&!u.shadowRoot&&i(u)===!0)return Ir(t);t.assignedSlot?t=t.assignedSlot:!u&&h!==t.ownerDocument?t=h.host:t=u}t=l}if(Pa(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ir(t);return!1},Ca=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return pe.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},an=function(t,n){return!(n.disabled||ba(n)||_a(n,t)||xa(n)||Ca(n))},Kn=function(t,n){return!(Oa(n)||Mi(n)<0||!an(t,n))},Ta=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ri=function(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=ya(a,o),u=o?Ri(i.candidates):a;l===0?o?n.push.apply(n,u):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:u})}),r.sort(wa).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Di=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:Kn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ta}):r=Ti(t,n.includeContainer,Kn.bind(null,n)),Ri(r)},Ii=function(t,n){n=n||{};var r;return n.getShadowRoot?r=sn([t],n.includeContainer,{filter:an.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Ti(t,n.includeContainer,an.bind(null,n)),r},$n=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return pe.call(t,nn)===!1?!1:Kn(n,t)},ka=_i.concat("iframe:not([inert]):not([inert] *)").join(","),Ni=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return pe.call(t,ka)===!1?!1:an(n,t)};function Ie(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function Ma(e,t){if(!$n(e,Ie()))return Fa(e,t);const n=Ve(e),r=Di(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function Fa(e,t){const n=Ve(e);if(!Ni(e,Ie()))return n.body;const r=Ii(n.body,Ie());t==="prev"&&r.reverse();const i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(o=>$n(o,Ie()))??n.body}function Li(e,t,n){const r=t.toLowerCase();if(r.endsWith(" ")){const d=r.slice(0,-1);if(e.filter(g=>g.toLowerCase().startsWith(d)).length<=1)return Li(e,d,n);const v=n?.toLowerCase();if(v&&v.startsWith(d)&&v.charAt(d.length)===" "&&t.trim()===d)return n;const p=e.filter(g=>g.toLowerCase().startsWith(r));if(p.length>0){const g=n?e.indexOf(n):-1;return Nr(p,Math.max(g,0)).find(C=>C!==n)||n}}const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=s.toLowerCase(),a=n?e.indexOf(n):-1;let l=Nr(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d?.toLowerCase().startsWith(o));return h!==n?h:void 0}function Nr(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Ra={afterMs:1e4,onChange:ct};function Bi(e,t){const{afterMs:n,onChange:r,getWindow:i}={...Ra,...t};let s=null,o=L(Xt(e));function a(){return i().setTimeout(()=>{m(o,e,!0),r?.(e)},n)}return vt(()=>()=>{s&&i().clearTimeout(s)}),O(()=>c(o),l=>{m(o,l,!0),r?.(l),s&&i().clearTimeout(s),s=a()})}class Da{#t;#e;#n=_(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=_(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Bi("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,n){if(!n.length)return;this.#e.current=this.#e.current+t;const r=c(this.#r)(),i=n.find(l=>l===r)?.textContent?.trim()??"",s=n.map(l=>l.textContent?.trim()??""),o=Li(s,this.#e.current,i),a=n.find(l=>l.textContent?.trim()===o);return a&&c(this.#n)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class Ia{#t;#e;#n;#r=L(null);constructor(t){this.#t=t,this.#e=_(()=>this.#t.enabled()),this.#n=Bi(!1,{afterMs:t.transitTimeout??300,onChange:n=>{c(this.#e)&&this.#t.setIsPointerInTransit?.(n)},getWindow:()=>Xn(this.#t.triggerNode())}),St([t.triggerNode,t.contentNode,t.enabled],([n,r,i])=>{if(!n||!r||!i)return;const s=a=>{this.#o(a,r)},o=a=>{this.#o(a,n)};return ge(lt(n,"pointerleave",s),lt(r,"pointerleave",o))}),St(()=>c(this.#r),()=>{const n=i=>{if(!c(this.#r))return;const s=i.target;if(!Vn(s))return;const o={x:i.clientX,y:i.clientY},a=t.triggerNode()?.contains(s)||t.contentNode()?.contains(s),l=!Wa(o,c(this.#r));a?this.#i():l&&(this.#i(),t.onPointerExit())},r=Ve(t.triggerNode()??t.contentNode());if(r)return lt(r,"pointermove",n)})}#i(){m(this.#r,null),this.#n.current=!1}#o(t,n){const r=t.currentTarget;if(!Zt(r))return;const i={x:t.clientX,y:t.clientY},s=Na(i,r.getBoundingClientRect()),o=La(i,s),a=Ba(n.getBoundingClientRect()),l=za([...o,...a]);m(this.#r,l,!0),this.#n.current=!0}}function Na(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function La(e,t,n=5){const r=n*1.5;switch(t){case"top":return[{x:e.x-n,y:e.y+n},{x:e.x,y:e.y-r},{x:e.x+n,y:e.y+n}];case"bottom":return[{x:e.x-n,y:e.y-n},{x:e.x,y:e.y+r},{x:e.x+n,y:e.y-n}];case"left":return[{x:e.x+n,y:e.y-n},{x:e.x-r,y:e.y},{x:e.x+n,y:e.y+n}];case"right":return[{x:e.x-n,y:e.y-n},{x:e.x+r,y:e.y},{x:e.x-n,y:e.y+n}]}}function Ba(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Wa(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s].x,l=t[s].y,u=t[o].x,h=t[o].y;l>r!=h>r&&n<(u-a)*(r-l)/(h-l)+a&&(i=!i)}return i}function za(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Va(t)}function Va(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const Ka="data-context-menu-trigger",Ha="data-context-menu-content",Wi=new we("Menu.Root"),tr=new we("Menu.Root | Menu.Sub"),zi=new we("Menu.Content"),Ua=new ua("bitsmenuopen",{bubbles:!1,cancelable:!0}),ja=Vs({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class er{static create(t){const n=new er(t);return Wi.set(n)}opts;isUsingKeyboard=new ee;#t=L(!1);get ignoreCloseAutoFocus(){return c(this.#t)}set ignoreCloseAutoFocus(t){m(this.#t,t,!0)}#e=L(!1);get isPointerInTransit(){return c(this.#e)}set isPointerInTransit(t){m(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>ja.getAttr(t,this.opts.variant.current)}class nr{static create(t,n){return tr.set(new nr(t,n,null))}opts;root;parentMenu;contentId=O(()=>"");#t=L(null);get contentNode(){return c(this.#t)}set contentNode(t){m(this.#t,t,!0)}contentPresence;#e=L(null);get triggerNode(){return c(this.#e)}set triggerNode(t){m(this.#e,t,!0)}constructor(t,n,r){this.opts=t,this.root=n,this.parentMenu=r,this.contentPresence=new ea({ref:O(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&St(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class rr{static create(t){return zi.set(new rr(t,tr.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=L("");get search(){return c(this.#t)}set search(t){m(this.#t,t,!0)}#e=0;#n;#r=L(!1);get mounted(){return c(this.#r)}set mounted(t){m(this.#r,t,!0)}#i;constructor(t,n){this.opts=t,this.parentMenu=n,this.domContext=new qn(t.ref),this.attachment=ve(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),n.contentId=t.id,this.#i=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Ia({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new Da({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new $s({rootNode:O(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:O(()=>"vertical")}),St(()=>this.parentMenu.contentNode,r=>{if(!r)return;const i=()=>{Gt(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return Ua.listen(r,i)}),vt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#o(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#i)&&this.parentMenu.triggerNode&&$n(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())};handleTabKeyDown(t){let n=this.parentMenu;for(;n.parentMenu!==null;)n=n.parentMenu;if(!n.triggerNode)return;t.preventDefault();const r=Ma(n.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,n.onClose(),Gt(()=>{r.focus(),Gt(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===js){this.handleTabKeyDown(t);return}const n=t.target,r=t.currentTarget;if(!Zt(n)||!Zt(r))return;const i=n.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,s=t.ctrlKey||t.altKey||t.metaKey,o=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(n,t)||t.code==="Space")return;const l=this.#o();i&&!s&&o&&this.#n(t.key,l),t.target?.id===this.parentMenu.contentId.current&&ga.includes(t.key)&&(t.preventDefault(),Pi.includes(t.key)&&l.reverse(),pa(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){Vn(t.currentTarget)&&Vn(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Gt(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!Ai(t.target))return;const n=this.parentMenu.triggerNode?.id;if(t.target.id===n){t.preventDefault();return}t.target.closest(`#${n}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=_(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return c(this.#s)}set snippetProps(t){m(this.#s,t)}#c=_(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":yi(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return c(this.#c)}set props(t){m(this.#c,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class Ya{opts;content;attachment;#t=L(!1);constructor(t,n){this.opts=t,this.content=n,this.attachment=ve(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&Dr(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!Zt(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||Dr(t)&&this.content.onItemLeave(t)}onfocus(t){Gt(()=>{t.defaultPrevented||this.opts.disabled.current||m(this.#t,!0)})}onblur(t){Gt(()=>{t.defaultPrevented||m(this.#t,!1)})}#e=_(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":pi(this.opts.disabled.current),"data-disabled":mi(this.opts.disabled.current),"data-highlighted":c(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}class ir{static create(t){const n=new Ya(t,zi.get());return new ir(t,n)}opts;item;root;#t=!1;constructor(t,n){this.opts=t,this.item=n,this.root=n.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const n=this.item.content.search!=="";if(!(this.item.opts.disabled.current||n&&t.key===Qn)&&fa.includes(t.key)){if(!Zt(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!Zt(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=_(()=>qt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return c(this.#n)}set props(t){m(this.#n,t)}}class or{static create(t){return new or(t,Wi.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=ve(this.opts.ref)}#t=_(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return c(this.#t)}set props(t){m(this.#t,t)}}class sr{static create(t){return new sr(t,tr.get())}opts;parentMenu;attachment;constructor(t,n){this.opts=t,this.parentMenu=n,this.attachment=ve(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===Qn||t.key===bi){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Ne&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=_(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=_(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":pi(this.parentMenu.opts.open.current),"aria-controls":c(this.#t),"data-disabled":mi(this.opts.disabled.current),"data-state":yi(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return c(this.#e)}set props(t){m(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class ar{static create(t){return new ar(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#i=!1;#o=void 0;#a;#s=ct;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,vt(()=>{this.#o=Oi(this.opts.ref.current)});let n=ct;const r=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),n()};St([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Fs(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),n(),n=this.#d())}),r}),ze(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#l.destroy(),this.#s(),n()})}#c=t=>{t.defaultPrevented||this.opts.ref.current&&Gt(()=>{!this.opts.ref.current||this.#p(t.target)||t.target&&!this.#i&&this.#a.current?.(t)})};#d(){return ge(lt(this.#o,"pointerdown",ge(this.#h,this.#v),{capture:!0}),lt(this.#o,"pointerdown",ge(this.#g,this.#l)),lt(this.#o,"focusin",this.#c))}#u=t=>{let n=t;n.defaultPrevented&&(n=Lr(t)),this.#t.current(t)};#l=Rr(t=>{if(!this.opts.ref.current){this.#s();return}const n=this.opts.isValidEvent.current(t,this.opts.ref.current)||qa(t,this.opts.ref.current);if(!this.#r||this.#m()||!n){this.#s();return}let r=t;if(r.defaultPrevented&&(r=Lr(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=lt(this.#o,"click",this.#u,{once:!0})):this.#t.current(r)},10);#h=t=>{this.#n[t.type]=!0};#g=t=>{this.#n[t.type]=!1};#v=()=>{this.opts.ref.current&&(this.#r=Xa(this.opts.ref.current))};#p=t=>this.opts.ref.current?Ei(this.opts.ref.current,t):!1;#f=Rr(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#m(){return Object.values(this.#n).some(Boolean)}#y=()=>{this.#i=!0};#w=()=>{this.#i=!1};props={onfocuscapture:this.#y,onblurcapture:this.#w}}function Ga(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:n}])=>n==="close"||n==="ignore")}function Xa(e){const t=[...globalThis.bitsDismissableLayers],n=Ga(t);if(n)return n[0].opts.ref.current===e;const[r]=t[0];return r.opts.ref.current===e}function qa(e,t){const n=e.target;if(!Ai(n))return!1;const r=!!n.closest(`[${Ka}]`);if("button"in e&&e.button>0&&!r)return!1;if("button"in e&&e.button===0&&r)return!0;const i=!!t.closest(`[${Ha}]`);return r&&i?!1:Oi(n).documentElement.contains(n)&&!Ei(t,n)&&da(e,t)}function Lr(e){const t=e.currentTarget,n=e.target;let r;e instanceof PointerEvent?r=new PointerEvent(e.type,e):r=new PointerEvent("pointerdown",e);let i=!1;return new Proxy(r,{get:(o,a)=>a==="currentTarget"?t:a==="target"?n:a==="preventDefault"?()=>{i=!0,typeof o.preventDefault=="function"&&o.preventDefault()}:a==="defaultPrevented"?i:a in o?o[a]:e[a]})}function Za(e,t){ut(t,!0);let n=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"onInteractOutside",3,ct),i=b(t,"onFocusOutside",3,ct),s=b(t,"isValidEvent",3,()=>!1);const o=ar.create({id:O(()=>t.id),interactOutsideBehavior:O(()=>n()),onInteractOutside:O(()=>r()),enabled:O(()=>t.enabled),onFocusOutside:O(()=>i()),isValidEvent:O(()=>s()),ref:t.ref});var a=N(),l=D(a);st(l,()=>t.children??pt,()=>({props:o.props})),x(e,a),dt()}globalThis.bitsEscapeLayers??=new Map;class cr{static create(t){return new cr(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new qn(this.opts.ref);let n=ct;St(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),n=this.#t()),()=>{n(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>lt(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==Ks||!Ja(this))return;const n=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(n)}}function Ja(e){const t=[...globalThis.bitsEscapeLayers],n=t.findLast(([i,{current:s}])=>s==="close"||s==="ignore");if(n)return n[0]===e;const[r]=t[0];return r===e}function Qa(e,t){ut(t,!0);let n=b(t,"escapeKeydownBehavior",3,"close"),r=b(t,"onEscapeKeydown",3,ct);cr.create({escapeKeydownBehavior:O(()=>n()),onEscapeKeydown:O(()=>r()),enabled:O(()=>t.enabled),ref:t.ref});var i=N(),s=D(i);st(s,()=>t.children??pt),x(e,i),dt()}class lr{static instance;#t=Wt([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new lr),this.instance}register(t){const n=this.getActive();n&&n!==t&&n.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(i=>i!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const n=this.getActive();n&&n.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,n){this.#e.set(t,n)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,n){this.#n.set(t,n)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class ur{#t=!1;#e=null;#n=lr.getInstance();#r=[];#i;constructor(t){this.#i=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#o(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#c(),this.#a()}unmount(){this.#e&&(this.#o(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const n=this.#u();n?(n.focus(),this.#n.setFocusMemory(this,n)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const n=this.#n.getPreFocusMemory(this);if(n&&document.contains(n))try{n.focus()}catch{document.body.focus()}}}#c(){if(!this.#e||!this.#i.trap.current)return;const t=this.#e,n=t.ownerDocument,r=o=>{if(this.#t||!this.#n.isActiveScope(this))return;const a=o.target;if(!a)return;if(t.contains(a))this.#n.setFocusMemory(this,a);else{const u=this.#n.getFocusMemory(this);if(u&&t.contains(u)&&Ni(u))o.preventDefault(),u.focus();else{const h=this.#u(),d=this.#l()[0];(h||d||t).focus()}}},i=o=>{if(!this.#i.loop||this.#t||o.key!=="Tab"||!this.#n.isActiveScope(this))return;const a=this.#d();if(a.length===0)return;const l=a[0],u=a[a.length-1];!o.shiftKey&&n.activeElement===u?(o.preventDefault(),l.focus()):o.shiftKey&&n.activeElement===l&&(o.preventDefault(),u.focus())};this.#r.push(lt(n,"focusin",r,{capture:!0}),lt(t,"keydown",i));const s=new MutationObserver(()=>{const o=this.#n.getFocusMemory(this);if(o&&!t.contains(o)){const a=this.#u(),l=this.#l()[0],u=a||l;u?(u.focus(),this.#n.setFocusMemory(this,u)):t.focus()}});s.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>s.disconnect())}#d(){return this.#e?Di(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#d()[0]||null}#l(){return this.#e?Ii(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return St([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||(n=new ur(t)),n.mount(r)):n&&(n.unmount(),n=null)}),ze(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}}function $a(e,t){ut(t,!0);let n=b(t,"enabled",3,!1),r=b(t,"trapFocus",3,!1),i=b(t,"loop",3,!1),s=b(t,"onCloseAutoFocus",3,ct),o=b(t,"onOpenAutoFocus",3,ct);const a=ur.use({enabled:O(()=>n()),trap:O(()=>r()),loop:i(),onCloseAutoFocus:O(()=>s()),onOpenAutoFocus:O(()=>o()),ref:t.ref});var l=N(),u=D(l);st(u,()=>t.focusScope??pt,()=>({props:a.props})),x(e,l),dt()}globalThis.bitsTextSelectionLayers??=new Map;class dr{static create(t){return new dr(t)}opts;domContext;#t=ct;constructor(t){this.opts=t,this.domContext=new qn(t.ref);let n=ct;St(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),n(),n=this.#e()),()=>{n(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return ge(lt(this.domContext.getDocument(),"pointerdown",this.#n),lt(this.domContext.getDocument(),"pointerup",li(this.#r,this.opts.onPointerUp.current)))}#n=t=>{const n=this.opts.ref.current,r=t.target;!Zt(n)||!Zt(r)||!this.opts.enabled.current||!ec(this)||!Bs(n,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=tc(n,this.domContext.getDocument().body)))};#r=()=>{this.#t(),this.#t=ct}}const Br=e=>e.style.userSelect||e.style.webkitUserSelect;function tc(e,t){const n=Br(t),r=Br(e);return qe(t,"none"),qe(e,"text"),()=>{qe(t,n),qe(e,r)}}function qe(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function ec(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const n=t.at(-1);return n?n[0]===e:!1}function nc(e,t){ut(t,!0);let n=b(t,"preventOverflowTextSelection",3,!0),r=b(t,"onPointerDown",3,ct),i=b(t,"onPointerUp",3,ct);dr.create({id:O(()=>t.id),onPointerDown:O(()=>r()),onPointerUp:O(()=>i()),enabled:O(()=>t.enabled&&n()),ref:t.ref});var s=N(),o=D(s);st(o,()=>t.children??pt),x(e,s),dt()}globalThis.bitsIdCounter??={current:0};function fr(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class rc{#t;#e=0;#n=L();#r;constructor(t){this.#t=t}#i(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),m(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,c(this.#n)===void 0&&(this.#r=ri(()=>{m(this.#n,this.#t(...t),!0)})),vt(()=>()=>{this.#i()}),c(this.#n)}}const $e=new Ps;let Ze=L(null),kn=null,Me=null,Fe=!1;const Wr=O(()=>{for(const e of $e.values())if(e)return!0;return!1});let Mn=null;const ic=new rc(()=>{function e(){document.body.setAttribute("style",c(Ze)??""),document.body.style.removeProperty("--scrollbar-width"),Fr&&kn?.(),m(Ze,null)}function t(){Me!==null&&(window.clearTimeout(Me),Me=null)}function n(i,s){t(),Fe=!0,Mn=Date.now();const o=Mn,a=()=>{Me=null,Mn===o&&(Vi($e)?Fe=!1:(Fe=!1,s()))},l=i===null?24:i;Me=window.setTimeout(a,l)}function r(){c(Ze)===null&&$e.size===0&&!Fe&&m(Ze,document.body.getAttribute("style"),!0)}return St(()=>Wr.current,()=>{if(!Wr.current)return;r(),Fe=!1;const i=getComputedStyle(document.documentElement),s=getComputedStyle(document.body),o=i.scrollbarGutter?.includes("stable")||s.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,u={padding:Number.parseInt(s.paddingRight??"0",10)+a,margin:Number.parseInt(s.marginRight??"0",10)};a>0&&!o&&(document.body.style.paddingRight=`${u.padding}px`,document.body.style.marginRight=`${u.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",Fr&&(kn=lt(document,"touchmove",h=>{h.target===document.documentElement&&(h.touches.length>1||h.preventDefault())},{passive:!1})),Gt(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),ze(()=>()=>{kn?.()}),{get lockMap(){return $e},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class oc{#t=fr();#e;#n=()=>null;#r;locked;constructor(t,n=()=>null){this.#e=t,this.#n=n,this.#r=ic.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=O(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),ze(()=>{if(this.#r.lockMap.delete(this.#t),Vi(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function Vi(e){for(const[t,n]of e)if(n)return!0;return!1}function zr(e,t){ut(t,!0);let n=b(t,"preventScroll",3,!0),r=b(t,"restoreScrollDelay",3,null);n()&&new oc(n(),()=>r()),dt()}const sc=["top","right","bottom","left"],ne=Math.min,Pt=Math.max,cn=Math.round,Je=Math.floor,Vt=e=>({x:e,y:e}),ac={left:"right",right:"left",bottom:"top",top:"bottom"},cc={start:"end",end:"start"};function Hn(e,t,n){return Pt(e,ne(t,n))}function Jt(e,t){return typeof e=="function"?e(t):e}function Qt(e){return e.split("-")[0]}function Ee(e){return e.split("-")[1]}function hr(e){return e==="x"?"y":"x"}function gr(e){return e==="y"?"height":"width"}const lc=new Set(["top","bottom"]);function zt(e){return lc.has(Qt(e))?"y":"x"}function vr(e){return hr(zt(e))}function uc(e,t,n){n===void 0&&(n=!1);const r=Ee(e),i=vr(e),s=gr(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ln(o)),[o,ln(o)]}function dc(e){const t=ln(e);return[Un(e),t,Un(t)]}function Un(e){return e.replace(/start|end/g,t=>cc[t])}const Vr=["left","right"],Kr=["right","left"],fc=["top","bottom"],hc=["bottom","top"];function gc(e,t,n){switch(e){case"top":case"bottom":return n?t?Kr:Vr:t?Vr:Kr;case"left":case"right":return t?fc:hc;default:return[]}}function vc(e,t,n,r){const i=Ee(e);let s=gc(Qt(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Un)))),s}function ln(e){return e.replace(/left|right|bottom|top/g,t=>ac[t])}function pc(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ki(e){return typeof e!="number"?pc(e):{top:e,right:e,bottom:e,left:e}}function un(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Hr(e,t,n){let{reference:r,floating:i}=e;const s=zt(t),o=vr(t),a=gr(o),l=Qt(t),u=s==="y",h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let v;switch(l){case"top":v={x:h,y:r.y-i.height};break;case"bottom":v={x:h,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Ee(t)){case"start":v[o]-=f*(n&&u?-1:1);break;case"end":v[o]+=f*(n&&u?-1:1);break}return v}async function mc(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:v=0}=Jt(t,e),p=Ki(v),w=a[f?d==="floating"?"reference":"floating":d],A=un(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:h,strategy:l})),C=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,F=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(F))?await(s.getScale==null?void 0:s.getScale(F))||{x:1,y:1}:{x:1,y:1},B=un(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:F,strategy:l}):C);return{top:(A.top-B.top+p.top)/S.y,bottom:(B.bottom-A.bottom+p.bottom)/S.y,left:(A.left-B.left+p.left)/S.x,right:(B.right-A.right+p.right)/S.x}}const yc=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:d}=Hr(u,r,l),f=r,v={},p=0;for(let w=0;w<a.length;w++){var g;const{name:A,fn:C}=a[w],{x:F,y:S,data:B,reset:E}=await C({x:h,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:v,rects:u,platform:{...o,detectOverflow:(g=o.detectOverflow)!=null?g:mc},elements:{reference:e,floating:t}});h=F??h,d=S??d,v={...v,[A]:{...v[A],...B}},E&&p<=50&&(p++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(u=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:h,y:d}=Hr(u,f,l)),w=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:v}},wc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:h=0}=Jt(e,t)||{};if(u==null)return{};const d=Ki(h),f={x:n,y:r},v=vr(i),p=gr(v),g=await o.getDimensions(u),w=v==="y",A=w?"top":"left",C=w?"bottom":"right",F=w?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[v]-f[v]-s.floating[p],B=f[v]-s.reference[v],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let T=E?E[F]:0;(!T||!await(o.isElement==null?void 0:o.isElement(E)))&&(T=a.floating[F]||s.floating[p]);const Q=S/2-B/2,k=T/2-g[p]/2-1,I=ne(d[A],k),W=ne(d[C],k),H=I,$=T-g[p]-W,tt=T/2-g[p]/2+Q,X=Hn(H,tt,$),z=!l.arrow&&Ee(i)!=null&&tt!==X&&s.reference[p]/2-(tt<H?I:W)-g[p]/2<0,Y=z?tt<H?tt-H:tt-$:0;return{[v]:f[v]+Y,data:{[v]:X,centerOffset:tt-X-Y,...z&&{alignmentOffset:Y}},reset:z}}}),bc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...w}=Jt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const A=Qt(i),C=zt(a),F=Qt(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),B=f||(F||!g?[ln(a)]:dc(a)),E=p!=="none";!f&&E&&B.push(...vc(a,g,p,S));const T=[a,...B],Q=await l.detectOverflow(t,w),k=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&k.push(Q[A]),d){const tt=uc(i,o,S);k.push(Q[tt[0]],Q[tt[1]])}if(I=[...I,{placement:i,overflows:k}],!k.every(tt=>tt<=0)){var W,H;const tt=(((W=s.flip)==null?void 0:W.index)||0)+1,X=T[tt];if(X&&(!(d==="alignment"?C!==zt(X):!1)||I.every(G=>zt(G.placement)===C?G.overflows[0]>0:!0)))return{data:{index:tt,overflows:I},reset:{placement:X}};let z=(H=I.filter(Y=>Y.overflows[0]<=0).sort((Y,G)=>Y.overflows[1]-G.overflows[1])[0])==null?void 0:H.placement;if(!z)switch(v){case"bestFit":{var $;const Y=($=I.filter(G=>{if(E){const At=zt(G.placement);return At===C||At==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(At=>At>0).reduce((At,Pe)=>At+Pe,0)]).sort((G,At)=>G[1]-At[1])[0])==null?void 0:$[0];Y&&(z=Y);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function Ur(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jr(e){return sc.some(t=>e[t]>=0)}const xc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=Jt(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Ur(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:jr(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Ur(o,n.floating);return{data:{escapedOffsets:a,escaped:jr(a)}}}default:return{}}}}},Hi=new Set(["left","top"]);async function Sc(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Qt(n),a=Ee(n),l=zt(n)==="y",u=Hi.has(o)?-1:1,h=s&&l?-1:1,d=Jt(t,e);let{mainAxis:f,crossAxis:v,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(v=a==="end"?p*-1:p),l?{x:v*h,y:f*u}:{x:f*u,y:v*h}}const Ac=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await Sc(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Ec=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:A=>{let{x:C,y:F}=A;return{x:C,y:F}}},...u}=Jt(e,t),h={x:n,y:r},d=await s.detectOverflow(t,u),f=zt(Qt(i)),v=hr(f);let p=h[v],g=h[f];if(o){const A=v==="y"?"top":"left",C=v==="y"?"bottom":"right",F=p+d[A],S=p-d[C];p=Hn(F,p,S)}if(a){const A=f==="y"?"top":"left",C=f==="y"?"bottom":"right",F=g+d[A],S=g-d[C];g=Hn(F,g,S)}const w=l.fn({...t,[v]:p,[f]:g});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[v]:o,[f]:a}}}}}},Oc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Jt(e,t),h={x:n,y:r},d=zt(i),f=hr(d);let v=h[f],p=h[d];const g=Jt(a,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const F=f==="y"?"height":"width",S=s.reference[f]-s.floating[F]+w.mainAxis,B=s.reference[f]+s.reference[F]-w.mainAxis;v<S?v=S:v>B&&(v=B)}if(u){var A,C;const F=f==="y"?"width":"height",S=Hi.has(Qt(i)),B=s.reference[d]-s.floating[F]+(S&&((A=o.offset)==null?void 0:A[d])||0)+(S?0:w.crossAxis),E=s.reference[d]+s.reference[F]+(S?0:((C=o.offset)==null?void 0:C[d])||0)-(S?w.crossAxis:0);p<B?p=B:p>E&&(p=E)}return{[f]:v,[d]:p}}}},Pc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}=Jt(e,t),h=await o.detectOverflow(t,u),d=Qt(i),f=Ee(i),v=zt(i)==="y",{width:p,height:g}=s.floating;let w,A;d==="top"||d==="bottom"?(w=d,A=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(A=d,w=f==="end"?"top":"bottom");const C=g-h.top-h.bottom,F=p-h.left-h.right,S=ne(g-h[w],C),B=ne(p-h[A],F),E=!t.middlewareData.shift;let T=S,Q=B;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(Q=F),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),E&&!f){const I=Pt(h.left,0),W=Pt(h.right,0),H=Pt(h.top,0),$=Pt(h.bottom,0);v?Q=p-2*(I!==0||W!==0?I+W:Pt(h.left,h.right)):T=g-2*(H!==0||$!==0?H+$:Pt(h.top,h.bottom))}await l({...t,availableWidth:Q,availableHeight:T});const k=await o.getDimensions(a.floating);return p!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}};function mn(){return typeof window<"u"}function Oe(e){return Ui(e)?(e.nodeName||"").toLowerCase():"#document"}function _t(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(Ui(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ui(e){return mn()?e instanceof Node||e instanceof _t(e).Node:!1}function Lt(e){return mn()?e instanceof Element||e instanceof _t(e).Element:!1}function Kt(e){return mn()?e instanceof HTMLElement||e instanceof _t(e).HTMLElement:!1}function Yr(e){return!mn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _t(e).ShadowRoot}const _c=new Set(["inline","contents"]);function Ke(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_c.has(i)}const Cc=new Set(["table","td","th"]);function Tc(e){return Cc.has(Oe(e))}const kc=[":popover-open",":modal"];function yn(e){return kc.some(t=>{try{return e.matches(t)}catch{return!1}})}const Mc=["transform","translate","scale","rotate","perspective"],Fc=["transform","translate","scale","rotate","perspective","filter"],Rc=["paint","layout","strict","content"];function pr(e){const t=mr(),n=Lt(e)?Bt(e):e;return Mc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Fc.some(r=>(n.willChange||"").includes(r))||Rc.some(r=>(n.contain||"").includes(r))}function Dc(e){let t=re(e);for(;Kt(t)&&!Ae(t);){if(pr(t))return t;if(yn(t))return null;t=re(t)}return null}function mr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ic=new Set(["html","body","#document"]);function Ae(e){return Ic.has(Oe(e))}function Bt(e){return _t(e).getComputedStyle(e)}function wn(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function re(e){if(Oe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yr(e)&&e.host||Ht(e);return Yr(t)?t.host:t}function ji(e){const t=re(e);return Ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Ke(t)?t:ji(t)}function Le(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ji(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=_t(i);if(s){const a=jn(o);return t.concat(o,o.visualViewport||[],Ke(i)?i:[],a&&n?Le(a):[])}return t.concat(i,Le(i,[],n))}function jn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yi(e){const t=Bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Kt(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=cn(n)!==s||cn(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function yr(e){return Lt(e)?e:e.contextElement}function xe(e){const t=yr(e);if(!Kt(t))return Vt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Yi(t);let o=(s?cn(n.width):n.width)/r,a=(s?cn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Nc=Vt(0);function Gi(e){const t=_t(e);return!mr()||!t.visualViewport?Nc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Lc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_t(e)?!1:t}function me(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=yr(e);let o=Vt(1);t&&(r?Lt(r)&&(o=xe(r)):o=xe(e));const a=Lc(s,n,r)?Gi(s):Vt(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(s){const f=_t(s),v=r&&Lt(r)?_t(r):r;let p=f,g=jn(p);for(;g&&r&&v!==p;){const w=xe(g),A=g.getBoundingClientRect(),C=Bt(g),F=A.left+(g.clientLeft+parseFloat(C.paddingLeft))*w.x,S=A.top+(g.clientTop+parseFloat(C.paddingTop))*w.y;l*=w.x,u*=w.y,h*=w.x,d*=w.y,l+=F,u+=S,p=_t(g),g=jn(p)}}return un({width:h,height:d,x:l,y:u})}function bn(e,t){const n=wn(e).scrollLeft;return t?t.left+n:me(Ht(e)).left+n}function Xi(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bn(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Bc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=Ht(r),a=t?yn(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=Vt(1);const h=Vt(0),d=Kt(r);if((d||!d&&!s)&&((Oe(r)!=="body"||Ke(o))&&(l=wn(r)),Kt(r))){const v=me(r);u=xe(r),h.x=v.x+r.clientLeft,h.y=v.y+r.clientTop}const f=o&&!d&&!s?Xi(o,l):Vt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-l.scrollTop*u.y+h.y+f.y}}function Wc(e){return Array.from(e.getClientRects())}function zc(e){const t=Ht(e),n=wn(e),r=e.ownerDocument.body,i=Pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+bn(e);const a=-n.scrollTop;return Bt(r).direction==="rtl"&&(o+=Pt(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Gr=25;function Vc(e,t){const n=_t(e),r=Ht(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const h=mr();(!h||h&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=bn(r);if(u<=0){const h=r.ownerDocument,d=h.body,f=getComputedStyle(d),v=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-v);p<=Gr&&(s-=p)}else u<=Gr&&(s+=u);return{width:s,height:o,x:a,y:l}}const Kc=new Set(["absolute","fixed"]);function Hc(e,t){const n=me(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Kt(e)?xe(e):Vt(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function Xr(e,t,n){let r;if(t==="viewport")r=Vc(e,n);else if(t==="document")r=zc(Ht(e));else if(Lt(t))r=Hc(t,n);else{const i=Gi(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return un(r)}function qi(e,t){const n=re(e);return n===t||!Lt(n)||Ae(n)?!1:Bt(n).position==="fixed"||qi(n,t)}function Uc(e,t){const n=t.get(e);if(n)return n;let r=Le(e,[],!1).filter(a=>Lt(a)&&Oe(a)!=="body"),i=null;const s=Bt(e).position==="fixed";let o=s?re(e):e;for(;Lt(o)&&!Ae(o);){const a=Bt(o),l=pr(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&Kc.has(i.position)||Ke(o)&&!l&&qi(e,o))?r=r.filter(h=>h!==o):i=a,o=re(o)}return t.set(e,r),r}function jc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?yn(t)?[]:Uc(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,h)=>{const d=Xr(t,h,i);return u.top=Pt(d.top,u.top),u.right=ne(d.right,u.right),u.bottom=ne(d.bottom,u.bottom),u.left=Pt(d.left,u.left),u},Xr(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Yc(e){const{width:t,height:n}=Yi(e);return{width:t,height:n}}function Gc(e,t,n){const r=Kt(t),i=Ht(t),s=n==="fixed",o=me(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Vt(0);function u(){l.x=bn(i)}if(r||!r&&!s)if((Oe(t)!=="body"||Ke(i))&&(a=wn(t)),r){const v=me(t,!0,s,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else i&&u();s&&!r&&i&&u();const h=i&&!r&&!s?Xi(i,a):Vt(0),d=o.left+a.scrollLeft-l.x-h.x,f=o.top+a.scrollTop-l.y-h.y;return{x:d,y:f,width:o.width,height:o.height}}function Fn(e){return Bt(e).position==="static"}function qr(e,t){if(!Kt(e)||Bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ht(e)===n&&(n=n.ownerDocument.body),n}function Zi(e,t){const n=_t(e);if(yn(e))return n;if(!Kt(e)){let i=re(e);for(;i&&!Ae(i);){if(Lt(i)&&!Fn(i))return i;i=re(i)}return n}let r=qr(e,t);for(;r&&Tc(r)&&Fn(r);)r=qr(r,t);return r&&Ae(r)&&Fn(r)&&!pr(r)?n:r||Dc(e)||n}const Xc=async function(e){const t=this.getOffsetParent||Zi,n=this.getDimensions,r=await n(e.floating);return{reference:Gc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qc(e){return Bt(e).direction==="rtl"}const Zc={convertOffsetParentRelativeRectToViewportRelativeRect:Bc,getDocumentElement:Ht,getClippingRect:jc,getOffsetParent:Zi,getElementRects:Xc,getClientRects:Wc,getDimensions:Yc,getScale:xe,isElement:Lt,isRTL:qc};function Ji(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jc(e,t){let n=null,r;const i=Ht(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:h,top:d,width:f,height:v}=u;if(a||t(),!f||!v)return;const p=Je(d),g=Je(i.clientWidth-(h+f)),w=Je(i.clientHeight-(d+v)),A=Je(h),F={rootMargin:-p+"px "+-g+"px "+-w+"px "+-A+"px",threshold:Pt(0,ne(1,l))||1};let S=!0;function B(E){const T=E[0].intersectionRatio;if(T!==l){if(!S)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!Ji(u,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(B,{...F,root:i.ownerDocument})}catch{n=new IntersectionObserver(B,F)}n.observe(e)}return o(!0),s}function Qc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=yr(e),h=i||s?[...u?Le(u):[],...Le(t)]:[];h.forEach(A=>{i&&A.addEventListener("scroll",n,{passive:!0}),s&&A.addEventListener("resize",n)});const d=u&&a?Jc(u,n):null;let f=-1,v=null;o&&(v=new ResizeObserver(A=>{let[C]=A;C&&C.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var F;(F=v)==null||F.observe(t)})),n()}),u&&!l&&v.observe(u),v.observe(t));let p,g=l?me(e):null;l&&w();function w(){const A=me(e);g&&!Ji(g,A)&&n(),g=A,p=requestAnimationFrame(w)}return n(),()=>{var A;h.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),d?.(),(A=v)==null||A.disconnect(),v=null,l&&cancelAnimationFrame(p)}}const $c=Ac,tl=Ec,el=bc,nl=Pc,rl=xc,il=wc,ol=Oc,sl=(e,t,n)=>{const r=new Map,i={platform:Zc,...n},s={...i.platform,_c:r};return yc(e,t,{...i,platform:s})};function de(e){return typeof e=="function"?e():e}function Qi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Zr(e,t){const n=Qi(e);return Math.round(t*n)/n}function Jr(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function al(e){const t=e.whileElementsMounted,n=_(()=>de(e.open)??!0),r=_(()=>de(e.middleware)),i=_(()=>de(e.transform)??!0),s=_(()=>de(e.placement)??"bottom"),o=_(()=>de(e.strategy)??"absolute"),a=_(()=>de(e.sideOffset)??0),l=_(()=>de(e.alignOffset)??0),u=e.reference;let h=L(0),d=L(0);const f=Wt(null);let v=L(Xt(c(o))),p=L(Xt(c(s))),g=L(Xt({})),w=L(!1),A=!1;const C=_(()=>{const k=f.current?Zr(f.current,c(h)):c(h),I=f.current?Zr(f.current,c(d)):c(d);return c(i)?{position:c(v),left:"0",top:"0",transform:`translate(${k}px, ${I}px)`,...f.current&&Qi(f.current)>=1.5&&{willChange:"transform"}}:{position:c(v),left:`${k}px`,top:`${I}px`}});let F;function S(){u.current===null||f.current===null||sl(u.current,f.current,{middleware:c(r),placement:c(s),strategy:c(o)}).then(k=>{const I=u.current;if(cl(I)){m(g,{...c(g),hide:{...c(g).hide,referenceHidden:!0}},!0);return}if(!c(n)&&c(h)!==0&&c(d)!==0){const H=Math.max(Math.abs(c(a)),Math.abs(c(l)),15);if(k.x<=H&&k.y<=H)return}m(h,k.x,!0),m(d,k.y,!0),m(v,k.strategy,!0),m(p,k.placement,!0),m(g,k.middlewareData,!0),m(w,!0)})}function B(){typeof F=="function"&&(F(),F=void 0)}function E(){if(B(),t===void 0){S();return}c(n)&&(u.current===null||f.current===null||(F=t(u.current,f.current,S)))}function T(){c(n)||m(w,!1)}function Q(){return[c(r),c(s),c(o),c(a),c(l),c(n)]}return vt(()=>{t===void 0&&c(n)&&S()}),vt(E),vt(()=>{if(t!==void 0){if(Q(),!c(n)){A=!1;return}if(!c(w)){A=!1;return}if(!A){A=!0;return}S()}}),vt(T),vt(()=>B),{floating:f,reference:u,get strategy(){return c(v)},get placement(){return c(p)},get middlewareData(){return c(g)},get isPositioned(){return c(w)},get floatingStyles(){return c(C)},get update(){return S}}}function cl(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const ll={top:"bottom",right:"left",bottom:"top",left:"right"},wr=new we("Floating.Root"),Qr=new we("Floating.Content"),br=new we("Floating.Root");class dn{static create(t=!1){return t?br.set(new dn):wr.set(new dn)}anchorNode=Wt(null);customAnchorNode=Wt(null);triggerNode=Wt(null);constructor(){vt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class fn{static create(t,n=!1){return n?Qr.set(new fn(t,br.get())):Qr.set(new fn(t,wr.get()))}opts;root;contentRef=Wt(null);wrapperRef=Wt(null);arrowRef=Wt(null);contentAttachment=ve(this.contentRef);wrapperAttachment=ve(this.wrapperRef);arrowAttachment=ve(this.arrowRef);arrowId=Wt(fr());#t=_(()=>{if(typeof this.opts.style=="string")return Re(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#n=new Ms(()=>this.arrowRef.current??void 0);#r=_(()=>this.#n?.width??0);#i=_(()=>this.#n?.height??0);#o=_(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=_(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=_(()=>c(this.#a).length>0);get hasExplicitBoundaries(){return c(this.#s)}set hasExplicitBoundaries(t){m(this.#s,t)}#c=_(()=>({padding:this.opts.collisionPadding.current,boundary:c(this.#a).filter(Js),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return c(this.#c)}set detectOverflowOptions(t){m(this.#c,t)}#d=L(void 0);#u=L(void 0);#l=L(void 0);#h=L(void 0);#g=_(()=>[$c({mainAxis:this.opts.sideOffset.current+c(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&tl({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?ol():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&el({...this.detectOverflowOptions}),nl({...this.detectOverflowOptions,apply:({rects:t,availableWidth:n,availableHeight:r})=>{const{width:i,height:s}=t.reference;m(this.#d,n,!0),m(this.#u,r,!0),m(this.#l,i,!0),m(this.#h,s,!0)}}),this.arrowRef.current&&il({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),ul({arrowWidth:c(this.#r),arrowHeight:c(this.#i)}),this.opts.hideWhenDetached.current&&rl({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return c(this.#g)}set middleware(t){m(this.#g,t)}floating;#v=_(()=>dl(this.floating.placement));get placedSide(){return c(this.#v)}set placedSide(t){m(this.#v,t)}#p=_(()=>fl(this.floating.placement));get placedAlign(){return c(this.#p)}set placedAlign(t){m(this.#p,t)}#f=_(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return c(this.#f)}set arrowX(t){m(this.#f,t)}#m=_(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return c(this.#m)}set arrowY(t){m(this.#m,t)}#y=_(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return c(this.#y)}set cannotCenterArrow(t){m(this.#y,t)}#w=L();get contentZIndex(){return c(this.#w)}set contentZIndex(t){m(this.#w,t,!0)}#b=_(()=>ll[this.placedSide]);get arrowBaseSide(){return c(this.#b)}set arrowBaseSide(t){m(this.#b,t)}#x=_(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${c(this.#d)}px`,"--bits-floating-available-height":`${c(this.#u)}px`,"--bits-floating-anchor-width":`${c(this.#l)}px`,"--bits-floating-anchor-height":`${c(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...c(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return c(this.#x)}set wrapperProps(t){m(this.#x,t)}#S=_(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:di({...c(this.#t)}),...this.contentAttachment}));get props(){return c(this.#S)}set props(t){m(this.#S,t)}#A=_(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return c(this.#A)}set arrowStyle(t){m(this.#A,t)}constructor(t,n){this.opts=t,this.root=n,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),St(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=al({strategy:()=>this.opts.strategy.current,placement:()=>c(this.#o),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>Qc(...r,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),vt(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),St(()=>this.contentRef.current,r=>{if(!r||!this.opts.enabled.current)return;const i=Xn(r),s=i.requestAnimationFrame(()=>{if(this.contentRef.current!==r||!this.opts.enabled.current)return;const o=i.getComputedStyle(r).zIndex;o!==this.contentZIndex&&(this.contentZIndex=o)});return()=>{i.cancelAnimationFrame(s)}}),vt(()=>{this.floating.floating.current=this.wrapperRef.current})}}class hn{static create(t,n=!1){return n?new hn(t,br.get()):new hn(t,wr.get())}opts;root;constructor(t,n){this.opts=t,this.root=n,t.virtualEl&&t.virtualEl.current?n.triggerNode=ci(t.virtualEl.current):n.triggerNode=t.ref}}function ul(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,h]=xr(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(i.arrow?.x??0)+a/2,v=(i.arrow?.y??0)+l/2;let p="",g="";return u==="bottom"?(p=o?d:`${f}px`,g=`${-l}px`):u==="top"?(p=o?d:`${f}px`,g=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,g=o?d:`${v}px`):u==="left"&&(p=`${r.floating.width+l}px`,g=o?d:`${v}px`),{data:{x:p,y:g}}}}}function xr(e){const[t,n="center"]=e.split("-");return[t,n]}function dl(e){return xr(e)[0]}function fl(e){return xr(e)[1]}function hl(e,t){ut(t,!0);let n=b(t,"tooltip",3,!1);dn.create(n());var r=N(),i=D(r);st(i,()=>t.children??pt),x(e,r),dt()}function gl(e,t){ut(t,!0);let n=b(t,"tooltip",3,!1);hn.create({id:O(()=>t.id),virtualEl:O(()=>t.virtualEl),ref:t.ref},n());var r=N(),i=D(r);st(i,()=>t.children??pt),x(e,r),dt()}function vl(e,t){ut(t,!0);let n=b(t,"side",3,"bottom"),r=b(t,"sideOffset",3,0),i=b(t,"align",3,"center"),s=b(t,"alignOffset",3,0),o=b(t,"arrowPadding",3,0),a=b(t,"avoidCollisions",3,!0),l=b(t,"collisionBoundary",19,()=>[]),u=b(t,"collisionPadding",3,0),h=b(t,"hideWhenDetached",3,!1),d=b(t,"onPlaced",3,()=>{}),f=b(t,"sticky",3,"partial"),v=b(t,"updatePositionStrategy",3,"optimized"),p=b(t,"strategy",3,"fixed"),g=b(t,"dir",3,"ltr"),w=b(t,"style",19,()=>({})),A=b(t,"wrapperId",19,fr),C=b(t,"customAnchor",3,null),F=b(t,"tooltip",3,!1);const S=fn.create({side:O(()=>n()),sideOffset:O(()=>r()),align:O(()=>i()),alignOffset:O(()=>s()),id:O(()=>t.id),arrowPadding:O(()=>o()),avoidCollisions:O(()=>a()),collisionBoundary:O(()=>l()),collisionPadding:O(()=>u()),hideWhenDetached:O(()=>h()),onPlaced:O(()=>d()),sticky:O(()=>f()),updatePositionStrategy:O(()=>v()),strategy:O(()=>p()),dir:O(()=>g()),style:O(()=>w()),enabled:O(()=>t.enabled),wrapperId:O(()=>A()),customAnchor:O(()=>C())},F()),B=_(()=>qt(S.wrapperProps,{style:{pointerEvents:"auto"}}));var E=N(),T=D(E);st(T,()=>t.content??pt,()=>({props:S.props,wrapperProps:c(B)})),x(e,E),dt()}function pl(e,t){ut(t,!0),ii(()=>{t.onPlaced?.()});var n=N(),r=D(n);st(r,()=>t.content??pt,()=>({props:{},wrapperProps:{}})),x(e,n),dt()}function ml(e,t){let n=b(t,"isStatic",3,!1),r=ie(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var i=N(),s=D(i);{var o=l=>{pl(l,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=l=>{vl(l,Ct({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};at(s,l=>{n()?l(o):l(a,!1)})}x(e,i)}var yl=K("<!> <!>",1);function $i(e,t){ut(t,!0);let n=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),i=b(t,"isValidEvent",3,()=>!1),s=b(t,"customAnchor",3,null),o=b(t,"isStatic",3,!1),a=b(t,"tooltip",3,!1),l=b(t,"contentPointerEvents",3,"auto"),u=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);ml(e,{get isStatic(){return o()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get enabled(){return t.enabled},get tooltip(){return a()},content:(d,f)=>{let v=()=>f?.().props,p=()=>f?.().wrapperProps;var g=yl(),w=D(g);{var A=S=>{zr(S,{get preventScroll(){return t.preventScroll}})},C=S=>{zr(S,{get preventScroll(){return t.preventScroll}})};at(w,S=>{t.forceMount&&t.enabled?S(A):t.forceMount||S(C,1)})}var F=nt(w,2);$a(F,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(B,E)=>{let T=()=>E?.().props;Qa(B,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(Q,k)=>{Za(Q,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return i()},get enabled(){return t.enabled},get ref(){return t.ref},children:(W,H)=>{let $=()=>H?.().props;nc(W,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(tt,X)=>{var z=N(),Y=D(z);{let G=_(()=>({props:qt(u,v(),$(),T(),{style:{pointerEvents:l()}}),wrapperProps:p()}));st(Y,()=>t.popper??pt,()=>c(G))}x(tt,z)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),x(d,g)},$$slots:{content:!0}}),dt()}function wl(e,t){let n=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),i=b(t,"isValidEvent",3,()=>!1),s=b(t,"customAnchor",3,null),o=b(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=N(),u=D(l);{var h=d=>{$i(d,Ct({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};at(u,d=>{t.shouldRender&&d(h)})}x(e,l)}function bl(e,t){let n=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),i=b(t,"isValidEvent",3,()=>!1),s=b(t,"customAnchor",3,null),o=b(t,"isStatic",3,!1),a=ie(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);$i(e,Ct({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}var xl=K("<div><!></div>");function Sl(e,t){const n=gn();ut(t,!0);let r=b(t,"ref",15,null),i=b(t,"id",19,()=>pn(n)),s=b(t,"disabled",3,!1),o=b(t,"onSelect",3,ct),a=b(t,"closeOnSelect",3,!0),l=ie(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const u=ir.create({id:O(()=>i()),disabled:O(()=>s()),onSelect:O(()=>o()),ref:O(()=>r(),g=>r(g)),closeOnSelect:O(()=>a())}),h=_(()=>qt(l,u.props));var d=N(),f=D(d);{var v=g=>{var w=N(),A=D(w);st(A,()=>t.child,()=>({props:c(h)})),x(g,w)},p=g=>{var w=xl();he(w,()=>({...c(h)}));var A=R(w);st(A,()=>t.children??pt),M(w),x(g,w)};at(f,g=>{t.child?g(v):g(p,!1)})}x(e,d),dt()}var Al=K("<div><!></div>");function El(e,t){const n=gn();ut(t,!0);let r=b(t,"ref",15,null),i=b(t,"id",19,()=>pn(n)),s=ie(t,["$$slots","$$events","$$legacy","ref","id","child","children"]);const o=or.create({id:O(()=>i()),ref:O(()=>r(),f=>r(f))}),a=_(()=>qt(s,o.props));var l=N(),u=D(l);{var h=f=>{var v=N(),p=D(v);st(p,()=>t.child,()=>({props:c(a)})),x(f,v)},d=f=>{var v=Al();he(v,()=>({...c(a)}));var p=R(v);st(p,()=>t.children??pt),M(v),x(f,v)};at(u,f=>{t.child?f(h):f(d,!1)})}x(e,l),dt()}function Ol(e,t){ut(t,!0);let n=b(t,"open",15,!1),r=b(t,"dir",3,"ltr"),i=b(t,"onOpenChange",3,ct),s=b(t,"onOpenChangeComplete",3,ct),o=b(t,"_internal_variant",3,"dropdown-menu");const a=er.create({variant:O(()=>o()),dir:O(()=>r()),onClose:()=>{n(!1),i()(!1)}});nr.create({open:O(()=>n(),l=>{n(l),i()(l)}),onOpenChangeComplete:O(()=>s())},a),hl(e,{children:(l,u)=>{var h=N(),d=D(h);st(d,()=>t.children??pt),x(l,h)},$$slots:{default:!0}}),dt()}var Pl=K("<div><div><!></div></div>"),_l=K("<div><div><!></div></div>");function Cl(e,t){const n=gn();ut(t,!0);let r=b(t,"id",19,()=>pn(n)),i=b(t,"ref",15,null),s=b(t,"loop",3,!0),o=b(t,"onInteractOutside",3,ct),a=b(t,"onEscapeKeydown",3,ct),l=b(t,"onCloseAutoFocus",3,ct),u=b(t,"forceMount",3,!1),h=b(t,"trapFocus",3,!1),d=ie(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const f=rr.create({id:O(()=>r()),loop:O(()=>s()),ref:O(()=>i(),S=>i(S)),onCloseAutoFocus:O(()=>l())}),v=_(()=>qt(d,f.props));function p(S){if(f.handleInteractOutside(S),!S.defaultPrevented&&(o()(S),!S.defaultPrevented)){if(S.target&&S.target instanceof Element){const B=`[${f.parentMenu.root.getBitsAttr("sub-content")}]`;if(S.target.closest(B))return}f.parentMenu.onClose()}}function g(S){a()(S),!S.defaultPrevented&&f.parentMenu.onClose()}var w=N(),A=D(w);{var C=S=>{bl(S,Ct(()=>c(v),()=>f.popperProps,{get ref(){return f.opts.ref},get enabled(){return f.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:g,get trapFocus(){return h()},get loop(){return s()},forceMount:!0,get id(){return r()},get shouldRender(){return f.shouldRender},popper:(E,T)=>{let Q=()=>T?.().props,k=()=>T?.().wrapperProps;const I=_(()=>qt(Q(),{style:Jr("dropdown-menu")},{style:t.style}));var W=N(),H=D(W);{var $=X=>{var z=N(),Y=D(z);{let G=_(()=>({props:c(I),wrapperProps:k(),...f.snippetProps}));st(Y,()=>t.child,()=>c(G))}x(X,z)},tt=X=>{var z=Pl();he(z,()=>({...k()}));var Y=R(z);he(Y,()=>({...c(I)}));var G=R(Y);st(G,()=>t.children??pt),M(Y),M(z),x(X,z)};at(H,X=>{t.child?X($):X(tt,!1)})}x(E,W)},$$slots:{popper:!0}}))},F=S=>{wl(S,Ct(()=>c(v),()=>f.popperProps,{get ref(){return f.opts.ref},get open(){return f.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:g,get trapFocus(){return h()},get loop(){return s()},forceMount:!1,get id(){return r()},get shouldRender(){return f.shouldRender},popper:(E,T)=>{let Q=()=>T?.().props,k=()=>T?.().wrapperProps;const I=_(()=>qt(Q(),{style:Jr("dropdown-menu")},{style:t.style}));var W=N(),H=D(W);{var $=X=>{var z=N(),Y=D(z);{let G=_(()=>({props:c(I),wrapperProps:k(),...f.snippetProps}));st(Y,()=>t.child,()=>c(G))}x(X,z)},tt=X=>{var z=_l();he(z,()=>({...k()}));var Y=R(z);he(Y,()=>({...c(I)}));var G=R(Y);st(G,()=>t.children??pt),M(Y),M(z),x(X,z)};at(H,X=>{t.child?X($):X(tt,!1)})}x(E,W)},$$slots:{popper:!0}}))};at(A,S=>{u()?S(C):u()||S(F,1)})}x(e,w),dt()}var Tl=K("<button><!></button>");function kl(e,t){const n=gn();ut(t,!0);let r=b(t,"id",19,()=>pn(n)),i=b(t,"ref",15,null),s=b(t,"disabled",3,!1),o=b(t,"type",3,"button"),a=ie(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=sr.create({id:O(()=>r()),disabled:O(()=>s()??!1),ref:O(()=>i(),h=>i(h))}),u=_(()=>qt(a,l.props,{type:o()}));gl(e,{get id(){return r()},get ref(){return l.opts.ref},children:(h,d)=>{var f=N(),v=D(f);{var p=w=>{var A=N(),C=D(A);st(C,()=>t.child,()=>({props:c(u)})),x(w,A)},g=w=>{var A=Tl();he(A,()=>({...c(u)}));var C=R(A);st(C,()=>t.children??pt),M(A),x(w,A)};at(v,w=>{t.child?w(p):w(g,!1)})}x(h,f)},$$slots:{default:!0}}),dt()}const Ml=Ol,Fl=kl,Rl=la,Dl=Cl,$r=Sl,Il=El;function Rn(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 4v16"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2"}],["path",{d:"M9 20h6"}]];se(e,Ct({name:"type"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}function Dn(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];se(e,Ct({name:"calendar"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}function In(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"1"}]];se(e,Ct({name:"circle-dot"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}function Nn(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];se(e,Ct({name:"link"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}function Nl(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];se(e,Ct({name:"tag"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}function Ll(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];se(e,Ct({name:"trash-2"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}function Bl(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];se(e,Ct({name:"check"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}function Wl(e,t){const n=oe(t,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 18-6-6 6-6"}]];se(e,Ct({name:"chevron-left"},()=>n,{get iconNode(){return r},children:(i,s)=>{var o=N(),a=D(o);ae(a,t,"default",{}),x(i,o)},$$slots:{default:!0}}))}var zl=K('<span class="ip-menu-check svelte-x7sio8"><!></span>'),Vl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span> </span> <!>',1),Kl=K('<span class="ip-menu-item-icon svelte-x7sio8"><!></span> <span>Remove</span>',1),Hl=K("<!> <!> <!>",1),Ul=K("<!> <!>",1),jl=K('<input class="ip-edit-input svelte-x7sio8" type="text"/>'),Yl=K('<button><span class="ip-status-dot svelte-x7sio8"></span> </button>'),Gl=K('<div class="ip-status-wrap svelte-x7sio8"><div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div> <div class="ip-status-dropdown svelte-x7sio8"></div></div>'),Xl=K('<span class="ip-cal-wd svelte-x7sio8"> </span>'),ql=K("<button> </button>"),Zl=K('<div class="ip-cal-week svelte-x7sio8"></div>'),Jl=K('<div class="ip-cal-wrap svelte-x7sio8"><span class="ip-date-text svelte-x7sio8"> </span> <div class="ip-cal-dropdown svelte-x7sio8"><div class="ip-cal-header svelte-x7sio8"><button class="ip-cal-nav svelte-x7sio8"><!></button> <span class="ip-cal-title svelte-x7sio8"> </span> <button class="ip-cal-nav svelte-x7sio8"><!></button></div> <div class="ip-cal-weekdays svelte-x7sio8"></div> <!></div></div>'),Ql=K('<span class="ip-badge svelte-x7sio8"> </span>'),$l=K('<button class="ip-wikilink-chip svelte-x7sio8"> </button>'),tu=K('<div class="ip-wikilink-group svelte-x7sio8"></div>'),eu=K('<div class="ip-status-value svelte-x7sio8"><span class="ip-status-dot svelte-x7sio8"></span> <span class="ip-status-text svelte-x7sio8"> </span></div>'),nu=K('<span class="ip-date-text svelte-x7sio8"> </span>'),ru=K('<a class="ip-url-link svelte-x7sio8" target="_blank" rel="noopener noreferrer"> </a>'),iu=K('<span class="ip-text-value svelte-x7sio8"> </span>'),ou=K('<div><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"> </div> <div class="ip-value svelte-x7sio8"><!></div></div>'),su=K('<div class="ip-row ip-add-row svelte-x7sio8"><div class="ip-icon svelte-x7sio8"><!></div> <div class="ip-key svelte-x7sio8"><input class="ip-add-key-input svelte-x7sio8" type="text" placeholder="Property name"/></div> <div class="ip-value svelte-x7sio8"></div></div>'),au=K('<button class="ip-add-btn svelte-x7sio8"><!> <span>Add property</span></button>'),cu=K('<div class="inline-properties svelte-x7sio8"><!> <!></div>');function Cu(e,t){ut(t,!0);let n=b(t,"editable",3,!1);const r=[{type:"text",label:"Text"},{type:"date",label:"Date"},{type:"status",label:"Status"},{type:"wikilink",label:"Link"}],i=["active","inactive","in-progress","completed","draft","archived","current","former","won","lost","open","closed"];let s=L(null),o=L(!1),a=L(""),l=L(void 0);function u(P){switch(P.toLowerCase()){case"active":case"current":case"won":return"#3ecf8e";case"in-progress":case"open":return"#f0c246";case"inactive":case"lost":case"closed":case"former":return"#e54d4d";default:return"#5c5c66"}}function h(P){for(const y of ai.repos){const rt=y.entities.find(Tt=>Tt.id===P);if(rt){Wo(`/${y.name}/${rt.entityType}/${rt.id}`);return}}}function d(P){return typeof P.value=="string"?P.value:P.value[0]}function f(P){return/^https?:\/\//.test(P)}function v(P){try{return new Date(P).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return P}}let p=L(Xt(new Date().getFullYear())),g=L(Xt(new Date().getMonth()));const w=["Su","Mo","Tu","We","Th","Fr","Sa"],A=["January","February","March","April","May","June","July","August","September","October","November","December"];function C(P,y){const rt=new Date(P,y,1).getDay(),Tt=new Date(P,y+1,0).getDate(),ce=new Date(P,y,0).getDate(),xt=[];let bt=[];for(let Ft=rt-1;Ft>=0;Ft--){const _e=ce-Ft,le=y===0?11:y-1,xn=y===0?P-1:P;bt.push({day:_e,month:le,year:xn,outside:!0})}for(let Ft=1;Ft<=Tt;Ft++)bt.push({day:Ft,month:y,year:P,outside:!1}),bt.length===7&&(xt.push(bt),bt=[]);if(bt.length>0){const Ft=y===11?0:y+1,_e=y===11?P+1:P;let le=1;for(;bt.length<7;)bt.push({day:le++,month:Ft,year:_e,outside:!0});xt.push(bt)}return xt}function F(P){const y=new Date;return P.day===y.getDate()&&P.month===y.getMonth()&&P.year===y.getFullYear()}function S(P,y){const rt=y.slice(0,10).split("-");return P.year===+rt[0]&&P.month===+rt[1]-1&&P.day===+rt[2]}function B(){c(g)===0?(m(g,11),Xe(p,-1)):Xe(g,-1)}function E(){c(g)===11?(m(g,0),Xe(p)):Xe(g)}function T(P){try{const y=P.slice(0,10).split("-");m(p,+y[0]),m(g,+y[1]-1)}catch{const y=new Date;m(p,y.getFullYear(),!0),m(g,y.getMonth(),!0)}}function Q(P){requestAnimationFrame(()=>{P.focus(),P.select()})}function k(P){!n()||P.type==="badge"||(P.type==="date"&&T(d(P)),m(s,P.key,!0))}function I(P,y){t.onedit&&t.onedit(P,y),m(s,null)}function W(P,y){const rt=`${y.year}-${String(y.month+1).padStart(2,"0")}-${String(y.day).padStart(2,"0")}`;t.onedit&&t.onedit(P,rt),m(s,null)}function H(P,y){t.ontypechange&&t.ontypechange(P,y)}function $(P){m(s,null),t.onremove&&t.onremove(P)}function tt(){m(o,!0),m(a,""),requestAnimationFrame(()=>c(l)?.focus())}function X(){const P=c(a).trim();P&&t.onadd&&t.onadd(P,""),m(o,!1),m(a,"")}function z(){m(o,!1),m(a,"")}function Y(P){P.key==="Enter"?(P.preventDefault(),X()):P.key==="Escape"&&z()}var G=cu();De("click",ko,()=>{m(s,null)});var At=R(G);Yt(At,17,()=>t.properties,P=>P.key,(P,y)=>{const rt=_(()=>c(s)===c(y).key);var Tt=ou();let ce;var xt=R(Tt),bt=R(xt);{var Ft=Z=>{var q=N(),J=D(q);ue(J,()=>Ml,(Et,Rt)=>{Rt(Et,{children:(kt,Dt)=>{var It=Ul(),j=D(It);ue(j,()=>Fl,(U,V)=>{V(U,{class:"ip-icon-trigger",children:(it,ot)=>{var et=N(),Ot=D(et);{var gt=ft=>{Dn(ft,{size:14})},Ut=ft=>{In(ft,{size:14})},jt=ft=>{Nn(ft,{size:14})},$t=ft=>{Rn(ft,{size:14})};at(Ot,ft=>{c(y).type==="date"?ft(gt):c(y).type==="status"?ft(Ut,1):c(y).type==="wikilink"?ft(jt,2):ft($t,!1)})}x(it,et)},$$slots:{default:!0}})});var Mt=nt(j,2);ue(Mt,()=>Rl,(U,V)=>{V(U,{children:(it,ot)=>{var et=N(),Ot=D(et);ue(Ot,()=>Dl,(gt,Ut)=>{Ut(gt,{class:"ip-menu-content",sideOffset:4,align:"start",children:(jt,$t)=>{var ft=Hl(),He=D(ft);Yt(He,17,()=>r,te,(Ce,Nt)=>{var je=N(),Sr=D(je);ue(Sr,()=>$r,(Ye,Ge)=>{Ge(Ye,{class:"ip-menu-item",onSelect:()=>H(c(y).key,c(Nt).type),children:(An,pu)=>{var Ar=Vl(),En=D(Ar),lo=R(En);{var uo=mt=>{Rn(mt,{size:13})},fo=mt=>{Dn(mt,{size:13})},ho=mt=>{In(mt,{size:13})},go=mt=>{Nn(mt,{size:13})};at(lo,mt=>{c(Nt).type==="text"?mt(uo):c(Nt).type==="date"?mt(fo,1):c(Nt).type==="status"?mt(ho,2):c(Nt).type==="wikilink"&&mt(go,3)})}M(En);var On=nt(En,2),vo=R(On,!0);M(On);var po=nt(On,2);{var mo=mt=>{var Pn=zl(),yo=R(Pn);Bl(yo,{size:12}),M(Pn),x(mt,Pn)};at(po,mt=>{c(y).type===c(Nt).type&&mt(mo)})}yt(()=>ht(vo,c(Nt).label)),x(An,Ar)},$$slots:{default:!0}})}),x(Ce,je)});var Ue=nt(He,2);ue(Ue,()=>Il,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-sep"})});var co=nt(Ue,2);ue(co,()=>$r,(Ce,Nt)=>{Nt(Ce,{class:"ip-menu-item ip-menu-destructive",onSelect:()=>$(c(y).key),children:(je,Sr)=>{var Ye=Kl(),Ge=D(Ye),An=R(Ge);Ll(An,{size:13}),M(Ge),_n(2),x(je,Ye)},$$slots:{default:!0}})}),x(jt,ft)},$$slots:{default:!0}})}),x(it,et)},$$slots:{default:!0}})}),x(kt,It)},$$slots:{default:!0}})}),x(Z,q)},_e=Z=>{var q=N(),J=D(q);{var Et=j=>{Dn(j,{size:14})},Rt=j=>{In(j,{size:14})},kt=j=>{Nn(j,{size:14})},Dt=j=>{Nl(j,{size:14})},It=j=>{Rn(j,{size:14})};at(J,j=>{c(y).type==="date"?j(Et):c(y).type==="status"?j(Rt,1):c(y).type==="wikilink"?j(kt,2):c(y).type==="badge"?j(Dt,3):j(It,!1)})}x(Z,q)};at(bt,Z=>{n()&&c(y).type!=="badge"?Z(Ft):Z(_e,!1)})}M(xt);var le=nt(xt,2),xn=R(le,!0);M(le);var Sn=nt(le,2),no=R(Sn);{var ro=Z=>{var q=jl();Bn(q),Uo(q,J=>Q?.(J)),yt(J=>Io(q,J),[()=>d(c(y))]),De("blur",q,J=>{const Et=J.currentTarget.value;Et!==d(c(y))&&t.onedit?.(c(y).key,Et),m(s,null)}),wt("keydown",q,J=>{J.key==="Enter"?J.currentTarget.blur():J.key==="Escape"&&(J.currentTarget.value=d(c(y)),m(s,null))}),x(Z,q)},io=Z=>{var q=Gl(),J=R(q),Et=R(J);let Rt;var kt=nt(Et,2),Dt=R(kt,!0);M(kt),M(J);var It=nt(J,2);Yt(It,21,()=>i,te,(j,Mt)=>{var U=Yl();let V;var it=R(U);let ot;var et=nt(it);M(U),yt((Ot,gt)=>{V=Qe(U,1,"ip-status-option svelte-x7sio8",null,V,Ot),ot=Tn(it,"",ot,gt),ht(et,` ${c(Mt)??""}`)},[()=>({selected:d(c(y))===c(Mt)}),()=>({background:u(c(Mt))})]),wt("click",U,()=>I(c(y).key,c(Mt))),x(j,U)}),M(It),M(q),yt((j,Mt)=>{Rt=Tn(Et,"",Rt,j),ht(Dt,Mt)},[()=>({background:u(d(c(y)))}),()=>d(c(y))]),wt("click",q,j=>j.stopPropagation()),x(Z,q)},oo=Z=>{var q=Jl(),J=R(q),Et=R(J,!0);M(J);var Rt=nt(J,2),kt=R(Rt),Dt=R(kt),It=R(Dt);Wl(It,{size:14}),M(Dt);var j=nt(Dt,2),Mt=R(j);M(j);var U=nt(j,2),V=R(U);Do(V,{size:14}),M(U),M(kt);var it=nt(kt,2);Yt(it,21,()=>w,te,(et,Ot)=>{var gt=Xl(),Ut=R(gt,!0);M(gt),yt(()=>ht(Ut,c(Ot))),x(et,gt)}),M(it);var ot=nt(it,2);Yt(ot,17,()=>C(c(p),c(g)),te,(et,Ot)=>{var gt=Zl();Yt(gt,21,()=>c(Ot),te,(Ut,jt)=>{var $t=ql();let ft;var He=R($t,!0);M($t),yt(Ue=>{ft=Qe($t,1,"ip-cal-day svelte-x7sio8",null,ft,Ue),ht(He,c(jt).day)},[()=>({outside:c(jt).outside,today:F(c(jt)),selected:S(c(jt),d(c(y)))})]),wt("click",$t,()=>W(c(y).key,c(jt))),x(Ut,$t)}),M(gt),x(et,gt)}),M(Rt),M(q),yt(et=>{ht(Et,et),ht(Mt,`${A[c(g)]??""} ${c(p)??""}`)},[()=>v(d(c(y)))]),wt("click",q,et=>et.stopPropagation()),wt("click",Dt,B),wt("click",U,E),x(Z,q)},so=Z=>{{let q=_(()=>Array.isArray(c(y).value));qo(Z,{get value(){return c(y).value},get multi(){return c(q)},onselect:J=>{t.onedit?.(c(y).key,J),m(s,null)},oncancel:()=>{m(s,null)}})}},ao=Z=>{var q=N(),J=D(q);{var Et=U=>{var V=Ql(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(y))]),x(U,V)},Rt=U=>{var V=tu();Yt(V,21,()=>Array.isArray(c(y).value)?c(y).value:[c(y).value],te,(it,ot)=>{var et=$l(),Ot=R(et,!0);M(et),yt(()=>ht(Ot,c(ot))),wt("click",et,gt=>{gt.stopPropagation(),h(c(ot))}),x(it,et)}),M(V),x(U,V)},kt=U=>{var V=eu(),it=R(V);let ot;var et=nt(it,2),Ot=R(et,!0);M(et),M(V),yt((gt,Ut)=>{ot=Tn(it,"",ot,gt),ht(Ot,Ut)},[()=>({background:u(d(c(y)))}),()=>d(c(y))]),x(U,V)},Dt=U=>{var V=nu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>v(d(c(y)))]),x(U,V)},It=U=>{var V=ru(),it=R(V,!0);M(V),yt((ot,et)=>{No(V,"href",ot),ht(it,et)},[()=>d(c(y)),()=>d(c(y))]),wt("click",V,ot=>ot.stopPropagation()),x(U,V)},j=_(()=>f(d(c(y)))),Mt=U=>{var V=iu(),it=R(V,!0);M(V),yt(ot=>ht(it,ot),[()=>d(c(y))]),x(U,V)};at(J,U=>{c(y).type==="badge"?U(Et):c(y).type==="wikilink"?U(Rt,1):c(y).type==="status"?U(kt,2):c(y).type==="date"?U(Dt,3):c(j)?U(It,4):U(Mt,!1)})}x(Z,q)};at(no,Z=>{c(rt)&&c(y).type==="text"?Z(ro):c(rt)&&c(y).type==="status"?Z(io,1):c(rt)&&c(y).type==="date"?Z(oo,2):c(rt)&&c(y).type==="wikilink"?Z(so,3):Z(ao,!1)})}M(Sn),M(Tt),yt(()=>{ce=Qe(Tt,1,"ip-row svelte-x7sio8",null,ce,{"ip-focused":c(rt)}),ht(xn,c(y).key)}),wt("click",xt,Z=>Z.stopPropagation()),wt("click",Sn,Z=>{Z.stopPropagation(),k(c(y))}),x(P,Tt)});var Pe=nt(At,2);{var to=P=>{var y=su(),rt=R(y),Tt=R(rt);Or(Tt,{size:14}),M(rt);var ce=nt(rt,2),xt=R(ce);Bn(xt),Yn(xt,bt=>m(l,bt),()=>c(l)),M(ce),_n(2),M(y),wt("keydown",xt,Y),De("blur",xt,z),si(xt,()=>c(a),bt=>m(a,bt)),x(P,y)},eo=P=>{var y=au(),rt=R(y);Or(rt,{size:14}),_n(2),M(y),wt("click",y,Tt=>{Tt.stopPropagation(),tt()}),x(P,y)};at(Pe,P=>{c(o)?P(to):n()&&P(eo,1)})}M(G),x(e,G),dt()}ei(["click","keydown"]);var lu=K('<div class="editor-wrap svelte-ok7wy5"><div class="cm-container svelte-ok7wy5"></div></div>');function Tu(e,t){ut(t,!0);let n=b(t,"readonly",3,!0),r=b(t,"resetKey",3,0);const i=Ln("theme");let s,o=null,a=t.content;function l(d,f){return d.theme({"&":{backgroundColor:"transparent",color:"var(--color-text-primary)",fontSize:"15px",fontFamily:"var(--font-sans)"},".cm-content":{padding:"32px 40px",fontFamily:"var(--font-sans)",caretColor:"var(--color-accent)",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"var(--color-accent)"},".cm-selectionBackground":{backgroundColor:f?"rgba(110,110,232,0.2)":"rgba(110,110,232,0.15)"},"&.cm-focused .cm-selectionBackground":{backgroundColor:f?"rgba(110,110,232,0.3)":"rgba(110,110,232,0.2)"},".cm-gutters":{display:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-line":{padding:"0"},".cm-header-1":{fontSize:"22px",fontWeight:"600"},".cm-header-2":{fontSize:"16px",fontWeight:"600"},".cm-header-3":{fontSize:"15px",fontWeight:"600"},".cm-formatting":{color:"var(--color-text-tertiary)",opacity:"0.5"},".cm-link":{color:"var(--color-link)",textDecoration:"none"}},{dark:f})}ii(async()=>{const{EditorState:d}=await be(async()=>{const{EditorState:k}=await import("./DnlgZ_Tk.js");return{EditorState:k}},[],import.meta.url),{EditorView:f,keymap:v}=await be(async()=>{const{EditorView:k,keymap:I}=await import("./DtVH--hH.js").then(W=>W.i);return{EditorView:k,keymap:I}},__vite__mapDeps([0,1]),import.meta.url),{markdown:p}=await be(async()=>{const{markdown:k}=await import("./Dh_H7Owr.js");return{markdown:k}},__vite__mapDeps([2,1,0,3,4]),import.meta.url),{syntaxHighlighting:g,HighlightStyle:w}=await be(async()=>{const{syntaxHighlighting:k,HighlightStyle:I}=await import("./4QY4j-jX.js");return{syntaxHighlighting:k,HighlightStyle:I}},__vite__mapDeps([3,4,1,0]),import.meta.url),{tags:A}=await be(async()=>{const{tags:k}=await import("./CUzqHQY_.js").then(I=>I.i);return{tags:k}},[],import.meta.url),{livePreviewPlugin:C,livePreviewTheme:F}=await be(async()=>{const{livePreviewPlugin:k,livePreviewTheme:I}=await import("./CksE5s8n.js");return{livePreviewPlugin:k,livePreviewTheme:I}},__vite__mapDeps([5,0,1,3,4]),import.meta.url),S=i.current==="dark",B=l(f,S),E=w.define([{tag:A.processingInstruction,color:"var(--color-text-tertiary)",opacity:"0.7"}]),T=[p(),B,g(E),C,F,f.lineWrapping];n()&&T.push(d.readOnly.of(!0)),t.onchange&&T.push(f.updateListener.of(k=>{if(k.docChanged){const I=k.state.doc.toString();a=I,t.onchange(I)}})),T.push(f.domEventHandlers({click(k){const I=k.target;if(t.onwikilinkclick){const H=I.closest(".cm-live-wikilink");if(H){k.preventDefault();const $=H.textContent?.replace(/^\[{1,2}|\]{1,2}$/g,"").trim();return $&&t.onwikilinkclick($),!0}}const W=I.closest(".cm-live-link");if(W){const H=W.getAttribute("data-href");if(H)return k.preventDefault(),window.open(H,"_blank","noopener,noreferrer"),!0}return!1}})),t.onsave&&T.push(v.of([{key:"Mod-s",run:()=>(t.onsave(),!0)}]));const Q=d.create({doc:t.content,extensions:T});o=new f({state:Q,parent:s})}),vt(()=>{r(),o&&t.content!==a&&(a=t.content,o.dispatch({changes:{from:0,to:o.state.doc.length,insert:t.content}}))}),Mo(()=>{o?.destroy()});var u=lu(),h=R(u);Yn(h,d=>s=d,()=>s),M(u),x(e,u),dt()}const uu=/^\d{4}-\d{2}-\d{2}/,du=new Set(["active","inactive","in-progress","completed","draft","archived","current","former","contractor","client","partner","won","lost","open","closed"]),fu=new Set(["entity_type","format"]),hu=new Set(["entity_id","created_at","updated_at","created_by","updated_by"]);function ku(e,t){const n=[];for(const[r,i]of Object.entries(e)){if(hu.has(r)||i==null)continue;const s=gu(r,i);s&&n.push(s)}return n}function gu(e,t){if(fu.has(e))return{key:e,value:String(t).toUpperCase(),type:"badge"};if(e==="status")return{key:e,value:String(t),type:"status"};if(Array.isArray(t)){const i=t.map(String),s=i.some(a=>/^\[\[.+?\]\]$/.test(a)),o=i.map(a=>{const l=a.match(/^\[\[(.+?)\]\]$/);return l?l[1]:a});return s||o.every(a=>ti(a))?{key:e,value:o,type:"wikilink"}:{key:e,value:i.join(", "),type:"text"}}const n=String(t),r=n.match(/^\[\[(.+?)\]\]$/);return r?{key:e,value:r[1],type:"wikilink"}:uu.test(n)?{key:e,value:n,type:"date"}:du.has(n.toLowerCase())?{key:e,value:n,type:"status"}:ti(n)&&!n.includes(" ")?{key:e,value:n,type:"wikilink"}:{key:e,value:n,type:"text"}}function ti(e){return/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(e)&&e.includes("-")}function vu(){let e=L(!1),t=L(!1),n=L(null),r=L(null);async function i(l,u,h,d){m(e,!0),m(r,null);try{const f=await Bo(l,u,h,d);return m(t,!1),m(n,new Date,!0),await Pr.refresh(),f}catch(f){return m(r,f.message??"Save failed",!0),null}finally{m(e,!1)}}async function s(l,u,h,d,f){m(e,!0),m(r,null);try{return await Lo(l,u,h,d,f),m(t,!1),m(n,new Date,!0),await Pr.refresh(),!0}catch(v){return m(r,v.message??"Save failed",!0),!1}finally{m(e,!1)}}function o(){m(t,!0)}function a(){m(t,!1),m(r,null),m(n,null)}return{get saving(){return c(e)},get dirty(){return c(t)},get lastSaved(){return c(n)},get error(){return c(r)},saveEntity:i,saveContentFile:s,markDirty:o,reset:a}}const Mu=vu();export{Tu as C,Cu as I,Mu as e,ku as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as l,g as o,p as u,i as n,j as d,k as m,h as p,e as _,m as v,l as k}from"./D2K5GzLj.js";class w{anchor;#t=new Map;#s=new Map;#e=new Map;#i=new Set;#f=!0;constructor(t,s=!0){this.anchor=t,this.#f=s}#a=t=>{if(this.#t.has(t)){var s=this.#t.get(t),e=this.#s.get(s);if(e)l(e),this.#i.delete(s);else{var f=this.#e.get(s);f&&(this.#s.set(s,f.effect),this.#e.delete(s),f.fragment.lastChild.remove(),this.anchor.before(f.fragment),e=f.effect)}for(const[i,a]of this.#t){if(this.#t.delete(i),i===t)break;const r=this.#e.get(a);r&&(o(r.effect),this.#e.delete(a))}for(const[i,a]of this.#s){if(i===s||this.#i.has(i))continue;const r=()=>{if(Array.from(this.#t.values()).includes(i)){var c=document.createDocumentFragment();v(a,c),c.append(n()),this.#e.set(i,{effect:a,fragment:c})}else o(a);this.#i.delete(i),this.#s.delete(i)};this.#f||!e?(this.#i.add(i),u(a,r,!1)):r()}}};#r=t=>{this.#t.delete(t);const s=Array.from(this.#t.values());for(const[e,f]of this.#e)s.includes(e)||(o(f.effect),this.#e.delete(e))};ensure(t,s){var e=m,f=k();if(s&&!this.#s.has(t)&&!this.#e.has(t))if(f){var i=document.createDocumentFragment(),a=n();i.append(a),this.#e.set(t,{effect:d(()=>s(a)),fragment:i})}else this.#s.set(t,d(()=>s(this.anchor)));if(this.#t.set(e,t),f){for(const[r,h]of this.#s)r===t?e.unskip_effect(h):e.skip_effect(h);for(const[r,h]of this.#e)r===t?e.unskip_effect(h.effect):e.skip_effect(h.effect);e.oncommit(this.#a),e.ondiscard(this.#r)}else p&&(this.anchor=_),this.#a(e)}}export{w as B};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as d,z as g,A as c,B as m,C as i,D as b,F as p,G as v,I as y,J as h}from"./D2K5GzLj.js";function x(n=!1){const s=d,e=s.l.u;if(!e)return;let f=()=>v(s.s);if(n){let a=0,t={};const _=y(()=>{let l=!1;const r=s.s;for(const o in r)r[o]!==t[o]&&(t[o]=r[o],l=!0);return l&&a++,a});f=()=>p(_)}e.b.length&&g(()=>{u(s,f),i(e.b)}),c(()=>{const a=m(()=>e.m.map(b));return()=>{for(const t of a)typeof t=="function"&&t()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}h();export{x as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.YEQhw1us.js","../chunks/SBEriEQR.js","../chunks/D2K5GzLj.js","../chunks/Dg2wWwJu.js","../chunks/m_R7HatS.js","../assets/0.BwJV4fvl.css","../nodes/1.CvmHhpRy.js","../chunks/vlmEnjfO.js","../chunks/DEkoussQ.js","../chunks/B4G4uWkV.js","../nodes/2.c5k1r7dq.js","../chunks/DW-KmHRi.js","../chunks/D0JBkEPE.js","../assets/ChatPanel.BNzaCFTL.css","../assets/2.DRHi7ABa.css","../nodes/3.B24tcdLK.js","../chunks/YTERt3Ul.js","../chunks/DcCr4z9k.js","../chunks/PPVm8Dsz.js","../assets/editor.D6Rjo7RE.css","../assets/3.CnAQdPKU.css","../nodes/4.kX2m5Pp9.js","../chunks/CqkleIqs.js","../assets/4.BG92MufE.css","../nodes/5.DELt6wTD.js","../assets/5.CfrQIPYs.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as f}from"../chunks/PPVm8Dsz.js";import{U as b,ay as F,F as u,aJ as G,aK as J,aL as K,n as U,z as B,A as H,S as N,aM as Q,V as y,u as W,q as X,P as E,t as Z,w as $,x as tt,Y as P}from"../chunks/D2K5GzLj.js";import{h as et,m as rt,u as at,s as st}from"../chunks/DEkoussQ.js";import{a as h,j as p,f as V,t as ot}from"../chunks/SBEriEQR.js";import{p as O,i as R,b as x}from"../chunks/DW-KmHRi.js";import{c as A}from"../chunks/DcCr4z9k.js";function nt(s){return class extends it{constructor(t){super({component:s,...t})}}}class it{#e;#t;constructor(t){var a=new Map,n=(e,r)=>{var c=K(r,!1,!1);return a.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(a.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===F?!0:(u(a.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return b(a.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&G(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||J(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{at(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const n=(...i)=>a.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const bt={};var ct=V('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),ut=V("<!> <!>",1);function mt(s,t){U(t,!0);let a=O(t,"components",23,()=>[]),n=O(t,"data_0",3,null),i=O(t,"data_1",3,null);B(()=>t.stores.page.set(t.page)),H(()=>{t.stores,t.page,t.constructors,a(),t.form,n(),i(),t.stores.page.notify()});let e=E(!1),r=E(!1),c=E(null);N(()=>{const o=t.stores.page.subscribe(()=>{u(e)&&(b(r,!0),Q().then(()=>{b(c,document.title||"untitled page",!0)}))});return b(e,!0),o});const I=P(()=>t.constructors[1]);var L=ut(),j=y(L);{var T=o=>{const m=P(()=>t.constructors[0]);var d=p(),v=y(d);A(v,()=>u(m),(_,l)=>{x(l(_,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,_t)=>{var w=p(),M=y(w);A(M,()=>u(I),(Y,q)=>{x(q(Y,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),z=>a()[1]=z,()=>a()?.[1])}),h(g,w)},$$slots:{default:!0}}),g=>a()[0]=g,()=>a()?.[0])}),h(o,d)},k=o=>{const m=P(()=>t.constructors[0]);var d=p(),v=y(d);A(v,()=>u(m),(_,l)=>{x(l(_,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>a()[0]=g,()=>a()?.[0])}),h(o,d)};R(j,o=>{t.constructors[1]?o(T):o(k,!1)})}var C=W(j,2);{var S=o=>{var m=ct(),d=Z(m);{var v=_=>{var l=ot();tt(()=>st(l,u(c))),h(_,l)};R(d,_=>{u(r)&&_(v)})}$(m),h(o,m)};R(C,o=>{u(e)&&o(S)})}h(s,L),X()}const Et=nt(mt),Pt=[()=>f(()=>import("../nodes/0.YEQhw1us.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>f(()=>import("../nodes/1.CvmHhpRy.js"),__vite__mapDeps([6,1,2,7,8,9]),import.meta.url),()=>f(()=>import("../nodes/2.c5k1r7dq.js"),__vite__mapDeps([10,1,2,7,8,11,4,12,3,9,13,14]),import.meta.url),()=>f(()=>import("../nodes/3.B24tcdLK.js"),__vite__mapDeps([15,3,2,4,1,8,11,12,9,7,13,16,17,18,19,20]),import.meta.url),()=>f(()=>import("../nodes/4.kX2m5Pp9.js"),__vite__mapDeps([21,3,2,4,1,8,11,12,9,7,13,16,17,18,19,22,23]),import.meta.url),()=>f(()=>import("../nodes/5.DELt6wTD.js"),__vite__mapDeps([24,3,2,4,1,11,12,8,9,7,13,18,25]),import.meta.url)],pt=[],Ot={"/":[2],"/graph":[5],"/[repo]/[type]/[id]":[3],"/[repo]/[type]/[id]/[...path]":[4]},D={handleError:(({error:s})=>{console.error(s)}),reroute:(()=>{}),transport:{}},dt=Object.fromEntries(Object.entries(D.transport).map(([s,t])=>[s,t.decode])),Rt=Object.fromEntries(Object.entries(D.transport).map(([s,t])=>[s,t.encode])),xt=!1,At=(s,t)=>dt[s](t);export{At as decode,dt as decoders,Ot as dictionary,Rt as encoders,xt as hash,D as hooks,bt as matchers,Pt as nodes,Et as root,pt as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/B4G4uWkV.js";export{o as load_css,r as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as _,f as v}from"../chunks/SBEriEQR.js";import{i as E,b as S,K as O,L as x,h as i,M as C,N as m,d as u,c as f,e as b,O as k,n as w,P as g,Q as F,R as h,A as I,F as a,S as T,x as M,q as A,T as D,t as N,w as R,U as c,$ as q}from"../chunks/D2K5GzLj.js";import{s as P,w as p,a as V}from"../chunks/Dg2wWwJu.js";function $(n,l){let o=null,t=i;var d;if(i){o=b;for(var e=k(document.head);e!==null&&(e.nodeType!==C||e.data!==n);)e=m(e);if(e===null)u(!1);else{var s=m(e);e.remove(),f(s)}}i||(d=document.head.appendChild(E()));try{S(()=>l(d),O|x)}finally{t&&(u(!0),f(o))}}var H=v('<div style="display: contents;"><!></div>');function z(n,l){w(l,!0);const o=typeof localStorage<"u"?localStorage.getItem("theme"):null;let t=g(F(o==="light"?"light":"dark"));h("theme",{get current(){return a(t)},toggle(){c(t,a(t)==="dark"?"light":"dark",!0),localStorage.setItem("theme",a(t))}});const e=typeof localStorage<"u"?localStorage.getItem("chatOpen"):null;let s=g(e==="true");h("chat",{get open(){return a(s)},toggle(){c(s,!a(s)),localStorage.setItem("chatOpen",String(a(s)))},close(){c(s,!1),localStorage.setItem("chatOpen","false")}}),I(()=>{document.documentElement.setAttribute("data-theme",a(t))}),T(()=>{p.load()});var r=H();$("12qhfyh",L=>{D(()=>{q.title=(p.name||"Studiograph")??""})});var y=N(r);P(y,()=>l.children),R(r),M(()=>V(r,"data-theme",a(t))),_(n,r),A()}export{z as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,f as h}from"../chunks/SBEriEQR.js";import{i as g}from"../chunks/vlmEnjfO.js";import{n as l,V as v,x as d,q as x,t as a,w as e,u as _}from"../chunks/D2K5GzLj.js";import{s as o}from"../chunks/DEkoussQ.js";import{s as $,p}from"../chunks/B4G4uWkV.js";const k={get error(){return p.error},get status(){return p.status}};$.updated.check;const m=k;var b=h("<h1> </h1> <p> </p>",1);function y(i,f){l(f,!1),g();var t=b(),r=v(t),n=a(r,!0);e(r);var s=_(r,2),c=a(s,!0);e(s),d(()=>{o(n,m.status),o(c,m.error?.message)}),u(i,t),x()}export{y as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l,f as d}from"../chunks/SBEriEQR.js";import{i as b}from"../chunks/vlmEnjfO.js";import{n as C,o as y,q as S,t,u as n,v as V,w as e,x as k}from"../chunks/D2K5GzLj.js";import{s as A}from"../chunks/DEkoussQ.js";import{i as p}from"../chunks/DW-KmHRi.js";import{A as P,V as q,C as L}from"../chunks/D0JBkEPE.js";import{w as m}from"../chunks/Dg2wWwJu.js";var T=d('<h2 class="svelte-1uha8ag"> </h2>'),W=d('<div class="content-row svelte-1uha8ag"><div class="entity-area svelte-1uha8ag"><!> <div class="welcome svelte-1uha8ag"><!> <p class="svelte-1uha8ag">Select an entity from the sidebar to get started.</p></div></div> <!></div>');function I(c,f){C(f,!1);const h=y("chat");b(),P(c,{children:(u,j)=>{var o=W(),s=t(o),i=t(s);q(i,{activeView:"entity"});var v=n(i,2),_=t(v);{var g=a=>{var r=T(),$=t(r);e(r),k(()=>A($,`Welcome to ${(m.name||"Studiograph")??""}`)),l(a,r)};p(_,a=>{m.nameLoaded&&a(g)})}V(2),e(v),e(s);var w=n(s,2);{var x=a=>{L(a,{})};p(w,a=>{h.open&&a(x)})}e(o),l(u,o)},$$slots:{default:!0}}),S()}export{I as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as mt,w as q,c as _t,b as gt,a as pt}from"../chunks/Dg2wWwJu.js";import{d as ht,e as bt,a as f,f as m,b as z}from"../chunks/SBEriEQR.js";import{n as kt,o as xt,P as b,Q as Ct,A as Q,F as n,U as c,W as X,q as wt,X as St,t as y,u as v,Y as S,V as Y,w as u,x as V}from"../chunks/D2K5GzLj.js";import{s as F}from"../chunks/DEkoussQ.js";import{i as P}from"../chunks/DW-KmHRi.js";import{g as Pt,n as Dt,A as Et,V as Kt,e as Ot,i as Tt,C as At}from"../chunks/D0JBkEPE.js";import{g as Vt}from"../chunks/B4G4uWkV.js";import{e as i,I as Ft,C as It,t as Rt}from"../chunks/YTERt3Ul.js";const jt=async({params:D,fetch:e})=>{const{repo:k,type:x,id:_}=D,C=await mt(k,x,_);return{repo:k,type:x,id:_,entity:C}},te=Object.freeze(Object.defineProperty({__proto__:null,load:jt},Symbol.toStringTag,{value:"Module"}));var Jt=m('<span class="bc-sep svelte-1dc9loe">/</span>'),Mt=m("<!><span> </span>",1),Nt=m('<span class="status-text saving svelte-1dc9loe">Saving...</span>'),Ut=m('<span class="status-text error svelte-1dc9loe"> </span>'),Wt=m('<span class="status-text dirty svelte-1dc9loe">Unsaved changes</span> <button class="action-btn discard svelte-1dc9loe">Discard</button> <button class="action-btn save svelte-1dc9loe">Save</button>',1),qt=m('<span class="status-text saved svelte-1dc9loe">Saved</span>'),zt=m('<a class="action-btn open-app svelte-1dc9loe" data-sveltekit-reload=""> </a>'),Qt=m('<div class="content-row svelte-1dc9loe"><div class="entity-area svelte-1dc9loe"><!> <div class="editor-bar svelte-1dc9loe"><div class="breadcrumb-path svelte-1dc9loe"></div> <div class="editor-actions svelte-1dc9loe"><!> <!></div></div> <div class="document-scroll svelte-1dc9loe"><!> <!></div></div> <!></div>');function ee(D,e){kt(e,!0);const k=xt("chat"),x=S(()=>e.data.entity.document?.content??""),_=S(()=>q.getAppForEntityType(e.data.entity.document?.frontmatter?.entity_type??e.data.type)),C=S(()=>()=>{const t=e.data.entity.path;if(t){const r=t.lastIndexOf(`/${e.data.repo}/`);if(r>=0)return t.substring(r+1).split("/")}return[e.data.repo,e.data.id,"main.md"]});let g=b(""),s=b(Ct({})),E=b(0);const B=S(()=>Rt(n(s)));let I=b(""),R=b(0);Q(()=>{const t=`${e.data.repo}/${e.data.type}/${e.data.id}`,r=Pt.revertCount;(t!==n(I)||r!==n(R))&&(c(I,t),c(R,r,!0),c(g,e.data.entity.document?.content??"",!0),c(s,{...e.data.entity.document?.frontmatter??e.data.entity.data??{}},!0),X(E),i.reset())}),Q(()=>{Dt.select(e.data.repo,e.data.type,e.data.id)});function G(t){c(g,t,!0);const r=e.data.entity.document?.content??"";t!==r&&i.markDirty()}function H(t,r){c(s,{...n(s),[t]:r},!0),i.markDirty()}function L(t){const{[t]:r,...d}=n(s);c(s,d,!0),i.markDirty()}function Z(t,r){c(s,{...n(s),[t]:r},!0),i.markDirty()}function $(t,r){i.markDirty()}function K(){const t={};n(g)!==n(x)&&(t.content=n(g));const r=e.data.entity.document?.frontmatter??e.data.entity.data??{};JSON.stringify(n(s))!==JSON.stringify(r)&&(t.data=n(s)),(t.content!==void 0||t.data!==void 0)&&i.saveEntity(e.data.repo,e.data.type,e.data.id,t)}function tt(){c(g,e.data.entity.document?.content??"",!0),c(s,{...e.data.entity.document?.frontmatter??e.data.entity.data??{}},!0),X(E),i.reset()}function et(t){for(const r of q.repos){const d=r.entities.find(p=>p.id===t);if(d){Vt(`/${r.name}/${d.entityType}/${d.id}`);return}}}function at(t){(t.metaKey||t.ctrlKey)&&t.key==="s"&&(t.preventDefault(),K())}bt("keydown",St,at),Et(D,{children:(t,r)=>{var d=Qt(),p=y(d),j=y(p);Kt(j,{activeView:"entity"});var O=v(j,2),T=y(O);Ot(T,21,()=>n(C)(),Tt,(a,o,l)=>{var w=Mt(),W=Y(w);{var ut=h=>{var yt=Jt();f(h,yt)};P(W,h=>{l>0&&h(ut)})}var A=v(W),ft=y(A,!0);u(A),V(h=>{gt(A,1,h,"svelte-1dc9loe"),F(ft,n(o))},[()=>_t(l===n(C)().length-1?"bc-current":"bc-segment")]),f(a,w)}),u(T);var J=v(T,2),M=y(J);{var nt=a=>{var o=Nt();f(a,o)},rt=a=>{var o=Ut(),l=y(o,!0);u(o),V(()=>F(l,i.error)),f(a,o)},ot=a=>{var o=Wt(),l=v(Y(o),2),w=v(l,2);z("click",l,tt),z("click",w,K),f(a,o)},it=a=>{var o=qt();f(a,o)};P(M,a=>{i.saving?a(nt):i.error?a(rt,1):i.dirty?a(ot,2):i.lastSaved&&a(it,3)})}var st=v(M,2);{var dt=a=>{var o=zt(),l=y(o);u(o),V(()=>{pt(o,"href",`${n(_).mountPath??""}/edit/${e.data.repo??""}/${e.data.id??""}`),F(l,`Open in ${n(_).name??""} →`)}),f(a,o)};P(st,a=>{n(_)&&a(dt)})}u(J),u(O);var N=v(O,2),U=y(N);Ft(U,{get properties(){return n(B)},editable:!0,onedit:H,onremove:L,onadd:Z,ontypechange:$});var ct=v(U,2);It(ct,{get content(){return n(g)},readonly:!1,onchange:G,onsave:K,onwikilinkclick:et,get resetKey(){return n(E)}}),u(N),u(p);var lt=v(p,2);{var vt=a=>{At(a,{})};P(lt,a=>{k.open&&a(vt)})}u(d),f(t,d)},$$slots:{default:!0}}),wt()}ht(["click"]);export{ee as component,te as universal};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{d as Vt,r as zt,e as jt,b as Yt,c as Xt,w as Gt}from"../chunks/Dg2wWwJu.js";import{d as Ht,b as rt,a as $,f as tt,e as $t}from"../chunks/SBEriEQR.js";import{n as Qt,P as mt,Q as Tt,A as Ft,t as B,u as Y,F as l,w as q,x as Dt,U as T,v as te,q as Jt,o as ee,W as Mt,Y as Rt,X as re,V as qt}from"../chunks/D2K5GzLj.js";import{s as Kt}from"../chunks/DEkoussQ.js";import{i as Et,b as ne}from"../chunks/DW-KmHRi.js";import{e as St,X as It,i as xt,P as Ut,n as ie,A as se,V as ae,C as oe}from"../chunks/D0JBkEPE.js";import{g as le}from"../chunks/B4G4uWkV.js";import{e as G,I as ue,C as he,t as fe}from"../chunks/YTERt3Ul.js";import{g as de}from"../chunks/CqkleIqs.js";const ce=async({params:x})=>{const{repo:c,type:C,id:a,path:F}=x,P=await Vt(c,C,a,F);return{repo:c,type:C,id:a,filePath:F,fileName:F.split("/").pop()??F,content:P}},Ue=Object.freeze(Object.defineProperty({__proto__:null,load:ce},Symbol.toStringTag,{value:"Module"}));var Ot={exports:{}};var pe=Ot.exports,Wt;function _e(){return Wt||(Wt=1,(function(x,c){((C,a)=>{x.exports=a()})(pe,function C(){var a=typeof self<"u"?self:typeof window<"u"?window:a!==void 0?a:{},F,P=!a.document&&!!a.postMessage,W=a.IS_PAPA_WORKER||!1,Q={},pt=0,p={};function Z(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var r=dt(e);r.chunkSize=parseInt(r.chunkSize),e.step||e.chunk||(r.chunkSize=null),this._handle=new yt(r),(this._handle.streamer=this)._config=r}).call(this,t),this.parseChunk=function(e,r){var n=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<n){let k=this._config.newline;k||(i=this._config.quoteChar||'"',k=this._handle.guessLineEndings(e,i)),e=[...e.split(k).slice(n)].join(k)}this.isFirstChunk&&y(this._config.beforeFirstChunk)&&(i=this._config.beforeFirstChunk(e))!==void 0&&(e=i),this.isFirstChunk=!1,this._halted=!1;var n=this._partialLine+e,i=(this._partialLine="",this._handle.parse(n,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=i.meta.cursor,n=(this._finished||(this._partialLine=n.substring(e-this._baseIndex),this._baseIndex=e),i&&i.data&&(this._rowCount+=i.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),W)a.postMessage({results:i,workerId:p.WORKER_ID,finished:n});else if(y(this._config.chunk)&&!r){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=i=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!n||!y(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||i&&i.meta.paused||this._nextChunk(),i}this._halted=!0},this._sendError=function(e){y(this._config.error)?this._config.error(e):W&&this._config.error&&a.postMessage({workerId:p.WORKER_ID,error:e,finished:!1})}}function ot(t){var e;(t=t||{}).chunkSize||(t.chunkSize=p.RemoteChunkSize),Z.call(this,t),this._nextChunk=P?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(r){this._input=r,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),P||(e.onload=b(this._chunkLoaded,this),e.onerror=b(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!P),this._config.downloadRequestHeaders){var r,n=this._config.downloadRequestHeaders;for(r in n)e.setRequestHeader(r,n[r])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,e.setRequestHeader("Range","bytes="+this._start+"-"+i));try{e.send(this._config.downloadRequestBody)}catch(k){this._chunkError(k.message)}P&&e.status===0&&this._chunkError()}},this._chunkLoaded=function(){e.readyState===4&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize||e.responseText.length,this._finished=!this._config.chunkSize||this._start>=(r=>(r=r.getResponseHeader("Content-Range"))!==null?parseInt(r.substring(r.lastIndexOf("/")+1)):-1)(e),this.parseChunk(e.responseText)))},this._chunkError=function(r){r=e.statusText||r,this._sendError(new Error(r))}}function lt(t){(t=t||{}).chunkSize||(t.chunkSize=p.LocalChunkSize),Z.call(this,t);var e,r,n=typeof FileReader<"u";this.stream=function(i){this._input=i,r=i.slice||i.webkitSlice||i.mozSlice,n?((e=new FileReader).onload=b(this._chunkLoaded,this),e.onerror=b(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var i=this._input,k=(this._config.chunkSize&&(k=Math.min(this._start+this._config.chunkSize,this._input.size),i=r.call(i,this._start,k)),e.readAsText(i,this._config.encoding));n||this._chunkLoaded({target:{result:k}})},this._chunkLoaded=function(i){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(i.target.result)},this._chunkError=function(){this._sendError(e.error)}}function ut(t){var e;Z.call(this,t=t||{}),this.stream=function(r){return e=r,this._nextChunk()},this._nextChunk=function(){var r,n;if(!this._finished)return r=this._config.chunkSize,e=r?(n=e.substring(0,r),e.substring(r)):(n=e,""),this._finished=!e,this.parseChunk(n)}}function H(t){Z.call(this,t=t||{});var e=[],r=!0,n=!1;this.pause=function(){Z.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){Z.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(i){this._input=i,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&e.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=b(function(i){try{e.push(typeof i=="string"?i:i.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(k){this._streamError(k)}},this),this._streamError=b(function(i){this._streamCleanUp(),this._sendError(i)},this),this._streamEnd=b(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=b(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function yt(t){var e,r,n,i,k=Math.pow(2,53),K=-k,u=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,h=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,s=this,S=0,f=0,z=!1,g=!1,_=[],o={data:[],errors:[],meta:{}};function L(d){return t.skipEmptyLines==="greedy"?d.join("").trim()==="":d.length===1&&d[0].length===0}function j(){if(o&&n&&(m("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+p.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines&&(o.data=o.data.filter(function(v){return!L(v)})),N()){let v=function(M,I){y(t.transformHeader)&&(M=t.transformHeader(M,I)),_.push(M)};if(o)if(Array.isArray(o.data[0])){for(var d=0;N()&&d<o.data.length;d++)o.data[d].forEach(v);o.data.splice(0,1)}else o.data.forEach(v)}function E(v,M){for(var I=t.header?{}:[],D=0;D<v.length;D++){var O=D,R=v[D],R=((et,w)=>(U=>(t.dynamicTypingFunction&&t.dynamicTyping[U]===void 0&&(t.dynamicTyping[U]=t.dynamicTypingFunction(U)),(t.dynamicTyping[U]||t.dynamicTyping)===!0))(et)?w==="true"||w==="TRUE"||w!=="false"&&w!=="FALSE"&&((U=>{if(u.test(U)&&(U=parseFloat(U),K<U&&U<k))return 1})(w)?parseFloat(w):h.test(w)?new Date(w):w===""?null:w):w)(O=t.header?D>=_.length?"__parsed_extra":_[D]:O,R=t.transform?t.transform(R,O):R);O==="__parsed_extra"?(I[O]=I[O]||[],I[O].push(R)):I[O]=R}return t.header&&(D>_.length?m("FieldMismatch","TooManyFields","Too many fields: expected "+_.length+" fields but parsed "+D,f+M):D<_.length&&m("FieldMismatch","TooFewFields","Too few fields: expected "+_.length+" fields but parsed "+D,f+M)),I}var A;o&&(t.header||t.dynamicTyping||t.transform)&&(A=1,!o.data.length||Array.isArray(o.data[0])?(o.data=o.data.map(E),A=o.data.length):o.data=E(o.data,0),t.header&&o.meta&&(o.meta.fields=_),f+=A)}function N(){return t.header&&_.length===0}function m(d,E,A,v){d={type:d,code:E,message:A},v!==void 0&&(d.row=v),o.errors.push(d)}y(t.step)&&(i=t.step,t.step=function(d){o=d,N()?j():(j(),o.data.length!==0&&(S+=d.data.length,t.preview&&S>t.preview?r.abort():(o.data=o.data[0],i(o,s))))}),this.parse=function(d,E,A){var v=t.quoteChar||'"',v=(t.newline||(t.newline=this.guessLineEndings(d,v)),n=!1,t.delimiter?y(t.delimiter)&&(t.delimiter=t.delimiter(d),o.meta.delimiter=t.delimiter):((v=((M,I,D,O,R)=>{var et,w,U,vt;R=R||[","," ","|",";",p.RECORD_SEP,p.UNIT_SEP];for(var kt=0;kt<R.length;kt++){for(var it,wt=R[kt],V=0,st=0,J=0,X=(U=void 0,new nt({comments:O,delimiter:wt,newline:I,preview:10}).parse(M)),ct=0;ct<X.data.length;ct++)D&&L(X.data[ct])?J++:(it=X.data[ct].length,st+=it,U===void 0?U=it:0<it&&(V+=Math.abs(it-U),U=it));0<X.data.length&&(st/=X.data.length-J),(w===void 0||V<=w)&&(vt===void 0||vt<st)&&1.99<st&&(w=V,et=wt,vt=st)}return{successful:!!(t.delimiter=et),bestDelimiter:et}})(d,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess)).successful?t.delimiter=v.bestDelimiter:(n=!0,t.delimiter=p.DefaultDelimiter),o.meta.delimiter=t.delimiter),dt(t));return t.preview&&t.header&&v.preview++,e=d,r=new nt(v),o=r.parse(e,E,A),j(),z?{meta:{paused:!0}}:o||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,r.abort(),e=y(t.chunk)?"":e.substring(r.getCharIndex())},this.resume=function(){s.streamer._halted?(z=!1,s.streamer.parseChunk(e,!0)):setTimeout(s.resume,3)},this.aborted=function(){return g},this.abort=function(){g=!0,r.abort(),o.meta.aborted=!0,y(t.complete)&&t.complete(o),e=""},this.guessLineEndings=function(M,v){M=M.substring(0,1048576);var v=new RegExp(ht(v)+"([^]*?)"+ht(v),"gm"),A=(M=M.replace(v,"")).split("\r"),v=M.split(`
|
|
2
|
+
`),M=1<v.length&&v[0].length<A[0].length;if(A.length===1||M)return`
|
|
3
|
+
`;for(var I=0,D=0;D<A.length;D++)A[D][0]===`
|
|
4
|
+
`&&I++;return I>=A.length/2?`\r
|
|
5
|
+
`:"\r"}}function ht(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nt(t){var e=(t=t||{}).delimiter,r=t.newline,n=t.comments,i=t.step,k=t.preview,K=t.fastMode,u=null,h=!1,s=t.quoteChar==null?'"':t.quoteChar,S=s;if(t.escapeChar!==void 0&&(S=t.escapeChar),(typeof e!="string"||-1<p.BAD_DELIMITERS.indexOf(e))&&(e=","),n===e)throw new Error("Comment character same as delimiter");n===!0?n="#":(typeof n!="string"||-1<p.BAD_DELIMITERS.indexOf(n))&&(n=!1),r!==`
|
|
6
|
+
`&&r!=="\r"&&r!==`\r
|
|
7
|
+
`&&(r=`
|
|
8
|
+
`);var f=0,z=!1;this.parse=function(g,_,o){if(typeof g!="string")throw new Error("Input must be a string");var L=g.length,j=e.length,N=r.length,m=n.length,d=y(i),E=[],A=[],v=[],M=f=0;if(!g)return V();if(K||K!==!1&&g.indexOf(s)===-1){for(var I=g.split(r),D=0;D<I.length;D++){if(v=I[D],f+=v.length,D!==I.length-1)f+=r.length;else if(o)return V();if(!n||v.substring(0,m)!==n){if(d){if(E=[],vt(v.split(e)),st(),z)return V()}else vt(v.split(e));if(k&&k<=D)return E=E.slice(0,k),V(!0)}}return V()}for(var O=g.indexOf(e,f),R=g.indexOf(r,f),et=new RegExp(ht(S)+ht(s),"g"),w=g.indexOf(s,f);;)if(g[f]===s)for(w=f,f++;;){if((w=g.indexOf(s,w+1))===-1)return o||A.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:E.length,index:f}),it();if(w===L-1)return it(g.substring(f,w).replace(et,s));if(s===S&&g[w+1]===S)w++;else if(s===S||w===0||g[w-1]!==S){O!==-1&&O<w+1&&(O=g.indexOf(e,w+1));var U=kt((R=R!==-1&&R<w+1?g.indexOf(r,w+1):R)===-1?O:Math.min(O,R));if(g.substr(w+1+U,j)===e){v.push(g.substring(f,w).replace(et,s)),g[f=w+1+U+j]!==s&&(w=g.indexOf(s,f)),O=g.indexOf(e,f),R=g.indexOf(r,f);break}if(U=kt(R),g.substring(w+1+U,w+1+U+N)===r){if(v.push(g.substring(f,w).replace(et,s)),wt(w+1+U+N),O=g.indexOf(e,f),w=g.indexOf(s,f),d&&(st(),z))return V();if(k&&E.length>=k)return V(!0);break}A.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:E.length,index:f}),w++}}else if(n&&v.length===0&&g.substring(f,f+m)===n){if(R===-1)return V();f=R+N,R=g.indexOf(r,f),O=g.indexOf(e,f)}else if(O!==-1&&(O<R||R===-1))v.push(g.substring(f,O)),f=O+j,O=g.indexOf(e,f);else{if(R===-1)break;if(v.push(g.substring(f,R)),wt(R+N),d&&(st(),z))return V();if(k&&E.length>=k)return V(!0)}return it();function vt(J){E.push(J),M=f}function kt(J){var X=0;return X=J!==-1&&(J=g.substring(w+1,J))&&J.trim()===""?J.length:X}function it(J){return o||(J===void 0&&(J=g.substring(f)),v.push(J),f=L,vt(v),d&&st()),V()}function wt(J){f=J,vt(v),v=[],R=g.indexOf(r,f)}function V(J){if(t.header&&!_&&E.length&&!h){var X=E[0],ct=Object.create(null),At=new Set(X);let Lt=!1;for(let bt=0;bt<X.length;bt++){let at=X[bt];if(ct[at=y(t.transformHeader)?t.transformHeader(at,bt):at]){let Ct,Pt=ct[at];for(;Ct=at+"_"+Pt,Pt++,At.has(Ct););At.add(Ct),X[bt]=Ct,ct[at]++,Lt=!0,(u=u===null?{}:u)[Ct]=at}else ct[at]=1,X[bt]=at;At.add(at)}Lt&&console.warn("Duplicate headers found and renamed."),h=!0}return{data:E,errors:A,meta:{delimiter:e,linebreak:r,aborted:z,truncated:!!J,cursor:M+(_||0),renamedHeaders:u}}}function st(){i(V()),E=[],A=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return f}}function ft(t){var e=t.data,r=Q[e.workerId],n=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var i={abort:function(){n=!0,_t(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:gt,resume:gt};if(y(r.userStep)){for(var k=0;k<e.results.data.length&&(r.userStep({data:e.results.data[k],errors:e.results.errors,meta:e.results.meta},i),!n);k++);delete e.results}else y(r.userChunk)&&(r.userChunk(e.results,i,e.file),delete e.results)}e.finished&&!n&&_t(e.workerId,e.results)}function _t(t,e){var r=Q[t];y(r.userComplete)&&r.userComplete(e),r.terminate(),delete Q[t]}function gt(){throw new Error("Not implemented.")}function dt(t){if(typeof t!="object"||t===null)return t;var e,r=Array.isArray(t)?[]:{};for(e in t)r[e]=dt(t[e]);return r}function b(t,e){return function(){t.apply(e,arguments)}}function y(t){return typeof t=="function"}return p.parse=function(t,e){var r=(e=e||{}).dynamicTyping||!1;if(y(r)&&(e.dynamicTypingFunction=r,r={}),e.dynamicTyping=r,e.transform=!!y(e.transform)&&e.transform,!e.worker||!p.WORKERS_SUPPORTED)return r=null,p.NODE_STREAM_INPUT,typeof t=="string"?(t=(n=>n.charCodeAt(0)!==65279?n:n.slice(1))(t),r=new(e.download?ot:ut)(e)):t.readable===!0&&y(t.read)&&y(t.on)?r=new H(e):(a.File&&t instanceof File||t instanceof Object)&&(r=new lt(e)),r.stream(t);(r=(()=>{var n;return!!p.WORKERS_SUPPORTED&&(n=(()=>{var i=a.URL||a.webkitURL||null,k=C.toString();return p.BLOB_URL||(p.BLOB_URL=i.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",k,")();"],{type:"text/javascript"})))})(),(n=new a.Worker(n)).onmessage=ft,n.id=pt++,Q[n.id]=n)})()).userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=y(e.step),e.chunk=y(e.chunk),e.complete=y(e.complete),e.error=y(e.error),delete e.worker,r.postMessage({input:t,config:e,workerId:r.id})},p.unparse=function(t,e){var r=!1,n=!0,i=",",k=`\r
|
|
9
|
+
`,K='"',u=K+K,h=!1,s=null,S=!1,f=((()=>{if(typeof e=="object"){if(typeof e.delimiter!="string"||p.BAD_DELIMITERS.filter(function(_){return e.delimiter.indexOf(_)!==-1}).length||(i=e.delimiter),typeof e.quotes!="boolean"&&typeof e.quotes!="function"&&!Array.isArray(e.quotes)||(r=e.quotes),typeof e.skipEmptyLines!="boolean"&&typeof e.skipEmptyLines!="string"||(h=e.skipEmptyLines),typeof e.newline=="string"&&(k=e.newline),typeof e.quoteChar=="string"&&(K=e.quoteChar),typeof e.header=="boolean"&&(n=e.header),Array.isArray(e.columns)){if(e.columns.length===0)throw new Error("Option columns is empty");s=e.columns}e.escapeChar!==void 0&&(u=e.escapeChar+K),e.escapeFormulae instanceof RegExp?S=e.escapeFormulae:typeof e.escapeFormulae=="boolean"&&e.escapeFormulae&&(S=/^[=+\-@\t\r].*$/)}})(),new RegExp(ht(K),"g"));if(typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return z(null,t,h);if(typeof t[0]=="object")return z(s||Object.keys(t[0]),t,h)}else if(typeof t=="object")return typeof t.data=="string"&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||s),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:typeof t.data[0]=="object"?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||typeof t.data[0]=="object"||(t.data=[t.data])),z(t.fields||[],t.data||[],h);throw new Error("Unable to serialize unrecognized input");function z(_,o,L){var j="",N=(typeof _=="string"&&(_=JSON.parse(_)),typeof o=="string"&&(o=JSON.parse(o)),Array.isArray(_)&&0<_.length),m=!Array.isArray(o[0]);if(N&&n){for(var d=0;d<_.length;d++)0<d&&(j+=i),j+=g(_[d],d);0<o.length&&(j+=k)}for(var E=0;E<o.length;E++){var A=(N?_:o[E]).length,v=!1,M=N?Object.keys(o[E]).length===0:o[E].length===0;if(L&&!N&&(v=L==="greedy"?o[E].join("").trim()==="":o[E].length===1&&o[E][0].length===0),L==="greedy"&&N){for(var I=[],D=0;D<A;D++){var O=m?_[D]:D;I.push(o[E][O])}v=I.join("").trim()===""}if(!v){for(var R=0;R<A;R++){0<R&&!M&&(j+=i);var et=N&&m?_[R]:R;j+=g(o[E][et],R)}E<o.length-1&&(!L||0<A&&!M)&&(j+=k)}}return j}function g(_,o){var L,j;return _==null?"":_.constructor===Date?JSON.stringify(_).slice(1,25):(j=!1,S&&typeof _=="string"&&S.test(_)&&(_="'"+_,j=!0),L=_.toString().replace(f,u),(j=j||r===!0||typeof r=="function"&&r(_,o)||Array.isArray(r)&&r[o]||((N,m)=>{for(var d=0;d<m.length;d++)if(-1<N.indexOf(m[d]))return!0;return!1})(L,p.BAD_DELIMITERS)||-1<L.indexOf(i)||L.charAt(0)===" "||L.charAt(L.length-1)===" ")?K+L+K:L)}},p.RECORD_SEP="",p.UNIT_SEP="",p.BYTE_ORDER_MARK="\uFEFF",p.BAD_DELIMITERS=["\r",`
|
|
10
|
+
`,'"',p.BYTE_ORDER_MARK],p.WORKERS_SUPPORTED=!P&&!!a.Worker,p.NODE_STREAM_INPUT=1,p.LocalChunkSize=10485760,p.RemoteChunkSize=5242880,p.DefaultDelimiter=",",p.Parser=nt,p.ParserHandle=yt,p.NetworkStreamer=ot,p.FileStreamer=lt,p.StringStreamer=ut,p.ReadableStreamStreamer=H,a.jQuery&&((F=a.jQuery).fn.parse=function(t){var e=t.config||{},r=[];return this.each(function(k){if(!(F(this).prop("tagName").toUpperCase()==="INPUT"&&F(this).attr("type").toLowerCase()==="file"&&a.FileReader)||!this.files||this.files.length===0)return!0;for(var K=0;K<this.files.length;K++)r.push({file:this.files[K],inputElem:this,instanceConfig:F.extend({},e)})}),n(),this;function n(){if(r.length===0)y(t.complete)&&t.complete();else{var k,K,u,h,s=r[0];if(y(t.before)){var S=t.before(s.file,s.inputElem);if(typeof S=="object"){if(S.action==="abort")return k="AbortError",K=s.file,u=s.inputElem,h=S.reason,void(y(t.error)&&t.error({name:k},K,u,h));if(S.action==="skip")return void i();typeof S.config=="object"&&(s.instanceConfig=F.extend(s.instanceConfig,S.config))}else if(S==="skip")return void i()}var f=s.instanceConfig.complete;s.instanceConfig.complete=function(z){y(f)&&f(z,s.file,s.inputElem),i()},p.parse(s.file,s.instanceConfig)}}function i(){r.splice(0,1),n()}}),W&&(a.onmessage=function(t){t=t.data,p.WORKER_ID===void 0&&t&&(p.WORKER_ID=t.workerId),typeof t.input=="string"?a.postMessage({workerId:p.WORKER_ID,results:p.parse(t.input,t.config),finished:!0}):(a.File&&t.input instanceof File||t.input instanceof Object)&&(t=p.parse(t.input,t.config))&&a.postMessage({workerId:p.WORKER_ID,results:t,finished:!0})}),(ot.prototype=Object.create(Z.prototype)).constructor=ot,(lt.prototype=Object.create(Z.prototype)).constructor=lt,(ut.prototype=Object.create(ut.prototype)).constructor=ut,(H.prototype=Object.create(Z.prototype)).constructor=H,p})})(Ot)),Ot.exports}var ge=_e();const Nt=de(ge);var ve=tt('<button class="col-delete-btn svelte-63hltt" title="Delete column"><!></button>'),me=tt('<th class="svelte-63hltt"><input class="cell-input header-input svelte-63hltt"/> <!></th>'),ye=tt('<td class="svelte-63hltt"><input class="cell-input svelte-63hltt"/></td>'),ke=tt('<tr class="svelte-63hltt"><td class="row-num svelte-63hltt"></td><!><td class="actions svelte-63hltt"><button class="delete-btn svelte-63hltt" title="Delete row"><!></button></td></tr>'),be=tt('<div class="csv-editor svelte-63hltt"><div class="table-scroll svelte-63hltt"><table class="svelte-63hltt"><thead><tr><th class="row-num svelte-63hltt"></th><!><th class="col-add svelte-63hltt"><button class="col-add-btn svelte-63hltt" title="Add column"><!></button></th></tr></thead><tbody></tbody></table></div> <div class="csv-footer svelte-63hltt"><button class="add-row-btn svelte-63hltt"><!> <span>Add row</span></button></div></div>');function Ee(x,c){Qt(c,!0);let C=mt(Tt([])),a=mt(Tt([])),F=mt(void 0);function P(u){const h=Nt.parse(u.trim(),{header:!1,skipEmptyLines:!0});h.data.length>0?(T(C,h.data[0],!0),T(a,h.data.slice(1),!0)):(T(C,[],!0),T(a,[],!0))}P(c.content),Ft(()=>{P(c.content)});function W(){return Nt.unparse([l(C),...l(a)])}function Q(){c.onchange?.(W())}function pt(u,h,s){l(a)[u][h]=s,T(a,[...l(a)],!0),Q()}function p(u,h){l(C)[u]=h,T(C,[...l(C)],!0),Q()}function Z(){T(a,[...l(a),l(C).map(()=>"")],!0),Q(),H(l(a).length-1,0)}function ot(u){T(a,l(a).filter((h,s)=>s!==u),!0),Q()}function lt(){const u=`col${l(C).length+1}`;T(C,[...l(C),u],!0),T(a,l(a).map(h=>[...h,""]),!0),Q(),requestAnimationFrame(()=>{const h=l(F)?.querySelector(`thead th:nth-child(${l(C).length+1}) input`);h&&(h.focus(),h.select())})}function ut(u){l(C).length<=1||(T(C,l(C).filter((h,s)=>s!==u),!0),T(a,l(a).map(h=>h.filter((s,S)=>S!==u)),!0),Q())}function H(u,h){requestAnimationFrame(()=>{if(!l(F))return;let s=null;u<0?s=l(F).querySelector(`thead th:nth-child(${h+2}) input`):s=l(F).querySelector(`tbody tr:nth-child(${u+1}) td:nth-child(${h+2}) input`),s&&(s.focus(),s.select())})}function yt(u,h,s){if(u.key==="Tab"){u.preventDefault(),u.shiftKey?s>0?H(h,s-1):h>0?H(h-1,l(C).length-1):h===0&&H(-1,l(C).length-1):s<l(C).length-1?H(h,s+1):h<l(a).length-1?H(h+1,0):h===l(a).length-1&&Z();return}if(u.key==="Enter"){u.preventDefault(),u.shiftKey?h>0?H(h-1,s):H(-1,s):h<l(a).length-1?H(h+1,s):Z();return}if(u.key==="Escape"){u.target.blur();return}}function ht(u,h){if(u.key==="Tab"){u.preventDefault(),u.shiftKey?h>0&&H(-1,h-1):h<l(C).length-1?H(-1,h+1):l(a).length>0&&H(0,0);return}if(u.key==="Enter"){u.preventDefault(),l(a).length>0?H(0,h):Z();return}if(u.key==="Escape"){u.target.blur();return}}function nt(u){(u.metaKey||u.ctrlKey)&&u.key==="s"&&(u.preventDefault(),c.onsave?.())}var ft=be(),_t=B(ft),gt=B(_t),dt=B(gt),b=B(dt),y=Y(B(b));St(y,17,()=>l(C),xt,(u,h,s)=>{var S=me(),f=B(S);zt(f);var z=Y(f,2);{var g=_=>{var o=ve(),L=B(o);It(L,{size:12}),q(o),rt("click",o,()=>ut(s)),$(_,o)};Et(z,_=>{l(C).length>1&&_(g)})}q(S),Dt(()=>jt(f,l(h))),rt("input",f,_=>p(s,_.currentTarget.value)),rt("keydown",f,_=>ht(_,s)),$(u,S)});var t=Y(y),e=B(t),r=B(e);Ut(r,{size:14}),q(e),q(t),q(b),q(dt);var n=Y(dt);St(n,21,()=>l(a),xt,(u,h,s)=>{var S=ke(),f=B(S);f.textContent=s+1;var z=Y(f);St(z,17,()=>l(h),xt,(L,j,N)=>{var m=ye(),d=B(m);zt(d),q(m),Dt(()=>jt(d,l(j))),rt("input",d,E=>pt(s,N,E.currentTarget.value)),rt("keydown",d,E=>yt(E,s,N)),$(L,m)});var g=Y(z),_=B(g),o=B(_);It(o,{size:12}),q(_),q(g),q(S),rt("click",_,()=>ot(s)),$(u,S)}),q(n),q(gt),ne(gt,u=>T(F,u),()=>l(F)),q(_t);var i=Y(_t,2),k=B(i),K=B(k);Ut(K,{size:14}),te(2),q(k),q(i),q(ft),rt("keydown",ft,nt),rt("click",e,lt),rt("click",k,Z),$(x,ft),Jt()}Ht(["keydown","input","click"]);function Bt(x){if(!x.startsWith("---"))return{frontmatter:{},content:x};const c=x.indexOf(`
|
|
11
|
+
---`,3);if(c===-1)return{frontmatter:{},content:x};const C=x.slice(4,c),a=x.slice(c+4).replace(/^\n/,"");try{return{frontmatter:we(C),content:a}}catch{return{frontmatter:{},content:x}}}function we(x){const c={},C=x.split(`
|
|
12
|
+
`);let a=0;for(;a<C.length;){const F=C[a];if(!F.trim()||F.trim().startsWith("#")){a++;continue}const P=F.match(/^([a-zA-Z_][a-zA-Z0-9_-]*):\s*(.*)/);if(!P){a++;continue}const W=P[1],Q=P[2].trim();if(!Q&&a+1<C.length&&C[a+1]?.match(/^\s+-\s/)){const pt=[];for(a++;a<C.length&&C[a].match(/^\s+-\s/);){const p=C[a].match(/^\s+-\s+(.*)/);p&&pt.push(Zt(p[1].trim())),a++}c[W]=pt;continue}c[W]=Ce(Q),a++}return c}function Zt(x){return x.startsWith("'")&&x.endsWith("'")||x.startsWith('"')&&x.endsWith('"')?x.slice(1,-1):x}function Ce(x){if(!x)return"";const c=Zt(x);return c==="true"?!0:c==="false"?!1:c==="null"||c==="~"?null:x===c&&/^-?\d+(\.\d+)?$/.test(x)?Number(x):c}var Re=tt('<span class="bc-sep svelte-xtfs5g">/</span>'),Se=tt("<!><span> </span>",1),xe=tt('<span class="status-text saving svelte-xtfs5g">Saving...</span>'),Oe=tt('<span class="status-text error svelte-xtfs5g"> </span>'),De=tt('<span class="status-text dirty svelte-xtfs5g">Unsaved changes</span> <button class="action-btn discard svelte-xtfs5g">Discard</button> <button class="action-btn save svelte-xtfs5g">Save</button>',1),Ae=tt('<span class="status-text saved svelte-xtfs5g">Saved</span>'),Te=tt('<div class="content-row svelte-xtfs5g"><div class="entity-area svelte-xtfs5g"><!> <div class="editor-bar svelte-xtfs5g"><div class="breadcrumb-path svelte-xtfs5g"></div> <div class="editor-actions svelte-xtfs5g"><!></div></div> <div class="document-scroll svelte-xtfs5g"><!> <!></div></div> <!></div>');function We(x,c){Qt(c,!0);const C=ee("chat"),a=Rt(()=>c.data.fileName.endsWith(".csv")),F=Rt(()=>c.data.fileName.endsWith(".md"));let P=mt(""),W=mt(Tt({})),Q=mt(0);const pt=Rt(()=>fe(l(W))),p=Rt(()=>Object.keys(l(W)).length>0),Z=Rt(()=>[c.data.repo,c.data.id,...c.data.filePath.split("/")]);let ot=mt("");Ft(()=>{const b=`${c.data.repo}/${c.data.type}/${c.data.id}/${c.data.filePath}`;if(b!==l(ot)){if(T(ot,b),l(F)||l(a)){const y=Bt(c.data.content);T(W,{...y.frontmatter},!0),T(P,y.content,!0)}else T(W,{},!0),T(P,c.data.content,!0);Mt(Q),G.reset()}}),Ft(()=>{ie.select(c.data.repo,c.data.type,c.data.id,c.data.filePath)});function lt(b){T(P,b,!0),G.markDirty()}function ut(b,y){T(W,{...l(W),[b]:y},!0),G.markDirty()}function H(b){const{[b]:y,...t}=l(W);T(W,t,!0),G.markDirty()}function yt(b,y){T(W,{...l(W),[b]:y},!0),G.markDirty()}function ht(b,y){G.markDirty()}function nt(){if(l(p)){const b=[];for(const[t,e]of Object.entries(l(W)))if(Array.isArray(e)){b.push(`${t}:`);for(const r of e){const n=String(r);b.push(` - ${ft(n)?`'${n}'`:n}`)}}else{const r=String(e??"");b.push(`${t}: ${ft(r)?`'${r}'`:r}`)}const y=`---
|
|
13
|
+
${b.join(`
|
|
14
|
+
`)}
|
|
15
|
+
---
|
|
16
|
+
${l(P)}`;G.saveContentFile(c.data.repo,c.data.type,c.data.id,c.data.filePath,y)}else G.saveContentFile(c.data.repo,c.data.type,c.data.id,c.data.filePath,l(P))}function ft(b){return/[\[\]{}'":,#|>&*!?]/.test(b)||/^\s|\s$/.test(b)}function _t(){if(l(F)||l(a)){const b=Bt(c.data.content);T(W,{...b.frontmatter},!0),T(P,b.content,!0)}else T(W,{},!0),T(P,c.data.content,!0);Mt(Q),G.reset()}function gt(b){for(const y of Gt.repos){const t=y.entities.find(e=>e.id===b);if(t){le(`/${y.name}/${t.entityType}/${t.id}`);return}}}function dt(b){(b.metaKey||b.ctrlKey)&&b.key==="s"&&(b.preventDefault(),nt())}$t("keydown",re,dt),se(x,{children:(b,y)=>{var t=Te(),e=B(t),r=B(e);ae(r,{activeView:"entity"});var n=Y(r,2),i=B(n);St(i,21,()=>l(Z),xt,(m,d,E)=>{var A=Se(),v=qt(A);{var M=O=>{var R=Re();$(O,R)};Et(v,O=>{E>0&&O(M)})}var I=Y(v),D=B(I,!0);q(I),Dt(()=>{Yt(I,1,Xt(E===l(Z).length-1?"bc-current":"bc-segment"),"svelte-xtfs5g"),Kt(D,l(d))}),$(m,A)}),q(i);var k=Y(i,2),K=B(k);{var u=m=>{var d=xe();$(m,d)},h=m=>{var d=Oe(),E=B(d,!0);q(d),Dt(()=>Kt(E,G.error)),$(m,d)},s=m=>{var d=De(),E=Y(qt(d),2),A=Y(E,2);rt("click",E,_t),rt("click",A,nt),$(m,d)},S=m=>{var d=Ae();$(m,d)};Et(K,m=>{G.saving?m(u):G.error?m(h,1):G.dirty?m(s,2):G.lastSaved&&m(S,3)})}q(k),q(n);var f=Y(n,2),z=B(f);{var g=m=>{ue(m,{get properties(){return l(pt)},editable:!0,onedit:ut,onremove:H,onadd:yt,ontypechange:ht})};Et(z,m=>{l(p)&&m(g)})}var _=Y(z,2);{var o=m=>{Ee(m,{get content(){return l(P)},onchange:lt,onsave:nt})},L=m=>{he(m,{get content(){return l(P)},readonly:!1,onchange:lt,onsave:nt,onwikilinkclick:gt,get resetKey(){return l(Q)}})};Et(_,m=>{l(a)?m(o):m(L,!1)})}q(f),q(e);var j=Y(e,2);{var N=m=>{oe(m,{})};Et(j,m=>{C.open&&m(N)})}q(t),$(b,t)},$$slots:{default:!0}}),Jt()}Ht(["click"]);export{We as component,Ue as universal};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BB_5th5W.js","../chunks/PPVm8Dsz.js","../chunks/CqkleIqs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as ke,b as ie,h as oe,a as Fe,w as ae}from"../chunks/Dg2wWwJu.js";import{j as Re,a as kt,d as Oe,b as gt,f as $t,e as se}from"../chunks/SBEriEQR.js";import{V as je,n as pe,o as ve,A as mt,F as C,U as ut,P as zt,Y as Mt,S as Xe,b8 as Ye,x as le,q as ye,t as it,u as At,w as nt}from"../chunks/D2K5GzLj.js";import{l as Ge,s as Le,p as Et,b as He,i as Ve}from"../chunks/DW-KmHRi.js";import{I as Ue,s as Be,a as bt,e as We,i as $e,n as Ut,A as Qe,V as Ke,c as Je,C as Ze}from"../chunks/D0JBkEPE.js";import{_ as qe}from"../chunks/PPVm8Dsz.js";import{s as ce}from"../chunks/DEkoussQ.js";import{g as tn}from"../chunks/B4G4uWkV.js";import"../chunks/vlmEnjfO.js";function en(){return ke("/api/graph")}const nn=async()=>({graphData:await en()}),rr=Object.freeze(Object.defineProperty({__proto__:null,load:nn},Symbol.toStringTag,{value:"Module"}));function rn(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return xe(this.cover(e,n),e,n,t)}function xe(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,a=t._root,c={data:r},o=t._x0,d=t._y0,l=t._x1,p=t._y1,b,x,u,_,f,s,h,w;if(!a)return t._root=c,t;for(;a.length;)if((f=e>=(b=(o+l)/2))?o=b:l=b,(s=n>=(x=(d+p)/2))?d=x:p=x,i=a,!(a=a[h=s<<1|f]))return i[h]=c,t;if(u=+t._x.call(null,a.data),_=+t._y.call(null,a.data),e===u&&n===_)return c.next=a,i?i[h]=c:t._root=c,t;do i=i?i[h]=new Array(4):t._root=new Array(4),(f=e>=(b=(o+l)/2))?o=b:l=b,(s=n>=(x=(d+p)/2))?d=x:p=x;while((h=s<<1|f)===(w=(_>=x)<<1|u>=b));return i[w]=a,i[h]=c,t}function on(t){var e,n,r=t.length,i,a,c=new Array(r),o=new Array(r),d=1/0,l=1/0,p=-1/0,b=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(a=+this._y.call(null,e))||(c[n]=i,o[n]=a,i<d&&(d=i),i>p&&(p=i),a<l&&(l=a),a>b&&(b=a));if(d>p||l>b)return this;for(this.cover(d,l).cover(p,b),n=0;n<r;++n)xe(this,c[n],o[n],t[n]);return this}function an(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var c=i-n||1,o=this._root,d,l;n>t||t>=i||r>e||e>=a;)switch(l=(e<r)<<1|t<n,d=new Array(4),d[l]=o,o=d,c*=2,l){case 0:i=n+c,a=r+c;break;case 1:n=i-c,a=r+c;break;case 2:i=n+c,r=a-c;break;case 3:n=i-c,r=a-c;break}this._root&&this._root.length&&(this._root=o)}return this._x0=n,this._y0=r,this._x1=i,this._y1=a,this}function sn(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function ln(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function U(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function cn(t,e,n){var r,i=this._x0,a=this._y0,c,o,d,l,p=this._x1,b=this._y1,x=[],u=this._root,_,f;for(u&&x.push(new U(u,i,a,p,b)),n==null?n=1/0:(i=t-n,a=e-n,p=t+n,b=e+n,n*=n);_=x.pop();)if(!(!(u=_.node)||(c=_.x0)>p||(o=_.y0)>b||(d=_.x1)<i||(l=_.y1)<a))if(u.length){var s=(c+d)/2,h=(o+l)/2;x.push(new U(u[3],s,h,d,l),new U(u[2],c,h,s,l),new U(u[1],s,o,d,h),new U(u[0],c,o,s,h)),(f=(e>=h)<<1|t>=s)&&(_=x[x.length-1],x[x.length-1]=x[x.length-1-f],x[x.length-1-f]=_)}else{var w=t-+this._x.call(null,u.data),M=e-+this._y.call(null,u.data),y=w*w+M*M;if(y<n){var T=Math.sqrt(n=y);i=t-T,a=e-T,p=t+T,b=e+T,r=u.data}}return r}function fn(t){if(isNaN(p=+this._x.call(null,t))||isNaN(b=+this._y.call(null,t)))return this;var e,n=this._root,r,i,a,c=this._x0,o=this._y0,d=this._x1,l=this._y1,p,b,x,u,_,f,s,h;if(!n)return this;if(n.length)for(;;){if((_=p>=(x=(c+d)/2))?c=x:d=x,(f=b>=(u=(o+l)/2))?o=u:l=u,e=n,!(n=n[s=f<<1|_]))return this;if(!n.length)break;(e[s+1&3]||e[s+2&3]||e[s+3&3])&&(r=e,h=s)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,i?(a?i.next=a:delete i.next,this):e?(a?e[s]=a:delete e[s],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[h]=n:this._root=n),this):(this._root=a,this)}function un(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function hn(){return this._root}function dn(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function gn(t){var e=[],n,r=this._root,i,a,c,o,d;for(r&&e.push(new U(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(r=n.node,a=n.x0,c=n.y0,o=n.x1,d=n.y1)&&r.length){var l=(a+o)/2,p=(c+d)/2;(i=r[3])&&e.push(new U(i,l,p,o,d)),(i=r[2])&&e.push(new U(i,a,p,l,d)),(i=r[1])&&e.push(new U(i,l,c,o,p)),(i=r[0])&&e.push(new U(i,a,c,l,p))}return this}function pn(t){var e=[],n=[],r;for(this._root&&e.push(new U(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var i=r.node;if(i.length){var a,c=r.x0,o=r.y0,d=r.x1,l=r.y1,p=(c+d)/2,b=(o+l)/2;(a=i[0])&&e.push(new U(a,c,o,p,b)),(a=i[1])&&e.push(new U(a,p,o,d,b)),(a=i[2])&&e.push(new U(a,c,b,p,l)),(a=i[3])&&e.push(new U(a,p,b,d,l))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function vn(t){return t[0]}function yn(t){return arguments.length?(this._x=t,this):this._x}function xn(t){return t[1]}function wn(t){return arguments.length?(this._y=t,this):this._y}function Qt(t,e,n){var r=new Kt(e??vn,n??xn,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function Kt(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function fe(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var W=Qt.prototype=Kt.prototype;W.copy=function(){var t=new Kt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=fe(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?n.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=fe(r));return t};W.add=rn;W.addAll=on;W.cover=an;W.data=sn;W.extent=ln;W.find=cn;W.remove=fn;W.removeAll=un;W.root=hn;W.size=dn;W.visit=gn;W.visitAfter=pn;W.x=yn;W.y=wn;function B(t){return function(){return t}}function ot(t){return(t()-.5)*1e-6}function _n(t){return t.x+t.vx}function mn(t){return t.y+t.vy}function bn(t){var e,n,r,i=1,a=1;typeof t!="function"&&(t=B(t==null?1:+t));function c(){for(var l,p=e.length,b,x,u,_,f,s,h=0;h<a;++h)for(b=Qt(e,_n,mn).visitAfter(o),l=0;l<p;++l)x=e[l],f=n[x.index],s=f*f,u=x.x+x.vx,_=x.y+x.vy,b.visit(w);function w(M,y,T,A,R){var k=M.data,O=M.r,P=f+O;if(k){if(k.index>x.index){var Z=u-k.x-k.vx,q=_-k.y-k.vy,Q=Z*Z+q*q;Q<P*P&&(Z===0&&(Z=ot(r),Q+=Z*Z),q===0&&(q=ot(r),Q+=q*q),Q=(P-(Q=Math.sqrt(Q)))/Q*i,x.vx+=(Z*=Q)*(P=(O*=O)/(s+O)),x.vy+=(q*=Q)*P,k.vx-=Z*(P=1-P),k.vy-=q*P)}return}return y>u+P||A<u-P||T>_+P||R<_-P}}function o(l){if(l.data)return l.r=n[l.data.index];for(var p=l.r=0;p<4;++p)l[p]&&l[p].r>l.r&&(l.r=l[p].r)}function d(){if(e){var l,p=e.length,b;for(n=new Array(p),l=0;l<p;++l)b=e[l],n[b.index]=+t(b,l,e)}}return c.initialize=function(l,p){e=l,r=p,d()},c.iterations=function(l){return arguments.length?(a=+l,c):a},c.strength=function(l){return arguments.length?(i=+l,c):i},c.radius=function(l){return arguments.length?(t=typeof l=="function"?l:B(+l),d(),c):t},c}function In(t){return t.index}function ue(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Mn(t){var e=In,n=b,r,i=B(30),a,c,o,d,l,p=1;t==null&&(t=[]);function b(s){return 1/Math.min(o[s.source.index],o[s.target.index])}function x(s){for(var h=0,w=t.length;h<p;++h)for(var M=0,y,T,A,R,k,O,P;M<w;++M)y=t[M],T=y.source,A=y.target,R=A.x+A.vx-T.x-T.vx||ot(l),k=A.y+A.vy-T.y-T.vy||ot(l),O=Math.sqrt(R*R+k*k),O=(O-a[M])/O*s*r[M],R*=O,k*=O,A.vx-=R*(P=d[M]),A.vy-=k*P,T.vx+=R*(P=1-P),T.vy+=k*P}function u(){if(c){var s,h=c.length,w=t.length,M=new Map(c.map((T,A)=>[e(T,A,c),T])),y;for(s=0,o=new Array(h);s<w;++s)y=t[s],y.index=s,typeof y.source!="object"&&(y.source=ue(M,y.source)),typeof y.target!="object"&&(y.target=ue(M,y.target)),o[y.source.index]=(o[y.source.index]||0)+1,o[y.target.index]=(o[y.target.index]||0)+1;for(s=0,d=new Array(w);s<w;++s)y=t[s],d[s]=o[y.source.index]/(o[y.source.index]+o[y.target.index]);r=new Array(w),_(),a=new Array(w),f()}}function _(){if(c)for(var s=0,h=t.length;s<h;++s)r[s]=+n(t[s],s,t)}function f(){if(c)for(var s=0,h=t.length;s<h;++s)a[s]=+i(t[s],s,t)}return x.initialize=function(s,h){c=s,l=h,u()},x.links=function(s){return arguments.length?(t=s,u(),x):t},x.id=function(s){return arguments.length?(e=s,x):e},x.iterations=function(s){return arguments.length?(p=+s,x):p},x.strength=function(s){return arguments.length?(n=typeof s=="function"?s:B(+s),_(),x):n},x.distance=function(s){return arguments.length?(i=typeof s=="function"?s:B(+s),f(),x):i},x}var Nn={value:()=>{}};function we(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Pt(n)}function Pt(t){this._=t}function Cn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Pt.prototype=we.prototype={constructor:Pt,on:function(t,e){var n=this._,r=Cn(t+"",n),i,a=-1,c=r.length;if(arguments.length<2){for(;++a<c;)if((i=(t=r[a]).type)&&(i=An(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<c;)if(i=(t=r[a]).type)n[i]=he(n[i],t.name,e);else if(e==null)for(i in n)n[i]=he(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Pt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function An(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function he(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Nn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var pt=0,Nt=0,It=0,_e=1e3,Ft,Ct,Rt=0,ht=0,Ot=0,Tt=typeof performance=="object"&&performance.now?performance:Date,me=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function be(){return ht||(me(Tn),ht=Tt.now()+Ot)}function Tn(){ht=0}function Bt(){this._call=this._time=this._next=null}Bt.prototype=Ie.prototype={constructor:Bt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?be():+n)+(e==null?0:+e),!this._next&&Ct!==this&&(Ct?Ct._next=this:Ft=this,Ct=this),this._call=t,this._time=n,Wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wt())}};function Ie(t,e,n){var r=new Bt;return r.restart(t,e,n),r}function Sn(){be(),++pt;for(var t=Ft,e;t;)(e=ht-t._time)>=0&&t._call.call(void 0,e),t=t._next;--pt}function de(){ht=(Rt=Tt.now())+Ot,pt=Nt=0;try{Sn()}finally{pt=0,zn(),ht=0}}function Dn(){var t=Tt.now(),e=t-Rt;e>_e&&(Ot-=e,Rt=t)}function zn(){for(var t,e=Ft,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ft=n);Ct=t,Wt(r)}function Wt(t){if(!pt){Nt&&(Nt=clearTimeout(Nt));var e=t-ht;e>24?(t<1/0&&(Nt=setTimeout(de,t-Tt.now()-Ot)),It&&(It=clearInterval(It))):(It||(Rt=Tt.now(),It=setInterval(Dn,_e)),pt=1,me(de))}}const En=1664525,Pn=1013904223,ge=4294967296;function kn(){let t=1;return()=>(t=(En*t+Pn)%ge)/ge}function Fn(t){return t.x}function Rn(t){return t.y}var On=10,jn=Math.PI*(3-Math.sqrt(5));function Xn(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),a=0,c=.6,o=new Map,d=Ie(b),l=we("tick","end"),p=kn();t==null&&(t=[]);function b(){x(),l.call("tick",e),n<r&&(d.stop(),l.call("end",e))}function x(f){var s,h=t.length,w;f===void 0&&(f=1);for(var M=0;M<f;++M)for(n+=(a-n)*i,o.forEach(function(y){y(n)}),s=0;s<h;++s)w=t[s],w.fx==null?w.x+=w.vx*=c:(w.x=w.fx,w.vx=0),w.fy==null?w.y+=w.vy*=c:(w.y=w.fy,w.vy=0);return e}function u(){for(var f=0,s=t.length,h;f<s;++f){if(h=t[f],h.index=f,h.fx!=null&&(h.x=h.fx),h.fy!=null&&(h.y=h.fy),isNaN(h.x)||isNaN(h.y)){var w=On*Math.sqrt(.5+f),M=f*jn;h.x=w*Math.cos(M),h.y=w*Math.sin(M)}(isNaN(h.vx)||isNaN(h.vy))&&(h.vx=h.vy=0)}}function _(f){return f.initialize&&f.initialize(t,p),f}return u(),e={tick:x,restart:function(){return d.restart(b),e},stop:function(){return d.stop(),e},nodes:function(f){return arguments.length?(t=f,u(),o.forEach(_),e):t},alpha:function(f){return arguments.length?(n=+f,e):n},alphaMin:function(f){return arguments.length?(r=+f,e):r},alphaDecay:function(f){return arguments.length?(i=+f,e):+i},alphaTarget:function(f){return arguments.length?(a=+f,e):a},velocityDecay:function(f){return arguments.length?(c=1-f,e):1-c},randomSource:function(f){return arguments.length?(p=f,o.forEach(_),e):p},force:function(f,s){return arguments.length>1?(s==null?o.delete(f):o.set(f,_(s)),e):o.get(f)},find:function(f,s,h){var w=0,M=t.length,y,T,A,R,k;for(h==null?h=1/0:h*=h,w=0;w<M;++w)R=t[w],y=f-R.x,T=s-R.y,A=y*y+T*T,A<h&&(k=R,h=A);return k},on:function(f,s){return arguments.length>1?(l.on(f,s),e):l.on(f)}}}function Yn(){var t,e,n,r,i=B(-30),a,c=1,o=1/0,d=.81;function l(u){var _,f=t.length,s=Qt(t,Fn,Rn).visitAfter(b);for(r=u,_=0;_<f;++_)e=t[_],s.visit(x)}function p(){if(t){var u,_=t.length,f;for(a=new Array(_),u=0;u<_;++u)f=t[u],a[f.index]=+i(f,u,t)}}function b(u){var _=0,f,s,h=0,w,M,y;if(u.length){for(w=M=y=0;y<4;++y)(f=u[y])&&(s=Math.abs(f.value))&&(_+=f.value,h+=s,w+=s*f.x,M+=s*f.y);u.x=w/h,u.y=M/h}else{f=u,f.x=f.data.x,f.y=f.data.y;do _+=a[f.data.index];while(f=f.next)}u.value=_}function x(u,_,f,s){if(!u.value)return!0;var h=u.x-e.x,w=u.y-e.y,M=s-_,y=h*h+w*w;if(M*M/d<y)return y<o&&(h===0&&(h=ot(n),y+=h*h),w===0&&(w=ot(n),y+=w*w),y<c&&(y=Math.sqrt(c*y)),e.vx+=h*u.value*r/y,e.vy+=w*u.value*r/y),!0;if(u.length||y>=o)return;(u.data!==e||u.next)&&(h===0&&(h=ot(n),y+=h*h),w===0&&(w=ot(n),y+=w*w),y<c&&(y=Math.sqrt(c*y)));do u.data!==e&&(M=a[u.data.index]*r/y,e.vx+=h*M,e.vy+=w*M);while(u=u.next)}return l.initialize=function(u,_){t=u,n=_,p()},l.strength=function(u){return arguments.length?(i=typeof u=="function"?u:B(+u),p(),l):i},l.distanceMin=function(u){return arguments.length?(c=u*u,l):Math.sqrt(c)},l.distanceMax=function(u){return arguments.length?(o=u*u,l):Math.sqrt(o)},l.theta=function(u){return arguments.length?(d=u*u,l):Math.sqrt(d)},l}function Gn(t){var e=B(.1),n,r,i;typeof t!="function"&&(t=B(t==null?0:+t));function a(o){for(var d=0,l=n.length,p;d<l;++d)p=n[d],p.vx+=(i[d]-p.x)*r[d]*o}function c(){if(n){var o,d=n.length;for(r=new Array(d),i=new Array(d),o=0;o<d;++o)r[o]=isNaN(i[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:B(+o),c(),a):e},a.x=function(o){return arguments.length?(t=typeof o=="function"?o:B(+o),c(),a):t},a}function Ln(t){var e=B(.1),n,r,i;typeof t!="function"&&(t=B(t==null?0:+t));function a(o){for(var d=0,l=n.length,p;d<l;++d)p=n[d],p.vy+=(i[d]-p.y)*r[d]*o}function c(){if(n){var o,d=n.length;for(r=new Array(d),i=new Array(d),o=0;o<d;++o)r[o]=isNaN(i[o]=+t(n[o],o,n))?0:+e(n[o],o,n)}}return a.initialize=function(o){n=o,c()},a.strength=function(o){return arguments.length?(e=typeof o=="function"?o:B(+o),c(),a):e},a.y=function(o){return arguments.length?(t=typeof o=="function"?o:B(+o),c(),a):t},a}function Hn(t,e){const n=Ge(e,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["circle",{cx:"12",cy:"12",r:"6"}],["circle",{cx:"12",cy:"12",r:"2"}]];Ue(t,Le({name:"target"},()=>n,{get iconNode(){return r},children:(i,a)=>{var c=Re(),o=je(c);Be(o,e,"default",{}),kt(i,c)},$$slots:{default:!0}}))}var Vn=$t('<div><span class="legend-dot svelte-1i33fky"></span> <span class="legend-label svelte-1i33fky"> </span> <span class="legend-count svelte-1i33fky"> </span></div>'),Un=$t('<div class="graph-view svelte-1i33fky"><div class="canvas-wrap svelte-1i33fky"><button><!></button> <div class="legend-panel svelte-1i33fky"></div></div></div>');function Bn(t,e){pe(e,!0);let n=Et(e,"selectedEntityId",3,null),r=Et(e,"filteredIds",3,null),i=Et(e,"sidebarHoveredId",3,null),a=Et(e,"highlightedIds",3,null);function c(g){return e.nameMap?.get(g)??g.replace(/-/g," ").replace(/\b\w/g,m=>m.toUpperCase())}const o=typeof localStorage<"u"?localStorage.getItem("graphFocus"):null;let d=zt(o==="true");function l(){ut(d,!C(d)),localStorage.setItem("graphFocus",String(C(d))),ut(k,C(d)&&n()?n():null,!0),G()}const p=ve("theme"),b=Mt(()=>p.current==="light"?{default:14211288,dim:15263976,conn:12632256,labelText:1710623}:{default:2763306,dim:1315860,conn:4210752,labelText:15592943}),x=Mt(()=>p.current==="light"?16316666:592139),u=.75;mt(()=>{p.current,$&&($.style.fill=C(b).labelText);const g=C(Gt);for(const m of s)bt(m.type)===wt&&(m.color=g);G()}),mt(()=>{r(),G()}),mt(()=>{a(),G()}),mt(()=>{ut(k,C(d)&&n()?n():null,!0),G()}),mt(()=>{const g=i();if(g){const m=s.find(v=>v.id===g)??null;R=m,Xt(),st=m?1:0,m&&(tt=1)}else O||(R=null,Xt(),st=0);G()});let _,f=null,s=[],h=[],w=!1,M=0,y=0,T=0,A=1,R=null,k=zt(null),O=null,P=zt(!1),Z=0,q=0,Q=0,Jt=0,at=new Set,vt=zt(null),tt=0,st=0;const Zt=4;let Y=null,yt=null,xt=null,St=null,qt=new Map,K=null,$=null,J=null;function Me(g){return Math.max(2,Math.min(2*Math.sqrt(g+1),10))}function jt(g,m){const v=_.getBoundingClientRect();return{x:(g-v.left-y)/A,y:(m-v.top-T)/A}}function te(g,m){for(let v=s.length-1;v>=0;v--){const N=s[v],z=g-N.x,F=m-N.y,E=(N.r*1.5+4)/A;if(z*z+F*F<=E*E)return N}return null}function Xt(){const g=R??null;if(at.clear(),!!g){at.add(g.id);for(const m of h)m.source.id===g.id&&at.add(m.target.id),m.target.id===g.id&&at.add(m.source.id)}}function ee(){if(s.length===0||!_)return;let g=1/0,m=-1/0,v=1/0,N=-1/0,z=0;for(const I of s)I.x<g&&(g=I.x),I.x>m&&(m=I.x),I.y<v&&(v=I.y),I.y>N&&(N=I.y),I.r>z&&(z=I.r);const F=_.clientWidth,E=_.clientHeight,j=m-g,L=N-v;if(j===0||L===0)return;const H=(60+z)*2;A=Math.min((F-H)/j,(E-H)/L,3),y=F/2-(g+m)/2*A,T=E/2-(v+N)/2*A,G()}function G(){w=!0,M=0}function Yt(g){return parseInt(g.replace("#",""),16)}function lt(g,m,v){const N=(g>>16&255)+v*((m>>16&255)-(g>>16&255)),z=(g>>8&255)+v*((m>>8&255)-(g>>8&255)),F=(g&255)+v*((m&255)-(g&255));return Math.round(N)<<16|Math.round(z)<<8|Math.round(F)}function Ne(){if(!J||!yt||!xt)return;yt.clear(),xt.clear();const m=R!==null,v=tt,N=C(vt),z=a(),F=r(),E=C(b).default,j=C(b).dim,L=C(b).conn;for(let H=0;H<h.length;H++){const I=h[H],D=I.source.x*A+y,_t=I.source.y*A+T,dt=I.target.x*A+y,V=I.target.y*A+T,et=m&&v>.01&&at.has(I.source.id)&&at.has(I.target.id);let S=E;m&&v>.01?S=et?lt(E,L,v):lt(E,j,v):(N!==null||z!==null||F!==null)&&(S=j);const X=et?xt:yt;X.setStrokeStyle({width:1,color:S,alpha:1}),X.moveTo(D,_t),X.lineTo(dt,V),X.stroke()}}function Ce(){if(!J)return;const g=R,m=g!==null,v=tt,N=C(vt),z=a(),F=r(),E=C(k)?s.find(I=>I.id===C(k)):null,j=new Set;if(E){j.add(E.id);for(const I of h)I.source.id===E.id&&j.add(I.target.id),I.target.id===E.id&&j.add(I.source.id)}for(const I of s){const D=qt.get(I.id);if(!D)continue;const _t=I.x*A+y,dt=I.y*A+T;D.position.set(_t,dt),D.scale.set(I.r/50),D.alpha=1;const V=Yt(I.color);if(E&&!R){const et=j.has(I.id);D.tint=et?V:lt(V,C(x),u),D.zIndex=I===E?2:et?1:0}else{const et=I===g,S=m&&at.has(I.id),X=N!==null&&(N==="other"?bt(I.type)===wt:I.type===N);if(et&&v>.01)D.tint=V,D.scale.set(I.r*(1+v*.4)/50),D.zIndex=2;else if(S)D.tint=V,D.zIndex=1;else if(N!==null)D.tint=X?V:lt(V,C(x),u),D.zIndex=X?1:0;else if(z!==null){const rt=z.has(I.id),Vt=rt?v*u:u;D.tint=lt(V,C(x),Vt),D.zIndex=rt?1:0}else if(F!==null){const rt=F.has(I.id),Vt=rt?v*u:u;D.tint=lt(V,C(x),Vt),D.zIndex=rt?1:0}else D.tint=lt(V,C(x),v*u),D.zIndex=0}}const L=g??E;if(L&&(v>.01||E)&&K){K.visible=!0;const I=L.x*A+y,D=L.y*A+T;K.position.set(I,D),K.scale.set(L.r*5/64),K.alpha=g?v*.25:.25,K.tint=Yt(L.color)}else K&&(K.visible=!1);const H=g??E;if(H&&(v>.01||E)&&$){const I=H.x*A+y,D=H.y*A+T;$.text=c(H.id),$.style.fontSize=12,$.position.set(I,D+H.r+8),$.alpha=g?v:1,$.visible=!0}else $&&($.visible=!1)}let Dt=!1;function Ae(g){if(g.button!==0)return;Dt=!1;const m=jt(g.clientX,g.clientY),v=te(m.x,m.y);v?(O=v,v.fx=v.x,v.fy=v.y,f?.alphaTarget(.3).restart(),G()):(ut(P,!0),Z=g.clientX,q=g.clientY,Q=y,Jt=T),_.setPointerCapture(g.pointerId)}function Te(g){if(O){Dt=!0;const m=jt(g.clientX,g.clientY);O.fx=m.x,O.fy=m.y,G()}else if(C(P))Dt=!0,y=Q+(g.clientX-Z),T=Jt+(g.clientY-q),G();else{const m=jt(g.clientX,g.clientY),v=te(m.x,m.y),N=R;R=v,v!==N&&(v&&N&&(tt=.15),Xt(),_.style.cursor=v?"pointer":"grab",st=v?1:0,G())}}function Se(g){const m=Dt;if(O){const v=O;O.fx=null,O.fy=null,f?.alphaTarget(0),O=null,G(),m||tn(`/${v.repo}/${v.type}/${v.id}`)}else C(P)&&ut(P,!1);_.releasePointerCapture(g.pointerId)}const wt="#5c5c66",De="#b0b0b8",Gt=Mt(()=>p.current==="light"?De:wt),ze=Mt(()=>{const g=new Map;for(const N of e.graphData.nodes)g.set(N.type,(g.get(N.type)??0)+1);const m=[];let v=0;for(const[N,z]of g){const F=bt(N);F===wt?v+=z:m.push({name:N,color:F,count:z})}return m.sort((N,z)=>z.count-N.count),v>0&&m.push({name:"other",color:C(Gt),count:v}),m});Xe(async()=>{J=await qe(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url),Y=new J.Application,await Y.init({antialias:!0,resolution:window.devicePixelRatio||1,autoDensity:!0,backgroundAlpha:0,resizeTo:_}),_.insertBefore(Y.canvas,_.firstChild),Y.canvas.style.position="absolute",Y.canvas.style.inset="0",yt=new J.Graphics,Y.stage.addChild(yt),xt=new J.Graphics,Y.stage.addChild(xt),St=new J.Container,St.sortableChildren=!0,Y.stage.addChild(St);const g=document.createElement("canvas");g.width=128,g.height=128;const m=g.getContext("2d"),v=m.createRadialGradient(64,64,0,64,64,64);v.addColorStop(0,"rgba(255,255,255,0.5)"),v.addColorStop(1,"rgba(255,255,255,0)"),m.fillStyle=v,m.fillRect(0,0,128,128);const N=J.Texture.from(g);K=new J.Sprite(N),K.anchor.set(.5),K.visible=!1,Y.stage.addChild(K);const z=document.createElement("canvas");z.width=100,z.height=100;const F=z.getContext("2d");F.beginPath(),F.arc(50,50,48,0,Math.PI*2),F.fillStyle="#ffffff",F.fill();const E=J.Texture.from(z),j=new Map;for(const S of e.graphData.edges)j.set(S.source,(j.get(S.source)??0)+1),j.set(S.target,(j.get(S.target)??0)+1);const L=new Map,I=3600*e.graphData.nodes.length,D=Math.sqrt(I);s=e.graphData.nodes.map(S=>{const X=j.get(S.id)??0,rt={id:S.id,type:S.type,repo:S.repo,color:bt(S.type)===wt?C(Gt):bt(S.type),weight:X,x:(Math.random()-.5)*D,y:(Math.random()-.5)*D,vx:0,vy:0,r:Me(X)};return L.set(S.id,rt),rt});for(const S of s){const X=new J.Sprite(E);X.anchor.set(.5),X.tint=Yt(S.color),St.addChild(X),qt.set(S.id,X)}$=new J.Text({text:"",style:{fontFamily:"Inter, system-ui, sans-serif",fontWeight:"500",fontSize:12,fill:C(b).labelText,align:"center"}}),$.anchor.set(.5,0),$.visible=!1,Y.stage.addChild($);const _t=e.graphData.edges.map(S=>({source:S.source,target:S.target})),dt=Mn(_t).id(S=>S.id).distance(250);f=Xn(s).force("link",dt).force("charge",Yn().strength(-1e3).distanceMin(30)).force("x",Gn(0).strength(.1)).force("y",Ln(0).strength(.1)).force("collide",bn().radius(60).strength(.5)).velocityDecay(.4).alpha(1).on("tick",()=>{ee(),G()}),h=dt.links();let V=0;Y.ticker.add(()=>{const S=performance.now(),X=V?Math.min((S-V)/1e3,.05):.016;V=S,tt<st?(tt=Math.min(st,tt+Zt*X),w=!0):tt>st&&(tt=Math.max(st,tt-Zt*X),w=!0),(w||M<120)&&(Ne(),Ce(),w=!1,M++)});const et=new ResizeObserver(()=>{Y.renderer.resize(_.clientWidth,_.clientHeight),ee()});return et.observe(_),()=>{et.disconnect()}}),Ye(()=>{f?.stop(),Y&&(Y.destroy(!0,{children:!0}),Y=null)});var Ee={toggleFocus:l},Lt=Un(),ct=it(Lt);let ne;var ft=it(ct);let re;var Pe=it(ft);Hn(Pe,{size:16}),nt(ft);var Ht=At(ft,2);return We(Ht,21,()=>C(ze),$e,(g,m)=>{var v=Vn();let N;var z=it(v);let F;var E=At(z,2),j=it(E,!0);nt(E);var L=At(E,2),H=it(L,!0);nt(L),nt(v),le(()=>{N=ie(v,1,"legend-item svelte-1i33fky",null,N,{"legend-item-active":C(vt)===C(m).name}),F=oe(z,"",F,{background:C(m).color}),ce(j,C(m).name),ce(H,C(m).count)}),se("mouseenter",v,()=>{ut(vt,C(m).name,!0),G()}),se("mouseleave",v,()=>{ut(vt,null),G()}),kt(g,v)}),nt(Ht),nt(ct),He(ct,g=>_=g,()=>_),nt(Lt),le(()=>{ne=oe(ct,"",ne,{cursor:C(P)?"grabbing":"grab"}),re=ie(ft,1,"focus-btn svelte-1i33fky",null,re,{active:C(d)}),Fe(ft,"title",C(d)?"Show full graph":"Focus on selected")}),gt("pointerdown",ct,Ae),gt("pointermove",ct,Te),gt("pointerup",ct,Se),gt("pointerdown",ft,g=>g.stopPropagation()),gt("click",ft,()=>{l()}),gt("pointerdown",Ht,g=>g.stopPropagation()),kt(t,Lt),ye(Ee)}Oe(["pointerdown","pointermove","pointerup","click"]);var Wn=$t('<div class="content-row svelte-315y67"><div class="graph-area svelte-315y67"><!> <!></div> <!></div>');function ir(t,e){pe(e,!0);const n=ve("chat");Ut.showGraph();const r=Mt(()=>{const i=new Map;for(const a of ae.repos)for(const c of a.entities)i.set(c.id,c.title);return i});Qe(t,{children:(i,a)=>{var c=Wn(),o=it(c),d=it(o);Ke(d,{activeView:"graph"});var l=At(d,2);Bn(l,{get graphData(){return e.data.graphData},get selectedEntityId(){return Ut.selectedId},get nameMap(){return C(r)},get filteredIds(){return ae.filteredIds},get sidebarHoveredId(){return Ut.hoveredEntityId},get highlightedIds(){return Je.highlightedIds}}),nt(o);var p=At(o,2);{var b=x=>{Ze(x,{})};Ve(p,x=>{n.open&&x(b)})}nt(c),kt(i,c)},$$slots:{default:!0}}),ye()}export{ir as component,rr as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"1772564927511"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
7
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
8
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
9
|
+
<link href="/_app/immutable/entry/start.CDuNCEco.js" rel="modulepreload">
|
|
10
|
+
<link href="/_app/immutable/chunks/B4G4uWkV.js" rel="modulepreload">
|
|
11
|
+
<link href="/_app/immutable/chunks/D2K5GzLj.js" rel="modulepreload">
|
|
12
|
+
<link href="/_app/immutable/entry/app.B9pwpU_x.js" rel="modulepreload">
|
|
13
|
+
<link href="/_app/immutable/chunks/PPVm8Dsz.js" rel="modulepreload">
|
|
14
|
+
<link href="/_app/immutable/chunks/DEkoussQ.js" rel="modulepreload">
|
|
15
|
+
<link href="/_app/immutable/chunks/SBEriEQR.js" rel="modulepreload">
|
|
16
|
+
<link href="/_app/immutable/chunks/DW-KmHRi.js" rel="modulepreload">
|
|
17
|
+
<link href="/_app/immutable/chunks/m_R7HatS.js" rel="modulepreload">
|
|
18
|
+
<link href="/_app/immutable/chunks/DcCr4z9k.js" rel="modulepreload">
|
|
19
|
+
|
|
20
|
+
</head>
|
|
21
|
+
<body data-sveltekit-preload-data="hover">
|
|
22
|
+
<div style="display: contents">
|
|
23
|
+
<script>
|
|
24
|
+
{
|
|
25
|
+
__sveltekit_1ydufa0 = {
|
|
26
|
+
base: ""
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const element = document.currentScript.parentElement;
|
|
30
|
+
|
|
31
|
+
Promise.all([
|
|
32
|
+
import("/_app/immutable/entry/start.CDuNCEco.js"),
|
|
33
|
+
import("/_app/immutable/entry/app.B9pwpU_x.js")
|
|
34
|
+
]).then(([kit, app]) => {
|
|
35
|
+
kit.start(app, element);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
</div>
|
|
40
|
+
</body>
|
|
41
|
+
</html>
|