kortext 2.2.3 → 3.1.0
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/LICENSE +21 -0
- package/README.md +175 -65
- package/agents/architect.md +85 -0
- package/agents/compliance-expert.md +36 -75
- package/agents/copywriter.md +36 -92
- package/agents/db-admin.md +43 -91
- package/agents/designer.md +40 -77
- package/agents/devops-engineer.md +37 -113
- package/agents/growth-expert.md +45 -88
- package/agents/product-manager.md +38 -83
- package/agents/qa-engineer.md +51 -99
- package/agents/security-engineer.md +47 -92
- package/bin/kortext.js +2 -0
- package/dist/app.js +829 -0
- package/dist/cli-spawn.js +137 -0
- package/dist/daemon.js +40 -0
- package/dist/db.js +78 -0
- package/dist/design-preview.js +533 -0
- package/dist/docs.js +701 -0
- package/dist/engines.js +225 -0
- package/dist/index.js +109 -0
- package/dist/pick-directory.js +38 -0
- package/dist/projects.js +189 -0
- package/dist/readiness.js +288 -0
- package/dist/runner.js +771 -0
- package/dist/update.js +55 -0
- package/docs/CHANGELOG.md +11 -0
- package/package.json +53 -13
- package/templates/AGENTS.md +62 -0
- package/templates/docs/API.md +67 -0
- package/templates/docs/ARCHITECTURE.md +31 -0
- package/templates/docs/BRIEF.md +27 -0
- package/templates/docs/CONTENT.md +66 -0
- package/templates/docs/DATABASE.md +63 -0
- package/templates/docs/DESIGN.md +124 -0
- package/templates/docs/ENGINEERING.md +66 -0
- package/templates/docs/ENVIRONMENT.md +102 -0
- package/templates/docs/GROWTH.md +44 -0
- package/templates/docs/LEGAL.md +48 -0
- package/templates/docs/PRODUCT.md +43 -0
- package/templates/docs/SECURITY.md +65 -0
- package/templates/docs/STACK.md +57 -0
- package/templates/docs/STRUCTURE.md +73 -0
- package/templates/docs/TEST.md +62 -0
- package/ui/dist/assets/abnfDiagram-VCTEODGH-Bm7Q2BML.js +1 -0
- package/ui/dist/assets/arc-BV9hs0Hu.js +1 -0
- package/ui/dist/assets/architecture-7GRP2DOG-RckR3gBI.js +1 -0
- package/ui/dist/assets/architectureDiagram-5GKGNRK7-CHiJ6JFT.js +36 -0
- package/ui/dist/assets/array-BifhSqXX.js +1 -0
- package/ui/dist/assets/blockDiagram-I7D4REHJ-qCbaKVhd.js +129 -0
- package/ui/dist/assets/c4Diagram-7LVT6UL2-DidCDJrv.js +38 -0
- package/ui/dist/assets/channel-CNUQ11ne.js +1 -0
- package/ui/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
- package/ui/dist/assets/chunk-4HAMMTFA-CDGFjfVp.js +62 -0
- package/ui/dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +15 -0
- package/ui/dist/assets/chunk-75Z2AOVW-CbNT4sDh.js +2 -0
- package/ui/dist/assets/chunk-DU6HZSFF-Cq2BVv26.js +127 -0
- package/ui/dist/assets/chunk-F27PBJKO-CE365m0v.js +1 -0
- package/ui/dist/assets/chunk-FOHPRMQF-DHwB1DNv.js +161 -0
- package/ui/dist/assets/chunk-GMAD6QVW-DxWL1VC-.js +72 -0
- package/ui/dist/assets/chunk-GVQU2GXP-aARV8YbK.js +1 -0
- package/ui/dist/assets/chunk-IMKFNOWR-CC790Kt2.js +231 -0
- package/ui/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
- package/ui/dist/assets/chunk-L3NEJ4N5-BfE4VE8J.js +1 -0
- package/ui/dist/assets/chunk-OSK3NFVY-BImQbSWH.js +10 -0
- package/ui/dist/assets/chunk-P2QGCYS3-CN3XD313.js +1 -0
- package/ui/dist/assets/chunk-POPQ4Y6H-Dqb6jOrX.js +1 -0
- package/ui/dist/assets/chunk-PWAF6VOD-DfXX6rBk.js +1 -0
- package/ui/dist/assets/chunk-SHT3W25Y-DATyyqPK.js +168 -0
- package/ui/dist/assets/chunk-SVP7TREG-r1chwRmg.js +88 -0
- package/ui/dist/assets/chunk-TICWLB2K-DL4atHUC.js +206 -0
- package/ui/dist/assets/chunk-XXDRQBXY-DXrM6jh7.js +1 -0
- package/ui/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
- package/ui/dist/assets/classDiagram-ZZMXUADV-BpQxfIQ7.js +1 -0
- package/ui/dist/assets/classDiagram-v2-VYDZK3BY-BpQxfIQ7.js +1 -0
- package/ui/dist/assets/cose-bilkent-JH36ORCC-Bhe-ZBlS.js +1 -0
- package/ui/dist/assets/cynefin-OW5HDTMX-D1koLd-G.js +1 -0
- package/ui/dist/assets/cynefinDiagram-5FMLGOSQ-BMcw40hV.js +62 -0
- package/ui/dist/assets/cytoscape.esm-CGd-uY3x.js +321 -0
- package/ui/dist/assets/dagre-GXQ25YYZ-DBun-Rs2.js +4 -0
- package/ui/dist/assets/dagre-PrKaheQc.js +1 -0
- package/ui/dist/assets/defaultLocale-BFoDCU3G.js +1 -0
- package/ui/dist/assets/diagram-S7CK7UJ4-C1fUIGvo.js +30 -0
- package/ui/dist/assets/diagram-UQ7AKVKN-B5FDfkvB.js +41 -0
- package/ui/dist/assets/diagram-VSXAHHWV-CCIpOCNC.js +3 -0
- package/ui/dist/assets/diagram-VX7I27RA-DV0q2xo_.js +24 -0
- package/ui/dist/assets/diagram-Z3DM3KII-B3LCdNgI.js +24 -0
- package/ui/dist/assets/dist-EcW76Zvr.js +1 -0
- package/ui/dist/assets/ebnfDiagram-PWID7BFC-De_oRbYe.js +1 -0
- package/ui/dist/assets/erDiagram-RLTQ6QDP-B9NikMr1.js +99 -0
- package/ui/dist/assets/eventmodeling-NTZA5JFV-DZ4t581k.js +1 -0
- package/ui/dist/assets/flowDiagram-HODETNUW-DuTOJp1C.js +1 -0
- package/ui/dist/assets/ganttDiagram-EL5Y4UJY-BVTqqlPw.js +292 -0
- package/ui/dist/assets/gitGraph-4MIJSDKK-xRFaEJdZ.js +1 -0
- package/ui/dist/assets/gitGraphDiagram-WWUBYQGX-CK5_GCmX.js +106 -0
- package/ui/dist/assets/graphlib-DS17s2tU.js +1 -0
- package/ui/dist/assets/index-CjkpNftW.js +46 -0
- package/ui/dist/assets/index-DVIDTWin.css +1 -0
- package/ui/dist/assets/info-A6RAGUB7-Dg7z-CTI.js +1 -0
- package/ui/dist/assets/infoDiagram-27XIBGKW-YaqsOXh0.js +2 -0
- package/ui/dist/assets/init-C-OQMol4.js +1 -0
- package/ui/dist/assets/ishikawaDiagram-5VMMS53U-C-wtxZPa.js +70 -0
- package/ui/dist/assets/journeyDiagram-3NMN7TZE-DsXSXf16.js +139 -0
- package/ui/dist/assets/kanban-definition-UXKFOSKX-Ct59fuWk.js +89 -0
- package/ui/dist/assets/katex-CXMH3UgJ.js +257 -0
- package/ui/dist/assets/line-BUVw9Mhs.js +1 -0
- package/ui/dist/assets/linear-D8ncLO0X.js +1 -0
- package/ui/dist/assets/mermaid-parser.core-BDC4bG-O.js +7 -0
- package/ui/dist/assets/mermaid.core-DZY3WwzX.js +44 -0
- package/ui/dist/assets/mindmap-definition-YA3MSWOX-DtiuF6Ce.js +96 -0
- package/ui/dist/assets/ordinal-BDEzSJ7C.js +1 -0
- package/ui/dist/assets/packet-AYTQ26CC-BX2-w9rD.js +1 -0
- package/ui/dist/assets/path-fybaL0A-.js +1 -0
- package/ui/dist/assets/pegDiagram-XKGWAZYB-CotwuIHB.js +1 -0
- package/ui/dist/assets/pie-WAS4IAKB-Hth8ZVpm.js +1 -0
- package/ui/dist/assets/pieDiagram-E7YTZNPT-D9-INs8B.js +39 -0
- package/ui/dist/assets/quadrantDiagram-AXDQQJYC-CMtBXZGV.js +7 -0
- package/ui/dist/assets/radar-RG4KPBEZ-6UuwQPsw.js +1 -0
- package/ui/dist/assets/railroad-74A4TZTK-BF5TZgj0.js +1 -0
- package/ui/dist/assets/railroad-abnf-HS5TGJTU-3KYovtYT.js +1 -0
- package/ui/dist/assets/railroad-ebnf-LZEXJU2U-DeP4WedE.js +1 -0
- package/ui/dist/assets/railroad-peg-WCYAUIDC-i42N1-yk.js +1 -0
- package/ui/dist/assets/railroadDiagram-O6MQD6OU-BS6zkU3Z.js +1 -0
- package/ui/dist/assets/requirementDiagram-BXWQKSXE-J4IOB-kP.js +84 -0
- package/ui/dist/assets/rough.esm-Dy-Kn_BL.js +1 -0
- package/ui/dist/assets/sankeyDiagram-P5KCCOFB-jYTCuYzQ.js +40 -0
- package/ui/dist/assets/sequenceDiagram-WJ2MYXX4-Cd2r6PW-.js +162 -0
- package/ui/dist/assets/sizeCapture-INFHLROL-B0uUizjq.js +1 -0
- package/ui/dist/assets/src-7TsfZXRO.js +1 -0
- package/ui/dist/assets/stateDiagram-D77RDMKH-DXOdtOKe.js +1 -0
- package/ui/dist/assets/stateDiagram-v2-MP3YSRHH-9h7sIf3R.js +1 -0
- package/ui/dist/assets/swimlanes-42K2YHIH-BvJGmGs1.js +1 -0
- package/ui/dist/assets/swimlanesDiagram-VR7AAH4N-QA4gPi6a.js +8 -0
- package/ui/dist/assets/timeline-definition-24CTP7MA-CAaD6-yd.js +120 -0
- package/ui/dist/assets/treeView-Q6P3EWNA-4gDEXIyJ.js +1 -0
- package/ui/dist/assets/treemap-WGGIJYW6-CGel5TwW.js +1 -0
- package/ui/dist/assets/vennDiagram-4TSXK5OY-DpxsKboL.js +34 -0
- package/ui/dist/assets/wardley-WFR3VGLG-Ck38v5ns.js +1 -0
- package/ui/dist/assets/wardleyDiagram-VM6X3IG4-Ba0grrqs.js +78 -0
- package/ui/dist/assets/xychartDiagram-S5SC5T6Z-DH_gC96K.js +7 -0
- package/ui/dist/index.html +13 -0
- package/ui/dist/kortext-logo-dark.svg +41 -0
- package/ui/dist/kortext-logo.svg +41 -0
- package/workflows/existing-project-analysis.md +87 -0
- package/workflows/new-project-analysis.md +98 -0
- package/workflows/planning-pipeline.md +61 -0
- package/AGENTS.md +0 -28
- package/agents/backend-developer.md +0 -132
- package/agents/delivery-manager.md +0 -121
- package/agents/engineering-manager.md +0 -208
- package/agents/frontend-developer.md +0 -174
- package/agents/operation-manager.md +0 -122
- package/hooks/audit-logger.sh +0 -25
- package/hooks/auto-locker.sh +0 -74
- package/hooks/auto-unlocker.sh +0 -17
- package/hooks/backlog-sync-guard.sh +0 -12
- package/hooks/branch-guard.sh +0 -32
- package/hooks/commit-msg-guard.sh +0 -43
- package/hooks/git-pre-commit.sh +0 -76
- package/hooks/git-pre-push.sh +0 -17
- package/hooks/handover-guard.sh +0 -33
- package/hooks/kortext-init.sh +0 -194
- package/hooks/kortext-lib.sh +0 -151
- package/hooks/lint-guard.sh +0 -50
- package/hooks/secret-scanner.sh +0 -89
- package/hooks/size-guard.sh +0 -48
- package/hooks/snapshot-guard.sh +0 -39
- package/hooks/write-guard.sh +0 -77
- package/rules/behavior.md +0 -252
- package/rules/branching.md +0 -82
- package/rules/commands.md +0 -112
- package/rules/emergency.md +0 -160
- package/rules/mcp.md +0 -47
- package/rules/models.md +0 -93
- package/scripts/kortext-backlog-add.py +0 -123
- package/scripts/kortext-backlog-health.py +0 -112
- package/scripts/kortext-backlog-sync.py +0 -117
- package/scripts/kortext-bulk-plan.py +0 -63
- package/scripts/kortext-cli.py +0 -376
- package/scripts/kortext-consistency-check.py +0 -74
- package/scripts/kortext-context-check.py +0 -146
- package/scripts/kortext-handover.py +0 -107
- package/scripts/kortext-item-check.py +0 -61
- package/scripts/kortext-item-start.py +0 -70
- package/scripts/kortext-item-transition.py +0 -78
- package/scripts/kortext-lock.py +0 -174
- package/scripts/kortext-session-start.py +0 -127
- package/scripts/lock_kortext.sh +0 -34
- package/settings/.claude-settings.template.json +0 -48
- package/settings/CHANGELOG.md +0 -176
- package/settings/INTEGRATION-MAP.md +0 -276
- package/settings/README.md +0 -255
- package/settings/USER-GUIDE.md +0 -502
- package/settings/VERSION +0 -1
- package/settings/config.md +0 -8
- package/settings/runtime-adapters.md +0 -104
- package/skills/backend-developer/.gitkeep +0 -0
- package/skills/compliance-expert/.gitkeep +0 -0
- package/skills/copywriter/.gitkeep +0 -0
- package/skills/db-admin/.gitkeep +0 -0
- package/skills/delivery-manager/.gitkeep +0 -0
- package/skills/designer/.gitkeep +0 -0
- package/skills/devops-engineer/.gitkeep +0 -0
- package/skills/engineering-manager/.gitkeep +0 -0
- package/skills/frontend-developer/.gitkeep +0 -0
- package/skills/growth-expert/.gitkeep +0 -0
- package/skills/operation-manager/.gitkeep +0 -0
- package/skills/product-manager/.gitkeep +0 -0
- package/skills/qa-engineer/.gitkeep +0 -0
- package/skills/security-engineer/.gitkeep +0 -0
- package/workflows/00-kortext-setup.md +0 -53
- package/workflows/01a-analysis-pipeline.md +0 -117
- package/workflows/01b-onboarding-pipeline.md +0 -110
- package/workflows/02-planning-pipeline.md +0 -146
- package/workflows/02b-spike-workflow.md +0 -120
- package/workflows/03-environment-setup.md +0 -99
- package/workflows/04-development-cycle.md +0 -203
- package/workflows/05-test-cycle.md +0 -123
- package/workflows/06-deployment-cycle.md +0 -224
- package/workflows/07-rollback-pipeline.md +0 -203
- package/workflows/08-hotfix-pipeline.md +0 -196
- package/workflows/09-maintenance-cycle.md +0 -133
- package/workspace/archive/.gitkeep +0 -0
- package/workspace/backups/.gitkeep +0 -0
- package/workspace/memory/backlog/.gitkeep +0 -0
- package/workspace/memory/backlog/BXX-[bug-name].md +0 -2
- package/workspace/memory/backlog/DXX-[debt-name].md +0 -2
- package/workspace/memory/backlog/README.md +0 -31
- package/workspace/memory/backlog/TXX-[task-name].md +0 -2
- package/workspace/memory/backlog/debt-dashboard.md +0 -3
- package/workspace/memory/backlog/epic-dashboard.md +0 -10
- package/workspace/memory/backlog/version-dashboard.md +0 -7
- package/workspace/memory/context/.gitkeep +0 -0
- package/workspace/memory/context/README.md +0 -35
- package/workspace/memory/context/[agent-name]-active.md +0 -2
- package/workspace/memory/decisions.md +0 -17
- package/workspace/memory/handover.md +0 -40
- package/workspace/memory/learned.md +0 -21
- package/workspace/references/access.md +0 -47
- package/workspace/references/api-reference.md +0 -59
- package/workspace/references/blueprint.md +0 -29
- package/workspace/references/content-strategy.md +0 -39
- package/workspace/references/db-schema.md +0 -51
- package/workspace/references/design-system.md +0 -107
- package/workspace/references/dictionary.md +0 -42
- package/workspace/references/file-system.md +0 -42
- package/workspace/references/growth-strategy.md +0 -46
- package/workspace/references/legal-strategy.md +0 -35
- package/workspace/references/required-skills.md +0 -11
- package/workspace/references/security-rules.md +0 -34
- package/workspace/references/tech-stack.md +0 -49
- package/workspace/references/test-strategy.md +0 -48
- package/workspace/reports/analysis-reports.md +0 -40
- package/workspace/reports/content-reports.md +0 -29
- package/workspace/reports/delivery-reports.md +0 -26
- package/workspace/reports/growth-reports.md +0 -9
- package/workspace/reports/legal-reports.md +0 -29
- package/workspace/reports/product-requirements.md +0 -28
- package/workspace/reports/release-notes.md +0 -20
- package/workspace/reports/security-reports.md +0 -27
- package/workspace/reports/status-reports.md +0 -48
- package/workspace/reports/tech-requirements.md +0 -30
- package/workspace/reports/test-reports.md +0 -61
- package/workspace/templates/BXX-[bug-name].md +0 -34
- package/workspace/templates/DXX-[debt-name].md +0 -35
- package/workspace/templates/EXX-[epic-name].md +0 -48
- package/workspace/templates/HXX-[hotfix-name].md +0 -73
- package/workspace/templates/SXX-[spike-name].md +0 -51
- package/workspace/templates/TXX-[task-name].md +0 -34
- package/workspace/templates/[agent-name]-active.md +0 -4
- package/workspace/templates/[original-name]_[YYYY-MM-DD_HHMMSS].md +0 -5
- package/workspace/templates/adr-XXX.md +0 -66
- package/workspace/templates/debt-dashboard.md +0 -10
- package/workspace/templates/epic-dashboard.md +0 -10
- package/workspace/templates/version-dashboard.md +0 -10
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import{n as e}from"./mermaid-parser.core-BDC4bG-O.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-7TsfZXRO.js";import{D as r,H as i,K as a,U as o,a as s,b as c,c as l,v as u,w as d,x as f,y as p}from"./chunk-DU6HZSFF-Cq2BVv26.js";import{i as m}from"./chunk-75Z2AOVW-CbNT4sDh.js";import{t as h}from"./chunk-JWPE2WC7-DVXcaiue.js";import{f as g}from"./mermaid.core-DZY3WwzX.js";var _=t((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=t((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=t(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=t(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=t((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:t(async t=>{let r=await e(`wardley`,t);n.debug(r);let i=S.parser?.yy;if(!i||typeof i.addNode!=`function`)throw Error(`parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);x(r,i)},`parse`)},C=new class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{t(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}};function w(){return f()[`wardley-beta`]}t(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}t(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}t(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}t(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}t(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}t(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}t(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}t(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}t(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}t(N,`setSize`);function P(e){C.startPipeline(e)}t(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}t(F,`addPipelineComponent`);function I(e){C.setAxes(e)}t(I,`updateAxes`);function L(e){return C.getNode(e)}t(L,`getNode`);function R(e){return C.resolveNodeId(e)}t(R,`resolveNodeId`);function z(){return C.build()}t(z,`getWardleyData`);function B(){C.clear(),s()}t(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:o,getAccTitle:p,setDiagramTitle:a,getDiagramTitle:d,getAccDescription:u,setAccDescription:i},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=t(()=>{let{themeVariables:e}=f();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=t(()=>{let e=f()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:t((e,r,i,a)=>{n.debug(`Rendering Wardley map
|
|
2
|
+
`+e);let o=W(),s=U(),c=o.nodeRadius*1.6,u=a.db,d=u.getWardleyData(),f=u.getDiagramTitle(),p=d.size?.width??o.width,m=d.size?.height??o.height,h=g(r);h.selectAll(`*`).remove(),l(h,m,p,o.useMaxWidth),h.attr(`viewBox`,`0 0 ${p} ${m}`);let _=h.append(`g`).attr(`class`,`wardley-map`),v=h.append(`defs`);v.append(`marker`).attr(`id`,`arrow-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.evolutionStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-end-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,9).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),v.append(`marker`).attr(`id`,`link-arrow-start-${r}`).attr(`viewBox`,`0 0 10 10`).attr(`refX`,1).attr(`refY`,5).attr(`markerWidth`,5).attr(`markerHeight`,5).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 10 0 L 0 5 L 10 10 z`).attr(`fill`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,p).attr(`height`,m).attr(`fill`,s.backgroundColor);let y=p-o.padding*2,b=m-o.padding*2;f&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,p/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let x=t(e=>o.padding+e/100*y,`projectX`),S=t(e=>m-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,m-o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,m-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:H;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,m-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,m-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,m-o.padding-b*n).attr(`y2`,m-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,l=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),l=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=l-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-c/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?c/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-c/2).attr(`y`,e=>D.get(e.id).y-c/2).attr(`width`,c).attr(`height`,c).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?c:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=p-o.padding-l,h=o.padding,g=m-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(h,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
|
|
3
|
+
M ${n} ${r-15}
|
|
4
|
+
L ${n+60-20} ${r-15}
|
|
5
|
+
L ${n+60-20} ${r-15-8}
|
|
6
|
+
L ${n+60} ${r}
|
|
7
|
+
L ${n+60-20} ${r+15+8}
|
|
8
|
+
L ${n+60-20} ${r+15}
|
|
9
|
+
L ${n} ${r+15}
|
|
10
|
+
Z
|
|
11
|
+
`;e.append(`path`).attr(`d`,i).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),e.append(`text`).attr(`x`,n+30).attr(`y`,r+15+15).attr(`text-anchor`,`middle`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.name)})}if(d.deaccelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-deaccelerators`);d.deaccelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
|
|
12
|
+
M ${n+60} ${r-15}
|
|
13
|
+
L ${n+20} ${r-15}
|
|
14
|
+
L ${n+20} ${r-15-8}
|
|
15
|
+
L ${n} ${r}
|
|
16
|
+
L ${n+20} ${r+15+8}
|
|
17
|
+
L ${n+20} ${r+15}
|
|
18
|
+
L ${n+60} ${r+15}
|
|
19
|
+
Z
|
|
20
|
+
`;e.append(`path`).attr(`d`,i).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),e.append(`text`).attr(`x`,n+30).attr(`y`,r+15+15).attr(`text-anchor`,`middle`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.name)})}},`draw`)},styles:t(({wardley:e}={})=>{let t=r(),n=c(),i=m(t,n.themeVariables),a=m(i.wardley,e);return`
|
|
21
|
+
.wardley-background {
|
|
22
|
+
fill: ${a.backgroundColor};
|
|
23
|
+
}
|
|
24
|
+
.wardley-axes line, .wardley-axes path {
|
|
25
|
+
stroke: ${a.axisColor};
|
|
26
|
+
}
|
|
27
|
+
.wardley-axis-label {
|
|
28
|
+
fill: ${a.axisTextColor};
|
|
29
|
+
}
|
|
30
|
+
.wardley-stage-label {
|
|
31
|
+
fill: ${a.axisTextColor};
|
|
32
|
+
}
|
|
33
|
+
.wardley-grid line {
|
|
34
|
+
stroke: ${a.gridColor};
|
|
35
|
+
}
|
|
36
|
+
.wardley-node circle {
|
|
37
|
+
fill: ${a.componentFill};
|
|
38
|
+
stroke: ${a.componentStroke};
|
|
39
|
+
}
|
|
40
|
+
.wardley-node-label {
|
|
41
|
+
fill: ${a.componentLabelColor};
|
|
42
|
+
}
|
|
43
|
+
.wardley-link {
|
|
44
|
+
stroke: ${a.linkStroke};
|
|
45
|
+
}
|
|
46
|
+
.wardley-link--dashed {
|
|
47
|
+
stroke-dasharray: 4 4;
|
|
48
|
+
}
|
|
49
|
+
.wardley-link-label {
|
|
50
|
+
fill: ${a.axisTextColor};
|
|
51
|
+
}
|
|
52
|
+
.wardley-trend line {
|
|
53
|
+
stroke: ${a.evolutionStroke};
|
|
54
|
+
}
|
|
55
|
+
.wardley-annotation-line {
|
|
56
|
+
stroke: ${a.annotationStroke};
|
|
57
|
+
}
|
|
58
|
+
.wardley-annotation circle {
|
|
59
|
+
fill: ${a.annotationFill};
|
|
60
|
+
stroke: ${a.annotationStroke};
|
|
61
|
+
}
|
|
62
|
+
.wardley-annotation text {
|
|
63
|
+
fill: ${a.annotationTextColor};
|
|
64
|
+
}
|
|
65
|
+
.wardley-annotations-box rect {
|
|
66
|
+
fill: ${a.annotationFill};
|
|
67
|
+
stroke: ${a.annotationStroke};
|
|
68
|
+
}
|
|
69
|
+
.wardley-annotations-box text {
|
|
70
|
+
fill: ${a.annotationTextColor};
|
|
71
|
+
}
|
|
72
|
+
.wardley-pipeline-box {
|
|
73
|
+
stroke: ${a.componentStroke};
|
|
74
|
+
}
|
|
75
|
+
.wardley-notes text {
|
|
76
|
+
fill: ${a.axisTextColor};
|
|
77
|
+
}
|
|
78
|
+
`},`styles`)};export{G as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t}from"./src-7TsfZXRO.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-DU6HZSFF-Cq2BVv26.js";import{t as m}from"./linear-D8ncLO0X.js";import{t as h}from"./ordinal-BDEzSJ7C.js";import{t as g}from"./init-C-OQMol4.js";import{i as _}from"./chunk-75Z2AOVW-CbNT4sDh.js";import{t as v}from"./line-BUVw9Mhs.js";import"./chunk-PWAF6VOD-DfXX6rBk.js";import{t as y}from"./chunk-GMAD6QVW-DxWL1VC-.js";import{f as b}from"./mermaid.core-DZY3WwzX.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s]}},`anonymous`),table:[t(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},t(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),t(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),{1:[2,1]},t(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},t(c,[2,5]),t(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),t(E,[2,40]),t(E,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:x,29:S}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,11]),t(T,[2,32],{35:60,29:C}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},t(T,[2,14]),{17:66,24:w},t(T,[2,16]),t(T,[2,17]),t(D,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(k,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:O},t(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
|
+
`+h.showPosition()+`
|
|
3
|
+
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
5
|
+
`+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 33;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 44;case 33:return`COLON`;case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function j(){this.yy={}}return e(j,`Parser`),j.prototype=A,A.Parser=j,new j})();C.parser=C;var w=C;function T(e){return e.type===`bar`}e(T,`isBarPlot`);function E(e){return e.type===`band`}e(E,`isBandAxisData`);function D(e){return e.type===`linear`}e(D,`isLinearAxisData`);var O=class{constructor(e){this.parentGroup=e}static{e(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=y(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},k=.7,A=.2,j=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{e(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){k*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(k*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;this.axisPosition===`bottom`&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=A*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation(`height`),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation(`width`)),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},M=class extends j{static{e(this,`BandAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.categories=n,this.scale=S().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=S().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),t.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ee=class extends j{static{e(this,`LinearAxis`)}constructor(e,t,n,r,i){super(e,r,i,t),this.domain=n,this.scale=m().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=m().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function N(e,t,n,r){let i=new O(r);return E(e)?new M(t,n,e.categories,e.title,i):new ee(t,n,[e.min,e.max],e.title,i)}e(N,`getAxis`);var te=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{e(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function P(e,t,n,r){return new te(new O(r),e,t,n)}e(P,`getChartTitleComponent`);var ne=.75,re=.5,ie=.35;function F(e){return{fontSize:e,markerSize:e*ne,markerSpacing:e*ie,itemSpacing:e*re}}e(F,`getLegendLayout`);var ae=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{e(this,`ChartLegend`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(e=>e.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:t,markerSize:n,markerSpacing:r,itemSpacing:i}=F(this.chartConfig.legendFontSize),a=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(e=>e.title),t),o=this.chartConfig.legendPadding*2+n+r+a.width,s=this.chartConfig.legendPadding*2+this.visiblePlots.length*t+(this.visiblePlots.length-1)*i;return o<=e.width&&s<=e.height?(this.boundingRect.width=o,this.boundingRect.height=s):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:t,markerSpacing:n,itemSpacing:r}=F(this.chartConfig.legendFontSize),i=e+r,a=this.boundingRect.x+this.chartConfig.legendPadding,o=this.boundingRect.y+this.chartConfig.legendPadding,s=[],c=[];for(let[e,n]of this.visiblePlots.entries())if(T(n))s.push({x:a,y:o+e*i,width:t,height:t,fill:n.fill,strokeFill:n.fill,strokeWidth:0});else{let r=o+e*i+t/2;c.push({path:`M ${a},${r} L ${a+t},${r}`,strokeFill:n.strokeFill,strokeWidth:n.strokeWidth})}return[{groupTexts:[`legend`,`markers`],type:`rect`,data:s},{groupTexts:[`legend`,`markers`],type:`path`,data:c},{groupTexts:[`legend`,`label`],type:`text`,data:this.visiblePlots.map((r,s)=>({text:r.title,x:a+t+n,y:o+s*i+t/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:`middle`,horizontalPos:`left`}))}]}};function I(e,t,n,r){return new ae(new O(r),e,t,n)}e(I,`getChartLegendComponent`);var oe=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{e(this,`LinePlot`)}getDrawableElement(){let e=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t;if(t=this.orientation===`horizontal`?v().y(e=>e[0]).x(e=>e[1])(e):v().x(e=>e[0]).y(e=>e[1])(e),!t)return[];let n=[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:t,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let t=[];for(let[n,[r,i]]of e.entries()){let e=this.plotData.pointLabels[n];e&&(this.orientation===`horizontal`?t.push({x:i+10,y:r,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`left`,fontSize:12,rotation:0}):t.push({x:r,y:i-10,text:e,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`center`,fontSize:12,rotation:0}))}t.length>0&&n.push({groupTexts:[`plot`,`line-plot-${this.plotIndex}`,`labels`],type:`text`,data:t})}return n}},se=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{e(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ce=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{e(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new oe(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new se(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}}return e}};function le(e,t,n){return new ce(e,t,n)}e(le,`getPlotComponent`);var ue=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:P(e,t,n,r),plot:le(e,t,n),legend:I(e,t,n,r),xAxis:N(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:N(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{e(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i={width:0,height:0},a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`bottom`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=s.height,this.componentStore.yAxis.setAxisPosition(`left`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=s.width,e-=s.width,i=this.componentStore.legend.calculateSpace({width:e,height:o}),e-=i.width,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.legend.setBoundingBoxXY({x:n+a,y:r+Math.max((o-i.height)/2,0)}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+o}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a={width:0,height:0},o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),c=this.componentStore.plot.calculateSpace({width:o,height:s});e-=c.width,t-=c.height,c=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=c.height,t-=c.height,this.componentStore.xAxis.setAxisPosition(`left`),c=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=c.width,r=c.width,this.componentStore.yAxis.setAxisPosition(`top`),c=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=c.height,i=n+c.height,a=this.componentStore.legend.calculateSpace({width:e,height:s}),e-=a.width,e>0&&(o+=e,e=0),t>0&&(s+=t,t=0),this.componentStore.plot.calculateSpace({width:o,height:s}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.legend.setBoundingBoxXY({x:r+o,y:i+Math.max((s-a.height)/2,0)}),this.componentStore.yAxis.setRange([r,r+o]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>T(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},de=class{static{e(this,`XYChartBuilder`)}static build(e,t,n,r){return new ue(e,t,n,r).getDrawableElement()}},L=0,R,z=K(),B=G(),V=q(),H=B.plotColorPalette.split(`,`).map(e=>e.trim()),U=!1,W=!1;function G(){let e=n(),t=s();return _(e.xyChart,t.themeVariables.xyChart)}e(G,`getChartDefaultThemeConfig`);function K(){let e=s();return _(l.xyChart,e.xyChart)}e(K,`getChartDefaultConfig`);function q(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}e(q,`getChartDefaultData`);function J(e){let t=s();return p(e.trim(),t)}e(J,`textSanitizer`);function Y(e){R=e}e(Y,`setTmpSVGG`);function fe(e){e===`horizontal`?z.chartOrientation=`horizontal`:z.chartOrientation=`vertical`}e(fe,`setOrientation`);function pe(e){V.xAxis.title=J(e.text)}e(pe,`setXAxisTitle`);function X(e,t){V.xAxis={type:`linear`,title:V.xAxis.title,min:e,max:t},U=!0}e(X,`setXAxisRangeData`);function me(e){V.xAxis={type:`band`,title:V.xAxis.title,categories:e.map(e=>J(e.text))},U=!0}e(me,`setXAxisBand`);function he(e){V.yAxis.title=J(e.text)}e(he,`setYAxisTitle`);function Z(e,t){V.yAxis={type:`linear`,title:V.yAxis.title,min:e,max:t},W=!0}e(Z,`setYAxisRangeData`);function ge(e){let t=Math.min(...e),n=Math.max(...e),r=D(V.yAxis)?V.yAxis.min:1/0,i=D(V.yAxis)?V.yAxis.max:-1/0;V.yAxis={type:`linear`,title:V.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}e(ge,`setYAxisRangeFromPlotData`);function Q(e){let t=[];if(e.length===0)return t;if(!U){let t=D(V.xAxis)?V.xAxis.min:1/0,n=D(V.xAxis)?V.xAxis.max:-1/0;X(Math.min(t,1),Math.max(n,e.length))}if(E(V.xAxis)&&e.length>V.xAxis.categories.length&&(e=e.slice(0,V.xAxis.categories.length)),W||ge(e),E(V.xAxis)&&(t=V.xAxis.categories.map((t,n)=>[t,e[n]])),D(V.xAxis)){let n=V.xAxis.min,r=V.xAxis.max;if(e.length===1)t=[[`${n}`,e[0]]];else{let i=(r-n)/(e.length-1);t=e.map((e,t)=>[`${n+t*i}`,e])}}return t}e(Q,`transformDataWithoutCategory`);function $(e){return H[e===0?0:e%H.length]}e($,`getPlotColorFromPalette`);function _e(e,t){let n=t.map(e=>e.value),r=t.map(e=>e.label?J(e.label):``),i=Q(n),a=r.some(e=>e!==``);V.plots.push({type:`line`,title:J(e.text),strokeFill:$(L),strokeWidth:2,data:i,...a?{pointLabels:r}:{}}),L++}e(_e,`setLineData`);function ve(e,t){let n=Q(t.map(e=>e.value));V.plots.push({type:`bar`,title:J(e.text),fill:$(L),data:n}),L++}e(ve,`setBarData`);function ye(){if(V.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return V.title=d(),de.build(z,V,B,R)}e(ye,`getDrawableElem`);function be(){return B}e(be,`getChartThemeConfig`);function xe(){return z}e(xe,`getChartConfig`);function Se(){return V}e(Se,`getXYChartData`);var Ce={parser:w,db:{getDrawableElem:ye,clear:e(function(){o(),L=0,z=K(),V=q(),B=G(),H=B.plotColorPalette.split(`,`).map(e=>e.trim()),U=!1,W=!1},`clear`),setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:d,getAccDescription:u,setAccDescription:r,setOrientation:fe,setXAxisTitle:pe,setXAxisRangeData:X,setXAxisBand:me,setYAxisTitle:he,setYAxisRangeData:Z,setLineData:_e,setBarData:ve,setTmpSVGG:Y,getChartThemeConfig:be,getChartConfig:xe,getXYChartData:Se},renderer:{draw:e((n,r,i,a)=>{let o=a.db,s=o.getChartThemeConfig(),l=o.getChartConfig(),u=o.getXYChartData().plots[0].data.map(e=>e[1]);function d(e){return e===`top`?`text-before-edge`:`middle`}e(d,`getDominantBaseLine`);function f(e){return e===`left`?`start`:e===`right`?`end`:`middle`}e(f,`getTextAnchor`);function p(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}e(p,`getTextTransformation`),t.debug(`Rendering xychart chart
|
|
7
|
+
`+n);let m=b(r),h=m.append(`g`).attr(`class`,`main`),g=h.append(`rect`).attr(`width`,l.width).attr(`height`,l.height).attr(`class`,`background`);c(m,l.height,l.width,!0),m.attr(`viewBox`,`0 0 ${l.width} ${l.height}`),g.attr(`fill`,s.backgroundColor),o.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let _=o.getDrawableElem(),v={};function y(e){let t=h,n=``;for(let[r]of e.entries()){let i=h;r>0&&v[n]&&(i=v[n]),n+=e[r],t=v[n],t||=v[n]=i.append(`g`).attr(`class`,e[r])}return t}e(y,`getGroup`);for(let t of _){if(t.data.length===0)continue;let n=y(t.groupTexts);switch(t.type){case`rect`:if(n.selectAll(`rect`).data(t.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),l.showDataLabel){let r=l.showDataLabelOutsideBar;if(l.chartOrientation===`horizontal`){let i=function(e,t){let{data:n,label:r}=e;return t*r.length*a<=n.width-o};e(i,`fitsHorizontally`);let a=.7,o=10,c=t.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),l=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!i(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...l)),f=e(e=>r?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);n.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,r?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let i=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};e(i,`fitsInBar`);let a=t.data.map((e,t)=>({data:e,label:u[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=a.map(e=>{let{data:t,label:n}=e,r=t.width/(n.length*.7);for(;!i(e,r,10)&&r>0;)--r;return r}),c=Math.floor(Math.min(...o)),l=e(e=>r?e.data.y-10:e.data.y+10,`determineLabelYPosition`);n.selectAll(`text`).data(a).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,l).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,r?`auto`:`hanging`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:n.selectAll(`text`).data(t.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>d(e.verticalPos)).attr(`text-anchor`,e=>f(e.horizontalPos)).attr(`transform`,e=>p(e)).text(e=>e.text);break;case`path`:n.selectAll(`path`).data(t.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth)}}},`draw`)}};export{Ce as diagram};
|
|
@@ -0,0 +1,13 @@
|
|
|
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.0" />
|
|
6
|
+
<title>Kortext</title>
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-CjkpNftW.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DVIDTWin.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1344" height="334" viewBox="86 340 1344 334" role="img" aria-labelledby="title description">
|
|
2
|
+
<title id="title">kortext — filled dark mode</title>
|
|
3
|
+
<desc id="description">Dark mode filled Kortext wordmark. Light gray sketch lettering, bright blueprint blue, off-white final lettering on a charcoal background. Original geometry preserved.</desc>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<!-- Pencil construction marks traced from the reference. -->
|
|
7
|
+
<g id="sketch-guides" fill="none" stroke="#abb3c2" stroke-linecap="round">
|
|
8
|
+
<path opacity=".25" stroke-width=".8" d="M102 380H185 M102 632H348 M121 356V655 M169 356V643 M223 444H310 M248 437L161 532 M215 520L312 647 M189 545L265 650 M485 444H655 M514 632H594 M535 428V653 M571 430V650 M636 425V495"/>
|
|
9
|
+
<path opacity=".13" stroke-width=".7" d="M104 379L177 381 M122 358L120 651 M167 364L169 645 M102 633L322 631 M223 442L306 445 M487 443L650 445 M533 427L537 648 M571 435L569 646 M635 427L637 491 M515 633L592 630"/>
|
|
10
|
+
<path opacity=".12" stroke-width=".7" stroke-dasharray="5 3 1 3" d="M297 632H534 M486 444H668"/>
|
|
11
|
+
</g>
|
|
12
|
+
|
|
13
|
+
<!-- Original reference geometry with light gray fill. -->
|
|
14
|
+
<g id="kor" fill="#9ca3af" fill-rule="evenodd" stroke="#9ca3af" stroke-width="2.15" stroke-linejoin="miter">
|
|
15
|
+
<path id="k" d="M122 380H168V522L246 444H297L216 521L298 631H250L191 548L168 571V631H122Z"/>
|
|
16
|
+
<path id="o" d="M401 442C345 442 306 482 306 537C306 595 345 634 401 634C459 634 497 594 497 537C497 482 458 442 401 442Z M401 477C366 477 344 501 344 537C344 574 367 599 401 599C436 599 460 574 460 537C460 501 437 477 401 477Z"/>
|
|
17
|
+
<path id="r" d="M536 444H571V472C582 452 604 440 635 443V481C609 474 589 482 578 500C573 509 572 518 572 532V631H536Z"/>
|
|
18
|
+
</g>
|
|
19
|
+
<g id="pencil-edge" fill="none" stroke="#aab2c0" stroke-width=".6" opacity=".32">
|
|
20
|
+
<path d="M123.4 381L166.8 379.7L168.8 523.3L247 445 M122.9 382L120.9 630.2L166.8 632 M215 520L299 633 M307.3 536C306 484 344 440.7 401 440.8C460 442.8 498.6 484 498 537C498 595 458 635.2 401 633.1C343 634.8 304.9 594 307.3 536 M344.8 538C344 501 366 475.6 401 475.8C438 477 461 501 461.4 537 M534.6 444.8L536.8 632 M573 472C587 450 607 440 635.6 441.7"/>
|
|
21
|
+
</g>
|
|
22
|
+
|
|
23
|
+
<!-- Blueprint construction lines, retained without diagonal hatching. -->
|
|
24
|
+
<g id="blueprint-guides" fill="none" stroke="#609cff" stroke-width=".8">
|
|
25
|
+
<path opacity=".32" d="M681 392H759 M701 376V652 M742 379V646 M672 427V494 M792 426V494 M655 444H1010 M655 477H1016 M685 597H1008 M829 430V645 M999 430V646 M817 502H1007 M793 520H1023 M792 550H1023 M813 572H1008 M866 474V631 M966 475V629 M917 442V633 M961 563L1008 597"/>
|
|
26
|
+
<path opacity=".48" stroke-dasharray="8 4" d="M716 366V655 M676 631H1130 M654 477H1016 M787 520H1025 M788 550H1023 M793 593V653 M830 430V649 M1000 430V649"/>
|
|
27
|
+
<path opacity=".68" stroke-dasharray="7 3 2 3" d="M1032 414V658 M1113 426V647 M1023 443H1131 M1092 537H1186 M1019 632H1132"/>
|
|
28
|
+
<path opacity=".34" d="M1032 430L1042 443 M1095 435L1101 443 M1094 631L1105 617 M1032 636L1043 622"/>
|
|
29
|
+
</g>
|
|
30
|
+
|
|
31
|
+
<g id="blueprint" fill="#0865ff" fill-rule="evenodd" stroke="#0865ff" stroke-width="2.1" stroke-linejoin="miter">
|
|
32
|
+
<path id="blue-t" d="M702 393H743V444H792V477H743V571C743 591 753 600 774 600C781 600 787 599 793 596V630C784 633 774 634 764 634C723 634 702 614 702 575V477H672V444H702Z"/>
|
|
33
|
+
<path id="e" d="M1000 550H866C870 581 888 599 918 599C940 599 956 590 967 572L997 591C979 619 953 633 918 633C865 633 830 596 830 539C830 484 865 441 917 441C967 441 1000 479 1000 535Z M866 520H967C964 492 946 474 917 474C890 474 870 491 866 520Z"/>
|
|
34
|
+
<path id="x-blue" d="M1041 443H1094L1170 537L1094 632H1041L1115 537Z"/>
|
|
35
|
+
</g>
|
|
36
|
+
|
|
37
|
+
<g id="final" fill="#f4f5f7">
|
|
38
|
+
<path id="x-final" d="M1219 442H1268L1194 532L1170 502Z M1194 544L1268 632H1219L1170 573Z"/>
|
|
39
|
+
<path id="final-t" d="M1330 387H1365V442H1412V474H1365V576C1365 595 1373 603 1389 603C1398 603 1406 601 1414 598V630C1406 633 1397 635 1385 635C1349 635 1330 615 1330 578V474H1302V442H1330Z"/>
|
|
40
|
+
</g>
|
|
41
|
+
</svg>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1344" height="334" viewBox="86 340 1344 334" role="img" aria-labelledby="title description">
|
|
2
|
+
<title id="title">kortext — filled version</title>
|
|
3
|
+
<desc id="description">Kortext filled variant: light gray kor, blueprint blue te and left x component, dark final component. Original vector geometry preserved.</desc>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<!-- Pencil construction marks traced from the reference. -->
|
|
7
|
+
<g id="sketch-guides" fill="none" stroke="#656565" stroke-linecap="round">
|
|
8
|
+
<path opacity=".25" stroke-width=".8" d="M102 380H185 M102 632H348 M121 356V655 M169 356V643 M223 444H310 M248 437L161 532 M215 520L312 647 M189 545L265 650 M485 444H655 M514 632H594 M535 428V653 M571 430V650 M636 425V495"/>
|
|
9
|
+
<path opacity=".13" stroke-width=".7" d="M104 379L177 381 M122 358L120 651 M167 364L169 645 M102 633L322 631 M223 442L306 445 M487 443L650 445 M533 427L537 648 M571 435L569 646 M635 427L637 491 M515 633L592 630"/>
|
|
10
|
+
<path opacity=".12" stroke-width=".7" stroke-dasharray="5 3 1 3" d="M297 632H534 M486 444H668"/>
|
|
11
|
+
</g>
|
|
12
|
+
|
|
13
|
+
<!-- Original reference geometry with light gray fill. -->
|
|
14
|
+
<g id="kor" fill="#e5e7eb" fill-rule="evenodd" stroke="#555555" stroke-width="2.15" stroke-linejoin="miter">
|
|
15
|
+
<path id="k" d="M122 380H168V522L246 444H297L216 521L298 631H250L191 548L168 571V631H122Z"/>
|
|
16
|
+
<path id="o" d="M401 442C345 442 306 482 306 537C306 595 345 634 401 634C459 634 497 594 497 537C497 482 458 442 401 442Z M401 477C366 477 344 501 344 537C344 574 367 599 401 599C436 599 460 574 460 537C460 501 437 477 401 477Z"/>
|
|
17
|
+
<path id="r" d="M536 444H571V472C582 452 604 440 635 443V481C609 474 589 482 578 500C573 509 572 518 572 532V631H536Z"/>
|
|
18
|
+
</g>
|
|
19
|
+
<g id="pencil-edge" fill="none" stroke="#686868" stroke-width=".6" opacity=".32">
|
|
20
|
+
<path d="M123.4 381L166.8 379.7L168.8 523.3L247 445 M122.9 382L120.9 630.2L166.8 632 M215 520L299 633 M307.3 536C306 484 344 440.7 401 440.8C460 442.8 498.6 484 498 537C498 595 458 635.2 401 633.1C343 634.8 304.9 594 307.3 536 M344.8 538C344 501 366 475.6 401 475.8C438 477 461 501 461.4 537 M534.6 444.8L536.8 632 M573 472C587 450 607 440 635.6 441.7"/>
|
|
21
|
+
</g>
|
|
22
|
+
|
|
23
|
+
<!-- Blueprint construction lines, retained without diagonal hatching. -->
|
|
24
|
+
<g id="blueprint-guides" fill="none" stroke="#176bff" stroke-width=".8">
|
|
25
|
+
<path opacity=".32" d="M681 392H759 M701 376V652 M742 379V646 M672 427V494 M792 426V494 M655 444H1010 M655 477H1016 M685 597H1008 M829 430V645 M999 430V646 M817 502H1007 M793 520H1023 M792 550H1023 M813 572H1008 M866 474V631 M966 475V629 M917 442V633 M961 563L1008 597"/>
|
|
26
|
+
<path opacity=".48" stroke-dasharray="8 4" d="M716 366V655 M676 631H1130 M654 477H1016 M787 520H1025 M788 550H1023 M793 593V653 M830 430V649 M1000 430V649"/>
|
|
27
|
+
<path opacity=".68" stroke-dasharray="7 3 2 3" d="M1032 414V658 M1113 426V647 M1023 443H1131 M1092 537H1186 M1019 632H1132"/>
|
|
28
|
+
<path opacity=".34" d="M1032 430L1042 443 M1095 435L1101 443 M1094 631L1105 617 M1032 636L1043 622"/>
|
|
29
|
+
</g>
|
|
30
|
+
|
|
31
|
+
<g id="blueprint" fill="#0865ff" fill-rule="evenodd" stroke="#0865ff" stroke-width="2.1" stroke-linejoin="miter">
|
|
32
|
+
<path id="blue-t" d="M702 393H743V444H792V477H743V571C743 591 753 600 774 600C781 600 787 599 793 596V630C784 633 774 634 764 634C723 634 702 614 702 575V477H672V444H702Z"/>
|
|
33
|
+
<path id="e" d="M1000 550H866C870 581 888 599 918 599C940 599 956 590 967 572L997 591C979 619 953 633 918 633C865 633 830 596 830 539C830 484 865 441 917 441C967 441 1000 479 1000 535Z M866 520H967C964 492 946 474 917 474C890 474 870 491 866 520Z"/>
|
|
34
|
+
<path id="x-blue" d="M1041 443H1094L1170 537L1094 632H1041L1115 537Z"/>
|
|
35
|
+
</g>
|
|
36
|
+
|
|
37
|
+
<g id="final" fill="#202123">
|
|
38
|
+
<path id="x-final" d="M1219 442H1268L1194 532L1170 502Z M1194 544L1268 632H1219L1170 573Z"/>
|
|
39
|
+
<path id="final-t" d="M1330 387H1365V442H1412V474H1365V576C1365 595 1373 603 1389 603C1398 603 1406 601 1414 598V630C1406 633 1397 635 1385 635C1349 635 1330 615 1330 578V474H1302V442H1330Z"/>
|
|
40
|
+
</g>
|
|
41
|
+
</svg>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Existing Project Analysis
|
|
2
|
+
|
|
3
|
+
> **In this file:** An existing project's codebase is examined and its actual state is documented in the reference + foundation files.
|
|
4
|
+
|
|
5
|
+
> **Scope before writing.** The codebase is the only evidence; there is no brief. Every step
|
|
6
|
+
> decides whether its document applies before it writes a line, and the `n/a when` condition
|
|
7
|
+
> below each step is that test — read the code, do not assume the project is like other
|
|
8
|
+
> projects. When the condition is met, the document is written with `status: not-applicable`
|
|
9
|
+
> and one line of reasoning, and the flow carries on. Steps with no `n/a when` line always
|
|
10
|
+
> apply. Absence of evidence is a finding, not a blank to fill.
|
|
11
|
+
|
|
12
|
+
## Technical Discovery
|
|
13
|
+
|
|
14
|
+
1. **+architect:** Produce `STACK.md` + `STRUCTURE.md`. Scan the existing codebase — the ground truth is THE CODE ITSELF (there is no brief in this flow). Scope: STACK (technology stack, MCP servers, dev tools, dependencies, language/framework versions), STRUCTURE (folder structure, naming conventions, coding standards + project terminology glossary).
|
|
15
|
+
- inputs:
|
|
16
|
+
- outputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`
|
|
17
|
+
- approver: +prime
|
|
18
|
+
|
|
19
|
+
2. **+architect:** Produce `ARCHITECTURE.md`. Extract the actual shape of the existing system: components, data flow, boundaries and integration points, the rationales behind the main architectural choices. Flag the gaps between code and intent.
|
|
20
|
+
- inputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`
|
|
21
|
+
- outputs: `.kortext/ARCHITECTURE.md`
|
|
22
|
+
- approver: +prime
|
|
23
|
+
|
|
24
|
+
3. **+db-admin:** Produce `DATABASE.md`. Scope: existing migrations + schema + ORM models + connection setup + tables + relationships + indexes + data types + integrity rules.
|
|
25
|
+
- inputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`
|
|
26
|
+
- outputs: `.kortext/DATABASE.md`
|
|
27
|
+
- n/a when: the codebase carries no persistence layer: no schema, no migrations, no ORM models, no database client.
|
|
28
|
+
- approver: +prime
|
|
29
|
+
|
|
30
|
+
4. **+security-engineer:** Produce `SECURITY.md`. Scope: existing auth + authorization + middleware + env handling + CORS + rate limiting + secret management + logging + sensitive-data usage. Flag vulnerabilities and missing layers, against the boundaries `ARCHITECTURE.md` found and the data `DATABASE.md` holds.
|
|
31
|
+
- inputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`, `.kortext/ARCHITECTURE.md`, `.kortext/DATABASE.md`
|
|
32
|
+
- outputs: `.kortext/SECURITY.md`
|
|
33
|
+
- approver: +prime
|
|
34
|
+
|
|
35
|
+
5. **+devops-engineer:** Produce `ENVIRONMENT.md`. Scope: CI/CD pipelines, deployment processes, environment configurations, branch strategy + access ownership and account inventory (Access & Service section), secret management.
|
|
36
|
+
- inputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`, `.kortext/ARCHITECTURE.md`, `.kortext/SECURITY.md`
|
|
37
|
+
- outputs: `.kortext/ENVIRONMENT.md`
|
|
38
|
+
- approver: +prime
|
|
39
|
+
|
|
40
|
+
6. **+architect:** Produce `API.md`. Scope: endpoint list + request/response models + auth mechanisms + service boundaries + integration points.
|
|
41
|
+
- inputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`, `.kortext/DATABASE.md`
|
|
42
|
+
- outputs: `.kortext/API.md`
|
|
43
|
+
- n/a when: the codebase exposes no endpoint, handler or public interface and calls no external service.
|
|
44
|
+
- approver: +prime
|
|
45
|
+
|
|
46
|
+
## Product Discovery
|
|
47
|
+
|
|
48
|
+
1. **+product-manager:** Produce `PRODUCT.md`. Scope: existing features + user flows + roles/permissions + known gaps + any existing roadmap/issue list — all from the code and the traces in the repo.
|
|
49
|
+
- inputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`, `.kortext/ARCHITECTURE.md`, `.kortext/DATABASE.md`, `.kortext/API.md`
|
|
50
|
+
- outputs: `.kortext/PRODUCT.md`
|
|
51
|
+
- approver: +prime
|
|
52
|
+
|
|
53
|
+
2. **+qa-engineer:** Produce `TEST.md`. Scope: test coverage + test types + CI test reports + untested areas. Document whether quality assurance is sufficient for the critical user flows.
|
|
54
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`, `.kortext/STRUCTURE.md`
|
|
55
|
+
- outputs: `.kortext/TEST.md`
|
|
56
|
+
- approver: +prime
|
|
57
|
+
|
|
58
|
+
3. **+designer:** Produce `DESIGN.md`. Extract the existing design language from the code: tokens/theme, components, layout patterns, accessibility state. Flag inconsistencies; set the rules future work must follow.
|
|
59
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`, `.kortext/STRUCTURE.md`
|
|
60
|
+
- outputs: `.kortext/DESIGN.md`
|
|
61
|
+
- n/a when: the codebase renders no user interface — no views, no templates, no components, no styling.
|
|
62
|
+
- approver: +prime
|
|
63
|
+
|
|
64
|
+
4. **+growth-expert:** Produce `GROWTH.md`. Scope: current analytics/tracking state, SEO/ASO posture, activation and retention signals worth measuring; what to instrument next.
|
|
65
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`, `.kortext/DESIGN.md`
|
|
66
|
+
- outputs: `.kortext/GROWTH.md`
|
|
67
|
+
- n/a when: the codebase serves no measurable surface and reaches no acquisition channel — an internal tool or a library.
|
|
68
|
+
- approver: +prime
|
|
69
|
+
|
|
70
|
+
5. **+compliance-expert:** Produce `LEGAL.md`. Scope: personal-data handling found in the code (KVKK/GDPR), license obligations of the dependency tree, terms/privacy needs, compliance gaps. Judge the codebase as it is: the hosting region from `ENVIRONMENT.md`, the third parties from `STACK.md` and `GROWTH.md`, the personal-data columns from `DATABASE.md`, the technical measures from `SECURITY.md`.
|
|
71
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`, `.kortext/SECURITY.md`, `.kortext/DATABASE.md`, `.kortext/ENVIRONMENT.md`, `.kortext/GROWTH.md`
|
|
72
|
+
- outputs: `.kortext/LEGAL.md`
|
|
73
|
+
- n/a when: the codebase touches no personal data, ships no third-party data flow and carries no licence obligation beyond permissive dependencies.
|
|
74
|
+
- approver: +prime
|
|
75
|
+
|
|
76
|
+
6. **+copywriter:** Produce `CONTENT.md`. Scope: existing UI copy, tone of voice, error/empty-state messages, localization state; the content rules future work must follow. The interface language is whatever the code already speaks — read the strings, do not assume; if the codebase carries an i18n setup, record the source language, the target languages and the state of each.
|
|
77
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/DESIGN.md`, `.kortext/GROWTH.md`, `.kortext/LEGAL.md`
|
|
78
|
+
- outputs: `.kortext/CONTENT.md`
|
|
79
|
+
- n/a when: no string in the codebase is read by a person: no interface copy, no messages, no emails.
|
|
80
|
+
- approver: +prime
|
|
81
|
+
|
|
82
|
+
## Technical Debt and the Engineering Contract
|
|
83
|
+
|
|
84
|
+
1. **+architect:** Consolidate `ENGINEERING.md`. Scope: technical debt from the discovery outputs + architectural issues + security risks + test gaps + devops/release risks + improvement areas. For each debt item: impact, risk, dependencies, priority level.
|
|
85
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`, `.kortext/STRUCTURE.md`, `.kortext/ARCHITECTURE.md`, `.kortext/DATABASE.md`, `.kortext/SECURITY.md`, `.kortext/API.md`, `.kortext/ENVIRONMENT.md`, `.kortext/TEST.md`, `.kortext/LEGAL.md`
|
|
86
|
+
- outputs: `.kortext/ENGINEERING.md`
|
|
87
|
+
- approver: +prime
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# New Project Analysis
|
|
2
|
+
|
|
3
|
+
> **In this file:** The reference + foundation files for a new project are produced.
|
|
4
|
+
|
|
5
|
+
> **Scope before writing.** Every step decides whether its document applies to THIS project
|
|
6
|
+
> before it writes a line. The `n/a when` condition below each step is that test; when it is
|
|
7
|
+
> met, the document is written with `status: not-applicable` and one line of reasoning, and
|
|
8
|
+
> the flow carries on — a correct outcome, not a gap. Steps with no `n/a when` line always
|
|
9
|
+
> apply. What the inputs do not say, no document may assume.
|
|
10
|
+
|
|
11
|
+
> **The order is the argument.** Each document is written only once every fact it depends on
|
|
12
|
+
> exists. Product first, because everything after it instruments, builds or judges what it
|
|
13
|
+
> defines. Stack before architecture, architecture before security, security before the
|
|
14
|
+
> environment it hardens and the schema it protects: each is the ground the next stands on.
|
|
15
|
+
> Measurement, compliance and content come near the end because all three read a system
|
|
16
|
+
> rather than imagine one — the surfaces are what a growth plan can measure, the hosting
|
|
17
|
+
> region, the processor list and the stored fields are what compliance rules on, and the
|
|
18
|
+
> components are what copy is written into. Where a late document finds a problem, the fix is
|
|
19
|
+
> a revision of the document that caused it, not a quiet assumption in the one that found it.
|
|
20
|
+
|
|
21
|
+
## Product
|
|
22
|
+
|
|
23
|
+
1. **+product-manager:** Produce `PRODUCT.md`. From the brief: scope, user types, main flows, priorities, acceptance criteria, out-of-scope items. State plainly which personal data each flow needs — that list is what the compliance analysis will be run against later.
|
|
24
|
+
- inputs: `.kortext/BRIEF.md`
|
|
25
|
+
- outputs: `.kortext/PRODUCT.md`
|
|
26
|
+
- approver: +prime
|
|
27
|
+
|
|
28
|
+
## Engineering
|
|
29
|
+
|
|
30
|
+
1. **+architect:** Produce `STACK.md` + `STRUCTURE.md`. STACK: technology stack, MCP servers, dev tools, prerequisites to request from prime (device, emulator, API key, external service). STRUCTURE: coding standards + folder structure + project terminology glossary. Name every third-party service that will see user data, and the region it runs in — compliance is judged on this list.
|
|
31
|
+
- inputs: `.kortext/BRIEF.md`, `.kortext/PRODUCT.md`
|
|
32
|
+
- outputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`
|
|
33
|
+
- approver: +prime
|
|
34
|
+
|
|
35
|
+
2. **+architect:** Produce `ARCHITECTURE.md`. From PRODUCT + STACK + STRUCTURE, design the shape of the system: components, data flow, boundaries and integration points, main architectural choices, each with its rationale and the alternative that lost. The boundaries drawn here are the ones `SECURITY.md` will defend.
|
|
36
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`, `.kortext/STRUCTURE.md`
|
|
37
|
+
- outputs: `.kortext/ARCHITECTURE.md`
|
|
38
|
+
- approver: +prime
|
|
39
|
+
|
|
40
|
+
3. **+security-engineer:** Produce `SECURITY.md`. Auth, authorization, secret management, data storage, logging, `.gitignore`, secure development discipline. Defend the boundaries `ARCHITECTURE.md` draws around the data `PRODUCT.md` says the product handles — not a generic checklist for the stack. The auth model written here is what the schema and the endpoints are built on, so name roles and permissions concretely.
|
|
41
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`, `.kortext/ARCHITECTURE.md`
|
|
42
|
+
- outputs: `.kortext/SECURITY.md`
|
|
43
|
+
- approver: +prime
|
|
44
|
+
|
|
45
|
+
4. **+devops-engineer:** Produce `ENVIRONMENT.md`. Environments (dev/prod), environment-variable plan, setup steps, CI/CD approach, access ownership and account inventory (Access & Service section), secret management under the rules `SECURITY.md` sets. State the hosting region explicitly — it is the single fact that decides whether a cross-border transfer regime applies. The database instances named here are the ones the schema is designed for.
|
|
46
|
+
- inputs: `.kortext/STACK.md`, `.kortext/STRUCTURE.md`, `.kortext/SECURITY.md`
|
|
47
|
+
- outputs: `.kortext/ENVIRONMENT.md`
|
|
48
|
+
- approver: +prime
|
|
49
|
+
|
|
50
|
+
5. **+db-admin:** Produce `DATABASE.md`. Tables, relationships, indexes, access rules, migration approach, data integrity. Design for the engine and instances `ENVIRONMENT.md` names, under the access rules `SECURITY.md` sets. Mark which columns hold personal data — `LEGAL.md` reads this to decide retention and erasure duties.
|
|
51
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/ARCHITECTURE.md`, `.kortext/SECURITY.md`, `.kortext/ENVIRONMENT.md`, `.kortext/STRUCTURE.md`, `.kortext/STACK.md`
|
|
52
|
+
- outputs: `.kortext/DATABASE.md`
|
|
53
|
+
- n/a when: the product persists nothing beyond its own configuration: no database, no stored records, no user data at rest.
|
|
54
|
+
- approver: +prime
|
|
55
|
+
|
|
56
|
+
6. **+architect:** Produce `API.md`. Endpoint list, request/response models, error formats, authorization requirements, data flow. The authorization on every endpoint is the model `SECURITY.md` defines — apply it, do not invent a second one.
|
|
57
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/ARCHITECTURE.md`, `.kortext/SECURITY.md`, `.kortext/STRUCTURE.md`, `.kortext/STACK.md`, `.kortext/DATABASE.md`
|
|
58
|
+
- outputs: `.kortext/API.md`
|
|
59
|
+
- n/a when: nothing crosses a program boundary: the product exposes no endpoint and calls no external service.
|
|
60
|
+
- approver: +prime
|
|
61
|
+
|
|
62
|
+
7. **+designer:** Produce `DESIGN.md`. Color palette, typography, component principles, responsive behavior, accessibility, core UI rules. The components named here are the ones `CONTENT.md` writes copy into and the surfaces `GROWTH.md` measures, so name them concretely.
|
|
63
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/STACK.md`
|
|
64
|
+
- outputs: `.kortext/DESIGN.md`
|
|
65
|
+
- n/a when: the product has no visual surface — a CLI, a library, or a service that renders nothing.
|
|
66
|
+
- approver: +prime
|
|
67
|
+
|
|
68
|
+
## Judgement
|
|
69
|
+
|
|
70
|
+
1. **+growth-expert:** Produce `GROWTH.md`. Scope: target audience, channel strategy, SEO/GEO, measurement, analytics, conversion tracking. The event taxonomy instruments the flows `PRODUCT.md` defines on the surfaces `DESIGN.md` names — use both, do not invent parallel ones. Every third party that would touch user data here becomes a processor `LEGAL.md` has to account for, so name the measurement mechanism concretely.
|
|
71
|
+
- inputs: `.kortext/BRIEF.md`, `.kortext/PRODUCT.md`, `.kortext/DESIGN.md`
|
|
72
|
+
- outputs: `.kortext/GROWTH.md`
|
|
73
|
+
- n/a when: the brief describes no surface worth measuring and no acquisition channel — an internal tool, a library, or something with one known user.
|
|
74
|
+
- approver: +prime
|
|
75
|
+
|
|
76
|
+
2. **+compliance-expert:** Produce `LEGAL.md`. Regulations that apply (KVKK, GDPR, CCPA, sector-specific) + data lifecycle rules (privacy, disclosure notices, consent, retention, deletion, third-party sharing). Judge the system as designed, not as imagined: the hosting region from `ENVIRONMENT.md`, the processors from `STACK.md` and `GROWTH.md`, the personal-data columns from `DATABASE.md`, the technical measures from `SECURITY.md`. Where the design breaks an obligation, name the document that must change and why — that is a revision request, not an open question.
|
|
77
|
+
- inputs: `.kortext/BRIEF.md`, `.kortext/PRODUCT.md`, `.kortext/GROWTH.md`, `.kortext/STACK.md`, `.kortext/SECURITY.md`, `.kortext/DATABASE.md`, `.kortext/ENVIRONMENT.md`
|
|
78
|
+
- outputs: `.kortext/LEGAL.md`
|
|
79
|
+
- n/a when: the design touches no personal data, no accounts, no third party receiving data and no regulated content — a tool whose data never leaves the user's own machine.
|
|
80
|
+
- approver: +prime
|
|
81
|
+
|
|
82
|
+
3. **+copywriter:** Produce `CONTENT.md`. Brand voice, message hierarchy, page copy, microcopy, SEO content direction. Write into the components `DESIGN.md` names and the flows `PRODUCT.md` defines. Every string a user reads is written in the interface language BRIEF.md names — and if BRIEF.md names more than one, add the localization plan: source language, target languages, what is translated and what stays fixed. The notices `LEGAL.md` requires are content: write them, do not reference them.
|
|
83
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/DESIGN.md`, `.kortext/GROWTH.md`, `.kortext/LEGAL.md`
|
|
84
|
+
- outputs: `.kortext/CONTENT.md`
|
|
85
|
+
- n/a when: nothing in the product is read by a person: no interface copy, no messages, no emails, no listing.
|
|
86
|
+
- approver: +prime
|
|
87
|
+
|
|
88
|
+
## Consolidation
|
|
89
|
+
|
|
90
|
+
1. **+architect:** Consolidate `ENGINEERING.md`. Merge the engineering documents and their decisions into a single report. `LEGAL.md` is an input, not a courtesy: where it rules against the design, the contradiction is resolved here or carried as a named risk.
|
|
91
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/ARCHITECTURE.md`, `.kortext/STACK.md`, `.kortext/STRUCTURE.md`, `.kortext/SECURITY.md`, `.kortext/DATABASE.md`, `.kortext/API.md`, `.kortext/ENVIRONMENT.md`, `.kortext/DESIGN.md`, `.kortext/LEGAL.md`
|
|
92
|
+
- outputs: `.kortext/ENGINEERING.md`
|
|
93
|
+
- approver: +prime
|
|
94
|
+
|
|
95
|
+
2. **+qa-engineer:** Produce `TEST.md`. Test types, critical user flows, automation coverage, manual QA, acceptance criteria, release quality gates. The gates prove the obligations `LEGAL.md` states and the risks `ENGINEERING.md` registers, not only that features work.
|
|
96
|
+
- inputs: `.kortext/PRODUCT.md`, `.kortext/ENGINEERING.md`, `.kortext/LEGAL.md`
|
|
97
|
+
- outputs: `.kortext/TEST.md`
|
|
98
|
+
- approver: +prime
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Planning Pipeline — "Transfer to Kopeng" (splitting the work into tasks)
|
|
2
|
+
|
|
3
|
+
> Runs only when +prime presses the **"Transfer to Kopeng"** button in the panel. Produces
|
|
4
|
+
> the Version → Epic → Task structure from the approved analysis documents and puts the
|
|
5
|
+
> files Kopeng will read under `.kopeng/`. This is the final step of the handshake.
|
|
6
|
+
|
|
7
|
+
## Inputs
|
|
8
|
+
|
|
9
|
+
Approved documents: `.kortext/PRODUCT.md`, `.kortext/ENGINEERING.md`,
|
|
10
|
+
`.kortext/ARCHITECTURE.md`, `.kortext/STACK.md`, `.kortext/SECURITY.md`,
|
|
11
|
+
`.kortext/DATABASE.md`, `.kortext/API.md`, `.kortext/DESIGN.md`, `.kortext/GROWTH.md`,
|
|
12
|
+
`.kortext/LEGAL.md`, `.kortext/CONTENT.md`, `.kortext/TEST.md`
|
|
13
|
+
(skip the ones marked not-applicable).
|
|
14
|
+
|
|
15
|
+
## Output — `.kopeng/` file layout (DRAFT contract; Kopeng conforms to this format)
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
.kopeng/
|
|
19
|
+
├── project.yaml # name, code, status: draft, created
|
|
20
|
+
├── versions/
|
|
21
|
+
│ └── v0.1.yaml # id, name, description, epics: [ACME-E01, …]
|
|
22
|
+
├── epics/
|
|
23
|
+
│ └── ACME-E01.yaml # id, name, version, description, tasks: [ACME-T001, …]
|
|
24
|
+
└── tasks/
|
|
25
|
+
└── ACME-T001.md # frontmatter + body (below)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Task file** (`tasks/<ID>.md`) — frontmatter:
|
|
29
|
+
`id`, `name`, `epic` (optional — a task may have no epic), `assignee` (`ai` | `prime`),
|
|
30
|
+
`blocked_by: []` (always write it; empty list if none), `blocks: []`.
|
|
31
|
+
Body headings (all required; write "—" where one does not apply):
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
## Description
|
|
35
|
+
## Functional Requirements
|
|
36
|
+
## User Flow
|
|
37
|
+
## UI Requirements
|
|
38
|
+
## Technical Notes
|
|
39
|
+
## Acceptance Criteria
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Rules
|
|
43
|
+
|
|
44
|
+
1. **ID convention:** project code as prefix — `<CODE>-E01` (epic), `<CODE>-T001` (task).
|
|
45
|
+
Slug/kebab-case ids are FORBIDDEN.
|
|
46
|
+
2. **Scope ceiling:** if PRODUCT.md or BRIEF.md sets an item limit or an "MVP/small" note, do NOT
|
|
47
|
+
exceed it; when in doubt, fewer, larger tasks. One feature = one task; do NOT split it
|
|
48
|
+
into frontend/backend/test.
|
|
49
|
+
3. **Few versions:** 1–3 versions for an MVP; every epic belongs to a version; tasks do not
|
|
50
|
+
have to belong to an epic (an independent task is not written to the version root — it
|
|
51
|
+
stays epic-less).
|
|
52
|
+
4. **+prime prerequisites (MANDATORY):** scan STACK/SECURITY/LEGAL/API; produce every need
|
|
53
|
+
that requires human action (opening an account, API key, domain, device, budget approval)
|
|
54
|
+
as an `assignee: prime` task and add it to the `blocked_by` of the tasks that depend on it.
|
|
55
|
+
5. **Dependencies:** encode the real ordering constraints with `blocked_by`; leave no
|
|
56
|
+
dangling ids; keep the `blocks` field consistent in the reverse direction.
|
|
57
|
+
6. **Acceptance Criteria** must align with TEST.md's quality bar and be behavior-focused
|
|
58
|
+
and verifiable.
|
|
59
|
+
7. **Self-check (before finishing):** does every file conform to the schema; are every
|
|
60
|
+
epic's `version` and listed `tasks` real; are every task's frontmatter fields complete;
|
|
61
|
+
are the ids on convention; is `project.yaml` at `status: draft`. Fix any problem you find.
|