koboyo 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/README.md +6 -1
  2. package/assets/editor/assets/DialogDescription-Ddhk2rmF.js +1 -0
  3. package/assets/editor/assets/DialogRoot-DUeVfNhS.js +1 -0
  4. package/assets/editor/assets/DialogTitle-D5au2NAn.js +1 -0
  5. package/assets/editor/assets/FloatingPortalLite-HnWQWrLk.js +1 -0
  6. package/assets/editor/assets/{IconAlertTriangle-CxPhYpe-.js → IconAlertTriangle-B33xznYN.js} +1 -1
  7. package/assets/editor/assets/{IconArrowLeft-DFk3Krim.js → IconArrowLeft-B4Zcy-Fc.js} +1 -1
  8. package/assets/editor/assets/IconChevronLeft-D7e7QC0h.js +1 -0
  9. package/assets/editor/assets/IconChevronRight-csfMBSUs.js +1 -0
  10. package/assets/editor/assets/{IconCode-hd05zxU4.js → IconCode-CHIz1nCU.js} +1 -1
  11. package/assets/editor/assets/IconCornerDownRight-DDiBMO4O.js +1 -0
  12. package/assets/editor/assets/{IconEraser-DlZQe3-r.js → IconEraser-CYfXj27R.js} +1 -1
  13. package/assets/editor/assets/{IconFocusCentered-C5PcDeR0.js → IconFocusCentered-Cn8rbfRI.js} +1 -1
  14. package/assets/editor/assets/IconHelp-CaEwHrsN.js +2 -0
  15. package/assets/editor/assets/IconLink-VS5p9Ytk.js +1 -0
  16. package/assets/editor/assets/IconLoader2-CzCTn-Sn.js +1 -0
  17. package/assets/editor/assets/IconMinus-BcaDLts8.js +1 -0
  18. package/assets/editor/assets/{IconMoodSmile-Bic_fw54.js → IconMoodSmile-CSZ5p_Hy.js} +1 -1
  19. package/assets/editor/assets/{IconPencil-C5Y-Y4dC.js → IconPencil-D_pQsAyv.js} +1 -1
  20. package/assets/editor/assets/{IconPhoto-CR36IK-b.js → IconPhoto-5zuCDtnR.js} +1 -1
  21. package/assets/editor/assets/{IconPlayerPlayFilled-D4OODBX7.js → IconPlayerPlayFilled-DVAWmYt7.js} +1 -1
  22. package/assets/editor/assets/{IconPlayerStopFilled-BUbX6ZO5.js → IconPlayerStopFilled-D4qdct2R.js} +1 -1
  23. package/assets/editor/assets/IconPlus-D4tAoi-A.js +1 -0
  24. package/assets/editor/assets/{IconPresentation-DCrY3PKL.js → IconPresentation-BMKzt7fv.js} +1 -1
  25. package/assets/editor/assets/{IconSearch-C1K0_Pq_.js → IconSearch-CCpMt02s.js} +1 -1
  26. package/assets/editor/assets/{IconSparkles-WDcg8BA9.js → IconSparkles-CnCp3BCQ.js} +1 -1
  27. package/assets/editor/assets/{IconTrash-DbN_RxB7.js → IconTrash-C8w6ThWx.js} +1 -1
  28. package/assets/editor/assets/{IconUsers-Bwnyj4mm.js → IconUsers-Dp85N225.js} +1 -1
  29. package/assets/editor/assets/IconX-KrRqxr2j.js +1 -0
  30. package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +1 -0
  31. package/assets/editor/assets/PopoverPopup-B3Y0VRYc.js +1 -0
  32. package/assets/editor/assets/{asset-glyph-B3c--Mx2.js → asset-glyph-C1E6cGwM.js} +1 -1
  33. package/assets/editor/assets/billing-BSXr-z2r.js +1 -0
  34. package/assets/editor/assets/build-pips-BV-uwXlP.js +1 -0
  35. package/assets/editor/assets/build-visibility-DyML9SHt.js +1 -0
  36. package/assets/editor/assets/builders-DMHAOPEv.js +1 -0
  37. package/assets/editor/assets/{chart-Z4HQx-0h.js → chart-4iRduYdU.js} +4 -4
  38. package/assets/editor/assets/{chrome-layout-B8YmHznO.js → chrome-layout-BzPU9far.js} +1 -1
  39. package/assets/editor/assets/{code-panel-BfsykjSz.js → code-panel-koBUgEWp.js} +7 -7
  40. package/assets/editor/assets/command-palette-BR-_ChOL.js +1 -0
  41. package/assets/editor/assets/config-D8b1QyEk.js +1 -0
  42. package/assets/editor/assets/connector-labels-CrEgadsC.js +2 -0
  43. package/assets/editor/assets/copy-image-dialog-BzGP7Xw8.js +1 -0
  44. package/assets/editor/assets/{core-CBnmD9hT.js → core-CmsJyU_-.js} +1 -1
  45. package/assets/editor/assets/createReactComponent-C51FAx3B.js +1 -0
  46. package/assets/editor/assets/{diagram-fingerprint-CsqZK4xZ.js → diagram-fingerprint-WGQ5iVXx.js} +1 -1
  47. package/assets/editor/assets/dialog-DnXgEbpz.js +1 -0
  48. package/assets/editor/assets/{edit-BJ_kibk8.js → edit-C0sBxxsg.js} +1 -1
  49. package/assets/editor/assets/editor-BeufBV54.js +1 -0
  50. package/assets/editor/assets/{elk-api-DnfklSaw.js → elk-api-C4wlHVIw.js} +1 -1
  51. package/assets/editor/assets/{elk-worker-loader-CC-I9MmI.js → elk-worker-loader-CVBdN1je.js} +1 -1
  52. package/assets/editor/assets/{export-ChP0k5F5.js → export-Bce6ra0N.js} +1 -1
  53. package/assets/editor/assets/export-K2VWg76n.js +6 -0
  54. package/assets/editor/assets/export-dialog-x2n2a4KX.js +1 -0
  55. package/assets/editor/assets/flow-layer-ewaL7g2y.js +1 -0
  56. package/assets/editor/assets/flow-panel-BzXNGGke.js +1 -0
  57. package/assets/editor/assets/flow-stage-Ba_CAggI.js +1 -0
  58. package/assets/editor/assets/flow-start-CpAvU-9P.js +1 -0
  59. package/assets/editor/assets/{flows-GGbkNqs8.js → flows-Cj7AFMIA.js} +2 -2
  60. package/assets/editor/assets/frames-Cp1QD3LR.js +1 -0
  61. package/assets/editor/assets/icon-picker-Cg39IKNJ.js +1 -0
  62. package/assets/editor/assets/image-library-JQu_tb8P.js +1 -0
  63. package/assets/editor/assets/index-CBPPqsiR.js +24 -0
  64. package/assets/editor/assets/{index-CC2h28V_.css → index-DBrN0u0i.css} +1 -1
  65. package/assets/editor/assets/jsx-runtime-DKdBMi_L.js +1 -0
  66. package/assets/editor/assets/layout-offthread-mRHRulkS.js +18 -0
  67. package/assets/editor/assets/{layout.worker-BIE1_z0S.js → layout.worker-CekYkaxO.js} +2 -2
  68. package/assets/editor/assets/menu-B9BAk63v.js +1 -0
  69. package/assets/editor/assets/panel-controls-DWVXiNUZ.js +1 -0
  70. package/assets/editor/assets/{panel-shell-CG2aq4Ia.js → panel-shell-BnMOHgWM.js} +1 -1
  71. package/assets/editor/assets/{plan-jQm1jDpt.js → plan-CkgM52Yh.js} +1 -1
  72. package/assets/editor/assets/presentation-DJUO0t7I.js +1 -0
  73. package/assets/editor/assets/presenter-keys-Bs3LnmOa.js +1 -0
  74. package/assets/editor/assets/{jsx-runtime-2Zwg-L3c.js → react-lCSYwAWP.js} +1 -1
  75. package/assets/editor/assets/reflow-DaYiVkwp.js +1 -0
  76. package/assets/editor/assets/registry-rEGZW7Ab.js +1 -0
  77. package/assets/editor/assets/renderer-environment-D3n3hbug.js +1 -0
  78. package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +1 -0
  79. package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +1 -0
  80. package/assets/editor/assets/shape-meta-COE2ATNh.js +1 -0
  81. package/assets/editor/assets/sign-in-dialog-tmQEB2bx.js +1 -0
  82. package/assets/editor/assets/slide-notes-dialog-BQBXpep6.js +1 -0
  83. package/assets/editor/assets/slides-D686obFO.js +15 -0
  84. package/assets/editor/assets/slides-panel-BEJCevJi.js +26 -0
  85. package/assets/editor/assets/text-breaks-DM4W6y5f.js +7 -0
  86. package/assets/editor/assets/{theme-palette-D1nbDFBC.js → theme-palette-Dl_G_VIJ.js} +1 -1
  87. package/assets/editor/assets/tidy-browser-dF3BON7J.js +1 -0
  88. package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +1 -0
  89. package/assets/editor/assets/toast-Czv_DJ-4.js +1 -0
  90. package/assets/editor/assets/tool-catalog-DXPhX2S1.js +1 -0
  91. package/assets/editor/assets/tool-drawer-CWOX_njp.js +1 -0
  92. package/assets/editor/assets/tooltip-CyBz17g8.js +1 -0
  93. package/assets/editor/assets/tree-KSgPjntC.js +1 -0
  94. package/assets/editor/assets/upgrade-dialog-DhSZnDpx.js +1 -0
  95. package/assets/editor/assets/use-drag-reorder-ye8-kpyR.js +1 -0
  96. package/assets/editor/assets/use-export-command-sC9UHj3_.js +2 -0
  97. package/assets/editor/assets/use-grid-keyboard-nav-DhQKecO1.js +0 -0
  98. package/assets/editor/assets/use-icon-node-BxqH7H27.js +1 -0
  99. package/assets/editor/assets/use-key-held-094C3Mn3.js +1 -0
  100. package/assets/editor/assets/use-recent-list-DuazDypH.js +1 -0
  101. package/assets/editor/assets/useAnchoredPopupScrollLock-i8D5Dm1d.js +1 -0
  102. package/assets/editor/assets/useBaseUiId-D2RfU0uY.js +1 -0
  103. package/assets/editor/assets/useButton-CLQYGhRJ.js +1 -0
  104. package/assets/editor/assets/useControlled-BE8zdmih.js +1 -0
  105. package/assets/editor/assets/usePositioner-AtbrPc7w.js +1 -0
  106. package/assets/editor/assets/useScrollLock-CQpr0n6U.js +1 -0
  107. package/assets/editor/assets/useValueChanged-SqLfIDi5.js +1 -0
  108. package/assets/editor/assets/web-controls-CLE9zr7i.js +1 -0
  109. package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +1 -0
  110. package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +1 -0
  111. package/assets/editor/assets/web-shape-C941TGTy.js +1 -0
  112. package/assets/editor/assets/widget-source-CHujvUeA.js +1 -0
  113. package/assets/editor/index.html +73 -69
  114. package/dist/koboyo.js +258 -214
  115. package/package.json +5 -5
  116. package/skills/koboyo/SKILL.md +22 -2
  117. package/skills/koboyo/references/architecture.md +1 -1
  118. package/skills/koboyo/references/bpmn.md +1 -1
  119. package/skills/koboyo/references/chart.md +1 -1
  120. package/skills/koboyo/references/cycle.md +1 -1
  121. package/skills/koboyo/references/erd.md +1 -1
  122. package/skills/koboyo/references/flowchart.md +1 -1
  123. package/skills/koboyo/references/funnel.md +1 -1
  124. package/skills/koboyo/references/gantt.md +1 -1
  125. package/skills/koboyo/references/gitgraph.md +1 -1
  126. package/skills/koboyo/references/journey.md +1 -1
  127. package/skills/koboyo/references/matrix.md +1 -1
  128. package/skills/koboyo/references/mindmap.md +1 -1
  129. package/skills/koboyo/references/orgchart.md +1 -1
  130. package/skills/koboyo/references/pyramid.md +1 -1
  131. package/skills/koboyo/references/sankey.md +1 -1
  132. package/skills/koboyo/references/sequence.md +1 -1
  133. package/skills/koboyo/references/statemachine.md +1 -1
  134. package/skills/koboyo/references/timeline.md +1 -1
  135. package/skills/koboyo/references/venn.md +1 -1
  136. package/skills/koboyo/references/wireframe.md +1 -1
  137. package/assets/editor/assets/DialogDescription-ZtZCUsfy.js +0 -1
  138. package/assets/editor/assets/DialogRoot-mHGRFW9m.js +0 -1
  139. package/assets/editor/assets/DialogTitle-CFhr-gP9.js +0 -1
  140. package/assets/editor/assets/FloatingPortalLite-Bf0q6fmL.js +0 -1
  141. package/assets/editor/assets/IconArrowBackUp-Brd2WpCh.js +0 -1
  142. package/assets/editor/assets/IconChevronLeft-BR0iwdRI.js +0 -1
  143. package/assets/editor/assets/IconChevronRight-DBDnxPYT.js +0 -1
  144. package/assets/editor/assets/IconHelp-DKNacRqS.js +0 -2
  145. package/assets/editor/assets/IconLoader2-BQaF1LKo.js +0 -1
  146. package/assets/editor/assets/IconMinus-y4ejub-s.js +0 -1
  147. package/assets/editor/assets/IconNote-CSELvWzx.js +0 -1
  148. package/assets/editor/assets/IconPlus-BbmieIBT.js +0 -1
  149. package/assets/editor/assets/IconX-AlbPkO_g.js +0 -1
  150. package/assets/editor/assets/MenuSubmenuTrigger-CpN67g09.js +0 -1
  151. package/assets/editor/assets/PopoverPopup-BqGWd_uB.js +0 -1
  152. package/assets/editor/assets/billing-C-BNGM3Z.js +0 -1
  153. package/assets/editor/assets/build-pips-CIaHaEPB.js +0 -1
  154. package/assets/editor/assets/build-visibility-E1mHeDCW.js +0 -1
  155. package/assets/editor/assets/builders-DbF28yId.js +0 -1
  156. package/assets/editor/assets/command-palette-BjFnQHnz.js +0 -1
  157. package/assets/editor/assets/config-a_lz-57R.js +0 -1
  158. package/assets/editor/assets/connector-labels-vVnYQJRz.js +0 -2
  159. package/assets/editor/assets/copy-image-dialog-CCY_6fM4.js +0 -1
  160. package/assets/editor/assets/createReactComponent-9UsI5fmM.js +0 -1
  161. package/assets/editor/assets/dialog-B32krrce.js +0 -1
  162. package/assets/editor/assets/editor-B0tARd79.js +0 -1
  163. package/assets/editor/assets/export-DEFKKRRi.js +0 -6
  164. package/assets/editor/assets/export-dialog-DPg1uzX5.js +0 -1
  165. package/assets/editor/assets/flow-layer-BC35drcK.js +0 -1
  166. package/assets/editor/assets/flow-panel-D_K9wgZi.js +0 -1
  167. package/assets/editor/assets/flow-stage-fiF5Nggn.js +0 -1
  168. package/assets/editor/assets/flow-start-ccYJ2KB9.js +0 -1
  169. package/assets/editor/assets/frames-CRP8oPP8.js +0 -1
  170. package/assets/editor/assets/icon-picker-NboB5Fvv.js +0 -1
  171. package/assets/editor/assets/image-library-Bb6bV6eK.js +0 -1
  172. package/assets/editor/assets/index-DfNbwHl_.js +0 -24
  173. package/assets/editor/assets/layout-offthread-BwetpTFH.js +0 -18
  174. package/assets/editor/assets/menu-BPrc8Ara.js +0 -1
  175. package/assets/editor/assets/panel-controls-DYZ7QFT5.js +0 -1
  176. package/assets/editor/assets/presentation-BavfNtxp.js +0 -1
  177. package/assets/editor/assets/presenter-keys-DVQcBdy1.js +0 -1
  178. package/assets/editor/assets/reflow-Cv75wPSh.js +0 -1
  179. package/assets/editor/assets/registry-DCgwH8wI.js +0 -1
  180. package/assets/editor/assets/renderer-environment-DmWXvuT4.js +0 -1
  181. package/assets/editor/assets/ride-overlay-DhygYdx1.js +0 -1
  182. package/assets/editor/assets/selection-overlay-primitives-hWJ1xjF7.js +0 -1
  183. package/assets/editor/assets/shape-meta-BpwsiB82.js +0 -1
  184. package/assets/editor/assets/sign-in-dialog-DRooo5xw.js +0 -1
  185. package/assets/editor/assets/slide-notes-dialog-DLdTmd7_.js +0 -1
  186. package/assets/editor/assets/slides-D9bnXqtf.js +0 -15
  187. package/assets/editor/assets/slides-panel-DV-zQJhV.js +0 -26
  188. package/assets/editor/assets/text-breaks-YU-ymaF9.js +0 -7
  189. package/assets/editor/assets/tidy-browser-BwodBnAH.js +0 -1
  190. package/assets/editor/assets/tidy-scope-BgBSUklT.js +0 -1
  191. package/assets/editor/assets/toast-Nu_fiCd9.js +0 -1
  192. package/assets/editor/assets/tool-catalog-ChSwaLIq.js +0 -1
  193. package/assets/editor/assets/tool-drawer-CG7-cnML.js +0 -1
  194. package/assets/editor/assets/tooltip-DgEojto1.js +0 -1
  195. package/assets/editor/assets/tree-rq4RTGgw.js +0 -1
  196. package/assets/editor/assets/upgrade-dialog-DpZeaLDB.js +0 -1
  197. package/assets/editor/assets/use-drag-reorder-C3h4ZMoZ.js +0 -1
  198. package/assets/editor/assets/use-export-command-CPc7qug1.js +0 -2
  199. package/assets/editor/assets/use-grid-keyboard-nav-B88Qw-cQ.js +0 -0
  200. package/assets/editor/assets/use-icon-node-DJZFjABX.js +0 -1
  201. package/assets/editor/assets/use-recent-list-BEG0iBIm.js +0 -1
  202. package/assets/editor/assets/useAnchoredPopupScrollLock-BGKchwpi.js +0 -1
  203. package/assets/editor/assets/useBaseUiId-C0Zm5sUV.js +0 -1
  204. package/assets/editor/assets/useButton-D3eS7fh5.js +0 -1
  205. package/assets/editor/assets/useControlled-C5xhvPXX.js +0 -1
  206. package/assets/editor/assets/usePositioner-DA3aR0-T.js +0 -1
  207. package/assets/editor/assets/useScrollLock-B7mQdXyv.js +0 -1
  208. package/assets/editor/assets/useValueChanged-p8z-93L4.js +0 -1
