koboyo 0.4.0 → 0.5.1

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 (169) hide show
  1. package/README.md +26 -0
  2. package/assets/editor/assets/ContextMenuTrigger-C6XZ9rqq.js +1 -0
  3. package/assets/editor/assets/{IconHelp-CaEwHrsN.js → IconHelp-Bf6OkQYw.js} +2 -2
  4. package/assets/editor/assets/IconReplace-CYUD1RLF.js +1 -0
  5. package/assets/editor/assets/IconSquare-Ce_qY-mF.js +1 -0
  6. package/assets/editor/assets/MenuSubmenuTrigger-CTLO1z_0.js +1 -0
  7. package/assets/editor/assets/{PopoverPopup-B3Y0VRYc.js → PopoverPopup-CvnB7nJs.js} +1 -1
  8. package/assets/editor/assets/asset-glyph-Dxg-7b67.js +1 -0
  9. package/assets/editor/assets/build-pips-DsgLkk6R.js +1 -0
  10. package/assets/editor/assets/build-visibility-0Y4EP2Ka.js +1 -0
  11. package/assets/editor/assets/builders-hABCgtrj.js +1 -0
  12. package/assets/editor/assets/{chrome-layout-BzPU9far.js → chrome-layout-500Q9pcx.js} +1 -1
  13. package/assets/editor/assets/code-panel-CHMqHqc6.js +18 -0
  14. package/assets/editor/assets/color-swatches-BC1-16T-.js +1 -0
  15. package/assets/editor/assets/{command-palette-BR-_ChOL.js → command-palette-BNj4FPOh.js} +1 -1
  16. package/assets/editor/assets/connector-labels-piWvprqQ.js +2 -0
  17. package/assets/editor/assets/{copy-image-dialog-BzGP7Xw8.js → copy-image-dialog-BdQfoSGr.js} +1 -1
  18. package/assets/editor/assets/core-DnS-1skV.js +1 -0
  19. package/assets/editor/assets/create-Bd0K44Bi.js +1 -0
  20. package/assets/editor/assets/custom-shape-view-_TxDE4zO.js +1 -0
  21. package/assets/editor/assets/custom-shapes-D3n9PjCN.js +1 -0
  22. package/assets/editor/assets/diagram-fingerprint-CtYYDDQV.js +3 -0
  23. package/assets/editor/assets/edit-NIyQT3d_.js +1 -0
  24. package/assets/editor/assets/editor-CpiNbiMQ.js +1 -0
  25. package/assets/editor/assets/{elk-api-C4wlHVIw.js → elk-api-DfUWdVFD.js} +1 -1
  26. package/assets/editor/assets/elk-worker-loader-D09QKxa0.js +3 -0
  27. package/assets/editor/assets/embed-input-D77Udvni.js +1 -0
  28. package/assets/editor/assets/excalidraw-D0kr_KKg.js +1 -0
  29. package/assets/editor/assets/export-DUFOrZJ-.js +6 -0
  30. package/assets/editor/assets/export-HJI2Aq3h.js +2 -0
  31. package/assets/editor/assets/export-dialog-Edoe6LBK.js +1 -0
  32. package/assets/editor/assets/flow-layer-DX6oKkg8.js +1 -0
  33. package/assets/editor/assets/flow-panel-BsbC8WAJ.js +1 -0
  34. package/assets/editor/assets/flow-stage-DFvraJ0j.js +1 -0
  35. package/assets/editor/assets/{flow-start-CpAvU-9P.js → flow-start-D_gK7Gur.js} +1 -1
  36. package/assets/editor/assets/flows-BAU4NQGk.js +3 -0
  37. package/assets/editor/assets/frames-C-jROub3.js +5 -0
  38. package/assets/editor/assets/generate-BWJhhTxM.js +26 -0
  39. package/assets/editor/assets/geometry-CVRSymIE.js +1 -0
  40. package/assets/editor/assets/icon-picker-cggWIJiD.js +1 -0
  41. package/assets/editor/assets/icons-K7FjuB-c.js +2 -0
  42. package/assets/editor/assets/{image-library-JQu_tb8P.js → image-library-BG41F2Zi.js} +1 -1
  43. package/assets/editor/assets/{index-DBrN0u0i.css → index-B0dKwEIM.css} +1 -1
  44. package/assets/editor/assets/index-BSs3RHtR.js +25 -0
  45. package/assets/editor/assets/layout-offthread-3DtYtT7h.js +18 -0
  46. package/assets/editor/assets/layout.worker-B99h3Wv0.js +28 -0
  47. package/assets/editor/assets/menu-rOnlAYaK.js +1 -0
  48. package/assets/editor/assets/mermaid-paste-C1_G99Lz.js +1 -0
  49. package/assets/editor/assets/panel-controls-BT48HF6c.js +1 -0
  50. package/assets/editor/assets/{panel-shell-BnMOHgWM.js → panel-shell-CSvihB5L.js} +1 -1
  51. package/assets/editor/assets/plan-BS_pzMjA.js +1 -0
  52. package/assets/editor/assets/presentation-DlKoEXsq.js +1 -0
  53. package/assets/editor/assets/{presenter-keys-Bs3LnmOa.js → presenter-keys-uSrN0NG3.js} +1 -1
  54. package/assets/editor/assets/rich-paste-route-Bx69sREx.js +1 -0
  55. package/assets/editor/assets/ride-overlay-ChaS8O9D.js +1 -0
  56. package/assets/editor/assets/selection-overlay-primitives-DXtdWjNx.js +1 -0
  57. package/assets/editor/assets/shape-meta-CZ0aZy7a.js +1 -0
  58. package/assets/editor/assets/shape-render-PK6dqxxf.js +1 -0
  59. package/assets/editor/assets/shapes-CHDGoELO.js +11 -0
  60. package/assets/editor/assets/shared-DKcKntwk.js +1 -0
  61. package/assets/editor/assets/{slide-notes-dialog-BQBXpep6.js → slide-notes-dialog-CypGkEmF.js} +1 -1
  62. package/assets/editor/assets/slides-panel-D22Fponu.js +26 -0
  63. package/assets/editor/assets/table-PnIQtvp1.js +7 -0
  64. package/assets/editor/assets/text-breaks-BDwq8Wxj.js +7 -0
  65. package/assets/editor/assets/{theme-palette-Dl_G_VIJ.js → theme-palette-DZtiNUYJ.js} +1 -1
  66. package/assets/editor/assets/tidy-browser-DqAPzbkG.js +1 -0
  67. package/assets/editor/assets/tidy-scope-CQinfwtO.js +1 -0
  68. package/assets/editor/assets/tldraw-DSRiyEEW.js +2 -0
  69. package/assets/editor/assets/tool-catalog-DM8xoisn.js +1 -0
  70. package/assets/editor/assets/tool-drawer-hovu85Xd.js +1 -0
  71. package/assets/editor/assets/{tooltip-CyBz17g8.js → tooltip-ClTJbfBH.js} +1 -1
  72. package/assets/editor/assets/tree-Ch-RF7UJ.js +1 -0
  73. package/assets/editor/assets/use-export-command-CZva79qg.js +2 -0
  74. package/assets/editor/assets/use-grid-keyboard-nav-BhzrY178.js +0 -0
  75. package/assets/editor/assets/{use-icon-node-BxqH7H27.js → use-icon-node-B5V42drv.js} +1 -1
  76. package/assets/editor/assets/{use-key-held-094C3Mn3.js → use-key-held-DRn09Hq8.js} +1 -1
  77. package/assets/editor/assets/use-web-environment-Ce65LEhf.js +1 -0
  78. package/assets/editor/assets/useTriggerFocusGuards-Mibi8yYw.js +1 -0
  79. package/assets/editor/assets/web-card-BTru0lge.js +1 -0
  80. package/assets/editor/assets/web-card-font-BbZEq3En.js +1 -0
  81. package/assets/editor/assets/web-controls-DIAT8wcZ.js +1 -0
  82. package/assets/editor/assets/web-embed-dialog-CnaSzcu9.js +1 -0
  83. package/assets/editor/assets/web-embed-url-CHu4SU82.js +1 -0
  84. package/assets/editor/assets/web-embeds-I3saJ_yp.js +1 -0
  85. package/assets/editor/assets/web-html-dialog-DpkLs7qD.js +1 -0
  86. package/assets/editor/assets/web-runtime-DNdRiAlf.js +1 -0
  87. package/assets/editor/assets/web-widget-limits-DeMquLIR.js +1 -0
  88. package/assets/editor/assets/web-widgets-DsFUBhiq.js +325 -0
  89. package/assets/editor/assets/widget-source-C3N9ZKTz.js +2 -0
  90. package/assets/editor/assets/widget-target-C9a207gT.js +1 -0
  91. package/assets/editor/index.html +46 -40
  92. package/dist/koboyo.js +605 -269
  93. package/package.json +3 -3
  94. package/skills/koboyo/SKILL.md +8 -3
  95. package/skills/koboyo/references/architecture.md +3 -1
  96. package/skills/koboyo/references/bpmn.md +1 -1
  97. package/skills/koboyo/references/chart.md +1 -1
  98. package/skills/koboyo/references/cycle.md +1 -1
  99. package/skills/koboyo/references/erd.md +1 -1
  100. package/skills/koboyo/references/flowchart.md +1 -1
  101. package/skills/koboyo/references/funnel.md +1 -1
  102. package/skills/koboyo/references/gantt.md +1 -1
  103. package/skills/koboyo/references/gitgraph.md +1 -1
  104. package/skills/koboyo/references/journey.md +1 -1
  105. package/skills/koboyo/references/matrix.md +1 -1
  106. package/skills/koboyo/references/mindmap.md +1 -1
  107. package/skills/koboyo/references/orgchart.md +1 -1
  108. package/skills/koboyo/references/pyramid.md +1 -1
  109. package/skills/koboyo/references/sankey.md +1 -1
  110. package/skills/koboyo/references/sequence.md +1 -1
  111. package/skills/koboyo/references/statemachine.md +1 -1
  112. package/skills/koboyo/references/timeline.md +1 -1
  113. package/skills/koboyo/references/venn.md +1 -1
  114. package/skills/koboyo/references/wireframe.md +1 -1
  115. package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +0 -1
  116. package/assets/editor/assets/asset-glyph-C1E6cGwM.js +0 -1
  117. package/assets/editor/assets/build-pips-BV-uwXlP.js +0 -1
  118. package/assets/editor/assets/build-visibility-DyML9SHt.js +0 -1
  119. package/assets/editor/assets/builders-DMHAOPEv.js +0 -1
  120. package/assets/editor/assets/chart-4iRduYdU.js +0 -7
  121. package/assets/editor/assets/code-panel-koBUgEWp.js +0 -43
  122. package/assets/editor/assets/connector-labels-CrEgadsC.js +0 -2
  123. package/assets/editor/assets/core-CmsJyU_-.js +0 -1
  124. package/assets/editor/assets/diagram-fingerprint-WGQ5iVXx.js +0 -3
  125. package/assets/editor/assets/edit-C0sBxxsg.js +0 -1
  126. package/assets/editor/assets/editor-BeufBV54.js +0 -1
  127. package/assets/editor/assets/elk-worker-loader-CVBdN1je.js +0 -3
  128. package/assets/editor/assets/excalidraw-BwgRIDi9.js +0 -1
  129. package/assets/editor/assets/export-Bce6ra0N.js +0 -2
  130. package/assets/editor/assets/export-K2VWg76n.js +0 -6
  131. package/assets/editor/assets/export-dialog-x2n2a4KX.js +0 -1
  132. package/assets/editor/assets/flow-layer-ewaL7g2y.js +0 -1
  133. package/assets/editor/assets/flow-panel-BzXNGGke.js +0 -1
  134. package/assets/editor/assets/flow-stage-Ba_CAggI.js +0 -1
  135. package/assets/editor/assets/flows-Cj7AFMIA.js +0 -3
  136. package/assets/editor/assets/frames-Cp1QD3LR.js +0 -1
  137. package/assets/editor/assets/icon-picker-Cg39IKNJ.js +0 -1
  138. package/assets/editor/assets/icon-sources-CZI1h18s.js +0 -1
  139. package/assets/editor/assets/icons-DzW1j-r3.js +0 -2
  140. package/assets/editor/assets/index-CBPPqsiR.js +0 -24
  141. package/assets/editor/assets/layout-offthread-mRHRulkS.js +0 -18
  142. package/assets/editor/assets/layout.worker-CekYkaxO.js +0 -27
  143. package/assets/editor/assets/menu-B9BAk63v.js +0 -1
  144. package/assets/editor/assets/panel-controls-DWVXiNUZ.js +0 -1
  145. package/assets/editor/assets/plan-CkgM52Yh.js +0 -1
  146. package/assets/editor/assets/presentation-DJUO0t7I.js +0 -1
  147. package/assets/editor/assets/reflow-DaYiVkwp.js +0 -1
  148. package/assets/editor/assets/registry-rEGZW7Ab.js +0 -1
  149. package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +0 -1
  150. package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +0 -1
  151. package/assets/editor/assets/shape-meta-COE2ATNh.js +0 -1
  152. package/assets/editor/assets/shared-DjLCTIA9.js +0 -1
  153. package/assets/editor/assets/slides-D686obFO.js +0 -15
  154. package/assets/editor/assets/slides-panel-BEJCevJi.js +0 -26
  155. package/assets/editor/assets/style-BENGW2ZV.js +0 -1
  156. package/assets/editor/assets/text-breaks-DM4W6y5f.js +0 -7
  157. package/assets/editor/assets/tidy-browser-dF3BON7J.js +0 -1
  158. package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +0 -1
  159. package/assets/editor/assets/tldraw-CE87oKyq.js +0 -2
  160. package/assets/editor/assets/tool-catalog-DXPhX2S1.js +0 -1
  161. package/assets/editor/assets/tool-drawer-CWOX_njp.js +0 -1
  162. package/assets/editor/assets/tree-KSgPjntC.js +0 -1
  163. package/assets/editor/assets/use-export-command-sC9UHj3_.js +0 -2
  164. package/assets/editor/assets/use-grid-keyboard-nav-DhQKecO1.js +0 -0
  165. package/assets/editor/assets/web-controls-CLE9zr7i.js +0 -1
  166. package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +0 -1
  167. package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +0 -1
  168. package/assets/editor/assets/web-shape-C941TGTy.js +0 -1
  169. package/assets/editor/assets/widget-source-CHujvUeA.js +0 -1
@@ -0,0 +1,11 @@
1
+ import{n as e,t}from"./web-embed-url-CHu4SU82.js";import{n,r}from"./web-widget-limits-DeMquLIR.js";import{D as i,S as a,_ as o,a as s,c,et as l,g as u,h as d,i as f,k as p,m,nt as h,rt as g,s as _,u as v,y}from"./geometry-CVRSymIE.js";var ee={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function b(e){return e.replace(/[&<>"']/g,e=>ee[e])}function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var S=1024*1024,te=256;function ne(){return{issues:[],capped:!1,unknownEnum:0}}function C(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 w={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 T(e,t,n){return typeof n==`number`&&Number.isFinite(n)?!0:(C(e,t,`expected a finite number`),!1)}function E(e,t,n){return typeof n==`string`?!0:(C(e,t,`expected a string`),!1)}function re(e,t,n){return typeof n==`boolean`?!0:(C(e,t,`expected a boolean`),!1)}function D(e,t,n,r){return typeof n==`string`?!r&&n.length===0?(C(e,t,`id must not be empty`),!1):n.length>te?(C(e,t,`id is too long`),!1):!0:(C(e,t,`expected a string id`),!1)}function O(e,t,n,r){return typeof n==`string`&&r.has(n)?!0:(C(e,t,`not an allowed value`,typeof n==`string`),!1)}function k(e,t,n){return typeof n==`number`&&Number.isFinite(n)&&n>=0&&n<=1?!0:(C(e,t,`expected a number in 0..1`),!1)}function ie(e,t,n){return typeof n==`number`&&Number.isFinite(n)&&n>=-.2&&n<=1.2?!0:(C(e,t,`expected a number in -0.2..1.2`),!1)}function ae(e,t,n){if(!x(n))return C(e,t,`expected a point`),!1;let r=T(e,`${t}.x`,n.x),i=T(e,`${t}.y`,n.y);return r&&i}function oe(e,t,n){if(!Array.isArray(n))return C(e,t,`expected an array of points`),!1;let r=!0;for(let i=0;i<n.length&&!e.capped;i+=1)ae(e,`${t}[${i}]`,n[i])||(r=!1);return r}function se(e,t,n,r){t[r]!==void 0&&T(e,`${n}.${r}`,t[r])}function ce(e,t,n,r){t[r]!==void 0&&E(e,`${n}.${r}`,t[r])}function le(e,t,n,r){t[r]!==void 0&&re(e,`${n}.${r}`,t[r])}function ue(e,t,n,r,i){t[r]!==void 0&&O(e,`${n}.${r}`,t[r],i)}var de=[`solid`,`dashed`,`dotted`,`none`],fe=[`curved`,`elbow`],pe=[`arrow`,`sweep`,`triangle`,`triangleOutline`,`diamond`,`diamondOutline`,`circle`,`circleOutline`,`bar`,`cross`,`crowOne`,`crowMany`,`crowOneOrMany`,`crowOnlyOne`,`crowZeroOrOne`,`crowZeroOrMany`],me=[`pastel`,`bold`,`outline`,`shadow`],he=[`left`,`center`,`right`],ge=[`top`,`middle`,`bottom`],_e=[`n`,`s`,`e`,`w`,`ne`,`nw`,`se`,`sw`],ve=`rectangle.ellipse.diamond.triangle.oval.parallelogram.trapezoid.cylinder.note.hexagon.star.checkbox.crossbox.heart.cloud.arrow-up.arrow-down.arrow-left.arrow-right.plus.speech-bubble.bolt.queue.callout.document.predefined-process.manual-input.pentagon.chevron.octagon.cube.actor.double-circle.card.delay.fork-join.multi-document.multi-process.package.component.brace`.split(`.`),ye=[`fade`,`rise`,`scale`,`pop`,`blur`,`wipe`,`draw`,`type`,`pulse`,`shake`,`glow`],be=[`up`,`down`,`left`,`right`],xe=[`enter`,`emphasis`,`exit`],Se=[`sharp`,`rounded`],Ce=[`simple`,`phone`,`tablet`,`browser`,`window`,`lanes`,`vlanes`,`boundary`],we=[`call`,`async`,`reply`],Te=[`bar`,`line`,`area`,`scatter`,`pie`,`donut`,`radar`,`quadrant`],Ee=[`number`,`percent`,`currency`],De=`button.input.search.checkbox.radio.toggle.dropdown.slider.navbar.tabs.image.avatar.heading.paragraph.divider.link.textarea.stepper.badge.progress.breadcrumbs.pagination.rating.card.list.alert.menu.tooltip.accordion.datepicker.sidebar.scrollbar.segmented.tabbar.statusbar.fab.stepbadge`.split(`.`),Oe=[`embed`,`html`],ke=/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9-]*$/,Ae=new Set(ve),je=new Set(pe),Me=new Set(de),Ne=new Set(me),Pe=new Set(Se),Fe=new Set(he),Ie=new Set(ge),Le=new Set(fe),Re=new Set(Te),ze=new Set(Ee),Be=new Set(Ce),Ve=new Set(_e),He=new Set(we),Ue=new Set(Oe),We={modal:!0,entity:!0,lifeline:!0,fragment:!0},Ge=new Set([...De,...Object.keys(We)]),Ke=new Set([`hanging`,`inside`]),qe=new Set([`x`,`y`]);function Je(e,t,n){D(e,`${t}.id`,n.id,!1),n.groupId!==void 0&&D(e,`${t}.groupId`,n.groupId,!0),n.lockId!==void 0&&D(e,`${t}.lockId`,n.lockId,!0),le(e,n,t,`locked`),Ye(e,t,n.animations)}function Ye(e,t,n){if(n!==void 0){if(!Array.isArray(n)){C(e,`${t}.animations`,`expected an array`);return}n.forEach((n,r)=>{Xe(e,`${t}.animations[${r}]`,n)})}}function Xe(e,t,n){if(!x(n)){C(e,t,`expected an object`);return}T(e,`${t}.step`,n.step),E(e,`${t}.kind`,n.kind),E(e,`${t}.effect`,n.effect),ce(e,n,t,`direction`),se(e,n,t,`duration`),se(e,n,t,`delay`),le(e,n,t,`afterPrevious`)}function Ze(e,t,n){if(n!==null){if(!x(n)){C(e,t,`expected a binding or null`);return}if(n.kind===`path`){D(e,`${t}.shapeId`,n.shapeId,!0),(typeof n.seg!=`number`||!Number.isInteger(n.seg)||n.seg<0)&&C(e,`${t}.seg`,`expected a nonnegative integer segment`),k(e,`${t}.t`,n.t);return}if(D(e,`${t}.shapeId`,n.shapeId,!0),ae(e,`${t}.anchor`,n.anchor)){let r=n.anchor;ie(e,`${t}.anchor.x`,r.x),ie(e,`${t}.anchor.y`,r.y)}re(e,`${t}.precise`,n.precise),ue(e,n,t,`port`,Ve)}}function Qe(e,t,n,r){if(n!==void 0){if(!x(n)){C(e,`${t}.titleIcon`,`expected an object`);return}E(e,`${t}.titleIcon.source`,n.source),E(e,`${t}.titleIcon.name`,n.name),r&&ue(e,n,`${t}.titleIcon`,`placement`,Ke)}}function $e(e,t,n){if(n===void 0)return;if(typeof n!=`object`||!n){C(e,t,`expected an object`);return}let r=n;E(e,`${t}.from`,r.from),E(e,`${t}.to`,r.to);for(let n of[`fromTop`,`fromSpan`,`toTop`,`toSpan`])T(e,`${t}.${n}`,r[n])}function et(e,t,n){if(!x(n)){C(e,t,`expected a crop rectangle`);return}let r=k(e,`${t}.x`,n.x),i=k(e,`${t}.y`,n.y),a=k(e,`${t}.width`,n.width),o=k(e,`${t}.height`,n.height);r&&a&&n.x+n.width>1.000001&&C(e,t,`crop extends past the source width`),i&&o&&n.y+n.height>1.000001&&C(e,t,`crop extends past the source height`)}function tt(e,t,n){if(n!==void 0){if(!Array.isArray(n)){C(e,t,`expected an array of strings`);return}for(let r=0;r<n.length&&!e.capped;r+=1)E(e,`${t}[${r}]`,n[r])}}function nt(e,t,n){if(n!==void 0){if(!Array.isArray(n)){C(e,t,`expected an array of numbers`);return}for(let r=0;r<n.length&&!e.capped;r+=1)T(e,`${t}[${r}]`,n[r])}}function rt(e,t,n){if(!Array.isArray(n)){C(e,t,`expected an array of numbers in 0..1`);return}for(let r=0;r<n.length&&!e.capped;r+=1)k(e,`${t}[${r}]`,n[r])}function it(e,t,n){let r=n.cells,i=n.colWidths,a=n.rowHeights,o=at(e,`${t}.colWidths`,i);at(e,`${t}.rowHeights`,a);let s=o&&Array.isArray(i)?i.length:null;if(!Array.isArray(r)){C(e,`${t}.cells`,`expected a grid of rows`);return}Array.isArray(a)&&a.length!==r.length&&C(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)){C(e,`${t}.cells[${n}]`,`expected a row of cells`);continue}s!==null&&i.length!==s&&C(e,`${t}.cells[${n}]`,`row width does not match colWidths`);for(let r=0;r<i.length;r+=1)E(e,`${t}.cells[${n}][${r}]`,i[r])}ot(e,`${t}.cellStyles`,n.cellStyles,r)}function at(e,t,n){if(!Array.isArray(n))return C(e,t,`expected an array of numbers`),!1;let r=!0;for(let i=0;i<n.length&&!e.capped;i+=1)T(e,`${t}[${i}]`,n[i])||(r=!1);return r}function ot(e,t,n,r){if(n!==void 0){if(!Array.isArray(n)){C(e,t,`expected a grid of cell styles`);return}n.length!==r.length&&C(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)){C(e,`${t}[${i}]`,`expected a row of cell styles`);continue}let o=r[i];Array.isArray(o)&&a.length!==o.length&&C(e,`${t}[${i}]`,`row width does not match the cells row`);for(let n=0;n<a.length;n+=1)st(e,`${t}[${i}][${n}]`,a[n])}}}function st(e,t,n){if(!x(n)){C(e,t,`expected a cell style object`);return}ce(e,n,t,`fontFamily`),se(e,n,t,`fontSize`),ce(e,n,t,`background`)}function ct(e,t,n){if(!Array.isArray(n)){C(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)){C(e,`${t}[${r}]`,`expected a row`);continue}for(let n=0;n<i.length;n+=1)E(e,`${t}[${r}][${n}]`,i[n])}}function lt(e,t,n){if(n!==void 0){if(!Array.isArray(n)){C(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`||C(e,`${t}[${r}]`,`expected a string or null`)}}}function ut(e,t,n){if(n!==void 0){if(!Array.isArray(n)){C(e,t,`expected an array of flows`);return}n.forEach((n,r)=>{let i=`${t}[${r}]`;if(!x(n)){C(e,i,`expected a flow`);return}if(D(e,`${i}.id`,n.id,!1),E(e,`${i}.name`,n.name),!Array.isArray(n.steps)){C(e,`${i}.steps`,`expected an array of steps`);return}n.steps.forEach((t,n)=>{let r=`${i}.steps[${n}]`;if(!x(t)){C(e,r,`expected a step`);return}D(e,`${r}.target`,t.target,!1),E(e,`${r}.title`,t.title),ce(e,t,r,`text`),tt(e,`${r}.also`,t.also),ue(e,t,r,`kind`,He),ce(e,t,r,`payload`),tt(e,`${r}.branches`,t.branches),le(e,t,r,`fails`)})})}}function dt(e,t,n){if(!Array.isArray(n)){C(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(!x(i)){C(e,`${t}[${r}]`,`expected an activation bar`);continue}T(e,`${t}[${r}].top`,i.top),T(e,`${t}[${r}].height`,i.height)}}function A(e){return(t,n,r,i)=>{e(t,`${n}.${i}`,r[i])}}function j(e){return(t,n,r,i)=>{r[i]!==void 0&&e(t,n,r,i)}}function M(e){return A((t,n,r)=>O(t,n,r,e))}function ft(e){return(t,n,r)=>{Qe(t,n,r.titleIcon,e)}}var N=A(T),P=A(E),pt=A(re),mt=A(oe),F=j(N),I=j(P),L=j(pt),ht=j(A(k)),gt=j(mt);function _t(e,t,n){if(!Array.isArray(n)){C(e,t,`expected an array of point arrays`);return}for(let r=0;r<n.length&&!e.capped;r+=1)oe(e,`${t}[${r}]`,n[r])}var vt=(e,t,n,r)=>{if(n[r]===void 0){C(e,`${t}.${r}`,`expected a binding or null`);return}Ze(e,`${t}.${r}`,n[r])},yt=()=>{},bt={traits:{geometry:`box`,color:!0,fill:!0,stroke:!0,dash:!0,font:`stored`,arrowEnds:!1,textField:`label`,edit:`text`,search:`label`,hit:`bounds`,animate:`box`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!0,snapsConnectors:!0,lineWork:!1},dataBearing:!1,codeBacked:!1},checks:{kind:M(Ae),x:N,y:N,width:N,height:N,rotation:N,label:P,fontSize:N,fontFamily:P,color:P,fill:P,strokeWidth:N,dash:M(Me),opacity:N,textAlign:j(M(Fe)),textVAlign:j(M(Ie)),textPadding:F,lineHeight:F,letterSpacing:F,labelColor:I,stroke:I,fillStyle:j(M(Ne)),corner:j(M(Pe)),flipX:L,flipY:L,shadow:L,minHeight:F,autoHeightFrom:F,link:I,titleIcon:ft(!0)}},xt={traits:{geometry:`connector`,color:!0,fill:!1,stroke:!0,dash:!0,font:`optional`,arrowEnds:!0,textField:`label`,edit:`text`,search:`label`,hit:`stroke`,animate:`path`,rotatable:!0,bindTarget:`path`,roles:{solid:!1,connectorObstacle:!1,graphNode:!1,snapsConnectors:!1,lineWork:!0},dataBearing:!1,codeBacked:!1},checks:{x:N,y:N,x2:N,y2:N,bend:N,bendAlong:N,startBend:F,endBend:F,bendStyle:M(Le),color:P,strokeWidth:N,dash:M(Me),startArrow:pt,endArrow:pt,opacity:N,startBinding:vt,endBinding:vt,bow:F,bowAlong:F,elbowMid:ht,labelAlong:ht,elbowPoints:gt,elbowRoute:gt,elbowMidHandle:j(A((e,t,n)=>{if(!x(n)){C(e,t,`expected an object`);return}T(e,`${t}.x`,n.x),T(e,`${t}.y`,n.y),O(e,`${t}.axis`,n.axis,qe),T(e,`${t}.span`,n.span)})),label:I,startLabel:I,endLabel:I,fontSize:F,fontFamily:I,startHead:j(M(je)),endHead:j(M(je)),flow:L}},St={traits:{geometry:`text`,color:!0,fill:!1,stroke:!1,dash:!1,font:`stored`,arrowEnds:!1,textField:`text-or-delete`,edit:`text`,search:`text`,hit:`bounds`,animate:`text`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!1,graphNode:!1,snapsConnectors:!0,lineWork:!1},dataBearing:!1,codeBacked:!1},checks:{x:N,y:N,text:P,fontSize:N,fontFamily:P,rotation:N,color:P,opacity:N,width:F,height:F,textAlign:j(M(Fe)),textVAlign:j(M(Ie)),lineHeight:F,letterSpacing:F,flipX:L,flipY:L}},Ct={traits:{geometry:`box`,color:!1,fill:!0,stroke:!1,dash:!1,font:`stored`,arrowEnds:!1,textField:`text`,edit:`text`,search:`text`,hit:`bounds`,animate:`text`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!0,snapsConnectors:!0,lineWork:!1},dataBearing:!1,codeBacked:!1},checks:{x:N,y:N,width:N,height:N,rotation:N,text:P,fontSize:N,fontFamily:P,fill:P,opacity:N,lineHeight:F,letterSpacing:F}},wt={traits:{geometry:`points`,color:!0,fill:!1,stroke:!0,dash:!1,font:`none`,arrowEnds:!1,textField:`text-or-delete`,edit:`none`,search:`none`,hit:`stroke`,animate:`path`,rotatable:!0,bindTarget:`node`,roles:{solid:!1,connectorObstacle:!1,graphNode:!1,snapsConnectors:!1,lineWork:!0},dataBearing:!1,codeBacked:!1},checks:{points:mt,color:P,strokeWidth:N,opacity:N,highlighter:L,pressure:j(A(rt))}},Tt={traits:{geometry:`points`,color:!0,fill:!0,stroke:!0,dash:!1,font:`none`,arrowEnds:!1,textField:`text-or-delete`,edit:`vertices`,search:`none`,hit:`bounds`,animate:`box`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!1,snapsConnectors:!1,lineWork:!1},dataBearing:!1,codeBacked:!1},checks:{points:mt,fill:P,color:P,strokeWidth:N,opacity:N,smooth:L,holes:j(A(_t)),band:A($e)}},Et={traits:{geometry:`points`,color:!0,fill:!1,stroke:!0,dash:!0,font:`optional`,arrowEnds:!0,textField:`label`,edit:`none`,search:`label`,hit:`stroke`,animate:`path`,rotatable:!0,bindTarget:`node-or-path`,roles:{solid:!1,connectorObstacle:!1,graphNode:!1,snapsConnectors:!1,lineWork:!0},dataBearing:!1,codeBacked:!1},checks:{points:mt,color:P,strokeWidth:N,dash:M(Me),startArrow:pt,endArrow:pt,opacity:N,startHead:j(M(je)),endHead:j(M(je)),flow:L,label:I,labelAlong:ht,fontSize:F,fontFamily:I}},Dt={traits:{geometry:`box`,color:!1,fill:!1,stroke:!1,dash:!1,font:`none`,arrowEnds:!1,textField:`text-or-delete`,edit:`crop`,search:`none`,hit:`bounds`,animate:`box`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!1,snapsConnectors:!0,lineWork:!1},dataBearing:!0,codeBacked:!1},checks:{x:N,y:N,width:N,height:N,rotation:N,src:P,opacity:N,corner:j(M(Pe)),flipX:L,flipY:L,crop:A(et)},inlineImageField:`src`},Ot={traits:{geometry:`box`,color:!0,fill:!1,stroke:!0,dash:!1,font:`stored`,arrowEnds:!1,textField:`label`,edit:`none`,search:`label-and-name`,hit:`bounds`,animate:`box`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!0,snapsConnectors:!0,lineWork:!1},dataBearing:!1,codeBacked:!1},checks:{x:N,y:N,width:N,height:N,rotation:N,source:P,name:P,label:P,fontSize:N,fontFamily:P,color:P,strokeWidth:N,flipX:L,flipY:L,opacity:N}},kt={traits:{geometry:`box`,color:!0,fill:!1,stroke:!1,dash:!1,font:`none`,arrowEnds:!1,textField:`label`,edit:`none`,search:`label`,hit:`outline`,animate:`box`,rotatable:!1,bindTarget:`node`,roles:{solid:!1,connectorObstacle:!1,graphNode:!1,snapsConnectors:!1,lineWork:!1},dataBearing:!1,codeBacked:!0},checks:{x:N,y:N,width:N,height:N,rotation:N,label:P,fontSize:N,fontFamily:P,color:P,opacity:N,kind:j(M(Be)),lanes:A(tt),laneSizes:A(nt),slideOrder:F,slideSkipped:L,notes:I,flows:A(ut),slideLayout:I,fill:I,strokeWidth:F,dash:j(M(Me)),code:I,codeFingerprint:I,titleIcon:ft(!1)}},At={traits:{geometry:`table`,color:!0,fill:!1,stroke:!1,dash:!1,font:`stored`,arrowEnds:!1,textField:`text-or-delete`,edit:`none`,search:`cells`,hit:`bounds`,animate:`box`,rotatable:!1,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!1,snapsConnectors:!0,lineWork:!1},dataBearing:!0,codeBacked:!1},checks:{x:N,y:N,rotation:N,fontSize:N,fontFamily:P,color:P,opacity:N,background:I,colWidths:it,rowHeights:yt,cells:yt,cellStyles:yt}},jt={traits:{geometry:`box`,color:!0,fill:!1,stroke:!1,dash:!1,font:`stored`,arrowEnds:!1,textField:`text-or-delete`,edit:`none`,search:`cells`,hit:`bounds`,animate:`box`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!1,snapsConnectors:!0,lineWork:!1},dataBearing:!0,codeBacked:!0},checks:{chartType:M(Re),x:N,y:N,width:N,height:N,rotation:N,fontSize:N,fontFamily:P,color:P,opacity:N,cells:A(ct),horizontal:L,stacked:L,showLegend:L,showValues:L,showTitles:L,numberFormat:j(M(ze)),seriesColors:A(lt),quadrantColors:A(lt),quadrantLabels:A(tt),title:I,xTitle:I,yTitle:I,code:I,codeFingerprint:I}},Mt={traits:{geometry:`box`,color:!0,fill:!1,stroke:!1,dash:!1,font:`stored`,arrowEnds:!1,textField:`label`,edit:`none`,search:`label`,hit:`bounds`,animate:`box`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!1,snapsConnectors:!0,lineWork:!1},dataBearing:!1,codeBacked:!1},checks:{kind:M(Ge),x:N,y:N,width:N,height:N,rotation:N,label:P,fontSize:N,fontFamily:P,color:P,opacity:N,body:I,primaryLabel:I,secondaryLabel:I,link:I,fill:I,value:F,widthManual:L,activations:j(A(dt))}},Nt=500,Pt={traits:{geometry:`box`,color:!1,fill:!1,stroke:!1,dash:!1,font:`none`,arrowEnds:!1,textField:`label`,edit:`interact`,search:`label`,hit:`bounds`,animate:`box`,rotatable:!1,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!1,snapsConnectors:!0,lineWork:!1},dataBearing:!0,codeBacked:!1},checks:{kind:(e,t,n,r)=>{O(e,`${t}.${r}`,n[r],Ue)&&(n.kind===`embed`&&n.url===void 0&&C(e,`${t}.url`,`an embed needs a url`),n.kind===`html`&&n.html===void 0&&n.htmlSrc===void 0&&C(e,`${t}.html`,`an html widget needs html or htmlSrc`))},x:N,y:N,width:N,height:N,rotation:N,label:A((e,t,n)=>{E(e,t,n)&&n.length>Nt&&C(e,t,`label is too long`)}),url:j(A((n,r,i)=>{E(n,r,i)&&!e(i)&&C(n,r,`expected an https url without credentials, at most ${t} characters`)})),html:j(A((e,t,n)=>{E(e,t,n)&&r(n)>131072&&C(e,t,`html is too large`)})),htmlSrc:j(A((e,t,r)=>{E(e,t,r)&&!n(r)&&C(e,t,`expected an https url`)})),poster:I,posterOf:I,keepAspect:L,opacity:N},inlineImageField:`poster`},Ft=500,It={rectangle:bt,arrow:xt,text:St,sticky:Ct,draw:wt,polygon:Tt,line:Et,image:Dt,icon:Ot,figure:kt,table:At,chart:jt,control:Mt,web:Pt,custom:{traits:{geometry:`box`,color:!1,fill:!1,stroke:!1,dash:!1,font:`none`,arrowEnds:!1,textField:`label`,edit:`none`,search:`label`,hit:`bounds`,animate:`box`,rotatable:!0,bindTarget:`node`,roles:{solid:!0,connectorObstacle:!0,graphNode:!1,snapsConnectors:!0,lineWork:!1},dataBearing:!0,codeBacked:!1},checks:{kind:A((e,t,n)=>{E(e,t,n)&&(n.length>64||!ke.test(n))&&C(e,t,`expected a kind like namespace/name`)}),version:A((e,t,n)=>{T(e,t,n)&&(!Number.isInteger(n)||n<1)&&C(e,t,`expected an integer version of at least 1`)}),x:N,y:N,width:N,height:N,rotation:N,label:A((e,t,n)=>{E(e,t,n)&&n.length>Ft&&C(e,t,`label is too long`)}),props:A((e,t,n)=>{if(!x(n)||Array.isArray(n)){C(e,t,`expected an object`);return}let i;try{i=r(JSON.stringify(n))}catch{C(e,t,`expected JSON`);return}i>65536&&C(e,t,`props are too large`)}),opacity:N}}},R=Object.fromEntries(Object.entries(It).map(([e,t])=>[e,t.traits]));function Lt(e){return typeof e==`string`&&Object.hasOwn(It,e)?R[e].bindTarget:void 0}function Rt(e){return e.type===`figure`}function zt(e,t,n,r,i){let a=Math.max(0,Math.min(i,n/2,r/2));return a===0?`M ${e} ${t} L ${e+n} ${t} L ${e+n} ${t+r} L ${e} ${t+r} Z`:`M ${e+a} ${t} L ${e+n-a} ${t} Q ${e+n} ${t} ${e+n} ${t+a} L ${e+n} ${t+r-a} Q ${e+n} ${t+r} ${e+n-a} ${t+r} L ${e+a} ${t+r} Q ${e} ${t+r} ${e} ${t+r-a} L ${e} ${t+a} Q ${e} ${t} ${e+a} ${t} Z`}function Bt(e,t,n,r,i){let a=Math.max(0,Math.min(i,n/2,r));return`M ${e} ${t+r} L ${e} ${t+a} Q ${e} ${t} ${e+a} ${t} L ${e+n-a} ${t} Q ${e+n} ${t} ${e+n} ${t+a} L ${e+n} ${t+r} Z`}function Vt(e,t,n){return`M ${e-n} ${t} A ${n} ${n} 0 1 0 ${e+n} ${t} A ${n} ${n} 0 1 0 ${e-n} ${t} Z`}function Ht(e,t,n,r){return`M ${e} ${t} L ${n} ${r}`}function Ut(e,t=0){if(e.length<3||t<=0)return e.map((e,t)=>`${t?`L`:`M`} ${e[0]} ${e[1]}`).join(` `)+` Z`;let n=(e,t,n)=>{let r=Math.hypot(t[0]-e[0],t[1]-e[1])||1;return[e[0]+(t[0]-e[0])/r*n,e[1]+(t[1]-e[1])/r*n]},r=[];for(let i=0;i<e.length;i+=1){let a=e[(i-1+e.length)%e.length],o=e[i],s=e[(i+1)%e.length],c=Math.min(t,Math.hypot(o[0]-a[0],o[1]-a[1])/2,Math.hypot(o[0]-s[0],o[1]-s[1])/2),l=n(o,a,c),u=n(o,s,c);r.push(`${i?`L`:`M`} ${l[0]} ${l[1]}`),r.push(`Q ${o[0]} ${o[1]} ${u[0]} ${u[1]}`)}return r.join(` `)+` Z`}var Wt={M:[`x`,`y`],L:[`x`,`y`],Q:[`x`,`y`,`x`,`y`],C:[`x`,`y`,`x`,`y`,`x`,`y`],A:[`keep`,`keep`,`rotation`,`keep`,`sweep`,`x`,`y`],Z:[]},Gt=/([A-Za-z])([^A-Za-z]*)/g,Kt=/[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g;function qt(e){if(!Number.isFinite(e))return`0`;let t=Math.round(e*1e4)/1e4;return Object.is(t,-0)?`0`:String(t)}function Jt(e,t,n,r){if(!n&&!r)return e;let i=t.x+t.width/2,a=t.y+t.height/2,o=n!==r,s=[];Gt.lastIndex=0;for(let t=Gt.exec(e);t;t=Gt.exec(e)){let c=t[1],l=Wt[c];if(!l)return e;let u=t[2].match(Kt)?.map(Number)??[];if(l.length===0||u.length===0){s.push(c);continue}let d=u.map((e,t)=>{let s=l[t%l.length];return s===`x`?qt(n?2*i-e:e):s===`y`?qt(r?2*a-e:e):s===`rotation`?qt(o?-e:e):s===`sweep`&&o?String(+!e):qt(e)});s.push(`${c} ${d.join(` `)}`)}return s.join(` `)}var Yt=`rectangle.ellipse.diamond.triangle.oval.parallelogram.trapezoid.cylinder.queue.note.callout.hexagon.star.checkbox.crossbox.heart.cloud.arrow-up.arrow-down.arrow-left.arrow-right.plus.speech-bubble.bolt.document.predefined-process.manual-input.pentagon.chevron.octagon.cube.actor.double-circle.card.delay.fork-join.multi-document.multi-process.package.component.brace`.split(`.`);function z(e,t=0){return Ut(e,t)}function Xt(e){let t=e.x+e.width/2,n=e.y+e.height/2,r=e.width/2,i=e.height/2,a=[];for(let e=0;e<10;e+=1){let o=e%2==0?1:.42,s=-Math.PI/2+e*Math.PI/5;a.push([t+Math.cos(s)*r*o,n+Math.sin(s)*i*o])}return z(a)}function Zt(e){return Math.min(e.width*.1,e.height*.25)}function Qt(e){return Math.min(e.height*.34,e.width*.25)}function $t(e){let{x:t,y:n,width:r,height:i}=e,a=e=>t+e*r,o=e=>n+e*i;return`M ${a(.5)} ${o(.28)} C ${a(.5)} ${o(.16)} ${a(.4)} ${o(.04)} ${a(.25)} ${o(.04)} C ${a(.06)} ${o(.04)} ${a(0)} ${o(.2)} ${a(0)} ${o(.32)} C ${a(0)} ${o(.52)} ${a(.2)} ${o(.68)} ${a(.5)} ${o(.96)} C ${a(.8)} ${o(.68)} ${a(1)} ${o(.52)} ${a(1)} ${o(.32)} C ${a(1)} ${o(.2)} ${a(.94)} ${o(.04)} ${a(.75)} ${o(.04)} C ${a(.6)} ${o(.04)} ${a(.5)} ${o(.16)} ${a(.5)} ${o(.28)} Z`}function en(e){return zt(e.x,e.y,e.width,e.height,Math.min(6,e.width/2,e.height/2))}function tn(e){let{x:t,y:n,width:r,height:i}=e,a=e=>t+e*r,o=e=>n+e*i;return`M ${a(.23)} ${o(1)} C ${a(.1)} ${o(1)} ${a(0)} ${o(.85)} ${a(0)} ${o(.66)} C ${a(0)} ${o(.47)} ${a(.1)} ${o(.31)} ${a(.23)} ${o(.31)} C ${a(.25)} ${o(.17)} ${a(.32)} ${o(.06)} ${a(.42)} ${o(.02)} C ${a(.51)} ${o(0)} ${a(.61)} ${o(.01)} ${a(.69)} ${o(.1)} C ${a(.76)} ${o(.19)} ${a(.8)} ${o(.33)} ${a(.78)} ${o(.46)} L ${a(.83)} ${o(.46)} C ${a(.92)} ${o(.46)} ${a(1)} ${o(.58)} ${a(1)} ${o(.73)} C ${a(1)} ${o(.88)} ${a(.92)} ${o(1)} ${a(.83)} ${o(1)} Z`}function nn(e,t){let n=t===`left`||t===`right`,r=n?e.width:e.height,i=n?e.height:e.width;return Math.min(i,r/2)}function rn(e,t,n=0){let{x:r,y:i,width:a,height:o}=e,s=t===`left`||t===`right`,c=s?a:o,l=s?o:a,u=nn(e,t),d=l*.25,f=l/2;return z([[0,f-d],[c-u,f-d],[c-u,0],[c,f],[c-u,l],[c-u,f+d],[0,f+d]].map(([e,n])=>t===`right`?[r+e,i+n]:t===`left`?[r+c-e,i+n]:t===`down`?[r+n,i+e]:[r+n,i+c-e]),n)}function an(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=i*.32,s=a*.32;return z([[n+o,r],[n+i-o,r],[n+i-o,r+s],[n+i,r+s],[n+i,r+a-s],[n+i-o,r+a-s],[n+i-o,r+a],[n+o,r+a],[n+o,r+a-s],[n,r+a-s],[n,r+s],[n+o,r+s]],t)}function on(e){let{x:t,y:n,width:r,height:i}=e,a=(e,a)=>[t+e*r,n+a*i];return z([a(.56,0),a(0,.6),a(.5,.6),a(.44,1),a(1,.4),a(.5,.4)])}var sn=.16;function cn(e){let{x:t,y:n,width:r,height:i}=e,a=i*sn,o=n+i-a,s=e=>t+e*r;return`M ${t} ${n} L ${t+r} ${n} L ${t+r} ${o} C ${s(.72)} ${o-a*1.4} ${s(.56)} ${o+a*1.4} ${s(.4)} ${o} C ${s(.26)} ${o-a*1.4} ${s(.12)} ${o+a*1.1} ${t} ${o} Z`}function ln(e){let{x:t,y:n,width:r,height:i}=e,a=Math.min(r*.12,16);return`M ${t+a} ${n} L ${t+a} ${n+i} M ${t+r-a} ${n} L ${t+r-a} ${n+i}`}function un(e){let{x:t,y:n,width:r,height:i}=e;return z([[t,n+i*.28],[t+r,n],[t+r,n+i],[t,n+i]])}function dn(e){return Math.min(e.width*.22,e.height*.6)}function fn(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=dn(e);return z([[n,r],[n+i-o,r],[n+i,r+a/2],[n+i-o,r+a],[n,r+a]],t)}function pn(e){return Math.min(e.width*.24,e.height*.6)}function mn(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=pn(e);return z([[n,r],[n+i-o,r],[n+i,r+a/2],[n+i-o,r+a],[n,r+a],[n+o,r+a/2]],t)}function hn(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=Math.min(i,a)*.29;return z([[n+o,r],[n+i-o,r],[n+i,r+o],[n+i,r+a-o],[n+i-o,r+a],[n+o,r+a],[n,r+a-o],[n,r+o]],t)}function gn(e){return Math.min(e.width,e.height)*.26}function _n(e){let{x:t,y:n,width:r,height:i}=e,a=gn(e);return z([[t,n+a],[t+a,n],[t+r,n],[t+r,n+i-a],[t+r-a,n+i],[t,n+i]])}function vn(e){let{x:t,y:n,width:r,height:i}=e,a=gn(e);return`M ${t} ${n+a} L ${t+r-a} ${n+a} L ${t+r} ${n} M ${t+r-a} ${n+a} L ${t+r-a} ${n+i}`}var yn=.72;function bn(e){let{x:t,y:n,width:r}=e,i=e.height*yn,a=t+r/2,o=Math.min(r*.22,i*.16),s=n+o+i*.04,c=s+o,l=n+i*.44,u=n+i*.64,d=n+i*.98,f=r*.3,p=r*.22;return`M ${a-o} ${s} A ${o} ${o} 0 1 0 ${a+o} ${s} A ${o} ${o} 0 1 0 ${a-o} ${s} M ${a} ${c} L ${a} ${u} M ${a-f} ${l} L ${a+f} ${l} M ${a} ${u} L ${a-p} ${d} M ${a} ${u} L ${a+p} ${d}`}var xn=.82,Sn=.78;function Cn(e,t,n,r){let{x:i,y:a,width:o,height:s}=e,c=a+s*t,l=Math.min(n,o/4,(c-a)/2);return`M ${i+l} ${a} L ${i+o-l} ${a} Q ${i+o} ${a} ${i+o} ${a+l} L ${i+o} ${c-l} Q ${i+o} ${c} ${i+o-l} ${c} L ${i+o*r[0]} ${c} L ${i+o*r[1]} ${a+s} L ${i+o*r[2]} ${c} L ${i+l} ${c} Q ${i} ${c} ${i} ${c-l} L ${i} ${a+l} Q ${i} ${a} ${i+l} ${a} Z`}function wn(e){return Cn(e,xn,10,[.24,.04,.14])}function Tn(e){return Cn(e,Sn,12,[.4,.22,.26])}function En(e){let t=e.y+e.height/2,n=e.width/2,r=e.height/2;return`M ${e.x} ${t} A ${n} ${r} 0 1 0 ${e.x+e.width} ${t} A ${n} ${r} 0 1 0 ${e.x} ${t} Z`}function Dn(e){let{x:t,y:n,width:r,height:i}=e,a=Math.min(r,i)*.2;return z([[t+a,n],[t+r,n],[t+r,n+i],[t,n+i],[t,n+a]])}function On(e){return Math.min(e.height/2,e.width/2)}function kn(e){let{x:t,y:n,width:r,height:i}=e,a=On(e),o=r-a;return`M ${t} ${n} L ${t+o} ${n} A ${a} ${a} 0 0 1 ${t+o} ${n+i} L ${t} ${n+i} Z`}function An(e){return Rn(e)}function jn(e){return Math.min(Math.min(e.width,e.height)*.08,9)}function Mn(e,t,n){let r=n??jn(e);return t({x:e.x,y:e.y+2*r,width:e.width-2*r,height:e.height-2*r})}function Nn(e,t,n,r){let i=n??jn(e),a=e.width-2*i,o=e.height-2*i,s=r??e.y+e.height;return`${Pn(e.x+2*i,e.y,a,o,i,s)} ${Pn(e.x+i,e.y+i,a,o,i,s)} ${Mn(e,t,i)}`}function Pn(e,t,n,r,i,a){let o=e+n,s=Math.min(t+r,a);return`M ${e} ${t+i} L ${e} ${t} L ${o} ${t} L ${o} ${s} L ${o-i} ${s}`}function Fn(e,t){return e.y+2*t+(e.height-2*t)*(1-sn)}var In=.12;function Ln(e,t){let n=Math.min(e.width,e.height)*t;return En(e)+` `+En({x:e.x+n,y:e.y+n,width:e.width-2*n,height:e.height-2*n})}function Rn(e){return zt(e.x,e.y,e.width,e.height,Math.min(4,e.width/2,e.height/2))}function zn(e){return Math.min(e.height*.24,26)}function Bn(e){return Math.min(e.width*.45,96)}function Vn(e){let{x:t,y:n,width:r,height:i}=e,a=zn(e),o=Bn(e);return z([[t,n],[t+o,n],[t+o,n+a],[t+r,n+a],[t+r,n+i],[t,n+i]])}function Hn(e){return Math.min(e.width*.16,22)}function Un(e){let{x:t,y:n,width:r,height:i}=e,a=Hn(e),o=Math.min(i*.16,14)/2,s=n+i*.32,c=n+i*.68,l=`M ${t} ${n} L ${t+r} ${n} L ${t+r} ${n+i} L ${t} ${n+i} L ${t} ${c+o} M ${t} ${c-o} L ${t} ${s+o} M ${t} ${s-o} L ${t} ${n}`,u=e=>`M ${t-a/2} ${e-o} L ${t+a/2} ${e-o} L ${t+a/2} ${e+o} L ${t-a/2} ${e+o} Z`;return`${l} ${u(s)} ${u(c)}`}function Wn(e){return Math.min(e.width*.3,16)}function Gn(e){let{x:t,y:n,height:r}=e,i=Wn(e),a=n+r/2,o=t+i,s=t+i*.4;return`M ${o} ${n} Q ${s} ${n} ${s} ${n+r*.22} L ${s} ${a-r*.06} Q ${s} ${a} ${t} ${a} Q ${s} ${a} ${s} ${a+r*.06} L ${s} ${n+r*.78} Q ${s} ${n+r} ${o} ${n+r}`}var Kn=new Set([`diamond`,`triangle`,`parallelogram`,`trapezoid`,`hexagon`,`pentagon`,`octagon`,`chevron`,`plus`,`arrow-up`,`arrow-down`,`arrow-left`,`arrow-right`]);function qn(e){return e===`rectangle`||Kn.has(e)}function Jn(e){return e===`rectangle`?`rounded`:`sharp`}function Yn(e){return e===`rounded`?7:0}var Xn={triangle:{y:!0},parallelogram:{x:!0,y:!0},trapezoid:{y:!0},cylinder:{y:!0},note:{x:!0,y:!0},star:{y:!0},checkbox:{x:!0,y:!0},heart:{y:!0},cloud:{x:!0,y:!0},"arrow-up":{y:!0},"arrow-down":{y:!0},"arrow-left":{x:!0},"arrow-right":{x:!0},"speech-bubble":{x:!0,y:!0},bolt:{x:!0,y:!0},queue:{x:!0},callout:{x:!0,y:!0},document:{x:!0,y:!0},"manual-input":{x:!0,y:!0},pentagon:{x:!0},chevron:{x:!0},cube:{x:!0,y:!0},actor:{y:!0},card:{x:!0,y:!0},delay:{x:!0},"multi-document":{x:!0,y:!0},"multi-process":{x:!0,y:!0},package:{x:!0,y:!0},component:{x:!0},brace:{x:!0}};function Zn(e){let t=Xn[e];return{x:t?.x===!0,y:t?.y===!0}}function B(e,t,n,r){if(r?.x||r?.y)return Jt(B(e,t,n),t,!!r.x,!!r.y);let{x:i,y:a,width:o,height:s}=t,c=i+o/2,l=a+s/2,u=Yn(n);switch(e){case`ellipse`:return En(t);case`oval`:return zt(i,a,o,s,Math.min(o,s)/2);case`diamond`:return z([[c,a],[i+o,l],[c,a+s],[i,l]],u);case`triangle`:return z([[c,a],[i+o,a+s],[i,a+s]],u);case`parallelogram`:{let e=Math.min(o*.25,s);return z([[i+e,a],[i+o,a],[i+o-e,a+s],[i,a+s]],u)}case`trapezoid`:{let e=o*.22;return z([[i+e,a],[i+o-e,a],[i+o,a+s],[i,a+s]],u)}case`hexagon`:{let e=Math.min(o*.25,o/2);return z([[i+e,a],[i+o-e,a],[i+o,l],[i+o-e,a+s],[i+e,a+s],[i,l]],u)}case`star`:return Xt(t);case`checkbox`:case`crossbox`:return en(t);case`heart`:return $t(t);case`cloud`:return tn(t);case`arrow-up`:case`arrow-down`:case`arrow-left`:case`arrow-right`:return rn(t,e.slice(6),u);case`plus`:return an(t,u);case`speech-bubble`:return Tn(t);case`callout`:return wn(t);case`bolt`:return on(t);case`document`:return cn(t);case`manual-input`:return un(t);case`pentagon`:return fn(t,u);case`predefined-process`:return zt(i,a,o,s,Math.min(3,o/2,s/2));case`chevron`:return mn(t,u);case`octagon`:return hn(t,u);case`cube`:return _n(t);case`actor`:return zt(i,a,o,s,Math.min(o,s)/2.4);case`note`:{let e=Math.min(o,s)*.26;return`M ${i} ${a} L ${i+o-e} ${a} L ${i+o} ${a+e} L ${i+o} ${a+s} L ${i} ${a+s} Z`}case`cylinder`:{let e=Zt(t),n=o/2,r=a+e,c=a+s-e;return`M ${i} ${r} L ${i} ${c} A ${n} ${e} 0 0 0 ${i+o} ${c} L ${i+o} ${r} A ${n} ${e} 0 0 0 ${i} ${r} Z`}case`queue`:{let e=Qt(t),n=s/2,r=i+e,c=i+o-e;return`M ${r} ${a} L ${c} ${a} A ${e} ${n} 0 0 1 ${c} ${a+s} L ${r} ${a+s} A ${e} ${n} 0 0 1 ${r} ${a} Z`}case`double-circle`:return En(t);case`card`:return Dn(t);case`delay`:return kn(t);case`fork-join`:return An(t);case`multi-process`:return Mn(t,Rn);case`multi-document`:return Mn(t,cn);case`package`:return Vn(t);case`component`:return Rn(t);case`brace`:return Rn(t);default:return zt(i,a,o,s,n===`sharp`?0:Math.min(12,o/2,s/2))}}function Qn(e,t,n,r){if(r?.x||r?.y)return Jt(Qn(e,t,n),t,!!r.x,!!r.y);let{x:i,y:a,width:o,height:s}=t;if(e===`cylinder`){let r=Zt(t),s=o/2,c=a+r;return B(e,t,n)+` M ${i} ${c} A ${s} ${r} 0 0 0 ${i+o} ${c}`}if(e===`queue`){let r=Qt(t),o=s/2,c=i+r;return B(e,t,n)+` M ${c} ${a} A ${r} ${o} 0 0 1 ${c} ${a+s}`}if(e===`note`){let r=Math.min(o,s)*.26;return B(e,t,n)+` M ${i+o-r} ${a} L ${i+o-r} ${a+r} L ${i+o} ${a+r}`}if(e===`crossbox`){let r=o*.06,c=s*.06;return B(e,t,n)+` M ${i+r} ${a+c} L ${i+o-r} ${a+s-c} M ${i+o-r} ${a+c} L ${i+r} ${a+s-c}`}if(e===`checkbox`)return B(e,t,n)+` M ${i+o*.24} ${a+s*.52} L ${i+o*.44} ${a+s*.72} L ${i+o*.78} ${a+s*.28}`;if(e===`predefined-process`)return B(e,t,n)+` `+ln(t);if(e===`cube`)return B(e,t,n)+` `+vn(t);if(e===`actor`)return bn(t);if(e===`double-circle`)return Ln(t,In);if(e===`multi-process`)return Nn(t,Rn);if(e===`multi-document`)return Nn(t,cn,void 0,Fn(t,jn(t)));if(e===`package`){let r=zn(t),i=Bn(t);return B(e,t,n)+` M ${t.x} ${t.y+r} L ${t.x+i} ${t.y+r}`}return e===`component`?Un(t):e===`brace`?Gn(t):B(e,t,n)}function $n(e){if(e===`arrow-up`||e===`arrow-down`||e===`bolt`||e===`actor`)return Qn(e,{x:5,y:4,width:14,height:16});if(e===`plus`||e===`checkbox`||e===`crossbox`||e===`heart`)return Qn(e,{x:5,y:5,width:14,height:14});if(e===`double-circle`)return Ln({x:4,y:4,width:16,height:16},.26);if(e===`multi-process`)return er({x:4,y:5,width:15,height:13},Rn,4);if(e===`multi-document`){let e={x:4,y:5,width:15,height:13};return er(e,cn,4,e.y+4+(e.height-4)*(1-sn))}return e===`fork-join`?An({x:4,y:9,width:16,height:6}):Qn(e,{x:4,y:5,width:16,height:14})}function er(e,t,n,r){let i=e.width-n,a=e.height-n,o=t({x:e.x,y:e.y+n,width:i,height:a});return`${Pn(e.x+n,e.y,i,a,n,r??e.y+a)} ${o}`}var{PI:tr}=Math,nr=tr+1e-4,rr=.5,ir=[1,1];function ar(e,t,n,r=e=>e){return e*r(.5-t*(.5-n))}var{min:or}=Math;function sr(e,t,n){let r=or(1,t/n);return or(1,e+(or(1,1-r)-e)*(r*.275))}function cr(e){return[-e[0],-e[1]]}function V(e,t){return[e[0]+t[0],e[1]+t[1]]}function lr(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function H(e,t){return[e[0]-t[0],e[1]-t[1]]}function ur(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function U(e,t){return[e[0]*t,e[1]*t]}function dr(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function fr(e,t){return[e[0]/t,e[1]/t]}function pr(e){return[e[1],-e[0]]}function mr(e,t){let n=t[0];return e[0]=t[1],e[1]=-n,e}function hr(e,t){return e[0]*t[0]+e[1]*t[1]}function gr(e,t){return e[0]===t[0]&&e[1]===t[1]}function _r(e){return Math.hypot(e[0],e[1])}function vr(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function yr(e){return fr(e,_r(e))}function br(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function xr(e,t,n){let r=Math.sin(n),i=Math.cos(n),a=e[0]-t[0],o=e[1]-t[1],s=a*i-o*r,c=a*r+o*i;return[s+t[0],c+t[1]]}function Sr(e,t,n,r){let i=Math.sin(r),a=Math.cos(r),o=t[0]-n[0],s=t[1]-n[1],c=o*a-s*i,l=o*i+s*a;return e[0]=c+n[0],e[1]=l+n[1],e}function Cr(e,t,n){return V(e,U(H(t,e),n))}function wr(e,t,n,r){let i=n[0]-t[0],a=n[1]-t[1];return e[0]=t[0]+i*r,e[1]=t[1]+a*r,e}function Tr(e,t,n){return V(e,U(t,n))}var W=[0,0],G=[0,0],K=[0,0];function Er(e,t){let n=Tr(e,yr(pr(H(e,V(e,[1,1])))),-t),r=[],i=1/13;for(let t=i;t<=1;t+=i)r.push(xr(n,e,nr*2*t));return r}function Dr(e,t,n){let r=[],i=1/n;for(let n=i;n<=1;n+=i)r.push(xr(t,e,nr*n));return r}function Or(e,t,n){let r=H(t,n),i=U(r,.5),a=U(r,.51);return[H(e,i),H(e,a),V(e,a),V(e,i)]}function kr(e,t,n,r){let i=[],a=Tr(e,t,n),o=1/r;for(let t=o;t<1;t+=o)i.push(xr(a,e,nr*3*t));return i}function Ar(e,t,n){return[V(e,U(t,n)),V(e,U(t,n*.99)),H(e,U(t,n*.99)),H(e,U(t,n))]}function jr(e,t,n){return e===!1||e===void 0?0:e===!0?Math.max(t,n):e}function Mr(e,t,n){return e.slice(0,10).reduce((e,r)=>{let i=r.pressure;return t&&(i=sr(e,r.distance,n)),(e+i)/2},e[0].pressure)}function Nr(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:a=!0,easing:o=e=>e,start:s={},end:c={},last:l=!1}=t,{cap:u=!0,easing:d=e=>e*(2-e)}=s,{cap:f=!0,easing:p=e=>--e*e*e+1}=c;if(e.length===0||n<=0)return[];let m=e[e.length-1].runningLength,h=jr(s.taper,n,m),g=jr(c.taper,n,m),_=(n*r)**2,v=[],y=[],ee=Mr(e,a,n),b=ar(n,i,e[e.length-1].pressure,o),x,S=e[0].vector,te=e[0].point,ne=te,C=te,w=ne,T=!1;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:c,distance:l,runningLength:u}=e[t],f=t===e.length-1;if(!f&&m-u<3)continue;i?(a&&(r=sr(ee,l,n)),b=ar(n,i,r,o)):b=n/2,x===void 0&&(x=b);let E=u<h?d(u/h):1,re=m-u<g?p((m-u)/g):1;b=Math.max(.01,b*Math.min(E,re));let D=(f?e[t]:e[t+1]).vector,O=f?1:hr(c,D),k=hr(c,S)<0&&!T,ie=O!==null&&O<0;if(k||ie){mr(W,S),dr(W,W,b);for(let e=0;e<=1;e+=.07692307692307693)ur(G,s,W),Sr(G,G,s,nr*e),C=[G[0],G[1]],v.push(C),lr(K,s,W),Sr(K,K,s,nr*-e),w=[K[0],K[1]],y.push(w);te=C,ne=w,ie&&(T=!0);continue}if(T=!1,f){mr(W,c),dr(W,W,b),v.push(H(s,W)),y.push(V(s,W));continue}wr(W,D,c,O),mr(W,W),dr(W,W,b),ur(G,s,W),C=[G[0],G[1]],(t<=1||vr(te,C)>_)&&(v.push(C),te=C),lr(K,s,W),w=[K[0],K[1]],(t<=1||vr(ne,w)>_)&&(y.push(w),ne=w),ee=r,S=c}let E=[e[0].point[0],e[0].point[1]],re=e.length>1?[e[e.length-1].point[0],e[e.length-1].point[1]]:V(e[0].point,[1,1]),D=[],O=[];if(e.length===1){if(!(h||g)||l)return Er(E,x||b)}else{h||g&&e.length===1||(u?D.push(...Dr(E,y[0],13)):D.push(...Or(E,v[0],y[0])));let t=pr(cr(e[e.length-1].vector));g||h&&e.length===1?O.push(re):f?O.push(...kr(re,t,b,29)):O.push(...Ar(re,t,b))}return v.concat(O,y.reverse(),D)}var Pr=[0,0];function Fr(e){return e!=null&&e>=0}function Ir(e,t={}){let{streamline:n=.5,size:r=16,last:i=!1}=t;if(e.length===0)return[];let a=.15+(1-n)*.85,o=Array.isArray(e[0])?e:e.map(({x:e,y:t,pressure:n=rr})=>[e,t,n]);if(o.length===2){let e=o[1];o=o.slice(0,-1);for(let t=1;t<5;t++)o.push(Cr(o[0],e,t/4))}o.length===1&&(o=[...o,[...V(o[0],ir),...o[0].slice(2)]]);let s=[{point:[o[0][0],o[0][1]],pressure:Fr(o[0][2])?o[0][2]:.25,vector:[...ir],distance:0,runningLength:0}],c=!1,l=0,u=s[0],d=o.length-1;for(let e=1;e<o.length;e++){let t=i&&e===d?[o[e][0],o[e][1]]:Cr(u.point,o[e],a);if(gr(u.point,t))continue;let n=br(t,u.point);if(l+=n,e<d&&!c){if(l<r)continue;c=!0}ur(Pr,u.point,t),u={point:t,pressure:Fr(o[e][2])?o[e][2]:rr,vector:yr(Pr),distance:n,runningLength:l},s.push(u)}return s[0].vector=s[1]?.vector||[0,0],s}function Lr(e,t={}){return Nr(Ir(e,t),t)}var Rr=.6;function zr(e){let{pressure:t}=e;return!t||e.highlighter||t.length!==e.points.length?null:t}function Br(e){return e.highlighter?e.strokeWidth*3:e.strokeWidth}function Vr(e){let t=zr(e);if(!t)return Br(e);let n=0;for(let e of t)n=Math.max(n,e);return Br(e)*(1+Rr*Math.max(0,2*n-1))}function Hr(e){if(e.length<3)return``;let t=e=>Math.round(e*100)/100,n=`M${t((e[0][0]+e[1][0])/2)} ${t((e[0][1]+e[1][1])/2)}`;for(let r=1;r<=e.length;r+=1){let[i,a]=e[r%e.length],[o,s]=e[(r+1)%e.length];n+=`Q${t(i)} ${t(a)} ${t((i+o)/2)} ${t((a+s)/2)}`}return n+`Z`}function Ur(e,t){return{size:Br(e)*2,thinning:t?Rr:0,smoothing:.5,streamline:.5,simulatePressure:!1,last:!0}}function Wr(e){let t=zr(e);return{input:t?e.points.map((e,n)=>[e.x,e.y,t[n]]):e.points.map(e=>[e.x,e.y]),pressured:t!==null}}function Gr(e){let{input:t,pressured:n}=Wr(e);return Hr(Lr(t,Ur(e,n)))}function Kr(e){let{input:t,pressured:n}=Wr(e),r=Ir(t,Ur(e,n)).map(e=>e.point);if(r.length<2)return``;let i=`M${r[0][0]} ${r[0][1]}`;for(let e=1;e<r.length-1;e+=1){let[t,n]=r[e],[a,o]=r[e+1];i+=`Q${t} ${n} ${(t+a)/2} ${(n+o)/2}`}let a=r[r.length-1];return`${i}L${a[0]} ${a[1]}`}function qr(e){if(e.length===0)return{x:0,y:0,width:0,height:0};let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return{x:t,y:n,width:r-t,height:i-n}}function Jr(e,t){return R[e.type].roles[t]}function Yr(e){return R[e.type].bindTarget!==`path`}function Xr(e){return R[e.type].bindTarget!==`node`}function Zr(e){return R[e.type].codeBacked}function Qr(e){return e.type===`control`&&e.kind===`lifeline`?!1:R[e.type].rotatable}function $r(e){return R[e.type].geometry===`box`}function ei(e){return R[e.type].fill}function ti(e){return Rt(e)||e.type===`control`}function ni(e){return{strokeWidth:e.strokeWidth??1.5,dash:e.dash??`solid`}}var ri={fade:[`box`,`path`,`text`],rise:[`box`,`path`,`text`],scale:[`box`,`path`,`text`],pop:[`box`,`path`,`text`],blur:[`box`,`path`,`text`],wipe:[`box`,`path`,`text`],draw:[`path`],type:[`text`],pulse:[`box`,`path`,`text`],shake:[`box`,`path`,`text`],glow:[`box`,`path`,`text`]};function ii(e,t){return ri[t].includes(R[e.type].animate)}var ai={fade:[`enter`,`exit`],rise:[`enter`,`exit`],scale:[`enter`,`exit`],pop:[`enter`],blur:[`enter`,`exit`],wipe:[`enter`,`exit`],draw:[`enter`,`exit`],type:[`enter`,`exit`],pulse:[`emphasis`],shake:[`emphasis`],glow:[`emphasis`]};function oi(e,t){return ai[e]?.includes(t)??!1}function si(e){return e.type===`rectangle`&&e.fill===`transparent`}function ci(e){return`label`in e&&typeof e.label==`string`?e.label:`text`in e&&typeof e.text==`string`?e.text:``}function li(e){return Qr(e)?e.rotation??0:0}function ui(e,t){return{...e,x:e.x+t.x,y:e.y+t.y}}function di(e,t,n,r){let i=y({x:t.x+t.width/2,y:t.y+t.height/2},n,r),a={...e,x:i.x-t.width/2,y:i.y-t.height/2};return Qr(e)?{...a,rotation:(e.rotation??0)+r*180/Math.PI}:a}function fi(e,t,n){let r=n.point({x:t.x+t.width/2,y:t.y+t.height/2});return{...e,x:r.x-t.width/2,y:r.y-t.height/2,rotation:-li(e)}}function pi(e,t){return{...e,flipX:t?!e.flipX:e.flipX,flipY:t?e.flipY:!e.flipY}}var mi=e=>e.type;function hi(e){return{x:Math.min(e.x,e.x+e.width),y:Math.min(e.y,e.y+e.height),width:Math.abs(e.width),height:Math.abs(e.height)}}function gi(e,t,n,r){let i=hi(e);return{...e,x:t.x+(i.x-t.x)*n,y:t.y+(i.y-t.y)*r,width:i.width*n,height:i.height*r}}function _i(e,t,n){return di(e,hi(e),t,n)}function vi(e,t){return fi(e,hi(e),t)}function q(){return{bounds:hi,domMeasured:`never`,move:ui,rotate:_i,scale:gi,flip:vi,rawText:ci,kindName:mi}}function yi(e,t){let n={...e,points:e.points.map(t)};return n.type===`polygon`&&n.holes&&(n.holes=n.holes.map(e=>e.map(t))),n}function bi(e){return qr(e.points)}function xi(e,t){return yi(e,e=>({x:e.x+t.x,y:e.y+t.y}))}function Si(e,t,n){return yi(e,e=>y(e,t,n))}function Ci(e,t,n,r){return yi(e,e=>({x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*r}))}function wi(e,t){return yi(e,t.point)}function Ti(){return{bounds:bi,domMeasured:`never`,move:xi,rotate:Si,scale:Ci,flip:wi,rawText:ci,kindName:mi}}var Ei=q(),Di={...Ei,flip:(e,t)=>{let n=Ei.flip(e,t),r=Zn(n.kind),i=t.horizontal&&r.x?!n.flipX:n.flipX,a=!t.horizontal&&r.y?!n.flipY:n.flipY;return{...n,flipX:i||void 0,flipY:a||void 0}},kindName:e=>e.kind};function Oi(e){return 9+e*2.2}var ki={arrow:.84,sweep:.88,triangle:1,triangleOutline:1,diamond:1,diamondOutline:1,circle:.8,circleOutline:.8,bar:0,cross:.69,crowOne:.55,crowOnlyOne:.9,crowMany:1,crowOneOrMany:1.3,crowZeroOrOne:1.3,crowZeroOrMany:1.7},Ai=.5,ji=.32;function Mi(e,t,n,r=1/0){let i=Math.max(ki[t],Ai);return Math.min(e,n*ji/i,r/i)}var J=36,Ni=10.5,Pi=1.5,Fi=3;function Ii(e){return{minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height}}function Li(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function Ri(e,t){return{minX:Math.min(e.minX,t.minX),minY:Math.min(e.minY,t.minY),maxX:Math.max(e.maxX,t.maxX),maxY:Math.max(e.maxY,t.maxY)}}function zi(e){return{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}}function Bi(e,t,n=0){return t.x>=e.minX-n&&t.x<=e.maxX+n&&t.y>=e.minY-n&&t.y<=e.maxY+n}function Vi(e,t){return e>=t.min&&e<=t.max}function Hi(e){return e.max-e.min}function Ui(e,t){return t.min<=e.min&&e.max<=t.max?[]:e.min<=t.min&&t.max<=e.max?[{min:e.min,max:t.min},{min:t.max,max:e.max}]:t.max<=e.min||t.min>=e.max?[e]:Vi(e.min,t)?[{min:t.max,max:e.max}]:[{min:e.min,max:t.min}]}function Wi(e,t,n){return e+(t-e)*n}var Gi=[`right`,`bottom`,`left`,`top`],Ki={top:{sign:-1,main:`minY`,far:`maxY`,crossLo:`minX`,crossHi:`maxX`,crossAxis:`x`},bottom:{sign:1,main:`maxY`,far:`minY`,crossLo:`minX`,crossHi:`maxX`,crossAxis:`x`},left:{sign:-1,main:`minX`,far:`maxX`,crossLo:`minY`,crossHi:`maxY`,crossAxis:`y`},right:{sign:1,main:`maxX`,far:`minX`,crossLo:`minY`,crossHi:`maxY`,crossAxis:`y`}};function qi(e,t,n){let r=Ki[n],i=e.box[r.main],a=e.isPoint?null:i+r.sign*J,o={min:e.box[r.crossLo],max:e.box[r.crossHi]},s={min:Math.min(t.box[r.main],t.box[r.far]),max:Math.max(t.box[r.main],t.box[r.far])};t.isPoint||(r.sign>0?s.min-=Ni*2:s.max+=Ni*2);let c={min:t.box[r.crossLo]-J,max:t.box[r.crossHi]+J};if(Vi(i,s)&&!e.isPoint&&!t.isPoint){let e=Ui(o,c);if(e.length===0)return null;o=e.length===2&&Hi(e[1])>Hi(e[0])?e[1]:e[0]}let l=e.target[r.crossAxis];return Vi(l,o)?{value:i,expanded:a,cross:o,crossTarget:l}:null}function Ji(e,t){return{top:qi(e,t,`top`),right:qi(e,t,`right`),bottom:qi(e,t,`bottom`),left:qi(e,t,`left`)}}function Yi(e,t){return t===null?!!(e.top||e.right||e.bottom||e.left):!!e[t]}function Xi(e){return e.isPoint?e:{box:{minX:e.target.x,minY:e.target.y,maxX:e.target.x,maxY:e.target.y},target:e.target,gap:0,minEnd:e.minEnd,side:null,isPoint:!0}}var Zi={sx:1,sy:1,swap:!1},Qi={sx:1,sy:-1,swap:!1},$i={sx:-1,sy:1,swap:!0},ea={sx:-1,sy:-1,swap:!1},ta={sx:1,sy:-1,swap:!0};function na(e,t){let n=e.sx*t.x,r=e.sy*t.y;return e.swap?{x:r,y:n}:{x:n,y:r}}function ra(e,t){let n=e.swap?t.y:t.x,r=e.swap?t.x:t.y;return{x:e.sx*n,y:e.sy*r}}function ia(e,t){if(e.sx===-1){let e=t.minX;t.minX=-t.maxX,t.maxX=-e}if(e.sy===-1){let e=t.minY;t.minY=-t.maxY,t.maxY=-e}if(e.swap){let e=t.minX;t.minX=t.minY,t.minY=e,e=t.maxX,t.maxX=t.maxY,t.maxY=e}}function aa(e){e&&(e.value=-e.value,e.expanded=e.expanded===null?null:-e.expanded)}function oa(e){if(!e)return;let t=e.cross.min;e.cross.min=-e.cross.max,e.cross.max=-t,e.crossTarget=-e.crossTarget}function sa(e,t){if(e.sx===-1){let e=t.left;t.left=t.right,t.right=e,aa(t.left),aa(t.right),oa(t.top),oa(t.bottom)}if(e.sy===-1){let e=t.top;t.top=t.bottom,t.bottom=e,aa(t.top),aa(t.bottom),oa(t.left),oa(t.right)}if(e.swap){let e=t.left;t.left=t.top,t.top=e,e=t.right,t.right=t.bottom,t.bottom=e}}function ca(e,t){if(ia(t,e.a.box),ia(t,e.a.grown),ia(t,e.b.box),ia(t,e.b.grown),ia(t,e.common.box),ia(t,e.common.grown),sa(t,e.a.edges),sa(t,e.b.edges),e.bias=na(t,e.bias),t.sx===-1&&(e.gapX=-e.gapX,e.midX=e.midX===null?null:-e.midX),t.sy===-1&&(e.gapY=-e.gapY,e.midY=e.midY===null?null:-e.midY),t.swap){let t=e.gapX;e.gapX=e.gapY,e.gapY=t,t=e.midX,e.midX=e.midY,e.midY=t}}function la(e,t){ca(e,t),e.applied.push(t)}function ua(e){return e.swap?{sx:e.sy,sy:e.sx,swap:!0}:e}function da(e){for(;e.applied.length>0;){let t=e.applied.pop();t&&ca(e,ua(t))}}function fa(e,t,n){let r={x:t,y:n};for(let t=e.applied.length-1;t>=0;--t)r=ra(e.applied[t],r);return r}var Y=.01,X=class{work;pts=[];mid=null;constructor(e){this.work=e}to(e,t){return this.pts.push(fa(this.work,e,t)),this}tagMid(e){let t=this.pts[this.pts.length-2],n=this.pts[this.pts.length-1],r=0;for(let e of this.work.applied)e.swap&&(r+=1);return this.mid={x:(t.x+n.x)/2,y:(t.y+n.y)/2,axis:r%2==1?e===`x`?`y`:`x`:e,span:Math.abs(t.x-n.x)+Math.abs(t.y-n.y)},this}done(){let e=Ma(this.pts),t=0;for(let n=0;n<e.length-1;n+=1)t+=Math.abs(e[n+1].x-e[n].x)+Math.abs(e[n+1].y-e[n].y);return{points:e,dist:t,mid:this.mid}}};function pa(e){let t=e.a.edges.right,n=e.b.edges.left;if(!t||!n||t.crossTarget>n.crossTarget&&(la(e,Qi),t=e.a.edges.right,n=e.b.edges.left,!t||!n))return null;if(e.gapX>0&&e.midX!==null)return new X(e).to(t.value,t.crossTarget).to(e.midX,t.crossTarget).to(e.midX,n.crossTarget).tagMid(`x`).to(n.value,n.crossTarget).done();if(t.expanded===null||n.expanded===null)return null;if(e.midY!==null)return new X(e).to(t.value,t.crossTarget).to(t.expanded,t.crossTarget).to(t.expanded,e.midY).to(n.expanded,e.midY).tagMid(`y`).to(n.expanded,n.crossTarget).to(n.value,n.crossTarget).done();let r=Math.abs(t.value-e.common.grown.maxX)+Math.abs(t.crossTarget-e.common.grown.maxY)+Math.abs(e.common.grown.maxX-n.expanded)+Math.abs(e.common.grown.maxY-n.crossTarget)+J+6,i=J+Math.abs(t.crossTarget-e.common.grown.minY)+Math.abs(t.expanded-e.common.grown.minX)+Math.abs(e.common.grown.minY-n.crossTarget)+Math.abs(e.common.grown.minX-n.value)+6+e.bias.y,a=e.gapX<0&&e.midX!==null?J+Math.abs(t.crossTarget-e.a.grown.maxY)+(e.common.grown.maxX-e.common.grown.minX)+Math.abs(e.a.grown.maxY-e.b.grown.minY)+Math.abs(e.b.grown.minY-n.crossTarget)+J+8:1/0;return r<i&&r<a?new X(e).to(t.value,t.crossTarget).to(e.common.grown.maxX,t.crossTarget).to(e.common.grown.maxX,e.common.grown.maxY).to(n.expanded,e.common.grown.maxY).to(n.expanded,n.crossTarget).to(n.value,n.crossTarget).done():i<a?new X(e).to(t.value,t.crossTarget).to(t.expanded,t.crossTarget).to(t.expanded,e.common.grown.minY).to(e.common.grown.minX,e.common.grown.minY).to(e.common.grown.minX,n.crossTarget).to(n.value,n.crossTarget).done():e.midX===null?null:new X(e).to(t.value,t.crossTarget).to(t.expanded,t.crossTarget).to(t.expanded,e.a.grown.maxY).to(e.midX,e.a.grown.maxY).to(e.midX,e.b.grown.minY).tagMid(`y`).to(n.expanded,e.b.grown.minY).to(n.expanded,n.crossTarget).to(n.value,n.crossTarget).done()}function ma(e){let t=e.a.edges.right,n=e.b.edges.top;if(!t||!n)return null;if(t.crossTarget<(n.expanded??n.value)&&n.crossTarget>(t.expanded??t.value)||e.a.isPoint&&Bi(e.b.grown,zi(e.a.box)))return new X(e).to(t.value,t.crossTarget).to(n.crossTarget,t.crossTarget).to(n.crossTarget,n.value).done();if(e.gapX>0&&e.midX!==null&&n.expanded!==null)return new X(e).to(t.value,t.crossTarget).to(e.midX,t.crossTarget).to(e.midX,n.expanded).tagMid(`x`).to(n.crossTarget,n.expanded).to(n.crossTarget,n.value).done();if(e.gapY>0&&t.expanded!==null&&n.crossTarget<t.expanded&&e.midY!==null)return new X(e).to(t.value,t.crossTarget).to(t.expanded,t.crossTarget).to(t.expanded,e.midY).to(n.crossTarget,e.midY).tagMid(`y`).to(n.crossTarget,n.value).done();let r=Math.abs(t.value-e.common.grown.maxX)+Math.abs(t.crossTarget-e.common.grown.minY)+Math.abs(n.crossTarget-e.common.grown.maxX)+Math.abs(n.value-e.common.grown.minY),i=t.expanded!==null&&e.midY!==null&&n.expanded!==null?Math.abs(t.value-t.expanded)+Math.abs(e.b.grown.minX-t.expanded)+Math.abs(e.b.grown.minX-n.crossTarget)+Math.abs(t.crossTarget-e.b.grown.minY)+Math.abs(n.value-n.expanded):1/0,a=t.expanded!==null&&e.midX!==null&&n.expanded!==null?Math.abs(t.value-e.common.grown.maxX)+Math.abs(t.crossTarget-e.a.grown.maxY)+Math.abs(t.expanded-n.crossTarget)+Math.abs(e.a.grown.maxY-n.expanded)+Math.abs(n.expanded-n.value):1/0;return r<i&&r<a?new X(e).to(t.value,t.crossTarget).to(e.common.grown.maxX,t.crossTarget).to(e.common.grown.maxX,e.common.grown.minY).to(n.crossTarget,e.common.grown.minY).to(n.crossTarget,n.value).done():n.expanded!==null&&t.expanded!==null&&e.midY!==null&&i<a?new X(e).to(t.value,t.crossTarget).to(t.expanded,t.crossTarget).to(t.expanded,e.midY).to(e.b.grown.minX,e.midY).tagMid(`y`).to(e.b.grown.minX,n.expanded).to(n.crossTarget,n.expanded).to(n.crossTarget,n.value).done():n.expanded!==null&&t.expanded!==null&&e.midX!==null?new X(e).to(t.value,t.crossTarget).to(t.expanded,t.crossTarget).to(t.expanded,e.a.grown.maxY).to(e.midX,e.a.grown.maxY).to(e.midX,n.expanded).tagMid(`x`).to(n.crossTarget,n.expanded).to(n.crossTarget,n.value).done():null}function ha(e){return la(e,Qi),ma(e)}function ga(e){let t=e.a.edges.right,n=e.b.edges.right;if(!t||!n)return null;if((e.gapX<=0||t.crossTarget>e.b.grown.maxY||t.crossTarget<e.b.grown.minY)&&(n.value>e.a.box.minX||n.crossTarget>e.a.grown.maxY||n.crossTarget<e.a.grown.minY))return new X(e).to(t.value,t.crossTarget).to(e.common.grown.maxX,t.crossTarget).to(e.common.grown.maxX,n.crossTarget).to(n.value,n.crossTarget).done();if(e.midX===null)return null;if(n.expanded!==null&&e.gapX>=0){let r=Math.abs(n.crossTarget-e.b.grown.maxY)+Math.abs(t.crossTarget-e.b.grown.maxY)<Math.abs(n.crossTarget-e.b.grown.minY)+Math.abs(t.crossTarget-e.b.grown.minY)?e.b.grown.maxY:e.b.grown.minY;return new X(e).to(t.value,t.crossTarget).to(e.midX,t.crossTarget).to(e.midX,r).tagMid(`x`).to(n.expanded,r).to(n.expanded,n.crossTarget).to(n.value,n.crossTarget).done()}if(t.expanded!==null&&e.gapX<=0){let r=Math.abs(n.crossTarget-e.a.grown.maxY)+Math.abs(t.crossTarget-e.a.grown.maxY)<Math.abs(n.crossTarget-e.a.grown.minY)+Math.abs(t.crossTarget-e.a.grown.minY)?e.a.grown.maxY:e.a.grown.minY;return new X(e).to(t.value,t.crossTarget).to(t.expanded,t.crossTarget).to(t.expanded,r).to(e.midX,r).to(e.midX,n.crossTarget).tagMid(`x`).to(n.value,n.crossTarget).done()}return null}var _a={top:{top:[ta,ga],left:[ta,ma],bottom:[ta,pa],right:[ta,ha]},right:{top:[Zi,ma],right:[Zi,ga],bottom:[Zi,ha],left:[Zi,pa]},bottom:{top:[$i,pa],left:[$i,ha],bottom:[$i,ga],right:[$i,ma]},left:{top:[ea,ha],left:[ea,ga],bottom:[ea,ma],right:[ea,pa]}};function Z(e,t,n){let[r,i]=_a[t][n];la(e,r);let a=i(e);return da(e),a}function va(e,t){let n=null,r=1/0,i=1/0,a=0;for(let[o,s]of t){a+=1;let t=Z(e,o,s);t&&(t.points.length<r?(r=t.points.length,i=t.dist,n=t):t.points.length===r&&t.dist+a<i&&(i=t.dist,n=t))}return n}function ya(e,t){let n=e.a.edges[t];if(!n)return;let r=n.expanded??n.value,i=e=>t===`right`?r<=e:r>=e,a=e.b.edges.top;if(a&&i(a.crossTarget)&&n.crossTarget<=(a.expanded??a.value))return Z(e,t,`top`);let o=e.b.edges.bottom;if(o&&i(o.crossTarget)&&n.crossTarget>=(o.expanded??o.value))return Z(e,t,`bottom`)}function ba(e){let t=null;if(Math.abs(e.gapX)+1>Math.abs(e.gapY)&&e.midX!==null)t=e.gapX>0?Z(e,`right`,`left`):Z(e,`left`,`right`);else if(e.a.isPoint&&e.b.isPoint)t=e.gapY>0?Z(e,`bottom`,`top`):Z(e,`top`,`bottom`);else{let n=ya(e,`right`);n===void 0&&(n=ya(e,`left`)),n===void 0?e.gapY>0&&e.midY!==null?t=Z(e,`bottom`,`top`):e.gapY<0&&e.midY!==null&&(t=Z(e,`top`,`bottom`)):t=n}if(t)return t;let n=Gi.filter(t=>e.a.edges[t]),r=Gi.filter(t=>e.b.edges[t]);return va(e,n.flatMap(e=>r.map(t=>[e,t])))}function xa(e,t){let n=null;return t===`right`?n=e.gapX>0&&e.gapX>Math.abs(e.gapY)&&e.midX!==null?Z(e,`right`,`left`):ya(e,`right`)??null:t===`left`&&(n=e.gapX<0&&Math.abs(e.gapX)>Math.abs(e.gapY)&&e.midX!==null?Z(e,`left`,`right`):ya(e,`left`)??null),n||va(e,{top:[`bottom`,`right`,`left`,`top`],bottom:[`top`,`right`,`left`,`bottom`],left:[`right`,`bottom`,`left`,`top`],right:[`left`,`bottom`,`right`,`top`]}[t].map(e=>[t,e]))}var Sa={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function Ca(e,t,n){return Z(e,t,n)||(e.a.isPoint&&e.b.isPoint?va(e,[[Sa[t],Sa[n]],[t,Sa[n]],[Sa[t],n]]):e.a.isPoint?Z(e,Sa[t],n):e.b.isPoint?Z(e,t,Sa[n]):null)}function wa(e,t,n){if(n.isPoint||n.gap<=0||e.length<2)return;let r=t?e[0]:e[e.length-1],i=t?e[1]:e[e.length-2],a=f(Math.abs(r.x-i.x)+Math.abs(r.y-i.y)-n.minEnd,0,n.gap);if(a<=0)return;let o=Math.sign(i.x-r.x),s=Math.sign(i.y-r.y);r.x+=o*a,r.y+=s*a}function Ta(e,t,n){if(!n.outline||!n.side||n.isPoint||e.length<2)return;let r=t?e[0]:e[e.length-1],i=t?e[1]:e[e.length-2];if(n.side===`left`||n.side===`right`){if(Math.abs(r.y-i.y)>Y)return;r.x=n.outline(r.y)}else{if(Math.abs(r.x-i.x)>Y)return;r.y=n.outline(r.x)}}function Ea(e,t,n){if(e.length<3)return;let r=t?e[0]:e[e.length-1],i=t?e[1]:e[e.length-2];if(!(Math.abs(r.x-i.x)+Math.abs(r.y-i.y)>=n)&&(e.splice(t?1:e.length-2,1),e.length>=3)){let n=t?e[1]:e[e.length-2];Math.abs(r.x-i.x)<Y?n.y=r.y:n.x=r.x}}function Da(e,t){let n=t.box.minX-e.box.maxX;n<0&&(n=-Math.max(0,e.box.minX-t.box.maxX));let r=t.box.minY-e.box.maxY;return r<0&&(r=-Math.max(0,e.box.minY-t.box.maxY)),{gapX:n,gapY:r}}var Oa={x:{lo:`minX`,hi:`maxX`},y:{lo:`minY`,hi:`maxY`}};function ka(e,t,n,r,i,a,o,s,c){let{lo:l,hi:u}=Oa[e];return t>n?{a:r.isPoint?r.box[u]+s:a[u],b:i.isPoint?i.box[l]-c:o[l]}:t<-n?{a:r.isPoint?r.box[l]-s:a[l],b:i.isPoint?i.box[u]+c:o[u]}:null}function Aa(e,t,n,r){if(!e||e.points.length<2)return null;let i=e.points;return Ta(i,!0,t),Ta(i,!1,n),wa(i,!0,t),wa(i,!1,n),Ea(i,!0,t.minEnd),Ea(i,!1,n.minEnd),r&&i.reverse(),i}function ja(e,t,n){let r={box:Ii(e.bounds),target:{x:e.target.x,y:e.target.y},gap:e.gap,minEnd:e.minEnd,side:e.side,outline:e.outline,isPoint:e.isPoint},i={box:Ii(t.bounds),target:{x:t.target.x,y:t.target.y},gap:t.gap,minEnd:t.minEnd,side:t.side,outline:t.outline,isPoint:t.isPoint},a=!r.side&&!!i.side,o=a?i:r,s=a?r:i,c=Ji(o,s),l=Ji(s,o);(!Yi(c,o.side)||!Yi(l,s.side))&&(Yi(c,o.side)||(s=Xi(s)),Yi(l,s.side)||(o=Xi(o)),Bi(s.box,o.target,J)&&(s=Xi(s)),Bi(o.box,s.target,J)&&(o=Xi(o)),c=Ji(o,s),l=Ji(s,o));let u=o.isPoint?o.box:Li(o.box,J),d=s.isPoint?s.box:Li(s.box,J),{gapX:f,gapY:p}=Da(o,s),m=o.minEnd*Fi,h=s.minEnd*Fi,g=(o.isPoint?m:Ni)+(s.isPoint?h:Ni),_=ka(`x`,f,g,o,s,u,d,m,h),v=ka(`y`,p,g,o,s,u,d,m,h),y=a?1-n:n,ee=_?Wi(_.a,_.b,y):null,b=v?Wi(v.a,v.b,y):null,x={a:{box:o.box,grown:u,edges:c,isPoint:o.isPoint},b:{box:s.box,grown:d,edges:l,isPoint:s.isPoint},common:{box:Ri(o.box,s.box),grown:Ri(u,d)},gapX:f,gapY:p,midX:ee,midY:b,bias:{x:1,y:1},applied:[]},S=null;return o.side&&s.side?S=Ca(x,o.side,s.side):o.side&&(S=xa(x,o.side)),S||=ba(x),{route:Aa(S,o,s,a),midHandle:S?.mid??null,midXRange:_?a?{lo:_.b,hi:_.a}:{lo:_.a,hi:_.b}:null,midYRange:v?a?{lo:v.b,hi:v.a}:{lo:v.a,hi:v.b}:null}}function Ma(e){let t=[];for(let n of e){let e=t[t.length-1],r=t[t.length-2];if(!e){t.push({x:n.x,y:n.y});continue}let i=Math.abs(n.x-e.x)<Y,a=Math.abs(n.y-e.y)<Y;if(!(i&&a)){if(r&&i&&Math.abs(n.x-r.x)<Y){e.y=n.y;continue}if(r&&a&&Math.abs(n.y-r.y)<Y){e.x=n.x;continue}t.push({x:n.x,y:n.y})}}return t}function Na(e,t,n,r){if(n.isPoint)return Math.sign(e-r)===t?r:null;let i=r+t*n.gap;return Math.sign(e-i)===t?i:Math.sign(e-r)===t&&Math.abs(e-r)>Y?r+(e-r)/2:null}function Pa(e,t,n){let r=n?e[0]:e[e.length-1],i=n?e[1]:e[e.length-2],a=Math.abs(i.y-r.y)<=Y;if(a===Math.abs(i.x-r.x)<=Y||t.side&&(t.side===`left`||t.side===`right`)!==a)return!1;if(a){let e=Math.sign(i.x-r.x),n=Na(i.x,e,t,!t.isPoint&&t.outline?t.outline(t.target.y):t.isPoint?t.target.x:e>0?t.bounds.x+t.bounds.width:t.bounds.x);return n===null?!1:(r.x=n,r.y=t.target.y,i.y=t.target.y,!0)}let o=Math.sign(i.y-r.y),s=Na(i.y,o,t,!t.isPoint&&t.outline?t.outline(t.target.x):t.isPoint?t.target.y:o>0?t.bounds.y+t.bounds.height:t.bounds.y);return s===null?!1:(r.y=s,r.x=t.target.x,i.x=t.target.x,!0)}function Fa(e,t,n){if(e.length<3)return null;let r=e.map(e=>({x:e.x,y:e.y}));if(!Pa(r,t,!0)||!Pa(r,n,!1))return null;let i=Ma(r);if(i.length<3)return null;for(let e=0;e<i.length-1;e+=1)if(Math.abs(i[e+1].x-i[e].x)>Y&&Math.abs(i[e+1].y-i[e].y)>Y)return null;return i}function Ia(e,t,n){if(e.length<2||t<0||t>e.length-2)return null;let r=e.map(e=>({x:e.x,y:e.y})),i=r[t],a=r[t+1],o=a.x-i.x,s=a.y-i.y,c=Math.abs(s)<=Math.abs(o),l=Math.abs(c?o:s);if(l<Y)return null;let u=Math.min(J,l/2);if(t===e.length-2){let e=r[r.length-1],t=c?{x:e.x-Math.sign(o)*u,y:e.y}:{x:e.x,y:e.y-Math.sign(s)*u};r.splice(r.length-1,0,{...t},{...t})}let d=t;if(t===0){let e=r[0],t=c?{x:e.x+Math.sign(o)*u,y:e.y}:{x:e.x,y:e.y+Math.sign(s)*u};r.splice(1,0,{...t},{...t}),d=2}let f=r[d],p=r[d+1];c?(f.y=n,p.y=n):(f.x=n,p.x=n);let m=Ma(r);return m.length<2?null:m}function La(e,t){return{bounds:{x:e.x,y:e.y,width:0,height:0},target:{x:e.x,y:e.y},gap:0,minEnd:t*Pi,side:null,isPoint:!0}}var Ra=18,za=.58,Ba=.15,Va=.16,Ha=.5,Ua=.68;function Wa(e,t,n){let r={x:-Math.sin(t),y:Math.cos(t)},i=r=>{let i=t+za*r;return{x:e.x-n*Math.cos(i),y:e.y-n*Math.sin(i)}},a=t=>({x:t.x+(e.x-t.x)*Va,y:t.y+(e.y-t.y)*Va}),o=t=>{let i=Math.sign((t.x-e.x)*r.x+(t.y-e.y)*r.y);return{x:e.x+r.x*i*n*Ba,y:e.y+r.y*i*n*Ba}},s=i(-1),c=i(1),l=a(s),u=a(c),d=o(s),f=o(c);return`M ${s.x} ${s.y} C ${l.x} ${l.y} ${d.x} ${d.y} ${e.x} ${e.y} C ${f.x} ${f.y} ${u.x} ${u.y} ${c.x} ${c.y}`}function Ga(e,t,n){let r={x:-Math.sin(t),y:Math.cos(t)},i=i=>{let a=t+Ha*i,o={x:e.x-n*Math.cos(a),y:e.y-n*Math.sin(a)},s={x:(o.x+e.x)/2,y:(o.y+e.y)/2},c=((s.x-e.x)*r.x+(s.y-e.y)*r.y)*Ua,l={x:s.x-r.x*c,y:s.y-r.y*c};return`M ${o.x} ${o.y} Q ${l.x} ${l.y} ${e.x} ${e.y}`};return`${i(-1)} ${i(1)}`}function Ka(e){return{x:(e.x+e.x2)/2,y:(e.y+e.y2)/2}}function qa(e,t){return u(e,m(e)*s(t)).point}function Ja(e){let t=e.labelAlong;if(e.bendStyle===`elbow`)return qa(no(e),t??.5);let n=mo(e);if(n)return t===void 0?n.apex:n.pointAt(t);if(t===void 0)return Ka(e);let r=s(t);return{x:e.x+(e.x2-e.x)*r,y:e.y+(e.y2-e.y)*r}}function Ya(e,t){if(e.bendStyle===`elbow`)return _(no(e),t);let n=mo(e);if(n)return po(n,t);let r=e.x2-e.x,i=e.y2-e.y,a=r*r+i*i;return a<1e-9?.5:s(((t.x-e.x)*r+(t.y-e.y)*i)/a)}var Xa=22,Za=10;function Qa(e,t){let n=Math.hypot(t.x,t.y)||1;return{x:e.x+t.y/n*Za,y:e.y-t.x/n*Za}}function $a(e,t){if(e.bendStyle===`elbow`){let n=no(e),r=t===`start`?n:[...n].reverse(),i=u(r,Math.min(Xa,m(r)*.4));return Qa(i.point,i.dir)}let n={x:e.x,y:e.y},r={x:e.x2,y:e.y2},i=c(n,r)||1,o=mo(e);if(!o){let e=Math.min(Xa,i*.4);return t===`start`?Qa(a(n,r,e),{x:r.x-n.x,y:r.y-n.y}):Qa(a(r,n,e),{x:n.x-r.x,y:n.y-r.y})}let s=Math.min(Xa/i,.4),l=t===`start`?o.pointAt(s):o.pointAt(1-s),d=t===`start`?o.pointAt(s+.02):o.pointAt(1-s-.02);return Qa(l,{x:d.x-l.x,y:d.y-l.y})}function eo(e){let t=e.x2-e.x,n=e.y2-e.y,r=Math.hypot(t,n)||1,i={x:t/r,y:n/r};return{dir:i,normal:{x:-i.y,y:i.x}}}function to(e){return ja(La({x:e.x,y:e.y},e.strokeWidth),La({x:e.x2,y:e.y2},e.strokeWidth),e.elbowMid??.5)}function no(e){if(e.elbowPoints&&e.elbowPoints.length>=2)return e.elbowPoints.map(e=>({x:e.x,y:e.y}));if(e.elbowRoute&&e.elbowRoute.length>=2)return e.elbowRoute.map(e=>({x:e.x,y:e.y}));let t=to(e);return t.route&&t.route.length>=2?t.route:[{x:e.x,y:e.y},{x:e.x2,y:e.y2}]}function ro(e){return e.elbowPoints?null:e.startBinding||e.endBinding?e.elbowMidHandle??null:to(e).midHandle}var io=.4;function ao(e){return f(e||0,-.4,io)}function oo(e){let t=Ka(e),{dir:n,normal:r}=eo(e),i=c({x:e.x,y:e.y},{x:e.x2,y:e.y2}),a=ao(e.bendAlong)*i;return{x:t.x+n.x*a+r.x*e.bend,y:t.y+n.y*a+r.y*e.bend}}var so=Math.PI*2,co=e=>(e%so+so)%so;function lo(e,t,n){let r=Math.atan2(e.y-t.y,e.x-t.x);return-Math.sin(r)*n.x+Math.cos(r)*n.y>0}function uo(e,t,n,r){let i=c(n,e),a=Math.atan2(e.y-n.y,e.x-n.x),o=Math.atan2(t.y-n.y,t.x-n.x),s=r?co(o-a):-co(a-o);return{from:e,to:t,center:n,r:i,a0:a,delta:s,len:Math.abs(s)*i}}function fo(e,t,n,r){let i=c(e,t);if(i<1||Math.abs(n)<.5)return null;let a={x:(t.x-e.x)/i,y:(t.y-e.y)/i},o={x:-a.y,y:a.x},l={x:(e.x+t.x)/2,y:(e.y+t.y)/2},u=ao(r)*i,d={x:l.x+a.x*u+o.x*n,y:l.y+a.y*u+o.y*n},f;if(Math.abs(u)<.5){let r=i/2,s=(n*n-r*r)/(2*n),c={x:l.x+o.x*s,y:l.y+o.y*s};f=[uo(e,t,c,lo(d,c,a))]}else{let n=e=>{let t=e.x-d.x,n=e.y-d.y,r=o.x*t+o.y*n;if(Math.abs(r)<.25||Math.hypot(t,n)<1)return null;let i=(t*t+n*n)/(2*r);return{x:d.x+o.x*i,y:d.y+o.y*i}},r=n(e),i=n(t);if(!r||!i)return null;f=[uo(e,d,r,lo(d,r,a)),uo(d,t,i,lo(d,i,a))]}let p=f.reduce((e,t)=>e+t.len,0);if(p<1)return null;let m=f[f.length-1];return{apex:d,apexT:f.length===2?f[0].len/p:.5,length:p,segments:f,pointAt:e=>{let n=s(e)*p;for(let e of f){if(n<=e.len||e===m){let t=e.len?Math.min(1,n/e.len):0,r=e.a0+e.delta*t;return{x:e.center.x+e.r*Math.cos(r),y:e.center.y+e.r*Math.sin(r)}}n-=e.len}return{x:t.x,y:t.y}}}}function po(e,t){let n=0,r=.5,i=1/0;for(let a of e.segments){let o=Math.abs(a.delta),s=Math.atan2(t.y-a.center.y,t.x-a.center.x),l=a.delta>=0?co(s-a.a0):co(a.a0-s),u;u=o<1e-9?0:l<=o?l/o:c(t,a.from)<=c(t,a.to)?0:1;let d=a.a0+a.delta*u,f=c(t,{x:a.center.x+a.r*Math.cos(d),y:a.center.y+a.r*Math.sin(d)});f<i&&(i=f,r=(n+u*a.len)/e.length),n+=a.len}return r}function mo(e){return fo({x:e.x,y:e.y},{x:e.x2,y:e.y2},e.bend,e.bendAlong??0)}function ho(e,t,n){let r=c(e,t)||1,i={x:(t.x-e.x)/r,y:(t.y-e.y)/r},a={x:-i.y,y:i.x},o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},s=n.x-o.x,l=n.y-o.y;return{bow:s*a.x+l*a.y,bowAlong:ao((s*i.x+l*i.y)/r)}}function go(e,t,n){return Math.abs(e*t)<=n?0:e}function _o(e,t){let n=t===`from`?e.a0:e.a0+e.delta,r=e.delta>=0?1:-1;return{x:-Math.sin(n)*r,y:Math.cos(n)*r}}function vo(e){return oo(e)}function yo(e,t){let n=ho({x:e.x,y:e.y},{x:e.x2,y:e.y2},t);return{bend:n.bow,bendAlong:n.bowAlong}}function bo(e,t){if(e.length<2)return``;let n=`M ${e[0].x} ${e[0].y}`;for(let r=1;r<e.length-1;r+=1){let i=e[r-1],o=e[r],s=e[r+1],l=Math.min(t,c(i,o)/2,c(o,s)/2),u=a(o,i,l),d=a(o,s,l);n+=` L ${u.x} ${u.y} Q ${o.x} ${o.y} ${d.x} ${d.y}`}let r=e[e.length-1];return n+=` L ${r.x} ${r.y}`,n}function xo(e){if(e.bendStyle===`elbow`){let t=no(e);if(t.length>=2)return bo(t,Ra)}let t=e.bendStyle===`elbow`?null:mo(e);if(!t)return`M ${e.x} ${e.y} L ${e.x2} ${e.y2}`;let n=`M ${t.segments[0].from.x} ${t.segments[0].from.y}`;for(let e of t.segments){let t=+(Math.abs(e.delta)>Math.PI),r=+(e.delta>0);n+=` A ${e.r} ${e.r} 0 ${t} ${r} ${e.to.x} ${e.to.y}`}return n}function So(e,t,n,r){if(e.length>n){let i=r?1-n/e.length:n/e.length,a=e.pointAt(i);if(c(a,t)>1e-6)return Math.atan2(t.y-a.y,t.x-a.x)}if(r){let t=_o(e.segments[e.segments.length-1],`to`);return Math.atan2(t.y,t.x)}let i=_o(e.segments[0],`from`);return Math.atan2(-i.y,-i.x)}function Co(e,t){let n=t===`end`,r=n?{x:e.x2,y:e.y2}:{x:e.x,y:e.y},i=(n?e.endHead:e.startHead)??`arrow`,a=Oi(e.strokeWidth),s=n?Math.atan2(e.y2-e.y,e.x2-e.x):Math.atan2(e.y-e.y2,e.x-e.x2);if(e.bendStyle===`elbow`){let t=no(e);return{tip:r,angle:d(t,n)??s,length:Mi(a,i,m(t),o(t,n))}}let l=mo(e);if(!l)return{tip:r,angle:s,length:Mi(a,i,c({x:e.x,y:e.y},{x:e.x2,y:e.y2}))};let u=Mi(a,i,l.length);return{tip:r,angle:So(l,r,u,n),length:u}}var wo=[0,Math.PI/2,Math.PI,-Math.PI/2];function To(e){let t=[e.from,e.to];for(let n of wo)(e.delta>=0?co(n-e.a0):co(e.a0-n))>Math.abs(e.delta)||t.push({x:e.center.x+e.r*Math.cos(n),y:e.center.y+e.r*Math.sin(n)});return t}function Eo(e){if(e.bendStyle===`elbow`)return no(e);let t=mo(e);return t?t.segments.flatMap(To):[{x:e.x,y:e.y},{x:e.x2,y:e.y2},oo(e)]}function Do(e){let t=Eo(e),n=t.map(e=>e.x),r=t.map(e=>e.y),i=Math.min(...n),a=Math.min(...r);return{x:i,y:a,width:Math.max(...n)-i,height:Math.max(...r)-a}}var Oo={n:`n`,s:`s`,e:`w`,w:`e`,ne:`nw`,nw:`ne`,se:`sw`,sw:`se`},ko={n:`s`,s:`n`,e:`e`,w:`w`,ne:`se`,se:`ne`,nw:`sw`,sw:`nw`};function Ao(e,t,n){if(!e)return e;if(!t.has(e.shapeId))return null;if(`kind`in e)return e;let r=n?{x:1-e.anchor.x,y:e.anchor.y}:{x:e.anchor.x,y:1-e.anchor.y};if(!e.port)return{...e,anchor:r};let i=n?Oo:ko;return{...e,anchor:r,port:i[e.port]}}function jo(e,t,n){if(!(!t.has(e.from)||!t.has(e.to)))return n?{from:e.to,to:e.from,fromTop:e.toTop,fromSpan:e.toSpan,toTop:e.fromTop,toSpan:e.fromSpan}:{...e,fromTop:1-e.fromTop-e.fromSpan,toTop:1-e.toTop-e.toSpan}}var Mo={bounds:Do,domMeasured:`never`,move:(e,t)=>{let n={...e,x:e.x+t.x,y:e.y+t.y,x2:e.x2+t.x,y2:e.y2+t.y};return e.elbowPoints&&(n.elbowPoints=e.elbowPoints.map(e=>({x:e.x+t.x,y:e.y+t.y}))),e.elbowRoute&&(n.elbowRoute=e.elbowRoute.map(e=>({x:e.x+t.x,y:e.y+t.y}))),e.elbowMidHandle&&(n.elbowMidHandle={...e.elbowMidHandle,x:e.elbowMidHandle.x+t.x,y:e.elbowMidHandle.y+t.y}),n},rotate:(e,t,n)=>{let r=y({x:e.x,y:e.y},t,n),i=y({x:e.x2,y:e.y2},t,n);return{...e,x:r.x,y:r.y,x2:i.x,y2:i.y,elbowPoints:void 0,elbowRoute:void 0,elbowMidHandle:void 0}},scale:(e,t,n,r)=>{let i=e=>t.x+(e-t.x)*n,a=e=>t.y+(e-t.y)*r;return{...e,x:i(e.x),y:a(e.y),x2:i(e.x2),y2:a(e.y2),bend:e.bend*(n+r)*.5,bow:e.bow==null?e.bow:e.bow*(n+r)*.5,elbowPoints:e.elbowPoints?.map(e=>({x:i(e.x),y:a(e.y)})),elbowRoute:void 0,elbowMidHandle:void 0}},flip:(e,{point:t,moving:n,horizontal:r})=>{let i=t({x:e.x,y:e.y}),a=t({x:e.x2,y:e.y2});return{...e,x:i.x,y:i.y,x2:a.x,y2:a.y,bend:-e.bend,bow:e.bow==null?e.bow:-e.bow,elbowPoints:e.elbowPoints?.map(t),elbowRoute:void 0,elbowMidHandle:void 0,startBinding:Ao(e.startBinding,n,r),endBinding:Ao(e.endBinding,n,r)}},rawText:ci,kindName:e=>e.type},No={top:0,right:0,bottom:0,left:0},Po=.46,Fo=.28,Io=.2,Lo=.35,Ro=.4,zo=.35;function Bo(e,t,n,r){let i=Vo(e,t,n);return!r?.x&&!r?.y?i:{top:r.y?i.bottom:i.top,right:r.x?i.left:i.right,bottom:r.y?i.top:i.bottom,left:r.x?i.right:i.left}}function Vo(e,t,n){let r={x:0,y:0,width:t,height:n};if(e===`multi-process`){let e=jn(r);return{top:2*e,right:2*e,bottom:0,left:0}}if(e===`multi-document`){let e=jn(r);return{top:2*e,right:2*e,bottom:(n-2*e)*sn,left:0}}if(e===`cube`){let e=gn(r);return{top:e,right:e,bottom:0,left:0}}if(e===`double-circle`){let e=Math.min(t,n)*In+6;return{top:e,right:e,bottom:e,left:e}}if(e===`cylinder`)return{top:2*Zt(r),right:0,bottom:0,left:0};if(e===`queue`){let e=Qt(r);return{top:0,right:e,bottom:0,left:2*e}}if(e===`document`)return{top:0,right:0,bottom:n*sn,left:0};if(e===`speech-bubble`)return{top:0,right:0,bottom:n*(1-Sn),left:0};if(e===`callout`)return{top:0,right:0,bottom:n*(1-xn),left:0};if(e===`actor`)return{top:n*yn,right:0,bottom:0,left:0};if(e===`triangle`)return{top:n*Po,right:0,bottom:0,left:0};if(e===`cloud`)return{top:n*Fo,right:0,bottom:0,left:0};if(e===`pentagon`)return{top:0,right:dn(r),bottom:0,left:0};if(e===`chevron`)return{top:0,right:0,bottom:0,left:pn(r)*zo};if(e===`manual-input`)return{top:n*Io,right:0,bottom:0,left:0};if(e===`delay`)return{top:0,right:On(r)*Ro,bottom:0,left:0};if(e===`package`)return{top:zn(r),right:0,bottom:0,left:0};if(e===`component`)return{top:0,right:0,bottom:0,left:Hn(r)+4};if(e===`brace`)return{top:0,right:0,bottom:0,left:Wn(r)+8};if(e===`arrow-up`||e===`arrow-down`||e===`arrow-left`||e===`arrow-right`){let t=nn(r,e.slice(6))*Lo;return e===`arrow-right`?{top:0,right:t,bottom:0,left:0}:e===`arrow-left`?{top:0,right:0,bottom:0,left:t}:e===`arrow-up`?{top:t,right:0,bottom:0,left:0}:{top:0,right:0,bottom:t,left:0}}return No}var Ho=14*.3;function Uo(e){return Math.max(14,Math.round(e))}function Wo(e){return Math.max(6,Math.round(e*.35))}var Go={ellipse:{fx:.146,fy:.146},diamond:{fx:.25,fy:.25},triangle:{fx:.25,fy:.5},parallelogram:{fx:.2,fy:0},trapezoid:{fx:.18,fy:0},hexagon:{fx:.25,fy:0},star:{fx:.3,fy:.18},heart:{fx:.22,fy:.1},cloud:{fx:.16,fy:.22},"speech-bubble":{fx:.05,fy:.05},bolt:{fx:.32,fy:.12},plus:{fx:.33,fy:.02},"arrow-up":{fx:.5,fy:.3},"arrow-down":{fx:.25,fy:.25},"arrow-left":{fx:.45,fy:.25},"arrow-right":{fx:.25,fy:.25}};function Ko(e,t,n,r){if(r?.x||r?.y){let i=Ko(e,t,n);return{x:r.x?t-i.x:i.x,y:r.y?n-i.y:i.y}}if(e===`oval`){let e=n/2*(1-Math.SQRT1_2);return{x:e,y:e}}if(e===`cylinder`)return{x:0,y:Zt({x:0,y:0,width:t,height:n})};if(e===`queue`)return{x:Qt({x:0,y:0,width:t,height:n}),y:0};let i=Go[e]??{fx:0,fy:0};return{x:i.fx*t,y:i.fy*n}}var qo=1.25,Jo=1.15;function Yo(e){let{kind:t,width:n,height:r,fontSize:i,lineHeight:a,textPadding:o,flipX:s,flipY:c}=e,l=Bo(t,n,r,{x:s,y:c}),u=o??6,d=r-l.top-l.bottom-u*2,f=Math.floor(d/(a??1.25));return Math.max(8,Math.min(i,f))}var Xo=.917,Zo=.292,Qo=(Xo-Zo)/2;function $o(e,t){return e*t/2+e*Qo}function es(e){return Math.max(2,Math.round(e*.2))}function ts(e){if(!e)return null;let t=e.trim();return t?/^(https?:|mailto:)/i.test(t)?t:/^[\w-]+(\.[\w-]+)+([/?#].*)?$/.test(t)?`https://${t}`:null:null}var ns={blue:`#e7f5ff`,green:`#ebfbee`,red:`#fff5f5`,orange:`#fff4e6`,violet:`#f3f0ff`,teal:`#e6fcf5`,pink:`#fff0f6`,yellow:`#fff9db`,gray:`#f8f9fa`},rs={blue:l.blue.bold,green:l.green.bold,red:l.red.bold,orange:l.orange.bold,violet:l.purple.bold,teal:l.teal.bold,pink:l.pink.bold,yellow:l.yellow.bold,gray:l.gray.bold},is=`#1e1e1e`,Q={ink:`token:ink`,inkMuted:`token:ink-muted`,inkInverse:`token:ink-inverse`,paper:`token:paper`,paperGrid:`token:paper-grid`,paperLine:`token:paper-line`},as={[Q.ink]:{var:`var(--canvas-ink)`,key:`ink`,lit:`#1e1e1e`},[Q.inkMuted]:{var:`var(--canvas-ink-muted)`,key:`inkMuted`,lit:`#495057`},[Q.inkInverse]:{var:`var(--canvas-ink-inverse)`,key:`inkInverse`,lit:`#ffffff`},[Q.paper]:{var:`var(--paper-bg)`,key:`paperBg`,lit:`#ffffff`},[Q.paperGrid]:{var:`var(--paper-grid)`,key:`paperGrid`,lit:`#eceef0`},[Q.paperLine]:{var:`var(--paper-line)`,key:`paperLine`,lit:`#dee2e6`}},os=Object.fromEntries(Object.values(as).map(e=>[e.key,e.lit]));function ss(e){return as[e]?.var??e}function cs(e){return e===void 0?void 0:ss(e)}function ls(e){return Object.values(as).find(t=>t.var===e)?.lit??e}function us(e,t){let n=as[e];return n?t?t[n.key]:n.lit:e}var ds={"#1e1e1e":Q.ink,"#495057":Q.inkMuted,"#ffffff":Q.inkInverse},fs={"#ffffff":Q.paper,"#eceef0":Q.paperGrid,"#dee2e6":Q.paperLine};function ps(e){return ds[e]??e}function ms(e){return ss(ps(e))}function hs(e){return e===Q.inkInverse?Q.ink:as[e]?Q.paper:void 0}function gs(e,t){return us(ps(e),t)}function _s(e){return cs(e===void 0?void 0:fs[e]??e)}function vs(e,t){return us(fs[e]??e,t)}var ys=new Map(Object.keys(ns).map(e=>[ns[e],rs[e]]));function bs(e){if(e===`#ffffff`)return ss(Q.paper);if(g(e,0)>.9){let t=ys.get(e);return`color-mix(in srgb, ${e} var(--paper-tint-strength), ${t?`color-mix(in srgb, ${t} var(--paper-hue-strength), var(--canvas-bg))`:`var(--canvas-bg)`})`}return ss(e)}var xs=.08,Ss=.1;function Cs(e,t){if(e!==`#ffffff`&&g(e,0)>.9&&g(t.bg,1)<.5){let n=ys.get(e);return Os(e,n?Os(n,t.bg,Ss):t.bg,xs)}return us(e===`#ffffff`?Q.paper:e,t)}var ws=.32,Ts=.4;function Es(e){return{pastel:e.pastel,fill:`color-mix(in srgb, ${e.pastel} var(--node-pastel-strength), color-mix(in srgb, ${e.bold} var(--node-hue-strength), var(--canvas-bg)))`,stroke:`color-mix(in srgb, var(--canvas-ink) var(--node-stroke-ink), ${e.bold})`}}function Ds(e,t){return g(t.bg,1)>=.5?{pastel:e.pastel,fill:e.pastel,stroke:t.ink}:{pastel:e.pastel,fill:Os(e.bold,t.bg,ws),stroke:Os(t.ink,e.bold,Ts)}}function Os(e,t,n){let r=h(e),i=h(t);if(!r||!i)return t;let a=(e,t)=>Math.round(e*n+t*(1-n)).toString(16).padStart(2,`0`);return`#${a(r.r,i.r)}${a(r.g,i.g)}${a(r.b,i.b)}`}function ks(e){return e&&g(e.paperBg,0)<.5?`screen`:`multiply`}function As(e,t,n,r,i,a){if(a&&e===`stroke`&&t===`#1e1e1e`)return a.stroke;if(a&&e===`fill`&&t===a.pastel)return a.fill;if(e===`stroke`)return r(t);if(e===`fill`){if(n===`paper`)return i(t);if(n===`ink`)return r(t)}return t}var js=RegExp(`<(?:${[`strong`,`em`,`u`,`s`,`code`,`mark`,`a`,`span`,`i`,`b`,`del`,`strike`,`ul`,`ol`,`li`,`br`,`div`,`p`].join(`|`)})\\b`,`i`);function Ms(e){return js.test(e)}function Ns(e){return e.replace(/\u200B/g,``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Ps(e){return Ns(e).replace(/"/g,`&quot;`)}function Fs(e){return`<ul>${e.map(e=>`<li>${Ns(e)}</li>`).join(``)}</ul>`}function Is(e){if(!e)return null;let t=e.trim().match(/^(\d+(?:\.\d+)?)px$/);if(!t)return null;let n=Math.round(Number(t[1]));return n<8||n>240?null:n}function Ls(e,t){return t===1?e:e.replace(/font-size:\s*(\d+(?:\.\d+)?)px/gi,(e,n)=>`font-size:${Math.round(f(Number(n)*t,8,240))}px`)}function Rs(e){if(!e)return null;let t=e.trim().toLowerCase();return/^#[0-9a-f]{3,8}$/.test(t)||/^rgba?\([\d.,\s%/]+\)$/.test(t)?t:null}function zs(e){let t=``;return e.childNodes.forEach(e=>{t+=Vs(e)}),t}function Bs(e){let t=e.tagName.toLowerCase()===`ol`?`ol`:`ul`,n=t===`ul`&&e.hasAttribute(`data-checklist`),r=``;return e.childNodes.forEach(e=>{if(e.nodeType===1&&e.tagName.toLowerCase()===`li`){let t=n&&e.hasAttribute(`data-checked`);r+=`<li${t?` data-checked="true"`:``}>${zs(e)}</li>`}}),r?`<${t}${n?` data-checklist="true"`:``}>${r}</${t}>`:``}function Vs(e){if(e.nodeType===3)return Ns(e.nodeValue??``);if(e.nodeType!==1)return``;let t=e,n=t.tagName.toLowerCase();if(n===`br`)return`<br>`;let r=zs(t);if(n===`em`||n===`i`)return r?`<em>${r}</em>`:``;if(n===`code`)return r?`<code>${r}</code>`:``;if(n===`mark`)return r?`<mark>${r}</mark>`:``;if(n===`b`||n===`strong`)return r?`<strong>${r}</strong>`:``;if(n===`u`)return r?`<u>${r}</u>`:``;if(n===`s`||n===`del`||n===`strike`)return r?`<s>${r}</s>`:``;if(n===`a`){let e=ts(t.getAttribute(`href`));return e&&r?`<a href="${Ps(e)}">${r}</a>`:r}if(n===`ul`||n===`ol`)return Bs(t);if(n===`span`){if(!r)return``;let e=r,n=t.style;n.fontStyle===`italic`&&(e=`<em>${e}</em>`),`${n.textDecorationLine} ${n.textDecoration}`.includes(`line-through`)&&(e=`<s>${e}</s>`),Rs(n.backgroundColor)&&(e=`<mark>${e}</mark>`);let i=Rs(n.color);i&&(e=`<span style="color:${i}">${e}</span>`);let a=Is(n.fontSize);return a&&(e=`<span style="font-size:${a}px">${e}</span>`),e}return r}function Hs(e){let t=``,n=()=>t===``||/(?:<br>|\n|<\/ul>|<\/ol>)$/.test(t),r=()=>{n()||(t+=`<br>`)};return e.childNodes.forEach(e=>{if(e.nodeType===1){let n=e.tagName.toLowerCase();if(n===`div`||n===`p`){r(),t+=zs(e);return}if(n===`ul`||n===`ol`){t+=Bs(e);return}}t+=Vs(e)}),t}function Us(){return Promise.resolve()}function Ws(){return globalThis.DOMParser!==void 0}function Gs(e){let t=globalThis.DOMParser;if(!t)throw Error(`No HTML parser available: this environment has no global DOMParser. Install one with setHtmlParser (see @koboyo/renderer/adapters/node).`);return new t().parseFromString(e,`text/html`).body}function Ks(e){return Gs(e)}function qs(e){return Hs(Ks(e))}function Js(e){return e?Ms(e)?qs(e).replaceAll(`<a href="`,`<a target="_blank" rel="noopener noreferrer" href="`).replace(/<span style="color:([^"]+)">/g,(e,t)=>{let n=ps(Ys(t));return n.startsWith(`token:`)?`<span data-ink="${n.slice(6)}" style="color:${t}">`:e}):Ns(e):``}function Ys(e){let t=/^rgba?\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(e);return t?`#${t.slice(1).map(e=>Number(e).toString(16).padStart(2,`0`)).join(``)}`:e}function Xs(e,t=0){let n=``;return e.childNodes.forEach(e=>{if(e.nodeType===3){n+=(e.nodeValue??``).replace(/\u200B/g,``);return}if(e.nodeType!==1)return;let r=e,i=r.tagName.toLowerCase();if(i===`br`){n+=`
2
+ `;return}if(i===`li`){n&&!n.endsWith(`
3
+ `)&&(n+=`
4
+ `);let e=r.parentElement?.hasAttribute(`data-checklist`)?r.hasAttribute(`data-checked`)?`☑`:`☐`:`•`;n+=`${` `.repeat(Math.max(0,t-1))}${e} ${Xs(r,t)}`;return}if(i===`div`||i===`p`||i===`ul`||i===`ol`){n&&!n.endsWith(`
5
+ `)&&(n+=`
6
+ `),n+=Xs(r,i===`ul`||i===`ol`?t+1:t);return}n+=Xs(r,t)}),n}function Zs(e){return e?Ms(e)?Xs(Ks(e)):e:``}function Qs(e){return Zs(e).trim().length===0}function $s(e){return Ms(e)?e.replace(/\u200B/g,``).replace(/<(?:br|\/li|\/div|\/p|\/ul|\/ol)[^>]*>/gi,`
7
+ `).replace(/<li[^>]*>/gi,`• `).replace(/<[^>]+>/g,``).replace(/&[a-z#0-9]+;/gi,`*`).replace(/\n+/g,`
8
+ `).replace(/^\n|\n$/g,``):e}function ec(e){return Ws()?Zs(e):$s(e)}function tc(e){if(!e||!Ms(e))return e;let t=Ks(e);return t.querySelectorAll(`span`).forEach(e=>{e.style.color=``}),Hs(t)}function nc(e,t){let n=Ks(Js(e)),r=n.querySelectorAll(`ul[data-checklist] > li`)[t];return r?(r.hasAttribute(`data-checked`)?r.removeAttribute(`data-checked`):r.setAttribute(`data-checked`,`true`),Hs(n)):null}function rc(e,t){let n=e=>t===`strong`?e.bold:t===`em`?e.italic:t===`u`?e.underline:e.strike,r=!1;for(let t of cc(e))for(let e of t.runs)if(e.text.trim()!==``&&(r=!0,!n(e)))return!1;return r}function ic(e,t){let n=e.parentElement;for(;n;){if(n.tagName.toLowerCase()===t)return!0;n=n.parentElement}return!1}function ac(e,t,n){if(n)return oc(e,t)??e;let r=Ks(Js(e));return r.querySelectorAll(t).forEach(e=>{let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}),Hs(r)}function oc(e,t,n={}){let r=Ks(Js(e)),i=[],a=e=>{e.childNodes.forEach(e=>{e.nodeType===3?(e.nodeValue??``).length>0&&i.push(e):e.nodeType===1&&a(e)})};a(r);let o=0,s=1/0;if(n.match!==void 0){let e=i.map(e=>e.nodeValue??``).join(``),t=n.match?e.toLowerCase().indexOf(n.match.toLowerCase()):-1;if(t<0)return null;o=t,s=t+n.match.length}let c=r.ownerDocument;if(!c)return Hs(r);let l=0;for(let e of i){let r=e.nodeValue??``,i=Math.max(0,o-l),a=Math.min(r.length,s-l);l+=r.length;let u=e.parentNode;if(i>=a||!u||t!==`span`&&ic(e,t))continue;let d=c.createElement(t);for(let[e,t]of Object.entries(n.attributes??{}))d.setAttribute(e,t);d.appendChild(c.createTextNode(r.slice(i,a))),i>0&&u.insertBefore(c.createTextNode(r.slice(0,i)),e),u.insertBefore(d,e),a<r.length&&u.insertBefore(c.createTextNode(r.slice(a)),e),u.removeChild(e)}return Hs(r)}var sc={bold:!1,italic:!1,underline:!1,strike:!1,code:!1,highlight:!1};function cc(e){let t=Ks(Js(e)),n=[{runs:[]}],r=0,i=(e,t)=>{n.push({runs:[],marker:e,checked:t||void 0,depth:r||void 0})},a=(e,t)=>{let a=n[n.length-1];if(a.runs.length===0&&!a.marker){a.marker=e,a.checked=t||void 0,a.depth=r||void 0;return}i(e,t)},o=(e,t)=>{e.split(`
9
+ `).forEach((e,r)=>{r>0&&i(),e&&n[n.length-1].runs.push({text:e,...t})})},s=(e,t)=>{e.childNodes.forEach(e=>{if(e.nodeType===3){o((e.nodeValue??``).replace(/\u200B/g,``),t);return}if(e.nodeType!==1)return;let c=e,l=c.tagName.toLowerCase();if(l===`br`){i();return}if(l===`em`||l===`i`){s(c,{...t,italic:!0});return}if(l===`strong`||l===`b`){s(c,{...t,bold:!0});return}if(l===`u`){s(c,{...t,underline:!0});return}if(l===`s`||l===`del`||l===`strike`){s(c,{...t,strike:!0});return}if(l===`code`){s(c,{...t,code:!0});return}if(l===`mark`){s(c,{...t,highlight:!0});return}if(l===`a`){s(c,{...t,href:ts(c.getAttribute(`href`))??t.href});return}if(l===`span`){s(c,{...t,color:Rs(c.style.color)??t.color,fontSize:Is(c.style.fontSize)??t.fontSize});return}if(l===`ul`||l===`ol`){let e=l===`ul`&&c.hasAttribute(`data-checklist`),n=1;c.childNodes.forEach(i=>{i.nodeType===1&&i.tagName.toLowerCase()===`li`&&(e?a({kind:`checkbox`},i.hasAttribute(`data-checked`)):a(l===`ol`?{kind:`number`,text:`${n++}.`}:{kind:`bullet`}),r+=1,s(i,t),--r)}),i();return}if(l===`div`||l===`p`){(n[n.length-1].runs.length>0||n[n.length-1].marker)&&i(),s(c,t);return}s(c,t)})};for(s(t,sc);n.length>1;){let e=n[n.length-1];if(e.runs.length===0&&!e.marker)n.pop();else break}return n}var lc=(e,t)=>{let n=t?.textBounds(e.id);if(n)return{x:e.x,y:e.y,width:n.width,height:n.height};let r=$s(e.text).split(`
10
+ `),i=r.reduce((e,t)=>Math.max(e,t.length),0);return{x:e.x,y:e.y,width:e.width??Math.max(i*e.fontSize*.55,e.fontSize),height:Math.max(r.length*e.fontSize*(e.lineHeight??1.15),e.height??0)}},uc={bounds:lc,domMeasured:`always`,move:ui,rotate:(e,t,n)=>di(e,lc(e),t,n),scale:(e,t,n,r)=>{let i={...e,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*r,fontSize:e.fontSize*r,text:Ls(e.text,r)};return e.width!=null&&(i.width=e.width*n),i},flip:(e,t)=>pi(fi(e,lc(e),t),t.horizontal),rawText:e=>e.text,kindName:e=>e.type},dc=q(),fc={...dc,scale:(e,t,n,r)=>{let i=dc.bounds(e),a=t.x+(i.x+i.width/2-t.x)*n,o=t.y+(i.y+i.height/2-t.y)*r;return{...e,x:a-i.width/2,y:o-i.height/2}}},pc=Ti(),mc=Ti(),hc={...mc,flip:(e,t)=>e.band?{...yi(e,t.point),band:jo(e.band,t.moving,t.horizontal)}:mc.flip(e,t)},gc=Ti(),_c=q(),vc={..._c,flip:(e,t)=>pi(_c.flip(e,t),t.horizontal)},yc=`93B[bw]4ABK]0B2IVCVYXUXMVU23]]]OuX_bc]Wec<R[UpefZhbXWcYtTVXBG?PY1TTQUW<US56M4lTTUVAM<SL^KILG3Ga`,bc=32,xc=126,Sc=.55,Cc=1;function wc(e){return e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=126976}function Tc(e,t){let n=0;for(let t of e){let e=t.codePointAt(0)??0;if(e>=bc&&e<=xc){n+=(yc.charCodeAt(e-bc)-32)/100;continue}n+=wc(e)?Cc:Sc}return n*t}var Ec=q(),Dc={...Ec,footprint:(e,t,n)=>{if(!e.label)return t;let r=t.x+t.width/2,i=e.fontSize??36,a,o,s=n?.iconLabelBounds(e.id);if(s)a=s.width,o=s.height;else{let t=ec(e.label).split(`
11
+ `),n=Math.max(i*.58,...t.map(e=>Tc(e,i)));a=Math.min(n,200),o=Math.round(i*1.45+(t.length-1)*i*qo)}let c=Math.min(t.x,r-a/2),l=Math.max(t.x+t.width,r+a/2),u=t.y+t.height+es(i)+o;return{x:c,y:t.y,width:l-c,height:u-t.y}},domMeasured:`labelled`,scale:(e,t,n,r)=>{let i=Ec.bounds(e),a=(n+r)/2;return{...e,x:t.x+(i.x-t.x)*n,y:t.y+(i.y-t.y)*r,width:i.width*a,height:i.height*a,fontSize:e.fontSize*a}},flip:(e,t)=>pi(Ec.flip(e,t),t.horizontal)},Oc={...q(),kindName:()=>`frame`},kc=e=>({x:e.x,y:e.y,width:e.colWidths.reduce((e,t)=>e+t,0),height:e.rowHeights.reduce((e,t)=>e+t,0)}),$={rectangle:Di,arrow:Mo,text:uc,sticky:fc,draw:pc,polygon:hc,line:gc,image:vc,icon:Dc,figure:Oc,table:{bounds:kc,domMeasured:`never`,move:ui,rotate:(e,t,n)=>di(e,kc(e),t,n),scale:(e,t,n,r)=>({...e,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*r,colWidths:e.colWidths.map(e=>e*n),rowHeights:e.rowHeights.map(e=>e*r)}),flip:(e,t)=>fi(e,kc(e),t),rawText:ci,kindName:e=>e.type},chart:q(),control:q(),web:{...q(),kindName:e=>e.kind===`html`?`widget`:`embed`},custom:{...q(),kindName:e=>e.kind}};function Ac(e){let t=e.type;switch(t){case`rectangle`:return $.rectangle;case`arrow`:return $.arrow;case`text`:return $.text;case`sticky`:return $.sticky;case`draw`:return $.draw;case`polygon`:return $.polygon;case`line`:return $.line;case`image`:return $.image;case`icon`:return $.icon;case`figure`:return $.figure;case`table`:return $.table;case`chart`:return $.chart;case`control`:return $.control;case`web`:return $.web;case`custom`:return $.custom;default:return jc(t)}}function jc(e){throw Error(`no definition for shape type ${String(e)}`)}function Mc(e,t){return Ac(e).bounds(e,t)}function Nc(e){let t=Mc(e);return{x:t.x+t.width/2,y:t.y+t.height/2}}function Pc(e){return Qr(e)&&Ic(e)?e.rotation??0:0}function Fc(e){return Qr(e)&&Ic(e)}function Ic(e){let t=R[e.type].geometry;return t===`box`||t===`text`||t===`table`}function Lc(e,t){let n=Ac(e),r=n.bounds(e,t);return n.footprint?n.footprint(e,r,t):r}var Rc=new WeakMap;function zc(e){let t=Ac(e).domMeasured;return t===`always`||t===`labelled`&&`label`in e&&!!e.label}function Bc(e,t){if(zc(e))return Vc(e,t);let n=Rc.get(e);if(n)return n;let r=Vc(e);return Rc.set(e,r),r}function Vc(e,t){let n=Lc(e,t),r=Pc(e);if(!r)return n;let i=Mc(e,t);return Hc(n,{x:i.x+i.width/2,y:i.y+i.height/2},r*Math.PI/180)}function Hc(e,t,n){let r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}].map(e=>y(e,t,n)),i=r.map(e=>e.x),a=r.map(e=>e.y),o=Math.min(...i),s=Math.min(...a);return{x:o,y:s,width:Math.max(...i)-o,height:Math.max(...a)-s}}function Uc(e,t){if(!t)return e;let n=t*Math.PI/180;return Hc(e,{x:e.x+e.width/2,y:e.y+e.height/2},n)}var Wc=new WeakMap;function Gc(e){let t=Wc.get(e);if(t)return t;let n=Kc(e);return Wc.set(e,n),n}function Kc(e){return Uc(Mc(e),Pc(e))}function qc(e){return Number.isFinite(Pc(e))&&v(Mc(e))}function Jc(e){for(let t of e)if(!qc(t))return e.filter(qc);return e}function Yc(e,t){if(e.length===0)return null;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let o of e){let e=Bc(o,t);v(e)&&(n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x+e.width),a=Math.max(a,e.y+e.height))}return n===1/0?null:{x:n,y:r,width:i-n,height:a-r}}function Xc(e){return{x:e.includes(`e`)?1:e.includes(`w`)?-1:0,y:e.includes(`s`)?1:e.includes(`n`)?-1:0}}function Zc(e,t,n){return Math.max(0,(e-t)*n)}function Qc(e,t,n,r){let i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height;t.includes(`w`)&&(i=n.x),t.includes(`e`)&&(o=n.x),t.includes(`n`)&&(a=n.y),t.includes(`s`)&&(s=n.y);let c=r?.width??0,l=r?.height??0;return o-i<c&&(t.includes(`w`)?i=o-c:o=i+c),s-a<l&&(t.includes(`n`)?a=s-l:s=a+l),{x:Math.min(i,o),y:Math.min(a,s),width:Math.abs(o-i),height:Math.abs(s-a)}}function $c(e,t,n,r,i=!1){let{box:a,fontSize:o,width:s,height:c}=r,l=a.x+a.width/2,u=a.y+a.height/2,d=Xc(t);if(t===`n`||t===`s`){let r=t===`s`?a.y:a.y+a.height,i=Math.max(o,Zc(n.y,r,d.y));return{...e,y:d.y===1?r:r-i,height:i}}if(t===`w`||t===`e`){if(i){let t=Math.abs(n.x-l);return{...e,x:l-t,width:Math.max(o,t*2)}}let r=t===`e`?a.x:a.x+a.width,s=Math.max(o,Zc(n.x,r,d.x));return{...e,x:d.x===1?r:r-s,width:s}}let p=t===`ne`||t===`se`?a.x:a.x+a.width,m=t===`sw`||t===`se`?a.y:a.y+a.height,h=f(o*(i?Math.max(Math.abs(n.x-l)/(a.width/2||1),Math.abs(n.y-u)/(a.height/2||1)):Math.max(Zc(n.x,p,d.x)/(a.width||1),Zc(n.y,m,d.y)/(a.height||1))),8,240),g=h/o,_=a.width*g,v=a.height*g,y={...e,fontSize:h,text:Ls(e.text,g)};return i?(y.x=l-_/2,y.y=u-v/2):(y.x=p===a.x?a.x:p-_,y.y=m===a.y?a.y:m-v),s!=null&&(y.width=s*g),c!=null&&(y.height=c*g),y}function el(e){return e.height==null?e.width==null?`auto-width`:`auto-height`:`fixed`}function tl(e,t){let n=Mc(e);if(t===`auto-width`){if(e.width==null&&e.height==null)return e;let t={...e};return delete t.width,delete t.height,t}if(t===`auto-height`){if(e.width!=null&&e.height==null)return e;let t={...e};return delete t.height,t.width??=n.width,t}return e.width!=null&&e.height!=null?e:{...e,width:e.width??n.width,height:e.height??n.height}}function nl(e,t){return Ac(e).move(e,t)}function rl(e,t,n){return Ac(e).rotate(e,t,n)}function il(e,t,n,r){return Ac(e).scale(e,t,n,r)}function al(e,t){let n=Yc(e);if(!n)return e;let r=t===`horizontal`,i=new Set(e.map(e=>e.id)),a=n.x+n.width/2,o=n.y+n.height/2,s=e=>r?2*a-e:e,c=e=>r?e:2*o-e,l={horizontal:r,moving:i,point:e=>({x:s(e.x),y:c(e.y)})};return e.map(e=>Ac(e).flip(e,l))}function ol(e,t){return e.map(e=>({...e,steps:e.steps.flatMap(e=>{let n=t(e.target);if(!n)return[];let r={...e,target:n};if(e.also){let n=e.also.flatMap(e=>t(e)??[]);n.length>0?r.also=n:delete r.also}return[r]})}))}var sl={width:160,height:100};function cl(e){return e===`drawnicons`?96:55}function ll(e,t){return!Number.isFinite(t)||t<=0||t===1?{width:e,height:e}:t>1?{width:e,height:e/t}:{width:e*t,height:e}}function ul(e,t){return Math.max(0,t)/55*e}function dl(e,t){return(e-3)*(Math.max(0,t)/55)}function fl(e){return e===`ellipse`?{width:120,height:120}:e===`checkbox`||e===`crossbox`||e===`heart`||e===`plus`?{width:110,height:110}:e===`arrow-up`||e===`arrow-down`?{width:100,height:160}:e===`bolt`?{width:110,height:150}:e===`actor`?{width:100,height:150}:e===`arrow-left`||e===`arrow-right`?{width:160,height:100}:e===`queue`?{width:170,height:80}:e===`callout`?{width:180,height:90}:e===`double-circle`?{width:120,height:120}:e===`fork-join`?{width:160,height:26}:sl}function pl(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`shape-${Date.now()}-${Math.floor(Math.random()*1e6)}`}function ml(e){return{id:pl(),type:`rectangle`,kind:`rectangle`,rotation:0,label:``,fontSize:16,fontFamily:p,color:i,fill:`transparent`,strokeWidth:1.5,dash:`solid`,opacity:1,...e}}function hl(e,t){if(!e)return null;let n=t.get(e.shapeId);return n?{...e,shapeId:n}:null}function gl(e,t){let n=new Map,r=new Map,i=new Map,a=new Map;for(let t of e)n.set(t.id,pl()),t.groupId&&i.set(t.groupId,(i.get(t.groupId)??0)+1),t.groupId&&!r.has(t.groupId)&&r.set(t.groupId,pl()),t.lockId&&!a.has(t.lockId)&&a.set(t.lockId,pl());return e.map(e=>{let o={...nl(e,t),id:n.get(e.id)};if(o.groupId&&=(i.get(o.groupId)??0)>1?r.get(o.groupId):void 0,o.lockId&&=a.get(o.lockId),o.type===`arrow`&&(o.startBinding=hl(o.startBinding,n),o.endBinding=hl(o.endBinding,n)),Rt(o)&&o.flows&&(o.flows=ol(o.flows,e=>n.get(e))),o.type===`polygon`&&o.band){let e=n.get(o.band.from),t=n.get(o.band.to);o.band=e&&t?{...o.band,from:e,to:t}:void 0}return o})}function _l(e,t){let n=e.width/(t.width||1),r=e.height/(t.height||1);return{x:e.x-t.x*n,y:e.y-t.y*r,width:n,height:r}}var vl=2;function yl(e,t){return e===`rounded`?Math.min(12,Math.abs(t.width)/2,Math.abs(t.height)/2):vl}export{is as $,Oi as $t,Nc as A,Bt as An,Bo as At,Ns as B,S as Bn,Ja as Bt,Yc as C,B as Cn,Zo as Ct,qc as D,Vt as Dn,es as Dt,Lc as E,Qt as En,Yo as Et,Tc as F,Je as Fn,ro as Ft,cc as G,b as Gn,Wa as Gt,Ms as H,C as Hn,yo as Ht,ac as I,be as In,no as It,Qs as J,Pi as Jt,ec as K,x as Kn,go as Kt,Fs as L,ye as Ln,$a as Lt,Bc as M,R as Mn,$o as Mt,Jc as N,Lt as Nn,vo as Nt,Fc as O,Ht as On,Wo as Ot,Ac as P,Rt as Pn,mo as Pt,nc as Q,ja as Qt,Ys as R,xe as Rn,Co as Rt,Hc as S,Jn as Sn,Xo as St,zc as T,Qn as Tn,Jo as Tt,rc as U,D as Un,fo as Ut,Ws as V,w as Vn,xo as Vt,Gs as W,ne as Wn,ho as Wt,qs as X,La as Xt,Zs as Y,Ia as Yt,tc as Z,Fa as Zt,$c as _,Hr as _n,cs as _t,fl as a,ti as an,ps as at,tl as b,Zt as bn,ts as bt,yl as c,si as cn,vs as ct,ol as d,Jr as dn,_s as dt,Mi as en,os as et,Zc as f,ii as fn,bs as ft,Qc as g,Gr as gn,ss as gt,nl as h,Kr as hn,ls as ht,cl as i,oi as in,gs as it,Pc as j,It as jn,Ko as jt,Mc as k,zt as kn,Uo as kt,_l as l,Qr as ln,ms as lt,Xc as m,Vr as mn,As as mt,pl as n,Yr as nn,ks as nt,ll as o,$r as on,Ds as ot,al as p,ei as pn,us as pt,Js as q,Ga as qt,ml as r,Xr as rn,hs as rt,ul as s,Zr as sn,Cs as st,gl as t,yi as tn,Q as tt,dl as u,ni as un,Es as ut,rl as v,Lr as vn,rs as vt,Gc as w,$n as wn,qo as wt,el as x,qn as xn,Ho as xt,il as y,Yt as yn,ns as yt,Us as z,De as zn,Ya as zt};
@@ -0,0 +1 @@
1
+ import{D as e,j as t}from"./geometry-CVRSymIE.js";function n(e,t=0){return typeof e==`number`&&Number.isFinite(e)?e:t}function r(e,t=``){return typeof e==`string`?e:t}function i(e){return n(e)*180/Math.PI}var a=t.find(e=>e.label===`Normal`)?.value??t[0].value,o=t.find(e=>e.label===`Code`)?.value??t[0].value,s=t[0].value;function c(t,n,i){return{...t,type:`figure`,x:n.x,y:n.y,width:n.width,height:n.height,rotation:0,label:r(i,`Frame`)||`Frame`,fontSize:16,fontFamily:s,color:e}}function l(e,t){for(let n of e)n.type===`arrow`&&(n.startBinding&&!t.has(n.startBinding.shapeId)&&(n.startBinding=null),n.endBinding&&!t.has(n.endBinding.shapeId)&&(n.endBinding=null))}export{l as a,r as c,i,s as n,c as o,a as r,n as s,o as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r,s as i}from"./editor-BeufBV54.js";import{A as a,f as o,i as s}from"./slides-D686obFO.js";import{t as c}from"./IconX-KrRqxr2j.js";import{i as l,n as u,r as d,t as f}from"./DialogRoot-DUeVfNhS.js";import{n as p,t as m}from"./DialogTitle-D5au2NAn.js";var h=e(t(),1),g=n();function _(){let e=i(),t=r(e=>e.notesEditorId),n=r(e=>e.shapes),[_,v]=(0,h.useState)(``),y=s(n),b=y.findIndex(e=>e.id===t),x=b>=0?y[b]:null;(0,h.useEffect)(()=>{if(!t)return;let n=a(e.getState().shapes,t);v(n?.type===`figure`?n.notes??``:``)},[t,e]);function S(){let t=e.getState(),n=t.shapes.find(e=>e.id===t.notesEditorId),r=_.trim(),i=r.length>0?r:void 0;n?.type===`figure`&&n.notes!==i&&t.updateShape(n.id,{notes:i}),t.setNotesEditorId(null)}return(0,g.jsx)(f,{open:x!==null,onOpenChange:e=>{e||S()},children:(0,g.jsxs)(u,{children:[(0,g.jsx)(l,{className:`fixed inset-0 bg-gray-900/15`}),(0,g.jsxs)(d,{"data-overlay":!0,"data-testid":`slide-notes-dialog`,className:`fixed left-1/2 top-1/2 w-[min(480px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-[var(--chrome-popup)] p-4 shadow-[0_24px_70px_rgba(0,0,0,0.22)] outline-none ring-1 ring-[var(--chrome-ring)]`,children:[(0,g.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,g.jsxs)(m,{className:`text-[14px] text-[var(--chrome-fg-900)]`,children:[`Speaker notes — `,x?o(x,b):``]}),(0,g.jsx)(p,{"aria-label":`Close`,className:`-mr-1 flex h-7 w-7 items-center justify-center rounded-full text-[var(--chrome-fg-400)] outline-none transition-colors hover:bg-[var(--chrome-divider)] hover:text-[var(--chrome-fg-600)]`,children:(0,g.jsx)(c,{size:16,stroke:1.75})})]}),(0,g.jsx)(`textarea`,{autoFocus:!0,value:_,placeholder:`What you'll say on this slide: context, the story, the segue…`,"data-testid":`slide-notes-input`,onChange:e=>v(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&S()},className:`h-36 w-full resize-none rounded-lg bg-[var(--chrome-rest)] p-3 text-[13px] leading-relaxed text-[var(--chrome-fg-800)] outline-none ring-1 ring-[var(--chrome-ring)] placeholder:text-[var(--chrome-fg-400)]`}),(0,g.jsxs)(`div`,{className:`mt-3 flex justify-between`,children:[(0,g.jsx)(`span`,{className:`self-center text-[11px] text-[var(--chrome-fg-400)]`,children:`Shown to you while presenting (press N)`}),(0,g.jsx)(`button`,{type:`button`,"data-testid":`slide-notes-done`,onClick:S,className:`rounded-lg bg-[var(--chrome-accent)] px-3.5 py-1.5 text-[13px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)]`,children:`Done`})]})]})]})})}export{_ as SlideNotesDialog};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r,s as i}from"./editor-CpiNbiMQ.js";import{K as a,O as o,b as s}from"./frames-C-jROub3.js";import{t as c}from"./IconX-KrRqxr2j.js";import{i as l,n as u,r as d,t as f}from"./DialogRoot-DUeVfNhS.js";import{n as p,t as m}from"./DialogTitle-D5au2NAn.js";var h=e(t(),1),g=n();function _(){let e=i(),t=r(e=>e.notesEditorId),n=r(e=>e.shapes),[_,v]=(0,h.useState)(``),y=s(n),b=y.findIndex(e=>e.id===t),x=b>=0?y[b]:null;(0,h.useEffect)(()=>{if(!t)return;let n=a(e.getState().shapes,t);v(n?.type===`figure`?n.notes??``:``)},[t,e]);function S(){let t=e.getState(),n=t.shapes.find(e=>e.id===t.notesEditorId),r=_.trim(),i=r.length>0?r:void 0;n?.type===`figure`&&n.notes!==i&&t.updateShape(n.id,{notes:i}),t.setNotesEditorId(null)}return(0,g.jsx)(f,{open:x!==null,onOpenChange:e=>{e||S()},children:(0,g.jsxs)(u,{children:[(0,g.jsx)(l,{className:`fixed inset-0 bg-gray-900/15`}),(0,g.jsxs)(d,{"data-overlay":!0,"data-testid":`slide-notes-dialog`,className:`fixed left-1/2 top-1/2 w-[min(480px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-2xl bg-[var(--chrome-popup)] p-4 shadow-[0_24px_70px_rgba(0,0,0,0.22)] outline-none ring-1 ring-[var(--chrome-ring)]`,children:[(0,g.jsxs)(`div`,{className:`mb-2.5 flex items-center justify-between`,children:[(0,g.jsxs)(m,{className:`text-[14px] text-[var(--chrome-fg-900)]`,children:[`Speaker notes — `,x?o(x,b):``]}),(0,g.jsx)(p,{"aria-label":`Close`,className:`-mr-1 flex h-7 w-7 items-center justify-center rounded-full text-[var(--chrome-fg-400)] outline-none transition-colors hover:bg-[var(--chrome-divider)] hover:text-[var(--chrome-fg-600)]`,children:(0,g.jsx)(c,{size:16,stroke:1.75})})]}),(0,g.jsx)(`textarea`,{autoFocus:!0,value:_,placeholder:`What you'll say on this slide: context, the story, the segue…`,"data-testid":`slide-notes-input`,onChange:e=>v(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&S()},className:`h-36 w-full resize-none rounded-lg bg-[var(--chrome-rest)] p-3 text-[13px] leading-relaxed text-[var(--chrome-fg-800)] outline-none ring-1 ring-[var(--chrome-ring)] placeholder:text-[var(--chrome-fg-400)]`}),(0,g.jsxs)(`div`,{className:`mt-3 flex justify-between`,children:[(0,g.jsx)(`span`,{className:`self-center text-[11px] text-[var(--chrome-fg-400)]`,children:`Shown to you while presenting (press N)`}),(0,g.jsx)(`button`,{type:`button`,"data-testid":`slide-notes-done`,onClick:S,className:`rounded-lg bg-[var(--chrome-accent)] px-3.5 py-1.5 text-[13px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)]`,children:`Done`})]})]})]})})}export{_ as SlideNotesDialog};
@@ -0,0 +1,26 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{t as r}from"./tooltip-ClTJbfBH.js";import{i}from"./useTriggerFocusGuards-Mibi8yYw.js";import{C as a,a as o,c as s,d as c,f as l,m as u,n as d,o as f,p,r as m,w as h}from"./menu-rOnlAYaK.js";import{In as g,L as _,Ln as v,fn as ee,in as y,k as b,st as x}from"./shapes-CHDGoELO.js";import{i as S}from"./geometry-CVRSymIE.js";import{a as te,o as C}from"./editor-CpiNbiMQ.js";import{i as ne}from"./config-D8b1QyEk.js";import{C as re,D as ie,E as w,K as ae,L as T,O as E,S as D,T as O,_ as oe,b as se,k as ce,v as le,w as ue,y as k,z as de}from"./frames-C-jROub3.js";import{a as fe}from"./icons-K7FjuB-c.js";import{n as pe}from"./renderer-environment-D3n3hbug.js";import{_ as me,m as he}from"./panel-controls-BT48HF6c.js";import{t as A}from"./createReactComponent-C51FAx3B.js";import{n as ge,r as _e,t as ve}from"./IconTrash-C8w6ThWx.js";import{t as ye}from"./IconArrowLeft-B4Zcy-Fc.js";import{n as j,t as be}from"./IconPlayerStopFilled-D4qdct2R.js";import{t as xe}from"./IconChevronLeft-D7e7QC0h.js";import{t as M}from"./IconChevronRight-csfMBSUs.js";import{t as N}from"./IconCode-CHIz1nCU.js";import{a as Se,c as Ce,d as we,f as Te,i as Ee,l as P,n as De,o as Oe,r as ke,s as Ae,t as je,u as Me}from"./ContextMenuTrigger-C6XZ9rqq.js";import{a as Ne,c as Pe,i as F,n as Fe,o as Ie,r as Le,s as Re,t as ze}from"./build-visibility-0Y4EP2Ka.js";import{t as Be}from"./IconPencil-D_pQsAyv.js";import{t as Ve}from"./IconPlus-D4tAoi-A.js";import{n as He,r as Ue,t as We}from"./use-drag-reorder-ye8-kpyR.js";import{t as Ge}from"./IconSparkles-CnCp3BCQ.js";import{t as Ke}from"./IconX-KrRqxr2j.js";import{t as qe}from"./IconPlayerPlayFilled-DVAWmYt7.js";import{a as Je,i as Ye,l as Xe,r as Ze,t as Qe}from"./PopoverPopup-CvnB7nJs.js";import{t as $e}from"./use-export-command-CZva79qg.js";import{n as et}from"./surface-Dke4SWpE.js";import{_ as tt,a as nt,c as rt,d as it,f as at,h as ot,i as st,l as ct,m as lt,n as ut,o as dt,p as ft,r as pt,t as mt,u as ht,v as gt,y as _t}from"./plan-BS_pzMjA.js";import{a as vt,c as yt,d as bt,f as xt,i as St,l as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot,u as kt}from"./edit-NIyQT3d_.js";import{a as At,c as jt}from"./chrome-C2RCq3SI.js";import{i as Mt,n as Nt,r as Pt,t as Ft}from"./DialogRoot-DUeVfNhS.js";import{n as It,t as Lt}from"./DialogTitle-D5au2NAn.js";import{n as Rt,t as zt}from"./shape-meta-CZ0aZy7a.js";import{r as Bt}from"./chrome-layout-500Q9pcx.js";import{t as Vt}from"./panel-shell-CSvihB5L.js";import{A as I,C as L,D as R,E as z,O as B,S as V,T as Ht,_ as Ut,a as H,b as Wt,c as Gt,d as Kt,f as U,g as qt,h as Jt,i as Yt,k as W,l as G,m as K,n as Xt,o as q,p as Zt,r as J,s as Y,t as Qt,u as $t,v as en,w as X,x as tn,y as nn}from"./builders-hABCgtrj.js";import{n as rn,t as an}from"./export-DUFOrZJ-.js";var on=A(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),sn=A(`outline`,`player-skip-back`,`PlayerSkipBack`,[[`path`,{d:`M20 5v14l-12 -7l12 -7`,key:`svg-0`}],[`path`,{d:`M4 5l0 14`,key:`svg-1`}]]),cn=A(`filled`,`pointer-filled`,`PointerFilled`,[[`path`,{d:`M3.039 4.277l3.904 13.563c.185 .837 .92 1.516 1.831 1.642l.17 .016a2.2 2.2 0 0 0 1.982 -1.006l.045 -.078l1.4 -2.072l4.05 4.05a2.067 2.067 0 0 0 2.924 0l1.047 -1.047c.388 -.388 .606 -.913 .606 -1.461l-.008 -.182a2.067 2.067 0 0 0 -.598 -1.28l-4.047 -4.048l2.103 -1.412c.726 -.385 1.18 -1.278 1.053 -2.189a2.2 2.2 0 0 0 -1.701 -1.845l-13.524 -3.89a1 1 0 0 0 -1.236 1.24z`,key:`svg-0`}]]),Z=e(t(),1);function ln(e,t){if(!t)return zt(e[0]);let n=e.find(e=>Rt(e).trim().length>0);return n?zt(n):`Group of ${e.length}`}var Q={enter:`Entry`,emphasis:`Emphasis`,exit:`Exit`},$=n();function un(e){let{units:t,idleCount:n,variant:r=`filled`,hasBuild:i,onHover:a,onAdd:o,onSweep:s}=e,c=r===`primary`,l=()=>{c&&(d(!1),a(null))},[u,d]=(0,Z.useState)(!1);return(0,$.jsxs)(Je,{open:u,onOpenChange:e=>{d(e),e||a(null)},children:[(0,$.jsx)(me,{"data-testid":`animate-add-open`,className:c?`mt-1 flex h-8 w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-[var(--chrome-accent)] text-[12px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)]`:`flex h-8 w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-[var(--chrome-rest)] text-[12px] text-[var(--chrome-fg-900)] transition-colors hover:bg-[var(--chrome-hover)]`,children:c?`Choose what animates`:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ve,{size:13,stroke:1.75}),`Add animation`,n>0&&(0,$.jsxs)(`span`,{"data-testid":`animate-add-count`,className:`text-[var(--chrome-fg-400)]`,children:[`· `,n,` not animated`]})]})}),(0,$.jsx)(Ye,{children:(0,$.jsx)(Ze,{side:`left`,align:`end`,sideOffset:8,collisionPadding:8,children:(0,$.jsxs)(Qe,{"data-overlay":!0,"data-testid":`animate-add-list`,onPointerDown:e=>e.stopPropagation(),className:`flex max-h-[60vh] w-72 flex-col overflow-y-auto p-1.5 ${et.popup}`,children:[n>0&&(0,$.jsxs)(`button`,{type:`button`,"data-testid":`animate-one-by-one`,onClick:()=>{s(),d(!1),a(null)},className:`mb-1 flex h-7 shrink-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 text-[11px] font-medium text-[var(--chrome-fg-900)] transition-colors hover:bg-[var(--chrome-hover)]`,children:[(0,$.jsx)(`span`,{children:i?`Add the remaining ${n}`:`Animate all ${n}, one by one`}),(0,$.jsx)(Ae,{size:12,stroke:2})]}),t.map(e=>{let t=e.shapes[0],n=new Set(mt(t).map(e=>e.kind));return(0,$.jsxs)(`div`,{"data-testid":`animate-add-row`,onPointerEnter:()=>a(t.id),onPointerLeave:()=>a(null),className:`flex h-8 shrink-0 items-center gap-2 rounded-lg px-2 text-[12px] text-[var(--chrome-fg-700)] hover:bg-[var(--chrome-hover)]`,children:[e.groupId&&(0,$.jsx)(Se,{size:12,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,$.jsx)(`span`,{className:`flex-1 truncate`,children:ln(e.shapes,e.groupId)}),ht(t).map(t=>{let r=t!==`emphasis`&&n.has(t);return(0,$.jsx)(`button`,{type:`button`,"data-testid":`animate-add-${t}`,disabled:r,title:r?`Already has ${Q[t].toLowerCase()}`:`Add ${Q[t].toLowerCase()}`,onClick:()=>{o(e,t),l()},className:`h-5 shrink-0 cursor-pointer rounded px-1.5 text-[10px] font-medium transition-colors ${r?`cursor-default bg-[var(--chrome-active)] text-[var(--chrome-fg-400)]`:`text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`}`,children:Q[t]},t)})]},gt(e))})]})})})]})}var dn={click:``,with:`Plays with the step above`,after:`Plays on its own, as soon as the step above finishes`};function fn(e){let{unit:t,click:n,playing:r,start:a,canJoin:o,pointed:s,unseen:c,selected:l,viewMode:u,handlers:d,onSplit:f,onMerge:p,onSetEffect:m,onSetDelay:h,onSetDirection:g,onSetKind:_,onSetStart:v,onPreviewEffect:ee,onRemove:y}=e,b=t.items[0],x=b.shape,S=b.animation,te=mt(x).filter((e,t)=>t!==b.index).map(e=>e.kind),C=f??p;return(0,$.jsxs)(`div`,{className:`group flex h-8 touch-none items-center gap-1.5 rounded-lg pl-1 pr-1 text-[12px] transition-colors ${r?`bg-[var(--chrome-accent)] text-white`:l?`bg-[var(--chrome-active)]`:s?`bg-[var(--chrome-hover)]`:`hover:bg-[var(--chrome-hover)]`}`,...d,children:[(0,$.jsx)(on,{size:13,stroke:1.75,className:`shrink-0 cursor-grab text-[var(--chrome-fg-300)]`}),(0,$.jsx)(`span`,{className:`flex w-4 shrink-0 items-center justify-center text-[11px] tabular-nums ${r?`text-white/70`:`text-[var(--chrome-fg-500)]`}`,title:a===`click`?void 0:dn[a],children:a===`click`?n:``}),C&&!u?(0,$.jsx)(`button`,{type:`button`,"data-testid":f?`animate-group-split`:`animate-group-merge`,title:f?`Animate this group's shapes one by one`:`Play these back as one group`,onPointerDown:e=>e.stopPropagation(),onClick:C,className:`flex h-5 w-4 shrink-0 cursor-pointer items-center justify-center rounded ${r?`text-white/70`:`text-[var(--chrome-fg-400)]`} hover:text-[var(--chrome-fg-900)]`,children:f?(0,$.jsx)(M,{size:12,stroke:2}):(0,$.jsx)(i,{size:12,stroke:2})}):C&&(0,$.jsx)(`span`,{className:`w-4 shrink-0`}),(0,$.jsx)(`span`,{className:`flex-1 truncate ${r?``:`text-[var(--chrome-fg-900)]`}`,children:ln(t.items.map(e=>e.shape),t.groupId)}),c&&(0,$.jsx)(`span`,{"data-testid":`animate-row-unseen`,title:`This plays while the shape is off screen, so it will not be seen`,className:`shrink-0 ${r?`text-white/70`:`text-[var(--chrome-fg-400)]`}`,children:(0,$.jsx)(we,{size:12,stroke:1.75})}),S.kind!==`enter`&&(0,$.jsx)(`span`,{"data-testid":`animate-kind-${S.kind}`,className:`shrink-0 rounded px-1 text-[10px] uppercase tracking-wide ring-1 ${r?`text-white/70 ring-white/30`:`text-[var(--chrome-fg-500)] ring-[var(--chrome-ring)]`}`,children:S.kind}),(0,$.jsx)(pn,{shape:x,kind:S.kind,kindsTaken:te,effect:S.effect,duration:S.duration,delay:S.delay,direction:S.direction,start:a,canJoin:o,disabled:u,onSetEffect:m,onSetDelay:h,onSetDirection:g,onSetKind:_,onSetStart:v,onPreviewEffect:ee}),!u&&(0,$.jsx)(`button`,{"data-testid":`animate-remove`,title:`Remove from the build`,onPointerDown:e=>e.stopPropagation(),className:`flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-[var(--chrome-fg-400)] opacity-0 hover:bg-[var(--chrome-hover)] group-hover:opacity-100`,onClick:y,children:(0,$.jsx)(Ke,{size:12,stroke:2})})]})}function pn(e){let{shape:t,kind:n,kindsTaken:r,effect:i,duration:a,delay:o,direction:s,start:c,canJoin:l,disabled:u,onSetEffect:d,onSetDelay:f,onSetDirection:p,onSetKind:m,onSetStart:h,onPreviewEffect:_}=e,[b,x]=(0,Z.useState)(!1),S=v.filter(e=>ee(t,e)&&y(e,n)),te=ht(t),C=Ne(i);return(0,$.jsxs)(Je,{open:b,onOpenChange:x,children:[(0,$.jsxs)(me,{"data-testid":`animate-effect-chip`,disabled:u,onPointerDown:e=>e.stopPropagation(),className:`flex h-6 shrink-0 cursor-pointer items-center gap-0.5 rounded-md bg-[var(--chrome-rest)] pl-1.5 pr-1 text-[11px] text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] transition-colors hover:bg-[var(--chrome-hover)] data-[popup-open]:bg-[var(--chrome-active)] disabled:cursor-default`,children:[C.label,(0,$.jsx)(Xe,{})]}),(0,$.jsx)(Ye,{children:(0,$.jsx)(Ze,{side:`left`,align:`center`,sideOffset:8,collisionPadding:8,children:(0,$.jsxs)(Qe,{"data-overlay":!0,onPointerDown:e=>e.stopPropagation(),className:`w-64 p-2.5 ${et.popup}`,children:[te.length>1&&(0,$.jsx)(`div`,{className:`mb-2 flex items-center gap-1 border-b border-[var(--chrome-ring)] pb-2`,children:te.map(e=>{let t=e!==n&&e!==`emphasis`&&r.includes(e);return(0,$.jsx)(`button`,{type:`button`,"data-testid":`animate-kind-set-${e}`,"aria-pressed":e===n,disabled:t,title:t?`This shape already has an ${Q[e]} row`:void 0,onClick:()=>m(e),className:`flex h-7 flex-1 cursor-pointer items-center justify-center rounded-lg text-[11px] font-medium transition-colors disabled:cursor-default disabled:opacity-40 ${jt(e===n)}`,children:Q[e]},e)})}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Effect`}),(0,$.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:S.map(e=>(0,$.jsxs)(`div`,{className:`flex h-7 items-center gap-1 rounded-lg pr-0.5 text-[11px] transition-colors ${jt(e===i)}`,children:[(0,$.jsxs)(`button`,{type:`button`,"data-testid":`animate-effect-${e}`,"aria-pressed":e===i,onClick:()=>d(e,a),className:`flex h-full flex-1 cursor-pointer items-center justify-between gap-1 rounded-l-lg pl-2 font-medium`,children:[Le[e].label,(0,$.jsxs)(`span`,{className:`text-[10px] tabular-nums text-[var(--chrome-fg-400)]`,children:[Math.round(F(e,e===i?a:void 0,t)),`ms`]})]}),(0,$.jsx)(`button`,{type:`button`,"data-testid":`animate-effect-play-${e}`,"aria-label":`Preview ${Le[e].label} on the slide`,title:`Play this on the shape`,onClick:()=>_(e,e===i?a:void 0),className:`flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-[var(--chrome-fg-500)] transition-colors hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`,children:(0,$.jsx)(qe,{size:10})})]},e))})]}),Re(C)&&(0,$.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,$.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Direction`}),(0,$.jsx)(`div`,{className:`flex items-center gap-1`,children:g.map(e=>{let t=(s??C.defaultDirection)===e;return(0,$.jsx)(`button`,{type:`button`,"data-testid":`animate-direction-${e}`,"aria-pressed":t,"aria-label":hn[e],title:hn[e],onClick:()=>p(e),className:`flex h-7 flex-1 cursor-pointer items-center justify-center rounded-lg text-[11px] font-medium transition-colors ${jt(t)}`,children:(0,$.jsx)(gn,{direction:e})},e)})})]}),(0,$.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,$.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Start`}),(0,$.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:_n.map(e=>(0,$.jsx)(`button`,{type:`button`,"data-testid":`animate-start-${e.mode}`,"aria-pressed":c===e.mode,disabled:e.mode===`with`&&!l,onClick:()=>h(e.mode),className:`flex h-7 items-center rounded-lg px-2 text-[11px] font-medium transition-colors disabled:cursor-default disabled:opacity-40 ${jt(c===e.mode)}`,children:e.label},e.mode))})]}),(0,$.jsxs)(`div`,{className:`mt-1 flex gap-2 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,$.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Duration`}),(0,$.jsx)(he,{label:`duration in milliseconds`,testId:`animate-duration`,value:Math.round(F(i,a,t)),min:80,max:4e3,step:40,fullWidth:!0,onChange:e=>d(i,e)})]}),c!==`click`&&(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,$.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Delay`}),(0,$.jsx)(he,{label:`delay in milliseconds`,testId:`animate-delay`,value:Math.round(Math.max(0,o??0)),min:0,max:1e4,step:100,fullWidth:!0,onChange:f})]})]})]})})})]})}var mn={up:ge,down:_e,left:ye,right:j},hn={up:`Upward`,down:`Downward`,left:`Leftward`,right:`Rightward`};function gn(e){let{direction:t}=e,n=mn[t];return(0,$.jsx)(n,{size:13,stroke:2})}var _n=[{mode:`click`,label:`On click`},{mode:`with`,label:`With previous`},{mode:`after`,label:`After previous`}],vn=`flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-[var(--chrome-fg-600)] transition-colors hover:bg-[var(--chrome-hover)] disabled:cursor-default disabled:text-[var(--chrome-fg-300)] disabled:hover:bg-transparent`,yn=4,bn=380,xn=200;function Sn(e){let{figure:t,index:n,total:r,onBack:i,onGoToSlide:a,onFocusSlide:o,viewMode:s}=e,{store:c,history:l}=te(),u=C(e=>e.shapes),d=C(e=>e.selectedIds),f=C(e=>e.hoveredId),p=Fe(),m=(0,Z.useMemo)(()=>at(u,t),[u,t]),h=(0,Z.useMemo)(()=>tt(u,t),[u,t]),g=(0,Z.useMemo)(()=>ut(m,h),[m,h]),_=(0,Z.useMemo)(()=>lt(u,t,h),[u,t,h]),v=(0,Z.useMemo)(()=>st(u,t,h),[u,t,h]),ee=(0,Z.useMemo)(()=>_t(m),[m]),y=(0,Z.useMemo)(()=>v.filter(e=>e.shapes.some(e=>d.has(e.id))),[v,d]),x=(0,Z.useMemo)(()=>{let e=new Map;g.forEach((t,n)=>{let r=t.groupId?void 0:t.items[0].shape.groupId;r&&!e.has(r)&&e.set(r,n)});let t=new Map;for(let[n,r]of e)g.filter(e=>e.items[0].shape.groupId===n).length>1&&t.set(r,n);return t},[g]),S=(0,Z.useMemo)(()=>{let e=0;return g.map((t,n)=>(n>0&&!t.withPrevious&&(e+=1),e))},[g]),ne=(0,Z.useMemo)(()=>pt(m),[m]);function re(e,t){w(wt(m,[e],t===`enter`?ot(e.shapes[0]):void 0,t))}function ie(){w(k?wt(m,_):Ot(u,t))}function w(e){e.length!==0&&(l.beginTransaction(),c.getState().replaceMany(e),l.endTransaction())}(0,Z.useEffect)(()=>{o(t)},[t.id]);let[T,E]=(0,Z.useState)(null);(0,Z.useLayoutEffect)(()=>{if(T===null||T<0)return;let e=m[T];e&&p.play(e,b(t))},[T,m,t,p]),(0,Z.useEffect)(()=>{if(T===null)return;let e=T>=0?m[T]:null,t=m[T+1]?.afterPrevious?0:bn,n=(e?Ie(e):0)+t,r=setTimeout(()=>{E(e=>e===null||e+1>=m.length?null:e+1)},n);return()=>clearTimeout(r)},[T,m]);let[D,O]=(0,Z.useState)(null);function oe(e,t,n){E(null),p.cancel(),O({items:e.map(e=>({shape:e.shape,index:e.index,start:0,row:e.row,animation:{...e.animation,step:0,effect:nt(e.shape,t,e.animation.kind),duration:n,delay:void 0}})),armed:e[0]?.animation.kind===`exit`})}(0,Z.useEffect)(()=>{if(!D||D.armed)return;let e=setTimeout(()=>O(e=>e&&!e.armed?{...e,armed:!0}:e),xn);return()=>clearTimeout(e)},[D]),(0,Z.useLayoutEffect)(()=>{if(!D?.armed)return;let e=D.items.some(e=>e.animation.kind===`exit`);p.play({index:0,items:D.items,afterPrevious:!1},b(t)).then(()=>{e&&window.setTimeout(()=>p.cancel(),xn)})},[D,t,p]),(0,Z.useEffect)(()=>{E(null),O(null)},[m]);function se(){if(O(null),T!==null){p.cancel(),E(null);return}m.length!==0&&(o(t),p.cancel(),E(-1))}let ce=(0,Z.useMemo)(()=>{let e=new Set;if(!f)return e;e.add(f);let t=ae(u,f);return t?.groupId&&h.has(t.groupId)&&e.add(t.groupId),e},[f,u,h]);function le(e){return{onPointerEnter:()=>c.getState().setHoveredId(e),onPointerLeave:()=>c.getState().setHoveredId(null)}}(0,Z.useEffect)(()=>()=>c.getState().setHoveredId(null),[c]);let ue=We({count:g.length,gap:yn,disabled:s,onReorder:(e,t)=>w(Tt(g,e,t)),onPress:e=>{let t=g[e];t&&c.getState().setSelectedIds(new Set(t.items.map(e=>e.shape.id)))}}),k=g.length>0;return(0,$.jsxs)($.Fragment,{children:[T!==null&&(0,$.jsx)(ze,{pending:rt(m,T)}),D&&!D.armed&&(0,$.jsx)(ze,{pending:new Set(D.items.map(e=>e.shape.id))}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5 bg-[var(--chrome-rest)] px-3 pb-3 pt-2.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Ae,{size:15,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-500)]`}),(0,$.jsx)(`span`,{className:`flex-1 truncate text-[13px] font-medium text-[var(--chrome-fg-900)]`,children:`Animate`}),(0,$.jsx)(`button`,{type:`button`,"data-testid":`animate-done`,title:`Back to the deck (Esc)`,onClick:i,className:`flex h-7 shrink-0 cursor-pointer items-center rounded-lg bg-[var(--chrome-accent)] px-3 text-[12px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)]`,children:`Done`})]}),(0,$.jsxs)(`div`,{className:`flex h-7 items-center justify-between rounded-lg bg-[var(--chrome-popup)] px-0.5 ring-1 ring-[var(--chrome-ring)]`,children:[(0,$.jsx)(`button`,{className:vn,"data-testid":`animate-prev-slide`,"aria-label":`Previous slide`,disabled:n===0,onClick:()=>a(n-1),children:(0,$.jsx)(xe,{size:14,stroke:1.75})}),(0,$.jsxs)(`span`,{className:`truncate text-[12px] tabular-nums text-[var(--chrome-fg-700)]`,children:[`Slide `,n+1,` of `,r]}),(0,$.jsx)(`button`,{className:vn,"data-testid":`animate-next-slide`,"aria-label":`Next slide`,disabled:n>=r-1,onClick:()=>a(n+1),children:(0,$.jsx)(M,{size:14,stroke:1.75})})]})]}),!s&&y.length>0&&(0,$.jsxs)(`div`,{"data-testid":`animate-selection`,className:`mx-3 mb-2 flex h-8 shrink-0 items-center gap-2 rounded-[10px] bg-[var(--chrome-rest)] px-2.5`,children:[(0,$.jsx)(cn,{size:12,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,$.jsx)(`span`,{className:`flex-1 truncate text-[11.5px] text-[var(--chrome-fg-900)]`,children:y.length===1?ln(y[0].shapes,y[0].groupId):`${y.length} shapes`}),wn(y).map(e=>(0,$.jsx)(`button`,{type:`button`,"data-testid":`animate-selection-${e}`,title:`Add ${Q[e].toLowerCase()}`,onClick:()=>{for(let t of y)re(t,e)},className:`h-5 shrink-0 cursor-pointer rounded px-1.5 text-[10px] font-medium text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] transition-colors hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`,children:Q[e]},e))]}),(0,$.jsxs)(`div`,{ref:ue.listRef,"data-testid":`animate-list`,className:`flex flex-1 flex-col overflow-y-auto px-3 pb-3 pt-2`,children:[!k&&(0,$.jsx)(`div`,{className:`px-1 pt-4`,children:v.length===0?(0,$.jsx)(`div`,{className:`text-balance px-1 py-6 text-center text-[11px] leading-relaxed text-[var(--chrome-fg-400)]`,children:`Nothing on this slide to animate yet.`}):(0,$.jsxs)(`div`,{"data-testid":`animate-empty`,"data-count":v.length,className:`flex flex-col items-center gap-2.5 rounded-xl p-4 text-center`,children:[(0,$.jsx)(`span`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-[var(--chrome-hover)] text-[var(--chrome-fg-600)]`,children:(0,$.jsx)(Ae,{size:17,stroke:1.75})}),(0,$.jsx)(`span`,{className:`text-[12.5px] font-medium text-[var(--chrome-fg-900)]`,children:`Reveal this slide in steps`}),(0,$.jsx)(`span`,{className:`text-balance text-[11px] leading-relaxed text-[var(--chrome-fg-500)]`,children:Cn(v.length)}),!s&&(0,$.jsx)(un,{variant:`primary`,units:v,idleCount:_.length,hasBuild:k,onHover:e=>c.getState().setHoveredId(e),onAdd:re,onSweep:ie})]})}),k&&(0,$.jsx)(`div`,{className:`flex flex-col gap-1`,children:g.map((e,t)=>{let n=ft(e);return(0,$.jsx)(`div`,{ref:ue.setItemRef(t),"data-testid":`animate-row-${t}`,"data-start":n,className:`shrink-0 ${t>0&&n===`click`?`border-t border-[var(--chrome-ring)] pt-1`:t>0&&n===`after`?`border-t border-dashed border-[var(--chrome-ring)] pt-1`:``}`,style:ue.rowStyle(t),children:(0,$.jsx)(fn,{unit:e,click:ne[S[t]],playing:T!==null&&S[t]===T,start:n,canJoin:t>0,pointed:ce.has(dt(e)),unseen:ee.has(ct(e.items[0])),selected:e.items.every(e=>d.has(e.shape.id)),viewMode:s,handlers:{...ue.rowHandlers(t),...le(e.items[0].shape.id)},onSplit:e.groupId?()=>w(xt(g,e.groupId)):null,onMerge:x.has(t)?()=>w(vt(g,x.get(t))):null,onSetEffect:(t,n)=>w(Ct(e.items,t,n)),onSetDelay:t=>w(Dt(e.items,t)),onSetKind:t=>w(kt(e.items,t)),onSetDirection:t=>w(yt(e.items,t)),onPreviewEffect:(t,n)=>oe(e.items,t,n),onSetStart:t=>w(bt(g,dt(e),t)),onRemove:()=>w(Et(g,dt(e)))})},dt(e))})}),!s&&k&&(0,$.jsx)(`div`,{className:`pt-3`,children:(0,$.jsx)(un,{units:v,idleCount:_.length,hasBuild:k,onHover:e=>c.getState().setHoveredId(e),onSweep:ie,onAdd:re})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-[var(--chrome-ring)] p-3`,children:[(0,$.jsx)(`button`,{"data-testid":`animate-play`,disabled:!k,className:`flex h-9 w-full items-center justify-center gap-2 rounded-lg bg-[var(--chrome-accent)] text-[13px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)] disabled:bg-[var(--chrome-hover)] disabled:text-[var(--chrome-fg-400)]`,onClick:se,children:T===null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(qe,{size:13}),`Play`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(be,{size:13}),`Stop`]})}),!s&&k&&(0,$.jsx)(`button`,{"data-testid":`animate-clear`,className:`mx-auto flex h-6 cursor-pointer items-center rounded px-2 text-[11px] text-[var(--chrome-fg-500)] transition-colors hover:text-[var(--chrome-fg-900)]`,onClick:()=>w(St(m)),children:`Clear animations`})]})]})}function Cn(e){return e===1?`One thing shows with the slide. Give it a click of its own.`:`${e} things show at once right now. Give each one its own click.`}function wn(e){let t=e.flatMap(e=>e.shapes);return ht(t[0]).filter(e=>e===`emphasis`||t.some(t=>!mt(t).some(t=>t.kind===e)))}var Tn=`flex h-9 items-center justify-center bg-[var(--chrome-accent)] text-[13px] text-white transition-colors hover:bg-[var(--chrome-accent-hover)] disabled:bg-[var(--chrome-hover)] disabled:text-[var(--chrome-fg-400)] data-[popup-open]:bg-[var(--chrome-accent-hover)]`;function En(e){let{disabled:t,onPresent:n}=e;return(0,$.jsxs)(`div`,{className:`flex gap-px`,children:[(0,$.jsxs)(`button`,{type:`button`,"data-testid":`slides-present`,disabled:t,onClick:()=>n(`current`),className:`${Tn} flex-1 gap-2 rounded-l-lg`,children:[(0,$.jsx)(qe,{size:14}),`Start presentation`]}),(0,$.jsxs)(s,{children:[(0,$.jsx)(f,{disabled:t,render:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Presentation start options`,"data-testid":`slides-present-options`,className:`${Tn} w-9 rounded-r-lg`,children:(0,$.jsx)(i,{size:14,stroke:2})})}),(0,$.jsx)(l,{children:(0,$.jsx)(c,{side:`top`,align:`end`,sideOffset:6,className:`z-50 outline-none`,children:(0,$.jsxs)(m,{"data-overlay":!0,className:`min-w-[185px] p-1`,children:[(0,$.jsxs)(d,{"data-testid":`slides-present-beginning`,onClick:()=>n(`beginning`),children:[(0,$.jsx)(sn,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-400)]`}),`From beginning`]}),(0,$.jsxs)(d,{"data-testid":`slides-present-current`,onClick:()=>n(`current`),children:[(0,$.jsx)(a,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-400)]`}),`From current slide`]})]})})})]})]})}var Dn=`flex cursor-default select-none items-center gap-2 rounded-lg px-2 py-1.5 text-[13px] text-[var(--chrome-fg-700)] outline-none data-[highlighted]:bg-[var(--chrome-hover)]`,On=`min-w-[185px] p-1 outline-none ${et.popup}`;function kn(e){let{index:t,prefix:n,actions:r,skipped:i,Item:o,Separator:s}=e;function c(e,r,i,a,s=!1){return(0,$.jsxs)(o,{className:s?`${Dn} text-red-600 data-[highlighted]:bg-red-50`:Dn,"data-testid":`${n}-${e}-${t}`,onClick:a,children:[(0,$.jsx)(`span`,{className:s?`text-red-400`:`text-[var(--chrome-fg-400)]`,children:r}),(0,$.jsx)(`span`,{children:i})]})}let l=(0,$.jsx)(s,{className:`mx-1 my-1 h-px bg-[var(--chrome-divider)]`});return(0,$.jsxs)($.Fragment,{children:[c(`present`,(0,$.jsx)(a,{size:15,stroke:1.75}),`Present from here`,r.onPresent),l,r.onExportPng?c(`export-png`,(0,$.jsx)(Oe,{size:15,stroke:1.75}),`Export slide as PNG`,r.onExportPng):null,r.onExportSvg?c(`export-svg`,(0,$.jsx)(P,{size:15,stroke:1.75}),`Export slide as SVG`,r.onExportSvg):null,r.onEmbed?c(`embed`,(0,$.jsx)(N,{size:15,stroke:1.75}),`Embed slide…`,r.onEmbed):null,l,c(`duplicate`,(0,$.jsx)(Te,{size:15,stroke:1.75}),`Duplicate slide`,r.onDuplicate),c(`rename`,(0,$.jsx)(Be,{size:15,stroke:1.75}),`Rename slide`,r.onRename),c(`notes`,(0,$.jsx)(Pe,{size:15,stroke:1.75}),`Speaker notes`,r.onEditNotes),i?c(`skip`,(0,$.jsx)(Me,{size:15,stroke:1.75}),`Unskip slide`,r.onToggleSkip):c(`skip`,(0,$.jsx)(we,{size:15,stroke:1.75}),`Skip slide`,r.onToggleSkip),c(`add-above`,(0,$.jsx)(He,{size:15,stroke:1.75}),`Add slide above`,r.onAddAbove),c(`add-below`,(0,$.jsx)(Ue,{size:15,stroke:1.75}),`Add slide below`,r.onAddBelow),l,c(`delete`,(0,$.jsx)(ve,{size:15,stroke:1.75}),`Remove slide`,r.onDelete,!0)]})}function An(e){let{index:t,actions:n,skipped:r,disabled:i}=e;return i?null:(0,$.jsxs)(s,{children:[(0,$.jsx)(f,{render:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Slide options`,"data-testid":`slide-menu-${t}`,className:`absolute right-1.5 top-1.5 flex h-6 w-6 items-center justify-center rounded-md bg-[var(--chrome-surface)] text-[var(--chrome-fg-600)] opacity-0 ring-1 ring-[var(--chrome-ring)] transition-opacity hover:bg-[var(--chrome-hover)] focus-visible:opacity-100 group-hover:opacity-100 data-[popup-open]:opacity-100`,onPointerDown:e=>e.stopPropagation(),children:(0,$.jsx)(h,{size:13,stroke:1.75})})}),(0,$.jsx)(l,{children:(0,$.jsx)(c,{side:`left`,align:`start`,sideOffset:6,className:`z-50 outline-none`,children:(0,$.jsx)(p,{"data-overlay":!0,className:On,children:(0,$.jsx)(kn,{index:t,prefix:`slide-menu`,actions:n,skipped:r,Item:u,Separator:o})})})})]})}function jn(e){let{index:t,actions:n,skipped:r,children:i,disabled:a}=e,s=C(e=>e.coarsePointer);return a||s?(0,$.jsx)($.Fragment,{children:i}):(0,$.jsxs)(De,{children:[(0,$.jsx)(je,{render:(0,$.jsx)(`div`,{style:{display:`contents`}}),children:i}),(0,$.jsx)(l,{children:(0,$.jsx)(c,{className:`z-50 outline-none`,children:(0,$.jsx)(p,{"data-overlay":!0,"data-testid":`slide-ctx-${t}`,className:On,children:(0,$.jsx)(kn,{index:t,prefix:`slide-ctx`,actions:n,skipped:r,Item:u,Separator:o})})})})]})}function Mn(e){let t=R(e),n=18*t.unit,r=[{x:433,fill:G.red},{x:471,fill:G.yellow},{x:509,fill:G.blue}].map(({x:e,fill:r})=>{let i=t.point(e,158);return z({x:i.x,y:i.y,width:n,height:n},r,{kind:`ellipse`,fillStyle:`bold`})}),i=(e,n,r,i)=>z(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[...r,i(812,100,24,G.yellow),i(128,416,16,G.pink),I(t.rect(120,204,720,90),`Presentation title`,t.font(56)),I(t.rect(180,306,600,40),`A short subtitle that sets the scene`,t.font(24),{color:J}),B([t.point(432,436),t.point(528,436)],{color:U,strokeWidth:4}),I(t.rect(280,452,400,30),`Your name · Occasion · Date`,t.font(16),{color:J})]}function Nn(e){let t=R(e);return[z(t.rect(110,145,230,230),G.yellow,{kind:`ellipse`,label:`01`,fontSize:t.font(80)}),I(t.rect(420,190,460,64),`Section title`,t.font(48),{align:`left`}),B([t.point(422,268),t.point(640,268)],{color:Y,strokeWidth:4}),I(t.rect(420,292,460,36),`A one-line summary of this chapter`,t.font(20),{align:`left`,color:J})]}function Pn(e){let t=R(e);return[I(t.rect(330,148,300,26),`THE BIG IDEA`,t.font(15),{letterSpacing:.3,color:J}),I(t.rect(120,192,720,156),`Say the one thing that matters.`,t.font(64)),B([t.point(390,374),t.point(570,374)],{color:U,strokeWidth:5})]}function Fn(e){let t=R(e),n=(e,n,r,i)=>z(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[Jt(t),n(150,106,26,G.yellow),n(806,92,18,G.blue),n(730,414,20,G.yellow),n(208,408,14,G.pink),B([t.point(434,198),t.point(526,198)],{color:U,strokeWidth:4}),qt(t.rect(120,216,720,90),`A title that glows in the dark`,t.font(52)),qt(t.rect(240,322,480,40),`A quieter cover for serious rooms`,t.font(20),{color:Yt})]}function In(e){let t=R(e);return[z(t.rect(0,0,424,Kt.height),G.gray,{dash:`none`,label:`Drop an image
2
+ or paste a screenshot`,fontSize:t.font(18),labelColor:J}),I(t.rect(486,168,300,26),`A DECK ABOUT`,t.font(14),{align:`left`,letterSpacing:.3,color:J}),I(t.rect(486,202,408,140),`The thing you came to hear`,t.font(44),{align:`left`,valign:`top`,lineHeight:1.25}),B([t.point(488,360),t.point(600,360)],{color:U,strokeWidth:4}),I(t.rect(486,384,408,30),`Your name · Occasion · Date`,t.font(16),{align:`left`,color:J})]}function Ln(e){let t=R(e),n=G.green,r=(e,n)=>z(t.rect(e,26,15,15),n,{kind:`ellipse`,fillStyle:`bold`,dash:`none`});return[Jt(t),r(30,G.red),r(56,G.yellow),r(82,G.green),tn(t.point(80,130),`~/talks $ present --topic`,t.font(20),n,{fontFamily:q}),tn(t.point(80,176),`"Your big idea"`,t.font(50),Gt,{fontFamily:q}),z(t.rect(80,268,20,42),Gt,{dash:`none`}),tn(t.point(80,356),`loading slides… ████████░░ 80%`,t.font(17),n,{fontFamily:q,opacity:.8}),tn(t.point(80,458),`# your name · today`,t.font(15),Gt,{fontFamily:q,opacity:.5})]}function Rn(e){let t=R(e);return[...L(t,`Slide title`),I(t.rect(72,156,816,312),_([`The first key point`,`A second point, with a little more detail to back it up`,`The third point that drives it home`]),t.font(24),{align:`left`,valign:`top`,lineHeight:2,color:H})]}function zn(e){let t=R(e),n=[{fill:G.blue,text:`Where we are today`},{fill:G.green,text:`What we learned`},{fill:G.yellow,text:`The plan from here`},{fill:G.pink,text:`Questions and next steps`}].flatMap(({fill:e,text:n},r)=>{let i=160+r*78;return V([z(t.rect(72,i,48,48),e,{kind:`ellipse`,label:String(r+1),fontSize:t.font(20)}),I(t.rect(140,i,720,48),n,t.font(24),{align:`left`})])});return[...L(t,`Agenda`),...n]}function Bn(e){let t=R(e);return[...L(t,`Slide title`),B([t.point(480,160),t.point(480,468)],{strokeWidth:1.5,dash:`dashed`,opacity:.35}),I(t.rect(72,156,380,40),`First column`,t.font(24),{align:`left`}),B([t.point(74,204),t.point(150,204)],{color:`#1971c2`,strokeWidth:3}),I(t.rect(72,216,380,244),`Use this side for the first idea, option or before-state.`,t.font(20),{align:`left`,valign:`top`,color:H}),I(t.rect(508,156,380,40),`Second column`,t.font(24),{align:`left`}),B([t.point(510,204),t.point(586,204)],{color:`#2f9e44`,strokeWidth:3}),I(t.rect(508,216,380,244),`And this side for the second idea, option or after-state.`,t.font(20),{align:`left`,valign:`top`,color:H})]}function Vn(e){let t=R(e);return[I(t.rect(72,48,816,50),`Which way do we go?`,t.font(36)),...V([z(t.rect(72,132,384,344),G.green,{fillStyle:`outline`}),z(t.rect(404,152,32,32),G.green,{kind:`checkbox`,fillStyle:`bold`}),I(t.rect(96,156,336,40),`Option A`,t.font(28)),I(t.rect(108,212,312,240),_([`Cheaper to build`,`Ships this quarter`,`Less flexible later`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:H})]),...V([z(t.rect(504,132,384,344),G.gray,{fillStyle:`outline`}),I(t.rect(528,156,336,40),`Option B`,t.font(28)),I(t.rect(540,212,312,240),_([`More upfront work`,`Ships next quarter`,`Grows with us`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:H})]),z(t.rect(450,274,60,60),G.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`vs`,fontSize:t.font(22)})]}function Hn(e){let t=R(e);return[...L(t,`Before and after`),...V([z(t.rect(72,140,384,330),G.gray),I(t.rect(96,162,344,36),`Before`,t.font(26),{align:`left`}),I(t.rect(96,214,344,230),`✗ Manual deploys at midnight
3
+ ✗ Surprise regressions
4
+ ✗ Knowledge in one head`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:H})]),...V([z(t.rect(504,140,384,330),G.green),I(t.rect(528,162,344,36),`After`,t.font(26),{align:`left`}),I(t.rect(528,214,344,230),`✓ Ship on every merge
5
+ ✓ Tests catch it first
6
+ ✓ Docs that stay current`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:H})]),Wt(t.point(462,305),t.point(498,305),5)]}function Un(e){let t=R(e),n=[{x:72,fill:G.blue,value:`42%`,caption:`more signups`},{x:360,fill:G.teal,value:`3×`,caption:`faster builds`},{x:648,fill:G.purple,value:`12k`,caption:`happy users`}].flatMap(({x:e,fill:n,value:r,caption:i})=>V([z(t.rect(e,150,240,260),n,{fillStyle:`outline`,label:r,fontSize:t.font(56)}),I(t.rect(e+20,330,200,56),i,t.font(18),{color:J})]));return[...L(t,`The quarter in numbers`),...n]}function Wn(e){let t=R(e),n=[{color:Y,text:`The first thing to remember`},{color:`#1971c2`,text:`The second, said plainly`},{color:`#2f9e44`,text:`The third, end on an action`}].flatMap(({color:e,text:n},r)=>{let i=156+r*104,a=V([tn(t.point(84,i+14),String(r+1),t.font(44),e),I(t.rect(160,i,720,84),n,t.font(26),{align:`left`})]);return r>0&&a.push(B([t.point(84,i-10),t.point(876,i-10)],{strokeWidth:1.5,opacity:.15})),a});return[...L(t,`Three takeaways`),...n]}function Gn(e){let t=R(e);return[...L(t,`Do and don't`),...V([z(t.rect(72,150,400,310),G.green,{fillStyle:`outline`}),z(t.rect(96,170,36,36),G.green,{kind:`checkbox`,fillStyle:`bold`}),I(t.rect(148,170,300,36),`Do`,t.font(28),{align:`left`}),I(t.rect(96,222,352,220),`Keep slides to one idea
7
+ Use big readable text
8
+ Practice out loud`,t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:H})]),...V([z(t.rect(488,150,400,310),G.red,{fillStyle:`outline`}),z(t.rect(512,170,36,36),G.red,{kind:`crossbox`,fillStyle:`bold`}),I(t.rect(564,170,300,36),`Don't`,t.font(28),{align:`left`}),I(t.rect(512,222,352,220),`Cram every detail in
9
+ Read off the slide
10
+ Run past the time box`,t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:H})])]}function Kn(e){let t=R(e),n=[{icon:`zap`,fill:G.yellow,name:`Fast`,desc:`Blank canvas to first stroke in a second`},{icon:`users`,fill:G.blue,name:`Together`,desc:`Share a link, draw with the whole room`},{icon:`share-2`,fill:G.green,name:`Portable`,desc:`PNG, SVG and PDF out of the box`},{icon:`undo-2`,fill:G.pink,name:`Forgiving`,desc:`Undo everything, nothing is precious`}].flatMap(({icon:e,fill:n,name:r,desc:i},a)=>{let o=162+a*78,s=52*t.unit,c=t.point(72,o),l=26*t.unit;return V([z({x:c.x,y:c.y,width:s,height:s},n,{kind:`ellipse`,dash:`none`}),X({x:c.x+(s-l)/2,y:c.y+(s-l)/2},l,e,{color:Xt}),I(t.rect(148,o+2,210,48),r,t.font(22),{align:`left`}),I(t.rect(366,o+2,522,48),i,t.font(17),{align:`left`,color:H})])});return[...L(t,`What you get`),...n]}function qn(e){let t=R(e),n=[{icon:`gauge`,title:`Instant`,body:`Boards open in under a second, however big`},{icon:`users`,title:`Multiplayer`,body:`Cursors, comments and a shared laser pointer`},{icon:`sparkles`,title:`AI drafts`,body:`Describe a diagram, get shapes you can edit`},{icon:`shapes`,title:`Every shape`,body:`Flowcharts, mockups, tables, charts, slides`},{icon:`lock`,title:`Private`,body:`Nothing leaves your workspace unless you share`},{icon:`file-down`,title:`Portable`,body:`PNG, SVG, PDF and a plain file you own`}].flatMap(({icon:e,title:n,body:r},i)=>{let a=72+i%3*280,o=168+Math.floor(i/3)*152,s=34*t.unit,c=t.point(a,o);return V([X({x:c.x,y:c.y},s,e,{color:Y}),I(t.rect(a+46,o-4,200,40),n,t.font(21),{align:`left`}),I(t.rect(a,o+48,252,76),r,t.font(15),{align:`left`,valign:`top`,lineHeight:1.6,color:H})])});return[...L(t,`Why teams switch`),...n]}function Jn(e){let t=R(e),n=(e,n,r,i)=>z(t.rect(e-126,n-126,252,252),r,{kind:`ellipse`,opacity:.6,color:i,strokeWidth:2}),r=[{cx:300,cy:262,fill:G.blue,ink:Qt.blue,name:`What users beg for`},{cx:432,cy:262,fill:G.yellow,ink:Qt.yellow,name:`What we're best at`},{cx:366,cy:376,fill:G.teal,ink:Qt.teal,name:`What pays the bills`}],i=r.flatMap(({fill:e,name:n},r)=>V([z(t.rect(660,214+r*66,20,20),e,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(694,208+r*66,200,32),n,t.font(17),{align:`left`})]));return[...L(t,`Where the three meet`),...r.map(({cx:e,cy:t,fill:r,ink:i})=>n(e,t,r,i)),I(t.rect(288,292,156,40),`Do this`,t.font(20)),...i]}function Yn(e){let t=R(e),n=V([z(t.rect(72,140,392,300),G.blue,{fillStyle:`outline`}),I(t.rect(96,164,344,96),`38%`,t.font(72),{align:`left`}),I(t.rect(96,250,344,34),`faster to a first board`,t.font(18),{align:`left`,color:H}),Ut(t.rect(96,292,344,130),`area`,[[``,`Minutes`],[`Jan`,`9.4`],[`Feb`,`7.1`],[`Mar`,`6.2`],[`Apr`,`4.8`],[`May`,`3.6`]],t.font(11),{showLegend:!1})]),r=V([z(t.rect(480,140,196,142),G.green,{fillStyle:`outline`}),I(t.rect(496,164,164,62),`4.8`,t.font(48),{align:`left`}),I(t.rect(496,228,164,32),`average rating`,t.font(15),{align:`left`,color:H})]),i=V([z(t.rect(692,140,196,142),G.orange,{fillStyle:`outline`}),X(t.point(710,162),30*t.unit,`trophy`,{color:Y}),I(t.rect(708,204,164,32),`12 of 14 shipped`,t.font(17),{align:`left`}),I(t.rect(708,234,164,28),`two slipped to Q3`,t.font(14),{align:`left`,color:J})]),a=V([z(t.rect(480,298,408,142),G.gray,{fillStyle:`outline`}),I(t.rect(504,316,360,76),`“It replaced three tools and a weekly meeting.”`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5}),I(t.rect(504,396,360,28),`Kim, platform lead at Globex`,t.font(14),{align:`left`,color:J})]);return[...L(t,`The quarter at a glance`),...n,...r,...i,...a]}function Xn(e){let t=R(e),n=[{fill:G.green,tag:`Added`,text:`Dark mode, at last`},{fill:G.blue,tag:`Improved`,text:`Boards open twice as fast`},{fill:G.red,tag:`Fixed`,text:`That one bug, gone for good`}].flatMap(({fill:e,tag:n,text:r},i)=>{let a=168+i*88;return V([z(t.rect(72,a+4,140,48),e,{fillStyle:`outline`,label:n,fontSize:t.font(18)}),I(t.rect(236,a,652,56),r,t.font(22),{align:`left`})])});return[I(t.rect(72,48,460,56),`What's new`,t.font(36),{align:`left`}),B([t.point(74,118),t.point(250,118)],{color:U,strokeWidth:4}),I(t.rect(560,58,328,36),`v2.4.0 · this week`,t.font(15),{align:`right`,fontFamily:q,color:J}),...n,I(t.rect(72,442,816,40),`…plus twelve smaller fixes nobody will notice but us.`,t.font(24),{fontFamily:$t,color:J})]}function Zn(e){let t=R(e),n=[G.blue,G.green,G.yellow,G.pink,G.teal,G.purple].flatMap((e,n)=>{let r=240+n%3*240,i=n<3?152:312;return V([z(t.rect(r-42,i,84,84),e,{kind:`ellipse`,label:String.fromCharCode(65+n),fontSize:t.font(28)}),I(t.rect(r-110,i+92,220,24),`Name Surname`,t.font(18)),I(t.rect(r-110,i+118,220,20),`What they do`,t.font(14),{color:J})])});return[...L(t,`Meet the team`),...n]}function Qn(e){let t=R(e),n=[{x:72,fill:G.blue,quote:`“It changed how our team plans every single week.”`,who:`Sam, Acme`},{x:368,fill:G.orange,quote:`“The first tool everyone actually kept using.”`,who:`Ada, Initech`},{x:664,fill:G.pink,quote:`“We shipped the rework two weeks early.”`,who:`Kim, Globex`}].flatMap(({x:e,fill:n,quote:r,who:i})=>V([z(t.rect(e,150,256,268),n,{fillStyle:`outline`}),I(t.rect(e+20,172,216,150),r,t.font(18),{align:`left`,valign:`top`,lineHeight:1.5}),K(t.rect(e+18,330,104,22),`rating`,{value:5,fill:U}),I(t.rect(e+20,362,216,32),i,t.font(14),{align:`left`,color:J})]));return[...L(t,`What people say`),...n]}function $n(e){let t=R(e),n=e.width/Kt.width,r=e.height/Kt.height,i=[[``,`Basic`,`Pro`,`Team`],[`Price`,`$0`,`$12`,`$29`],[`Projects`,`1`,`10`,`Unlimited`],[`Export`,`PNG`,`PNG, SVG, PDF`,`PNG, SVG, PDF`],[`Support`,`—`,`Email`,`Priority`]],a=i.map((e,t)=>e.map((e,n)=>t===0?{background:n===2?G.blue:`#e9ecef`}:n===2?{background:`#e7f5ff`}:{}));return[...L(t,`Compare the options`),en(t.point(72,156),i,[252,188,188,188].map(e=>e*n),i.map(()=>54*r),t.font(16),{cellStyles:a})]}function er(e){let t=R(e),n=[{x:176,fill:G.blue,when:`Q1`,what:`Discovery, 20 interviews`},{x:384,fill:G.green,when:`Q2`,what:`First beta, 10 teams`},{x:592,fill:G.yellow,when:`Q3`,what:`Public launch`},{x:792,fill:G.pink,when:`Q4`,what:`Scale up, self-serve`}].flatMap(({x:e,fill:n,when:r,what:i},a)=>{let o=a%2==0,s=26*t.unit,c=t.point(e,306),l=o?-1:1;return V([B([t.point(e,306+l*16),t.point(e,306+l*54)],{strokeWidth:1.5,opacity:.3}),z({x:c.x-s/2,y:c.y-s/2,width:s,height:s},n,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(e-92,o?184:364,184,34),r,t.font(22),{valign:o?`bottom`:`top`}),I(t.rect(e-92,o?218:398,184,56),i,t.font(15),{valign:o?`bottom`:`top`,lineHeight:1.5,color:H})])});return[...L(t,`Roadmap`),B([t.point(88,306),t.point(890,306)],{strokeWidth:3,endArrow:!0}),...n,z(t.rect(96,332,96,34),Y,{kind:`oval`,fillStyle:`bold`,label:`today`,fontSize:t.font(14)}),B([t.point(144,284),t.point(144,332)],{color:Y,strokeWidth:2})]}function tr(e){let t=R(e),n=[{x:72,title:`Now`},{x:350,title:`Next`},{x:628,title:`Later`}].flatMap(({x:e,title:n})=>V([z(t.rect(e,140,260,330),`transparent`,{dash:`dashed`,opacity:.6}),I(t.rect(e,152,260,30),n,t.font(22))])),r=116*t.unit,i=[{x:100,y:206,rot:-2,fill:G.yellow,text:`Ship the fix`},{x:168,y:332,rot:3,fill:G.blue,text:`Call the pilot users`},{x:396,y:224,rot:-4,fill:G.green,text:`Write the launch post`},{x:690,y:240,rot:5,fill:G.pink,text:`Explore pricing`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>W(t.point(e,n),r,o,t.font(15),i,a));return[...L(t,`Now, next, later`),...n,...i]}function nr(e){let t=R(e),n=[{label:`Infrastructure`,fill:G.green,pct:.8},{label:`Mobile app`,fill:G.blue,pct:.6},{label:`Documentation`,fill:G.yellow,pct:.45},{label:`Onboarding`,fill:G.pink,pct:.2}].flatMap(({label:e,fill:n,pct:r},i)=>{let a=168+i*76;return V([I(t.rect(72,a,240,32),e,t.font(20),{align:`left`}),z(t.rect(330,a,470,32),G.gray,{dash:`none`}),z(t.rect(330,a,470*r,32),n,{fillStyle:`bold`,dash:`none`}),I(t.rect(814,a,76,32),`${Math.round(r*100)}%`,t.font(16),{align:`left`,fontFamily:q,color:H})])});return[...L(t,`Where things stand`),...n]}function rr(e){let t=R(e),n=[{x:72,y:140,fill:G.green,title:`Strengths`,hint:`What we do well`},{x:504,y:140,fill:G.red,title:`Weaknesses`,hint:`Where we struggle`},{x:72,y:314,fill:G.blue,title:`Opportunities`,hint:`What we could ride`},{x:504,y:314,fill:G.yellow,title:`Threats`,hint:`What could hurt us`}].flatMap(({x:e,y:n,fill:r,title:i,hint:a})=>V([z(t.rect(e,n,384,158),r),I(t.rect(e+20,n+12,344,28),i,t.font(20),{align:`left`}),I(t.rect(e+20,n+48,344,96),a,t.font(15),{align:`left`,valign:`top`,color:H})]));return[...L(t,`SWOT`),...n]}function ir(e){let t=R(e),n=[{fill:G.blue,label:`Collect`,note:`Anyone can file a request`},{fill:G.teal,label:`Sort`,note:`Weekly triage, no backlog`},{fill:G.green,label:`Decide`,note:`One owner says yes or no`},{fill:G.yellow,label:`Ship`,note:`Behind a flag, then wide`}].flatMap(({fill:e,label:n,note:r},i)=>{let a=72+i*188;return V([z(t.rect(a,218,234,104),e,{kind:`chevron`,label:n,fontSize:t.font(21)}),I(t.rect(a+44,340,174,76),r,t.font(15),{valign:`top`,lineHeight:1.5,color:J})])});return[...L(t,`How it works`),...n]}var ar=.56;function or(e){let t=R(e),n=[{fill:G.blue,value:`12,400`,name:`Visited the site`,note:`any page, any source`},{fill:G.teal,value:`1,860`,name:`Started a trial`,note:`15% of visitors`},{fill:G.green,value:`410`,name:`Became customers`,note:`22% of trials`}],r=520,i=[],a=[];return n.forEach(({fill:e,value:n,name:o,note:s},c)=>{let l=148+c*96,u=l+96/2,d=r*ar;i.push(...V([z(t.rect(340-r/2,l,r,96),e,{kind:`trapezoid`,rotation:180}),I(t.rect(340-d/2,u-24,d,48),n,t.font(30-c*4))]),...V([I(t.rect(646,u-30,250,30),o,t.font(20),{align:`left`}),I(t.rect(646,u+2,250,26),s,t.font(15),{align:`left`,color:J})])),c>0&&a.push(I(t.rect(40,u-30,134,30),c===1?`−10,540`:`−1,450`,t.font(17),{align:`right`,color:J}),Wt(t.point(340-r/2+18,u-6),t.point(150,u+12),1.8,{color:J})),r*=ar}),[...L(t,`Where people drop off`),...i,...a,B([t.point(622,156),t.point(622,428)],{strokeWidth:1.5,dash:`dashed`,opacity:.3}),z(t.rect(258,460,164,38),G.gray,{kind:`oval`,fillStyle:`outline`,label:`3.3% end to end`,fontSize:t.font(16)})]}function sr(e){let t=R(e),n=[{fill:G.purple,label:`Why`,note:`Teams lose their mornings to status meetings`},{fill:G.blue,label:`How`,note:`One board replaces the four tools they juggle`},{fill:G.teal,label:`What`,note:`Ship the shared inbox and the weekly digest`}],r=180,i=[];n.forEach(({fill:e,label:n,note:a},o)=>{let s=176+o*96,c=s+96/2;i.push(...V([z(t.rect(330-r/2,s,r,96),e,{kind:`trapezoid`}),I(t.rect(330-r*ar*.5,c-22,r*ar,44),n,t.font(24))]),...V([z(t.rect(660,c-26,12,12),e,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(684,c-34,212,68),a,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:H})])),r/=ar});let a=180*ar;return[...L(t,`How the work ladders up`),z(t.rect(330-a/2,118,a,58),G.yellow,{kind:`triangle`}),...i]}function cr(e){let t=R(e),n={x:340,y:318},r=[{label:`Talk to users`,fill:G.blue},{label:`Pick one bet`,fill:G.teal},{label:`Ship it small`,fill:G.green},{label:`Measure it`,fill:G.yellow}],i=r.map(({label:e,fill:i},a)=>{let o=-Math.PI/2+a*2*Math.PI/r.length;return z(t.rect(n.x+Math.cos(o)*152-156/2,n.y+Math.sin(o)*152-58/2,156,58),i,{label:e,fontSize:t.font(18)})}),a=i.map((e,n)=>{let r=i[(n+1)%i.length];return Ht({x:e.x+e.width/2,y:e.y+e.height/2},{x:r.x+r.width/2,y:r.y+r.height/2},e,r,{bow:-34*t.unit,strokeWidth:2.4})}),o=46*t.unit;return[...L(t,`How we work`),...a,...i,X({x:t.point(n.x,n.y).x-o/2,y:t.point(n.x,n.y).y-o/2},o,`refresh-cw`,{color:J}),I(t.rect(646,240,250,34),`Every two weeks`,t.font(21),{align:`left`}),I(t.rect(646,282,250,140),`One loop per sprint. Nothing ships that hasn't been through all four.`,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:H})]}function lr(e){let t=R(e),n=nn(t.rect(72,148,816,300),`lanes`,{lanes:[`Customer`,`Support`,`Engineering`]}),r=e=>148+e*100+50,i=(e,n,i,a)=>z(t.rect(e,r(n)-27,148,54),a,{label:i,fontSize:t.font(16)}),a=i(126,0,`Reports a bug`,G.blue),o=i(324,1,`Triages it`,G.teal),s=i(522,2,`Ships a fix`,G.green),c=i(720,0,`Confirms`,G.blue),l=(e,t)=>Ht({x:e.x+e.width,y:e.y+e.height/2},{x:t.x,y:t.y+t.height/2},e,t,{bendStyle:`elbow`,strokeWidth:2.4});return[...L(t,`Who picks it up`),n,a,o,s,c,l(a,o),l(o,s),l(s,c)]}function ur(e){let t=R(e),n=e=>250+e*106,r=Array.from({length:6},(e,r)=>[B([t.point(n(r),150),t.point(n(r),440)],{strokeWidth:1.5,opacity:.12}),I(t.rect(n(r),118,106,26),`W${r+1}`,t.font(14),{color:J})]).flat(),i=[{name:`Research`,from:0,span:2,fill:G.purple},{name:`Design`,from:1,span:2,fill:G.blue},{name:`Build`,from:2,span:3,fill:G.teal},{name:`Beta`,from:4,span:1.5,fill:G.green},{name:`Launch prep`,from:5,span:.7,fill:G.yellow}].flatMap(({name:e,from:r,span:i,fill:a},o)=>{let s=170+o*52;return V([I(t.rect(72,s,164,36),e,t.font(17),{align:`left`}),z(t.rect(n(r)+6,s+4,106*i-12,28),a,{kind:`oval`,fillStyle:`bold`,dash:`none`})])});return[...L(t,`Six weeks to launch`),...r,...i,B([t.point(n(2),138),t.point(n(2),448)],{color:Y,strokeWidth:2,dash:`dashed`}),I(t.rect(n(2)-60,452,120,26),`today`,t.font(14),{color:Y}),z(t.rect(852,378,36,36),G.red,{kind:`diamond`,fillStyle:`bold`}),I(t.rect(714,418,168,26),`Launch`,t.font(15),{align:`right`,color:H})]}function dr(e){let t=R(e),n=[{y:244,text:`KR1 — Signup to first board under 2 minutes`,progress:.7,pct:`70%`},{y:320,text:`KR2 — Week-one activation up 20%`,progress:.45,pct:`45%`},{y:396,text:`KR3 — 50 teams on the new flow`,progress:.2,pct:`20%`}].flatMap(({y:e,text:n,progress:r,pct:i})=>V([I(t.rect(72,e,540,44),n,t.font(19),{align:`left`}),z(t.rect(640,e+9,160,24),G.gray,{dash:`none`}),z(t.rect(640,e+9,160*r,24),G.green,{fillStyle:`bold`,dash:`none`}),I(t.rect(812,e+2,76,38),i,t.font(18),{align:`left`,color:H})]));return[...L(t,`This quarter's OKRs`),z(t.rect(72,144,816,62),G.blue,{label:`Objective — Make onboarding effortless`,fontSize:t.font(22)}),...n]}function fr(e){let t=R(e);return[...L(t,`The problem we solve`),...V([z(t.rect(72,150,384,320),G.red,{fillStyle:`outline`}),I(t.rect(96,174,336,40),`The problem`,t.font(26),{align:`left`}),I(t.rect(96,228,336,220),`Status lives in six tools
11
+ Standups eat the morning
12
+ Nobody trusts the roadmap`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:H})]),...V([z(t.rect(504,150,384,320),G.green,{fillStyle:`outline`}),I(t.rect(528,174,336,40),`Our solution`,t.font(26),{align:`left`}),I(t.rect(528,228,336,220),`One board for plans and talk
13
+ Status that writes itself
14
+ A roadmap anyone can read`,t.font(19),{align:`left`,valign:`top`,lineHeight:2,color:H})]),Wt(t.point(462,310),t.point(498,310),5)]}function pr(e){let t=R(e),n=[{d:340,fill:G.blue},{d:230,fill:G.teal},{d:120,fill:G.green}].map(({d:e,fill:n})=>z(t.rect(330-e/2,480-e,e,e),n,{kind:`ellipse`})),r=[{y:190,fill:G.blue,value:`TAM — $4.2B`,caption:`everyone with the problem`},{y:268,fill:G.teal,value:`SAM — $600M`,caption:`who we can reach`},{y:346,fill:G.green,value:`SOM — $40M`,caption:`a realistic first bite`}].flatMap(({y:e,fill:n,value:r,caption:i})=>V([z(t.rect(560,e+4,22,22),n,{kind:`ellipse`,fillStyle:`bold`}),I(t.rect(596,e,292,30),r,t.font(22),{align:`left`}),I(t.rect(596,e+34,292,26),i,t.font(15),{align:`left`,color:J})]));return[...L(t,`How big is this?`),...n,...r]}function mr(e){let t=R(e),n=[{x:72,name:`Free`,price:`$0`,features:`3 boards
15
+ Core shapes
16
+ PNG export`,highlight:!1},{x:356,name:`Pro`,price:`$12`,features:`Unlimited boards
17
+ AI assistant
18
+ Every export`,highlight:!0},{x:640,name:`Team`,price:`$49`,features:`Shared spaces
19
+ Admin controls
20
+ Priority help`,highlight:!1}].flatMap(({x:e,name:n,price:r,features:i,highlight:a})=>{let o=[z(t.rect(e,156,248,314),a?G.blue:G.gray,{fillStyle:`outline`}),I(t.rect(e+24,180,200,34),n,t.font(22),{align:`left`}),I(t.rect(e+24,218,200,60),r,t.font(44),{align:`left`}),I(t.rect(e+26,240,200,60),`per person / month`,t.font(13),{align:`right`,valign:`bottom`,color:J}),I(t.rect(e+24,306,200,150),i,t.font(17),{align:`left`,valign:`top`,lineHeight:2,color:H})];return a&&o.push(Zt(t.rect(e+50,138,148,30),G.yellow,`MOST POPULAR`,t.font(12),{labelColor:Xt})),V(o)});return[...L(t,`Pick a plan`),...n]}function hr(e){let t=R(e);return[...L(t,`Where the line is going`),Ut(t.rect(72,150,536,300),`area`,[[``,`MRR`],[`Jan`,`41`],[`Feb`,`58`],[`Mar`,`76`],[`Apr`,`97`],[`May`,`128`],[`Jun`,`164`]],t.font(12),{showLegend:!1,numberFormat:`currency`,showValues:!0}),...[{value:`4.1×`,caption:`revenue in six months`},{value:`112%`,caption:`net revenue retention`},{value:`$0`,caption:`spent on paid acquisition`}].flatMap(({value:e,caption:n},r)=>{let i=168+r*100;return V([I(t.rect(648,i,240,56),e,t.font(40),{align:`left`}),I(t.rect(648,i+54,240,30),n,t.font(15),{align:`left`,color:J})])})]}function gr(e){let t=R(e);return[...L(t,`How we sit in the market`),Ut(t.rect(96,146,768,330),`quadrant`,[[``,`x`,`y`],[`Us`,`0.78`,`0.82`],[`Legacy suite`,`0.24`,`0.74`],[`Sticky-note app`,`0.8`,`0.26`],[`Docs and slides`,`0.34`,`0.22`]],t.font(13),{quadrantLabels:[`Where we play`,`Heavy and slow`,`Good enough`,`Fast but shallow`],xTitle:`Hard to start → Open and draw`,yTitle:`One meeting → The whole workflow`})]}function _r(e){let t=R(e),n=[{icon:`circle-check`,text:`Ship the collaboration layer`},{icon:`circle-check`,text:`Hire two engineers and a designer`},{icon:`circle-check`,text:`Reach $500k ARR before the next round`}].flatMap(({icon:e,text:n},r)=>{let i=300+r*52,a=22*t.unit,o=t.point(72,i+4);return V([X({x:o.x,y:o.y},a,e,{color:`#2f9e44`}),I(t.rect(108,i,380,34),n,t.font(17),{align:`left`,color:H})])});return[...L(t,`The ask`),I(t.rect(72,158,420,96),`$2.5M`,t.font(76),{align:`left`}),I(t.rect(72,250,420,34),`seed round · 18 months of runway`,t.font(19),{align:`left`,color:J}),...n,Ut(t.rect(536,152,352,300),`donut`,[[``,`Share`],[`Engineering`,`55`],[`Go to market`,`30`],[`Everything else`,`15`]],t.font(12),{showValues:!0,numberFormat:`percent`})]}function vr(e){let t=R(e),n=[{x:136,y:146,fill:G.green,title:`Quick wins`,align:`left`},{x:491,y:146,fill:G.blue,title:`Big bets`,align:`right`},{x:136,y:299,fill:G.gray,title:`Fill-ins`,align:`left`},{x:491,y:299,fill:G.red,title:`Money pits`,align:`right`}].flatMap(({x:e,y:n,fill:r,title:i,align:a})=>[z({...t.rect(e,n,710/2,306/2)},r,{dash:`none`,opacity:.35}),I(t.rect(e+(a===`left`?16:-16),n+10,710/2-32,26),i,t.font(15),{align:a,color:H})]),r=96*t.unit,i=[{x:190,y:176,rot:-3,fill:G.green,text:`Ship this week`},{x:604,y:190,rot:4,fill:G.blue,text:`The big rewrite`},{x:236,y:322,rot:2,fill:G.yellow,text:`Nice to have`},{x:640,y:336,rot:-5,fill:G.red,text:`Kill it`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>W(t.point(e,n),r,o,t.font(14),i,a));return[...L(t,`Where to spend the effort`),...n,B([t.point(120,299),t.point(868,299)],{strokeWidth:2,endArrow:!0,opacity:.5}),B([t.point(491,468),t.point(491,124)],{strokeWidth:2,endArrow:!0,opacity:.5}),...i,I(t.rect(692,466,160,26),`more effort`,t.font(14),{align:`right`,color:J}),I(t.rect(503,112,160,26),`more impact`,t.font(14),{align:`left`,color:J})]}function yr(e){let t=R(e),n=[{x:72,fill:G.green,icon:`circle-check`,title:`In scope`,body:`Shared inbox
21
+ Weekly digest
22
+ Slack alerts`},{x:350,fill:G.red,icon:`circle-slash`,title:`Not this time`,body:`Mobile app
23
+ Custom roles
24
+ SSO`},{x:628,fill:G.orange,icon:`triangle-alert`,title:`Watch out for`,body:`Search rewrite lands late
25
+ One backend engineer`}].flatMap(({x:e,fill:n,icon:r,title:i,body:a})=>V([z(t.rect(e,232,260,186),n,{fillStyle:`outline`}),z(t.rect(e+18,250,224,32),`transparent`,{dash:`none`,label:i,fontSize:t.font(19),align:`left`,titleIcon:{source:`lucide`,name:r,placement:`inside`}}),I(t.rect(e+18,292,224,112),a,t.font(15),{align:`left`,valign:`top`,lineHeight:1.9,color:H})])),r=[`Owner · Ada`,`Ships · 14 August`,`Check-in · Fridays, 10:00`].map((e,n)=>Zt(t.rect(72+n*250,448,232,38),G.gray,e,t.font(15),{fillStyle:`pastel`}));return[...L(t,`Project kickoff`),z(t.rect(72,140,816,68),G.blue,{label:`Cut the time a team spends chasing status to zero`,fontSize:t.font(23),titleIcon:{source:`lucide`,name:`target`,placement:`inside`}}),...n,...r]}function br(e){let t=R(e),n=e=>186+e*140,r=[{label:`Hears of us`,doing:`A teammate shares a board`,mood:`smile`,fill:G.green},{label:`Signs up`,doing:`Three fields, no card`,mood:`smile`,fill:G.green},{label:`First board`,doing:`Stares at a blank canvas`,mood:`meh`,fill:G.yellow},{label:`Invites the team`,doing:`Nobody joins for a week`,mood:`frown`,fill:G.red},{label:`Renews`,doing:`Finance asks what it's for`,mood:`meh`,fill:G.yellow}].flatMap(({label:e,doing:r,mood:i,fill:a},o)=>{let s=n(o),c=38*t.unit,l=t.point(s+132/2,318);return[Zt(t.rect(s,148,132,36),G.blue,e,t.font(14),{fillStyle:`outline`}),I(t.rect(s,206,132,76),r,t.font(14),{valign:`top`,lineHeight:1.5,color:H}),X({x:l.x-c/2,y:l.y-c/2},c,i,{color:a===G.green?`#2f9e44`:a===G.red?`#e03131`:`#f08c00`})]}),i=[`Doing`,`Feeling`,`Fix it here`].map((e,n)=>I(t.rect(56,[212,306,384][n],110,30),e,t.font(15),{align:`right`,color:J})),a=104*t.unit;return[...L(t,`The trip they take`),B([t.point(176,292),t.point(888,292)],{strokeWidth:1.5,opacity:.15}),B([t.point(176,366),t.point(888,366)],{strokeWidth:1.5,opacity:.15}),...r,...i,W(t.point(n(2)+14,384),a,`Start from a template`,t.font(13),-3),W(t.point(n(3)+14,384),a,`Invite from the empty board`,t.font(13),4)]}function xr(e){let t=R(e);return[...L(t,`What the data says`),Ut(t.rect(72,150,530,310),`bar`,[[``,`This year`,`Last year`],[`Q1`,`12`,`8`],[`Q2`,`18`,`11`],[`Q3`,`24`,`16`],[`Q4`,`31`,`19`]],t.font(12),{showLegend:!0,showValues:!0}),I(t.rect(648,170,240,30),`The takeaway`,t.font(22),{align:`left`}),I(t.rect(648,212,240,200),`Say in one sentence what the chart proves, then stop.`,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:H})]}function Sr(e){let t=R(e),n=z(t.rect(96,220,180,90),G.blue,{label:`Client`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`monitor`,placement:`inside`}}),r=z(t.rect(390,220,180,90),G.teal,{label:`API`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`server`,placement:`inside`}}),i=z(t.rect(684,205,180,120),G.purple,{kind:`cylinder`,label:`Database`,fontSize:t.font(20)});return[...L(t,`How it fits together`),n,r,i,Ht(t.point(278,265),t.point(388,265),n,r,{label:`REST`,fontSize:t.font(14),strokeWidth:2.4}),Ht(t.point(572,265),t.point(682,265),r,i,{label:`SQL`,fontSize:t.font(14),strokeWidth:2.4}),I(t.rect(72,420,816,30),`Swap the boxes for your pieces. The arrows stay attached.`,t.font(16),{color:J})]}function Cr(e){let t=R(e);return[z(t.rect(-65,277,330,56),G.yellow,{fillStyle:`bold`,label:`THE ONE NUMBER`,fontSize:t.font(17),letterSpacing:.15,rotation:-90}),I(t.rect(180,150,600,200),`99.9%`,t.font(120)),I(t.rect(180,366,600,40),`what it measures, and why it matters`,t.font(20),{color:J}),B([t.point(420,352),t.point(540,352)],{color:Y,strokeWidth:4})]}function wr(e){let t=R(e);return[z(t.rect(72,84,400,372),G.gray,{dash:`none`,label:`Drop an image
26
+ or sketch here`,fontSize:t.font(18),labelColor:J}),I(t.rect(528,132,360,80),`Show, then tell`,t.font(36),{align:`left`}),B([t.point(530,224),t.point(660,224)],{color:U,strokeWidth:4}),I(t.rect(528,248,360,180),`Pair one strong visual with a few words. Say what it shows and why it matters. Nothing more.`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5,color:H})]}function Tr(e){let t=R(e),n=58*t.unit,r=46*t.unit,i=t.point(136,412);return[X(t.point(136,148),n,`quote`,{color:Y,strokeWidth:2.4}),I(t.rect(132,232,700,156),`Add one line worth remembering, and give it the whole slide.`,t.font(38),{align:`left`,valign:`top`,lineHeight:1.4}),z({x:i.x,y:i.y,width:r,height:r},G.yellow,{kind:`ellipse`,label:`A`,fontSize:t.font(18)}),I(t.rect(196,410,400,28),`Ada Lovelace`,t.font(19),{align:`left`}),I(t.rect(196,436,400,26),`Head of platform, Initech`,t.font(15),{align:`left`,color:J})]}function Er(e){let t=R(e);return[nn(t.rect(112,64,224,424),`phone`),K(t.rect(128,92,192,22),`statusbar`,{label:`9:41`,fontSize:t.font(11)}),K(t.rect(128,122,192,30),`heading`,{label:`Boards`,fontSize:t.font(18)}),K(t.rect(128,160,192,34),`search`,{label:`Search boards…`,fontSize:t.font(12)}),K(t.rect(128,206,192,116),`list`,{label:`Sprint board | Roadmap wall | Retro — Tuesday`,fontSize:t.font(12)}),K(t.rect(128,336,192,42),`button`,{label:`New board`,fill:G.blue,fontSize:t.font(13)}),K(t.rect(128,424,192,44),`tabbar`,{label:`Home | Search | You`,fontSize:t.font(11)}),I(t.rect(420,150,470,80),`In your pocket`,t.font(36),{align:`left`}),B([t.point(422,240),t.point(552,240)],{color:U,strokeWidth:4}),I(t.rect(420,264,460,160),`One tap from idea to board. Works offline, syncs the moment you're back.`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5,color:H})]}function Dr(e){let t=R(e);return[...L(t,`Where the work lives`),nn(t.rect(72,148,520,312),`browser`),K(t.rect(84,196,96,252),`sidebar`,{label:`Boards | Team | Settings`,fontSize:t.font(11),fill:G.gray}),K(t.rect(192,194,200,30),`heading`,{label:`Roadmap wall`,fontSize:t.font(16)}),K(t.rect(428,196,152,28),`segmented`,{label:`Day | Week | Month`,fontSize:t.font(10),fill:G.blue}),...[{x:192,label:`Now`},{x:326,label:`Next`},{x:460,label:`Later`}].map(({x:e,label:n})=>K(t.rect(e,238,120,86),`card`,{label:n,fontSize:t.font(12)})),K(t.rect(192,340,388,100),`list`,{label:`Ship the fix | Call the pilot users | Write the launch post`,fontSize:t.font(12)}),I(t.rect(628,190,260,76),`One wall for the whole team`,t.font(25),{align:`left`,valign:`top`,lineHeight:1.3}),I(t.rect(628,288,260,160),`Everything the team is doing, on one wall anyone can open.`,t.font(17),{align:`left`,valign:`top`,lineHeight:1.5,color:H})]}function Or(e){let t=R(e),n=[{x:148,y:214,note:`The one action a new board needs`},{x:300,y:320,note:`Status, without asking anyone`},{x:452,y:396,note:`Everything else hides until it's wanted`}],r=36*t.unit;return[...L(t,`What to look at`),z(t.rect(72,150,520,300),`transparent`,{dash:`dashed`,label:`Drop a screenshot here`,fontSize:t.font(17),labelColor:J,opacity:.6}),...n.flatMap(({x:e,y:n,note:i},a)=>{let o=t.point(e,n),s=178+a*92;return[K({x:o.x,y:o.y,width:r,height:r},`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:G.yellow}),...V([K(t.rect(628,s,34,34),`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:G.yellow}),I(t.rect(674,s-4,214,84),i,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:H})])]})]}function kr(e){let t=R(e),n=(e,n,r)=>z(e,`transparent`,{dash:`dashed`,label:n,fontSize:t.font(r),labelColor:J,opacity:.6});return[...L(t,`The look we're after`),n(t.rect(72,148,462,312),`Drop the hero shot`,18),n(t.rect(552,148,336,148),`Reference`,15),n(t.rect(552,312,158,148),`Detail`,14),n(t.rect(730,312,158,148),`Colour`,14)]}function Ar(e){let t=R(e),n=124*t.unit,r=[{x:128,y:96,rot:-4,fill:G.blue,text:`What if…?`},{x:660,y:84,rot:3,fill:G.green,text:`Steal this idea`},{x:116,y:326,rot:5,fill:G.pink,text:`Open question`},{x:692,y:318,rot:-6,fill:G.teal,text:`Remember this`},{x:408,y:392,rot:2,fill:G.yellow,text:`Wild card`}].map(({x:e,y:r,rot:i,fill:a,text:o})=>W(t.point(e,r),n,o,t.font(15),i,a));return[z(t.rect(350,200,260,120),G.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`The topic`,fontSize:t.font(26)}),...r]}function jr(e){let t=R(e),n=(e,n,r,i)=>z(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[n(186,122,44,G.yellow),n(744,104,32,G.pink),n(252,396,26,G.blue),I(t.rect(160,186,640,100),`Demo time`,t.font(72)),I(t.rect(280,300,400,48),`(everything will be fine)`,t.font(30),{fontFamily:$t,color:H}),W(t.point(656,360),132*t.unit,`Plan B: screenshots`,t.font(16),5)]}function Mr(e){let t=R(e),n=26*t.unit,r=t.point(772,102);return[z({x:r.x,y:r.y,width:n,height:n},G.pink,{kind:`heart`,fillStyle:`bold`}),I(t.rect(160,190,640,100),`Thank you!`,t.font(64)),...[`hello@example.com`,`koboyo.com`,`@yourhandle`].map((e,n)=>Zt(t.rect(196+n*200,306,184,40),G.gray,e,t.font(15),{fillStyle:`pastel`})),W(t.point(688,366),180*.85*t.unit,`Questions?`,t.font(20),-6)]}function Nr(e){let t=R(e),n=84*t.unit,r=t.point(480,132);return[X({x:r.x-n/2,y:r.y},n,`coffee`,{color:Y}),I(t.rect(160,248,640,90),`Back in 10 minutes`,t.font(56)),I(t.rect(280,344,400,44),`stretch, refill, ignore Slack`,t.font(28),{fontFamily:$t,color:H}),K(t.rect(330,424,300,18),`progress`,{value:.35,fill:G.blue})]}var Pr=[{id:`blank`,name:`Blank`,category:`title`,build:()=>[]},{id:`cover`,name:`Title slide`,category:`title`,build:Mn},{id:`image-cover`,name:`Image title`,category:`title`,build:In},{id:`dark-cover`,name:`Midnight title`,category:`title`,build:Fn},{id:`terminal`,name:`Terminal`,category:`title`,build:Ln},{id:`section`,name:`Section divider`,category:`title`,build:Nn},{id:`big-statement`,name:`Big statement`,category:`title`,build:Pn},{id:`bullets`,name:`Title and bullets`,category:`content`,build:Rn},{id:`agenda`,name:`Agenda`,category:`content`,build:zn},{id:`two-columns`,name:`Two columns`,category:`content`,build:Bn},{id:`comparison`,name:`Comparison`,category:`content`,build:Vn},{id:`before-after`,name:`Before and after`,category:`content`,build:Hn},{id:`metrics`,name:`Key numbers`,category:`content`,build:Un},{id:`takeaways`,name:`Three takeaways`,category:`content`,build:Wn},{id:`checklist`,name:`Do and don't`,category:`content`,build:Gn},{id:`feature-list`,name:`Feature rundown`,category:`content`,build:Kn},{id:`icon-grid`,name:`Icon grid`,category:`content`,build:qn},{id:`bento`,name:`At a glance`,category:`content`,build:Yn},{id:`venn`,name:`Overlap`,category:`content`,build:Jn},{id:`changelog`,name:`What's new`,category:`content`,build:Xn},{id:`feature-table`,name:`Feature matrix`,category:`content`,build:$n},{id:`timeline`,name:`Timeline`,category:`plan`,build:er},{id:`kanban`,name:`Now, next, later`,category:`plan`,build:tr},{id:`progress`,name:`Status report`,category:`plan`,build:nr},{id:`okrs`,name:`OKRs`,category:`plan`,build:dr},{id:`swot`,name:`SWOT`,category:`plan`,build:rr},{id:`process`,name:`Process`,category:`plan`,build:ir},{id:`funnel`,name:`Funnel`,category:`plan`,build:or},{id:`pyramid`,name:`Pyramid`,category:`plan`,build:sr},{id:`cycle`,name:`Loop`,category:`plan`,build:cr},{id:`swimlanes`,name:`Swimlanes`,category:`plan`,build:lr},{id:`gantt`,name:`Week-by-week plan`,category:`plan`,build:ur},{id:`problem-solution`,name:`Problem, solution`,category:`pitch`,build:fr},{id:`market-size`,name:`Market size`,category:`pitch`,build:pr},{id:`traction`,name:`Traction`,category:`pitch`,build:hr},{id:`competition`,name:`Competitive map`,category:`pitch`,build:gr},{id:`ask`,name:`The ask`,category:`pitch`,build:_r},{id:`pricing`,name:`Pricing tiers`,category:`pitch`,build:mr},{id:`team`,name:`Meet the team`,category:`pitch`,build:Zn},{id:`testimonials`,name:`What people say`,category:`pitch`,build:Qn},{id:`matrix`,name:`Effort vs impact`,category:`workshop`,build:vr},{id:`kickoff`,name:`Project kickoff`,category:`workshop`,build:yr},{id:`journey`,name:`Journey map`,category:`workshop`,build:br},{id:`chart`,name:`Chart`,category:`visual`,build:xr},{id:`diagram`,name:`Diagram starter`,category:`visual`,build:Sr},{id:`big-metric`,name:`One number`,category:`visual`,build:Cr},{id:`image-text`,name:`Image and text`,category:`visual`,build:wr},{id:`image-grid`,name:`Moodboard`,category:`visual`,build:kr},{id:`annotated`,name:`Annotated screenshot`,category:`visual`,build:Or},{id:`phone`,name:`Phone mockup`,category:`visual`,build:Er},{id:`browser`,name:`Browser mockup`,category:`visual`,build:Dr},{id:`quote`,name:`Quote`,category:`visual`,build:Tr},{id:`brainstorm`,name:`Brainstorm`,category:`fun`,build:Ar},{id:`demo`,name:`Demo time`,category:`fun`,build:jr},{id:`intermission`,name:`Break`,category:`fun`,build:Nr},{id:`closing`,name:`Thank you`,category:`fun`,build:Mr}];async function Fr(e,t,n,r){let i=r.theme.palette();return an(await rn(e,r,{bounds:t,padding:0,background:n(i),palette:i}))}var Ir=new Map;function Lr(e,t,n,r){let i=pe(),[a,o]=(0,Z.useState)(()=>Ir.get(e)??null),s=(0,Z.useRef)(t);s.current=t;let c=(0,Z.useRef)(n);c.current=n;let l=(0,Z.useRef)(r);return l.current=r,(0,Z.useEffect)(()=>{let t=Ir.get(e);if(t){o(t);return}let n=!0,r={x:0,y:0,...c.current};return Fr(fe(s.current()),r,e=>l.current?e.paperBg:e.bg,i).then(t=>{Ir.set(e,t),n&&o(t)}),()=>{n=!1}},[e,i]),a}function Rr(e){let{template:t,testId:n,cacheKey:r,aspect:i,canvas:a,onPaper:o,onPick:s}=e,c=Lr(r,()=>t.build({x:0,y:0,...a}),a,o);return(0,$.jsxs)(`button`,{type:`button`,"data-testid":n,onClick:s,className:`group overflow-hidden rounded-lg text-left ring-1 ring-[var(--chrome-ring)] transition-shadow hover:ring-2 hover:ring-[var(--chrome-fg-500)]`,children:[(0,$.jsx)(`div`,{className:`${i} w-full`,style:{background:o?`var(--paper-bg)`:`var(--canvas-bg)`},children:c&&(0,$.jsx)(`img`,{src:c,alt:``,draggable:!1,className:`h-full w-full object-fill`})}),(0,$.jsxs)(`div`,{className:`border-t border-[var(--chrome-ring)] px-2.5 py-1.5`,children:[(0,$.jsx)(`div`,{className:`text-[12px] text-[var(--chrome-fg-800)]`,children:t.name}),t.blurb?(0,$.jsx)(`div`,{className:`text-[11px] text-[var(--chrome-fg-500)]`,children:t.blurb}):null]})]})}function zr(e){let{open:t,onOpenChange:n,title:r,prefix:i,width:a,cardAspect:o,canvas:s,filters:c,templates:l,previewOnPaper:u,pinned:d,onPick:f}=e,p=(0,Z.useRef)(null),[m,h]=(0,Z.useState)(`all`),g=Ee(),_=l.filter(e=>m===`all`||e.category===m||d?.(e));return(0,$.jsx)(Ft,{open:t,onOpenChange:n,children:(0,$.jsxs)(Nt,{children:[(0,$.jsx)(Mt,{className:`fixed inset-0 bg-gray-900/15`}),(0,$.jsxs)(Pt,{ref:p,initialFocus:p,"data-overlay":!0,"data-testid":`${i}-dialog`,className:`scrollbar-slim fixed left-1/2 top-1/2 max-h-[82vh] ${a} -translate-x-1/2 -translate-y-1/2 overflow-y-auto overflow-x-hidden rounded-2xl bg-[var(--chrome-popup)] shadow-[0_24px_70px_rgba(0,0,0,0.22)] outline-none ring-1 ring-[var(--chrome-ring)]`,children:[(0,$.jsxs)(`div`,{className:`sticky top-0 z-10 border-b border-[var(--chrome-ring)] bg-[var(--chrome-surface)] backdrop-blur`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-5 pb-2.5 pt-3.5`,children:[(0,$.jsx)(Lt,{className:`text-[15px] text-[var(--chrome-fg-900)]`,children:r}),(0,$.jsx)(It,{"aria-label":`Close`,className:`-mr-1.5 flex h-7 w-7 items-center justify-center rounded-full text-[var(--chrome-fg-400)] outline-none transition-colors hover:bg-[var(--chrome-divider)] hover:text-[var(--chrome-fg-600)]`,children:(0,$.jsx)(Ke,{size:16,stroke:1.75})})]}),(0,$.jsx)(`div`,{className:`scrollbar-slim flex gap-1.5 overflow-x-auto px-5 pb-3`,children:c.map(({id:e,label:t})=>(0,$.jsx)(`button`,{type:`button`,"data-testid":`${i}-filter-${e}`,onClick:()=>h(e),className:`shrink-0 whitespace-nowrap rounded-full px-3 py-1 text-[12px] transition-colors ${m===e?`bg-[var(--chrome-accent)] text-white`:`text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] hover:bg-[var(--chrome-hover)]`}`,children:t},e))})]}),(0,$.jsx)(`div`,{className:`grid grid-cols-2 gap-3 p-5 sm:grid-cols-3`,children:_.map(e=>(0,$.jsx)(Rr,{template:e,testId:`${i}-${e.id}`,cacheKey:`${i}:${e.id}:${g}`,aspect:o,canvas:s,onPaper:u??!1,onPick:()=>{n(!1),f(e)}},e.id))})]})]})})}var Br=[{id:`all`,label:`All`},{id:`title`,label:`Title`},{id:`content`,label:`Content`},{id:`plan`,label:`Plan`},{id:`pitch`,label:`Pitch`},{id:`workshop`,label:`Workshop`},{id:`visual`,label:`Visual`},{id:`fun`,label:`Fun`}];function Vr(e){let{open:t,onOpenChange:n,onPick:r}=e;return(0,$.jsx)(zr,{open:t,onOpenChange:n,title:`Pick a slide template`,prefix:`slide-template`,width:`w-[min(680px,92vw)]`,cardAspect:`aspect-video`,canvas:Kt,filters:Br,templates:Pr,previewOnPaper:!0,pinned:e=>e.id===`blank`,onPick:e=>r(e)})}var Hr=90,Ur=210;function Wr(e){let t=e.width/Math.max(1,e.height);return Math.round(S(248/t,Hr,Ur))}var Gr=new Map;function Kr(e,t,n,r){return e.box.x===t.x&&e.box.y===t.y&&e.box.width===t.width&&e.box.height===t.height&&e.fill===t.fill&&e.theme===r&&e.contents.length===n.length&&e.contents.every((e,t)=>e===n[t])}function qr(e){for(let t of Gr.keys())e.has(t)||Gr.delete(t)}function Jr(e){let{figure:t,shapes:n}=e,r=pe(),i=(0,Z.useMemo)(()=>O(n,t),[n,t]),a=Ee(),[o,s]=(0,Z.useState)(()=>Gr.get(t.id)?.url??null);return(0,Z.useEffect)(()=>{let e=Gr.get(t.id);if(e&&Kr(e,t,i,a)){s(e.url);return}let n=!0,o=setTimeout(()=>{Fr(i,b(t),e=>t.fill&&t.fill!==`transparent`?x(t.fill,e):e.bg,r).then(e=>{n&&(Gr.set(t.id,{box:{x:t.x,y:t.y,width:t.width,height:t.height},fill:t.fill,theme:a,contents:i,url:e}),s(e))})},e?300:0);return()=>{n=!1,clearTimeout(o)}},[t,i,a,r]),(0,$.jsx)(`div`,{className:`w-full overflow-hidden rounded-[7px] bg-[var(--canvas-bg)]`,style:{height:Wr(t)},children:o&&(0,$.jsx)(`img`,{src:o,alt:``,draggable:!1,className:`h-full w-full object-fill`})})}var Yr=`flex items-center gap-1 rounded-md bg-[var(--chrome-surface)] px-1.5 py-0.5 text-[10px] tabular-nums text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] backdrop-blur-sm`,Xr=72,Zr=12;function Qr(e){let{containerRef:t}=e;return C(e=>e.rightPanel===`slides`)?(0,$.jsx)($r,{containerRef:t}):null}function $r(e){let{containerRef:t}=e,{ai:n,embed:i}=ne(),a=ke(`slide`),o=te(),{store:s,viewportAnimation:c,history:l}=o,u=$e(),{beginTransaction:d,endTransaction:f}=l,p=C(e=>e.shapes),m=C(e=>e.viewport),h=C(e=>e.slidePickerOpen),g=C(e=>e.animateSlideId),_=C(e=>e.selectedIds),v=C(e=>e.viewMode),{addMany:ee,sendToBack:y,replaceMany:x,removeShapes:S,updateShape:ae,setSelectedIds:fe,setSlidesOpen:pe,setSlidePickerOpen:me,setNotesEditorId:he,setAnimateSlideId:A,setAiOpen:ge,setPresentingIndex:_e,setViewport:ve,setExportDialog:ye}=s.getState(),j=(0,Z.useMemo)(()=>se(p),[p]),be=(0,Z.useMemo)(()=>it(p),[p]),xe=(0,Z.useMemo)(()=>D(j).length,[j]),[M,N]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{qr(new Set(j.map(e=>e.id)))},[j]);let Se=Bt()===`docked`,Te=(0,Z.useCallback)(()=>{let e=t.current,n=e?.clientWidth??window.innerWidth,r=e?.clientHeight??window.innerHeight;return{width:Math.max(1,n-(Se?272:0)),height:r}},[t,Se]),Ee=(0,Z.useMemo)(()=>oe(j,m,Te()),[j,m,Te]);function P(e){c.animate(s.getState().viewport,T(b(e),Te(),Xr),ve)}(0,Z.useEffect)(()=>{if(!g||_.size===0)return;let e=s.getState().shapes,t=ie(e,se(e),_);!t||t.id===g||A(t.id)},[_,g,s,A]);function De(e,t){let{width:n,height:r}=Te(),i=de({x:n/2,y:r/2},m),a={...le(j,i,p),slideOrder:e,slideLayout:t&&t.id!==`blank`?t.id:void 0},o=t?t.build(b(a)):[];d(),x(re(j,e)),ee([a,...o]),y(new Set([a.id])),f(),fe(new Set([a.id])),P(a)}function Oe(e){let t=s.getState().shapes,{clones:n,renumbered:r}=k(t,j,e);d(),x(r),ee(n),y(new Set([n[0].id])),f(),fe(new Set([n[0].id])),P(n[0])}function je(e){let t=s.getState().shapes;S(ce(t,j[e])),fe(new Set)}function Me(e,t){let n=s.getState().shapes,r=j[e],i=O(n,r),a={bounds:b(r),padding:0,background:r.fill,measurement:o.measurement},c=w(r,e);u(t===`png`?`downloadPng`:`downloadSvg`,i,{options:a,filename:c})}function Ne(e){xe!==0&&_e(e??Math.max(0,Ee))}function Pe(){if(!M)return;let e=M.value.trim();e!==M.initial&&ae(M.id,{label:e}),N(null)}let F=We({count:j.length,gap:Zr,disabled:v,onPress:e=>P(j[e]),onReorder:(e,t)=>x(ue(j,e,t)),canDrag:()=>!M}),Fe=g?j.findIndex(e=>e.id===g):-1,Ie=Fe>=0?j[Fe]:void 0;return(0,$.jsxs)(Vt,{width:272,testId:`slides-panel`,ariaLabel:`Slides`,onDismiss:()=>pe(!1),children:[Ie?(0,$.jsx)(Sn,{figure:Ie,index:Fe,total:j.length,viewMode:v,onBack:()=>A(null),onGoToSlide:e=>{let t=j[e];t&&(A(t.id),P(t))},onFocusSlide:P}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between py-2 pl-4 pr-2`,children:[(0,$.jsxs)(`span`,{className:`text-[14px] text-[var(--chrome-fg-900)]`,"data-testid":`slides-count`,children:[`Slides (`,j.length,`)`]}),(0,$.jsxs)(`div`,{className:`flex items-center`,children:[n&&!v&&(0,$.jsx)(r,{label:`Generate with AI`,side:`bottom`,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Generate slides with AI`,"data-testid":`slides-ai-open`,onClick:()=>ge(!0),className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg text-[var(--chrome-fg-600)] transition-[background-color,scale] hover:bg-[var(--chrome-hover)] active:scale-[0.96] coarse:h-11 coarse:w-11`,children:(0,$.jsx)(Ge,{size:16,stroke:1.75})})}),!v&&(0,$.jsx)(r,{label:`Add slide`,side:`bottom`,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Add slide`,"data-testid":`slides-add`,onClick:()=>me(!0),className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg text-[var(--chrome-fg-600)] transition-[background-color,scale] hover:bg-[var(--chrome-hover)] active:scale-[0.96] coarse:h-11 coarse:w-11`,children:(0,$.jsx)(Ve,{size:16,stroke:1.75})})}),i?null:(0,$.jsx)(r,{label:`Export as PDF`,side:`bottom`,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Export slides as PDF`,"data-testid":`slides-export-pdf`,disabled:xe===0,onClick:()=>ye({format:`pdf`}),className:`${At} disabled:pointer-events-none disabled:text-[var(--chrome-fg-300)]`,children:(0,$.jsx)(Ce,{size:16,stroke:1.75})})}),(0,$.jsx)(r,{label:`Hide slides`,side:`bottom`,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":`Hide slides`,"data-testid":`slides-close`,onClick:()=>pe(!1),className:At,children:(0,$.jsx)(Ke,{size:16,stroke:1.75})})})]})]}),(0,$.jsx)(`div`,{className:`mx-3 h-px bg-[var(--chrome-divider)]`}),(0,$.jsxs)(`div`,{ref:F.listRef,"data-testid":`slides-list`,className:`flex flex-1 flex-col gap-3 overflow-y-auto p-3`,children:[j.length===0&&(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,$.jsx)(`p`,{className:`text-[12px] leading-relaxed text-[var(--chrome-fg-400)]`,children:`No slides yet. Create a new slide or generate one with AI to get started.`}),!v&&(0,$.jsxs)(`button`,{type:`button`,"data-testid":`slides-add-empty`,onClick:()=>me(!0),className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[12px] text-[var(--chrome-fg-600)] ring-1 ring-[var(--chrome-ring)] transition-colors hover:bg-[var(--chrome-rest)] hover:text-[var(--chrome-fg-900)]`,children:[(0,$.jsx)(Ve,{size:14,stroke:1.75}),`Add slide`]})]}),j.map((e,t)=>{let n=E(e,t),r=t===Ee,o={onPresent:()=>Ne(t),onExportPng:i?null:()=>Me(t,`png`),onExportSvg:i?null:()=>Me(t,`svg`),onEmbed:a?()=>a(e.id):null,onDuplicate:()=>Oe(t),onRename:()=>N({id:e.id,initial:n,value:n}),onEditNotes:()=>he(e.id),onToggleSkip:()=>ae(e.id,{slideSkipped:!e.slideSkipped||void 0}),onAddAbove:()=>De(t),onAddBelow:()=>De(t+1),onDelete:()=>je(t)};return(0,$.jsxs)(`div`,{ref:F.setItemRef(t),"data-testid":`slide-item-${t}`,className:`group relative shrink-0`,style:F.rowStyle(t),children:[(0,$.jsx)(jn,{index:t,actions:o,skipped:!!e.slideSkipped,disabled:v,children:(0,$.jsxs)(`div`,{className:`relative cursor-pointer touch-none overflow-hidden rounded-lg ring-1 transition-shadow ${r?`ring-2 ring-[var(--chrome-fg-500)]`:`ring-[var(--chrome-ring)] hover:ring-black/25`}`,...F.rowHandlers(t),children:[(0,$.jsx)(`div`,{className:e.slideSkipped?`opacity-40`:void 0,children:(0,$.jsx)(Jr,{figure:e,shapes:p})}),(0,$.jsxs)(`div`,{className:`absolute left-1.5 top-1.5 flex items-center gap-1`,children:[e.slideSkipped&&(0,$.jsxs)(`div`,{"data-testid":`slide-skipped-${t}`,title:`Skipped — not shown when presenting`,className:Yr,children:[(0,$.jsx)(we,{size:11,stroke:1.75}),`Skipped`]}),be.has(e.id)&&(0,$.jsxs)(`div`,{"data-testid":`slide-animated-${t}`,title:`Animated: plays in ${be.get(e.id)} clicks`,className:Yr,children:[(0,$.jsx)(Ae,{size:11,stroke:1.75}),be.get(e.id)]})]}),M?.id===e.id?(0,$.jsx)(`input`,{autoFocus:!0,onFocus:e=>e.target.select(),value:M.value,onChange:e=>N({...M,value:e.target.value}),onBlur:Pe,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&Pe(),e.key===`Escape`&&N(null)},onPointerDown:e=>e.stopPropagation(),className:`absolute inset-x-0 bottom-0 border-t border-[var(--chrome-ring)] bg-[var(--chrome-popup)] px-2.5 py-1.5 text-[12px] text-[var(--chrome-fg-800)] outline-none`}):(0,$.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 flex items-center gap-1.5 border-t border-[var(--chrome-ring)] bg-[var(--chrome-surface)] px-2.5 py-1.5 text-[12px] text-[var(--chrome-fg-800)] backdrop-blur-sm`,title:n,onPointerDown:e=>e.stopPropagation(),onClick:()=>P(e),onDoubleClick:t=>{t.stopPropagation(),v||N({id:e.id,initial:n,value:n})},children:[(0,$.jsx)(`span`,{className:`shrink-0 text-[var(--chrome-fg-400)]`,children:t+1}),(0,$.jsx)(`span`,{className:`truncate`,children:n})]})]})}),(0,$.jsx)(An,{index:t,actions:o,skipped:!!e.slideSkipped,disabled:v})]},e.id)})]}),(0,$.jsx)(`div`,{className:`border-t border-[var(--chrome-ring)] p-3`,children:(0,$.jsx)(En,{disabled:xe===0,onPresent:e=>Ne(e===`beginning`?0:void 0)})})]}),(0,$.jsx)(Vr,{open:h,onOpenChange:me,onPick:e=>{De(j.length,e),Se||pe(!1)}})]})}export{Qr as SlidesPanel};
@@ -0,0 +1,7 @@
1
+ import{$ as e,Cn as t,Tn as n,W as r,at as i,gn as a,k as o,n as s,tt as c,un as l}from"./shapes-CHDGoELO.js";import{Y as u,a as d,at as f,ct as p,i as m,st as h}from"./geometry-CVRSymIE.js";import{_n as g,a as _,cn as v,dn as y,gn as b,ln as x,o as S,un as C,vn as w}from"./frames-C-jROub3.js";import{f as T}from"./text-breaks-BDwq8Wxj.js";var E=[`#4dabf7`,`#51cf66`,`#ff922b`,`#cc5de8`,`#ff6b6b`,`#20c997`,`#ffd43b`,`#f06595`],D={k:1e3,m:1e6,b:1e9,t:0xe8d4a51000};function O(e){let t=String(e??``).trim(),n=t.match(/([kmbt])\s*$/i),r=n?D[n[1].toLowerCase()]:1,i=parseFloat(t.replace(/[^0-9.+\-eE]/g,``))*r;return Number.isFinite(i)?i:0}function k(e,t){return e.seriesColors?.[t]??E[t%E.length]}function A(e){let t=e.cells,n=t[0]??[],r=Math.max(0,n.length-1),i=t.slice(1),a=i.map(e=>e[0]??``),o=[];for(let t=1;t<=r;t+=1)o.push({name:n[t]??``,color:k(e,t-1),values:i.map(e=>O(e[t]))});let s=-1/0,c=1/0;for(let e of o)for(let t of e.values)t>s&&(s=t),t<c&&(c=t);return Number.isFinite(s)||(s=0,c=0),{categories:a,series:o,min:c,max:s}}function ee(e){return e.cells.slice(1).some(e=>e.slice(1).some(e=>String(e??``).trim().length>0))}function te(e){let t=0,n=0;for(let r=0;r<e.categories.length;r+=1){let i=0,a=0;for(let t of e.series){let e=t.values[r]??0;e>=0?i+=e:a+=e}i>t&&(t=i),a<n&&(n=a)}return{min:n,max:t}}function ne(e){let t=String(e??``).trim();return t.length!==0&&/^[-+]?[$€£¥]?[\d,]*\.?\d+%?[kmbtKMBT]?$/.test(t)}function re(e){if(e.length<2||(e[0]?.length??0)<2)return!1;let t=e.slice(1);for(let n=1;n<e[0].length;n+=1){let e=0,r=0;for(let i of t){let t=i[n]??``;t.trim().length!==0&&(r+=1,ne(t)&&(e+=1))}if(r>=1&&e/r>=.6)return!0}return!1}function j(e,t){let n=Math.abs(e);return n>=1e9?`${Number((e/1e9).toFixed(1))}B`:n>=1e6?`${Number((e/1e6).toFixed(1))}M`:n>=1e3?`${Number((e/1e3).toFixed(1))}k`:e.toFixed(t)}function ie(e,t){return t===`percent`?`${e}%`:t===`currency`?`$${e}`:e}function M(e,t){return ie(j(e,Number.isInteger(e)?0:+(Math.abs(e)<10)),t)}function ae(e,t,n){return ie(j(Math.abs(e)<t*1e-9?0:e,t<1?Math.min(4,Math.ceil(-Math.log10(t))):0),n)}function N(e,t){if(e.length<=t)return e;if(t<=3)return e.slice(0,Math.max(0,t));let n=Math.ceil((t-1)/2),r=Math.floor((t-1)/2);return`${e.slice(0,n)}…${e.slice(e.length-r)}`}function oe(e,t,n){return n===`number`?M(e,`number`):n===`currency`?M(e,`currency`):`${Math.round(e/t*100)}%`}var P=c.paperGrid,F=c.paperLine,se=`#868e96`,I=`#ffffff`;function L(e,t,n,r,i={}){return{kind:`text`,x:t,y:n,text:r,size:e.fontSize,color:se,family:e.fontFamily,anchor:`middle`,baseline:`middle`,...i}}function R(e,t,n,r,a={}){return L(e,t,n,r,{color:i(e.color),...a})}function ce(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}function le(e,t){if(!e.showTitles||!e.title)return{prims:[],box:t};let n=e.fontSize*1.2,r=[R(e,t.x+t.width/2,t.y+n*.2,e.title,{size:n,baseline:`hanging`})],i=n*1.5;return{prims:r,box:{x:t.x,y:t.y+i,width:t.width,height:t.height-i}}}function z(e,t,n){let r=t.filter(e=>e.name);if(!e.showLegend||r.length===0)return{prims:[],height:0};let i=e.fontSize,a=i*.8,o=i*.45,s=i*1.6,c=e=>e.length*i*.6,l=e=>a+o+c(e),u=[],d=0;for(let e of r){let t=l(e.name),r=u[u.length-1];if(!r||d+s+t>n.width){u.push([e]),d=t;continue}r.push(e),d+=s+t}let f=i*1.5,p=[];return u.forEach((t,r)=>{let c=t.reduce((e,t,n)=>e+l(t.name)+(n>0?s:0),0),u=n.y+i*.6+r*f,d=n.x+Math.max(0,(n.width-c)/2);for(let n of t)p.push({kind:`rect`,x:d,y:u,width:a,height:a,fill:n.color,rx:2,testId:`chart-legend`}),p.push(R(e,d+a+o,u+a/2,n.name,{anchor:`start`})),d+=l(n.name)+s}),{prims:p,height:i*.6+u.length*f}}function B(e,t,n){return z(e,t.series.map(e=>({name:e.name,color:e.color})),n)}function V(e,t,n){return t.name?`${e}\n${t.name}: ${n}`:e?`${e}: ${n}`:n}function H(e,t){let n=10**Math.floor(Math.log10(e)),r=e/n,i;return i=t?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10,i*n}function U(e,t,n){let r=Math.min(0,Number.isFinite(e)?e:0),i=Math.max(0,Number.isFinite(t)?t:0);r===i&&(i=r+1);let a=H(H(i-r,!1)/Math.max(1,n),!0),o=Math.floor(r/a)*a,s=Math.ceil(i/a)*a,c=[];for(let e=o;e<=s+a*.5;e+=a)c.push(e);return{min:o,max:s,step:a,ticks:c}}function W(e,t,n,r){for(let i of n.ticks){let a=r.valueOf(i),o=Math.abs(i)<n.step*1e-6,s=r.tickLine(a);e.push({kind:`line`,x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:o?F:P,width:1}),e.push(r.tickText(a,ae(i,n.step,t.numberFormat)))}for(let t=0;t<r.count;t+=1)e.push(r.categoryText(t,r.padAlongStart+r.slot*(t+.5)))}function G(e,t,n,r,i,a){let o=Math.max(1,r.series.length),s=a.slot*.18,c=a.slot-s*2;if(i){let i=r.categories.map(()=>0),o=r.categories.map(()=>0);for(let l=0;l<a.count;l+=1){let u=a.padAlongStart+a.slot*l+s;r.series.forEach((s,d)=>{let f=s.values[l]??0,p=f>=0?i[l]:o[l],m=p+f,h=a.valueOf(p),g=a.valueOf(m),_=a.barRect(u,c,h,g);e.push({kind:`rect`,x:_.x,y:_.y,width:_.width,height:_.height,fill:k(n,d),rx:2,testId:`chart-bar`});let v=a.stackedValueText(_,f,M(f,n.numberFormat));v&&e.push(v);let y=a.stackedTip(_,h,g);t.push({x:_.x,y:_.y,width:_.width,height:_.height,tipX:y.tipX,tipY:y.tipY,label:V(r.categories[l],s,M(f,n.numberFormat))}),f>=0?i[l]=m:o[l]=m})}return}let l=o>1?c*.08:0,u=(c-l*(o-1))/o;for(let i=0;i<a.count;i+=1){let o=a.padAlongStart+a.slot*i+s;r.series.forEach((s,c)=>{let d=s.values[i]??0,f=o+c*(u+l),p=a.barRect(f,u,a.base,a.valueOf(d));e.push({kind:`rect`,x:p.x,y:p.y,width:p.width,height:p.height,fill:s.color,rx:2,testId:`chart-bar`});let m=a.groupedValueText(p,d,M(d,n.numberFormat));m&&e.push(m);let h=a.groupedTip(p,d);t.push({x:p.x,y:p.y,width:p.width,height:p.height,tipX:h.tipX,tipY:h.tipY,label:V(r.categories[i],s,M(d,n.numberFormat))})})}}function ue(e,t,n,r,i,a){let o=n.fontSize,{padLeft:s,slot:c,yOf:l,baseY:u}=a,d=n.chartType===`scatter`,f=r.categories.map(()=>0);r.series.forEach(a=>{let p=a.values.map((e,t)=>{let n=i?f[t]+e:e;return{x:s+c*(t+.5),y:l(n)}});if(n.chartType===`area`){let t=i?f.map(e=>l(e)):r.categories.map(()=>u);e.push({kind:`path`,d:me(p,t),fill:a.color,fillOpacity:i?1:.55,testId:`chart-area`})}d||e.push({kind:`polyline`,points:p,stroke:a.color,width:2.5,testId:`chart-line`}),p.forEach((i,s)=>{n.chartType===`line`&&e.push({kind:`circle`,cx:i.x,cy:i.y,r:3.5,fill:I,stroke:a.color,width:2}),d&&e.push({kind:`circle`,cx:i.x,cy:i.y,r:4.5,fill:a.color,stroke:I,width:1.5,testId:`chart-dot`});let l=a.values[s]??0;n.showValues&&e.push(R(n,i.x,i.y-7,M(l,n.numberFormat),{size:o*.85,baseline:`auto`,testId:`chart-value`})),t.push({x:i.x-c*.4,y:Math.min(i.y,u)-6,width:c*.8,height:Math.abs(u-i.y)+12,tipX:i.x,tipY:i.y,label:V(r.categories[s],a,M(l,n.numberFormat))})}),a.values.forEach((e,t)=>{f[t]+=e})})}function de(e,t,n){let r=e.fontSize,i=(e.chartType===`bar`||e.chartType===`area`)&&!!e.stacked,a=B(e,t,n),o=n.y+a.height,s=i?te(t):{min:t.min,max:t.max},c=U(s.min,s.max,4),l=c.ticks.map(t=>ae(t,c.step,e.numberFormat)),u=Math.max(...l.map(e=>e.length)),d=e.showTitles&&e.yTitle?r*2.1:0,f=e.showTitles&&e.xTitle?r*1.6:0,p=n.x+d+u*r*.6+10,m=n.x+n.width-12,h=o+r*.6,g=Math.max(1,m-p),_=t.categories.length,v=g/Math.max(1,_),y=e=>e.length*r*.55,b=t.categories.reduce((e,t)=>Math.max(e,y(t)),0)>v*.95,x=t.categories,S=r+12;if(b){let e=40*Math.PI/180,i=Math.max(r*2,(n.height*.42-12)/Math.sin(e)),a=Math.max(3,Math.floor(i/(r*.55)));x=t.categories.map(e=>N(e,a));let o=x.reduce((e,t)=>Math.max(e,y(t)),0);S=Math.sin(e)*o+14}let C=n.y+n.height-S-f,w=c.max-c.min||1,T=Math.max(1,C-h),E=e=>C-(e-c.min)/w*T,D=E(0),O={count:_,slot:v,padAlongStart:p,valueOf:E,base:D,barRect:(e,t,n,r)=>({x:e,y:Math.min(n,r),width:t,height:Math.abs(r-n)}),tickLine:e=>({x1:p,y1:e,x2:m,y2:e}),tickText:(t,n)=>L(e,p-6,t,n,{anchor:`end`}),categoryText:(n,r)=>b?L(e,r,C+8,x[n],{anchor:`end`,rotate:-40}):L(e,r,C+6,t.categories[n],{baseline:`hanging`}),stackedValueText:(t,n,i)=>e.showValues&&t.height>r?L(e,t.x+t.width/2,t.y+t.height/2,i,{size:r*.85,color:I,testId:`chart-value`}):null,groupedValueText:(t,n,i)=>e.showValues?R(e,t.x+t.width/2,(n>=0?t.y:t.y+t.height)-(n>=0?4:-r),i,{size:r*.85,baseline:`auto`,testId:`chart-value`}):null,stackedTip:e=>({tipX:e.x+e.width/2,tipY:e.y}),groupedTip:e=>({tipX:e.x+e.width/2,tipY:e.y})},k=[...a.prims,...fe(e,{padLeft:p,padRight:m,padBottom:C,padTop:h,box:n})],A=[];return W(k,e,c,O),e.chartType===`line`||e.chartType===`area`||e.chartType===`scatter`?(ue(k,A,e,t,i,{padLeft:p,slot:v,yOf:E,baseY:D}),{prims:k,marks:A}):(G(k,A,e,t,i,O),{prims:k,marks:A})}function fe(e,t){if(!e.showTitles)return[];let n=e.fontSize,r=[];if(e.xTitle&&r.push(R(e,(t.padLeft+t.padRight)/2,t.box.y+t.box.height-n*.4,e.xTitle,{baseline:`auto`})),e.yTitle){let i=(t.padTop+t.padBottom)/2,a=t.box.x+n*.8;r.push(R(e,a,i,e.yTitle,{rotate:-90}))}return r}function pe(e,t,n){let r=e.fontSize,i=!!e.stacked,a=B(e,t,n),o=n.y+a.height,s=i?te(t):{min:t.min,max:t.max},c=U(s.min,s.max,4),l=e=>e.length*r*.55,u=Math.min(n.width*.35,t.categories.reduce((e,t)=>Math.max(e,l(t)),0)),d=Math.max(3,Math.floor(u/(r*.55))),f=t.categories.map(e=>N(e,d)),p=e.showTitles&&e.yTitle?r*2.1:0,m=e.showTitles&&e.xTitle?r*1.6:0,h=n.x+p+u+14,g=n.x+n.width-14,_=o+r*.4,v=n.y+n.height-(r+10)-m,y=Math.max(1,g-h),b=Math.max(1,v-_),x=c.max-c.min||1,S=e=>h+(e-c.min)/x*y,C=S(0),w=t.categories.length,T={count:w,slot:b/Math.max(1,w),padAlongStart:_,valueOf:S,base:C,barRect:(e,t,n,r)=>({x:Math.min(n,r),y:e,width:Math.abs(r-n),height:t}),tickLine:e=>({x1:e,y1:_,x2:e,y2:v}),tickText:(t,n)=>L(e,t,v+6,n,{baseline:`hanging`}),categoryText:(t,n)=>L(e,h-8,n,f[t],{anchor:`end`}),stackedValueText:()=>null,groupedValueText:(t,n,i)=>e.showValues?R(e,(n>=0?t.x+t.width:t.x)+(n>=0?4:-4),t.y+t.height/2,i,{size:r*.85,anchor:n>=0?`start`:`end`,testId:`chart-value`}):null,stackedTip:(e,t,n)=>({tipX:(t+n)/2,tipY:e.y}),groupedTip:e=>({tipX:e.x+e.width,tipY:e.y+e.height/2})},E=[...a.prims,...fe(e,{padLeft:h,padRight:g,padBottom:v,padTop:_,box:n})],D=[];return W(E,e,c,T),G(E,D,e,t,i,T),{prims:E,marks:D}}function me(e,t){return`${e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `)} ${e.map((e,n)=>`L ${e.x} ${t[n]}`).reverse().join(` `)} Z`}function he(e,t,n,r,i){let a={x:e+n*Math.cos(r),y:t+n*Math.sin(r)},o={x:e+n*Math.cos(i),y:t+n*Math.sin(i)},s=+(i-r>Math.PI);return`M ${e} ${t} L ${a.x} ${a.y} A ${n} ${n} 0 ${s} 1 ${o.x} ${o.y} Z`}function ge(e,t,n,r,i,a){let o=(n,r)=>({x:e+n*Math.cos(r),y:t+n*Math.sin(r)}),s=o(n,i),c=o(n,a),l=o(r,a),u=o(r,i),d=+(a-i>Math.PI);return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} 1 ${c.x} ${c.y} L ${l.x} ${l.y} A ${r} ${r} 0 ${d} 0 ${u.x} ${u.y} Z`}function _e(e,t,n){let r=e.fontSize,i=t.series[0],a=z(e,t.categories.map((e,t)=>({name:e,color:E[t%E.length]})),n),o=[...a.prims],s=[];if(!i)return{prims:o,marks:s};let c=i.values.reduce((e,t)=>e+Math.max(0,t),0),l=n.y+a.height,u=n.x+n.width/2,d=l+(n.y+n.height-l)/2,f=Math.max(8,Math.min(n.width,n.y+n.height-l)/2-r),p=e.chartType===`donut`?f*.58:0;if(c<=0)return{prims:o,marks:s};let m=-Math.PI/2;return i.values.forEach((n,a)=>{let l=Math.max(0,n)/c*Math.PI*2;if(l<=0)return;let h=E[a%E.length],g=p>0?ge(u,d,f,p,m,m+l):he(u,d,f,m,m+l);o.push({kind:`path`,d:g,fill:h,testId:`chart-slice`});let _=m+l/2,v=p>0?(f+p)/2:f*.62,y=u+v*Math.cos(_),b=d+v*Math.sin(_);l>.25&&o.push(L(e,y,b,oe(n,c,e.numberFormat),{size:r*.9,color:I,testId:`chart-value`}));let x=Math.round(n/c*100),S=M(n,e.numberFormat===`currency`?`currency`:`number`);s.push({x:y-r,y:b-r,width:r*2,height:r*2,tipX:y,tipY:b-r,label:V(t.categories[a]??``,i,`${S} (${x}%)`)}),m+=l}),{prims:o,marks:s}}function ve(e){let t=[];for(let n of e.cells.slice(1)){let e=String(n[1]??``).trim(),r=String(n[2]??``).trim();!e&&!r||t.push({label:n[0]??``,x:d(O(e)),y:d(O(r))})}return t}function K(e){let t=(e??``).trim();if(!t)return{low:``,high:``};let n=/^(.*?)\s*(?:→|-->|->)\s*(.*)$/.exec(t);return n?{low:n[1].trim(),high:n[2].trim()}:{low:t,high:``}}function ye(e,t){let n=e.trim(),r=t.trim();return n&&r?`${n} → ${r}`:n?`${n} →`:r?`→ ${r}`:``}var be=[E[1],E[0],E[4],E[2]];function xe(e,t,n,r){return`M ${e} ${t} L ${n} ${t} L ${n} ${r} L ${e} ${r} Z`}function Se(e,t){let n=e.fontSize,r=[],i=[],a=K(e.xTitle),o=K(e.yTitle),s=!!(a.low||a.high),c=!!(o.low||o.high),l=t.x+(c?n*1.9:n*.6),u=t.x+t.width-n*.8,d=t.y+n*.6,f=t.y+t.height-(s?n*1.9:n*.8),p=Math.max(1,u-l),m=Math.max(1,f-d),h=l+p/2,g=d+m/2,_=e=>l+e*p,v=e=>f-e*m,y=t=>e.quadrantColors?.[t]??be[t],b=[{rect:[h,d,u,g],tint:y(0),label:e.quadrantLabels?.[0]},{rect:[l,d,h,g],tint:y(1),label:e.quadrantLabels?.[1]},{rect:[l,g,h,f],tint:y(2),label:e.quadrantLabels?.[2]},{rect:[h,g,u,f],tint:y(3),label:e.quadrantLabels?.[3]}];for(let e of b){let[t,n,i,a]=e.rect;r.push({kind:`path`,d:xe(t,n,i,a),fill:e.tint,fillOpacity:.1,testId:`chart-quadrant-zone`})}r.push({kind:`path`,d:xe(l,d,u,f),stroke:F,width:1}),r.push({kind:`line`,x1:h,y1:d,x2:h,y2:f,stroke:F,width:1}),r.push({kind:`line`,x1:l,y1:g,x2:u,y2:g,stroke:F,width:1});for(let t of b){if(!t.label)continue;let[i,a,o]=t.rect,s=Math.max(3,Math.floor((o-i)/(n*.55)));r.push(R(e,(i+o)/2,a+n*1.1,N(t.label,s),{testId:`chart-quadrant-label`}))}a.high?(r.push(L(e,(l+h)/2,f+n*.9,a.low,{baseline:`hanging`})),r.push(L(e,(h+u)/2,f+n*.9,a.high,{baseline:`hanging`}))):a.low&&r.push(L(e,h,f+n*.9,a.low,{baseline:`hanging`}));let x=t.x+n*1;o.high?(r.push(L(e,x,(g+f)/2,o.low,{rotate:-90})),r.push(L(e,x,(d+g)/2,o.high,{rotate:-90}))):o.low&&r.push(L(e,x,g,o.low,{rotate:-90}));let S=k(e,0);for(let t of ve(e)){let a=_(t.x),o=v(t.y);if(r.push({kind:`circle`,cx:a,cy:o,r:5,fill:S,stroke:I,width:1.5,testId:`chart-quadrant-point`}),t.label){let i=t.x>.72;r.push(R(e,a+(i?-9:9),o,t.label,{size:n*.85,anchor:i?`end`:`start`,testId:`chart-quadrant-point-label`}))}let s=`(${M(t.x,`number`)}, ${M(t.y,`number`)})`;i.push({x:a-n,y:o-n,width:n*2,height:n*2,tipX:a,tipY:o,label:t.label?`${t.label}\n${s}`:s})}return{prims:r,marks:i}}function q(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Ce(e){let r=o(e),i={x:0,y:0,width:r.width,height:r.height},a={x:e.flipX,y:e.flipY},s=t(e.kind,i,e.corner,a),c=n(e.kind,i,e.corner,a),l=h(e.fill,e.fillStyle??`pastel`,e.shadow,e.stroke),d=e.kind===`fork-join`?e.color:l.fill,p=e.kind===`fork-join`?1:l.fillOpacity,m=e.kind===`fork-join`?e.color:l.stroke,g=u(e.dash,e.strokeWidth),_=f(r);return{shadow:l.shadow?{tag:`path`,attrs:{d:s,transform:`translate(${_} ${_})`,fill:`#000000`,"fill-opacity":.18,stroke:`none`}}:null,fill:d===`none`?null:{tag:`path`,attrs:{d:s,fill:d,"fill-opacity":p,stroke:`none`}},strokes:e.dash===`none`?[]:y(e).map(t=>({tag:`path`,attrs:{d:t,fill:`none`,stroke:m,"stroke-width":e.strokeWidth,"stroke-dasharray":g.strokeDasharray,"stroke-linecap":g.strokeLinecap,"stroke-linejoin":`round`}})),fillPath:s,hitPath:c}}function we(e){let t=o(e);return{shadow:{tag:`rect`,attrs:{x:4,y:4,width:t.width,height:t.height,rx:2,fill:`#000000`,"fill-opacity":T}},card:{tag:`rect`,attrs:{width:t.width,height:t.height,rx:2,fill:e.fill}}}}function Te(e){let t=o(e),n=e.fill&&e.fill!==`transparent`?e.fill:`none`,r=e.kind??`simple`,i=l(e),a=i.strokeWidth,s=u(i.dash,a),c=i.dash===`none`;if(r===`simple`)return{outline:{tag:`rect`,attrs:{x:t.x,y:t.y,width:t.width,height:t.height,rx:10,fill:n,stroke:c?`none`:e.color,"stroke-opacity":.55,"stroke-width":a,"stroke-dasharray":s.strokeDasharray,"stroke-linecap":s.strokeLinecap}},chrome:[]};let{border:d,details:f}=_(r,t,e.lanes,e.laneSizes),p={fill:`none`,stroke:e.color,"stroke-opacity":.55,"stroke-width":a,"stroke-dasharray":s.strokeDasharray,"stroke-linecap":s.strokeLinecap,"stroke-linejoin":`round`},m=c?[]:[d,...f].flatMap((t,n)=>x(t,e,n).map(e=>({tag:`path`,attrs:{d:e,...p}})));return{outline:{tag:`rect`,attrs:{x:t.x,y:t.y,width:t.width,height:t.height,rx:S(r,t),fill:n,stroke:`none`}},chrome:m}}function Ee(t){let n=t.type===`line`&&t.color===`transparent`?e:t.color,r=u(t.dash,t.strokeWidth),i=t.type===`arrow`?v(t):C(t),a=t.type===`arrow`?b(t):g(t);return{strokes:i.map(e=>({tag:`path`,attrs:{d:e,fill:`none`,stroke:n,"stroke-width":t.strokeWidth,"stroke-linecap":r.strokeLinecap,"stroke-linejoin":`round`,"stroke-dasharray":r.strokeDasharray}})),heads:a.map(e=>({tag:`path`,attrs:{d:e.d,fill:w(e.fill,n),stroke:n,"stroke-width":t.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`}}))}}var J=e=>Math.round(e*100)/100;function Y(e,t,n){let r=Oe(e,t);return!n||n.length===0||r===``?r:[r,...n.map(e=>Oe(e,t))].filter(e=>e!==``).join(` `)}function De(e){return e.holes&&e.holes.length>0?`evenodd`:void 0}function Oe(e,t){if(e.length===0)return``;if(e.length<3||!t){let[t,...n]=e;return`M ${t.x} ${t.y}${n.map(e=>` L ${e.x} ${e.y}`).join(``)} Z`}let n=t=>e[(t+e.length)%e.length],r=`M ${n(0).x} ${n(0).y}`;for(let t=0;t<e.length;t+=1){let e=n(t-1),i=n(t),a=n(t+1),o=n(t+2),s=J(i.x+(a.x-e.x)/6),c=J(i.y+(a.y-e.y)/6),l=J(a.x-(o.x-i.x)/6),u=J(a.y-(o.y-i.y)/6);r+=` C ${s} ${c} ${l} ${u} ${a.x} ${a.y}`}return`${r} Z`}function ke(t){return{tag:`path`,attrs:{d:a(t),fill:t.color===`transparent`?e:t.color}}}var Ae=q(Ce),je=q(we),Me=q(Te),Ne=q(Ee);function Pe(e,t,n){let r=e.fontSize,i=B(e,t,n),a=[...i.prims],o=[],s=t.categories.length;if(s<1)return{prims:a,marks:o};let c=n.y+i.height,l=n.x+n.width/2,u=c+(n.y+n.height-c)/2,d=Math.max(8,Math.min(n.width,n.y+n.height-c)/2-r*2.4),f=U(t.min,t.max,4),p=f.max-f.min||1,m=e=>e/s*Math.PI*2-Math.PI/2,h=(e,t)=>{let n=(t-f.min)/p*d,r=m(e);return{x:l+n*Math.cos(r),y:u+n*Math.sin(r)}};for(let e of f.ticks){let n=(e-f.min)/p*d;if(n<=.5)continue;let r=t.categories.map((e,t)=>{let r=m(t);return{x:l+n*Math.cos(r),y:u+n*Math.sin(r)}});a.push({kind:`path`,d:Y(r),stroke:P,width:1,testId:`chart-radar-grid`})}for(let n=0;n<s;n+=1){let i=m(n),o={x:l+d*Math.cos(i),y:u+d*Math.sin(i)};a.push({kind:`line`,x1:l,y1:u,x2:o.x,y2:o.y,stroke:P,width:1});let s=l+(d+r*.8)*Math.cos(i),c=u+(d+r*.8)*Math.sin(i),f=Math.abs(Math.cos(i))<.3?`middle`:Math.cos(i)>0?`start`:`end`;a.push(L(e,s,c,t.categories[n],{anchor:f}))}return t.series.forEach(n=>{let i=n.values.map((e,t)=>h(t,e));a.push({kind:`path`,d:Y(i),fill:n.color,fillOpacity:.18,stroke:n.color,width:2,testId:`chart-radar-area`}),i.forEach((i,s)=>{a.push({kind:`circle`,cx:i.x,cy:i.y,r:3,fill:n.color,stroke:I,width:1.5});let c=n.values[s]??0;o.push({x:i.x-r,y:i.y-r,width:r*2,height:r*2,tipX:i.x,tipY:i.y,label:V(t.categories[s]??``,n,M(c,e.numberFormat))})})}),{prims:a,marks:o}}var Fe=`chart-empty`;function Ie(e,t){return{prims:[L(e,t.x+t.width/2,t.y+t.height/2,`No data. Double-click to edit`,{testId:Fe})],marks:[]}}function Le(e){let t=ce(e);if(!ee(e))return Ie(e,t);let n=A(e),r=le(e,t),i=r.box,a=e.chartType===`quadrant`?Se(e,i):e.chartType===`pie`||e.chartType===`donut`?_e(e,n,i):e.chartType===`radar`?Pe(e,n,i):e.chartType===`bar`&&e.horizontal?pe(e,n,i):de(e,n,i);return{prims:[...r.prims,...a.prims],marks:a.marks}}function Re(e){return Le(e).prims}var ze=280,Be=10,Ve=`#9ca3af`,He=.58;function Ue(e){return e.rowHeights.length}function We(e){return e.colWidths.length}function Ge(e){let t=e.colWidths.reduce((e,t)=>e+t,0),n=e.rowHeights.reduce((e,t)=>e+t,0);return{x:e.x,y:e.y,width:t,height:n}}function Ke(e){let t=[0];for(let n of e)t.push(t[t.length-1]+n);return t}function X(e){return Ke(e.colWidths)}function Z(e){return Ke(e.rowHeights)}function qe(e,t,n){return{x:e.x+X(e)[n],y:e.y+Z(e)[t],width:e.colWidths[n],height:e.rowHeights[t]}}function Je(e,t){return e.split(`
2
+ `).reduce((e,t)=>Math.max(e,t.length),0)*t*He}function Ye(e){return Math.max(32,Math.ceil(e*1.3)+16)}function Xe(e,t){let n=e[0]?.length??0,r=[];for(let i=0;i<n;i+=1){let n=0;for(let r of e)n=Math.max(n,Je(r[i]??``,t));r.push(m(Math.ceil(n+Be*2),56,ze))}return r}function Q(e){let t=Math.max(1,...e.map(e=>e.length));return e.map(e=>{let n=e.slice(0,t);for(;n.length<t;)n.push(``);return n})}function Ze(e,t,n){let r=Q(e.length>0?e:[[``]]);return{id:s(),type:`table`,x:t.x,y:t.y,cells:r,colWidths:Xe(r,n.fontSize),rowHeights:r.map(()=>Ye(n.fontSize)),rotation:0,fontSize:n.fontSize,fontFamily:n.fontFamily,color:n.color,opacity:n.opacity}}function Qe(e,t){let n=[],r=[],i=``,a=!1;for(let o=0;o<e.length;o+=1){let s=e[o];if(a){s===`"`&&e[o+1]===`"`?(i+=`"`,o+=1):s===`"`?a=!1:i+=s;continue}s===`"`?a=!0:s===t?(r.push(i),i=``):s===`
3
+ `?(r.push(i),n.push(r),r=[],i=``):s!==`\r`&&(i+=s)}return r.push(i),n.push(r),n}function $e(e){let t=e.replace(/\r\n/g,`
4
+ `).replace(/\n+$/,``);if(t.length===0)return null;let n=t.includes(` `)?` `:t.includes(`,`)?`,`:null;if(n===null)return null;let r=Qe(t,n);if(r.length===0)return null;let i=r[0].length;return i<2||r.some(e=>e.length!==i)?null:Q(r)}function $(e){let t=[],n=``;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===`\\`&&e[r+1]===`|`){n+=`|`,r+=1;continue}if(i===`|`){t.push(n.trim()),n=``;continue}n+=i}return t.push(n.trim()),t.length>1&&t[0]===``&&t.shift(),t.length>1&&t[t.length-1]===``&&t.pop(),t}function et(e){let t=e.replace(/\r\n/g,`
5
+ `).trim().split(`
6
+ `).map(e=>e.trim());if(t.length<2||t.some(e=>!e.includes(`|`)))return null;let n=$(t[0]),r=$(t[1]);return n.length===0||r.length!==n.length||!r.every(e=>/^:?-+:?$/.test(e))?null:Q([n,...t.slice(2).map($)])}function tt(e){let t=r(e).querySelector(`table`);if(!t)return null;let n=Array.from(t.querySelectorAll(`tr`)).map(e=>Array.from(e.querySelectorAll(`th,td`)).map(e=>(e.textContent??``).replace(/\s+/g,` `).trim())).filter(e=>e.length>0);return n.length>0?Q(n):null}function nt(e,t){let n=We(e),r=e.cells.slice();r.splice(t,0,Array.from({length:n},()=>``));let i=e.rowHeights.slice();i.splice(t,0,Ye(e.fontSize));let a=e.cellStyles?.slice();return a?.splice(t,0,Array.from({length:n},()=>({}))),{...e,cells:r,rowHeights:i,cellStyles:a}}function rt(e,t){if(Ue(e)<=1)return e;let n=e.cells.slice();n.splice(t,1);let r=e.rowHeights.slice();r.splice(t,1);let i=e.cellStyles?.slice();return i?.splice(t,1),{...e,cells:n,rowHeights:r,cellStyles:i}}function it(e,t){let n=e.cells.map(e=>{let n=e.slice();return n.splice(t,0,``),n}),r=e.colWidths.slice();r.splice(t,0,112);let i=e.cellStyles?.map(e=>{let n=e.slice();return n.splice(t,0,{}),n});return{...e,cells:n,colWidths:r,cellStyles:i}}function at(e,t){if(We(e)<=1)return e;let n=e.cells.map(e=>{let n=e.slice();return n.splice(t,1),n}),r=e.colWidths.slice();r.splice(t,1);let i=e.cellStyles?.map(e=>{let n=e.slice();return n.splice(t,1),n});return{...e,cells:n,colWidths:r,cellStyles:i}}function ot(e,t){return e.rowHeights.map((n,r)=>{let i=32;for(let n=0;n<e.colWidths.length;n+=1){let e=t(r,n);e&&e>i&&(i=e)}return i})}function st(e,t,n,r){let i=e.colWidths.slice();return i[t]=Math.max(56,n+r),{...e,colWidths:i}}function ct(e,t,n){let r=e.cellStyles?.[t]?.[n],i=r?.background??e.background,a=i===`transparent`?void 0:i;return{fontFamily:r?.fontFamily??e.fontFamily,fontSize:r?.fontSize??e.fontSize,color:a?p(a):e.color,background:a}}function lt(e){return e.cells.map(e=>e.map(()=>({})))}function ut(e){let t={};return e.fontFamily!==void 0&&(t.fontFamily=e.fontFamily),e.fontSize!==void 0&&(t.fontSize=e.fontSize),e.background!==void 0&&(t.background=e.background),t}function dt(e,t,n){let r=e;if(n.opacity!==void 0&&(r={...r,opacity:n.opacity}),t===null)return n.fontFamily!==void 0&&(r={...r,fontFamily:n.fontFamily}),n.fontSize!==void 0&&(r={...r,fontSize:n.fontSize}),n.background!==void 0&&(r={...r,background:n.background}),r;let i=ut(n);if(Object.keys(i).length===0)return r;let a=(r.cellStyles??lt(r)).map(e=>e.slice()),o=t.axis===`row`;for(let e=0;e<a.length;e+=1)for(let n=0;n<a[e].length;n+=1)(o?e===t.index:n===t.index)&&(a[e][n]={...a[e][n],...i});return{...r,cellStyles:a}}function ft(e){return e.cells.map(e=>e.map(e=>/[",\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e).join(`,`)).join(`
7
+ `)}function pt(e){let t=Ge(e),n=[];for(let t=0;t<e.cells.length;t+=1)for(let r=0;r<e.cells[t].length;r+=1){let i=ct(e,t,r).background;i&&n.push({key:`bg-${t}-${r}`,rect:qe(e,t,r),fill:i})}let r=[],i=X(e),a=Z(e);for(let n=1;n<i.length-1;n+=1){let a=e.x+i[n];r.push({key:`col-${n}`,x1:a,y1:t.y,x2:a,y2:t.y+t.height})}for(let n=1;n<a.length-1;n+=1){let i=e.y+a[n];r.push({key:`row-${n}`,x1:t.x,y1:i,x2:t.x+t.width,y2:i})}return{frame:t,cellFills:n,dividers:r}}export{je as A,Le as C,De as D,Me as E,A as F,re as I,K as M,ye as N,Y as O,E as P,Re as S,ke as T,dt as _,ct as a,ft as b,ot as c,tt as d,et as f,Z as g,st as h,qe as i,be as j,Ae as k,Q as l,rt as m,it as n,X as o,at as p,nt as r,Ze as s,Ve as t,$e as u,Ge as v,Ne as w,Fe as x,pt as y};
@@ -0,0 +1,7 @@
1
+ import{B as e,F as t,n}from"./shapes-CHDGoELO.js";import{t as r}from"./web-card-font-BbZEq3En.js";var i=`#ffec99`,a=.14;function o(e,t){return(e.fill??``).localeCompare(t.fill??``)||e.y-t.y||e.x-t.x}function s(e,t){return{id:n(),type:`sticky`,x:e.x,y:e.y,width:180,height:180,rotation:0,text:``,fontSize:t.fontSize,fontFamily:t.fontFamily,fill:t.fill===`transparent`?i:t.fill,opacity:t.opacity}}function c(e,t,n){}function l(e){return(e.split(`,`)[0]?.trim()??``).replace(/^['"]|['"]$/g,``)}var u=`JetBrains Mono`,d=e=>`label`in e?e.label??``:``,f=()=>``,p={rectangle:{text:d},arrow:{text:e=>[e.label,e.startLabel,e.endLabel].filter(Boolean).join(` `)},text:{text:e=>e.text},sticky:{text:e=>e.text},draw:{text:f},polygon:{text:f},line:{text:d},image:{text:f},icon:{text:d},figure:{text:e=>[e.label,...e.lanes??[]].filter(Boolean).join(` `)},table:{text:f,cells:!0,cellFaces:e=>{let t=[];for(let n of e.cellStyles??[])if(n)for(let e of n)e?.fontFamily&&t.push(e.fontFamily);return t}},chart:{text:e=>[...e.showTitles?[e.title,e.xTitle,e.yTitle]:[],...e.quadrantLabels??[]].filter(Boolean).join(` `),cells:!0},control:{text:e=>`${e.label??``} ${e.body??``}`},web:{text:(e,t)=>e.poster?``:t?t(e):`${e.label} ${e.kind}`,cardFace:r},custom:{text:e=>e.label}};function m(e){return p[e.type]}function h(e,t){let n=new Set,r=!1,i=!1,a=new Set,o=e=>{for(let t of e)a.add(t.codePointAt(0)??0)};for(let a of e){let e=m(a),s=e.text(a,t),c=!!s||e.cells===!0;if(c&&`fontFamily`in a&&a.fontFamily&&n.add(l(a.fontFamily)),c&&e.cardFace&&n.add(l(e.cardFace)),s.includes(`<code`)&&n.add(u),r||=s.includes(`<strong`),i||=s.includes(`<em`),o(s),`cells`in a&&Array.isArray(a.cells))for(let e of a.cells)for(let t of e)o(String(t));for(let t of e.cellFaces?.(a)??[])n.add(l(t))}return{families:n,bold:r,italic:i,codepoints:a}}var g={woff2:`font/woff2`,woff:`font/woff`,truetype:`font/ttf`,opentype:`font/otf`};function _(e,t){let n=e.format??`woff2`,r=`data:${g[n]};base64,${t(e.data)}`,i=e.unicodeRange?` unicode-range: ${e.unicodeRange};\n`:``;return`@font-face {\n font-family: "${e.family}";\n font-style: ${e.style??`normal`};\n font-weight: ${e.weight??`400`};\n font-display: swap;\n src: url(${r}) format("${n}");\n`+i+`}`}function v(e,t,n){let{families:r,bold:i,italic:a,codepoints:o}=e;return t.filter(e=>r.has(e.family)&&(i||(e.weight??`400`).trim()!==`700`)&&(a||(e.style??`normal`)!==`italic`)&&y(e.unicodeRange??``,o)).map(e=>_(e,n)).join(`
2
+ `)}function y(e,t){if(!e.trim())return!0;for(let n of e.split(`,`)){let e=n.trim().match(/^U\+([0-9a-f?]+)(?:-([0-9a-f]+))?$/i);if(!e)continue;let r=parseInt(e[1].replaceAll(`?`,`0`),16),i=e[2]?parseInt(e[2],16):parseInt(e[1].replaceAll(`?`,`f`),16);for(let e of t)if(e>=r&&e<=i)return!0}return!1}var b=new Set([`/`,`\\`,`.`,`_`,`-`,`:`,`#`,`,`,`?`,`&`,`=`,`@`]),x=2,S=/^[A-Za-z0-9]{1,5}$/,C=e=>e!==e.toUpperCase()&&e===e.toLowerCase(),w=e=>e!==e.toLowerCase()&&e===e.toUpperCase();function T(e){let t=Array.from(e),n=[];for(let e=x;e<=t.length-x;e+=1){let r=t[e-1],i=t[e];if(b.has(r)&&!b.has(i)){(r!==`.`||!S.test(t.slice(e).join(``)))&&n.push(e);continue}let a=C(r)&&w(i),o=w(r)&&w(i)&&C(t[e+1]??``);(a||o)&&n.push(e)}return n}function E(e){let t=Array.from(e),n=[0,...T(e),t.length],r=[];for(let e=0;e<n.length-1;e+=1)r.push(t.slice(n[e],n[e+1]).join(``));return r}function D(e,t,n){let r=[],i=``;for(let a of e){if(i&&n(i+a)>t){r.push(i),i=a;continue}i+=a}return r.push(i),r}function O(e,t,n){if(n(e)<=t)return[e];let r=[],i=``,a=(e,a)=>{let o=i?`${i}${a}${e}`:e;if(n(o)<=t){i=o;return}if(i&&=(r.push(i),``),n(e)<=t){i=e;return}let s=D(e,t,n);r.push(...s.slice(0,-1)),i=s[s.length-1]};for(let r of e.split(` `)){if(n(r)<=t){a(r,` `);continue}E(r).forEach((e,t)=>a(e,t===0?` `:``))}return(i||r.length===0)&&r.push(i),r}function k(n,r,i){return n.split(`
3
+ `).map(n=>n.split(` `).map(n=>t(n,i)<=r?e(n):E(n).map(e).join(`<wbr>`)).join(` `)).join(`
4
+ `)}var A={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`},j=/^<\/?(?:br|p|div|li|ul|ol|h[1-6]|blockquote)\b/i;function M(e){let t=[];for(let n of e.split(/(<[^>]*>)/))if(n){if(n.startsWith(`<`)&&n.endsWith(`>`)){t.push({raw:n,char:j.test(n)?`
5
+ `:``,tag:!0});continue}for(let e of n.matchAll(/&[#\w]+;|[\s\S]/gu)){let n=e[0],r=n.length>1?A[n]??`x`:n;t.push({raw:n,char:r,tag:!1})}}return t}function N(e,n,r){let i=M(e),a=new Set,o=[],s=()=>{let e=o.map(e=>i[e].char).join(``);if(e&&t(e,r)>n&&Array.from(e).length===o.length)for(let t of T(e))a.add(o[t]);o=[]};return i.forEach((e,t)=>{if(!(e.tag&&e.char===``)){if(/\s/.test(e.char)){s();return}o.push(t)}}),s(),i.map((e,t)=>a.has(t)?`<wbr>${e.raw}`:e.raw).join(``)}function P(e,n,r){return e.split(`
6
+ `).map(e=>e.split(` `).map(e=>t(e,r)<=n?e:E(e).join(`​`)).join(` `)).join(`
7
+ `)}export{O as a,y as c,i as d,a as f,P as i,h as l,s as m,k as n,v as o,o as p,N as r,l as s,T as t,c as u};
@@ -1 +1 @@
1
- import{zn as e}from"./slides-D686obFO.js";var t={...e,bg:`#ffffff`},n={bg:`#1c1c1f`,ink:`#e6e6e6`,inkMuted:`#a6a7ae`,inkInverse:`#1e1e1e`,paperBg:`#26262b`,paperGrid:`rgba(255, 255, 255, 0.06)`,paperLine:`rgba(255, 255, 255, 0.13)`};export{t as n,n as t};
1
+ import{et as e}from"./shapes-CHDGoELO.js";var t={...e,bg:`#ffffff`},n={bg:`#1c1c1f`,ink:`#e6e6e6`,inkMuted:`#a6a7ae`,inkInverse:`#1e1e1e`,paperBg:`#26262b`,paperGrid:`rgba(255, 255, 255, 0.06)`,paperLine:`rgba(255, 255, 255, 0.13)`};export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{A as e,C as t,H as n,Pn as r,dn as i,h as a,k as o}from"./shapes-CHDGoELO.js";import{W as s,d as c}from"./geometry-CVRSymIE.js";import{N as l}from"./frames-C-jROub3.js";import{t as u}from"./icons-K7FjuB-c.js";import{n as d}from"./asset-glyph-Dxg-7b67.js";import{r as f}from"./elk-worker-loader-D09QKxa0.js";import{i as p,n as m,r as h}from"./tidy-scope-CQinfwtO.js";import{n as g}from"./shape-meta-CZ0aZy7a.js";import{a as _,c as v,l as y,n as b,o as x,s as S,t as C}from"./layout-offthread-3DtYtT7h.js";import{T as w}from"./builders-hABCgtrj.js";import{t as T}from"./widget-source-C3N9ZKTz.js";var E={none:[!1,!1],start:[!0,!1],end:[!1,!0],both:[!0,!0]},D={top:{x:.5,y:0},bottom:{x:.5,y:1},left:{x:0,y:.5},right:{x:1,y:.5},center:{x:.5,y:.5}},O={top:`top`,right:`right`,bottom:`bottom`,left:`left`};function k(e,t){return!e||!t||`kind`in e||!D[t]?e:{...e,anchor:D[t],precise:!0}}function A(e,t){if(e.type!==`arrow`)return e;let n={...e};t.fromSide&&(n.startBinding=k(n.startBinding,t.fromSide)),t.toSide&&(n.endBinding=k(n.endBinding,t.toSide));let r=t.style??(t.dashed?`dashed`:void 0);r&&(n.dash=r),t.color&&s[t.color]&&(n.color=s[t.color]);let i=t.arrows?E[t.arrows]:t.bidirectional?E.both:void 0;return i&&(n.startArrow=i[0],n.endArrow=i[1]),typeof t.label==`string`&&(n.label=t.label),t.bend===`elbow`?n={...n,bendStyle:`elbow`,bend:0,bendAlong:0,bow:0,elbowPoints:void 0,elbowRoute:void 0,elbowMidHandle:void 0}:t.bend===`curved`&&(n.bendStyle=`curved`),n}function j(e){return i(e,`connectorObstacle`)}function M(e,t){return{id:e,width:t.width,height:t.height,rank:0,x:t.x,y:t.y}}function N(t,n,r,i,a){let c=()=>{let i=A(w(e(t),e(n),t,n),r);return i.strokeWidth=v,i},l=o(t),u=o(n),d=i.filter(e=>e.id!==t.id&&e.id!==n.id&&j(e)).map(e=>o(e));if(!S([e(t),e(n)],d)&&r.bend===`curved`)return c();let f=y({bounds:l,side:r.fromSide?O[r.fromSide]:void 0},{bounds:u,side:r.toSide?O[r.toSide]:void 0},d,void 0,a);if(!f)return c();let p=x({from:M(t.id,l),to:M(n.id,u),fromShapeId:t.id,toShapeId:n.id,routed:{elbow:!0,bend:0,route:f},label:r.label,labelObstacles:d,dashed:r.style===`dashed`||r.dashed,color:r.color&&s[r.color]?s[r.color]:void 0}),m=r.arrows?E[r.arrows]:r.bidirectional?E.both:void 0;return m&&(p.startArrow=m[0],p.endArrow=m[1]),r.style===`dotted`&&(p.dash=`dotted`),p}function P(e,t){return{...e,x:t.x,y:t.y,x2:t.x2,y2:t.y2,bend:t.bend,bendAlong:t.bendAlong,bendStyle:t.bendStyle,elbowPoints:t.elbowPoints,elbowRoute:void 0,elbowMidHandle:void 0,labelAlong:t.labelAlong,startBinding:t.startBinding,endBinding:t.endBinding}}var F=(()=>{let e={};for(let[t,n]of Object.entries(_))n&&!(n in e)&&(e[n]=t);return e})();function I(e){let t=g(e);if(e.type===`icon`){let n=e.source===`lucide`?e.name:`${e.source}:${e.name}`;return{id:e.id,label:t,icon:n}}return e.type===`sticky`?{id:e.id,label:t,shape:`sticky`}:e.type===`rectangle`?{id:e.id,label:t,shape:F[e.kind]}:{id:e.id,label:t}}var L=28,R=44;function z(e,t,n,r,i){if(p(e)&&`width`in e)return{...e,x:t,y:n,width:r,height:i};let s=o(e);return a(e,{x:t-s.x,y:n-s.y})}function B(e,t){let n=new Map(t.map(e=>[e.id,e])),r=e.startBinding&&!(`kind`in e.startBinding)?n.get(e.startBinding.shapeId):void 0,i=e.endBinding&&!(`kind`in e.endBinding)?n.get(e.endBinding.shapeId):void 0;return!r||!i||r.id===i.id?e:P(e,N(r,i,{},t))}async function V(i,s,u,d){let f=new Set;if(Array.isArray(i.ids)&&i.ids.forEach(e=>f.add(e)),i.selection&&u.forEach(e=>f.add(e)),f.size===0)return[];let _=m(s,f),v=s.filter(e=>_.has(e.id)),y=v.filter(p);if(y.length<2)return[];let b=new Set(y.map(e=>e.id)),x=v.filter(e=>e.type===`arrow`&&!!e.startBinding&&!(`kind`in e.startBinding)&&!!e.endBinding&&!(`kind`in e.endBinding)&&b.has(e.startBinding.shapeId)&&b.has(e.endBinding.shapeId)&&e.startBinding.shapeId!==e.endBinding.shapeId),S=t(y);if(!S)return[];let C=v.filter(e=>r(e)),w=(t,n)=>c(e(n),o(t)),T=C.filter(e=>!y.every(t=>w(e,t))),E=e=>h(T,e)?.id,D=new Set,O=y.map(e=>{let t=I(e),n=E(e);return n?(D.add(n),{...t,group:n}):t}),k={kind:`graph`,title:``,direction:i.direction??(S.height>S.width*1.3?`down`:`right`),nodes:O,groups:C.filter(e=>D.has(e.id)).map(e=>({id:e.id,label:g(e)})),edges:x.map(e=>({from:e.startBinding.shapeId,to:e.endBinding.shapeId,label:e.label,dashed:e.dash===`dashed`}))},A=await d.layoutGraph(k),j=A.filter(p);if(j.length!==y.length)return[];let M=t(j);if(!M)return[];let N=S.x-M.x,F=S.y-M.y,V=new Map,H=new Map;y.forEach((e,t)=>{let n=o(j[t]);H.set(j[t].id,e.id),V.set(e.id,z(e,n.x+N,n.y+F,n.width,n.height))});let U=A.filter(e=>e.type===`arrow`),W=e=>{if(!e||`kind`in e)return e;let t=H.get(e.shapeId);return t?{...e,shapeId:t}:e},G;G=U.length===x.length?x.map((e,t)=>{let r=a(U[t],{x:N,y:F}),i=P(e,r);return i.startBinding=W(i.startBinding),i.endBinding=W(i.endBinding),r.label&&e.label&&!n(e.label)&&(i.label=r.label),i}):[];let K=[],q=new Map(V);G.forEach(e=>q.set(e.id,e));let J=C.filter(e=>D.has(e.id)),Y=A.filter(e=>r(e));Y.length===J.length&&J.forEach((e,t)=>{let n=o(Y[t]),r={...e,x:n.x+N,y:n.y+F,width:n.width,height:n.height};K.push(r),q.set(e.id,r)});let X=new Set(K.map(e=>e.id));for(let e of C){if(X.has(e.id))continue;let n=t(l(s,e).map(e=>q.get(e.id)).filter(e=>e!==void 0));if(n){let t={...e,x:n.x-L,y:n.y-R,width:n.width+L*2,height:n.height+L+R};K.push(t),q.set(e.id,t)}}if(G.length===0&&x.length>0){let e=s.map(e=>q.get(e.id)??e);G=x.map(t=>B(t,e))}return[...V.values(),...K,...G]}var H=f(),U={resolveIcon:e=>u().resolveIcon(e),glyphAspect:d,layoutDiagram:(e,t)=>C(e,t),layoutGraph:b,measureText:typeof document>`u`?void 0:(e,t,n,r)=>H.measure(e,t,n,r),loadWidgetHtml:T};function W(e,t,n){return V(e,t,n,U)}export{W as tidyInBrowser};
@@ -0,0 +1 @@
1
+ import{A as e,Pn as t,dn as n,k as r}from"./shapes-CHDGoELO.js";import{d as i}from"./geometry-CVRSymIE.js";import{N as a}from"./frames-C-jROub3.js";function o(e){return n(e,`graphNode`)}function s(t,n){let a=e(n),o;for(let e of t){let t=r(e);i(a,t)&&(!o||t.width*t.height<o.width*o.height)&&(o=e)}return o}function c(e,n){let r=new Set(n),i=e.filter(e=>t(e)&&(e.kind??`simple`)===`simple`&&e.slideOrder===void 0);for(let n=0;n<4;n+=1){let n=r.size;for(let n of e)r.has(n.id)&&t(n)&&a(e,n).forEach(e=>r.add(e.id));for(let t of e){if(!r.has(t.id)||!o(t))continue;let e=s(i,t);e&&r.add(e.id)}if(r.size===n)break}return r}function l(e,t){if(t.size===0)return!1;let n=c(e,t),r=0;for(let t of e)if(n.has(t.id)&&o(t)&&(r+=1,r>=2))return!0;return!1}export{o as i,c as n,s as r,l as t};
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./geometry-CVRSymIE.js";import{a as t,c as n,i as r,n as i,o as a,r as o,s,t as c}from"./shared-DKcKntwk.js";function l(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.tldrawFileFormatVersion!=null&&Array.isArray(t.records)}var u={black:`#1d1d1d`,grey:`#9fa8b2`,"light-violet":`#e085f4`,violet:`#ae3ec9`,blue:`#4263eb`,"light-blue":`#4dabf7`,yellow:`#f1ac4b`,orange:`#e16919`,green:`#099268`,"light-green":`#4cb05e`,"light-red":`#f87777`,red:`#e03131`,white:`#ffffff`},d={black:`#e9ecef`,grey:`#e9ecef`,"light-violet":`#eebefa`,violet:`#eebefa`,blue:`#a5d8ff`,"light-blue":`#a5d8ff`,yellow:`#ffec99`,orange:`#ffd8a8`,green:`#b2f2bb`,"light-green":`#b2f2bb`,"light-red":`#fcc2d7`,red:`#ffc9c9`,white:`#ffffff`},f={s:2,m:3.5,l:5,xl:10},p={s:18,m:24,l:36,xl:44};function m(e){return u[n(e.color)]??`#1e1e1e`}function h(e){let t=n(e.font);return t===`sans`||t===`serif`?o:t===`mono`?c:i}function g(e){return f[n(e.size)]??3.5}function _(e){return(p[n(e.size)]??24)*s(e.scale,1)}function v(e){let t=n(e.dash);return t===`dashed`?`dashed`:t===`dotted`?`dotted`:`solid`}function y(e){let t=n(e.fill,`none`);return t===`none`?{fill:`transparent`,fillStyle:`pastel`}:{fill:d[n(e.color)]??`#e9ecef`,fillStyle:t===`fill`?`bold`:`pastel`}}var b=new Set([`rectangle`]),x={rectangle:`rectangle`,ellipse:`ellipse`,oval:`oval`,diamond:`diamond`,triangle:`triangle`,trapezoid:`trapezoid`,hexagon:`hexagon`,pentagon:`hexagon`,octagon:`hexagon`,star:`star`,rhombus:`parallelogram`,"rhombus-2":`parallelogram`,cloud:`cloud`,"arrow-up":`arrow-up`,"arrow-down":`arrow-down`,"arrow-left":`arrow-left`,"arrow-right":`arrow-right`,"check-box":`checkbox`,"x-box":`crossbox`,heart:`heart`},S={arrow:`arrow`,triangle:`triangle`,inverted:`triangle`,square:`bar`,bar:`bar`,pipe:`bar`,cross:`bar`,dot:`circle`,diamond:`diamond`};function C(e){if(typeof e.text==`string`)return e.text;let t=e.richText;return!t||!Array.isArray(t.content)?``:t.content.map(w).join(`
2
+ `)}function w(e){return typeof e.text==`string`?e.text:Array.isArray(e.content)?e.content.map(w).join(``):``}function T(e){let t=e.points,r=[];return Array.isArray(t)?r=t:t&&typeof t==`object`&&(r=Object.values(t),r.sort((e,t)=>n(e.index).localeCompare(n(t.index)))),r.map(e=>({x:s(e.x),y:s(e.y)}))}function E(e,t,r){let i=(e.props??{})[t]??{},a=r.find(n=>n.fromId===e.id&&n.props?.terminal===t);if(a){let e=a.props?.normalizedAnchor;return{point:{x:s(i.x),y:s(i.y)},binding:{shapeId:n(a.toId),anchor:{x:s(e?.x,.5),y:s(e?.y,.5)},precise:a.props?.isPrecise===!0}}}if(i.type===`binding`&&typeof i.boundShapeId==`string`){let e=i.normalizedAnchor;return{point:{x:0,y:0},binding:{shapeId:i.boundShapeId,anchor:{x:s(e?.x,.5),y:s(e?.y,.5)},precise:i.isPrecise===!0}}}return{point:{x:s(i.x),y:s(i.y)},binding:null}}function D(i){let o=i.records,c=o.filter(e=>e?.typeName===`shape`),l=new Map(c.map(e=>[e.id,e])),u=new Map(o.filter(e=>e?.typeName===`asset`).map(e=>[e.id,e])),f=o.filter(e=>e?.typeName===`binding`&&e.type===`arrow`),p=o.filter(e=>e?.typeName===`page`).sort((e,t)=>n(e.index).localeCompare(n(t.index)))[0]?.id;function w(e){let t=e;for(let e=0;e<100;e+=1){let e=n(t.parentId);if(!e.startsWith(`shape:`))return p==null||e===p;let r=l.get(e);if(!r)return!1;t=r}return!1}function D(e){let t=s(e.x),r=s(e.y),i=n(e.parentId);for(let e=0;e<100&&i.startsWith(`shape:`);e+=1){let e=l.get(i);if(!e)break;t+=s(e.x),r+=s(e.y),i=n(e.parentId)}return{x:t,y:r}}function O(e){let t=n(e.parentId);for(let e=0;e<100&&t.startsWith(`shape:`);e+=1){let e=l.get(t);if(!e)return;if(e.type===`group`)return n(e.id);t=n(e.parentId)}}let k=new Map;for(let e of c){let t=n(e.parentId),r=k.get(t)??[];r.push(e),k.set(t,r)}for(let e of k.values())e.sort((e,t)=>n(e.index).localeCompare(n(t.index)));let A=[];function j(e){for(let t of k.get(e)??[])A.push(t),j(n(t.id))}p==null?A.push(...c):j(p);let M=[],N=new Set,P=0;for(let t of A){if(!w(t))continue;let i=t.props??{},o=D(t),c={id:n(t.id)||crypto.randomUUID(),groupId:O(t),locked:t.isLocked===!0||void 0,opacity:e(s(t.opacity,1))};if(t.type===`geo`){M.push({...c,type:`rectangle`,kind:x[n(i.geo)]??`rectangle`,corner:b.has(n(i.geo))?`sharp`:void 0,x:o.x,y:o.y,width:s(i.w),height:s(i.h),rotation:r(t.rotation),label:C(i),fontSize:_(i),fontFamily:h(i),color:m(i),...y(i),strokeWidth:g(i),dash:v(i)}),N.add(c.id);continue}if(t.type===`note`){let e=s(i.scale,1);M.push({...c,type:`rectangle`,kind:`note`,x:o.x,y:o.y,width:200*e,height:(200+s(i.growY))*e,rotation:r(t.rotation),label:C(i),fontSize:_(i),fontFamily:h(i),color:m(i),fill:n(i.color)===`black`||!d[n(i.color)]?`#ffec99`:d[n(i.color)],fillStyle:`pastel`,strokeWidth:2,dash:`solid`}),N.add(c.id);continue}if(t.type===`text`){M.push({...c,type:`text`,x:o.x,y:o.y,text:C(i),fontSize:_(i),fontFamily:h(i),width:i.autoSize===!1?s(i.w):void 0,rotation:r(t.rotation),color:m(i)});continue}if(t.type===`draw`||t.type===`highlight`){let n=Array.isArray(i.segments)?i.segments:[],r=[],a=[];for(let t of n)for(let n of Array.isArray(t?.points)?t.points:[])r.push({x:o.x+s(n.x),y:o.y+s(n.y)}),a.push(e(typeof n.z==`number`&&Number.isFinite(n.z)?n.z:.5));if(r.length<2)continue;let l=t.type===`highlight`;M.push({...c,type:`draw`,points:r,color:m(i),strokeWidth:g(i),...l?{highlighter:!0}:{},...!l&&i.isPen===!0?{pressure:a}:{},opacity:l?c.opacity*.4:c.opacity});continue}if(t.type===`line`){let e=T(i).map(e=>({x:o.x+e.x,y:o.y+e.y}));if(e.length<2)continue;M.push({...c,type:`line`,points:e,color:m(i),strokeWidth:g(i),dash:v(i),startArrow:!1,endArrow:!1});continue}if(t.type===`arrow`){let e=E(t,`start`,f),r=E(t,`end`,f),a=S[n(i.arrowheadStart)],l=S[n(i.arrowheadEnd,`arrow`)],u=C(i);M.push({...c,type:`arrow`,x:o.x+e.point.x,y:o.y+e.point.y,x2:o.x+r.point.x,y2:o.y+r.point.y,bend:-s(i.bend)||0,bendAlong:0,bow:-s(i.bend)||void 0,bendStyle:n(i.kind)===`elbow`?`elbow`:`curved`,startBinding:e.binding,endBinding:r.binding,label:u||void 0,fontSize:u?_(i):void 0,fontFamily:u?h(i):void 0,color:m(i),strokeWidth:g(i),dash:v(i),startArrow:a!=null&&n(i.arrowheadStart)!==`none`,endArrow:n(i.arrowheadEnd,`arrow`)!==`none`,startHead:a,endHead:l??`arrow`});continue}if(t.type===`frame`){M.push(a(c,{x:o.x,y:o.y,width:s(i.w),height:s(i.h)},i.name)),N.add(c.id);continue}if(t.type===`image`){let e=n(u.get(n(i.assetId))?.props?.src);if(!e){P+=1;continue}let a=i.crop;M.push({...c,type:`image`,x:o.x,y:o.y,width:s(i.w),height:s(i.h),rotation:r(t.rotation),src:e,crop:a?.topLeft&&a?.bottomRight?{x:s(a.topLeft.x),y:s(a.topLeft.y),width:s(a.bottomRight.x,1)-s(a.topLeft.x),height:s(a.bottomRight.y,1)-s(a.topLeft.y)}:{x:0,y:0,width:1,height:1}});continue}t.type!==`group`&&(P+=1)}return t(M,N),{shapes:M,skipped:P}}export{D as importTldraw,l as isTldrawData};