koboyo 0.3.0 → 0.4.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.
Files changed (204) hide show
  1. package/assets/editor/assets/DialogDescription-Ddhk2rmF.js +1 -0
  2. package/assets/editor/assets/DialogRoot-DUeVfNhS.js +1 -0
  3. package/assets/editor/assets/DialogTitle-D5au2NAn.js +1 -0
  4. package/assets/editor/assets/FloatingPortalLite-HnWQWrLk.js +1 -0
  5. package/assets/editor/assets/{IconAlertTriangle-CxPhYpe-.js → IconAlertTriangle-B33xznYN.js} +1 -1
  6. package/assets/editor/assets/{IconArrowLeft-DFk3Krim.js → IconArrowLeft-B4Zcy-Fc.js} +1 -1
  7. package/assets/editor/assets/IconChevronLeft-D7e7QC0h.js +1 -0
  8. package/assets/editor/assets/IconChevronRight-csfMBSUs.js +1 -0
  9. package/assets/editor/assets/{IconCode-hd05zxU4.js → IconCode-CHIz1nCU.js} +1 -1
  10. package/assets/editor/assets/IconCornerDownRight-DDiBMO4O.js +1 -0
  11. package/assets/editor/assets/{IconEraser-DlZQe3-r.js → IconEraser-CYfXj27R.js} +1 -1
  12. package/assets/editor/assets/{IconFocusCentered-C5PcDeR0.js → IconFocusCentered-Cn8rbfRI.js} +1 -1
  13. package/assets/editor/assets/IconHelp-CaEwHrsN.js +2 -0
  14. package/assets/editor/assets/{IconLink-ze4g4Lrj.js → IconLink-VS5p9Ytk.js} +1 -1
  15. package/assets/editor/assets/IconLoader2-CzCTn-Sn.js +1 -0
  16. package/assets/editor/assets/IconMinus-BcaDLts8.js +1 -0
  17. package/assets/editor/assets/{IconMoodSmile-Bic_fw54.js → IconMoodSmile-CSZ5p_Hy.js} +1 -1
  18. package/assets/editor/assets/{IconPencil-C5Y-Y4dC.js → IconPencil-D_pQsAyv.js} +1 -1
  19. package/assets/editor/assets/{IconPhoto-CR36IK-b.js → IconPhoto-5zuCDtnR.js} +1 -1
  20. package/assets/editor/assets/{IconPlayerPlayFilled-D4OODBX7.js → IconPlayerPlayFilled-DVAWmYt7.js} +1 -1
  21. package/assets/editor/assets/{IconPlayerStopFilled-BUbX6ZO5.js → IconPlayerStopFilled-D4qdct2R.js} +1 -1
  22. package/assets/editor/assets/IconPlus-D4tAoi-A.js +1 -0
  23. package/assets/editor/assets/{IconPresentation-DCrY3PKL.js → IconPresentation-BMKzt7fv.js} +1 -1
  24. package/assets/editor/assets/{IconSearch-C1K0_Pq_.js → IconSearch-CCpMt02s.js} +1 -1
  25. package/assets/editor/assets/{IconSparkles-WDcg8BA9.js → IconSparkles-CnCp3BCQ.js} +1 -1
  26. package/assets/editor/assets/{IconTrash-DbN_RxB7.js → IconTrash-C8w6ThWx.js} +1 -1
  27. package/assets/editor/assets/{IconUsers-Bwnyj4mm.js → IconUsers-Dp85N225.js} +1 -1
  28. package/assets/editor/assets/IconX-KrRqxr2j.js +1 -0
  29. package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +1 -0
  30. package/assets/editor/assets/PopoverPopup-B3Y0VRYc.js +1 -0
  31. package/assets/editor/assets/{asset-glyph-B3c--Mx2.js → asset-glyph-C1E6cGwM.js} +1 -1
  32. package/assets/editor/assets/billing-BSXr-z2r.js +1 -0
  33. package/assets/editor/assets/build-pips-BV-uwXlP.js +1 -0
  34. package/assets/editor/assets/build-visibility-DyML9SHt.js +1 -0
  35. package/assets/editor/assets/builders-DMHAOPEv.js +1 -0
  36. package/assets/editor/assets/{chart-Z4HQx-0h.js → chart-4iRduYdU.js} +4 -4
  37. package/assets/editor/assets/{chrome-layout-B8YmHznO.js → chrome-layout-BzPU9far.js} +1 -1
  38. package/assets/editor/assets/{code-panel-BfsykjSz.js → code-panel-koBUgEWp.js} +7 -7
  39. package/assets/editor/assets/command-palette-BR-_ChOL.js +1 -0
  40. package/assets/editor/assets/config-D8b1QyEk.js +1 -0
  41. package/assets/editor/assets/connector-labels-CrEgadsC.js +2 -0
  42. package/assets/editor/assets/copy-image-dialog-BzGP7Xw8.js +1 -0
  43. package/assets/editor/assets/{core-CBnmD9hT.js → core-CmsJyU_-.js} +1 -1
  44. package/assets/editor/assets/createReactComponent-C51FAx3B.js +1 -0
  45. package/assets/editor/assets/{diagram-fingerprint-CsqZK4xZ.js → diagram-fingerprint-WGQ5iVXx.js} +1 -1
  46. package/assets/editor/assets/dialog-DnXgEbpz.js +1 -0
  47. package/assets/editor/assets/{edit-BJ_kibk8.js → edit-C0sBxxsg.js} +1 -1
  48. package/assets/editor/assets/editor-BeufBV54.js +1 -0
  49. package/assets/editor/assets/{elk-api-DnfklSaw.js → elk-api-C4wlHVIw.js} +1 -1
  50. package/assets/editor/assets/{elk-worker-loader-CC-I9MmI.js → elk-worker-loader-CVBdN1je.js} +1 -1
  51. package/assets/editor/assets/{export-ChP0k5F5.js → export-Bce6ra0N.js} +1 -1
  52. package/assets/editor/assets/export-K2VWg76n.js +6 -0
  53. package/assets/editor/assets/export-dialog-x2n2a4KX.js +1 -0
  54. package/assets/editor/assets/flow-layer-ewaL7g2y.js +1 -0
  55. package/assets/editor/assets/flow-panel-BzXNGGke.js +1 -0
  56. package/assets/editor/assets/flow-stage-Ba_CAggI.js +1 -0
  57. package/assets/editor/assets/{flow-start-BKN48uke.js → flow-start-CpAvU-9P.js} +1 -1
  58. package/assets/editor/assets/{flows-GGbkNqs8.js → flows-Cj7AFMIA.js} +2 -2
  59. package/assets/editor/assets/frames-Cp1QD3LR.js +1 -0
  60. package/assets/editor/assets/icon-picker-Cg39IKNJ.js +1 -0
  61. package/assets/editor/assets/image-library-JQu_tb8P.js +1 -0
  62. package/assets/editor/assets/index-CBPPqsiR.js +24 -0
  63. package/assets/editor/assets/{index-e23lIFZB.css → index-DBrN0u0i.css} +1 -1
  64. package/assets/editor/assets/jsx-runtime-DKdBMi_L.js +1 -0
  65. package/assets/editor/assets/layout-offthread-mRHRulkS.js +18 -0
  66. package/assets/editor/assets/{layout.worker-BIE1_z0S.js → layout.worker-CekYkaxO.js} +2 -2
  67. package/assets/editor/assets/menu-B9BAk63v.js +1 -0
  68. package/assets/editor/assets/panel-controls-DWVXiNUZ.js +1 -0
  69. package/assets/editor/assets/{panel-shell-CG2aq4Ia.js → panel-shell-BnMOHgWM.js} +1 -1
  70. package/assets/editor/assets/{plan-jQm1jDpt.js → plan-CkgM52Yh.js} +1 -1
  71. package/assets/editor/assets/presentation-DJUO0t7I.js +1 -0
  72. package/assets/editor/assets/presenter-keys-Bs3LnmOa.js +1 -0
  73. package/assets/editor/assets/{jsx-runtime-2Zwg-L3c.js → react-lCSYwAWP.js} +1 -1
  74. package/assets/editor/assets/reflow-DaYiVkwp.js +1 -0
  75. package/assets/editor/assets/registry-rEGZW7Ab.js +1 -0
  76. package/assets/editor/assets/renderer-environment-D3n3hbug.js +1 -0
  77. package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +1 -0
  78. package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +1 -0
  79. package/assets/editor/assets/shape-meta-COE2ATNh.js +1 -0
  80. package/assets/editor/assets/sign-in-dialog-tmQEB2bx.js +1 -0
  81. package/assets/editor/assets/slide-notes-dialog-BQBXpep6.js +1 -0
  82. package/assets/editor/assets/slides-D686obFO.js +15 -0
  83. package/assets/editor/assets/slides-panel-BEJCevJi.js +26 -0
  84. package/assets/editor/assets/text-breaks-DM4W6y5f.js +7 -0
  85. package/assets/editor/assets/{theme-palette-D1nbDFBC.js → theme-palette-Dl_G_VIJ.js} +1 -1
  86. package/assets/editor/assets/tidy-browser-dF3BON7J.js +1 -0
  87. package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +1 -0
  88. package/assets/editor/assets/toast-Czv_DJ-4.js +1 -0
  89. package/assets/editor/assets/{tool-catalog-CHq6TJ2q.js → tool-catalog-DXPhX2S1.js} +1 -1
  90. package/assets/editor/assets/tool-drawer-CWOX_njp.js +1 -0
  91. package/assets/editor/assets/tooltip-CyBz17g8.js +1 -0
  92. package/assets/editor/assets/{tree-BbSzMkPL.js → tree-KSgPjntC.js} +1 -1
  93. package/assets/editor/assets/upgrade-dialog-DhSZnDpx.js +1 -0
  94. package/assets/editor/assets/use-drag-reorder-ye8-kpyR.js +1 -0
  95. package/assets/editor/assets/use-export-command-sC9UHj3_.js +2 -0
  96. package/assets/editor/assets/use-grid-keyboard-nav-DhQKecO1.js +0 -0
  97. package/assets/editor/assets/use-icon-node-BxqH7H27.js +1 -0
  98. package/assets/editor/assets/use-key-held-094C3Mn3.js +1 -0
  99. package/assets/editor/assets/use-recent-list-DuazDypH.js +1 -0
  100. package/assets/editor/assets/useAnchoredPopupScrollLock-i8D5Dm1d.js +1 -0
  101. package/assets/editor/assets/useBaseUiId-D2RfU0uY.js +1 -0
  102. package/assets/editor/assets/useButton-CLQYGhRJ.js +1 -0
  103. package/assets/editor/assets/useControlled-BE8zdmih.js +1 -0
  104. package/assets/editor/assets/usePositioner-AtbrPc7w.js +1 -0
  105. package/assets/editor/assets/useScrollLock-CQpr0n6U.js +1 -0
  106. package/assets/editor/assets/useValueChanged-SqLfIDi5.js +1 -0
  107. package/assets/editor/assets/web-controls-CLE9zr7i.js +1 -0
  108. package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +1 -0
  109. package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +1 -0
  110. package/assets/editor/assets/web-shape-C941TGTy.js +1 -0
  111. package/assets/editor/assets/widget-source-CHujvUeA.js +1 -0
  112. package/assets/editor/index.html +73 -69
  113. package/dist/koboyo.js +257 -215
  114. package/package.json +5 -5
  115. package/skills/koboyo/SKILL.md +22 -2
  116. package/skills/koboyo/references/architecture.md +1 -1
  117. package/skills/koboyo/references/bpmn.md +1 -1
  118. package/skills/koboyo/references/chart.md +1 -1
  119. package/skills/koboyo/references/cycle.md +1 -1
  120. package/skills/koboyo/references/erd.md +1 -1
  121. package/skills/koboyo/references/flowchart.md +1 -1
  122. package/skills/koboyo/references/funnel.md +1 -1
  123. package/skills/koboyo/references/gantt.md +1 -1
  124. package/skills/koboyo/references/gitgraph.md +1 -1
  125. package/skills/koboyo/references/journey.md +1 -1
  126. package/skills/koboyo/references/matrix.md +1 -1
  127. package/skills/koboyo/references/mindmap.md +1 -1
  128. package/skills/koboyo/references/orgchart.md +1 -1
  129. package/skills/koboyo/references/pyramid.md +1 -1
  130. package/skills/koboyo/references/sankey.md +1 -1
  131. package/skills/koboyo/references/sequence.md +1 -1
  132. package/skills/koboyo/references/statemachine.md +1 -1
  133. package/skills/koboyo/references/timeline.md +1 -1
  134. package/skills/koboyo/references/venn.md +1 -1
  135. package/skills/koboyo/references/wireframe.md +1 -1
  136. package/assets/editor/assets/DialogDescription-ZtZCUsfy.js +0 -1
  137. package/assets/editor/assets/DialogRoot-mHGRFW9m.js +0 -1
  138. package/assets/editor/assets/DialogTitle-CFhr-gP9.js +0 -1
  139. package/assets/editor/assets/FloatingPortalLite-Bf0q6fmL.js +0 -1
  140. package/assets/editor/assets/IconChevronLeft-BR0iwdRI.js +0 -1
  141. package/assets/editor/assets/IconChevronRight-DBDnxPYT.js +0 -1
  142. package/assets/editor/assets/IconCornerDownRight-BerbioFY.js +0 -1
  143. package/assets/editor/assets/IconHelp-DKNacRqS.js +0 -2
  144. package/assets/editor/assets/IconLoader2-BQaF1LKo.js +0 -1
  145. package/assets/editor/assets/IconMinus-y4ejub-s.js +0 -1
  146. package/assets/editor/assets/IconPlus-BbmieIBT.js +0 -1
  147. package/assets/editor/assets/IconX-AlbPkO_g.js +0 -1
  148. package/assets/editor/assets/MenuSubmenuTrigger-CpN67g09.js +0 -1
  149. package/assets/editor/assets/PopoverPopup-BqGWd_uB.js +0 -1
  150. package/assets/editor/assets/billing-C-BNGM3Z.js +0 -1
  151. package/assets/editor/assets/build-pips-q_Fq10ov.js +0 -1
  152. package/assets/editor/assets/build-visibility-E1mHeDCW.js +0 -1
  153. package/assets/editor/assets/builders-DbF28yId.js +0 -1
  154. package/assets/editor/assets/command-palette-BjFnQHnz.js +0 -1
  155. package/assets/editor/assets/config-a_lz-57R.js +0 -1
  156. package/assets/editor/assets/connector-labels-vVnYQJRz.js +0 -2
  157. package/assets/editor/assets/copy-image-dialog-CCY_6fM4.js +0 -1
  158. package/assets/editor/assets/createReactComponent-9UsI5fmM.js +0 -1
  159. package/assets/editor/assets/dialog-B32krrce.js +0 -1
  160. package/assets/editor/assets/editor-B0tARd79.js +0 -1
  161. package/assets/editor/assets/export-DEFKKRRi.js +0 -6
  162. package/assets/editor/assets/export-dialog-DPg1uzX5.js +0 -1
  163. package/assets/editor/assets/flow-layer-B7mlx0G4.js +0 -1
  164. package/assets/editor/assets/flow-panel-DoK6VIJ4.js +0 -1
  165. package/assets/editor/assets/flow-stage-fiF5Nggn.js +0 -1
  166. package/assets/editor/assets/frames-CRP8oPP8.js +0 -1
  167. package/assets/editor/assets/icon-picker-NboB5Fvv.js +0 -1
  168. package/assets/editor/assets/image-library-Bb6bV6eK.js +0 -1
  169. package/assets/editor/assets/index-mhi0Z6gG.js +0 -24
  170. package/assets/editor/assets/layout-offthread-BwetpTFH.js +0 -18
  171. package/assets/editor/assets/menu-BPrc8Ara.js +0 -1
  172. package/assets/editor/assets/panel-controls-DYZ7QFT5.js +0 -1
  173. package/assets/editor/assets/presentation-BavfNtxp.js +0 -1
  174. package/assets/editor/assets/presenter-keys-DVQcBdy1.js +0 -1
  175. package/assets/editor/assets/reflow-Cv75wPSh.js +0 -1
  176. package/assets/editor/assets/registry-DCgwH8wI.js +0 -1
  177. package/assets/editor/assets/renderer-environment-DmWXvuT4.js +0 -1
  178. package/assets/editor/assets/ride-overlay-DhygYdx1.js +0 -1
  179. package/assets/editor/assets/selection-overlay-primitives-hWJ1xjF7.js +0 -1
  180. package/assets/editor/assets/shape-meta-BpwsiB82.js +0 -1
  181. package/assets/editor/assets/sign-in-dialog-DRooo5xw.js +0 -1
  182. package/assets/editor/assets/slide-notes-dialog-DLdTmd7_.js +0 -1
  183. package/assets/editor/assets/slides-D9bnXqtf.js +0 -15
  184. package/assets/editor/assets/slides-panel-hozTMSMk.js +0 -26
  185. package/assets/editor/assets/text-breaks-YU-ymaF9.js +0 -7
  186. package/assets/editor/assets/tidy-browser-BwodBnAH.js +0 -1
  187. package/assets/editor/assets/tidy-scope-BgBSUklT.js +0 -1
  188. package/assets/editor/assets/toast-Nu_fiCd9.js +0 -1
  189. package/assets/editor/assets/tool-drawer-DEEqsKSN.js +0 -1
  190. package/assets/editor/assets/tooltip-DgEojto1.js +0 -1
  191. package/assets/editor/assets/upgrade-dialog-DpZeaLDB.js +0 -1
  192. package/assets/editor/assets/use-drag-reorder-CTTvTwza.js +0 -1
  193. package/assets/editor/assets/use-export-command-CPc7qug1.js +0 -2
  194. package/assets/editor/assets/use-grid-keyboard-nav-B88Qw-cQ.js +0 -0
  195. package/assets/editor/assets/use-icon-node-DJZFjABX.js +0 -1
  196. package/assets/editor/assets/use-key-held-38H1v73f.js +0 -1
  197. package/assets/editor/assets/use-recent-list-BEG0iBIm.js +0 -1
  198. package/assets/editor/assets/useAnchoredPopupScrollLock-BGKchwpi.js +0 -1
  199. package/assets/editor/assets/useBaseUiId-C0Zm5sUV.js +0 -1
  200. package/assets/editor/assets/useButton-D3eS7fh5.js +0 -1
  201. package/assets/editor/assets/useControlled-C5xhvPXX.js +0 -1
  202. package/assets/editor/assets/usePositioner-DA3aR0-T.js +0 -1
  203. package/assets/editor/assets/useScrollLock-B7mQdXyv.js +0 -1
  204. package/assets/editor/assets/useValueChanged-p8z-93L4.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koboyo",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Render Koboyo diagram code to SVG and PNG on your own machine. No account needed.",
