koboyo 0.4.0 → 0.5.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 (142) hide show
  1. package/README.md +26 -0
  2. package/assets/editor/assets/ContextMenuTrigger-CXUL1E23.js +1 -0
  3. package/assets/editor/assets/{IconHelp-CaEwHrsN.js → IconHelp-4FIVl1rh.js} +2 -2
  4. package/assets/editor/assets/IconReplace-CYUD1RLF.js +1 -0
  5. package/assets/editor/assets/MenuSubmenuTrigger-BFlIkXYg.js +1 -0
  6. package/assets/editor/assets/{PopoverPopup-B3Y0VRYc.js → PopoverPopup-1zO38CRl.js} +1 -1
  7. package/assets/editor/assets/asset-glyph-DjBHkQcP.js +1 -0
  8. package/assets/editor/assets/build-pips-BRf3pMnt.js +1 -0
  9. package/assets/editor/assets/build-visibility-CAmmsnmF.js +1 -0
  10. package/assets/editor/assets/builders-DrWdKwLQ.js +1 -0
  11. package/assets/editor/assets/{chart-4iRduYdU.js → chart-CKIxcbcM.js} +4 -4
  12. package/assets/editor/assets/{chrome-layout-BzPU9far.js → chrome-layout-D5dql-y4.js} +1 -1
  13. package/assets/editor/assets/code-panel-BFikzGNv.js +18 -0
  14. package/assets/editor/assets/color-swatches-CZKb4DxX.js +1 -0
  15. package/assets/editor/assets/{command-palette-BR-_ChOL.js → command-palette-Uat68wmJ.js} +1 -1
  16. package/assets/editor/assets/connector-labels-DqVssnYz.js +2 -0
  17. package/assets/editor/assets/{copy-image-dialog-BzGP7Xw8.js → copy-image-dialog-C0fXdR1a.js} +1 -1
  18. package/assets/editor/assets/core-C1TxysMz.js +1 -0
  19. package/assets/editor/assets/diagram-fingerprint-B-HB8UbR.js +3 -0
  20. package/assets/editor/assets/{edit-C0sBxxsg.js → edit-B4DMFSZr.js} +1 -1
  21. package/assets/editor/assets/editor-DAJETlQW.js +1 -0
  22. package/assets/editor/assets/{elk-worker-loader-CVBdN1je.js → elk-worker-loader-BCdkmVMX.js} +1 -1
  23. package/assets/editor/assets/embed-input-D77Udvni.js +1 -0
  24. package/assets/editor/assets/export-FQTXirjn.js +2 -0
  25. package/assets/editor/assets/{export-dialog-x2n2a4KX.js → export-dialog-KYLeNY3G.js} +1 -1
  26. package/assets/editor/assets/export-u442sUQs.js +6 -0
  27. package/assets/editor/assets/flow-layer-B4Q8rktl.js +1 -0
  28. package/assets/editor/assets/flow-panel-DbnavW4w.js +1 -0
  29. package/assets/editor/assets/flow-stage-CSTrNMZF.js +1 -0
  30. package/assets/editor/assets/{flow-start-CpAvU-9P.js → flow-start-ByhFxEeV.js} +1 -1
  31. package/assets/editor/assets/{flows-Cj7AFMIA.js → flows-CGl4r-xb.js} +1 -1
  32. package/assets/editor/assets/{frames-Cp1QD3LR.js → frames-DRSLvE9E.js} +1 -1
  33. package/assets/editor/assets/generate-DHP90nDk.js +26 -0
  34. package/assets/editor/assets/{icon-picker-Cg39IKNJ.js → icon-picker-DIkw2xYL.js} +1 -1
  35. package/assets/editor/assets/{image-library-JQu_tb8P.js → image-library-BmoSPV9c.js} +1 -1
  36. package/assets/editor/assets/index-DFwoT1_W.js +25 -0
  37. package/assets/editor/assets/layout-offthread-JPTCbsLL.js +18 -0
  38. package/assets/editor/assets/menu-4xb5HtA1.js +1 -0
  39. package/assets/editor/assets/mermaid-paste-2cCwweY0.js +1 -0
  40. package/assets/editor/assets/panel-controls-B0Ccd0XF.js +1 -0
  41. package/assets/editor/assets/{panel-shell-BnMOHgWM.js → panel-shell-COqmheb-.js} +1 -1
  42. package/assets/editor/assets/plan-D4Jyzo5X.js +1 -0
  43. package/assets/editor/assets/presentation-DNmdm11D.js +1 -0
  44. package/assets/editor/assets/{presenter-keys-Bs3LnmOa.js → presenter-keys-DLNIsrm5.js} +1 -1
  45. package/assets/editor/assets/reflow-C6bvnSVm.js +1 -0
  46. package/assets/editor/assets/registry-d5KleeyB.js +1 -0
  47. package/assets/editor/assets/rich-paste-route-Bx69sREx.js +1 -0
  48. package/assets/editor/assets/ride-overlay-C1TrM7Ki.js +1 -0
  49. package/assets/editor/assets/selection-overlay-primitives-CfOaP5_G.js +1 -0
  50. package/assets/editor/assets/shape-meta-YgfIm0bQ.js +1 -0
  51. package/assets/editor/assets/shape-render-DZscezZk.js +1 -0
  52. package/assets/editor/assets/shapes-D5w8NTQQ.js +11 -0
  53. package/assets/editor/assets/{slide-notes-dialog-BQBXpep6.js → slide-notes-dialog-43EMJFJV.js} +1 -1
  54. package/assets/editor/assets/slides-DDNzjFz9.js +5 -0
  55. package/assets/editor/assets/slides-panel-DANnu_nw.js +26 -0
  56. package/assets/editor/assets/text-breaks-DhCXtQrJ.js +7 -0
  57. package/assets/editor/assets/{theme-palette-Dl_G_VIJ.js → theme-palette-DEq19D0h.js} +1 -1
  58. package/assets/editor/assets/tidy-browser-BdlwTfCT.js +1 -0
  59. package/assets/editor/assets/tidy-scope-REEad7oC.js +1 -0
  60. package/assets/editor/assets/{tool-catalog-DXPhX2S1.js → tool-catalog-CIjdZm_C.js} +1 -1
  61. package/assets/editor/assets/{tool-drawer-CWOX_njp.js → tool-drawer-B-Ys7Rsn.js} +1 -1
  62. package/assets/editor/assets/{tooltip-CyBz17g8.js → tooltip-CKCG8vcp.js} +1 -1
  63. package/assets/editor/assets/tree-BWJsAqkV.js +1 -0
  64. package/assets/editor/assets/use-export-command-BR-A4kAa.js +2 -0
  65. package/assets/editor/assets/{use-grid-keyboard-nav-DhQKecO1.js → use-grid-keyboard-nav-B0jjlh8Q.js} +0 -0
  66. package/assets/editor/assets/{use-icon-node-BxqH7H27.js → use-icon-node-uhKPP4Ki.js} +1 -1
  67. package/assets/editor/assets/{use-key-held-094C3Mn3.js → use-key-held-DaUTxGze.js} +1 -1
  68. package/assets/editor/assets/useTriggerFocusGuards-Mibi8yYw.js +1 -0
  69. package/assets/editor/assets/web-card-BTru0lge.js +1 -0
  70. package/assets/editor/assets/web-card-font-BbZEq3En.js +1 -0
  71. package/assets/editor/assets/web-controls-BjBov-C2.js +1 -0
  72. package/assets/editor/assets/web-embed-dialog-sT-1yK5o.js +1 -0
  73. package/assets/editor/assets/web-embed-url-CHu4SU82.js +1 -0
  74. package/assets/editor/assets/web-embeds-I3saJ_yp.js +1 -0
  75. package/assets/editor/assets/web-html-dialog-B5Hb3RGw.js +1 -0
  76. package/assets/editor/assets/web-runtime-wPi8lWzO.js +1 -0
  77. package/assets/editor/assets/web-widget-limits-DeMquLIR.js +1 -0
  78. package/assets/editor/assets/web-widgets-DsFUBhiq.js +325 -0
  79. package/assets/editor/assets/widget-source-C3N9ZKTz.js +2 -0
  80. package/assets/editor/assets/widget-target-C9a207gT.js +1 -0
  81. package/assets/editor/index.html +41 -35
  82. package/dist/koboyo.js +565 -232
  83. package/package.json +3 -3
  84. package/skills/koboyo/SKILL.md +8 -3
  85. package/skills/koboyo/references/architecture.md +1 -1
  86. package/skills/koboyo/references/bpmn.md +1 -1
  87. package/skills/koboyo/references/chart.md +1 -1
  88. package/skills/koboyo/references/cycle.md +1 -1
  89. package/skills/koboyo/references/erd.md +1 -1
  90. package/skills/koboyo/references/flowchart.md +1 -1
  91. package/skills/koboyo/references/funnel.md +1 -1
  92. package/skills/koboyo/references/gantt.md +1 -1
  93. package/skills/koboyo/references/gitgraph.md +1 -1
  94. package/skills/koboyo/references/journey.md +1 -1
  95. package/skills/koboyo/references/matrix.md +1 -1
  96. package/skills/koboyo/references/mindmap.md +1 -1
  97. package/skills/koboyo/references/orgchart.md +1 -1
  98. package/skills/koboyo/references/pyramid.md +1 -1
  99. package/skills/koboyo/references/sankey.md +1 -1
  100. package/skills/koboyo/references/sequence.md +1 -1
  101. package/skills/koboyo/references/statemachine.md +1 -1
  102. package/skills/koboyo/references/timeline.md +1 -1
  103. package/skills/koboyo/references/venn.md +1 -1
  104. package/skills/koboyo/references/wireframe.md +1 -1
  105. package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +0 -1
  106. package/assets/editor/assets/asset-glyph-C1E6cGwM.js +0 -1
  107. package/assets/editor/assets/build-pips-BV-uwXlP.js +0 -1
  108. package/assets/editor/assets/build-visibility-DyML9SHt.js +0 -1
  109. package/assets/editor/assets/builders-DMHAOPEv.js +0 -1
  110. package/assets/editor/assets/code-panel-koBUgEWp.js +0 -43
  111. package/assets/editor/assets/connector-labels-CrEgadsC.js +0 -2
  112. package/assets/editor/assets/core-CmsJyU_-.js +0 -1
  113. package/assets/editor/assets/diagram-fingerprint-WGQ5iVXx.js +0 -3
  114. package/assets/editor/assets/editor-BeufBV54.js +0 -1
  115. package/assets/editor/assets/export-Bce6ra0N.js +0 -2
  116. package/assets/editor/assets/export-K2VWg76n.js +0 -6
  117. package/assets/editor/assets/flow-layer-ewaL7g2y.js +0 -1
  118. package/assets/editor/assets/flow-panel-BzXNGGke.js +0 -1
  119. package/assets/editor/assets/flow-stage-Ba_CAggI.js +0 -1
  120. package/assets/editor/assets/index-CBPPqsiR.js +0 -24
  121. package/assets/editor/assets/layout-offthread-mRHRulkS.js +0 -18
  122. package/assets/editor/assets/menu-B9BAk63v.js +0 -1
  123. package/assets/editor/assets/panel-controls-DWVXiNUZ.js +0 -1
  124. package/assets/editor/assets/plan-CkgM52Yh.js +0 -1
  125. package/assets/editor/assets/presentation-DJUO0t7I.js +0 -1
  126. package/assets/editor/assets/reflow-DaYiVkwp.js +0 -1
  127. package/assets/editor/assets/registry-rEGZW7Ab.js +0 -1
  128. package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +0 -1
  129. package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +0 -1
  130. package/assets/editor/assets/shape-meta-COE2ATNh.js +0 -1
  131. package/assets/editor/assets/slides-D686obFO.js +0 -15
  132. package/assets/editor/assets/slides-panel-BEJCevJi.js +0 -26
  133. package/assets/editor/assets/text-breaks-DM4W6y5f.js +0 -7
  134. package/assets/editor/assets/tidy-browser-dF3BON7J.js +0 -1
  135. package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +0 -1
  136. package/assets/editor/assets/tree-KSgPjntC.js +0 -1
  137. package/assets/editor/assets/use-export-command-sC9UHj3_.js +0 -2
  138. package/assets/editor/assets/web-controls-CLE9zr7i.js +0 -1
  139. package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +0 -1
  140. package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +0 -1
  141. package/assets/editor/assets/web-shape-C941TGTy.js +0 -1
  142. package/assets/editor/assets/widget-source-CHujvUeA.js +0 -1
package/README.md CHANGED
@@ -91,6 +91,32 @@ koboyo convert flow.mmd # Mermaid to Koboyo code: flow.kbd
91
91
  Run `koboyo help` to see every command, and `koboyo help <command>` for its
92
92
  options and examples.
93
93
 
94
+ ## Shell completion
95
+
96
+ `koboyo completion <shell>` prints a script that completes commands, options
97
+ and diagram files. `koboyo setup` tells you when your shell doesn't have it
98
+ yet. Install it once for your shell:
99
+
100
+ ```sh
101
+ # bash (4.1+ with bash-completion)
102
+ mkdir -p ~/.local/share/bash-completion/completions
103
+ koboyo completion bash > ~/.local/share/bash-completion/completions/koboyo
104
+
105
+ # zsh: then add `fpath=(~/.zfunc $fpath)` to ~/.zshrc, before compinit
106
+ mkdir -p ~/.zfunc && koboyo completion zsh > ~/.zfunc/_koboyo
107
+
108
+ # fish
109
+ koboyo completion fish > ~/.config/fish/completions/koboyo.fish
110
+ ```
111
+
112
+ ```powershell
113
+ koboyo completion powershell > "$HOME\koboyo-completion.ps1"
114
+ Add-Content $PROFILE '. "$HOME\koboyo-completion.ps1"'
115
+ ```
116
+
117
+ Start a new shell to use it. Run the same command again after updating koboyo,
118
+ so new commands and options complete too.
119
+
94
120
  ## Warnings in the code
95
121
 