@@ -0,0 +1,15 @@
1
+ import{B as e,F as t,G as n,H as r,J as i,M as a,P as o,V as s,W as c,X as l,Z as u,a as d,et as f,nt as p,q as m,r as h,rt as g,s as _,st as v,tt as y}from"./style-BENGW2ZV.js";var ee=2048,b=`strict-origin-when-cross-origin`,x=`allow-scripts allow-same-origin allow-popups allow-presentation`,S=`${x} allow-forms`,C=`allow-scripts allow-same-origin allow-popups`,w=`fullscreen; picture-in-picture; encrypted-media; clipboard-write; autoplay`,T=`fullscreen`,E=[`koboyo.com`,`koboyousercontent.com`];function D(e){if(e.length>2048)return null;let t;try{t=new URL(e)}catch{return null}return t.protocol!==`https:`||t.username!==``||t.password!==``?null:t}function te(e){return e.hostname.toLowerCase().replace(/\.$/,``)}function ne(e){return E.some(t=>e===t||e.endsWith(`.${t}`))}function O(e){return e.pathname.split(`/`).filter(e=>e!==``)}var k=new Set([`youtube.com`,`www.youtube.com`,`m.youtube.com`,`music.youtube.com`,`youtube-nocookie.com`,`www.youtube-nocookie.com`]),re=/^[A-Za-z0-9_-]{11}$/;function ie(e){let t=e.searchParams.get(`t`)??e.searchParams.get(`start`)??``;if(/^\d+s?$/.test(t))return Number.parseInt(t,10);let n=/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/.exec(t);if(!n||t===``)return 0;let[,r=`0`,i=`0`,a=`0`]=n;return Number(r)*3600+Number(i)*60+Number(a)}function ae(e,t){let n=O(e),r=null,i=!1;if(t===`youtu.be`?r=n[0]??null:k.has(t)&&(n[0]===`watch`?r=e.searchParams.get(`v`):n[0]===`embed`||n[0]===`live`||n[0]===`v`?r=n[1]??null:n[0]===`shorts`&&(r=n[1]??null,i=!0)),!r||!re.test(r))return null;let a=ie(e);return{provider:`youtube`,label:`YouTube video`,src:`https://www.youtube-nocookie.com/embed/${r}${a>0?`?start=${a}`:``}`,width:i?315:560,height:i?560:315,keepAspect:!0,video:!0,thumbnail:`https://i.ytimg.com/vi/${r}/hqdefault.jpg`}}function oe(e,t){let n=O(e),r,i=null;if(t===`vimeo.com`||t===`www.vimeo.com`?(r=n[0],i=n[1]??null):t===`player.vimeo.com`&&n[0]===`video`&&(r=n[1],i=e.searchParams.get(`h`)),!r||!/^\d+$/.test(r))return null;let a=i&&/^[0-9a-f]+$/i.test(i)?`?h=${i}`:``;return{provider:`vimeo`,label:`Vimeo video`,src:`https://player.vimeo.com/video/${r}${a}`,width:640,height:360,keepAspect:!0,video:!0}}function se(e,t){if(t!==`loom.com`&&t!==`www.loom.com`)return null;let[n,r]=O(e);return n!==`share`&&n!==`embed`||!r||!/^[A-Za-z0-9]+$/.test(r)?null:{provider:`loom`,label:`Loom video`,src:`https://www.loom.com/embed/${r}`,width:640,height:360,keepAspect:!0,video:!0}}var ce=new Set([`file`,`design`,`proto`,`board`]);function le(e,t){if(t!==`figma.com`&&t!==`www.figma.com`)return null;let n=O(e);if(n[0]===`embed`){let t=D(e.searchParams.get(`url`)??``);return!t||O(t)[0]===`embed`?null:le(t,te(t))}return!ce.has(n[0]??``)||!n[1]?null:{provider:`figma`,label:n[0]===`board`?`FigJam board`:`Figma file`,src:`https://www.figma.com/embed?embed_host=koboyo&url=${encodeURIComponent(e.href)}`,width:800,height:450,keepAspect:!1,video:!1,forms:!0}}function ue(e,t){if(t!==`codepen.io`)return null;let[n,r,i]=O(e),a=new Set([`pen`,`full`,`details`,`embed`]);return!n||!/^[A-Za-z0-9_-]+$/.test(n)||!a.has(r??``)||!i||!/^[A-Za-z0-9]+$/.test(i)?null:{provider:`codepen`,label:`CodePen`,src:`https://codepen.io/${n}/embed/${i}?default-tab=result`,width:800,height:450,keepAspect:!1,video:!1}}function de(e,t){if(t!==`codesandbox.io`)return null;let n=O(e),r;return n[0]===`s`||n[0]===`embed`?r=n[1]:n[0]===`p`&&n[1]===`sandbox`&&(r=n[2]),!r||!/^[A-Za-z0-9-]+$/.test(r)?null:{provider:`codesandbox`,label:`CodeSandbox`,src:`https://codesandbox.io/embed/${r}`,width:800,height:500,keepAspect:!1,video:!1,forms:!0}}function fe(e,t){return t!==`google.com`&&t!==`www.google.com`||e.pathname!==`/maps/embed`||!e.searchParams.get(`pb`)?null:{provider:`google-maps`,label:`Google Map`,src:e.href,width:600,height:450,keepAspect:!1,video:!1}}var pe=new Set([`track`,`album`,`playlist`,`episode`]);function me(e,t){if(t!==`open.spotify.com`)return null;let n=O(e);n[0]===`embed`&&(n=n.slice(1)),n[0]?.startsWith(`intl-`)&&(n=n.slice(1));let[r,i]=n;if(!r||!pe.has(r)||!i||!/^[A-Za-z0-9]+$/.test(i))return null;let a=r===`track`||r===`episode`;return{provider:`spotify`,label:`Spotify`,src:`https://open.spotify.com/embed/${r}/${i}`,width:400,height:a?152:352,keepAspect:!1,video:!1}}var he=[ae,oe,se,le,ue,de,fe,me];function ge(e){let t=D(e.trim());if(!t)return null;let n=te(t);if(n===``||ne(n))return null;let r=t.href;for(let e of he){let i=e(t,n);if(!i)continue;let{forms:a,...o}=i;return{...o,canonical:r,sandbox:a?S:x,allow:w}}return{provider:`generic`,label:n.replace(/^www\./,``),src:r,canonical:r,width:800,height:600,keepAspect:!1,sandbox:C,allow:T,video:!1}}function _e(e){let t=/<iframe\b[^>]*>/i.exec(e);if(!t)return null;let n=/\ssrc\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/i.exec(t[0]);if(!n)return null;let r=ve((n[1]??n[2]??n[3]??``).trim()),i=D(r.startsWith(`//`)?`https:${r}`:r);return i?i.href:null}function ve(e){return e.replace(/&quot;/g,`"`).replace(/&#0*39;/g,`'`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&amp;/g,`&`)}function ye(e){return 9+e*2.2}var be={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},xe=.5,Se=.32;function Ce(e,t,n,r=1/0){let i=Math.max(be[t],xe);return Math.min(e,n*Se/i,r/i)}var A=36,we=10.5,Te=1.5,Ee=3;function De(e){return{minX:e.x,minY:e.y,maxX:e.x+e.width,maxY:e.y+e.height}}function Oe(e,t){return{minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t}}function ke(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 Ae(e){return{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}}function je(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 Me(e,t){return e>=t.min&&e<=t.max}function Ne(e){return e.max-e.min}function Pe(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]:Me(e.min,t)?[{min:t.max,max:e.max}]:[{min:e.min,max:t.min}]}function Fe(e,t,n){return e+(t-e)*n}var Ie=[`right`,`bottom`,`left`,`top`],Le={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 Re(e,t,n){let r=Le[n],i=e.box[r.main],a=e.isPoint?null:i+r.sign*A,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-=we*2:s.max+=we*2);let c={min:t.box[r.crossLo]-A,max:t.box[r.crossHi]+A};if(Me(i,s)&&!e.isPoint&&!t.isPoint){let e=Pe(o,c);if(e.length===0)return null;o=e.length===2&&Ne(e[1])>Ne(e[0])?e[1]:e[0]}let l=e.target[r.crossAxis];return Me(l,o)?{value:i,expanded:a,cross:o,crossTarget:l}:null}function ze(e,t){return{top:Re(e,t,`top`),right:Re(e,t,`right`),bottom:Re(e,t,`bottom`),left:Re(e,t,`left`)}}function Be(e,t){return t===null?!!(e.top||e.right||e.bottom||e.left):!!e[t]}function Ve(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 He={sx:1,sy:1,swap:!1},Ue={sx:1,sy:-1,swap:!1},We={sx:-1,sy:1,swap:!0},Ge={sx:-1,sy:-1,swap:!1},Ke={sx:1,sy:-1,swap:!0};function qe(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 Je(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 Ye(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 Xe(e){e&&(e.value=-e.value,e.expanded=e.expanded===null?null:-e.expanded)}function Ze(e){if(!e)return;let t=e.cross.min;e.cross.min=-e.cross.max,e.cross.max=-t,e.crossTarget=-e.crossTarget}function Qe(e,t){if(e.sx===-1){let e=t.left;t.left=t.right,t.right=e,Xe(t.left),Xe(t.right),Ze(t.top),Ze(t.bottom)}if(e.sy===-1){let e=t.top;t.top=t.bottom,t.bottom=e,Xe(t.top),Xe(t.bottom),Ze(t.left),Ze(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 $e(e,t){if(Ye(t,e.a.box),Ye(t,e.a.grown),Ye(t,e.b.box),Ye(t,e.b.grown),Ye(t,e.common.box),Ye(t,e.common.grown),Qe(t,e.a.edges),Qe(t,e.b.edges),e.bias=qe(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 et(e,t){$e(e,t),e.applied.push(t)}function tt(e){return e.swap?{sx:e.sy,sy:e.sx,swap:!0}:e}function nt(e){for(;e.applied.length>0;){let t=e.applied.pop();t&&$e(e,tt(t))}}function rt(e,t,n){let r={x:t,y:n};for(let t=e.applied.length-1;t>=0;--t)r=Je(e.applied[t],r);return r}var j=.01,M=class{work;pts=[];mid=null;constructor(e){this.work=e}to(e,t){return this.pts.push(rt(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=Ct(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 it(e){let t=e.a.edges.right,n=e.b.edges.left;if(!t||!n||t.crossTarget>n.crossTarget&&(et(e,Ue),t=e.a.edges.right,n=e.b.edges.left,!t||!n))return null;if(e.gapX>0&&e.midX!==null)return new M(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 M(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)+A+6,i=A+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?A+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)+A+8:1/0;return r<i&&r<a?new M(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 M(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 M(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 at(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&&je(e.b.grown,Ae(e.a.box)))return new M(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 M(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 M(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 M(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 M(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 M(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 ot(e){return et(e,Ue),at(e)}function st(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 M(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 M(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 M(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 ct={top:{top:[Ke,st],left:[Ke,at],bottom:[Ke,it],right:[Ke,ot]},right:{top:[He,at],right:[He,st],bottom:[He,ot],left:[He,it]},bottom:{top:[We,it],left:[We,ot],bottom:[We,st],right:[We,at]},left:{top:[Ge,ot],left:[Ge,st],bottom:[Ge,at],right:[Ge,it]}};function N(e,t,n){let[r,i]=ct[t][n];et(e,r);let a=i(e);return nt(e),a}function lt(e,t){let n=null,r=1/0,i=1/0,a=0;for(let[o,s]of t){a+=1;let t=N(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 ut(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 N(e,t,`top`);let o=e.b.edges.bottom;if(o&&i(o.crossTarget)&&n.crossTarget>=(o.expanded??o.value))return N(e,t,`bottom`)}function dt(e){let t=null;if(Math.abs(e.gapX)+1>Math.abs(e.gapY)&&e.midX!==null)t=e.gapX>0?N(e,`right`,`left`):N(e,`left`,`right`);else if(e.a.isPoint&&e.b.isPoint)t=e.gapY>0?N(e,`bottom`,`top`):N(e,`top`,`bottom`);else{let n=ut(e,`right`);n===void 0&&(n=ut(e,`left`)),n===void 0?e.gapY>0&&e.midY!==null?t=N(e,`bottom`,`top`):e.gapY<0&&e.midY!==null&&(t=N(e,`top`,`bottom`)):t=n}if(t)return t;let n=Ie.filter(t=>e.a.edges[t]),r=Ie.filter(t=>e.b.edges[t]);return lt(e,n.flatMap(e=>r.map(t=>[e,t])))}function ft(e,t){let n=null;return t===`right`?n=e.gapX>0&&e.gapX>Math.abs(e.gapY)&&e.midX!==null?N(e,`right`,`left`):ut(e,`right`)??null:t===`left`&&(n=e.gapX<0&&Math.abs(e.gapX)>Math.abs(e.gapY)&&e.midX!==null?N(e,`left`,`right`):ut(e,`left`)??null),n||lt(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 pt={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function mt(e,t,n){return N(e,t,n)||(e.a.isPoint&&e.b.isPoint?lt(e,[[pt[t],pt[n]],[t,pt[n]],[pt[t],n]]):e.a.isPoint?N(e,pt[t],n):e.b.isPoint?N(e,t,pt[n]):null)}function ht(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=c(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 gt(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)>j)return;r.x=n.outline(r.y)}else{if(Math.abs(r.x-i.x)>j)return;r.y=n.outline(r.x)}}function _t(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)<j?n.y=r.y:n.x=r.x}}function vt(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 yt={x:{lo:`minX`,hi:`maxX`},y:{lo:`minY`,hi:`maxY`}};function bt(e,t,n,r,i,a,o,s,c){let{lo:l,hi:u}=yt[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 xt(e,t,n,r){if(!e||e.points.length<2)return null;let i=e.points;return gt(i,!0,t),gt(i,!1,n),ht(i,!0,t),ht(i,!1,n),_t(i,!0,t.minEnd),_t(i,!1,n.minEnd),r&&i.reverse(),i}function St(e,t,n){let r={box:De(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:De(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=ze(o,s),l=ze(s,o);(!Be(c,o.side)||!Be(l,s.side))&&(Be(c,o.side)||(s=Ve(s)),Be(l,s.side)||(o=Ve(o)),je(s.box,o.target,A)&&(s=Ve(s)),je(o.box,s.target,A)&&(o=Ve(o)),c=ze(o,s),l=ze(s,o));let u=o.isPoint?o.box:Oe(o.box,A),d=s.isPoint?s.box:Oe(s.box,A),{gapX:f,gapY:p}=vt(o,s),m=o.minEnd*Ee,h=s.minEnd*Ee,g=(o.isPoint?m:we)+(s.isPoint?h:we),_=bt(`x`,f,g,o,s,u,d,m,h),v=bt(`y`,p,g,o,s,u,d,m,h),y=a?1-n:n,ee=_?Fe(_.a,_.b,y):null,b=v?Fe(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:ke(o.box,s.box),grown:ke(u,d)},gapX:f,gapY:p,midX:ee,midY:b,bias:{x:1,y:1},applied:[]},S=null;return o.side&&s.side?S=mt(x,o.side,s.side):o.side&&(S=ft(x,o.side)),S||=dt(x),{route:xt(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 Ct(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)<j,a=Math.abs(n.y-e.y)<j;if(!(i&&a)){if(r&&i&&Math.abs(n.x-r.x)<j){e.y=n.y;continue}if(r&&a&&Math.abs(n.y-r.y)<j){e.x=n.x;continue}t.push({x:n.x,y:n.y})}}return t}function wt(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)>j?r+(e-r)/2:null}function Tt(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)<=j;if(a===Math.abs(i.x-r.x)<=j||t.side&&(t.side===`left`||t.side===`right`)!==a)return!1;if(a){let e=Math.sign(i.x-r.x),n=wt(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=wt(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 Et(e,t,n){if(e.length<3)return null;let r=e.map(e=>({x:e.x,y:e.y}));if(!Tt(r,t,!0)||!Tt(r,n,!1))return null;let i=Ct(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)>j&&Math.abs(i[e+1].y-i[e].y)>j)return null;return i}function Dt(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<j)return null;let u=Math.min(A,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=Ct(r);return m.length<2?null:m}function Ot(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*Te,side:null,isPoint:!0}}var kt=18,At=.58,jt=.15,Mt=.16,Nt=.5,Pt=.68;function Ft(e,t,n){let r={x:-Math.sin(t),y:Math.cos(t)},i=r=>{let i=t+At*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)*Mt,y:t.y+(e.y-t.y)*Mt}),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*jt,y:e.y+r.y*i*n*jt}},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 It(e,t,n){let r={x:-Math.sin(t),y:Math.cos(t)},i=i=>{let a=t+Nt*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)*Pt,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 Lt(e){return{x:(e.x+e.x2)/2,y:(e.y+e.y2)/2}}function Rt(e,t){return p(e,f(e)*n(t)).point}function zt(e){let t=e.labelAlong;if(e.bendStyle===`elbow`)return Rt(P(e),t??.5);let r=F(e);if(r)return t===void 0?r.apex:r.pointAt(t);if(t===void 0)return Lt(e);let i=n(t);return{x:e.x+(e.x2-e.x)*i,y:e.y+(e.y2-e.y)*i}}function Bt(e,t){if(e.bendStyle===`elbow`)return m(P(e),t);let r=F(e);if(r)return nn(r,t);let i=e.x2-e.x,a=e.y2-e.y,o=i*i+a*a;return o<1e-9?.5:n(((t.x-e.x)*i+(t.y-e.y)*a)/o)}var Vt=22,Ht=10;function Ut(e,t){let n=Math.hypot(t.x,t.y)||1;return{x:e.x+t.y/n*Ht,y:e.y-t.x/n*Ht}}function Wt(e,t){if(e.bendStyle===`elbow`){let n=P(e),r=t===`start`?n:[...n].reverse(),i=p(r,Math.min(Vt,f(r)*.4));return Ut(i.point,i.dir)}let n={x:e.x,y:e.y},r={x:e.x2,y:e.y2},a=i(n,r)||1,o=F(e);if(!o){let e=Math.min(Vt,a*.4);return t===`start`?Ut(v(n,r,e),{x:r.x-n.x,y:r.y-n.y}):Ut(v(r,n,e),{x:n.x-r.x,y:n.y-r.y})}let s=Math.min(Vt/a,.4),c=t===`start`?o.pointAt(s):o.pointAt(1-s),l=t===`start`?o.pointAt(s+.02):o.pointAt(1-s-.02);return Ut(c,{x:l.x-c.x,y:l.y-c.y})}function Gt(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 Kt(e){return St(Ot({x:e.x,y:e.y},e.strokeWidth),Ot({x:e.x2,y:e.y2},e.strokeWidth),e.elbowMid??.5)}function P(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=Kt(e);return t.route&&t.route.length>=2?t.route:[{x:e.x,y:e.y},{x:e.x2,y:e.y2}]}function qt(e){return e.elbowPoints?null:e.startBinding||e.endBinding?e.elbowMidHandle??null:Kt(e).midHandle}var Jt=.4;function Yt(e){return c(e||0,-.4,Jt)}function Xt(e){let t=Lt(e),{dir:n,normal:r}=Gt(e),a=i({x:e.x,y:e.y},{x:e.x2,y:e.y2}),o=Yt(e.bendAlong)*a;return{x:t.x+n.x*o+r.x*e.bend,y:t.y+n.y*o+r.y*e.bend}}var Zt=Math.PI*2,Qt=e=>(e%Zt+Zt)%Zt;function $t(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 en(e,t,n,r){let a=i(n,e),o=Math.atan2(e.y-n.y,e.x-n.x),s=Math.atan2(t.y-n.y,t.x-n.x),c=r?Qt(s-o):-Qt(o-s);return{from:e,to:t,center:n,r:a,a0:o,delta:c,len:Math.abs(c)*a}}function tn(e,t,r,a){let o=i(e,t);if(o<1||Math.abs(r)<.5)return null;let s={x:(t.x-e.x)/o,y:(t.y-e.y)/o},c={x:-s.y,y:s.x},l={x:(e.x+t.x)/2,y:(e.y+t.y)/2},u=Yt(a)*o,d={x:l.x+s.x*u+c.x*r,y:l.y+s.y*u+c.y*r},f;if(Math.abs(u)<.5){let n=o/2,i=(r*r-n*n)/(2*r),a={x:l.x+c.x*i,y:l.y+c.y*i};f=[en(e,t,a,$t(d,a,s))]}else{let n=e=>{let t=e.x-d.x,n=e.y-d.y,r=c.x*t+c.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+c.x*i,y:d.y+c.y*i}},r=n(e),i=n(t);if(!r||!i)return null;f=[en(e,d,r,$t(d,r,s)),en(d,t,i,$t(d,i,s))]}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 r=n(e)*p;for(let e of f){if(r<=e.len||e===m){let t=e.len?Math.min(1,r/e.len):0,n=e.a0+e.delta*t;return{x:e.center.x+e.r*Math.cos(n),y:e.center.y+e.r*Math.sin(n)}}r-=e.len}return{x:t.x,y:t.y}}}}function nn(e,t){let n=0,r=.5,a=1/0;for(let o of e.segments){let s=Math.abs(o.delta),c=Math.atan2(t.y-o.center.y,t.x-o.center.x),l=o.delta>=0?Qt(c-o.a0):Qt(o.a0-c),u;u=s<1e-9?0:l<=s?l/s:i(t,o.from)<=i(t,o.to)?0:1;let d=o.a0+o.delta*u,f=i(t,{x:o.center.x+o.r*Math.cos(d),y:o.center.y+o.r*Math.sin(d)});f<a&&(a=f,r=(n+u*o.len)/e.length),n+=o.len}return r}function F(e){return tn({x:e.x,y:e.y},{x:e.x2,y:e.y2},e.bend,e.bendAlong??0)}function rn(e,t,n){let r=i(e,t)||1,a={x:(t.x-e.x)/r,y:(t.y-e.y)/r},o={x:-a.y,y:a.x},s={x:(e.x+t.x)/2,y:(e.y+t.y)/2},c=n.x-s.x,l=n.y-s.y;return{bow:c*o.x+l*o.y,bowAlong:Yt((c*a.x+l*a.y)/r)}}function an(e,t,n){return Math.abs(e*t)<=n?0:e}function on(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 sn(e){return Xt(e)}function cn(e,t){let n=rn({x:e.x,y:e.y},{x:e.x2,y:e.y2},t);return{bend:n.bow,bendAlong:n.bowAlong}}function ln(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 a=e[r-1],o=e[r],s=e[r+1],c=Math.min(t,i(a,o)/2,i(o,s)/2),l=v(o,a,c),u=v(o,s,c);n+=` L ${l.x} ${l.y} Q ${o.x} ${o.y} ${u.x} ${u.y}`}let r=e[e.length-1];return n+=` L ${r.x} ${r.y}`,n}function un(e){if(e.bendStyle===`elbow`){let t=P(e);if(t.length>=2)return ln(t,kt)}let t=e.bendStyle===`elbow`?null:F(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 dn(e,t,n,r){if(e.length>n){let a=r?1-n/e.length:n/e.length,o=e.pointAt(a);if(i(o,t)>1e-6)return Math.atan2(t.y-o.y,t.x-o.x)}if(r){let t=on(e.segments[e.segments.length-1],`to`);return Math.atan2(t.y,t.x)}let a=on(e.segments[0],`from`);return Math.atan2(-a.y,-a.x)}function fn(e,t){let n=t===`end`,r=n?{x:e.x2,y:e.y2}:{x:e.x,y:e.y},a=(n?e.endHead:e.startHead)??`arrow`,o=ye(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=P(e);return{tip:r,angle:y(t,n)??s,length:Ce(o,a,f(t),g(t,n))}}let c=F(e);if(!c)return{tip:r,angle:s,length:Ce(o,a,i({x:e.x,y:e.y},{x:e.x2,y:e.y2}))};let l=Ce(o,a,c.length);return{tip:r,angle:dn(c,r,l,n),length:l}}var pn=[0,Math.PI/2,Math.PI,-Math.PI/2];function mn(e){let t=[e.from,e.to];for(let n of pn)(e.delta>=0?Qt(n-e.a0):Qt(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 hn(e){if(e.bendStyle===`elbow`)return P(e);let t=F(e);return t?t.segments.flatMap(mn):[{x:e.x,y:e.y},{x:e.x2,y:e.y2},Xt(e)]}function gn(e){let t=hn(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}}function _n(e){return y(e,!0)??0}function vn(e){return y(e,!1)??0}function yn(e,t){return e.length===0?{x:0,y:0}:p(e,f(e)*n(t??.5)).point}function bn(e){return e.length===0?``:e.reduce((e,t,n)=>e+`${n===0?`M`:`L`} ${t.x} ${t.y} `,``)}function xn(e){let t=[];for(let n of e){let e=t[t.length-1];(!e||Math.abs(e.x-n.x)>.01||Math.abs(e.y-n.y)>.01)&&t.push(n)}return t}var Sn=[`arrow`,`sweep`,`triangle`,`triangleOutline`],Cn=[`circle`,`circleOutline`,`diamond`,`diamondOutline`,`bar`,`cross`],wn=[`crowOne`,`crowMany`,`crowOneOrMany`,`crowOnlyOne`,`crowZeroOrOne`,`crowZeroOrMany`];function Tn(e){let t={x:Math.cos(e),y:Math.sin(e)};return{dir:t,normal:{x:-t.y,y:t.x}}}function En(e){let[t,...n]=e;return`M ${t.x} ${t.y} `+n.map(e=>`L ${e.x} ${e.y} `).join(``)+`Z`}function Dn(e,t){return`M ${e.x-t} ${e.y} a ${t} ${t} 0 1 0 ${t*2} 0 a ${t} ${t} 0 1 0 ${-t*2} 0 Z`}function On(e,t,n,r){let{dir:i,normal:a}=Tn(n),o=r,s=e=>({x:t.x-i.x*e,y:t.y-i.y*e}),c=(e,t)=>{let n=s(e),r={x:n.x+a.x*t,y:n.y+a.y*t},i={x:n.x-a.x*t,y:n.y-a.y*t};return`M ${r.x} ${r.y} L ${i.x} ${i.y}`},l=(e,n)=>{let r=s(e),i={x:t.x+a.x*n,y:t.y+a.y*n},o={x:t.x-a.x*n,y:t.y-a.y*n};return`M ${i.x} ${i.y} L ${r.x} ${r.y} L ${o.x} ${o.y}`},u=(e,t=`none`)=>({d:e,fill:t}),d=s(o);switch(e){case`arrow`:return[u(Ft(t,n,o))];case`sweep`:return[u(It(t,n,o))];case`triangle`:case`triangleOutline`:{let n=o*.42;return[u(En([t,{x:d.x+a.x*n,y:d.y+a.y*n},{x:d.x-a.x*n,y:d.y-a.y*n}]),e===`triangle`?`solid`:`white`)]}case`diamond`:case`diamondOutline`:{let n=o*.34,r=s(o/2);return[u(En([t,{x:r.x+a.x*n,y:r.y+a.y*n},d,{x:r.x-a.x*n,y:r.y-a.y*n}]),e===`diamond`?`solid`:`white`)]}case`circle`:case`circleOutline`:{let t=o*.4;return[u(Dn(s(t),t),e===`circle`?`solid`:`white`)]}case`bar`:return[u(c(0,o*.5))];case`cross`:{let e=o*.4,t=t=>{let n=i.x*t+a.x,r=i.y*t+a.y,o=Math.hypot(n,r)||1,c=n/o*e,l=r/o*e,u=s(e);return`M ${u.x-c} ${u.y-l} L ${u.x+c} ${u.y+l}`};return[u(t(1)),u(t(-1))]}case`crowOne`:return[u(c(o*.55,o*.45))];case`crowOnlyOne`:return[u(c(o*.45,o*.45)),u(c(o*.9,o*.45))];case`crowMany`:return[u(l(o,o*.5))];case`crowOneOrMany`:return[u(l(o,o*.5)),u(c(o*1.3,o*.45))];case`crowZeroOrOne`:{let e=o*.3;return[u(c(o*.4,o*.45)),u(Dn(s(o),e),`white`)]}case`crowZeroOrMany`:{let e=o*.3;return[u(l(o*.85,o*.5)),u(Dn(s(o*1.4),e),`white`)]}}}function kn(e){let t=[];if(e.endArrow){let n=fn(e,`end`);t.push(...On(e.endHead??`arrow`,n.tip,n.angle,n.length))}if(e.startArrow){let n=fn(e,`start`);t.push(...On(e.startHead??`arrow`,n.tip,n.angle,n.length))}return t}function An(e){let t=e.points;if(t.length<2)return[];let n=ye(e.strokeWidth),r=f(t),i=[];if(e.endArrow){let a=e.endHead??`arrow`;i.push(...On(a,t[t.length-1],_n(t),Ce(n,a,r,g(t,!0))))}if(e.startArrow){let a=e.startHead??`arrow`;i.push(...On(a,t[0],vn(t),Ce(n,a,r,g(t,!1))))}return i}function jn(e,t){return e===`solid`?t:e===`white`?`#ffffff`:`none`}function Mn(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function Nn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Pn(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)Mn(e,s,i);let c=function(e,t,n){let r=[];for(let t of e){let e=[...t];Nn(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach((e=>{o.push({s,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=s))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),(n!==1||c%t==0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach((e=>{e.edge.x=e.edge.x+n*e.edge.islope})),c++}return i}(o,a,r);if(i){for(let e of o)Mn(e,s,-i);(function(e,t,n){let r=[];e.forEach((e=>r.push(...e))),Mn(r,t,n)})(c,s,-i)}return c}function Fn(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),Pn(e,r,n,i||1)}var In=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=Fn(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function Ln(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var Rn=class extends In{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);let r=Fn(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(let[e,t]of r)Ln([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},zn=class extends In{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},Bn=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=Fn(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=Ln(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+2*Math.random()*a,c=o-a+2*Math.random()*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},Vn=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=Fn(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,i=[];return e.forEach((e=>{let a=Ln(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}})),i}},Hn=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=Fn(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach((e=>{let i=Ln(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=2*e*t,a=2*(e+1)*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}},I={},Un=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},Wn=0,Gn=1,Kn=2,qn={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Jn(e,t){return e.type===t}function Yn(e){let t=[],n=function(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:Wn,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:Gn,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:Kn,text:``},t}(e),r=`BOD`,i=0,a=n[i];for(;!Jn(a,Kn);){let o=0,s=[];if(r===`BOD`){if(a.text!==`M`&&a.text!==`m`)return Yn(`M0,0`+e);i++,o=qn[a.text],r=a.text}else Jn(a,Gn)?o=qn[r]:(i++,o=qn[a.text],r=a.text);if(!(i+o<n.length))throw Error(`Path data ended short`);for(let e=i;e<i+o;e++){let t=n[e];if(!Jn(t,Gn))throw Error(`Param not a number: `+r+`,`+t.text);s[s.length]=+t.text}if(typeof qn[r]!=`number`)throw Error(`Bad segment: `+r);{let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}}return t}function Xn(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map(((e,r)=>r%2?e+n:e+t));a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Zn(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&($n(r,i,c,l,e,n,a,o,s).forEach((function(e){t.push({key:`C`,data:e})})),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function Qn(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function $n(e,t,n,r,i,a,o,s,c,l){let u=(d=o,Math.PI*d/180);var d;let f=[],p=0,m=0,h=0,g=0;if(l)[p,m,h,g]=l;else{[e,t]=Qn(e,t,-u),[n,r]=Qn(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i*=d,a*=d);let f=i*i,_=a*a,v=f*_-f*l*l-_*o*o,y=f*l*l+_*o*o,ee=(s===c?-1:1)*Math.sqrt(Math.abs(v/y));h=ee*i*l/a+(e+n)/2,g=ee*-a*o/i+(t+r)/2,p=Math.asin(parseFloat(((t-g)/a).toFixed(9))),m=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<h&&(p=Math.PI-p),n<h&&(m=Math.PI-m),p<0&&(p=2*Math.PI+p),m<0&&(m=2*Math.PI+m),c&&p>m&&(p-=2*Math.PI),!c&&m>p&&(m-=2*Math.PI)}let _=m-p;if(Math.abs(_)>120*Math.PI/180){let e=m,t=n,s=r;m=c&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=$n(n=h+i*Math.cos(m),r=g+a*Math.sin(m),t,s,i,a,o,0,c,[m,e,h,g])}_=m-p;let v=Math.cos(p),y=Math.sin(p),ee=Math.cos(m),b=Math.sin(m),x=Math.tan(_/4),S=4/3*i*x,C=4/3*a*x,w=[e,t],T=[e+S*y,t-C*v],E=[n+S*b,r-C*ee],D=[n,r];if(T[0]=2*w[0]-T[0],T[1]=2*w[1]-T[1],l)return[T,E,D].concat(f);{f=[T,E,D].concat(f);let e=[];for(let t=0;t<f.length;t+=3){let n=Qn(f[t][0],f[t][1],u),r=Qn(f[t+1][0],f[t+1][1],u),i=Qn(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var er={randOffset:function(e,t){return L(e,t)},randOffsetWithRange:function(e,t,n){return pr(e,t,n)},ellipse:function(e,t,n,r,i){return or(e,t,i,ar(n,r,i)).opset},doubleLineOps:function(e,t,n,r,i){return R(e,t,n,r,i,!0)}};function tr(e,t,n,r,i){return{type:`path`,ops:R(e,t,n,r,i)}}function nr(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...R(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...R(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?tr(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function rr(e,t,n,r,i){return function(e,t){return nr(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function ir(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=hr(n[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:hr(n[0],1.5*(1+.22*t.roughness),dr(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=hr(a,1*(1+.2*t.roughness),t),n=t.disableMultiStroke?[]:hr(a,1.5*(1+.22*t.roughness),dr(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function ar(e,t,n){let r=Math.sqrt(2*Math.PI*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=L(o*c,n),s+=L(s*c,n),{increment:a,rx:o,ry:s}}function or(e,t,n,r){let[i,a]=_r(r.increment,e,t,r.rx,r.ry,1,r.increment*pr(.1,pr(.4,1,n),n),n),o=gr(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=_r(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=gr(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function sr(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=L(.01*d,c),f+=L(.01*f,c);let p=i,m=a;for(;p<0;)p+=2*Math.PI,m+=2*Math.PI;m-p>2*Math.PI&&(p=0,m=2*Math.PI);let h=2*Math.PI/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=vr(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=vr(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...R(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...R(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function cr(e,t){let n=Zn(Xn(Yn(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...R(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...yr(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...R(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function lr(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+L(e,t),r[0][1]+L(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+L(e,t),r[a][1]+L(e,t)]})}}return{type:`fillPath`,ops:n}}function ur(e,t){return function(e,t){let n=e.fillStyle||`hachure`;if(!I[n])switch(n){case`zigzag`:I[n]||(I[n]=new Rn(t));break;case`cross-hatch`:I[n]||(I[n]=new zn(t));break;case`dots`:I[n]||(I[n]=new Bn(t));break;case`dashed`:I[n]||(I[n]=new Vn(t));break;case`zigzag-line`:I[n]||(I[n]=new Hn(t));break;default:n=`hachure`,I[n]||(I[n]=new In(t))}return I[n]}(t,er).fillPolygons(e,t)}function dr(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function fr(e){return e.randomizer||=new Un(e.seed||0),e.randomizer.next()}function pr(e,t,n,r=1){return n.roughness*r*(fr(n)*(t-e)+e)}function L(e,t,n=1){return pr(-e,e,t,n)}function R(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=mr(e,t,n,r,i,!0,!1);if(o)return s;let c=mr(e,t,n,r,i,!0,!0);return s.concat(c)}function mr(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+.2*fr(i),p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=L(p,i,l),m=L(m,i,l);let h=[],g=()=>L(d,i,l),_=()=>L(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:L(u,i,l)),t+(v?0:L(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function hr(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+L(t,n),e[0][1]+L(t,n)]),r.push([e[0][0]+L(t,n),e[0][1]+L(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+L(t,n),e[i][1]+L(t,n)]),i===e.length-1&&r.push([e[i][0]+L(t,n),e[i][1]+L(t,n)]);return gr(r,null,n)}function gr(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+L(e,n),t[1]+L(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...mr(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function _r(e,t,n,r,i,a,o,s){let c=[],l=[];if(s.roughness===0){e/=4,l.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=2*Math.PI;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];c.push(e),l.push(e)}l.push([t+r*Math.cos(0),n+i*Math.sin(0)]),l.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let u=L(.5,s)-Math.PI/2;l.push([L(a,s)+t+.9*r*Math.cos(u-e),L(a,s)+n+.9*i*Math.sin(u-e)]);let d=2*Math.PI+u-.01;for(let o=u;o<d;o+=e){let e=[L(a,s)+t+r*Math.cos(o),L(a,s)+n+i*Math.sin(o)];c.push(e),l.push(e)}l.push([L(a,s)+t+r*Math.cos(u+2*Math.PI+.5*o),L(a,s)+n+i*Math.sin(u+2*Math.PI+.5*o)]),l.push([L(a,s)+t+.98*r*Math.cos(u+o),L(a,s)+n+.98*i*Math.sin(u+o)]),l.push([L(a,s)+t+.9*r*Math.cos(u+.5*o),L(a,s)+n+.9*i*Math.sin(u+.5*o)])}return[l,c]}function vr(e,t,n,r,i,a,o,s,c){let l=a+L(.1,c),u=[];u.push([L(s,c)+t+.9*r*Math.cos(l-e),L(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([L(s,c)+t+r*Math.cos(a),L(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),gr(u,null,c)}function yr(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:L(l[0],s)),o[1]+(f?0:L(l[0],s))]}),u=f?[i,a]:[i+L(l[p],s),a+L(l[p],s)],c.push({op:`bcurveTo`,data:[e+L(l[p],s),t+L(l[p],s),n+L(l[p],s),r+L(l[p],s),u[0],u[1]]});return c}function br(e){return[...e]}function xr(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(br(e[0]),br(e[1]),br(e[2]),br(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(br(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function Sr(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function Cr(e,t,n){let r=Sr(t,n);if(r===0)return Sr(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),Sr(e,z(t,n,i))}function z(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function wr(e,t,n,r){let i=r||[];if(function(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}(e,t)<n){let n=e[t+0];i.length?(a=i[i.length-1],o=n,Math.sqrt(Sr(a,o)))>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=z(a,o,r),u=z(o,s,r),d=z(s,c,r),f=z(l,u,r),p=z(u,d,r),m=z(f,p,r);wr([a,l,f,m],0,n,i),wr([m,p,d,c],0,n,i)}var a,o;return i}function Tr(e,t){return Er(e,0,e.length,t)}function Er(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=Cr(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(Er(e,t,l+1,r,a),Er(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function Dr(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)wr(e,3*n,t,r);return n&&n>0?Er(r,0,r.length,n):r}var B=`none`,Or=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[tr(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=rr(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(lr([i],a)):o.push(ur([i],a))}return a.stroke!==B&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=ar(n,r,a),c=or(e,t,a,s);if(a.fill)if(a.fillStyle===`solid`){let n=or(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(ur([c.estimatedPoints],a));return a.stroke!==B&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[nr(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=sr(e,t,n,r,i,a,o,!0,c);if(o&&c.fill)if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=sr(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(function(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=L(.01*l,o),u+=L(.01*u,o);let d=i,f=a;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),ur([m],o)}(e,t,n,r,i,a,c));return c.stroke!==B&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=ir(e,n);if(n.fill&&n.fill!==B)if(n.fillStyle===`solid`){let t=ir(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...Dr(xr([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...Dr(xr(r),10,(1+n.roughness)/2))}t.length&&r.push(ur([t],n))}return n.stroke!==B&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=nr(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(lr([e],n)):r.push(ur([e],n))),n.stroke!==B&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==B,a=n.stroke!==B,o=!!(n.simplification&&n.simplification<1),s=function(e,t,n){let r=Zn(Xn(Yn(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...Dr(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=Tr(e,n);t.length&&u.push(t)}return u}(e,1,o?4-4*(n.simplification||1):(1+n.roughness)/2),c=cr(e,n);if(i)if(n.fillStyle===`solid`)if(s.length===1){let t=cr(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(lr(s,n));else r.push(ur(s,n));return a&&(o?s.forEach((e=>{r.push(nr(e,!1,n))})):r.push(c)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:B};break;case`fillPath`:t={d:this.opsToPath(e),stroke:B,strokeWidth:0,fill:n.fill||B};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||B,strokeWidth:n,fill:B}}_mergedShape(e){return e.filter(((e,t)=>t===0||e.op!==`move`))}},kr=class{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext(`2d`),this.gen=new Or(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;for(let a of t)switch(a.type){case`path`:r.save(),r.strokeStyle=n.stroke===`none`?`transparent`:n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,a,i),r.restore();break;case`fillPath`:{r.save(),r.fillStyle=n.fill||``;let t=e.shape===`curve`||e.shape===`polygon`||e.shape===`path`?`evenodd`:`nonzero`;this._drawToContext(r,a,i,t),r.restore();break}case`fillSketch`:this.fillSketch(r,a,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||``,e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r=`nonzero`){e.beginPath();for(let r of t.ops){let t=typeof n==`number`&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case`move`:e.moveTo(t[0],t[1]);break;case`bcurveTo`:e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case`lineTo`:e.lineTo(t[0],t[1])}}t.type===`fillPath`?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a),a}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a),a}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a),a}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i),i}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c),c}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){let n=this.gen.path(e,t);return this.draw(n),n}},Ar=`http://www.w3.org/2000/svg`,jr=class{constructor(e,t){this.svg=e,this.gen=new Or(t)}draw(e){let t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(Ar,`g`),a=e.options.fixedDecimalPlaceDigits;for(let o of t){let t=null;switch(o.type){case`path`:t=r.createElementNS(Ar,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,n.stroke),t.setAttribute(`stroke-width`,n.strokeWidth+``),t.setAttribute(`fill`,`none`),n.strokeLineDash&&t.setAttribute(`stroke-dasharray`,n.strokeLineDash.join(` `).trim()),n.strokeLineDashOffset&&t.setAttribute(`stroke-dashoffset`,`${n.strokeLineDashOffset}`);break;case`fillPath`:t=r.createElementNS(Ar,`path`),t.setAttribute(`d`,this.opsToPath(o,a)),t.setAttribute(`stroke`,`none`),t.setAttribute(`stroke-width`,`0`),t.setAttribute(`fill`,n.fill||``),e.shape!==`curve`&&e.shape!==`polygon`||t.setAttribute(`fill-rule`,`evenodd`);break;case`fillSketch`:t=this.fillSketch(r,o,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);let i=e.createElementNS(Ar,`path`);return i.setAttribute(`d`,this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute(`stroke`,n.fill||``),i.setAttribute(`stroke-width`,r+``),i.setAttribute(`fill`,`none`),n.fillLineDash&&i.setAttribute(`stroke-dasharray`,n.fillLineDash.join(` `).trim()),n.fillLineDashOffset&&i.setAttribute(`stroke-dashoffset`,`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){let a=this.gen.line(e,t,n,r,i);return this.draw(a)}rectangle(e,t,n,r,i){let a=this.gen.rectangle(e,t,n,r,i);return this.draw(a)}ellipse(e,t,n,r,i){let a=this.gen.ellipse(e,t,n,r,i);return this.draw(a)}circle(e,t,n,r){let i=this.gen.circle(e,t,n,r);return this.draw(i)}linearPath(e,t){let n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){let n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,i,a,o=!1,s){let c=this.gen.arc(e,t,n,r,i,a,o,s);return this.draw(c)}curve(e,t){let n=this.gen.curve(e,t);return this.draw(n)}path(e,t){let n=this.gen.path(e,t);return this.draw(n)}},Mr={canvas:(e,t)=>new kr(e,t),svg:(e,t)=>new jr(e,t),generator:e=>new Or(e),newSeed:()=>Or.newSeed()};function V(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 Nr(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 Pr(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 Fr(e,t,n,r){return`M ${e} ${t} L ${n} ${r}`}function Ir(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 Lr={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:[]},Rr=/([A-Za-z])([^A-Za-z]*)/g,zr=/[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g;function Br(e){if(!Number.isFinite(e))return`0`;let t=Math.round(e*1e4)/1e4;return Object.is(t,-0)?`0`:String(t)}function Vr(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=[];Rr.lastIndex=0;for(let t=Rr.exec(e);t;t=Rr.exec(e)){let c=t[1],l=Lr[c];if(!l)return e;let u=t[2].match(zr)?.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`?Br(n?2*i-e:e):s===`y`?Br(r?2*a-e:e):s===`rotation`?Br(o?-e:e):s===`sweep`&&o?String(+!e):Br(e)});s.push(`${c} ${d.join(` `)}`)}return s.join(` `)}var Hr=`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 H(e,t=0){return Ir(e,t)}function Ur(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 H(a)}function Wr(e){return Math.min(e.width*.1,e.height*.25)}function Gr(e){return Math.min(e.height*.34,e.width*.25)}function Kr(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 qr(e){return V(e.x,e.y,e.width,e.height,Math.min(6,e.width/2,e.height/2))}function Jr(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 Yr(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 Xr(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=Yr(e,t),d=l*.25,f=l/2;return H([[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 Zr(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=i*.32,s=a*.32;return H([[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 Qr(e){let{x:t,y:n,width:r,height:i}=e,a=(e,a)=>[t+e*r,n+a*i];return H([a(.56,0),a(0,.6),a(.5,.6),a(.44,1),a(1,.4),a(.5,.4)])}var $r=.16;function ei(e){let{x:t,y:n,width:r,height:i}=e,a=i*$r,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 ti(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 ni(e){let{x:t,y:n,width:r,height:i}=e;return H([[t,n+i*.28],[t+r,n],[t+r,n+i],[t,n+i]])}function ri(e){return Math.min(e.width*.22,e.height*.6)}function ii(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=ri(e);return H([[n,r],[n+i-o,r],[n+i,r+a/2],[n+i-o,r+a],[n,r+a]],t)}function ai(e){return Math.min(e.width*.24,e.height*.6)}function oi(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=ai(e);return H([[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 si(e,t=0){let{x:n,y:r,width:i,height:a}=e,o=Math.min(i,a)*.29;return H([[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 ci(e){return Math.min(e.width,e.height)*.26}function li(e){let{x:t,y:n,width:r,height:i}=e,a=ci(e);return H([[t,n+a],[t+a,n],[t+r,n],[t+r,n+i-a],[t+r-a,n+i],[t,n+i]])}function ui(e){let{x:t,y:n,width:r,height:i}=e,a=ci(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 di=.72;function fi(e){let{x:t,y:n,width:r}=e,i=e.height*di,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 pi=.82,mi=.78;function hi(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 gi(e){return hi(e,pi,10,[.24,.04,.14])}function _i(e){return hi(e,mi,12,[.4,.22,.26])}function vi(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 yi(e){let{x:t,y:n,width:r,height:i}=e,a=Math.min(r,i)*.2;return H([[t+a,n],[t+r,n],[t+r,n+i],[t,n+i],[t,n+a]])}function bi(e){return Math.min(e.height/2,e.width/2)}function xi(e){let{x:t,y:n,width:r,height:i}=e,a=bi(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 Si(e){return Ai(e)}function Ci(e){return Math.min(Math.min(e.width,e.height)*.08,9)}function wi(e,t,n){let r=n??Ci(e);return t({x:e.x,y:e.y+2*r,width:e.width-2*r,height:e.height-2*r})}function Ti(e,t,n,r){let i=n??Ci(e),a=e.width-2*i,o=e.height-2*i,s=r??e.y+e.height;return`${Ei(e.x+2*i,e.y,a,o,i,s)} ${Ei(e.x+i,e.y+i,a,o,i,s)} ${wi(e,t,i)}`}function Ei(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 Di(e,t){return e.y+2*t+(e.height-2*t)*(1-$r)}var Oi=.12;function ki(e,t){let n=Math.min(e.width,e.height)*t;return vi(e)+` `+vi({x:e.x+n,y:e.y+n,width:e.width-2*n,height:e.height-2*n})}function Ai(e){return V(e.x,e.y,e.width,e.height,Math.min(4,e.width/2,e.height/2))}function ji(e){return Math.min(e.height*.24,26)}function Mi(e){return Math.min(e.width*.45,96)}function Ni(e){let{x:t,y:n,width:r,height:i}=e,a=ji(e),o=Mi(e);return H([[t,n],[t+o,n],[t+o,n+a],[t+r,n+a],[t+r,n+i],[t,n+i]])}function Pi(e){return Math.min(e.width*.16,22)}function Fi(e){let{x:t,y:n,width:r,height:i}=e,a=Pi(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 Ii(e){return Math.min(e.width*.3,16)}function Li(e){let{x:t,y:n,height:r}=e,i=Ii(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 Ri=new Set([`diamond`,`triangle`,`parallelogram`,`trapezoid`,`hexagon`,`pentagon`,`octagon`,`chevron`,`plus`,`arrow-up`,`arrow-down`,`arrow-left`,`arrow-right`]);function zi(e){return e===`rectangle`||Ri.has(e)}function Bi(e){return e===`rectangle`?`rounded`:`sharp`}function Vi(e){return e===`rounded`?7:0}var Hi={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 Ui(e){let t=Hi[e];return{x:t?.x===!0,y:t?.y===!0}}function U(e,t,n,r){if(r?.x||r?.y)return Vr(U(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=Vi(n);switch(e){case`ellipse`:return vi(t);case`oval`:return V(i,a,o,s,Math.min(o,s)/2);case`diamond`:return H([[c,a],[i+o,l],[c,a+s],[i,l]],u);case`triangle`:return H([[c,a],[i+o,a+s],[i,a+s]],u);case`parallelogram`:{let e=Math.min(o*.25,s);return H([[i+e,a],[i+o,a],[i+o-e,a+s],[i,a+s]],u)}case`trapezoid`:{let e=o*.22;return H([[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 H([[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 Ur(t);case`checkbox`:case`crossbox`:return qr(t);case`heart`:return Kr(t);case`cloud`:return Jr(t);case`arrow-up`:case`arrow-down`:case`arrow-left`:case`arrow-right`:return Xr(t,e.slice(6),u);case`plus`:return Zr(t,u);case`speech-bubble`:return _i(t);case`callout`:return gi(t);case`bolt`:return Qr(t);case`document`:return ei(t);case`manual-input`:return ni(t);case`pentagon`:return ii(t,u);case`predefined-process`:return V(i,a,o,s,Math.min(3,o/2,s/2));case`chevron`:return oi(t,u);case`octagon`:return si(t,u);case`cube`:return li(t);case`actor`:return V(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=Wr(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=Gr(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 vi(t);case`card`:return yi(t);case`delay`:return xi(t);case`fork-join`:return Si(t);case`multi-process`:return wi(t,Ai);case`multi-document`:return wi(t,ei);case`package`:return Ni(t);case`component`:return Ai(t);case`brace`:return Ai(t);default:return V(i,a,o,s,n===`sharp`?0:Math.min(12,o/2,s/2))}}function Wi(e,t,n,r){if(r?.x||r?.y)return Vr(Wi(e,t,n),t,!!r.x,!!r.y);let{x:i,y:a,width:o,height:s}=t;if(e===`cylinder`){let r=Wr(t),s=o/2,c=a+r;return U(e,t,n)+` M ${i} ${c} A ${s} ${r} 0 0 0 ${i+o} ${c}`}if(e===`queue`){let r=Gr(t),o=s/2,c=i+r;return U(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 U(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 U(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 U(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 U(e,t,n)+` `+ti(t);if(e===`cube`)return U(e,t,n)+` `+ui(t);if(e===`actor`)return fi(t);if(e===`double-circle`)return ki(t,Oi);if(e===`multi-process`)return Ti(t,Ai);if(e===`multi-document`)return Ti(t,ei,void 0,Di(t,Ci(t)));if(e===`package`){let r=ji(t),i=Mi(t);return U(e,t,n)+` M ${t.x} ${t.y+r} L ${t.x+i} ${t.y+r}`}return e===`component`?Fi(t):e===`brace`?Li(t):U(e,t,n)}function Gi(e){if(e===`arrow-up`||e===`arrow-down`||e===`bolt`||e===`actor`)return Wi(e,{x:5,y:4,width:14,height:16});if(e===`plus`||e===`checkbox`||e===`crossbox`||e===`heart`)return Wi(e,{x:5,y:5,width:14,height:14});if(e===`double-circle`)return ki({x:4,y:4,width:16,height:16},.26);if(e===`multi-process`)return Ki({x:4,y:5,width:15,height:13},Ai,4);if(e===`multi-document`){let e={x:4,y:5,width:15,height:13};return Ki(e,ei,4,e.y+4+(e.height-4)*(1-$r))}return e===`fork-join`?Si({x:4,y:9,width:16,height:6}):Wi(e,{x:4,y:5,width:16,height:14})}function Ki(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`${Ei(e.x+n,e.y,i,a,n,r??e.y+a)} ${o}`}var{PI:qi}=Math,Ji=qi+1e-4,Yi=.5,Xi=[1,1];function Zi(e,t,n,r=e=>e){return e*r(.5-t*(.5-n))}var{min:Qi}=Math;function $i(e,t,n){let r=Qi(1,t/n);return Qi(1,e+(Qi(1,1-r)-e)*(r*.275))}function ea(e){return[-e[0],-e[1]]}function W(e,t){return[e[0]+t[0],e[1]+t[1]]}function ta(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function G(e,t){return[e[0]-t[0],e[1]-t[1]]}function na(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function K(e,t){return[e[0]*t,e[1]*t]}function ra(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function ia(e,t){return[e[0]/t,e[1]/t]}function aa(e){return[e[1],-e[0]]}function oa(e,t){let n=t[0];return e[0]=t[1],e[1]=-n,e}function sa(e,t){return e[0]*t[0]+e[1]*t[1]}function ca(e,t){return e[0]===t[0]&&e[1]===t[1]}function la(e){return Math.hypot(e[0],e[1])}function ua(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function da(e){return ia(e,la(e))}function fa(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function pa(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 ma(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 ha(e,t,n){return W(e,K(G(t,e),n))}function ga(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 _a(e,t,n){return W(e,K(t,n))}var q=[0,0],J=[0,0],Y=[0,0];function va(e,t){let n=_a(e,da(aa(G(e,W(e,[1,1])))),-t),r=[],i=1/13;for(let t=i;t<=1;t+=i)r.push(pa(n,e,Ji*2*t));return r}function ya(e,t,n){let r=[],i=1/n;for(let n=i;n<=1;n+=i)r.push(pa(t,e,Ji*n));return r}function ba(e,t,n){let r=G(t,n),i=K(r,.5),a=K(r,.51);return[G(e,i),G(e,a),W(e,a),W(e,i)]}function xa(e,t,n,r){let i=[],a=_a(e,t,n),o=1/r;for(let t=o;t<1;t+=o)i.push(pa(a,e,Ji*3*t));return i}function Sa(e,t,n){return[W(e,K(t,n)),W(e,K(t,n*.99)),G(e,K(t,n*.99)),G(e,K(t,n))]}function Ca(e,t,n){return e===!1||e===void 0?0:e===!0?Math.max(t,n):e}function wa(e,t,n){return e.slice(0,10).reduce((e,r)=>{let i=r.pressure;return t&&(i=$i(e,r.distance,n)),(e+i)/2},e[0].pressure)}function Ta(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=Ca(s.taper,n,m),g=Ca(c.taper,n,m),_=(n*r)**2,v=[],y=[],ee=wa(e,a,n),b=Zi(n,i,e[e.length-1].pressure,o),x,S=e[0].vector,C=e[0].point,w=C,T=C,E=w,D=!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=$i(ee,l,n)),b=Zi(n,i,r,o)):b=n/2,x===void 0&&(x=b);let te=u<h?d(u/h):1,ne=m-u<g?p((m-u)/g):1;b=Math.max(.01,b*Math.min(te,ne));let O=(f?e[t]:e[t+1]).vector,k=f?1:sa(c,O),re=sa(c,S)<0&&!D,ie=k!==null&&k<0;if(re||ie){oa(q,S),ra(q,q,b);for(let e=0;e<=1;e+=.07692307692307693)na(J,s,q),ma(J,J,s,Ji*e),T=[J[0],J[1]],v.push(T),ta(Y,s,q),ma(Y,Y,s,Ji*-e),E=[Y[0],Y[1]],y.push(E);C=T,w=E,ie&&(D=!0);continue}if(D=!1,f){oa(q,c),ra(q,q,b),v.push(G(s,q)),y.push(W(s,q));continue}ga(q,O,c,k),oa(q,q),ra(q,q,b),na(J,s,q),T=[J[0],J[1]],(t<=1||ua(C,T)>_)&&(v.push(T),C=T),ta(Y,s,q),E=[Y[0],Y[1]],(t<=1||ua(w,E)>_)&&(y.push(E),w=E),ee=r,S=c}let te=[e[0].point[0],e[0].point[1]],ne=e.length>1?[e[e.length-1].point[0],e[e.length-1].point[1]]:W(e[0].point,[1,1]),O=[],k=[];if(e.length===1){if(!(h||g)||l)return va(te,x||b)}else{h||g&&e.length===1||(u?O.push(...ya(te,y[0],13)):O.push(...ba(te,v[0],y[0])));let t=aa(ea(e[e.length-1].vector));g||h&&e.length===1?k.push(ne):f?k.push(...xa(ne,t,b,29)):k.push(...Sa(ne,t,b))}return v.concat(k,y.reverse(),O)}var Ea=[0,0];function Da(e){return e!=null&&e>=0}function Oa(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=Yi})=>[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(ha(o[0],e,t/4))}o.length===1&&(o=[...o,[...W(o[0],Xi),...o[0].slice(2)]]);let s=[{point:[o[0][0],o[0][1]],pressure:Da(o[0][2])?o[0][2]:.25,vector:[...Xi],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]]:ha(u.point,o[e],a);if(ca(u.point,t))continue;let n=fa(t,u.point);if(l+=n,e<d&&!c){if(l<r)continue;c=!0}na(Ea,u.point,t),u={point:t,pressure:Da(o[e][2])?o[e][2]:Yi,vector:da(Ea),distance:n,runningLength:l},s.push(u)}return s[0].vector=s[1]?.vector||[0,0],s}function ka(e,t={}){return Ta(Oa(e,t),t)}function Aa(e){return e.highlighter?e.strokeWidth*3:e.strokeWidth}function ja(e){if(e.length<3)return``;let t=`M${(e[0][0]+e[1][0])/2} ${(e[0][1]+e[1][1])/2}`;for(let n=1;n<=e.length;n+=1){let[r,i]=e[n%e.length],[a,o]=e[(n+1)%e.length];t+=`Q${r} ${i} ${(r+a)/2} ${(i+o)/2}`}return t+`Z`}function Ma(e){return{size:Aa(e)*2,thinning:0,smoothing:.5,streamline:.5,simulatePressure:!1,last:!0}}function Na(e){return ja(ka(e.points.map(e=>[e.x,e.y]),Ma(e)))}function Pa(e){let t=Oa(e.points.map(e=>[e.x,e.y]),Ma(e)).map(e=>e.point);if(t.length<2)return``;let n=`M${t[0][0]} ${t[0][1]}`;for(let e=1;e<t.length-1;e+=1){let[r,i]=t[e],[a,o]=t[e+1];n+=`Q${r} ${i} ${(r+a)/2} ${(i+o)/2}`}let r=t[t.length-1];return`${n}L${r[0]} ${r[1]}`}function Fa(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}}var Ia={top:0,right:0,bottom:0,left:0},La=.46,Ra=.28,za=.2,Ba=.35,Va=.4,Ha=.35;function Ua(e,t,n,r){let i=Wa(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 Wa(e,t,n){let r={x:0,y:0,width:t,height:n};if(e===`multi-process`){let e=Ci(r);return{top:2*e,right:2*e,bottom:0,left:0}}if(e===`multi-document`){let e=Ci(r);return{top:2*e,right:2*e,bottom:(n-2*e)*$r,left:0}}if(e===`cube`){let e=ci(r);return{top:e,right:e,bottom:0,left:0}}if(e===`double-circle`){let e=Math.min(t,n)*Oi+6;return{top:e,right:e,bottom:e,left:e}}if(e===`cylinder`)return{top:2*Wr(r),right:0,bottom:0,left:0};if(e===`queue`){let e=Gr(r);return{top:0,right:e,bottom:0,left:2*e}}if(e===`document`)return{top:0,right:0,bottom:n*$r,left:0};if(e===`speech-bubble`)return{top:0,right:0,bottom:n*(1-mi),left:0};if(e===`callout`)return{top:0,right:0,bottom:n*(1-pi),left:0};if(e===`actor`)return{top:n*di,right:0,bottom:0,left:0};if(e===`triangle`)return{top:n*La,right:0,bottom:0,left:0};if(e===`cloud`)return{top:n*Ra,right:0,bottom:0,left:0};if(e===`pentagon`)return{top:0,right:ri(r),bottom:0,left:0};if(e===`chevron`)return{top:0,right:0,bottom:0,left:ai(r)*Ha};if(e===`manual-input`)return{top:n*za,right:0,bottom:0,left:0};if(e===`delay`)return{top:0,right:bi(r)*Va,bottom:0,left:0};if(e===`package`)return{top:ji(r),right:0,bottom:0,left:0};if(e===`component`)return{top:0,right:0,bottom:0,left:Pi(r)+4};if(e===`brace`)return{top:0,right:0,bottom:0,left:Ii(r)+8};if(e===`arrow-up`||e===`arrow-down`||e===`arrow-left`||e===`arrow-right`){let t=Yr(r,e.slice(6))*Ba;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 Ia}var Ga=14*.3;function Ka(e){return Math.max(14,Math.round(e))}function qa(e){return Math.max(6,Math.round(e*.35))}var Ja={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 Ya(e,t,n,r){if(r?.x||r?.y){let i=Ya(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:Wr({x:0,y:0,width:t,height:n})};if(e===`queue`)return{x:Gr({x:0,y:0,width:t,height:n}),y:0};let i=Ja[e]??{fx:0,fy:0};return{x:i.fx*t,y:i.fy*n}}var Xa=1.25,Za=1.15;function Qa(e){let{kind:t,width:n,height:r,fontSize:i,lineHeight:a,textPadding:o,flipX:s,flipY:c}=e,l=Ua(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 $a=.917,eo=.292,to=($a-eo)/2;function no(e,t){return e*t/2+e*to}function ro(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 io={blue:`#e7f5ff`,green:`#ebfbee`,red:`#fff5f5`,orange:`#fff4e6`,violet:`#f3f0ff`,teal:`#e6fcf5`,pink:`#fff0f6`,yellow:`#fff9db`,gray:`#f8f9fa`},ao={blue:a.blue.bold,green:a.green.bold,red:a.red.bold,orange:a.orange.bold,violet:a.purple.bold,teal:a.teal.bold,pink:a.pink.bold,yellow:a.yellow.bold,gray:a.gray.bold},oo=`#1e1e1e`,X={ink:`token:ink`,inkMuted:`token:ink-muted`,inkInverse:`token:ink-inverse`,paper:`token:paper`,paperGrid:`token:paper-grid`,paperLine:`token:paper-line`},so={[X.ink]:{var:`var(--canvas-ink)`,key:`ink`,lit:`#1e1e1e`},[X.inkMuted]:{var:`var(--canvas-ink-muted)`,key:`inkMuted`,lit:`#495057`},[X.inkInverse]:{var:`var(--canvas-ink-inverse)`,key:`inkInverse`,lit:`#ffffff`},[X.paper]:{var:`var(--paper-bg)`,key:`paperBg`,lit:`#ffffff`},[X.paperGrid]:{var:`var(--paper-grid)`,key:`paperGrid`,lit:`#eceef0`},[X.paperLine]:{var:`var(--paper-line)`,key:`paperLine`,lit:`#dee2e6`}},co=Object.fromEntries(Object.values(so).map(e=>[e.key,e.lit]));function lo(e){return so[e]?.var??e}function uo(e){return e===void 0?void 0:lo(e)}function fo(e){return Object.values(so).find(t=>t.var===e)?.lit??e}function po(e,t){let n=so[e];return n?t?t[n.key]:n.lit:e}var mo={"#1e1e1e":X.ink,"#495057":X.inkMuted,"#ffffff":X.inkInverse},ho={"#ffffff":X.paper,"#eceef0":X.paperGrid,"#dee2e6":X.paperLine};function go(e){return mo[e]??e}function _o(e){return lo(go(e))}function vo(e){return e===X.inkInverse?X.ink:so[e]?X.paper:void 0}function yo(e,t){return po(go(e),t)}function bo(e){return uo(e===void 0?void 0:ho[e]??e)}function xo(e,t){return po(ho[e]??e,t)}var So=new Map(Object.keys(io).map(e=>[io[e],ao[e]]));function Co(e){if(e===`#ffffff`)return lo(X.paper);if(t(e,0)>.9){let t=So.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 lo(e)}var wo=.08,To=.1;function Eo(e,n){if(e!==`#ffffff`&&t(e,0)>.9&&t(n.bg,1)<.5){let t=So.get(e);return jo(e,t?jo(t,n.bg,To):n.bg,wo)}return po(e===`#ffffff`?X.paper:e,n)}var Do=.32,Oo=.4;function ko(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 Ao(e,n){return t(n.bg,1)>=.5?{pastel:e.pastel,fill:e.pastel,stroke:n.ink}:{pastel:e.pastel,fill:jo(e.bold,n.bg,Do),stroke:jo(n.ink,e.bold,Oo)}}function jo(e,t,n){let r=o(e),i=o(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 Mo(e){return e&&t(e.paperBg,0)<.5?`screen`:`multiply`}function No(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 Po=RegExp(`<(?:${[`strong`,`em`,`u`,`s`,`code`,`mark`,`a`,`span`,`i`,`b`,`del`,`strike`,`ul`,`ol`,`li`,`br`,`div`,`p`].join(`|`)})\\b`,`i`);function Fo(e){return Po.test(e)}function Io(e){return e.replace(/\u200B/g,``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Lo(e){return Io(e).replace(/"/g,`&quot;`)}function Ro(e){return`<ul>${e.map(e=>`<li>${Io(e)}</li>`).join(``)}</ul>`}function zo(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 Bo(e,t){return t===1?e:e.replace(/font-size:\s*(\d+(?:\.\d+)?)px/gi,(e,n)=>`font-size:${Math.round(c(Number(n)*t,8,240))}px`)}function Vo(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 Ho(e){let t=``;return e.childNodes.forEach(e=>{t+=Wo(e)}),t}function Uo(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"`:``}>${Ho(e)}</li>`}}),r?`<${t}${n?` data-checklist="true"`:``}>${r}</${t}>`:``}function Wo(e){if(e.nodeType===3)return Io(e.nodeValue??``);if(e.nodeType!==1)return``;let t=e,n=t.tagName.toLowerCase();if(n===`br`)return`<br>`;let r=Ho(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=ro(t.getAttribute(`href`));return e&&r?`<a href="${Lo(e)}">${r}</a>`:r}if(n===`ul`||n===`ol`)return Uo(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>`),Vo(n.backgroundColor)&&(e=`<mark>${e}</mark>`);let i=Vo(n.color);i&&(e=`<span style="color:${i}">${e}</span>`);let a=zo(n.fontSize);return a&&(e=`<span style="font-size:${a}px">${e}</span>`),e}return r}function Go(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+=Ho(e);return}if(n===`ul`||n===`ol`){t+=Uo(e);return}}t+=Wo(e)}),t}function Ko(){return Promise.resolve()}function qo(){return globalThis.DOMParser!==void 0}function Jo(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 Yo(e){return Jo(e)}function Xo(e){return Go(Yo(e))}function Zo(e){return e?Fo(e)?Xo(e).replaceAll(`<a href="`,`<a target="_blank" rel="noopener noreferrer" href="`).replace(/<span style="color:([^"]+)">/g,(e,t)=>{let n=go(Qo(t));return n.startsWith(`token:`)?`<span data-ink="${n.slice(6)}" style="color:${t}">`:e}):Io(e):``}function Qo(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 $o(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} ${$o(r,t)}`;return}if(i===`div`||i===`p`||i===`ul`||i===`ol`){n&&!n.endsWith(`
5
+ `)&&(n+=`
6
+ `),n+=$o(r,i===`ul`||i===`ol`?t+1:t);return}n+=$o(r,t)}),n}function es(e){return e?Fo(e)?$o(Yo(e)):e:``}function ts(e){return es(e).trim().length===0}function ns(e){return Fo(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 rs(e){return qo()?es(e):ns(e)}function is(e){if(!e||!Fo(e))return e;let t=Yo(e);return t.querySelectorAll(`span`).forEach(e=>{e.style.color=``}),Go(t)}function as(e,t){let n=Yo(Zo(e)),r=n.querySelectorAll(`ul[data-checklist] > li`)[t];return r?(r.hasAttribute(`data-checked`)?r.removeAttribute(`data-checked`):r.setAttribute(`data-checked`,`true`),Go(n)):null}function os(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 ds(e))for(let e of t.runs)if(e.text.trim()!==``&&(r=!0,!n(e)))return!1;return r}function ss(e,t){let n=e.parentElement;for(;n;){if(n.tagName.toLowerCase()===t)return!0;n=n.parentElement}return!1}function cs(e,t,n){if(n)return ls(e,t)??e;let r=Yo(Zo(e));return r.querySelectorAll(t).forEach(e=>{let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}),Go(r)}function ls(e,t,n={}){let r=Yo(Zo(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 Go(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`&&ss(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 Go(r)}var us={bold:!1,italic:!1,underline:!1,strike:!1,code:!1,highlight:!1};function ds(e){let t=Yo(Zo(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:ro(c.getAttribute(`href`))??t.href});return}if(l===`span`){s(c,{...t,color:Vo(c.style.color)??t.color,fontSize:zo(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,us);n.length>1;){let e=n[n.length-1];if(e.runs.length===0&&!e.marker)n.pop();else break}return n}var fs=`93B[bw]4ABK]0B2IVCVYXUXMVU23]]]OuX_bc]Wec<R[UpefZhbXWcYtTVXBG?PY1TTQUW<US56M4lTTUVAM<SL^KILG3Ga`,ps=32,ms=126,hs=.55,gs=1;function _s(e){return e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65280&&e<=65376||e>=126976}function vs(e,t){let n=0;for(let t of e){let e=t.codePointAt(0)??0;if(e>=ps&&e<=ms){n+=(fs.charCodeAt(e-ps)-32)/100;continue}n+=_s(e)?gs:hs}return n*t}var ys={rectangle:{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},arrow:{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},text:{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},sticky:{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},draw:{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},polygon:{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},line:{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},image:{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},icon:{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},figure:{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},table:{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},chart:{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},control:{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},web:{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}};function bs(e){return e.type===`control`&&e.kind===`lifeline`?!1:ys[e.type].rotatable}function xs(e){return ys[e.type].geometry===`box`}function Ss(e){return ys[e.type].fill}function Cs(e){return e.type===`figure`||e.type===`control`}function ws(e){return{strokeWidth:e.strokeWidth??1.5,dash:e.dash??`solid`}}var Ts={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 Es(e,t){return Ts[t].includes(ys[e.type].animate)}var Ds={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 Os(e,t){return Ds[e]?.includes(t)??!1}function ks(e){return e.type===`rectangle`&&e.fill===`transparent`}function As(e){throw Error(`Unhandled shape type: ${e.type??`unknown`}`)}function Z(e,t){if(xs(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)};if(e.type===`arrow`)return gn(e);if(e.type===`draw`||e.type===`polygon`||e.type===`line`)return Fa(e.points);if(e.type===`table`)return{x:e.x,y:e.y,width:e.colWidths.reduce((e,t)=>e+t,0),height:e.rowHeights.reduce((e,t)=>e+t,0)};if(e.type===`text`){let n=t?.textBounds(e.id);if(n)return{x:e.x,y:e.y,width:n.width,height:n.height};let r=ns(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)}}return As(e)}function js(e,t,n){let r=Math.cos(n),i=Math.sin(n),a=e.x-t.x,o=e.y-t.y;return{x:t.x+a*r-o*i,y:t.y+a*i+o*r}}function Ms(e){let t=Z(e);return{x:t.x+t.width/2,y:t.y+t.height/2}}function Ns(e){return bs(e)&&(xs(e)||e.type===`text`||e.type===`table`)?e.rotation??0:0}function Ps(e){return bs(e)&&(xs(e)||e.type===`text`||e.type===`table`)}function Fs(e){return Math.max(2,Math.round(e*.2))}function Is(e,t){let n=Z(e,t);if(e.type===`icon`&&e.label){let r=n.x+n.width/2,i=e.fontSize??36,a,o,s=t?.iconLabelBounds(e.id);if(s)a=s.width,o=s.height;else{let t=rs(e.label).split(`
11
+ `),n=Math.max(i*.58,...t.map(e=>vs(e,i)));a=Math.min(n,200),o=Math.round(i*1.45+(t.length-1)*i*Xa)}let c=Math.min(n.x,r-a/2),l=Math.max(n.x+n.width,r+a/2),u=n.y+n.height+Fs(i)+o;return{x:c,y:n.y,width:l-c,height:u-n.y}}return n}var Ls=new WeakMap;function Rs(e){return e.type===`text`||e.type===`icon`&&!!e.label}function zs(e,t){if(Rs(e))return Bs(e,t);let n=Ls.get(e);if(n)return n;let r=Bs(e);return Ls.set(e,r),r}function Bs(e,t){let n=Is(e,t),r=Ns(e);if(!r)return n;let i=Z(e,t);return Vs(n,{x:i.x+i.width/2,y:i.y+i.height/2},r*Math.PI/180)}function Vs(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=>js(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 Hs(e,t){if(!t)return e;let n=t*Math.PI/180;return Vs(e,{x:e.x+e.width/2,y:e.y+e.height/2},n)}var Us=new WeakMap;function Ws(e){let t=Us.get(e);if(t)return t;let n=Gs(e);return Us.set(e,n),n}function Gs(e){return Hs(Z(e),Ns(e))}function Ks(e){return Number.isFinite(Ns(e))&&l(Z(e))}function qs(e){for(let t of e)if(!Ks(t))return e.filter(Ks);return e}function Js(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=zs(o,t);l(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 Ys(e){return{x:e.includes(`e`)?1:e.includes(`w`)?-1:0,y:e.includes(`s`)?1:e.includes(`n`)?-1:0}}function Xs(e,t,n){return Math.max(0,(e-t)*n)}function Zs(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 Qs(e,t,n,r,i=!1){let{box:a,fontSize:o,width:s,height:l}=r,u=a.x+a.width/2,d=a.y+a.height/2,f=Ys(t);if(t===`n`||t===`s`){let r=t===`s`?a.y:a.y+a.height,i=Math.max(o,Xs(n.y,r,f.y));return{...e,y:f.y===1?r:r-i,height:i}}if(t===`w`||t===`e`){if(i){let t=Math.abs(n.x-u);return{...e,x:u-t,width:Math.max(o,t*2)}}let r=t===`e`?a.x:a.x+a.width,s=Math.max(o,Xs(n.x,r,f.x));return{...e,x:f.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=c(o*(i?Math.max(Math.abs(n.x-u)/(a.width/2||1),Math.abs(n.y-d)/(a.height/2||1)):Math.max(Xs(n.x,p,f.x)/(a.width||1),Xs(n.y,m,f.y)/(a.height||1))),8,240),g=h/o,_=a.width*g,v=a.height*g,y={...e,fontSize:h,text:Bo(e.text,g)};return i?(y.x=u-_/2,y.y=d-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),l!=null&&(y.height=l*g),y}function $s(e){return e.height==null?e.width==null?`auto-width`:`auto-height`:`fixed`}function ec(e,t){let n=Z(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 tc(e,t){if(e.type===`arrow`){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}return e.type===`draw`||e.type===`polygon`||e.type===`line`?{...e,points:e.points.map(e=>({x:e.x+t.x,y:e.y+t.y}))}:xs(e)||e.type===`text`||e.type===`table`?{...e,x:e.x+t.x,y:e.y+t.y}:As(e)}function nc(e,t,n){if(e.type===`arrow`){let r=js({x:e.x,y:e.y},t,n),i=js({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}}if(e.type===`draw`||e.type===`polygon`||e.type===`line`)return{...e,points:e.points.map(e=>js(e,t,n))};let r=Z(e),i=js({x:r.x+r.width/2,y:r.y+r.height/2},t,n),a={...e,x:i.x-r.width/2,y:i.y-r.height/2};return bs(e)?{...a,rotation:(e.rotation??0)+n*180/Math.PI}:a}function rc(e,t,n,r){let i=e=>t.x+(e-t.x)*n,a=e=>t.y+(e-t.y)*r;if(e.type===`arrow`)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};if(e.type===`text`){let t={...e,x:i(e.x),y:a(e.y),fontSize:e.fontSize*r,text:Bo(e.text,r)};return e.width!=null&&(t.width=e.width*n),t}if(e.type===`draw`||e.type===`polygon`||e.type===`line`)return{...e,points:e.points.map(e=>({x:i(e.x),y:a(e.y)}))};if(e.type===`table`)return{...e,x:i(e.x),y:a(e.y),colWidths:e.colWidths.map(e=>e*n),rowHeights:e.rowHeights.map(e=>e*r)};if(e.type===`sticky`){let t=Z(e),n=i(t.x+t.width/2),r=a(t.y+t.height/2);return{...e,x:n-t.width/2,y:r-t.height/2}}if(e.type===`icon`){let t=Z(e),o=(n+r)/2;return{...e,x:i(t.x),y:a(t.y),width:t.width*o,height:t.height*o,fontSize:e.fontSize*o}}let o=Z(e);return{...e,x:i(o.x),y:a(o.y),width:o.width*n,height:o.height*r}}function ic(e,t){let n=Js(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=e=>({x:s(e.x),y:c(e.y)});return e.map(e=>{if(e.type===`arrow`){let t=l({x:e.x,y:e.y}),n=l({x:e.x2,y:e.y2});return{...e,x:t.x,y:t.y,x2:n.x,y2:n.y,bend:-e.bend,bow:e.bow==null?e.bow:-e.bow,elbowPoints:e.elbowPoints?.map(l),elbowRoute:void 0,elbowMidHandle:void 0,startBinding:sc(e.startBinding,i,r),endBinding:sc(e.endBinding,i,r)}}if(e.type===`polygon`&&e.band)return{...e,points:e.points.map(l),band:cc(e.band,i,r)};if(e.type===`draw`||e.type===`polygon`||e.type===`line`)return{...e,points:e.points.map(l)};let t=Z(e),n=l({x:t.x+t.width/2,y:t.y+t.height/2}),a={...e,x:n.x-t.width/2,y:n.y-t.height/2,rotation:-Ns(e)};if(a.type===`text`||a.type===`icon`||a.type===`image`)return{...a,flipX:r?!a.flipX:a.flipX,flipY:r?a.flipY:!a.flipY};if(a.type===`rectangle`){let e=Ui(a.kind),t=r&&e.x?!a.flipX:a.flipX,n=!r&&e.y?!a.flipY:a.flipY;return{...a,flipX:t||void 0,flipY:n||void 0}}return a})}var ac={n:`n`,s:`s`,e:`w`,w:`e`,ne:`nw`,nw:`ne`,se:`sw`,sw:`se`},oc={n:`s`,s:`n`,e:`e`,w:`w`,ne:`se`,se:`ne`,nw:`sw`,sw:`nw`};function sc(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?ac:oc;return{...e,anchor:r,port:i[e.port]}}function cc(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}}function lc(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 uc={width:160,height:100};function dc(e){return e===`drawnicons`?96:55}function fc(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 pc(e,t){return Math.max(0,t)/55*e}function mc(e,t){return(e-3)*(Math.max(0,t)/55)}function hc(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}:uc}function gc(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`shape-${Date.now()}-${Math.floor(Math.random()*1e6)}`}function _c(e){return{id:gc(),type:`rectangle`,kind:`rectangle`,rotation:0,label:``,fontSize:16,fontFamily:_,color:d,fill:`transparent`,strokeWidth:1.5,dash:`solid`,opacity:1,...e}}function vc(e,t){if(!e)return null;let n=t.get(e.shapeId);return n?{...e,shapeId:n}:null}function yc(e,t){let n=new Map,r=new Map,i=new Map,a=new Map;for(let t of e)n.set(t.id,gc()),t.groupId&&i.set(t.groupId,(i.get(t.groupId)??0)+1),t.groupId&&!r.has(t.groupId)&&r.set(t.groupId,gc()),t.lockId&&!a.has(t.lockId)&&a.set(t.lockId,gc());return e.map(e=>{let o={...tc(e,t),id:n.get(e.id)};return 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=vc(o.startBinding,n),o.endBinding=vc(o.endBinding,n)),o.type===`figure`&&o.flows&&(o.flows=lc(o.flows,e=>n.get(e))),o})}function bc(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 xc=2;function Sc(e,t){return e===`rounded`?Math.min(12,Math.abs(t.width)/2,Math.abs(t.height)/2):xc}var Cc=Mr.generator(),wc=1,Tc=1,Ec=.45,Dc=.2,Oc=250,kc=.5;function Ac(e){return e<=Oc?1:Math.max(kc,Oc/e)}var jc=.3,Mc=220,Nc=.35;function Pc(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)%2**31}var Fc=2e3,Ic=new Map;function Lc(e,t){Ic.size>=Fc&&Ic.delete(Ic.keys().next().value),Ic.set(e,t)}function Rc(e,t,n,r=wc,i=Tc){let a=`${t}|${n}|${r}|${i}|${e}`,o=Ic.get(a);if(o)return o;let s=Cc.path(e,{seed:t,roughness:r,bowing:i,disableMultiStroke:!0,preserveVertices:!0,strokeWidth:n}),c=Cc.toPaths(s).map(e=>e.d);return Lc(a,c),c}function zc(e){let t=Z(e),n={x:0,y:0,width:t.width,height:t.height},r=Wi(e.kind,n,e.corner,{x:e.flipX,y:e.flipY}),i=c(Math.min(t.width,t.height)/Mc,Nc,1);return Rc(r,Pc(e.id),e.strokeWidth,wc*i,jc*i)}function Bc(e,t,n){let r=Pc(t.id)+n;if(n>0)return Rc(e,r,1.5,.5,jc);let i=Z(t),a=c(Math.min(i.width,i.height)/Mc,Nc,1);return Rc(e,r,1.5,wc*a,jc*a)}function Vc(e,t,n,r,i){let a=Pc(r.id)+i,o=`disc|${a}|${e.toFixed(1)}|${t.toFixed(1)}|${n.toFixed(1)}`,s=Ic.get(o);if(s)return s;let c=Cc.circle(e,t,n*2,{seed:a,roughness:wc,bowing:Tc,fill:`#000000`,fillStyle:`solid`,stroke:`none`,disableMultiStroke:!0}),l=Cc.toPaths(c).filter(e=>e.fill&&e.fill!==`none`).map(e=>e.d);return Lc(o,l),l}function Hc(e,t,n,r){let i=Z(t),a=c(Math.min(i.width,i.height)/Mc,Nc,1);return Rc(e,Pc(t.id)+n,r,wc*a,jc*a)}function Uc(e){return e.bendStyle===`elbow`?f(P(e)):Math.hypot(e.x2-e.x,e.y2-e.y)+Math.abs(e.bend)}function Wc(e){let t=Ac(Uc(e));return Rc(un(e),Pc(e.id),e.strokeWidth,Ec*t,Dc*t)}function Gc(e){let t=Ac(f(e.points));return Rc(bn(e.points),Pc(e.id),e.strokeWidth,Ec*t,Dc*t)}var Kc=`#8a8f98`,qc=2,Jc=1.5,Yc=`#4dabf7`;function Q(e,t,n,r=qc,i){return Hc(t,e.shape,e.nextSalt(),r).map(e=>({kind:`path`,d:e,stroke:n,width:r,testId:i}))}function Xc(e,t,n,r){return[{kind:`rect`,x:t.x,y:t.y,width:t.width,height:t.height,rx:n,fill:r},...Q(e,V(t.x,t.y,t.width,t.height,n),e.ink)]}function Zc(e,t,n,r,i,a={}){return{kind:`text`,x:t,y:n,text:r,size:a.size??e.shape.fontSize,color:i,family:e.shape.fontFamily,anchor:a.anchor??`start`,baseline:a.baseline??`middle`,testId:a.testId}}function Qc(e,t,n){return e.text.measure(t,n??e.shape.fontSize,e.shape.fontFamily)}function $c(e){return!e.fill||e.fill===`transparent`?null:e.fill}var el=1.6,tl=.85,nl=.85;function rl(e){return Math.min(7,e.height*.18)}function il(e){return 12+rl(e)*2+12}function al(e){return Math.min(26,e.height)}function ol(e){return al(e)*1.9+10}function sl(e){return Math.min(e.height,e.width/3)}function cl(e){return Math.min(e.height*.28,13)}function ll(e){return cl(e)*2+24}function ul(e,t){let n=[],r=``;for(let i of e.split(/\s+/)){let e=r.length===0?i:`${r} ${i}`;e.length>t&&r.length>0?(n.push(r),r=i):r=e}return r.length>0&&n.push(r),n}function dl(e,t,n){let r=n*.52;return ul(e,Math.max(4,Math.floor(t/r)))}function fl(e,t,n){return e.split(/\r?\n/).flatMap(e=>e?dl(e,t,n):[``])}var pl=`#e7f5ff`;function ml(e,t){let n=$c(e.shape);if(!n)return[];let{bounds:r}=e;return[{kind:`rect`,x:r.x,y:r.y,width:r.width,height:r.height,rx:t,fill:n}]}function hl(e,t){let{bounds:n,ink:r}=e,i=ml(e,t);return i.push(...Q(e,V(n.x,n.y,n.width,n.height,t),r)),i}function gl(e){return e.split(` | `).map(e=>e.trim()).filter(e=>e.length>0)}function _l(e,t){return t===0?0:Math.max(0,Math.min(t-1,Math.round(e.value??0)))}var vl=`+id: string
12
+ +name: string
13
+ ---
14
+ +save()
15
+ +delete()`,yl=1.9,bl=1.4,xl=/^-{2,}$/;function Sl(e){return(e??``).split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0)}function Cl(e){return Sl(e.body).map(e=>({text:e,divider:xl.test(e)}))}function wl(e){return Cl(e).filter(e=>!e.divider).map(e=>e.text)}function Tl(e){let t=e.fontSize*.9;return{fontSize:t,lineH:t*bl}}function El(e){let t=Z(e),n=wl(e).length===0?t.height:Math.min(t.height,e.fontSize*yl),r=t.x+12,i=t.width-24,{fontSize:a}=Tl(e),o=t.y+n+4,s=t.y+t.height-4;return{title:{field:`label`,x:t.x,y:t.y,width:t.width,height:n,fontSize:e.fontSize},body:{field:`body`,x:r,y:o,width:i,height:Math.max(a,s-o),fontSize:a}}}function Dl(e,t,n){let r=n*.9,i=r*bl,a=n*yl,o=Math.round(a+4+t.length*i+8),s=(e,t)=>e.length*t*.62,c=Math.max(s(e,n),0,...t.filter(e=>!xl.test(e)).map(e=>s(e,r)));return{width:Math.max(160,Math.round(c+24+16)),height:o}}function Ol(e){let t=El(e),{lineH:n}=Tl(e),r=Z(e).y+e.height;return Cl(e).map((e,r)=>({text:e.text,cy:t.body.y+n*(r+.5),divider:e.divider})).filter(e=>e.cy<=r)}function kl(e){let t=Z(e);return Ol(e).filter(e=>!e.divider).map(({cy:e})=>({cy:e,left:{x:t.x,y:e},right:{x:t.x+t.width,y:e}}))}function Al(t){let{bounds:n,shape:r,ink:i}=t,a=El(r),o=n.y+a.title.height,s=wl(r).length>0,c=$c(r),l=[];c&&l.push({kind:`path`,d:s?Nr(n.x,n.y,n.width,a.title.height,6):V(n.x,n.y,n.width,n.height,6),fill:c,testId:`entity-header`}),l.push(...Q(t,V(n.x,n.y,n.width,n.height,6),i)),s&&l.push(...Q(t,Fr(n.x,o,n.x+n.width,o),i,Jc));let u=r.label.trim();u&&l.push(Zc(t,n.x+n.width/2,n.y+a.title.height/2,u,c?e(c):i,{anchor:`middle`,testId:`entity-title`}));for(let{text:e,cy:o,divider:s}of Ol(r)){if(s){l.push(...Q(t,Fr(n.x,o,n.x+n.width,o),i,Jc,`entity-divider`));continue}l.push(Zc(t,a.body.x,o,e,i,{size:a.body.fontSize,testId:`entity-row`}))}return l}function jl(e){return Math.min(e.height,Ml(e.fontSize))}function Ml(e){return e*2.4}var Nl=12;function Pl(e){if(!e.activations||e.activations.length===0)return[];let t=jl(e),n=e.height;return e.activations.map(r=>{let i=Math.min(Math.max(r.top,t),Math.max(t,n-12)),a=Math.max(12,Math.min(r.height,n-i));return{x:e.x+e.width/2-Nl/2,y:e.y+i,width:Nl,height:a}})}function Fl(e,t){for(let n of Pl(e))if(t>=n.y&&t<=n.y+n.height)return n;return null}function Il(e){let t=jl(e);return{x:e.x+e.width/2,y:e.y+t,width:0,height:Math.max(2,e.height-t)}}function Ll(e){let t=jl(e),n=Math.max(0,e.height-t),r=Math.min(Math.max(n*.12,16),64);return{top:t+r,height:Math.max(12,n-r*2)}}function Rl(e){let t=Pl(e);if(t.length===0)return Ll(e);let n=jl(e),r=t.map(t=>({top:t.y-e.y,bottom:t.y-e.y+t.height})).sort((e,t)=>e.top-t.top),i=[],a=n;for(let e of r)e.top>a&&i.push({start:a,end:e.top}),a=Math.max(a,e.bottom);a<e.height&&i.push({start:a,end:e.height});let o=i.sort((e,t)=>t.end-t.start-(e.end-e.start))[0];if(!o)return{top:Math.max(n,e.height-12),height:12};let s=o.end-o.start,c=Math.min(Math.max(s*.15,10),48);return{top:o.start+c,height:Math.max(12,s-c*2)}}var zl=12,Bl=7,Vl=1.5;function Hl(t){let n=$c(t);return n?e(n):null}function Ul(e){let{bounds:t,shape:n,ink:r}=e,i=jl(n),a=t.x+t.width/2,o=$c(n)??X.paper,s=Xc(e,{x:t.x,y:t.y,width:t.width,height:i},6,o);n.label.trim()&&s.push(Zc(e,a,t.y+i/2,n.label.trim(),Hl(n)??r,{anchor:`middle`,testId:`lifeline-name`}));let c=t.y+t.height;for(let e=t.y+i;e<c;e+=zl)s.push({kind:`line`,x1:a,y1:e,x2:a,y2:Math.min(e+Bl,c),stroke:r,width:Vl});for(let t of Pl(n))s.push(...Xc(e,t,2,o));return s}var Wl=[`opt`,`alt`,`loop`,`par`,`break`,`critical`,`seq`],Gl=`#f3f0ff`,Kl=14,ql=8,Jl=1.75,Yl=.1;function Xl(e,t){let n=e.trimStart().match(/^\S+(\s[\s\S]*)?$/);return t+(n&&n[1]?n[1]:``)}function Zl(e){return Math.min(Z(e).height,e.fontSize*Jl)}function Ql(e,t){let n=Z(e),r=e.label.trim()||`opt`,i=Math.min(n.width,t.measure(r,e.fontSize,e.fontFamily)+24);return{x:n.x,y:n.y,width:i,height:Zl(e)}}function $l(e){let t=Math.min(ql,e.width/2,e.height/2);return{tl:Math.min(Kl,e.width-t,e.height-t),br:t}}function eu(e){let{x:t,y:n,width:r,height:i}=e,{tl:a,br:o}=$l(e);return[`M ${t+a} ${n}`,`L ${t+r} ${n}`,`L ${t+r} ${n+i-o}`,`Q ${t+r} ${n+i} ${t+r-o} ${n+i}`,`L ${t} ${n+i}`,`L ${t} ${n+a}`,`Q ${t} ${n} ${t+a} ${n}`,`Z`].join(` `)}function tu(e){let{x:t,y:n,width:r,height:i}=e,{br:a}=$l(e);return`M ${t+r} ${n} L ${t+r} ${n+i-a} Q ${t+r} ${n+i} ${t+r-a} ${n+i} L ${t} ${n+i}`}function nu(t){let{bounds:n,shape:r,ink:i}=t,a=$c(r)??`#f3f0ff`,o=Ql(r,t.text),s=[{kind:`path`,d:eu(o),fill:a,testId:`fragment-tab`}];s.push(...Q(t,V(n.x,n.y,n.width,n.height,Kl),i)),s.push(...Q(t,tu(o),i,Jc,`fragment-tab`));let c=r.label.trim();return c&&s.push(Zc(t,o.x+12,o.y+o.height/2+r.fontSize*Yl,c,e(a),{anchor:`start`,testId:`fragment-label`})),s}var ru={entity:Al,lifeline:Ul,fragment:nu},iu=8,au=[],$={get(e){for(let t=au.length-1;t>=0;--t)if(au[t].shapes===e)return au[t].index},has(e){return $.get(e)!==void 0},set(e,t){au.push({shapes:e,index:t}),au.length>iu&&au.shift()}};function ou(e){if(e.type===`arrow`){let t=[];return e.startBinding&&t.push(e.startBinding.shapeId),e.endBinding&&t.push(e.endBinding.shapeId),t}return e.type===`polygon`&&e.band?[e.band.from,e.band.to]:[]}function su(e){let t=new Map,n=new Map,r=new Map;for(let i=0;i<e.length;i+=1){let a=e[i];t.has(a.id)||t.set(a.id,i);let o=r.get(a.type);o?o.push(i):r.set(a.type,[i]);for(let e of ou(a)){let t=n.get(e);t?t.push(a.id):n.set(e,[a.id])}}return{position:t,dependents:n,byType:r}}function cu(e){let t=$.get(e);if(t)return t;let n=su(e);return $.set(e,n),n}function lu(e,t){if(e===t||$.has(t))return;let n=$.get(e);if(!(!n||e.length!==t.length)){for(let n=0;n<t.length;n+=1){let r=e[n],i=t[n];if(r!==i&&!du(r,i))return}$.set(t,n)}}function uu(e,t,n){if(e===t||$.has(t))return;let r=$.get(e);if(!(!r||e.length!==t.length)){for(let r of n){let n=e[r],i=t[r];if(n!==i&&!du(n,i))return}$.set(t,r)}}function du(e,t){return e.id===t.id&&e.type===t.type&&fu(e,t)}function fu(e,t){let n=ou(t);if(n.length===0)return!0;let r=ou(e);return n.every(e=>r.includes(e))}function pu(e,t){let{position:n}=cu(e),r=[];for(let e of t){let t=n.get(e);t!==void 0&&r.push(t)}return r.sort((e,t)=>e-t),r.map(t=>e[t])}function mu(e,t){let n=$.get(e);return n?(n.byType.get(t)??[]).map(t=>e[t]):e.filter(e=>e.type===t)}function hu(e){return mu(e,`figure`)}function gu(e,t){let n=$.get(e);if(n){let r=n.position.get(t);return r===void 0?void 0:e[r]}return e.find(e=>e.id===t)}var _u=.05;function vu(e){return Number.isNaN(e)?1:c(e,_u,8)}function yu(e){return{zoom:1,x:Number.isFinite(e.width)?e.width/2:0,y:Number.isFinite(e.height)?e.height/2:0}}function bu(e,t){return{x:(e.x-t.x)/t.zoom,y:(e.y-t.y)/t.zoom}}function xu(e,t){return{x:e.x*t.zoom+t.x,y:e.y*t.zoom+t.y}}function Su(e,t,n){let r=vu(t),i=bu(n,e),a=n.x-i.x*r,o=n.y-i.y*r;return!Number.isFinite(a)||!Number.isFinite(o)?{zoom:r,x:n.x,y:n.y}:{zoom:r,x:a,y:o}}function Cu(e,t,n,r=80,i=24){if(!l(e))return null;let a=xu({x:e.x,y:e.y},t),o=xu({x:e.x+e.width,y:e.y+e.height},t);if(a.x>=i&&a.y>=i&&o.x<=n.width-i&&o.y<=n.height-i)return null;if(e.width*t.zoom<=n.width-r*2&&e.height*t.zoom<=n.height-r*2){let r=e.x+e.width/2,i=e.y+e.height/2;return{zoom:t.zoom,x:n.width/2-r*t.zoom,y:n.height/2-i*t.zoom}}return wu(e,n,r)}function wu(e,t,n=80){if(!l(e))return yu(t);let r=Math.max(1,t.width-n*2),i=Math.max(1,t.height-n*2),a=vu(Math.min(r/e.width,i/e.height,1)),o=e.x+e.width/2,s=e.y+e.height/2,c={zoom:a,x:t.width/2-o*a,y:t.height/2-s*a};return!Number.isFinite(c.x)||!Number.isFinite(c.y)?yu(t):c}function Tu(e,t,n,r){return n.id===e.id?!1:n.type===`figure`?Ou(t,Z(n,r)):u(s(Z(n,r)),t)}function Eu(e,t,n){let i=Z(t,n);return e.filter(e=>(Rs(e)||r(Ws(e),i))&&Tu(t,i,e,n))}function Du(e,t,n){let r=e.map((e,t)=>({x:s(Z(e,n)).x,order:t,shape:e})).sort((e,t)=>e.x-t.x),i=r.map(e=>e.x),a=e=>{let t=0,n=i.length;for(;t<n;){let r=t+n>>1;i[r]<e?t=r+1:n=r}return t},o=e=>{let t=0,n=i.length;for(;t<n;){let r=t+n>>1;i[r]<=e?t=r+1:n=r}return t};return{members(e){let i=Z(e,n),s=a(i.x),c=o(i.x+i.width);t?.onCandidates?.(Math.max(0,c-s));let l=[];for(let t=s;t<c;t+=1){let a=r[t];Tu(e,i,a.shape,n)&&l.push(a)}return l.sort((e,t)=>e.order-t.order),l.map(e=>e.shape)}}}function Ou(e,t){return t.x>=e.x&&t.y>=e.y&&t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height}function ku(e,t){let n=Z(t);return e.some(e=>e.type===`figure`&&e.id!==t.id&&Ou(Z(e),n))}function Au(e){let t=e.filter(e=>e.type===`figure`),n=t.map(e=>Z(e)),r=new Set;for(let e=0;e<t.length;e+=1)for(let i=0;i<t.length;i+=1)if(e!==i&&Ou(n[i],n[e])){r.add(t[e].id);break}return r}function ju(e,t,n){let r=new Set(t.map(e=>e.id)),i=[...t];if(r.size>=e.length)return i;let a=t.filter(e=>e.type===`figure`),o=a.length>2?Du(e,void 0,n):null;for(let t of a){let a=o?o.members(t):Eu(e,t,n);for(let e of a)r.has(e.id)||(r.add(e.id),i.push(e))}return i}var Mu=64,Nu=480,Pu=270;function Fu(e,t){return e.type===`figure`&&e.slideOrder!==void 0&&!e.groupId&&(e.kind??`simple`)===`simple`&&!t.has(e.id)}function Iu(e){let t=hu(e);return Ru(t,Au(t))}function Lu(e){return e.filter(e=>!e.slideSkipped)}function Ru(e,t){return e.filter(e=>Fu(e,t)).sort((e,t)=>(e.slideOrder??0)-(t.slideOrder??0))}function zu(e,t){let n=(Fo(e.label)?es(e.label):e.label).trim();return n.length>0?n:`Frame ${t+1}`}function Bu(e,t){return zu(e,t).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`slide-${t+1}`}function Vu(e,t,n){let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r.map((e,t)=>({...e,slideOrder:t}))}function Hu(e,t,n=1){return e.map((e,r)=>({...e,slideOrder:r<t?r:r+n}))}function Uu(e,t,n=[]){let r=e[e.length-1],i=r&&r.width>=Nu&&r.height>=Pu,a=i?r.width:960,o=i?r.height:540,s=r?null:Js(n),c,l;return r?(c=Math.max(...e.map(e=>e.x+e.width))+Mu,l=r.y):s?(c=s.x+s.width+Mu,l=s.y+s.height/2-o/2):(c=t.x-a/2,l=t.y-o/2),{id:gc(),type:`figure`,x:c,y:l,width:a,height:o,rotation:0,label:`Frame ${e.length+1}`,fontSize:24,fontFamily:_,color:h,fill:`#ffffff`,opacity:1,slideOrder:e.length}}function Wu(e,t,n){let r=t[n],i=Eu(e,r),a={x:Math.max(...t.map(e=>e.x+e.width))+Mu-r.x,y:0},[o,...s]=yc([r,...i],a);return{clones:[{...o,slideOrder:n+1},...s],renumbered:Hu(t,n+1)}}function Gu(e,t){return new Set([t.id,...Eu(e,t).map(e=>e.id)])}function Ku(e,t){let n=Au(e);return e.filter(e=>qu(t,e,n))}function qu(e,t,n){if(t.id===e.id||t.type===`figure`&&!n.has(t.id))return!1;let r=Z(e),i=Ws(t);return i.x<r.x+r.width&&i.x+i.width>r.x&&i.y<r.y+r.height&&i.y+i.height>r.y}function Ju(e,t,n){if(n.size===0||t.length===0)return null;let r=Au(e),i=null;for(let a of e){if(!n.has(a.id))continue;let e=t.find(e=>e.id===a.id)??Yu(t,a,r);if(e){if(i&&i.id!==e.id)return null;i=e}}return i}function Yu(e,t,n){let r=null,i=1/0;for(let a of e){if(!qu(a,t,n))continue;let e=Z(a),o=e.width*e.height;o<i&&(r=a,i=o)}return r}function Xu(e,t){let n=vu(Math.min(t.width/e.width,t.height/e.height));return{zoom:n,x:t.width/2-(e.x+e.width/2)*n,y:t.height/2-(e.y+e.height/2)*n}}function Zu(e,t,n){return Qu(e,bu({x:n.width/2,y:n.height/2},t))}function Qu(e,t){let n=-1,r=1/0;return e.forEach((e,i)=>{let a=Z(e),o=t.x>=a.x&&t.x<=a.x+a.width&&t.y>=a.y&&t.y<=a.y+a.height,s=a.width*a.height;o&&s<r&&(n=i,r=s)}),n}export{Rl as $,No as $n,rn as $r,Rs as $t,gu as A,ds as An,Pr as Ar,gc as At,ru as B,X as Bn,xn as Br,Xs as Bt,bu as C,Qo as Cn,Wr as Cr,dl as Ct,lu as D,Fo as Dn,Gi as Dr,Gc as Dt,ou as E,qo as En,U as Er,Bc as Et,bl as F,Xo as Fn,Cn as Fr,pc as Ft,Zl as G,Ao as Gn,qt as Gr,Qs as Gt,Dl as H,vo as Hn,bn as Hr,Ys as Ht,Gl as I,is as In,On as Ir,Sc as It,Fl as J,_o as Jn,Bt as Jr,ec as Jt,Xl as K,Eo as Kn,P as Kr,nc as Kt,Yl as L,as as Ln,kn as Lr,bc as Lt,pu as M,Zo as Mn,V as Mr,dc as Mt,mu as N,ts as Nn,wn as Nr,hc as Nt,uu as O,os as On,Wi as Or,zc as Ot,vl as P,es as Pn,Sn as Pr,fc as Pt,Hl as Q,po as Qn,tn as Qr,Ws as Qt,Wl as R,oo as Rn,An as Rr,mc as Rt,Cu as S,Ro as Sn,Hr as Sr,ul as St,Su as T,Io as Tn,Bi as Tr,Vc as Tt,kl as U,yo as Un,sn as Ur,tc as Ut,El as V,Mo as Vn,yn as Vr,ic as Vt,Ql as W,go as Wn,F as Wr,Zs as Wt,jl as X,bo as Xn,un as Xr,Vs as Xt,Il as Y,ko as Yn,zt as Yr,$s as Yt,Ml as Z,Co as Zn,cn as Zr,Js as Zt,Eu as _,ws as _n,Aa as _r,Qc as _t,Xu as a,Et as ai,Z as an,ro as ar,nl as at,vu as b,vs as bn,ja as br,ol as bt,Vu as c,Ce as ci,zs as cn,eo as cr,_l as ct,Ju as d,_e as di,ys as dn,Qa as dr,hl as dt,Ft as ei,Is as en,fo as er,tl as et,zu as f,D as fi,Os as fn,qa as fr,rl as ft,ju as g,bs as gn,no as gr,Q as gt,Du as h,ks as hn,Ya as hr,sl as ht,Iu as i,Ot as ii,js as in,io as ir,Kc as it,cu as j,rs as jn,Fr as jr,_c as jt,hu as k,Jo as kn,Gr as kr,yc as kt,Ku as l,b as li,qs as ln,Xa as lr,cl as lt,qu as m,xs as mn,Ua as mr,gl as mt,Uu as n,Te as ni,Ps as nn,uo as nr,el as nt,Lu as o,St as oi,Ms as on,Ga as or,Yc as ot,Gu as p,ge as pi,Cs as pn,Ka as pr,il as pt,Pl as q,xo as qn,Wt as qr,rc as qt,Wu as r,Dt as ri,Fs as rn,ao as rr,pl as rt,Hu as s,ye as si,Ns as sn,$a as sr,$c as st,Zu as t,an as ti,Ks as tn,lo as tr,Jc as tt,Bu as u,ee as ui,As as un,Za as ur,ll as ut,ku as v,Es as vn,Pa as vr,Zc as vt,xu as w,Ko as wn,zi as wr,Wc as wt,wu as x,cs as xn,ka as xr,fl as xt,Au as y,Ss as yn,Na as yr,al as yt,Vl as z,co as zn,jn as zr,lc as zt};
@@ -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-CyBz17g8.js";import{D as i,E as a,T as o,a as s,g as c,h as l,l as u,m as d,n as f,o as p,p as m,r as h}from"./menu-B9BAk63v.js";import{i as g}from"./config-D8b1QyEk.js";import{a as ee,o as _}from"./editor-BeufBV54.js";import{E as v,T as y,t as b}from"./reflow-DaYiVkwp.js";import{A as x,C as S,Kn as C,Sn as w,an as te,c as ne,d as re,f as ie,fn as T,i as E,l as D,n as O,o as ae,p as oe,r as se,s as ce,t as le,u as ue,vn as k,x as de}from"./slides-D686obFO.js";import{W as fe}from"./style-BENGW2ZV.js";import{n as pe}from"./renderer-environment-D3n3hbug.js";import{A as me,C as he,D as ge,E as _e,O as ve,S as ye,T as be,_ as xe,b as Se,k as Ce,m as we,v as A,x as Te,y as Ee}from"./panel-controls-DWVXiNUZ.js";import{t as j}from"./createReactComponent-C51FAx3B.js";import{n as M,r as De,t as Oe}from"./IconTrash-C8w6ThWx.js";import{t as ke}from"./IconArrowLeft-B4Zcy-Fc.js";import{n as N,t as Ae}from"./IconPlayerStopFilled-D4qdct2R.js";import{t as je}from"./IconChevronLeft-D7e7QC0h.js";import{t as Me}from"./IconChevronRight-csfMBSUs.js";import{t as Ne}from"./IconCode-CHIz1nCU.js";import{a as Pe,c as Fe,i as P,n as Ie,o as Le,r as Re,s as ze,t as Be}from"./build-visibility-DyML9SHt.js";import{t as Ve}from"./IconPencil-D_pQsAyv.js";import{t as He}from"./IconPlus-D4tAoi-A.js";import{n as Ue,r as We,t as Ge}from"./use-drag-reorder-ye8-kpyR.js";import{t as Ke}from"./IconSparkles-CnCp3BCQ.js";import{t as qe}from"./IconX-KrRqxr2j.js";import{t as Je}from"./IconPlayerPlayFilled-DVAWmYt7.js";import{a as Ye,i as Xe,l as Ze,r as Qe,t as $e}from"./PopoverPopup-B3Y0VRYc.js";import{t as et}from"./use-export-command-sC9UHj3_.js";import{n as tt}from"./surface-Dke4SWpE.js";import{_ as nt,a as rt,c as it,d as at,f as ot,h as st,i as ct,l as lt,m as ut,n as dt,o as ft,p as pt,r as mt,t as ht,u as gt,v as _t,y as vt}from"./plan-CkgM52Yh.js";import{a as yt,c as bt,d as xt,f as St,i as Ct,l as wt,n as Tt,o as Et,r as Dt,s as Ot,t as kt,u as At}from"./edit-C0sBxxsg.js";import{a as jt,c as Mt}from"./chrome-C2RCq3SI.js";import{i as Nt,n as Pt,r as Ft,t as It}from"./DialogRoot-DUeVfNhS.js";import{n as Lt,t as Rt}from"./DialogTitle-D5au2NAn.js";import{n as zt,t as Bt}from"./shape-meta-COE2ATNh.js";import{r as Vt}from"./chrome-layout-BzPU9far.js";import{t as Ht}from"./panel-shell-BnMOHgWM.js";import{A as F,C as I,D as L,E as R,O as z,S as B,T as Ut,_ as Wt,a as V,b as Gt,c as Kt,d as qt,f as H,g as Jt,h as Yt,i as Xt,k as U,l as W,m as G,n as Zt,o as K,p as Qt,r as q,s as J,t as $t,u as en,v as tn,w as Y,x as nn,y as rn}from"./builders-DMHAOPEv.js";import{n as an,t as on}from"./export-K2VWg76n.js";var sn=j(`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`}]]),cn=j(`outline`,`player-skip-back`,`PlayerSkipBack`,[[`path`,{d:`M20 5v14l-12 -7l12 -7`,key:`svg-0`}],[`path`,{d:`M4 5l0 14`,key:`svg-1`}]]),ln=j(`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`}]]),X=e(t(),1);function un(e,t){if(!t)return Bt(e[0]);let n=e.find(e=>zt(e).trim().length>0);return n?Bt(n):`Group of ${e.length}`}var Z={enter:`Entry`,emphasis:`Emphasis`,exit:`Exit`},Q=n();function dn(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,X.useState)(!1);return(0,Q.jsxs)(Ye,{open:u,onOpenChange:e=>{d(e),e||a(null)},children:[(0,Q.jsx)(xe,{"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,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(He,{size:13,stroke:1.75}),`Add animation`,n>0&&(0,Q.jsxs)(`span`,{"data-testid":`animate-add-count`,className:`text-[var(--chrome-fg-400)]`,children:[`· `,n,` not animated`]})]})}),(0,Q.jsx)(Xe,{children:(0,Q.jsx)(Qe,{side:`left`,align:`end`,sideOffset:8,collisionPadding:8,children:(0,Q.jsxs)($e,{"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 ${tt.popup}`,children:[n>0&&(0,Q.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,Q.jsx)(`span`,{children:i?`Add the remaining ${n}`:`Animate all ${n}, one by one`}),(0,Q.jsx)(be,{size:12,stroke:2})]}),t.map(e=>{let t=e.shapes[0],n=new Set(ht(t).map(e=>e.kind));return(0,Q.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,Q.jsx)(ye,{size:12,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate`,children:un(e.shapes,e.groupId)}),gt(t).map(t=>{let r=t!==`emphasis`&&n.has(t);return(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-add-${t}`,disabled:r,title:r?`Already has ${Z[t].toLowerCase()}`:`Add ${Z[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:Z[t]},t)})]},_t(e))})]})})})]})}var fn={click:``,with:`Plays with the step above`,after:`Plays on its own, as soon as the step above finishes`};function pn(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:ee,onSetStart:_,onPreviewEffect:v,onRemove:y}=e,b=t.items[0],x=b.shape,S=b.animation,C=ht(x).filter((e,t)=>t!==b.index).map(e=>e.kind),w=f??p;return(0,Q.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,Q.jsx)(sn,{size:13,stroke:1.75,className:`shrink-0 cursor-grab text-[var(--chrome-fg-300)]`}),(0,Q.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:fn[a],children:a===`click`?n:``}),w&&!u?(0,Q.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:w,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,Q.jsx)(Me,{size:12,stroke:2}):(0,Q.jsx)(i,{size:12,stroke:2})}):w&&(0,Q.jsx)(`span`,{className:`w-4 shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate ${r?``:`text-[var(--chrome-fg-900)]`}`,children:un(t.items.map(e=>e.shape),t.groupId)}),c&&(0,Q.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,Q.jsx)(Ce,{size:12,stroke:1.75})}),S.kind!==`enter`&&(0,Q.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,Q.jsx)(mn,{shape:x,kind:S.kind,kindsTaken:C,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:ee,onSetStart:_,onPreviewEffect:v}),!u&&(0,Q.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,Q.jsx)(qe,{size:12,stroke:2})})]})}function mn(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:g}=e,[ee,_]=(0,X.useState)(!1),b=v.filter(e=>k(t,e)&&T(e,n)),x=gt(t),S=Pe(i);return(0,Q.jsxs)(Ye,{open:ee,onOpenChange:_,children:[(0,Q.jsxs)(xe,{"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:[S.label,(0,Q.jsx)(Ze,{})]}),(0,Q.jsx)(Xe,{children:(0,Q.jsx)(Qe,{side:`left`,align:`center`,sideOffset:8,collisionPadding:8,children:(0,Q.jsxs)($e,{"data-overlay":!0,onPointerDown:e=>e.stopPropagation(),className:`w-64 p-2.5 ${tt.popup}`,children:[x.length>1&&(0,Q.jsx)(`div`,{className:`mb-2 flex items-center gap-1 border-b border-[var(--chrome-ring)] pb-2`,children:x.map(e=>{let t=e!==n&&e!==`emphasis`&&r.includes(e);return(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-kind-set-${e}`,"aria-pressed":e===n,disabled:t,title:t?`This shape already has an ${Z[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 ${Mt(e===n)}`,children:Z[e]},e)})}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Effect`}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:b.map(e=>(0,Q.jsxs)(`div`,{className:`flex h-7 items-center gap-1 rounded-lg pr-0.5 text-[11px] transition-colors ${Mt(e===i)}`,children:[(0,Q.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:[Re[e].label,(0,Q.jsxs)(`span`,{className:`text-[10px] tabular-nums text-[var(--chrome-fg-400)]`,children:[Math.round(P(e,e===i?a:void 0,t)),`ms`]})]}),(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-effect-play-${e}`,"aria-label":`Preview ${Re[e].label} on the slide`,title:`Play this on the shape`,onClick:()=>g(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,Q.jsx)(Je,{size:10})})]},e))})]}),ze(S)&&(0,Q.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Direction`}),(0,Q.jsx)(`div`,{className:`flex items-center gap-1`,children:y.map(e=>{let t=(s??S.defaultDirection)===e;return(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-direction-${e}`,"aria-pressed":t,"aria-label":gn[e],title:gn[e],onClick:()=>p(e),className:`flex h-7 flex-1 cursor-pointer items-center justify-center rounded-lg text-[11px] font-medium transition-colors ${Mt(t)}`,children:(0,Q.jsx)(_n,{direction:e})},e)})})]}),(0,Q.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Start`}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:vn.map(e=>(0,Q.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 ${Mt(c===e.mode)}`,children:e.label},e.mode))})]}),(0,Q.jsxs)(`div`,{className:`mt-1 flex gap-2 border-t border-[var(--chrome-ring)] pt-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Duration`}),(0,Q.jsx)(we,{label:`duration in milliseconds`,testId:`animate-duration`,value:Math.round(P(i,a,t)),min:80,max:4e3,step:40,fullWidth:!0,onChange:e=>d(i,e)})]}),c!==`click`&&(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsx)(`div`,{className:`px-1 text-[11px] text-[var(--chrome-fg-500)]`,children:`Delay`}),(0,Q.jsx)(we,{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 hn={up:M,down:De,left:ke,right:N},gn={up:`Upward`,down:`Downward`,left:`Leftward`,right:`Rightward`};function _n(e){let{direction:t}=e,n=hn[t];return(0,Q.jsx)(n,{size:13,stroke:2})}var vn=[{mode:`click`,label:`On click`},{mode:`with`,label:`With previous`},{mode:`after`,label:`After previous`}],yn=`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`,bn=4,xn=380,Sn=200;function Cn(e){let{figure:t,index:n,total:r,onBack:i,onGoToSlide:a,onFocusSlide:o,viewMode:s}=e,{store:c,history:l}=ee(),u=_(e=>e.shapes),d=_(e=>e.selectedIds),f=_(e=>e.hoveredId),p=Ie(),m=(0,X.useMemo)(()=>ot(u,t),[u,t]),h=(0,X.useMemo)(()=>nt(u,t),[u,t]),g=(0,X.useMemo)(()=>dt(m,h),[m,h]),v=(0,X.useMemo)(()=>ut(u,t,h),[u,t,h]),y=(0,X.useMemo)(()=>ct(u,t,h),[u,t,h]),b=(0,X.useMemo)(()=>vt(m),[m]),S=(0,X.useMemo)(()=>y.filter(e=>e.shapes.some(e=>d.has(e.id))),[y,d]),C=(0,X.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]),w=(0,X.useMemo)(()=>{let e=0;return g.map((t,n)=>(n>0&&!t.withPrevious&&(e+=1),e))},[g]),ne=(0,X.useMemo)(()=>mt(m),[m]);function re(e,t){T(Tt(m,[e],t===`enter`?st(e.shapes[0]):void 0,t))}function ie(){T(k?Tt(m,v):kt(u,t))}function T(e){e.length!==0&&(l.beginTransaction(),c.getState().replaceMany(e),l.endTransaction())}(0,X.useEffect)(()=>{o(t)},[t.id]);let[E,D]=(0,X.useState)(null);(0,X.useLayoutEffect)(()=>{if(E===null||E<0)return;let e=m[E];e&&p.play(e,te(t))},[E,m,t,p]),(0,X.useEffect)(()=>{if(E===null)return;let e=E>=0?m[E]:null,t=m[E+1]?.afterPrevious?0:xn,n=(e?Le(e):0)+t,r=setTimeout(()=>{D(e=>e===null||e+1>=m.length?null:e+1)},n);return()=>clearTimeout(r)},[E,m]);let[O,ae]=(0,X.useState)(null);function oe(e,t,n){D(null),p.cancel(),ae({items:e.map(e=>({shape:e.shape,index:e.index,start:0,row:e.row,animation:{...e.animation,step:0,effect:rt(e.shape,t,e.animation.kind),duration:n,delay:void 0}})),armed:e[0]?.animation.kind===`exit`})}(0,X.useEffect)(()=>{if(!O||O.armed)return;let e=setTimeout(()=>ae(e=>e&&!e.armed?{...e,armed:!0}:e),Sn);return()=>clearTimeout(e)},[O]),(0,X.useLayoutEffect)(()=>{if(!O?.armed)return;let e=O.items.some(e=>e.animation.kind===`exit`);p.play({index:0,items:O.items,afterPrevious:!1},te(t)).then(()=>{e&&window.setTimeout(()=>p.cancel(),Sn)})},[O,t,p]),(0,X.useEffect)(()=>{D(null),ae(null)},[m]);function se(){if(ae(null),E!==null){p.cancel(),D(null);return}m.length!==0&&(o(t),p.cancel(),D(-1))}let ce=(0,X.useMemo)(()=>{let e=new Set;if(!f)return e;e.add(f);let t=x(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,X.useEffect)(()=>()=>c.getState().setHoveredId(null),[c]);let ue=Ge({count:g.length,gap:bn,disabled:s,onReorder:(e,t)=>T(Et(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,Q.jsxs)(Q.Fragment,{children:[E!==null&&(0,Q.jsx)(Be,{pending:it(m,E)}),O&&!O.armed&&(0,Q.jsx)(Be,{pending:new Set(O.items.map(e=>e.shape.id))}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 bg-[var(--chrome-rest)] px-3 pb-3 pt-2.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(be,{size:15,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-500)]`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate text-[13px] font-medium text-[var(--chrome-fg-900)]`,children:`Animate`}),(0,Q.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,Q.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,Q.jsx)(`button`,{className:yn,"data-testid":`animate-prev-slide`,"aria-label":`Previous slide`,disabled:n===0,onClick:()=>a(n-1),children:(0,Q.jsx)(je,{size:14,stroke:1.75})}),(0,Q.jsxs)(`span`,{className:`truncate text-[12px] tabular-nums text-[var(--chrome-fg-700)]`,children:[`Slide `,n+1,` of `,r]}),(0,Q.jsx)(`button`,{className:yn,"data-testid":`animate-next-slide`,"aria-label":`Next slide`,disabled:n>=r-1,onClick:()=>a(n+1),children:(0,Q.jsx)(Me,{size:14,stroke:1.75})})]})]}),!s&&S.length>0&&(0,Q.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,Q.jsx)(ln,{size:12,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate text-[11.5px] text-[var(--chrome-fg-900)]`,children:S.length===1?un(S[0].shapes,S[0].groupId):`${S.length} shapes`}),Tn(S).map(e=>(0,Q.jsx)(`button`,{type:`button`,"data-testid":`animate-selection-${e}`,title:`Add ${Z[e].toLowerCase()}`,onClick:()=>{for(let t of S)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:Z[e]},e))]}),(0,Q.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,Q.jsx)(`div`,{className:`px-1 pt-4`,children:y.length===0?(0,Q.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,Q.jsxs)(`div`,{"data-testid":`animate-empty`,"data-count":y.length,className:`flex flex-col items-center gap-2.5 rounded-xl p-4 text-center`,children:[(0,Q.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,Q.jsx)(be,{size:17,stroke:1.75})}),(0,Q.jsx)(`span`,{className:`text-[12.5px] font-medium text-[var(--chrome-fg-900)]`,children:`Reveal this slide in steps`}),(0,Q.jsx)(`span`,{className:`text-balance text-[11px] leading-relaxed text-[var(--chrome-fg-500)]`,children:wn(y.length)}),!s&&(0,Q.jsx)(dn,{variant:`primary`,units:y,idleCount:v.length,hasBuild:k,onHover:e=>c.getState().setHoveredId(e),onAdd:re,onSweep:ie})]})}),k&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,children:g.map((e,t)=>{let n=pt(e);return(0,Q.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,Q.jsx)(pn,{unit:e,click:ne[w[t]],playing:E!==null&&w[t]===E,start:n,canJoin:t>0,pointed:ce.has(ft(e)),unseen:b.has(lt(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?()=>T(St(g,e.groupId)):null,onMerge:C.has(t)?()=>T(yt(g,C.get(t))):null,onSetEffect:(t,n)=>T(wt(e.items,t,n)),onSetDelay:t=>T(Ot(e.items,t)),onSetKind:t=>T(At(e.items,t)),onSetDirection:t=>T(bt(e.items,t)),onPreviewEffect:(t,n)=>oe(e.items,t,n),onSetStart:t=>T(xt(g,ft(e),t)),onRemove:()=>T(Dt(g,ft(e)))})},ft(e))})}),!s&&k&&(0,Q.jsx)(`div`,{className:`pt-3`,children:(0,Q.jsx)(dn,{units:y,idleCount:v.length,hasBuild:k,onHover:e=>c.getState().setHoveredId(e),onSweep:ie,onAdd:re})})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-[var(--chrome-ring)] p-3`,children:[(0,Q.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:E===null?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Je,{size:13}),`Play`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ae,{size:13}),`Stop`]})}),!s&&k&&(0,Q.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:()=>T(Ct(m)),children:`Clear animations`})]})]})}function wn(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 Tn(e){let t=e.flatMap(e=>e.shapes);return gt(t[0]).filter(e=>e===`emphasis`||t.some(t=>!ht(t).some(t=>t.kind===e)))}var En=`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 Dn(e){let{disabled:t,onPresent:n}=e;return(0,Q.jsxs)(`div`,{className:`flex gap-px`,children:[(0,Q.jsxs)(`button`,{type:`button`,"data-testid":`slides-present`,disabled:t,onClick:()=>n(`current`),className:`${En} flex-1 gap-2 rounded-l-lg`,children:[(0,Q.jsx)(Je,{size:14}),`Start presentation`]}),(0,Q.jsxs)(u,{children:[(0,Q.jsx)(p,{disabled:t,render:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Presentation start options`,"data-testid":`slides-present-options`,className:`${En} w-9 rounded-r-lg`,children:(0,Q.jsx)(i,{size:14,stroke:2})})}),(0,Q.jsx)(d,{children:(0,Q.jsx)(m,{side:`top`,align:`end`,sideOffset:6,className:`z-50 outline-none`,children:(0,Q.jsxs)(h,{"data-overlay":!0,className:`min-w-[185px] p-1`,children:[(0,Q.jsxs)(f,{"data-testid":`slides-present-beginning`,onClick:()=>n(`beginning`),children:[(0,Q.jsx)(cn,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-400)]`}),`From beginning`]}),(0,Q.jsxs)(f,{"data-testid":`slides-present-current`,onClick:()=>n(`current`),children:[(0,Q.jsx)(o,{size:15,stroke:1.75,className:`text-[var(--chrome-fg-400)]`}),`From current slide`]})]})})})]})]})}var On=`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)]`,kn=`min-w-[185px] p-1 outline-none ${tt.popup}`;function An(e){let{index:t,prefix:n,actions:r,skipped:i,Item:a,Separator:s}=e;function c(e,r,i,o,s=!1){return(0,Q.jsxs)(a,{className:s?`${On} text-red-600 data-[highlighted]:bg-red-50`:On,"data-testid":`${n}-${e}-${t}`,onClick:o,children:[(0,Q.jsx)(`span`,{className:s?`text-red-400`:`text-[var(--chrome-fg-400)]`,children:r}),(0,Q.jsx)(`span`,{children:i})]})}let l=(0,Q.jsx)(s,{className:`mx-1 my-1 h-px bg-[var(--chrome-divider)]`});return(0,Q.jsxs)(Q.Fragment,{children:[c(`present`,(0,Q.jsx)(o,{size:15,stroke:1.75}),`Present from here`,r.onPresent),l,r.onExportPng?c(`export-png`,(0,Q.jsx)(he,{size:15,stroke:1.75}),`Export slide as PNG`,r.onExportPng):null,r.onExportSvg?c(`export-svg`,(0,Q.jsx)(ge,{size:15,stroke:1.75}),`Export slide as SVG`,r.onExportSvg):null,r.onEmbed?c(`embed`,(0,Q.jsx)(Ne,{size:15,stroke:1.75}),`Embed slide…`,r.onEmbed):null,l,c(`duplicate`,(0,Q.jsx)(me,{size:15,stroke:1.75}),`Duplicate slide`,r.onDuplicate),c(`rename`,(0,Q.jsx)(Ve,{size:15,stroke:1.75}),`Rename slide`,r.onRename),c(`notes`,(0,Q.jsx)(Fe,{size:15,stroke:1.75}),`Speaker notes`,r.onEditNotes),i?c(`skip`,(0,Q.jsx)(ve,{size:15,stroke:1.75}),`Unskip slide`,r.onToggleSkip):c(`skip`,(0,Q.jsx)(Ce,{size:15,stroke:1.75}),`Skip slide`,r.onToggleSkip),c(`add-above`,(0,Q.jsx)(Ue,{size:15,stroke:1.75}),`Add slide above`,r.onAddAbove),c(`add-below`,(0,Q.jsx)(We,{size:15,stroke:1.75}),`Add slide below`,r.onAddBelow),l,c(`delete`,(0,Q.jsx)(Oe,{size:15,stroke:1.75}),`Remove slide`,r.onDelete,!0)]})}function jn(e){let{index:t,actions:n,skipped:r,disabled:i}=e;return i?null:(0,Q.jsxs)(u,{children:[(0,Q.jsx)(p,{render:(0,Q.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,Q.jsx)(a,{size:13,stroke:1.75})})}),(0,Q.jsx)(d,{children:(0,Q.jsx)(m,{side:`left`,align:`start`,sideOffset:6,className:`z-50 outline-none`,children:(0,Q.jsx)(l,{"data-overlay":!0,className:kn,children:(0,Q.jsx)(An,{index:t,prefix:`slide-menu`,actions:n,skipped:r,Item:c,Separator:s})})})})]})}function Mn(e){let{index:t,actions:n,skipped:r,children:i,disabled:a}=e,o=_(e=>e.coarsePointer);return a||o?(0,Q.jsx)(Q.Fragment,{children:i}):(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(A,{render:(0,Q.jsx)(`div`,{style:{display:`contents`}}),children:i}),(0,Q.jsx)(d,{children:(0,Q.jsx)(m,{className:`z-50 outline-none`,children:(0,Q.jsx)(l,{"data-overlay":!0,"data-testid":`slide-ctx-${t}`,className:kn,children:(0,Q.jsx)(An,{index:t,prefix:`slide-ctx`,actions:n,skipped:r,Item:c,Separator:s})})})})]})}function Nn(e){let t=L(e),n=18*t.unit,r=[{x:433,fill:W.red},{x:471,fill:W.yellow},{x:509,fill:W.blue}].map(({x:e,fill:r})=>{let i=t.point(e,158);return R({x:i.x,y:i.y,width:n,height:n},r,{kind:`ellipse`,fillStyle:`bold`})}),i=(e,n,r,i)=>R(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[...r,i(812,100,24,W.yellow),i(128,416,16,W.pink),F(t.rect(120,204,720,90),`Presentation title`,t.font(56)),F(t.rect(180,306,600,40),`A short subtitle that sets the scene`,t.font(24),{color:q}),z([t.point(432,436),t.point(528,436)],{color:H,strokeWidth:4}),F(t.rect(280,452,400,30),`Your name · Occasion · Date`,t.font(16),{color:q})]}function Pn(e){let t=L(e);return[R(t.rect(110,145,230,230),W.yellow,{kind:`ellipse`,label:`01`,fontSize:t.font(80)}),F(t.rect(420,190,460,64),`Section title`,t.font(48),{align:`left`}),z([t.point(422,268),t.point(640,268)],{color:J,strokeWidth:4}),F(t.rect(420,292,460,36),`A one-line summary of this chapter`,t.font(20),{align:`left`,color:q})]}function Fn(e){let t=L(e);return[F(t.rect(330,148,300,26),`THE BIG IDEA`,t.font(15),{letterSpacing:.3,color:q}),F(t.rect(120,192,720,156),`Say the one thing that matters.`,t.font(64)),z([t.point(390,374),t.point(570,374)],{color:H,strokeWidth:5})]}function In(e){let t=L(e),n=(e,n,r,i)=>R(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[Yt(t),n(150,106,26,W.yellow),n(806,92,18,W.blue),n(730,414,20,W.yellow),n(208,408,14,W.pink),z([t.point(434,198),t.point(526,198)],{color:H,strokeWidth:4}),Jt(t.rect(120,216,720,90),`A title that glows in the dark`,t.font(52)),Jt(t.rect(240,322,480,40),`A quieter cover for serious rooms`,t.font(20),{color:Xt})]}function Ln(e){let t=L(e);return[R(t.rect(0,0,424,qt.height),W.gray,{dash:`none`,label:`Drop an image
2
+ or paste a screenshot`,fontSize:t.font(18),labelColor:q}),F(t.rect(486,168,300,26),`A DECK ABOUT`,t.font(14),{align:`left`,letterSpacing:.3,color:q}),F(t.rect(486,202,408,140),`The thing you came to hear`,t.font(44),{align:`left`,valign:`top`,lineHeight:1.25}),z([t.point(488,360),t.point(600,360)],{color:H,strokeWidth:4}),F(t.rect(486,384,408,30),`Your name · Occasion · Date`,t.font(16),{align:`left`,color:q})]}function Rn(e){let t=L(e),n=W.green,r=(e,n)=>R(t.rect(e,26,15,15),n,{kind:`ellipse`,fillStyle:`bold`,dash:`none`});return[Yt(t),r(30,W.red),r(56,W.yellow),r(82,W.green),nn(t.point(80,130),`~/talks $ present --topic`,t.font(20),n,{fontFamily:K}),nn(t.point(80,176),`"Your big idea"`,t.font(50),Kt,{fontFamily:K}),R(t.rect(80,268,20,42),Kt,{dash:`none`}),nn(t.point(80,356),`loading slides… ████████░░ 80%`,t.font(17),n,{fontFamily:K,opacity:.8}),nn(t.point(80,458),`# your name · today`,t.font(15),Kt,{fontFamily:K,opacity:.5})]}function zn(e){let t=L(e);return[...I(t,`Slide title`),F(t.rect(72,156,816,312),w([`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:V})]}function Bn(e){let t=L(e),n=[{fill:W.blue,text:`Where we are today`},{fill:W.green,text:`What we learned`},{fill:W.yellow,text:`The plan from here`},{fill:W.pink,text:`Questions and next steps`}].flatMap(({fill:e,text:n},r)=>{let i=160+r*78;return B([R(t.rect(72,i,48,48),e,{kind:`ellipse`,label:String(r+1),fontSize:t.font(20)}),F(t.rect(140,i,720,48),n,t.font(24),{align:`left`})])});return[...I(t,`Agenda`),...n]}function Vn(e){let t=L(e);return[...I(t,`Slide title`),z([t.point(480,160),t.point(480,468)],{strokeWidth:1.5,dash:`dashed`,opacity:.35}),F(t.rect(72,156,380,40),`First column`,t.font(24),{align:`left`}),z([t.point(74,204),t.point(150,204)],{color:`#1971c2`,strokeWidth:3}),F(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:V}),F(t.rect(508,156,380,40),`Second column`,t.font(24),{align:`left`}),z([t.point(510,204),t.point(586,204)],{color:`#2f9e44`,strokeWidth:3}),F(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:V})]}function Hn(e){let t=L(e);return[F(t.rect(72,48,816,50),`Which way do we go?`,t.font(36)),...B([R(t.rect(72,132,384,344),W.green,{fillStyle:`outline`}),R(t.rect(404,152,32,32),W.green,{kind:`checkbox`,fillStyle:`bold`}),F(t.rect(96,156,336,40),`Option A`,t.font(28)),F(t.rect(108,212,312,240),w([`Cheaper to build`,`Ships this quarter`,`Less flexible later`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:V})]),...B([R(t.rect(504,132,384,344),W.gray,{fillStyle:`outline`}),F(t.rect(528,156,336,40),`Option B`,t.font(28)),F(t.rect(540,212,312,240),w([`More upfront work`,`Ships next quarter`,`Grows with us`]),t.font(20),{align:`left`,valign:`top`,lineHeight:2,color:V})]),R(t.rect(450,274,60,60),W.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`vs`,fontSize:t.font(22)})]}function Un(e){let t=L(e);return[...I(t,`Before and after`),...B([R(t.rect(72,140,384,330),W.gray),F(t.rect(96,162,344,36),`Before`,t.font(26),{align:`left`}),F(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:V})]),...B([R(t.rect(504,140,384,330),W.green),F(t.rect(528,162,344,36),`After`,t.font(26),{align:`left`}),F(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:V})]),Gt(t.point(462,305),t.point(498,305),5)]}function Wn(e){let t=L(e),n=[{x:72,fill:W.blue,value:`42%`,caption:`more signups`},{x:360,fill:W.teal,value:`3×`,caption:`faster builds`},{x:648,fill:W.purple,value:`12k`,caption:`happy users`}].flatMap(({x:e,fill:n,value:r,caption:i})=>B([R(t.rect(e,150,240,260),n,{fillStyle:`outline`,label:r,fontSize:t.font(56)}),F(t.rect(e+20,330,200,56),i,t.font(18),{color:q})]));return[...I(t,`The quarter in numbers`),...n]}function Gn(e){let t=L(e),n=[{color:J,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=B([nn(t.point(84,i+14),String(r+1),t.font(44),e),F(t.rect(160,i,720,84),n,t.font(26),{align:`left`})]);return r>0&&a.push(z([t.point(84,i-10),t.point(876,i-10)],{strokeWidth:1.5,opacity:.15})),a});return[...I(t,`Three takeaways`),...n]}function Kn(e){let t=L(e);return[...I(t,`Do and don't`),...B([R(t.rect(72,150,400,310),W.green,{fillStyle:`outline`}),R(t.rect(96,170,36,36),W.green,{kind:`checkbox`,fillStyle:`bold`}),F(t.rect(148,170,300,36),`Do`,t.font(28),{align:`left`}),F(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:V})]),...B([R(t.rect(488,150,400,310),W.red,{fillStyle:`outline`}),R(t.rect(512,170,36,36),W.red,{kind:`crossbox`,fillStyle:`bold`}),F(t.rect(564,170,300,36),`Don't`,t.font(28),{align:`left`}),F(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:V})])]}function qn(e){let t=L(e),n=[{icon:`zap`,fill:W.yellow,name:`Fast`,desc:`Blank canvas to first stroke in a second`},{icon:`users`,fill:W.blue,name:`Together`,desc:`Share a link, draw with the whole room`},{icon:`share-2`,fill:W.green,name:`Portable`,desc:`PNG, SVG and PDF out of the box`},{icon:`undo-2`,fill:W.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 B([R({x:c.x,y:c.y,width:s,height:s},n,{kind:`ellipse`,dash:`none`}),Y({x:c.x+(s-l)/2,y:c.y+(s-l)/2},l,e,{color:Zt}),F(t.rect(148,o+2,210,48),r,t.font(22),{align:`left`}),F(t.rect(366,o+2,522,48),i,t.font(17),{align:`left`,color:V})])});return[...I(t,`What you get`),...n]}function Jn(e){let t=L(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 B([Y({x:c.x,y:c.y},s,e,{color:J}),F(t.rect(a+46,o-4,200,40),n,t.font(21),{align:`left`}),F(t.rect(a,o+48,252,76),r,t.font(15),{align:`left`,valign:`top`,lineHeight:1.6,color:V})])});return[...I(t,`Why teams switch`),...n]}function Yn(e){let t=L(e),n=(e,n,r,i)=>R(t.rect(e-126,n-126,252,252),r,{kind:`ellipse`,opacity:.6,color:i,strokeWidth:2}),r=[{cx:300,cy:262,fill:W.blue,ink:$t.blue,name:`What users beg for`},{cx:432,cy:262,fill:W.yellow,ink:$t.yellow,name:`What we're best at`},{cx:366,cy:376,fill:W.teal,ink:$t.teal,name:`What pays the bills`}],i=r.flatMap(({fill:e,name:n},r)=>B([R(t.rect(660,214+r*66,20,20),e,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(694,208+r*66,200,32),n,t.font(17),{align:`left`})]));return[...I(t,`Where the three meet`),...r.map(({cx:e,cy:t,fill:r,ink:i})=>n(e,t,r,i)),F(t.rect(288,292,156,40),`Do this`,t.font(20)),...i]}function Xn(e){let t=L(e),n=B([R(t.rect(72,140,392,300),W.blue,{fillStyle:`outline`}),F(t.rect(96,164,344,96),`38%`,t.font(72),{align:`left`}),F(t.rect(96,250,344,34),`faster to a first board`,t.font(18),{align:`left`,color:V}),Wt(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=B([R(t.rect(480,140,196,142),W.green,{fillStyle:`outline`}),F(t.rect(496,164,164,62),`4.8`,t.font(48),{align:`left`}),F(t.rect(496,228,164,32),`average rating`,t.font(15),{align:`left`,color:V})]),i=B([R(t.rect(692,140,196,142),W.orange,{fillStyle:`outline`}),Y(t.point(710,162),30*t.unit,`trophy`,{color:J}),F(t.rect(708,204,164,32),`12 of 14 shipped`,t.font(17),{align:`left`}),F(t.rect(708,234,164,28),`two slipped to Q3`,t.font(14),{align:`left`,color:q})]),a=B([R(t.rect(480,298,408,142),W.gray,{fillStyle:`outline`}),F(t.rect(504,316,360,76),`“It replaced three tools and a weekly meeting.”`,t.font(20),{align:`left`,valign:`top`,lineHeight:1.5}),F(t.rect(504,396,360,28),`Kim, platform lead at Globex`,t.font(14),{align:`left`,color:q})]);return[...I(t,`The quarter at a glance`),...n,...r,...i,...a]}function Zn(e){let t=L(e),n=[{fill:W.green,tag:`Added`,text:`Dark mode, at last`},{fill:W.blue,tag:`Improved`,text:`Boards open twice as fast`},{fill:W.red,tag:`Fixed`,text:`That one bug, gone for good`}].flatMap(({fill:e,tag:n,text:r},i)=>{let a=168+i*88;return B([R(t.rect(72,a+4,140,48),e,{fillStyle:`outline`,label:n,fontSize:t.font(18)}),F(t.rect(236,a,652,56),r,t.font(22),{align:`left`})])});return[F(t.rect(72,48,460,56),`What's new`,t.font(36),{align:`left`}),z([t.point(74,118),t.point(250,118)],{color:H,strokeWidth:4}),F(t.rect(560,58,328,36),`v2.4.0 · this week`,t.font(15),{align:`right`,fontFamily:K,color:q}),...n,F(t.rect(72,442,816,40),`…plus twelve smaller fixes nobody will notice but us.`,t.font(24),{fontFamily:en,color:q})]}function Qn(e){let t=L(e),n=[W.blue,W.green,W.yellow,W.pink,W.teal,W.purple].flatMap((e,n)=>{let r=240+n%3*240,i=n<3?152:312;return B([R(t.rect(r-42,i,84,84),e,{kind:`ellipse`,label:String.fromCharCode(65+n),fontSize:t.font(28)}),F(t.rect(r-110,i+92,220,24),`Name Surname`,t.font(18)),F(t.rect(r-110,i+118,220,20),`What they do`,t.font(14),{color:q})])});return[...I(t,`Meet the team`),...n]}function $n(e){let t=L(e),n=[{x:72,fill:W.blue,quote:`“It changed how our team plans every single week.”`,who:`Sam, Acme`},{x:368,fill:W.orange,quote:`“The first tool everyone actually kept using.”`,who:`Ada, Initech`},{x:664,fill:W.pink,quote:`“We shipped the rework two weeks early.”`,who:`Kim, Globex`}].flatMap(({x:e,fill:n,quote:r,who:i})=>B([R(t.rect(e,150,256,268),n,{fillStyle:`outline`}),F(t.rect(e+20,172,216,150),r,t.font(18),{align:`left`,valign:`top`,lineHeight:1.5}),G(t.rect(e+18,330,104,22),`rating`,{value:5,fill:H}),F(t.rect(e+20,362,216,32),i,t.font(14),{align:`left`,color:q})]));return[...I(t,`What people say`),...n]}function er(e){let t=L(e),n=e.width/qt.width,r=e.height/qt.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?W.blue:`#e9ecef`}:n===2?{background:`#e7f5ff`}:{}));return[...I(t,`Compare the options`),tn(t.point(72,156),i,[252,188,188,188].map(e=>e*n),i.map(()=>54*r),t.font(16),{cellStyles:a})]}function tr(e){let t=L(e),n=[{x:176,fill:W.blue,when:`Q1`,what:`Discovery, 20 interviews`},{x:384,fill:W.green,when:`Q2`,what:`First beta, 10 teams`},{x:592,fill:W.yellow,when:`Q3`,what:`Public launch`},{x:792,fill:W.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 B([z([t.point(e,306+l*16),t.point(e,306+l*54)],{strokeWidth:1.5,opacity:.3}),R({x:c.x-s/2,y:c.y-s/2,width:s,height:s},n,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(e-92,o?184:364,184,34),r,t.font(22),{valign:o?`bottom`:`top`}),F(t.rect(e-92,o?218:398,184,56),i,t.font(15),{valign:o?`bottom`:`top`,lineHeight:1.5,color:V})])});return[...I(t,`Roadmap`),z([t.point(88,306),t.point(890,306)],{strokeWidth:3,endArrow:!0}),...n,R(t.rect(96,332,96,34),J,{kind:`oval`,fillStyle:`bold`,label:`today`,fontSize:t.font(14)}),z([t.point(144,284),t.point(144,332)],{color:J,strokeWidth:2})]}function nr(e){let t=L(e),n=[{x:72,title:`Now`},{x:350,title:`Next`},{x:628,title:`Later`}].flatMap(({x:e,title:n})=>B([R(t.rect(e,140,260,330),`transparent`,{dash:`dashed`,opacity:.6}),F(t.rect(e,152,260,30),n,t.font(22))])),r=116*t.unit,i=[{x:100,y:206,rot:-2,fill:W.yellow,text:`Ship the fix`},{x:168,y:332,rot:3,fill:W.blue,text:`Call the pilot users`},{x:396,y:224,rot:-4,fill:W.green,text:`Write the launch post`},{x:690,y:240,rot:5,fill:W.pink,text:`Explore pricing`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>U(t.point(e,n),r,o,t.font(15),i,a));return[...I(t,`Now, next, later`),...n,...i]}function rr(e){let t=L(e),n=[{label:`Infrastructure`,fill:W.green,pct:.8},{label:`Mobile app`,fill:W.blue,pct:.6},{label:`Documentation`,fill:W.yellow,pct:.45},{label:`Onboarding`,fill:W.pink,pct:.2}].flatMap(({label:e,fill:n,pct:r},i)=>{let a=168+i*76;return B([F(t.rect(72,a,240,32),e,t.font(20),{align:`left`}),R(t.rect(330,a,470,32),W.gray,{dash:`none`}),R(t.rect(330,a,470*r,32),n,{fillStyle:`bold`,dash:`none`}),F(t.rect(814,a,76,32),`${Math.round(r*100)}%`,t.font(16),{align:`left`,fontFamily:K,color:V})])});return[...I(t,`Where things stand`),...n]}function ir(e){let t=L(e),n=[{x:72,y:140,fill:W.green,title:`Strengths`,hint:`What we do well`},{x:504,y:140,fill:W.red,title:`Weaknesses`,hint:`Where we struggle`},{x:72,y:314,fill:W.blue,title:`Opportunities`,hint:`What we could ride`},{x:504,y:314,fill:W.yellow,title:`Threats`,hint:`What could hurt us`}].flatMap(({x:e,y:n,fill:r,title:i,hint:a})=>B([R(t.rect(e,n,384,158),r),F(t.rect(e+20,n+12,344,28),i,t.font(20),{align:`left`}),F(t.rect(e+20,n+48,344,96),a,t.font(15),{align:`left`,valign:`top`,color:V})]));return[...I(t,`SWOT`),...n]}function ar(e){let t=L(e),n=[{fill:W.blue,label:`Collect`,note:`Anyone can file a request`},{fill:W.teal,label:`Sort`,note:`Weekly triage, no backlog`},{fill:W.green,label:`Decide`,note:`One owner says yes or no`},{fill:W.yellow,label:`Ship`,note:`Behind a flag, then wide`}].flatMap(({fill:e,label:n,note:r},i)=>{let a=72+i*188;return B([R(t.rect(a,218,234,104),e,{kind:`chevron`,label:n,fontSize:t.font(21)}),F(t.rect(a+44,340,174,76),r,t.font(15),{valign:`top`,lineHeight:1.5,color:q})])});return[...I(t,`How it works`),...n]}var $=.56;function or(e){let t=L(e),n=[{fill:W.blue,value:`12,400`,name:`Visited the site`,note:`any page, any source`},{fill:W.teal,value:`1,860`,name:`Started a trial`,note:`15% of visitors`},{fill:W.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*$;i.push(...B([R(t.rect(340-r/2,l,r,96),e,{kind:`trapezoid`,rotation:180}),F(t.rect(340-d/2,u-24,d,48),n,t.font(30-c*4))]),...B([F(t.rect(646,u-30,250,30),o,t.font(20),{align:`left`}),F(t.rect(646,u+2,250,26),s,t.font(15),{align:`left`,color:q})])),c>0&&a.push(F(t.rect(40,u-30,134,30),c===1?`−10,540`:`−1,450`,t.font(17),{align:`right`,color:q}),Gt(t.point(340-r/2+18,u-6),t.point(150,u+12),1.8,{color:q})),r*=$}),[...I(t,`Where people drop off`),...i,...a,z([t.point(622,156),t.point(622,428)],{strokeWidth:1.5,dash:`dashed`,opacity:.3}),R(t.rect(258,460,164,38),W.gray,{kind:`oval`,fillStyle:`outline`,label:`3.3% end to end`,fontSize:t.font(16)})]}function sr(e){let t=L(e),n=[{fill:W.purple,label:`Why`,note:`Teams lose their mornings to status meetings`},{fill:W.blue,label:`How`,note:`One board replaces the four tools they juggle`},{fill:W.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(...B([R(t.rect(330-r/2,s,r,96),e,{kind:`trapezoid`}),F(t.rect(330-r*$*.5,c-22,r*$,44),n,t.font(24))]),...B([R(t.rect(660,c-26,12,12),e,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(684,c-34,212,68),a,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:V})])),r/=$});let a=180*$;return[...I(t,`How the work ladders up`),R(t.rect(330-a/2,118,a,58),W.yellow,{kind:`triangle`}),...i]}function cr(e){let t=L(e),n={x:340,y:318},r=[{label:`Talk to users`,fill:W.blue},{label:`Pick one bet`,fill:W.teal},{label:`Ship it small`,fill:W.green},{label:`Measure it`,fill:W.yellow}],i=r.map(({label:e,fill:i},a)=>{let o=-Math.PI/2+a*2*Math.PI/r.length;return R(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 Ut({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[...I(t,`How we work`),...a,...i,Y({x:t.point(n.x,n.y).x-o/2,y:t.point(n.x,n.y).y-o/2},o,`refresh-cw`,{color:q}),F(t.rect(646,240,250,34),`Every two weeks`,t.font(21),{align:`left`}),F(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:V})]}function lr(e){let t=L(e),n=rn(t.rect(72,148,816,300),`lanes`,{lanes:[`Customer`,`Support`,`Engineering`]}),r=e=>148+e*100+50,i=(e,n,i,a)=>R(t.rect(e,r(n)-27,148,54),a,{label:i,fontSize:t.font(16)}),a=i(126,0,`Reports a bug`,W.blue),o=i(324,1,`Triages it`,W.teal),s=i(522,2,`Ships a fix`,W.green),c=i(720,0,`Confirms`,W.blue),l=(e,t)=>Ut({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[...I(t,`Who picks it up`),n,a,o,s,c,l(a,o),l(o,s),l(s,c)]}function ur(e){let t=L(e),n=e=>250+e*106,r=Array.from({length:6},(e,r)=>[z([t.point(n(r),150),t.point(n(r),440)],{strokeWidth:1.5,opacity:.12}),F(t.rect(n(r),118,106,26),`W${r+1}`,t.font(14),{color:q})]).flat(),i=[{name:`Research`,from:0,span:2,fill:W.purple},{name:`Design`,from:1,span:2,fill:W.blue},{name:`Build`,from:2,span:3,fill:W.teal},{name:`Beta`,from:4,span:1.5,fill:W.green},{name:`Launch prep`,from:5,span:.7,fill:W.yellow}].flatMap(({name:e,from:r,span:i,fill:a},o)=>{let s=170+o*52;return B([F(t.rect(72,s,164,36),e,t.font(17),{align:`left`}),R(t.rect(n(r)+6,s+4,106*i-12,28),a,{kind:`oval`,fillStyle:`bold`,dash:`none`})])});return[...I(t,`Six weeks to launch`),...r,...i,z([t.point(n(2),138),t.point(n(2),448)],{color:J,strokeWidth:2,dash:`dashed`}),F(t.rect(n(2)-60,452,120,26),`today`,t.font(14),{color:J}),R(t.rect(852,378,36,36),W.red,{kind:`diamond`,fillStyle:`bold`}),F(t.rect(714,418,168,26),`Launch`,t.font(15),{align:`right`,color:V})]}function dr(e){let t=L(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})=>B([F(t.rect(72,e,540,44),n,t.font(19),{align:`left`}),R(t.rect(640,e+9,160,24),W.gray,{dash:`none`}),R(t.rect(640,e+9,160*r,24),W.green,{fillStyle:`bold`,dash:`none`}),F(t.rect(812,e+2,76,38),i,t.font(18),{align:`left`,color:V})]));return[...I(t,`This quarter's OKRs`),R(t.rect(72,144,816,62),W.blue,{label:`Objective — Make onboarding effortless`,fontSize:t.font(22)}),...n]}function fr(e){let t=L(e);return[...I(t,`The problem we solve`),...B([R(t.rect(72,150,384,320),W.red,{fillStyle:`outline`}),F(t.rect(96,174,336,40),`The problem`,t.font(26),{align:`left`}),F(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:V})]),...B([R(t.rect(504,150,384,320),W.green,{fillStyle:`outline`}),F(t.rect(528,174,336,40),`Our solution`,t.font(26),{align:`left`}),F(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:V})]),Gt(t.point(462,310),t.point(498,310),5)]}function pr(e){let t=L(e),n=[{d:340,fill:W.blue},{d:230,fill:W.teal},{d:120,fill:W.green}].map(({d:e,fill:n})=>R(t.rect(330-e/2,480-e,e,e),n,{kind:`ellipse`})),r=[{y:190,fill:W.blue,value:`TAM — $4.2B`,caption:`everyone with the problem`},{y:268,fill:W.teal,value:`SAM — $600M`,caption:`who we can reach`},{y:346,fill:W.green,value:`SOM — $40M`,caption:`a realistic first bite`}].flatMap(({y:e,fill:n,value:r,caption:i})=>B([R(t.rect(560,e+4,22,22),n,{kind:`ellipse`,fillStyle:`bold`}),F(t.rect(596,e,292,30),r,t.font(22),{align:`left`}),F(t.rect(596,e+34,292,26),i,t.font(15),{align:`left`,color:q})]));return[...I(t,`How big is this?`),...n,...r]}function mr(e){let t=L(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=[R(t.rect(e,156,248,314),a?W.blue:W.gray,{fillStyle:`outline`}),F(t.rect(e+24,180,200,34),n,t.font(22),{align:`left`}),F(t.rect(e+24,218,200,60),r,t.font(44),{align:`left`}),F(t.rect(e+26,240,200,60),`per person / month`,t.font(13),{align:`right`,valign:`bottom`,color:q}),F(t.rect(e+24,306,200,150),i,t.font(17),{align:`left`,valign:`top`,lineHeight:2,color:V})];return a&&o.push(Qt(t.rect(e+50,138,148,30),W.yellow,`MOST POPULAR`,t.font(12),{labelColor:Zt})),B(o)});return[...I(t,`Pick a plan`),...n]}function hr(e){let t=L(e);return[...I(t,`Where the line is going`),Wt(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 B([F(t.rect(648,i,240,56),e,t.font(40),{align:`left`}),F(t.rect(648,i+54,240,30),n,t.font(15),{align:`left`,color:q})])})]}function gr(e){let t=L(e);return[...I(t,`How we sit in the market`),Wt(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=L(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 B([Y({x:o.x,y:o.y},a,e,{color:`#2f9e44`}),F(t.rect(108,i,380,34),n,t.font(17),{align:`left`,color:V})])});return[...I(t,`The ask`),F(t.rect(72,158,420,96),`$2.5M`,t.font(76),{align:`left`}),F(t.rect(72,250,420,34),`seed round · 18 months of runway`,t.font(19),{align:`left`,color:q}),...n,Wt(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=L(e),n=[{x:136,y:146,fill:W.green,title:`Quick wins`,align:`left`},{x:491,y:146,fill:W.blue,title:`Big bets`,align:`right`},{x:136,y:299,fill:W.gray,title:`Fill-ins`,align:`left`},{x:491,y:299,fill:W.red,title:`Money pits`,align:`right`}].flatMap(({x:e,y:n,fill:r,title:i,align:a})=>[R({...t.rect(e,n,710/2,306/2)},r,{dash:`none`,opacity:.35}),F(t.rect(e+(a===`left`?16:-16),n+10,710/2-32,26),i,t.font(15),{align:a,color:V})]),r=96*t.unit,i=[{x:190,y:176,rot:-3,fill:W.green,text:`Ship this week`},{x:604,y:190,rot:4,fill:W.blue,text:`The big rewrite`},{x:236,y:322,rot:2,fill:W.yellow,text:`Nice to have`},{x:640,y:336,rot:-5,fill:W.red,text:`Kill it`}].map(({x:e,y:n,rot:i,fill:a,text:o})=>U(t.point(e,n),r,o,t.font(14),i,a));return[...I(t,`Where to spend the effort`),...n,z([t.point(120,299),t.point(868,299)],{strokeWidth:2,endArrow:!0,opacity:.5}),z([t.point(491,468),t.point(491,124)],{strokeWidth:2,endArrow:!0,opacity:.5}),...i,F(t.rect(692,466,160,26),`more effort`,t.font(14),{align:`right`,color:q}),F(t.rect(503,112,160,26),`more impact`,t.font(14),{align:`left`,color:q})]}function yr(e){let t=L(e),n=[{x:72,fill:W.green,icon:`circle-check`,title:`In scope`,body:`Shared inbox
21
+ Weekly digest
22
+ Slack alerts`},{x:350,fill:W.red,icon:`circle-slash`,title:`Not this time`,body:`Mobile app
23
+ Custom roles
24
+ SSO`},{x:628,fill:W.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})=>B([R(t.rect(e,232,260,186),n,{fillStyle:`outline`}),R(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`}}),F(t.rect(e+18,292,224,112),a,t.font(15),{align:`left`,valign:`top`,lineHeight:1.9,color:V})])),r=[`Owner · Ada`,`Ships · 14 August`,`Check-in · Fridays, 10:00`].map((e,n)=>Qt(t.rect(72+n*250,448,232,38),W.gray,e,t.font(15),{fillStyle:`pastel`}));return[...I(t,`Project kickoff`),R(t.rect(72,140,816,68),W.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=L(e),n=e=>186+e*140,r=[{label:`Hears of us`,doing:`A teammate shares a board`,mood:`smile`,fill:W.green},{label:`Signs up`,doing:`Three fields, no card`,mood:`smile`,fill:W.green},{label:`First board`,doing:`Stares at a blank canvas`,mood:`meh`,fill:W.yellow},{label:`Invites the team`,doing:`Nobody joins for a week`,mood:`frown`,fill:W.red},{label:`Renews`,doing:`Finance asks what it's for`,mood:`meh`,fill:W.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[Qt(t.rect(s,148,132,36),W.blue,e,t.font(14),{fillStyle:`outline`}),F(t.rect(s,206,132,76),r,t.font(14),{valign:`top`,lineHeight:1.5,color:V}),Y({x:l.x-c/2,y:l.y-c/2},c,i,{color:a===W.green?`#2f9e44`:a===W.red?`#e03131`:`#f08c00`})]}),i=[`Doing`,`Feeling`,`Fix it here`].map((e,n)=>F(t.rect(56,[212,306,384][n],110,30),e,t.font(15),{align:`right`,color:q})),a=104*t.unit;return[...I(t,`The trip they take`),z([t.point(176,292),t.point(888,292)],{strokeWidth:1.5,opacity:.15}),z([t.point(176,366),t.point(888,366)],{strokeWidth:1.5,opacity:.15}),...r,...i,U(t.point(n(2)+14,384),a,`Start from a template`,t.font(13),-3),U(t.point(n(3)+14,384),a,`Invite from the empty board`,t.font(13),4)]}function xr(e){let t=L(e);return[...I(t,`What the data says`),Wt(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}),F(t.rect(648,170,240,30),`The takeaway`,t.font(22),{align:`left`}),F(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:V})]}function Sr(e){let t=L(e),n=R(t.rect(96,220,180,90),W.blue,{label:`Client`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`monitor`,placement:`inside`}}),r=R(t.rect(390,220,180,90),W.teal,{label:`API`,fontSize:t.font(20),titleIcon:{source:`lucide`,name:`server`,placement:`inside`}}),i=R(t.rect(684,205,180,120),W.purple,{kind:`cylinder`,label:`Database`,fontSize:t.font(20)});return[...I(t,`How it fits together`),n,r,i,Ut(t.point(278,265),t.point(388,265),n,r,{label:`REST`,fontSize:t.font(14),strokeWidth:2.4}),Ut(t.point(572,265),t.point(682,265),r,i,{label:`SQL`,fontSize:t.font(14),strokeWidth:2.4}),F(t.rect(72,420,816,30),`Swap the boxes for your pieces. The arrows stay attached.`,t.font(16),{color:q})]}function Cr(e){let t=L(e);return[R(t.rect(-65,277,330,56),W.yellow,{fillStyle:`bold`,label:`THE ONE NUMBER`,fontSize:t.font(17),letterSpacing:.15,rotation:-90}),F(t.rect(180,150,600,200),`99.9%`,t.font(120)),F(t.rect(180,366,600,40),`what it measures, and why it matters`,t.font(20),{color:q}),z([t.point(420,352),t.point(540,352)],{color:J,strokeWidth:4})]}function wr(e){let t=L(e);return[R(t.rect(72,84,400,372),W.gray,{dash:`none`,label:`Drop an image
26
+ or sketch here`,fontSize:t.font(18),labelColor:q}),F(t.rect(528,132,360,80),`Show, then tell`,t.font(36),{align:`left`}),z([t.point(530,224),t.point(660,224)],{color:H,strokeWidth:4}),F(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:V})]}function Tr(e){let t=L(e),n=58*t.unit,r=46*t.unit,i=t.point(136,412);return[Y(t.point(136,148),n,`quote`,{color:J,strokeWidth:2.4}),F(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}),R({x:i.x,y:i.y,width:r,height:r},W.yellow,{kind:`ellipse`,label:`A`,fontSize:t.font(18)}),F(t.rect(196,410,400,28),`Ada Lovelace`,t.font(19),{align:`left`}),F(t.rect(196,436,400,26),`Head of platform, Initech`,t.font(15),{align:`left`,color:q})]}function Er(e){let t=L(e);return[rn(t.rect(112,64,224,424),`phone`),G(t.rect(128,92,192,22),`statusbar`,{label:`9:41`,fontSize:t.font(11)}),G(t.rect(128,122,192,30),`heading`,{label:`Boards`,fontSize:t.font(18)}),G(t.rect(128,160,192,34),`search`,{label:`Search boards…`,fontSize:t.font(12)}),G(t.rect(128,206,192,116),`list`,{label:`Sprint board | Roadmap wall | Retro — Tuesday`,fontSize:t.font(12)}),G(t.rect(128,336,192,42),`button`,{label:`New board`,fill:W.blue,fontSize:t.font(13)}),G(t.rect(128,424,192,44),`tabbar`,{label:`Home | Search | You`,fontSize:t.font(11)}),F(t.rect(420,150,470,80),`In your pocket`,t.font(36),{align:`left`}),z([t.point(422,240),t.point(552,240)],{color:H,strokeWidth:4}),F(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:V})]}function Dr(e){let t=L(e);return[...I(t,`Where the work lives`),rn(t.rect(72,148,520,312),`browser`),G(t.rect(84,196,96,252),`sidebar`,{label:`Boards | Team | Settings`,fontSize:t.font(11),fill:W.gray}),G(t.rect(192,194,200,30),`heading`,{label:`Roadmap wall`,fontSize:t.font(16)}),G(t.rect(428,196,152,28),`segmented`,{label:`Day | Week | Month`,fontSize:t.font(10),fill:W.blue}),...[{x:192,label:`Now`},{x:326,label:`Next`},{x:460,label:`Later`}].map(({x:e,label:n})=>G(t.rect(e,238,120,86),`card`,{label:n,fontSize:t.font(12)})),G(t.rect(192,340,388,100),`list`,{label:`Ship the fix | Call the pilot users | Write the launch post`,fontSize:t.font(12)}),F(t.rect(628,190,260,76),`One wall for the whole team`,t.font(25),{align:`left`,valign:`top`,lineHeight:1.3}),F(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:V})]}function Or(e){let t=L(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[...I(t,`What to look at`),R(t.rect(72,150,520,300),`transparent`,{dash:`dashed`,label:`Drop a screenshot here`,fontSize:t.font(17),labelColor:q,opacity:.6}),...n.flatMap(({x:e,y:n,note:i},a)=>{let o=t.point(e,n),s=178+a*92;return[G({x:o.x,y:o.y,width:r,height:r},`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:W.yellow}),...B([G(t.rect(628,s,34,34),`stepbadge`,{label:String(a+1),fontSize:t.font(15),fill:W.yellow}),F(t.rect(674,s-4,214,84),i,t.font(16),{align:`left`,valign:`top`,lineHeight:1.5,color:V})])]})]}function kr(e){let t=L(e),n=(e,n,r)=>R(e,`transparent`,{dash:`dashed`,label:n,fontSize:t.font(r),labelColor:q,opacity:.6});return[...I(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=L(e),n=124*t.unit,r=[{x:128,y:96,rot:-4,fill:W.blue,text:`What if…?`},{x:660,y:84,rot:3,fill:W.green,text:`Steal this idea`},{x:116,y:326,rot:5,fill:W.pink,text:`Open question`},{x:692,y:318,rot:-6,fill:W.teal,text:`Remember this`},{x:408,y:392,rot:2,fill:W.yellow,text:`Wild card`}].map(({x:e,y:r,rot:i,fill:a,text:o})=>U(t.point(e,r),n,o,t.font(15),i,a));return[R(t.rect(350,200,260,120),W.yellow,{kind:`ellipse`,fillStyle:`bold`,label:`The topic`,fontSize:t.font(26)}),...r]}function jr(e){let t=L(e),n=(e,n,r,i)=>R(t.rect(e,n,r,r),i,{kind:`star`,fillStyle:`bold`});return[n(186,122,44,W.yellow),n(744,104,32,W.pink),n(252,396,26,W.blue),F(t.rect(160,186,640,100),`Demo time`,t.font(72)),F(t.rect(280,300,400,48),`(everything will be fine)`,t.font(30),{fontFamily:en,color:V}),U(t.point(656,360),132*t.unit,`Plan B: screenshots`,t.font(16),5)]}function Mr(e){let t=L(e),n=26*t.unit,r=t.point(772,102);return[R({x:r.x,y:r.y,width:n,height:n},W.pink,{kind:`heart`,fillStyle:`bold`}),F(t.rect(160,190,640,100),`Thank you!`,t.font(64)),...[`hello@example.com`,`koboyo.com`,`@yourhandle`].map((e,n)=>Qt(t.rect(196+n*200,306,184,40),W.gray,e,t.font(15),{fillStyle:`pastel`})),U(t.point(688,366),180*.85*t.unit,`Questions?`,t.font(20),-6)]}function Nr(e){let t=L(e),n=84*t.unit,r=t.point(480,132);return[Y({x:r.x-n/2,y:r.y},n,`coffee`,{color:J}),F(t.rect(160,248,640,90),`Back in 10 minutes`,t.font(56)),F(t.rect(280,344,400,44),`stretch, refill, ignore Slack`,t.font(28),{fontFamily:en,color:V}),G(t.rect(330,424,300,18),`progress`,{value:.35,fill:W.blue})]}var Pr=[{id:`blank`,name:`Blank`,category:`title`,build:()=>[]},{id:`cover`,name:`Title slide`,category:`title`,build:Nn},{id:`image-cover`,name:`Image title`,category:`title`,build:Ln},{id:`dark-cover`,name:`Midnight title`,category:`title`,build:In},{id:`terminal`,name:`Terminal`,category:`title`,build:Rn},{id:`section`,name:`Section divider`,category:`title`,build:Pn},{id:`big-statement`,name:`Big statement`,category:`title`,build:Fn},{id:`bullets`,name:`Title and bullets`,category:`content`,build:zn},{id:`agenda`,name:`Agenda`,category:`content`,build:Bn},{id:`two-columns`,name:`Two columns`,category:`content`,build:Vn},{id:`comparison`,name:`Comparison`,category:`content`,build:Hn},{id:`before-after`,name:`Before and after`,category:`content`,build:Un},{id:`metrics`,name:`Key numbers`,category:`content`,build:Wn},{id:`takeaways`,name:`Three takeaways`,category:`content`,build:Gn},{id:`checklist`,name:`Do and don't`,category:`content`,build:Kn},{id:`feature-list`,name:`Feature rundown`,category:`content`,build:qn},{id:`icon-grid`,name:`Icon grid`,category:`content`,build:Jn},{id:`bento`,name:`At a glance`,category:`content`,build:Xn},{id:`venn`,name:`Overlap`,category:`content`,build:Yn},{id:`changelog`,name:`What's new`,category:`content`,build:Zn},{id:`feature-table`,name:`Feature matrix`,category:`content`,build:er},{id:`timeline`,name:`Timeline`,category:`plan`,build:tr},{id:`kanban`,name:`Now, next, later`,category:`plan`,build:nr},{id:`progress`,name:`Status report`,category:`plan`,build:rr},{id:`okrs`,name:`OKRs`,category:`plan`,build:dr},{id:`swot`,name:`SWOT`,category:`plan`,build:ir},{id:`process`,name:`Process`,category:`plan`,build:ar},{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:Qn},{id:`testimonials`,name:`What people say`,category:`pitch`,build:$n},{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 on(await an(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,X.useState)(()=>Ir.get(e)??null),s=(0,X.useRef)(t);s.current=t;let c=(0,X.useRef)(n);c.current=n;let l=(0,X.useRef)(r);return l.current=r,(0,X.useEffect)(()=>{let t=Ir.get(e);if(t){o(t);return}let n=!0,r={x:0,y:0,...c.current};return Fr(b(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,Q.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,Q.jsx)(`div`,{className:`${i} w-full`,style:{background:o?`var(--paper-bg)`:`var(--canvas-bg)`},children:c&&(0,Q.jsx)(`img`,{src:c,alt:``,draggable:!1,className:`h-full w-full object-fill`})}),(0,Q.jsxs)(`div`,{className:`border-t border-[var(--chrome-ring)] px-2.5 py-1.5`,children:[(0,Q.jsx)(`div`,{className:`text-[12px] text-[var(--chrome-fg-800)]`,children:t.name}),t.blurb?(0,Q.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,X.useRef)(null),[m,h]=(0,X.useState)(`all`),g=Te(),ee=l.filter(e=>m===`all`||e.category===m||d?.(e));return(0,Q.jsx)(It,{open:t,onOpenChange:n,children:(0,Q.jsxs)(Pt,{children:[(0,Q.jsx)(Nt,{className:`fixed inset-0 bg-gray-900/15`}),(0,Q.jsxs)(Ft,{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,Q.jsxs)(`div`,{className:`sticky top-0 z-10 border-b border-[var(--chrome-ring)] bg-[var(--chrome-surface)] backdrop-blur`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between px-5 pb-2.5 pt-3.5`,children:[(0,Q.jsx)(Rt,{className:`text-[15px] text-[var(--chrome-fg-900)]`,children:r}),(0,Q.jsx)(Lt,{"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,Q.jsx)(qe,{size:16,stroke:1.75})})]}),(0,Q.jsx)(`div`,{className:`scrollbar-slim flex gap-1.5 overflow-x-auto px-5 pb-3`,children:c.map(({id:e,label:t})=>(0,Q.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,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-3 p-5 sm:grid-cols-3`,children:ee.map(e=>(0,Q.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,Q.jsx)(zr,{open:t,onOpenChange:n,title:`Pick a slide template`,prefix:`slide-template`,width:`w-[min(680px,92vw)]`,cardAspect:`aspect-video`,canvas:qt,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(fe(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,X.useMemo)(()=>D(n,t),[n,t]),a=Te(),[o,s]=(0,X.useState)(()=>Gr.get(t.id)?.url??null);return(0,X.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,te(t),e=>t.fill&&t.fill!==`transparent`?C(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,Q.jsx)(`div`,{className:`w-full overflow-hidden rounded-[7px] bg-[var(--canvas-bg)]`,style:{height:Wr(t)},children:o&&(0,Q.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 _(e=>e.rightPanel===`slides`)?(0,Q.jsx)($r,{containerRef:t}):null}function $r(e){let{containerRef:t}=e,{ai:n,embed:i}=g(),a=Se(`slide`),o=ee(),{store:s,viewportAnimation:c,history:l}=o,u=et(),{beginTransaction:d,endTransaction:f}=l,p=_(e=>e.shapes),m=_(e=>e.viewport),h=_(e=>e.slidePickerOpen),v=_(e=>e.animateSlideId),y=_(e=>e.selectedIds),b=_(e=>e.viewMode),{addMany:x,sendToBack:C,replaceMany:w,removeShapes:T,updateShape:k,setSelectedIds:fe,setSlidesOpen:pe,setSlidePickerOpen:me,setNotesEditorId:he,setAnimateSlideId:ge,setAiOpen:ve,setPresentingIndex:ye,setViewport:xe,setExportDialog:we}=s.getState(),A=(0,X.useMemo)(()=>E(p),[p]),Te=(0,X.useMemo)(()=>at(p),[p]),Ee=(0,X.useMemo)(()=>ae(A).length,[A]),[j,M]=(0,X.useState)(null);(0,X.useEffect)(()=>{qr(new Set(A.map(e=>e.id)))},[A]);let De=Vt()===`docked`,Oe=(0,X.useCallback)(()=>{let e=t.current,n=e?.clientWidth??window.innerWidth,r=e?.clientHeight??window.innerHeight;return{width:Math.max(1,n-(De?272:0)),height:r}},[t,De]),ke=(0,X.useMemo)(()=>le(A,m,Oe()),[A,m,Oe]);function N(e){c.animate(s.getState().viewport,de(te(e),Oe(),Xr),xe)}(0,X.useEffect)(()=>{if(!v||y.size===0)return;let e=s.getState().shapes,t=re(e,E(e),y);!t||t.id===v||ge(t.id)},[y,v,s,ge]);function Ae(e,t){let{width:n,height:r}=Oe(),i=S({x:n/2,y:r/2},m),a={...O(A,i,p),slideOrder:e,slideLayout:t&&t.id!==`blank`?t.id:void 0},o=t?t.build(te(a)):[];d(),w(ce(A,e)),x([a,...o]),C(new Set([a.id])),f(),fe(new Set([a.id])),N(a)}function je(e){let t=s.getState().shapes,{clones:n,renumbered:r}=se(t,A,e);d(),w(r),x(n),C(new Set([n[0].id])),f(),fe(new Set([n[0].id])),N(n[0])}function Me(e){let t=s.getState().shapes;T(oe(t,A[e])),fe(new Set)}function Ne(e,t){let n=s.getState().shapes,r=A[e],i=D(n,r),a={bounds:te(r),padding:0,background:r.fill,measurement:o.measurement},c=ue(r,e);u(t===`png`?`downloadPng`:`downloadSvg`,i,{options:a,filename:c})}function Pe(e){Ee!==0&&ye(e??Math.max(0,ke))}function Fe(){if(!j)return;let e=j.value.trim();e!==j.initial&&k(j.id,{label:e}),M(null)}let P=Ge({count:A.length,gap:Zr,disabled:b,onPress:e=>N(A[e]),onReorder:(e,t)=>w(ne(A,e,t)),canDrag:()=>!j}),Ie=v?A.findIndex(e=>e.id===v):-1,Le=Ie>=0?A[Ie]:void 0;return(0,Q.jsxs)(Ht,{width:272,testId:`slides-panel`,ariaLabel:`Slides`,onDismiss:()=>pe(!1),children:[Le?(0,Q.jsx)(Cn,{figure:Le,index:Ie,total:A.length,viewMode:b,onBack:()=>ge(null),onGoToSlide:e=>{let t=A[e];t&&(ge(t.id),N(t))},onFocusSlide:N}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between py-2 pl-4 pr-2`,children:[(0,Q.jsxs)(`span`,{className:`text-[14px] text-[var(--chrome-fg-900)]`,"data-testid":`slides-count`,children:[`Slides (`,A.length,`)`]}),(0,Q.jsxs)(`div`,{className:`flex items-center`,children:[n&&!b&&(0,Q.jsx)(r,{label:`Generate with AI`,side:`bottom`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Generate slides with AI`,"data-testid":`slides-ai-open`,onClick:()=>ve(!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,Q.jsx)(Ke,{size:16,stroke:1.75})})}),!b&&(0,Q.jsx)(r,{label:`Add slide`,side:`bottom`,children:(0,Q.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,Q.jsx)(He,{size:16,stroke:1.75})})}),i?null:(0,Q.jsx)(r,{label:`Export as PDF`,side:`bottom`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Export slides as PDF`,"data-testid":`slides-export-pdf`,disabled:Ee===0,onClick:()=>we({format:`pdf`}),className:`${jt} disabled:pointer-events-none disabled:text-[var(--chrome-fg-300)]`,children:(0,Q.jsx)(_e,{size:16,stroke:1.75})})}),(0,Q.jsx)(r,{label:`Hide slides`,side:`bottom`,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":`Hide slides`,"data-testid":`slides-close`,onClick:()=>pe(!1),className:jt,children:(0,Q.jsx)(qe,{size:16,stroke:1.75})})})]})]}),(0,Q.jsx)(`div`,{className:`mx-3 h-px bg-[var(--chrome-divider)]`}),(0,Q.jsxs)(`div`,{ref:P.listRef,"data-testid":`slides-list`,className:`flex flex-1 flex-col gap-3 overflow-y-auto p-3`,children:[A.length===0&&(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[(0,Q.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.`}),!b&&(0,Q.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,Q.jsx)(He,{size:14,stroke:1.75}),`Add slide`]})]}),A.map((e,t)=>{let n=ie(e,t),r=t===ke,o={onPresent:()=>Pe(t),onExportPng:i?null:()=>Ne(t,`png`),onExportSvg:i?null:()=>Ne(t,`svg`),onEmbed:a?()=>a(e.id):null,onDuplicate:()=>je(t),onRename:()=>M({id:e.id,initial:n,value:n}),onEditNotes:()=>he(e.id),onToggleSkip:()=>k(e.id,{slideSkipped:!e.slideSkipped||void 0}),onAddAbove:()=>Ae(t),onAddBelow:()=>Ae(t+1),onDelete:()=>Me(t)};return(0,Q.jsxs)(`div`,{ref:P.setItemRef(t),"data-testid":`slide-item-${t}`,className:`group relative shrink-0`,style:P.rowStyle(t),children:[(0,Q.jsx)(Mn,{index:t,actions:o,skipped:!!e.slideSkipped,disabled:b,children:(0,Q.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`}`,...P.rowHandlers(t),children:[(0,Q.jsx)(`div`,{className:e.slideSkipped?`opacity-40`:void 0,children:(0,Q.jsx)(Jr,{figure:e,shapes:p})}),(0,Q.jsxs)(`div`,{className:`absolute left-1.5 top-1.5 flex items-center gap-1`,children:[e.slideSkipped&&(0,Q.jsxs)(`div`,{"data-testid":`slide-skipped-${t}`,title:`Skipped — not shown when presenting`,className:Yr,children:[(0,Q.jsx)(Ce,{size:11,stroke:1.75}),`Skipped`]}),Te.has(e.id)&&(0,Q.jsxs)(`div`,{"data-testid":`slide-animated-${t}`,title:`Animated: plays in ${Te.get(e.id)} clicks`,className:Yr,children:[(0,Q.jsx)(be,{size:11,stroke:1.75}),Te.get(e.id)]})]}),j?.id===e.id?(0,Q.jsx)(`input`,{autoFocus:!0,onFocus:e=>e.target.select(),value:j.value,onChange:e=>M({...j,value:e.target.value}),onBlur:Fe,onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&Fe(),e.key===`Escape`&&M(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,Q.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:()=>N(e),onDoubleClick:t=>{t.stopPropagation(),b||M({id:e.id,initial:n,value:n})},children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-[var(--chrome-fg-400)]`,children:t+1}),(0,Q.jsx)(`span`,{className:`truncate`,children:n})]})]})}),(0,Q.jsx)(jn,{index:t,actions:o,skipped:!!e.slideSkipped,disabled:b})]},e.id)})]}),(0,Q.jsx)(`div`,{className:`border-t border-[var(--chrome-ring)] p-3`,children:(0,Q.jsx)(Dn,{disabled:Ee===0,onPresent:e=>Pe(e===`beginning`?0:void 0)})})]}),(0,Q.jsx)(Vr,{open:h,onOpenChange:me,onPick:e=>{Ae(A.length,e),De||pe(!1)}})]})}export{Qr as SlidesPanel};
@@ -0,0 +1,7 @@
1
+ import{At as e,Tn as t,bn as n,pi as r}from"./slides-D686obFO.js";function i(e,t,n){}var a=`Inter, ui-sans-serif, system-ui, sans-serif`;function o(e){let t=e.label.trim();if(e.kind===`html`){let n=`${Math.round(e.width)}×${Math.round(e.height)}`;return{title:t||`HTML widget`,caption:`HTML widget · ${n}`,glyph:`code`}}let n=e.url?r(e.url):null;if(!n)return{title:t||`Web embed`,caption:e.url??``,glyph:`globe`};let i=new URL(n.canonical).hostname.replace(/^www\./,``);return{title:t||n.label,caption:i,glyph:n.video?`play`:`globe`}}function s(e){return(e.split(`,`)[0]?.trim()??``).replace(/^['"]|['"]$/g,``)}var c=`JetBrains Mono`;function l(e){if(e.type===`control`)return`${e.label??``} ${e.body??``}`;if(e.type===`arrow`)return[e.label,e.startLabel,e.endLabel].filter(Boolean).join(` `);if(e.type===`figure`)return[e.label,...e.lanes??[]].filter(Boolean).join(` `);if(e.type===`chart`)return[...e.showTitles?[e.title,e.xTitle,e.yTitle]:[],...e.quadrantLabels??[]].filter(Boolean).join(` `);if((e.type===`rectangle`||e.type===`icon`||e.type===`line`)&&`label`in e)return e.label??``;if(e.type===`text`||e.type===`sticky`)return e.text;if(e.type===`web`&&!e.poster){let t=o(e);return`${t.title} ${t.caption}`}return``}function u(e){let t=new Set,n=!1,r=!1,i=new Set,o=e=>{for(let t of e)i.add(t.codePointAt(0)??0)};for(let i of e){let e=l(i),u=!!e||i.type===`chart`||i.type===`table`;if(u&&`fontFamily`in i&&i.fontFamily&&t.add(s(i.fontFamily)),u&&i.type===`web`&&t.add(s(a)),e.includes(`<code`)&&t.add(c),n||=e.includes(`<strong`),r||=e.includes(`<em`),o(e),`cells`in i&&Array.isArray(i.cells))for(let e of i.cells)for(let t of e)o(String(t));if(i.type===`table`&&i.cellStyles){for(let e of i.cellStyles)if(e)for(let n of e)n?.fontFamily&&t.add(s(n.fontFamily))}}return{families:t,bold:n,italic:r,codepoints:i}}var d={woff2:`font/woff2`,woff:`font/woff`,truetype:`font/ttf`,opentype:`font/otf`};function f(e,t){let n=e.format??`woff2`,r=`data:${d[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 p(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`)&&m(e.unicodeRange??``,o)).map(e=>f(e,n)).join(`
2
+ `)}function m(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 h=`#ffec99`,g=.14;function _(e,t){return(e.fill??``).localeCompare(t.fill??``)||e.y-t.y||e.x-t.x}function v(t,n){return{id:e(),type:`sticky`,x:t.x,y:t.y,width:180,height:180,rotation:0,text:``,fontSize:n.fontSize,fontFamily:n.fontFamily,fill:n.fill===`transparent`?h:n.fill,opacity:n.opacity}}var y=new Set([`/`,`\\`,`.`,`_`,`-`,`:`,`#`,`,`,`?`,`&`,`=`,`@`]),b=2,x=/^[A-Za-z0-9]{1,5}$/,S=e=>e!==e.toUpperCase()&&e===e.toLowerCase(),C=e=>e!==e.toLowerCase()&&e===e.toUpperCase();function w(e){let t=Array.from(e),n=[];for(let e=b;e<=t.length-b;e+=1){let r=t[e-1],i=t[e];if(y.has(r)&&!y.has(i)){(r!==`.`||!x.test(t.slice(e).join(``)))&&n.push(e);continue}let a=S(r)&&C(i),o=C(r)&&C(i)&&S(t[e+1]??``);(a||o)&&n.push(e)}return n}function T(e){let t=Array.from(e),n=[0,...w(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 E(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 D(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=E(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}T(r).forEach((e,t)=>a(e,t===0?` `:``))}return(i||r.length===0)&&r.push(i),r}function O(e,r,i){return e.split(`
3
+ `).map(e=>e.split(` `).map(e=>n(e,i)<=r?t(e):T(e).map(t).join(`<wbr>`)).join(` `)).join(`
4
+ `)}var k={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`},A=/^<\/?(?:br|p|div|li|ul|ol|h[1-6]|blockquote)\b/i;function j(e){let t=[];for(let n of e.split(/(<[^>]*>)/))if(n){if(n.startsWith(`<`)&&n.endsWith(`>`)){t.push({raw:n,char:A.test(n)?`
5
+ `:``,tag:!0});continue}for(let e of n.matchAll(/&[#\w]+;|[\s\S]/gu)){let n=e[0],r=n.length>1?k[n]??`x`:n;t.push({raw:n,char:r,tag:!1})}}return t}function M(e,t,r){let i=j(e),a=new Set,o=[],s=()=>{let e=o.map(e=>i[e].char).join(``);if(e&&n(e,r)>t&&Array.from(e).length===o.length)for(let t of w(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 N(e,t,r){return e.split(`
6
+ `).map(e=>e.split(` `).map(e=>n(e,r)<=t?e:T(e).join(`​`)).join(` `)).join(`
7
+ `)}export{D as a,_ as c,s as d,m as f,i as g,o as h,N as i,v as l,a as m,O as n,h as o,u as p,M as r,g as s,w as t,p as u};
@@ -1 +1 @@
1
- import{zn as e}from"./slides-D9bnXqtf.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{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};
@@ -0,0 +1 @@
1
+ import{Dn as e,Ut as t,Zt as n,_ as r,an as i,on as a}from"./slides-D686obFO.js";import{S as o,Z as s}from"./style-BENGW2ZV.js";import{r as c}from"./elk-worker-loader-CVBdN1je.js";import{t as l}from"./icons-DzW1j-r3.js";import{i as u,r as d,t as f}from"./tidy-scope-BGG3ZXvZ.js";import{t as p}from"./widget-source-CHujvUeA.js";import{n as m}from"./asset-glyph-C1E6cGwM.js";import{n as h}from"./shape-meta-COE2ATNh.js";import{a as g,c as _,l as v,n as y,o as b,s as x,t as S}from"./layout-offthread-mRHRulkS.js";import{T as C}from"./builders-DMHAOPEv.js";var w={none:[!1,!1],start:[!0,!1],end:[!1,!0],both:[!0,!0]},T={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}},E={top:`top`,right:`right`,bottom:`bottom`,left:`left`};function D(e,t){return!e||!t||`kind`in e||!T[t]?e:{...e,anchor:T[t],precise:!0}}function O(e,t){if(e.type!==`arrow`)return e;let n={...e};t.fromSide&&(n.startBinding=D(n.startBinding,t.fromSide)),t.toSide&&(n.endBinding=D(n.endBinding,t.toSide));let r=t.style??(t.dashed?`dashed`:void 0);r&&(n.dash=r),t.color&&o[t.color]&&(n.color=o[t.color]);let i=t.arrows?w[t.arrows]:t.bidirectional?w.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 k(e){return e.type===`rectangle`||e.type===`icon`||e.type===`sticky`||e.type===`table`||e.type===`chart`}function A(e,t){return{id:e,width:t.width,height:t.height,rank:0,x:t.x,y:t.y}}function j(e,t,n,r,s){let c=()=>{let r=O(C(a(e),a(t),e,t),n);return r.strokeWidth=_,r},l=i(e),u=i(t),d=r.filter(n=>n.id!==e.id&&n.id!==t.id&&k(n)).map(e=>i(e));if(!x([a(e),a(t)],d)&&n.bend===`curved`)return c();let f=v({bounds:l,side:n.fromSide?E[n.fromSide]:void 0},{bounds:u,side:n.toSide?E[n.toSide]:void 0},d,void 0,s);if(!f)return c();let p=b({from:A(e.id,l),to:A(t.id,u),fromShapeId:e.id,toShapeId:t.id,routed:{elbow:!0,bend:0,route:f},label:n.label,labelObstacles:d,dashed:n.style===`dashed`||n.dashed,color:n.color&&o[n.color]?o[n.color]:void 0}),m=n.arrows?w[n.arrows]:n.bidirectional?w.both:void 0;return m&&(p.startArrow=m[0],p.endArrow=m[1]),n.style===`dotted`&&(p.dash=`dotted`),p}function M(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 N=(()=>{let e={};for(let[t,n]of Object.entries(g))n&&!(n in e)&&(e[n]=t);return e})();function P(e){let t=h(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:N[e.kind]}:{id:e.id,label:t}}var F=28,I=44;function L(e,n,r,a,o){if(e.type===`rectangle`||e.type===`icon`||e.type===`sticky`)return{...e,x:n,y:r,width:a,height:o};let s=i(e);return t(e,{x:n-s.x,y:r-s.y})}function R(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:M(e,j(r,i,{},t))}async function z(o,c,l,p){let m=new Set;if(Array.isArray(o.ids)&&o.ids.forEach(e=>m.add(e)),o.selection&&l.forEach(e=>m.add(e)),m.size===0)return[];let g=d(c,m),_=c.filter(e=>g.has(e.id)),v=_.filter(e=>f.has(e.type));if(v.length<2)return[];let y=new Set(v.map(e=>e.id)),b=_.filter(e=>e.type===`arrow`&&!!e.startBinding&&!(`kind`in e.startBinding)&&!!e.endBinding&&!(`kind`in e.endBinding)&&y.has(e.startBinding.shapeId)&&y.has(e.endBinding.shapeId)&&e.startBinding.shapeId!==e.endBinding.shapeId),x=n(v);if(!x)return[];let S=_.filter(e=>e.type===`figure`),C=(e,t)=>s(a(t),i(e)),w=S.filter(e=>!v.every(t=>C(e,t))),T=e=>u(w,e)?.id,E=new Set,D=v.map(e=>{let t=P(e),n=T(e);return n?(E.add(n),{...t,group:n}):t}),O={kind:`graph`,title:``,direction:o.direction??(x.height>x.width*1.3?`down`:`right`),nodes:D,groups:S.filter(e=>E.has(e.id)).map(e=>({id:e.id,label:h(e)})),edges:b.map(e=>({from:e.startBinding.shapeId,to:e.endBinding.shapeId,label:e.label,dashed:e.dash===`dashed`}))},k=await p.layoutGraph(O),A=k.filter(e=>e.type===`rectangle`||e.type===`icon`||e.type===`sticky`);if(A.length!==v.length)return[];let j=n(A);if(!j)return[];let N=x.x-j.x,z=x.y-j.y,B=new Map,V=new Map;v.forEach((e,t)=>{let n=i(A[t]);V.set(A[t].id,e.id),B.set(e.id,L(e,n.x+N,n.y+z,n.width,n.height))});let H=k.filter(e=>e.type===`arrow`),U=e=>{if(!e||`kind`in e)return e;let t=V.get(e.shapeId);return t?{...e,shapeId:t}:e},W;W=H.length===b.length?b.map((n,r)=>{let i=t(H[r],{x:N,y:z}),a=M(n,i);return a.startBinding=U(a.startBinding),a.endBinding=U(a.endBinding),i.label&&n.label&&!e(n.label)&&(a.label=i.label),a}):[];let G=[],K=new Map(B);W.forEach(e=>K.set(e.id,e));let q=S.filter(e=>E.has(e.id)),J=k.filter(e=>e.type===`figure`);J.length===q.length&&q.forEach((e,t)=>{let n=i(J[t]),r={...e,x:n.x+N,y:n.y+z,width:n.width,height:n.height};G.push(r),K.set(e.id,r)});let Y=new Set(G.map(e=>e.id));for(let e of S){if(Y.has(e.id))continue;let t=n(r(c,e).map(e=>K.get(e.id)).filter(e=>e!==void 0));if(t){let n={...e,x:t.x-F,y:t.y-I,width:t.width+F*2,height:t.height+F+I};G.push(n),K.set(e.id,n)}}if(W.length===0&&b.length>0){let e=c.map(e=>K.get(e.id)??e);W=b.map(t=>R(t,e))}return[...B.values(),...G,...W]}var B=c(),V={resolveIcon:e=>l().resolveIcon(e),glyphAspect:m,layoutDiagram:(e,t)=>S(e,t),layoutGraph:y,measureText:typeof document>`u`?void 0:(e,t,n,r)=>B.measure(e,t,n,r),loadWidgetHtml:p};function H(e,t,n){return z(e,t,n,V)}export{H as tidyInBrowser};
@@ -0,0 +1 @@
1
+ import{_ as e,an as t,on as n}from"./slides-D686obFO.js";import{Z as r}from"./style-BENGW2ZV.js";var i=new Set([`rectangle`,`icon`,`sticky`]);function a(e,i){let a=n(i),o;for(let n of e){let e=t(n);r(a,e)&&(!o||e.width*e.height<o.width*o.height)&&(o=n)}return o}function o(t,n){let r=new Set(n),o=t.filter(e=>e.type===`figure`&&(e.kind??`simple`)===`simple`&&e.slideOrder===void 0);for(let n=0;n<4;n+=1){let n=r.size;for(let n of t)r.has(n.id)&&n.type===`figure`&&e(t,n).forEach(e=>r.add(e.id));for(let e of t){if(!r.has(e.id)||!i.has(e.type))continue;let t=a(o,e);t&&r.add(t.id)}if(r.size===n)break}return r}function s(e,t){if(t.size===0)return!1;let n=o(e,t),r=0;for(let t of e)if(n.has(t.id)&&i.has(t.type)&&(r+=1,r>=2))return!0;return!1}export{a as i,s as n,o as r,i as t};