5
5
  "keywords": [
6
6
  "koboyo",
@@ -50,12 +50,12 @@
50
50
  "vitest": "^4.1.10",
51
51
  "zod": "^4.4.3",
52
52
  "@koboyo/agent-tools": "0.0.0",
53
- "@koboyo/compiler": "0.0.0",
54
53
  "@koboyo/language": "0.0.0",
55
- "@koboyo/model": "0.0.0",
54
+ "@koboyo/compiler": "0.0.0",
55
+ "@koboyo/local-editor": "0.0.0",
56
56
  "@koboyo/headless": "0.0.0",
57
- "@koboyo/renderer": "0.0.0",
58
- "@koboyo/local-editor": "0.0.0"
57
+ "@koboyo/model": "0.0.0",
58
+ "@koboyo/renderer": "0.0.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "node --import tsx scripts/build.mjs",
@@ -3,7 +3,7 @@ name: koboyo
3
3
  description: "Draw diagrams as code and render them to SVG, PNG or HTML on this machine with the koboyo CLI: architecture and dependency maps, flowcharts, sequence diagrams, ERDs and class diagrams, state machines, mind maps, gantt charts, timelines and more. Use when the user asks to draw, diagram, visualize, map or explain a system, a codebase, a request flow, a data model or a process, or wants a picture for docs or a README; and to let the user edit a diagram by hand in a local editor and read their edits back."
4
4
  ---
5
5
 
6
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
6
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
7
7
 
8
8
  # Koboyo diagrams
9
9
 
@@ -127,13 +127,33 @@ once (the message is shown to the person); `wait_for_edits({ sessionId, timeoutS
127
127
  returns the result above plus the PNG, or status "waiting" when the person isn't done yet, so
128
128
  call it again with the same sessionId;
129
129
  `read_drawing({ path })` reads the board as it is now, without waiting. Both list the open
130
- comments; `reply_to_comment({ path, commentId, text, resolve })` answers one.
130
+ comments; `reply_to_comment({ path, commentId, text, resolve })` answers one, and
131
+ `add_comment({ path, text, on | image | at })` pins a new one: on a shape (id or label), on
132
+ a measured pixel of an image (`image: { imageId, x, y }`), or on a board point.
131
133
 
132
134
  The server also draws on boards directly, with the hosted server's board tools taking a
133
135
  `path` to a `.kby`: `create_diagram`, `read_canvas`, `draw_shapes`, `update_shapes`,
134
136
  `connect_shapes`, `add_flow` and the rest. While the board is open in the editor, the
135
137
  person watches each change land.
136
138
 
139
+ A diagram shows structure; some things are better shown working. With the MCP server
140
+ connected, put them on a board beside the diagrams:
141
+
142
+ - `add_html({ path, title, width, height, html })`: a live HTML widget for a UI mockup, a
143
+ small interactive prototype or a little dashboard the person can click through. Write one
144
+ self-contained document: inline CSS and JS, data inlined as literals, no network (fetch,
145
+ XHR and WebSocket are blocked). Tailwind's CDN (`https://cdn.tailwindcss.com`) works;
146
+ other scripts only from cdn.jsdelivr.net, unpkg.com, cdnjs.cloudflare.com or esm.sh. Size
147
+ it to its content, at most 128 KB. The answer lists anything that will not work.
148
+ - `edit_html({ path, id, edits: [{ find, replace }] })` revises it: each `find` is an exact
149
+ snippet that appears once. Do this rather than resending the whole page or adding a
150
+ second copy; `read_html({ path, id })` shows the current source.
151
+ - `add_embed({ path, url })`: a video (YouTube, Vimeo, Loom), a Figma file, a CodePen or
152
+ CodeSandbox, a map, or any https page the person wants to see in place.
153
+
154
+ Systems, flows, sequences and data models stay diagrams: HTML is for what a diagram cannot
155
+ show. Open the board in the editor so the person can use the widget and comment on it.
156
+
137
157
  To get the person's feedback on something visual you built — a page, a screen, a chart:
138
158
 
139
159
  1. Take a screenshot with your browser tool and save it in the project.
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Architecture diagrams
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # BPMN and swimlanes
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Charts
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Infographics: timelines, journeys, cycles, funnels, pyramids, venn, matrix
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Entity-relationship diagrams
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Flowcharts
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Infographics: timelines, journeys, cycles, funnels, pyramids, venn, matrix
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Gantt charts as code
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Git graphs as code
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Infographics: timelines, journeys, cycles, funnels, pyramids, venn, matrix
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Infographics: timelines, journeys, cycles, funnels, pyramids, venn, matrix
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Mind maps
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Org charts
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Infographics: timelines, journeys, cycles, funnels, pyramids, venn, matrix
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Sankey diagrams as code
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Sequence diagrams
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # State machines
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Infographics: timelines, journeys, cycles, funnels, pyramids, venn, matrix
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Infographics: timelines, journeys, cycles, funnels, pyramids, venn, matrix
4
4
 
@@ -1,4 +1,4 @@
1
- <!-- Generated by koboyo 0.3.0. `koboyo setup` rewrites this file. -->
1
+ <!-- Generated by koboyo 0.4.0. `koboyo setup` rewrites this file. -->
2
2
 
3
3
  # Wireframes
4
4
 
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{ht as n}from"./useScrollLock-B7mQdXyv.js";import{t as r}from"./useBaseUiId-C0Zm5sUV.js";import{o as i}from"./DialogRoot-mHGRFW9m.js";var a=e(t(),1).forwardRef(function(e,t){let{render:a,className:o,style:s,id:c,...l}=e,{store:u}=i(),d=r(c);return u.useSyncedValueWithCleanup(`descriptionElementId`,d),n(`p`,e,{ref:t,props:[{id:d},l]})});export{a as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{A as r,An as i,C as a,Cn as o,Gt as s,R as c,S as l,Tn as u,U as d,Wt as f,Y as p,_ as m,b as h,d as g,dt as _,f as v,g as y,ht as b,i as x,j as S,jn as C,k as w,l as T,mt as E,n as D,o as O,p as k,pt as A,r as j,t as M,u as N,v as P,x as F}from"./useScrollLock-B7mQdXyv.js";var I=n(),L=e(t(),1);function R(e){let{store:t,actionsRef:n}=e,r=t.useState(`open`);l(t,r),P(t);let{forceUnmount:i}=h(r,t),a=L.useCallback(()=>{t.setOpen(!1,d(p))},[t]);L.useImperativeHandle(n,()=>({unmount:i,close:a}),[i,a])}function z({store:e,parentContext:t,isDrawer:n}){let i=e.useState(`open`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[d,p]=L.useState(0),[m,h]=L.useState(0),g=d===0,_=r(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0||`touches`in t&&t.touches.length!==1)return!1;let n=s(t);return g&&!a?o&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===n||e.context.backdropRef.current===n||f(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0:!1},escapeKey:g});return M(i&&o===!0,c),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{p(e),h(t)}),e.useContextCallback(`onNestedDialogClose`,()=>{p(0),h(0)}),L.useEffect(()=>(t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(d+1,m+ +!!n),t?.onNestedDialogClose&&!i&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&i&&t.onNestedDialogClose()}),[n,i,d,m,t]),F(e,{activeTriggerProps:_.reference??u,inactiveTriggerProps:_.trigger??u,popupProps:_.floating??u,nestedOpenDialogCount:d,nestedOpenDrawerCount:m}),null}var B=L.createContext(!1),V=L.createContext(void 0);function H(e){let t=L.useContext(V);if(e===!1&&t===void 0)throw Error(C(27));return t}var U={...g,modal:i(e=>e.modal),nested:i(e=>e.nested),nestedOpenDialogCount:i(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:i(e=>e.nestedOpenDrawerCount),disablePointerDismissal:i(e=>e.disablePointerDismissal),openMethod:i(e=>e.openMethod),descriptionElementId:i(e=>e.descriptionElementId),titleElementId:i(e=>e.titleElementId),viewportElement:i(e=>e.viewportElement),role:i(e=>e.role)},W=class e extends o{constructor(e,t,n=!1){let r=new v,i=G(e);i.floatingRootContext=N(r,t,n),super(i,{popupRef:L.createRef(),backdropRef:L.createRef(),internalBackdropRef:L.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},U)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};m(n,e,t.trigger),this.update(n)};static useStore(t,n){return a(t,(t,r)=>new e(n,t,r),!0).store}};function G(e={}){return{...T(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function K(e,t=`dialog`){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=e,p=t===`drawer`,m=t===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=H(!0),y={modal:h,disablePointerDismissal:g,nested:!!v,role:_},b=W.useStore(u?.store,{open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y});w(()=>{let e=r===void 0&&b.state.open===!1&&i===!0?{open:!0,activeTriggerId:f}:null;m?b.update(e?{...y,...e}:y):e&&b.update(e)}),b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);R({store:b,actionsRef:l});let T=x||S,E=L.useMemo(()=>({store:b}),[b]);return(0,I.jsx)(B.Provider,{value:!1,children:(0,I.jsxs)(V.Provider,{value:E,children:[T&&(0,I.jsx)(z,{store:b,parentContext:v?.store.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})})}var q={...O,...A},J=L.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=H(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return b(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:q,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Y=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),X=function(e){return e[e.open=x.open]=`open`,e[e.closed=x.closed]=`closed`,e[e.startingStyle=x.startingStyle]=`startingStyle`,e[e.endingStyle=x.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),Z=L.createContext(void 0);function Q(){let e=L.useContext(Z);if(e===void 0)throw Error(C(26));return e}var $={...O,...A,nestedDialogOpen(e){return e?{[X.nestedDialogOpen]:``}:null}},ee=L.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,{store:c}=H(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),v=c.useState(`open`),x=c.useState(`openMethod`),C=c.useState(`titleElementId`),w=c.useState(`transitionStatus`),T=c.useState(`role`),E=d.useState(`floatingId`),D=s.id??E;Q(),_({open:v,ref:c.context.popupRef,onComplete(){v&&c.context.onOpenChangeComplete?.(!0)}});let O=o===void 0?y(c.context.popupRef):o,A=g>0,M=c.useStateSetter(`popupElement`),N=b(`div`,e,{state:{open:v,nested:h,transitionStatus:w,nestedDialogOpen:A},props:[f,{id:D,"aria-labelledby":C??void 0,"aria-describedby":l??void 0,role:T,...k,hidden:!m,onKeyDown(e){j.has(e.key)&&e.stopPropagation()},style:{[Y.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,M],stateAttributesMapping:$});return(0,I.jsx)(S,{context:d,openInteractionType:x,disabled:!m,closeOnFocusOut:!u,initialFocus:O,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:N})}),te=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=H(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,I.jsx)(Z.Provider,{value:n,children:(0,I.jsxs)(c,{ref:t,...r,children:[a&&o===!0&&(0,I.jsx)(D,{ref:i.context.internalBackdropRef,inert:E(!s)}),e.children]})}):null});function ne(e){return K(e,L.useContext(B)?`drawer`:`dialog`)}export{K as a,J as i,te as n,H as o,ee as r,ne as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{G as n,U as r,ht as i}from"./useScrollLock-B7mQdXyv.js";import{t as a}from"./useButton-D3eS7fh5.js";import{t as o}from"./useBaseUiId-C0Zm5sUV.js";import{o as s}from"./DialogRoot-mHGRFW9m.js";var c=e(t(),1),l=c.forwardRef(function(e,t){let{render:o,className:c,style:l,disabled:u=!1,nativeButton:d=!0,...f}=e,{store:p}=s(),m=p.useState(`open`),{getButtonProps:h,buttonRef:g}=a({disabled:u,native:d}),_={disabled:u};function v(e){m&&p.setOpen(!1,r(n,e.nativeEvent))}return i(`button`,e,{state:_,ref:[t,g],props:[{onClick:v},f,h]})}),u=c.forwardRef(function(e,t){let{render:n,className:r,style:a,id:c,...l}=e,{store:u}=s(),d=o(c);return u.useSyncedValueWithCleanup(`titleElementId`,d),i(`h2`,e,{ref:t,props:[{id:d},l]})});export{l as n,u as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{Fn as r,z as i}from"./useScrollLock-B7mQdXyv.js";var a=e(t(),1),o=e(r(),1),s=n(),c=a.forwardRef(function(e,t){let{children:n,container:r,className:c,render:l,style:u,...d}=e,{portalNode:f,portalSubtree:p}=i({container:r,ref:t,componentProps:e,elementProps:d});return!p&&!f?null:(0,s.jsxs)(a.Fragment,{children:[p,f&&o.createPortal(n,f)]})});export{c as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`chevron-left`,`ChevronLeft`,[[`path`,{d:`M15 6l-6 6l6 6`,key:`svg-0`}]]);export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`chevron-right`,`ChevronRight`,[[`path`,{d:`M9 6l6 6l-6 6`,key:`svg-0`}]]);export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`corner-down-right`,`CornerDownRight`,[[`path`,{d:`M6 6v6a3 3 0 0 0 3 3h10l-4 -4m0 8l4 -4`,key:`svg-0`}]]);export{t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ride-overlay-DhygYdx1.js","assets/rolldown-runtime-aKtaBQYM.js","assets/jsx-runtime-2Zwg-L3c.js","assets/editor-B0tARd79.js","assets/reflow-Cv75wPSh.js","assets/style-BENGW2ZV.js","assets/slides-D9bnXqtf.js","assets/renderer-environment-DmWXvuT4.js","assets/editable-target-BTLnvKNi.js","assets/createReactComponent-9UsI5fmM.js","assets/IconTrash-DbN_RxB7.js","assets/IconArrowLeft-DFk3Krim.js","assets/IconPlayerStopFilled-BUbX6ZO5.js","assets/IconEraser-DlZQe3-r.js","assets/IconFocusCentered-C5PcDeR0.js","assets/IconPencil-C5Y-Y4dC.js","assets/IconX-AlbPkO_g.js","assets/IconPlayerPlayFilled-D4OODBX7.js","assets/storage-CvDRYh5V.js","assets/chrome-C2RCq3SI.js","assets/DialogRoot-mHGRFW9m.js","assets/useScrollLock-B7mQdXyv.js","assets/DialogTitle-CFhr-gP9.js","assets/useButton-D3eS7fh5.js","assets/useBaseUiId-C0Zm5sUV.js","assets/DialogDescription-ZtZCUsfy.js","assets/connector-labels-vVnYQJRz.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{o as r}from"./editor-B0tARd79.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{i as a,n as o,r as s,t as c}from"./lazy-module-DkWvu4va.js";import{t as l}from"./createReactComponent-9UsI5fmM.js";var u=e(t(),1),d={status:`idle`};function f(e,t){switch(t.type){case`activate`:case`retry`:return e.status===`failed`?{status:`idle`}:e;case`load-start`:return e.status===`idle`?{status:`loading`}:e;case`load-resolve`:return e.status===`loading`?{status:`ready`}:e;case`load-reject`:return e.status===`loading`?{status:`failed`}:e;case`load-stale`:return e.status===`loading`||e.status===`failed`?{status:`stale`}:e}}function p(e,t){return t&&e.status===`idle`}function m(e,t,n){return e.status===`ready`?t||n:!1}function h(e,t){return t&&e.status===`loading`}function g(e,t){return t&&e.status===`failed`}function _(e,t){return t&&e.status===`stale`}var v=n(),y=`absolute left-1/2 top-[var(--chrome-top)] -translate-x-1/2 coarse:top-[calc(4.5rem+var(--koboyo-host-inset-top))]`;function b(e){let{children:t}=e;return(0,v.jsx)(`div`,{className:`pointer-events-none flex flex-col items-center gap-2 ${y}`,children:t})}function x(e){let{testId:t,tone:n,children:r,action:i}=e;return(0,v.jsxs)(`div`,{role:n===`error`?`alert`:`status`,"data-testid":t,"data-overlay":!0,className:`z-10 flex min-h-8 max-w-[min(24rem,calc(100vw-9rem))] items-center gap-2 rounded-xl bg-[var(--chrome-popup)] px-3 py-1.5 text-[12px] leading-snug text-[var(--chrome-fg-600)] shadow-md ring-1 ring-[var(--chrome-ring)] ${y}`,children:[(0,v.jsx)(`span`,{className:`min-w-0`,children:r}),i?(0,v.jsx)(`button`,{type:`button`,"data-testid":i.testId,onClick:i.onClick,className:`flex h-6 shrink-0 cursor-pointer items-center rounded-lg px-2 text-[var(--chrome-fg-500)] transition-colors hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`,children:i.label}):null]})}function S(e){o(e.load)}function C(e){let{active:t,retain:n=!1,feature:r,fallback:i,children:o}=e,[l,y]=(0,u.useReducer)(f,d),b=(0,u.useRef)(!1);(0,u.useEffect)(()=>{t&&!b.current&&y({type:`activate`}),b.current=t},[t]);let S=(0,u.useRef)(!0);(0,u.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]);let C=(0,u.useRef)(0),w=p(l,t);if((0,u.useEffect)(()=>{w&&(y({type:`load-start`}),s(r.load).then(()=>{S.current&&y({type:`load-resolve`})},e=>{C.current+=1,S.current&&y({type:`load-reject`}),c(e).then(e=>{e&&S.current&&y({type:`load-stale`})})}))},[w,r]),m(l,t,n)){let e=a(r.load);return e===void 0?null:(0,v.jsx)(v.Fragment,{children:o(r.pick(e))})}return h(l,t)?(0,v.jsx)(v.Fragment,{children:i??null}):_(l,t)?(0,v.jsx)(x,{testId:`lazy-feature-stale`,tone:`error`,action:{label:`Reload`,testId:`lazy-feature-reload`,onClick:()=>window.location.reload()},children:`New version available`}):g(l,t)?(0,v.jsx)(x,{testId:`lazy-feature-error`,tone:`error`,action:{label:`Retry`,testId:`lazy-feature-retry`,onClick:()=>{if(C.current>=2){window.location.reload();return}y({type:`retry`})}},children:`Couldn't load this panel`}):null}var w={load:()=>i(()=>import(`./ride-overlay-DhygYdx1.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])),pick:e=>e.RideOverlay},T={at:null};function E(){let e=r(e=>e.rideMode),t=r(e=>e.presentingIndex!==null);return(0,u.useEffect)(()=>{let e=e=>{T.at={x:e.clientX,y:e.clientY}};return window.addEventListener(`pointermove`,e,{passive:!0}),()=>window.removeEventListener(`pointermove`,e)},[]),(0,v.jsx)(C,{active:e&&!t,feature:w,children:e=>(0,v.jsx)(e,{})})}var D=l(`outline`,`help`,`Help`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M12 17l0 .01`,key:`svg-1`}],[`path`,{d:`M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4`,key:`svg-2`}]]);export{S as a,b as c,C as i,E as n,x as o,T as r,y as s,D as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`loader-2`,`Loader2`,[[`path`,{d:`M12 3a9 9 0 1 0 9 9`,key:`svg-0`}]]);export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`minus`,`Minus`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}]]);export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]);export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`x`,`X`,[[`path`,{d:`M18 6l-12 12`,key:`svg-0`}],[`path`,{d:`M6 6l12 12`,key:`svg-1`}]]);export{t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{T as r,Tn as i,c as a,ht as o,jn as s}from"./useScrollLock-B7mQdXyv.js";import{i as c,r as l}from"./tooltip-DgEojto1.js";import{O as u,S as d,_ as f,d as p,l as m,u as h,x as g,y as _}from"./menu-BPrc8Ara.js";import{t as v}from"./createReactComponent-9UsI5fmM.js";import{t as y}from"./useBaseUiId-C0Zm5sUV.js";var b=v(`outline`,`route`,`Route`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5`,key:`svg-2`}]]),x=e(t(),1),S=n();function C(e){let t=g().store,n=x.useMemo(()=>({parentMenu:t}),[t]);return(0,S.jsx)(h.Provider,{value:n,children:(0,S.jsx)(m,{...e})})}var w=x.forwardRef(function(e,t){let{render:n,className:m,style:h,label:v,id:b,nativeButton:S=!1,openOnHover:C=!0,delay:w=100,closeDelay:T=0,disabled:E=!1,...D}=e,O=f({label:v}),k=d(),{store:A}=g(),j=y(b),M=A.useState(`open`),N=A.useState(`floatingRootContext`),P=A.useState(`floatingTreeRoot`),F=A.useState(`triggerPopupId`,j),I=r(j,A),L=x.useCallback(e=>{let t=I(e);return e!==null&&A.select(`open`)&&A.select(`activeTriggerId`)==null&&A.update({activeTriggerId:j,activeTriggerElement:e,closeDelay:T}),t},[I,T,A,j]),R=x.useRef(null),z=x.useCallback(e=>{R.current=e,A.set(`activeTriggerElement`,e)},[A]),B=p();if(!B?.parentMenu)throw Error(s(37));A.useSyncedValue(`closeDelay`,T);let V=B.parentMenu,H=A.useState(`disabled`),U=V.useState(`disabled`),W=E||H||U,G=V.useState(`itemProps`),K=V.useState(`isActive`,O.index),q=x.useMemo(()=>({type:`submenu-trigger`,setActive(){V.select(`highlightItemOnHover`)&&V.set(`activeIndex`,O.index)}}),[V,O.index]),{getItemProps:J,itemRef:Y}=_({closeOnClick:!1,disabled:W,highlighted:K,id:j,store:A,typingRef:V.context.typingRef,nativeButton:S,itemMetadata:q,nodeId:k?.context.nodeId}),X=c(N,{enabled:A.useState(`hoverEnabled`)&&C&&!W,handleClose:l({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:w,delay:{open:w,close:T},shouldOpen:w>0?()=>V.select(`allowMouseEnter`):void 0,triggerElementRef:R,externalTree:P,isClosing:()=>A.select(`transitionStatus`)===`ending`}),Z=u(N,{enabled:!W,event:`mousedown`,toggle:!C,ignoreMouse:C,stickIfOpen:!1}).reference??i,Q=A.useState(`triggerProps`,!0);return delete Q.id,o(`div`,e,{state:{disabled:W,highlighted:K,open:M},stateAttributesMapping:a,props:[Z,X,Q,G,{"aria-controls":F,tabIndex:M||K?0:-1,onBlur(){K&&V.set(`activeIndex`,null)}},D,J],ref:[t,O.ref,Y,L,z]})});export{C as n,b as r,w as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{A as r,An as i,C as a,Cn as o,Dn as s,F as c,Fn as l,M as u,Mn as d,N as f,P as p,R as m,S as h,Tn as g,U as _,Y as v,_ as y,_n as b,_t as x,b as S,d as C,dt as w,en as T,f as E,ft as D,g as O,h as k,ht as A,j,jn as M,l as N,mt as P,n as F,nt as I,o as L,p as R,pt as z,r as B,u as V,ut as ee,v as H,x as U,y as te}from"./useScrollLock-B7mQdXyv.js";import{i as ne,n as re,o as ie,r as ae,t as oe}from"./usePositioner-DA3aR0-T.js";import{Dr as se,ei as W}from"./slides-D9bnXqtf.js";import{n as ce,t as le}from"./useAnchoredPopupScrollLock-BGKchwpi.js";var G=n(),K=7;function ue(e){let{kind:t,size:n}=e;return(0,G.jsx)(`svg`,{width:n??22,height:n??22,viewBox:`0 0 24 24`,fill:t===`fork-join`?`currentColor`:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:se(t)})})}function de(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`7`,y:`3`,width:`10`,height:`4.6`,rx:`1.4`}),(0,G.jsx)(`path`,{d:`M12 7.6V21`,strokeDasharray:`2 2.6`})]})}function fe(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,G.jsx)(`path`,{d:`M4 9H20`}),(0,G.jsx)(`path`,{d:`M7 12.6H15.5`}),(0,G.jsx)(`path`,{d:`M7 16H12.5`})]})}function pe(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`9.8`,y:`3`,width:`4.4`,height:`18`,rx:`2.2`}),(0,G.jsx)(`rect`,{x:`9.8`,y:`4.5`,width:`4.4`,height:`7.5`,rx:`2.2`,fill:`currentColor`,stroke:`none`})]})}function me(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`3`,y:`3.5`,width:`18`,height:`4`,rx:`1.2`}),(0,G.jsx)(`path`,{d:`M16.5 5l1 1l1 -1`}),(0,G.jsx)(`path`,{d:`M5.5 10.5H15`}),(0,G.jsx)(`path`,{d:`M5.5 13H12`}),(0,G.jsx)(`rect`,{x:`3`,y:`15.5`,width:`18`,height:`4`,rx:`1.2`}),(0,G.jsx)(`path`,{d:`M16.5 16.7l1 0.8l-1 0.8`})]})}function he(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M4 9l-2 3l2 3`}),(0,G.jsx)(`rect`,{x:`7.5`,y:`10.3`,width:`9`,height:`3.4`,rx:`1.7`,fill:`currentColor`,stroke:`none`}),(0,G.jsx)(`path`,{d:`M20 9l2 3l-2 3`})]})}function ge(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`2`,y:`10`,width:`20`,height:`4`,rx:`2`}),(0,G.jsx)(`rect`,{x:`2`,y:`10`,width:`12.5`,height:`4`,rx:`2`,fill:`currentColor`,stroke:`none`})]})}function _e(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,G.jsx)(`path`,{d:`M6 8.5H18`}),(0,G.jsx)(`path`,{d:`M6 11.5H18`}),(0,G.jsx)(`path`,{d:`M6 14.5H13`}),(0,G.jsx)(`path`,{d:`M18.5 15.5l-3 3`}),(0,G.jsx)(`path`,{d:`M18.5 18l-0.8 0.8`})]})}function ve(e){let{size:t,stroke:n}=e,r={x:17.5,y:6.5};return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M 6 18 L ${r.x} ${r.y}`}),(0,G.jsx)(`path`,{d:W(r,-Math.PI/4,K)})]})}function ye(e){let{bend:t,size:n}=e;return(0,G.jsx)(`svg`,{width:n??22,height:n??22,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:t===`elbow`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{d:`M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7`}),(0,G.jsx)(`path`,{d:W({x:21,y:7},0,K)})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{d:`M6 20c0 -6.075 4.925 -11 11 -11h3`}),(0,G.jsx)(`path`,{d:W({x:20,y:9},0,K)})]})})}var be={left:`M4 4v16m3-8h11M7 12l3-3m-3 3l3 3`,center:`M12 4v16m4-8h5m-3-3l-3 3l3 3M8 12H3m3-3l3 3l-3 3`,right:`M20 4v16m-3-8H6m11 0l-3-3m3 3l-3 3`,top:`M20 4H4m8 3v11m0-11l3 3m-3-3l-3 3`,middle:`M4 12h16m-8-4V3M9 6l3 3l3-3m-3 10v5m-3-3l3-3l3 3`,bottom:`M20 20H4m8-3V6m0 11l3-3m-3 3l-3-3`};function xe(e){let{type:t,size:n,stroke:r}=e;return(0,G.jsx)(`svg`,{width:n??16,height:n??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:r??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:be[t]})})}function Se(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M5 3a2 2 0 0 0 -2 2`}),(0,G.jsx)(`path`,{d:`M19 3a2 2 0 0 1 2 2`}),(0,G.jsx)(`path`,{d:`M21 19a2 2 0 0 1 -2 2`}),(0,G.jsx)(`path`,{d:`M5 21a2 2 0 0 1 -2 -2`}),(0,G.jsx)(`path`,{d:`M9 3h1`}),(0,G.jsx)(`path`,{d:`M9 21h1`}),(0,G.jsx)(`path`,{d:`M14 3h1`}),(0,G.jsx)(`path`,{d:`M14 21h1`}),(0,G.jsx)(`path`,{d:`M3 9v1`}),(0,G.jsx)(`path`,{d:`M21 9v1`}),(0,G.jsx)(`path`,{d:`M3 14v1`}),(0,G.jsx)(`path`,{d:`M21 14v1`})]})}function Ce(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`m9 11-6 6v3h9l3-3`}),(0,G.jsx)(`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})]})}function we(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??22,height:t??22,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M12 3 L20.6 9.2 L17.3 19.3 L6.7 19.3 L3.4 9.2 Z`,opacity:.35}),(0,G.jsx)(`path`,{d:`M12 12 L12 3 M12 12 L20.6 9.2 M12 12 L17.3 19.3 M12 12 L6.7 19.3 M12 12 L3.4 9.2`,opacity:.35}),(0,G.jsx)(`path`,{d:`M12 4 L16.8 10.5 L16.1 17.7 L9.7 15.2 L6.3 10.2 Z`})]})}function Te(){return(0,G.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 8 8`,className:`text-gray-400`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:`M1.5 2.75 L4 5.25 L6.5 2.75`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ee(){return(0,G.jsx)(`svg`,{width:`6`,height:`6`,viewBox:`0 0 6 6`,"aria-hidden":!0,className:`absolute bottom-1 right-1 opacity-30`,children:(0,G.jsx)(`path`,{d:`M6 0 V6 H0 Z`,fill:`currentColor`})})}function De(){return(0,G.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,G.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,G.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})}var q=e(t(),1),J=q.createContext(void 0);function Y(e){let t=q.useContext(J);if(t===void 0&&!e)throw Error(M(47));return t}var Oe=e(l(),1);function ke(){return{...N(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Ae={...C,disabled:i(e=>e.disabled),instantType:i(e=>e.instantType),openMethod:i(e=>e.openMethod),openChangeReason:i(e=>e.openChangeReason),modal:i(e=>e.modal),focusManagerModal:i(e=>e.focusManagerModal),stickIfOpen:i(e=>e.stickIfOpen),titleElementId:i(e=>e.titleElementId),descriptionElementId:i(e=>e.descriptionElementId),openOnHover:i(e=>e.openOnHover),closeDelay:i(e=>e.closeDelay),hasViewport:i(e=>e.hasViewport)},je=class e extends o{constructor(e,t,n=!1){let r={...ke(),...e},i=new E;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=V(i,t,n),super(r,{popupRef:q.createRef(),backdropRef:q.createRef(),internalBackdropRef:q.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:q.createRef(),beforeContentFocusGuardRef:q.createRef(),stickIfOpenTimeout:new T,triggerElements:i},Ae)}setOpen=(e,t)=>{let n=t.reason===I,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=k(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};y(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Oe.flushSync(s)):s(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:i}=a(t,(t,r)=>new e(n,t,r));return q.useEffect(()=>i?.disposeEffect(),[i]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function X({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:l,defaultTriggerId:u=null}=e,d=je.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:u,triggerIdProp:l});te(d,n,r,u),d.useControlledProp(`openProp`,n),d.useControlledProp(`triggerIdProp`,l);let f=d.useState(`open`),p=d.useState(`mounted`),m=d.useState(`payload`),g=c()!=null;d.useContextCallback(`onOpenChange`,i),d.useContextCallback(`onOpenChangeComplete`,a),h(d,f),H(d);let{forceUnmount:y}=S(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o,nested:g}),q.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]);let b=q.useCallback(()=>{d.setOpen(!1,_(v))},[d]);q.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:b}),[y,b]);let x=f||p,C=q.useMemo(()=>({store:d}),[d]);return(0,G.jsxs)(J.Provider,{value:C,children:[x&&(0,G.jsx)(Ne,{store:d,modal:o}),typeof t==`function`?t({payload:m}):t]})}function Me(e){return Y(!0)?(0,G.jsx)(X,{props:e}):(0,G.jsx)(f,{children:(0,G.jsx)(X,{props:e})})}function Ne({store:e,modal:t}){let n=r(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return U(e,{activeTriggerProps:n.reference??g,inactiveTriggerProps:n.trigger??g,popupProps:q.useMemo(()=>x(R,n.floating),[n.floating])}),null}var Z=q.createContext(void 0);function Pe(){let e=q.useContext(Z);if(e===void 0)throw Error(M(45));return e}var Fe=q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Y();return i.useState(`mounted`)||n?(0,G.jsx)(Z.Provider,{value:n,children:(0,G.jsx)(m,{ref:t,...r})}):null}),Q=q.createContext(void 0);function Ie(){let e=q.useContext(Q);if(!e)throw Error(M(46));return e}var Le=q.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:f=0,collisionBoundary:m=`clipping-ancestors`,collisionPadding:h=5,arrowPadding:g=5,sticky:_=!1,disableAnchorTracking:v=!1,collisionAvoidance:y=ee,...b}=e,{store:x}=Y(),S=Pe(),C=p(),w=x.useState(`floatingRootContext`),T=x.useState(`mounted`),E=x.useState(`open`),O=x.useState(`openChangeReason`),k=x.useState(`activeTriggerElement`),A=x.useState(`modal`),j=x.useState(`openMethod`),M=x.useState(`positionerElement`),N=x.useState(`instantType`),I=x.useState(`transitionStatus`),L=x.useState(`hasViewport`),R=q.useRef(null),z=D(M,!1,!1),B=ae({anchor:a,floatingRootContext:w,positionMethod:o,mounted:T,side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:g,collisionBoundary:m,collisionPadding:h,sticky:_,disableAnchorTracking:v,keepMounted:S,nodeId:C,collisionAvoidance:y,adaptiveOrigin:L?ne:void 0}),V=w.useState(`domReferenceElement`);d(()=>{let e=V,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){x.set(`instantType`,void 0);let e=new AbortController;return z(()=>{x.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[V,z,x]),le(E&&A===!0&&O!==`trigger-hover`,j===`touch`,M,k);let H=q.useCallback(e=>{x.set(`positionerElement`,e)},[x]),U=oe(e,{open:E,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:N},{styles:B.positionerStyles,transitionStatus:I,props:b,refs:[t,H],hidden:!T,inert:!E});return(0,G.jsxs)(Q.Provider,{value:B,children:[T&&A===!0&&O!==`trigger-hover`&&(0,G.jsx)(F,{ref:x.context.internalBackdropRef,inert:P(!E),cutout:k}),(0,G.jsx)(u,{id:C,children:U})]})}),$=q.createContext(void 0);function Re(){let[e,t]=q.useState(0),n=s(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:q.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function ze(e){let{value:t,children:n}=e;return(0,G.jsx)($.Provider,{value:t,children:n})}function Be(){let e=q.useContext($);d(()=>e?.register(),[e])}var Ve={...L,...z},He=q.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,{store:c}=Y(),l=Ie(),u=ce(!0)!=null,{context:d,hasClosePart:f}=Re(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),T=c.useState(`activeTriggerElement`),E=c.useState(`floatingRootContext`),D=E.useState(`floatingId`),k=c.useState(`disabled`),M=c.useState(`openOnHover`),N=c.useState(`closeDelay`),P=s.id??D;w({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),ie(E,{enabled:M&&!k,closeDelay:N});let F=a===void 0?O(c.context.popupRef):a,I=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,I);let L=q.useCallback(e=>{c.set(`popupElement`,e)},[c]),z=A(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,L],props:[_,{id:P,role:`dialog`,...R,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&B.has(e.key)&&e.stopPropagation()}},re(g),s],stateAttributesMapping:Ve});return(0,G.jsx)(j,{context:E,openInteractionType:m,modal:I,disabled:!S||C===`trigger-hover`,initialFocus:F,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:b(T)?T:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(ze,{value:d,children:z})})});export{_e as C,xe as S,ye as _,Me as a,we as b,ve as c,Ee as d,fe as f,de as g,ue as h,Fe as i,Te as l,Ce as m,Be as n,Y as o,Se as p,Le as r,me as s,He as t,De as u,he as v,pe as x,ge as y};
@@ -1 +0,0 @@
1
- import{t as e}from"./createReactComponent-9UsI5fmM.js";var t=e(`outline`,`folder`,`Folder`,[[`path`,{d:`M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2`,key:`svg-0`}]]),n={free:{id:`free`,label:`Free`,messages:{limit:5,period:`lifetime`},images:{limit:0,period:`lifetime`},canvasLimit:1,folders:!1,embedWatermark:!0},pro:{id:`pro`,label:`Pro`,messages:{limit:50,period:`month`},images:{limit:10,period:`month`},canvasLimit:null,folders:!0,embedWatermark:!1}},r={price:10,messages:50,images:10,expiryDays:365};r.expiryDays*24*60*60*1e3;var i={monthly:{amountCents:999,interval:`month`},yearly:{amountCents:1e4,interval:`year`}};function a(){let e=i.monthly.amountCents*12,t=e-i.yearly.amountCents;return{cents:t,percent:Math.round(t/e*100)}}function o(){return Math.round(i.yearly.amountCents/12)}function s(e,t){return new Intl.NumberFormat(`en-US`,{style:`currency`,currency:t.toUpperCase()}).format(e/100)}var c=`2026-10-15`,l=Date.UTC(2026,9,16);export{n as a,a as c,r as i,t as l,c as n,i as o,s as r,o as s,l as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{a as r,o as i}from"./editor-B0tARd79.js";import{Zt as a,cn as o,i as s}from"./slides-D9bnXqtf.js";import{t as c}from"./IconCornerDownRight-BerbioFY.js";import{_ as l,f as u,h as d,m as f,n as p,o as m,r as h,v as g}from"./plan-jQm1jDpt.js";import{n as _,r as v}from"./edit-BJ_kibk8.js";var y=e(t(),1),b=n(),x=21,S=3;function C(e){let{zoom:t}=e,n=i(e=>e.animateSlideId),C=i(e=>e.shapes),w=i(e=>e.hoveredId),{store:T,history:E,measurement:D}=r(),O=(0,y.useMemo)(()=>{if(n)return s(C).find(e=>e.id===n)},[n,C]),k=(0,y.useMemo)(()=>{if(!O)return[];let e=l(C,O),t=u(C,O),n=h(t),r=t.flatMap((t,r)=>p([t],e).map(e=>({unit:{shapes:e.items.map(e=>e.shape),groupId:e.groupId},rowId:m(e),step:n[r],follows:e.withPrevious}))),i=f(C,O,e).map(e=>({unit:e,rowId:null,step:null,follows:!1})),a=[...r,...i],o=new Map;return a.map(e=>{let t=e.unit.groupId??e.unit.shapes[0].id,n=o.get(t)??0;return o.set(t,n+1),{...e,lane:n}})},[C,O]);if(!O||k.length===0)return null;function A(e,t){let r=T.getState().shapes,i=s(r).find(e=>e.id===n);if(!i)return;let a=l(r,i),o=u(r,i),c=t?v(p(o,a),t):_(o,[e],d(e.shapes[0]));c.length!==0&&(E.beginTransaction(),T.getState().replaceMany(c),E.endTransaction())}function j(e){return{onPointerEnter:()=>T.getState().setHoveredId(e),onPointerLeave:()=>T.getState().setHoveredId(null)}}return(0,b.jsx)(`div`,{"data-testid":`build-pips`,className:`pointer-events-none absolute left-0 top-0`,children:k.map(({unit:e,rowId:n,step:r,follows:i,lane:s})=>{let l=a(e.shapes,D)??o(e.shapes[0],D),u=r!==null,d=e.shapes.some(e=>e.id===w);return(0,b.jsx)(`div`,{className:`absolute`,style:{left:l.x-(S+s*x)/t,top:l.y-S/t},children:(0,b.jsx)(`button`,{type:`button`,"data-testid":u?`build-pip`:`build-pip-add`,"data-follows":u&&i?`true`:void 0,title:u?i?`Plays with click ${r}. Press to remove.`:`Click ${r}. Press to remove.`:`Click to animate this`,style:{transform:`scale(${1/t})`,transformOrigin:`100% 100%`},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),A(e,n)},...j(e.shapes[0].id),className:`pointer-events-auto absolute bottom-0 right-0 flex items-center justify-center rounded-md text-[11px] leading-none tabular-nums ring-1 transition-[opacity,background-color,color] ${u?`h-[18px] min-w-[18px] bg-[var(--chrome-accent)] px-1 text-white ring-[var(--chrome-accent)]`:`h-[15px] w-[15px] bg-[var(--chrome-popup)] text-[var(--chrome-fg-500)] ring-[var(--chrome-ring)] hover:text-[var(--chrome-fg-900)] ${d?`opacity-100`:`opacity-45 hover:opacity-100`}`}`,children:u?i?(0,b.jsx)(c,{size:11,stroke:2.25}):r:`+`})},n??g(e))})})}export{C as BuildPips};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{o as r}from"./editor-B0tARd79.js";import{G as i,W as a}from"./style-BENGW2ZV.js";import{an as o}from"./slides-D9bnXqtf.js";import{n as s,r as c}from"./dom-PAoZruqo.js";import{t as l}from"./createReactComponent-9UsI5fmM.js";import{n as ee}from"./shape-meta-BpwsiB82.js";var u=l(`outline`,`notes`,`Notes`,[[`path`,{d:`M5 5a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -14`,key:`svg-0`}],[`path`,{d:`M9 7l6 0`,key:`svg-1`}],[`path`,{d:`M9 11l6 0`,key:`svg-2`}],[`path`,{d:`M9 15l4 0`,key:`svg-3`}]]),d=e(t(),1),f=`cubic-bezier(0.22, 0.61, 0.36, 1)`;function p(e){return{duration:e.duration,delay:e.delay,easing:f,fill:`backwards`}}var te=.75;function ne(e,t){let n,r;try{n=e.getPointAtLength(0),r=e.getPointAtLength(e.getTotalLength())}catch{return!0}return t===`right`?r.x>=n.x:t===`left`?r.x<=n.x:t===`down`?r.y>=n.y:r.y<=n.y}function m(e,t,n){let r=e.matches(`path`)?[e]:Array.from(e.querySelectorAll(`path`)),i=[],a=[];for(let e of r){let t=h(e);if(t===null){a.push(e);continue}i.push({path:e,length:t})}if(i.length===0)return n(e,t);let o=t.direction===void 0||ne(i[0].path,t.direction),s=Math.round(t.duration*te),c=i.map(({path:e,length:n})=>({element:e,keyframes:[{strokeDasharray:`${n}`,strokeDashoffset:`${o?n:-n}`},{strokeDasharray:`${n}`,strokeDashoffset:`0`}],timing:{...p(t),duration:s,easing:`linear`}})),l=o?t.delay+s:t.delay;for(let e of a)c.push({element:e,keyframes:[{opacity:0},{opacity:1}],timing:{...p(t),delay:l,duration:Math.max(80,t.duration-s)}});return c}function h(e){let t=getComputedStyle(e);if(t.stroke===`none`||t.stroke===``||parseFloat(t.strokeWidth)===0)return null;let n=0;try{n=e.getTotalLength()}catch{return null}return n>0?n:null}function g(e,t){let n=y(e);if(n.length===0)return[];let r=n[0],i=[{offset:0,clipPath:b(r.left,r.top,r.bottom),easing:_}];return n.forEach((e,t)=>{let r=t===n.length-1;i.push({offset:(t+1)/n.length,clipPath:b(e.caret,e.top,r?100:e.bottom),easing:_})}),[{element:e,keyframes:i,timing:{...p(t),easing:`linear`}}]}var _=`steps(1, end)`,v=240;function y(e){let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)return[];let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=document.createRange(),i=[],a=n.nextNode();for(;a;){let e=a.nodeValue??``;for(let n=0;n<e.length;n+=1){r.setStart(a,n),r.setEnd(a,n+1);let e=r.getBoundingClientRect();e.width<=0||e.height<=0||i.push({caret:(e.right-t.left)/t.width*100,left:(e.left-t.left)/t.width*100,top:(e.top-t.top)/t.height*100,bottom:(e.bottom-t.top)/t.height*100})}a=n.nextNode()}if(i.length<=v)return i;let o=Math.ceil(i.length/v),s=i.filter((e,t)=>t%o===0),c=i[i.length-1];return s[s.length-1]!==c&&s.push(c),s}function b(e,t,n){return`polygon(0% 0%, 100% 0%, 100% ${t}%, ${e}% ${t}%, ${e}% ${n}%, 0% ${n}%)`}function x(e,t,n){return[{element:e,keyframes:t,timing:p(n)}]}var re=.035,S=`up`,C=`right`;function w(e,t){return e===`down`?`0 ${-t}px`:e===`left`?`${t}px 0`:e===`right`?`${-t}px 0`:`0 ${t}px`}function T(e){return e===`left`?`inset(0 0 0 100%)`:e===`up`?`inset(100% 0 0 0)`:e===`down`?`inset(0 0 100% 0)`:`inset(0 100% 0 0)`}function E(e,t){let n=e===`left`||e===`right`,r=n?t.unit.width:t.unit.height,a=n?t.bounds.width:t.bounds.height;if(r<=0||a<=0)return{at:0,through:1};let o=n?t.unit.x:t.unit.y,s=n?t.bounds.x:t.bounds.y,c=i((e===`right`||e===`down`?s-o:o+r-(s+a))/r);return{at:c,through:Math.min(i(a/r),1-c)}}var D=.94,O=.02,k=.7;function A(e){let t=Math.max(e.unit.width,e.unit.height);return t<=0?D:a(1-e.slide.height*O/t,k,D)}var j=.8,M=1.06,N=.62,P=`cubic-bezier(0.16, 0.84, 0.44, 1)`,F=`cubic-bezier(0.36, 0, 0.66, 1)`,I=.012,L=1.08,R=.012,z=[0,-1,.85,-.6,.3,0],B=.02,V=`rgba(99, 102, 241, 0.65)`,H=`http://www.w3.org/2000/svg`;function U(e,t){return e.namespaceURI===H?{transformBox:`view-box`,transformOrigin:`${t.unit.x+t.unit.width/2}px ${t.unit.y+t.unit.height/2}px`}:{transformOrigin:`center`}}var W=40,G=400,K=4e3;function q(e){let t=0;try{t=ee(e).trim().length}catch{t=0}return a(t*W,G,K)}function J(e,t){let n=t.direction??C,r=E(n,t);return[{element:e,keyframes:[{clipPath:T(n)},{clipPath:`inset(0 0 0 0)`}],timing:{...p(t),delay:t.delay+r.at*t.duration,duration:Math.max(1,r.through*t.duration)}}]}var Y={fade:{label:`Fade`,defaultDuration:260,plan:(e,t)=>x(e,[{opacity:0},{opacity:1}],t)},rise:{label:`Rise`,defaultDuration:320,defaultDirection:S,plan:(e,t)=>{let n=Math.max(8,t.slide.height*re);return x(e,[{opacity:0,translate:w(t.direction??S,n)},{opacity:1,translate:`0 0`}],t)}},scale:{label:`Scale`,defaultDuration:280,plan:(e,t)=>{let n=U(e,t);return x(e,[{...n,opacity:0,scale:`${A(t)}`},{...n,opacity:1,scale:`1`}],t)}},pop:{label:`Pop`,defaultDuration:380,plan:(e,t)=>{let n=U(e,t);return[{element:e,keyframes:[{...n,offset:0,opacity:0,scale:`${j}`,easing:P},{...n,offset:N,opacity:1,scale:`${M}`,easing:F},{...n,offset:1,opacity:1,scale:`1`}],timing:{...p(t),easing:`linear`}}]}},blur:{label:`Blur`,defaultDuration:420,plan:(e,t)=>x(e,[{opacity:0,filter:`blur(${Math.max(2,t.slide.height*I)}px)`},{opacity:1,filter:`blur(0px)`}],t)},pulse:{label:`Pulse`,defaultDuration:480,plan:(e,t)=>{let n=U(e,t);return x(e,[{...n,offset:0,scale:`1`},{...n,offset:.5,scale:`${L}`},{...n,offset:1,scale:`1`}],t)}},shake:{label:`Shake`,defaultDuration:420,plan:(e,t)=>{let n=Math.max(3,t.slide.height*R);return x(e,z.map((e,t)=>({offset:t/(z.length-1),translate:`${e*n}px 0`})),t)}},glow:{label:`Glow`,defaultDuration:620,plan:(e,t)=>x(e,[{offset:0,filter:`none`},{offset:.5,filter:`drop-shadow(0 0 ${Math.max(4,t.slide.height*B)}px ${V})`},{offset:1,filter:`none`}],t)},wipe:{label:`Wipe`,defaultDuration:340,defaultDirection:C,plan:J},draw:{label:`Draw`,defaultDuration:520,directional:!0,plan:(e,t)=>m(e,t,J)},type:{label:`Type`,defaultDuration:G,durationFor:e=>q(e),plan:(e,t)=>g(e,t)}};function X(e,t,n,r){return r===`exit`?e.plan(t,{...n,direction:ae(n.direction)}).map(e=>({element:e.element,keyframes:e.keyframes,timing:{...e.timing,fill:`both`,direction:`reverse`,delay:n.delay+ie(e.timing,n)}})):e.plan(t,n)}function ie(e,t){let n=Math.max(0,Number(e.delay??0)-t.delay),r=Number(e.duration??t.duration);return Math.max(0,t.duration-(n+r))}function ae(e){if(e===`up`)return`down`;if(e===`down`)return`up`;if(e===`left`)return`right`;if(e===`right`)return`left`}function oe(e){return e.directional===!0||e.defaultDirection!==void 0}function Z(e){return Object.hasOwn(Y,e)?Y[e]:Y.fade}function Q(e,t,n){if(t!==void 0&&Number.isFinite(t)&&t>0)return t;let r=Z(e);return n&&r.durationFor?r.durationFor(n):r.defaultDuration}function $(e){return e.items.reduce((e,t)=>{let{animation:n,shape:r}=t,i=Math.max(0,t.start);return Math.max(e,Q(n.effect,n.duration,r)+i)},0)}function se(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function ce(e){let t=[];function n(){for(let e of t)e.cancel();t=[]}return{cancel:n,finish(){for(let e of t)try{e.finish()}catch{}t=[]},play(r,i){if(n(),e.reducedMotion())return Promise.resolve();let a=new Map;for(let t of r.items){let n=e.boundsOf(t.shape),r=a.get(t.row);a.set(t.row,r?se(r,n):n)}let o=[];for(let t of r.items){let{shape:n,animation:r}=t,s=Z(r.effect),c=e.boundsOf(n),l={bounds:c,unit:a.get(t.row)??c,slide:i,duration:Q(r.effect,r.duration,n),delay:Math.max(0,t.start),direction:r.direction};for(let t of e.elementsFor(n.id))o.push(...X(s,t,l,r.kind))}if(o.length===0)return Promise.resolve();t=o.map(e=>e.element.animate(e.keyframes,e.timing));let s=t.map(e=>e.finished);return Promise.allSettled(s).then(()=>void 0)}}}var le=`(prefers-reduced-motion: reduce)`;function ue(){let[e,t]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{let e=window.matchMedia(le),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function de(){let e=r(e=>e.presentationAnimation),t=ue(),n=(0,d.useRef)(!1);n.current=!e||t;let i=(0,d.useMemo)(()=>ce({elementsFor:e=>s(e),boundsOf:e=>o(e),reducedMotion:()=>n.current}),[]);return(0,d.useEffect)(()=>()=>i.cancel(),[i]),i}var fe=n();function pe(e){let{pending:t}=e,n=(0,d.useMemo)(()=>t.size===0?``:`${[...t].map(c).join(`,`)}{opacity:0!important;pointer-events:none!important}`,[t]);return n?(0,fe.jsx)(`style`,{"data-testid":`build-visibility`,children:n}):null}export{Z as a,u as c,Q as i,de as n,$ as o,Y as r,oe as s,pe as t};
@@ -1 +0,0 @@
1
- import{M as e,s as t}from"./style-BENGW2ZV.js";import{At as n}from"./slides-D9bnXqtf.js";var r={width:960,height:540},i=`#1e1e1e`,a=`#ffffff`,o=`#495057`,s=`#868e96`,c=`#adb5bd`,l=`#f08c00`,u=`#fab005`,d={yellow:e.yellow.pastel,orange:e.orange.pastel,green:e.green.pastel,red:e.red.pastel,blue:e.blue.pastel,teal:e.teal.pastel,purple:e.purple.pastel,pink:e.pink.pastel,gray:e.gray.pastel},f={yellow:e.yellow.bold,orange:e.orange.bold,green:e.green.bold,red:e.red.bold,blue:e.blue.bold,teal:e.teal.bold,purple:e.purple.bold,pink:e.pink.bold,gray:e.gray.bold},p=`'JetBrains Mono', ui-monospace, monospace`,m=`Caveat, cursive`;function h(e){let t=n();return e.map(e=>({...e,groupId:t}))}function g(e){let t=e.width/r.width,n=e.height/r.height,i=Math.min(t,n);return{rect:(r,i,a,o)=>({x:e.x+r*t,y:e.y+i*n,width:a*t,height:o*n}),point:(r,i)=>({x:e.x+r*t,y:e.y+i*n}),font:e=>Math.max(8,Math.round(e*i)),unit:i}}function _(e,r,i,a={}){return{id:n(),type:`text`,x:e.x+6,y:e.y+6,width:e.width-12,height:e.height-12,text:r,fontSize:i,fontFamily:a.fontFamily??t,textAlign:a.align??`center`,textVAlign:a.valign??`middle`,lineHeight:a.lineHeight??1.25,letterSpacing:a.letterSpacing,rotation:0,color:a.color??`#1e1e1e`,opacity:a.opacity??1}}function v(e,r,i={}){return{id:n(),type:`rectangle`,kind:i.kind??`rectangle`,...e,rotation:i.rotation??0,label:i.label??``,fontSize:i.fontSize??24,fontFamily:t,labelColor:i.labelColor,letterSpacing:i.letterSpacing,textAlign:i.align,textVAlign:i.valign,textPadding:i.textPadding,titleIcon:i.titleIcon,link:i.link,color:i.color??`#1e1e1e`,fill:r,fillStyle:i.fillStyle??`pastel`,corner:i.corner,shadow:i.shadow,strokeWidth:i.strokeWidth??1.5,dash:i.dash??`solid`,opacity:i.opacity??1}}function y(e,t={}){return{id:n(),type:`line`,points:e,color:t.color??`#1e1e1e`,strokeWidth:t.strokeWidth??3,dash:t.dash??`solid`,startArrow:!1,endArrow:t.endArrow??!1,opacity:t.opacity??1}}function b(e,r,i,a,o={}){return{id:n(),type:`text`,x:e.x,y:e.y,text:r,fontSize:i,fontFamily:o.fontFamily??t,rotation:o.rotation??0,color:a,opacity:o.opacity??1}}function x(e,r,i,a,o,s=d.yellow){return{id:n(),type:`sticky`,x:e.x,y:e.y,width:r,height:r,rotation:o,text:i,fontSize:a,fontFamily:t,fill:s,opacity:1}}function S(e,r,i,a,o={}){return{id:n(),type:`arrow`,x:e.x,y:e.y,x2:r.x,y2:r.y,bend:o.bow??0,bendAlong:0,bow:o.bow??0,bendStyle:o.bendStyle??`curved`,startBinding:{shapeId:i.id,anchor:{x:.5,y:.5},precise:!1},endBinding:{shapeId:a.id,anchor:{x:.5,y:.5},precise:!1},label:o.label,fontSize:o.fontSize,fontFamily:o.label?t:void 0,color:o.color??`#1e1e1e`,strokeWidth:o.strokeWidth??3,dash:o.dash??`solid`,startArrow:!1,endArrow:!0,opacity:1}}function C(e,t,r,i={}){return{id:n(),type:`arrow`,x:e.x,y:e.y,x2:t.x,y2:t.y,bend:i.bow??0,bendAlong:0,bow:i.bow??0,bendStyle:`curved`,startBinding:null,endBinding:null,color:i.color??`#1e1e1e`,strokeWidth:r,dash:`solid`,startArrow:!1,endArrow:!0,opacity:1}}function w(e,r,a,o,s={}){return{id:n(),type:`chart`,chartType:r,...e,rotation:0,cells:a,fontSize:o,fontFamily:t,color:i,opacity:1,...s}}function T(e,r,a,o,s,c={}){return{id:n(),type:`table`,x:e.x,y:e.y,cells:r,colWidths:a,rowHeights:o,rotation:0,fontSize:s,fontFamily:t,color:i,opacity:1,cellStyles:c.cellStyles??r.map((e,t)=>e.map(()=>t===0&&c.headerFill?{background:c.headerFill}:{}))}}function E(e,r,a={}){return{id:n(),type:`control`,kind:r,...e,rotation:0,label:a.label??``,body:a.body,primaryLabel:a.primaryLabel,secondaryLabel:a.secondaryLabel,fontSize:a.fontSize??15,fontFamily:t,color:i,fill:a.fill,value:a.value,opacity:a.opacity??1}}function D(e,r,i,a={}){return{id:n(),type:`icon`,x:e.x,y:e.y,width:r,height:r,rotation:0,source:a.source??`lucide`,name:i,label:a.label??``,fontSize:a.fontSize??16,fontFamily:t,color:a.color??`#1e1e1e`,strokeWidth:a.strokeWidth??3,opacity:a.opacity??1}}function O(e,r,i={}){return{id:n(),type:`figure`,kind:r,...e,rotation:0,label:i.label??``,lanes:i.lanes,laneSizes:i.laneSizes,fill:i.fill,dash:i.dash,strokeWidth:i.strokeWidth,fontSize:i.fontSize??16,fontFamily:t,color:i.color??`#868e96`,opacity:1}}function k(e,t,n,r,i={}){return v(e,t,{kind:`oval`,fillStyle:i.fillStyle??`bold`,label:n,fontSize:r,labelColor:i.labelColor,dash:`none`})}function A(e,t){return[_(e.rect(72,48,700,56),t,e.font(36),{align:`left`}),y([e.point(74,118),e.point(250,118)],{color:u,strokeWidth:4})]}function j(e){return v(e.rect(0,0,r.width,r.height),i,{dash:`none`})}function M(e,t,n,r={}){return _(e,t,n,{...r,color:r.color??`#ffffff`})}export{_ as A,A as C,g as D,v as E,y as O,h as S,S as T,w as _,o as a,C as b,a as c,r as d,u as f,M as g,j as h,c as i,x as k,d as l,E as m,i as n,p as o,k as p,s as r,l as s,f as t,m as u,T as v,D as w,b as x,O as y};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{s as r}from"./editor-B0tARd79.js";import{t as i}from"./IconSearch-C1K0_Pq_.js";import{n as a}from"./keys-DrjiT9FL.js";import{n as o}from"./surface-Dke4SWpE.js";import{i as s,n as c,r as l,t as u}from"./DialogRoot-mHGRFW9m.js";var d=e(t(),1),f=n();function p(e){let{commands:t,onRun:n,placeholder:o,inputTestId:s,itemTestId:c,emptyLabel:l,dense:u}=e,p=r(),[m,h]=(0,d.useState)(``),[g,_]=(0,d.useState)(0),v=(0,d.useRef)(null),y=e.inputRef??v,b=(0,d.useRef)(null),x=m.trim().toLowerCase(),S=(0,d.useMemo)(()=>x?t.filter(e=>`${e.label} ${e.group} ${e.keywords??``}`.toLowerCase().includes(x)):t,[t,x]);(0,d.useEffect)(()=>{_(0)},[x]),(0,d.useEffect)(()=>{e.inputRef||p.getState().coarsePointer||v.current?.focus()},[e.inputRef,p]),(0,d.useEffect)(()=>{b.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[g]);function C(e){if(e.key===`ArrowDown`)e.preventDefault(),_(e=>Math.min(e+1,S.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),_(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=S[g];t&&n(t)}}return(0,f.jsxs)(`div`,{className:`flex min-h-0 flex-col ${e.className??``}`,children:[(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--chrome-ring)] ${u?`px-3`:`px-3.5`}`,children:[(0,f.jsx)(i,{size:15,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,f.jsx)(`input`,{ref:y,"data-testid":s,value:m,onChange:e=>h(e.target.value),onKeyDown:C,placeholder:o,className:`w-full bg-transparent text-[13.5px] text-[var(--chrome-fg-900)] outline-none placeholder:text-[var(--chrome-fg-400)] ${u?`py-2`:`py-2.5`}`})]}),(0,f.jsx)(`div`,{ref:b,className:`scrollbar-slim overflow-y-auto ${e.listClassName??``}`,children:S.length===0?(0,f.jsx)(`div`,{className:`px-3 py-6 text-center text-[12.5px] text-[var(--chrome-fg-400)]`,children:l}):S.map((e,t)=>{let r=e.icon;return(0,f.jsxs)(`div`,{children:[!x&&(t===0||S[t-1].group!==e.group)?(0,f.jsx)(`div`,{className:`px-2 pb-0.5 text-[10.5px] font-medium uppercase tracking-wide text-[var(--chrome-fg-400)] ${u?`pt-1.5`:`pt-2`}`,children:e.group},`h-${e.group}`):null,(0,f.jsxs)(`button`,{type:`button`,"data-testid":c(e.id),"data-active":t===g,onMouseEnter:()=>_(t),onClick:()=>n(e),className:`flex w-full items-center rounded-lg px-2 text-left transition-colors ${u?`gap-2 py-1`:`gap-2.5 py-1.5`} ${t===g?`bg-[var(--chrome-hover)]`:`hover:bg-[var(--chrome-rest)]`}`,children:[(0,f.jsx)(`span`,{className:`flex shrink-0 items-center justify-center ${u?`h-5 w-5`:`h-6 w-6`} ${t===g?`text-[var(--chrome-fg-700)]`:`text-[var(--chrome-fg-500)]`}`,children:r?(0,f.jsx)(r,{size:15,stroke:1.75}):null}),(0,f.jsx)(`span`,{className:`flex-1 truncate text-[13px] text-[var(--chrome-fg-800)]`,children:e.label}),e.hint?(0,f.jsx)(`span`,{className:`shrink-0 rounded-md bg-[var(--chrome-divider)] px-1.5 py-0.5 text-[11px] text-[var(--chrome-fg-500)]`,children:a(e.hint)}):null]})]},e.id)})})]})}function m(e){let{open:t,onOpenChange:n,commands:r}=e,i=(0,d.useRef)(null);function a(e){n(!1),e.run()}return(0,f.jsx)(u,{open:t,onOpenChange:n,children:(0,f.jsxs)(c,{children:[(0,f.jsx)(s,{className:`fixed inset-0 bg-gray-900/15`}),(0,f.jsx)(l,{initialFocus:i,"data-overlay":!0,"data-testid":`command-palette`,className:`fixed left-1/2 top-[16%] w-[min(500px,92vw)] -translate-x-1/2 overflow-hidden rounded-xl outline-none ${o.popup}`,children:(0,f.jsx)(p,{commands:r,onRun:a,placeholder:`Search commands…`,inputTestId:`command-palette-input`,itemTestId:e=>`command-${e}`,emptyLabel:`No matching commands`,inputRef:i,listClassName:`max-h-[48vh] p-1.5`})})]})})}export{p as CommandList,m as CommandPalette};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";var n=e(t(),1),r={state:{status:`disabled`},loginWithProvider:()=>Promise.reject(Error(`Accounts are not configured`)),loginWithEmail:()=>Promise.reject(Error(`Accounts are not configured`)),registerWithEmail:()=>Promise.reject(Error(`Accounts are not configured`)),requestPasswordReset:()=>Promise.reject(Error(`Accounts are not configured`)),acquireSessionPolling:()=>()=>{},logout:()=>Promise.reject(Error(`Accounts are not configured`)),refreshUsage:()=>{}},i=(0,n.createContext)({ai:!1}),a=i.Provider;function o(){return(0,n.useContext)(i)}function s(){return o().account??r}function c(){return o().comments??null}export{o as i,s as n,c as r,a as t};
@@ -1,2 +0,0 @@
1
- import{O as e,s as t}from"./style-BENGW2ZV.js";import{Vr as n,Yr as r,jn as i,qr as a,ur as o}from"./slides-D9bnXqtf.js";function s(e){return[{text:e.startLabel??``,end:`start`},{text:e.endLabel??``,end:`end`}].filter(e=>e.text).map(t=>({text:t.text,point:a(e,t.end)}))}function c(t,n,r,a,s){let c=e(a),l=i(t).split(`
2
- `),u=l.length*r*o,d=Math.max(...l.map(e=>s.measure(e,r,a,c)))+20;return{x:n.x-d/2,y:n.y-u/2,width:d,height:u}}function l(e,i){let a=e.fontFamily??t,o=[];if(e.label){let t=e.type===`arrow`?r(e):n(e.points,e.labelAlong);o.push(c(e.label,t,e.fontSize??20,a,i))}if(e.type===`arrow`)for(let t of s(e))o.push(c(t.text,t.point,14,a,i));return o}export{l as n,s as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./jsx-runtime-2Zwg-L3c.js";import{o as r}from"./editor-B0tARd79.js";import{t as i}from"./blob-CTPsKWYv.js";import{t as a}from"./IconX-AlbPkO_g.js";import{n as o}from"./surface-Dke4SWpE.js";import{i as s,n as c,r as l,t as u}from"./DialogRoot-mHGRFW9m.js";import{n as d,t as f}from"./DialogTitle-CFhr-gP9.js";import{t as p}from"./DialogDescription-ZtZCUsfy.js";import{t as m}from"./dialog-B32krrce.js";var h=e(t(),1),g=n();function _(e){let{image:t,onClose:n}=e,[_,v]=(0,h.useState)(null),y=r(e=>e.deviceMode!==`desktop`);return(0,h.useEffect)(()=>{let e=!0;return i(t).then(t=>e&&v(t),()=>e&&n()),()=>{e=!1}},[t,n]),(0,g.jsx)(u,{open:!0,onOpenChange:e=>{e||n()},children:(0,g.jsxs)(c,{children:[(0,g.jsx)(s,{className:o.dialogBackdrop}),(0,g.jsxs)(l,{"data-overlay":!0,"data-testid":`copy-image-dialog`,className:`flex max-h-[92vh] w-[min(560px,92vw)] flex-col p-5 ${o.dialogPopup}`,children:[(0,g.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,g.jsx)(f,{className:m.title,children:`Copy image`}),(0,g.jsx)(d,{"aria-label":`Close`,className:`-mr-1.5 -mt-1.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[var(--chrome-fg-500)] outline-none transition-colors hover:bg-[var(--chrome-hover)]`,children:(0,g.jsx)(a,{size:16,stroke:2})})]}),(0,g.jsxs)(p,{className:`mt-1 ${m.description}`,children:[`This window can't copy images for you.`,` `,y?`Press and hold the picture, then choose Copy.`:`Right-click the picture and choose Copy Image.`]}),(0,g.jsx)(`div`,{className:`mt-4 flex min-h-0 flex-1 items-center justify-center overflow-auto rounded-lg bg-[var(--chrome-hover)] p-3`,children:_&&(0,g.jsx)(`img`,{src:_,alt:`The copied shapes`,className:`max-h-[60vh] max-w-full object-contain`,"data-testid":`copy-image`})})]})]})})}export{_ as CopyImageDialog};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";var n=e(t(),1),r={outline:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},filled:{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`currentColor`,stroke:`none`}},i=(e,t,i,a)=>{let o=(0,n.forwardRef)(({color:i=`currentColor`,size:o=24,stroke:s=2,title:c,className:l,children:u,...d},f)=>(0,n.createElement)(`svg`,{ref:f,...r[e],width:o,height:o,className:[`tabler-icon`,`tabler-icon-${t}`,l].join(` `),...e===`filled`?{fill:i}:{strokeWidth:s,stroke:i},...d},[c&&(0,n.createElement)(`title`,{key:`svg-title`},c),...a.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(u)?u:[u]]));return o.displayName=`${i}`,o};export{i as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";var n=e(t(),1);function r(e){let t=e.open,r=e.inline===!0,[i,a]=(0,n.useState)(!1),[o,s]=(0,n.useState)(null),c=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{t&&(a(!1),s(null),c.current=!1)},[t]),{pending:i,error:o,setError:s,run:(0,n.useCallback)(async(e,t)=>{if(!c.current){c.current=!0,s(null),a(!0);try{await e(),t.onSuccess(),c.current=!1,r&&a(!1)}catch(e){s(t.errorFor(e)),a(!1),c.current=!1}}},[r])}}function i(e,t){return e instanceof Error?e.message:t}var a={title:`text-[15px] text-[var(--chrome-fg-900)]`,description:`text-[13px] leading-relaxed text-[var(--chrome-fg-500)]`,field:`w-full rounded-lg bg-transparent px-3 py-2 text-[13px] text-[var(--chrome-fg-900)] outline-none ring-1 ring-[var(--chrome-input)] transition-shadow hover:ring-[var(--chrome-input-hover)] focus:ring-[var(--chrome-input-hover)] placeholder:text-[var(--chrome-fg-400)]`,select:`w-full appearance-none rounded-lg bg-transparent py-2 pl-3 pr-9 text-[13px] text-[var(--chrome-fg-900)] outline-none ring-1 ring-[var(--chrome-input)] transition-shadow hover:ring-[var(--chrome-input-hover)] focus:ring-[var(--chrome-input-hover)]`,selectChevron:`pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-[var(--chrome-fg-400)]`,label:`text-[12px] text-[var(--chrome-fg-500)]`,error:`text-[12px] text-[var(--chrome-danger)]`,actions:`mt-1 flex justify-end gap-2`,cancelButton:`h-8 rounded-xl bg-[var(--chrome-popup)] px-3.5 text-[13px] text-[var(--chrome-fg-700)] outline-none ring-1 ring-[var(--chrome-ring)] transition-colors hover:bg-[var(--chrome-hover)]`,dangerTextButton:`-ml-2.5 h-8 rounded-xl px-2.5 text-[13px] text-[var(--chrome-danger)] outline-none transition-colors hover:bg-[color-mix(in_srgb,var(--chrome-danger)_10%,transparent)] disabled:opacity-60`,dangerButton:`h-8 rounded-xl bg-red-600 px-3.5 text-[13px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-red-700 disabled:cursor-default disabled:opacity-60 disabled:active:scale-100`,submitButton:`h-8 rounded-xl bg-[var(--chrome-accent)] px-3.5 text-[13px] text-white outline-none transition-colors active:scale-[0.97] hover:bg-[var(--chrome-accent-hover)] disabled:cursor-default disabled:opacity-60 disabled:active:scale-100`};export{i as n,r,a as t};
@@ -1 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t}from"./jsx-runtime-2Zwg-L3c.js";import{A as n,C as r,D as i,E as a,M as o,O as s,S as c,T as l,b as u,j as d,k as f,t as ee,u as te,w as ne,x as re,y as ie}from"./reflow-Cv75wPSh.js";import{G as ae,h as oe}from"./style-BENGW2ZV.js";import{A as se,At as ce,D as le,O as ue,T as p,Y as de,i as fe,j as pe,q as me,x as he}from"./slides-D9bnXqtf.js";var m=e(t(),1),ge=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},_e=(e=>e?ge(e):ge),ve=e=>e;function ye(e,t=ve){let n=m.useSyncExternalStore(e.subscribe,m.useCallback(()=>t(e.getState()),[e,t]),m.useCallback(()=>t(e.getInitialState()),[e,t]));return m.useDebugValue(n),n}var be=(e,t,n)=>(r,i)=>({pastStates:n?.pastStates||[],futureStates:n?.futureStates||[],undo:(a=1)=>{if(i().pastStates.length){let o=n?.partialize?.(t())||t(),s=i().pastStates.splice(-a,a),c=s.shift();e(c),r({pastStates:i().pastStates,futureStates:i().futureStates.concat(n?.diff?.(o,c)||o,s.reverse())})}},redo:(a=1)=>{if(i().futureStates.length){let o=n?.partialize?.(t())||t(),s=i().futureStates.splice(-a,a),c=s.shift();e(c),r({pastStates:i().pastStates.concat(n?.diff?.(o,c)||o,s.reverse()),futureStates:i().futureStates})}},clear:()=>r({pastStates:[],futureStates:[]}),isTracking:!0,pause:()=>r({isTracking:!1}),resume:()=>r({isTracking:!0}),setOnSave:e=>r({_onSave:e}),_onSave:n?.onSave,_handleSet:(e,t,a,o)=>{n?.limit&&i().pastStates.length>=n?.limit&&i().pastStates.shift(),i()._onSave?.(e,a),r({pastStates:i().pastStates.concat(o||e),futureStates:[]})}}),xe=(e,t)=>(n,r,i)=>{i.temporal=_e(t?.wrapTemporal?.(be(n,r,t))||be(n,r,t));let a=t?.handleSet?.(i.temporal.getState()._handleSet)||i.temporal.getState()._handleSet,o=e=>{if(!i.temporal.getState().isTracking)return;let n=t?.partialize?.(r())||r(),o=t?.diff?.(e,n);o===null||t?.equality?.(e,n)||a(e,void 0,n,o)},s=i.setState;return i.setState=(...e)=>{let n=t?.partialize?.(r())||r();s(...e),o(n)},e((...e)=>{let i=t?.partialize?.(r())||r();n(...e),o(i)},r,i)},Se=100,Ce=1e6;function we(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n===0)return!1;if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return!1;t+=1}else if(n>=56320&&n<=57343)return!1}return!0}function Te(e){if(we(e))return e;let t=``;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r!==0){if(r>=55296&&r<=56319){let r=e.charCodeAt(n+1);r>=56320&&r<=57343?(t+=e.slice(n,n+2),n+=1):t+=`�`;continue}t+=r>=56320&&r<=57343?`�`:e[n]}}return t}function h(e,t,n){if(n.values+=1,n.values>Ce)return`complexity`;if(typeof e==`string`)return we(e)?null:`text`;if(e===null||typeof e==`boolean`)return null;if(typeof e==`number`)return Number.isFinite(e)?null:`number`;if(typeof e!=`object`)return`value`;if(t>Se)return`depth`;if(n.ancestors.has(e))return`cycle`;n.ancestors.add(e);try{if(Array.isArray(e)){if(e.length>Ce-n.values)return`complexity`;for(let t of Reflect.ownKeys(e))if(t!==`length`&&(typeof t!=`string`||!/^(0|[1-9]\d*)$/.test(t)||Number(t)>=e.length))return`array-property`;for(let r=0;r<e.length;r+=1){let i=Object.getOwnPropertyDescriptor(e,String(r));if(!i||!(`value`in i))return`array-entry`;let a=h(i.value,t+1,n);if(a)return a}return null}let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)return`object`;let i=Reflect.ownKeys(e);if(i.length>Ce-n.values)return`complexity`;for(let r of i){if(typeof r!=`string`||!we(r))return`object-key`;let i=Object.getOwnPropertyDescriptor(e,r);if(!i?.enumerable||!(`value`in i))return`object-property`;if(i.value===void 0)continue;let a=h(i.value,t+1,n);if(a)return a}return null}catch{return`unreadable`}finally{n.ancestors.delete(e)}}function Ee(e){return h(e,0,{ancestors:new Set,values:0})}var De={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Oe(e){return e.replace(/[&<>"']/g,e=>De[e])}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ke=new Set(i),_=new Set(ie),v=new Set(r),Ae=new Set(ne),je=new Set(c),Me=new Set(n),Ne=new Set(d),Pe=new Set(u),Fe=new Set(re),Ie=new Set(s),Le=new Set(a),Re=new Set(f),ze=new Set(l),Be={modal:!0,entity:!0,lifeline:!0,fragment:!0},Ve=new Set([...o,...Object.keys(Be)]),He=new Set([`hanging`,`inside`]),Ue=new Set([`x`,`y`]),We=256;function y(){return{issues:[],capped:!1,unknownEnum:0}}function b(e,t,n,r=!1){if(e.issues.length<100){e.issues.push({path:t,message:n}),r&&(e.unknownEnum+=1);return}e.capped=!0}var Ge={complexity:`document is too complex to persist`,text:`document contains unsupported text`,number:`document contains an unsupported number`,value:`document contains an unsupported value`,depth:`document is nested too deeply to persist`,cycle:`document contains a circular reference`,"array-property":`document contains a non-JSON array property`,"array-entry":`document contains a non-JSON array entry`,object:`document contains a non-JSON object`,"object-key":`document contains an unsupported object key`,"object-property":`document contains a non-JSON object property`,unreadable:`document contains an unreadable value`};function x(e,t,n){return typeof n==`number`&&Number.isFinite(n)?!0:(b(e,t,`expected a finite number`),!1)}function S(e,t,n){return typeof n==`string`?!0:(b(e,t,`expected a string`),!1)}function C(e,t,n){return typeof n==`boolean`?!0:(b(e,t,`expected a boolean`),!1)}function w(e,t,n,r){return typeof n==`string`?!r&&n.length===0?(b(e,t,`id must not be empty`),!1):n.length>We?(b(e,t,`id is too long`),!1):!0:(b(e,t,`expected a string id`),!1)}function T(e,t,n,r){return typeof n==`string`&&r.has(n)?!0:(b(e,t,`not an allowed value`,typeof n==`string`),!1)}function E(e,t,n){return typeof n==`number`&&Number.isFinite(n)&&n>=0&&n<=1?!0:(b(e,t,`expected a number in 0..1`),!1)}function Ke(e,t,n){return typeof n==`number`&&Number.isFinite(n)&&n>=-.2&&n<=1.2?!0:(b(e,t,`expected a number in -0.2..1.2`),!1)}function qe(e,t,n){if(!g(n))return b(e,t,`expected a point`),!1;let r=x(e,`${t}.x`,n.x),i=x(e,`${t}.y`,n.y);return r&&i}function Je(e,t,n){if(!Array.isArray(n))return b(e,t,`expected an array of points`),!1;let r=!0;for(let i=0;i<n.length&&!e.capped;i+=1)qe(e,`${t}[${i}]`,n[i])||(r=!1);return r}function D(e,t,n,r){t[r]!==void 0&&x(e,`${n}.${r}`,t[r])}function O(e,t,n,r){t[r]!==void 0&&S(e,`${n}.${r}`,t[r])}function k(e,t,n,r){t[r]!==void 0&&C(e,`${n}.${r}`,t[r])}function A(e,t,n,r,i){t[r]!==void 0&&T(e,`${n}.${r}`,t[r],i)}function Ye(e,t,n){w(e,`${t}.id`,n.id,!1),n.groupId!==void 0&&w(e,`${t}.groupId`,n.groupId,!0),n.lockId!==void 0&&w(e,`${t}.lockId`,n.lockId,!0),k(e,n,t,`locked`),Xe(e,t,n.animations)}function Xe(e,t,n){if(n!==void 0){if(!Array.isArray(n)){b(e,`${t}.animations`,`expected an array`);return}n.forEach((n,r)=>{Ze(e,`${t}.animations[${r}]`,n)})}}function Ze(e,t,n){if(!g(n)){b(e,t,`expected an object`);return}x(e,`${t}.step`,n.step),S(e,`${t}.kind`,n.kind),S(e,`${t}.effect`,n.effect),O(e,n,t,`direction`),D(e,n,t,`duration`),D(e,n,t,`delay`),k(e,n,t,`afterPrevious`)}function Qe(e,t,n){if(n!==null){if(!g(n)){b(e,t,`expected a binding or null`);return}if(n.kind===`path`){w(e,`${t}.shapeId`,n.shapeId,!0),(typeof n.seg!=`number`||!Number.isInteger(n.seg)||n.seg<0)&&b(e,`${t}.seg`,`expected a nonnegative integer segment`),E(e,`${t}.t`,n.t);return}if(w(e,`${t}.shapeId`,n.shapeId,!0),qe(e,`${t}.anchor`,n.anchor)){let r=n.anchor;Ke(e,`${t}.anchor.x`,r.x),Ke(e,`${t}.anchor.y`,r.y)}C(e,`${t}.precise`,n.precise),A(e,n,t,`port`,Re)}}function $e(e,t,n,r){if(n!==void 0){if(!g(n)){b(e,`${t}.titleIcon`,`expected an object`);return}S(e,`${t}.titleIcon.source`,n.source),S(e,`${t}.titleIcon.name`,n.name),r&&A(e,n,`${t}.titleIcon`,`placement`,He)}}function et(e,t,n){if(n===void 0)return;if(typeof n!=`object`||!n){b(e,t,`expected an object`);return}let r=n;S(e,`${t}.from`,r.from),S(e,`${t}.to`,r.to);for(let n of[`fromTop`,`fromSpan`,`toTop`,`toSpan`])x(e,`${t}.${n}`,r[n])}function tt(e,t,n){if(!g(n)){b(e,t,`expected a crop rectangle`);return}let r=E(e,`${t}.x`,n.x),i=E(e,`${t}.y`,n.y),a=E(e,`${t}.width`,n.width),o=E(e,`${t}.height`,n.height);r&&a&&n.x+n.width>1.000001&&b(e,t,`crop extends past the source width`),i&&o&&n.y+n.height>1.000001&&b(e,t,`crop extends past the source height`)}function j(e,t,n){if(n!==void 0){if(!Array.isArray(n)){b(e,t,`expected an array of strings`);return}for(let r=0;r<n.length&&!e.capped;r+=1)S(e,`${t}[${r}]`,n[r])}}function nt(e,t,n){if(n!==void 0){if(!Array.isArray(n)){b(e,t,`expected an array of numbers`);return}for(let r=0;r<n.length&&!e.capped;r+=1)x(e,`${t}[${r}]`,n[r])}}function rt(e,t,n){let r=n.cells,i=n.colWidths,a=n.rowHeights,o=it(e,`${t}.colWidths`,i);it(e,`${t}.rowHeights`,a);let s=o&&Array.isArray(i)?i.length:null;if(!Array.isArray(r)){b(e,`${t}.cells`,`expected a grid of rows`);return}Array.isArray(a)&&a.length!==r.length&&b(e,`${t}.rowHeights`,`must have one entry per row`);for(let n=0;n<r.length&&!e.capped;n+=1){let i=r[n];if(!Array.isArray(i)){b(e,`${t}.cells[${n}]`,`expected a row of cells`);continue}s!==null&&i.length!==s&&b(e,`${t}.cells[${n}]`,`row width does not match colWidths`);for(let r=0;r<i.length;r+=1)S(e,`${t}.cells[${n}][${r}]`,i[r])}at(e,`${t}.cellStyles`,n.cellStyles,r)}function it(e,t,n){if(!Array.isArray(n))return b(e,t,`expected an array of numbers`),!1;let r=!0;for(let i=0;i<n.length&&!e.capped;i+=1)x(e,`${t}[${i}]`,n[i])||(r=!1);return r}function at(e,t,n,r){if(n!==void 0){if(!Array.isArray(n)){b(e,t,`expected a grid of cell styles`);return}n.length!==r.length&&b(e,t,`must mirror the cells grid`);for(let i=0;i<n.length&&!e.capped;i+=1){let a=n[i];if(!Array.isArray(a)){b(e,`${t}[${i}]`,`expected a row of cell styles`);continue}let o=r[i];Array.isArray(o)&&a.length!==o.length&&b(e,`${t}[${i}]`,`row width does not match the cells row`);for(let n=0;n<a.length;n+=1)ot(e,`${t}[${i}][${n}]`,a[n])}}}function ot(e,t,n){if(!g(n)){b(e,t,`expected a cell style object`);return}O(e,n,t,`fontFamily`),D(e,n,t,`fontSize`),O(e,n,t,`background`)}function st(e,t,n){if(!Array.isArray(n)){b(e,t,`expected a grid of rows`);return}for(let r=0;r<n.length&&!e.capped;r+=1){let i=n[r];if(!Array.isArray(i)){b(e,`${t}[${r}]`,`expected a row`);continue}for(let n=0;n<i.length;n+=1)S(e,`${t}[${r}][${n}]`,i[n])}}function ct(e,t,n){if(n!==void 0){if(!Array.isArray(n)){b(e,t,`expected an array`);return}for(let r=0;r<n.length&&!e.capped;r+=1){let i=n[r];i==null||typeof i==`string`||b(e,`${t}[${r}]`,`expected a string or null`)}}}function lt(e,t,n){if(n!==void 0){if(!Array.isArray(n)){b(e,t,`expected an array of flows`);return}n.forEach((n,r)=>{let i=`${t}[${r}]`;if(!g(n)){b(e,i,`expected a flow`);return}if(w(e,`${i}.id`,n.id,!1),S(e,`${i}.name`,n.name),!Array.isArray(n.steps)){b(e,`${i}.steps`,`expected an array of steps`);return}n.steps.forEach((t,n)=>{let r=`${i}.steps[${n}]`;if(!g(t)){b(e,r,`expected a step`);return}w(e,`${r}.target`,t.target,!1),S(e,`${r}.title`,t.title),O(e,t,r,`text`),j(e,`${r}.also`,t.also),A(e,t,r,`kind`,ze),O(e,t,r,`payload`),j(e,`${r}.branches`,t.branches),k(e,t,r,`fails`)})})}}function ut(e,t,n){if(!Array.isArray(n)){b(e,t,`expected an array of activation bars`);return}for(let r=0;r<n.length&&!e.capped;r+=1){let i=n[r];if(!g(i)){b(e,`${t}[${r}]`,`expected an activation bar`);continue}x(e,`${t}[${r}].top`,i.top),x(e,`${t}[${r}].height`,i.height)}}function M(e){return(t,n,r,i)=>{e(t,`${n}.${i}`,r[i])}}function N(e){return(t,n,r,i)=>{r[i]!==void 0&&e(t,n,r,i)}}function P(e){return M((t,n,r)=>T(t,n,r,e))}function dt(e){return(t,n,r)=>{$e(t,n,r.titleIcon,e)}}var F=M(x),I=M(S),L=M(C),R=M(Je),z=N(F),B=N(I),V=N(L),H=N(M(E)),ft=N(R),pt=(e,t,n,r)=>{if(n[r]===void 0){b(e,`${t}.${r}`,`expected a binding or null`);return}Qe(e,`${t}.${r}`,n[r])},U=()=>{},mt={rectangle:{kind:P(ke),x:F,y:F,width:F,height:F,rotation:F,label:I,fontSize:F,fontFamily:I,color:I,fill:I,strokeWidth:F,dash:P(v),opacity:F,textAlign:N(P(Me)),textVAlign:N(P(Ne)),textPadding:z,lineHeight:z,letterSpacing:z,labelColor:B,stroke:B,fillStyle:N(P(Ae)),corner:N(P(je)),flipX:V,flipY:V,shadow:V,minHeight:z,autoHeightFrom:z,link:B,titleIcon:dt(!0)},arrow:{x:F,y:F,x2:F,y2:F,bend:F,bendAlong:F,startBend:z,endBend:z,bendStyle:P(Pe),color:I,strokeWidth:F,dash:P(v),startArrow:L,endArrow:L,opacity:F,startBinding:pt,endBinding:pt,bow:z,bowAlong:z,elbowMid:H,labelAlong:H,elbowPoints:ft,elbowRoute:ft,elbowMidHandle:N(M((e,t,n)=>{if(!g(n)){b(e,t,`expected an object`);return}x(e,`${t}.x`,n.x),x(e,`${t}.y`,n.y),T(e,`${t}.axis`,n.axis,Ue),x(e,`${t}.span`,n.span)})),label:B,startLabel:B,endLabel:B,fontSize:z,fontFamily:B,startHead:N(P(_)),endHead:N(P(_)),flow:V},text:{x:F,y:F,text:I,fontSize:F,fontFamily:I,rotation:F,color:I,opacity:F,width:z,height:z,textAlign:N(P(Me)),textVAlign:N(P(Ne)),lineHeight:z,letterSpacing:z,flipX:V,flipY:V},sticky:{x:F,y:F,width:F,height:F,rotation:F,text:I,fontSize:F,fontFamily:I,fill:I,opacity:F,lineHeight:z,letterSpacing:z},draw:{points:R,color:I,strokeWidth:F,opacity:F,highlighter:V},polygon:{points:R,fill:I,color:I,strokeWidth:F,opacity:F,smooth:V,band:M(et)},line:{points:R,color:I,strokeWidth:F,dash:P(v),startArrow:L,endArrow:L,opacity:F,startHead:N(P(_)),endHead:N(P(_)),flow:V,label:B,labelAlong:H,fontSize:z,fontFamily:B},image:{x:F,y:F,width:F,height:F,rotation:F,src:I,opacity:F,corner:N(P(je)),flipX:V,flipY:V,crop:M(tt)},icon:{x:F,y:F,width:F,height:F,rotation:F,source:I,name:I,label:I,fontSize:F,fontFamily:I,color:I,strokeWidth:F,flipX:V,flipY:V,opacity:F},figure:{x:F,y:F,width:F,height:F,rotation:F,label:I,fontSize:F,fontFamily:I,color:I,opacity:F,kind:N(P(Le)),lanes:M(j),laneSizes:M(nt),slideOrder:z,slideSkipped:V,notes:B,flows:M(lt),slideLayout:B,fill:B,strokeWidth:z,dash:N(P(v)),code:B,codeFingerprint:B,titleIcon:dt(!1)},table:{x:F,y:F,rotation:F,fontSize:F,fontFamily:I,color:I,opacity:F,background:B,colWidths:rt,rowHeights:U,cells:U,cellStyles:U},chart:{chartType:P(Fe),x:F,y:F,width:F,height:F,rotation:F,fontSize:F,fontFamily:I,color:I,opacity:F,cells:M(st),horizontal:V,stacked:V,showLegend:V,showValues:V,showTitles:V,numberFormat:N(P(Ie)),seriesColors:M(ct),quadrantColors:M(ct),quadrantLabels:M(j),title:B,xTitle:B,yTitle:B,code:B,codeFingerprint:B},control:{kind:P(Ve),x:F,y:F,width:F,height:F,rotation:F,label:I,fontSize:F,fontFamily:I,color:I,opacity:F,body:B,primaryLabel:B,secondaryLabel:B,link:B,fill:B,value:z,widthManual:V,activations:N(M(ut))}};function ht(e,t,n,r){for(let i of Object.keys(r))r[i](e,t,n,i)}function gt(e,t,n,r){let i=n.type,a=typeof i==`string`?mt[i]:void 0;if(!r)return Ye(e,t,n),a?(ht(e,t,n,a),`understood`):(b(e,`${t}.type`,`unknown shape type`),`understood`);let o=y();return Ye(o,t,n),a&&ht(o,t,n,a),a?o.issues.length===0?`understood`:o.issues.length===o.unknownEnum?`unknown`:`damaged`:typeof i==`string`&&o.issues.length===0?`unknown`:`damaged`}function _t(e,t,n,r,i){vt(e,`${t}.startBinding`,n,n.startBinding,r,i),vt(e,`${t}.endBinding`,n,n.endBinding,r,i)}function vt(e,t,n,r,i,a){if(!g(r))return;let o=r.shapeId;if(typeof o!=`string`)return;if(o===n.id){b(e,`${t}.shapeId`,`binding targets its own arrow`);return}let s=i.get(o);if(!s){b(e,`${t}.shapeId`,`binding target does not exist`);return}if(!a.has(o)){if(r.kind===`path`){if(s.type!==`line`&&s.type!==`arrow`){b(e,`${t}.shapeId`,`path binding must target a line or arrow`);return}let n=(s.type===`line`&&Array.isArray(s.points)?s.points.length:2)-2;typeof r.seg==`number`&&(r.seg<0||r.seg>n)&&b(e,`${t}.seg`,`path segment does not exist on the target`);return}s.type===`arrow`&&b(e,`${t}.shapeId`,`node binding cannot target an arrow`)}}var yt=1e4;function bt(e){try{if(!g(e))return!1;let t=y();return gt(t,`shape`,e,!1),t.issues.length===0&&Ee(e)===null}catch{return!1}}function xt(e,t){return Ct(e,!0,t)}function St(e,t){return Ct(e,!1,t)}function Ct(e,t,n){try{return wt(e,t,n?.unknownShapes===`preserve`)}catch{return{status:`invalid`,issues:[{path:``,message:`could not be validated`}]}}}function wt(e,t,n){if(!g(e))return{status:`invalid`,issues:[{path:``,message:`expected an object`}]};let r=e.version;if(r!==1)return typeof r==`number`&&Number.isFinite(r)?{status:`unsupported-version`,version:r}:{status:`invalid`,issues:[{path:`version`,message:`unsupported version`}]};let i=e.shapes;if(!Array.isArray(i))return{status:`invalid`,issues:[{path:`shapes`,message:`expected an array`}]};if(i.length>1e4)return{status:`invalid`,issues:[{path:`shapes`,message:`too many shapes`}]};let a=y(),o=new Map,s=new Set,c=new Map,l=new Set;for(let e=0;e<i.length;e+=1){if(a.issues.length>=100){a.capped=!0;break}let t=i[e],r=`shapes[${e}]`;if(!g(t)){b(a,r,`expected a shape object`);continue}typeof t.id==`string`&&(s.has(t.id)?b(a,`${r}.id`,`duplicate shape id`):(s.add(t.id),o.set(t.id,t)));let u=gt(a,r,t,n);if(u===`understood`||!w(a,`${r}.id`,t.id,!1))continue;if(u===`unknown`&&JSON.stringify(t).length>1048576){b(a,r,`unrecognized shape is too large to preserve`);continue}let d=t.id;c.set(e,{index:e,id:d,shape:t,reason:u}),l.add(d)}for(let e=0;e<i.length;e+=1){if(a.issues.length>=100){a.capped=!0;break}let t=i[e];if(!g(t)||t.type!==`arrow`||c.has(e))continue;let r=`shapes[${e}]`;if(!n){_t(a,r,t,o,l);continue}let s=y();if(_t(s,r,t,o,l),s.issues.length===0||!w(a,`${r}.id`,t.id,!1))continue;let u=t.id;c.set(e,{index:e,id:u,shape:t,reason:`damaged`}),l.add(u)}if(a.issues.length>0)return{status:`invalid`,issues:a.issues};if(t){let t=Ee(e);if(t)return b(a,``,Ge[t]),{status:`invalid`,issues:a.issues}}return c.size===0?{status:`valid`,document:e,opaque:[]}:{status:`valid`,document:{...e,shapes:i.filter((e,t)=>!c.has(t))},opaque:[...c.values()].sort((e,t)=>e.index-t.index)}}function W(e){return JSON.stringify(e,(e,t)=>{if(typeof t!=`object`||!t||Array.isArray(t))return t;let n=t;return Object.fromEntries(Object.keys(n).sort().map(e=>[e,n[e]]))})}function Tt(e,t,n){let{shapes:r,conflicts:i}=Dt(e.shapes,t.shapes,n.shapes);return{document:{version:1,shapes:r},conflicts:i}}function Et(e,t,n){let r=new Map(e.shapes.map(e=>[e.id,W(e)])),i=new Map(t.shapes.map(e=>[e.id,W(e)])),a=0;for(let e of n.shapes){let t=i.get(e.id);t!==r.get(e.id)&&W(e)!==t&&(a+=1)}return a}function Dt(e,t,n){let r=e=>W(e),i=new Map(e.map(e=>[e.id,r(e)])),a=new Map(t.map(e=>[e.id,e])),o=new Set(n.map(e=>e.id)),s=0,c=[],l=new Set;for(let e of n){let t=e.id,n=i.get(t),o=a.get(t);if(l.add(t),n===void 0){o&&r(o)!==r(e)?(s+=1,c.push(o)):c.push(e);continue}if(!o){r(e)!==n&&(s+=1,c.push(e));continue}let u=r(o)!==n,d=r(e)!==n;u&&d&&r(o)!==r(e)?(s+=1,c.push(o)):u?c.push(o):c.push(e)}for(let[e,t]of i){if(o.has(e)||l.has(e))continue;let n=a.get(e);l.add(e),n&&r(n)!==t&&(s+=1,c.push(n))}for(let e of t)l.has(e.id)||c.push(e);return{shapes:c,conflicts:s}}function Ot(e,t){if(t===null)return 0;let n=e.length-1;if(n>=0&&e[n].id===t)return e.length;let r=e.findIndex(e=>e.id===t);return r===-1?e.length:r+1}var kt=16;function At(e,t){return e.findIndex(e=>e.id===t)}function G(e,t){let n=[...e],r=null,i=e=>{if(t.length<kt)return At(n,e);if(r===null){r=new Map;for(let e=0;e<n.length;e+=1)r.has(n[e].id)||r.set(n[e].id,e)}return r.get(e)??-1};for(let e of t){if(e.o===`put`){let t=i(e.shape.id);if(t!==-1){n[t]=e.shape;continue}n.splice(Ot(n,e.after),0,e.shape),r=null;continue}if(e.o===`set`){let t=i(e.id);if(t===-1)continue;let r={...n[t],...e.props,id:e.id};for(let t of e.unset??[])t!==`id`&&delete r[t];n[t]=r;continue}if(e.o===`del`){let t=i(e.id);t!==-1&&(n.splice(t,1),r=null);continue}let t=i(e.id);if(t===-1||e.after===e.id)continue;let[a]=n.splice(t,1);n.splice(Ot(n,e.after),0,a),r=null}return n}function jt(e,t){return e===t?!0:typeof e!=`object`||typeof t!=`object`||e===null||t===null?!1:W(e)===W(t)}function Mt(e){let t=[],n=Array(e.length).fill(-1);for(let r=0;r<e.length;r+=1){let i=0,a=t.length;for(;i<a;){let n=i+a>>1;e[t[n]]<e[r]?i=n+1:a=n}i>0&&(n[r]=t[i-1]),t[i]=r}let r=new Set,i=t.length>0?t[t.length-1]:-1;for(;i!==-1;)r.add(i),i=n[i];return r}function Nt(e,t){let n=[],r=new Map,i=new Map;e.forEach((e,t)=>{r.set(e.id,e),i.set(e.id,t)});let a=new Set(t.map(e=>e.id));for(let t of e)a.has(t.id)||n.push({o:`del`,id:t.id});let o=[],s=[];t.forEach((e,t)=>{let n=i.get(e.id);n!==void 0&&(o.push(n),s.push(t))});let c=Mt(o),l=new Set;return s.forEach((e,t)=>{c.has(t)||l.add(e)}),t.forEach((e,i)=>{let a=i===0?null:t[i-1].id,o=r.get(e.id);if(!o){n.push({o:`put`,shape:e,after:a});return}if(l.has(i)&&n.push({o:`move`,id:e.id,after:a}),o===e)return;let s=o,c=e,u={},d=!1;for(let e of Object.keys(c))c[e]!==void 0&&(jt(s[e],c[e])||(u[e]=c[e],d=!0));let f=Object.keys(s).filter(e=>s[e]!==void 0&&c[e]===void 0);!d&&f.length===0||n.push(f.length>0?{o:`set`,id:e.id,props:u,unset:f}:{o:`set`,id:e.id,props:u})}),n}var K=yt,Pt=8e3;function Ft(e,t){return e+t>K?{kind:`block`,message:`That would put this canvas past ${K.toLocaleString()} shapes, so nothing was added. Split the work across canvases instead.`}:e<=8e3&&e+t>8e3?{kind:`warn`,message:`This canvas now has over ${Pt.toLocaleString()} shapes. Boards this large can feel slow.`}:null}function It(e,t){return e>K?t===`open`?{kind:`block`,message:`That board has ${e.toLocaleString()} shapes, more than the ${K.toLocaleString()} a canvas supports, so it wasn't opened.`}:{kind:`warn`,message:`This board has ${e.toLocaleString()} shapes, more than the ${K.toLocaleString()} a canvas supports. Expect it to feel slow.`}:e>8e3?{kind:`warn`,message:`This board has ${e.toLocaleString()} shapes. Boards this large can feel slow.`}:null}function Lt(e){let t=0;for(let n of e)n.type===`figure`&&n.slideOrder!==void 0&&(t=Math.max(t,n.slideOrder+1));return t}function Rt(e,t){if(!t.some(e=>e.type===`figure`&&e.slideOrder!==void 0))return t;let n=new Set;for(let t of e)t.type===`figure`&&t.slideOrder!==void 0&&n.add(t.slideOrder);let r=Lt([...e,...t]);return t.map(e=>{if(e.type!==`figure`||e.slideOrder===void 0)return e;if(!n.has(e.slideOrder))return n.add(e.slideOrder),e;let t=r++;return n.add(t),{...e,slideOrder:t}})}function zt(e){let t=new Map;return fe(e).forEach((e,n)=>{e.slideOrder!==n&&t.set(e.id,{...e,slideOrder:n})}),t.size===0?e:e.map(e=>t.get(e.id)??e)}var Bt=`(prefers-color-scheme: dark)`;function Vt(e,t){return e===`system`?t?`dark`:`light`:e}function Ht(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(Bt).matches}var q={showGrid:!0,snapEnabled:!0,presentationAnimation:!0,showZoomIndicator:!1,theme:`light`},J=1,Ut={"'Balsamiq Sans', cursive":`'Balsamiq Sans Neue', cursive`};function Wt(e){let t=e.activation;if(!t||typeof t!=`object`||Array.isArray(t))return null;let{top:n,height:r}=t;return typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)?null:{top:n,height:r}}function Gt(e){let t=new Map,n=e.map(e=>{if(e.type!==`control`||e.kind!==`lifeline`||!(`activation`in e))return e;let{activation:n,...r}=e,i=Array.isArray(e.activations),a=Wt(e);if(i||!a)return r;let o={...r,activations:[a]};return t.set(o.id,o),o});if(t.size===0)return n;let r=e=>{if(!e||te(e)||!e.precise)return e;let n=t.get(e.shapeId);if(!n)return e;let r=me(n)[0],i=de(n),a=ae((r.y+e.anchor.y*r.height-i.y)/i.height);return{...e,anchor:{x:.5,y:a}}};return n.map(e=>{if(e.type!==`arrow`)return e;let t=r(e.startBinding),n=r(e.endBinding);return t===e.startBinding&&n===e.endBinding?e:{...e,startBinding:t,endBinding:n}})}var Kt=100;function qt(e,t=0,n=new Set){if(typeof e==`string`)return Te(e);if(typeof e!=`object`||!e||t>=Kt||n.has(e))return e;n.add(e);try{if(Array.isArray(e)){let r=!1,i=Array(e.length);for(let a=0;a<e.length;a+=1){let o=Object.getOwnPropertyDescriptor(e,String(a));if(!o||!(`value`in o))return e;let s=o.value,c=qt(s,t+1,n);c!==s&&(r=!0),i[a]=c}return r?i:e}let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)return e;let i=!1,a={};for(let r of Reflect.ownKeys(e)){if(typeof r!=`string`)return e;let o=Object.getOwnPropertyDescriptor(e,r);if(!o?.enumerable||!(`value`in o))return e;let s=o.value,c=qt(s,t+1,n);c!==s&&(i=!0),a[r]=c}return i?a:e}finally{n.delete(e)}}function Jt(e){return Gt(e).map(e=>{if(`fontFamily`in e&&e.fontFamily){let t=Ut[e.fontFamily];if(t)return{...e,fontFamily:t}}return e})}function Yt(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.x!=`number`||typeof t.y!=`number`||typeof t.zoom!=`number`||!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(t.zoom)||t.zoom<=0?null:{x:t.x,y:t.y,zoom:t.zoom}}var Xt={unknownShapes:`preserve`};function Y(e,t){if(t.length===0)return e;let n=[...e.shapes];for(let e of[...t].sort((e,t)=>e.index-t.index))n.splice(Math.min(e.index,n.length),0,e.shape);return{...e,shapes:n}}function Zt(e){let t=xt(e,Xt);if(t.status!==`valid`)return{document:e,opaque:[]};let n=t.opaque.filter(e=>e.reason===`unknown`);if(n.length===t.opaque.length)return{document:t.document,opaque:t.opaque};let r=Qt(t.opaque.filter(e=>e.reason===`damaged`),n);return{document:Y(t.document,r),opaque:n}}function Qt(e,t){return e.length===0||t.length===0?e:e.map(e=>({...e,index:e.index-t.filter(t=>t.index<e.index).length}))}function $t(e,t){if(t.length===0)return e;let n=new Set(t.map(e=>e.id));return{...e,shapes:e.shapes.filter(e=>!n.has(e.id))}}function en(e){let t=St(e,Xt);if(t.status===`unsupported-version`)return{status:`unsupported-version`};if(t.status===`invalid`)return{status:`invalid`};let n=qt(t.document),r=xt(Y({...n,shapes:Jt(n.shapes)},t.opaque),Xt);if(r.status!==`valid`)return{status:`invalid`};let i=r.opaque.filter(e=>e.reason===`damaged`),a=Qt(r.opaque.filter(e=>e.reason===`unknown`),i),o=r.document.shapes.length+r.opaque.length;return o>0&&i.length===o?{status:`invalid`}:{status:`valid`,document:Y(r.document,a),opaque:a,damaged:i}}function X(e,t){return typeof e==`function`?e(t):e}function Z(e){return t=>n=>e(e=>{let r=X(n,e[t]);return Object.is(r,e[t])?e:{[t]:r}})}var tn=1.2,nn={x:0,y:0,zoom:1};function Q(e,t){return Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.zoom)&&t.zoom>0?{viewport:t}:{viewport:e}}var rn=e=>({viewport:nn,zoomGestureNonce:0,pulseZoomGesture:()=>e(e=>({zoomGestureNonce:e.zoomGestureNonce+1})),setViewport:t=>e(e=>Q(e.viewport,X(t,e.viewport))),zoomIn:t=>e(e=>Q(e.viewport,p(e.viewport,e.viewport.zoom*tn,t))),zoomOut:t=>e(e=>Q(e.viewport,p(e.viewport,e.viewport.zoom/tn,t))),resetZoom:t=>e(e=>Q(e.viewport,p(e.viewport,1,t))),fitToBounds:(t,n)=>e(e=>Q(e.viewport,t?he(t,n):{zoom:1,x:n.width/2,y:n.height/2}))});function an(e){let t=new Map;for(let n of e)n.groupId&&t.set(n.groupId,(t.get(n.groupId)??0)+1);return[...t.values()].some(e=>e===1)?e.map(e=>e.groupId&&t.get(e.groupId)===1?{...e,groupId:void 0}:e):e}function on(e,t){let{position:n}=pe(e),r=e.slice(),i=[];for(let a of t(t=>{let r=n.get(t);return r===void 0?void 0:e[r]})){let e=n.get(a.id);e!==void 0&&(r[e]=a,i.push(e))}return ue(e,r,i),r}var $=new Set,sn=e=>(t,n,r)=>{let i=r.temporal;function a(){return n().viewModeLocked&&i?.getState().isTracking!==!1}function o(n,r,i,o){a()||t(t=>{let a=n(t.shapes);le(t.shapes,a);let s=ee(a,r,e,o);return t.activeGroupId&&!s.some(e=>e.groupId===t.activeGroupId)?{shapes:s,...i,activeGroupId:null}:{shapes:s,...i}})}function s(e){o(t=>{let n=t.some(t=>e.has(t.id)&&t.type===`figure`&&t.slideOrder!==void 0),r=t.filter(t=>!e.has(t.id));return n?zt(r):r},e)}function c(e,r){if(a())return;let i=Ft(n().shapes.length,e.length);i&&(t({limitNotice:i}),i.kind===`block`)||o(t=>r(t,Rt(t,e)),new Set(e.map(e=>e.id)))}return{shapes:[],hydrate:(n,r,i)=>{let a=n?Zt(n):null;t({shapes:ee(a?.document.shapes??[],null,e),opaqueShapes:a?.opaque??[],viewport:r??nn,showGrid:i?.showGrid??q.showGrid,snapEnabled:i?.snapEnabled??q.snapEnabled,presentationAnimation:i?.presentationAnimation??q.presentationAnimation,showZoomIndicator:i?.showZoomIndicator??q.showZoomIndicator,theme:i?.theme??q.theme})},opaqueShapes:[],limitNotice:null,clearLimitNotice:()=>t({limitNotice:null}),addShape:e=>c([e],(e,t)=>[...e,...t]),addMany:e=>c(e,(e,t)=>[...e,...t]),addShapeBehind:(e,t)=>c([e],(e,n)=>{let r=e.findIndex(e=>t.has(e.id));return r===-1?[...e,...n]:[...e.slice(0,r),...n,...e.slice(r)]}),updateShape:(e,t)=>o(n=>on(n,n=>{let r=n(e);return r?[{...r,...t}]:[]}),new Set([e])),replaceShape:e=>o(t=>on(t,()=>[e]),new Set([e.id])),replaceMany:(e,t)=>{o(t=>on(t,()=>e),new Set(e.map(e=>e.id)),void 0,t)},loadShapes:e=>{let t=Zt({version:J,shapes:e});o(()=>t.document.shapes,null,{opaqueShapes:t.opaque})},applyRemoteOps:e=>{e.length!==0&&t(t=>{let n=t.opaqueShapes.length===0&&e.every(e=>e.o!==`put`||bt(e.shape)),r,i=t.opaqueShapes;if(n)r=G(t.shapes,e),le(t.shapes,r);else{let n=Zt({version:J,shapes:G(Y({version:J,shapes:t.shapes},t.opaqueShapes).shapes,e)});r=n.document.shapes,i=n.opaque}let a=e=>pe(r).position.has(e),o=[...t.selectedIds].every(a)?t.selectedIds:new Set([...t.selectedIds].filter(a));return t.activeGroupId&&!r.some(e=>e.groupId===t.activeGroupId)?{shapes:r,opaqueShapes:i,selectedIds:o,activeGroupId:null}:{shapes:r,opaqueShapes:i,selectedIds:o}})},remeasureBindings:()=>o(e=>e,null),settleBindings:e=>o(e=>e,e),removeShape:e=>s(new Set([e])),removeShapes:e=>s(e),bringToFront:e=>o(t=>[...t.filter(t=>!e.has(t.id)),...t.filter(t=>e.has(t.id))],$),sendToBack:e=>o(t=>[...t.filter(t=>e.has(t.id)),...t.filter(t=>!e.has(t.id))],$),bringForward:e=>o(t=>{let n=[...t];for(let t=n.length-2;t>=0;--t)e.has(n[t].id)&&!e.has(n[t+1].id)&&([n[t],n[t+1]]=[n[t+1],n[t]]);return n},$),sendBackward:e=>o(t=>{let n=[...t];for(let t=1;t<n.length;t+=1)e.has(n[t].id)&&!e.has(n[t-1].id)&&([n[t],n[t-1]]=[n[t-1],n[t]]);return n},$),group:e=>{let t=ce();o(n=>{let r=n.filter(t=>e.has(t.id));if(r.length<2)return n;let i=r.map(e=>({...e,groupId:t})),a=n.filter(t=>!e.has(t.id)),o=0;n.forEach((t,n)=>{e.has(t.id)&&(o=n)});let s=n.slice(0,o+1).filter(t=>!e.has(t.id)).length,c=[...a];return c.splice(s,0,...i),an(c)},$)},ungroup:e=>o(t=>{let n=new Set(t.filter(t=>e.has(t.id)&&t.groupId).map(e=>e.groupId));return n.size===0?t:t.map(e=>e.groupId&&n.has(e.groupId)?{...e,groupId:void 0}:e)},$)}};function cn(e){return e.kind===`none`?null:e.shapeId}function ln(e,t){if(e.kind===`none`||e.shapeId!==t)return{kind:`none`};switch(e.kind){case`text`:return{kind:`text`,field:e.field};case`table-cell`:return{kind:`table-cell`,row:e.row,col:e.col};case`lane`:return{kind:`lane`,lane:e.lane};case`crop`:return{kind:`crop`};case`chart-data`:return{kind:`chart-data`};case`vertices`:return{kind:`vertices`};default:return e}}function un(e){return e.kind===`crop`||e.kind===`vertices`}function dn(e){return e.kind===`text`||e.kind===`table-cell`||e.kind===`lane`}function fn(e,t){return e.kind===`text`&&se(t,e.shapeId)?.type!==`figure`}function pn(e){return Number.isFinite(e)?Math.max(0,Math.trunc(e)):0}var mn=(e,t)=>{let n=Z(e);return{tool:`select`,selectedIds:new Set,erasingIds:new Set,editSession:{kind:`none`},tableSelection:null,hoveredId:null,activeGroupId:null,style:oe,shapeKind:`rectangle`,chartKind:`bar`,frameKind:`simple`,pendingIcon:null,pendingControl:null,toolLock:!1,lockRevealId:null,setTool:t=>e(e=>{let n=X(t,e.tool);return n===e.tool?e:e.tool===`highlight`&&n===`select`?{tool:n,style:oe}:{tool:n}}),releaseTool:()=>e(e=>e.toolLock?e:{tool:`select`}),placeShape:(e,n)=>{let r=t();r.addShape(e),r.setSelectedIds(new Set([e.id])),n?.edit&&r.beginTextEdit(e.id),r.releaseTool()},setSelectedIds:n(`selectedIds`),setErasingIds:n(`erasingIds`),beginTextEdit:(t,n=`label`)=>e({editSession:{kind:`text`,shapeId:t,field:n}}),beginTableCellEdit:(t,n,r)=>e({editSession:{kind:`table-cell`,shapeId:t,row:pn(n),col:pn(r)}}),beginLaneEdit:(t,n)=>e({editSession:{kind:`lane`,shapeId:t,lane:pn(n)}}),beginCrop:t=>e({editSession:{kind:`crop`,shapeId:t}}),beginChartDataEdit:t=>e({editSession:{kind:`chart-data`,shapeId:t}}),beginVertexEdit:t=>e({editSession:{kind:`vertices`,shapeId:t}}),endEdit:t=>e(e=>{let n=e.editSession;return n.kind===`none`||t!==void 0&&n.shapeId!==t?e:{editSession:{kind:`none`}}}),setTableSelection:n(`tableSelection`),setHoveredId:t=>e(e=>{let n=X(t,e.hoveredId);return n===e.hoveredId?e:{hoveredId:n}}),setActiveGroupId:n(`activeGroupId`),setStyle:n(`style`),setShapeKind:n(`shapeKind`),setChartKind:n(`chartKind`),setFrameKind:n(`frameKind`),setPendingIcon:n(`pendingIcon`),setPendingControl:n(`pendingControl`),setToolLock:n(`toolLock`),setLockRevealId:n(`lockRevealId`)}},hn=e=>{let t=Z(e),n={slidePickerOpen:!1,animateSlideId:null},r=e=>({rightPanel:e,...e===`slides`?{}:n,...e===`flow`?{}:{flowEdit:null}}),i=(e,t)=>e.rightPanel===t?{rightPanel:null}:void 0;return{iconPickerOpen:!1,imageLibraryOpen:!1,rightPanel:null,slidePickerOpen:!1,notesEditorId:null,animateSlideId:null,flowEdit:null,flowPlay:null,flowPreview:null,lastFlow:{},codeSeed:null,pendingBoard:null,textAiSignInOpen:!1,textAiUpgradeOpen:!1,embedSignInOpen:!1,paletteOpen:!1,exportDialog:null,imageToCopy:null,toolDrawerOpen:!1,searchOpen:!1,zenMode:!1,rideMode:!1,viewMode:!1,viewModeLocked:!1,presentingIndex:null,pasteChoiceGrid:null,aiGhost:null,aiPrompt:null,deviceMode:`desktop`,coarsePointer:!1,setIconPickerOpen:t(`iconPickerOpen`),setImageLibraryOpen:t(`imageLibraryOpen`),setSlidesOpen:t=>e(e=>X(t,e.rightPanel===`slides`)?r(`slides`):{...i(e,`slides`),...n}),setSlidePickerOpen:t(`slidePickerOpen`),setNotesEditorId:t(`notesEditorId`),setAnimateSlideId:t=>e(t===null?{animateSlideId:null}:{animateSlideId:t,rightPanel:`slides`,tool:`select`,pendingIcon:null,pendingControl:null}),setFlowEdit:t=>e(e=>t===null?{flowEdit:null,...i(e,`flow`)}:{...r(`flow`),flowEdit:t,flowPreview:null,tool:`select`,pendingIcon:null,pendingControl:null}),patchFlowEdit:t=>e(e=>e.flowEdit?{flowEdit:{...e.flowEdit,...t}}:{}),setFlowPreview:t(`flowPreview`),setFlowsOpen:t=>e(e=>X(t,e.rightPanel===`flow`&&e.flowEdit===null)?{...r(`flow`),flowEdit:null}:{flowEdit:null,...i(e,`flow`)}),setFlowPlay:t=>e(e=>t?{flowPlay:t,flowPreview:null,...!t.trail?.length&&e.lastFlow[t.frameId]!==t.flowId?{lastFlow:{...e.lastFlow,[t.frameId]:t.flowId}}:{}}:{flowPlay:null}),setAiOpen:t=>e(e=>{let n=X(t,e.rightPanel===`ai`);return n&&e.viewMode?e:n?r(`ai`):i(e,`ai`)??e}),setCodeOpen:t=>e(e=>{let n=X(t,e.rightPanel===`code`);return n&&e.viewMode?e:n?r(`code`):i(e,`code`)??e}),setCodeSeed:t=>e({codeSeed:t}),setPendingBoard:t=>e({pendingBoard:t}),setTextAiSignInOpen:t(`textAiSignInOpen`),setTextAiUpgradeOpen:t(`textAiUpgradeOpen`),setEmbedSignInOpen:t(`embedSignInOpen`),setPaletteOpen:t(`paletteOpen`),setExportDialog:t(`exportDialog`),setImageToCopy:t=>e({imageToCopy:t}),setToolDrawerOpen:t(`toolDrawerOpen`),setSearchOpen:t(`searchOpen`),setZenMode:t(`zenMode`),setRideMode:t(`rideMode`),setViewMode:t=>e(e=>{let n=X(t,e.viewMode);return n?{viewMode:n,tool:`select`,editSession:{kind:`none`},pendingIcon:null,pendingControl:null,erasingIds:new Set,toolDrawerOpen:!1,...e.rightPanel===`ai`||e.rightPanel===`code`?{rightPanel:null}:{}}:e.viewModeLocked?e:{viewMode:n}}),setViewModeLocked:t=>e({viewModeLocked:t}),setPresentingIndex:t(`presentingIndex`),setPasteChoiceGrid:t(`pasteChoiceGrid`),setAiGhost:t=>e({aiGhost:t}),askAi:(t,n=!1)=>e(e=>e.viewMode?e:{...r(`ai`),aiPrompt:{text:t,send:n}}),setAiPrompt:t=>e({aiPrompt:t}),setDeviceMode:t(`deviceMode`),setCoarsePointer:t(`coarsePointer`)}},gn=e=>{let t=Z(e),n=q;return{showGrid:n.showGrid,snapEnabled:n.snapEnabled,theme:n.theme,presentationAnimation:n.presentationAnimation,showZoomIndicator:n.showZoomIndicator,setShowGrid:t(`showGrid`),setSnapEnabled:t(`snapEnabled`),setTheme:t(`theme`),setPresentationAnimation:t(`presentationAnimation`),setShowZoomIndicator:t(`showZoomIndicator`)}},_n=e=>({remoteCursors:new Map,lastPeerPointers:new Map,setRemoteCursors:t=>e(e=>{let n=e.lastPeerPointers;for(let r of t.values()){let t=n.get(r.peerId);t&&t.at>=r.at||(n===e.lastPeerPointers&&(n=new Map(n)),n.set(r.peerId,{x:r.x,y:r.y,at:r.at}))}return{remoteCursors:t,lastPeerPointers:n}})}),vn=e=>({openThreadId:null,commentDraft:null,commentsVisible:!0,setOpenThreadId:t=>e({openThreadId:t,commentDraft:null}),setCommentDraft:t=>e(t?{commentDraft:t,openThreadId:null,commentsVisible:!0}:{commentDraft:null}),setCommentsVisible:Z(e)(`commentsVisible`)}),yn={isPanning:!1,dragging:!1,transforming:!1,resizing:!1,marquee:null,lasso:null,bindTarget:null,snapDot:null};function bn(e){return e.isPanning||e.dragging||e.transforming||e.draft!==null||e.marquee!==null||e.lasso!==null}var xn=e=>{let t=Z(e);return{draft:null,polyDraft:null,marquee:null,lasso:null,bindTarget:null,snapDot:null,hoverWorld:null,snapGuides:[],isPanning:!1,dragging:!1,transforming:!1,resizing:!1,eraserTrail:``,selectionFrame:null,setDraft:t(`draft`),setPolyDraft:t(`polyDraft`),setMarquee:t(`marquee`),setLasso:t(`lasso`),setBindTarget:t(`bindTarget`),setSnapDot:t(`snapDot`),setHoverWorld:t(`hoverWorld`),setSnapGuides:t(`snapGuides`),setIsPanning:t(`isPanning`),setDragging:t(`dragging`),setTransforming:t(`transforming`),setResizing:t(`resizing`),setEraserTrail:t(`eraserTrail`),setSelectionFrame:t(`selectionFrame`),clearSnapGuides:()=>e(e=>e.snapGuides.length===0?e:{snapGuides:[]}),resetGestureVisuals:()=>e(e=>e.snapGuides.length===0&&Object.keys(yn).every(t=>e[t]===yn[t])?e:{...yn,snapGuides:[]})}},Sn=200;function Cn(e){let t={holding:()=>!1},n=_e()(xe((...t)=>({...sn(e)(...t),...mn(...t),...hn(...t),...gn(...t),..._n(...t),...vn(...t),...rn(...t),...xn(...t)}),{partialize:e=>({shapes:e.shapes,opaqueShapes:e.opaqueShapes}),equality:(e,n)=>e.shapes===n.shapes||t.holding(),limit:Sn}));return Object.assign(n,{historyGate:t})}function wn(e,t){let n=Cn(t);return e&&(n.getState().hydrate(e.document,e.viewport,e.preferences),n.temporal.getState().clear()),n}var Tn=(0,m.createContext)(null),En=Tn.Provider;function Dn(){let e=(0,m.useContext)(Tn);if(!e)throw Error(`useEditorRuntime must be called under a mounted <Canvas>. Editor hooks and commands resolve through the canvas's own runtime.`);return e}function On(){return Dn().store}function kn(e){return ye(On(),e)}function An(e,t,n){let r=(0,m.useRef)(null);return kn(i=>{let a=e(i),o=r.current;if(o&&jn(o.inputs,a))return o.value;let s=t(...a),c=o&&n?.(o.value,s)?o.value:s;return r.current={inputs:a,value:c},c})}function jn(e,t){return e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]))}function Mn(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{Oe as A,It as C,Et as D,W as E,Tt as O,Lt as S,Nt as T,Y as _,Dn as a,Vt as b,bn as c,un as d,ln as f,Yt as g,en as h,An as i,ye as j,bt as k,cn as l,J as m,wn as n,kn as o,fn as p,Mn as r,On as s,En as t,dn as u,$t as v,G as w,Ht as x,Bt as y};
@@ -1,6 +0,0 @@
1
- import{B as e,F as t,I as n,O as r,R as i,b as a,s as o}from"./style-BENGW2ZV.js";import{$n as s,An as c,Cn as l,Dn as u,En as d,Ft as f,Gn as p,It as m,Kn as h,Lt as g,Qn as _,Rn as v,Rt as y,Un as b,Vn as x,Vr as S,Yr as C,Zt as w,an as T,ar as ee,cr as E,fr as D,gr as O,hr as te,jn as k,lr as A,mr as j,or as M,pr as N,qn as P,rn as ne,sn as F,sr as re,un as ie,ur as ae,wn as oe}from"./slides-D9bnXqtf.js";import{i as se}from"./registry-DCgwH8wI.js";import{a as ce,m as le,p as ue,t as de}from"./text-breaks-YU-ymaF9.js";import{i as fe,r as I}from"./icon-sources-CZI1h18s.js";import{P as pe,a as me,b as he,c as ge,g as L,i as _e,l as ve,n as ye,o as be,s as xe,y as Se}from"./chart-Z4HQx-0h.js";import{c as Ce,i as we,s as Te,u as Ee}from"./frames-CRP8oPP8.js";import{n as De,t as Oe}from"./connector-labels-vVnYQJRz.js";var ke=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ae=(()=>{let e=new Int8Array(128).fill(-1);for(let t=0;t<64;t+=1)e[ke.charCodeAt(t)]=t;return e})();function je(e){let t=e.replace(/[\s=]+$/g,``).replace(/\s+/g,``),n=``,r=0,i=0;for(let e=0;e<t.length;e+=1){let a=t.charCodeAt(e),o=a<128?Ae[a]:-1;if(o<0)throw Error(`invalid base64`);i=i<<6|o,r+=6,r>=8&&(r-=8,n+=String.fromCharCode(i>>r&255))}return n}var R=`#ffffff`;function z(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function B(e){return String(e).replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`)}function Me(e){let t=Object.entries(e).filter(e=>e[1]!==void 0&&e[1]!==null&&e[1]!==``),n=t.filter(([e,t])=>e!==`style`&&typeof t==`string`&&t.includes(`var(--`));if(n.length===0)return t.map(([e,t])=>`${e}="${B(t)}"`).join(` `);let r=t.find(([e])=>e===`style`)?.[1],i=[...n.map(([e,t])=>`${e}:${t}`),...r?[r]:[]];return[...t.filter(e=>!n.includes(e)&&e[0]!==`style`),[`style`,i.join(`;`)]].map(([e,t])=>`${e}="${B(t)}"`).join(` `)}function V(e,t,n){let r=Me(t);return n===void 0?`<${e}${r?` `+r:``}/>`:`<${e}${r?` `+r:``}>${n}</${e}>`}function H(e,t){if(e)return`rotate(${e} ${t.x+t.width/2} ${t.y+t.height/2})`}function U(e,t,n){if(!t&&!n)return;let r=`scale(${t?-1:1} ${n?-1:1})`;return`translate(${e.x} ${e.y}) ${r} translate(${-e.x} ${-e.y})`}function W(e,t){let n=H(e.rotation??0,t),r=U({x:t.x+t.width/2,y:t.y+t.height/2},e.flipX,e.flipY);return r?n?`${n} ${r}`:r:n}var Ne=`'JetBrains Mono', ui-monospace, monospace`,Pe=.9,Fe=`#fde68a`;function G(e,t){let n=e.fontSize??t;return e.code?n*Pe:n}function K(e,t,n,r,i){let a=t.code?Ne:n,o=G(t,r),s=t.bold?700:i??400;return e.measure(t.text,o,a,s,t.italic)}var q=.55,Ie=1.4,Le=1.4;function Re(e,t){return(e.depth??0)*Le*t}function ze(e){return e.kind===`bullet`?`• `:e.kind===`number`?`${e.text} `:null}function Be(e,t,n,r,i,a){if(!e)return 0;let o=ze(e);return o===null?Ie*t:a.measure(o,t,n,r)+i*o.length}function Ve(e,t,n,r,i,a){let o=r*.8,s=e+r*.25,c=t+(n-o)/2,l=V(`rect`,{x:s,y:c,width:o,height:o,rx:r*.15,fill:i?a:`none`,stroke:a,"stroke-width":1.5});if(!i)return l;let u=V(`path`,{d:`M ${s+o*.24} ${c+o*.54} L ${s+o*.44} ${c+o*.72} L ${s+o*.78} ${c+o*.3}`,fill:`none`,stroke:`#ffffff`,"stroke-width":Math.max(1.5,o*.12),"stroke-linecap":`round`,"stroke-linejoin":`round`});return V(`g`,{opacity:q},l+u)}function He(e,t,n,r,i,a){return ce(e,t,e=>a.measure(e,n,r,i))}function Ue(e){let t=[];for(let n of e)for(let e of n.text.split(/(\s+)/).filter(e=>e.length>0)){let r=e.trim().length===0,i=t[t.length-1];if(i&&i.space===r&&!r){i.piece.push({run:n,text:e});continue}t.push({space:r,piece:[{run:n,text:e}]})}return t}function J(e,t,n){let r=[],i=0;for(let a of e){let e=Array.from(a.text),o=Math.max(t-i,0),s=Math.min(n-i,e.length);o<s&&r.push({run:a.run,text:e.slice(o,s).join(``)}),i+=e.length}return r}function We(e,t,n,r,i,a){let o=[];for(let s of e){let e=Be(s.marker,r,n,i,0,a),c=Math.max(r,t-e-Re(s,r)),l=[],u=0,d=!0,f=null,p=()=>{for(;l.length>0;){let e=l[l.length-1];if(e.text=e.text.replace(/\s+$/,``),e.text.length>0)break;l.pop()}o.push({runs:l,marker:d?s.marker:void 0,checked:s.checked,depth:s.depth}),d=!1,l=[],u=0,f=null},m=(e,t,n)=>{f===e&&l.length>0?l[l.length-1].text+=t:(l.push({...e,text:t}),f=e),u+=n},h=e=>e.reduce((e,t)=>e+K(a,{...t.run,text:t.text},n,r,i),0),g=(e,t)=>{for(let t of e)m(t.run,t.text,K(a,{...t.run,text:t.text},n,r,i));return t},_=e=>u+e<=c;for(let e of Ue(s.runs)){if(e.space){_(h(e.piece))?g(e.piece,0):p();continue}let t=h(e.piece);if(_(t)){g(e.piece,t);continue}if(l.length>0&&p(),t<=c){g(e.piece,t);continue}let n=e.piece.map(e=>e.text).join(``),r=[0,...de(n),Array.from(n).length];for(let t=0;t<r.length-1;t+=1){let n=J(e.piece,r[t],r[t+1]),i=h(n);if(_(i)){g(n,i);continue}if(l.length>0&&p(),i<=c){g(n,i);continue}let a=r[t+1]-r[t],o=0;for(let e=1;e<=a;e+=1){let t=J(n,o,e);e-o>1&&h(t)>c&&(g(J(n,o,e-1),0),p(),o=e-1)}g(J(n,o,a),0)}}p()}return o}function Ge(e){return e.fontSize*(e.lineHeight??1.2)}function Ke(e){return(e.letterSpacing??0)*e.fontSize}function qe(e,t,n,r,i){let a=e;t.background&&(a=V(`rect`,{x:t.x-n/2-10,y:t.y-r/2,width:n+20,height:r,rx:2,fill:i.theme.paint(e=>e.bg,R)})+a);let o=t.rotateCenter;if(!o)return a;let s=[t.rotation?`rotate(${t.rotation} ${o.x} ${o.y})`:void 0,U(o,t.flipX,t.flipY)].filter(Boolean).join(` `);return s?V(`g`,{transform:s},a):a}function Je(e,t,n){if(e)return t.fixedInk?e:n.theme.paint(t=>b(l(e),t),e)}function Y(e,t){if(u(e.text)&&d())return Ye(e,t);let n=r(e.fontFamily),i=e.maxWidth,a=k(e.text).split(`
2
- `);i!==void 0&&(a=a.flatMap(r=>He(r,i,e.fontSize,e.fontFamily,n,t.text)));let o=e.ascent??O(e.fontSize,e.lineHeight??1.2),s=Ge(e),c=Ke(e),l=a.length*s,f=e.vAlign===`center`?e.y-l/2+o:e.vAlign===`bottom`?e.y-l+o:e.y+o,p=a.map((t,n)=>V(`tspan`,{x:e.x,y:f+n*s},z(t)||` `)).join(``);return qe(V(`text`,{"font-family":e.fontFamily,"font-size":e.fontSize,"font-weight":n,fill:e.color,"text-anchor":e.align,"white-space":`pre`,"letter-spacing":c||void 0},p),e,e.background?Math.max(...a.map(r=>t.text.measure(r,e.fontSize,e.fontFamily,n)+c*r.length)):0,l,t)}function Ye(e,t){let n=r(e.fontFamily),i=c(e.text);e.maxWidth!==void 0&&(i=We(i,e.maxWidth,e.fontFamily,e.fontSize,n,t.text));let o=e.lineHeight??1.2,s=e.letterSpacing??0,l=i.map(t=>Math.max(e.fontSize,...t.runs.map(t=>G(t,e.fontSize)))),u=l.map(e=>e*o),d=u.reduce((e,t)=>e+t,0),f=e.vAlign===`center`?e.y-d/2:e.vAlign===`bottom`?e.y-d:e.y,p=[],m=[],h=0,g=f;i.forEach((r,i)=>{let c=e.ascent?e.ascent/e.fontSize*l[i]:O(l[i],o),d=u[i],f=g,_=f+c;g+=d;let v=Be(r.marker,e.fontSize,e.fontFamily,n,s*e.fontSize,t.text),y=r.runs.map(t=>G(t,e.fontSize)),b=r.runs.map((r,i)=>K(t.text,r,e.fontFamily,e.fontSize,n)+s*y[i]*r.text.length),x=b.reduce((e,t)=>e+t,0),S=Re(r,e.fontSize),C=S+v+x;h=Math.max(h,C);let w=e.align===`middle`?e.x-C/2:e.align===`end`?e.x-C:e.x;if(w+=S,r.marker){let t=ze(r.marker);t===null?p.push(Ve(w,f,d,e.fontSize,r.checked,e.color)):m.push(V(`tspan`,{x:w,y:_},z(t))),w+=v}r.runs.forEach((n,i)=>{let o=b[i],c=y[i];n.highlight&&p.push(V(`rect`,{x:w,y:_-c*re,width:o,height:c*(re+E),rx:3,fill:Fe,opacity:r.checked?q:void 0}));let l=[n.href||n.underline?`underline`:``,n.strike?`line-through`:``].filter(Boolean).join(` `);m.push(V(`tspan`,{x:w,y:_,"font-style":n.italic?`italic`:void 0,"font-weight":n.bold?700:void 0,"font-family":n.code?Ne:void 0,"font-size":c===e.fontSize?void 0:c,"letter-spacing":s?s*c:void 0,fill:n.href?a:Je(n.color,e,t),"fill-opacity":r.checked?q:void 0,"text-decoration":l||void 0},z(n.text)||` `)),w+=o})});let _=V(`text`,{"font-family":e.fontFamily,"font-size":e.fontSize,"font-weight":n,fill:e.color,"text-anchor":`start`,"white-space":`pre`},m.join(``));return qe(p.join(``)+_,e,h,d,t)}function Xe(e){return`light`in e&&`dark`in e}function Ze(){return{paint:(e,t)=>t,css:()=>``,rootClass:void 0}}function Qe(e){return{paint:t=>t(e),css:()=>``,rootClass:void 0}}var X=`koboyo-adaptive`;function $e(e){if(t(e.light.bg,1)<.5||t(e.dark.bg,0)>=.5)throw Error(`an adaptive export needs a light palette and a dark one, in that order`);let n=new Map;return{paint(t){let r=t(e.light),i=t(e.dark);return r===i?r:`var(${et(n,r,i)})`},css(){if(n.size===0)return``;let e=e=>[...n].map(([t,n])=>`${t}:${n[e]}`).join(`;`);return`.${X}{${e(0)}}@media (prefers-color-scheme: dark){.${X}{${e(1)}}}`},rootClass:X}}function et(e,t,n){let r=`--kb-${tt(`${t}|${n}`)}`,i=r;for(let a=1;;a+=1){let o=e.get(i);if(!o)return e.set(i,[t,n]),i;if(o[0]===t&&o[1]===n)return i;i=`${r}-${a}`}}function tt(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function nt(e,t){let r=n(e);return rt(e)?t.theme.paint(e=>b(r,e),r):r}function rt(e){return e.fill===`transparent`||e.fill===`#ffffff`||i(e)!==null}function it(e,t){if(!e.label)return``;let n=T(e),r=j(e.kind,n.width,n.height,{x:e.flipX,y:e.flipY}),i={x:n.x+r.left,y:n.y+r.top,width:n.width-r.left-r.right,height:n.height-r.top-r.bottom},a=nt(e,t),o=e.textAlign??`center`,s=e.textVAlign??`middle`,c=e.textPadding??6,l=e.fontSize??20,u=e.titleIcon?.placement===`inside`?N(l)+D(l):0;return Y({text:e.label,fontSize:l,fontFamily:e.fontFamily,color:a,fixedInk:!rt(e),lineHeight:e.lineHeight??1.25,letterSpacing:e.letterSpacing,x:o===`left`?i.x+c+u:o===`right`?i.x+i.width-c:i.x+i.width/2+u/2,y:s===`top`?i.y+c:s===`bottom`?i.y+i.height-c:i.y+i.height/2,align:o===`left`?`start`:o===`right`?`end`:`middle`,vAlign:s===`top`?`top`:s===`bottom`?`bottom`:`center`,maxWidth:i.width-c*2-u,rotation:e.rotation,rotateCenter:{x:i.x+i.width/2,y:i.y+i.height/2}},t)}var at=15;function ot(e){return e.titleIcon?19:0}function st(e,t){let n=e.titleIcon;if(!n||!e.label)return``;let r=T(e),i=r.x,a=r.y-M-14*1.2+O(14,1.2)-14*.35-at/2;return $({source:n.source,name:n.name,srcMap:t.srcMap,icons:t.icons,x:i,y:a,size:at,stroke:t.theme.paint(t=>b(e.color,t),e.color)})}function ct(e,t){if(!e.label)return``;let n=T(e);return st(e,t)+Y({text:e.label,fontSize:14,fontFamily:e.fontFamily,color:t.theme.paint(t=>b(e.color,t),e.color),x:n.x+ot(e),y:n.y-M,align:`start`,vAlign:`bottom`},t)}function lt(e,t){let n=e.lanes??[];if(!Te(e.kind)||n.length===0)return``;let r=Ee(e.kind),i=T(e),a=Ce(n.length,r?i.width:i.height,e.laneSizes),o=t.theme.paint(t=>b(e.color,t),e.color),s=n.map((n,s)=>{if(!n)return``;let c=(a[s]+a[s+1])/2,l=r?i.x+c:i.x+30/2,u=r?i.y+30/2:i.y+c;return Y({text:n,fontSize:14,fontFamily:e.fontFamily,color:o,x:l,y:u,align:`middle`,vAlign:`center`,lineHeight:1,rotation:r?void 0:-90,rotateCenter:r?void 0:{x:l,y:u}},t)}).join(``);return V(`g`,{opacity:we},s)}function ut(e,t){if(!e.label)return null;let n=T(e),i=r(e.fontFamily),a=k(e.label).split(`
3
- `),o=a.length*14*1.2,s=ot(e)+Math.max(...a.map(n=>t.measure(n,14,e.fontFamily,i))),c=n.y-M-o;return{x:n.x,y:c,width:s,height:n.y-c}}function dt(e,t,n,r,i){let a=r.color===`transparent`?v:r.color,s=i.theme.paint(e=>b(a,e),a);return Y({text:e,fontSize:n,fontFamily:r.fontFamily??o,color:s,lineHeight:ae,x:t.x,y:t.y,align:`middle`,vAlign:`center`,background:!0},i)}function ft(e,t,n){let r=e.label??``;return r?dt(r,t,e.fontSize??20,e,n):``}function pt(e,t){let n=``;for(let r of Oe(e))n+=dt(r.text,r.point,14,e,t);return n}function mt(e,t){if(!e.label)return``;let n=T(e),r=n.x+n.width/2,i=e.fontSize??36,a=ne(i),o=e.color===`transparent`?v:e.color;return Y({text:e.label,fontSize:i,fontFamily:e.fontFamily,color:t.theme.paint(e=>b(o,e),o),lineHeight:A,x:r,y:n.y+n.height+a,align:`middle`,vAlign:`top`,rotation:e.rotation,rotateCenter:{x:r,y:n.y+n.height/2}},t)}function ht(e,t){if(!e.text)return``;let n=T(e,t.measurement),i=e.textAlign??`left`,a=e.textVAlign??`top`,o=r(e.fontFamily),s=(e.letterSpacing??0)*e.fontSize,c=e.width??Math.max(...k(e.text).split(`
4
- `).map(n=>t.text.measure(n,e.fontSize,e.fontFamily,o)+s*n.length));return Y({text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,color:t.theme.paint(t=>b(e.color,t),e.color),lineHeight:e.lineHeight??1.15,letterSpacing:e.letterSpacing,x:i===`center`?e.x+c/2:i===`right`?e.x+c:e.x,y:e.height==null||a===`top`?e.y:a===`bottom`?e.y+n.height:e.y+n.height/2,align:i===`center`?`middle`:i===`right`?`end`:`start`,vAlign:e.height==null||a===`top`?`top`:a===`bottom`?`bottom`:`center`,maxWidth:e.width,ascent:O(e.fontSize,e.lineHeight??1.15),rotation:e.rotation,rotateCenter:{x:n.x+n.width/2,y:n.y+n.height/2},flipX:e.flipX,flipY:e.flipY},t)}function Z(e,t,n,r){let i={};for(let[a,o]of Object.entries(e))i[a]=typeof o==`string`?n.paint(e=>s(a,o,t,t=>b(t,e),t=>h(t,e),r?p(r,e):void 0),o):o;return i}function Q(e,t,n=`keep`,r){return e.filter(e=>e!==null).map(e=>V(e.tag,Z(e.attrs,n,t,r))).join(``)}function gt(e,t){let n=T(e),r=ge(e),a={x:0,y:0,width:n.width,height:n.height},o=`translate(${n.x} ${n.y})`,s=H(e.rotation??0,a),c=e.fill===`#ffffff`?`paper`:`keep`,l=i(e)??void 0;return V(`g`,{transform:s?`${o} ${s}`:o},Q([r.shadow],t.theme)+Q([r.fill],t.theme,c,l)+Q(r.strokes,t.theme,`keep`,l))}function _t(e){let t=T(e),n=ve(e),r={x:0,y:0,width:t.width,height:t.height},i=`translate(${t.x} ${t.y})`,a=H(F(e),r);return V(`g`,{transform:a?`${i} ${a}`:i},Q([n.shadow,n.card],Ze()))}function vt(t,n){if(!t.text)return``;let r=T(t),i=t.fill===`transparent`?n.theme.paint(e=>b(v,e),e(t.fill)):e(t.fill);return Y({text:t.text,fontSize:t.fontSize,fontFamily:t.fontFamily,color:i,fixedInk:t.fill!==`transparent`,lineHeight:t.lineHeight??1.25,letterSpacing:t.letterSpacing,x:r.x+r.width/2,y:r.y+r.height/2,align:`middle`,vAlign:`center`,maxWidth:r.width-28,rotation:t.rotation,rotateCenter:{x:r.x+r.width/2,y:r.y+r.height/2}},n)}function yt(e,t){let n=T(e),r=be(e);return V(`g`,{transform:H(F(e),n)},Q([r.outline],t.theme,`paper`)+Q(r.chrome,t.theme))}function bt(e,t){let n=_e(e);return Q(n.strokes,t.theme)+Q(n.heads,t.theme,`ink`)}function xt(e,t){let n=me(e),r=Z(n.attrs,`ink`,t.theme),i=e.highlighter?{style:`mix-blend-mode:${t.theme.paint(x,x())}`}:void 0;return V(n.tag,{...r,opacity:e.opacity,...i})}function St(e,t){return V(`path`,{...Z({d:xe(e.points,e.smooth),fill:e.fill,stroke:e.color},`ink`,t.theme),"stroke-width":e.strokeWidth})}function Ct(e,t){let n=T(e),{x:r,y:i,width:a,height:o}=g(n,e.crop),s=`imgclip-${e.id}`,c=t.srcMap.get(e.src)??e.src,l=V(`clipPath`,{id:s},V(`rect`,{x:n.x,y:n.y,width:n.width,height:n.height,rx:m(e.corner,n)})),u=V(`image`,{href:c,x:r,y:i,width:a,height:o,preserveAspectRatio:`none`,"clip-path":`url(#${s})`});return V(`g`,{transform:W(e,n)},l+u)}function wt(e,t){let n=t.cachedNode(e);return n?n.map(([e,t])=>V(e,t)).join(``):``}function Tt(e){let t=/^data:image\/svg\+xml(;base64)?,([\s\S]*)$/.exec(e.dataUrl);if(!t)return null;let n;try{n=t[1]?je(t[2]):decodeURIComponent(t[2])}catch{return null}let r=/<svg\b[^>]*>/i.exec(n),i=n.lastIndexOf(`</svg>`);if(!r||i<0)return null;let a=/viewBox="([^"]*)"/i.exec(r[0])?.[1];if(!a)return null;let o={x:e.x,y:e.y,width:e.size,height:e.height,viewBox:a,fill:`currentColor`,color:e.ink},s=a.trim().split(/[\s,]+/).map(Number),[,,c,l]=s,u=s.length===4&&c>0&&l>0?Math.min(e.size/c,e.height/l):1,d=(e.weight??0)/u,f=n.slice(r.index+r[0].length,i);if(d>0)o.overflow=`visible`,o.stroke=`currentColor`,o[`stroke-width`]=d,o[`stroke-linejoin`]=`round`,o[`stroke-linecap`]=`round`;else if(d<0&&e.weightId){let t=`mono-erode-${e.weightId}`;f=V(`filter`,{id:t},V(`feMorphology`,{operator:`erode`,radius:-d/4}))+V(`g`,{filter:`url(#${t})`},f)}return V(`svg`,o,f)}function $(e){let{source:t,name:n,srcMap:r,icons:i,x:a,y:o,size:s,height:c=e.size,stroke:l,strokeWidth:u=2,weight:d,weightId:f}=e;if(I(t)){let e=i.assetIconUrl(t,n),u=r.get(e);if(u&&fe(t)){let e=Tt({dataUrl:u,x:a,y:o,size:s,height:c,ink:l,weight:d,weightId:f});if(e)return e}return V(`image`,{href:u??e,x:a,y:o,width:s,height:c})}return V(`g`,{transform:`translate(${a} ${o}) scale(${s/24})`,fill:`none`,stroke:l,"stroke-width":u,"stroke-linecap":`round`,"stroke-linejoin":`round`},wt(n,i))}function Et(e,t,n){let r=T(t),i=te(t.kind,r.width,r.height,{x:t.flipX,y:t.flipY}),a=r.x+i.x-28/2,o=r.y+i.y-28/2,s=V(`rect`,{x:a,y:o,width:28,height:28,rx:6,fill:`#ffffff`,stroke:t.color,"stroke-width":1.5}),c=$({source:e.source,name:e.name,srcMap:n.srcMap,icons:n.icons,x:a+5,y:o+5,size:18,stroke:t.color});return V(`g`,{transform:H(t.rotation??0,r)},s+c)}function Dt(e,t,n){let i=T(t),a=t.fontSize??20,o=N(a),s=D(a),c=t.textPadding??6,l=t.textAlign??`center`,u=t.textVAlign??`middle`,d=r(t.fontFamily),f=k(t.label).split(`
5
- `),p=j(t.kind,i.width,i.height,{x:t.flipX,y:t.flipY}),m=Math.max(a,i.width-p.left-p.right-c*2-o-s),h=f.map(e=>n.text.measure(e,a,t.fontFamily,d)),g=Math.min(m,Math.max(0,...h)),_=h.reduce((e,t)=>e+Math.max(1,Math.ceil(t/m)),0)*(a*(t.lineHeight??1.25)),v=u===`top`?i.y+c:u===`bottom`?i.y+i.height-c-_:i.y+i.height/2-_/2,y=o+s+g,b=l===`left`?i.x+c:l===`right`?i.x+i.width-c-y:i.x+i.width/2-y/2,x=v+O(a,t.lineHeight??1.25)-a*.3-o/2,S=nt(t,n),C=$({source:e.source,name:e.name,srcMap:n.srcMap,icons:n.icons,x:b,y:x,size:o,stroke:S});return V(`g`,{transform:H(t.rotation??0,i)},C)}function Ot(e,t){let n=T(e),r=n.width/24,i=$({source:e.source,name:e.name,srcMap:t.srcMap,icons:t.icons,x:n.x,y:n.y,size:n.width,height:n.height,stroke:t.theme.paint(t=>b(e.color,t),e.color),strokeWidth:r>0?f(e.strokeWidth,n.width)/r:e.strokeWidth,weight:y(e.strokeWidth,n.width),weightId:e.id});return V(`g`,{transform:W(e,n)},i)}function kt(e,t){let n=pe(e),r=V(`rect`,{x:n.frame.x,y:n.frame.y,width:n.frame.width,height:n.frame.height,fill:t.theme.paint(e=>P(`#ffffff`,e),`#ffffff`),stroke:L,"stroke-width":1});for(let e of n.cellFills)r+=V(`rect`,{x:e.rect.x,y:e.rect.y,width:e.rect.width,height:e.rect.height,fill:t.theme.paint(t=>P(e.fill,t),e.fill)});for(let e of n.dividers)r+=V(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:L,"stroke-width":1});for(let n=0;n<e.cells.length;n+=1)for(let i=0;i<e.cells[n].length;i+=1){let a=e.cells[n][i];if(!a)continue;let o=Se(e,n,i),s=he(e,n,i);r+=Y({text:a,fontSize:s.fontSize,fontFamily:s.fontFamily,color:t.theme.paint(e=>b(s.color,e),s.color),x:o.x+8,y:o.y+o.height/2,align:`start`,vAlign:`center`,maxWidth:Math.max(1,o.width-16),lineHeight:A},t)}return r}function At(e,t){let n=e=>e===void 0?void 0:t.paint(t=>_(e,t),_(e));return e.kind===`rect`?V(`rect`,{x:e.x,y:e.y,width:e.width,height:Math.max(0,e.height),rx:e.rx,fill:n(e.fill)}):e.kind===`line`?V(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:n(e.stroke),"stroke-width":e.width}):e.kind===`polyline`?V(`polyline`,{points:e.points.map(e=>`${e.x},${e.y}`).join(` `),fill:`none`,stroke:n(e.stroke),"stroke-width":e.width,"stroke-linecap":`round`,"stroke-linejoin":`round`}):e.kind===`path`?V(`path`,{d:e.d,fill:n(e.fill)??`none`,"fill-opacity":e.fillOpacity,stroke:n(e.stroke)??`none`,"stroke-width":e.width}):e.kind===`circle`?V(`circle`,{cx:e.cx,cy:e.cy,r:e.r,fill:n(e.fill),stroke:n(e.stroke),"stroke-width":e.width}):V(`text`,{x:e.x,y:e.y,"font-family":e.family,"font-size":e.size,fill:n(e.color),"text-anchor":e.anchor,"dominant-baseline":e.baseline,transform:e.rotate?`rotate(${e.rotate} ${e.x} ${e.y})`:void 0},z(e.text))}function jt(e,t){let n=T(e),r=t.theme.paint(e=>P(R,e),R),i=V(`rect`,{x:n.x,y:n.y,width:n.width,height:n.height,rx:4,fill:r});for(let n of ye(e))n.testId!==`chart-empty`&&(i+=At(n,t.theme));return V(`g`,{transform:H(F(e),n)},i)}function Mt(e,t){let n=T(e),r=``;for(let n of se(e,t.text))r+=At(n,t.theme);return V(`g`,{transform:H(F(e),n)},r)}function Nt(e,t){let n=Pt(e,t);return!n||e.type===`draw`||!(e.opacity<1)?n:V(`g`,{opacity:e.opacity},n)}function Pt(e,t){switch(e.type){case`rectangle`:return gt(e,t)+it(e,t)+(e.titleIcon?e.titleIcon.placement===`inside`?Dt(e.titleIcon,e,t):Et(e.titleIcon,e,t):``);case`sticky`:return _t(e)+vt(e,t);case`figure`:return yt(e,t)+lt(e,t)+ct(e,t);case`arrow`:return bt(e,t)+ft(e,C(e),t)+pt(e,t);case`line`:return bt(e,t)+ft(e,S(e.points,e.labelAlong),t);case`draw`:return xt(e,t);case`polygon`:return St(e,t);case`image`:return Ct(e,t);case`icon`:return Ot(e,t)+mt(e,t);case`text`:return ht(e,t);case`table`:return kt(e,t);case`chart`:return jt(e,t);case`control`:return Mt(e,t);default:return ie(e)}}async function Ft(e,t,n){let r=new Set;for(let n of e)n.type===`image`&&!n.src.startsWith(`data:`)&&r.add(n.src),n.type===`icon`&&I(n.source)&&r.add(t.assetIconUrl(n.source,n.name)),(n.type===`rectangle`||n.type===`figure`)&&n.titleIcon&&I(n.titleIcon.source)&&r.add(t.assetIconUrl(n.titleIcon.source,n.titleIcon.name));let i=new Map;return await Promise.all([...r].map(async e=>{let t=await n.inline(e);if(t){i.set(e,t);return}le(`asset-inline`,Error(`asset was not inlined`),e)})),i}function It(e){let t=e.filter(e=>e.type===`figure`),n=e.filter(e=>e.type!==`figure`);return[...t,...n]}function Lt(e){return e?Xe(e)?$e(e):Qe(e):Ze()}async function Rt(e,t,n={}){await oe();let r=n.padding??16,i=n.bounds??w(e,n.measurement);if(!i)return V(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:1,height:1});let a=i.x,o=i.y,s=i.x+i.width,c=i.y+i.height;if(!n.bounds)for(let n of e){let e=[];if(n.type===`figure`){let r=ut(n,t.text);r&&e.push(r)}else(n.type===`arrow`||n.type===`line`)&&e.push(...De(n,t.text));for(let t of e)a=Math.min(a,t.x),o=Math.min(o,t.y),s=Math.max(s,t.x+t.width),c=Math.max(c,t.y+t.height)}let l={x:a,y:o,width:s-a,height:c-o};await t.text.prepare(n.fonts);let[,u,d]=await Promise.all([t.icons.ensureCatalog().catch(e=>{le(`icon-catalog`,e)}),n.embedFonts===!1?Promise.resolve(``):t.fonts.embed(ue(e),n.fonts),Ft(e,t.icons,t.assets)]),f=l.x-r,p=l.y-r,m=Math.max(1,Math.round(l.width+r*2)),h=Math.max(1,Math.round(l.height+r*2)),g=Lt(n.palette),_={text:t.text,icons:t.icons,srcMap:d,theme:g,measurement:n.measurement},v=It(e).map(e=>{let t=Nt(e,_),n=e.type===`rectangle`||e.type===`control`?ee(e.link):void 0;return n?V(`a`,{href:n,target:`_blank`,rel:`noopener`},t):t}).join(``),y=n.palette!==void 0&&Xe(n.palette),b=n.background??(y?g.paint(e=>e.bg,`#ffffff`):`#ffffff`),x=b===`transparent`?``:V(`rect`,{x:0,y:0,width:m,height:h,fill:b}),S=[u,g.css()].filter(Boolean).join(`
6
- `),C=S?V(`defs`,{},V(`style`,{type:`text/css`},`\n${S}\n`)):``,T=V(`g`,{transform:`translate(${-f} ${-p})`},v),E=n.width?{width:n.width,height:Math.max(1,Math.round(h*n.width/m))}:{width:m,height:h},D=n.title?V(`title`,{},z(n.title)):``;return V(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,class:g.rootClass,role:n.title?`img`:void 0,"aria-label":n.title,width:E.width,height:E.height,viewBox:`0 0 ${m} ${h}`},D+C+x+T)}function zt(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}export{Rt as n,zt as t};