96
122
  Problems are printed with their line, the way compilers print them:
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{Ft as n,Gt as r,U as i,W as a,Wt as o,ht as s,in as c,it as l,rn as u,rt as d,s as f,tn as p}from"./useScrollLock-CQpr0n6U.js";import{r as m}from"./toast-Czv_DJ-4.js";import{t as h}from"./jsx-runtime-DKdBMi_L.js";import{S as g,c as _,s as v,v as y,x as b,y as x}from"./menu-4xb5HtA1.js";import{i as S,n as C}from"./config-D8b1QyEk.js";import{S as w,b as T,o as E,x as D}from"./editor-DAJETlQW.js";import{t as O}from"./createReactComponent-C51FAx3B.js";var k=O(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),A=O(`outline`,`eye-off`,`EyeOff`,[[`path`,{d:`M10.585 10.587a2 2 0 0 0 2.829 2.828`,key:`svg-0`}],[`path`,{d:`M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87`,key:`svg-1`}],[`path`,{d:`M3 3l18 18`,key:`svg-2`}]]),j=O(`outline`,`eye`,`Eye`,[[`path`,{d:`M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6`,key:`svg-1`}]]),M=O(`outline`,`file-code`,`FileCode`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2`,key:`svg-1`}],[`path`,{d:`M10 13l-1 2l1 2`,key:`svg-2`}],[`path`,{d:`M14 13l1 2l-1 2`,key:`svg-3`}]]),N=O(`outline`,`file-type-pdf`,`FileTypePdf`,[[`path`,{d:`M14 3v4a1 1 0 0 0 1 1h4`,key:`svg-0`}],[`path`,{d:`M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4`,key:`svg-1`}],[`path`,{d:`M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6`,key:`svg-2`}],[`path`,{d:`M17 18h2`,key:`svg-3`}],[`path`,{d:`M20 15h-3v6`,key:`svg-4`}],[`path`,{d:`M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1`,key:`svg-5`}]]),P=O(`outline`,`list-numbers`,`ListNumbers`,[[`path`,{d:`M11 6h9`,key:`svg-0`}],[`path`,{d:`M11 12h9`,key:`svg-1`}],[`path`,{d:`M12 18h8`,key:`svg-2`}],[`path`,{d:`M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4`,key:`svg-3`}],[`path`,{d:`M6 10v-6l-2 2`,key:`svg-4`}]]),F=O(`outline`,`photo-down`,`PhotoDown`,[[`path`,{d:`M15 8h.01`,key:`svg-0`}],[`path`,{d:`M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5`,key:`svg-1`}],[`path`,{d:`M3 16l5 -5c.928 -.893 2.072 -.893 3 0l4 4`,key:`svg-2`}],[`path`,{d:`M14 14l1 -1c.653 -.629 1.413 -.815 2.13 -.559`,key:`svg-3`}],[`path`,{d:`M19 16v6`,key:`svg-4`}],[`path`,{d:`M22 19l-3 3l-3 -3`,key:`svg-5`}]]),I=O(`outline`,`stack-2`,`Stack2`,[[`path`,{d:`M12 4l-8 4l8 4l8 -4l-8 -4`,key:`svg-0`}],[`path`,{d:`M4 12l8 4l8 -4`,key:`svg-1`}],[`path`,{d:`M4 16l8 4l8 -4`,key:`svg-2`}]]),L=e(t(),1);function R(e){if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(T);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function z(){return D(E(e=>e.theme),(0,L.useSyncExternalStore)(R,w,()=>!1))}function B(e){let{onEmbedFrame:t,onSaveCanvas:n,publicShare:r}=S(),i=C(),a=E(e=>e.setEmbedSignInOpen),{notify:o}=m(),s=i.state.status===`authenticated`;return(0,L.useMemo)(()=>t||(!n||r?null:()=>{if(s){o(`Save this canvas to embed a ${e}`);return}a(!0)}),[t,n,r,s,o,a,e])}var V=h();function H(e){let[t,n]=L.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=L.useRef(null),i=L.useRef(null),a=L.useRef(null),o=L.useRef(null),s=L.useRef(!0),c=L.useRef(null),u=l(),d=L.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:u}),[t,u]);return(0,V.jsx)(b.Provider,{value:d,children:(0,V.jsx)(y.Provider,{value:void 0,children:(0,V.jsx)(_,{...e})})})}var U=500,W=L.forwardRef(function(e,t){let{render:l,className:m,style:h,..._}=e,{setAnchor:y,actionsRef:b,internalBackdropRef:S,backdropRef:C,positionerRef:w,allowMouseUpTriggerRef:T,initialCursorPointRef:E,rootId:D}=g(!1),{store:O}=x(!1),k=O.useState(`open`),A=O.useState(`disabled`),j=L.useRef(null),M=L.useRef(null),N=p(),P=p(),F=L.useRef(!1);function I(e,t,n){let r=n.type.startsWith(`touch`);E.current={x:e,y:t},y({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),F.current=!1,b.current?.setOpen(!0,i(d,n)),P.start(U,()=>{F.current=!0})}function R(e){A||(T.current=!0,n(e),I(e.clientX,e.clientY,e.nativeEvent),u(c(j.current),`mouseup`,e=>{if(T.current=!1,!F.current)return;P.clear(),F.current=!1;let t=r(e);o(w.current,t)||D&&t&&v(t)===D||b.current?.setOpen(!1,i(a,e))},{once:!0}))}function z(e){if(!A&&(T.current=!1,e.touches.length===1)){e.stopPropagation();let t=e.touches[0];M.current={x:t.clientX,y:t.clientY},N.start(U,()=>{M.current&&I(M.current.x,M.current.y,e.nativeEvent)})}}function B(e){if(N.isStarted()&&M.current&&e.touches.length===1){let t=e.touches[0],n=Math.abs(t.clientX-M.current.x),r=Math.abs(t.clientY-M.current.y);(n>10||r>10)&&N.clear()}}function V(){N.clear(),M.current=null}return L.useEffect(()=>{function e(e){if(A)return;let t=r(e);(o(j.current,t)||o(S.current,t)||o(C.current,t))&&e.preventDefault()}return u(c(j.current),`contextmenu`,e)},[C,A,S]),s(`div`,e,{state:{open:k},ref:[j,t],props:[{onContextMenu:R,onTouchStart:z,onTouchMove:B,onTouchEnd:V,onTouchCancel:V,style:{WebkitTouchCallout:`none`}},_],stateAttributesMapping:f})});export{I as a,N as c,A as d,k as f,z as i,M as l,H as n,F as o,B as r,P as s,W as t,j as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ride-overlay-Hx90v4ZK.js","assets/rolldown-runtime-aKtaBQYM.js","assets/react-lCSYwAWP.js","assets/jsx-runtime-DKdBMi_L.js","assets/editor-BeufBV54.js","assets/reflow-DaYiVkwp.js","assets/slides-D686obFO.js","assets/style-BENGW2ZV.js","assets/renderer-environment-D3n3hbug.js","assets/editable-target-BTLnvKNi.js","assets/createReactComponent-C51FAx3B.js","assets/IconTrash-C8w6ThWx.js","assets/IconArrowLeft-B4Zcy-Fc.js","assets/IconPlayerStopFilled-D4qdct2R.js","assets/IconEraser-CYfXj27R.js","assets/IconFocusCentered-Cn8rbfRI.js","assets/IconPencil-D_pQsAyv.js","assets/IconX-KrRqxr2j.js","assets/IconPlayerPlayFilled-DVAWmYt7.js","assets/storage-CvDRYh5V.js","assets/chrome-C2RCq3SI.js","assets/DialogRoot-DUeVfNhS.js","assets/useScrollLock-CQpr0n6U.js","assets/DialogTitle-D5au2NAn.js","assets/useButton-CLQYGhRJ.js","assets/useBaseUiId-D2RfU0uY.js","assets/DialogDescription-Ddhk2rmF.js","assets/connector-labels-CrEgadsC.js"])))=>i.map(i=>d[i]);
2
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r}from"./editor-BeufBV54.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{i as a,n as o,r as s,t as c}from"./lazy-module-DkWvu4va.js";import{t as l}from"./createReactComponent-C51FAx3B.js";var u=e(t(),1),d={status:`idle`};function f(e,t){switch(t.type){case`activate`:case`retry`:return e.status===`failed`?{status:`idle`}:e;case`load-start`:return e.status===`idle`?{status:`loading`}:e;case`load-resolve`:return e.status===`loading`?{status:`ready`}:e;case`load-reject`:return e.status===`loading`?{status:`failed`}:e;case`load-stale`:return e.status===`loading`||e.status===`failed`?{status:`stale`}:e}}function p(e,t){return t&&e.status===`idle`}function m(e,t,n){return e.status===`ready`?t||n:!1}function h(e,t){return t&&e.status===`loading`}function g(e,t){return t&&e.status===`failed`}function _(e,t){return t&&e.status===`stale`}var v=n(),y=`absolute left-1/2 top-[var(--chrome-top)] -translate-x-1/2 coarse:top-[calc(4.5rem+var(--koboyo-host-inset-top))]`;function b(e){let{children:t}=e;return(0,v.jsx)(`div`,{className:`pointer-events-none flex flex-col items-center gap-2 ${y}`,children:t})}function x(e){let{testId:t,tone:n,children:r,action:i}=e;return(0,v.jsxs)(`div`,{role:n===`error`?`alert`:`status`,"data-testid":t,"data-overlay":!0,className:`z-10 flex min-h-8 max-w-[min(24rem,calc(100vw-9rem))] items-center gap-2 rounded-xl bg-[var(--chrome-popup)] px-3 py-1.5 text-[12px] leading-snug text-[var(--chrome-fg-600)] shadow-md ring-1 ring-[var(--chrome-ring)] ${y}`,children:[(0,v.jsx)(`span`,{className:`min-w-0`,children:r}),i?(0,v.jsx)(`button`,{type:`button`,"data-testid":i.testId,onClick:i.onClick,className:`flex h-6 shrink-0 cursor-pointer items-center rounded-lg px-2 text-[var(--chrome-fg-500)] transition-colors hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`,children:i.label}):null]})}function S(e){o(e.load)}function C(e){let{active:t,retain:n=!1,feature:r,fallback:i,children:o}=e,[l,y]=(0,u.useReducer)(f,d),b=(0,u.useRef)(!1);(0,u.useEffect)(()=>{t&&!b.current&&y({type:`activate`}),b.current=t},[t]);let S=(0,u.useRef)(!0);(0,u.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]);let C=(0,u.useRef)(0),w=p(l,t);if((0,u.useEffect)(()=>{w&&(y({type:`load-start`}),s(r.load).then(()=>{S.current&&y({type:`load-resolve`})},e=>{C.current+=1,S.current&&y({type:`load-reject`}),c(e).then(e=>{e&&S.current&&y({type:`load-stale`})})}))},[w,r]),m(l,t,n)){let e=a(r.load);return e===void 0?null:(0,v.jsx)(v.Fragment,{children:o(r.pick(e))})}return h(l,t)?(0,v.jsx)(v.Fragment,{children:i??null}):_(l,t)?(0,v.jsx)(x,{testId:`lazy-feature-stale`,tone:`error`,action:{label:`Reload`,testId:`lazy-feature-reload`,onClick:()=>window.location.reload()},children:`New version available`}):g(l,t)?(0,v.jsx)(x,{testId:`lazy-feature-error`,tone:`error`,action:{label:`Retry`,testId:`lazy-feature-retry`,onClick:()=>{if(C.current>=2){window.location.reload();return}y({type:`retry`})}},children:`Couldn't load this panel`}):null}var w={load:()=>i(()=>import(`./ride-overlay-Hx90v4ZK.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27])),pick:e=>e.RideOverlay},T={at:null};function E(){let e=r(e=>e.rideMode),t=r(e=>e.presentingIndex!==null);return(0,u.useEffect)(()=>{let e=e=>{T.at={x:e.clientX,y:e.clientY}};return window.addEventListener(`pointermove`,e,{passive:!0}),()=>window.removeEventListener(`pointermove`,e)},[]),(0,v.jsx)(C,{active:e&&!t,feature:w,children:e=>(0,v.jsx)(e,{})})}var D=l(`outline`,`help`,`Help`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M12 17l0 .01`,key:`svg-1`}],[`path`,{d:`M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4`,key:`svg-2`}]]);export{S as a,b as c,C as i,E as n,x as o,T as r,y as s,D as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ride-overlay-C1TrM7Ki.js","assets/rolldown-runtime-aKtaBQYM.js","assets/react-lCSYwAWP.js","assets/jsx-runtime-DKdBMi_L.js","assets/editor-DAJETlQW.js","assets/reflow-C6bvnSVm.js","assets/style-BENGW2ZV.js","assets/shapes-D5w8NTQQ.js","assets/slides-DDNzjFz9.js","assets/web-embed-url-CHu4SU82.js","assets/web-widget-limits-DeMquLIR.js","assets/renderer-environment-D3n3hbug.js","assets/editable-target-BTLnvKNi.js","assets/createReactComponent-C51FAx3B.js","assets/IconTrash-C8w6ThWx.js","assets/IconArrowLeft-B4Zcy-Fc.js","assets/IconPlayerStopFilled-D4qdct2R.js","assets/IconEraser-CYfXj27R.js","assets/IconFocusCentered-Cn8rbfRI.js","assets/IconPencil-D_pQsAyv.js","assets/IconX-KrRqxr2j.js","assets/IconPlayerPlayFilled-DVAWmYt7.js","assets/storage-CvDRYh5V.js","assets/chrome-C2RCq3SI.js","assets/DialogRoot-DUeVfNhS.js","assets/useScrollLock-CQpr0n6U.js","assets/DialogTitle-D5au2NAn.js","assets/useButton-CLQYGhRJ.js","assets/useBaseUiId-D2RfU0uY.js","assets/DialogDescription-Ddhk2rmF.js","assets/connector-labels-DqVssnYz.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r}from"./editor-DAJETlQW.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{i as a,n as o,r as s,t as c}from"./lazy-module-DkWvu4va.js";import{t as l}from"./createReactComponent-C51FAx3B.js";var u=e(t(),1),d={status:`idle`};function f(e,t){switch(t.type){case`activate`:case`retry`:return e.status===`failed`?{status:`idle`}:e;case`load-start`:return e.status===`idle`?{status:`loading`}:e;case`load-resolve`:return e.status===`loading`?{status:`ready`}:e;case`load-reject`:return e.status===`loading`?{status:`failed`}:e;case`load-stale`:return e.status===`loading`||e.status===`failed`?{status:`stale`}:e}}function p(e,t){return t&&e.status===`idle`}function m(e,t,n){return e.status===`ready`?t||n:!1}function h(e,t){return t&&e.status===`loading`}function g(e,t){return t&&e.status===`failed`}function _(e,t){return t&&e.status===`stale`}var v=n(),y=`absolute left-1/2 top-[var(--chrome-top)] -translate-x-1/2 coarse:top-[calc(4.5rem+var(--koboyo-host-inset-top))]`;function b(e){let{children:t}=e;return(0,v.jsx)(`div`,{className:`pointer-events-none flex flex-col items-center gap-2 ${y}`,children:t})}function x(e){let{testId:t,tone:n,children:r,action:i}=e;return(0,v.jsxs)(`div`,{role:n===`error`?`alert`:`status`,"data-testid":t,"data-overlay":!0,className:`z-10 flex min-h-8 max-w-[min(24rem,calc(100vw-9rem))] items-center gap-2 rounded-xl bg-[var(--chrome-popup)] px-3 py-1.5 text-[12px] leading-snug text-[var(--chrome-fg-600)] shadow-md ring-1 ring-[var(--chrome-ring)] ${y}`,children:[(0,v.jsx)(`span`,{className:`min-w-0`,children:r}),i?(0,v.jsx)(`button`,{type:`button`,"data-testid":i.testId,onClick:i.onClick,className:`flex h-6 shrink-0 cursor-pointer items-center rounded-lg px-2 text-[var(--chrome-fg-500)] transition-colors hover:bg-[var(--chrome-hover)] hover:text-[var(--chrome-fg-900)]`,children:i.label}):null]})}function S(e){o(e.load)}function C(e){let{active:t,retain:n=!1,feature:r,fallback:i,children:o}=e,[l,y]=(0,u.useReducer)(f,d),b=(0,u.useRef)(!1);(0,u.useEffect)(()=>{t&&!b.current&&y({type:`activate`}),b.current=t},[t]);let S=(0,u.useRef)(!0);(0,u.useEffect)(()=>(S.current=!0,()=>{S.current=!1}),[]);let C=(0,u.useRef)(0),w=p(l,t);if((0,u.useEffect)(()=>{w&&(y({type:`load-start`}),s(r.load).then(()=>{S.current&&y({type:`load-resolve`})},e=>{C.current+=1,S.current&&y({type:`load-reject`}),c(e).then(e=>{e&&S.current&&y({type:`load-stale`})})}))},[w,r]),m(l,t,n)){let e=a(r.load);return e===void 0?null:(0,v.jsx)(v.Fragment,{children:o(r.pick(e))})}return h(l,t)?(0,v.jsx)(v.Fragment,{children:i??null}):_(l,t)?(0,v.jsx)(x,{testId:`lazy-feature-stale`,tone:`error`,action:{label:`Reload`,testId:`lazy-feature-reload`,onClick:()=>window.location.reload()},children:`New version available`}):g(l,t)?(0,v.jsx)(x,{testId:`lazy-feature-error`,tone:`error`,action:{label:`Retry`,testId:`lazy-feature-retry`,onClick:()=>{if(C.current>=2){window.location.reload();return}y({type:`retry`})}},children:`Couldn't load this panel`}):null}var w={load:()=>i(()=>import(`./ride-overlay-C1TrM7Ki.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])),pick:e=>e.RideOverlay},T={at:null};function E(){let e=r(e=>e.rideMode),t=r(e=>e.presentingIndex!==null);return(0,u.useEffect)(()=>{let e=e=>{T.at={x:e.clientX,y:e.clientY}};return window.addEventListener(`pointermove`,e,{passive:!0}),()=>window.removeEventListener(`pointermove`,e)},[]),(0,v.jsx)(C,{active:e&&!t,feature:w,children:e=>(0,v.jsx)(e,{})})}var D=l(`outline`,`help`,`Help`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,key:`svg-0`}],[`path`,{d:`M12 17l0 .01`,key:`svg-1`}],[`path`,{d:`M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4`,key:`svg-2`}]]);export{S as a,b as c,C as i,E as n,x as o,T as r,y as s,D as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createReactComponent-C51FAx3B.js";var t=e(`outline`,`external-link`,`ExternalLink`,[[`path`,{d:`M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 13l9 -9`,key:`svg-1`}],[`path`,{d:`M15 4h5v5`,key:`svg-2`}]]),n=e(`outline`,`replace`,`Replace`,[[`path`,{d:`M3 4a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-0`}],[`path`,{d:`M15 16a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-1`}],[`path`,{d:`M21 11v-3a2 2 0 0 0 -2 -2h-6l3 3m0 -6l-3 3`,key:`svg-2`}],[`path`,{d:`M3 13v3a2 2 0 0 0 2 2h6l-3 -3m0 6l3 -3`,key:`svg-3`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{T as n,Tn as r,c as i,ht as a,jn as o}from"./useScrollLock-CQpr0n6U.js";import{t as s}from"./jsx-runtime-DKdBMi_L.js";import{i as c,r as l}from"./tooltip-CKCG8vcp.js";import{a as u}from"./useTriggerFocusGuards-Mibi8yYw.js";import{_ as d,b as f,c as p,h as m,l as h,u as g,y as _}from"./menu-4xb5HtA1.js";import{t as v}from"./createReactComponent-C51FAx3B.js";import{t as y}from"./useBaseUiId-D2RfU0uY.js";var b=v(`outline`,`route`,`Route`,[[`path`,{d:`M3 19a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M19 7a2 2 0 1 0 0 -4a2 2 0 0 0 0 4`,key:`svg-1`}],[`path`,{d:`M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5`,key:`svg-2`}]]),x=e(t(),1),S=s();function C(e){let t=_().store,n=x.useMemo(()=>({parentMenu:t}),[t]);return(0,S.jsx)(h.Provider,{value:n,children:(0,S.jsx)(p,{...e})})}var w=x.forwardRef(function(e,t){let{render:s,className:p,style:h,label:v,id:b,nativeButton:S=!1,openOnHover:C=!0,delay:w=100,closeDelay:T=0,disabled:E=!1,...D}=e,O=m({label:v}),k=f(),{store:A}=_(),j=y(b),M=A.useState(`open`),N=A.useState(`floatingRootContext`),P=A.useState(`floatingTreeRoot`),F=A.useState(`triggerPopupId`,j),I=n(j,A),L=x.useCallback(e=>{let t=I(e);return e!==null&&A.select(`open`)&&A.select(`activeTriggerId`)==null&&A.update({activeTriggerId:j,activeTriggerElement:e,closeDelay:T}),t},[I,T,A,j]),R=x.useRef(null),z=x.useCallback(e=>{R.current=e,A.set(`activeTriggerElement`,e)},[A]),B=g();if(!B?.parentMenu)throw Error(o(37));A.useSyncedValue(`closeDelay`,T);let V=B.parentMenu,H=A.useState(`disabled`),U=V.useState(`disabled`),W=E||H||U,G=V.useState(`itemProps`),K=V.useState(`isActive`,O.index),q=x.useMemo(()=>({type:`submenu-trigger`,setActive(){V.select(`highlightItemOnHover`)&&V.set(`activeIndex`,O.index)}}),[V,O.index]),{getItemProps:J,itemRef:Y}=d({closeOnClick:!1,disabled:W,highlighted:K,id:j,store:A,typingRef:V.context.typingRef,nativeButton:S,itemMetadata:q,nodeId:k?.context.nodeId}),X=c(N,{enabled:A.useState(`hoverEnabled`)&&C&&!W,handleClose:l({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:w,delay:{open:w,close:T},shouldOpen:w>0?()=>V.select(`allowMouseEnter`):void 0,triggerElementRef:R,externalTree:P,isClosing:()=>A.select(`transitionStatus`)===`ending`}),Z=u(N,{enabled:!W,event:`mousedown`,toggle:!C,ignoreMouse:C,stickIfOpen:!1}).reference??r,Q=A.useState(`triggerProps`,!0);return delete Q.id,a(`div`,e,{state:{disabled:W,highlighted:K,open:M},stateAttributesMapping:i,props:[Z,X,Q,G,{"aria-controls":F,tabIndex:M||K?0:-1,onBlur(){K&&V.set(`activeIndex`,null)}},D,J],ref:[t,O.ref,Y,L,z]})});export{C as n,b as r,w as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{A as n,An as r,C as i,Cn as a,Dn as o,F as s,Fn as c,M as l,Mn as u,N as d,P as f,R as p,S as m,Tn as h,U as g,Y as _,_ as v,_n as y,_t as b,b as x,d as S,dt as C,en as w,f as T,ft as E,g as D,h as O,ht as k,j as A,jn as j,l as M,mt as N,n as P,nt as F,o as I,p as L,pt as R,r as z,u as B,ut as ee,v as V,x as H,y as U}from"./useScrollLock-CQpr0n6U.js";import{t as te}from"./jsx-runtime-DKdBMi_L.js";import{i as ne,n as re,o as ie,r as ae,t as oe}from"./usePositioner-AtbrPc7w.js";import{Dr as se,ei as W}from"./slides-D686obFO.js";import{n as ce,t as le}from"./useAnchoredPopupScrollLock-i8D5Dm1d.js";var G=te(),K=7;function ue(e){let{kind:t,size:n}=e;return(0,G.jsx)(`svg`,{width:n??22,height:n??22,viewBox:`0 0 24 24`,fill:t===`fork-join`?`currentColor`:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:se(t)})})}function de(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`7`,y:`3`,width:`10`,height:`4.6`,rx:`1.4`}),(0,G.jsx)(`path`,{d:`M12 7.6V21`,strokeDasharray:`2 2.6`})]})}function fe(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,G.jsx)(`path`,{d:`M4 9H20`}),(0,G.jsx)(`path`,{d:`M7 12.6H15.5`}),(0,G.jsx)(`path`,{d:`M7 16H12.5`})]})}function pe(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`9.8`,y:`3`,width:`4.4`,height:`18`,rx:`2.2`}),(0,G.jsx)(`rect`,{x:`9.8`,y:`4.5`,width:`4.4`,height:`7.5`,rx:`2.2`,fill:`currentColor`,stroke:`none`})]})}function me(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`3`,y:`3.5`,width:`18`,height:`4`,rx:`1.2`}),(0,G.jsx)(`path`,{d:`M16.5 5l1 1l1 -1`}),(0,G.jsx)(`path`,{d:`M5.5 10.5H15`}),(0,G.jsx)(`path`,{d:`M5.5 13H12`}),(0,G.jsx)(`rect`,{x:`3`,y:`15.5`,width:`18`,height:`4`,rx:`1.2`}),(0,G.jsx)(`path`,{d:`M16.5 16.7l1 0.8l-1 0.8`})]})}function he(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M4 9l-2 3l2 3`}),(0,G.jsx)(`rect`,{x:`7.5`,y:`10.3`,width:`9`,height:`3.4`,rx:`1.7`,fill:`currentColor`,stroke:`none`}),(0,G.jsx)(`path`,{d:`M20 9l2 3l-2 3`})]})}function ge(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`2`,y:`10`,width:`20`,height:`4`,rx:`2`}),(0,G.jsx)(`rect`,{x:`2`,y:`10`,width:`12.5`,height:`4`,rx:`2`,fill:`currentColor`,stroke:`none`})]})}function _e(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,G.jsx)(`path`,{d:`M6 8.5H18`}),(0,G.jsx)(`path`,{d:`M6 11.5H18`}),(0,G.jsx)(`path`,{d:`M6 14.5H13`}),(0,G.jsx)(`path`,{d:`M18.5 15.5l-3 3`}),(0,G.jsx)(`path`,{d:`M18.5 18l-0.8 0.8`})]})}function ve(e){let{size:t,stroke:n}=e,r={x:17.5,y:6.5};return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M 6 18 L ${r.x} ${r.y}`}),(0,G.jsx)(`path`,{d:W(r,-Math.PI/4,K)})]})}function ye(e){let{bend:t,size:n}=e;return(0,G.jsx)(`svg`,{width:n??22,height:n??22,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:t===`elbow`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{d:`M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7`}),(0,G.jsx)(`path`,{d:W({x:21,y:7},0,K)})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{d:`M6 20c0 -6.075 4.925 -11 11 -11h3`}),(0,G.jsx)(`path`,{d:W({x:20,y:9},0,K)})]})})}var be={left:`M4 4v16m3-8h11M7 12l3-3m-3 3l3 3`,center:`M12 4v16m4-8h5m-3-3l-3 3l3 3M8 12H3m3-3l3 3l-3 3`,right:`M20 4v16m-3-8H6m11 0l-3-3m3 3l-3 3`,top:`M20 4H4m8 3v11m0-11l3 3m-3-3l-3 3`,middle:`M4 12h16m-8-4V3M9 6l3 3l3-3m-3 10v5m-3-3l3-3l3 3`,bottom:`M20 20H4m8-3V6m0 11l3-3m-3 3l-3-3`};function xe(e){let{type:t,size:n,stroke:r}=e;return(0,G.jsx)(`svg`,{width:n??16,height:n??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:r??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:be[t]})})}function Se(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M5 3a2 2 0 0 0 -2 2`}),(0,G.jsx)(`path`,{d:`M19 3a2 2 0 0 1 2 2`}),(0,G.jsx)(`path`,{d:`M21 19a2 2 0 0 1 -2 2`}),(0,G.jsx)(`path`,{d:`M5 21a2 2 0 0 1 -2 -2`}),(0,G.jsx)(`path`,{d:`M9 3h1`}),(0,G.jsx)(`path`,{d:`M9 21h1`}),(0,G.jsx)(`path`,{d:`M14 3h1`}),(0,G.jsx)(`path`,{d:`M14 21h1`}),(0,G.jsx)(`path`,{d:`M3 9v1`}),(0,G.jsx)(`path`,{d:`M21 9v1`}),(0,G.jsx)(`path`,{d:`M3 14v1`}),(0,G.jsx)(`path`,{d:`M21 14v1`})]})}function Ce(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`m9 11-6 6v3h9l3-3`}),(0,G.jsx)(`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})]})}function we(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??22,height:t??22,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M12 3 L20.6 9.2 L17.3 19.3 L6.7 19.3 L3.4 9.2 Z`,opacity:.35}),(0,G.jsx)(`path`,{d:`M12 12 L12 3 M12 12 L20.6 9.2 M12 12 L17.3 19.3 M12 12 L6.7 19.3 M12 12 L3.4 9.2`,opacity:.35}),(0,G.jsx)(`path`,{d:`M12 4 L16.8 10.5 L16.1 17.7 L9.7 15.2 L6.3 10.2 Z`})]})}function Te(){return(0,G.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 8 8`,className:`text-gray-400`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:`M1.5 2.75 L4 5.25 L6.5 2.75`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ee(){return(0,G.jsx)(`svg`,{width:`6`,height:`6`,viewBox:`0 0 6 6`,"aria-hidden":!0,className:`absolute bottom-1 right-1 opacity-30`,children:(0,G.jsx)(`path`,{d:`M6 0 V6 H0 Z`,fill:`currentColor`})})}function De(){return(0,G.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,G.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,G.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})}var q=e(t(),1),J=q.createContext(void 0);function Y(e){let t=q.useContext(J);if(t===void 0&&!e)throw Error(j(47));return t}var Oe=e(c(),1);function ke(){return{...M(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Ae={...S,disabled:r(e=>e.disabled),instantType:r(e=>e.instantType),openMethod:r(e=>e.openMethod),openChangeReason:r(e=>e.openChangeReason),modal:r(e=>e.modal),focusManagerModal:r(e=>e.focusManagerModal),stickIfOpen:r(e=>e.stickIfOpen),titleElementId:r(e=>e.titleElementId),descriptionElementId:r(e=>e.descriptionElementId),openOnHover:r(e=>e.openOnHover),closeDelay:r(e=>e.closeDelay),hasViewport:r(e=>e.hasViewport)},je=class e extends a{constructor(e,t,n=!1){let r={...ke(),...e},i=new T;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=B(i,t,n),super(r,{popupRef:q.createRef(),backdropRef:q.createRef(),internalBackdropRef:q.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:q.createRef(),beforeContentFocusGuardRef:q.createRef(),stickIfOpenTimeout:new w,triggerElements:i},Ae)}setOpen=(e,t)=>{let n=t.reason===F,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=O(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};v(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Oe.flushSync(s)):s(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:a}=i(t,(t,r)=>new e(n,t,r));return q.useEffect(()=>a?.disposeEffect(),[a]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function X({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:c,triggerId:l,defaultTriggerId:u=null}=e,d=je.useStore(c?.store,{modal:o,open:r,openProp:n,activeTriggerId:u,triggerIdProp:l});U(d,n,r,u),d.useControlledProp(`openProp`,n),d.useControlledProp(`triggerIdProp`,l);let f=d.useState(`open`),p=d.useState(`mounted`),h=d.useState(`payload`),v=s()!=null;d.useContextCallback(`onOpenChange`,i),d.useContextCallback(`onOpenChangeComplete`,a),m(d,f),V(d);let{forceUnmount:y}=x(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o,nested:v}),q.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]);let b=q.useCallback(()=>{d.setOpen(!1,g(_))},[d]);q.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:b}),[y,b]);let S=f||p,C=q.useMemo(()=>({store:d}),[d]);return(0,G.jsxs)(J.Provider,{value:C,children:[S&&(0,G.jsx)(Ne,{store:d,modal:o}),typeof t==`function`?t({payload:h}):t]})}function Me(e){return Y(!0)?(0,G.jsx)(X,{props:e}):(0,G.jsx)(d,{children:(0,G.jsx)(X,{props:e})})}function Ne({store:e,modal:t}){let r=n(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return H(e,{activeTriggerProps:r.reference??h,inactiveTriggerProps:r.trigger??h,popupProps:q.useMemo(()=>b(L,r.floating),[r.floating])}),null}var Z=q.createContext(void 0);function Pe(){let e=q.useContext(Z);if(e===void 0)throw Error(j(45));return e}var Fe=q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Y();return i.useState(`mounted`)||n?(0,G.jsx)(Z.Provider,{value:n,children:(0,G.jsx)(p,{ref:t,...r})}):null}),Q=q.createContext(void 0);function Ie(){let e=q.useContext(Q);if(!e)throw Error(j(46));return e}var Le=q.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:c=`center`,sideOffset:d=0,alignOffset:p=0,collisionBoundary:m=`clipping-ancestors`,collisionPadding:h=5,arrowPadding:g=5,sticky:_=!1,disableAnchorTracking:v=!1,collisionAvoidance:y=ee,...b}=e,{store:x}=Y(),S=Pe(),C=f(),w=x.useState(`floatingRootContext`),T=x.useState(`mounted`),D=x.useState(`open`),O=x.useState(`openChangeReason`),k=x.useState(`activeTriggerElement`),A=x.useState(`modal`),j=x.useState(`openMethod`),M=x.useState(`positionerElement`),F=x.useState(`instantType`),I=x.useState(`transitionStatus`),L=x.useState(`hasViewport`),R=q.useRef(null),z=E(M,!1,!1),B=ae({anchor:a,floatingRootContext:w,positionMethod:o,mounted:T,side:s,sideOffset:d,align:c,alignOffset:p,arrowPadding:g,collisionBoundary:m,collisionPadding:h,sticky:_,disableAnchorTracking:v,keepMounted:S,nodeId:C,collisionAvoidance:y,adaptiveOrigin:L?ne:void 0}),V=w.useState(`domReferenceElement`);u(()=>{let e=V,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){x.set(`instantType`,void 0);let e=new AbortController;return z(()=>{x.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[V,z,x]),le(D&&A===!0&&O!==`trigger-hover`,j===`touch`,M,k);let H=q.useCallback(e=>{x.set(`positionerElement`,e)},[x]),U=oe(e,{open:D,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:F},{styles:B.positionerStyles,transitionStatus:I,props:b,refs:[t,H],hidden:!T,inert:!D});return(0,G.jsxs)(Q.Provider,{value:B,children:[T&&A===!0&&O!==`trigger-hover`&&(0,G.jsx)(P,{ref:x.context.internalBackdropRef,inert:N(!D),cutout:k}),(0,G.jsx)(l,{id:C,children:U})]})}),$=q.createContext(void 0);function Re(){let[e,t]=q.useState(0),n=o(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:q.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function ze(e){let{value:t,children:n}=e;return(0,G.jsx)($.Provider,{value:t,children:n})}function Be(){let e=q.useContext($);u(()=>e?.register(),[e])}var Ve={...I,...R},He=q.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,{store:c}=Y(),l=Ie(),u=ce(!0)!=null,{context:d,hasClosePart:f}=Re(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),w=c.useState(`openChangeReason`),T=c.useState(`activeTriggerElement`),E=c.useState(`floatingRootContext`),O=E.useState(`floatingId`),j=c.useState(`disabled`),M=c.useState(`openOnHover`),N=c.useState(`closeDelay`),P=s.id??O;C({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),ie(E,{enabled:M&&!j,closeDelay:N});let F=a===void 0?D(c.context.popupRef):a,I=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,I);let R=q.useCallback(e=>{c.set(`popupElement`,e)},[c]),B=k(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,R],props:[_,{id:P,role:`dialog`,...L,"aria-labelledby":v,"aria-describedby":b,onKeyDown(e){u&&z.has(e.key)&&e.stopPropagation()}},re(g),s],stateAttributesMapping:Ve});return(0,G.jsx)(A,{context:E,openInteractionType:m,modal:I,disabled:!S||w===`trigger-hover`,initialFocus:F,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:y(T)?T:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(ze,{value:d,children:B})})});export{_e as C,xe as S,ye as _,Me as a,we as b,ve as c,Ee as d,fe as f,de as g,ue as h,Fe as i,Te as l,Ce as m,Be as n,Y as o,Se as p,Le as r,me as s,He as t,De as u,he as v,pe as x,ge as y};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{A as n,An as r,C as i,Cn as a,Dn as o,F as s,Fn as c,M as l,Mn as u,N as d,P as f,R as p,S as m,Tn as h,U as g,Y as _,_ as v,_n as y,_t as b,b as x,d as S,dt as C,en as w,f as T,ft as E,g as D,h as O,ht as k,j as A,jn as j,l as M,mt as N,n as P,nt as F,o as I,p as L,pt as R,r as z,u as B,ut as ee,v as V,x as H,y as U}from"./useScrollLock-CQpr0n6U.js";import{t as te}from"./jsx-runtime-DKdBMi_L.js";import{i as ne,n as re,o as ie,r as ae,t as oe}from"./usePositioner-AtbrPc7w.js";import{$t as se,vn as W}from"./shapes-D5w8NTQQ.js";import{n as ce,t as le}from"./useAnchoredPopupScrollLock-i8D5Dm1d.js";var G=te(),K=7;function ue(e){let{kind:t,size:n}=e;return(0,G.jsx)(`svg`,{width:n??22,height:n??22,viewBox:`0 0 24 24`,fill:t===`fork-join`?`currentColor`:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:se(t)})})}function de(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`7`,y:`3`,width:`10`,height:`4.6`,rx:`1.4`}),(0,G.jsx)(`path`,{d:`M12 7.6V21`,strokeDasharray:`2 2.6`})]})}function fe(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,G.jsx)(`path`,{d:`M4 9H20`}),(0,G.jsx)(`path`,{d:`M7 12.6H15.5`}),(0,G.jsx)(`path`,{d:`M7 16H12.5`})]})}function pe(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`9.8`,y:`3`,width:`4.4`,height:`18`,rx:`2.2`}),(0,G.jsx)(`rect`,{x:`9.8`,y:`4.5`,width:`4.4`,height:`7.5`,rx:`2.2`,fill:`currentColor`,stroke:`none`})]})}function me(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`3`,y:`3.5`,width:`18`,height:`4`,rx:`1.2`}),(0,G.jsx)(`path`,{d:`M16.5 5l1 1l1 -1`}),(0,G.jsx)(`path`,{d:`M5.5 10.5H15`}),(0,G.jsx)(`path`,{d:`M5.5 13H12`}),(0,G.jsx)(`rect`,{x:`3`,y:`15.5`,width:`18`,height:`4`,rx:`1.2`}),(0,G.jsx)(`path`,{d:`M16.5 16.7l1 0.8l-1 0.8`})]})}function he(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M4 9l-2 3l2 3`}),(0,G.jsx)(`rect`,{x:`7.5`,y:`10.3`,width:`9`,height:`3.4`,rx:`1.7`,fill:`currentColor`,stroke:`none`}),(0,G.jsx)(`path`,{d:`M20 9l2 3l-2 3`})]})}function ge(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`2`,y:`10`,width:`20`,height:`4`,rx:`2`}),(0,G.jsx)(`rect`,{x:`2`,y:`10`,width:`12.5`,height:`4`,rx:`2`,fill:`currentColor`,stroke:`none`})]})}function _e(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,G.jsx)(`path`,{d:`M6 8.5H18`}),(0,G.jsx)(`path`,{d:`M6 11.5H18`}),(0,G.jsx)(`path`,{d:`M6 14.5H13`}),(0,G.jsx)(`path`,{d:`M18.5 15.5l-3 3`}),(0,G.jsx)(`path`,{d:`M18.5 18l-0.8 0.8`})]})}function ve(e){let{size:t,stroke:n}=e,r={x:17.5,y:6.5};return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M 6 18 L ${r.x} ${r.y}`}),(0,G.jsx)(`path`,{d:W(r,-Math.PI/4,K)})]})}function ye(e){let{bend:t,size:n}=e;return(0,G.jsx)(`svg`,{width:n??22,height:n??22,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:t===`elbow`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{d:`M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7`}),(0,G.jsx)(`path`,{d:W({x:21,y:7},0,K)})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`path`,{d:`M6 20c0 -6.075 4.925 -11 11 -11h3`}),(0,G.jsx)(`path`,{d:W({x:20,y:9},0,K)})]})})}var be={left:`M4 4v16m3-8h11M7 12l3-3m-3 3l3 3`,center:`M12 4v16m4-8h5m-3-3l-3 3l3 3M8 12H3m3-3l3 3l-3 3`,right:`M20 4v16m-3-8H6m11 0l-3-3m3 3l-3 3`,top:`M20 4H4m8 3v11m0-11l3 3m-3-3l-3 3`,middle:`M4 12h16m-8-4V3M9 6l3 3l3-3m-3 10v5m-3-3l3-3l3 3`,bottom:`M20 20H4m8-3V6m0 11l3-3m-3 3l-3-3`};function xe(e){let{type:t,size:n,stroke:r}=e;return(0,G.jsx)(`svg`,{width:n??16,height:n??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:r??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:be[t]})})}function Se(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M5 3a2 2 0 0 0 -2 2`}),(0,G.jsx)(`path`,{d:`M19 3a2 2 0 0 1 2 2`}),(0,G.jsx)(`path`,{d:`M21 19a2 2 0 0 1 -2 2`}),(0,G.jsx)(`path`,{d:`M5 21a2 2 0 0 1 -2 -2`}),(0,G.jsx)(`path`,{d:`M9 3h1`}),(0,G.jsx)(`path`,{d:`M9 21h1`}),(0,G.jsx)(`path`,{d:`M14 3h1`}),(0,G.jsx)(`path`,{d:`M14 21h1`}),(0,G.jsx)(`path`,{d:`M3 9v1`}),(0,G.jsx)(`path`,{d:`M21 9v1`}),(0,G.jsx)(`path`,{d:`M3 14v1`}),(0,G.jsx)(`path`,{d:`M21 14v1`})]})}function Ce(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??24,height:t??24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`m9 11-6 6v3h9l3-3`}),(0,G.jsx)(`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})]})}function we(e){let{size:t,stroke:n}=e;return(0,G.jsxs)(`svg`,{width:t??22,height:t??22,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:n??1.75,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,G.jsx)(`path`,{d:`M12 3 L20.6 9.2 L17.3 19.3 L6.7 19.3 L3.4 9.2 Z`,opacity:.35}),(0,G.jsx)(`path`,{d:`M12 12 L12 3 M12 12 L20.6 9.2 M12 12 L17.3 19.3 M12 12 L6.7 19.3 M12 12 L3.4 9.2`,opacity:.35}),(0,G.jsx)(`path`,{d:`M12 4 L16.8 10.5 L16.1 17.7 L9.7 15.2 L6.3 10.2 Z`})]})}function Te(){return(0,G.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 8 8`,className:`text-gray-400`,"aria-hidden":!0,children:(0,G.jsx)(`path`,{d:`M1.5 2.75 L4 5.25 L6.5 2.75`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ee(){return(0,G.jsx)(`svg`,{width:`6`,height:`6`,viewBox:`0 0 6 6`,"aria-hidden":!0,className:`absolute bottom-1 right-1 opacity-30`,children:(0,G.jsx)(`path`,{d:`M6 0 V6 H0 Z`,fill:`currentColor`})})}function De(){return(0,G.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,G.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,G.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})}var q=e(t(),1),J=q.createContext(void 0);function Y(e){let t=q.useContext(J);if(t===void 0&&!e)throw Error(j(47));return t}var Oe=e(c(),1);function ke(){return{...M(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var Ae={...S,disabled:r(e=>e.disabled),instantType:r(e=>e.instantType),openMethod:r(e=>e.openMethod),openChangeReason:r(e=>e.openChangeReason),modal:r(e=>e.modal),focusManagerModal:r(e=>e.focusManagerModal),stickIfOpen:r(e=>e.stickIfOpen),titleElementId:r(e=>e.titleElementId),descriptionElementId:r(e=>e.descriptionElementId),openOnHover:r(e=>e.openOnHover),closeDelay:r(e=>e.closeDelay),hasViewport:r(e=>e.hasViewport)},je=class e extends a{constructor(e,t,n=!1){let r={...ke(),...e},i=new T;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=B(i,t,n),super(r,{popupRef:q.createRef(),backdropRef:q.createRef(),internalBackdropRef:q.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:q.createRef(),beforeContentFocusGuardRef:q.createRef(),stickIfOpenTimeout:new w,triggerElements:i},Ae)}setOpen=(e,t)=>{let n=t.reason===F,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=O(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n={open:e,openChangeReason:t.reason};v(n,e,t.trigger,a()),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Oe.flushSync(s)):s(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let{store:r,internalStore:a}=i(t,(t,r)=>new e(n,t,r));return q.useEffect(()=>a?.disposeEffect(),[a]),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function X({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:c,triggerId:l,defaultTriggerId:u=null}=e,d=je.useStore(c?.store,{modal:o,open:r,openProp:n,activeTriggerId:u,triggerIdProp:l});U(d,n,r,u),d.useControlledProp(`openProp`,n),d.useControlledProp(`triggerIdProp`,l);let f=d.useState(`open`),p=d.useState(`mounted`),h=d.useState(`payload`),v=s()!=null;d.useContextCallback(`onOpenChange`,i),d.useContextCallback(`onOpenChangeComplete`,a),m(d,f),V(d);let{forceUnmount:y}=x(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:o,nested:v}),q.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]);let b=q.useCallback(()=>{d.setOpen(!1,g(_))},[d]);q.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:b}),[y,b]);let S=f||p,C=q.useMemo(()=>({store:d}),[d]);return(0,G.jsxs)(J.Provider,{value:C,children:[S&&(0,G.jsx)(Ne,{store:d,modal:o}),typeof t==`function`?t({payload:h}):t]})}function Me(e){return Y(!0)?(0,G.jsx)(X,{props:e}):(0,G.jsx)(d,{children:(0,G.jsx)(X,{props:e})})}function Ne({store:e,modal:t}){let r=n(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}});return H(e,{activeTriggerProps:r.reference??h,inactiveTriggerProps:r.trigger??h,popupProps:q.useMemo(()=>b(L,r.floating),[r.floating])}),null}var Z=q.createContext(void 0);function Pe(){let e=q.useContext(Z);if(e===void 0)throw Error(j(45));return e}var Fe=q.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Y();return i.useState(`mounted`)||n?(0,G.jsx)(Z.Provider,{value:n,children:(0,G.jsx)(p,{ref:t,...r})}):null}),Q=q.createContext(void 0);function Ie(){let e=q.useContext(Q);if(!e)throw Error(j(46));return e}var Le=q.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o=`absolute`,side:s=`bottom`,align:c=`center`,sideOffset:d=0,alignOffset:p=0,collisionBoundary:m=`clipping-ancestors`,collisionPadding:h=5,arrowPadding:g=5,sticky:_=!1,disableAnchorTracking:v=!1,collisionAvoidance:y=ee,...b}=e,{store:x}=Y(),S=Pe(),C=f(),w=x.useState(`floatingRootContext`),T=x.useState(`mounted`),D=x.useState(`open`),O=x.useState(`openChangeReason`),k=x.useState(`activeTriggerElement`),A=x.useState(`modal`),j=x.useState(`openMethod`),M=x.useState(`positionerElement`),F=x.useState(`instantType`),I=x.useState(`transitionStatus`),L=x.useState(`hasViewport`),R=q.useRef(null),z=E(M,!1,!1),B=ae({anchor:a,floatingRootContext:w,positionMethod:o,mounted:T,side:s,sideOffset:d,align:c,alignOffset:p,arrowPadding:g,collisionBoundary:m,collisionPadding:h,sticky:_,disableAnchorTracking:v,keepMounted:S,nodeId:C,collisionAvoidance:y,adaptiveOrigin:L?ne:void 0}),V=w.useState(`domReferenceElement`);u(()=>{let e=V,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){x.set(`instantType`,void 0);let e=new AbortController;return z(()=>{x.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[V,z,x]),le(D&&A===!0&&O!==`trigger-hover`,j===`touch`,M,k);let H=q.useCallback(e=>{x.set(`positionerElement`,e)},[x]),U=oe(e,{open:D,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:F},{styles:B.positionerStyles,transitionStatus:I,props:b,refs:[t,H],hidden:!T,inert:!D});return(0,G.jsxs)(Q.Provider,{value:B,children:[T&&A===!0&&O!==`trigger-hover`&&(0,G.jsx)(P,{ref:x.context.internalBackdropRef,inert:N(!D),cutout:k}),(0,G.jsx)(l,{id:C,children:U})]})}),$=q.createContext(void 0);function Re(){let[e,t]=q.useState(0),n=o(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:q.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function ze(e){let{value:t,children:n}=e;return(0,G.jsx)($.Provider,{value:t,children:n})}function Be(){let e=q.useContext($);u(()=>e?.register(),[e])}var Ve={...I,...R},He=q.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,{store:c}=Y(),l=Ie(),u=ce(!0)!=null,{context:d,hasClosePart:f}=Re(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),w=c.useState(`openChangeReason`),T=c.useState(`activeTriggerElement`),E=c.useState(`floatingRootContext`),O=E.useState(`floatingId`),j=c.useState(`disabled`),M=c.useState(`openOnHover`),N=c.useState(`closeDelay`),P=s.id??O;C({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),ie(E,{enabled:M&&!j,closeDelay:N});let F=a===void 0?D(c.context.popupRef):a,I=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,I);let R=q.useCallback(e=>{c.set(`popupElement`,e)},[c]),B=k(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,R],props:[_,{id:P,role:`dialog`,...L,"aria-labelledby":v,"aria-describedby":b,onKeyDown(e){u&&z.has(e.key)&&e.stopPropagation()}},re(g),s],stateAttributesMapping:Ve});return(0,G.jsx)(A,{context:E,openInteractionType:m,modal:I,disabled:!S||w===`trigger-hover`,initialFocus:F,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:y(T)?T:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(ze,{value:d,children:B})})});export{_e as C,xe as S,ye as _,Me as a,we as b,ve as c,Ee as d,fe as f,de as g,ue as h,Fe as i,Te as l,Ce as m,Be as n,Y as o,Se as p,Le as r,me as s,He as t,De as u,he as v,pe as x,ge as y};
@@ -0,0 +1 @@
1
+ import{i as e,o as t}from"./shapes-D5w8NTQQ.js";import{n,r}from"./icon-sources-CZI1h18s.js";import{t as i}from"./icons-DzW1j-r3.js";var a=new Map,o=new Map;function s(e,t){return`${e}/${t}`}function c(e,t){return a.get(s(e,t))}function l(e,t){let n=s(e,t);if(a.has(n))return Promise.resolve(a.get(n)??null);let r=o.get(n);if(r)return r;let c=fetch(i().assetIconUrl(e,t)).then(e=>e.text()).then(e=>{let t=new DOMParser().parseFromString(e,`image/svg+xml`).querySelector(`svg`),r=t?{viewBox:t.getAttribute(`viewBox`)??`0 0 24 24`,inner:t.innerHTML}:null;return a.set(n,r),r}).catch(()=>null).finally(()=>{o.delete(n)});return o.set(n,c),c}function u(e,t){l(e,t)}function d(e){let t=e.trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return null;let[,,n,r]=t;return n>0&&r>0?{width:n,height:r}:null}function f(e,t){let n=a.get(`${e}/${t}`);if(!n)return 1;let r=d(n.viewBox);return r?r.width/r.height:1}function p(n,r){return t(e(n),f(n,r))}function m(e,t,i){if(!(r(e)&&n(e))||c(e,t)!==void 0){i({source:e,name:t});return}l(e,t).then(()=>i({source:e,name:t}))}export{l as a,p as i,f as n,d as o,c as r,u as s,m as t};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{a as r,o as i}from"./editor-DAJETlQW.js";import{C as a,P as o}from"./shapes-D5w8NTQQ.js";import{i as s}from"./slides-DDNzjFz9.js";import{t as c}from"./IconCornerDownRight-DDiBMO4O.js";import{_ as l,f as u,h as d,m as f,n as p,o as m,r as h,v as g}from"./plan-D4Jyzo5X.js";import{n as _,r as v}from"./edit-B4DMFSZr.js";var y=e(t(),1),b=n(),x=21,S=3;function C(e){let{zoom:t}=e,n=i(e=>e.animateSlideId),C=i(e=>e.shapes),w=i(e=>e.hoveredId),{store:T,history:E,measurement:D}=r(),O=(0,y.useMemo)(()=>{if(n)return s(C).find(e=>e.id===n)},[n,C]),k=(0,y.useMemo)(()=>{if(!O)return[];let e=l(C,O),t=u(C,O),n=h(t),r=t.flatMap((t,r)=>p([t],e).map(e=>({unit:{shapes:e.items.map(e=>e.shape),groupId:e.groupId},rowId:m(e),step:n[r],follows:e.withPrevious}))),i=f(C,O,e).map(e=>({unit:e,rowId:null,step:null,follows:!1})),a=[...r,...i],o=new Map;return a.map(e=>{let t=e.unit.groupId??e.unit.shapes[0].id,n=o.get(t)??0;return o.set(t,n+1),{...e,lane:n}})},[C,O]);if(!O||k.length===0)return null;function A(e,t){let r=T.getState().shapes,i=s(r).find(e=>e.id===n);if(!i)return;let a=l(r,i),o=u(r,i),c=t?v(p(o,a),t):_(o,[e],d(e.shapes[0]));c.length!==0&&(E.beginTransaction(),T.getState().replaceMany(c),E.endTransaction())}function j(e){return{onPointerEnter:()=>T.getState().setHoveredId(e),onPointerLeave:()=>T.getState().setHoveredId(null)}}return(0,b.jsx)(`div`,{"data-testid":`build-pips`,className:`pointer-events-none absolute left-0 top-0`,children:k.map(({unit:e,rowId:n,step:r,follows:i,lane:s})=>{let l=a(e.shapes,D)??o(e.shapes[0],D),u=r!==null,d=e.shapes.some(e=>e.id===w);return(0,b.jsx)(`div`,{className:`absolute`,style:{left:l.x-(S+s*x)/t,top:l.y-S/t},children:(0,b.jsx)(`button`,{type:`button`,"data-testid":u?`build-pip`:`build-pip-add`,"data-follows":u&&i?`true`:void 0,title:u?i?`Plays with click ${r}. Press to remove.`:`Click ${r}. Press to remove.`:`Click to animate this`,style:{transform:`scale(${1/t})`,transformOrigin:`100% 100%`},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),A(e,n)},...j(e.shapes[0].id),className:`pointer-events-auto absolute bottom-0 right-0 flex items-center justify-center rounded-md text-[11px] leading-none tabular-nums ring-1 transition-[opacity,background-color,color] ${u?`h-[18px] min-w-[18px] bg-[var(--chrome-accent)] px-1 text-white ring-[var(--chrome-accent)]`:`h-[15px] w-[15px] bg-[var(--chrome-popup)] text-[var(--chrome-fg-500)] ring-[var(--chrome-ring)] hover:text-[var(--chrome-fg-900)] ${d?`opacity-100`:`opacity-45 hover:opacity-100`}`}`,children:u?i?(0,b.jsx)(c,{size:11,stroke:2.25}):r:`+`})},n??g(e))})})}export{C as BuildPips};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r}from"./editor-DAJETlQW.js";import{G as i,W as a}from"./style-BENGW2ZV.js";import{j as o}from"./shapes-D5w8NTQQ.js";import{n as s,r as c}from"./dom-PAoZruqo.js";import{t as l}from"./createReactComponent-C51FAx3B.js";import{n as ee}from"./shape-meta-YgfIm0bQ.js";var u=l(`outline`,`notes`,`Notes`,[[`path`,{d:`M5 5a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -14`,key:`svg-0`}],[`path`,{d:`M9 7l6 0`,key:`svg-1`}],[`path`,{d:`M9 11l6 0`,key:`svg-2`}],[`path`,{d:`M9 15l4 0`,key:`svg-3`}]]),d=e(t(),1),f=`cubic-bezier(0.22, 0.61, 0.36, 1)`;function p(e){return{duration:e.duration,delay:e.delay,easing:f,fill:`backwards`}}var te=.75;function ne(e,t){let n,r;try{n=e.getPointAtLength(0),r=e.getPointAtLength(e.getTotalLength())}catch{return!0}return t===`right`?r.x>=n.x:t===`left`?r.x<=n.x:t===`down`?r.y>=n.y:r.y<=n.y}function m(e,t,n){let r=e.matches(`path`)?[e]:Array.from(e.querySelectorAll(`path`)),i=[],a=[];for(let e of r){let t=h(e);if(t===null){a.push(e);continue}i.push({path:e,length:t})}if(i.length===0)return n(e,t);let o=t.direction===void 0||ne(i[0].path,t.direction),s=Math.round(t.duration*te),c=i.map(({path:e,length:n})=>({element:e,keyframes:[{strokeDasharray:`${n}`,strokeDashoffset:`${o?n:-n}`},{strokeDasharray:`${n}`,strokeDashoffset:`0`}],timing:{...p(t),duration:s,easing:`linear`}})),l=o?t.delay+s:t.delay;for(let e of a)c.push({element:e,keyframes:[{opacity:0},{opacity:1}],timing:{...p(t),delay:l,duration:Math.max(80,t.duration-s)}});return c}function h(e){let t=getComputedStyle(e);if(t.stroke===`none`||t.stroke===``||parseFloat(t.strokeWidth)===0)return null;let n=0;try{n=e.getTotalLength()}catch{return null}return n>0?n:null}function g(e,t){let n=y(e);if(n.length===0)return[];let r=n[0],i=[{offset:0,clipPath:b(r.left,r.top,r.bottom),easing:_}];return n.forEach((e,t)=>{let r=t===n.length-1;i.push({offset:(t+1)/n.length,clipPath:b(e.caret,e.top,r?100:e.bottom),easing:_})}),[{element:e,keyframes:i,timing:{...p(t),easing:`linear`}}]}var _=`steps(1, end)`,v=240;function y(e){let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)return[];let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=document.createRange(),i=[],a=n.nextNode();for(;a;){let e=a.nodeValue??``;for(let n=0;n<e.length;n+=1){r.setStart(a,n),r.setEnd(a,n+1);let e=r.getBoundingClientRect();e.width<=0||e.height<=0||i.push({caret:(e.right-t.left)/t.width*100,left:(e.left-t.left)/t.width*100,top:(e.top-t.top)/t.height*100,bottom:(e.bottom-t.top)/t.height*100})}a=n.nextNode()}if(i.length<=v)return i;let o=Math.ceil(i.length/v),s=i.filter((e,t)=>t%o===0),c=i[i.length-1];return s[s.length-1]!==c&&s.push(c),s}function b(e,t,n){return`polygon(0% 0%, 100% 0%, 100% ${t}%, ${e}% ${t}%, ${e}% ${n}%, 0% ${n}%)`}function x(e,t,n){return[{element:e,keyframes:t,timing:p(n)}]}var re=.035,S=`up`,C=`right`;function w(e,t){return e===`down`?`0 ${-t}px`:e===`left`?`${t}px 0`:e===`right`?`${-t}px 0`:`0 ${t}px`}function T(e){return e===`left`?`inset(0 0 0 100%)`:e===`up`?`inset(100% 0 0 0)`:e===`down`?`inset(0 0 100% 0)`:`inset(0 100% 0 0)`}function E(e,t){let n=e===`left`||e===`right`,r=n?t.unit.width:t.unit.height,a=n?t.bounds.width:t.bounds.height;if(r<=0||a<=0)return{at:0,through:1};let o=n?t.unit.x:t.unit.y,s=n?t.bounds.x:t.bounds.y,c=i((e===`right`||e===`down`?s-o:o+r-(s+a))/r);return{at:c,through:Math.min(i(a/r),1-c)}}var D=.94,O=.02,k=.7;function A(e){let t=Math.max(e.unit.width,e.unit.height);return t<=0?D:a(1-e.slide.height*O/t,k,D)}var j=.8,M=1.06,N=.62,P=`cubic-bezier(0.16, 0.84, 0.44, 1)`,F=`cubic-bezier(0.36, 0, 0.66, 1)`,I=.012,L=1.08,R=.012,z=[0,-1,.85,-.6,.3,0],B=.02,V=`rgba(99, 102, 241, 0.65)`,H=`http://www.w3.org/2000/svg`;function U(e,t){return e.namespaceURI===H?{transformBox:`view-box`,transformOrigin:`${t.unit.x+t.unit.width/2}px ${t.unit.y+t.unit.height/2}px`}:{transformOrigin:`center`}}var W=40,G=400,K=4e3;function q(e){let t=0;try{t=ee(e).trim().length}catch{t=0}return a(t*W,G,K)}function J(e,t){let n=t.direction??C,r=E(n,t);return[{element:e,keyframes:[{clipPath:T(n)},{clipPath:`inset(0 0 0 0)`}],timing:{...p(t),delay:t.delay+r.at*t.duration,duration:Math.max(1,r.through*t.duration)}}]}var Y={fade:{label:`Fade`,defaultDuration:260,plan:(e,t)=>x(e,[{opacity:0},{opacity:1}],t)},rise:{label:`Rise`,defaultDuration:320,defaultDirection:S,plan:(e,t)=>{let n=Math.max(8,t.slide.height*re);return x(e,[{opacity:0,translate:w(t.direction??S,n)},{opacity:1,translate:`0 0`}],t)}},scale:{label:`Scale`,defaultDuration:280,plan:(e,t)=>{let n=U(e,t);return x(e,[{...n,opacity:0,scale:`${A(t)}`},{...n,opacity:1,scale:`1`}],t)}},pop:{label:`Pop`,defaultDuration:380,plan:(e,t)=>{let n=U(e,t);return[{element:e,keyframes:[{...n,offset:0,opacity:0,scale:`${j}`,easing:P},{...n,offset:N,opacity:1,scale:`${M}`,easing:F},{...n,offset:1,opacity:1,scale:`1`}],timing:{...p(t),easing:`linear`}}]}},blur:{label:`Blur`,defaultDuration:420,plan:(e,t)=>x(e,[{opacity:0,filter:`blur(${Math.max(2,t.slide.height*I)}px)`},{opacity:1,filter:`blur(0px)`}],t)},pulse:{label:`Pulse`,defaultDuration:480,plan:(e,t)=>{let n=U(e,t);return x(e,[{...n,offset:0,scale:`1`},{...n,offset:.5,scale:`${L}`},{...n,offset:1,scale:`1`}],t)}},shake:{label:`Shake`,defaultDuration:420,plan:(e,t)=>{let n=Math.max(3,t.slide.height*R);return x(e,z.map((e,t)=>({offset:t/(z.length-1),translate:`${e*n}px 0`})),t)}},glow:{label:`Glow`,defaultDuration:620,plan:(e,t)=>x(e,[{offset:0,filter:`none`},{offset:.5,filter:`drop-shadow(0 0 ${Math.max(4,t.slide.height*B)}px ${V})`},{offset:1,filter:`none`}],t)},wipe:{label:`Wipe`,defaultDuration:340,defaultDirection:C,plan:J},draw:{label:`Draw`,defaultDuration:520,directional:!0,plan:(e,t)=>m(e,t,J)},type:{label:`Type`,defaultDuration:G,durationFor:e=>q(e),plan:(e,t)=>g(e,t)}};function X(e,t,n,r){return r===`exit`?e.plan(t,{...n,direction:ae(n.direction)}).map(e=>({element:e.element,keyframes:e.keyframes,timing:{...e.timing,fill:`both`,direction:`reverse`,delay:n.delay+ie(e.timing,n)}})):e.plan(t,n)}function ie(e,t){let n=Math.max(0,Number(e.delay??0)-t.delay),r=Number(e.duration??t.duration);return Math.max(0,t.duration-(n+r))}function ae(e){if(e===`up`)return`down`;if(e===`down`)return`up`;if(e===`left`)return`right`;if(e===`right`)return`left`}function oe(e){return e.directional===!0||e.defaultDirection!==void 0}function Z(e){return Object.hasOwn(Y,e)?Y[e]:Y.fade}function Q(e,t,n){if(t!==void 0&&Number.isFinite(t)&&t>0)return t;let r=Z(e);return n&&r.durationFor?r.durationFor(n):r.defaultDuration}function $(e){return e.items.reduce((e,t)=>{let{animation:n,shape:r}=t,i=Math.max(0,t.start);return Math.max(e,Q(n.effect,n.duration,r)+i)},0)}function se(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function ce(e){let t=[];function n(){for(let e of t)e.cancel();t=[]}return{cancel:n,finish(){for(let e of t)try{e.finish()}catch{}t=[]},play(r,i){if(n(),e.reducedMotion())return Promise.resolve();let a=new Map;for(let t of r.items){let n=e.boundsOf(t.shape),r=a.get(t.row);a.set(t.row,r?se(r,n):n)}let o=[];for(let t of r.items){let{shape:n,animation:r}=t,s=Z(r.effect),c=e.boundsOf(n),l={bounds:c,unit:a.get(t.row)??c,slide:i,duration:Q(r.effect,r.duration,n),delay:Math.max(0,t.start),direction:r.direction};for(let t of e.elementsFor(n.id))o.push(...X(s,t,l,r.kind))}if(o.length===0)return Promise.resolve();t=o.map(e=>e.element.animate(e.keyframes,e.timing));let s=t.map(e=>e.finished);return Promise.allSettled(s).then(()=>void 0)}}}var le=`(prefers-reduced-motion: reduce)`;function ue(){let[e,t]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{let e=window.matchMedia(le),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function de(){let e=r(e=>e.presentationAnimation),t=ue(),n=(0,d.useRef)(!1);n.current=!e||t;let i=(0,d.useMemo)(()=>ce({elementsFor:e=>s(e),boundsOf:e=>o(e),reducedMotion:()=>n.current}),[]);return(0,d.useEffect)(()=>()=>i.cancel(),[i]),i}var fe=n();function pe(e){let{pending:t}=e,n=(0,d.useMemo)(()=>t.size===0?``:`${[...t].map(c).join(`,`)}{opacity:0!important;pointer-events:none!important}`,[t]);return n?(0,fe.jsx)(`style`,{"data-testid":`build-visibility`,children:n}):null}export{Z as a,u as c,Q as i,de as n,$ as o,Y as r,oe as s,pe as t};
@@ -0,0 +1 @@
1
+ import{M as e,s as t}from"./style-BENGW2ZV.js";import{n}from"./shapes-D5w8NTQQ.js";var r={width:960,height:540},i=`#1e1e1e`,a=`#ffffff`,o=`#495057`,s=`#868e96`,c=`#adb5bd`,l=`#f08c00`,u=`#fab005`,d={yellow:e.yellow.pastel,orange:e.orange.pastel,green:e.green.pastel,red:e.red.pastel,blue:e.blue.pastel,teal:e.teal.pastel,purple:e.purple.pastel,pink:e.pink.pastel,gray:e.gray.pastel},f={yellow:e.yellow.bold,orange:e.orange.bold,green:e.green.bold,red:e.red.bold,blue:e.blue.bold,teal:e.teal.bold,purple:e.purple.bold,pink:e.pink.bold,gray:e.gray.bold},p=`'JetBrains Mono', ui-monospace, monospace`,m=`Caveat, cursive`;function h(e){let t=n();return e.map(e=>({...e,groupId:t}))}function g(e){let t=e.width/r.width,n=e.height/r.height,i=Math.min(t,n);return{rect:(r,i,a,o)=>({x:e.x+r*t,y:e.y+i*n,width:a*t,height:o*n}),point:(r,i)=>({x:e.x+r*t,y:e.y+i*n}),font:e=>Math.max(8,Math.round(e*i)),unit:i}}function _(e,r,i,a={}){return{id:n(),type:`text`,x:e.x+6,y:e.y+6,width:e.width-12,height:e.height-12,text:r,fontSize:i,fontFamily:a.fontFamily??t,textAlign:a.align??`center`,textVAlign:a.valign??`middle`,lineHeight:a.lineHeight??1.25,letterSpacing:a.letterSpacing,rotation:0,color:a.color??`#1e1e1e`,opacity:a.opacity??1}}function v(e,r,i={}){return{id:n(),type:`rectangle`,kind:i.kind??`rectangle`,...e,rotation:i.rotation??0,label:i.label??``,fontSize:i.fontSize??24,fontFamily:t,labelColor:i.labelColor,letterSpacing:i.letterSpacing,textAlign:i.align,textVAlign:i.valign,textPadding:i.textPadding,titleIcon:i.titleIcon,link:i.link,color:i.color??`#1e1e1e`,fill:r,fillStyle:i.fillStyle??`pastel`,corner:i.corner,shadow:i.shadow,strokeWidth:i.strokeWidth??1.5,dash:i.dash??`solid`,opacity:i.opacity??1}}function y(e,t={}){return{id:n(),type:`line`,points:e,color:t.color??`#1e1e1e`,strokeWidth:t.strokeWidth??3,dash:t.dash??`solid`,startArrow:!1,endArrow:t.endArrow??!1,opacity:t.opacity??1}}function b(e,r,i,a,o={}){return{id:n(),type:`text`,x:e.x,y:e.y,text:r,fontSize:i,fontFamily:o.fontFamily??t,rotation:o.rotation??0,color:a,opacity:o.opacity??1}}function x(e,r,i,a,o,s=d.yellow){return{id:n(),type:`sticky`,x:e.x,y:e.y,width:r,height:r,rotation:o,text:i,fontSize:a,fontFamily:t,fill:s,opacity:1}}function S(e,r,i,a,o={}){return{id:n(),type:`arrow`,x:e.x,y:e.y,x2:r.x,y2:r.y,bend:o.bow??0,bendAlong:0,bow:o.bow??0,bendStyle:o.bendStyle??`curved`,startBinding:{shapeId:i.id,anchor:{x:.5,y:.5},precise:!1},endBinding:{shapeId:a.id,anchor:{x:.5,y:.5},precise:!1},label:o.label,fontSize:o.fontSize,fontFamily:o.label?t:void 0,color:o.color??`#1e1e1e`,strokeWidth:o.strokeWidth??3,dash:o.dash??`solid`,startArrow:!1,endArrow:!0,opacity:1}}function C(e,t,r,i={}){return{id:n(),type:`arrow`,x:e.x,y:e.y,x2:t.x,y2:t.y,bend:i.bow??0,bendAlong:0,bow:i.bow??0,bendStyle:`curved`,startBinding:null,endBinding:null,color:i.color??`#1e1e1e`,strokeWidth:r,dash:`solid`,startArrow:!1,endArrow:!0,opacity:1}}function w(e,r,a,o,s={}){return{id:n(),type:`chart`,chartType:r,...e,rotation:0,cells:a,fontSize:o,fontFamily:t,color:i,opacity:1,...s}}function T(e,r,a,o,s,c={}){return{id:n(),type:`table`,x:e.x,y:e.y,cells:r,colWidths:a,rowHeights:o,rotation:0,fontSize:s,fontFamily:t,color:i,opacity:1,cellStyles:c.cellStyles??r.map((e,t)=>e.map(()=>t===0&&c.headerFill?{background:c.headerFill}:{}))}}function E(e,r,a={}){return{id:n(),type:`control`,kind:r,...e,rotation:0,label:a.label??``,body:a.body,primaryLabel:a.primaryLabel,secondaryLabel:a.secondaryLabel,fontSize:a.fontSize??15,fontFamily:t,color:i,fill:a.fill,value:a.value,opacity:a.opacity??1}}function D(e,r,i,a={}){return{id:n(),type:`icon`,x:e.x,y:e.y,width:r,height:r,rotation:0,source:a.source??`lucide`,name:i,label:a.label??``,fontSize:a.fontSize??16,fontFamily:t,color:a.color??`#1e1e1e`,strokeWidth:a.strokeWidth??3,opacity:a.opacity??1}}function O(e,r,i={}){return{id:n(),type:`figure`,kind:r,...e,rotation:0,label:i.label??``,lanes:i.lanes,laneSizes:i.laneSizes,fill:i.fill,dash:i.dash,strokeWidth:i.strokeWidth,fontSize:i.fontSize??16,fontFamily:t,color:i.color??`#868e96`,opacity:1}}function k(e,t,n,r,i={}){return v(e,t,{kind:`oval`,fillStyle:i.fillStyle??`bold`,label:n,fontSize:r,labelColor:i.labelColor,dash:`none`})}function A(e,t){return[_(e.rect(72,48,700,56),t,e.font(36),{align:`left`}),y([e.point(74,118),e.point(250,118)],{color:u,strokeWidth:4})]}function j(e){return v(e.rect(0,0,r.width,r.height),i,{dash:`none`})}function M(e,t,n,r={}){return _(e,t,n,{...r,color:r.color??`#ffffff`})}export{_ as A,A as C,g as D,v as E,y as O,h as S,S as T,w as _,o as a,C as b,a as c,r as d,u as f,M as g,j as h,c as i,x as k,d as l,E as m,i as n,p as o,k as p,s as r,l as s,f as t,m as u,T as v,D as w,b as x,O as y};
@@ -1,7 +1,7 @@
1
- import{At as e,Bn as t,Dt as n,Er as r,Et as i,Lr as a,Or as o,Ot as s,Rn as c,Rr as l,Wn as u,_n as d,an as f,kn as p,wt as m,yr as h,zr as g}from"./slides-D686obFO.js";import{B as _,D as v,G as y,L as b,W as x,z as S}from"./style-BENGW2ZV.js";import{s as C}from"./text-breaks-DM4W6y5f.js";import{a as w,o as T}from"./frames-Cp1QD3LR.js";var E=280,D=10,O=`#9ca3af`,k=.58;function A(e){return e.rowHeights.length}function j(e){return e.colWidths.length}function ee(e){let t=e.colWidths.reduce((e,t)=>e+t,0),n=e.rowHeights.reduce((e,t)=>e+t,0);return{x:e.x,y:e.y,width:t,height:n}}function te(e){let t=[0];for(let n of e)t.push(t[t.length-1]+n);return t}function M(e){return te(e.colWidths)}function N(e){return te(e.rowHeights)}function ne(e,t,n){return{x:e.x+M(e)[n],y:e.y+N(e)[t],width:e.colWidths[n],height:e.rowHeights[t]}}function re(e,t){return e.split(`
2
- `).reduce((e,t)=>Math.max(e,t.length),0)*t*k}function ie(e){return Math.max(32,Math.ceil(e*1.3)+16)}function ae(e,t){let n=e[0]?.length??0,r=[];for(let i=0;i<n;i+=1){let n=0;for(let r of e)n=Math.max(n,re(r[i]??``,t));r.push(x(Math.ceil(n+D*2),56,E))}return r}function P(e){let t=Math.max(1,...e.map(e=>e.length));return e.map(e=>{let n=e.slice(0,t);for(;n.length<t;)n.push(``);return n})}function oe(t,n,r){let i=P(t.length>0?t:[[``]]);return{id:e(),type:`table`,x:n.x,y:n.y,cells:i,colWidths:ae(i,r.fontSize),rowHeights:i.map(()=>ie(r.fontSize)),rotation:0,fontSize:r.fontSize,fontFamily:r.fontFamily,color:r.color,opacity:r.opacity}}function se(e,t){let n=[],r=[],i=``,a=!1;for(let o=0;o<e.length;o+=1){let s=e[o];if(a){s===`"`&&e[o+1]===`"`?(i+=`"`,o+=1):s===`"`?a=!1:i+=s;continue}s===`"`?a=!0:s===t?(r.push(i),i=``):s===`
1
+ import{B as e,D as t,G as n,L as r,W as i,z as a}from"./style-BENGW2ZV.js";import{Gt as o,Qt as s,U as c,en as l,ft as u,gt as d,j as f,n as p,tt as m,ut as h}from"./shapes-D5w8NTQQ.js";import{Dt as g,Et as _,Ft as v,Nt as y,Ot as b,Pt as x,wt as S}from"./slides-DDNzjFz9.js";import{s as C}from"./text-breaks-DhCXtQrJ.js";import{a as w,o as T}from"./frames-DRSLvE9E.js";var E=280,D=10,O=`#9ca3af`,k=.58;function A(e){return e.rowHeights.length}function j(e){return e.colWidths.length}function ee(e){let t=e.colWidths.reduce((e,t)=>e+t,0),n=e.rowHeights.reduce((e,t)=>e+t,0);return{x:e.x,y:e.y,width:t,height:n}}function te(e){let t=[0];for(let n of e)t.push(t[t.length-1]+n);return t}function M(e){return te(e.colWidths)}function N(e){return te(e.rowHeights)}function ne(e,t,n){return{x:e.x+M(e)[n],y:e.y+N(e)[t],width:e.colWidths[n],height:e.rowHeights[t]}}function re(e,t){return e.split(`
2
+ `).reduce((e,t)=>Math.max(e,t.length),0)*t*k}function ie(e){return Math.max(32,Math.ceil(e*1.3)+16)}function ae(e,t){let n=e[0]?.length??0,r=[];for(let a=0;a<n;a+=1){let n=0;for(let r of e)n=Math.max(n,re(r[a]??``,t));r.push(i(Math.ceil(n+D*2),56,E))}return r}function P(e){let t=Math.max(1,...e.map(e=>e.length));return e.map(e=>{let n=e.slice(0,t);for(;n.length<t;)n.push(``);return n})}function oe(e,t,n){let r=P(e.length>0?e:[[``]]);return{id:p(),type:`table`,x:t.x,y:t.y,cells:r,colWidths:ae(r,n.fontSize),rowHeights:r.map(()=>ie(n.fontSize)),rotation:0,fontSize:n.fontSize,fontFamily:n.fontFamily,color:n.color,opacity:n.opacity}}function se(e,t){let n=[],r=[],i=``,a=!1;for(let o=0;o<e.length;o+=1){let s=e[o];if(a){s===`"`&&e[o+1]===`"`?(i+=`"`,o+=1):s===`"`?a=!1:i+=s;continue}s===`"`?a=!0:s===t?(r.push(i),i=``):s===`
3
3
  `?(r.push(i),n.push(r),r=[],i=``):s!==`\r`&&(i+=s)}return r.push(i),n.push(r),n}function ce(e){let t=e.replace(/\r\n/g,`
4
4
  `).replace(/\n+$/,``);if(t.length===0)return null;let n=t.includes(` `)?` `:t.includes(`,`)?`,`:null;if(n===null)return null;let r=se(t,n);if(r.length===0)return null;let i=r[0].length;return i<2||r.some(e=>e.length!==i)?null:P(r)}function F(e){let t=[],n=``;for(let r=0;r<e.length;r+=1){let i=e[r];if(i===`\\`&&e[r+1]===`|`){n+=`|`,r+=1;continue}if(i===`|`){t.push(n.trim()),n=``;continue}n+=i}return t.push(n.trim()),t.length>1&&t[0]===``&&t.shift(),t.length>1&&t[t.length-1]===``&&t.pop(),t}function le(e){let t=e.replace(/\r\n/g,`
5
5
  `).trim().split(`
6
- `).map(e=>e.trim());if(t.length<2||t.some(e=>!e.includes(`|`)))return null;let n=F(t[0]),r=F(t[1]);return n.length===0||r.length!==n.length||!r.every(e=>/^:?-+:?$/.test(e))?null:P([n,...t.slice(2).map(F)])}function ue(e){let t=p(e).querySelector(`table`);if(!t)return null;let n=Array.from(t.querySelectorAll(`tr`)).map(e=>Array.from(e.querySelectorAll(`th,td`)).map(e=>(e.textContent??``).replace(/\s+/g,` `).trim())).filter(e=>e.length>0);return n.length>0?P(n):null}function de(e,t){let n=j(e),r=e.cells.slice();r.splice(t,0,Array.from({length:n},()=>``));let i=e.rowHeights.slice();i.splice(t,0,ie(e.fontSize));let a=e.cellStyles?.slice();return a?.splice(t,0,Array.from({length:n},()=>({}))),{...e,cells:r,rowHeights:i,cellStyles:a}}function fe(e,t){if(A(e)<=1)return e;let n=e.cells.slice();n.splice(t,1);let r=e.rowHeights.slice();r.splice(t,1);let i=e.cellStyles?.slice();return i?.splice(t,1),{...e,cells:n,rowHeights:r,cellStyles:i}}function pe(e,t){let n=e.cells.map(e=>{let n=e.slice();return n.splice(t,0,``),n}),r=e.colWidths.slice();r.splice(t,0,112);let i=e.cellStyles?.map(e=>{let n=e.slice();return n.splice(t,0,{}),n});return{...e,cells:n,colWidths:r,cellStyles:i}}function me(e,t){if(j(e)<=1)return e;let n=e.cells.map(e=>{let n=e.slice();return n.splice(t,1),n}),r=e.colWidths.slice();r.splice(t,1);let i=e.cellStyles?.map(e=>{let n=e.slice();return n.splice(t,1),n});return{...e,cells:n,colWidths:r,cellStyles:i}}function he(e,t){return e.rowHeights.map((n,r)=>{let i=32;for(let n=0;n<e.colWidths.length;n+=1){let e=t(r,n);e&&e>i&&(i=e)}return i})}function ge(e,t,n,r){let i=e.colWidths.slice();return i[t]=Math.max(56,n+r),{...e,colWidths:i}}function _e(e,t,n){let r=e.cellStyles?.[t]?.[n],i=r?.background??e.background,a=i===`transparent`?void 0:i;return{fontFamily:r?.fontFamily??e.fontFamily,fontSize:r?.fontSize??e.fontSize,color:a?_(a):e.color,background:a}}function ve(e){return e.cells.map(e=>e.map(()=>({})))}function ye(e){let t={};return e.fontFamily!==void 0&&(t.fontFamily=e.fontFamily),e.fontSize!==void 0&&(t.fontSize=e.fontSize),e.background!==void 0&&(t.background=e.background),t}function be(e,t,n){let r=e;if(n.opacity!==void 0&&(r={...r,opacity:n.opacity}),t===null)return n.fontFamily!==void 0&&(r={...r,fontFamily:n.fontFamily}),n.fontSize!==void 0&&(r={...r,fontSize:n.fontSize}),n.background!==void 0&&(r={...r,background:n.background}),r;let i=ye(n);if(Object.keys(i).length===0)return r;let a=(r.cellStyles??ve(r)).map(e=>e.slice()),o=t.axis===`row`;for(let e=0;e<a.length;e+=1)for(let n=0;n<a[e].length;n+=1)(o?e===t.index:n===t.index)&&(a[e][n]={...a[e][n],...i});return{...r,cellStyles:a}}function xe(e){return e.cells.map(e=>e.map(e=>/[",\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e).join(`,`)).join(`
7
- `)}function Se(e){let t=ee(e),n=[];for(let t=0;t<e.cells.length;t+=1)for(let r=0;r<e.cells[t].length;r+=1){let i=_e(e,t,r).background;i&&n.push({key:`bg-${t}-${r}`,rect:ne(e,t,r),fill:i})}let r=[],i=M(e),a=N(e);for(let n=1;n<i.length-1;n+=1){let a=e.x+i[n];r.push({key:`col-${n}`,x1:a,y1:t.y,x2:a,y2:t.y+t.height})}for(let n=1;n<a.length-1;n+=1){let i=e.y+a[n];r.push({key:`row-${n}`,x1:t.x,y1:i,x2:t.x+t.width,y2:i})}return{frame:t,cellFills:n,dividers:r}}var I=[`#4dabf7`,`#51cf66`,`#ff922b`,`#cc5de8`,`#ff6b6b`,`#20c997`,`#ffd43b`,`#f06595`],Ce={k:1e3,m:1e6,b:1e9,t:0xe8d4a51000};function L(e){let t=String(e??``).trim(),n=t.match(/([kmbt])\s*$/i),r=n?Ce[n[1].toLowerCase()]:1,i=parseFloat(t.replace(/[^0-9.+\-eE]/g,``))*r;return Number.isFinite(i)?i:0}function R(e,t){return e.seriesColors?.[t]??I[t%I.length]}function z(e){let t=e.cells,n=t[0]??[],r=Math.max(0,n.length-1),i=t.slice(1),a=i.map(e=>e[0]??``),o=[];for(let t=1;t<=r;t+=1)o.push({name:n[t]??``,color:R(e,t-1),values:i.map(e=>L(e[t]))});let s=-1/0,c=1/0;for(let e of o)for(let t of e.values)t>s&&(s=t),t<c&&(c=t);return Number.isFinite(s)||(s=0,c=0),{categories:a,series:o,min:c,max:s}}function we(e){return e.cells.slice(1).some(e=>e.slice(1).some(e=>String(e??``).trim().length>0))}function B(e){let t=0,n=0;for(let r=0;r<e.categories.length;r+=1){let i=0,a=0;for(let t of e.series){let e=t.values[r]??0;e>=0?i+=e:a+=e}i>t&&(t=i),a<n&&(n=a)}return{min:n,max:t}}function Te(e){let t=String(e??``).trim();return t.length!==0&&/^[-+]?[$€£¥]?[\d,]*\.?\d+%?[kmbtKMBT]?$/.test(t)}function Ee(e){if(e.length<2||(e[0]?.length??0)<2)return!1;let t=e.slice(1);for(let n=1;n<e[0].length;n+=1){let e=0,r=0;for(let i of t){let t=i[n]??``;t.trim().length!==0&&(r+=1,Te(t)&&(e+=1))}if(r>=1&&e/r>=.6)return!0}return!1}function De(e,t){let n=Math.abs(e);return n>=1e9?`${Number((e/1e9).toFixed(1))}B`:n>=1e6?`${Number((e/1e6).toFixed(1))}M`:n>=1e3?`${Number((e/1e3).toFixed(1))}k`:e.toFixed(t)}function Oe(e,t){return t===`percent`?`${e}%`:t===`currency`?`$${e}`:e}function V(e,t){return Oe(De(e,Number.isInteger(e)?0:+(Math.abs(e)<10)),t)}function ke(e,t,n){return Oe(De(Math.abs(e)<t*1e-9?0:e,t<1?Math.min(4,Math.ceil(-Math.log10(t))):0),n)}function H(e,t){if(e.length<=t)return e;if(t<=3)return e.slice(0,Math.max(0,t));let n=Math.ceil((t-1)/2),r=Math.floor((t-1)/2);return`${e.slice(0,n)}…${e.slice(e.length-r)}`}function Ae(e,t,n){return n===`number`?V(e,`number`):n===`currency`?V(e,`currency`):`${Math.round(e/t*100)}%`}var U=t.paperGrid,W=t.paperLine,je=`#868e96`,G=`#ffffff`;function K(e,t,n,r,i={}){return{kind:`text`,x:t,y:n,text:r,size:e.fontSize,color:je,family:e.fontFamily,anchor:`middle`,baseline:`middle`,...i}}function q(e,t,n,r,i={}){return K(e,t,n,r,{color:u(e.color),...i})}function Me(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}function Ne(e,t){if(!e.showTitles||!e.title)return{prims:[],box:t};let n=e.fontSize*1.2,r=[q(e,t.x+t.width/2,t.y+n*.2,e.title,{size:n,baseline:`hanging`})],i=n*1.5;return{prims:r,box:{x:t.x,y:t.y+i,width:t.width,height:t.height-i}}}function Pe(e,t,n){let r=t.filter(e=>e.name);if(!e.showLegend||r.length===0)return{prims:[],height:0};let i=e.fontSize,a=i*.8,o=i*.45,s=i*1.6,c=e=>e.length*i*.6,l=e=>a+o+c(e),u=[],d=0;for(let e of r){let t=l(e.name),r=u[u.length-1];if(!r||d+s+t>n.width){u.push([e]),d=t;continue}r.push(e),d+=s+t}let f=i*1.5,p=[];return u.forEach((t,r)=>{let c=t.reduce((e,t,n)=>e+l(t.name)+(n>0?s:0),0),u=n.y+i*.6+r*f,d=n.x+Math.max(0,(n.width-c)/2);for(let n of t)p.push({kind:`rect`,x:d,y:u,width:a,height:a,fill:n.color,rx:2,testId:`chart-legend`}),p.push(q(e,d+a+o,u+a/2,n.name,{anchor:`start`})),d+=l(n.name)+s}),{prims:p,height:i*.6+u.length*f}}function J(e,t,n){return Pe(e,t.series.map(e=>({name:e.name,color:e.color})),n)}function Y(e,t,n){return t.name?`${e}\n${t.name}: ${n}`:e?`${e}: ${n}`:n}function Fe(e,t){let n=10**Math.floor(Math.log10(e)),r=e/n,i;return i=t?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10,i*n}function X(e,t,n){let r=Math.min(0,Number.isFinite(e)?e:0),i=Math.max(0,Number.isFinite(t)?t:0);r===i&&(i=r+1);let a=Fe(Fe(i-r,!1)/Math.max(1,n),!0),o=Math.floor(r/a)*a,s=Math.ceil(i/a)*a,c=[];for(let e=o;e<=s+a*.5;e+=a)c.push(e);return{min:o,max:s,step:a,ticks:c}}function Ie(e,t,n,r){for(let i of n.ticks){let a=r.valueOf(i),o=Math.abs(i)<n.step*1e-6,s=r.tickLine(a);e.push({kind:`line`,x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:o?W:U,width:1}),e.push(r.tickText(a,ke(i,n.step,t.numberFormat)))}for(let t=0;t<r.count;t+=1)e.push(r.categoryText(t,r.padAlongStart+r.slot*(t+.5)))}function Le(e,t,n,r,i,a){let o=Math.max(1,r.series.length),s=a.slot*.18,c=a.slot-s*2;if(i){let i=r.categories.map(()=>0),o=r.categories.map(()=>0);for(let l=0;l<a.count;l+=1){let u=a.padAlongStart+a.slot*l+s;r.series.forEach((s,d)=>{let f=s.values[l]??0,p=f>=0?i[l]:o[l],m=p+f,h=a.valueOf(p),g=a.valueOf(m),_=a.barRect(u,c,h,g);e.push({kind:`rect`,x:_.x,y:_.y,width:_.width,height:_.height,fill:R(n,d),rx:2,testId:`chart-bar`});let v=a.stackedValueText(_,f,V(f,n.numberFormat));v&&e.push(v);let y=a.stackedTip(_,h,g);t.push({x:_.x,y:_.y,width:_.width,height:_.height,tipX:y.tipX,tipY:y.tipY,label:Y(r.categories[l],s,V(f,n.numberFormat))}),f>=0?i[l]=m:o[l]=m})}return}let l=o>1?c*.08:0,u=(c-l*(o-1))/o;for(let i=0;i<a.count;i+=1){let o=a.padAlongStart+a.slot*i+s;r.series.forEach((s,c)=>{let d=s.values[i]??0,f=o+c*(u+l),p=a.barRect(f,u,a.base,a.valueOf(d));e.push({kind:`rect`,x:p.x,y:p.y,width:p.width,height:p.height,fill:s.color,rx:2,testId:`chart-bar`});let m=a.groupedValueText(p,d,V(d,n.numberFormat));m&&e.push(m);let h=a.groupedTip(p,d);t.push({x:p.x,y:p.y,width:p.width,height:p.height,tipX:h.tipX,tipY:h.tipY,label:Y(r.categories[i],s,V(d,n.numberFormat))})})}}function Re(e,t,n,r,i,a){let o=n.fontSize,{padLeft:s,slot:c,yOf:l,baseY:u}=a,d=n.chartType===`scatter`,f=r.categories.map(()=>0);r.series.forEach(a=>{let p=a.values.map((e,t)=>{let n=i?f[t]+e:e;return{x:s+c*(t+.5),y:l(n)}});if(n.chartType===`area`){let t=i?f.map(e=>l(e)):r.categories.map(()=>u);e.push({kind:`path`,d:He(p,t),fill:a.color,fillOpacity:i?1:.55,testId:`chart-area`})}d||e.push({kind:`polyline`,points:p,stroke:a.color,width:2.5,testId:`chart-line`}),p.forEach((i,s)=>{n.chartType===`line`&&e.push({kind:`circle`,cx:i.x,cy:i.y,r:3.5,fill:G,stroke:a.color,width:2}),d&&e.push({kind:`circle`,cx:i.x,cy:i.y,r:4.5,fill:a.color,stroke:G,width:1.5,testId:`chart-dot`});let l=a.values[s]??0;n.showValues&&e.push(q(n,i.x,i.y-7,V(l,n.numberFormat),{size:o*.85,baseline:`auto`,testId:`chart-value`})),t.push({x:i.x-c*.4,y:Math.min(i.y,u)-6,width:c*.8,height:Math.abs(u-i.y)+12,tipX:i.x,tipY:i.y,label:Y(r.categories[s],a,V(l,n.numberFormat))})}),a.values.forEach((e,t)=>{f[t]+=e})})}function ze(e,t,n){let r=e.fontSize,i=(e.chartType===`bar`||e.chartType===`area`)&&!!e.stacked,a=J(e,t,n),o=n.y+a.height,s=i?B(t):{min:t.min,max:t.max},c=X(s.min,s.max,4),l=c.ticks.map(t=>ke(t,c.step,e.numberFormat)),u=Math.max(...l.map(e=>e.length)),d=e.showTitles&&e.yTitle?r*2.1:0,f=e.showTitles&&e.xTitle?r*1.6:0,p=n.x+d+u*r*.6+10,m=n.x+n.width-12,h=o+r*.6,g=Math.max(1,m-p),_=t.categories.length,v=g/Math.max(1,_),y=e=>e.length*r*.55,b=t.categories.reduce((e,t)=>Math.max(e,y(t)),0)>v*.95,x=t.categories,S=r+12;if(b){let e=40*Math.PI/180,i=Math.max(r*2,(n.height*.42-12)/Math.sin(e)),a=Math.max(3,Math.floor(i/(r*.55)));x=t.categories.map(e=>H(e,a));let o=x.reduce((e,t)=>Math.max(e,y(t)),0);S=Math.sin(e)*o+14}let C=n.y+n.height-S-f,w=c.max-c.min||1,T=Math.max(1,C-h),E=e=>C-(e-c.min)/w*T,D=E(0),O={count:_,slot:v,padAlongStart:p,valueOf:E,base:D,barRect:(e,t,n,r)=>({x:e,y:Math.min(n,r),width:t,height:Math.abs(r-n)}),tickLine:e=>({x1:p,y1:e,x2:m,y2:e}),tickText:(t,n)=>K(e,p-6,t,n,{anchor:`end`}),categoryText:(n,r)=>b?K(e,r,C+8,x[n],{anchor:`end`,rotate:-40}):K(e,r,C+6,t.categories[n],{baseline:`hanging`}),stackedValueText:(t,n,i)=>e.showValues&&t.height>r?K(e,t.x+t.width/2,t.y+t.height/2,i,{size:r*.85,color:G,testId:`chart-value`}):null,groupedValueText:(t,n,i)=>e.showValues?q(e,t.x+t.width/2,(n>=0?t.y:t.y+t.height)-(n>=0?4:-r),i,{size:r*.85,baseline:`auto`,testId:`chart-value`}):null,stackedTip:e=>({tipX:e.x+e.width/2,tipY:e.y}),groupedTip:e=>({tipX:e.x+e.width/2,tipY:e.y})},k=[...a.prims,...Be(e,{padLeft:p,padRight:m,padBottom:C,padTop:h,box:n})],A=[];return Ie(k,e,c,O),e.chartType===`line`||e.chartType===`area`||e.chartType===`scatter`?(Re(k,A,e,t,i,{padLeft:p,slot:v,yOf:E,baseY:D}),{prims:k,marks:A}):(Le(k,A,e,t,i,O),{prims:k,marks:A})}function Be(e,t){if(!e.showTitles)return[];let n=e.fontSize,r=[];if(e.xTitle&&r.push(q(e,(t.padLeft+t.padRight)/2,t.box.y+t.box.height-n*.4,e.xTitle,{baseline:`auto`})),e.yTitle){let i=(t.padTop+t.padBottom)/2,a=t.box.x+n*.8;r.push(q(e,a,i,e.yTitle,{rotate:-90}))}return r}function Ve(e,t,n){let r=e.fontSize,i=!!e.stacked,a=J(e,t,n),o=n.y+a.height,s=i?B(t):{min:t.min,max:t.max},c=X(s.min,s.max,4),l=e=>e.length*r*.55,u=Math.min(n.width*.35,t.categories.reduce((e,t)=>Math.max(e,l(t)),0)),d=Math.max(3,Math.floor(u/(r*.55))),f=t.categories.map(e=>H(e,d)),p=e.showTitles&&e.yTitle?r*2.1:0,m=e.showTitles&&e.xTitle?r*1.6:0,h=n.x+p+u+14,g=n.x+n.width-14,_=o+r*.4,v=n.y+n.height-(r+10)-m,y=Math.max(1,g-h),b=Math.max(1,v-_),x=c.max-c.min||1,S=e=>h+(e-c.min)/x*y,C=S(0),w=t.categories.length,T={count:w,slot:b/Math.max(1,w),padAlongStart:_,valueOf:S,base:C,barRect:(e,t,n,r)=>({x:Math.min(n,r),y:e,width:Math.abs(r-n),height:t}),tickLine:e=>({x1:e,y1:_,x2:e,y2:v}),tickText:(t,n)=>K(e,t,v+6,n,{baseline:`hanging`}),categoryText:(t,n)=>K(e,h-8,n,f[t],{anchor:`end`}),stackedValueText:()=>null,groupedValueText:(t,n,i)=>e.showValues?q(e,(n>=0?t.x+t.width:t.x)+(n>=0?4:-4),t.y+t.height/2,i,{size:r*.85,anchor:n>=0?`start`:`end`,testId:`chart-value`}):null,stackedTip:(e,t,n)=>({tipX:(t+n)/2,tipY:e.y}),groupedTip:e=>({tipX:e.x+e.width,tipY:e.y+e.height/2})},E=[...a.prims,...Be(e,{padLeft:h,padRight:g,padBottom:v,padTop:_,box:n})],D=[];return Ie(E,e,c,T),Le(E,D,e,t,i,T),{prims:E,marks:D}}function He(e,t){return`${e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `)} ${e.map((e,n)=>`L ${e.x} ${t[n]}`).reverse().join(` `)} Z`}function Ue(e,t,n,r,i){let a={x:e+n*Math.cos(r),y:t+n*Math.sin(r)},o={x:e+n*Math.cos(i),y:t+n*Math.sin(i)},s=+(i-r>Math.PI);return`M ${e} ${t} L ${a.x} ${a.y} A ${n} ${n} 0 ${s} 1 ${o.x} ${o.y} Z`}function We(e,t,n,r,i,a){let o=(n,r)=>({x:e+n*Math.cos(r),y:t+n*Math.sin(r)}),s=o(n,i),c=o(n,a),l=o(r,a),u=o(r,i),d=+(a-i>Math.PI);return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} 1 ${c.x} ${c.y} L ${l.x} ${l.y} A ${r} ${r} 0 ${d} 0 ${u.x} ${u.y} Z`}function Ge(e,t,n){let r=e.fontSize,i=t.series[0],a=Pe(e,t.categories.map((e,t)=>({name:e,color:I[t%I.length]})),n),o=[...a.prims],s=[];if(!i)return{prims:o,marks:s};let c=i.values.reduce((e,t)=>e+Math.max(0,t),0),l=n.y+a.height,u=n.x+n.width/2,d=l+(n.y+n.height-l)/2,f=Math.max(8,Math.min(n.width,n.y+n.height-l)/2-r),p=e.chartType===`donut`?f*.58:0;if(c<=0)return{prims:o,marks:s};let m=-Math.PI/2;return i.values.forEach((n,a)=>{let l=Math.max(0,n)/c*Math.PI*2;if(l<=0)return;let h=I[a%I.length],g=p>0?We(u,d,f,p,m,m+l):Ue(u,d,f,m,m+l);o.push({kind:`path`,d:g,fill:h,testId:`chart-slice`});let _=m+l/2,v=p>0?(f+p)/2:f*.62,y=u+v*Math.cos(_),b=d+v*Math.sin(_);l>.25&&o.push(K(e,y,b,Ae(n,c,e.numberFormat),{size:r*.9,color:G,testId:`chart-value`}));let x=Math.round(n/c*100),S=V(n,e.numberFormat===`currency`?`currency`:`number`);s.push({x:y-r,y:b-r,width:r*2,height:r*2,tipX:y,tipY:b-r,label:Y(t.categories[a]??``,i,`${S} (${x}%)`)}),m+=l}),{prims:o,marks:s}}function Ke(e){let t=[];for(let n of e.cells.slice(1)){let e=String(n[1]??``).trim(),r=String(n[2]??``).trim();!e&&!r||t.push({label:n[0]??``,x:y(L(e)),y:y(L(r))})}return t}function Z(e){let t=(e??``).trim();if(!t)return{low:``,high:``};let n=/^(.*?)\s*(?:→|-->|->)\s*(.*)$/.exec(t);return n?{low:n[1].trim(),high:n[2].trim()}:{low:t,high:``}}function qe(e,t){let n=e.trim(),r=t.trim();return n&&r?`${n} → ${r}`:n?`${n} →`:r?`→ ${r}`:``}var Je=[I[1],I[0],I[4],I[2]];function Ye(e,t,n,r){return`M ${e} ${t} L ${n} ${t} L ${n} ${r} L ${e} ${r} Z`}function Xe(e,t){let n=e.fontSize,r=[],i=[],a=Z(e.xTitle),o=Z(e.yTitle),s=!!(a.low||a.high),c=!!(o.low||o.high),l=t.x+(c?n*1.9:n*.6),u=t.x+t.width-n*.8,d=t.y+n*.6,f=t.y+t.height-(s?n*1.9:n*.8),p=Math.max(1,u-l),m=Math.max(1,f-d),h=l+p/2,g=d+m/2,_=e=>l+e*p,v=e=>f-e*m,y=t=>e.quadrantColors?.[t]??Je[t],b=[{rect:[h,d,u,g],tint:y(0),label:e.quadrantLabels?.[0]},{rect:[l,d,h,g],tint:y(1),label:e.quadrantLabels?.[1]},{rect:[l,g,h,f],tint:y(2),label:e.quadrantLabels?.[2]},{rect:[h,g,u,f],tint:y(3),label:e.quadrantLabels?.[3]}];for(let e of b){let[t,n,i,a]=e.rect;r.push({kind:`path`,d:Ye(t,n,i,a),fill:e.tint,fillOpacity:.1,testId:`chart-quadrant-zone`})}r.push({kind:`path`,d:Ye(l,d,u,f),stroke:W,width:1}),r.push({kind:`line`,x1:h,y1:d,x2:h,y2:f,stroke:W,width:1}),r.push({kind:`line`,x1:l,y1:g,x2:u,y2:g,stroke:W,width:1});for(let t of b){if(!t.label)continue;let[i,a,o]=t.rect,s=Math.max(3,Math.floor((o-i)/(n*.55)));r.push(q(e,(i+o)/2,a+n*1.1,H(t.label,s),{testId:`chart-quadrant-label`}))}a.high?(r.push(K(e,(l+h)/2,f+n*.9,a.low,{baseline:`hanging`})),r.push(K(e,(h+u)/2,f+n*.9,a.high,{baseline:`hanging`}))):a.low&&r.push(K(e,h,f+n*.9,a.low,{baseline:`hanging`}));let x=t.x+n*1;o.high?(r.push(K(e,x,(g+f)/2,o.low,{rotate:-90})),r.push(K(e,x,(d+g)/2,o.high,{rotate:-90}))):o.low&&r.push(K(e,x,g,o.low,{rotate:-90}));let S=R(e,0);for(let t of Ke(e)){let a=_(t.x),o=v(t.y);if(r.push({kind:`circle`,cx:a,cy:o,r:5,fill:S,stroke:G,width:1.5,testId:`chart-quadrant-point`}),t.label){let i=t.x>.72;r.push(q(e,a+(i?-9:9),o,t.label,{size:n*.85,anchor:i?`end`:`start`,testId:`chart-quadrant-point-label`}))}let s=`(${V(t.x,`number`)}, ${V(t.y,`number`)})`;i.push({x:a-n,y:o-n,width:n*2,height:n*2,tipX:a,tipY:o,label:t.label?`${t.label}\n${s}`:s})}return{prims:r,marks:i}}function Q(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Ze(e){let t=f(e),n={x:0,y:0,width:t.width,height:t.height},i={x:e.flipX,y:e.flipY},a=r(e.kind,n,e.corner,i),c=o(e.kind,n,e.corner,i),l=S(e.fill,e.fillStyle??`pastel`,e.shadow,e.stroke),u=e.kind===`fork-join`?e.color:l.fill,d=e.kind===`fork-join`?1:l.fillOpacity,p=e.kind===`fork-join`?e.color:l.stroke,m=v(e.dash,e.strokeWidth),h=b(t);return{shadow:l.shadow?{tag:`path`,attrs:{d:a,transform:`translate(${h} ${h})`,fill:`#000000`,"fill-opacity":.18,stroke:`none`}}:null,fill:u===`none`?null:{tag:`path`,attrs:{d:a,fill:u,"fill-opacity":d,stroke:`none`}},strokes:e.dash===`none`?[]:s(e).map(t=>({tag:`path`,attrs:{d:t,fill:`none`,stroke:p,"stroke-width":e.strokeWidth,"stroke-dasharray":m.strokeDasharray,"stroke-linecap":m.strokeLinecap,"stroke-linejoin":`round`}})),fillPath:a,hitPath:c}}function Qe(e){let t=f(e);return{shadow:{tag:`rect`,attrs:{x:4,y:4,width:t.width,height:t.height,rx:2,fill:`#000000`,"fill-opacity":C}},card:{tag:`rect`,attrs:{width:t.width,height:t.height,rx:2,fill:e.fill}}}}function $e(e){let t=f(e),n=e.fill&&e.fill!==`transparent`?e.fill:`none`,r=e.kind??`simple`,a=d(e),o=a.strokeWidth,s=v(a.dash,o),c=a.dash===`none`;if(r===`simple`)return{outline:{tag:`rect`,attrs:{x:t.x,y:t.y,width:t.width,height:t.height,rx:10,fill:n,stroke:c?`none`:e.color,"stroke-opacity":.55,"stroke-width":o,"stroke-dasharray":s.strokeDasharray,"stroke-linecap":s.strokeLinecap}},chrome:[]};let{border:l,details:u}=w(r,t,e.lanes,e.laneSizes),p={fill:`none`,stroke:e.color,"stroke-opacity":.55,"stroke-width":o,"stroke-dasharray":s.strokeDasharray,"stroke-linecap":s.strokeLinecap,"stroke-linejoin":`round`},m=c?[]:[l,...u].flatMap((t,n)=>i(t,e,n).map(e=>({tag:`path`,attrs:{d:e,...p}})));return{outline:{tag:`rect`,attrs:{x:t.x,y:t.y,width:t.width,height:t.height,rx:T(r,t),fill:n,stroke:`none`}},chrome:m}}function et(e){let t=e.type===`line`&&e.color===`transparent`?c:e.color,r=v(e.dash,e.strokeWidth),i=e.type===`arrow`?m(e):n(e),o=e.type===`arrow`?a(e):l(e);return{strokes:i.map(n=>({tag:`path`,attrs:{d:n,fill:`none`,stroke:t,"stroke-width":e.strokeWidth,"stroke-linecap":r.strokeLinecap,"stroke-linejoin":`round`,"stroke-dasharray":r.strokeDasharray}})),heads:o.map(n=>({tag:`path`,attrs:{d:n.d,fill:g(n.fill,t),stroke:t,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`}}))}}function $(e,t){if(e.length===0)return``;if(e.length<3||!t){let[t,...n]=e;return`M ${t.x} ${t.y}${n.map(e=>` L ${e.x} ${e.y}`).join(``)} Z`}let n=t=>e[(t+e.length)%e.length],r=`M ${n(0).x} ${n(0).y}`;for(let t=0;t<e.length;t+=1){let e=n(t-1),i=n(t),a=n(t+1),o=n(t+2),s={x:i.x+(a.x-e.x)/6,y:i.y+(a.y-e.y)/6},c={x:a.x-(o.x-i.x)/6,y:a.y-(o.y-i.y)/6};r+=` C ${s.x} ${s.y} ${c.x} ${c.y} ${a.x} ${a.y}`}return`${r} Z`}function tt(e){return{tag:`path`,attrs:{d:h(e),fill:e.color===`transparent`?c:e.color}}}var nt=Q(Ze),rt=Q(Qe),it=Q($e),at=Q(et);function ot(e,t,n){let r=e.fontSize,i=J(e,t,n),a=[...i.prims],o=[],s=t.categories.length;if(s<1)return{prims:a,marks:o};let c=n.y+i.height,l=n.x+n.width/2,u=c+(n.y+n.height-c)/2,d=Math.max(8,Math.min(n.width,n.y+n.height-c)/2-r*2.4),f=X(t.min,t.max,4),p=f.max-f.min||1,m=e=>e/s*Math.PI*2-Math.PI/2,h=(e,t)=>{let n=(t-f.min)/p*d,r=m(e);return{x:l+n*Math.cos(r),y:u+n*Math.sin(r)}};for(let e of f.ticks){let n=(e-f.min)/p*d;if(n<=.5)continue;let r=t.categories.map((e,t)=>{let r=m(t);return{x:l+n*Math.cos(r),y:u+n*Math.sin(r)}});a.push({kind:`path`,d:$(r),stroke:U,width:1,testId:`chart-radar-grid`})}for(let n=0;n<s;n+=1){let i=m(n),o={x:l+d*Math.cos(i),y:u+d*Math.sin(i)};a.push({kind:`line`,x1:l,y1:u,x2:o.x,y2:o.y,stroke:U,width:1});let s=l+(d+r*.8)*Math.cos(i),c=u+(d+r*.8)*Math.sin(i),f=Math.abs(Math.cos(i))<.3?`middle`:Math.cos(i)>0?`start`:`end`;a.push(K(e,s,c,t.categories[n],{anchor:f}))}return t.series.forEach(n=>{let i=n.values.map((e,t)=>h(t,e));a.push({kind:`path`,d:$(i),fill:n.color,fillOpacity:.18,stroke:n.color,width:2,testId:`chart-radar-area`}),i.forEach((i,s)=>{a.push({kind:`circle`,cx:i.x,cy:i.y,r:3,fill:n.color,stroke:G,width:1.5});let c=n.values[s]??0;o.push({x:i.x-r,y:i.y-r,width:r*2,height:r*2,tipX:i.x,tipY:i.y,label:Y(t.categories[s]??``,n,V(c,e.numberFormat))})})}),{prims:a,marks:o}}var st=`chart-empty`;function ct(e,t){return{prims:[K(e,t.x+t.width/2,t.y+t.height/2,`No data. Double-click to edit`,{testId:st})],marks:[]}}function lt(e){let t=Me(e);if(!we(e))return ct(e,t);let n=z(e),r=Ne(e,t),i=r.box,a=e.chartType===`quadrant`?Xe(e,i):e.chartType===`pie`||e.chartType===`donut`?Ge(e,n,i):e.chartType===`radar`?ot(e,n,i):e.chartType===`bar`&&e.horizontal?Ve(e,n,i):ze(e,n,i);return{prims:[...r.prims,...a.prims],marks:a.marks}}function ut(e){return lt(e).prims}export{ge as A,he as C,le as D,ue as E,xe as F,be as M,ee as N,me as O,Se as P,oe as S,ce as T,pe as _,tt as a,_e as b,nt as c,Z as d,qe as f,O as g,Ee as h,at as i,N as j,fe as k,rt as l,z as m,ut as n,it as o,I as p,lt as r,$ as s,st as t,Je as u,de as v,P as w,M as x,ne as y};
6
+ `).map(e=>e.trim());if(t.length<2||t.some(e=>!e.includes(`|`)))return null;let n=F(t[0]),r=F(t[1]);return n.length===0||r.length!==n.length||!r.every(e=>/^:?-+:?$/.test(e))?null:P([n,...t.slice(2).map(F)])}function ue(e){let t=m(e).querySelector(`table`);if(!t)return null;let n=Array.from(t.querySelectorAll(`tr`)).map(e=>Array.from(e.querySelectorAll(`th,td`)).map(e=>(e.textContent??``).replace(/\s+/g,` `).trim())).filter(e=>e.length>0);return n.length>0?P(n):null}function de(e,t){let n=j(e),r=e.cells.slice();r.splice(t,0,Array.from({length:n},()=>``));let i=e.rowHeights.slice();i.splice(t,0,ie(e.fontSize));let a=e.cellStyles?.slice();return a?.splice(t,0,Array.from({length:n},()=>({}))),{...e,cells:r,rowHeights:i,cellStyles:a}}function fe(e,t){if(A(e)<=1)return e;let n=e.cells.slice();n.splice(t,1);let r=e.rowHeights.slice();r.splice(t,1);let i=e.cellStyles?.slice();return i?.splice(t,1),{...e,cells:n,rowHeights:r,cellStyles:i}}function pe(e,t){let n=e.cells.map(e=>{let n=e.slice();return n.splice(t,0,``),n}),r=e.colWidths.slice();r.splice(t,0,112);let i=e.cellStyles?.map(e=>{let n=e.slice();return n.splice(t,0,{}),n});return{...e,cells:n,colWidths:r,cellStyles:i}}function me(e,t){if(j(e)<=1)return e;let n=e.cells.map(e=>{let n=e.slice();return n.splice(t,1),n}),r=e.colWidths.slice();r.splice(t,1);let i=e.cellStyles?.map(e=>{let n=e.slice();return n.splice(t,1),n});return{...e,cells:n,colWidths:r,cellStyles:i}}function he(e,t){return e.rowHeights.map((n,r)=>{let i=32;for(let n=0;n<e.colWidths.length;n+=1){let e=t(r,n);e&&e>i&&(i=e)}return i})}function ge(e,t,n,r){let i=e.colWidths.slice();return i[t]=Math.max(56,n+r),{...e,colWidths:i}}function _e(t,n,r){let i=t.cellStyles?.[n]?.[r],a=i?.background??t.background,o=a===`transparent`?void 0:a;return{fontFamily:i?.fontFamily??t.fontFamily,fontSize:i?.fontSize??t.fontSize,color:o?e(o):t.color,background:o}}function ve(e){return e.cells.map(e=>e.map(()=>({})))}function ye(e){let t={};return e.fontFamily!==void 0&&(t.fontFamily=e.fontFamily),e.fontSize!==void 0&&(t.fontSize=e.fontSize),e.background!==void 0&&(t.background=e.background),t}function be(e,t,n){let r=e;if(n.opacity!==void 0&&(r={...r,opacity:n.opacity}),t===null)return n.fontFamily!==void 0&&(r={...r,fontFamily:n.fontFamily}),n.fontSize!==void 0&&(r={...r,fontSize:n.fontSize}),n.background!==void 0&&(r={...r,background:n.background}),r;let i=ye(n);if(Object.keys(i).length===0)return r;let a=(r.cellStyles??ve(r)).map(e=>e.slice()),o=t.axis===`row`;for(let e=0;e<a.length;e+=1)for(let n=0;n<a[e].length;n+=1)(o?e===t.index:n===t.index)&&(a[e][n]={...a[e][n],...i});return{...r,cellStyles:a}}function xe(e){return e.cells.map(e=>e.map(e=>/[",\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e).join(`,`)).join(`
7
+ `)}function Se(e){let t=ee(e),n=[];for(let t=0;t<e.cells.length;t+=1)for(let r=0;r<e.cells[t].length;r+=1){let i=_e(e,t,r).background;i&&n.push({key:`bg-${t}-${r}`,rect:ne(e,t,r),fill:i})}let r=[],i=M(e),a=N(e);for(let n=1;n<i.length-1;n+=1){let a=e.x+i[n];r.push({key:`col-${n}`,x1:a,y1:t.y,x2:a,y2:t.y+t.height})}for(let n=1;n<a.length-1;n+=1){let i=e.y+a[n];r.push({key:`row-${n}`,x1:t.x,y1:i,x2:t.x+t.width,y2:i})}return{frame:t,cellFills:n,dividers:r}}var I=[`#4dabf7`,`#51cf66`,`#ff922b`,`#cc5de8`,`#ff6b6b`,`#20c997`,`#ffd43b`,`#f06595`],Ce={k:1e3,m:1e6,b:1e9,t:0xe8d4a51000};function L(e){let t=String(e??``).trim(),n=t.match(/([kmbt])\s*$/i),r=n?Ce[n[1].toLowerCase()]:1,i=parseFloat(t.replace(/[^0-9.+\-eE]/g,``))*r;return Number.isFinite(i)?i:0}function R(e,t){return e.seriesColors?.[t]??I[t%I.length]}function z(e){let t=e.cells,n=t[0]??[],r=Math.max(0,n.length-1),i=t.slice(1),a=i.map(e=>e[0]??``),o=[];for(let t=1;t<=r;t+=1)o.push({name:n[t]??``,color:R(e,t-1),values:i.map(e=>L(e[t]))});let s=-1/0,c=1/0;for(let e of o)for(let t of e.values)t>s&&(s=t),t<c&&(c=t);return Number.isFinite(s)||(s=0,c=0),{categories:a,series:o,min:c,max:s}}function we(e){return e.cells.slice(1).some(e=>e.slice(1).some(e=>String(e??``).trim().length>0))}function B(e){let t=0,n=0;for(let r=0;r<e.categories.length;r+=1){let i=0,a=0;for(let t of e.series){let e=t.values[r]??0;e>=0?i+=e:a+=e}i>t&&(t=i),a<n&&(n=a)}return{min:n,max:t}}function Te(e){let t=String(e??``).trim();return t.length!==0&&/^[-+]?[$€£¥]?[\d,]*\.?\d+%?[kmbtKMBT]?$/.test(t)}function Ee(e){if(e.length<2||(e[0]?.length??0)<2)return!1;let t=e.slice(1);for(let n=1;n<e[0].length;n+=1){let e=0,r=0;for(let i of t){let t=i[n]??``;t.trim().length!==0&&(r+=1,Te(t)&&(e+=1))}if(r>=1&&e/r>=.6)return!0}return!1}function De(e,t){let n=Math.abs(e);return n>=1e9?`${Number((e/1e9).toFixed(1))}B`:n>=1e6?`${Number((e/1e6).toFixed(1))}M`:n>=1e3?`${Number((e/1e3).toFixed(1))}k`:e.toFixed(t)}function Oe(e,t){return t===`percent`?`${e}%`:t===`currency`?`$${e}`:e}function V(e,t){return Oe(De(e,Number.isInteger(e)?0:+(Math.abs(e)<10)),t)}function ke(e,t,n){return Oe(De(Math.abs(e)<t*1e-9?0:e,t<1?Math.min(4,Math.ceil(-Math.log10(t))):0),n)}function H(e,t){if(e.length<=t)return e;if(t<=3)return e.slice(0,Math.max(0,t));let n=Math.ceil((t-1)/2),r=Math.floor((t-1)/2);return`${e.slice(0,n)}…${e.slice(e.length-r)}`}function Ae(e,t,n){return n===`number`?V(e,`number`):n===`currency`?V(e,`currency`):`${Math.round(e/t*100)}%`}var U=u.paperGrid,W=u.paperLine,je=`#868e96`,G=`#ffffff`;function K(e,t,n,r,i={}){return{kind:`text`,x:t,y:n,text:r,size:e.fontSize,color:je,family:e.fontFamily,anchor:`middle`,baseline:`middle`,...i}}function q(e,t,n,r,i={}){return K(e,t,n,r,{color:d(e.color),...i})}function Me(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}function Ne(e,t){if(!e.showTitles||!e.title)return{prims:[],box:t};let n=e.fontSize*1.2,r=[q(e,t.x+t.width/2,t.y+n*.2,e.title,{size:n,baseline:`hanging`})],i=n*1.5;return{prims:r,box:{x:t.x,y:t.y+i,width:t.width,height:t.height-i}}}function Pe(e,t,n){let r=t.filter(e=>e.name);if(!e.showLegend||r.length===0)return{prims:[],height:0};let i=e.fontSize,a=i*.8,o=i*.45,s=i*1.6,c=e=>e.length*i*.6,l=e=>a+o+c(e),u=[],d=0;for(let e of r){let t=l(e.name),r=u[u.length-1];if(!r||d+s+t>n.width){u.push([e]),d=t;continue}r.push(e),d+=s+t}let f=i*1.5,p=[];return u.forEach((t,r)=>{let c=t.reduce((e,t,n)=>e+l(t.name)+(n>0?s:0),0),u=n.y+i*.6+r*f,d=n.x+Math.max(0,(n.width-c)/2);for(let n of t)p.push({kind:`rect`,x:d,y:u,width:a,height:a,fill:n.color,rx:2,testId:`chart-legend`}),p.push(q(e,d+a+o,u+a/2,n.name,{anchor:`start`})),d+=l(n.name)+s}),{prims:p,height:i*.6+u.length*f}}function J(e,t,n){return Pe(e,t.series.map(e=>({name:e.name,color:e.color})),n)}function Y(e,t,n){return t.name?`${e}\n${t.name}: ${n}`:e?`${e}: ${n}`:n}function Fe(e,t){let n=10**Math.floor(Math.log10(e)),r=e/n,i;return i=t?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10,i*n}function X(e,t,n){let r=Math.min(0,Number.isFinite(e)?e:0),i=Math.max(0,Number.isFinite(t)?t:0);r===i&&(i=r+1);let a=Fe(Fe(i-r,!1)/Math.max(1,n),!0),o=Math.floor(r/a)*a,s=Math.ceil(i/a)*a,c=[];for(let e=o;e<=s+a*.5;e+=a)c.push(e);return{min:o,max:s,step:a,ticks:c}}function Ie(e,t,n,r){for(let i of n.ticks){let a=r.valueOf(i),o=Math.abs(i)<n.step*1e-6,s=r.tickLine(a);e.push({kind:`line`,x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:o?W:U,width:1}),e.push(r.tickText(a,ke(i,n.step,t.numberFormat)))}for(let t=0;t<r.count;t+=1)e.push(r.categoryText(t,r.padAlongStart+r.slot*(t+.5)))}function Le(e,t,n,r,i,a){let o=Math.max(1,r.series.length),s=a.slot*.18,c=a.slot-s*2;if(i){let i=r.categories.map(()=>0),o=r.categories.map(()=>0);for(let l=0;l<a.count;l+=1){let u=a.padAlongStart+a.slot*l+s;r.series.forEach((s,d)=>{let f=s.values[l]??0,p=f>=0?i[l]:o[l],m=p+f,h=a.valueOf(p),g=a.valueOf(m),_=a.barRect(u,c,h,g);e.push({kind:`rect`,x:_.x,y:_.y,width:_.width,height:_.height,fill:R(n,d),rx:2,testId:`chart-bar`});let v=a.stackedValueText(_,f,V(f,n.numberFormat));v&&e.push(v);let y=a.stackedTip(_,h,g);t.push({x:_.x,y:_.y,width:_.width,height:_.height,tipX:y.tipX,tipY:y.tipY,label:Y(r.categories[l],s,V(f,n.numberFormat))}),f>=0?i[l]=m:o[l]=m})}return}let l=o>1?c*.08:0,u=(c-l*(o-1))/o;for(let i=0;i<a.count;i+=1){let o=a.padAlongStart+a.slot*i+s;r.series.forEach((s,c)=>{let d=s.values[i]??0,f=o+c*(u+l),p=a.barRect(f,u,a.base,a.valueOf(d));e.push({kind:`rect`,x:p.x,y:p.y,width:p.width,height:p.height,fill:s.color,rx:2,testId:`chart-bar`});let m=a.groupedValueText(p,d,V(d,n.numberFormat));m&&e.push(m);let h=a.groupedTip(p,d);t.push({x:p.x,y:p.y,width:p.width,height:p.height,tipX:h.tipX,tipY:h.tipY,label:Y(r.categories[i],s,V(d,n.numberFormat))})})}}function Re(e,t,n,r,i,a){let o=n.fontSize,{padLeft:s,slot:c,yOf:l,baseY:u}=a,d=n.chartType===`scatter`,f=r.categories.map(()=>0);r.series.forEach(a=>{let p=a.values.map((e,t)=>{let n=i?f[t]+e:e;return{x:s+c*(t+.5),y:l(n)}});if(n.chartType===`area`){let t=i?f.map(e=>l(e)):r.categories.map(()=>u);e.push({kind:`path`,d:He(p,t),fill:a.color,fillOpacity:i?1:.55,testId:`chart-area`})}d||e.push({kind:`polyline`,points:p,stroke:a.color,width:2.5,testId:`chart-line`}),p.forEach((i,s)=>{n.chartType===`line`&&e.push({kind:`circle`,cx:i.x,cy:i.y,r:3.5,fill:G,stroke:a.color,width:2}),d&&e.push({kind:`circle`,cx:i.x,cy:i.y,r:4.5,fill:a.color,stroke:G,width:1.5,testId:`chart-dot`});let l=a.values[s]??0;n.showValues&&e.push(q(n,i.x,i.y-7,V(l,n.numberFormat),{size:o*.85,baseline:`auto`,testId:`chart-value`})),t.push({x:i.x-c*.4,y:Math.min(i.y,u)-6,width:c*.8,height:Math.abs(u-i.y)+12,tipX:i.x,tipY:i.y,label:Y(r.categories[s],a,V(l,n.numberFormat))})}),a.values.forEach((e,t)=>{f[t]+=e})})}function ze(e,t,n){let r=e.fontSize,i=(e.chartType===`bar`||e.chartType===`area`)&&!!e.stacked,a=J(e,t,n),o=n.y+a.height,s=i?B(t):{min:t.min,max:t.max},c=X(s.min,s.max,4),l=c.ticks.map(t=>ke(t,c.step,e.numberFormat)),u=Math.max(...l.map(e=>e.length)),d=e.showTitles&&e.yTitle?r*2.1:0,f=e.showTitles&&e.xTitle?r*1.6:0,p=n.x+d+u*r*.6+10,m=n.x+n.width-12,h=o+r*.6,g=Math.max(1,m-p),_=t.categories.length,v=g/Math.max(1,_),y=e=>e.length*r*.55,b=t.categories.reduce((e,t)=>Math.max(e,y(t)),0)>v*.95,x=t.categories,S=r+12;if(b){let e=40*Math.PI/180,i=Math.max(r*2,(n.height*.42-12)/Math.sin(e)),a=Math.max(3,Math.floor(i/(r*.55)));x=t.categories.map(e=>H(e,a));let o=x.reduce((e,t)=>Math.max(e,y(t)),0);S=Math.sin(e)*o+14}let C=n.y+n.height-S-f,w=c.max-c.min||1,T=Math.max(1,C-h),E=e=>C-(e-c.min)/w*T,D=E(0),O={count:_,slot:v,padAlongStart:p,valueOf:E,base:D,barRect:(e,t,n,r)=>({x:e,y:Math.min(n,r),width:t,height:Math.abs(r-n)}),tickLine:e=>({x1:p,y1:e,x2:m,y2:e}),tickText:(t,n)=>K(e,p-6,t,n,{anchor:`end`}),categoryText:(n,r)=>b?K(e,r,C+8,x[n],{anchor:`end`,rotate:-40}):K(e,r,C+6,t.categories[n],{baseline:`hanging`}),stackedValueText:(t,n,i)=>e.showValues&&t.height>r?K(e,t.x+t.width/2,t.y+t.height/2,i,{size:r*.85,color:G,testId:`chart-value`}):null,groupedValueText:(t,n,i)=>e.showValues?q(e,t.x+t.width/2,(n>=0?t.y:t.y+t.height)-(n>=0?4:-r),i,{size:r*.85,baseline:`auto`,testId:`chart-value`}):null,stackedTip:e=>({tipX:e.x+e.width/2,tipY:e.y}),groupedTip:e=>({tipX:e.x+e.width/2,tipY:e.y})},k=[...a.prims,...Be(e,{padLeft:p,padRight:m,padBottom:C,padTop:h,box:n})],A=[];return Ie(k,e,c,O),e.chartType===`line`||e.chartType===`area`||e.chartType===`scatter`?(Re(k,A,e,t,i,{padLeft:p,slot:v,yOf:E,baseY:D}),{prims:k,marks:A}):(Le(k,A,e,t,i,O),{prims:k,marks:A})}function Be(e,t){if(!e.showTitles)return[];let n=e.fontSize,r=[];if(e.xTitle&&r.push(q(e,(t.padLeft+t.padRight)/2,t.box.y+t.box.height-n*.4,e.xTitle,{baseline:`auto`})),e.yTitle){let i=(t.padTop+t.padBottom)/2,a=t.box.x+n*.8;r.push(q(e,a,i,e.yTitle,{rotate:-90}))}return r}function Ve(e,t,n){let r=e.fontSize,i=!!e.stacked,a=J(e,t,n),o=n.y+a.height,s=i?B(t):{min:t.min,max:t.max},c=X(s.min,s.max,4),l=e=>e.length*r*.55,u=Math.min(n.width*.35,t.categories.reduce((e,t)=>Math.max(e,l(t)),0)),d=Math.max(3,Math.floor(u/(r*.55))),f=t.categories.map(e=>H(e,d)),p=e.showTitles&&e.yTitle?r*2.1:0,m=e.showTitles&&e.xTitle?r*1.6:0,h=n.x+p+u+14,g=n.x+n.width-14,_=o+r*.4,v=n.y+n.height-(r+10)-m,y=Math.max(1,g-h),b=Math.max(1,v-_),x=c.max-c.min||1,S=e=>h+(e-c.min)/x*y,C=S(0),w=t.categories.length,T={count:w,slot:b/Math.max(1,w),padAlongStart:_,valueOf:S,base:C,barRect:(e,t,n,r)=>({x:Math.min(n,r),y:e,width:Math.abs(r-n),height:t}),tickLine:e=>({x1:e,y1:_,x2:e,y2:v}),tickText:(t,n)=>K(e,t,v+6,n,{baseline:`hanging`}),categoryText:(t,n)=>K(e,h-8,n,f[t],{anchor:`end`}),stackedValueText:()=>null,groupedValueText:(t,n,i)=>e.showValues?q(e,(n>=0?t.x+t.width:t.x)+(n>=0?4:-4),t.y+t.height/2,i,{size:r*.85,anchor:n>=0?`start`:`end`,testId:`chart-value`}):null,stackedTip:(e,t,n)=>({tipX:(t+n)/2,tipY:e.y}),groupedTip:e=>({tipX:e.x+e.width,tipY:e.y+e.height/2})},E=[...a.prims,...Be(e,{padLeft:h,padRight:g,padBottom:v,padTop:_,box:n})],D=[];return Ie(E,e,c,T),Le(E,D,e,t,i,T),{prims:E,marks:D}}function He(e,t){return`${e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `)} ${e.map((e,n)=>`L ${e.x} ${t[n]}`).reverse().join(` `)} Z`}function Ue(e,t,n,r,i){let a={x:e+n*Math.cos(r),y:t+n*Math.sin(r)},o={x:e+n*Math.cos(i),y:t+n*Math.sin(i)},s=+(i-r>Math.PI);return`M ${e} ${t} L ${a.x} ${a.y} A ${n} ${n} 0 ${s} 1 ${o.x} ${o.y} Z`}function We(e,t,n,r,i,a){let o=(n,r)=>({x:e+n*Math.cos(r),y:t+n*Math.sin(r)}),s=o(n,i),c=o(n,a),l=o(r,a),u=o(r,i),d=+(a-i>Math.PI);return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} 1 ${c.x} ${c.y} L ${l.x} ${l.y} A ${r} ${r} 0 ${d} 0 ${u.x} ${u.y} Z`}function Ge(e,t,n){let r=e.fontSize,i=t.series[0],a=Pe(e,t.categories.map((e,t)=>({name:e,color:I[t%I.length]})),n),o=[...a.prims],s=[];if(!i)return{prims:o,marks:s};let c=i.values.reduce((e,t)=>e+Math.max(0,t),0),l=n.y+a.height,u=n.x+n.width/2,d=l+(n.y+n.height-l)/2,f=Math.max(8,Math.min(n.width,n.y+n.height-l)/2-r),p=e.chartType===`donut`?f*.58:0;if(c<=0)return{prims:o,marks:s};let m=-Math.PI/2;return i.values.forEach((n,a)=>{let l=Math.max(0,n)/c*Math.PI*2;if(l<=0)return;let h=I[a%I.length],g=p>0?We(u,d,f,p,m,m+l):Ue(u,d,f,m,m+l);o.push({kind:`path`,d:g,fill:h,testId:`chart-slice`});let _=m+l/2,v=p>0?(f+p)/2:f*.62,y=u+v*Math.cos(_),b=d+v*Math.sin(_);l>.25&&o.push(K(e,y,b,Ae(n,c,e.numberFormat),{size:r*.9,color:G,testId:`chart-value`}));let x=Math.round(n/c*100),S=V(n,e.numberFormat===`currency`?`currency`:`number`);s.push({x:y-r,y:b-r,width:r*2,height:r*2,tipX:y,tipY:b-r,label:Y(t.categories[a]??``,i,`${S} (${x}%)`)}),m+=l}),{prims:o,marks:s}}function Ke(e){let t=[];for(let r of e.cells.slice(1)){let e=String(r[1]??``).trim(),i=String(r[2]??``).trim();!e&&!i||t.push({label:r[0]??``,x:n(L(e)),y:n(L(i))})}return t}function Z(e){let t=(e??``).trim();if(!t)return{low:``,high:``};let n=/^(.*?)\s*(?:→|-->|->)\s*(.*)$/.exec(t);return n?{low:n[1].trim(),high:n[2].trim()}:{low:t,high:``}}function qe(e,t){let n=e.trim(),r=t.trim();return n&&r?`${n} → ${r}`:n?`${n} →`:r?`→ ${r}`:``}var Je=[I[1],I[0],I[4],I[2]];function Ye(e,t,n,r){return`M ${e} ${t} L ${n} ${t} L ${n} ${r} L ${e} ${r} Z`}function Xe(e,t){let n=e.fontSize,r=[],i=[],a=Z(e.xTitle),o=Z(e.yTitle),s=!!(a.low||a.high),c=!!(o.low||o.high),l=t.x+(c?n*1.9:n*.6),u=t.x+t.width-n*.8,d=t.y+n*.6,f=t.y+t.height-(s?n*1.9:n*.8),p=Math.max(1,u-l),m=Math.max(1,f-d),h=l+p/2,g=d+m/2,_=e=>l+e*p,v=e=>f-e*m,y=t=>e.quadrantColors?.[t]??Je[t],b=[{rect:[h,d,u,g],tint:y(0),label:e.quadrantLabels?.[0]},{rect:[l,d,h,g],tint:y(1),label:e.quadrantLabels?.[1]},{rect:[l,g,h,f],tint:y(2),label:e.quadrantLabels?.[2]},{rect:[h,g,u,f],tint:y(3),label:e.quadrantLabels?.[3]}];for(let e of b){let[t,n,i,a]=e.rect;r.push({kind:`path`,d:Ye(t,n,i,a),fill:e.tint,fillOpacity:.1,testId:`chart-quadrant-zone`})}r.push({kind:`path`,d:Ye(l,d,u,f),stroke:W,width:1}),r.push({kind:`line`,x1:h,y1:d,x2:h,y2:f,stroke:W,width:1}),r.push({kind:`line`,x1:l,y1:g,x2:u,y2:g,stroke:W,width:1});for(let t of b){if(!t.label)continue;let[i,a,o]=t.rect,s=Math.max(3,Math.floor((o-i)/(n*.55)));r.push(q(e,(i+o)/2,a+n*1.1,H(t.label,s),{testId:`chart-quadrant-label`}))}a.high?(r.push(K(e,(l+h)/2,f+n*.9,a.low,{baseline:`hanging`})),r.push(K(e,(h+u)/2,f+n*.9,a.high,{baseline:`hanging`}))):a.low&&r.push(K(e,h,f+n*.9,a.low,{baseline:`hanging`}));let x=t.x+n*1;o.high?(r.push(K(e,x,(g+f)/2,o.low,{rotate:-90})),r.push(K(e,x,(d+g)/2,o.high,{rotate:-90}))):o.low&&r.push(K(e,x,g,o.low,{rotate:-90}));let S=R(e,0);for(let t of Ke(e)){let a=_(t.x),o=v(t.y);if(r.push({kind:`circle`,cx:a,cy:o,r:5,fill:S,stroke:G,width:1.5,testId:`chart-quadrant-point`}),t.label){let i=t.x>.72;r.push(q(e,a+(i?-9:9),o,t.label,{size:n*.85,anchor:i?`end`:`start`,testId:`chart-quadrant-point-label`}))}let s=`(${V(t.x,`number`)}, ${V(t.y,`number`)})`;i.push({x:a-n,y:o-n,width:n*2,height:n*2,tipX:a,tipY:o,label:t.label?`${t.label}\n${s}`:s})}return{prims:r,marks:i}}function Q(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function Ze(e){let n=f(e),i={x:0,y:0,width:n.width,height:n.height},o={x:e.flipX,y:e.flipY},c=s(e.kind,i,e.corner,o),u=l(e.kind,i,e.corner,o),d=a(e.fill,e.fillStyle??`pastel`,e.shadow,e.stroke),p=e.kind===`fork-join`?e.color:d.fill,m=e.kind===`fork-join`?1:d.fillOpacity,h=e.kind===`fork-join`?e.color:d.stroke,g=t(e.dash,e.strokeWidth),_=r(n);return{shadow:d.shadow?{tag:`path`,attrs:{d:c,transform:`translate(${_} ${_})`,fill:`#000000`,"fill-opacity":.18,stroke:`none`}}:null,fill:p===`none`?null:{tag:`path`,attrs:{d:c,fill:p,"fill-opacity":m,stroke:`none`}},strokes:e.dash===`none`?[]:b(e).map(t=>({tag:`path`,attrs:{d:t,fill:`none`,stroke:h,"stroke-width":e.strokeWidth,"stroke-dasharray":g.strokeDasharray,"stroke-linecap":g.strokeLinecap,"stroke-linejoin":`round`}})),fillPath:c,hitPath:u}}function Qe(e){let t=f(e);return{shadow:{tag:`rect`,attrs:{x:4,y:4,width:t.width,height:t.height,rx:2,fill:`#000000`,"fill-opacity":C}},card:{tag:`rect`,attrs:{width:t.width,height:t.height,rx:2,fill:e.fill}}}}function $e(e){let n=f(e),r=e.fill&&e.fill!==`transparent`?e.fill:`none`,i=e.kind??`simple`,a=c(e),o=a.strokeWidth,s=t(a.dash,o),l=a.dash===`none`;if(i===`simple`)return{outline:{tag:`rect`,attrs:{x:n.x,y:n.y,width:n.width,height:n.height,rx:10,fill:r,stroke:l?`none`:e.color,"stroke-opacity":.55,"stroke-width":o,"stroke-dasharray":s.strokeDasharray,"stroke-linecap":s.strokeLinecap}},chrome:[]};let{border:u,details:d}=w(i,n,e.lanes,e.laneSizes),p={fill:`none`,stroke:e.color,"stroke-opacity":.55,"stroke-width":o,"stroke-dasharray":s.strokeDasharray,"stroke-linecap":s.strokeLinecap,"stroke-linejoin":`round`},m=l?[]:[u,...d].flatMap((t,n)=>_(t,e,n).map(e=>({tag:`path`,attrs:{d:e,...p}})));return{outline:{tag:`rect`,attrs:{x:n.x,y:n.y,width:n.width,height:n.height,rx:T(i,n),fill:r,stroke:`none`}},chrome:m}}function et(e){let n=e.type===`line`&&e.color===`transparent`?h:e.color,r=t(e.dash,e.strokeWidth),i=e.type===`arrow`?S(e):g(e),a=e.type===`arrow`?y(e):x(e);return{strokes:i.map(t=>({tag:`path`,attrs:{d:t,fill:`none`,stroke:n,"stroke-width":e.strokeWidth,"stroke-linecap":r.strokeLinecap,"stroke-linejoin":`round`,"stroke-dasharray":r.strokeDasharray}})),heads:a.map(t=>({tag:`path`,attrs:{d:t.d,fill:v(t.fill,n),stroke:n,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`}}))}}function $(e,t){if(e.length===0)return``;if(e.length<3||!t){let[t,...n]=e;return`M ${t.x} ${t.y}${n.map(e=>` L ${e.x} ${e.y}`).join(``)} Z`}let n=t=>e[(t+e.length)%e.length],r=`M ${n(0).x} ${n(0).y}`;for(let t=0;t<e.length;t+=1){let e=n(t-1),i=n(t),a=n(t+1),o=n(t+2),s={x:i.x+(a.x-e.x)/6,y:i.y+(a.y-e.y)/6},c={x:a.x-(o.x-i.x)/6,y:a.y-(o.y-i.y)/6};r+=` C ${s.x} ${s.y} ${c.x} ${c.y} ${a.x} ${a.y}`}return`${r} Z`}function tt(e){return{tag:`path`,attrs:{d:o(e),fill:e.color===`transparent`?h:e.color}}}var nt=Q(Ze),rt=Q(Qe),it=Q($e),at=Q(et);function ot(e,t,n){let r=e.fontSize,i=J(e,t,n),a=[...i.prims],o=[],s=t.categories.length;if(s<1)return{prims:a,marks:o};let c=n.y+i.height,l=n.x+n.width/2,u=c+(n.y+n.height-c)/2,d=Math.max(8,Math.min(n.width,n.y+n.height-c)/2-r*2.4),f=X(t.min,t.max,4),p=f.max-f.min||1,m=e=>e/s*Math.PI*2-Math.PI/2,h=(e,t)=>{let n=(t-f.min)/p*d,r=m(e);return{x:l+n*Math.cos(r),y:u+n*Math.sin(r)}};for(let e of f.ticks){let n=(e-f.min)/p*d;if(n<=.5)continue;let r=t.categories.map((e,t)=>{let r=m(t);return{x:l+n*Math.cos(r),y:u+n*Math.sin(r)}});a.push({kind:`path`,d:$(r),stroke:U,width:1,testId:`chart-radar-grid`})}for(let n=0;n<s;n+=1){let i=m(n),o={x:l+d*Math.cos(i),y:u+d*Math.sin(i)};a.push({kind:`line`,x1:l,y1:u,x2:o.x,y2:o.y,stroke:U,width:1});let s=l+(d+r*.8)*Math.cos(i),c=u+(d+r*.8)*Math.sin(i),f=Math.abs(Math.cos(i))<.3?`middle`:Math.cos(i)>0?`start`:`end`;a.push(K(e,s,c,t.categories[n],{anchor:f}))}return t.series.forEach(n=>{let i=n.values.map((e,t)=>h(t,e));a.push({kind:`path`,d:$(i),fill:n.color,fillOpacity:.18,stroke:n.color,width:2,testId:`chart-radar-area`}),i.forEach((i,s)=>{a.push({kind:`circle`,cx:i.x,cy:i.y,r:3,fill:n.color,stroke:G,width:1.5});let c=n.values[s]??0;o.push({x:i.x-r,y:i.y-r,width:r*2,height:r*2,tipX:i.x,tipY:i.y,label:Y(t.categories[s]??``,n,V(c,e.numberFormat))})})}),{prims:a,marks:o}}var st=`chart-empty`;function ct(e,t){return{prims:[K(e,t.x+t.width/2,t.y+t.height/2,`No data. Double-click to edit`,{testId:st})],marks:[]}}function lt(e){let t=Me(e);if(!we(e))return ct(e,t);let n=z(e),r=Ne(e,t),i=r.box,a=e.chartType===`quadrant`?Xe(e,i):e.chartType===`pie`||e.chartType===`donut`?Ge(e,n,i):e.chartType===`radar`?ot(e,n,i):e.chartType===`bar`&&e.horizontal?Ve(e,n,i):ze(e,n,i);return{prims:[...r.prims,...a.prims],marks:a.marks}}function ut(e){return lt(e).prims}export{ge as A,he as C,le as D,ue as E,xe as F,be as M,ee as N,me as O,Se as P,oe as S,ce as T,pe as _,tt as a,_e as b,nt as c,Z as d,qe as f,O as g,Ee as h,at as i,N as j,fe as k,rt as l,z as m,ut as n,it as o,I as p,lt as r,$ as s,st as t,Je as u,de as v,P as w,M as x,ne as y};
@@ -1 +1 @@
1
- import{o as e}from"./editor-BeufBV54.js";var t=16,n={slides:272,ai:340,code:360,flow:300};function r(e){return e===null?0:n[e]}function i(e){return e===null?t:n[e]+t}function a(){return e(e=>e.deviceMode===`phone`?`sheet`:`docked`)}export{i as n,a as r,r as t};
1
+ import{o as e}from"./editor-DAJETlQW.js";var t=16,n={slides:272,ai:340,code:360,flow:300};function r(e){return e===null?0:n[e]}function i(e){return e===null?t:n[e]+t}function a(){return e(e=>e.deviceMode===`phone`?`sheet`:`docked`)}export{i as n,a as r,r as t};
@@ -0,0 +1,18 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{Fn as n}from"./useScrollLock-CQpr0n6U.js";import{t as r}from"./jsx-runtime-DKdBMi_L.js";import{t as i}from"./tooltip-CKCG8vcp.js";import{a,o}from"./editor-DAJETlQW.js";import{N as s,t as c}from"./reflow-C6bvnSVm.js";import{C as l}from"./shapes-D5w8NTQQ.js";import{A as u,C as d,_ as f,x as p}from"./slides-DDNzjFz9.js";import{A as m,E as h,M as g,O as _,S as v,T as y,b as ee,g as te,j as b}from"./registry-d5KleeyB.js";import{n as ne}from"./renderer-environment-D3n3hbug.js";import{t as x}from"./icons-DzW1j-r3.js";import{t as re}from"./diagram-fingerprint-B-HB8UbR.js";import{t as ie}from"./createReactComponent-C51FAx3B.js";import{t as ae}from"./IconAlertTriangle-B33xznYN.js";import{t as oe}from"./IconCode-CHIz1nCU.js";import{t as se}from"./IconX-KrRqxr2j.js";import{n as ce,t as le}from"./storage-CvDRYh5V.js";import{a as ue}from"./chrome-C2RCq3SI.js";import{i as de,n as fe,r as pe,t as me}from"./DialogRoot-DUeVfNhS.js";import{n as he,t as ge}from"./DialogTitle-D5au2NAn.js";import{n as _e}from"./dialog-DnXgEbpz.js";import{r as ve}from"./chrome-layout-D5dql-y4.js";import{t as ye}from"./panel-shell-COqmheb-.js";import{t as be}from"./layout-offthread-JPTCbsLL.js";import{n as xe,t as Se}from"./export-u442sUQs.js";import{r as S}from"./flows-CGl4r-xb.js";import{_ as C,a as Ce,b as w,c as we,d as Te,f as T,g as E,h as D,i as O,l as Ee,m as k,n as De,o as Oe,p as A,r as ke,s as j,t as Ae,u as je,v as M,y as N}from"./generate-DHP90nDk.js";import{n as P}from"./icon-catalog-CbUlEKtK.js";var Me=ie(`outline`,`book`,`Book`,[[`path`,{d:`M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0`,key:`svg-0`}],[`path`,{d:`M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0`,key:`svg-1`}],[`path`,{d:`M3 6l0 13`,key:`svg-2`}],[`path`,{d:`M12 6l0 13`,key:`svg-3`}],[`path`,{d:`M21 6l0 13`,key:`svg-4`}]]),F=e(t(),1);function I(e){let t=l(e);return t?{x:t.x+t.width+160,y:t.y}:null}var L=e(n(),1),R=[...D,...M],z=new Set(Object.keys(v).filter(e=>!te.includes(e))),B=[...w.filter(e=>!z.has(e)),`chart`],V=[`title`,`direction`,`icons`],H=[`right`,`down`,`left`,`up`],U=[`badge`,`inside`],W=[`group`,`screen`,`note`,`legend`,`loop`,`alt`,`else`,`opt`,`par`,`and`,`break`,`activate`,`deactivate`,`central`],Ne=[`icon`,`color`,`shape`,`fill`,`colorMode`,`corner`,`frame`,`label`,`labelColor`,`group`,`link`,`head`,`width`,`value`,`score`],Pe=[`full`,`half`,`third`,`two-thirds`],Fe=new Set([...Object.keys(v),`mindmap`,...h,`chart`,...V,...W,...A]),G=[`drawnicons`,`aws`,`gcp`,`azure`,`tech`,`mood`,`emoji`],Ie={drawnicons:`Library`,aws:`AWS`,gcp:`GCP`,azure:`Azure`,tech:`Tech`,mood:`Mood`,emoji:`Emoji`},K=[`server`,`database`,`user`,`cloud`,`queue`,`globe`,`lock`,`mail`];function q(e,t,n){return e.map(e=>({label:e,detail:t,insert:n?n(e):void 0}))}var J=G.map(e=>({label:`${e}/`,detail:`${Ie[e]} icons`,insert:`${e}/`}));function Le(e){let t=q(e?P:K,`icon`);return[...J,...t]}function Re(e,t,n,r,i,a){let o=a?.entries(e);if(!o)return{from:n,to:r,query:i,options:[]};let s=t.toLowerCase(),c=[],l=[];for(let t of o){let n={label:`${e}/${t.slug}`,detail:t.name,iconUrl:a?.iconUrl(e,t.slug)},r=t.slug.toLowerCase(),i=t.name.toLowerCase();!s||r.startsWith(s)||i.startsWith(s)?c.push(n):(r.includes(s)||i.includes(s))&&l.push(n)}return{from:n,to:r,query:i,options:[...c,...l].slice(0,80)}}var ze={color:q(_,`colour`),labelcolor:q(_,`colour`),textcolor:q(_,`colour`),shape:q(g,`shape`),fill:q(b,`fill`),colormode:q(b,`fill`),corner:q(m,`corner`),corners:q(m,`corner`),frame:q(y,`frame`),head:q(ee,`head`),width:q(Pe,`width`)};function Be(e,t){return e===`icon`?Le(t):ze[e]??null}function Ve(e){return[...q(Ne,`key`,e=>`${e}: `),...q(_,`colour`),...q(g,`shape`),...q(b,`fill`),...q(m,`corner`),...q([`shadow`,`flow`,`invisible`],`flag`),...q(y,`frame`),...J,...q(e?P:K,`icon`)]}function He(e){for(let t of e.split(`
2
+ `)){let e=t.trim();if(!e||e.startsWith(`//`))continue;let n=e.toLowerCase().split(/\s+/)[0];return v[n]||(n===`chart`||w.includes(n)?n:`architecture`)}return`architecture`}var Ue=new RegExp(C.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).concat(`,`,`=`).join(`|`));function We(e){let t=new Set;for(let n of e.split(`
3
+ `)){let e=n.replace(/\/\/.*$/,``).trim();if(!e)continue;let r=e.toLowerCase().split(/\s+/)[0];if(!Fe.has(r)){e=e.replace(/\[[^\]]*\]/g,``).replace(/:.*/,``);for(let n of e.split(Ue)){let e=n.trim();e&&/[A-Za-z]/.test(e)&&e.length<=40&&t.add(e)}}}return[...t]}function Ge(e,t){if(!t)return e;let n=t.toLowerCase(),r=[],i=[];for(let t of e){let e=t.label.toLowerCase();e.startsWith(n)?r.push(t):e.includes(n)&&i.push(t)}return[...r,...i]}function Y(e,t,n,r){let i=Ge(r,n).slice(0,80);return i.length===0?null:{from:e,to:t,query:n,options:i}}function Ke(e,t,n){let r=e.lastIndexOf(`
4
+ `,t-1)+1,i=e.slice(r,t);if(/^\s*direction\s*:\s*\w*$/i.test(i)){let e=/\w*$/.exec(i)?.[0]??``;return Y(t-e.length,t,e,q(H,`direction`))}if(/^\s*icons\s*:\s*\w*$/i.test(i)){let e=/\w*$/.exec(i)?.[0]??``;return Y(t-e.length,t,e,q(U,`icons`))}let a=i.lastIndexOf(`[`);if(a>i.lastIndexOf(`]`)){let e=i.slice(a+1).split(`,`).pop()??``,r=e.match(/([a-zA-Z][\w-]*)\s*:\s*([\w/-]*)$/),o=r?r[1].toLowerCase():null,s=r?r[2]:/[\w/-]*$/.exec(e)?.[0]??``,c=t-s.length,l=/^([a-z]+)\/(.*)$/.exec(s);if(l&&G.includes(l[1]))return Re(l[1],l[2],c,t,s,n);if(o){let e=Be(o,s);if(e)return Y(c,t,s,e)}return Y(c,t,s,Ve(s))}let o=/[\w/-]*$/.exec(i)?.[0]??``,c=t-o.length,l=i.replace(/^\s+/,``),u=!/\s/.test(l),d=He(e),f=We(e);if(u){let e=[...q(B,`family`),...q(V,`directive`,e=>`${e}: `)];return d===`wireframe`?(e.push(q([`screen`],`block`)[0]),e.push(...q(s,`control`,e=>`${e}: `))):d===`sequence`?e.push(...q([`note`,`loop`,`alt`,`opt`,`par`,`break`,`activate`,`deactivate`],`block`)):d===`erd`?e.push(...q(R,`cardinality`,e=>`${e} `)):d===`mindmap`?e.push(...q([`central`],`directive`,()=>`central: `)):d===`gitgraph`?e.push(...q([`commit`,`branch`,`checkout`,`merge`,`cherry-pick`],`block`,e=>e===`commit`?e:`${e} `)):d===`gantt`?(e.push(q([`section`],`block`,e=>`${e} `)[0]),e.push(q([`excludes`],`directive`,()=>`excludes: weekends`)[0])):d===`journey`||d===`timeline`?e.push(q([`section`],`block`,e=>`${e} `)[0]):d===`venn`?e.push(q([`overlap`],`block`,e=>`${e} `)[0]):d===`sankey`||d===`chart`||e.push(...q([`group`,`legend`],`block`)),e.push(...q(f,`node`)),Y(c,t,o,e)}return Y(c,t,o,[...q(C,`connector`,e=>`${e} `),...q(d===`erd`?R:[],`cardinality`,e=>`${e} `),...q(f,`node`)])}var qe=new Set([...w,...T,`quadrant-1`,`quadrant-2`,`quadrant-3`,`quadrant-4`,`group`,`screen`,`note`,`loop`,`alt`,`opt`,`par`,`break`,`and`,`else`,`activate`,`deactivate`,`legend`,`title`,`direction`,`icons`,`kanban`,`central`,`root`,`center`,`categories`,`x-axis`,`y-axis`,`stacked`,`horizontal`,`section`,`overlap`,`excludes`,`commit`,`branch`,`checkout`,`switch`,`merge`,`cherry-pick`]),Je=new Set([...C,...E,...N]);function Ye(e){return Je.has(e)||e.toLowerCase()in k}function Xe(e,t){for(let n of t.split(/(\[[^\]]*\])/g))if(n){if(n.startsWith(`[`)&&n.endsWith(`]`)){e.push({kind:`attribute`,text:n});continue}for(let t of n.split(/(\s+)/))t&&e.push({kind:Ye(t)?`connector`:`plain`,text:t})}}function Ze(e,t){let n=-1;for(let e=0;e<t.length-1;e+=1)if(t[e]===`/`&&t[e+1]===`/`){let r=e===0?` `:t[e-1];if(/\s/.test(r)){n=e;break}}let r=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n):``,a=r.match(/^(\s*)([A-Za-z][\w-]*)([\s\S]*)$/);a&&qe.has(a[2].toLowerCase())?(a[1]&&e.push({kind:`plain`,text:a[1]}),e.push({kind:`keyword`,text:a[2]}),Xe(e,a[3])):Xe(e,r),i&&e.push({kind:`comment`,text:i})}function Qe(e){let t=[];for(let n of e.split(`
5
+ `))Ze(t,n),t.push({kind:`plain`,text:`
6
+ `});return t}var X=r(),$e={plain:null,keyword:`text-violet-600 dark:text-violet-400`,connector:`text-sky-600 dark:text-sky-400`,attribute:`text-amber-700 dark:text-amber-300`,comment:`text-[var(--chrome-fg-400)] italic`};function et(e){return(0,X.jsx)(X.Fragment,{children:Qe(e.code).map((e,t)=>{let n=$e[e.kind];return n?(0,X.jsx)(`span`,{className:n,children:e.text},t):(0,X.jsx)(F.Fragment,{children:e.text},t)})})}var tt=[`aws`,`gcp`,`azure`,`tech`];function nt(){let[e,t]=(0,F.useState)(0),n=(0,F.useRef)(!0);(0,F.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);let r=(0,F.useCallback)(e=>{x().cachedAssetIndex(e)||x().loadAssetIndex(e).then(()=>{n.current&&t(e=>e+1)}).catch(()=>void 0)},[]);return(0,F.useEffect)(()=>{for(let e of tt)r(e)},[r]),{snapshot:(0,F.useMemo)(()=>({entries(e){let t=x().cachedAssetIndex(e);return t?t.map(e=>({name:e[0],slug:e[1],keywords:e[2]})):(r(e),null)},iconUrl(e,t){return x().assetIconUrl(e,t)}}),[r]),iconsVersion:e}}var rt=`'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`,Z=12,Q=20,$=12,it=60,at={margin:0,border:0,padding:$,fontFamily:rt,fontSize:Z,lineHeight:`${Q}px`,fontVariantLigatures:`none`,fontFeatureSettings:`"liga" 0, "calt" 0`,tabSize:2,whiteSpace:`pre`,overflowWrap:`normal`,wordBreak:`normal`},ot=0;function st(){let e=typeof document<`u`?document.fonts:void 0;if(!e)return!0;try{return e.check(`${Z}px 'JetBrains Mono'`)}catch{return!0}}function ct(){if(ot)return ot;let e=document.createElement(`canvas`).getContext(`2d`);if(!e)return Z*.6;e.font=`${Z}px ${rt}`;let t=e.measureText(`M`).width||Z*.6;return st()&&(ot=t),t}function lt(e,t){let n=e.value,r=n.lastIndexOf(`
7
+ `,t-1)+1,i=n.slice(0,t).split(`
8
+ `).length-1,a=t-r,o=e.getBoundingClientRect();return{left:o.left+$+a*ct()-e.scrollLeft,top:o.top+$+(i+1)*Q-e.scrollTop}}function ut(e){let t=(0,F.useRef)(null),n=(0,F.useRef)(null),r=(0,F.useRef)(``),i=(0,F.useRef)(0),a=(0,F.useRef)(null),o=(0,F.useRef)(()=>void 0),[s,c]=(0,F.useState)(null),l=(0,F.useRef)(null),{snapshot:u,iconsVersion:d}=nt();(0,F.useEffect)(()=>{o.current(!1)},[d]),(0,F.useLayoutEffect)(()=>{if(a.current!=null&&t.current){let e=a.current;t.current.selectionStart=e,t.current.selectionEnd=e,a.current=null}f()});function f(){let e=t.current,i=n.current;if(!e||!i)return!1;let a=`translate(${-e.scrollLeft}px, ${-e.scrollTop}px)`;return a===r.current?!1:(r.current=a,i.style.transform=a,!0)}function p(){f()&&c(e=>{let n=t.current;if(!e||!n)return e;let r=lt(n,n.selectionStart);return r.left===e.left&&r.top===e.top?e:{...e,...r}})}function m(){cancelAnimationFrame(i.current),i.current=requestAnimationFrame(()=>{p(),document.activeElement===t.current&&m()})}(0,F.useEffect)(()=>()=>cancelAnimationFrame(i.current),[]),(0,F.useImperativeHandle)(e.handleRef,()=>({revealLine(e){let n=t.current;if(!n)return;let r=O(n.value,e);if(!r)return;n.focus({preventScroll:!0}),n.setSelectionRange(r.start,r.end);let i=$+(e-1)*Q,a=i+Q;(i<n.scrollTop||a>n.scrollTop+n.clientHeight)&&(n.scrollTop=Math.max(0,i-n.clientHeight/2)),n.scrollLeft=0,c(null),f()}}));function h(e){let n=t.current;if(!n)return;let r=n.selectionStart;if(r!==n.selectionEnd){c(null);return}let i=Ke(n.value,r,u),a=n.value.slice(0,r),o=i!=null&&i.options.length===1&&i.options[0].label.toLowerCase()===i.query.toLowerCase(),s=e||i!=null&&!o&&(i.query.length>=1||a.endsWith(`[`));if(!i||!s){c(null);return}let l=lt(n,r);c({from:i.from,to:i.to,options:i.options.slice(0,it),index:0,left:l.left,top:l.top})}function g(n){let r=t.current;if(!r)return;let i=r.selectionStart,o=r.value,s=Ke(o,i,u),l=s?s.from:i,d=n.insert??n.label,f=o.slice(0,l)+d+o.slice(i);a.current=l+d.length,c(null),e.onChange(f),requestAnimationFrame(()=>h(!1))}o.current=h;function _(t){if(t.stopPropagation(),t.key===`Enter`&&(t.metaKey||t.ctrlKey)){t.preventDefault(),c(null),e.onGenerate();return}if(t.key===` `&&t.ctrlKey||t.key===`Escape`&&s){if(t.key===`Escape`){t.preventDefault(),c(null);return}t.preventDefault(),h(!0);return}if(s){if(t.key===`ArrowDown`){t.preventDefault(),c({...s,index:(s.index+1)%s.options.length});return}if(t.key===`ArrowUp`){t.preventDefault(),c({...s,index:(s.index-1+s.options.length)%s.options.length});return}(t.key===`Enter`||t.key===`Tab`)&&(t.preventDefault(),g(s.options[s.index]))}}return(0,F.useEffect)(()=>{if(!s)return;let e=t.current;if(!e)return;let n=lt(e,e.selectionStart);(n.left!==s.left||n.top!==s.top)&&c({...s,left:n.left,top:n.top})},[e.value,s]),(0,F.useLayoutEffect)(()=>{let e=l.current;if(!s||!e)return;e.style.left=`8px`;let t=e.getBoundingClientRect(),n=Math.max(8,Math.min(s.left,window.innerWidth-t.width-8)),r=s.top+t.height<=window.innerHeight-8?s.top:Math.max(8,s.top-t.height-Q);e.style.left=`${n}px`,e.style.top=`${r}px`},[s]),(0,X.jsxs)(`div`,{className:`relative overflow-hidden ${e.className??``}`,children:[(0,X.jsx)(`pre`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden text-[var(--chrome-fg-900)]`,style:{margin:0},children:(0,X.jsx)(`code`,{ref:n,style:{...at,display:`block`},children:(0,X.jsx)(et,{code:e.value})})}),(0,X.jsx)(`textarea`,{ref:t,value:e.value,spellCheck:!1,wrap:`off`,autoCapitalize:`off`,autoCorrect:`off`,"data-testid":`code-input`,placeholder:e.placeholder,onChange:t=>{e.onChange(t.target.value),requestAnimationFrame(()=>h(!1))},onKeyDown:_,onScroll:p,onFocus:m,onBlur:()=>c(null),onClick:()=>c(null),className:`absolute inset-0 resize-none bg-transparent text-transparent caret-[var(--chrome-fg-900)] outline-none`,style:at}),s&&(0,L.createPortal)((0,X.jsx)(`ul`,{ref:l,className:`fixed z-50 max-h-56 min-w-44 max-w-80 overflow-y-auto rounded-lg bg-[var(--chrome-popup)] py-1 shadow-lg ring-1 ring-[var(--chrome-ring)]`,style:{left:s.left,top:s.top,fontFamily:rt,fontSize:12},role:`listbox`,onPointerDown:e=>e.preventDefault(),children:s.options.map((e,t)=>(0,X.jsxs)(`li`,{role:`option`,"aria-selected":t===s.index,onPointerDown:t=>{t.preventDefault(),g(e)},onPointerEnter:()=>c(e=>e&&{...e,index:t}),className:`flex cursor-pointer items-center gap-2.5 px-2.5 py-1 ${t===s.index?`bg-[var(--chrome-hover)] text-[var(--chrome-fg-900)]`:`text-[var(--chrome-fg-700)]`}`,children:[e.iconUrl&&(0,X.jsx)(`img`,{src:e.iconUrl,alt:``,loading:`lazy`,className:`h-4 w-4 shrink-0 object-contain`}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label}),(0,X.jsx)(`span`,{className:`ml-auto shrink-0 truncate text-[10px] text-[var(--chrome-fg-400)]`,children:e.detail})]},`${e.label}-${t}`))}),document.body)]})}function dt(e,t){switch(t.type){case`load`:return{code:t.code,linked:t.linked,diagnostics:[],result:null,errorGate:!1};case`edit`:return{...e,code:t.code};case`report`:return{...e,diagnostics:t.diagnostics??e.diagnostics,result:t.result===void 0?e.result:t.result};case`gate`:return{...e,diagnostics:[],errorGate:!0};case`ungate`:return e.errorGate?{...e,errorGate:!1}:e;case`link`:return{...e,linked:t.linked}}}var ft=96,pt=`// Describe a diagram as code.
9
+ // Full syntax guide at koboyo.com/docs
10
+ title: My pipeline
11
+
12
+ API Gateway [aws/api-gateway]
13
+ Resize fn [aws/lambda, green]
14
+ Postgres [cylinder, blue]
15
+
16
+ API Gateway -> Resize fn: upload
17
+ Resize fn --> Postgres: async write
18
+ `;function mt(){return le.getString(ce.diagramCode)??pt}function ht(e,t,n){let r=I(e);if(r)return r;let i=d({x:n.width/2,y:n.height/2},t);return{x:i.x-400,y:i.y-250}}function gt(e){let{containerRef:t}=e,{store:n,viewportAnimation:r,history:s}=a(),l=ne(),{beginTransaction:d,endTransaction:m}=s,h=o(e=>e.rightPanel===`code`),g=o(e=>e.selectedIds),{addMany:_,removeShapes:v,setCodeOpen:y,setViewport:ee}=n.getState(),[te,b]=(0,F.useReducer)(dt,void 0,()=>({code:mt(),diagnostics:[],result:null,errorGate:!1,linked:null})),{code:x,diagnostics:ie,result:S,errorGate:C,linked:w}=te,[T,E]=(0,F.useState)(!1),D=(0,F.useRef)(null),[O,k]=(0,F.useState)(null),[A,M]=(0,F.useState)(`next`);(0,F.useEffect)(()=>{w||le.setString(ce.diagramCode,x)},[x,w]);let N=(0,F.useRef)(w);N.current=w;let P=(0,F.useRef)(x);P.current=x,(0,F.useEffect)(()=>{if(!h||g.size!==1)return;let e=[...g][0];if(N.current?.frameId===e)return;let t=n.getState().shapes,r=u(t,e);if(!r||r.type!==`figure`&&r.type!==`chart`||typeof r.code!=`string`||!r.code.trim())return;let i=N.current;if(i){let e=u(t,i.frameId);if(e&&(e.type===`figure`||e.type===`chart`)&&e.code!==P.current)return}b({type:`load`,code:r.code,linked:{frameId:r.id,label:(r.type===`chart`?r.title:r.label)||(r.type===`chart`?`Chart`:`Diagram`),stale:re(t,r)}})},[h,g,n]);let I=(0,F.useRef)(null),L=o(e=>e.codeSeed),R=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(!h)return;let e=L===null?null:n.getState().codeSeed;e!==null&&(n.getState().setCodeSeed(null),R.current=e,b({type:`load`,code:e,linked:null}));let t=I.current;!t||R.current===null||R.current!==x||(R.current=null,t())},[h,L,x,n]);let z=(0,F.useDeferredValue)(x),B=(0,F.useMemo)(()=>Te(Ee(z).source).diagnostics,[z]),V=ke(B).length,H=C&&V>0,U=H?B:ie;(0,F.useEffect)(()=>{V===0&&b({type:`ungate`})},[V]);let W=ve()===`docked`;if(!h)return null;function Ne(){b({type:`load`,code:mt(),linked:null})}let Pe=()=>{let e=t.current,n=e?.clientWidth??window.innerWidth,r=e?.clientHeight??window.innerHeight;return{width:Math.max(1,n-(W?360:0)),height:r}};function Fe(e){r.animate(n.getState().viewport,p(e,Pe(),ft),ee)}let G=we(x);function Ie(){if(!G)return;let e=je(x,G);b({type:`edit`,code:e.code}),b({type:`report`,diagnostics:e.diagnostics,result:e.code===x?null:`Converted from ${j[G]}.`})}function K(e,t){return t.type===`figure`?[t,...f(e,t)]:[t]}async function q(e){let t=n.getState();if(!t.viewMode){if(e.target){if(re(t.shapes,e.target)&&!e.force){let n=l.theme.palette(),[r,i]=await Promise.all([xe(K(t.shapes,e.target),l,{padding:20,background:n.bg,palette:n}),xe(c(e.shapes),l,{padding:20,background:n.bg,palette:n})]);M(`next`),k({current:Se(r),next:Se(i)});return}let n=_t(t.shapes,e.target,e.shapes,e.primary);d(),v(new Set(K(t.shapes,e.target).map(e=>e.id))),_(n),m()}else _(e.shapes);e.primary?(b({type:`link`,linked:{frameId:e.primary.id,label:e.label,stale:!1}}),n.getState().setSelectedIds(new Set([e.primary.id]))):e.target&&b({type:`link`,linked:null}),Fe(e.bounds),b({type:`report`,result:`${e.target?`Updated`:`Added`} ${e.summary}.`}),W||y(!1)}}async function J(e={}){if(!(T||n.getState().viewMode)){E(!0),b({type:`report`,result:null});try{let t=De(x);t.converted&&t.converted.code!==x&&b({type:`edit`,code:t.converted.code});let r=n.getState(),i=w?u(r.shapes,w.frameId):void 0,a=i&&(i.type===`figure`||i.type===`chart`)?i:void 0,o=await Ae(t,{origin:a?{x:a.x,y:a.y}:ht(r.shapes,r.viewport,Pe()),layout:be,allowErrors:H||!!e.skipErrors,icons:Oe(l.icons)});if(o.status===`gated`){b({type:`gate`});return}if(b({type:`ungate`}),w&&!a&&b({type:`link`,linked:null}),b({type:`report`,diagnostics:o.diagnostics}),o.status===`empty`){b({type:`report`,result:`Nothing to draw yet. Add a node or an edge.`});return}await q({target:a,shapes:o.shapes,primary:o.primary,label:o.label,bounds:o.bounds,summary:o.summary,force:e.force??!1})}catch(e){b({type:`report`,diagnostics:[],result:_e(e,`Couldn't draw this. Check the code and try again.`)})}finally{E(!1)}}}return I.current=J,(0,X.jsxs)(ye,{width:360,testId:`code-panel`,ariaLabel:`Diagram as code`,onDismiss:()=>y(!1),children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between py-2 pl-4 pr-2`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[14px] text-[var(--chrome-fg-900)]`,children:[(0,X.jsx)(oe,{size:15,stroke:1.75}),`Diagram as code`]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,X.jsx)(i,{label:`Syntax guide`,side:`bottom`,children:(0,X.jsx)(`a`,{href:`/docs`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Syntax guide`,"data-testid":`code-docs-link`,className:ue,children:(0,X.jsx)(Me,{size:16,stroke:1.75})})}),(0,X.jsx)(i,{label:`Hide code panel`,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Hide code panel`,"data-testid":`code-close`,onClick:()=>y(!1),className:ue,children:(0,X.jsx)(se,{size:16,stroke:1.75})})})]})]}),(0,X.jsx)(`div`,{className:`mx-3 h-px bg-[var(--chrome-divider)]`}),w&&(0,X.jsxs)(`div`,{"data-testid":`code-linked-chip`,"data-stale":w.stale?`true`:`false`,className:`mx-3 mt-2 flex items-start justify-between gap-2 rounded-lg px-2.5 py-1.5 text-[12px] ${w.stale?`bg-amber-50 text-amber-800`:`bg-[var(--chrome-hover)] text-[var(--chrome-fg-700)]`}`,children:[(0,X.jsx)(`span`,{className:`text-pretty`,children:w.stale?`“${w.label}” was edited on the canvas. Updating from this code replaces those edits.`:`Editing “${w.label}”. Generating replaces it.`}),(0,X.jsx)(i,{label:`Back to the draft`,side:`bottom`,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`Stop editing this diagram`,"data-testid":`code-unlink`,onClick:Ne,className:`shrink-0 rounded-md p-0.5 transition-[background-color,scale] active:scale-[0.96] ${w.stale?`hover:bg-amber-100`:`hover:bg-[var(--chrome-rest)]`}`,children:(0,X.jsx)(se,{size:14,stroke:1.75})})})]}),G&&(0,X.jsxs)(`div`,{"data-testid":`code-foreign-hint`,className:`mx-3 mt-2 flex items-center justify-between gap-2 rounded-lg bg-amber-50 px-2.5 py-1.5 text-[12px] text-amber-800`,children:[(0,X.jsxs)(`span`,{className:`min-w-0`,children:[`Looks like `,j[G],`.`]}),(0,X.jsx)(`button`,{type:`button`,"data-testid":`code-foreign-convert`,onClick:Ie,className:`shrink-0 whitespace-nowrap rounded-md px-1.5 py-0.5 text-amber-900 underline decoration-amber-400 transition-[background-color,scale] hover:bg-amber-100 active:scale-[0.96]`,children:`Convert now`})]}),(0,X.jsx)(ut,{handleRef:D,value:x,onChange:e=>b({type:`edit`,code:e}),onGenerate:()=>void J(),placeholder:`API -> Worker: job`,className:`m-3 flex-1 rounded-lg text-[12px] leading-relaxed ring-1 ring-[var(--chrome-ring)] focus-within:ring-black/25`}),(U.length>0||S)&&(0,X.jsxs)(`div`,{className:`mx-3 mb-2 flex max-h-32 flex-col gap-1 overflow-y-auto`,children:[S&&(0,X.jsx)(`div`,{"data-testid":`code-result`,className:`text-pretty text-[12px] text-[var(--chrome-fg-600)]`,children:S}),U.map((e,t)=>(0,X.jsxs)(`button`,{type:`button`,"data-testid":`code-diagnostic`,"data-severity":e.severity??`warning`,disabled:e.line<=0,onClick:()=>D.current?.revealLine(e.line),className:`-mx-1 rounded px-1 text-left text-pretty text-[12px] leading-snug tabular-nums transition-colors enabled:hover:bg-[var(--chrome-hover)] ${e.severity===`error`?`text-red-600`:`text-amber-700`}`,children:[e.line>0?`Line ${e.line}: `:``,e.message]},`${e.line}-${t}`))]}),(0,X.jsxs)(`div`,{className:`border-t border-[var(--chrome-ring)] p-3`,children:[H&&(0,X.jsxs)(`div`,{role:`status`,"data-testid":`code-error-gate`,className:`mb-2 flex items-start gap-1.5 rounded-lg bg-red-50 px-2.5 py-1.5 text-[12px] text-[var(--chrome-danger)] dark:bg-red-500/10`,children:[(0,X.jsx)(ae,{size:14,stroke:1.75,className:`mt-px shrink-0`}),(0,X.jsx)(`span`,{className:`text-pretty tabular-nums`,children:Ce(V)})]}),(0,X.jsx)(`button`,{type:`button`,"data-testid":`code-generate`,disabled:T||x.trim().length===0,onClick:()=>void J(),className:`w-full rounded-lg bg-[var(--chrome-accent)] px-3 py-2 text-[13px] text-white transition-[background-color,scale] hover:bg-[var(--chrome-accent-hover)] active:scale-[0.96] disabled:bg-[var(--chrome-rest)] disabled:active:scale-100`,children:T?`Generating…`:H?`Apply anyway`:w?`Update diagram`:G?`Convert ${j[G]} & generate`:`Generate diagram`}),(0,X.jsx)(`p`,{className:`mt-1.5 text-center text-[11px] text-[var(--chrome-fg-400)]`,children:`⌘↵ generates · the code stays for tweaking`})]}),O&&(0,X.jsx)(me,{open:!0,onOpenChange:e=>!e&&k(null),children:(0,X.jsxs)(fe,{children:[(0,X.jsx)(de,{className:`fixed inset-0 z-40 bg-gray-900/25`}),(0,X.jsxs)(pe,{"data-overlay":!0,"data-testid":`code-replace-dialog`,className:`fixed left-1/2 top-1/2 z-50 flex max-h-[92dvh] w-[min(860px,94vw)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-2xl bg-[var(--chrome-popup)] p-5 shadow-[0_24px_70px_rgba(0,0,0,0.22)] outline-none ring-1 ring-[var(--chrome-ring)]`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(ge,{className:`text-[15px] font-medium text-[var(--chrome-fg-900)]`,children:`Replace your edits?`}),(0,X.jsx)(`p`,{className:`mt-1 text-[13px] leading-snug text-[var(--chrome-fg-600)]`,children:`This diagram was edited on the canvas after its code was generated. Compare both, then keep your edits or replace them with the code.`})]}),(0,X.jsx)(he,{"aria-label":`Close`,className:`-mr-1 -mt-1 shrink-0 rounded-lg p-1 text-[var(--chrome-fg-500)] outline-none transition-colors hover:bg-[var(--chrome-hover)]`,children:(0,X.jsx)(se,{size:16,stroke:1.75})})]}),(0,X.jsx)(`div`,{role:`tablist`,className:`mt-4 inline-flex self-start rounded-lg bg-[var(--chrome-rest)] p-0.5 text-[12.5px]`,children:[{key:`next`,label:`Code version`},{key:`current`,label:`Already on Canvas`}].map(e=>(0,X.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":A===e.key,onClick:()=>M(e.key),className:`rounded-md px-3 py-1 transition-colors ${A===e.key?`bg-[var(--chrome-popup)] text-[var(--chrome-fg-900)] shadow-sm`:`text-[var(--chrome-fg-500)] hover:text-[var(--chrome-fg-800)]`}`,children:e.label},e.key))}),(0,X.jsxs)(`div`,{className:`mt-3 flex min-h-0 flex-1 items-center justify-center overflow-auto rounded-xl bg-[var(--canvas-bg)] p-4 ring-1 ring-[var(--chrome-ring)] [min-height:clamp(260px,56vh,520px)]`,children:[(0,X.jsx)(`img`,{src:O.current,alt:`Your edits`,className:`max-h-full max-w-full object-contain ${A===`current`?``:`hidden`}`}),(0,X.jsx)(`img`,{src:O.next,alt:`Code version`,className:`max-h-full max-w-full object-contain ${A===`next`?``:`hidden`}`})]}),(0,X.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,X.jsx)(`p`,{className:`text-[12px] text-[var(--chrome-fg-500)]`,children:A===`current`?`What you have on the canvas.`:`Rebuilt from the code. You can undo this.`}),A===`current`?(0,X.jsx)(he,{className:`rounded-lg bg-[var(--chrome-rest)] px-3.5 py-2 text-[13px] text-[var(--chrome-fg-800)] outline-none ring-1 ring-[var(--chrome-ring)] transition-[background-color,scale] hover:bg-[var(--chrome-hover)] active:scale-[0.96]`,children:`Keep my edits`}):(0,X.jsx)(`button`,{type:`button`,"data-testid":`code-confirm-replace`,onClick:()=>{k(null),J({force:!0,skipErrors:!0})},className:`rounded-lg bg-[var(--chrome-accent)] px-3.5 py-2 text-[13px] text-white outline-none transition-[background-color,scale] hover:bg-[var(--chrome-accent-hover)] active:scale-[0.96]`,children:`Apply my Code Changes`})]})]})]})})]})}function _t(e,t,n,r){if(t.type!==`figure`||!t.flows?.length||r?.type!==`figure`)return n;let{flows:i}=S(e,t,n,r);return n.map(e=>e===r?{...r,flows:i}:e)}export{gt as CodePanel};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./shapes-D5w8NTQQ.js";var n={width:140,height:100},r=16,i=8;function a(a,o,s){let c=Math.min(a.length,i),l=Math.ceil(a.length/i),u=c*n.width+(c-1)*r,d=l*n.height+(l-1)*r,f=Math.round(o.x-u/2),p=Math.round(o.y-d/2),m=a.length>1?e():void 0;return a.map((e,a)=>{let o=a%i,c=Math.floor(a/i);return t({x:f+o*(n.width+r),y:p+c*(n.height+r),width:n.width,height:n.height,label:e.name?`${e.name}\n${e.value}`:e.value,fontFamily:s.fontFamily,fontSize:16,fill:e.hex,...m?{groupId:m}:{}})})}export{a as createColorSwatches};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{s as r}from"./editor-BeufBV54.js";import{t as i}from"./IconSearch-CCpMt02s.js";import{n as a}from"./keys-DrjiT9FL.js";import{n as o}from"./surface-Dke4SWpE.js";import{i as s,n as c,r as l,t as u}from"./DialogRoot-DUeVfNhS.js";var d=e(t(),1),f=n();function p(e){let{commands:t,onRun:n,placeholder:o,inputTestId:s,itemTestId:c,emptyLabel:l,dense:u}=e,p=r(),[m,h]=(0,d.useState)(``),[g,_]=(0,d.useState)(0),v=(0,d.useRef)(null),y=e.inputRef??v,b=(0,d.useRef)(null),x=m.trim().toLowerCase(),S=(0,d.useMemo)(()=>x?t.filter(e=>`${e.label} ${e.group} ${e.keywords??``}`.toLowerCase().includes(x)):t,[t,x]);(0,d.useEffect)(()=>{_(0)},[x]),(0,d.useEffect)(()=>{e.inputRef||p.getState().coarsePointer||v.current?.focus()},[e.inputRef,p]),(0,d.useEffect)(()=>{b.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[g]);function C(e){if(e.key===`ArrowDown`)e.preventDefault(),_(e=>Math.min(e+1,S.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),_(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=S[g];t&&n(t)}}return(0,f.jsxs)(`div`,{className:`flex min-h-0 flex-col ${e.className??``}`,children:[(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--chrome-ring)] ${u?`px-3`:`px-3.5`}`,children:[(0,f.jsx)(i,{size:15,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,f.jsx)(`input`,{ref:y,"data-testid":s,value:m,onChange:e=>h(e.target.value),onKeyDown:C,placeholder:o,className:`w-full bg-transparent text-[13.5px] text-[var(--chrome-fg-900)] outline-none placeholder:text-[var(--chrome-fg-400)] ${u?`py-2`:`py-2.5`}`})]}),(0,f.jsx)(`div`,{ref:b,className:`scrollbar-slim overflow-y-auto ${e.listClassName??``}`,children:S.length===0?(0,f.jsx)(`div`,{className:`px-3 py-6 text-center text-[12.5px] text-[var(--chrome-fg-400)]`,children:l}):S.map((e,t)=>{let r=e.icon;return(0,f.jsxs)(`div`,{children:[!x&&(t===0||S[t-1].group!==e.group)?(0,f.jsx)(`div`,{className:`px-2 pb-0.5 text-[10.5px] font-medium uppercase tracking-wide text-[var(--chrome-fg-400)] ${u?`pt-1.5`:`pt-2`}`,children:e.group},`h-${e.group}`):null,(0,f.jsxs)(`button`,{type:`button`,"data-testid":c(e.id),"data-active":t===g,onMouseEnter:()=>_(t),onClick:()=>n(e),className:`flex w-full items-center rounded-lg px-2 text-left transition-colors ${u?`gap-2 py-1`:`gap-2.5 py-1.5`} ${t===g?`bg-[var(--chrome-hover)]`:`hover:bg-[var(--chrome-rest)]`}`,children:[(0,f.jsx)(`span`,{className:`flex shrink-0 items-center justify-center ${u?`h-5 w-5`:`h-6 w-6`} ${t===g?`text-[var(--chrome-fg-700)]`:`text-[var(--chrome-fg-500)]`}`,children:r?(0,f.jsx)(r,{size:15,stroke:1.75}):null}),(0,f.jsx)(`span`,{className:`flex-1 truncate text-[13px] text-[var(--chrome-fg-800)]`,children:e.label}),e.hint?(0,f.jsx)(`span`,{className:`shrink-0 rounded-md bg-[var(--chrome-divider)] px-1.5 py-0.5 text-[11px] text-[var(--chrome-fg-500)]`,children:a(e.hint)}):null]})]},e.id)})})]})}function m(e){let{open:t,onOpenChange:n,commands:r}=e,i=(0,d.useRef)(null);function a(e){n(!1),e.run()}return(0,f.jsx)(u,{open:t,onOpenChange:n,children:(0,f.jsxs)(c,{children:[(0,f.jsx)(s,{className:`fixed inset-0 bg-gray-900/15`}),(0,f.jsx)(l,{initialFocus:i,"data-overlay":!0,"data-testid":`command-palette`,className:`fixed left-1/2 top-[16%] w-[min(500px,92vw)] -translate-x-1/2 overflow-hidden rounded-xl outline-none ${o.popup}`,children:(0,f.jsx)(p,{commands:r,onRun:a,placeholder:`Search commands…`,inputTestId:`command-palette-input`,itemTestId:e=>`command-${e}`,emptyLabel:`No matching commands`,inputRef:i,listClassName:`max-h-[48vh] p-1.5`})})]})})}export{p as CommandList,m as CommandPalette};
1
+ 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{s as r}from"./editor-DAJETlQW.js";import{t as i}from"./IconSearch-CCpMt02s.js";import{n as a}from"./keys-DrjiT9FL.js";import{n as o}from"./surface-Dke4SWpE.js";import{i as s,n as c,r as l,t as u}from"./DialogRoot-DUeVfNhS.js";var d=e(t(),1),f=n();function p(e){let{commands:t,onRun:n,placeholder:o,inputTestId:s,itemTestId:c,emptyLabel:l,dense:u}=e,p=r(),[m,h]=(0,d.useState)(``),[g,_]=(0,d.useState)(0),v=(0,d.useRef)(null),y=e.inputRef??v,b=(0,d.useRef)(null),x=m.trim().toLowerCase(),S=(0,d.useMemo)(()=>x?t.filter(e=>`${e.label} ${e.group} ${e.keywords??``}`.toLowerCase().includes(x)):t,[t,x]);(0,d.useEffect)(()=>{_(0)},[x]),(0,d.useEffect)(()=>{e.inputRef||p.getState().coarsePointer||v.current?.focus()},[e.inputRef,p]),(0,d.useEffect)(()=>{b.current?.querySelector(`[data-active="true"]`)?.scrollIntoView({block:`nearest`})},[g]);function C(e){if(e.key===`ArrowDown`)e.preventDefault(),_(e=>Math.min(e+1,S.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),_(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=S[g];t&&n(t)}}return(0,f.jsxs)(`div`,{className:`flex min-h-0 flex-col ${e.className??``}`,children:[(0,f.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--chrome-ring)] ${u?`px-3`:`px-3.5`}`,children:[(0,f.jsx)(i,{size:15,stroke:1.75,className:`shrink-0 text-[var(--chrome-fg-400)]`}),(0,f.jsx)(`input`,{ref:y,"data-testid":s,value:m,onChange:e=>h(e.target.value),onKeyDown:C,placeholder:o,className:`w-full bg-transparent text-[13.5px] text-[var(--chrome-fg-900)] outline-none placeholder:text-[var(--chrome-fg-400)] ${u?`py-2`:`py-2.5`}`})]}),(0,f.jsx)(`div`,{ref:b,className:`scrollbar-slim overflow-y-auto ${e.listClassName??``}`,children:S.length===0?(0,f.jsx)(`div`,{className:`px-3 py-6 text-center text-[12.5px] text-[var(--chrome-fg-400)]`,children:l}):S.map((e,t)=>{let r=e.icon;return(0,f.jsxs)(`div`,{children:[!x&&(t===0||S[t-1].group!==e.group)?(0,f.jsx)(`div`,{className:`px-2 pb-0.5 text-[10.5px] font-medium uppercase tracking-wide text-[var(--chrome-fg-400)] ${u?`pt-1.5`:`pt-2`}`,children:e.group},`h-${e.group}`):null,(0,f.jsxs)(`button`,{type:`button`,"data-testid":c(e.id),"data-active":t===g,onMouseEnter:()=>_(t),onClick:()=>n(e),className:`flex w-full items-center rounded-lg px-2 text-left transition-colors ${u?`gap-2 py-1`:`gap-2.5 py-1.5`} ${t===g?`bg-[var(--chrome-hover)]`:`hover:bg-[var(--chrome-rest)]`}`,children:[(0,f.jsx)(`span`,{className:`flex shrink-0 items-center justify-center ${u?`h-5 w-5`:`h-6 w-6`} ${t===g?`text-[var(--chrome-fg-700)]`:`text-[var(--chrome-fg-500)]`}`,children:r?(0,f.jsx)(r,{size:15,stroke:1.75}):null}),(0,f.jsx)(`span`,{className:`flex-1 truncate text-[13px] text-[var(--chrome-fg-800)]`,children:e.label}),e.hint?(0,f.jsx)(`span`,{className:`shrink-0 rounded-md bg-[var(--chrome-divider)] px-1.5 py-0.5 text-[11px] text-[var(--chrome-fg-500)]`,children:a(e.hint)}):null]})]},e.id)})})]})}function m(e){let{open:t,onOpenChange:n,commands:r}=e,i=(0,d.useRef)(null);function a(e){n(!1),e.run()}return(0,f.jsx)(u,{open:t,onOpenChange:n,children:(0,f.jsxs)(c,{children:[(0,f.jsx)(s,{className:`fixed inset-0 bg-gray-900/15`}),(0,f.jsx)(l,{initialFocus:i,"data-overlay":!0,"data-testid":`command-palette`,className:`fixed left-1/2 top-[16%] w-[min(500px,92vw)] -translate-x-1/2 overflow-hidden rounded-xl outline-none ${o.popup}`,children:(0,f.jsx)(p,{commands:r,onRun:a,placeholder:`Search commands…`,inputTestId:`command-palette-input`,itemTestId:e=>`command-${e}`,emptyLabel:`No matching commands`,inputRef:i,listClassName:`max-h-[48vh] p-1.5`})})]})})}export{p as CommandList,m as CommandPalette};
@@ -0,0 +1,2 @@
1
+ import{O as e,s as t}from"./style-BENGW2ZV.js";import{It as n,pn as r,rt as i,un as a}from"./shapes-D5w8NTQQ.js";import{Lt as o}from"./slides-DDNzjFz9.js";function s(e){return[{text:e.startLabel??``,end:`start`},{text:e.endLabel??``,end:`end`}].filter(e=>e.text).map(t=>({text:t.text,point:a(e,t.end)}))}function c(t,r,a,o,s){let c=e(o),l=i(t).split(`
2
+ `),u=l.length*a*n,d=Math.max(...l.map(e=>s.measure(e,a,o,c)))+20;return{x:r.x-d/2,y:r.y-u/2,width:d,height:u}}function l(e,n){let i=e.fontFamily??t,a=[];if(e.label){let t=e.type===`arrow`?r(e):o(e.points,e.labelAlong);a.push(c(e.label,t,e.fontSize??20,i,n))}if(e.type===`arrow`)for(let t of s(e))a.push(c(t.text,t.point,14,i,n));return a}export{l as n,s as t};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r}from"./editor-BeufBV54.js";import{t as i}from"./blob-CTPsKWYv.js";import{t as a}from"./IconX-KrRqxr2j.js";import{n as o}from"./surface-Dke4SWpE.js";import{i as s,n as c,r as l,t as u}from"./DialogRoot-DUeVfNhS.js";import{n as d,t as f}from"./DialogTitle-D5au2NAn.js";import{t as p}from"./DialogDescription-Ddhk2rmF.js";import{t as m}from"./dialog-DnXgEbpz.js";var h=e(t(),1),g=n();function _(e){let{image:t,onClose:n}=e,[_,v]=(0,h.useState)(null),y=r(e=>e.deviceMode!==`desktop`);return(0,h.useEffect)(()=>{let e=!0;return i(t).then(t=>e&&v(t),()=>e&&n()),()=>{e=!1}},[t,n]),(0,g.jsx)(u,{open:!0,onOpenChange:e=>{e||n()},children:(0,g.jsxs)(c,{children:[(0,g.jsx)(s,{className:o.dialogBackdrop}),(0,g.jsxs)(l,{"data-overlay":!0,"data-testid":`copy-image-dialog`,className:`flex max-h-[92vh] w-[min(560px,92vw)] flex-col p-5 ${o.dialogPopup}`,children:[(0,g.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,g.jsx)(f,{className:m.title,children:`Copy image`}),(0,g.jsx)(d,{"aria-label":`Close`,className:`-mr-1.5 -mt-1.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[var(--chrome-fg-500)] outline-none transition-colors hover:bg-[var(--chrome-hover)]`,children:(0,g.jsx)(a,{size:16,stroke:2})})]}),(0,g.jsxs)(p,{className:`mt-1 ${m.description}`,children:[`This window can't copy images for you.`,` `,y?`Press and hold the picture, then choose Copy.`:`Right-click the picture and choose Copy Image.`]}),(0,g.jsx)(`div`,{className:`mt-4 flex min-h-0 flex-1 items-center justify-center overflow-auto rounded-lg bg-[var(--chrome-hover)] p-3`,children:_&&(0,g.jsx)(`img`,{src:_,alt:`The copied shapes`,className:`max-h-[60vh] max-w-full object-contain`,"data-testid":`copy-image`})})]})]})})}export{_ as CopyImageDialog};
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{t as n}from"./jsx-runtime-DKdBMi_L.js";import{o as r}from"./editor-DAJETlQW.js";import{t as i}from"./blob-CTPsKWYv.js";import{t as a}from"./IconX-KrRqxr2j.js";import{n as o}from"./surface-Dke4SWpE.js";import{i as s,n as c,r as l,t as u}from"./DialogRoot-DUeVfNhS.js";import{n as d,t as f}from"./DialogTitle-D5au2NAn.js";import{t as p}from"./DialogDescription-Ddhk2rmF.js";import{t as m}from"./dialog-DnXgEbpz.js";var h=e(t(),1),g=n();function _(e){let{image:t,onClose:n}=e,[_,v]=(0,h.useState)(null),y=r(e=>e.deviceMode!==`desktop`);return(0,h.useEffect)(()=>{let e=!0;return i(t).then(t=>e&&v(t),()=>e&&n()),()=>{e=!1}},[t,n]),(0,g.jsx)(u,{open:!0,onOpenChange:e=>{e||n()},children:(0,g.jsxs)(c,{children:[(0,g.jsx)(s,{className:o.dialogBackdrop}),(0,g.jsxs)(l,{"data-overlay":!0,"data-testid":`copy-image-dialog`,className:`flex max-h-[92vh] w-[min(560px,92vw)] flex-col p-5 ${o.dialogPopup}`,children:[(0,g.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,g.jsx)(f,{className:m.title,children:`Copy image`}),(0,g.jsx)(d,{"aria-label":`Close`,className:`-mr-1.5 -mt-1.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[var(--chrome-fg-500)] outline-none transition-colors hover:bg-[var(--chrome-hover)]`,children:(0,g.jsx)(a,{size:16,stroke:2})})]}),(0,g.jsxs)(p,{className:`mt-1 ${m.description}`,children:[`This window can't copy images for you.`,` `,y?`Press and hold the picture, then choose Copy.`:`Right-click the picture and choose Copy Image.`]}),(0,g.jsx)(`div`,{className:`mt-4 flex min-h-0 flex-1 items-center justify-center overflow-auto rounded-lg bg-[var(--chrome-hover)] p-3`,children:_&&(0,g.jsx)(`img`,{src:_,alt:`The copied shapes`,className:`max-h-[60vh] max-w-full object-contain`,"data-testid":`copy-image`})})]})]})})}export{_ as CopyImageDialog};
@@ -0,0 +1 @@
1
+ import{n as e}from"./shapes-D5w8NTQQ.js";import{_ as t}from"./slides-DDNzjFz9.js";function n(e,n){return t(e,n)}function r(e,t){let n=e=>e.steps.length>0,r=e.find(e=>e.id===t&&n(e));if(r)return r;let i=new Set(e.flatMap(e=>e.steps.flatMap(e=>e.branches??[])));return e.find(e=>n(e)&&!i.has(e.id))??e.find(n)??null}function i(e){return e.filter(e=>e.type===`figure`&&(e.flows?.length??0)>0)}function a(e,n){return e.filter(r=>r.type===`figure`&&r.id!==n&&t(e,r).some(e=>e.id===n)).sort((e,t)=>e.width*e.height-t.width*t.height)}function o(e,n){let[r]=n;if(!r)return null;if(n.length===1&&r.type===`figure`)return r;let i=a(e,r.id).at(-1);if(!i)return null;let o=new Set(t(e,i).map(e=>e.id));return n.every(e=>o.has(e.id))?i:null}function s(t,n=[]){let r=new Set(t.map(e=>e.name)),i=t.length+1;for(;r.has(`Flow ${i}`);)i+=1;return{id:e(),name:`Flow ${i}`,steps:n}}export{r as a,s as i,n,i as r,o as t};
@@ -0,0 +1,3 @@
1
+ import"./style-BENGW2ZV.js";import{Zt as e,n as t}from"./shapes-D5w8NTQQ.js";import{_ as n,h as r}from"./slides-DDNzjFz9.js";import{n as i}from"./shape-meta-YgfIm0bQ.js";function a(){return{cells:[[``,`x`,`y`],[`Feature A`,`0.32`,`0.78`],[`Feature B`,`0.74`,`0.7`],[`Feature C`,`0.68`,`0.3`],[`Feature D`,`0.26`,`0.32`]],quadrantLabels:[`Big bets`,`Quick wins`,`Deprioritise`,`Time sinks`],xTitle:`Low Effort → High Effort`,yTitle:`Low Impact → High Impact`,showTitles:!0}}var o={width:360,height:240},s=new Set([`radar`,`quadrant`]);function c(e){return s.has(e)?{width:320,height:320}:o}function l(e,n,r=`bar`){let i=c(r);return{id:t(),type:`chart`,chartType:r,x:e.x,y:e.y,width:i.width,height:i.height,rotation:0,cells:[[``,`Revenue`],[`Jan`,`12`],[`Feb`,`19`],[`Mar`,`9`],[`Apr`,`22`],[`May`,`17`]],fontSize:12,fontFamily:n.fontFamily,color:n.color,opacity:n.opacity,...r===`quadrant`?a():{}}}var u=`arrow`;function d(e,t){return f(t,n(e,t))}function f(e,t){let n=[`frame|${i(e)}`];for(let e of t)n.push(x(e));return n.sort(),S(n.join(`
2
+ `))}function p(e,t){return typeof e.code!=`string`||e.code.trim().length===0||typeof e.codeFingerprint!=`string`?!1:(e.type===`chart`?_(e):t(e))!==e.codeFingerprint}function m(e,t){return p(t,t=>d(e,t))}function h(e,t,n){e.code=t,e.codeFingerprint=e.type===`chart`?_(e):d(n,e)}function g(e){let t=new Set,n=null;for(let i of e)i.type!==`figure`&&i.type!==`chart`||p(i,t=>f(t,(n??=r(e)).members(t)))&&t.add(i.id);return t}function _(e){let t=[e.chartType,e.horizontal?`h`:``,e.stacked?`s`:``,e.showValues?`v`:``,e.title??``,e.xTitle??``,e.yTitle??``,...e.cells.map(e=>e.join(``))];return e.quadrantLabels&&e.quadrantLabels.length>0&&t.push(`quadrants|${e.quadrantLabels.join(`|`)}`),S(t.join(`
3
+ `))}function v(e,t){let n=e[t];return typeof n==`string`||typeof n==`number`?String(n):``}function y(e){if(e.type===`icon`)return`${v(e,`name`)}/${v(e,`source`)}`;let t=e.titleIcon;return t?`${t.name??``}/${t.source??``}`:``}function b(t){let n=[],r=v(t,`fillStyle`);r&&r!==`pastel`&&n.push(`fillStyle:${r}`);let i=v(t,`corner`);i&&i!==e(v(t,`kind`))&&n.push(`corner:${i}`);for(let e of[`flipX`,`flipY`])t[e]===!0&&n.push(`${e}:1`);return(t.type===`arrow`||t.type===`line`)&&(t.dash!==`solid`&&n.push(`dash:${t.dash}`),t.startHead&&t.startHead!==u&&n.push(`startHead:${t.startHead}`),t.endHead&&t.endHead!==u&&n.push(`endHead:${t.endHead}`)),n}function x(e){let t=[e.type,v(e,`kind`),i(e),v(e,`fill`),v(e,`color`),y(e)];if(e.type===`arrow`){let n=e.startBinding?.shapeId??``,r=e.endBinding?.shapeId??``;return[...t,n,r,...b(e)].join(`|`)}return[...t,...b(e)].join(`|`)}function S(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}export{c as a,o as i,g as n,l as o,h as r,m as t};
@@ -1 +1 @@
1
- import{l as e}from"./slides-D686obFO.js";import{W as t}from"./style-BENGW2ZV.js";import{_ as n,a as r,b as i,g as a,h as o,o as s,s as c,t as l}from"./plan-CkgM52Yh.js";function u(e,t){if(t.length===0){let t={...e};return delete t.animations,t}return{...e,animations:[...t]}}function d(){let e=new Map,t=t=>{let n=e.get(t.id);return n||(n={shape:t,next:[...l(t)]},e.set(t.id,n)),n};return{write(e,n,r){t(e).next[n]=r},drop(e,n){t(e).next[n]=null},replace(t,n){e.set(t.id,{shape:t,next:[...n]})},changed(){let t=[];for(let n of e.values()){let e=n.next.filter(e=>e!=null);f(l(n.shape),e)||t.push(u(n.shape,e))}return t}}}function f(e,t){return e.length===t.length&&e.every((e,n)=>v(e,t[n]))}function p(e,t){let n=-1;e.forEach((e,r)=>{(r===0||!e.withPrevious)&&(n+=1);for(let r of e.items)r.animation.step!==n&&t.write(r.shape,r.index,{...r.animation,step:n})})}function m(e){let t=d();return p(e,t),t.changed()}function h(e,n,r){if(n===r||n<0||n>=e.length)return[];let i=[...e],[a]=i.splice(n,1);return i.splice(t(r,0,i.length),0,a),m(i)}function g(e,t,n){let r=e.findIndex(e=>s(e)===t);if(r===-1||r===0&&n===`with`)return[];let i=n===`with`,a=d(),o=e.map((e,t)=>t===r?{...e,withPrevious:i}:e);p(o,a);let c=_(o);for(let t of e[r].items){let e={...t.animation,step:c[r]};n===`after`?e.afterPrevious=!0:delete e.afterPrevious,n===`click`&&delete e.delay,a.write(t.shape,t.index,e)}return a.changed()}function _(e){let t=-1;return e.map((e,n)=>((n===0||!e.withPrevious)&&(t+=1),t))}function v(e,t){return e.kind===t.kind&&e.step===t.step&&e.effect===t.effect&&e.direction===t.direction&&e.duration===t.duration&&e.delay===t.delay&&e.afterPrevious===t.afterPrevious}function y(e,t,n,i=`enter`){let a=i!==`emphasis`,s=new Set(e.flatMap(e=>e.items.filter(e=>e.animation.kind===i).map(e=>e.shape.id))),c=e.length,u=d();for(let e of t){let t=a?e.shapes.filter(e=>!s.has(e.id)):e.shapes;if(t.length!==0){for(let e of t)u.write(e,l(e).length,{kind:i,step:c,effect:n?r(e,n,i):o(e,i)});c+=1}}return u.changed()}function b(e,t){let n=e.findIndex(e=>e.groupId===t);if(n===-1||e[n].items.length<2)return[];let r=e[n].items.map((t,r)=>({items:[t],withPrevious:r===0&&e[n].withPrevious}));return m([...e.slice(0,n),...r,...e.slice(n+1)])}function x(e,t){let n=e=>e.items.some(e=>e.shape.groupId===t),i=e.findIndex(n);if(i===-1)return[];let a={groupId:t,items:e.filter(n).flatMap(e=>e.items),withPrevious:e[i].withPrevious};if(a.items.length<2)return[];let o=e.filter(e=>!n(e)),s=[...o.slice(0,i),a,...o.slice(i)],u=_(s),f=u[Math.min(i,u.length-1)]??0,m=l(c(a).shape),h=d();p(s,h);let g=new Set(a.items.map(e=>e.shape));for(let e of g)h.replace(e,m.map(t=>({...t,effect:r(e,t.effect,t.kind),step:f})));return h.changed()}function S(e,t,n){let i=d();for(let a of e){let e={...a.animation,effect:r(a.shape,t,a.animation.kind)};n===void 0?delete e.duration:e.duration=n,i.write(a.shape,a.index,e)}return i.changed()}function C(e,t){let n=d();for(let r of e){let e={...r.animation};t>0?e.delay=t:delete e.delay,n.write(r.shape,r.index,e)}return n.changed()}function w(e,t){let n=d();for(let r of e)n.write(r.shape,r.index,{...r.animation,direction:t});return n.changed()}function T(e,t){let n=d();for(let i of e)n.write(i.shape,i.index,{...i.animation,kind:t,effect:r(i.shape,i.animation.effect,t)});return n.changed()}function E(e,t){let n=e.findIndex(e=>s(e)===t);if(n===-1)return[];let r=d();for(let t of e[n].items)r.drop(t.shape,t.index);return p(e.filter((e,t)=>t!==n),r),r.changed()}function D(e){let t=d();for(let n of e)for(let e of n.items)t.drop(e.shape,e.index);return t.changed()}function O(t,s,c,l){let u=a(e(t,s),l??n(t,s)),f=d();return i(u,s).forEach((e,t)=>{for(let n of e.shapes)f.replace(n,[{kind:`enter`,step:t,effect:c?r(n,c):o(n)}])}),f.changed()}export{x as a,w as c,g as d,b as f,D as i,S as l,y as n,h as o,E as r,C as s,O as t,T as u};
1
+ import{W as e}from"./style-BENGW2ZV.js";import{l as t}from"./slides-DDNzjFz9.js";import{_ as n,a as r,b as i,g as a,h as o,o as s,s as c,t as l}from"./plan-D4Jyzo5X.js";function u(e,t){if(t.length===0){let t={...e};return delete t.animations,t}return{...e,animations:[...t]}}function d(){let e=new Map,t=t=>{let n=e.get(t.id);return n||(n={shape:t,next:[...l(t)]},e.set(t.id,n)),n};return{write(e,n,r){t(e).next[n]=r},drop(e,n){t(e).next[n]=null},replace(t,n){e.set(t.id,{shape:t,next:[...n]})},changed(){let t=[];for(let n of e.values()){let e=n.next.filter(e=>e!=null);f(l(n.shape),e)||t.push(u(n.shape,e))}return t}}}function f(e,t){return e.length===t.length&&e.every((e,n)=>v(e,t[n]))}function p(e,t){let n=-1;e.forEach((e,r)=>{(r===0||!e.withPrevious)&&(n+=1);for(let r of e.items)r.animation.step!==n&&t.write(r.shape,r.index,{...r.animation,step:n})})}function m(e){let t=d();return p(e,t),t.changed()}function h(t,n,r){if(n===r||n<0||n>=t.length)return[];let i=[...t],[a]=i.splice(n,1);return i.splice(e(r,0,i.length),0,a),m(i)}function g(e,t,n){let r=e.findIndex(e=>s(e)===t);if(r===-1||r===0&&n===`with`)return[];let i=n===`with`,a=d(),o=e.map((e,t)=>t===r?{...e,withPrevious:i}:e);p(o,a);let c=_(o);for(let t of e[r].items){let e={...t.animation,step:c[r]};n===`after`?e.afterPrevious=!0:delete e.afterPrevious,n===`click`&&delete e.delay,a.write(t.shape,t.index,e)}return a.changed()}function _(e){let t=-1;return e.map((e,n)=>((n===0||!e.withPrevious)&&(t+=1),t))}function v(e,t){return e.kind===t.kind&&e.step===t.step&&e.effect===t.effect&&e.direction===t.direction&&e.duration===t.duration&&e.delay===t.delay&&e.afterPrevious===t.afterPrevious}function y(e,t,n,i=`enter`){let a=i!==`emphasis`,s=new Set(e.flatMap(e=>e.items.filter(e=>e.animation.kind===i).map(e=>e.shape.id))),c=e.length,u=d();for(let e of t){let t=a?e.shapes.filter(e=>!s.has(e.id)):e.shapes;if(t.length!==0){for(let e of t)u.write(e,l(e).length,{kind:i,step:c,effect:n?r(e,n,i):o(e,i)});c+=1}}return u.changed()}function b(e,t){let n=e.findIndex(e=>e.groupId===t);if(n===-1||e[n].items.length<2)return[];let r=e[n].items.map((t,r)=>({items:[t],withPrevious:r===0&&e[n].withPrevious}));return m([...e.slice(0,n),...r,...e.slice(n+1)])}function x(e,t){let n=e=>e.items.some(e=>e.shape.groupId===t),i=e.findIndex(n);if(i===-1)return[];let a={groupId:t,items:e.filter(n).flatMap(e=>e.items),withPrevious:e[i].withPrevious};if(a.items.length<2)return[];let o=e.filter(e=>!n(e)),s=[...o.slice(0,i),a,...o.slice(i)],u=_(s),f=u[Math.min(i,u.length-1)]??0,m=l(c(a).shape),h=d();p(s,h);let g=new Set(a.items.map(e=>e.shape));for(let e of g)h.replace(e,m.map(t=>({...t,effect:r(e,t.effect,t.kind),step:f})));return h.changed()}function S(e,t,n){let i=d();for(let a of e){let e={...a.animation,effect:r(a.shape,t,a.animation.kind)};n===void 0?delete e.duration:e.duration=n,i.write(a.shape,a.index,e)}return i.changed()}function C(e,t){let n=d();for(let r of e){let e={...r.animation};t>0?e.delay=t:delete e.delay,n.write(r.shape,r.index,e)}return n.changed()}function w(e,t){let n=d();for(let r of e)n.write(r.shape,r.index,{...r.animation,direction:t});return n.changed()}function T(e,t){let n=d();for(let i of e)n.write(i.shape,i.index,{...i.animation,kind:t,effect:r(i.shape,i.animation.effect,t)});return n.changed()}function E(e,t){let n=e.findIndex(e=>s(e)===t);if(n===-1)return[];let r=d();for(let t of e[n].items)r.drop(t.shape,t.index);return p(e.filter((e,t)=>t!==n),r),r.changed()}function D(e){let t=d();for(let n of e)for(let e of n.items)t.drop(e.shape,e.index);return t.changed()}function O(e,s,c,l){let u=a(t(e,s),l??n(e,s)),f=d();return i(u,s).forEach((e,t)=>{for(let n of e.shapes)f.replace(n,[{kind:`enter`,step:t,effect:c?r(n,c):o(n)}])}),f.changed()}export{x as a,w as c,g as d,b as f,D as i,S as l,y as n,h as o,E as r,C as s,O as t,T as u};