koboyo 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/assets/editor/assets/ContextMenuTrigger-C6XZ9rqq.js +1 -0
- package/assets/editor/assets/{IconHelp-CaEwHrsN.js → IconHelp-Bf6OkQYw.js} +2 -2
- package/assets/editor/assets/IconReplace-CYUD1RLF.js +1 -0
- package/assets/editor/assets/IconSquare-Ce_qY-mF.js +1 -0
- package/assets/editor/assets/MenuSubmenuTrigger-CTLO1z_0.js +1 -0
- package/assets/editor/assets/{PopoverPopup-B3Y0VRYc.js → PopoverPopup-CvnB7nJs.js} +1 -1
- package/assets/editor/assets/asset-glyph-Dxg-7b67.js +1 -0
- package/assets/editor/assets/build-pips-DsgLkk6R.js +1 -0
- package/assets/editor/assets/build-visibility-0Y4EP2Ka.js +1 -0
- package/assets/editor/assets/builders-hABCgtrj.js +1 -0
- package/assets/editor/assets/{chrome-layout-BzPU9far.js → chrome-layout-500Q9pcx.js} +1 -1
- package/assets/editor/assets/code-panel-CHMqHqc6.js +18 -0
- package/assets/editor/assets/color-swatches-BC1-16T-.js +1 -0
- package/assets/editor/assets/{command-palette-BR-_ChOL.js → command-palette-BNj4FPOh.js} +1 -1
- package/assets/editor/assets/connector-labels-piWvprqQ.js +2 -0
- package/assets/editor/assets/{copy-image-dialog-BzGP7Xw8.js → copy-image-dialog-BdQfoSGr.js} +1 -1
- package/assets/editor/assets/core-DnS-1skV.js +1 -0
- package/assets/editor/assets/create-Bd0K44Bi.js +1 -0
- package/assets/editor/assets/custom-shape-view-_TxDE4zO.js +1 -0
- package/assets/editor/assets/custom-shapes-D3n9PjCN.js +1 -0
- package/assets/editor/assets/diagram-fingerprint-CtYYDDQV.js +3 -0
- package/assets/editor/assets/edit-NIyQT3d_.js +1 -0
- package/assets/editor/assets/editor-CpiNbiMQ.js +1 -0
- package/assets/editor/assets/{elk-api-C4wlHVIw.js → elk-api-DfUWdVFD.js} +1 -1
- package/assets/editor/assets/elk-worker-loader-D09QKxa0.js +3 -0
- package/assets/editor/assets/embed-input-D77Udvni.js +1 -0
- package/assets/editor/assets/excalidraw-D0kr_KKg.js +1 -0
- package/assets/editor/assets/export-DUFOrZJ-.js +6 -0
- package/assets/editor/assets/export-HJI2Aq3h.js +2 -0
- package/assets/editor/assets/export-dialog-Edoe6LBK.js +1 -0
- package/assets/editor/assets/flow-layer-DX6oKkg8.js +1 -0
- package/assets/editor/assets/flow-panel-BsbC8WAJ.js +1 -0
- package/assets/editor/assets/flow-stage-DFvraJ0j.js +1 -0
- package/assets/editor/assets/{flow-start-CpAvU-9P.js → flow-start-D_gK7Gur.js} +1 -1
- package/assets/editor/assets/flows-BAU4NQGk.js +3 -0
- package/assets/editor/assets/frames-C-jROub3.js +5 -0
- package/assets/editor/assets/generate-BWJhhTxM.js +26 -0
- package/assets/editor/assets/geometry-CVRSymIE.js +1 -0
- package/assets/editor/assets/icon-picker-cggWIJiD.js +1 -0
- package/assets/editor/assets/icons-K7FjuB-c.js +2 -0
- package/assets/editor/assets/{image-library-JQu_tb8P.js → image-library-BG41F2Zi.js} +1 -1
- package/assets/editor/assets/{index-DBrN0u0i.css → index-B0dKwEIM.css} +1 -1
- package/assets/editor/assets/index-BSs3RHtR.js +25 -0
- package/assets/editor/assets/layout-offthread-3DtYtT7h.js +18 -0
- package/assets/editor/assets/layout.worker-B99h3Wv0.js +28 -0
- package/assets/editor/assets/menu-rOnlAYaK.js +1 -0
- package/assets/editor/assets/mermaid-paste-C1_G99Lz.js +1 -0
- package/assets/editor/assets/panel-controls-BT48HF6c.js +1 -0
- package/assets/editor/assets/{panel-shell-BnMOHgWM.js → panel-shell-CSvihB5L.js} +1 -1
- package/assets/editor/assets/plan-BS_pzMjA.js +1 -0
- package/assets/editor/assets/presentation-DlKoEXsq.js +1 -0
- package/assets/editor/assets/{presenter-keys-Bs3LnmOa.js → presenter-keys-uSrN0NG3.js} +1 -1
- package/assets/editor/assets/rich-paste-route-Bx69sREx.js +1 -0
- package/assets/editor/assets/ride-overlay-ChaS8O9D.js +1 -0
- package/assets/editor/assets/selection-overlay-primitives-DXtdWjNx.js +1 -0
- package/assets/editor/assets/shape-meta-CZ0aZy7a.js +1 -0
- package/assets/editor/assets/shape-render-PK6dqxxf.js +1 -0
- package/assets/editor/assets/shapes-CHDGoELO.js +11 -0
- package/assets/editor/assets/shared-DKcKntwk.js +1 -0
- package/assets/editor/assets/{slide-notes-dialog-BQBXpep6.js → slide-notes-dialog-CypGkEmF.js} +1 -1
- package/assets/editor/assets/slides-panel-D22Fponu.js +26 -0
- package/assets/editor/assets/table-PnIQtvp1.js +7 -0
- package/assets/editor/assets/text-breaks-BDwq8Wxj.js +7 -0
- package/assets/editor/assets/{theme-palette-Dl_G_VIJ.js → theme-palette-DZtiNUYJ.js} +1 -1
- package/assets/editor/assets/tidy-browser-DqAPzbkG.js +1 -0
- package/assets/editor/assets/tidy-scope-CQinfwtO.js +1 -0
- package/assets/editor/assets/tldraw-DSRiyEEW.js +2 -0
- package/assets/editor/assets/tool-catalog-DM8xoisn.js +1 -0
- package/assets/editor/assets/tool-drawer-hovu85Xd.js +1 -0
- package/assets/editor/assets/{tooltip-CyBz17g8.js → tooltip-ClTJbfBH.js} +1 -1
- package/assets/editor/assets/tree-Ch-RF7UJ.js +1 -0
- package/assets/editor/assets/use-export-command-CZva79qg.js +2 -0
- package/assets/editor/assets/use-grid-keyboard-nav-BhzrY178.js +0 -0
- package/assets/editor/assets/{use-icon-node-BxqH7H27.js → use-icon-node-B5V42drv.js} +1 -1
- package/assets/editor/assets/{use-key-held-094C3Mn3.js → use-key-held-DRn09Hq8.js} +1 -1
- package/assets/editor/assets/use-web-environment-Ce65LEhf.js +1 -0
- package/assets/editor/assets/useTriggerFocusGuards-Mibi8yYw.js +1 -0
- package/assets/editor/assets/web-card-BTru0lge.js +1 -0
- package/assets/editor/assets/web-card-font-BbZEq3En.js +1 -0
- package/assets/editor/assets/web-controls-DIAT8wcZ.js +1 -0
- package/assets/editor/assets/web-embed-dialog-CnaSzcu9.js +1 -0
- package/assets/editor/assets/web-embed-url-CHu4SU82.js +1 -0
- package/assets/editor/assets/web-embeds-I3saJ_yp.js +1 -0
- package/assets/editor/assets/web-html-dialog-DpkLs7qD.js +1 -0
- package/assets/editor/assets/web-runtime-DNdRiAlf.js +1 -0
- package/assets/editor/assets/web-widget-limits-DeMquLIR.js +1 -0
- package/assets/editor/assets/web-widgets-DsFUBhiq.js +325 -0
- package/assets/editor/assets/widget-source-C3N9ZKTz.js +2 -0
- package/assets/editor/assets/widget-target-C9a207gT.js +1 -0
- package/assets/editor/index.html +46 -40
- package/dist/koboyo.js +605 -269
- package/package.json +3 -3
- package/skills/koboyo/SKILL.md +8 -3
- package/skills/koboyo/references/architecture.md +3 -1
- package/skills/koboyo/references/bpmn.md +1 -1
- package/skills/koboyo/references/chart.md +1 -1
- package/skills/koboyo/references/cycle.md +1 -1
- package/skills/koboyo/references/erd.md +1 -1
- package/skills/koboyo/references/flowchart.md +1 -1
- package/skills/koboyo/references/funnel.md +1 -1
- package/skills/koboyo/references/gantt.md +1 -1
- package/skills/koboyo/references/gitgraph.md +1 -1
- package/skills/koboyo/references/journey.md +1 -1
- package/skills/koboyo/references/matrix.md +1 -1
- package/skills/koboyo/references/mindmap.md +1 -1
- package/skills/koboyo/references/orgchart.md +1 -1
- package/skills/koboyo/references/pyramid.md +1 -1
- package/skills/koboyo/references/sankey.md +1 -1
- package/skills/koboyo/references/sequence.md +1 -1
- package/skills/koboyo/references/statemachine.md +1 -1
- package/skills/koboyo/references/timeline.md +1 -1
- package/skills/koboyo/references/venn.md +1 -1
- package/skills/koboyo/references/wireframe.md +1 -1
- package/assets/editor/assets/MenuSubmenuTrigger-KacA9GM8.js +0 -1
- package/assets/editor/assets/asset-glyph-C1E6cGwM.js +0 -1
- package/assets/editor/assets/build-pips-BV-uwXlP.js +0 -1
- package/assets/editor/assets/build-visibility-DyML9SHt.js +0 -1
- package/assets/editor/assets/builders-DMHAOPEv.js +0 -1
- package/assets/editor/assets/chart-4iRduYdU.js +0 -7
- package/assets/editor/assets/code-panel-koBUgEWp.js +0 -43
- package/assets/editor/assets/connector-labels-CrEgadsC.js +0 -2
- package/assets/editor/assets/core-CmsJyU_-.js +0 -1
- package/assets/editor/assets/diagram-fingerprint-WGQ5iVXx.js +0 -3
- package/assets/editor/assets/edit-C0sBxxsg.js +0 -1
- package/assets/editor/assets/editor-BeufBV54.js +0 -1
- package/assets/editor/assets/elk-worker-loader-CVBdN1je.js +0 -3
- package/assets/editor/assets/excalidraw-BwgRIDi9.js +0 -1
- package/assets/editor/assets/export-Bce6ra0N.js +0 -2
- package/assets/editor/assets/export-K2VWg76n.js +0 -6
- package/assets/editor/assets/export-dialog-x2n2a4KX.js +0 -1
- package/assets/editor/assets/flow-layer-ewaL7g2y.js +0 -1
- package/assets/editor/assets/flow-panel-BzXNGGke.js +0 -1
- package/assets/editor/assets/flow-stage-Ba_CAggI.js +0 -1
- package/assets/editor/assets/flows-Cj7AFMIA.js +0 -3
- package/assets/editor/assets/frames-Cp1QD3LR.js +0 -1
- package/assets/editor/assets/icon-picker-Cg39IKNJ.js +0 -1
- package/assets/editor/assets/icon-sources-CZI1h18s.js +0 -1
- package/assets/editor/assets/icons-DzW1j-r3.js +0 -2
- package/assets/editor/assets/index-CBPPqsiR.js +0 -24
- package/assets/editor/assets/layout-offthread-mRHRulkS.js +0 -18
- package/assets/editor/assets/layout.worker-CekYkaxO.js +0 -27
- package/assets/editor/assets/menu-B9BAk63v.js +0 -1
- package/assets/editor/assets/panel-controls-DWVXiNUZ.js +0 -1
- package/assets/editor/assets/plan-CkgM52Yh.js +0 -1
- package/assets/editor/assets/presentation-DJUO0t7I.js +0 -1
- package/assets/editor/assets/reflow-DaYiVkwp.js +0 -1
- package/assets/editor/assets/registry-rEGZW7Ab.js +0 -1
- package/assets/editor/assets/ride-overlay-Hx90v4ZK.js +0 -1
- package/assets/editor/assets/selection-overlay-primitives-BRp854AD.js +0 -1
- package/assets/editor/assets/shape-meta-COE2ATNh.js +0 -1
- package/assets/editor/assets/shared-DjLCTIA9.js +0 -1
- package/assets/editor/assets/slides-D686obFO.js +0 -15
- package/assets/editor/assets/slides-panel-BEJCevJi.js +0 -26
- package/assets/editor/assets/style-BENGW2ZV.js +0 -1
- package/assets/editor/assets/text-breaks-DM4W6y5f.js +0 -7
- package/assets/editor/assets/tidy-browser-dF3BON7J.js +0 -1
- package/assets/editor/assets/tidy-scope-BGG3ZXvZ.js +0 -1
- package/assets/editor/assets/tldraw-CE87oKyq.js +0 -2
- package/assets/editor/assets/tool-catalog-DXPhX2S1.js +0 -1
- package/assets/editor/assets/tool-drawer-CWOX_njp.js +0 -1
- package/assets/editor/assets/tree-KSgPjntC.js +0 -1
- package/assets/editor/assets/use-export-command-sC9UHj3_.js +0 -2
- package/assets/editor/assets/use-grid-keyboard-nav-DhQKecO1.js +0 -0
- package/assets/editor/assets/web-controls-CLE9zr7i.js +0 -1
- package/assets/editor/assets/web-embed-dialog-XUNelFFM.js +0 -1
- package/assets/editor/assets/web-html-dialog-BcAyzH5D.js +0 -1
- package/assets/editor/assets/web-shape-C941TGTy.js +0 -1
- 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-rOnlAYaK.js";import{A as S,j as C,k as w,o as T}from"./editor-CpiNbiMQ.js";import{i as E,n as D}from"./config-D8b1QyEk.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(w);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function z(){return S(T(e=>e.theme),(0,L.useSyncExternalStore)(R,C,()=>!1))}function B(e){let{onEmbedFrame:t,onSaveCanvas:n,publicShare:r}=E(),i=D(),a=T(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-
|
|
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-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ride-overlay-ChaS8O9D.js","assets/rolldown-runtime-aKtaBQYM.js","assets/react-lCSYwAWP.js","assets/jsx-runtime-DKdBMi_L.js","assets/shapes-CHDGoELO.js","assets/web-embed-url-CHu4SU82.js","assets/web-widget-limits-DeMquLIR.js","assets/geometry-CVRSymIE.js","assets/editor-CpiNbiMQ.js","assets/custom-shapes-D3n9PjCN.js","assets/frames-C-jROub3.js","assets/icons-K7FjuB-c.js","assets/preload-helper-Czpn1I53.js","assets/asset-glyph-Dxg-7b67.js","assets/create-Bd0K44Bi.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-piWvprqQ.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-CpiNbiMQ.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-ChaS8O9D.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,31,32,33,34])),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{t as e}from"./createReactComponent-C51FAx3B.js";var t=e(`outline`,`square`,`Square`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}]]);export{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-ClTJbfBH.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-rOnlAYaK.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{Gt as W,wn as se}from"./shapes-CHDGoELO.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-CHDGoELO.js";import{m as n,p as r}from"./frames-C-jROub3.js";import{t as i}from"./icons-K7FjuB-c.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(!(n(e)&&r(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{C as r,M as i}from"./shapes-CHDGoELO.js";import{a,o}from"./editor-CpiNbiMQ.js";import{b as s}from"./frames-C-jROub3.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-BS_pzMjA.js";import{n as _,r as v}from"./edit-NIyQT3d_.js";var y=e(t(),1),b=n(),x=21,S=3;function C(e){let{zoom:t}=e,n=o(e=>e.animateSlideId),C=o(e=>e.shapes),w=o(e=>e.hoveredId),{store:T,history:E,measurement:D}=a(),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:a,follows:o,lane:s})=>{let l=r(e.shapes,D)??i(e.shapes[0],D),u=a!==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&&o?`true`:void 0,title:u?o?`Plays with click ${a}. Press to remove.`:`Click ${a}. 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?o?(0,b.jsx)(c,{size:11,stroke:2.25}):a:`+`})},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{k as r}from"./shapes-CHDGoELO.js";import{a as i,i as a}from"./geometry-CVRSymIE.js";import{o}from"./editor-CpiNbiMQ.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-CZ0aZy7a.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=o(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=>r(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{n as e}from"./shapes-CHDGoELO.js";import{et as t,k as n}from"./geometry-CVRSymIE.js";var r={width:960,height:540},i=`#1e1e1e`,a=`#ffffff`,o=`#495057`,s=`#868e96`,c=`#adb5bd`,l=`#f08c00`,u=`#fab005`,d={yellow:t.yellow.pastel,orange:t.orange.pastel,green:t.green.pastel,red:t.red.pastel,blue:t.blue.pastel,teal:t.teal.pastel,purple:t.purple.pastel,pink:t.pink.pastel,gray:t.gray.pastel},f={yellow:t.yellow.bold,orange:t.orange.bold,green:t.green.bold,red:t.red.bold,blue:t.blue.bold,teal:t.teal.bold,purple:t.purple.bold,pink:t.pink.bold,gray:t.gray.bold},p=`'JetBrains Mono', ui-monospace, monospace`,m=`Caveat, cursive`;function h(t){let n=e();return t.map(e=>({...e,groupId:n}))}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 _(t,r,i,a={}){return{id:e(),type:`text`,x:t.x+6,y:t.y+6,width:t.width-12,height:t.height-12,text:r,fontSize:i,fontFamily:a.fontFamily??n,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(t,r,i={}){return{id:e(),type:`rectangle`,kind:i.kind??`rectangle`,...t,rotation:i.rotation??0,label:i.label??``,fontSize:i.fontSize??24,fontFamily:n,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(t,n={}){return{id:e(),type:`line`,points:t,color:n.color??`#1e1e1e`,strokeWidth:n.strokeWidth??3,dash:n.dash??`solid`,startArrow:!1,endArrow:n.endArrow??!1,opacity:n.opacity??1}}function b(t,r,i,a,o={}){return{id:e(),type:`text`,x:t.x,y:t.y,text:r,fontSize:i,fontFamily:o.fontFamily??n,rotation:o.rotation??0,color:a,opacity:o.opacity??1}}function x(t,r,i,a,o,s=d.yellow){return{id:e(),type:`sticky`,x:t.x,y:t.y,width:r,height:r,rotation:o,text:i,fontSize:a,fontFamily:n,fill:s,opacity:1}}function S(t,r,i,a,o={}){return{id:e(),type:`arrow`,x:t.x,y:t.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?n:void 0,color:o.color??`#1e1e1e`,strokeWidth:o.strokeWidth??3,dash:o.dash??`solid`,startArrow:!1,endArrow:!0,opacity:1}}function C(t,n,r,i={}){return{id:e(),type:`arrow`,x:t.x,y:t.y,x2:n.x,y2:n.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(t,r,a,o,s={}){return{id:e(),type:`chart`,chartType:r,...t,rotation:0,cells:a,fontSize:o,fontFamily:n,color:i,opacity:1,...s}}function T(t,r,a,o,s,c={}){return{id:e(),type:`table`,x:t.x,y:t.y,cells:r,colWidths:a,rowHeights:o,rotation:0,fontSize:s,fontFamily:n,color:i,opacity:1,cellStyles:c.cellStyles??r.map((e,t)=>e.map(()=>t===0&&c.headerFill?{background:c.headerFill}:{}))}}function E(t,r,a={}){return{id:e(),type:`control`,kind:r,...t,rotation:0,label:a.label??``,body:a.body,primaryLabel:a.primaryLabel,secondaryLabel:a.secondaryLabel,fontSize:a.fontSize??15,fontFamily:n,color:i,fill:a.fill,value:a.value,opacity:a.opacity??1}}function D(t,r,i,a={}){return{id:e(),type:`icon`,x:t.x,y:t.y,width:r,height:r,rotation:0,source:a.source??`lucide`,name:i,label:a.label??``,fontSize:a.fontSize??16,fontFamily:n,color:a.color??`#1e1e1e`,strokeWidth:a.strokeWidth??3,opacity:a.opacity??1}}function O(t,r,i={}){return{id:e(),type:`figure`,kind:r,...t,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:n,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 +1 @@
|
|
|
1
|
-
import{o as e}from"./editor-
|
|
1
|
+
import{o as e}from"./editor-CpiNbiMQ.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-ClTJbfBH.js";import{C as a,Pn as o,zn as s}from"./shapes-CHDGoELO.js";import{a as c,o as l}from"./editor-CpiNbiMQ.js";import{Ft as u,Gt as d,K as f,L as p,N as m,Nt as h,Rt as g,Ut as _,Vt as v,Wt as y,kt as ee,z as te,zt as b}from"./frames-C-jROub3.js";import{a as ne,t as x}from"./icons-K7FjuB-c.js";import{n as re}from"./renderer-environment-D3n3hbug.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{t as ve}from"./diagram-fingerprint-CtYYDDQV.js";import{r as ye}from"./chrome-layout-500Q9pcx.js";import{t as be}from"./panel-shell-CSvihB5L.js";import{t as xe}from"./layout-offthread-3DtYtT7h.js";import{n as Se,t as Ce}from"./export-DUFOrZJ-.js";import{r as S}from"./flows-BAU4NQGk.js";import{_ as C,a as we,b as w,c as Te,d as Ee,f as T,g as E,h as D,i as O,l as De,m as k,n as Oe,o as ke,p as A,r as Ae,s as j,t as je,u as Me,v as M,y as N}from"./generate-BWJhhTxM.js";import{n as P}from"./icon-catalog-CbUlEKtK.js";var Ne=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=a(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(u).filter(e=>!ee.includes(e))),B=[...w.filter(e=>!z.has(e)),`chart`],V=[`title`,`direction`,`icons`],H=[`right`,`down`,`left`,`up`],U=[`badge`,`inside`],Pe=[`group`,`screen`,`note`,`legend`,`loop`,`alt`,`else`,`opt`,`par`,`and`,`break`,`activate`,`deactivate`,`central`],Fe=[`icon`,`color`,`shape`,`fill`,`colorMode`,`corner`,`frame`,`label`,`labelColor`,`group`,`link`,`head`,`width`,`value`,`score`],Ie=[`full`,`half`,`third`,`two-thirds`],Le=new Set([...Object.keys(u),`mindmap`,...b,`chart`,...V,...Pe,...A]),W=[`drawnicons`,`aws`,`gcp`,`azure`,`tech`,`mood`,`emoji`],Re={drawnicons:`Library`,aws:`AWS`,gcp:`GCP`,azure:`Azure`,tech:`Tech`,mood:`Mood`,emoji:`Emoji`},G=[`server`,`database`,`user`,`cloud`,`queue`,`globe`,`lock`,`mail`];function K(e,t,n){return e.map(e=>({label:e,detail:t,insert:n?n(e):void 0}))}var q=W.map(e=>({label:`${e}/`,detail:`${Re[e]} icons`,insert:`${e}/`}));function ze(e){let t=K(e?P:G,`icon`);return[...q,...t]}function Be(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 Ve={color:K(v,`colour`),labelcolor:K(v,`colour`),textcolor:K(v,`colour`),shape:K(d,`shape`),fill:K(y,`fill`),colormode:K(y,`fill`),corner:K(_,`corner`),corners:K(_,`corner`),frame:K(g,`frame`),head:K(h,`head`),width:K(Ie,`width`)};function He(e,t){return e===`icon`?ze(t):Ve[e]??null}function Ue(e){return[...K(Fe,`key`,e=>`${e}: `),...K(v,`colour`),...K(d,`shape`),...K(y,`fill`),...K(_,`corner`),...K([`shadow`,`flow`,`invisible`],`flag`),...K(g,`frame`),...q,...K(e?P:G,`icon`)]}function We(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 u[n]||(n===`chart`||w.includes(n)?n:`architecture`)}return`architecture`}var Ge=new RegExp(C.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).concat(`,`,`=`).join(`|`));function Ke(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(!Le.has(r)){e=e.replace(/\[[^\]]*\]/g,``).replace(/:.*/,``);for(let n of e.split(Ge)){let e=n.trim();e&&/[A-Za-z]/.test(e)&&e.length<=40&&t.add(e)}}}return[...t]}function qe(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 J(e,t,n,r){let i=qe(r,n).slice(0,80);return i.length===0?null:{from:e,to:t,query:n,options:i}}function Je(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 J(t-e.length,t,e,K(H,`direction`))}if(/^\s*icons\s*:\s*\w*$/i.test(i)){let e=/\w*$/.exec(i)?.[0]??``;return J(t-e.length,t,e,K(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&&W.includes(l[1]))return Be(l[1],l[2],c,t,s,n);if(o){let e=He(o,s);if(e)return J(c,t,s,e)}return J(c,t,s,Ue(s))}let o=/[\w/-]*$/.exec(i)?.[0]??``,c=t-o.length,l=i.replace(/^\s+/,``),u=!/\s/.test(l),d=We(e),f=Ke(e);if(u){let e=[...K(B,`family`),...K(V,`directive`,e=>`${e}: `)];return d===`wireframe`?(e.push(K([`screen`],`block`)[0]),e.push(...K(s,`control`,e=>`${e}: `))):d===`sequence`?e.push(...K([`note`,`loop`,`alt`,`opt`,`par`,`break`,`activate`,`deactivate`],`block`)):d===`erd`?e.push(...K(R,`cardinality`,e=>`${e} `)):d===`mindmap`?e.push(...K([`central`],`directive`,()=>`central: `)):d===`gitgraph`?e.push(...K([`commit`,`branch`,`checkout`,`merge`,`cherry-pick`],`block`,e=>e===`commit`?e:`${e} `)):d===`gantt`?(e.push(K([`section`],`block`,e=>`${e} `)[0]),e.push(K([`excludes`],`directive`,()=>`excludes: weekends`)[0])):d===`journey`||d===`timeline`?e.push(K([`section`],`block`,e=>`${e} `)[0]):d===`venn`?e.push(K([`overlap`],`block`,e=>`${e} `)[0]):d===`sankey`||d===`chart`||e.push(...K([`group`,`legend`],`block`)),e.push(...K(f,`node`)),J(c,t,o,e)}return J(c,t,o,[...K(C,`connector`,e=>`${e} `),...K(d===`erd`?R:[],`cardinality`,e=>`${e} `),...K(f,`node`)])}var Ye=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`]),Xe=new Set([...C,...E,...N]);function Ze(e){return Xe.has(e)||e.toLowerCase()in k}function Qe(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:Ze(t)?`connector`:`plain`,text:t})}}function $e(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&&Ye.has(a[2].toLowerCase())?(a[1]&&e.push({kind:`plain`,text:a[1]}),e.push({kind:`keyword`,text:a[2]}),Qe(e,a[3])):Qe(e,r),i&&e.push({kind:`comment`,text:i})}function et(e){let t=[];for(let n of e.split(`
|
|
5
|
+
`))$e(t,n),t.push({kind:`plain`,text:`
|
|
6
|
+
`});return t}var Y=r(),tt={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 nt(e){return(0,Y.jsx)(Y.Fragment,{children:et(e.code).map((e,t)=>{let n=tt[e.kind];return n?(0,Y.jsx)(`span`,{className:n,children:e.text},t):(0,Y.jsx)(F.Fragment,{children:e.text},t)})})}var rt=[`aws`,`gcp`,`azure`,`tech`];function it(){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 rt)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 at=`'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`,X=12,Z=20,Q=12,ot=60,st={margin:0,border:0,padding:Q,fontFamily:at,fontSize:X,lineHeight:`${Z}px`,fontVariantLigatures:`none`,fontFeatureSettings:`"liga" 0, "calt" 0`,tabSize:2,whiteSpace:`pre`,overflowWrap:`normal`,wordBreak:`normal`},ct=0;function lt(){let e=typeof document<`u`?document.fonts:void 0;if(!e)return!0;try{return e.check(`${X}px 'JetBrains Mono'`)}catch{return!0}}function ut(){if(ct)return ct;let e=document.createElement(`canvas`).getContext(`2d`);if(!e)return X*.6;e.font=`${X}px ${at}`;let t=e.measureText(`M`).width||X*.6;return lt()&&(ct=t),t}function $(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+Q+a*ut()-e.scrollLeft,top:o.top+Q+(i+1)*Z-e.scrollTop}}function dt(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}=it();(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=$(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=Q+(e-1)*Z,a=i+Z;(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=Je(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=$(n,r);c({from:i.from,to:i.to,options:i.options.slice(0,ot),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=Je(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=$(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-Z);e.style.left=`${n}px`,e.style.top=`${r}px`},[s]),(0,Y.jsxs)(`div`,{className:`relative overflow-hidden ${e.className??``}`,children:[(0,Y.jsx)(`pre`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0 overflow-hidden text-[var(--chrome-fg-900)]`,style:{margin:0},children:(0,Y.jsx)(`code`,{ref:n,style:{...st,display:`block`},children:(0,Y.jsx)(nt,{code:e.value})})}),(0,Y.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:st}),s&&(0,L.createPortal)((0,Y.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:at,fontSize:12},role:`listbox`,onPointerDown:e=>e.preventDefault(),children:s.options.map((e,t)=>(0,Y.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,Y.jsx)(`img`,{src:e.iconUrl,alt:``,loading:`lazy`,className:`h-4 w-4 shrink-0 object-contain`}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.label}),(0,Y.jsx)(`span`,{className:`ml-auto shrink-0 truncate text-[10px] text-[var(--chrome-fg-400)]`,children:e.detail})]},`${e.label}-${t}`))}),document.body)]})}function ft(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 pt=96,mt=`// 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 ht(){return le.getString(ce.diagramCode)??mt}function gt(e,t,n){let r=I(e);if(r)return r;let i=te({x:n.width/2,y:n.height/2},t);return{x:i.x-400,y:i.y-250}}function _t(e){let{containerRef:t}=e,{store:n,viewportAnimation:r,history:a}=c(),s=re(),{beginTransaction:u,endTransaction:d}=a,h=l(e=>e.rightPanel===`code`),g=l(e=>e.selectedIds),{addMany:_,removeShapes:v,setCodeOpen:y,setViewport:ee}=n.getState(),[te,b]=(0,F.useReducer)(ft,void 0,()=>({code:ht(),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=f(t,e);if(!r||!o(r)&&r.type!==`chart`||typeof r.code!=`string`||!r.code.trim())return;let i=N.current;if(i){let e=f(t,i.frameId);if(e&&(o(e)||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:ve(t,r)}})},[h,g,n]);let I=(0,F.useRef)(null),L=l(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)(()=>Ee(De(z).source).diagnostics,[z]),V=Ae(B).length,H=C&&V>0,U=H?B:ie;(0,F.useEffect)(()=>{V===0&&b({type:`ungate`})},[V]);let Pe=ye()===`docked`;if(!h)return null;function Fe(){b({type:`load`,code:ht(),linked:null})}let Ie=()=>{let e=t.current,n=e?.clientWidth??window.innerWidth,r=e?.clientHeight??window.innerHeight;return{width:Math.max(1,n-(Pe?360:0)),height:r}};function Le(e){r.animate(n.getState().viewport,p(e,Ie(),pt),ee)}let W=Te(x);function Re(){if(!W)return;let e=Me(x,W);b({type:`edit`,code:e.code}),b({type:`report`,diagnostics:e.diagnostics,result:e.code===x?null:`Converted from ${j[W]}.`})}function G(e,t){return o(t)?[t,...m(e,t)]:[t]}async function K(e){let t=n.getState();if(!t.viewMode){if(e.target){if(ve(t.shapes,e.target)&&!e.force){let n=s.theme.palette(),[r,i]=await Promise.all([Se(G(t.shapes,e.target),s,{padding:20,background:n.bg,palette:n}),Se(ne(e.shapes),s,{padding:20,background:n.bg,palette:n})]);M(`next`),k({current:Ce(r),next:Ce(i)});return}let n=vt(t.shapes,e.target,e.shapes,e.primary);u(),v(new Set(G(t.shapes,e.target).map(e=>e.id))),_(n),d()}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}),Le(e.bounds),b({type:`report`,result:`${e.target?`Updated`:`Added`} ${e.summary}.`}),Pe||y(!1)}}async function q(e={}){if(!(T||n.getState().viewMode)){E(!0),b({type:`report`,result:null});try{let t=Oe(x);t.converted&&t.converted.code!==x&&b({type:`edit`,code:t.converted.code});let r=n.getState(),i=w?f(r.shapes,w.frameId):void 0,a=i&&(o(i)||i.type===`chart`)?i:void 0,c=await je(t,{origin:a?{x:a.x,y:a.y}:gt(r.shapes,r.viewport,Ie()),layout:xe,allowErrors:H||!!e.skipErrors,icons:ke(s.icons)});if(c.status===`gated`){b({type:`gate`});return}if(b({type:`ungate`}),w&&!a&&b({type:`link`,linked:null}),b({type:`report`,diagnostics:c.diagnostics}),c.status===`empty`){b({type:`report`,result:`Nothing to draw yet. Add a node or an edge.`});return}await K({target:a,shapes:c.shapes,primary:c.primary,label:c.label,bounds:c.bounds,summary:c.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=q,(0,Y.jsxs)(be,{width:360,testId:`code-panel`,ariaLabel:`Diagram as code`,onDismiss:()=>y(!1),children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between py-2 pl-4 pr-2`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[14px] text-[var(--chrome-fg-900)]`,children:[(0,Y.jsx)(oe,{size:15,stroke:1.75}),`Diagram as code`]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,Y.jsx)(i,{label:`Syntax guide`,side:`bottom`,children:(0,Y.jsx)(`a`,{href:`/docs`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Syntax guide`,"data-testid":`code-docs-link`,className:ue,children:(0,Y.jsx)(Ne,{size:16,stroke:1.75})})}),(0,Y.jsx)(i,{label:`Hide code panel`,side:`bottom`,children:(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Hide code panel`,"data-testid":`code-close`,onClick:()=>y(!1),className:ue,children:(0,Y.jsx)(se,{size:16,stroke:1.75})})})]})]}),(0,Y.jsx)(`div`,{className:`mx-3 h-px bg-[var(--chrome-divider)]`}),w&&(0,Y.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,Y.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,Y.jsx)(i,{label:`Back to the draft`,side:`bottom`,children:(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Stop editing this diagram`,"data-testid":`code-unlink`,onClick:Fe,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,Y.jsx)(se,{size:14,stroke:1.75})})})]}),W&&(0,Y.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,Y.jsxs)(`span`,{className:`min-w-0`,children:[`Looks like `,j[W],`.`]}),(0,Y.jsx)(`button`,{type:`button`,"data-testid":`code-foreign-convert`,onClick:Re,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,Y.jsx)(dt,{handleRef:D,value:x,onChange:e=>b({type:`edit`,code:e}),onGenerate:()=>void q(),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,Y.jsxs)(`div`,{className:`mx-3 mb-2 flex max-h-32 flex-col gap-1 overflow-y-auto`,children:[S&&(0,Y.jsx)(`div`,{"data-testid":`code-result`,className:`text-pretty text-[12px] text-[var(--chrome-fg-600)]`,children:S}),U.map((e,t)=>(0,Y.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,Y.jsxs)(`div`,{className:`border-t border-[var(--chrome-ring)] p-3`,children:[H&&(0,Y.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,Y.jsx)(ae,{size:14,stroke:1.75,className:`mt-px shrink-0`}),(0,Y.jsx)(`span`,{className:`text-pretty tabular-nums`,children:we(V)})]}),(0,Y.jsx)(`button`,{type:`button`,"data-testid":`code-generate`,disabled:T||x.trim().length===0,onClick:()=>void q(),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`:W?`Convert ${j[W]} & generate`:`Generate diagram`}),(0,Y.jsx)(`p`,{className:`mt-1.5 text-center text-[11px] text-[var(--chrome-fg-400)]`,children:`⌘↵ generates · the code stays for tweaking`})]}),O&&(0,Y.jsx)(me,{open:!0,onOpenChange:e=>!e&&k(null),children:(0,Y.jsxs)(fe,{children:[(0,Y.jsx)(de,{className:`fixed inset-0 z-40 bg-gray-900/25`}),(0,Y.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,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(ge,{className:`text-[15px] font-medium text-[var(--chrome-fg-900)]`,children:`Replace your edits?`}),(0,Y.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,Y.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,Y.jsx)(se,{size:16,stroke:1.75})})]}),(0,Y.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,Y.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,Y.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,Y.jsx)(`img`,{src:O.current,alt:`Your edits`,className:`max-h-full max-w-full object-contain ${A===`current`?``:`hidden`}`}),(0,Y.jsx)(`img`,{src:O.next,alt:`Code version`,className:`max-h-full max-w-full object-contain ${A===`next`?``:`hidden`}`})]}),(0,Y.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,Y.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,Y.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,Y.jsx)(`button`,{type:`button`,"data-testid":`code-confirm-replace`,onClick:()=>{k(null),q({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 vt(e,t,n,r){if(!o(t)||!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{_t as CodePanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./shapes-CHDGoELO.js";var n={width:160,height:64},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-
|
|
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-CpiNbiMQ.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{Bt as e,K as t,Lt as n,Tt as r}from"./shapes-CHDGoELO.js";import{X as i,k as a}from"./geometry-CVRSymIE.js";import{bn as o}from"./frames-C-jROub3.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:n(e,t.end)}))}function c(e,n,a,o,s){let c=i(o),l=t(e).split(`
|
|
2
|
+
`),u=l.length*a*r,d=Math.max(...l.map(e=>s.measure(e,a,o,c)))+20;return{x:n.x-d/2,y:n.y-u/2,width:d,height:u}}function l(t,n){let r=t.fontFamily??a,i=[];if(t.label){let a=t.type===`arrow`?e(t):o(t.points,t.labelAlong);i.push(c(t.label,a,t.fontSize??20,r,n))}if(t.type===`arrow`)for(let e of s(t))i.push(c(e.text,e.point,14,r,n));return i}export{l as n,s as t};
|
package/assets/editor/assets/{copy-image-dialog-BzGP7Xw8.js → copy-image-dialog-BdQfoSGr.js}
RENAMED
|
@@ -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-
|
|
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-CpiNbiMQ.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{Pn as e,n as t}from"./shapes-CHDGoELO.js";import{N as n}from"./frames-C-jROub3.js";function r(e,t){return n(e,t)}function i(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 a(t){return t.filter(t=>e(t)&&(t.flows?.length??0)>0)}function o(t,r){return t.filter(i=>e(i)&&i.id!==r&&n(t,i).some(e=>e.id===r)).sort((e,t)=>e.width*e.height-t.width*t.height)}function s(t,r){let[i]=r;if(!i)return null;if(r.length===1&&e(i))return i;let a=o(t,i.id).at(-1);if(!a)return null;let s=new Set(n(t,a).map(e=>e.id));return r.every(e=>s.has(e.id))?a:null}function c(e,n=[]){let r=new Set(e.map(e=>e.name)),i=e.length+1;for(;r.has(`Flow ${i}`);)i+=1;return{id:t(),name:`Flow ${i}`,steps:n}}export{i as a,c as i,r as n,a as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./shapes-CHDGoELO.js";function t(){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 n={width:360,height:240},r=new Set([`radar`,`quadrant`]);function i(e){return r.has(e)?{width:320,height:320}:n}function a(n,r,a=`bar`){let o=i(a);return{id:e(),type:`chart`,chartType:a,x:n.x,y:n.y,width:o.width,height:o.height,rotation:0,cells:[[``,`Revenue`],[`Jan`,`12`],[`Feb`,`19`],[`Mar`,`9`],[`Apr`,`22`],[`May`,`17`]],fontSize:12,fontFamily:r.fontFamily,color:r.color,opacity:r.opacity,...a===`quadrant`?t():{}}}export{i as n,a as r,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}from"./jsx-runtime-DKdBMi_L.js";import{k as r}from"./shapes-CHDGoELO.js";import{r as i}from"./custom-shapes-D3n9PjCN.js";import{V as a,s as o}from"./editor-CpiNbiMQ.js";import{n as s,r as c}from"./shape-render-PK6dqxxf.js";var l=e(t(),1),u=n();function d(e){let{shape:t,interactive:n,interacting:d,selected:f,readOnly:p,erasing:m}=e,{onPointerDown:h,onBeginEdit:g,onHover:_}=e,v=o(),y=i(t),b=a(t.kind),x=(0,l.useCallback)(e=>{let n=v.getState().shapes.find(e=>e.id===t.id);if(n?.type!==`custom`)return;let r=i(n),a=r.ok?r.props:n.props,o=r.ok?r.kind.version:n.version;v.getState().updateShape(t.id,{props:{...a,...e},version:o})},[v,t.id]);if(!y.ok||!b?.component)return null;let S=r(t);return(0,u.jsx)(`div`,{"data-shape-id":t.id,"data-testid":`custom`,"data-custom-kind":t.kind,"data-interacting":d?`true`:void 0,className:`absolute overflow-hidden`,style:{left:S.x,top:S.y,width:S.width,height:S.height,transform:t.rotation?`rotate(${t.rotation}deg)`:void 0,opacity:s(t.opacity,m),pointerEvents:n?`auto`:`none`},onPointerDown:e=>{if(d){e.stopPropagation();return}h(t.id,e)},onDoubleClick:()=>n&&!d&&g(t.id),...c(t.id,_),children:(0,u.jsx)(`div`,{style:{width:`100%`,height:`100%`,pointerEvents:d?`auto`:`none`},children:b.component({shape:t,props:y.props,selected:f,interacting:d,readOnly:p,update:x})})})}var f=(0,l.memo)(d);function p(e){let{shape:t,interactive:n,erasing:o,onPointerDown:l,onHover:d}=e,f=r(t),p=f.x+f.width/2,m=f.y+f.height/2,h=i(t);if(h.ok&&a(t.kind)?.component!==void 0)return null;let g;return g=h.ok&&h.kind.toSvg?(0,u.jsx)(`g`,{transform:`translate(${f.x} ${f.y})`,dangerouslySetInnerHTML:{__html:h.kind.toSvg(t,h.props)}}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`rect`,{x:f.x,y:f.y,width:f.width,height:f.height,rx:Math.min(8,f.width/4,f.height/4),fill:`var(--paper-bg)`,stroke:`var(--canvas-ink)`,strokeOpacity:.35,strokeDasharray:`6 4`}),t.label?(0,u.jsx)(`text`,{x:p,y:m-8,textAnchor:`middle`,dominantBaseline:`middle`,fontSize:14,fill:`var(--canvas-ink)`,fillOpacity:.85,children:t.label}):null,(0,u.jsx)(`text`,{x:p,y:t.label?m+10:m,textAnchor:`middle`,dominantBaseline:`middle`,fontSize:11,fill:`var(--canvas-ink)`,fillOpacity:.55,children:t.kind})]}),(0,u.jsx)(`g`,{"data-shape-id":t.id,"data-testid":`custom`,"data-custom-kind":t.kind,transform:t.rotation?`rotate(${t.rotation} ${p} ${m})`:void 0,opacity:s(t.opacity,o),style:{pointerEvents:n?`all`:`none`},onPointerDown:e=>l(t.id,e),...c(t.id,d),children:g})}var m=(0,l.memo)(p);export{f as CustomShapeHost,m as CustomShapeSvg};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=new Map;function t(t){for(let n of t)e.set(n.kind,n);return()=>{for(let n of t)e.get(n.kind)===n&&e.delete(n.kind)}}function n(t){return e.get(t)}function r(t){let n=e.get(t.kind);if(!n)return{ok:!1,reason:`unregistered`};let r=t.props;for(let e=t.version;e<n.version;e+=1){let t=n.migrate?.[e];if(!t)return{ok:!1,reason:`unmigratable`};r=t(r)}return n.validate&&!n.validate(r)?{ok:!1,reason:`invalid`}:{ok:!0,kind:n,props:r}}export{t as n,r,n as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Sn as e,sn as t}from"./shapes-CHDGoELO.js";import"./geometry-CVRSymIE.js";import{N as n,j as r}from"./frames-C-jROub3.js";import{n as i}from"./shape-meta-CZ0aZy7a.js";var a=`arrow`;function o(e,t){return s(t,n(e,t))}function s(e,t){let n=[`frame|${i(e)}`];for(let e of t)n.push(g(e));return n.sort(),_(n.join(`
|
|
2
|
+
`))}function c(e,t){return typeof e.code!=`string`||e.code.trim().length===0||typeof e.codeFingerprint!=`string`?!1:(e.type===`chart`?f(e):t(e))!==e.codeFingerprint}function l(e,t){return c(t,t=>o(e,t))}function u(e,t,n){e.code=t,e.codeFingerprint=e.type===`chart`?f(e):o(n,e)}function d(e){let n=new Set,i=null;for(let a of e)t(a)&&c(a,t=>s(t,(i??=r(e)).members(t)))&&n.add(a.id);return n}function f(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(`|`)}`),_(t.join(`
|
|
3
|
+
`))}function p(e,t){let n=e[t];return typeof n==`string`||typeof n==`number`?String(n):``}function m(e){if(e.type===`icon`)return`${p(e,`name`)}/${p(e,`source`)}`;let t=e.titleIcon;return t?`${t.name??``}/${t.source??``}`:``}function h(t){let n=[],r=p(t,`fillStyle`);r&&r!==`pastel`&&n.push(`fillStyle:${r}`);let i=p(t,`corner`);i&&i!==e(p(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!==a&&n.push(`startHead:${t.startHead}`),t.endHead&&t.endHead!==a&&n.push(`endHead:${t.endHead}`)),n}function g(e){let t=[e.type,p(e,`kind`),i(e),p(e,`fill`),p(e,`color`),m(e)];if(e.type===`arrow`){let n=e.startBinding?.shapeId??``,r=e.endBinding?.shapeId??``;return[...t,n,r,...h(e)].join(`|`)}return[...t,...h(e)].join(`|`)}function _(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{d as n,u as r,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./geometry-CVRSymIE.js";import{T as t}from"./frames-C-jROub3.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-BS_pzMjA.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./react-lCSYwAWP.js";import{E as n,Fn as r,Hn as i,It as a,Kn as o,Nn as s,Pn as c,Pt as l,Un as u,Vn as d,Wn as f,_ as p,a as m,f as h,g,j as ee,jn as te,k as _,m as ne,mn as re,n as ie,tn as v}from"./shapes-CHDGoELO.js";import{L as ae,a as oe,c as y,d as se,o as ce,y as le}from"./geometry-CVRSymIE.js";import{n as ue,t as de}from"./custom-shapes-D3n9PjCN.js";import{K as fe,L as pe,Q as me,U as he,V as b,W as ge,X as x,b as _e,ht as ve,n as ye,pt as be,q as xe}from"./frames-C-jROub3.js";import{a as Se,g as Ce,m as we,u as Te}from"./icons-K7FjuB-c.js";import{i as Ee}from"./asset-glyph-Dxg-7b67.js";import{n as De,t as Oe}from"./create-Bd0K44Bi.js";var S=e(t(),1),C=new Map;function ke(e){let t=ue(e);for(let t of e)C.set(t.kind,t);return()=>{t();for(let t of e)C.get(t.kind)===t&&C.delete(t.kind)}}function Ae(e){return C.get(e)}var je=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Me=(e=>e?je(e):je),Ne=e=>e;function Pe(e,t=Ne){let n=S.useSyncExternalStore(e.subscribe,S.useCallback(()=>t(e.getState()),[e,t]),S.useCallback(()=>t(e.getInitialState()),[e,t]));return S.useDebugValue(n),n}var Fe=(e,t,n)=>(r,i)=>({pastStates:n?.pastStates||[],futureStates:n?.futureStates||[],undo:(a=1)=>{if(i().pastStates.length){let o=n?.partialize?.(t())||t(),s=i().pastStates.splice(-a,a),c=s.shift();e(c),r({pastStates:i().pastStates,futureStates:i().futureStates.concat(n?.diff?.(o,c)||o,s.reverse())})}},redo:(a=1)=>{if(i().futureStates.length){let o=n?.partialize?.(t())||t(),s=i().futureStates.splice(-a,a),c=s.shift();e(c),r({pastStates:i().pastStates.concat(n?.diff?.(o,c)||o,s.reverse()),futureStates:i().futureStates})}},clear:()=>r({pastStates:[],futureStates:[]}),isTracking:!0,pause:()=>r({isTracking:!1}),resume:()=>r({isTracking:!0}),setOnSave:e=>r({_onSave:e}),_onSave:n?.onSave,_handleSet:(e,t,a,o)=>{n?.limit&&i().pastStates.length>=n?.limit&&i().pastStates.shift(),i()._onSave?.(e,a),r({pastStates:i().pastStates.concat(o||e),futureStates:[]})}}),Ie=(e,t)=>(n,r,i)=>{i.temporal=Me(t?.wrapTemporal?.(Fe(n,r,t))||Fe(n,r,t));let a=t?.handleSet?.(i.temporal.getState()._handleSet)||i.temporal.getState()._handleSet,o=e=>{if(!i.temporal.getState().isTracking)return;let n=t?.partialize?.(r())||r(),o=t?.diff?.(e,n);o===null||t?.equality?.(e,n)||a(e,void 0,n,o)},s=i.setState;return i.setState=(...e)=>{let n=t?.partialize?.(r())||r();s(...e),o(n)},e((...e)=>{let i=t?.partialize?.(r())||r();n(...e),o(i)},r,i)},Le=100,w=1e6;function Re(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n===0)return!1;if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return!1;t+=1}else if(n>=56320&&n<=57343)return!1}return!0}function ze(e){if(Re(e))return e;let t=``;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r!==0){if(r>=55296&&r<=56319){let r=e.charCodeAt(n+1);r>=56320&&r<=57343?(t+=e.slice(n,n+2),n+=1):t+=`�`;continue}t+=r>=56320&&r<=57343?`�`:e[n]}}return t}function T(e,t,n){if(n.values+=1,n.values>w)return`complexity`;if(typeof e==`string`)return Re(e)?null:`text`;if(e===null||typeof e==`boolean`)return null;if(typeof e==`number`)return Number.isFinite(e)?null:`number`;if(typeof e!=`object`)return`value`;if(t>Le)return`depth`;if(n.ancestors.has(e))return`cycle`;n.ancestors.add(e);try{if(Array.isArray(e)){if(e.length>w-n.values)return`complexity`;for(let t of Reflect.ownKeys(e))if(t!==`length`&&(typeof t!=`string`||!/^(0|[1-9]\d*)$/.test(t)||Number(t)>=e.length))return`array-property`;for(let r=0;r<e.length;r+=1){let i=Object.getOwnPropertyDescriptor(e,String(r));if(!i||!(`value`in i))return`array-entry`;let a=T(i.value,t+1,n);if(a)return a}return null}let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)return`object`;let i=Reflect.ownKeys(e);if(i.length>w-n.values)return`complexity`;for(let r of i){if(typeof r!=`string`||!Re(r))return`object-key`;let i=Object.getOwnPropertyDescriptor(e,r);if(!i?.enumerable||!(`value`in i))return`object-property`;if(i.value===void 0)continue;let a=T(i.value,t+1,n);if(a)return a}return null}catch{return`unreadable`}finally{n.ancestors.delete(e)}}function Be(e){return T(e,0,{ancestors:new Set,values:0})}var Ve={};for(let[e,t]of Object.entries(te))Ve[e]=t.checks;function He(e,t,n,r){for(let i of Object.keys(r))r[i](e,t,n,i)}function Ue(e,t,n,a){let o=n.type,s=typeof o==`string`?Ve[o]:void 0;if(!a)return r(e,t,n),s?(He(e,t,n,s),`understood`):(i(e,`${t}.type`,`unknown shape type`),`understood`);let c=f();return r(c,t,n),s&&He(c,t,n,s),s?c.issues.length===0?`understood`:c.issues.length===c.unknownEnum?`unknown`:`damaged`:typeof o==`string`&&c.issues.length===0?`unknown`:`damaged`}function We(e,t,n,r,i){Ge(e,`${t}.startBinding`,n,n.startBinding,r,i),Ge(e,`${t}.endBinding`,n,n.endBinding,r,i)}function Ge(e,t,n,r,a,c){if(!o(r))return;let l=r.shapeId;if(typeof l!=`string`)return;if(l===n.id){i(e,`${t}.shapeId`,`binding targets its own arrow`);return}let u=a.get(l);if(!u){i(e,`${t}.shapeId`,`binding target does not exist`);return}if(!c.has(l)){if(r.kind===`path`){let n=s(u.type);if(n!==`path`&&n!==`node-or-path`){i(e,`${t}.shapeId`,`path binding must target a line or arrow`);return}let a=(u.type===`line`&&Array.isArray(u.points)?u.points.length:2)-2;typeof r.seg==`number`&&(r.seg<0||r.seg>a)&&i(e,`${t}.seg`,`path segment does not exist on the target`);return}s(u.type)===`path`&&i(e,`${t}.shapeId`,`node binding cannot target an arrow`)}}var Ke=1e4;function qe(e){try{if(!o(e))return!1;let t=f();return Ue(t,`shape`,e,!1),t.issues.length===0&&Be(e)===null}catch{return!1}}function Je(e,t){return Xe(e,!0,t)}function Ye(e,t){return Xe(e,!1,t)}function Xe(e,t,n){try{return Ze(e,t,n?.unknownShapes===`preserve`)}catch{return{status:`invalid`,issues:[{path:``,message:`could not be validated`}]}}}function Ze(e,t,n){if(!o(e))return{status:`invalid`,issues:[{path:``,message:`expected an object`}]};let r=e.version;if(r!==1)return typeof r==`number`&&Number.isFinite(r)?{status:`unsupported-version`,version:r}:{status:`invalid`,issues:[{path:`version`,message:`unsupported version`}]};let a=e.shapes;if(!Array.isArray(a))return{status:`invalid`,issues:[{path:`shapes`,message:`expected an array`}]};if(a.length>1e4)return{status:`invalid`,issues:[{path:`shapes`,message:`too many shapes`}]};let s=f(),c=new Map,l=new Set,p=new Map,m=new Set;for(let e=0;e<a.length;e+=1){if(s.issues.length>=100){s.capped=!0;break}let t=a[e],r=`shapes[${e}]`;if(!o(t)){i(s,r,`expected a shape object`);continue}typeof t.id==`string`&&(l.has(t.id)?i(s,`${r}.id`,`duplicate shape id`):(l.add(t.id),c.set(t.id,t)));let d=Ue(s,r,t,n);if(d===`understood`||!u(s,`${r}.id`,t.id,!1))continue;if(d===`unknown`&&JSON.stringify(t).length>1048576){i(s,r,`unrecognized shape is too large to preserve`);continue}let f=t.id;p.set(e,{index:e,id:f,shape:t,reason:d}),m.add(f)}for(let e=0;e<a.length;e+=1){if(s.issues.length>=100){s.capped=!0;break}let t=a[e];if(!o(t)||t.type!==`arrow`||p.has(e))continue;let r=`shapes[${e}]`;if(!n){We(s,r,t,c,m);continue}let i=f();if(We(i,r,t,c,m),i.issues.length===0||!u(s,`${r}.id`,t.id,!1))continue;let l=t.id;p.set(e,{index:e,id:l,shape:t,reason:`damaged`}),m.add(l)}if(s.issues.length>0)return{status:`invalid`,issues:s.issues};if(t){let t=Be(e);if(t)return i(s,``,d[t]),{status:`invalid`,issues:s.issues}}return p.size===0?{status:`valid`,document:e,opaque:[]}:{status:`valid`,document:{...e,shapes:a.filter((e,t)=>!p.has(t))},opaque:[...p.values()].sort((e,t)=>e.index-t.index)}}function E(e){return JSON.stringify(e,(e,t)=>{if(typeof t!=`object`||!t||Array.isArray(t))return t;let n=t;return Object.fromEntries(Object.keys(n).sort().map(e=>[e,n[e]]))})}function Qe(e,t,n){let{shapes:r,conflicts:i}=et(e.shapes,t.shapes,n.shapes);return{document:{version:1,shapes:r},conflicts:i}}function $e(e,t,n){let r=new Map(e.shapes.map(e=>[e.id,E(e)])),i=new Map(t.shapes.map(e=>[e.id,E(e)])),a=0;for(let e of n.shapes){let t=i.get(e.id);t!==r.get(e.id)&&E(e)!==t&&(a+=1)}return a}function et(e,t,n){let r=e=>E(e),i=new Map(e.map(e=>[e.id,r(e)])),a=new Map(t.map(e=>[e.id,e])),o=new Set(n.map(e=>e.id)),s=0,c=[],l=new Set;for(let e of n){let t=e.id,n=i.get(t),o=a.get(t);if(l.add(t),n===void 0){o&&r(o)!==r(e)?(s+=1,c.push(o)):c.push(e);continue}if(!o){r(e)!==n&&(s+=1,c.push(e));continue}let u=r(o)!==n,d=r(e)!==n;u&&d&&r(o)!==r(e)?(s+=1,c.push(o)):u?c.push(o):c.push(e)}for(let[e,t]of i){if(o.has(e)||l.has(e))continue;let n=a.get(e);l.add(e),n&&r(n)!==t&&(s+=1,c.push(n))}for(let e of t)l.has(e.id)||c.push(e);return{shapes:c,conflicts:s}}function tt(e,t){if(t===null)return 0;let n=e.length-1;if(n>=0&&e[n].id===t)return e.length;let r=e.findIndex(e=>e.id===t);return r===-1?e.length:r+1}var nt=16;function rt(e,t){return e.findIndex(e=>e.id===t)}function D(e,t){let n=[...e],r=null,i=e=>{if(t.length<nt)return rt(n,e);if(r===null){r=new Map;for(let e=0;e<n.length;e+=1)r.has(n[e].id)||r.set(n[e].id,e)}return r.get(e)??-1};for(let e of t){if(e.o===`put`){let t=i(e.shape.id);if(t!==-1){n[t]=e.shape;continue}n.splice(tt(n,e.after),0,e.shape),r=null;continue}if(e.o===`set`){let t=i(e.id);if(t===-1)continue;let r={...n[t],...e.props,id:e.id};for(let t of e.unset??[])t!==`id`&&delete r[t];n[t]=r;continue}if(e.o===`del`){let t=i(e.id);t!==-1&&(n.splice(t,1),r=null);continue}let t=i(e.id);if(t===-1||e.after===e.id)continue;let[a]=n.splice(t,1);n.splice(tt(n,e.after),0,a),r=null}return n}function it(e,t){return e===t?!0:typeof e!=`object`||typeof t!=`object`||e===null||t===null?!1:E(e)===E(t)}function at(e){let t=[],n=Array(e.length).fill(-1);for(let r=0;r<e.length;r+=1){let i=0,a=t.length;for(;i<a;){let n=i+a>>1;e[t[n]]<e[r]?i=n+1:a=n}i>0&&(n[r]=t[i-1]),t[i]=r}let r=new Set,i=t.length>0?t[t.length-1]:-1;for(;i!==-1;)r.add(i),i=n[i];return r}function ot(e,t){let n=[],r=new Map,i=new Map;e.forEach((e,t)=>{r.set(e.id,e),i.set(e.id,t)});let a=new Set(t.map(e=>e.id));for(let t of e)a.has(t.id)||n.push({o:`del`,id:t.id});let o=[],s=[];t.forEach((e,t)=>{let n=i.get(e.id);n!==void 0&&(o.push(n),s.push(t))});let c=at(o),l=new Set;return s.forEach((e,t)=>{c.has(t)||l.add(e)}),t.forEach((e,i)=>{let a=i===0?null:t[i-1].id,o=r.get(e.id);if(!o){n.push({o:`put`,shape:e,after:a});return}if(l.has(i)&&n.push({o:`move`,id:e.id,after:a}),o===e)return;let s=o,c=e,u={},d=!1;for(let e of Object.keys(c))c[e]!==void 0&&(it(s[e],c[e])||(u[e]=c[e],d=!0));let f=Object.keys(s).filter(e=>s[e]!==void 0&&c[e]===void 0);!d&&f.length===0||n.push(f.length>0?{o:`set`,id:e.id,props:u,unset:f}:{o:`set`,id:e.id,props:u})}),n}function st(e,t,n=ie()){let r=e.filter(e=>t.has(e.id));if(r.length<2)return e;let i=r.map(e=>({...e,groupId:n})),a=e.filter(e=>!t.has(e.id)),o=0;e.forEach((e,n)=>{t.has(e.id)&&(o=n)});let s=e.slice(0,o+1).filter(e=>!t.has(e.id)).length,c=[...a];return c.splice(s,0,...i),lt(c)}function ct(e,t){let n=new Set(e.filter(e=>t.has(e.id)&&e.groupId).map(e=>e.groupId));return n.size===0?e:e.map(e=>e.groupId&&n.has(e.groupId)?{...e,groupId:void 0}:e)}function lt(e){let t=new Map;for(let n of e)n.groupId&&t.set(n.groupId,(t.get(n.groupId)??0)+1);return[...t.values()].some(e=>e===1)?e.map(e=>e.groupId&&t.get(e.groupId)===1?{...e,groupId:void 0}:e):e}var O=Ke,ut=8e3;function dt(e,t){return e+t>O?{kind:`block`,message:`That would put this canvas past ${O.toLocaleString()} shapes, so nothing was added. Split the work across canvases instead.`}:e<=8e3&&e+t>8e3?{kind:`warn`,message:`This canvas now has over ${ut.toLocaleString()} shapes. Boards this large can feel slow.`}:null}function ft(e,t){return e>O?t===`open`?{kind:`block`,message:`That board has ${e.toLocaleString()} shapes, more than the ${O.toLocaleString()} a canvas supports, so it wasn't opened.`}:{kind:`warn`,message:`This board has ${e.toLocaleString()} shapes, more than the ${O.toLocaleString()} a canvas supports. Expect it to feel slow.`}:e>8e3?{kind:`warn`,message:`This board has ${e.toLocaleString()} shapes. Boards this large can feel slow.`}:null}function pt(e){let t=0;for(let n of e)c(n)&&n.slideOrder!==void 0&&(t=Math.max(t,n.slideOrder+1));return t}function mt(e,t){if(!t.some(e=>c(e)&&e.slideOrder!==void 0))return t;let n=new Set;for(let t of e)c(t)&&t.slideOrder!==void 0&&n.add(t.slideOrder);let r=pt([...e,...t]);return t.map(e=>{if(!c(e)||e.slideOrder===void 0)return e;if(!n.has(e.slideOrder))return n.add(e.slideOrder),e;let t=r++;return n.add(t),{...e,slideOrder:t}})}function ht(e){let t=new Map;return _e(e).forEach((e,n)=>{e.slideOrder!==n&&t.set(e.id,{...e,slideOrder:n})}),t.size===0?e:e.map(e=>t.get(e.id)??e)}var gt=`(prefers-color-scheme: dark)`;function _t(e,t){return e===`system`?t?`dark`:`light`:e}function vt(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(gt).matches}var k={showGrid:!0,snapEnabled:!0,presentationAnimation:!0,showZoomIndicator:!1,theme:`light`},A=1,yt={"'Balsamiq Sans', cursive":`'Balsamiq Sans Neue', cursive`};function bt(e){let t=e.activation;if(!t||typeof t!=`object`||Array.isArray(t))return null;let{top:n,height:r}=t;return typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)?null:{top:n,height:r}}function xt(e){let t=new Map,n=e.map(e=>{if(e.type!==`control`||e.kind!==`lifeline`||!(`activation`in e))return e;let{activation:n,...r}=e,i=Array.isArray(e.activations),a=bt(e);if(i||!a)return r;let o={...r,activations:[a]};return t.set(o.id,o),o});if(t.size===0)return n;let r=e=>{if(!e||we(e)||!e.precise)return e;let n=t.get(e.shapeId);if(!n)return e;let r=be(n)[0],i=ve(n),a=oe((r.y+e.anchor.y*r.height-i.y)/i.height);return{...e,anchor:{x:.5,y:a}}};return n.map(e=>{if(e.type!==`arrow`)return e;let t=r(e.startBinding),n=r(e.endBinding);return t===e.startBinding&&n===e.endBinding?e:{...e,startBinding:t,endBinding:n}})}var St=100;function j(e,t=0,n=new Set){if(typeof e==`string`)return ze(e);if(typeof e!=`object`||!e||t>=St||n.has(e))return e;n.add(e);try{if(Array.isArray(e)){let r=!1,i=Array(e.length);for(let a=0;a<e.length;a+=1){let o=Object.getOwnPropertyDescriptor(e,String(a));if(!o||!(`value`in o))return e;let s=o.value,c=j(s,t+1,n);c!==s&&(r=!0),i[a]=c}return r?i:e}let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)return e;let i=!1,a={};for(let r of Reflect.ownKeys(e)){if(typeof r!=`string`)return e;let o=Object.getOwnPropertyDescriptor(e,r);if(!o?.enumerable||!(`value`in o))return e;let s=o.value,c=j(s,t+1,n);c!==s&&(i=!0),a[r]=c}return i?a:e}finally{n.delete(e)}}function Ct(e){return xt(e).map(e=>{if(`fontFamily`in e&&e.fontFamily){let t=yt[e.fontFamily];if(t)return{...e,fontFamily:t}}return e})}function wt(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.x!=`number`||typeof t.y!=`number`||typeof t.zoom!=`number`||!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(t.zoom)||t.zoom<=0?null:{x:t.x,y:t.y,zoom:t.zoom}}var M={unknownShapes:`preserve`};function N(e,t){if(t.length===0)return e;let n=[...e.shapes];for(let e of[...t].sort((e,t)=>e.index-t.index))n.splice(Math.min(e.index,n.length),0,e.shape);return{...e,shapes:n}}function P(e){let t=Je(e,M);if(t.status!==`valid`)return{document:e,opaque:[]};let n=t.opaque.filter(e=>e.reason===`unknown`);if(n.length===t.opaque.length)return{document:t.document,opaque:t.opaque};let r=Tt(t.opaque.filter(e=>e.reason===`damaged`),n);return{document:N(t.document,r),opaque:n}}function Tt(e,t){return e.length===0||t.length===0?e:e.map(e=>({...e,index:e.index-t.filter(t=>t.index<e.index).length}))}function Et(e,t){if(t.length===0)return e;let n=new Set(t.map(e=>e.id));return{...e,shapes:e.shapes.filter(e=>!n.has(e.id))}}function Dt(e){let t=Ye(e,M);if(t.status===`unsupported-version`)return{status:`unsupported-version`};if(t.status===`invalid`)return{status:`invalid`};let n=j(t.document),r=Je(N({...n,shapes:Ct(n.shapes)},t.opaque),M);if(r.status!==`valid`)return{status:`invalid`};let i=r.opaque.filter(e=>e.reason===`damaged`),a=Tt(r.opaque.filter(e=>e.reason===`unknown`),i),o=r.document.shapes.length+r.opaque.length;return o>0&&i.length===o?{status:`invalid`}:{status:`valid`,document:N(r.document,a),opaque:a,damaged:i}}function F(e,t){return typeof e==`function`?e(t):e}function I(e){return t=>n=>e(e=>{let r=F(n,e[t]);return Object.is(r,e[t])?e:{[t]:r}})}var Ot=1.2,kt={x:0,y:0,zoom:1};function L(e,t){return Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.zoom)&&t.zoom>0?{viewport:t}:{viewport:e}}var At=e=>({viewport:kt,zoomGestureNonce:0,pulseZoomGesture:()=>e(e=>({zoomGestureNonce:e.zoomGestureNonce+1})),setViewport:t=>e(e=>L(e.viewport,F(t,e.viewport))),zoomIn:t=>e(e=>L(e.viewport,b(e.viewport,e.viewport.zoom*Ot,t))),zoomOut:t=>e(e=>L(e.viewport,b(e.viewport,e.viewport.zoom/Ot,t))),resetZoom:t=>e(e=>L(e.viewport,b(e.viewport,1,t))),fitToBounds:(t,n)=>e(e=>L(e.viewport,t?pe(t,n):{zoom:1,x:n.width/2,y:n.height/2}))});function R(e,t){let{position:n}=xe(e),r=e.slice(),i=[];for(let a of t(t=>{let r=n.get(t);return r===void 0?void 0:e[r]})){let e=n.get(a.id);e!==void 0&&(r[e]=a,i.push(e))}return ge(e,r,i),r}var z=new Set,jt=e=>(t,n,r)=>{let i=r.temporal;function a(){return n().viewModeLocked&&i?.getState().isTracking!==!1}function o(n,r,i,o){a()||t(t=>{let a=n(t.shapes);he(t.shapes,a);let s=Se(a,r,e,o);return t.activeGroupId&&!s.some(e=>e.groupId===t.activeGroupId)?{shapes:s,...i,activeGroupId:null}:{shapes:s,...i}})}function s(e){o(t=>{let n=t.some(t=>e.has(t.id)&&c(t)&&t.slideOrder!==void 0),r=t.filter(t=>!e.has(t.id));return n?ht(r):r},e)}function l(e,r){if(a())return;let i=dt(n().shapes.length,e.length);i&&(t({limitNotice:i}),i.kind===`block`)||o(t=>r(t,mt(t,e)),new Set(e.map(e=>e.id)))}return{shapes:[],hydrate:(n,r,i)=>{let a=n?P(n):null;t({shapes:Se(a?.document.shapes??[],null,e),opaqueShapes:a?.opaque??[],viewport:r??kt,showGrid:i?.showGrid??k.showGrid,snapEnabled:i?.snapEnabled??k.snapEnabled,presentationAnimation:i?.presentationAnimation??k.presentationAnimation,showZoomIndicator:i?.showZoomIndicator??k.showZoomIndicator,theme:i?.theme??k.theme})},opaqueShapes:[],limitNotice:null,clearLimitNotice:()=>t({limitNotice:null}),addShape:e=>l([e],(e,t)=>[...e,...t]),addMany:e=>l(e,(e,t)=>[...e,...t]),addShapeBehind:(e,t)=>l([e],(e,n)=>{let r=e.findIndex(e=>t.has(e.id));return r===-1?[...e,...n]:[...e.slice(0,r),...n,...e.slice(r)]}),updateShape:(e,t)=>o(n=>R(n,n=>{let r=n(e);return r?[{...r,...t}]:[]}),new Set([e])),replaceShape:e=>o(t=>R(t,()=>[e]),new Set([e.id])),replaceMany:(e,t)=>{o(t=>R(t,()=>e),new Set(e.map(e=>e.id)),void 0,t)},loadShapes:e=>{let t=P({version:A,shapes:e});o(()=>t.document.shapes,null,{opaqueShapes:t.opaque})},applyRemoteOps:e=>{e.length!==0&&t(t=>{let n=t.opaqueShapes.length===0&&e.every(e=>e.o!==`put`||qe(e.shape)),r,i=t.opaqueShapes;if(n)r=D(t.shapes,e),he(t.shapes,r);else{let n=P({version:A,shapes:D(N({version:A,shapes:t.shapes},t.opaqueShapes).shapes,e)});r=n.document.shapes,i=n.opaque}let a=e=>xe(r).position.has(e),o=[...t.selectedIds].every(a)?t.selectedIds:new Set([...t.selectedIds].filter(a));return t.activeGroupId&&!r.some(e=>e.groupId===t.activeGroupId)?{shapes:r,opaqueShapes:i,selectedIds:o,activeGroupId:null}:{shapes:r,opaqueShapes:i,selectedIds:o}})},remeasureBindings:()=>o(e=>e,null),settleBindings:e=>o(e=>e,e),removeShape:e=>s(new Set([e])),removeShapes:e=>s(e),bringToFront:e=>o(t=>[...t.filter(t=>!e.has(t.id)),...t.filter(t=>e.has(t.id))],z),sendToBack:e=>o(t=>[...t.filter(t=>e.has(t.id)),...t.filter(t=>!e.has(t.id))],z),bringForward:e=>o(t=>{let n=[...t];for(let t=n.length-2;t>=0;--t)e.has(n[t].id)&&!e.has(n[t+1].id)&&([n[t],n[t+1]]=[n[t+1],n[t]]);return n},z),sendBackward:e=>o(t=>{let n=[...t];for(let t=1;t<n.length;t+=1)e.has(n[t].id)&&!e.has(n[t-1].id)&&([n[t],n[t-1]]=[n[t-1],n[t]]);return n},z),group:e=>{let t=ie();o(n=>st(n,e,t),z)},ungroup:e=>o(t=>ct(t,e),z)}},Mt=.02;function B(e){return{hasX:e.includes(`e`)||e.includes(`w`),hasY:e.includes(`n`)||e.includes(`s`)}}function V(e,t){let n=e.x+e.width/2;t.includes(`w`)?n=e.x+e.width:t.includes(`e`)&&(n=e.x);let r=e.y+e.height/2;return t.includes(`n`)?r=e.y+e.height:t.includes(`s`)&&(r=e.y),{x:n,y:r}}function H(e,t,n,r){let i=(e.width||1)/(e.height||1),a=B(t);if(a.hasX&&a.hasY){let a=V(e,t),o=ne(t),s=Math.max(Mt,h(n.x,a.x,o.x)/(e.width||1),h(n.y,a.y,o.y)/(e.height||1)),c=Math.min(1,Math.max(r?.width?r.width/(e.width||1):0,r?.height?r.height*i/(e.width||1):0)),l=(e.width||1)*Math.max(s,c),u=l/i;return{x:o.x===1?a.x:a.x-l,y:o.y===1?a.y:a.y-u,width:l,height:u}}let o=g(e,t,n,r);if(a.hasX){let t=o.width,n=t/i;return{x:o.x,y:e.y+e.height/2-n/2,width:t,height:n}}let s=o.height,c=s*i;return{x:e.x+e.width/2-c/2,y:o.y,width:c,height:s}}function Nt(e,t,n,r,i){let a=_(e),{hasX:o,hasY:s}=B(t.handle),c=o?Math.abs(n.x-r.x):a.width/2,l=s?Math.abs(n.y-r.y):a.height/2;if(e.type===`image`||i.shift&&o&&s){let e=(a.width||1)/(a.height||1);o&&s?c/e>=l?l=c/e:c=l*e:o?l=c/e:c=l*e}return{...e,x:r.x-c,y:r.y-l,width:c*2,height:l*2}}var U=()=>({x:!1,y:!1}),W=()=>({x:!0,y:!0}),Pt={resize:{box:(e,t,n,r)=>{let i=B(t.handle);return r.shift&&i.hasX&&i.hasY?{...e,...H(_(e),t.handle,n)}:{...e,...g(_(e),t.handle,n,{height:e.minHeight??0})}},snapAxes:W,aboutCentre:Nt,live:(e,t,n)=>t?.type===`rectangle`?B(n).hasY?{...e,minHeight:t.minHeight,autoHeightFrom:void 0}:{...e,minHeight:t.minHeight,height:t.height,autoHeightFrom:t.autoHeightFrom}:e},draft:{drawn:`box`,finalize:e=>{if(Math.abs(e.width)<3&&Math.abs(e.height)<3){let t=m(e.kind);return{...e,width:t.width,height:t.height}}return e}},link:{get:e=>e.link,set:(e,t)=>({...e,link:t})},quickConnects:!0};function G(e,t){let r=_(e,t),i=n(e,t),a=ee(e)*Math.PI/180;if(!a)return{body:r,footprint:i,toLocal:e=>e,toWorld:e=>e};let o={x:r.x+r.width/2,y:r.y+r.height/2};return{body:r,footprint:i,toLocal:e=>le(e,o,-a),toWorld:e=>le(e,o,a)}}function Ft(e,t,n){let r=G(e,n);return se(r.toLocal(t),r.footprint)}function It(e){if(e.type===`line`)return e.points;if(e.type===`arrow`){let t=e.elbowPoints??e.elbowRoute;return e.bendStyle===`elbow`&&t&&t.length>=2?t:[{x:e.x,y:e.y},{x:e.x2,y:e.y2}]}return null}function Lt(e){return e.type===`line`||e.type===`arrow`&&e.bendStyle!==`elbow`&&!e.bend}function Rt(e,t){let n=[];for(let r of e){if(r.id===t)continue;let e=$(r).snapPoints;if(e){n.push(...e(r));continue}let{body:i,toWorld:a}=G(r),o=[i.x,i.x+i.width/2,i.x+i.width],s=[i.y,i.y+i.height/2,i.y+i.height];for(let e of o)for(let t of s)n.push({point:a({x:e,y:t}),attach:null})}return n}function zt(e,t){let n=[];for(let r of e){if(r.id===t||r.type!==`line`&&r.type!==`arrow`||r.type===`arrow`&&r.bendStyle!==`elbow`&&r.bend)continue;let e=It(r);if(!e)continue;let i=Lt(r);for(let t=0;t<e.length-1;t+=1)n.push({a:e[t],b:e[t+1],attach:i?{shapeId:r.id,seg:t,t:0}:null})}return n}var K=256,Bt=4;function Vt(e,t){return`${e},${t}`}function Ht(e){let t=new Map;return e.forEach((e,n)=>{let r=Vt(Math.floor(e.point.x/K),Math.floor(e.point.y/K)),i=t.get(r);i?i.push(n):t.set(r,[n])}),t}function Ut(e,t,n){let r=Math.floor((t.x-n)/K),i=Math.floor((t.x+n)/K),a=Math.floor((t.y-n)/K),o=Math.floor((t.y+n)/K);if(!Number.isFinite(r+i+a+o)||i-r>Bt||o-a>Bt)return e.points;e.grid??=Ht(e.points);let s=[];for(let t=r;t<=i;t+=1)for(let n=a;n<=o;n+=1){let r=e.grid.get(Vt(t,n));for(let e of r??[])s.push(e)}return s.sort((e,t)=>e-t),s.map(t=>e.points[t])}var q=null;function Wt(e,t,n){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r]&&(e[r].id!==n||t[r].id!==n))return!1;return!0}function Gt(e,t){return q&&q.excludeId===t&&Wt(q.shapes,e,t)||(q={shapes:e,excludeId:t,points:Rt(e,t),grid:null,segments:null}),q}function Kt(e,t,n){let r=null,i=n;for(let n of t){let t=y(e,n.point);t<=i&&(r={point:n.point,attach:n.attach},i=t)}return r}function qt(e,t,n){let r=null,i=n;for(let n of t){let t=ce(e,n.a,n.b),a=y(e,t);if(a<=i){let e=y(n.a,n.b);r={point:t,attach:n.attach&&e?{...n.attach,t:y(n.a,t)/e}:null},i=a}}return r}function Jt(e,t,n,r,i){let a=Gt(t,r),o=Kt(e,Ut(a,e,n),n);if(i){let t=o?y(e,o.point):n;for(let n of i){let r=y(e,n);r<=t&&(o={point:n,attach:null},t=r)}}return o||(a.segments??=zt(t,r),qt(e,a.segments,n))}function Yt(e,{shapes:t,disconnect:n,measurement:r}){if(Math.hypot(e.x2-e.x,e.y2-e.y)<3)return null;let i={x:e.x2,y:e.y2},a=n?null:Ce(t,i,e.id,r),o=n?null:e.startBinding,s=a?Te(a,i,r):null;if(!a&&!n){let n=Jt(i,t,.01,e.id);n?.attach&&(s={kind:`path`,...n.attach})}return o&&s&&o.shapeId===s.shapeId&&!we(o)&&(o=null,s=null),{...e,startBinding:o,endBinding:s}}var Xt=16,Zt={resize:{box:null,snapAxes:U},draft:{drawn:`connector`,finalize:Yt},hit:{centerline:e=>{if(e.bendStyle===`elbow`)return a(e);let t=l(e);return t?Array.from({length:17},(e,n)=>t.pointAt(n/Xt)):[{x:e.x,y:e.y},{x:e.x2,y:e.y2}]}},snapPoints:e=>[{point:{x:e.x,y:e.y},attach:{shapeId:e.id,seg:0,t:0}},{point:{x:e.x2,y:e.y2},attach:{shapeId:e.id,seg:0,t:1}}]},J=[{handle:`nw`,cursor:`nwse-resize`},{handle:`ne`,cursor:`nesw-resize`},{handle:`sw`,cursor:`nesw-resize`},{handle:`se`,cursor:`nwse-resize`}],Y=[{handle:`n`,cursor:`ns-resize`},{handle:`w`,cursor:`ew-resize`},{handle:`e`,cursor:`ew-resize`},{handle:`s`,cursor:`ns-resize`}],Qt=[{handle:`n`,cursor:`ns-resize`},{handle:`w`,cursor:`ew-resize`},{handle:`e`,cursor:`ew-resize`},{handle:`s`,cursor:`ns-resize`}],$t=Y.filter(e=>e.handle===`w`||e.handle===`e`),en=Y.filter(e=>e.handle===`n`||e.handle===`s`);function tn(e){switch(x[e.kind].resize){case`width`:return{edges:$t,corners:[]};case`height`:return{edges:en,corners:[]};case`aspect`:return{edges:[],corners:J};default:return{edges:Y,corners:J}}}var nn={resize:{box:(e,t,n,r)=>t.textStart?p(e,t.handle,n,t.textStart,r.alt):null,snapAxes:U},draft:{drawn:`none`},selection:{handles:()=>({edges:Qt,corners:J})}},rn={resize:{box:null,snapAxes:U},draft:{drawn:`none`},selection:{duplicateDots:!0}},an={resize:{box:(e,t,n)=>{let r=_(e),i=g(r,t.handle,n),a=r.width?i.width/r.width:1,o=r.height?i.height/r.height:1;return v(e,e=>({x:i.x+(e.x-r.x)*a,y:i.y+(e.y-r.y)*o}))},snapAxes:U},draft:{drawn:`stroke`,finalize:e=>e.points.length>=2?e:null,keepsTool:!0},hit:{centerline:e=>e.points,inkWidth:re},snapPoints:()=>[]},on={resize:{box:(e,t,n)=>{let r=_(e),i=g(r,t.handle,n),a=r.width?i.width/r.width:1,o=r.height?i.height/r.height:1;return v(e,e=>({x:i.x+(e.x-r.x)*a,y:i.y+(e.y-r.y)*o}))},snapAxes:U},draft:{drawn:`none`}},sn={resize:{box:(e,t,n)=>{let r=_(e),i=g(r,t.handle,n),a=r.width?i.width/r.width:1,o=r.height?i.height/r.height:1;return v(e,e=>({x:i.x+(e.x-r.x)*a,y:i.y+(e.y-r.y)*o}))},snapAxes:U},draft:{drawn:`none`},hit:{centerline:e=>e.points},snapPoints:e=>{let t=e.points.length-1;return e.points.map((n,r)=>({point:n,attach:{shapeId:e.id,seg:r===t?t-1:r,t:+(r===t)}}))}},cn={resize:{box:(e,t,n)=>({...e,...H(_(e),t.handle,n)}),snapAxes:U,aboutCentre:Nt},draft:{drawn:`none`}},ln=16;function un(e,t,n,r){let i=t.iconFootprint??_(e),a=_(e),{hasX:o,hasY:s}=B(t.handle),c;if(r.alt){let e=i.x+i.width/2,t=i.y+i.height/2,r=Math.abs(n.x-e)*2/i.width,a=Math.abs(n.y-t)*2/i.height;c=o&&s?Math.max(r,a):o?r:a}else{let e=V(i,t.handle),r=ne(t.handle),a=h(n.x,e.x,r.x)/i.width,l=h(n.y,e.y,r.y)/i.height;c=o&&s?Math.max(a,l):o?a:l}let l=Math.max(a.width,a.height),u=Math.max(ln,l*c),d=l?u/l:1,f=i.width*d,p=i.height*d,m,g;if(r.alt)m=i.x+i.width/2-f/2,g=i.y+i.height/2-p/2;else{let e=V(i,t.handle);m=o?t.handle.includes(`w`)?e.x-f:e.x:i.x+i.width/2-f/2,g=s?t.handle.includes(`n`)?e.y-p:e.y:i.y+i.height/2-p/2}return{...e,x:m+(a.x-i.x)*d,y:g+(a.y-i.y)*d,width:a.width*d,height:a.height*d,fontSize:Math.max(6,Math.round((e.fontSize??36)*d))}}var dn={resize:{box:un,snapAxes:U},draft:{drawn:`icon`,finalize:e=>e.width<3&&e.height<3?{...e,...Ee(e.source,e.name)}:e,consumesPick:`icon`},quickConnects:!0},fn={resize:{box:(e,t,n)=>({...e,...g(_(e),t.handle,n)}),snapAxes:W},draft:{drawn:`box`,finalize:e=>{if(Math.abs(e.width)<3&&Math.abs(e.height)<3){let t=ye[e.kind??`simple`];return{...e,width:t.width,height:t.height}}return e}},selection:{titleAbove:!0},formattedText:!1},pn=20,mn={resize:{box:(e,t,n)=>{let r=_(e),i=g(r,t.handle,n),a=r.width?i.width/r.width:1;return{...e,x:i.x,colWidths:e.colWidths.map(e=>Math.max(pn,e*a))}},snapAxes:()=>({x:!0,y:!1})},draft:{drawn:`none`}},X={width:Oe.width/2,height:Oe.height/2},hn={resize:{box:(e,t,n)=>{let r=X;return{...e,...g(_(e),t.handle,n,r)}},snapAxes:W},draft:{drawn:`box`,minSize:()=>X,finalize:e=>{let t=_(e);if(t.width<3&&t.height<3){let n=De(e.chartType);return{...e,x:t.x,y:t.y,width:n.width,height:n.height}}return{...e,x:t.x,y:t.y,width:Math.max(t.width,X.width),height:Math.max(t.height,X.height)}}}},gn=new Set([`image`,`avatar`,`divider`,`progress`,`slider`,`scrollbar`,`rating`,`lifeline`]);function Z(e){return gn.has(e.kind)?null:me[e.kind]}var _n={resize:{box:(e,t,n)=>{let r=_(e),i=x[e.kind];if(i.resize===`aspect`)return{...e,...H(r,t.handle,n,{width:24,height:24})};let a=i.resize===`free`?Z(e)??{width:24,height:16}:{width:24,height:16},o=g(r,t.handle,n,a);return i.resize===`width`?{...e,x:o.x,y:r.y,width:o.width,height:r.height}:i.resize===`height`?{...e,x:r.x,y:o.y,width:r.width,height:o.height}:e.kind===`lifeline`&&B(t.handle).hasX?{...e,...o,widthManual:!0}:{...e,...o}},snapAxes:e=>{let t=x[e.kind];return t.resize===`width`?{x:!0,y:!1}:t.resize===`height`?{x:!1,y:!0}:t.resize===`free`?{x:!0,y:!0}:{x:!1,y:!1}}},draft:{drawn:`box`,minSize:Z,finalize:e=>{let t=_(e),n=Z(e);if(n)return{...e,x:t.x,y:t.y,width:Math.max(t.width,n.width),height:Math.max(t.height,n.height)};if(t.width<3&&t.height<3){let n=me[e.kind];return{...e,x:t.x,y:t.y,width:n.width,height:n.height}}return e},consumesPick:`control`},selection:{handles:tn},link:{get:e=>e.link,set:(e,t)=>({...e,link:t})}},vn={width:80,height:60},yn={resize:{box:(e,t,n,r)=>{let i=B(t.handle),a=e.keepAspect===!0||r.shift&&i.hasX&&i.hasY,o=_(e);return{...e,...a?H(o,t.handle,n,vn):g(o,t.handle,n,vn)}},snapAxes:e=>e.keepAspect?{x:!1,y:!1}:{x:!0,y:!0}},draft:{drawn:`none`}},bn={width:8,height:8},Q={rectangle:Pt,arrow:Zt,text:nn,sticky:rn,draw:an,polygon:on,line:sn,image:cn,icon:dn,figure:fn,table:mn,chart:hn,control:_n,web:yn,custom:{resize:{box:(e,t,n,r)=>{let i=de(e.kind),a=i?.minSize??bn,o=B(t.handle),s=i?.keepAspect===!0||r.shift&&o.hasX&&o.hasY,c=_(e);return{...e,...s?H(c,t.handle,n,a):g(c,t.handle,n,a)}},snapAxes:e=>de(e.kind)?.keepAspect?{x:!1,y:!1}:{x:!0,y:!0}},draft:{drawn:`none`},interactsOnEdit:e=>Ae(e.kind)?.component!==void 0}};function $(e){let t=e.type;switch(t){case`rectangle`:return Q.rectangle;case`arrow`:return Q.arrow;case`text`:return Q.text;case`sticky`:return Q.sticky;case`draw`:return Q.draw;case`polygon`:return Q.polygon;case`line`:return Q.line;case`image`:return Q.image;case`icon`:return Q.icon;case`figure`:return Q.figure;case`table`:return Q.table;case`chart`:return Q.chart;case`control`:return Q.control;case`web`:return Q.web;case`custom`:return Q.custom;default:return xn(t)}}function xn(e){throw Error(`no definition for shape type ${String(e)}`)}function Sn(e){return e.kind===`none`?null:e.shapeId}function Cn(e,t){if(e.kind===`none`||e.shapeId!==t)return{kind:`none`};switch(e.kind){case`text`:return{kind:`text`,field:e.field};case`table-cell`:return{kind:`table-cell`,row:e.row,col:e.col};case`lane`:return{kind:`lane`,lane:e.lane};case`crop`:return{kind:`crop`};case`chart-data`:return{kind:`chart-data`};case`vertices`:return{kind:`vertices`};case`interact`:return{kind:`interact`};default:return e}}function wn(e){return e.kind===`crop`||e.kind===`vertices`}function Tn(e){return wn(e)||e.kind===`interact`}function En(e){return e.kind===`text`||e.kind===`table-cell`||e.kind===`lane`}function Dn(e,t){if(e.kind!==`text`)return!1;let n=fe(t,e.shapeId);return!n||$(n).formattedText!==!1}function On(e){return Number.isFinite(e)?Math.max(0,Math.trunc(e)):0}var kn=(e,t)=>{let n=I(e);return{tool:`select`,selectedIds:new Set,erasingIds:new Set,editSession:{kind:`none`},tableSelection:null,hoveredId:null,activeGroupId:null,style:ae,shapeKind:`rectangle`,chartKind:`bar`,frameKind:`simple`,pendingIcon:null,pendingControl:null,toolLock:!1,lockRevealId:null,setTool:t=>e(e=>{let n=F(t,e.tool);return n===e.tool?e:e.tool===`highlight`&&n===`select`?{tool:n,style:ae}:{tool:n}}),releaseTool:()=>e(e=>e.toolLock?e:{tool:`select`}),placeShape:(e,n)=>{let r=t();r.addShape(e),r.setSelectedIds(new Set([e.id])),n?.edit&&r.beginTextEdit(e.id),r.releaseTool()},setSelectedIds:n(`selectedIds`),setErasingIds:n(`erasingIds`),beginTextEdit:(t,n=`label`)=>e({editSession:{kind:`text`,shapeId:t,field:n}}),beginTableCellEdit:(t,n,r)=>e({editSession:{kind:`table-cell`,shapeId:t,row:On(n),col:On(r)}}),beginLaneEdit:(t,n)=>e({editSession:{kind:`lane`,shapeId:t,lane:On(n)}}),beginCrop:t=>e({editSession:{kind:`crop`,shapeId:t}}),beginChartDataEdit:t=>e({editSession:{kind:`chart-data`,shapeId:t}}),beginVertexEdit:t=>e({editSession:{kind:`vertices`,shapeId:t}}),beginInteract:t=>e({editSession:{kind:`interact`,shapeId:t}}),endEdit:t=>e(e=>{let n=e.editSession;return n.kind===`none`||t!==void 0&&n.shapeId!==t?e:{editSession:{kind:`none`}}}),setTableSelection:n(`tableSelection`),setHoveredId:t=>e(e=>{let n=F(t,e.hoveredId);return n===e.hoveredId?e:{hoveredId:n}}),setActiveGroupId:n(`activeGroupId`),setStyle:n(`style`),setShapeKind:n(`shapeKind`),setChartKind:n(`chartKind`),setFrameKind:n(`frameKind`),setPendingIcon:n(`pendingIcon`),setPendingControl:n(`pendingControl`),setToolLock:n(`toolLock`),setLockRevealId:n(`lockRevealId`)}},An=e=>{let t=I(e),n={slidePickerOpen:!1,animateSlideId:null},r=e=>({rightPanel:e,...e===`slides`?{}:n,...e===`flow`?{}:{flowEdit:null}}),i=(e,t)=>e.rightPanel===t?{rightPanel:null}:void 0;return{iconPickerOpen:!1,imageLibraryOpen:!1,rightPanel:null,slidePickerOpen:!1,notesEditorId:null,animateSlideId:null,flowEdit:null,flowPlay:null,flowPreview:null,lastFlow:{},codeSeed:null,pendingBoard:null,textAiSignInOpen:!1,textAiUpgradeOpen:!1,embedSignInOpen:!1,paletteOpen:!1,exportDialog:null,imageToCopy:null,toolDrawerOpen:!1,searchOpen:!1,zenMode:!1,rideMode:!1,viewMode:!1,viewModeLocked:!1,presentingIndex:null,pasteChoiceGrid:null,aiGhost:null,aiPrompt:null,deviceMode:`desktop`,coarsePointer:!1,setIconPickerOpen:t(`iconPickerOpen`),setImageLibraryOpen:t(`imageLibraryOpen`),setSlidesOpen:t=>e(e=>F(t,e.rightPanel===`slides`)?r(`slides`):{...i(e,`slides`),...n}),setSlidePickerOpen:t(`slidePickerOpen`),setNotesEditorId:t(`notesEditorId`),setAnimateSlideId:t=>e(t===null?{animateSlideId:null}:{animateSlideId:t,rightPanel:`slides`,tool:`select`,pendingIcon:null,pendingControl:null}),setFlowEdit:t=>e(e=>t===null?{flowEdit:null,...i(e,`flow`)}:{...r(`flow`),flowEdit:t,flowPreview:null,tool:`select`,pendingIcon:null,pendingControl:null}),patchFlowEdit:t=>e(e=>e.flowEdit?{flowEdit:{...e.flowEdit,...t}}:{}),setFlowPreview:t(`flowPreview`),setFlowsOpen:t=>e(e=>F(t,e.rightPanel===`flow`&&e.flowEdit===null)?{...r(`flow`),flowEdit:null}:{flowEdit:null,...i(e,`flow`)}),setFlowPlay:t=>e(e=>t?{flowPlay:t,flowPreview:null,...!t.trail?.length&&e.lastFlow[t.frameId]!==t.flowId?{lastFlow:{...e.lastFlow,[t.frameId]:t.flowId}}:{}}:{flowPlay:null}),setAiOpen:t=>e(e=>{let n=F(t,e.rightPanel===`ai`);return n&&e.viewMode?e:n?r(`ai`):i(e,`ai`)??e}),setCodeOpen:t=>e(e=>{let n=F(t,e.rightPanel===`code`);return n&&e.viewMode?e:n?r(`code`):i(e,`code`)??e}),setCodeSeed:t=>e({codeSeed:t}),setPendingBoard:t=>e({pendingBoard:t}),setTextAiSignInOpen:t(`textAiSignInOpen`),setTextAiUpgradeOpen:t(`textAiUpgradeOpen`),setEmbedSignInOpen:t(`embedSignInOpen`),setPaletteOpen:t(`paletteOpen`),setExportDialog:t(`exportDialog`),setImageToCopy:t=>e({imageToCopy:t}),setToolDrawerOpen:t(`toolDrawerOpen`),setSearchOpen:t(`searchOpen`),setZenMode:t(`zenMode`),setRideMode:t(`rideMode`),setViewMode:t=>e(e=>{let n=F(t,e.viewMode);return n?{viewMode:n,tool:`select`,editSession:{kind:`none`},pendingIcon:null,pendingControl:null,erasingIds:new Set,toolDrawerOpen:!1,...e.rightPanel===`ai`||e.rightPanel===`code`?{rightPanel:null}:{}}:e.viewModeLocked?e:{viewMode:n}}),setViewModeLocked:t=>e({viewModeLocked:t}),setPresentingIndex:t(`presentingIndex`),setPasteChoiceGrid:t(`pasteChoiceGrid`),setAiGhost:t=>e({aiGhost:t}),askAi:(t,n=!1)=>e(e=>e.viewMode?e:{...r(`ai`),aiPrompt:{text:t,send:n}}),setAiPrompt:t=>e({aiPrompt:t}),setDeviceMode:t(`deviceMode`),setCoarsePointer:t(`coarsePointer`)}},jn=e=>{let t=I(e),n=k;return{showGrid:n.showGrid,snapEnabled:n.snapEnabled,theme:n.theme,presentationAnimation:n.presentationAnimation,showZoomIndicator:n.showZoomIndicator,setShowGrid:t(`showGrid`),setSnapEnabled:t(`snapEnabled`),setTheme:t(`theme`),setPresentationAnimation:t(`presentationAnimation`),setShowZoomIndicator:t(`showZoomIndicator`)}},Mn=e=>({remoteCursors:new Map,lastPeerPointers:new Map,setRemoteCursors:t=>e(e=>{let n=e.lastPeerPointers;for(let r of t.values()){let t=n.get(r.peerId);t&&t.at>=r.at||(n===e.lastPeerPointers&&(n=new Map(n)),n.set(r.peerId,{x:r.x,y:r.y,at:r.at}))}return{remoteCursors:t,lastPeerPointers:n}})}),Nn=e=>({openThreadId:null,commentDraft:null,commentsVisible:!0,setOpenThreadId:t=>e({openThreadId:t,commentDraft:null}),setCommentDraft:t=>e(t?{commentDraft:t,openThreadId:null,commentsVisible:!0}:{commentDraft:null}),setCommentsVisible:I(e)(`commentsVisible`)}),Pn={isPanning:!1,dragging:!1,transforming:!1,resizing:!1,marquee:null,lasso:null,bindTarget:null,snapDot:null};function Fn(e){return e.isPanning||e.dragging||e.transforming||e.draft!==null||e.marquee!==null||e.lasso!==null}var In=e=>{let t=I(e);return{draft:null,polyDraft:null,marquee:null,lasso:null,bindTarget:null,snapDot:null,hoverWorld:null,snapGuides:[],isPanning:!1,dragging:!1,transforming:!1,resizing:!1,eraserTrail:``,selectionFrame:null,setDraft:t(`draft`),setPolyDraft:t(`polyDraft`),setMarquee:t(`marquee`),setLasso:t(`lasso`),setBindTarget:t(`bindTarget`),setSnapDot:t(`snapDot`),setHoverWorld:t(`hoverWorld`),setSnapGuides:t(`snapGuides`),setIsPanning:t(`isPanning`),setDragging:t(`dragging`),setTransforming:t(`transforming`),setResizing:t(`resizing`),setEraserTrail:t(`eraserTrail`),setSelectionFrame:t(`selectionFrame`),clearSnapGuides:()=>e(e=>e.snapGuides.length===0?e:{snapGuides:[]}),resetGestureVisuals:()=>e(e=>e.snapGuides.length===0&&Object.keys(Pn).every(t=>e[t]===Pn[t])?e:{...Pn,snapGuides:[]})}};function Ln(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var Rn=e=>{let t=I(e);return{liveWebIds:new Set,startedWebIds:new Set,webEmbedDialog:null,webHtmlEditorId:null,widgetSizes:new Map,setLiveWebIds:t=>e(e=>Ln(e.liveWebIds,t)?e:{liveWebIds:new Set(t)}),startWeb:t=>e(e=>e.startedWebIds.has(t)?e:{startedWebIds:new Set([...e.startedWebIds,t])}),stopWeb:t=>e(e=>{if(!e.startedWebIds.has(t))return e;let n=new Set(e.startedWebIds);return n.delete(t),{startedWebIds:n}}),setWebEmbedDialog:t(`webEmbedDialog`),setWebHtmlEditorId:t(`webHtmlEditorId`),setWidgetSize:(t,n)=>e(e=>{let r=e.widgetSizes.get(t);if(n===null?!r:r?.width===n.width&&r.height===n.height)return e;let i=new Map(e.widgetSizes);return n===null?i.delete(t):i.set(t,n),{widgetSizes:i}})}},zn=200;function Bn(e){let t={holding:()=>!1},n=Me()(Ie((...t)=>({...jt(e)(...t),...kn(...t),...An(...t),...jn(...t),...Mn(...t),...Nn(...t),...At(...t),...In(...t),...Rn(...t)}),{partialize:e=>({shapes:e.shapes,opaqueShapes:e.opaqueShapes}),equality:(e,n)=>e.shapes===n.shapes||t.holding(),limit:zn}));return Object.assign(n,{historyGate:t})}function Vn(e,t){let n=Bn(t);return e&&(n.getState().hydrate(e.document,e.viewport,e.preferences),n.temporal.getState().clear()),n}var Hn=(0,S.createContext)(null),Un=Hn.Provider;function Wn(){let e=(0,S.useContext)(Hn);if(!e)throw Error(`useEditorRuntime must be called under a mounted <Canvas>. Editor hooks and commands resolve through the canvas's own runtime.`);return e}function Gn(){return Wn().store}function Kn(e){return Pe(Gn(),e)}function qn(e,t,n){let r=(0,S.useRef)(null);return Kn(i=>{let a=e(i),o=r.current;if(o&&Jn(o.inputs,a))return o.value;let s=t(...a),c=o&&n?.(o.value,s)?o.value:s;return r.current={inputs:a,value:c},c})}function Jn(e,t){return e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]))}function Yn(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{_t as A,Pe as B,B as C,N as D,wt as E,ot as F,ke as H,E as I,$e as L,pt as M,ft as N,Et as O,D as P,Qe as R,V as S,Dt as T,Ae as V,Y as _,Wn as a,G as b,Fn as c,En as d,wn as f,J as g,$ as h,qn as i,vt as j,gt as k,Sn as l,Dn as m,Vn as n,Kn as o,Cn as p,Yn as r,Gn as s,Un as t,Tn as u,Jt as v,A as w,Mt as x,Ft as y,qe as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./layout.worker-
|
|
1
|
+
import{n as e,t}from"./layout.worker-B99h3Wv0.js";var n=t(((t,n)=>{(function(e){if(typeof t==`object`&&n!==void 0)n.exports=e();else if(typeof define==`function`&&define.amd)define([],e);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=e()}})(function(){return(function(){function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s<i.length;s++)a(i[s]);return a}return t})()({1:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;function r(e){"@babel/helpers - typeof";return r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function o(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=c(e,`string`);return r(t)==`symbol`?t:t+``}function c(e,t){if(r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||`default`);if(r(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}n.default=function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,a=r===void 0?{}:r,o=n.algorithms,s=o===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:o,c=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=a,this.initialized=!1,u===void 0&&c===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=c;u!==void 0&&c===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new l(f),this.worker.postMessage({cmd:`register`,algorithms:s}).then(function(e){return t.initialized=!0}).catch(console.err)}return o(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i!==void 0&&i,o=t.measureExecutionTime,s=o!==void 0&&o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}])}();var l=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return o(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}])}()},{}],2:[function(e,t,n){var r=e("./elk-api.js").default;Object.defineProperty(t.exports,"__esModule",{value:!0}),t.exports=r,r.default=r},{"./elk-api.js":1}]},{},[2])(2)})}));export default n();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/elk-api-CdZ15eos.js","assets/rolldown-runtime-aKtaBQYM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{n as t,t as n}from"./icons-K7FjuB-c.js";import{t as r}from"./preload-helper-Czpn1I53.js";import{c as i,o as a,u as o}from"./text-breaks-BDwq8Wxj.js";import{t as s}from"./blob-CTPsKWYv.js";import{n as c}from"./theme-palette-DZtiNUYJ.js";function l(e){let t=null;function n(){if(!t){let n=e();t=n,n.catch(()=>{t===n&&(t=null)})}return t}return{async layout(e){return await(await n()).layout(e)}}}async function u(){let{default:e}=await r(async()=>{let{default:e}=await import(`./elk-in-process-absent-CzI8UVp-.js`);return{default:e}},[]);return new e}function d(){return{async inline(e){let t=document.baseURI,n=t?new URL(e,t).href:e;try{return await s(await f(n))}catch(t){return o(`asset-inline`,t,e),null}}}}async function f(e){let t=await fetch(e,{cache:`force-cache`}).catch(()=>null),n=t?.ok?t:await fetch(e,{cache:`reload`});if(!n.ok)throw Error(`asset request failed with ${n.status}`);let r=await n.blob();if(!r.type.startsWith(`image/`))throw Error(`asset was ${r.type||`untyped`}, not an image`);return r}function p(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}function m(){let e=[];for(let t of Array.from(document.styleSheets)){let n=null;try{n=t.cssRules}catch{continue}if(n)for(let t of Array.from(n)){if(!(t instanceof CSSFontFaceRule))continue;let n=t.style,r=[...n.getPropertyValue(`src`).matchAll(/url\(\s*["']?([^"')]+)["']?\s*\)/g)].map(e=>e[1]);r.length!==0&&e.push({family:n.getPropertyValue(`font-family`).replace(/['"]/g,``).trim(),weight:n.getPropertyValue(`font-weight`)||`400`,style:n.getPropertyValue(`font-style`)||`normal`,unicodeRange:n.getPropertyValue(`unicode-range`),srcUrls:r})}}return e}function h(e){return e.find(e=>e.includes(`.woff2`))??e[0]}function g(e){return e.includes(`.woff2`)?`woff2`:e.includes(`.woff`)?`woff`:e.includes(`.otf`)?`opentype`:e.includes(`.ttf`)?`truetype`:`woff2`}async function _(e){return s(await(await fetch(e,{cache:`force-cache`})).blob())}function v(e,t){let n=e.unicodeRange?` unicode-range: ${e.unicodeRange};\n`:``;return`@font-face {\n font-family: "${e.family}";\n font-style: ${e.style};\n font-weight: ${e.weight};\n font-display: swap;\n src: url(${t}) format("${g(h(e.srcUrls))}");\n`+n+`}`}function y(){let e=new Map,t=t=>{let n=e.get(t);return n||(n=_(t),n.catch(()=>e.delete(t)),e.set(t,n)),n};return{async embed(e,n){let{families:r,bold:s,italic:c,codepoints:l}=e;if(r.size===0)return``;if(n&&n.length>0)return a(e,n,p);let u=m(),d=[];for(let e of r){let n=u.filter(t=>t.family===e&&(s||t.weight.trim()!==`700`)&&(c||t.style!==`italic`)&&i(t.unicodeRange,l));for(let e of n)try{let n=await t(new URL(h(e.srcUrls),document.baseURI).href);d.push(v(e,n))}catch(t){o(`font-embed`,t,e.family)}}return d.join(`
|
|
3
|
+
`)}}}function b(e,t,n,r){return`${r?`italic `:``}${n??400} ${e}px ${t}`}function x(e,t,n,r,i,a){return e.font=b(n,r,i,a),e.measureText(t).width}function S(e,t){return e.length*t*.6}function C(){let e=null,t=!1,n=()=>(t||=(e=document.createElement(`canvas`).getContext(`2d`),!0),e);return{prepare:()=>Promise.resolve(),measure:(e,t,r,i,a)=>{let o=n();return o?x(o,e,t,r,i,a):S(e,t)}}}function w(){if(typeof document>`u`)return{...c};let e=getComputedStyle(document.documentElement),t=(t,n)=>e.getPropertyValue(t).trim()||n;return{bg:t(`--canvas-bg`,c.bg),ink:t(`--canvas-ink`,c.ink),inkMuted:t(`--canvas-ink-muted`,c.inkMuted),inkInverse:t(`--canvas-ink-inverse`,c.inkInverse),paperBg:t(`--paper-bg`,c.paperBg),paperGrid:t(`--paper-grid`,c.paperGrid),paperLine:t(`--paper-line`,c.paperLine)}}function T(){return{palette:w}}function E(e={}){let r=e.assetBase===void 0&&e.loadIconCatalog===void 0?n():t({assetBase:e.assetBase,loadCatalog:e.loadIconCatalog});return{text:C(),fonts:y(),assets:d(),icons:r,elk:l(e.elk??u),theme:T()}}async function D(){try{let[{default:t},{default:n}]=await Promise.all([r(()=>import(`./elk-api-CdZ15eos.js`).then(t=>e(t.default,1)),__vite__mapDeps([0,1])),r(()=>import(`./elk-worker.min-SDxTC6NI.js`),[])]),i=new t({workerFactory:()=>new n});return await i.layout({id:`__probe__`,children:[{id:`n`,width:1,height:1}]}),i}catch{return u()}}export{E as n,C as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./web-embed-url-CHu4SU82.js";import{i as t,n,r}from"./web-embeds-I3saJ_yp.js";function i(e){let i=e.trim();if(i.length===0)return null;if(/<iframe\b/i.test(i)){let e=n(i);return e?t(e):null}let a=r(i);if(a)return t(a);if(/\s/.test(i))return null;let o=t(i);return!o||o.provider===`generic`?null:o}function a(r){let i=r.trim();if(i.length===0)return`Paste a link to embed`;let a=/<iframe\b/i.test(i)?n(i):i;return a?e(a)?t(a)?null:`Koboyo pages can't be embedded in a board. Link to it instead`:/^http:\/\//i.test(a)?`Only secure (https) links can be embedded`:`That doesn't look like a web address`:`That embed code has no https link in it`}function o(e){let r=e.trim(),i=/<iframe\b/i.test(r)?n(r):r;return i?t(i):null}function s(e,t){let n=t.keepAspect?Math.round(e.width*t.height/t.width):e.height;return{...e,kind:`embed`,url:t.canonical,height:n,keepAspect:t.keepAspect||void 0,html:void 0,htmlSrc:void 0,poster:void 0,posterOf:void 0}}export{s as i,i as n,a as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,a as t}from"./geometry-CVRSymIE.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./shared-DKcKntwk.js";function u(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`excalidraw`&&Array.isArray(t.elements)}function d(e){return t(c(e.opacity,100)/100)}function f(e){let t=c(e.strokeWidth,2);return t<=1?1.5:t>=4?5:3}function p(e){let t=e.strokeStyle;return t===`dashed`?`dashed`:t===`dotted`?`dotted`:`solid`}function m(e){let t=c(e.fontFamily,1);return t===2||t===6?s:t===3?l:a}function h(e){return e.roundness?void 0:`sharp`}var g={rectangle:`rectangle`,ellipse:`ellipse`,diamond:`diamond`},_={arrow:`arrow`,triangle:`triangle`,triangle_outline:`triangleOutline`,bar:`bar`,dot:`circle`,circle:`circle`,circle_outline:`circleOutline`,diamond:`diamond`,diamond_outline:`diamondOutline`,crowfoot_one:`crowOne`,crowfoot_many:`crowMany`,crowfoot_one_or_many:`crowOneOrMany`};function v(e){let t=Array.isArray(e.points)?e.points:[],n=c(e.x),r=c(e.y);return t.filter(e=>Array.isArray(e)&&e.length>=2).map(e=>({x:n+c(e[0]),y:r+c(e[1])}))}function y(e,n){let r=e.pressures;if(!(e.simulatePressure!==!1||!Array.isArray(r)||r.length!==n))return r.map(e=>t(typeof e==`number`&&Number.isFinite(e)?e:.5))}function b(e){let t=Array.isArray(e.groupIds)?e.groupIds:[];return{id:r(e.id)||crypto.randomUUID(),groupId:typeof t[0]==`string`?t[0]:void 0,locked:e.locked===!0||void 0,opacity:d(e)}}function x(t){let s=t,l=s.elements.filter(e=>e&&e.isDeleted!==!0),u=s.files??{},d=new Map;for(let e of l)e.type===`text`&&typeof e.containerId==`string`&&d.set(e.containerId,e);let x=[],S=new Set,C=0;for(let t of l){let n=t.type,s=b(t);if(n===`rectangle`||n===`ellipse`||n===`diamond`){let o=d.get(s.id),l=r(t.backgroundColor,`transparent`);x.push({...s,type:`rectangle`,kind:g[n],corner:n===`rectangle`?h(t):void 0,x:c(t.x),y:c(t.y),width:c(t.width),height:c(t.height),rotation:i(t.angle),label:o?r(o.text):``,fontSize:o?c(o.fontSize,24):24,fontFamily:o?m(o):a,color:r(t.strokeColor,e),fill:!l||l===`transparent`?`transparent`:l,fillStyle:`pastel`,strokeWidth:f(t),dash:p(t)}),S.add(s.id);continue}if(n===`text`){if(typeof t.containerId==`string`)continue;x.push({...s,type:`text`,x:c(t.x),y:c(t.y),text:r(t.text),fontSize:c(t.fontSize,24),fontFamily:m(t),rotation:i(t.angle),color:r(t.strokeColor,e)});continue}if(n===`freedraw`){let n=v(t);if(n.length<2)continue;let i=y(t,n.length);x.push({...s,type:`draw`,points:n,color:r(t.strokeColor,e),strokeWidth:f(t),...i?{pressure:i}:{}});continue}if(n===`line`){let n=v(t);if(n.length<2)continue;x.push({...s,type:`line`,points:n,color:r(t.strokeColor,e),strokeWidth:f(t),dash:p(t),startArrow:!1,endArrow:!1});continue}if(n===`arrow`){let n=v(t);if(n.length<2)continue;let i=t.startBinding,a=t.endBinding,o=typeof i?.elementId==`string`||typeof a?.elementId==`string`,l=_[r(t.startArrowhead)],u=_[r(t.endArrowhead)],h=d.get(s.id);if(!o&&n.length>2){x.push({...s,type:`line`,points:n,color:r(t.strokeColor,e),strokeWidth:f(t),dash:p(t),startArrow:l!=null,endArrow:t.endArrowhead!==null,startHead:l,endHead:u??`arrow`,label:h?r(h.text):void 0});continue}let g=n[0],y=n[n.length-1],b={...s,type:`arrow`,x:g.x,y:g.y,x2:y.x,y2:y.y,bend:0,bendAlong:0,bendStyle:t.elbowed===!0?`elbow`:`curved`,startBinding:typeof i?.elementId==`string`?{shapeId:i.elementId,anchor:{x:.5,y:.5},precise:!1}:null,endBinding:typeof a?.elementId==`string`?{shapeId:a.elementId,anchor:{x:.5,y:.5},precise:!1}:null,label:h?r(h.text):void 0,fontSize:h?c(h.fontSize,24):void 0,fontFamily:h?m(h):void 0,color:r(t.strokeColor,e),strokeWidth:f(t),dash:p(t),startArrow:l!=null,endArrow:t.endArrowhead!==null,startHead:l,endHead:u??`arrow`};x.push(b);continue}if(n===`image`){let e=u[r(t.fileId)],n=e?r(e.dataURL):``;if(!n){C+=1;continue}x.push({...s,type:`image`,x:c(t.x),y:c(t.y),width:c(t.width),height:c(t.height),rotation:i(t.angle),src:n,crop:{x:0,y:0,width:1,height:1}});continue}if(n===`frame`){x.push(o(s,{x:c(t.x),y:c(t.y),width:c(t.width),height:c(t.height)},t.name)),S.add(s.id);continue}C+=1}return n(x,S),{shapes:x,skipped:C}}export{x as importExcalidraw,u as isExcalidrawData};
|