@marimo-team/frontend 0.22.5-dev2 → 0.22.5-dev21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/assets/{CellStatus-HZQ0Twqj.js → CellStatus-CP1jrQ3A.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-C9jSHm_Y.js → ConnectedDataExplorerComponent-CfU-ThkK.js} +1 -1
  3. package/dist/assets/{ImperativeModal-Ka_MU6gk.js → ImperativeModal-DoGv2BXV.js} +1 -1
  4. package/dist/assets/JsonOutput-Bk2by9qo.js +49 -0
  5. package/dist/assets/{LazyAnyLanguageCodeMirror-Bb2dITRz.js → LazyAnyLanguageCodeMirror-CoYqQxHb.js} +2 -2
  6. package/dist/assets/MarimoErrorOutput-Cyd8ikG3.js +7 -0
  7. package/dist/assets/RSPContexts-LWFBF00h.js +1 -0
  8. package/dist/assets/{RenderHTML-Cyj8OBbz.js → RenderHTML-BOW_1WUn.js} +1 -1
  9. package/dist/assets/{add-cell-with-ai-BccDsMLb.js → add-cell-with-ai-DUq7Y523.js} +9 -9
  10. package/dist/assets/{add-connection-dialog-BO_nxLQi.js → add-connection-dialog-20N0EHLl.js} +1 -1
  11. package/dist/assets/{agent-panel-BMTl3Cgd.js → agent-panel-DEza5aFa.js} +3 -3
  12. package/dist/assets/{ai-model-dropdown-CS5ryevV.js → ai-model-dropdown-B-sbS07W.js} +4 -4
  13. package/dist/assets/{any-language-editor-BKxF_o5k.js → any-language-editor-DYgTL8eG.js} +1 -1
  14. package/dist/assets/app-config-button-CJFpYJ_2.js +1 -0
  15. package/dist/assets/{cache-panel-PA0cVzei.js → cache-panel-8E_Y5OSb.js} +1 -1
  16. package/dist/assets/{cell-editor-qLPKK49y.js → cell-editor-DLL6kX__.js} +11 -11
  17. package/dist/assets/{cell-link-CY7i_e4O.js → cell-link-Dtonmtv_.js} +1 -1
  18. package/dist/assets/{cells-CuaAKcwV.js → cells-BVG4a-Qn.js} +42 -42
  19. package/dist/assets/{chat-display-BLYrUQhO.js → chat-display-DsIGz-Wy.js} +1 -1
  20. package/dist/assets/{chat-panel-w9jaKRAD.js → chat-panel-aXOgktdv.js} +2 -2
  21. package/dist/assets/{chat-ui-BqpUGrwS.js → chat-ui-C--RApyx.js} +4 -4
  22. package/dist/assets/{column-preview-Dk6-wUK-.js → column-preview-CB_HZPdz.js} +1 -1
  23. package/dist/assets/{command-DkwDd6Ey.js → command-DvF_4mQa.js} +1 -1
  24. package/dist/assets/{command-palette-C0hZrhup.js → command-palette-DLKNdcX_.js} +1 -1
  25. package/dist/assets/{common-CL1iSwod.js → common-CLVI2BhO.js} +1 -1
  26. package/dist/assets/{components-CBihADZo.js → components-CGwwQ0Y4.js} +1 -1
  27. package/dist/assets/{components-CtOW1DR4.js → components-DiALLQRt.js} +1 -1
  28. package/dist/assets/{copy-icon-n6r2uyq3.js → copy-icon-BGs1Pbai.js} +1 -1
  29. package/dist/assets/{datasource-DwmhT5-D.js → datasource-BzTPyEw3.js} +1 -1
  30. package/dist/assets/{dependency-graph-panel-3AdEtWPZ.js → dependency-graph-panel-Pxmnzmd4.js} +1 -1
  31. package/dist/assets/{diagram-PSM6KHXK-D6nw8Fvd.js → diagram-PSM6KHXK-UdiW7QQb.js} +1 -1
  32. package/dist/assets/{documentation-panel-CVIUk8ga.js → documentation-panel-bgaPBvan.js} +1 -1
  33. package/dist/assets/{download-pkTDt-sj.js → download-QIfZjflb.js} +3 -3
  34. package/dist/assets/{edit-page-6Fpl3Fez.js → edit-page-DB_go-vo.js} +7 -7
  35. package/dist/assets/{error-banner-Bfe6BopK.js → error-banner-bXc_9BBZ.js} +1 -1
  36. package/dist/assets/{error-panel-Cy3_isDL.js → error-panel-DfHzC7q-.js} +1 -1
  37. package/dist/assets/{field-CXDGiU3T.js → field-DTzXkFLZ.js} +1 -1
  38. package/dist/assets/{file-explorer-panel-qM-Iflzm.js → file-explorer-panel-CEd-m832.js} +3 -3
  39. package/dist/assets/{file-icons-DaGma7HH.js → file-icons-ma7AC7Pi.js} +1 -1
  40. package/dist/assets/{floating-outline-oPCmn9_F.js → floating-outline-BluCz3vD.js} +1 -1
  41. package/dist/assets/{focus-B524Cy57.js → focus-BHXzPxK_.js} +1 -1
  42. package/dist/assets/{form-IHIhviLb.js → form-C0W8wa3f.js} +1 -1
  43. package/dist/assets/{formats-DC_7w22O.js → formats-BQHP_yQk.js} +1 -1
  44. package/dist/assets/{formatting-Dw_0ktP1.js → formatting-BCAZDWQ0.js} +1 -1
  45. package/dist/assets/{gallery-page-DCkpFwYi.js → gallery-page-XSrY7bw_.js} +1 -1
  46. package/dist/assets/{ganttDiagram-JELNMOA3-BC4H0xrj.js → ganttDiagram-JELNMOA3-KWj06bYC.js} +1 -1
  47. package/dist/assets/{glide-data-editor-BkvzN8Tk.js → glide-data-editor-Bd4FOxvW.js} +1 -1
  48. package/dist/assets/{home-page-bB7oHRxE.js → home-page-nNrKA7jH.js} +2 -2
  49. package/dist/assets/{hooks-DmeHnl8J.js → hooks-C7qnb_ft.js} +1 -1
  50. package/dist/assets/{html-to-image-C-c-Hfuw.js → html-to-image-B3VySJ1_.js} +1 -1
  51. package/dist/assets/index-CLnKZIHZ.js +42 -0
  52. package/dist/assets/index-DBs2il8a.css +2 -0
  53. package/dist/assets/input-Bg12i6qY.js +1 -0
  54. package/dist/assets/{kiosk-mode-CnJjuo6B.js → kiosk-mode-BSY8y4kL.js} +1 -1
  55. package/dist/assets/{layout-Ce-vzLs_.js → layout-V4eTNc4M.js} +3 -3
  56. package/dist/assets/{linear-bY7qDnP9.js → linear-BICTUQLW.js} +1 -1
  57. package/dist/assets/{logs-panel-CzlMq5La.js → logs-panel-B1AysC8S.js} +1 -1
  58. package/dist/assets/{markdown-renderer-B4-BiMy9.js → markdown-renderer-BiKTlki_.js} +1 -1
  59. package/dist/assets/{mermaid-DDNZ06H7.js → mermaid-BJFSZcG6.js} +3 -3
  60. package/dist/assets/{name-cell-input-CUG9-cgv.js → name-cell-input-BA5B0KJl.js} +1 -1
  61. package/dist/assets/{outline-panel-BXefyCJ4.js → outline-panel-BfGPA_Sj.js} +1 -1
  62. package/dist/assets/{packages-panel-Bc42thuF.js → packages-panel-BgoT3rrV.js} +1 -1
  63. package/dist/assets/{panels-xqtEg2DV.js → panels-BeW4RaML.js} +1 -1
  64. package/dist/assets/{pieDiagram-ADFJNKIX-BeLuFsHa.js → pieDiagram-ADFJNKIX-ixj1Ihpk.js} +1 -1
  65. package/dist/assets/{precisionRound-D8yxZYIF.js → precisionRound-CU2C3Vxx.js} +1 -1
  66. package/dist/assets/{process-output-C-VBRULx.js → process-output-MnxG8jwi.js} +1 -1
  67. package/dist/assets/{quadrantDiagram-AYHSOK5B-7-MiutmN.js → quadrantDiagram-AYHSOK5B-DAgQxEHI.js} +1 -1
  68. package/dist/assets/{react-vega-LNfJwi6n.js → react-vega-BVBnH7ue.js} +1 -1
  69. package/dist/assets/react-vega-BfEZWy9T.js +1 -0
  70. package/dist/assets/{readonly-python-code-DinZuT8P.js → readonly-python-code-DuH_nOq_.js} +1 -1
  71. package/dist/assets/{run-page-GmVLTzzU.js → run-page-kI3bwb2R.js} +1 -1
  72. package/dist/assets/{sankeyDiagram-TZEHDZUN-DuPJkvrj.js → sankeyDiagram-TZEHDZUN-DAWWzAvZ.js} +1 -1
  73. package/dist/assets/{scratchpad-panel-CnzHN40A.js → scratchpad-panel-617FvSKA.js} +1 -1
  74. package/dist/assets/{secrets-panel-DxBoNgTM.js → secrets-panel-C6X5jB8Q.js} +1 -1
  75. package/dist/assets/{session-panel-CpeJADG_.js → session-panel-D6Sf5vhq.js} +1 -1
  76. package/dist/assets/snippets-panel-DfWq0wh2.js +1 -0
  77. package/dist/assets/{state-9-n7I_Bo.js → state-BgrGQPFs.js} +1 -1
  78. package/dist/assets/{state-DuVk71Dw.js → state-Blw6taKi.js} +1 -1
  79. package/dist/assets/{state-oW8A8maF.js → state-urfwd716.js} +2 -2
  80. package/dist/assets/{terminal-bXHNLBHU.js → terminal-BBTjIXBz.js} +3 -3
  81. package/dist/assets/{textarea-CI3yaazO.js → textarea-B5p9_myy.js} +1 -1
  82. package/dist/assets/{time-BdrzW2P6.js → time-DLcLlk0u.js} +1 -1
  83. package/dist/assets/{tracing-BRo4IXxX.js → tracing-CazNvlp4.js} +1 -1
  84. package/dist/assets/{tracing-panel-7QrwywKQ.js → tracing-panel-Bj0Bx8ZJ.js} +2 -2
  85. package/dist/assets/{useAddCell-BMYemCZ-.js → useAddCell-g3zSMJKs.js} +1 -1
  86. package/dist/assets/{useAsyncData-CaAFMbY9.js → useAsyncData-aCoWDe-l.js} +1 -1
  87. package/dist/assets/useBoolean-ugd5JdXd.js +1 -0
  88. package/dist/assets/{useCellActionButton-DMySRby1.js → useCellActionButton-DdsVswP2.js} +1 -1
  89. package/dist/assets/{useDateFormatter-BBQkEV05.js → useDateFormatter-BEz9SEXo.js} +1 -1
  90. package/dist/assets/{useDeleteCell-6SLN_jZa.js → useDeleteCell-CIdiI4Pk.js} +1 -1
  91. package/dist/assets/{useDependencyPanelTab-DRoK7Mvg.js → useDependencyPanelTab-DhXqfAqL.js} +1 -1
  92. package/dist/assets/{useNotebookActions-SGiWvk1I.js → useNotebookActions-ULfiGMMl.js} +1 -1
  93. package/dist/assets/{useNumberFormatter-DIM21HH4.js → useNumberFormatter-wQU1z0W_.js} +1 -1
  94. package/dist/assets/{usePress-CLNv4Iws.js → usePress-BXMIcLWP.js} +3 -3
  95. package/dist/assets/{useRunCells-a5YC9YVQ.js → useRunCells-q5CA-QoL.js} +1 -1
  96. package/dist/assets/{useSplitCell-Dn4N4Evl.js → useSplitCell-B0jDwUEM.js} +1 -1
  97. package/dist/assets/{utils-BaSt_0sN.js → utils-BZwMGX81.js} +1 -1
  98. package/dist/assets/{vega-component-B_GT243z.js → vega-component-B2_J2GQq.js} +1 -1
  99. package/dist/assets/{vega-loader.browser-DLukqq1q.js → vega-loader.browser-DXARUlxo.js} +1 -1
  100. package/dist/assets/{write-secret-modal-C87c9nwO.js → write-secret-modal-CHfFN0H8.js} +1 -1
  101. package/dist/assets/{xychartDiagram-PRI3JC2R-BRVF_pwk.js → xychartDiagram-PRI3JC2R-DgjhbmH4.js} +1 -1
  102. package/dist/index.html +52 -51
  103. package/package.json +2 -2
  104. package/src/components/data-table/__tests__/columns.test.tsx +92 -13
  105. package/src/components/data-table/column-header.tsx +81 -56
  106. package/src/components/data-table/columns.tsx +25 -32
  107. package/src/components/data-table/data-table.tsx +8 -1
  108. package/src/components/data-table/renderers.tsx +19 -6
  109. package/src/components/data-table/types.ts +4 -0
  110. package/src/components/editor/errors/traceback-modal.tsx +6 -5
  111. package/src/components/editor/output/MarimoErrorOutput.tsx +7 -14
  112. package/src/components/editor/output/MarimoTracebackOutput.tsx +4 -3
  113. package/src/core/cells/document-changes.ts +12 -0
  114. package/src/core/saving/file-state.ts +16 -0
  115. package/src/hooks/useAsyncData.ts +1 -1
  116. package/src/mount.tsx +17 -1
  117. package/src/plugins/impl/DataTablePlugin.tsx +1 -1
  118. package/src/plugins/impl/plotly/__tests__/selection.test.ts +22 -0
  119. package/src/plugins/impl/plotly/selection.ts +1 -0
  120. package/dist/assets/JsonOutput-C0_rp6zm.js +0 -49
  121. package/dist/assets/MarimoErrorOutput-C3-dwG-M.js +0 -7
  122. package/dist/assets/VisuallyHidden-CuyBIaeU.js +0 -1
  123. package/dist/assets/app-config-button-2bbgrHC2.js +0 -1
  124. package/dist/assets/index-B2hkIK4p.js +0 -42
  125. package/dist/assets/index-BNN_F0CC.css +0 -2
  126. package/dist/assets/input-DfDSaPYh.js +0 -1
  127. package/dist/assets/react-vega-Bpff0f7C.js +0 -1
  128. package/dist/assets/snippets-panel-Z3fr4trp.js +0 -1
  129. package/dist/assets/useBoolean-Dsw5twOt.js +0 -1
  130. /package/dist/assets/{blob-Brr8JjWU.js → blob-CTort_or.js} +0 -0
  131. /package/dist/assets/{context-BoP98Msj.js → context-DGqo1TbK.js} +0 -0
  132. /package/dist/assets/{copy-Acb9G8ns.js → copy-Bizk-4hH.js} +0 -0
  133. /package/dist/assets/{defaultLocale-B8Omxjnr.js → defaultLocale-BLne0bXb.js} +0 -0
  134. /package/dist/assets/{defaultLocale-Cyhs3Xd2.js → defaultLocale-JieDVWC_.js} +0 -0
  135. /package/dist/assets/{dialog-Do1NuJPs.js → dialog-BYjetQgE.js} +0 -0
  136. /package/dist/assets/{errors-Dn17Z1-5.js → errors-CZb6hI2x.js} +0 -0
  137. /package/dist/assets/{numbers--q6KLqqK.js → numbers--nDjbAPa.js} +0 -0
  138. /package/dist/assets/{ordinal-CN_bk_zt.js → ordinal-DuTuuUgV.js} +0 -0
  139. /package/dist/assets/{range-BmYMHsC2.js → range-1DwpgXvM.js} +0 -0
  140. /package/dist/assets/{react-icons.esm-3sYgjjif.js → react-icons.esm-BUYTQ32a.js} +0 -0
  141. /package/dist/assets/{share-CkOka71S.js → share-0LPgOyiW.js} +0 -0
  142. /package/dist/assets/{useHotkey-CX3-tpiy.js → useHotkey-DALUNe8I.js} +0 -0
@@ -1 +1 @@
1
- import{s as ze}from"./chunk-LvLJmgfZ.js";import{d as $,l as ct,p as ht,u as me}from"./useEvent-D91BmmQi.js";import{t as mt}from"./react-Bj1aDYRI.js";import{E as Me,En as pt,Jt as ut,Rr as ft,Tn as xt,_ as yt,cr as kt,ct as We,h as _e,kn as bt,ot as wt,pr as jt,st as gt,t as vt,ur as Ct,vr as zt,wi as pe,wn as Mt}from"./cells-CuaAKcwV.js";import{t as N}from"./compiler-runtime-B3qBwwSJ.js";import{n as Wt,x as _t}from"./ai-model-dropdown-CS5ryevV.js";import{_ as H,d as Ne}from"./useEventListener-DGjKht0c.js";import{y as Nt}from"./utils-8btzWeZg.js";import{n as L,t as Se}from"./constants-tOPFFcLZ.js";import{S as ue,h as St,n as Dt,o as Pt,x as At}from"./config-Cgj0Ahvb.js";import{t as It}from"./jsx-runtime-Blw4afVn.js";import{o as Et}from"./alert-dialog-CXspBRlP.js";import{a as Lt,c as fe,o as xe,s as Tt}from"./popover-AtoFZ7i4.js";import{a as Rt,c as $t,i as Ht,n as qt,r as Bt,s as Ft,t as Ot}from"./select--zcABebs.js";import{gt as Ut}from"./JsonOutput-C0_rp6zm.js";import{c as De,d as ye,n as Vt,o as Yt,r as ke,t as Kt}from"./download-pkTDt-sj.js";import{m as Gt}from"./form-IHIhviLb.js";import{t as Pe}from"./tooltip-DmqhBBs6.js";import{r as Ae,t as q}from"./button-BKVLeSTX.js";import{i as Jt,r as Xt,t as Ie}from"./strings-pfr2N700.js";import{r as B}from"./requests-9-v2bhoi.js";import{t as b}from"./createLucideIcon-w-Qo9n0R.js";import{a as Ee,f as Qt,i as Le,m as Zt,p as Te,u as Re}from"./layout-Ce-vzLs_.js";import{t as be}from"./check-B-sKate2.js";import{n as ea}from"./maps-B4xARV9R.js";import{r as ta}from"./useCellActionButton-DMySRby1.js";import{t as $e}from"./copy-DFMsQ6MJ.js";import{t as aa}from"./eye-off-DgRJ-xBZ.js";import{t as ae}from"./file-l37OnSN4.js";import{t as oa}from"./github-C3N4cuN4.js";import{n as na,r as sa,t as la}from"./youtube-D6LtMx2w.js";import{i as ia,n as He}from"./add-connection-dialog-BO_nxLQi.js";import{n as ra,t as da}from"./square-COtNnHUC.js";import{t as ca}from"./image-BgkzrnsX.js";import{t as ha}from"./link-dU_vDDSR.js";import{r as ma}from"./input-DfDSaPYh.js";import{t as pa}from"./settings-C1bg8A2T.js";import{t as ua}from"./sparkles-B79Qf6ma.js";import{y as fa}from"./textarea-CI3yaazO.js";import{t as S}from"./use-toast-BDYuj3zG.js";import{n as qe,t as xa}from"./paths-BzSgteR-.js";import{o as ya}from"./session-DdnWW30b.js";import{a as Be,c as Fe,i as Oe,n as Ue,r as Ve}from"./dialog-Do1NuJPs.js";import{n as we}from"./ImperativeModal-Ka_MU6gk.js";import{r as ka,t as ba}from"./share-CkOka71S.js";import{n as F}from"./copy-Acb9G8ns.js";import{r as wa}from"./useRunCells-a5YC9YVQ.js";import{a as ja}from"./cell-link-CY7i_e4O.js";import{a as ga}from"./renderShortcut-DrDh2657.js";import{t as va}from"./icons-DlzgV4KY.js";import{n as Ca}from"./marimo-icons-Dp8wmdDL.js";import{t as za}from"./links-C19POYUQ.js";import{r as Ma,t as Ye}from"./hooks-DmeHnl8J.js";import{t as Ke}from"./types-DOdUT9LT.js";var Wa=b("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),_a=b("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ge=b("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Je=b("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),Xe=b("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Na=b("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),Sa=b("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),Da=b("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Qe=b("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),Pa=b("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),Aa=b("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ia=b("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ze=b("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),Ea=b("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),La=b("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),et=b("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),je=N(),D=ze(mt(),1),a=ze(It(),1);function Ta(){return"uvx marimo@latest"}function Ra(t,e,n){let o=n?" --with-token":"",s=`${Ta()} pair prompt --url '${e}'${o}`;switch(t){case"claude":return`claude "$(${s} --claude)"`;case"codex":return`codex "$(${s} --codex)"`;case"opencode":return`opencode "$(${s} --opencode)"`;default:Xt(t)}}function $a(t){return t.length<=4?"****":`${"*".repeat(Math.min(t.length-4,8))}${t.slice(-4)}`}var Ha="npx skills add marimo-team/marimo-pair";function qa(){let t=(0,je.c)(2),[e,n]=(0,D.useState)(null),o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{fetch(Dt("/auth/token").href,{credentials:"include"}).then(Ba).then(r=>n((r==null?void 0:r.token)??null)).catch(()=>n(null))},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,D.useEffect)(o,s),e}function Ba(t){return t.ok?t.json():null}const Fa=t=>{let e=(0,je.c)(32),{onClose:n}=t,[o,s]=(0,D.useState)("claude"),r=Pt(),i=qa(),l=!!i,d;e[0]!==o||e[1]!==l||e[2]!==r.httpURL?(d=Ra(o,r.httpURL.toString(),l),e[0]=o,e[1]=l,e[2]=r.httpURL,e[3]=d):d=e[3];let c=d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(Fe,{children:"Pair with an agent"}),e[4]=m):m=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(Be,{children:[m,(0,a.jsxs)(Ve,{children:["Use an AI coding agent to pair-program on this notebook."," ",(0,a.jsx)("a",{href:"https://links.marimo.app/marimo-pair",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Learn more"}),"."]})]}),e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"1. Install the skill"}),(0,a.jsx)(O,{command:Ha})]}),e[6]=h):h=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)("span",{className:"text-sm font-medium",children:"2. Run in your terminal"}),e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=_=>s(_),e[8]=x):x=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Tt,{className:"w-full",children:[(0,a.jsx)(fe,{value:"claude",className:"flex-1",children:"Claude"}),(0,a.jsx)(fe,{value:"codex",className:"flex-1",children:"Codex"}),(0,a.jsx)(fe,{value:"opencode",className:"flex-1",children:"OpenCode"})]}),e[9]=w):w=e[9];let y;e[10]===c?y=e[11]:(y=(0,a.jsx)(xe,{value:"claude",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[10]=c,e[11]=y);let k;e[12]===c?k=e[13]:(k=(0,a.jsx)(xe,{value:"codex",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[12]=c,e[13]=k);let j;e[14]===c?j=e[15]:(j=(0,a.jsx)(xe,{value:"opencode",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[14]=c,e[15]=j);let g;e[16]!==o||e[17]!==j||e[18]!==y||e[19]!==k?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[u,(0,a.jsxs)(Lt,{value:o,onValueChange:x,children:[w,y,k,j]})]}),e[16]=o,e[17]=j,e[18]=y,e[19]=k,e[20]=g):g=e[20];let z;e[21]!==i||e[22]!==l?(z=l&&i&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"3. Paste when prompted for token"}),(0,a.jsx)(O,{command:i,display:$a(i)})]}),e[21]=i,e[22]=l,e[23]=z):z=e[23];let v;e[24]!==g||e[25]!==z?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[h,g,z]}),e[24]=g,e[25]=z,e[26]=v):v=e[26];let M;e[27]===n?M=e[28]:(M=(0,a.jsx)(Oe,{children:(0,a.jsx)(q,{variant:"secondary",onClick:n,children:"Close"})}),e[27]=n,e[28]=M);let W;return e[29]!==v||e[30]!==M?(W=(0,a.jsxs)(Ue,{className:"sm:max-w-lg",children:[p,v,M]}),e[29]=v,e[30]=M,e[31]=W):W=e[31],W};var O=t=>{let e=(0,je.c)(15),{command:n,display:o}=t,[s,r]=(0,D.useState)(!1),i;e[0]===n?i=e[1]:(i=Ae.stopPropagation(async x=>{x.preventDefault(),await F(n),r(!0),setTimeout(()=>r(!1),2e3)}),e[0]=n,e[1]=i);let l=i,d=o??n,c;e[2]===d?c=e[3]:(c=(0,a.jsx)("code",{className:"flex-1 select-all break-words",children:d}),e[2]=d,e[3]=c);let m;e[4]===s?m=e[5]:(m=s?(0,a.jsx)(be,{size:14,strokeWidth:1.5}):(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[4]=s,e[5]=m);let p;e[6]!==l||e[7]!==m?(p=(0,a.jsx)(q,{onClick:l,size:"xs",variant:"ghost",children:m}),e[6]=l,e[7]=m,e[8]=p):p=e[8];let h;e[9]!==s||e[10]!==p?(h=(0,a.jsx)(Pe,{content:"Copied!",open:s,children:p}),e[9]=s,e[10]=p,e[11]=h):h=e[11];let u;return e[12]!==c||e[13]!==h?(u=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-xs",children:[c,h]}),e[12]=c,e[13]=h,e[14]=u):u=e[14],u},tt=N(),oe="https://static.marimo.app";const Oa=t=>{let e=(0,tt.c)(25),{onClose:n}=t,[o,s]=(0,D.useState)(""),{exportAsHTML:r}=B(),i=`${o}-${Math.random().toString(36).slice(2,6)}`,l=`${oe}/static/${i}`,d;e[0]!==r||e[1]!==n||e[2]!==i?(d=async g=>{g.preventDefault(),n();let z=await r({download:!1,includeCode:!0,files:Qt.INSTANCE.filenames()}),v=S({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:z,path:i})}).catch(()=>{v.dismiss(),S({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:L.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),v.dismiss(),S({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},e[0]=r,e[1]=n,e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Fe,{children:"Share static notebook"}),e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsxs)(Be,{children:[c,(0,a.jsxs)(Ve,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:oe,target:"_blank",children:oe}),"."]})]}),e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=g=>{s(g.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},e[6]=p):p=e[6];let h;e[7]===o?h=e[8]:(h=(0,a.jsx)(ma,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:p,required:!0,autoComplete:"off"}),e[7]=o,e[8]=h);let u;e[9]===l?u=e[10]:(u=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Ua,{text:l}),(0,a.jsx)("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=u);let x;e[11]!==h||e[12]!==u?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[h,u]}),e[11]=h,e[12]=u,e[13]=x):x=e[13];let w;e[14]===n?w=e[15]:(w=(0,a.jsx)(q,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=w);let y;e[16]===l?y=e[17]:(y=(0,a.jsx)(q,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await F(l)},children:"Create"}),e[16]=l,e[17]=y);let k;e[18]!==w||e[19]!==y?(k=(0,a.jsxs)(Oe,{children:[w,y]}),e[18]=w,e[19]=y,e[20]=k):k=e[20];let j;return e[21]!==d||e[22]!==k||e[23]!==x?(j=(0,a.jsx)(Ue,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[m,x,k]})}),e[21]=d,e[22]=k,e[23]=x,e[24]=j):j=e[24],j};var Ua=t=>{let e=(0,tt.c)(8),[n,o]=D.useState(!1),s;e[0]===t.text?s=e[1]:(s=Ae.stopPropagation(async c=>{c.preventDefault(),await F(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=s);let r=s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2];let l;e[3]===r?l=e[4]:(l=(0,a.jsx)(q,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:i}),e[3]=r,e[4]=l);let d;return e[5]!==n||e[6]!==l?(d=(0,a.jsx)(Pe,{content:"Copied!",open:n,children:l}),e[5]=n,e[6]=l,e[7]=d):d=e[7],d},Va=N();function Ya(){let t=document.getElementsByClassName(Se.outputArea);for(let e of t){let n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=pe.findElement(e);if(!o){H.warn("Could not find HTMLCellId for visible output area",e);continue}return{cellId:pe.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Ka(t){if(!t){H.warn("No scroll anchor provided to restore scroll position");return}let e=document.getElementById(pe.create(t.cellId));if(!e){H.warn("Could not find cell element to restore scroll position",t.cellId);return}if(!e.querySelector(`.${Se.outputArea}`)){H.warn("Could not find output area to restore scroll position",t.cellId);return}e.scrollIntoView({block:"start",behavior:"auto"})}function at(){let t=(0,Va.c)(2),e=$(We),n;return t[0]===e?n=t[1]:(n=()=>{let o=Ya();e(s=>({mode:gt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ka(o)})})},t[0]=e,t[1]=n),n}const ot=ht(!1);var Ga=N();const Ja=()=>{let t=(0,Ga.c)(7),{selectedLayout:e}=Ee(),{setLayoutView:n}=Le();if(ue()&&!bt("wasm_layouts"))return null;let o;t[0]===n?o=t[1]:(o=l=>n(l),t[0]=n,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Ft,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(qt,{children:(0,a.jsxs)(Bt,{children:[(0,a.jsx)(Rt,{children:"View as"}),Ke.map(Qa)]})}),t[3]=r):r=t[3];let i;return t[4]!==e||t[5]!==o?(i=(0,a.jsxs)(Ot,{"data-testid":"layout-select",value:e,onValueChange:o,children:[s,r]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function Xa(t){return(0,a.jsx)(nt(t),{className:"h-4 w-4"})}function nt(t){switch(t){case"vertical":return Pa;case"grid":return sa;case"slides":return Ze;default:return Jt(t),da}}function st(t){return Ie.startCase(t)}function Qa(t){return(0,a.jsx)(Ht,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Xa(t),(0,a.jsx)("span",{children:st(t)})]})},t)}async function Za(t){let{filename:e,preset:n,downloadPDF:o}=t;await o({filename:e,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var eo=N();function to(t){let e=(0,eo.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=B(),r;return e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==t?(r=()=>{if(!t)return null;let i=xa.guessDeliminator(t);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(t)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:l=>{let d=i.join(qe.dirname(t),l);s({source:t,destination:d}).then(()=>{o(),S({title:"Notebook copied",description:"A copy of the notebook has been created."}),za(d)})}})},e[0]=o,e[1]=n,e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const ao=()=>{let{updateCellConfig:t}=Me(),{saveCellConfig:e}=B();return(0,D.useCallback)(async()=>{let n=new ut,o=_e(),s=o.cellIds.inOrderIds,r={};for(let l of s){if(o.cellData[l]===void 0)continue;let{code:d,config:c}=o.cellData[l];c.hide_code||n.isSupported(d)&&(r[l]={hide_code:!0})}let i=Ne.entries(r);if(i.length!==0){await e({configs:r});for(let[l,d]of i)t({cellId:l,config:d})}},[t])};var oo=N();function lt(){let t=(0,oo.c)(4),{openConfirm:e}=we(),n=$(St),{sendRestart:o}=B(),s;return t[0]!==e||t[1]!==o||t[2]!==n?(s=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(Et,{onClick:async()=>{n({state:At.CLOSING}),await o(),ka()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}var no=N(),T=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation()};function so(){var ve,Ce;let t=(0,no.c)(51),e=ja(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=Mt(),{selectedPanel:r}=xt(),[i]=ct(We),l=me(wt),d=ao(),[c]=Nt(),{updateCellConfig:m,undoDeleteCell:p,clearAllCellOutputs:h,addSetupCellIfDoesntExist:u,collapseAllCells:x,expandAllCells:w}=Me(),y=lt(),k=wa(),j=to(e),g=$(ot),z=$(Wt),v=$(_t),{exportAsIPYNB:M,exportAsMarkdown:W,readCode:_,saveCellConfig:se,updateCellOutputs:P}=B(),A=Ma(),le=me(yt),ie=me(vt),{selectedLayout:U}=Ee(),{setLayoutView:re}=Le(),V=at(),Y=((ve=c.sharing)==null?void 0:ve.html)??!0,K=((Ce=c.sharing)==null?void 0:Ce.wasm)??!0,ge=!ue(),de=U==="slides",it=Co,rt=vo,G;t[0]!==e||t[1]!==A||t[2]!==P?(G=async f=>{let{preset:C,title:R}=f;if(!e){ne();return}await De(R,async he=>{await Ye({takeScreenshots:()=>A({progress:he}),updateCellOutputs:P}),await Za({filename:e,preset:C,downloadPDF:Vt})})},t[0]=e,t[1]=A,t[2]=P,t[3]=G):G=t[3];let I=G,J;t[4]===I?J=t[5]:(J=async()=>{if(ge){await I({preset:"document",title:"Downloading Document PDF..."});return}let f=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(f),setTimeout(go,0),setTimeout(()=>window.dispatchEvent(C),0)},t[4]=I,t[5]=J);let X=J,Q;t[6]!==M||t[7]!==e||t[8]!==A||t[9]!==P?(Q=async()=>{if(!e){ne();return}await De("Downloading IPYNB...",async f=>{await Ye({takeScreenshots:()=>A({progress:f}),updateCellOutputs:P});let C=await M({download:!1});ke(new Blob([C],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},t[6]=M,t[7]=e,t[8]=A,t[9]=P,t[10]=Q):Q=t[10];let ce=Q,Z;t[11]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)(Ut,{size:14,strokeWidth:1.5}),t[11]=Z):Z=t[11];let ee;t[12]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),t[12]=ee):ee=t[12];let E;t[13]===e?E=t[14]:(E=async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!0})},t[13]=e,t[14]=E);let te;return t[15]!==u||t[16]!==ie||t[17]!==h||t[18]!==o||t[19]!==x||t[20]!==j||t[21]!==I||t[22]!==w||t[23]!==W||t[24]!==e||t[25]!==X||t[26]!==ce||t[27]!==le||t[28]!==d||t[29]!==de||t[30]!==l||t[31]!==n||t[32]!==_||t[33]!==y||t[34]!==k||t[35]!==se||t[36]!==U||t[37]!==r||t[38]!==g||t[39]!==v||t[40]!==re||t[41]!==z||t[42]!==Y||t[43]!==K||t[44]!==E||t[45]!==s||t[46]!==V||t[47]!==p||t[48]!==m||t[49]!==i.mode?(te=[{icon:Z,label:"Download",handle:T,dropdown:[{icon:ee,label:"Download as HTML",handle:E},{icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!1})}},{icon:(0,a.jsx)(va,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let f=await W({download:!1});ke(new Blob([f],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ce},{icon:(0,a.jsx)(Zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let f=await _();ke(new Blob([f.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:i.mode!=="present",tooltip:i.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ga("global.hideCode",!1)]}),handle:jo},de?{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:T,dropdown:[{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:X},{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:rt(!0),hidden:!ge,handle:async()=>{await I({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:X}]},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Pair with an agent",handle:async()=>{n((0,a.jsx)(Fa,{onClose:o}))}},{icon:(0,a.jsx)(Ea,{size:14,strokeWidth:1.5}),label:"Share",handle:T,hidden:!Y&&!K,dropdown:[{icon:(0,a.jsx)(Gt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!Y,handle:async()=>{n((0,a.jsx)(Oa,{onClose:o}))}},{icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!K,handle:async()=>{await F(ba({code:(await _()).contents})),S({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:T,dropdown:pt.flatMap(f=>{let{type:C,Icon:R,hidden:he,additionalKeywords:dt}=f;return he?[]:{label:Ie.startCase(C),rightElement:it(r===C),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),handle:()=>s(C),additionalKeywords:dt}})},{icon:(0,a.jsx)(Ze,{size:14,strokeWidth:1.5}),label:"Present as",handle:T,dropdown:[{icon:i.mode==="present"?(0,a.jsx)(fa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Qe,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{V()}},...Ke.map((f,C)=>{let R=nt(f);return{divider:C===0,label:st(f),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:U===f&&(0,a.jsx)(be,{size:14})}),handle:()=>{re(f),i.mode==="edit"&&V()}}})]},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!e||ue(),handle:j},{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{await F((await _()).contents),S({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!le||l,handle:async()=>{let f=ft(_e());await se({configs:Ne.fromEntries(f.map(wo))});for(let C of f)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Xe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{u({})}},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(He,{onClose:o}))}},{icon:(0,a.jsx)(ia,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(He,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(et,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ie||l,handle:()=>{p()}},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:y,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)(jt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{h()}},{icon:(0,a.jsx)(aa,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:x,redundant:!0},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:w,redundant:!0},{divider:!0,icon:(0,a.jsx)(Je,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>g(bo)},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>v(ko)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>z(yo),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ea,{size:14,strokeWidth:1.5}),label:"Resources",handle:T,dropdown:[{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:xo},{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"GitHub",handle:fo},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:uo},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"YouTube",handle:po},{icon:(0,a.jsx)(kt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:mo}]},{divider:!0,icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:ho},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:co}].filter(ro).map(lo),t[15]=u,t[16]=ie,t[17]=h,t[18]=o,t[19]=x,t[20]=j,t[21]=I,t[22]=w,t[23]=W,t[24]=e,t[25]=X,t[26]=ce,t[27]=le,t[28]=d,t[29]=de,t[30]=l,t[31]=n,t[32]=_,t[33]=y,t[34]=k,t[35]=se,t[36]=U,t[37]=r,t[38]=g,t[39]=v,t[40]=re,t[41]=z,t[42]=Y,t[43]=K,t[44]=E,t[45]=s,t[46]=V,t[47]=p,t[48]=m,t[49]=i.mode,t[50]=te):te=t[50],te}function lo(t){return t.dropdown?{...t,dropdown:t.dropdown.filter(io)}:t}function io(t){return!t.hidden}function ro(t){return!t.hidden}function co(){let t=ya();window.open(t,"_blank")}function ho(){let t=document.baseURI.split("?")[0];window.open(t,"_self")}function mo(){window.open(L.releasesPage,"_blank")}function po(){window.open(L.youtube,"_blank")}function uo(){window.open(L.discordLink,"_blank")}function fo(){window.open(L.githubPage,"_blank")}function xo(){window.open(L.docsPage,"_blank")}function yo(t){return!t}function ko(t){return!t}function bo(t){return!t}function wo(t){return[t,{disabled:!1}]}async function jo(){let t=document.getElementById("App");t&&await Yt({element:t,filename:document.title,prepare:Kt})}function go(){return window.print()}function vo(t){return t?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function Co(t){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:t&&(0,a.jsx)(be,{size:14})})}function ne(){S({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{at as a,Xe as c,ot as i,Je as l,lt as n,et as o,Ja as r,Qe as s,so as t,Ge as u};
1
+ import{s as ze}from"./chunk-LvLJmgfZ.js";import{d as $,l as ct,p as ht,u as me}from"./useEvent-D91BmmQi.js";import{t as mt}from"./react-Bj1aDYRI.js";import{E as Me,En as pt,Jt as ut,Rr as ft,Ti as pe,Tn as xt,_ as yt,cr as kt,ct as We,h as _e,kn as bt,ot as wt,pr as jt,st as gt,t as vt,ur as Ct,vr as zt,wn as Mt}from"./cells-BVG4a-Qn.js";import{t as N}from"./compiler-runtime-B3qBwwSJ.js";import{n as Wt,x as _t}from"./ai-model-dropdown-B-sbS07W.js";import{_ as H,d as Ne}from"./useEventListener-DGjKht0c.js";import{y as Nt}from"./utils-8btzWeZg.js";import{n as L,t as Se}from"./constants-tOPFFcLZ.js";import{S as ue,h as St,n as Dt,o as Pt,x as At}from"./config-Cgj0Ahvb.js";import{t as It}from"./jsx-runtime-Blw4afVn.js";import{o as Et}from"./alert-dialog-CXspBRlP.js";import{a as Lt,c as fe,o as xe,s as Tt}from"./popover-AtoFZ7i4.js";import{a as Rt,c as $t,i as Ht,n as qt,r as Bt,s as Ft,t as Ot}from"./select--zcABebs.js";import{gt as Ut}from"./JsonOutput-Bk2by9qo.js";import{c as De,d as ye,n as Vt,o as Yt,r as ke,t as Kt}from"./download-QIfZjflb.js";import{m as Gt}from"./form-C0W8wa3f.js";import{t as Pe}from"./tooltip-DmqhBBs6.js";import{r as Ae,t as q}from"./button-BKVLeSTX.js";import{i as Jt,r as Qt,t as Ie}from"./strings-pfr2N700.js";import{r as B}from"./requests-9-v2bhoi.js";import{t as b}from"./createLucideIcon-w-Qo9n0R.js";import{a as Ee,f as Xt,i as Le,m as Zt,p as Te,u as Re}from"./layout-V4eTNc4M.js";import{t as be}from"./check-B-sKate2.js";import{n as ea}from"./maps-B4xARV9R.js";import{r as ta}from"./useCellActionButton-DdsVswP2.js";import{t as $e}from"./copy-DFMsQ6MJ.js";import{t as aa}from"./eye-off-DgRJ-xBZ.js";import{t as ae}from"./file-l37OnSN4.js";import{t as oa}from"./github-C3N4cuN4.js";import{n as na,r as sa,t as la}from"./youtube-D6LtMx2w.js";import{i as ia,n as He}from"./add-connection-dialog-20N0EHLl.js";import{n as ra,t as da}from"./square-COtNnHUC.js";import{t as ca}from"./image-BgkzrnsX.js";import{t as ha}from"./link-dU_vDDSR.js";import{r as ma}from"./input-Bg12i6qY.js";import{t as pa}from"./settings-C1bg8A2T.js";import{t as ua}from"./sparkles-B79Qf6ma.js";import{y as fa}from"./textarea-B5p9_myy.js";import{t as S}from"./use-toast-BDYuj3zG.js";import{n as qe,t as xa}from"./paths-BzSgteR-.js";import{o as ya}from"./session-DdnWW30b.js";import{n as F}from"./copy-Bizk-4hH.js";import{r as ka}from"./useRunCells-q5CA-QoL.js";import{a as Be,c as Fe,i as Oe,n as Ue,r as Ve}from"./dialog-BYjetQgE.js";import{n as we}from"./ImperativeModal-DoGv2BXV.js";import{r as ba,t as wa}from"./share-0LPgOyiW.js";import{a as ja}from"./cell-link-Dtonmtv_.js";import{a as ga}from"./renderShortcut-DrDh2657.js";import{t as va}from"./icons-DlzgV4KY.js";import{n as Ca}from"./marimo-icons-Dp8wmdDL.js";import{t as za}from"./links-C19POYUQ.js";import{r as Ma,t as Ye}from"./hooks-C7qnb_ft.js";import{t as Ke}from"./types-DOdUT9LT.js";var Wa=b("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),_a=b("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ge=b("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]),Je=b("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]),Qe=b("diamond-plus",[["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",key:"1ey20j"}],["path",{d:"M8 12h8",key:"1wcyev"}]]),Na=b("fast-forward",[["path",{d:"M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z",key:"b19h5q"}],["path",{d:"M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z",key:"h7h5ge"}]]),Sa=b("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),Da=b("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),Xe=b("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]),Pa=b("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),Aa=b("notebook",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M16 2v20",key:"rotuqe"}]]),Ia=b("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ze=b("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]),Ea=b("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),La=b("square-power",[["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M7.998 9.003a5 5 0 1 0 8-.005",key:"1pek45"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]),et=b("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),je=N(),D=ze(mt(),1),a=ze(It(),1);function Ta(){return"uvx marimo@latest"}function Ra(t,e,n){let o=n?" --with-token":"",s=`${Ta()} pair prompt --url '${e}'${o}`;switch(t){case"claude":return`claude "$(${s} --claude)"`;case"codex":return`codex "$(${s} --codex)"`;case"opencode":return`opencode "$(${s} --opencode)"`;default:Qt(t)}}function $a(t){return t.length<=4?"****":`${"*".repeat(Math.min(t.length-4,8))}${t.slice(-4)}`}var Ha="npx skills add marimo-team/marimo-pair";function qa(){let t=(0,je.c)(2),[e,n]=(0,D.useState)(null),o,s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{fetch(Dt("/auth/token").href,{credentials:"include"}).then(Ba).then(r=>n((r==null?void 0:r.token)??null)).catch(()=>n(null))},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,D.useEffect)(o,s),e}function Ba(t){return t.ok?t.json():null}const Fa=t=>{let e=(0,je.c)(32),{onClose:n}=t,[o,s]=(0,D.useState)("claude"),r=Pt(),i=qa(),l=!!i,d;e[0]!==o||e[1]!==l||e[2]!==r.httpURL?(d=Ra(o,r.httpURL.toString(),l),e[0]=o,e[1]=l,e[2]=r.httpURL,e[3]=d):d=e[3];let c=d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsx)(Fe,{children:"Pair with an agent"}),e[4]=m):m=e[4];let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsxs)(Be,{children:[m,(0,a.jsxs)(Ve,{children:["Use an AI coding agent to pair-program on this notebook."," ",(0,a.jsx)("a",{href:"https://links.marimo.app/marimo-pair",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Learn more"}),"."]})]}),e[5]=p):p=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"1. Install the skill"}),(0,a.jsx)(O,{command:Ha})]}),e[6]=h):h=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=(0,a.jsx)("span",{className:"text-sm font-medium",children:"2. Run in your terminal"}),e[7]=u):u=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=_=>s(_),e[8]=x):x=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=(0,a.jsxs)(Tt,{className:"w-full",children:[(0,a.jsx)(fe,{value:"claude",className:"flex-1",children:"Claude"}),(0,a.jsx)(fe,{value:"codex",className:"flex-1",children:"Codex"}),(0,a.jsx)(fe,{value:"opencode",className:"flex-1",children:"OpenCode"})]}),e[9]=w):w=e[9];let y;e[10]===c?y=e[11]:(y=(0,a.jsx)(xe,{value:"claude",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[10]=c,e[11]=y);let k;e[12]===c?k=e[13]:(k=(0,a.jsx)(xe,{value:"codex",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[12]=c,e[13]=k);let j;e[14]===c?j=e[15]:(j=(0,a.jsx)(xe,{value:"opencode",className:"mt-3",children:(0,a.jsx)(O,{command:c})}),e[14]=c,e[15]=j);let g;e[16]!==o||e[17]!==j||e[18]!==y||e[19]!==k?(g=(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[u,(0,a.jsxs)(Lt,{value:o,onValueChange:x,children:[w,y,k,j]})]}),e[16]=o,e[17]=j,e[18]=y,e[19]=k,e[20]=g):g=e[20];let z;e[21]!==i||e[22]!==l?(z=l&&i&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"3. Paste when prompted for token"}),(0,a.jsx)(O,{command:i,display:$a(i)})]}),e[21]=i,e[22]=l,e[23]=z):z=e[23];let v;e[24]!==g||e[25]!==z?(v=(0,a.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[h,g,z]}),e[24]=g,e[25]=z,e[26]=v):v=e[26];let M;e[27]===n?M=e[28]:(M=(0,a.jsx)(Oe,{children:(0,a.jsx)(q,{variant:"secondary",onClick:n,children:"Close"})}),e[27]=n,e[28]=M);let W;return e[29]!==v||e[30]!==M?(W=(0,a.jsxs)(Ue,{className:"sm:max-w-lg",children:[p,v,M]}),e[29]=v,e[30]=M,e[31]=W):W=e[31],W};var O=t=>{let e=(0,je.c)(15),{command:n,display:o}=t,[s,r]=(0,D.useState)(!1),i;e[0]===n?i=e[1]:(i=Ae.stopPropagation(async x=>{x.preventDefault(),await F(n),r(!0),setTimeout(()=>r(!1),2e3)}),e[0]=n,e[1]=i);let l=i,d=o??n,c;e[2]===d?c=e[3]:(c=(0,a.jsx)("code",{className:"flex-1 select-all break-words",children:d}),e[2]=d,e[3]=c);let m;e[4]===s?m=e[5]:(m=s?(0,a.jsx)(be,{size:14,strokeWidth:1.5}):(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[4]=s,e[5]=m);let p;e[6]!==l||e[7]!==m?(p=(0,a.jsx)(q,{onClick:l,size:"xs",variant:"ghost",children:m}),e[6]=l,e[7]=m,e[8]=p):p=e[8];let h;e[9]!==s||e[10]!==p?(h=(0,a.jsx)(Pe,{content:"Copied!",open:s,children:p}),e[9]=s,e[10]=p,e[11]=h):h=e[11];let u;return e[12]!==c||e[13]!==h?(u=(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-xs",children:[c,h]}),e[12]=c,e[13]=h,e[14]=u):u=e[14],u},tt=N(),oe="https://static.marimo.app";const Oa=t=>{let e=(0,tt.c)(25),{onClose:n}=t,[o,s]=(0,D.useState)(""),{exportAsHTML:r}=B(),i=`${o}-${Math.random().toString(36).slice(2,6)}`,l=`${oe}/static/${i}`,d;e[0]!==r||e[1]!==n||e[2]!==i?(d=async g=>{g.preventDefault(),n();let z=await r({download:!1,includeCode:!0,files:Xt.INSTANCE.filenames()}),v=S({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:z,path:i})}).catch(()=>{v.dismiss(),S({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:L.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),v.dismiss(),S({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},e[0]=r,e[1]=n,e[2]=i,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Fe,{children:"Share static notebook"}),e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=(0,a.jsxs)(Be,{children:[c,(0,a.jsxs)(Ve,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",(0,a.jsx)("a",{href:oe,target:"_blank",children:oe}),"."]})]}),e[5]=m):m=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=g=>{s(g.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},e[6]=p):p=e[6];let h;e[7]===o?h=e[8]:(h=(0,a.jsx)(ma,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:p,required:!0,autoComplete:"off"}),e[7]=o,e[8]=h);let u;e[9]===l?u=e[10]:(u=(0,a.jsxs)("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Ua,{text:l}),(0,a.jsx)("span",{className:"text-primary",children:l})]})]}),e[9]=l,e[10]=u);let x;e[11]!==h||e[12]!==u?(x=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[h,u]}),e[11]=h,e[12]=u,e[13]=x):x=e[13];let w;e[14]===n?w=e[15]:(w=(0,a.jsx)(q,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),e[14]=n,e[15]=w);let y;e[16]===l?y=e[17]:(y=(0,a.jsx)(q,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await F(l)},children:"Create"}),e[16]=l,e[17]=y);let k;e[18]!==w||e[19]!==y?(k=(0,a.jsxs)(Oe,{children:[w,y]}),e[18]=w,e[19]=y,e[20]=k):k=e[20];let j;return e[21]!==d||e[22]!==k||e[23]!==x?(j=(0,a.jsx)(Ue,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:d,children:[m,x,k]})}),e[21]=d,e[22]=k,e[23]=x,e[24]=j):j=e[24],j};var Ua=t=>{let e=(0,tt.c)(8),[n,o]=D.useState(!1),s;e[0]===t.text?s=e[1]:(s=Ae.stopPropagation(async c=>{c.preventDefault(),await F(t.text),o(!0),setTimeout(()=>o(!1),2e3)}),e[0]=t.text,e[1]=s);let r=s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[2]=i):i=e[2];let l;e[3]===r?l=e[4]:(l=(0,a.jsx)(q,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:i}),e[3]=r,e[4]=l);let d;return e[5]!==n||e[6]!==l?(d=(0,a.jsx)(Pe,{content:"Copied!",open:n,children:l}),e[5]=n,e[6]=l,e[7]=d):d=e[7],d},Va=N();function Ya(){let t=document.getElementsByClassName(Se.outputArea);for(let e of t){let n=e.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=pe.findElement(e);if(!o){H.warn("Could not find HTMLCellId for visible output area",e);continue}return{cellId:pe.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Ka(t){if(!t){H.warn("No scroll anchor provided to restore scroll position");return}let e=document.getElementById(pe.create(t.cellId));if(!e){H.warn("Could not find cell element to restore scroll position",t.cellId);return}if(!e.querySelector(`.${Se.outputArea}`)){H.warn("Could not find output area to restore scroll position",t.cellId);return}e.scrollIntoView({block:"start",behavior:"auto"})}function at(){let t=(0,Va.c)(2),e=$(We),n;return t[0]===e?n=t[1]:(n=()=>{let o=Ya();e(s=>({mode:gt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Ka(o)})})},t[0]=e,t[1]=n),n}const ot=ht(!1);var Ga=N();const Ja=()=>{let t=(0,Ga.c)(7),{selectedLayout:e}=Ee(),{setLayoutView:n}=Le();if(ue()&&!bt("wasm_layouts"))return null;let o;t[0]===n?o=t[1]:(o=l=>n(l),t[0]=n,t[1]=o);let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Ft,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)($t,{placeholder:"Select a view"})}),t[2]=s):s=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(qt,{children:(0,a.jsxs)(Bt,{children:[(0,a.jsx)(Rt,{children:"View as"}),Ke.map(Xa)]})}),t[3]=r):r=t[3];let i;return t[4]!==e||t[5]!==o?(i=(0,a.jsxs)(Ot,{"data-testid":"layout-select",value:e,onValueChange:o,children:[s,r]}),t[4]=e,t[5]=o,t[6]=i):i=t[6],i};function Qa(t){return(0,a.jsx)(nt(t),{className:"h-4 w-4"})}function nt(t){switch(t){case"vertical":return Pa;case"grid":return sa;case"slides":return Ze;default:return Jt(t),da}}function st(t){return Ie.startCase(t)}function Xa(t){return(0,a.jsx)(Ht,{value:t,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Qa(t),(0,a.jsx)("span",{children:st(t)})]})},t)}async function Za(t){let{filename:e,preset:n,downloadPDF:o}=t;await o({filename:e,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var eo=N();function to(t){let e=(0,eo.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=B(),r;return e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==t?(r=()=>{if(!t)return null;let i=xa.guessDeliminator(t);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(t)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:l=>{let d=i.join(qe.dirname(t),l);s({source:t,destination:d}).then(()=>{o(),S({title:"Notebook copied",description:"A copy of the notebook has been created."}),za(d)})}})},e[0]=o,e[1]=n,e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const ao=()=>{let{updateCellConfig:t}=Me(),{saveCellConfig:e}=B();return(0,D.useCallback)(async()=>{let n=new ut,o=_e(),s=o.cellIds.inOrderIds,r={};for(let l of s){if(o.cellData[l]===void 0)continue;let{code:d,config:c}=o.cellData[l];c.hide_code||n.isSupported(d)&&(r[l]={hide_code:!0})}let i=Ne.entries(r);if(i.length!==0){await e({configs:r});for(let[l,d]of i)t({cellId:l,config:d})}},[t])};var oo=N();function lt(){let t=(0,oo.c)(4),{openConfirm:e}=we(),n=$(St),{sendRestart:o}=B(),s;return t[0]!==e||t[1]!==o||t[2]!==n?(s=()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:(0,a.jsx)(Et,{onClick:async()=>{n({state:At.CLOSING}),await o(),ba()},"aria-label":"Confirm Restart",children:"Restart"})})},t[0]=e,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}var no=N(),T=t=>{t==null||t.preventDefault(),t==null||t.stopPropagation()};function so(){var ve,Ce;let t=(0,no.c)(51),e=ja(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=Mt(),{selectedPanel:r}=xt(),[i]=ct(We),l=me(wt),d=ao(),[c]=Nt(),{updateCellConfig:m,undoDeleteCell:p,clearAllCellOutputs:h,addSetupCellIfDoesntExist:u,collapseAllCells:x,expandAllCells:w}=Me(),y=lt(),k=ka(),j=to(e),g=$(ot),z=$(Wt),v=$(_t),{exportAsIPYNB:M,exportAsMarkdown:W,readCode:_,saveCellConfig:se,updateCellOutputs:P}=B(),A=Ma(),le=me(yt),ie=me(vt),{selectedLayout:U}=Ee(),{setLayoutView:re}=Le(),V=at(),Y=((ve=c.sharing)==null?void 0:ve.html)??!0,K=((Ce=c.sharing)==null?void 0:Ce.wasm)??!0,ge=!ue(),de=U==="slides",it=Co,rt=vo,G;t[0]!==e||t[1]!==A||t[2]!==P?(G=async f=>{let{preset:C,title:R}=f;if(!e){ne();return}await De(R,async he=>{await Ye({takeScreenshots:()=>A({progress:he}),updateCellOutputs:P}),await Za({filename:e,preset:C,downloadPDF:Vt})})},t[0]=e,t[1]=A,t[2]=P,t[3]=G):G=t[3];let I=G,J;t[4]===I?J=t[5]:(J=async()=>{if(ge){await I({preset:"document",title:"Downloading Document PDF..."});return}let f=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(f),setTimeout(go,0),setTimeout(()=>window.dispatchEvent(C),0)},t[4]=I,t[5]=J);let Q=J,X;t[6]!==M||t[7]!==e||t[8]!==A||t[9]!==P?(X=async()=>{if(!e){ne();return}await De("Downloading IPYNB...",async f=>{await Ye({takeScreenshots:()=>A({progress:f}),updateCellOutputs:P});let C=await M({download:!1});ke(new Blob([C],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},t[6]=M,t[7]=e,t[8]=A,t[9]=P,t[10]=X):X=t[10];let ce=X,Z;t[11]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)(Ut,{size:14,strokeWidth:1.5}),t[11]=Z):Z=t[11];let ee;t[12]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),t[12]=ee):ee=t[12];let E;t[13]===e?E=t[14]:(E=async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!0})},t[13]=e,t[14]=E);let te;return t[15]!==u||t[16]!==ie||t[17]!==h||t[18]!==o||t[19]!==x||t[20]!==j||t[21]!==I||t[22]!==w||t[23]!==W||t[24]!==e||t[25]!==Q||t[26]!==ce||t[27]!==le||t[28]!==d||t[29]!==de||t[30]!==l||t[31]!==n||t[32]!==_||t[33]!==y||t[34]!==k||t[35]!==se||t[36]!==U||t[37]!==r||t[38]!==g||t[39]!==v||t[40]!==re||t[41]!==z||t[42]!==Y||t[43]!==K||t[44]!==E||t[45]!==s||t[46]!==V||t[47]!==p||t[48]!==m||t[49]!==i.mode?(te=[{icon:Z,label:"Download",handle:T,dropdown:[{icon:ee,label:"Download as HTML",handle:E},{icon:(0,a.jsx)(Te,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!e){ne();return}await Re({filename:e,includeCode:!1})}},{icon:(0,a.jsx)(va,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let f=await W({download:!1});ke(new Blob([f],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ce},{icon:(0,a.jsx)(Zt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let f=await _();ke(new Blob([f.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:i.mode!=="present",tooltip:i.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",ga("global.hideCode",!1)]}),handle:jo},de?{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:T,dropdown:[{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:Q},{icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:rt(!0),hidden:!ge,handle:async()=>{await I({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(ae,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:Q}]},{icon:(0,a.jsx)(ua,{size:14,strokeWidth:1.5}),label:"Pair with an agent",handle:async()=>{n((0,a.jsx)(Fa,{onClose:o}))}},{icon:(0,a.jsx)(Ea,{size:14,strokeWidth:1.5}),label:"Share",handle:T,hidden:!Y&&!K,dropdown:[{icon:(0,a.jsx)(Gt,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!Y,handle:async()=>{n((0,a.jsx)(Oa,{onClose:o}))}},{icon:(0,a.jsx)(ha,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!K,handle:async()=>{await F(wa({code:(await _()).contents})),S({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:T,dropdown:pt.flatMap(f=>{let{type:C,Icon:R,hidden:he,additionalKeywords:dt}=f;return he?[]:{label:Ie.startCase(C),rightElement:it(r===C),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),handle:()=>s(C),additionalKeywords:dt}})},{icon:(0,a.jsx)(Ze,{size:14,strokeWidth:1.5}),label:"Present as",handle:T,dropdown:[{icon:i.mode==="present"?(0,a.jsx)(fa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Xe,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{V()}},...Ke.map((f,C)=>{let R=nt(f);return{divider:C===0,label:st(f),icon:(0,a.jsx)(R,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:U===f&&(0,a.jsx)(be,{size:14})}),handle:()=>{re(f),i.mode==="edit"&&V()}}})]},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!e||ue(),handle:j},{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{await F((await _()).contents),S({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!le||l,handle:async()=>{let f=ft(_e());await se({configs:Ne.fromEntries(f.map(wo))});for(let C of f)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(Qe,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{u({})}},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(He,{onClose:o}))}},{icon:(0,a.jsx)(ia,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(He,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(et,{size:14,strokeWidth:1.5}),label:"Undo cell deletion",hidden:!ie||l,handle:()=>{p()}},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:y,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{k()}},{icon:(0,a.jsx)(jt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{h()}},{icon:(0,a.jsx)(aa,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:d,redundant:!0},{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:x,redundant:!0},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:w,redundant:!0},{divider:!0,icon:(0,a.jsx)(Je,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>g(bo)},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>v(ko)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>z(yo),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ea,{size:14,strokeWidth:1.5}),label:"Resources",handle:T,dropdown:[{icon:(0,a.jsx)(zt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:xo},{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"GitHub",handle:fo},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:uo},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"YouTube",handle:po},{icon:(0,a.jsx)(kt,{size:14,strokeWidth:1.5}),label:"Changelog",handle:mo}]},{divider:!0,icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:ho},{icon:(0,a.jsx)(Ca,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:co}].filter(ro).map(lo),t[15]=u,t[16]=ie,t[17]=h,t[18]=o,t[19]=x,t[20]=j,t[21]=I,t[22]=w,t[23]=W,t[24]=e,t[25]=Q,t[26]=ce,t[27]=le,t[28]=d,t[29]=de,t[30]=l,t[31]=n,t[32]=_,t[33]=y,t[34]=k,t[35]=se,t[36]=U,t[37]=r,t[38]=g,t[39]=v,t[40]=re,t[41]=z,t[42]=Y,t[43]=K,t[44]=E,t[45]=s,t[46]=V,t[47]=p,t[48]=m,t[49]=i.mode,t[50]=te):te=t[50],te}function lo(t){return t.dropdown?{...t,dropdown:t.dropdown.filter(io)}:t}function io(t){return!t.hidden}function ro(t){return!t.hidden}function co(){let t=ya();window.open(t,"_blank")}function ho(){let t=document.baseURI.split("?")[0];window.open(t,"_self")}function mo(){window.open(L.releasesPage,"_blank")}function po(){window.open(L.youtube,"_blank")}function uo(){window.open(L.discordLink,"_blank")}function fo(){window.open(L.githubPage,"_blank")}function xo(){window.open(L.docsPage,"_blank")}function yo(t){return!t}function ko(t){return!t}function bo(t){return!t}function wo(t){return[t,{disabled:!1}]}async function jo(){let t=document.getElementById("App");t&&await Yt({element:t,filename:document.title,prepare:Kt})}function go(){return window.print()}function vo(t){return t?(0,a.jsx)("span",{className:"ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700",children:"Recommended"}):null}function Co(t){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:t&&(0,a.jsx)(be,{size:14})})}function ne(){S({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{at as a,Qe as c,ot as i,Je as l,lt as n,et as o,Ja as r,Xe as s,so as t,Ge as u};
@@ -1 +1 @@
1
- import{s as h}from"./chunk-LvLJmgfZ.js";import{t as c}from"./react-Bj1aDYRI.js";import{t as y}from"./context-BoP98Msj.js";var l=new Map,m=!1;try{m=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}var u=!1;try{u=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}var p={degree:{narrow:{default:"\xB0","ja-JP":" \u5EA6","zh-TW":"\u5EA6","sl-SI":" \xB0"}}},f=class{format(t){var e;let r="";if(r=!m&&this.options.signDisplay!=null?b(this.numberFormatter,this.options.signDisplay,t):this.numberFormatter.format(t),this.options.style==="unit"&&!u){let{unit:s,unitDisplay:i="short",locale:a}=this.resolvedOptions();if(!s)return r;let o=(e=p[s])==null?void 0:e[i];r+=o[a]||o.default}return r}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,r){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,r);if(r<t)throw RangeError("End date must be >= start date");return`${this.format(t)} \u2013 ${this.format(r)}`}formatRangeToParts(t,r){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,r);if(r<t)throw RangeError("End date must be >= start date");let e=this.numberFormatter.formatToParts(t),s=this.numberFormatter.formatToParts(r);return[...e.map(i=>({...i,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...s.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!m&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!u&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,r={}){this.numberFormatter=d(t,r),this.options=r}};function d(t,r={}){var a;let{numberingSystem:e}=r;if(e&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${e}`),r.style==="unit"&&!u){let{unit:o,unitDisplay:n="short"}=r;if(!o)throw Error('unit option must be provided with style: "unit"');if(!((a=p[o])!=null&&a[n]))throw Error(`Unsupported unit ${o} with unitDisplay = ${n}`);r={...r,style:"decimal"}}let s=t+(r?Object.entries(r).sort((o,n)=>o[0]<n[0]?-1:1).join():"");if(l.has(s))return l.get(s);let i=new Intl.NumberFormat(t,r);return l.set(s,i),i}function b(t,r,e){if(r==="auto")return t.format(e);if(r==="never")return t.format(Math.abs(e));{let s=!1;if(r==="always"?s=e>0||Object.is(e,0):r==="exceptZero"&&(Object.is(e,-0)||Object.is(e,0)?e=Math.abs(e):s=e>0),s){let i=t.format(-e),a=t.format(e),o=i.replace(a,"").replace(/\u200e|\u061C/,"");return[...o].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(a,"!!!").replace(o,"+").replace("!!!",a)}else return t.format(e)}}var g=h(c(),1);function D(t={}){let{locale:r}=y();return(0,g.useMemo)(()=>new f(r,t),[r,t])}export{f as n,D as t};
1
+ import{s as h}from"./chunk-LvLJmgfZ.js";import{t as c}from"./react-Bj1aDYRI.js";import{t as y}from"./context-DGqo1TbK.js";var l=new Map,m=!1;try{m=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}var u=!1;try{u=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}var p={degree:{narrow:{default:"\xB0","ja-JP":" \u5EA6","zh-TW":"\u5EA6","sl-SI":" \xB0"}}},f=class{format(t){var e;let r="";if(r=!m&&this.options.signDisplay!=null?b(this.numberFormatter,this.options.signDisplay,t):this.numberFormatter.format(t),this.options.style==="unit"&&!u){let{unit:s,unitDisplay:i="short",locale:a}=this.resolvedOptions();if(!s)return r;let o=(e=p[s])==null?void 0:e[i];r+=o[a]||o.default}return r}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,r){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,r);if(r<t)throw RangeError("End date must be >= start date");return`${this.format(t)} \u2013 ${this.format(r)}`}formatRangeToParts(t,r){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,r);if(r<t)throw RangeError("End date must be >= start date");let e=this.numberFormatter.formatToParts(t),s=this.numberFormatter.formatToParts(r);return[...e.map(i=>({...i,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...s.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!m&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!u&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,r={}){this.numberFormatter=d(t,r),this.options=r}};function d(t,r={}){var a;let{numberingSystem:e}=r;if(e&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${e}`),r.style==="unit"&&!u){let{unit:o,unitDisplay:n="short"}=r;if(!o)throw Error('unit option must be provided with style: "unit"');if(!((a=p[o])!=null&&a[n]))throw Error(`Unsupported unit ${o} with unitDisplay = ${n}`);r={...r,style:"decimal"}}let s=t+(r?Object.entries(r).sort((o,n)=>o[0]<n[0]?-1:1).join():"");if(l.has(s))return l.get(s);let i=new Intl.NumberFormat(t,r);return l.set(s,i),i}function b(t,r,e){if(r==="auto")return t.format(e);if(r==="never")return t.format(Math.abs(e));{let s=!1;if(r==="always"?s=e>0||Object.is(e,0):r==="exceptZero"&&(Object.is(e,-0)||Object.is(e,0)?e=Math.abs(e):s=e>0),s){let i=t.format(-e),a=t.format(e),o=i.replace(a,"").replace(/\u200e|\u061C/,"");return[...o].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(a,"!!!").replace(o,"+").replace("!!!",a)}else return t.format(e)}}var g=h(c(),1);function D(t={}){let{locale:r}=y();return(0,g.useMemo)(()=>new f(r,t),[r,t])}export{f as n,D as t};
@@ -1,7 +1,7 @@
1
- import{s as tt}from"./chunk-LvLJmgfZ.js";import{t as nt}from"./react-Bj1aDYRI.js";import{t as rt}from"./react-dom-CSu739Rf.js";import{n as it}from"./clsx-XrBBnd7s.js";import{n as ot}from"./SSRProvider-D3zWcDme.js";var d=tt(nt(),1),T=typeof document<"u"?d.useLayoutEffect:()=>{};function at(e){let[t,n]=(0,d.useState)(e),a=(0,d.useRef)(t),i=(0,d.useRef)(null),s=(0,d.useRef)(()=>{if(!i.current)return;let l=i.current.next();if(l.done){i.current=null;return}a.current===l.value?s.current():n(l.value)});return T(()=>{a.current=t,i.current&&s.current()}),[t,(0,d.useCallback)(l=>{i.current=l(a.current),s.current()},[s])]}var st=!!(typeof window<"u"&&window.document&&window.document.createElement),x=new Map,G;typeof FinalizationRegistry<"u"&&(G=new FinalizationRegistry(e=>{x.delete(e)}));function Se(e){let[t,n]=(0,d.useState)(e),a=(0,d.useRef)(null),i=ot(t),s=(0,d.useRef)(null);if(G&&G.register(s,i),st){let l=x.get(i);l&&!l.includes(a)?l.push(a):x.set(i,[a])}return T(()=>{let l=i;return()=>{G&&G.unregister(s),x.delete(l)}},[i]),(0,d.useEffect)(()=>{let l=a.current;return l&&n(l),()=>{l&&(a.current=null)}}),i}function lt(e,t){if(e===t)return e;let n=x.get(e);if(n)return n.forEach(i=>i.current=t),t;let a=x.get(t);return a?(a.forEach(i=>i.current=e),e):t}function ut(e=[]){let t=Se(),[n,a]=at(t),i=(0,d.useCallback)(()=>{a(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,a]);return T(i,[t,i,...e]),n}function te(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}var h=e=>(e==null?void 0:e.ownerDocument)??document,O=e=>e&&"window"in e&&e.window===e?e:h(e).defaultView||window;function ct(e){return typeof e=="object"&&!!e&&"nodeType"in e&&typeof e.nodeType=="number"}function dt(e){return ct(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}var ft=!1;function W(){return ft}function E(e,t){if(!W())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName==="SLOT"&&n.assignedSlot?n.assignedSlot.parentNode:dt(n)?n.host:n.parentNode}return!1}var ne=(e=document)=>{var n;if(!W())return e.activeElement;let t=e.activeElement;for(;t&&"shadowRoot"in t&&((n=t.shadowRoot)!=null&&n.activeElement);)t=t.shadowRoot.activeElement;return t};function g(e){if(W()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function pt(e){if(!e)return!1;let t=e.getRootNode(),n=O(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let a=t.activeElement;return a!=null&&e.contains(a)}function Le(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,a=e.map(i=>{let s=Ce(i,t);return n||(n=typeof s=="function"),s});if(n)return()=>{a.forEach((i,s)=>{typeof i=="function"?i():Ce(e[s],null)})}}}function Ce(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function re(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let a=e[n];for(let i in a){let s=t[i],l=a[i];typeof s=="function"&&typeof l=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=te(s,l):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof l=="string"?t[i]=it(s,l):i==="id"&&s&&l?t.id=lt(s,l):i==="ref"&&s&&l?t.ref=Le(s,l):t[i]=l===void 0?s:l}}return t}function z(e){if(gt())e.focus({preventScroll:!0});else{let t=yt(e);e.focus(),vt(t)}}var _=null;function gt(){if(_==null){_=!1;try{document.createElement("div").focus({get preventScroll(){return _=!0,!0}})}catch{}}return _}function yt(e){let t=e.parentNode,n=[],a=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==a;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return a instanceof HTMLElement&&n.push({element:a,scrollTop:a.scrollTop,scrollLeft:a.scrollLeft}),n}function vt(e){for(let{element:t,scrollTop:n,scrollLeft:a}of e)t.scrollTop=n,t.scrollLeft=a}function Y(e){var n;if(typeof window>"u"||window.navigator==null)return!1;let t=(n=window.navigator.userAgentData)==null?void 0:n.brands;return Array.isArray(t)&&t.some(a=>e.test(a.brand))||e.test(window.navigator.userAgent)}function ie(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function w(e){let t=null;return()=>(t??(t=e()),t)}var F=w(function(){return ie(/^Mac/i)}),Ae=w(function(){return ie(/^iPhone/i)}),oe=w(function(){return ie(/^iPad/i)||F()&&navigator.maxTouchPoints>1}),X=w(function(){return Ae()||oe()}),mt=w(function(){return F()||X()}),Me=w(function(){return Y(/AppleWebKit/i)&&!Ke()}),Ke=w(function(){return Y(/Chrome/i)}),ae=w(function(){return Y(/Android/i)}),bt=w(function(){return Y(/Firefox/i)}),ht=(0,d.createContext)({isNative:!0,open:Tt,useHref:e=>e});function se(){return(0,d.useContext)(ht)}function L(e,t,n=!0){var v;var a;let{metaKey:i,ctrlKey:s,altKey:l,shiftKey:p}=t;bt()&&(a=window.event)!=null&&((v=a.type)!=null&&v.startsWith("key"))&&e.target==="_blank"&&(F()?i=!0:s=!0);let y=Me()&&F()&&!oe()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:s,altKey:l,shiftKey:p}):new MouseEvent("click",{metaKey:i,ctrlKey:s,altKey:l,shiftKey:p,detail:1,bubbles:!0,cancelable:!0});L.isOpening=n,z(e),e.dispatchEvent(y),L.isOpening=!1}L.isOpening=!1;function Et(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function Tt(e,t){Et(e,n=>L(n,t))}function wt(e){let t=se().useHref(e.href??"");return{"data-href":e.href?t:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}function Pt(e){let t=se().useHref((e==null?void 0:e.href)??"");return{href:e!=null&&e.href?t:void 0,target:e==null?void 0:e.target,rel:e==null?void 0:e.rel,download:e==null?void 0:e.download,ping:e==null?void 0:e.ping,referrerPolicy:e==null?void 0:e.referrerPolicy}}var k=new Map,le=new Set;function Ie(){if(typeof window>"u")return;function e(a){return"propertyName"in a}let t=a=>{let i=g(a);if(!e(a)||!i)return;let s=k.get(i);s||(s=new Set,k.set(i,s),i.addEventListener("transitioncancel",n,{once:!0})),s.add(a.propertyName)},n=a=>{let i=g(a);if(!e(a)||!i)return;let s=k.get(i);if(s&&(s.delete(a.propertyName),s.size===0&&(i.removeEventListener("transitioncancel",n),k.delete(i)),k.size===0)){for(let l of le)l();le.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ie):Ie());function kt(){for(let[e]of k)"isConnected"in e&&!e.isConnected&&k.delete(e)}function xe(e){requestAnimationFrame(()=>{kt(),k.size===0?e():le.add(e)})}function Oe(){let e=(0,d.useRef)(new Map),t=(0,d.useCallback)((i,s,l,p)=>{let y=p!=null&&p.once?(...v)=>{e.current.delete(l),l(...v)}:l;e.current.set(l,{type:s,eventTarget:i,fn:y,options:p}),i.addEventListener(s,y,p)},[]),n=(0,d.useCallback)((i,s,l,p)=>{var v;let y=((v=e.current.get(l))==null?void 0:v.fn)||l;i.removeEventListener(s,y,p),e.current.delete(l)},[]),a=(0,d.useCallback)(()=>{e.current.forEach((i,s)=>{n(i.eventTarget,i.type,s,i.options)})},[n]);return(0,d.useEffect)(()=>a,[a]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:a}}var St=d.useInsertionEffect??T;function V(e){let t=(0,d.useRef)(null);return St(()=>{t.current=e},[e]),(0,d.useCallback)((...n)=>{let a=t.current;return a==null?void 0:a(...n)},[])}function Fe(e,t){T(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ne(e){return e.pointerType===""&&e.isTrusted?!0:ae()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Re(e){return!ae()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}var Lt=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Ct(e){let t=O(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:a}=e.style,i=n!=="none"&&a!=="hidden"&&a!=="collapse";if(i){let{getComputedStyle:s}=e.ownerDocument.defaultView,{display:l,visibility:p}=s(e);i=l!=="none"&&p!=="hidden"&&p!=="collapse"}return i}function At(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function ue(e,t){return Lt?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Ct(e)&&At(e,t)&&(!e.parentElement||ue(e.parentElement,e))}var ce=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Mt=ce.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";ce.push('[tabindex]:not([tabindex="-1"]):not([disabled])');var Kt=ce.join(':not([hidden]):not([tabindex="-1"]),');function He(e){return e.matches(Mt)&&ue(e)&&!De(e)}function It(e){return e.matches(Kt)&&ue(e)&&!De(e)}function De(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function xt(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function Ue(e,t,n){xt(e,t),t.set(e,n)}function de(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Ge(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Ot(e){let t=(0,d.useRef)({isFocused:!1,observer:null});return T(()=>{let n=t.current;return()=>{n.observer&&(n.observer=(n.observer.disconnect(),null))}},[]),(0,d.useCallback)(n=>{let a=g(n);if(a instanceof HTMLButtonElement||a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement){t.current.isFocused=!0;let i=a;i.addEventListener("focusout",s=>{if(t.current.isFocused=!1,i.disabled){let l=de(s);e==null||e(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var s;(s=t.current.observer)==null||s.disconnect();let l=i===ne()?null:ne();i.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[e])}var fe=!1;function Ft(e){for(;e&&!He(e);)e=e.parentElement;let t=O(e),n=t.document.activeElement;if(!n||n===e)return;fe=!0;let a=!1,i=m=>{(g(m)===n||a)&&m.stopImmediatePropagation()},s=m=>{(g(m)===n||a)&&(m.stopImmediatePropagation(),!e&&!a&&(a=!0,z(n),y()))},l=m=>{(g(m)===e||a)&&m.stopImmediatePropagation()},p=m=>{(g(m)===e||a)&&(m.stopImmediatePropagation(),a||(a=!0,z(n),y()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",p,!0),t.addEventListener("focus",l,!0);let y=()=>{cancelAnimationFrame(v),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",p,!0),t.removeEventListener("focus",l,!0),fe=!1,a=!1},v=requestAnimationFrame(y);return y}var N="default",pe="",q=new WeakMap;function Nt(e){if(X()){if(N==="default"){let t=h(e);pe=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}N="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";q.set(e,e.style[t]),e.style[t]="none"}}function ze(e){if(X()){if(N!=="disabled")return;N="restoring",setTimeout(()=>{xe(()=>{if(N==="restoring"){let t=h(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=pe||""),pe="",N="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&q.has(e)){let t=q.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),q.delete(e)}}var ge=d.createContext({register:()=>{}});ge.displayName="PressResponderContext";function Rt(e,t){return t.get?t.get.call(e):t.value}function Ve(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ht(e,t){return Rt(e,Ve(e,t,"get"))}function Dt(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}function je(e,t,n){return Dt(e,Ve(e,t,"set"),n),n}rt();function Ut(e){let t=(0,d.useContext)(ge);if(t){let{register:n,ref:a,...i}=t;e=re(i,e),n()}return Fe(t,e.ref),e}var J=new WeakMap,$=class{continuePropagation(){je(this,J,!1)}get shouldStopPropagation(){return Ht(this,J)}constructor(e,t,n,a){var v;Ue(this,J,{writable:!0,value:void 0}),je(this,J,!0);let i=(v=(a==null?void 0:a.target)??n.currentTarget)==null?void 0:v.getBoundingClientRect(),s,l=0,p,y=null;n.clientX!=null&&n.clientY!=null&&(p=n.clientX,y=n.clientY),i&&(p!=null&&y!=null?(s=p-i.left,l=y-i.top):(s=i.width/2,l=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=s,this.y=l,this.key=n.key}},Be=Symbol("linkClicked"),We="react-aria-pressable-style",_e="data-react-aria-pressable";function Gt(e){let{onPress:t,onPressChange:n,onPressStart:a,onPressEnd:i,onPressUp:s,onClick:l,isDisabled:p,isPressed:y,preventFocusOnPress:v,shouldCancelOnPointerExit:m,allowTextSelectionOnPress:A,ref:Q,...qe}=Ut(e),[Je,me]=(0,d.useState)(!1),P=(0,d.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:M,removeAllGlobalListeners:R,removeGlobalListener:H}=Oe(),D=(0,d.useCallback)((r,c)=>{let o=P.current;if(p||o.didFirePressStart)return!1;let f=!0;if(o.isTriggeringEvent=!0,a){let u=new $("pressstart",c,r);a(u),f=u.shouldStopPropagation}return n&&n(!0),o.isTriggeringEvent=!1,o.didFirePressStart=!0,me(!0),f},[p,a,n]),S=(0,d.useCallback)((r,c,o=!0)=>{let f=P.current;if(!f.didFirePressStart)return!1;f.didFirePressStart=!1,f.isTriggeringEvent=!0;let u=!0;if(i){let b=new $("pressend",c,r);i(b),u=b.shouldStopPropagation}if(n&&n(!1),me(!1),t&&o&&!p){let b=new $("press",c,r);t(b),u&&(u=b.shouldStopPropagation)}return f.isTriggeringEvent=!1,u},[p,i,n,t]),$e=V(S),U=(0,d.useCallback)((r,c)=>{let o=P.current;if(p)return!1;if(s){o.isTriggeringEvent=!0;let f=new $("pressup",c,r);return s(f),o.isTriggeringEvent=!1,f.shouldStopPropagation}return!0},[p,s]),Qe=V(U),K=(0,d.useCallback)(r=>{let c=P.current;if(c.isPressed&&c.target){c.didFirePressStart&&c.pointerType!=null&&S(C(c.target,r),c.pointerType,!1),c.isPressed=!1,Pe(null),c.isOverTarget=!1,c.activePointerId=null,c.pointerType=null,R(),A||ze(c.target);for(let o of c.disposables)o();c.disposables=[]}},[A,R,S]),Z=V(K),be=(0,d.useCallback)(r=>{m&&K(r)},[m,K]),ee=(0,d.useCallback)(r=>{p||(l==null||l(r))},[p,l]),he=(0,d.useCallback)((r,c)=>{if(!p&&l){let o=new MouseEvent("click",r);Ge(o,c),l(de(o))}},[p,l]),Ze=V(he),[Ee,Te]=(0,d.useState)(!1);T(()=>{let r=P.current;if(Ee){let c=u=>{var ke;if(r.isPressed&&r.target&&ve(u,r.target)){var b;Ye(g(u),u.key)&&u.preventDefault();let j=g(u),B=E(r.target,j);$e(C(r.target,u),"keyboard",B),B&&Ze(u,r.target),R(),u.key!=="Enter"&&ye(r.target)&&E(r.target,j)&&!u[Be]&&(u[Be]=!0,L(r.target,u,!1)),r.isPressed=!1,Te(!1),(b=r.metaKeyEvents)==null||b.delete(u.key)}else if(u.key==="Meta"&&((ke=r.metaKeyEvents)!=null&&ke.size)){var I;let j=r.metaKeyEvents;r.metaKeyEvents=void 0;for(let B of j.values())(I=r.target)==null||I.dispatchEvent(new KeyboardEvent("keyup",B))}},o=r.target,f=te(u=>{o&&ve(u,o)&&!u.repeat&&E(o,g(u))&&r.target&&Qe(C(r.target,u),"keyboard")},c);return M(h(r.target),"keyup",f,!0),()=>{H(h(r.target),"keyup",f,!0)}}},[Ee,M,R,H]);let[we,Pe]=(0,d.useState)(null);T(()=>{let r=P.current;if(we==="pointer"){let c=f=>{if(f.pointerId===r.activePointerId&&r.isPressed&&f.button===0&&r.target){if(E(r.target,g(f))&&r.pointerType!=null){let u=!1,b=setTimeout(()=>{r.isPressed&&r.target instanceof HTMLElement&&(u?Z(f):(z(r.target),r.target.click()))},80);f.currentTarget&&M(f.currentTarget,"click",()=>u=!0,!0),r.disposables.push(()=>clearTimeout(b))}else Z(f);r.isOverTarget=!1}},o=f=>{Z(f)};return M(h(r.target),"pointerup",c,!1),M(h(r.target),"pointercancel",o,!1),()=>{H(h(r.target),"pointerup",c,!1),H(h(r.target),"pointercancel",o,!1)}}},[we,M,H]);let et=(0,d.useMemo)(()=>{let r=P.current,c={onKeyDown(o){if(ve(o.nativeEvent,o.currentTarget)&&E(o.currentTarget,g(o))){var f;Ye(g(o),o.key)&&o.preventDefault();let u=!0;!r.isPressed&&!o.repeat&&(r.target=o.currentTarget,r.isPressed=!0,Te(!0),r.pointerType="keyboard",u=D(o,"keyboard")),u&&o.stopPropagation(),o.metaKey&&F()&&((f=r.metaKeyEvents)==null||f.set(o.key,o.nativeEvent))}else o.key==="Meta"&&(r.metaKeyEvents=new Map)},onClick(o){if(!(o&&!E(o.currentTarget,g(o)))&&o&&o.button===0&&!r.isTriggeringEvent&&!L.isOpening){let f=!0;if(p&&o.preventDefault(),!r.ignoreEmulatedMouseEvents&&!r.isPressed&&(r.pointerType==="virtual"||Ne(o.nativeEvent))){let u=D(o,"virtual"),b=U(o,"virtual"),I=S(o,"virtual");ee(o),f=u&&b&&I}else if(r.isPressed&&r.pointerType!=="keyboard"){let u=r.pointerType||o.nativeEvent.pointerType||"virtual",b=U(C(o.currentTarget,o),u),I=S(C(o.currentTarget,o),u,!0);f=b&&I,r.isOverTarget=!1,ee(o),K(o)}r.ignoreEmulatedMouseEvents=!1,f&&o.stopPropagation()}}};return typeof PointerEvent<"u"&&(c.onPointerDown=o=>{if(o.button!==0||!E(o.currentTarget,g(o)))return;if(Re(o.nativeEvent)){r.pointerType="virtual";return}r.pointerType=o.pointerType;let f=!0;if(!r.isPressed){r.isPressed=!0,Pe("pointer"),r.isOverTarget=!0,r.activePointerId=o.pointerId,r.target=o.currentTarget,A||Nt(r.target),f=D(o,r.pointerType);let u=g(o);"releasePointerCapture"in u&&("hasPointerCapture"in u?u.hasPointerCapture(o.pointerId)&&u.releasePointerCapture(o.pointerId):u.releasePointerCapture(o.pointerId))}f&&o.stopPropagation()},c.onMouseDown=o=>{if(E(o.currentTarget,g(o))&&o.button===0){if(v){let f=Ft(o.target);f&&r.disposables.push(f)}o.stopPropagation()}},c.onPointerUp=o=>{!E(o.currentTarget,g(o))||r.pointerType==="virtual"||o.button===0&&!r.isPressed&&U(o,r.pointerType||o.pointerType)},c.onPointerEnter=o=>{o.pointerId===r.activePointerId&&r.target&&!r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!0,D(C(r.target,o),r.pointerType))},c.onPointerLeave=o=>{o.pointerId===r.activePointerId&&r.target&&r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!1,S(C(r.target,o),r.pointerType,!1),be(o))},c.onDragStart=o=>{E(o.currentTarget,g(o))&&K(o)}),c},[p,v,R,A,K,be,S,D,U,ee,he]);return(0,d.useEffect)(()=>{if(!Q)return;let r=h(Q.current);if(!r||!r.head||r.getElementById(We))return;let c=r.createElement("style");c.id=We,c.textContent=`
1
+ import{s as tt}from"./chunk-LvLJmgfZ.js";import{t as nt}from"./react-Bj1aDYRI.js";import{t as rt}from"./react-dom-CSu739Rf.js";import{n as it}from"./clsx-XrBBnd7s.js";import{n as ot}from"./SSRProvider-D3zWcDme.js";var d=tt(nt(),1),T=typeof document<"u"?d.useLayoutEffect:()=>{};function at(e){let[t,n]=(0,d.useState)(e),a=(0,d.useRef)(t),i=(0,d.useRef)(null),s=(0,d.useRef)(()=>{if(!i.current)return;let l=i.current.next();if(l.done){i.current=null;return}a.current===l.value?s.current():n(l.value)});return T(()=>{a.current=t,i.current&&s.current()}),[t,(0,d.useCallback)(l=>{i.current=l(a.current),s.current()},[s])]}var st=!!(typeof window<"u"&&window.document&&window.document.createElement),x=new Map,G;typeof FinalizationRegistry<"u"&&(G=new FinalizationRegistry(e=>{x.delete(e)}));function Se(e){let[t,n]=(0,d.useState)(e),a=(0,d.useRef)(null),i=ot(t),s=(0,d.useRef)(null);if(G&&G.register(s,i),st){let l=x.get(i);l&&!l.includes(a)?l.push(a):x.set(i,[a])}return T(()=>{let l=i;return()=>{G&&G.unregister(s),x.delete(l)}},[i]),(0,d.useEffect)(()=>{let l=a.current;return l&&n(l),()=>{l&&(a.current=null)}}),i}function lt(e,t){if(e===t)return e;let n=x.get(e);if(n)return n.forEach(i=>i.current=t),t;let a=x.get(t);return a?(a.forEach(i=>i.current=e),e):t}function ut(e=[]){let t=Se(),[n,a]=at(t),i=(0,d.useCallback)(()=>{a(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,a]);return T(i,[t,i,...e]),n}function te(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}var h=e=>(e==null?void 0:e.ownerDocument)??document,O=e=>e&&"window"in e&&e.window===e?e:h(e).defaultView||window;function ct(e){return typeof e=="object"&&!!e&&"nodeType"in e&&typeof e.nodeType=="number"}function dt(e){return ct(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}var ft=!1;function W(){return ft}function E(e,t){if(!W())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName==="SLOT"&&n.assignedSlot?n.assignedSlot.parentNode:dt(n)?n.host:n.parentNode}return!1}var ne=(e=document)=>{var n;if(!W())return e.activeElement;let t=e.activeElement;for(;t&&"shadowRoot"in t&&((n=t.shadowRoot)!=null&&n.activeElement);)t=t.shadowRoot.activeElement;return t};function g(e){if(W()&&e.target instanceof Element&&e.target.shadowRoot){if("composedPath"in e)return e.composedPath()[0]??null;if("composedPath"in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function pt(e){if(!e)return!1;let t=e.getRootNode(),n=O(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let a=t.activeElement;return a!=null&&e.contains(a)}function Le(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,a=e.map(i=>{let s=Ce(i,t);return n||(n=typeof s=="function"),s});if(n)return()=>{a.forEach((i,s)=>{typeof i=="function"?i():Ce(e[s],null)})}}}function Ce(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function re(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let a=e[n];for(let i in a){let s=t[i],l=a[i];typeof s=="function"&&typeof l=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?t[i]=te(s,l):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof l=="string"?t[i]=it(s,l):i==="id"&&s&&l?t.id=lt(s,l):i==="ref"&&s&&l?t.ref=Le(s,l):t[i]=l===void 0?s:l}}return t}function j(e){if(gt())e.focus({preventScroll:!0});else{let t=yt(e);e.focus(),vt(t)}}var Y=null;function gt(){if(Y==null){Y=!1;try{document.createElement("div").focus({get preventScroll(){return Y=!0,!0}})}catch{}}return Y}function yt(e){let t=e.parentNode,n=[],a=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==a;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return a instanceof HTMLElement&&n.push({element:a,scrollTop:a.scrollTop,scrollLeft:a.scrollLeft}),n}function vt(e){for(let{element:t,scrollTop:n,scrollLeft:a}of e)t.scrollTop=n,t.scrollLeft=a}function _(e){var n;if(typeof window>"u"||window.navigator==null)return!1;let t=(n=window.navigator.userAgentData)==null?void 0:n.brands;return Array.isArray(t)&&t.some(a=>e.test(a.brand))||e.test(window.navigator.userAgent)}function ie(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function w(e){let t=null;return()=>(t??(t=e()),t)}var F=w(function(){return ie(/^Mac/i)}),Ae=w(function(){return ie(/^iPhone/i)}),oe=w(function(){return ie(/^iPad/i)||F()&&navigator.maxTouchPoints>1}),X=w(function(){return Ae()||oe()}),mt=w(function(){return F()||X()}),Me=w(function(){return _(/AppleWebKit/i)&&!Ke()}),Ke=w(function(){return _(/Chrome/i)}),ae=w(function(){return _(/Android/i)}),bt=w(function(){return _(/Firefox/i)}),ht=(0,d.createContext)({isNative:!0,open:Tt,useHref:e=>e});function se(){return(0,d.useContext)(ht)}function L(e,t,n=!0){var v;var a;let{metaKey:i,ctrlKey:s,altKey:l,shiftKey:p}=t;bt()&&(a=window.event)!=null&&((v=a.type)!=null&&v.startsWith("key"))&&e.target==="_blank"&&(F()?i=!0:s=!0);let y=Me()&&F()&&!oe()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:s,altKey:l,shiftKey:p}):new MouseEvent("click",{metaKey:i,ctrlKey:s,altKey:l,shiftKey:p,detail:1,bubbles:!0,cancelable:!0});L.isOpening=n,j(e),e.dispatchEvent(y),L.isOpening=!1}L.isOpening=!1;function Et(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function Tt(e,t){Et(e,n=>L(n,t))}function wt(e){let t=se().useHref(e.href??"");return{"data-href":e.href?t:void 0,"data-target":e.target,"data-rel":e.rel,"data-download":e.download,"data-ping":e.ping,"data-referrer-policy":e.referrerPolicy}}function Pt(e){let t=se().useHref((e==null?void 0:e.href)??"");return{href:e!=null&&e.href?t:void 0,target:e==null?void 0:e.target,rel:e==null?void 0:e.rel,download:e==null?void 0:e.download,ping:e==null?void 0:e.ping,referrerPolicy:e==null?void 0:e.referrerPolicy}}var k=new Map,le=new Set;function Ie(){if(typeof window>"u")return;function e(a){return"propertyName"in a}let t=a=>{let i=g(a);if(!e(a)||!i)return;let s=k.get(i);s||(s=new Set,k.set(i,s),i.addEventListener("transitioncancel",n,{once:!0})),s.add(a.propertyName)},n=a=>{let i=g(a);if(!e(a)||!i)return;let s=k.get(i);if(s&&(s.delete(a.propertyName),s.size===0&&(i.removeEventListener("transitioncancel",n),k.delete(i)),k.size===0)){for(let l of le)l();le.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Ie):Ie());function kt(){for(let[e]of k)"isConnected"in e&&!e.isConnected&&k.delete(e)}function xe(e){requestAnimationFrame(()=>{kt(),k.size===0?e():le.add(e)})}function Oe(){let e=(0,d.useRef)(new Map),t=(0,d.useCallback)((i,s,l,p)=>{let y=p!=null&&p.once?(...v)=>{e.current.delete(l),l(...v)}:l;e.current.set(l,{type:s,eventTarget:i,fn:y,options:p}),i.addEventListener(s,y,p)},[]),n=(0,d.useCallback)((i,s,l,p)=>{var v;let y=((v=e.current.get(l))==null?void 0:v.fn)||l;i.removeEventListener(s,y,p),e.current.delete(l)},[]),a=(0,d.useCallback)(()=>{e.current.forEach((i,s)=>{n(i.eventTarget,i.type,s,i.options)})},[n]);return(0,d.useEffect)(()=>a,[a]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:a}}var St=d.useInsertionEffect??T;function z(e){let t=(0,d.useRef)(null);return St(()=>{t.current=e},[e]),(0,d.useCallback)((...n)=>{let a=t.current;return a==null?void 0:a(...n)},[])}function Fe(e,t){T(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ne(e){return e.pointerType===""&&e.isTrusted?!0:ae()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function He(e){return!ae()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}var Lt=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Ct(e){let t=O(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:a}=e.style,i=n!=="none"&&a!=="hidden"&&a!=="collapse";if(i){let{getComputedStyle:s}=e.ownerDocument.defaultView,{display:l,visibility:p}=s(e);i=l!=="none"&&p!=="hidden"&&p!=="collapse"}return i}function At(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function ue(e,t){return Lt?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):e.nodeName!=="#comment"&&Ct(e)&&At(e,t)&&(!e.parentElement||ue(e.parentElement,e))}var ce=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Mt=ce.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";ce.push('[tabindex]:not([tabindex="-1"]):not([disabled])');var Kt=ce.join(':not([hidden]):not([tabindex="-1"]),');function Re(e){return e.matches(Mt)&&ue(e)&&!De(e)}function It(e){return e.matches(Kt)&&ue(e)&&!De(e)}function De(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function de(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Ue(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function xt(e){let t=(0,d.useRef)({isFocused:!1,observer:null});return T(()=>{let n=t.current;return()=>{n.observer&&(n.observer=(n.observer.disconnect(),null))}},[]),(0,d.useCallback)(n=>{let a=g(n);if(a instanceof HTMLButtonElement||a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement){t.current.isFocused=!0;let i=a;i.addEventListener("focusout",s=>{if(t.current.isFocused=!1,i.disabled){let l=de(s);e==null||e(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&i.disabled){var s;(s=t.current.observer)==null||s.disconnect();let l=i===ne()?null:ne();i.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[e])}var fe=!1;function Ot(e){for(;e&&!Re(e);)e=e.parentElement;let t=O(e),n=t.document.activeElement;if(!n||n===e)return;fe=!0;let a=!1,i=m=>{(g(m)===n||a)&&m.stopImmediatePropagation()},s=m=>{(g(m)===n||a)&&(m.stopImmediatePropagation(),!e&&!a&&(a=!0,j(n),y()))},l=m=>{(g(m)===e||a)&&m.stopImmediatePropagation()},p=m=>{(g(m)===e||a)&&(m.stopImmediatePropagation(),a||(a=!0,j(n),y()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",s,!0),t.addEventListener("focusin",p,!0),t.addEventListener("focus",l,!0);let y=()=>{cancelAnimationFrame(v),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",s,!0),t.removeEventListener("focusin",p,!0),t.removeEventListener("focus",l,!0),fe=!1,a=!1},v=requestAnimationFrame(y);return y}var N="default",pe="",q=new WeakMap;function Ft(e){if(X()){if(N==="default"){let t=h(e);pe=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}N="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";q.set(e,e.style[t]),e.style[t]="none"}}function Ge(e){if(X()){if(N!=="disabled")return;N="restoring",setTimeout(()=>{xe(()=>{if(N==="restoring"){let t=h(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=pe||""),pe="",N="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&q.has(e)){let t=q.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[n]==="none"&&(e.style[n]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),q.delete(e)}}var ge=d.createContext({register:()=>{}});ge.displayName="PressResponderContext";function Nt(e,t){return t.get?t.get.call(e):t.value}function je(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ht(e,t){return Nt(e,je(e,t,"get"))}function Rt(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}function ze(e,t,n){Rt(e,t),t.set(e,n)}function Dt(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}function Ve(e,t,n){return Dt(e,je(e,t,"set"),n),n}rt();function Ut(e){let t=(0,d.useContext)(ge);if(t){let{register:n,ref:a,...i}=t;e=re(i,e),n()}return Fe(t,e.ref),e}var J=new WeakMap,$=class{continuePropagation(){Ve(this,J,!1)}get shouldStopPropagation(){return Ht(this,J)}constructor(e,t,n,a){var v;ze(this,J,{writable:!0,value:void 0}),Ve(this,J,!0);let i=(v=(a==null?void 0:a.target)??n.currentTarget)==null?void 0:v.getBoundingClientRect(),s,l=0,p,y=null;n.clientX!=null&&n.clientY!=null&&(p=n.clientX,y=n.clientY),i&&(p!=null&&y!=null?(s=p-i.left,l=y-i.top):(s=i.width/2,l=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=s,this.y=l,this.key=n.key}},Be=Symbol("linkClicked"),We="react-aria-pressable-style",Ye="data-react-aria-pressable";function Gt(e){let{onPress:t,onPressChange:n,onPressStart:a,onPressEnd:i,onPressUp:s,onClick:l,isDisabled:p,isPressed:y,preventFocusOnPress:v,shouldCancelOnPointerExit:m,allowTextSelectionOnPress:A,ref:Q,...qe}=Ut(e),[Je,me]=(0,d.useState)(!1),P=(0,d.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:M,removeAllGlobalListeners:H,removeGlobalListener:R}=Oe(),D=(0,d.useCallback)((r,c)=>{let o=P.current;if(p||o.didFirePressStart)return!1;let f=!0;if(o.isTriggeringEvent=!0,a){let u=new $("pressstart",c,r);a(u),f=u.shouldStopPropagation}return n&&n(!0),o.isTriggeringEvent=!1,o.didFirePressStart=!0,me(!0),f},[p,a,n]),S=(0,d.useCallback)((r,c,o=!0)=>{let f=P.current;if(!f.didFirePressStart)return!1;f.didFirePressStart=!1,f.isTriggeringEvent=!0;let u=!0;if(i){let b=new $("pressend",c,r);i(b),u=b.shouldStopPropagation}if(n&&n(!1),me(!1),t&&o&&!p){let b=new $("press",c,r);t(b),u&&(u=b.shouldStopPropagation)}return f.isTriggeringEvent=!1,u},[p,i,n,t]),$e=z(S),U=(0,d.useCallback)((r,c)=>{let o=P.current;if(p)return!1;if(s){o.isTriggeringEvent=!0;let f=new $("pressup",c,r);return s(f),o.isTriggeringEvent=!1,f.shouldStopPropagation}return!0},[p,s]),Qe=z(U),K=(0,d.useCallback)(r=>{let c=P.current;if(c.isPressed&&c.target){c.didFirePressStart&&c.pointerType!=null&&S(C(c.target,r),c.pointerType,!1),c.isPressed=!1,Pe(null),c.isOverTarget=!1,c.activePointerId=null,c.pointerType=null,H(),A||Ge(c.target);for(let o of c.disposables)o();c.disposables=[]}},[A,H,S]),Z=z(K),be=(0,d.useCallback)(r=>{m&&K(r)},[m,K]),ee=(0,d.useCallback)(r=>{p||(l==null||l(r))},[p,l]),he=(0,d.useCallback)((r,c)=>{if(!p&&l){let o=new MouseEvent("click",r);Ue(o,c),l(de(o))}},[p,l]),Ze=z(he),[Ee,Te]=(0,d.useState)(!1);T(()=>{let r=P.current;if(Ee){let c=u=>{var ke;if(r.isPressed&&r.target&&ve(u,r.target)){var b;_e(g(u),u.key)&&u.preventDefault();let V=g(u),B=E(r.target,V);$e(C(r.target,u),"keyboard",B),B&&Ze(u,r.target),H(),u.key!=="Enter"&&ye(r.target)&&E(r.target,V)&&!u[Be]&&(u[Be]=!0,L(r.target,u,!1)),r.isPressed=!1,Te(!1),(b=r.metaKeyEvents)==null||b.delete(u.key)}else if(u.key==="Meta"&&((ke=r.metaKeyEvents)!=null&&ke.size)){var I;let V=r.metaKeyEvents;r.metaKeyEvents=void 0;for(let B of V.values())(I=r.target)==null||I.dispatchEvent(new KeyboardEvent("keyup",B))}},o=r.target,f=te(u=>{o&&ve(u,o)&&!u.repeat&&E(o,g(u))&&r.target&&Qe(C(r.target,u),"keyboard")},c);return M(h(r.target),"keyup",f,!0),()=>{R(h(r.target),"keyup",f,!0)}}},[Ee,M,H,R]);let[we,Pe]=(0,d.useState)(null);T(()=>{let r=P.current;if(we==="pointer"){let c=f=>{if(f.pointerId===r.activePointerId&&r.isPressed&&f.button===0&&r.target){if(E(r.target,g(f))&&r.pointerType!=null){let u=!1,b=setTimeout(()=>{r.isPressed&&r.target instanceof HTMLElement&&(u?Z(f):(j(r.target),r.target.click()))},80);f.currentTarget&&M(f.currentTarget,"click",()=>u=!0,!0),r.disposables.push(()=>clearTimeout(b))}else Z(f);r.isOverTarget=!1}},o=f=>{Z(f)};return M(h(r.target),"pointerup",c,!1),M(h(r.target),"pointercancel",o,!1),()=>{R(h(r.target),"pointerup",c,!1),R(h(r.target),"pointercancel",o,!1)}}},[we,M,R]);let et=(0,d.useMemo)(()=>{let r=P.current,c={onKeyDown(o){if(ve(o.nativeEvent,o.currentTarget)&&E(o.currentTarget,g(o))){var f;_e(g(o),o.key)&&o.preventDefault();let u=!0;!r.isPressed&&!o.repeat&&(r.target=o.currentTarget,r.isPressed=!0,Te(!0),r.pointerType="keyboard",u=D(o,"keyboard")),u&&o.stopPropagation(),o.metaKey&&F()&&((f=r.metaKeyEvents)==null||f.set(o.key,o.nativeEvent))}else o.key==="Meta"&&(r.metaKeyEvents=new Map)},onClick(o){if(!(o&&!E(o.currentTarget,g(o)))&&o&&o.button===0&&!r.isTriggeringEvent&&!L.isOpening){let f=!0;if(p&&o.preventDefault(),!r.ignoreEmulatedMouseEvents&&!r.isPressed&&(r.pointerType==="virtual"||Ne(o.nativeEvent))){let u=D(o,"virtual"),b=U(o,"virtual"),I=S(o,"virtual");ee(o),f=u&&b&&I}else if(r.isPressed&&r.pointerType!=="keyboard"){let u=r.pointerType||o.nativeEvent.pointerType||"virtual",b=U(C(o.currentTarget,o),u),I=S(C(o.currentTarget,o),u,!0);f=b&&I,r.isOverTarget=!1,ee(o),K(o)}r.ignoreEmulatedMouseEvents=!1,f&&o.stopPropagation()}}};return typeof PointerEvent<"u"&&(c.onPointerDown=o=>{if(o.button!==0||!E(o.currentTarget,g(o)))return;if(He(o.nativeEvent)){r.pointerType="virtual";return}r.pointerType=o.pointerType;let f=!0;if(!r.isPressed){r.isPressed=!0,Pe("pointer"),r.isOverTarget=!0,r.activePointerId=o.pointerId,r.target=o.currentTarget,A||Ft(r.target),f=D(o,r.pointerType);let u=g(o);"releasePointerCapture"in u&&("hasPointerCapture"in u?u.hasPointerCapture(o.pointerId)&&u.releasePointerCapture(o.pointerId):u.releasePointerCapture(o.pointerId))}f&&o.stopPropagation()},c.onMouseDown=o=>{if(E(o.currentTarget,g(o))&&o.button===0){if(v){let f=Ot(o.target);f&&r.disposables.push(f)}o.stopPropagation()}},c.onPointerUp=o=>{!E(o.currentTarget,g(o))||r.pointerType==="virtual"||o.button===0&&!r.isPressed&&U(o,r.pointerType||o.pointerType)},c.onPointerEnter=o=>{o.pointerId===r.activePointerId&&r.target&&!r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!0,D(C(r.target,o),r.pointerType))},c.onPointerLeave=o=>{o.pointerId===r.activePointerId&&r.target&&r.isOverTarget&&r.pointerType!=null&&(r.isOverTarget=!1,S(C(r.target,o),r.pointerType,!1),be(o))},c.onDragStart=o=>{E(o.currentTarget,g(o))&&K(o)}),c},[p,v,H,A,K,be,S,D,U,ee,he]);return(0,d.useEffect)(()=>{if(!Q)return;let r=h(Q.current);if(!r||!r.head||r.getElementById(We))return;let c=r.createElement("style");c.id=We,c.textContent=`
2
2
  @layer {
3
- [${_e}] {
3
+ [${Ye}] {
4
4
  touch-action: pan-x pan-y pinch-zoom;
5
5
  }
6
6
  }
7
- `.trim(),r.head.prepend(c)},[Q]),(0,d.useEffect)(()=>{let r=P.current;return()=>{A||ze(r.target??void 0);for(let c of r.disposables)c();r.disposables=[]}},[A]),{isPressed:y||Je,pressProps:re(qe,et,{[_e]:!0})}}function ye(e){return e.tagName==="A"&&e.hasAttribute("href")}function ve(e,t){let{key:n,code:a}=e,i=t,s=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||a==="Space")&&!(i instanceof O(i).HTMLInputElement&&!Xe(i,n)||i instanceof O(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&ye(i))&&n!=="Enter")}function C(e,t){let n=t.clientX,a=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:a,key:t.key}}function zt(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!ye(e)}function Ye(e,t){return e instanceof HTMLInputElement?!Xe(e,t):zt(e)}var Vt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Xe(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":Vt.has(e.type)}export{Le as A,Se as B,oe as C,X as D,mt as E,W as F,h as I,O as L,pt as M,ne as N,z as O,g as P,te as R,Me as S,ae as T,T as V,L as _,Ge as a,Ae as b,He as c,Ne as d,Fe as f,Pt as g,xe as h,Ot as i,E as j,re as k,It as l,Oe as m,ge as n,fe as o,V as p,de as r,Ue as s,Gt as t,Re as u,se as v,F as w,Ke as x,wt as y,ut as z};
7
+ `.trim(),r.head.prepend(c)},[Q]),(0,d.useEffect)(()=>{let r=P.current;return()=>{A||Ge(r.target??void 0);for(let c of r.disposables)c();r.disposables=[]}},[A]),{isPressed:y||Je,pressProps:re(qe,et,{[Ye]:!0})}}function ye(e){return e.tagName==="A"&&e.hasAttribute("href")}function ve(e,t){let{key:n,code:a}=e,i=t,s=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||a==="Space")&&!(i instanceof O(i).HTMLInputElement&&!Xe(i,n)||i instanceof O(i).HTMLTextAreaElement||i.isContentEditable)&&!((s==="link"||!s&&ye(i))&&n!=="Enter")}function C(e,t){let n=t.clientX,a=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:a,key:t.key}}function jt(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!ye(e)}function _e(e,t){return e instanceof HTMLInputElement?!Xe(e,t):jt(e)}var zt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Xe(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":zt.has(e.type)}export{Le as A,Se as B,oe as C,X as D,mt as E,W as F,h as I,O as L,pt as M,ne as N,j as O,g as P,te as R,Me as S,ae as T,T as V,L as _,xt as a,Ae as b,Re as c,Ne as d,Fe as f,Pt as g,xe as h,de as i,E as j,re as k,It as l,Oe as m,ze as n,Ue as o,z as p,ge as r,fe as s,Gt as t,He as u,se as v,F as w,Ke as x,wt as y,ut as z};
@@ -1 +1 @@
1
- import{d as g,n as i,p as k}from"./useEvent-D91BmmQi.js";import{E as v,Ln as w,Ur as F,h as d,yt as b,zr as _}from"./cells-CuaAKcwV.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{_ as z}from"./useEventListener-DGjKht0c.js";import{o as D}from"./dist-BNTOYRCs.js";import{r as E}from"./requests-9-v2bhoi.js";var u=x();const y=k(!1);function H(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function L(r){let n=(0,u.c)(3),t=f(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function U(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(_(d())),r[0]=n,r[1]=t),i(t)}function f(){let r=(0,u.c)(4),{prepareForRun:n}=v(),{sendRun:t}=E(),e=g(y),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),I({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function I({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,p;l?(w(l)!=="markdown"&&D(l),p=b(l)):p=((R=s[a])==null?void 0:R.code)||"",c.push(p),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{z.error(a)})}export{f as a,L as i,I as n,H as o,U as r,y as t};
1
+ import{d as g,n as i,p as k}from"./useEvent-D91BmmQi.js";import{E as v,Ln as w,Ur as F,h as d,yt as b,zr as _}from"./cells-BVG4a-Qn.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{_ as z}from"./useEventListener-DGjKht0c.js";import{o as D}from"./dist-BNTOYRCs.js";import{r as E}from"./requests-9-v2bhoi.js";var u=x();const y=k(!1);function H(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function L(r){let n=(0,u.c)(3),t=f(),e;return n[0]!==r||n[1]!==t?(e=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=e):e=n[2],i(e)}function U(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(_(d())),r[0]=n,r[1]=t),i(t)}function f(){let r=(0,u.c)(4),{prepareForRun:n}=v(),{sendRun:t}=E(),e=g(y),o;return r[0]!==n||r[1]!==t||r[2]!==e?(o=async s=>{if(s.length===0)return;let c=d();return e(!0),I({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=e,r[3]=o):o=r[3],i(o)}async function I({cellIds:r,sendRun:n,prepareForRun:t,notebook:e}){var m,h,R;if(r.length===0)return;let{cellHandles:o,cellData:s}=e,c=[];for(let a of r){let l=(h=(m=o[a])==null?void 0:m.current)==null?void 0:h.editorView,p;l?(w(l)!=="markdown"&&D(l),p=b(l)):p=((R=s[a])==null?void 0:R.code)||"",c.push(p),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{z.error(a)})}export{f as a,L as i,I as n,H as o,U as r,y as t};
@@ -1 +1 @@
1
- import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-D91BmmQi.js";import{E as d,f,yt as u}from"./cells-CuaAKcwV.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-Blw4afVn.js";import{t as h}from"./use-toast-BDYuj3zG.js";import{r as v}from"./useDeleteCell-6SLN_jZa.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j as t};
1
+ import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-D91BmmQi.js";import{E as d,f,yt as u}from"./cells-BVG4a-Qn.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-Blw4afVn.js";import{t as h}from"./use-toast-BDYuj3zG.js";import{r as v}from"./useDeleteCell-CIdiI4Pk.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=h({title:"Cell split",action:(0,b.jsx)(v,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j as t};
@@ -1,4 +1,4 @@
1
- var de=Object.defineProperty;var he=(t,e,n)=>e in t?de(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var A=(t,e,n)=>he(t,typeof e!="symbol"?e+"":e,n);var at,lt,ot,ut,ct;import{_ as fe,d as yt}from"./useEventListener-DGjKht0c.js";import{St as pt,a as ye,c as pe,gt as ge,o as me,wt as ve}from"./vega-loader.browser-DLukqq1q.js";const gt=Uint8Array.of(65,82,82,79,87,49),$={V1:0,V2:1,V3:2,V4:3,V5:4},S={NONE:0,Schema:1,DictionaryBatch:2,RecordBatch:3,Tensor:4,SparseTensor:5},l={Dictionary:-1,NONE:0,Null:1,Int:2,Float:3,Binary:4,Utf8:5,Bool:6,Decimal:7,Date:8,Time:9,Timestamp:10,Interval:11,List:12,Struct:13,Union:14,FixedSizeBinary:15,FixedSizeList:16,Map:17,Duration:18,LargeBinary:19,LargeUtf8:20,LargeList:21,RunEndEncoded:22,BinaryView:23,Utf8View:24,ListView:25,LargeListView:26},mt={HALF:0,SINGLE:1,DOUBLE:2},z={DAY:0,MILLISECOND:1},m={SECOND:0,MILLISECOND:1,MICROSECOND:2,NANOSECOND:3},C={YEAR_MONTH:0,DAY_TIME:1,MONTH_DAY_NANO:2},W={Sparse:0,Dense:1},vt=Uint8Array,bt=Uint16Array,xt=Uint32Array,wt=BigUint64Array,It=Int8Array,be=Int16Array,x=Int32Array,L=BigInt64Array,xe=Float32Array,k=Float64Array;function we(t,e){let n=Math.log2(t)-3;return(e?[It,be,x,L]:[vt,bt,xt,wt])[n]}Object.getPrototypeOf(Int8Array);function X(t,e){let n=0,r=t.length;if(r<=2147483648)do{let i=n+r>>>1;t[i]<=e?n=i+1:r=i}while(n<r);else do{let i=Math.trunc((n+r)/2);t[i]<=e?n=i+1:r=i}while(n<r);return n}function J(t,e,n){if(e(t))return t;throw Error(n(t))}function w(t,e,n){return e=Array.isArray(e)?e:Object.values(e),J(t,r=>e.includes(r),n??(()=>`${t} must be one of ${e}`))}function Lt(t,e){for(let[n,r]of Object.entries(t))if(r===e)return n;return"<Unknown>"}const Z=t=>`Unsupported data type: "${Lt(l,t)}" (id ${t})`,At=(t,e,n=!0,r=null)=>({name:t,type:e,nullable:n,metadata:r});function Nt(t){return Object.hasOwn(t,"name")&&Et(t.type)}function Et(t){return typeof(t==null?void 0:t.typeId)=="number"}function B(t,e="",n=!0){return Nt(t)?t:At(e,J(t,Et,()=>"Data type expected."),n)}const Ie=(t,e,n=!1,r=-1)=>({typeId:l.Dictionary,id:r,dictionary:t,indices:e||St(),ordered:n}),Dt=(t=32,e=!0)=>({typeId:l.Int,bitWidth:w(t,[8,16,32,64]),signed:e,values:we(t,e)}),St=()=>Dt(32),Le=(t=2)=>({typeId:l.Float,precision:w(t,mt),values:[bt,xe,k][t]}),Ae=()=>({typeId:l.Binary,offsets:x}),Ne=()=>({typeId:l.Utf8,offsets:x}),Ee=(t,e,n=128)=>({typeId:l.Decimal,precision:t,scale:e,bitWidth:w(n,[128,256]),values:wt}),De=t=>({typeId:l.Date,unit:w(t,z),values:t===z.DAY?x:L}),Se=(t=m.MILLISECOND,e=32)=>({typeId:l.Time,unit:w(t,m),bitWidth:w(e,[32,64]),values:e===32?x:L}),Be=(t=m.MILLISECOND,e=null)=>({typeId:l.Timestamp,unit:w(t,m),timezone:e,values:L}),Oe=(t=C.MONTH_DAY_NANO)=>({typeId:l.Interval,unit:w(t,C),values:t===C.MONTH_DAY_NANO?void 0:x}),Te=t=>({typeId:l.List,children:[B(t)],offsets:x}),Me=t=>({typeId:l.Struct,children:Array.isArray(t)&&Nt(t[0])?t:Object.entries(t).map(([e,n])=>At(e,n))}),Ce=(t,e,n,r)=>(n??(n=e.map((i,s)=>s)),{typeId:l.Union,mode:w(t,W),typeIds:n,typeMap:n.reduce((i,s,a)=>(i[s]=a,i),{}),children:e.map((i,s)=>B(i,`_${s}`)),typeIdForValue:r,offsets:x}),Ue=t=>({typeId:l.FixedSizeBinary,stride:t}),Ve=(t,e)=>({typeId:l.FixedSizeList,stride:e,children:[B(t)]}),Fe=(t,e)=>({typeId:l.Map,keysSorted:t,children:[e],offsets:x}),Re=(t=m.MILLISECOND)=>({typeId:l.Duration,unit:w(t,m),values:L}),$e=()=>({typeId:l.LargeBinary,offsets:L}),ze=()=>({typeId:l.LargeUtf8,offsets:L}),ke=t=>({typeId:l.LargeList,children:[B(t)],offsets:L}),je=(t,e)=>({typeId:l.RunEndEncoded,children:[J(B(t,"run_ends"),n=>n.type.typeId===l.Int,()=>"Run-ends must have an integer type."),B(e,"values")]}),Ye=t=>({typeId:l.ListView,children:[B(t,"value")],offsets:x}),_e=t=>({typeId:l.LargeListView,children:[B(t,"value")],offsets:L});var j=new k(2).buffer;new L(j),new xt(j),new x(j),new vt(j);function O(t){if(t>2**53-1||t<-(2**53-1))throw Error(`BigInt exceeds integer number representation: ${t}`);return Number(t)}function G(t,e){return Number(t/e)+Number(t%e)/Number(e)}var U=t=>BigInt.asUintN(64,t);function He(t,e){let n=e<<1,r;return BigInt.asIntN(64,t[n+1])<0?(r=U(~t[n])|U(~t[n+1])<<64n,r=-(r+1n)):r=t[n]|t[n+1]<<64n,r}function Pe(t,e){let n=e<<2,r;return BigInt.asIntN(64,t[n+3])<0?(r=U(~t[n])|U(~t[n+1])<<64n|U(~t[n+2])<<128n|U(~t[n+3])<<192n,r=-(r+1n)):r=t[n]|t[n+1]<<64n|t[n+2]<<128n|t[n+3]<<192n,r}var We=new TextDecoder("utf-8");new TextEncoder;function Y(t){return We.decode(t)}function Bt(t,e){return(t[e>>3]&1<<e%8)!=0}function N(t,e){let n=e+h(t,e),r=n-h(t,n),i=v(t,r);return(s,a,o=null)=>{if(s<i){let u=v(t,r+s);if(u)return a(t,n+u)}return o}}function M(t,e){return e}function F(t,e){return!!Xe(t,e)}function Xe(t,e){return q(t,e)<<24>>24}function q(t,e){return t[e]}function v(t,e){return Je(t,e)<<16>>16}function Je(t,e){return t[e]|t[e+1]<<8}function h(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function Ot(t,e){return h(t,e)>>>0}function b(t,e){return O(BigInt.asIntN(64,BigInt(Ot(t,e))+(BigInt(Ot(t,e+4))<<32n)))}function _(t,e){let n=e+h(t,e),r=h(t,n);return n+=4,Y(t.subarray(n,n+r))}function T(t,e,n,r){if(!e)return[];let i=e+h(t,e);return Array.from({length:h(t,i)},(s,a)=>r(t,i+4+a*n))}const K=Symbol("rowIndex");function Q(t,e){class n{constructor(s){this[K]=s}toJSON(){return Mt(t,e,this[K])}}let r=n.prototype;for(let i=0;i<t.length;++i){if(Object.hasOwn(r,t[i]))continue;let s=e[i];Object.defineProperty(r,t[i],{get(){return s.at(this[K])},enumerable:!0})}return i=>new n(i)}function Tt(t,e){return n=>Mt(t,e,n)}function Mt(t,e,n){let r={};for(let i=0;i<t.length;++i)r[t[i]]=e[i].at(n);return r}function Ze(t){return t instanceof P}var H=(at=class{constructor({length:t,nullCount:e,type:n,validity:r,values:i,offsets:s,sizes:a,children:o}){this.length=t,this.nullCount=e,this.type=n,this.validity=r,this.values=i,this.offsets=s,this.sizes=a,this.children=o,(!e||!this.validity)&&(this.at=u=>this.value(u))}get[Symbol.toStringTag](){return"Batch"}at(t){return this.isValid(t)?this.value(t):null}isValid(t){return Bt(this.validity,t)}value(t){return this.values[t]}slice(t,e){let n=e-t,r=Array(n);for(let i=0;i<n;++i)r[i]=this.at(t+i);return r}*[Symbol.iterator](){for(let t=0;t<this.length;++t)yield this.at(t)}},A(at,"ArrayType",null),at),P=class extends H{constructor(t){super(t);let{length:e,values:n}=this;this.values=n.subarray(0,e)}slice(t,e){return this.nullCount?super.slice(t,e):this.values.subarray(t,e)}[Symbol.iterator](){return this.nullCount?super[Symbol.iterator]():this.values[Symbol.iterator]()}},tt=(lt=class extends H{},A(lt,"ArrayType",k),lt),f=(ot=class extends H{},A(ot,"ArrayType",Array),ot),Ge=class extends f{value(t){return null}},V=class extends tt{value(t){return O(this.values[t])}},qe=class extends tt{value(t){let e=this.values[t],n=(e&31744)>>10,r=(e&1023)/1024,i=(-1)**((e&32768)>>15);switch(n){case 31:return i*(r?NaN:1/0);case 0:return i*(r?6103515625e-14*r:0)}return i*2**(n-15)*(1+r)}},Ke=class extends f{value(t){return Bt(this.values,t)}},Ct=class extends H{constructor(t){super(t);let{bitWidth:e,scale:n}=this.type;this.decimal=e===128?He:Pe,this.scale=10n**BigInt(n)}},Qe=(ut=class extends Ct{value(t){return G(this.decimal(this.values,t),this.scale)}},A(ut,"ArrayType",k),ut),tn=(ct=class extends Ct{value(t){return this.decimal(this.values,t)}},A(ct,"ArrayType",Array),ct),Ut=class extends f{constructor(t){super(t),this.source=t}value(t){return new Date(this.source.value(t))}},en=class extends tt{value(t){return 864e5*this.values[t]}};const nn=V;var rn=class extends V{value(t){return super.value(t)*1e3}};const sn=V;var an=class extends V{value(t){return G(this.values[t],1000n)}},ln=class extends V{value(t){return G(this.values[t],1000000n)}},on=class extends f{value(t){return this.values.subarray(t<<1,t+1<<1)}},un=class extends f{value(t){let e=this.values,n=t<<4;return Float64Array.of(h(e,n),h(e,n+4),b(e,n+8))}},Vt=({values:t,offsets:e},n)=>t.subarray(e[n],e[n+1]),Ft=({values:t,offsets:e},n)=>t.subarray(O(e[n]),O(e[n+1])),cn=class extends f{value(t){return Vt(this,t)}},dn=class extends f{value(t){return Ft(this,t)}},hn=class extends f{value(t){return Y(Vt(this,t))}},fn=class extends f{value(t){return Y(Ft(this,t))}},yn=class extends f{value(t){let e=this.offsets;return this.children[0].slice(e[t],e[t+1])}},pn=class extends f{value(t){let e=this.offsets;return this.children[0].slice(O(e[t]),O(e[t+1]))}},gn=class extends f{value(t){let e=this.offsets[t],n=e+this.sizes[t];return this.children[0].slice(e,n)}},mn=class extends f{value(t){let e=this.offsets[t],n=e+this.sizes[t];return this.children[0].slice(O(e),O(n))}},Rt=class extends f{constructor(t){super(t),this.stride=this.type.stride}},vn=class extends Rt{value(t){let{stride:e,values:n}=this;return n.subarray(t*e,(t+1)*e)}},bn=class extends Rt{value(t){let{children:e,stride:n}=this;return e[0].slice(t*n,(t+1)*n)}};function $t({children:t,offsets:e},n){let[r,i]=t[0].children,s=e[n],a=e[n+1],o=[];for(let u=s;u<a;++u)o.push([r.at(u),i.at(u)]);return o}var xn=class extends f{value(t){return $t(this,t)}},wn=class extends f{value(t){return new Map($t(this,t))}},zt=class extends f{constructor({typeIds:t,...e}){super(e),this.typeIds=t,this.typeMap=this.type.typeMap}value(t,e=t){let{typeIds:n,children:r,typeMap:i}=this;return r[i[n[t]]].at(e)}},In=class extends zt{value(t){return super.value(t,this.offsets[t])}},kt=class extends f{constructor(t,e=Tt){super(t),this.names=this.type.children.map(n=>n.name),this.factory=e(this.names,this.children)}value(t){return this.factory(t)}},Ln=class extends kt{constructor(t){super(t,Q)}},An=class extends f{value(t){let[{values:e},n]=this.children;return n.at(X(e,t))}},Nn=class extends f{setDictionary(t){return this.dictionary=t,this.cache=t.cache(),this}value(t){return this.cache[this.key(t)]}key(t){return this.values[t]}},jt=class extends f{constructor({data:t,...e}){super(e),this.data=t}view(t){let{values:e,data:n}=this,r=t<<4,i=r+4,s=e,a=h(s,r);return a>12&&(i=h(s,r+12),s=n[h(s,r+8)]),s.subarray(i,i+a)}},En=class extends jt{value(t){return this.view(t)}},Dn=class extends jt{value(t){return Y(this.view(t))}};function Yt(t){let e=[];return{add(n){return e.push(n),this},clear:()=>e=[],done:()=>new Sn(e,t)}}var Sn=class{constructor(t,e=(n=>(n=t[0])==null?void 0:n.type)()){this.type=e,this.length=t.reduce((s,a)=>s+a.length,0),this.nullCount=t.reduce((s,a)=>s+a.nullCount,0),this.data=t;let r=t.length,i=new Int32Array(r+1);if(r===1){let[s]=t;i[1]=s.length,this.at=a=>s.at(a)}else for(let s=0,a=0;s<r;++s)i[s+1]=a+=t[s].length;this.offsets=i}get[Symbol.toStringTag](){return"Column"}[Symbol.iterator](){let t=this.data;return t.length===1?t[0][Symbol.iterator]():Bn(t)}at(t){var i;let{data:e,offsets:n}=this,r=X(n,t)-1;return(i=e[r])==null?void 0:i.at(t-n[r])}get(t){return this.at(t)}toArray(){let{length:t,nullCount:e,data:n}=this,r=!e&&Ze(n[0]),i=n.length;if(r&&i===1)return n[0].values;let s=new(!i||e>0?Array:n[0].constructor.ArrayType??n[0].values.constructor)(t);return r?On(s,n):Tn(s,n)}cache(){return this._cache??(this._cache=this.toArray())}};function*Bn(t){for(let e=0;e<t.length;++e){let n=t[e][Symbol.iterator]();for(let r=n.next();!r.done;r=n.next())yield r.value}}function On(t,e){for(let n=0,r=0;n<e.length;++n){let{values:i}=e[n];t.set(i,r),r+=i.length}return t}function Tn(t,e){let n=-1;for(let r=0;r<e.length;++r){let i=e[r];for(let s=0;s<i.length;++s)t[++n]=i.at(s)}return t}var Mn=class ue{constructor(e,n,r=!1){let i=e.fields.map(a=>a.name);this.schema=e,this.names=i,this.children=n,this.factory=r?Q:Tt;let s=[];this.getFactory=a=>s[a]??(s[a]=this.factory(i,n.map(o=>o.data[a])))}get[Symbol.toStringTag](){return"Table"}get numCols(){return this.names.length}get numRows(){var e;return((e=this.children[0])==null?void 0:e.length)??0}getChildAt(e){return this.children[e]}getChild(e){let n=this.names.findIndex(r=>r===e);return n>-1?this.children[n]:void 0}selectAt(e,n=[]){let{children:r,factory:i,schema:s}=this,{fields:a}=s;return new ue({...s,fields:e.map((o,u)=>Cn(a[o],n[u]))},e.map(o=>r[o]),i===Q)}select(e,n){let r=this.names,i=e.map(s=>r.indexOf(s));return this.selectAt(i,n)}toColumns(){let{children:e,names:n}=this,r={};return n.forEach((i,s)=>{var a;return r[i]=((a=e[s])==null?void 0:a.toArray())??[]}),r}toArray(){var a;let{children:e,getFactory:n,numRows:r}=this,i=((a=e[0])==null?void 0:a.data)??[],s=Array(r);for(let o=0,u=-1;o<i.length;++o){let d=n(o);for(let c=0;c<i[o].length;++c)s[++u]=d(c)}return s}*[Symbol.iterator](){var i;let{children:e,getFactory:n}=this,r=((i=e[0])==null?void 0:i.data)??[];for(let s=0;s<r.length;++s){let a=n(s);for(let o=0;o<r[s].length;++o)yield a(o)}}at(e){let{children:n,getFactory:r,numRows:i}=this;if(e<0||e>=i)return null;let[{offsets:s}]=n,a=X(s,e)-1;return r(a)(e-s[a])}get(e){return this.at(e)}};function Cn(t,e){return e!=null&&e!==t.name?{...t,name:e}:t}function Un(t,e={}){let{typeId:n,bitWidth:r,precision:i,unit:s}=t,{useBigInt:a,useDate:o,useDecimalBigInt:u,useMap:d,useProxy:c}=e;switch(n){case l.Null:return Ge;case l.Bool:return Ke;case l.Int:case l.Time:case l.Duration:return a||r<64?P:V;case l.Float:return i?P:qe;case l.Date:return _t(s===z.DAY?en:nn,o&&Ut);case l.Timestamp:return _t(s===m.SECOND?rn:s===m.MILLISECOND?sn:s===m.MICROSECOND?an:ln,o&&Ut);case l.Decimal:return u?tn:Qe;case l.Interval:return s===C.DAY_TIME?on:s===C.YEAR_MONTH?P:un;case l.FixedSizeBinary:return vn;case l.Utf8:return hn;case l.LargeUtf8:return fn;case l.Binary:return cn;case l.LargeBinary:return dn;case l.BinaryView:return En;case l.Utf8View:return Dn;case l.List:return yn;case l.LargeList:return pn;case l.Map:return d?wn:xn;case l.ListView:return gn;case l.LargeListView:return mn;case l.FixedSizeList:return bn;case l.Struct:return c?Ln:kt;case l.RunEndEncoded:return An;case l.Dictionary:return Nn;case l.Union:return t.mode?In:zt}throw Error(Z(n))}function _t(t,e){return e?class extends e{constructor(n){super(new t(n))}}:t}function Vn(t,e){return{offset:b(t,e),metadataLength:h(t,e+8),bodyLength:b(t,e+16)}}function Ht(t,e){return T(t,e,24,Vn)}function Pt(t,e,n){let r=N(t,e);if(r(10,M,0))throw Error("Record batch compression not implemented");let i=n<$.V4?8:0;return{length:r(4,b,0),nodes:T(t,r(6,M),16,(s,a)=>({length:b(s,a),nullCount:b(s,a+8)})),regions:T(t,r(8,M),16+i,(s,a)=>({offset:b(s,a+i),length:b(s,a+i+8)})),variadic:T(t,r(12,M),8,b)}}function Fn(t,e,n){let r=N(t,e);return{id:r(4,b,0),data:r(6,(i,s)=>Pt(i,s,n)),isDelta:r(8,F,!1)}}function Wt(t,e,n,r){w(n,l,Z);let i=N(t,e);switch(n){case l.Binary:return Ae();case l.Utf8:return Ne();case l.LargeBinary:return $e();case l.LargeUtf8:return ze();case l.List:return Te(r[0]);case l.ListView:return Ye(r[0]);case l.LargeList:return ke(r[0]);case l.LargeListView:return _e(r[0]);case l.Struct:return Me(r);case l.RunEndEncoded:return je(r[0],r[1]);case l.Int:return Dt(i(4,h,0),i(6,F,!1));case l.Float:return Le(i(4,v,mt.HALF));case l.Decimal:return Ee(i(4,h,0),i(6,h,0),i(8,h,128));case l.Date:return De(i(4,v,z.MILLISECOND));case l.Time:return Se(i(4,v,m.MILLISECOND),i(6,h,32));case l.Timestamp:return Be(i(4,v,m.SECOND),i(6,_));case l.Interval:return Oe(i(4,v,C.YEAR_MONTH));case l.Duration:return Re(i(4,v,m.MILLISECOND));case l.FixedSizeBinary:return Ue(i(4,h,0));case l.FixedSizeList:return Ve(r[0],i(4,h,0));case l.Map:return Fe(i(4,F,!1),r[0]);case l.Union:return Ce(i(4,v,W.Sparse),r,T(t,i(6,M),4,h))}return{typeId:n}}function et(t,e){let n=T(t,e,4,(r,i)=>{let s=N(r,i);return[s(4,_),s(6,_)]});return n.length?new Map(n):null}function Xt(t,e,n){let r=N(t,e);return{version:n,endianness:r(4,v,0),fields:r(6,Rn,[]),metadata:r(8,et)}}function Rn(t,e){return T(t,e,4,Jt)}function Jt(t,e){let n=N(t,e),r=n(8,q,l.NONE),i=n(10,M,0),s=n(12,zn),a=Wt(t,i,r,n(14,(o,u)=>$n(o,u)));return s&&(s.dictionary=a,a=s),{name:n(4,_),type:a,nullable:n(6,F,!1),metadata:n(16,et)}}function $n(t,e){let n=T(t,e,4,Jt);return n.length?n:null}function zn(t,e){if(!e)return null;let n=N(t,e);return Ie(null,n(6,kn,St()),n(8,F,!1),n(4,b,0))}function kn(t,e){return Wt(t,e,l.Int)}var jn=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,Yn=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,_n=t=>`Unsupported message type: ${t} (${Lt(S,t)})`;function nt(t,e){let n=h(t,e)||0;if(e+=4,n===-1&&(n=h(t,e)||0,e+=4),n===0)return null;let r=t.subarray(e,e+=n);if(r.byteLength<n)throw Error(jn(n,r.byteLength));let i=N(r,0),s=i(4,v,$.V1),a=i(6,q,S.NONE),o=i(8,M,0),u=i(10,b,0),d;if(o){let c=a===S.Schema?Xt:a===S.DictionaryBatch?Fn:a===S.RecordBatch?Pt:null;if(!c)throw Error(_n(a));if(d=c(r,o,s),u>0){let g=t.subarray(e,e+=u);if(g.byteLength<u)throw Error(Yn(u,g.byteLength));d.body=g}}return{version:s,type:a,index:e,content:d}}function Hn(t){let e=t instanceof ArrayBuffer?new Uint8Array(t):t;return e instanceof Uint8Array&&Pn(e)?Xn(e):Wn(e)}function Pn(t){if(!t||t.length<4)return!1;for(let e=0;e<6;++e)if(gt[e]!==t[e])return!1;return!0}function Wn(t){let e=[t].flat(),n,r=[],i=[];for(let s of e){if(!(s instanceof Uint8Array))throw Error("IPC data batch was not a Uint8Array.");let a=0;for(;;){let o=nt(s,a);if(o===null)break;if(a=o.index,o.content)switch(o.type){case S.Schema:n||(n=o.content);break;case S.RecordBatch:r.push(o.content);break;case S.DictionaryBatch:i.push(o.content);break}}}return{schema:n,dictionaries:i,records:r,metadata:null}}function Xn(t){let e=t.byteLength-(gt.length+4),n=N(t,e-h(t,e)),r=n(4,v,$.V1),i=n(8,Ht,[]),s=n(10,Ht,[]);return{schema:n(6,(a,o)=>Xt(a,o,r)),dictionaries:i.map(({offset:a})=>nt(t,a).content),records:s.map(({offset:a})=>nt(t,a).content),metadata:n(12,et)}}function rt(t,e){return Jn(Hn(t),e)}function Jn(t,e={}){let{schema:n={fields:[]},dictionaries:r,records:i}=t,{version:s,fields:a}=n,o=new Map,u=Gn(e,s,o),d=new Map;Zn(n,y=>{let p=y.type;p.typeId===l.Dictionary&&d.set(p.id,p.dictionary)});let c=new Map;for(let y of r){let{id:p,data:E,isDelta:D,body:ce}=y,dt=d.get(p),ht=it(dt,u({...E,body:ce}));if(c.has(p)){let ft=c.get(p);D||ft.clear(),ft.add(ht)}else{if(D)throw Error("Delta update can not be first dictionary batch.");c.set(p,Yt(dt).add(ht))}}c.forEach((y,p)=>o.set(p,y.done()));let g=a.map(y=>Yt(y.type));for(let y of i){let p=u(y);a.forEach((E,D)=>g[D].add(it(E.type,p)))}return new Mn(n,g.map(y=>y.done()),e.useProxy)}function Zn(t,e){t.fields.forEach(function n(r){var i,s,a;e(r),(s=(i=r.type.dictionary)==null?void 0:i.children)==null||s.forEach(n),(a=r.type.children)==null||a.forEach(n)})}function Gn(t,e,n){let r={version:e,options:t,dictionary:i=>n.get(i)};return i=>{let{length:s,nodes:a,regions:o,variadic:u,body:d}=i,c=-1,g=-1,y=-1;return{...r,length:s,node:()=>a[++c],buffer:p=>{let{length:E,offset:D}=o[++g];return p?new p(d.buffer,d.byteOffset+D,E/p.BYTES_PER_ELEMENT):d.subarray(D,D+E)},variadic:()=>u[++y],visit(p){return p.map(E=>it(E.type,this))}}}}function it(t,e){let{typeId:n}=t,{length:r,options:i,node:s,buffer:a,variadic:o,version:u}=e,d=Un(t,i);if(n===l.Null)return new d({length:r,nullCount:r,type:t});let c={...s(),type:t};switch(n){case l.Bool:case l.Int:case l.Time:case l.Duration:case l.Float:case l.Decimal:case l.Date:case l.Timestamp:case l.Interval:case l.FixedSizeBinary:return new d({...c,validity:a(),values:a(t.values)});case l.Utf8:case l.LargeUtf8:case l.Binary:case l.LargeBinary:return new d({...c,validity:a(),offsets:a(t.offsets),values:a()});case l.BinaryView:case l.Utf8View:return new d({...c,validity:a(),values:a(),data:Array.from({length:o()},()=>a())});case l.List:case l.LargeList:case l.Map:return new d({...c,validity:a(),offsets:a(t.offsets),children:e.visit(t.children)});case l.ListView:case l.LargeListView:return new d({...c,validity:a(),offsets:a(t.offsets),sizes:a(t.offsets),children:e.visit(t.children)});case l.FixedSizeList:case l.Struct:return new d({...c,validity:a(),children:e.visit(t.children)});case l.RunEndEncoded:return new d({...c,children:e.visit(t.children)});case l.Dictionary:{let{id:g,indices:y}=t;return new d({...c,validity:a(),values:a(y.values)}).setDictionary(e.dictionary(g))}case l.Union:return u<$.V5&&a(),new d({...c,typeIds:a(It),offsets:t.mode===W.Sparse?null:a(t.offsets),children:e.visit(t.children)});default:throw Error(Z(n))}}new Uint16Array(new Uint8Array([1,0]).buffer)[0];function R(t,e){let n=new Map;return(...r)=>{let i=e(...r);if(n.has(i))return n.get(i);let s=t(...r).finally(()=>{n.delete(i)});return n.set(i,s),s}}function st(t,e){return me(t,e)}function qn(){return ye()}const I=pe;function Zt(){let t=Kn(qn()),e=n=>JSON.stringify(n);return{load:R(t.load.bind(t),e),sanitize:R(t.sanitize.bind(t),e),http:R(t.http.bind(t),e),file:R(t.file.bind(t),e)}}function Kn(t){return{...t,async load(e,n){return e.endsWith(".arrow")?rt(await Gt(e),{useProxy:!1}).toArray():t.load(e,n)}}}const Gt=R(t=>fetch(t).then(e=>e.arrayBuffer()),t=>t);var qt=I.integer,Kt=I.number,Qn=I.date,tr=I.boolean,Qt=()=>(I.integer=t=>{if(t==="")return"";if(t==="-inf"||t==="inf")return t;function e(r){let i=qt(r);return Number.isNaN(i)?r:i}let n=Number.parseInt(t,10);if(Number.isNaN(n))return t;if(!(Math.abs(n)>2**53-1))return e(t);try{return BigInt(t)}catch{return e(t)}},I.number=t=>{if(t==="-inf"||t==="inf")return t;let e=Kt(t);return Number.isNaN(e)?t:e},()=>{I.integer=qt,I.number=Kt}),te=()=>(I.date=t=>{if(t==="")return"";if(t==null)return null;if(!/^\d{4}-\d{2}-\d{2}(T[\d.:]+(Z|[+-]\d{2}:?\d{2})?)?$/.test(t))return t;try{let e=new Date(t);return Number.isNaN(e.getTime())?t:e}catch{return fe.warn(`Failed to parse date: ${t}`),t}},()=>{I.date=Qn});I.boolean=t=>t==="True"?!0:t==="False"?!1:tr(t);const ee=Zt();async function er(t,e,n={}){let{handleBigIntAndNumberLike:r=!1,replacePeriod:i=!1}=n;if(t.endsWith(".arrow")||(e==null?void 0:e.type)==="arrow")return rt(await Gt(t),{useProxy:!0,useDate:!0,useBigInt:r}).toArray();let s=[te];r&&s.push(Qt);let a=[];try{let o=await ee.load(t);if(!e){if(typeof o=="string")try{JSON.parse(o),e={type:"json"}}catch{e={type:"csv",parse:"auto"}}typeof o=="object"&&(e={type:"json"})}let u=(e==null?void 0:e.type)==="csv";u&&typeof o=="string"&&(o=rr(o)),u&&typeof o=="string"&&i&&(o=ir(o));let d=(e==null?void 0:e.parse)||"auto";return typeof d=="object"&&(d=yt.mapValues(d,c=>c==="time"?"string":c==="datetime"?"date":c)),a=s.map(c=>c()),u?st(o,{...e,parse:d}):st(o,e)}finally{a.forEach(o=>o())}}function nr(t,e=!0){let n=[te];e&&n.push(Qt);let r=n.map(s=>s()),i=st(t,{type:"csv",parse:"auto"});return r.forEach(s=>s()),i}function rr(t){return t!=null&&t.includes(",")?ne(t,e=>{let n=new Set;return e.map(r=>{let i=ar(r,n);return n.add(i),i})}):t}function ir(t){return t!=null&&t.includes(".")?ne(t,e=>e.map(n=>n.replaceAll(".","\u2024"))):t}function ne(t,e){let n=t.split(`
1
+ var de=Object.defineProperty;var he=(t,e,n)=>e in t?de(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var A=(t,e,n)=>he(t,typeof e!="symbol"?e+"":e,n);var at,lt,ot,ut,ct;import{_ as fe,d as yt}from"./useEventListener-DGjKht0c.js";import{St as pt,a as ye,c as pe,gt as ge,o as me,wt as ve}from"./vega-loader.browser-DXARUlxo.js";const gt=Uint8Array.of(65,82,82,79,87,49),$={V1:0,V2:1,V3:2,V4:3,V5:4},S={NONE:0,Schema:1,DictionaryBatch:2,RecordBatch:3,Tensor:4,SparseTensor:5},l={Dictionary:-1,NONE:0,Null:1,Int:2,Float:3,Binary:4,Utf8:5,Bool:6,Decimal:7,Date:8,Time:9,Timestamp:10,Interval:11,List:12,Struct:13,Union:14,FixedSizeBinary:15,FixedSizeList:16,Map:17,Duration:18,LargeBinary:19,LargeUtf8:20,LargeList:21,RunEndEncoded:22,BinaryView:23,Utf8View:24,ListView:25,LargeListView:26},mt={HALF:0,SINGLE:1,DOUBLE:2},z={DAY:0,MILLISECOND:1},m={SECOND:0,MILLISECOND:1,MICROSECOND:2,NANOSECOND:3},C={YEAR_MONTH:0,DAY_TIME:1,MONTH_DAY_NANO:2},W={Sparse:0,Dense:1},vt=Uint8Array,bt=Uint16Array,xt=Uint32Array,wt=BigUint64Array,It=Int8Array,be=Int16Array,x=Int32Array,L=BigInt64Array,xe=Float32Array,k=Float64Array;function we(t,e){let n=Math.log2(t)-3;return(e?[It,be,x,L]:[vt,bt,xt,wt])[n]}Object.getPrototypeOf(Int8Array);function X(t,e){let n=0,r=t.length;if(r<=2147483648)do{let i=n+r>>>1;t[i]<=e?n=i+1:r=i}while(n<r);else do{let i=Math.trunc((n+r)/2);t[i]<=e?n=i+1:r=i}while(n<r);return n}function J(t,e,n){if(e(t))return t;throw Error(n(t))}function w(t,e,n){return e=Array.isArray(e)?e:Object.values(e),J(t,r=>e.includes(r),n??(()=>`${t} must be one of ${e}`))}function Lt(t,e){for(let[n,r]of Object.entries(t))if(r===e)return n;return"<Unknown>"}const Z=t=>`Unsupported data type: "${Lt(l,t)}" (id ${t})`,At=(t,e,n=!0,r=null)=>({name:t,type:e,nullable:n,metadata:r});function Nt(t){return Object.hasOwn(t,"name")&&Et(t.type)}function Et(t){return typeof(t==null?void 0:t.typeId)=="number"}function B(t,e="",n=!0){return Nt(t)?t:At(e,J(t,Et,()=>"Data type expected."),n)}const Ie=(t,e,n=!1,r=-1)=>({typeId:l.Dictionary,id:r,dictionary:t,indices:e||St(),ordered:n}),Dt=(t=32,e=!0)=>({typeId:l.Int,bitWidth:w(t,[8,16,32,64]),signed:e,values:we(t,e)}),St=()=>Dt(32),Le=(t=2)=>({typeId:l.Float,precision:w(t,mt),values:[bt,xe,k][t]}),Ae=()=>({typeId:l.Binary,offsets:x}),Ne=()=>({typeId:l.Utf8,offsets:x}),Ee=(t,e,n=128)=>({typeId:l.Decimal,precision:t,scale:e,bitWidth:w(n,[128,256]),values:wt}),De=t=>({typeId:l.Date,unit:w(t,z),values:t===z.DAY?x:L}),Se=(t=m.MILLISECOND,e=32)=>({typeId:l.Time,unit:w(t,m),bitWidth:w(e,[32,64]),values:e===32?x:L}),Be=(t=m.MILLISECOND,e=null)=>({typeId:l.Timestamp,unit:w(t,m),timezone:e,values:L}),Oe=(t=C.MONTH_DAY_NANO)=>({typeId:l.Interval,unit:w(t,C),values:t===C.MONTH_DAY_NANO?void 0:x}),Te=t=>({typeId:l.List,children:[B(t)],offsets:x}),Me=t=>({typeId:l.Struct,children:Array.isArray(t)&&Nt(t[0])?t:Object.entries(t).map(([e,n])=>At(e,n))}),Ce=(t,e,n,r)=>(n??(n=e.map((i,s)=>s)),{typeId:l.Union,mode:w(t,W),typeIds:n,typeMap:n.reduce((i,s,a)=>(i[s]=a,i),{}),children:e.map((i,s)=>B(i,`_${s}`)),typeIdForValue:r,offsets:x}),Ue=t=>({typeId:l.FixedSizeBinary,stride:t}),Ve=(t,e)=>({typeId:l.FixedSizeList,stride:e,children:[B(t)]}),Fe=(t,e)=>({typeId:l.Map,keysSorted:t,children:[e],offsets:x}),Re=(t=m.MILLISECOND)=>({typeId:l.Duration,unit:w(t,m),values:L}),$e=()=>({typeId:l.LargeBinary,offsets:L}),ze=()=>({typeId:l.LargeUtf8,offsets:L}),ke=t=>({typeId:l.LargeList,children:[B(t)],offsets:L}),je=(t,e)=>({typeId:l.RunEndEncoded,children:[J(B(t,"run_ends"),n=>n.type.typeId===l.Int,()=>"Run-ends must have an integer type."),B(e,"values")]}),Ye=t=>({typeId:l.ListView,children:[B(t,"value")],offsets:x}),_e=t=>({typeId:l.LargeListView,children:[B(t,"value")],offsets:L});var j=new k(2).buffer;new L(j),new xt(j),new x(j),new vt(j);function O(t){if(t>2**53-1||t<-(2**53-1))throw Error(`BigInt exceeds integer number representation: ${t}`);return Number(t)}function G(t,e){return Number(t/e)+Number(t%e)/Number(e)}var U=t=>BigInt.asUintN(64,t);function He(t,e){let n=e<<1,r;return BigInt.asIntN(64,t[n+1])<0?(r=U(~t[n])|U(~t[n+1])<<64n,r=-(r+1n)):r=t[n]|t[n+1]<<64n,r}function Pe(t,e){let n=e<<2,r;return BigInt.asIntN(64,t[n+3])<0?(r=U(~t[n])|U(~t[n+1])<<64n|U(~t[n+2])<<128n|U(~t[n+3])<<192n,r=-(r+1n)):r=t[n]|t[n+1]<<64n|t[n+2]<<128n|t[n+3]<<192n,r}var We=new TextDecoder("utf-8");new TextEncoder;function Y(t){return We.decode(t)}function Bt(t,e){return(t[e>>3]&1<<e%8)!=0}function N(t,e){let n=e+h(t,e),r=n-h(t,n),i=v(t,r);return(s,a,o=null)=>{if(s<i){let u=v(t,r+s);if(u)return a(t,n+u)}return o}}function M(t,e){return e}function F(t,e){return!!Xe(t,e)}function Xe(t,e){return q(t,e)<<24>>24}function q(t,e){return t[e]}function v(t,e){return Je(t,e)<<16>>16}function Je(t,e){return t[e]|t[e+1]<<8}function h(t,e){return t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24}function Ot(t,e){return h(t,e)>>>0}function b(t,e){return O(BigInt.asIntN(64,BigInt(Ot(t,e))+(BigInt(Ot(t,e+4))<<32n)))}function _(t,e){let n=e+h(t,e),r=h(t,n);return n+=4,Y(t.subarray(n,n+r))}function T(t,e,n,r){if(!e)return[];let i=e+h(t,e);return Array.from({length:h(t,i)},(s,a)=>r(t,i+4+a*n))}const K=Symbol("rowIndex");function Q(t,e){class n{constructor(s){this[K]=s}toJSON(){return Mt(t,e,this[K])}}let r=n.prototype;for(let i=0;i<t.length;++i){if(Object.hasOwn(r,t[i]))continue;let s=e[i];Object.defineProperty(r,t[i],{get(){return s.at(this[K])},enumerable:!0})}return i=>new n(i)}function Tt(t,e){return n=>Mt(t,e,n)}function Mt(t,e,n){let r={};for(let i=0;i<t.length;++i)r[t[i]]=e[i].at(n);return r}function Ze(t){return t instanceof P}var H=(at=class{constructor({length:t,nullCount:e,type:n,validity:r,values:i,offsets:s,sizes:a,children:o}){this.length=t,this.nullCount=e,this.type=n,this.validity=r,this.values=i,this.offsets=s,this.sizes=a,this.children=o,(!e||!this.validity)&&(this.at=u=>this.value(u))}get[Symbol.toStringTag](){return"Batch"}at(t){return this.isValid(t)?this.value(t):null}isValid(t){return Bt(this.validity,t)}value(t){return this.values[t]}slice(t,e){let n=e-t,r=Array(n);for(let i=0;i<n;++i)r[i]=this.at(t+i);return r}*[Symbol.iterator](){for(let t=0;t<this.length;++t)yield this.at(t)}},A(at,"ArrayType",null),at),P=class extends H{constructor(t){super(t);let{length:e,values:n}=this;this.values=n.subarray(0,e)}slice(t,e){return this.nullCount?super.slice(t,e):this.values.subarray(t,e)}[Symbol.iterator](){return this.nullCount?super[Symbol.iterator]():this.values[Symbol.iterator]()}},tt=(lt=class extends H{},A(lt,"ArrayType",k),lt),f=(ot=class extends H{},A(ot,"ArrayType",Array),ot),Ge=class extends f{value(t){return null}},V=class extends tt{value(t){return O(this.values[t])}},qe=class extends tt{value(t){let e=this.values[t],n=(e&31744)>>10,r=(e&1023)/1024,i=(-1)**((e&32768)>>15);switch(n){case 31:return i*(r?NaN:1/0);case 0:return i*(r?6103515625e-14*r:0)}return i*2**(n-15)*(1+r)}},Ke=class extends f{value(t){return Bt(this.values,t)}},Ct=class extends H{constructor(t){super(t);let{bitWidth:e,scale:n}=this.type;this.decimal=e===128?He:Pe,this.scale=10n**BigInt(n)}},Qe=(ut=class extends Ct{value(t){return G(this.decimal(this.values,t),this.scale)}},A(ut,"ArrayType",k),ut),tn=(ct=class extends Ct{value(t){return this.decimal(this.values,t)}},A(ct,"ArrayType",Array),ct),Ut=class extends f{constructor(t){super(t),this.source=t}value(t){return new Date(this.source.value(t))}},en=class extends tt{value(t){return 864e5*this.values[t]}};const nn=V;var rn=class extends V{value(t){return super.value(t)*1e3}};const sn=V;var an=class extends V{value(t){return G(this.values[t],1000n)}},ln=class extends V{value(t){return G(this.values[t],1000000n)}},on=class extends f{value(t){return this.values.subarray(t<<1,t+1<<1)}},un=class extends f{value(t){let e=this.values,n=t<<4;return Float64Array.of(h(e,n),h(e,n+4),b(e,n+8))}},Vt=({values:t,offsets:e},n)=>t.subarray(e[n],e[n+1]),Ft=({values:t,offsets:e},n)=>t.subarray(O(e[n]),O(e[n+1])),cn=class extends f{value(t){return Vt(this,t)}},dn=class extends f{value(t){return Ft(this,t)}},hn=class extends f{value(t){return Y(Vt(this,t))}},fn=class extends f{value(t){return Y(Ft(this,t))}},yn=class extends f{value(t){let e=this.offsets;return this.children[0].slice(e[t],e[t+1])}},pn=class extends f{value(t){let e=this.offsets;return this.children[0].slice(O(e[t]),O(e[t+1]))}},gn=class extends f{value(t){let e=this.offsets[t],n=e+this.sizes[t];return this.children[0].slice(e,n)}},mn=class extends f{value(t){let e=this.offsets[t],n=e+this.sizes[t];return this.children[0].slice(O(e),O(n))}},Rt=class extends f{constructor(t){super(t),this.stride=this.type.stride}},vn=class extends Rt{value(t){let{stride:e,values:n}=this;return n.subarray(t*e,(t+1)*e)}},bn=class extends Rt{value(t){let{children:e,stride:n}=this;return e[0].slice(t*n,(t+1)*n)}};function $t({children:t,offsets:e},n){let[r,i]=t[0].children,s=e[n],a=e[n+1],o=[];for(let u=s;u<a;++u)o.push([r.at(u),i.at(u)]);return o}var xn=class extends f{value(t){return $t(this,t)}},wn=class extends f{value(t){return new Map($t(this,t))}},zt=class extends f{constructor({typeIds:t,...e}){super(e),this.typeIds=t,this.typeMap=this.type.typeMap}value(t,e=t){let{typeIds:n,children:r,typeMap:i}=this;return r[i[n[t]]].at(e)}},In=class extends zt{value(t){return super.value(t,this.offsets[t])}},kt=class extends f{constructor(t,e=Tt){super(t),this.names=this.type.children.map(n=>n.name),this.factory=e(this.names,this.children)}value(t){return this.factory(t)}},Ln=class extends kt{constructor(t){super(t,Q)}},An=class extends f{value(t){let[{values:e},n]=this.children;return n.at(X(e,t))}},Nn=class extends f{setDictionary(t){return this.dictionary=t,this.cache=t.cache(),this}value(t){return this.cache[this.key(t)]}key(t){return this.values[t]}},jt=class extends f{constructor({data:t,...e}){super(e),this.data=t}view(t){let{values:e,data:n}=this,r=t<<4,i=r+4,s=e,a=h(s,r);return a>12&&(i=h(s,r+12),s=n[h(s,r+8)]),s.subarray(i,i+a)}},En=class extends jt{value(t){return this.view(t)}},Dn=class extends jt{value(t){return Y(this.view(t))}};function Yt(t){let e=[];return{add(n){return e.push(n),this},clear:()=>e=[],done:()=>new Sn(e,t)}}var Sn=class{constructor(t,e=(n=>(n=t[0])==null?void 0:n.type)()){this.type=e,this.length=t.reduce((s,a)=>s+a.length,0),this.nullCount=t.reduce((s,a)=>s+a.nullCount,0),this.data=t;let r=t.length,i=new Int32Array(r+1);if(r===1){let[s]=t;i[1]=s.length,this.at=a=>s.at(a)}else for(let s=0,a=0;s<r;++s)i[s+1]=a+=t[s].length;this.offsets=i}get[Symbol.toStringTag](){return"Column"}[Symbol.iterator](){let t=this.data;return t.length===1?t[0][Symbol.iterator]():Bn(t)}at(t){var i;let{data:e,offsets:n}=this,r=X(n,t)-1;return(i=e[r])==null?void 0:i.at(t-n[r])}get(t){return this.at(t)}toArray(){let{length:t,nullCount:e,data:n}=this,r=!e&&Ze(n[0]),i=n.length;if(r&&i===1)return n[0].values;let s=new(!i||e>0?Array:n[0].constructor.ArrayType??n[0].values.constructor)(t);return r?On(s,n):Tn(s,n)}cache(){return this._cache??(this._cache=this.toArray())}};function*Bn(t){for(let e=0;e<t.length;++e){let n=t[e][Symbol.iterator]();for(let r=n.next();!r.done;r=n.next())yield r.value}}function On(t,e){for(let n=0,r=0;n<e.length;++n){let{values:i}=e[n];t.set(i,r),r+=i.length}return t}function Tn(t,e){let n=-1;for(let r=0;r<e.length;++r){let i=e[r];for(let s=0;s<i.length;++s)t[++n]=i.at(s)}return t}var Mn=class ue{constructor(e,n,r=!1){let i=e.fields.map(a=>a.name);this.schema=e,this.names=i,this.children=n,this.factory=r?Q:Tt;let s=[];this.getFactory=a=>s[a]??(s[a]=this.factory(i,n.map(o=>o.data[a])))}get[Symbol.toStringTag](){return"Table"}get numCols(){return this.names.length}get numRows(){var e;return((e=this.children[0])==null?void 0:e.length)??0}getChildAt(e){return this.children[e]}getChild(e){let n=this.names.findIndex(r=>r===e);return n>-1?this.children[n]:void 0}selectAt(e,n=[]){let{children:r,factory:i,schema:s}=this,{fields:a}=s;return new ue({...s,fields:e.map((o,u)=>Cn(a[o],n[u]))},e.map(o=>r[o]),i===Q)}select(e,n){let r=this.names,i=e.map(s=>r.indexOf(s));return this.selectAt(i,n)}toColumns(){let{children:e,names:n}=this,r={};return n.forEach((i,s)=>{var a;return r[i]=((a=e[s])==null?void 0:a.toArray())??[]}),r}toArray(){var a;let{children:e,getFactory:n,numRows:r}=this,i=((a=e[0])==null?void 0:a.data)??[],s=Array(r);for(let o=0,u=-1;o<i.length;++o){let d=n(o);for(let c=0;c<i[o].length;++c)s[++u]=d(c)}return s}*[Symbol.iterator](){var i;let{children:e,getFactory:n}=this,r=((i=e[0])==null?void 0:i.data)??[];for(let s=0;s<r.length;++s){let a=n(s);for(let o=0;o<r[s].length;++o)yield a(o)}}at(e){let{children:n,getFactory:r,numRows:i}=this;if(e<0||e>=i)return null;let[{offsets:s}]=n,a=X(s,e)-1;return r(a)(e-s[a])}get(e){return this.at(e)}};function Cn(t,e){return e!=null&&e!==t.name?{...t,name:e}:t}function Un(t,e={}){let{typeId:n,bitWidth:r,precision:i,unit:s}=t,{useBigInt:a,useDate:o,useDecimalBigInt:u,useMap:d,useProxy:c}=e;switch(n){case l.Null:return Ge;case l.Bool:return Ke;case l.Int:case l.Time:case l.Duration:return a||r<64?P:V;case l.Float:return i?P:qe;case l.Date:return _t(s===z.DAY?en:nn,o&&Ut);case l.Timestamp:return _t(s===m.SECOND?rn:s===m.MILLISECOND?sn:s===m.MICROSECOND?an:ln,o&&Ut);case l.Decimal:return u?tn:Qe;case l.Interval:return s===C.DAY_TIME?on:s===C.YEAR_MONTH?P:un;case l.FixedSizeBinary:return vn;case l.Utf8:return hn;case l.LargeUtf8:return fn;case l.Binary:return cn;case l.LargeBinary:return dn;case l.BinaryView:return En;case l.Utf8View:return Dn;case l.List:return yn;case l.LargeList:return pn;case l.Map:return d?wn:xn;case l.ListView:return gn;case l.LargeListView:return mn;case l.FixedSizeList:return bn;case l.Struct:return c?Ln:kt;case l.RunEndEncoded:return An;case l.Dictionary:return Nn;case l.Union:return t.mode?In:zt}throw Error(Z(n))}function _t(t,e){return e?class extends e{constructor(n){super(new t(n))}}:t}function Vn(t,e){return{offset:b(t,e),metadataLength:h(t,e+8),bodyLength:b(t,e+16)}}function Ht(t,e){return T(t,e,24,Vn)}function Pt(t,e,n){let r=N(t,e);if(r(10,M,0))throw Error("Record batch compression not implemented");let i=n<$.V4?8:0;return{length:r(4,b,0),nodes:T(t,r(6,M),16,(s,a)=>({length:b(s,a),nullCount:b(s,a+8)})),regions:T(t,r(8,M),16+i,(s,a)=>({offset:b(s,a+i),length:b(s,a+i+8)})),variadic:T(t,r(12,M),8,b)}}function Fn(t,e,n){let r=N(t,e);return{id:r(4,b,0),data:r(6,(i,s)=>Pt(i,s,n)),isDelta:r(8,F,!1)}}function Wt(t,e,n,r){w(n,l,Z);let i=N(t,e);switch(n){case l.Binary:return Ae();case l.Utf8:return Ne();case l.LargeBinary:return $e();case l.LargeUtf8:return ze();case l.List:return Te(r[0]);case l.ListView:return Ye(r[0]);case l.LargeList:return ke(r[0]);case l.LargeListView:return _e(r[0]);case l.Struct:return Me(r);case l.RunEndEncoded:return je(r[0],r[1]);case l.Int:return Dt(i(4,h,0),i(6,F,!1));case l.Float:return Le(i(4,v,mt.HALF));case l.Decimal:return Ee(i(4,h,0),i(6,h,0),i(8,h,128));case l.Date:return De(i(4,v,z.MILLISECOND));case l.Time:return Se(i(4,v,m.MILLISECOND),i(6,h,32));case l.Timestamp:return Be(i(4,v,m.SECOND),i(6,_));case l.Interval:return Oe(i(4,v,C.YEAR_MONTH));case l.Duration:return Re(i(4,v,m.MILLISECOND));case l.FixedSizeBinary:return Ue(i(4,h,0));case l.FixedSizeList:return Ve(r[0],i(4,h,0));case l.Map:return Fe(i(4,F,!1),r[0]);case l.Union:return Ce(i(4,v,W.Sparse),r,T(t,i(6,M),4,h))}return{typeId:n}}function et(t,e){let n=T(t,e,4,(r,i)=>{let s=N(r,i);return[s(4,_),s(6,_)]});return n.length?new Map(n):null}function Xt(t,e,n){let r=N(t,e);return{version:n,endianness:r(4,v,0),fields:r(6,Rn,[]),metadata:r(8,et)}}function Rn(t,e){return T(t,e,4,Jt)}function Jt(t,e){let n=N(t,e),r=n(8,q,l.NONE),i=n(10,M,0),s=n(12,zn),a=Wt(t,i,r,n(14,(o,u)=>$n(o,u)));return s&&(s.dictionary=a,a=s),{name:n(4,_),type:a,nullable:n(6,F,!1),metadata:n(16,et)}}function $n(t,e){let n=T(t,e,4,Jt);return n.length?n:null}function zn(t,e){if(!e)return null;let n=N(t,e);return Ie(null,n(6,kn,St()),n(8,F,!1),n(4,b,0))}function kn(t,e){return Wt(t,e,l.Int)}var jn=(t,e)=>`Expected to read ${t} metadata bytes, but only read ${e}.`,Yn=(t,e)=>`Expected to read ${t} bytes for message body, but only read ${e}.`,_n=t=>`Unsupported message type: ${t} (${Lt(S,t)})`;function nt(t,e){let n=h(t,e)||0;if(e+=4,n===-1&&(n=h(t,e)||0,e+=4),n===0)return null;let r=t.subarray(e,e+=n);if(r.byteLength<n)throw Error(jn(n,r.byteLength));let i=N(r,0),s=i(4,v,$.V1),a=i(6,q,S.NONE),o=i(8,M,0),u=i(10,b,0),d;if(o){let c=a===S.Schema?Xt:a===S.DictionaryBatch?Fn:a===S.RecordBatch?Pt:null;if(!c)throw Error(_n(a));if(d=c(r,o,s),u>0){let g=t.subarray(e,e+=u);if(g.byteLength<u)throw Error(Yn(u,g.byteLength));d.body=g}}return{version:s,type:a,index:e,content:d}}function Hn(t){let e=t instanceof ArrayBuffer?new Uint8Array(t):t;return e instanceof Uint8Array&&Pn(e)?Xn(e):Wn(e)}function Pn(t){if(!t||t.length<4)return!1;for(let e=0;e<6;++e)if(gt[e]!==t[e])return!1;return!0}function Wn(t){let e=[t].flat(),n,r=[],i=[];for(let s of e){if(!(s instanceof Uint8Array))throw Error("IPC data batch was not a Uint8Array.");let a=0;for(;;){let o=nt(s,a);if(o===null)break;if(a=o.index,o.content)switch(o.type){case S.Schema:n||(n=o.content);break;case S.RecordBatch:r.push(o.content);break;case S.DictionaryBatch:i.push(o.content);break}}}return{schema:n,dictionaries:i,records:r,metadata:null}}function Xn(t){let e=t.byteLength-(gt.length+4),n=N(t,e-h(t,e)),r=n(4,v,$.V1),i=n(8,Ht,[]),s=n(10,Ht,[]);return{schema:n(6,(a,o)=>Xt(a,o,r)),dictionaries:i.map(({offset:a})=>nt(t,a).content),records:s.map(({offset:a})=>nt(t,a).content),metadata:n(12,et)}}function rt(t,e){return Jn(Hn(t),e)}function Jn(t,e={}){let{schema:n={fields:[]},dictionaries:r,records:i}=t,{version:s,fields:a}=n,o=new Map,u=Gn(e,s,o),d=new Map;Zn(n,y=>{let p=y.type;p.typeId===l.Dictionary&&d.set(p.id,p.dictionary)});let c=new Map;for(let y of r){let{id:p,data:E,isDelta:D,body:ce}=y,dt=d.get(p),ht=it(dt,u({...E,body:ce}));if(c.has(p)){let ft=c.get(p);D||ft.clear(),ft.add(ht)}else{if(D)throw Error("Delta update can not be first dictionary batch.");c.set(p,Yt(dt).add(ht))}}c.forEach((y,p)=>o.set(p,y.done()));let g=a.map(y=>Yt(y.type));for(let y of i){let p=u(y);a.forEach((E,D)=>g[D].add(it(E.type,p)))}return new Mn(n,g.map(y=>y.done()),e.useProxy)}function Zn(t,e){t.fields.forEach(function n(r){var i,s,a;e(r),(s=(i=r.type.dictionary)==null?void 0:i.children)==null||s.forEach(n),(a=r.type.children)==null||a.forEach(n)})}function Gn(t,e,n){let r={version:e,options:t,dictionary:i=>n.get(i)};return i=>{let{length:s,nodes:a,regions:o,variadic:u,body:d}=i,c=-1,g=-1,y=-1;return{...r,length:s,node:()=>a[++c],buffer:p=>{let{length:E,offset:D}=o[++g];return p?new p(d.buffer,d.byteOffset+D,E/p.BYTES_PER_ELEMENT):d.subarray(D,D+E)},variadic:()=>u[++y],visit(p){return p.map(E=>it(E.type,this))}}}}function it(t,e){let{typeId:n}=t,{length:r,options:i,node:s,buffer:a,variadic:o,version:u}=e,d=Un(t,i);if(n===l.Null)return new d({length:r,nullCount:r,type:t});let c={...s(),type:t};switch(n){case l.Bool:case l.Int:case l.Time:case l.Duration:case l.Float:case l.Decimal:case l.Date:case l.Timestamp:case l.Interval:case l.FixedSizeBinary:return new d({...c,validity:a(),values:a(t.values)});case l.Utf8:case l.LargeUtf8:case l.Binary:case l.LargeBinary:return new d({...c,validity:a(),offsets:a(t.offsets),values:a()});case l.BinaryView:case l.Utf8View:return new d({...c,validity:a(),values:a(),data:Array.from({length:o()},()=>a())});case l.List:case l.LargeList:case l.Map:return new d({...c,validity:a(),offsets:a(t.offsets),children:e.visit(t.children)});case l.ListView:case l.LargeListView:return new d({...c,validity:a(),offsets:a(t.offsets),sizes:a(t.offsets),children:e.visit(t.children)});case l.FixedSizeList:case l.Struct:return new d({...c,validity:a(),children:e.visit(t.children)});case l.RunEndEncoded:return new d({...c,children:e.visit(t.children)});case l.Dictionary:{let{id:g,indices:y}=t;return new d({...c,validity:a(),values:a(y.values)}).setDictionary(e.dictionary(g))}case l.Union:return u<$.V5&&a(),new d({...c,typeIds:a(It),offsets:t.mode===W.Sparse?null:a(t.offsets),children:e.visit(t.children)});default:throw Error(Z(n))}}new Uint16Array(new Uint8Array([1,0]).buffer)[0];function R(t,e){let n=new Map;return(...r)=>{let i=e(...r);if(n.has(i))return n.get(i);let s=t(...r).finally(()=>{n.delete(i)});return n.set(i,s),s}}function st(t,e){return me(t,e)}function qn(){return ye()}const I=pe;function Zt(){let t=Kn(qn()),e=n=>JSON.stringify(n);return{load:R(t.load.bind(t),e),sanitize:R(t.sanitize.bind(t),e),http:R(t.http.bind(t),e),file:R(t.file.bind(t),e)}}function Kn(t){return{...t,async load(e,n){return e.endsWith(".arrow")?rt(await Gt(e),{useProxy:!1}).toArray():t.load(e,n)}}}const Gt=R(t=>fetch(t).then(e=>e.arrayBuffer()),t=>t);var qt=I.integer,Kt=I.number,Qn=I.date,tr=I.boolean,Qt=()=>(I.integer=t=>{if(t==="")return"";if(t==="-inf"||t==="inf")return t;function e(r){let i=qt(r);return Number.isNaN(i)?r:i}let n=Number.parseInt(t,10);if(Number.isNaN(n))return t;if(!(Math.abs(n)>2**53-1))return e(t);try{return BigInt(t)}catch{return e(t)}},I.number=t=>{if(t==="-inf"||t==="inf")return t;let e=Kt(t);return Number.isNaN(e)?t:e},()=>{I.integer=qt,I.number=Kt}),te=()=>(I.date=t=>{if(t==="")return"";if(t==null)return null;if(!/^\d{4}-\d{2}-\d{2}(T[\d.:]+(Z|[+-]\d{2}:?\d{2})?)?$/.test(t))return t;try{let e=new Date(t);return Number.isNaN(e.getTime())?t:e}catch{return fe.warn(`Failed to parse date: ${t}`),t}},()=>{I.date=Qn});I.boolean=t=>t==="True"?!0:t==="False"?!1:tr(t);const ee=Zt();async function er(t,e,n={}){let{handleBigIntAndNumberLike:r=!1,replacePeriod:i=!1}=n;if(t.endsWith(".arrow")||(e==null?void 0:e.type)==="arrow")return rt(await Gt(t),{useProxy:!0,useDate:!0,useBigInt:r}).toArray();let s=[te];r&&s.push(Qt);let a=[];try{let o=await ee.load(t);if(!e){if(typeof o=="string")try{JSON.parse(o),e={type:"json"}}catch{e={type:"csv",parse:"auto"}}typeof o=="object"&&(e={type:"json"})}let u=(e==null?void 0:e.type)==="csv";u&&typeof o=="string"&&(o=rr(o)),u&&typeof o=="string"&&i&&(o=ir(o));let d=(e==null?void 0:e.parse)||"auto";return typeof d=="object"&&(d=yt.mapValues(d,c=>c==="time"?"string":c==="datetime"?"date":c)),a=s.map(c=>c()),u?st(o,{...e,parse:d}):st(o,e)}finally{a.forEach(o=>o())}}function nr(t,e=!0){let n=[te];e&&n.push(Qt);let r=n.map(s=>s()),i=st(t,{type:"csv",parse:"auto"});return r.forEach(s=>s()),i}function rr(t){return t!=null&&t.includes(",")?ne(t,e=>{let n=new Set;return e.map(r=>{let i=ar(r,n);return n.add(i),i})}):t}function ir(t){return t!=null&&t.includes(".")?ne(t,e=>e.map(n=>n.replaceAll(".","\u2024"))):t}function ne(t,e){let n=t.split(`
2
2
  `);return n[0]=e(n[0].split(",")).join(","),n.join(`
3
3
  `)}var sr="\u200B";function ar(t,e){let n=t,r=1;for(;e.has(n);)n=`${t}${sr.repeat(r)}`,r++;return n}var lr={version:"1.1.0"};function or(t,e,n,r){if(ge(t))return`[${t.map(i=>e(ve(i)?i:re(i,n))).join(", ")}]`;if(pt(t)){let i="",{title:s,image:a,...o}=t;s&&(i+=`<h2>${e(s)}</h2>`),a&&(i+=`<img src="${new URL(e(a),r||location.href).href}">`);let u=Object.keys(o);if(u.length>0){i+="<table>";for(let d of u){let c=o[d];c!==void 0&&(pt(c)&&(c=re(c,n)),i+=`<tr><td class="key">${e(d)}</td><td class="value">${e(c)}</td></tr>`)}i+="</table>"}return i||"{}"}return e(t)}function ur(t){let e=[];return function(n,r){return typeof r!="object"||!r?r:(e.length=e.indexOf(this)+1,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r))}}function re(t,e){return JSON.stringify(t,ur(e))}var cr=`#vg-tooltip-element {
4
4
  visibility: hidden;
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{n as C}from"./useEvent-D91BmmQi.js";import{t as Y}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import{t as tt}from"./compiler-runtime-B3qBwwSJ.js";import{t as et}from"./debounce-BbSyBDA8.js";import{_,d as T}from"./useEventListener-DGjKht0c.js";import{n as V}from"./config-Cgj0Ahvb.js";import{t as nt}from"./cn-DYvqRARy.js";import{t as rt}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-k58KVlT-.js";import{t as at}from"./tooltip-DmqhBBs6.js";import{r as it}from"./button-BKVLeSTX.js";import{d as N}from"./arrays-DAC2orgH.js";import{u as ot}from"./toDate-BGIVWsZ9.js";import"./session-DdnWW30b.js";import{r as lt}from"./useTheme-DCDmxPD0.js";import{t as ct}from"./isValid-U-UFA9KI.js";import{a as st,r as mt,t as pt}from"./utils-BaSt_0sN.js";import{n as ut}from"./vega-loader.browser-DLukqq1q.js";import{t as ft}from"./react-vega-LNfJwi6n.js";import"./defaultLocale-Cyhs3Xd2.js";import"./defaultLocale-B8Omxjnr.js";import{r as dt,t as ht}from"./alert-DF3HbVtk.js";import{n as gt}from"./error-banner-Bfe6BopK.js";import{n as yt}from"./useAsyncData-CaAFMbY9.js";import{t as vt}from"./formats-DC_7w22O.js";import{t as H}from"./useDeepCompareMemoize-D0WTlCXt.js";var kt=tt(),S=z(Y(),1);function bt(t){return t.data&&"url"in t.data&&(t.data.url=V(t.data.url).href),t}const u={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"};var F=new Set(["boxplot","errorband","errorbar"]);const x={getMarkType(t){let e=typeof t=="string"?t:t.type;if(F.has(e))throw Error("Not supported");return e},isInteractive(t){let e=typeof t=="string"?t:t.type;return!F.has(e)},makeClickable(t){let e=typeof t=="string"?t:t.type;return e in u?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity(t){return typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null}},y={point(t){return t==null?"select_point":`select_point_${t}`},interval(t){return t==null?"select_interval":`select_interval_${t}`},legendSelection(t){return`legend_selection_${t}`},binColoring(t){return t==null?"bin_coloring":`bin_coloring_${t}`},HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint(t){return t.some(e=>e.startsWith("select_point"))},hasInterval(t){return t.some(e=>e.startsWith("select_interval"))},hasLegend(t){return t.some(e=>e.startsWith("legend_selection"))},hasPanZoom(t){return t.some(e=>e.startsWith("pan_zoom"))},isBinColoring(t){return t.startsWith("bin_coloring")}},j={highlight(){return{name:y.HIGHLIGHT,select:{type:"point",on:"mouseover"}}},interval(t,e){return{name:y.interval(e),select:{type:"interval",encodings:W(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}},point(t,e){return{name:y.point(e),select:{type:"point",encodings:W(t),on:"click[!event.metaKey]"}}},binColoring(t){return{name:y.binColoring(t),select:{type:"point",on:"click[!event.metaKey]"}}},legend(t){return{name:y.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}},panZoom(){return{name:y.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}}}};function W(t){switch(x.getMarkType(t.mark)){case u.image:case u.trail:return;case u.area:case u.arc:return["color"];case u.bar:{let e=wt(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case u.circle:case u.geoshape:case u.line:case u.point:case u.rect:case u.rule:case u.square:case u.text:case u.tick:return["x","y"]}}function P(t){return"params"in t&&t.params&&t.params.length>0?N(t.params.filter(e=>e==null?!1:"select"in e&&e.select!==void 0).map(e=>e.name)):"layer"in t?N(t.layer.flatMap(P)):"vconcat"in t?N(t.vconcat.flatMap(P)):"hconcat"in t?N(t.hconcat.flatMap(P)):[]}function wt(t){var a,r;if(!t||!("mark"in t))return;let e=(a=t.encoding)==null?void 0:a.x,n=(r=t.encoding)==null?void 0:r.y;if(e&&"type"in e&&e.type==="nominal")return"vertical";if(n&&"type"in n&&n.type==="nominal"||e&&"aggregate"in e)return"horizontal";if(n&&"aggregate"in n)return"vertical"}function St(t){if(!t.encoding)return[];let e=[];for(let n of Object.values(t.encoding))n&&typeof n=="object"&&"bin"in n&&n.bin&&"field"in n&&typeof n.field=="string"&&e.push(n.field);return e}function D(t){if(!t||!("encoding"in t))return[];let{encoding:e}=t;return e?Object.entries(e).flatMap(n=>{let[a,r]=n;return!r||!xt.has(a)?[]:"field"in r&&typeof r.field=="string"?[r.field]:"condition"in r&&r.condition&&typeof r.condition=="object"&&"field"in r.condition&&r.condition.field&&typeof r.condition.field=="string"?[r.condition.field]:[]}):[]}var xt=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function G(t,e,n,a){let r=n.filter(o=>y.isBinColoring(o)),i={and:(r.length>0?r:n).map(o=>({param:o}))};if(t==="opacity"){let o=x.getOpacity(a)||1;return{...e,opacity:{condition:{test:i,value:o},value:o/5}}}else return e}function At(t){if(!("select"in t)||!t.select)return JSON.stringify(t);let e=t.select;if(typeof e=="string")return JSON.stringify({type:e,bind:t.bind});let n={type:e.type,encodings:"encodings"in e&&e.encodings?[...e.encodings].toSorted():void 0,fields:"fields"in e&&e.fields?[...e.fields].toSorted():void 0,bind:t.bind};return JSON.stringify(n)}function $(t){let e=E(t);if(e.length===0)return t;let n=_t(e);return n.length===0?t:{...L(K(t,new Set(n.map(a=>a.name))),n.map(a=>a.name)),params:[...t.params||[],...n]}}function E(t){let e=[];if("vconcat"in t&&Array.isArray(t.vconcat))for(let n of t.vconcat)e.push(...E(n));else if("hconcat"in t&&Array.isArray(t.hconcat))for(let n of t.hconcat)e.push(...E(n));else{if("layer"in t)return[];"mark"in t&&"params"in t&&t.params&&t.params.length>0&&e.push({params:t.params})}return e}function _t(t){if(t.length===0)return[];let e=new Map,n=t.length;for(let{params:r}of t){let i=new Set;for(let o of r){let l=At(o);i.has(l)||(i.add(l),e.has(l)||e.set(l,{count:0,param:o}),e.get(l).count++)}}let a=[];for(let[,{count:r,param:i}]of e)r===n&&a.push(i);return a}function K(t,e){if("vconcat"in t&&Array.isArray(t.vconcat))return{...t,vconcat:t.vconcat.map(n=>K(n,e))};if("hconcat"in t&&Array.isArray(t.hconcat))return{...t,hconcat:t.hconcat.map(n=>K(n,e))};if("mark"in t&&"params"in t&&t.params){let n=t.params,a=[];for(let r of n){if(!r||typeof r!="object"||!("name"in r)){a.push(r);continue}e.has(r.name)||a.push(r)}if(a.length===0){let{params:r,...i}=t;return i}return{...t,params:a}}return t}function L(t,e){return"vconcat"in t&&Array.isArray(t.vconcat)?{...t,vconcat:t.vconcat.map(n=>L(n,e))}:"hconcat"in t&&Array.isArray(t.hconcat)?{...t,hconcat:t.hconcat.map(n=>L(n,e))}:"layer"in t?t:"mark"in t&&x.isInteractive(t.mark)?{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",t.encoding||{},e,t.mark)}:t}function Z(t,e){var l,k;let{chartSelection:n=!0,fieldSelection:a=!0}=e;if(!n&&!a)return t;(l=t.params)!=null&&l.some(s=>s.bind==="legend")&&(a=!1);let r=(k=t.params)==null?void 0:k.some(s=>!s.bind);r&&(n=!1);let i="vconcat"in t||"hconcat"in t;if(r&&i)return t;if("vconcat"in t){let s=t.vconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,vconcat:s})}if("hconcat"in t){let s=t.hconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,hconcat:s})}if("layer"in t){let s=t.params&&t.params.length>0,m=a!==!1&&!s,v=[];if(m){let p=t.layer.flatMap(f=>"mark"in f?D(f):[]);v=[...new Set(p)],Array.isArray(a)&&(v=v.filter(f=>a.includes(f)))}let w=t.layer.map((p,f)=>{if(!("mark"in p))return p;let h=p;if(f===0&&v.length>0){let O=v.map(M=>j.legend(M));h={...h,params:[...h.params||[],...O]}}return h=q(h,n,f),h=R(h),f===0&&(h=J(h)),h});return{...t,layer:w}}if(!("mark"in t)||!x.isInteractive(t.mark))return t;let o=t;return o=jt(o,a),o=q(o,n,void 0),o=R(o),o=J(o),o}function jt(t,e){if(e===!1)return t;let n=D(t);Array.isArray(e)&&(n=n.filter(i=>e.includes(i)));let a=n.map(i=>j.legend(i)),r=[...t.params||[],...a];return{...t,params:r}}function q(t,e,n){if(e===!1)return t;let a;try{a=x.getMarkType(t.mark)}catch{return t}if(a==="geoshape")return t;let r=St(t),i=e===!0?r.length>0?["point"]:Ot(a):[e];if(!i||i.length===0)return t;let o=i.map(k=>k==="interval"?j.interval(t,n):j.point(t,n)),l=[...t.params||[],...o];return r.length>0&&i.includes("point")&&l.push(j.binColoring(n)),{...t,params:l}}function J(t){let e;try{e=x.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;let n=t.params||[];return n.some(a=>a.bind==="scales")?t:{...t,params:[...n,j.panZoom()]}}function R(t){let e="encoding"in t?t.encoding:void 0,n=t.params||[],a=n.map(r=>r.name);return n.length===0||!x.isInteractive(t.mark)?t:{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",e||{},a,t.mark)}}function Ot(t){switch(t){case"arc":case"area":return["point"];case"text":case"bar":return["point","interval"];case"line":return;default:return["point","interval"]}}async function Mt(t){if(!t)return t;let e="datasets"in t?{...t.datasets}:{},n=async r=>{if(!r)return r;if("layer"in r){let l=await Promise.all(r.layer.map(n));r={...r,layer:l}}if("hconcat"in r){let l=await Promise.all(r.hconcat.map(n));r={...r,hconcat:l}}if("vconcat"in r){let l=await Promise.all(r.vconcat.map(n));r={...r,vconcat:l}}if("spec"in r&&(r={...r,spec:await n(r.spec)}),!r.data||!("url"in r.data))return r;let i;try{i=V(r.data.url)}catch{return r}let o=await st(i.href,r.data.format);return e[i.pathname]=o,{...r,data:{name:i.pathname}}},a=await n(t);return Object.keys(e).length===0?a:{...a,datasets:e}}var d=z(rt(),1);ut("arrow",vt);var Nt=t=>{let e=(0,kt.c)(12),{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:o,embedOptions:l}=t,k,s;e[0]===o?(k=e[1],s=e[2]):(k=async()=>Mt(o),s=[o],e[0]=o,e[1]=k,e[2]=s);let{data:m,error:v}=yt(k,s);if(v){let p;return e[3]===v?p=e[4]:(p=(0,d.jsx)(gt,{error:v}),e[3]=v,e[4]=p),p}if(!m)return null;let w;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==m||e[9]!==a||e[10]!==n?(w=(0,d.jsx)(Pt,{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:m,embedOptions:l}),e[5]=r,e[6]=l,e[7]=i,e[8]=m,e[9]=a,e[10]=n,e[11]=w):w=e[11],w},Pt=({value:t,setValue:e,chartSelection:n,fieldSelection:a,spec:r,embedOptions:i})=>{let{theme:o}=lt(),l=(0,S.useRef)(null),k=(0,S.useRef)(void 0),[s,m]=(0,S.useState)(),v=(0,S.useMemo)(()=>i&&"actions"in i?i.actions:{source:!1,compiled:!1},[i]),w=H(r),p=(0,S.useMemo)(()=>Z(bt(w),{chartSelection:n,fieldSelection:a}),[w,n,a]),f=(0,S.useMemo)(()=>P(p),[p]),h=C(c=>{e({...t,...c})}),O=(0,S.useMemo)(()=>et((c,g)=>{_.debug("[Vega signal]",c,g);let b=T.mapValues(g,Ct);b=T.mapValues(b,It),h({[c]:b})},100),[h]),M=H(f),I=(0,S.useMemo)(()=>M.reduce((c,g)=>(y.PAN_ZOOM===g||y.isBinColoring(g)||c.push({signalName:g,handler:(b,X)=>O(b,X)}),c),[]),[M,O]),B=C(c=>{_.error(c),_.debug(p),m(c)}),Q=C(c=>{_.debug("[Vega view] created",c),k.current=c,m(void 0)}),U=()=>{let c=[];return y.hasPoint(f)&&c.push(["Point selection","click to select a point; hold shift for multi-select"]),y.hasInterval(f)&&c.push(["Interval selection","click and drag to select an interval"]),y.hasLegend(f)&&c.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),y.hasPanZoom(f)&&c.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),c.length===0?null:(0,d.jsx)(at,{delayDuration:300,side:"left",content:(0,d.jsx)("div",{className:"text-xs flex flex-col",children:c.map((g,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{className:"font-bold tracking-wide",children:[g[0],":"]})," ",g[1]]},b))}),children:(0,d.jsx)(ot,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})},A=ft({ref:l,spec:p,options:{theme:o==="dark"?"dark":void 0,actions:v,mode:"vega-lite",tooltip:mt.call,renderer:"canvas"},onError:B,onEmbed:Q});return(0,S.useEffect)(()=>(I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.addSignalListener(c,g)}catch(b){_.error(b)}}),()=>{I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.removeSignalListener(c,g)}catch(b){_.error(b)}})}),[A,I]),(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsxs)(ht,{variant:"destructive",children:[(0,d.jsx)(dt,{children:s.message}),(0,d.jsx)("div",{className:"text-md",children:s.stack})]}),(0,d.jsxs)("div",{className:nt("relative"),onPointerDown:it.stopPropagation(),children:[(0,d.jsx)("div",{ref:l,"data-container-width":pt(p)}),U()]})]})};function It(t){return t instanceof Set?[...t]:t}function Ct(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&ct(e)?new Date(e).getTime():e):t}var Et=Nt;export{Et as default};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{n as C}from"./useEvent-D91BmmQi.js";import{t as Y}from"./react-Bj1aDYRI.js";import"./react-dom-CSu739Rf.js";import{t as tt}from"./compiler-runtime-B3qBwwSJ.js";import{t as et}from"./debounce-BbSyBDA8.js";import{_,d as T}from"./useEventListener-DGjKht0c.js";import{n as V}from"./config-Cgj0Ahvb.js";import{t as nt}from"./cn-DYvqRARy.js";import{t as rt}from"./jsx-runtime-Blw4afVn.js";import"./fullscreen-k58KVlT-.js";import{t as at}from"./tooltip-DmqhBBs6.js";import{r as it}from"./button-BKVLeSTX.js";import{d as N}from"./arrays-DAC2orgH.js";import{u as ot}from"./toDate-BGIVWsZ9.js";import"./session-DdnWW30b.js";import{r as lt}from"./useTheme-DCDmxPD0.js";import{t as ct}from"./isValid-U-UFA9KI.js";import{a as st,r as mt,t as pt}from"./utils-BZwMGX81.js";import{n as ut}from"./vega-loader.browser-DXARUlxo.js";import{t as ft}from"./react-vega-BVBnH7ue.js";import"./defaultLocale-JieDVWC_.js";import"./defaultLocale-BLne0bXb.js";import{r as dt,t as ht}from"./alert-DF3HbVtk.js";import{n as gt}from"./error-banner-bXc_9BBZ.js";import{n as yt}from"./useAsyncData-aCoWDe-l.js";import{t as vt}from"./formats-BQHP_yQk.js";import{t as H}from"./useDeepCompareMemoize-D0WTlCXt.js";var kt=tt(),S=z(Y(),1);function bt(t){return t.data&&"url"in t.data&&(t.data.url=V(t.data.url).href),t}const u={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"};var F=new Set(["boxplot","errorband","errorbar"]);const x={getMarkType(t){let e=typeof t=="string"?t:t.type;if(F.has(e))throw Error("Not supported");return e},isInteractive(t){let e=typeof t=="string"?t:t.type;return!F.has(e)},makeClickable(t){let e=typeof t=="string"?t:t.type;return e in u?typeof t=="string"?{type:t,cursor:"pointer",tooltip:!0}:{...t,type:e,cursor:"pointer",tooltip:!0}:t},getOpacity(t){return typeof t=="string"?null:"opacity"in t&&typeof t.opacity=="number"?t.opacity:null}},y={point(t){return t==null?"select_point":`select_point_${t}`},interval(t){return t==null?"select_interval":`select_interval_${t}`},legendSelection(t){return`legend_selection_${t}`},binColoring(t){return t==null?"bin_coloring":`bin_coloring_${t}`},HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint(t){return t.some(e=>e.startsWith("select_point"))},hasInterval(t){return t.some(e=>e.startsWith("select_interval"))},hasLegend(t){return t.some(e=>e.startsWith("legend_selection"))},hasPanZoom(t){return t.some(e=>e.startsWith("pan_zoom"))},isBinColoring(t){return t.startsWith("bin_coloring")}},j={highlight(){return{name:y.HIGHLIGHT,select:{type:"point",on:"mouseover"}}},interval(t,e){return{name:y.interval(e),select:{type:"interval",encodings:W(t),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}},point(t,e){return{name:y.point(e),select:{type:"point",encodings:W(t),on:"click[!event.metaKey]"}}},binColoring(t){return{name:y.binColoring(t),select:{type:"point",on:"click[!event.metaKey]"}}},legend(t){return{name:y.legendSelection(t),select:{type:"point",fields:[t]},bind:"legend"}},panZoom(){return{name:y.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}}}};function W(t){switch(x.getMarkType(t.mark)){case u.image:case u.trail:return;case u.area:case u.arc:return["color"];case u.bar:{let e=wt(t);return e==="horizontal"?["y"]:e==="vertical"?["x"]:void 0}case u.circle:case u.geoshape:case u.line:case u.point:case u.rect:case u.rule:case u.square:case u.text:case u.tick:return["x","y"]}}function P(t){return"params"in t&&t.params&&t.params.length>0?N(t.params.filter(e=>e==null?!1:"select"in e&&e.select!==void 0).map(e=>e.name)):"layer"in t?N(t.layer.flatMap(P)):"vconcat"in t?N(t.vconcat.flatMap(P)):"hconcat"in t?N(t.hconcat.flatMap(P)):[]}function wt(t){var a,r;if(!t||!("mark"in t))return;let e=(a=t.encoding)==null?void 0:a.x,n=(r=t.encoding)==null?void 0:r.y;if(e&&"type"in e&&e.type==="nominal")return"vertical";if(n&&"type"in n&&n.type==="nominal"||e&&"aggregate"in e)return"horizontal";if(n&&"aggregate"in n)return"vertical"}function St(t){if(!t.encoding)return[];let e=[];for(let n of Object.values(t.encoding))n&&typeof n=="object"&&"bin"in n&&n.bin&&"field"in n&&typeof n.field=="string"&&e.push(n.field);return e}function D(t){if(!t||!("encoding"in t))return[];let{encoding:e}=t;return e?Object.entries(e).flatMap(n=>{let[a,r]=n;return!r||!xt.has(a)?[]:"field"in r&&typeof r.field=="string"?[r.field]:"condition"in r&&r.condition&&typeof r.condition=="object"&&"field"in r.condition&&r.condition.field&&typeof r.condition.field=="string"?[r.condition.field]:[]}):[]}var xt=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function G(t,e,n,a){let r=n.filter(o=>y.isBinColoring(o)),i={and:(r.length>0?r:n).map(o=>({param:o}))};if(t==="opacity"){let o=x.getOpacity(a)||1;return{...e,opacity:{condition:{test:i,value:o},value:o/5}}}else return e}function At(t){if(!("select"in t)||!t.select)return JSON.stringify(t);let e=t.select;if(typeof e=="string")return JSON.stringify({type:e,bind:t.bind});let n={type:e.type,encodings:"encodings"in e&&e.encodings?[...e.encodings].toSorted():void 0,fields:"fields"in e&&e.fields?[...e.fields].toSorted():void 0,bind:t.bind};return JSON.stringify(n)}function $(t){let e=E(t);if(e.length===0)return t;let n=_t(e);return n.length===0?t:{...L(K(t,new Set(n.map(a=>a.name))),n.map(a=>a.name)),params:[...t.params||[],...n]}}function E(t){let e=[];if("vconcat"in t&&Array.isArray(t.vconcat))for(let n of t.vconcat)e.push(...E(n));else if("hconcat"in t&&Array.isArray(t.hconcat))for(let n of t.hconcat)e.push(...E(n));else{if("layer"in t)return[];"mark"in t&&"params"in t&&t.params&&t.params.length>0&&e.push({params:t.params})}return e}function _t(t){if(t.length===0)return[];let e=new Map,n=t.length;for(let{params:r}of t){let i=new Set;for(let o of r){let l=At(o);i.has(l)||(i.add(l),e.has(l)||e.set(l,{count:0,param:o}),e.get(l).count++)}}let a=[];for(let[,{count:r,param:i}]of e)r===n&&a.push(i);return a}function K(t,e){if("vconcat"in t&&Array.isArray(t.vconcat))return{...t,vconcat:t.vconcat.map(n=>K(n,e))};if("hconcat"in t&&Array.isArray(t.hconcat))return{...t,hconcat:t.hconcat.map(n=>K(n,e))};if("mark"in t&&"params"in t&&t.params){let n=t.params,a=[];for(let r of n){if(!r||typeof r!="object"||!("name"in r)){a.push(r);continue}e.has(r.name)||a.push(r)}if(a.length===0){let{params:r,...i}=t;return i}return{...t,params:a}}return t}function L(t,e){return"vconcat"in t&&Array.isArray(t.vconcat)?{...t,vconcat:t.vconcat.map(n=>L(n,e))}:"hconcat"in t&&Array.isArray(t.hconcat)?{...t,hconcat:t.hconcat.map(n=>L(n,e))}:"layer"in t?t:"mark"in t&&x.isInteractive(t.mark)?{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",t.encoding||{},e,t.mark)}:t}function Z(t,e){var l,k;let{chartSelection:n=!0,fieldSelection:a=!0}=e;if(!n&&!a)return t;(l=t.params)!=null&&l.some(s=>s.bind==="legend")&&(a=!1);let r=(k=t.params)==null?void 0:k.some(s=>!s.bind);r&&(n=!1);let i="vconcat"in t||"hconcat"in t;if(r&&i)return t;if("vconcat"in t){let s=t.vconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,vconcat:s})}if("hconcat"in t){let s=t.hconcat.map(m=>"mark"in m?Z(m,{chartSelection:n,fieldSelection:a}):m);return $({...t,hconcat:s})}if("layer"in t){let s=t.params&&t.params.length>0,m=a!==!1&&!s,v=[];if(m){let p=t.layer.flatMap(f=>"mark"in f?D(f):[]);v=[...new Set(p)],Array.isArray(a)&&(v=v.filter(f=>a.includes(f)))}let w=t.layer.map((p,f)=>{if(!("mark"in p))return p;let h=p;if(f===0&&v.length>0){let O=v.map(M=>j.legend(M));h={...h,params:[...h.params||[],...O]}}return h=q(h,n,f),h=R(h),f===0&&(h=J(h)),h});return{...t,layer:w}}if(!("mark"in t)||!x.isInteractive(t.mark))return t;let o=t;return o=jt(o,a),o=q(o,n,void 0),o=R(o),o=J(o),o}function jt(t,e){if(e===!1)return t;let n=D(t);Array.isArray(e)&&(n=n.filter(i=>e.includes(i)));let a=n.map(i=>j.legend(i)),r=[...t.params||[],...a];return{...t,params:r}}function q(t,e,n){if(e===!1)return t;let a;try{a=x.getMarkType(t.mark)}catch{return t}if(a==="geoshape")return t;let r=St(t),i=e===!0?r.length>0?["point"]:Ot(a):[e];if(!i||i.length===0)return t;let o=i.map(k=>k==="interval"?j.interval(t,n):j.point(t,n)),l=[...t.params||[],...o];return r.length>0&&i.includes("point")&&l.push(j.binColoring(n)),{...t,params:l}}function J(t){let e;try{e=x.getMarkType(t.mark)}catch{}if(e==="geoshape")return t;let n=t.params||[];return n.some(a=>a.bind==="scales")?t:{...t,params:[...n,j.panZoom()]}}function R(t){let e="encoding"in t?t.encoding:void 0,n=t.params||[],a=n.map(r=>r.name);return n.length===0||!x.isInteractive(t.mark)?t:{...t,mark:x.makeClickable(t.mark),encoding:G("opacity",e||{},a,t.mark)}}function Ot(t){switch(t){case"arc":case"area":return["point"];case"text":case"bar":return["point","interval"];case"line":return;default:return["point","interval"]}}async function Mt(t){if(!t)return t;let e="datasets"in t?{...t.datasets}:{},n=async r=>{if(!r)return r;if("layer"in r){let l=await Promise.all(r.layer.map(n));r={...r,layer:l}}if("hconcat"in r){let l=await Promise.all(r.hconcat.map(n));r={...r,hconcat:l}}if("vconcat"in r){let l=await Promise.all(r.vconcat.map(n));r={...r,vconcat:l}}if("spec"in r&&(r={...r,spec:await n(r.spec)}),!r.data||!("url"in r.data))return r;let i;try{i=V(r.data.url)}catch{return r}let o=await st(i.href,r.data.format);return e[i.pathname]=o,{...r,data:{name:i.pathname}}},a=await n(t);return Object.keys(e).length===0?a:{...a,datasets:e}}var d=z(rt(),1);ut("arrow",vt);var Nt=t=>{let e=(0,kt.c)(12),{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:o,embedOptions:l}=t,k,s;e[0]===o?(k=e[1],s=e[2]):(k=async()=>Mt(o),s=[o],e[0]=o,e[1]=k,e[2]=s);let{data:m,error:v}=yt(k,s);if(v){let p;return e[3]===v?p=e[4]:(p=(0,d.jsx)(gt,{error:v}),e[3]=v,e[4]=p),p}if(!m)return null;let w;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==m||e[9]!==a||e[10]!==n?(w=(0,d.jsx)(Pt,{value:n,setValue:a,chartSelection:r,fieldSelection:i,spec:m,embedOptions:l}),e[5]=r,e[6]=l,e[7]=i,e[8]=m,e[9]=a,e[10]=n,e[11]=w):w=e[11],w},Pt=({value:t,setValue:e,chartSelection:n,fieldSelection:a,spec:r,embedOptions:i})=>{let{theme:o}=lt(),l=(0,S.useRef)(null),k=(0,S.useRef)(void 0),[s,m]=(0,S.useState)(),v=(0,S.useMemo)(()=>i&&"actions"in i?i.actions:{source:!1,compiled:!1},[i]),w=H(r),p=(0,S.useMemo)(()=>Z(bt(w),{chartSelection:n,fieldSelection:a}),[w,n,a]),f=(0,S.useMemo)(()=>P(p),[p]),h=C(c=>{e({...t,...c})}),O=(0,S.useMemo)(()=>et((c,g)=>{_.debug("[Vega signal]",c,g);let b=T.mapValues(g,Ct);b=T.mapValues(b,It),h({[c]:b})},100),[h]),M=H(f),I=(0,S.useMemo)(()=>M.reduce((c,g)=>(y.PAN_ZOOM===g||y.isBinColoring(g)||c.push({signalName:g,handler:(b,X)=>O(b,X)}),c),[]),[M,O]),B=C(c=>{_.error(c),_.debug(p),m(c)}),Q=C(c=>{_.debug("[Vega view] created",c),k.current=c,m(void 0)}),U=()=>{let c=[];return y.hasPoint(f)&&c.push(["Point selection","click to select a point; hold shift for multi-select"]),y.hasInterval(f)&&c.push(["Interval selection","click and drag to select an interval"]),y.hasLegend(f)&&c.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),y.hasPanZoom(f)&&c.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),c.length===0?null:(0,d.jsx)(at,{delayDuration:300,side:"left",content:(0,d.jsx)("div",{className:"text-xs flex flex-col",children:c.map((g,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("span",{className:"font-bold tracking-wide",children:[g[0],":"]})," ",g[1]]},b))}),children:(0,d.jsx)(ot,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})},A=ft({ref:l,spec:p,options:{theme:o==="dark"?"dark":void 0,actions:v,mode:"vega-lite",tooltip:mt.call,renderer:"canvas"},onError:B,onEmbed:Q});return(0,S.useEffect)(()=>(I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.addSignalListener(c,g)}catch(b){_.error(b)}}),()=>{I.forEach(({signalName:c,handler:g})=>{try{A==null||A.view.removeSignalListener(c,g)}catch(b){_.error(b)}})}),[A,I]),(0,d.jsxs)(d.Fragment,{children:[s&&(0,d.jsxs)(ht,{variant:"destructive",children:[(0,d.jsx)(dt,{children:s.message}),(0,d.jsx)("div",{className:"text-md",children:s.stack})]}),(0,d.jsxs)("div",{className:nt("relative"),onPointerDown:it.stopPropagation(),children:[(0,d.jsx)("div",{ref:l,"data-container-width":pt(p)}),U()]})]})};function It(t){return t instanceof Set?[...t]:t}function Ct(t){return Array.isArray(t)?t.map(e=>e instanceof Date&&ct(e)?new Date(e).getTime():e):t}var Et=Nt;export{Et as default};
@@ -1,4 +1,4 @@
1
- import{a as Tt,n as _n,r as Wn,s as Jn,t as qn}from"./precisionRound-D8yxZYIF.js";import{i as _t,n as Hn,r as Gn,t as Zn}from"./defaultLocale-Cyhs3Xd2.js";import{C as Vn,N as Wt,S as Qn,T as Jt,_ as qt,a as Kn,b as it,c as Ht,i as Xn,l as Gt,n as tr,o as nr,p as Zt,r as rr,s as er,t as ar,v as st,w as ur,x as or}from"./defaultLocale-B8Omxjnr.js";function E(t,n,r){return t.fields=n||[],t.fname=r,t}function ir(t){return t==null?null:t.fname}function Vt(t){return t==null?null:t.fields}function Qt(t){return t.length===1?sr(t[0]):lr(t)}var sr=t=>function(n){return n[t]},lr=t=>{let n=t.length;return function(r){for(let e=0;e<n;++e)r=r[t[e]];return r}};function v(t){throw Error(t)}function wt(t){let n=[],r=t.length,e=null,a=0,u="",o,i,c;t+="";function l(){n.push(u+t.substring(o,i)),u="",o=i+1}for(o=i=0;i<r;++i)if(c=t[i],c==="\\")u+=t.substring(o,i++),o=i;else if(c===e)l(),e=null,a=-1;else{if(e)continue;o===a&&c==='"'||o===a&&c==="'"?(o=i+1,e=c):c==="."&&!a?i>o?l():o=i+1:c==="["?(i>o&&l(),a=o=i+1):c==="]"&&(a||v("Access path missing open bracket: "+t),a>0&&l(),a=0,o=i+1)}return a&&v("Access path missing closing bracket: "+t),e&&v("Access path missing closing quote: "+t),i>o&&(i++,l()),n}function lt(t,n,r){let e=wt(t);return t=e.length===1?e[0]:t,E((r&&r.get||Qt)(e),[t],n||t)}var cr=lt("id"),W=E(t=>t,[],"identity"),I=E(()=>0,[],"zero"),Kt=E(()=>1,[],"one"),fr=E(()=>!0,[],"true"),hr=E(()=>!1,[],"false"),gr=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(t=>typeof Object.prototype[t]=="function"),"__proto__"]);function pr(t,n,r){let e=[n].concat([].slice.call(r));console[t].apply(console,e)}var mr=0,dr=1,yr=2,vr=3,br=4;function Mr(t,n,r=pr){let e=t||0;return{level(a){return arguments.length?(e=+a,this):e},error(){return e>=1&&r(n||"error","ERROR",arguments),this},warn(){return e>=2&&r(n||"warn","WARN",arguments),this},info(){return e>=3&&r(n||"log","INFO",arguments),this},debug(){return e>=4&&r(n||"log","DEBUG",arguments),this}}}var J=Array.isArray;function $(t){return t===Object(t)}var Xt=t=>t!=="__proto__";function Cr(...t){return t.reduce((n,r)=>{for(let e in r)if(e==="signals")n.signals=Tr(n.signals,r.signals);else{let a=e==="legend"?{layout:1}:e==="style"?!0:null;jt(n,e,r[e],a)}return n},{})}function jt(t,n,r,e){if(!Xt(n))return;let a,u;if($(r)&&!J(r))for(a in u=$(t[n])?t[n]:t[n]={},r)e&&(e===!0||e[a])?jt(u,a,r[a]):Xt(a)&&(u[a]=r[a]);else t[n]=r}function Tr(t,n){if(t==null)return n;let r={},e=[];function a(u){r[u.name]||(r[u.name]=1,e.push(u))}return n.forEach(a),t.forEach(a),e}function P(t){return t[t.length-1]}function q(t){return t==null||t===""?null:+t}var tn=t=>n=>t*Math.exp(n),nn=t=>n=>Math.log(t*n),rn=t=>n=>Math.sign(n)*Math.log1p(Math.abs(n/t)),en=t=>n=>Math.sign(n)*Math.expm1(Math.abs(n))*t,ct=t=>n=>n<0?-((-n)**+t):n**+t;function ft(t,n,r,e){let a=r(t[0]),u=r(P(t)),o=(u-a)*n;return[e(a-o),e(u-o)]}function wr(t,n){return ft(t,n,q,W)}function jr(t,n){var r=Math.sign(t[0]);return ft(t,n,nn(r),tn(r))}function Dr(t,n,r){return ft(t,n,ct(r),ct(1/r))}function kr(t,n,r){return ft(t,n,rn(r),en(r))}function ht(t,n,r,e,a){let u=e(t[0]),o=e(P(t)),i=n==null?(u+o)/2:e(n);return[a(i+(u-i)*r),a(i+(o-i)*r)]}function Or(t,n,r){return ht(t,n,r,q,W)}function Ur(t,n,r){let e=Math.sign(t[0]);return ht(t,n,r,nn(e),tn(e))}function xr(t,n,r,e){return ht(t,n,r,ct(e),ct(1/e))}function Nr(t,n,r,e){return ht(t,n,r,rn(e),en(e))}function Ar(t){return 1+~~(new Date(t).getMonth()/3)}function Er(t){return 1+~~(new Date(t).getUTCMonth()/3)}function R(t){return t==null?[]:J(t)?t:[t]}function Sr(t,n,r){let e=t[0],a=t[1],u;return a<e&&(u=a,a=e,e=u),u=a-e,u>=r-n?[n,r]:[e=Math.min(Math.max(e,n),r-u),e+u]}function B(t){return typeof t=="function"}var Fr="descending";function Pr(t,n,r){r||(r={}),n=R(n)||[];let e=[],a=[],u={},o=r.comparator||zr;return R(t).forEach((i,c)=>{i!=null&&(e.push(n[c]===Fr?-1:1),a.push(i=B(i)?i:lt(i,null,r)),(Vt(i)||[]).forEach(l=>u[l]=1))}),a.length===0?null:E(o(a,e),Object.keys(u))}var Dt=(t,n)=>(t<n||t==null)&&n!=null?-1:(t>n||n==null)&&t!=null?1:(n=n instanceof Date?+n:n,(t=t instanceof Date?+t:t)!==t&&n===n?-1:n!==n&&t===t?1:0),zr=(t,n)=>t.length===1?Yr(t[0],n[0]):Ir(t,n,t.length),Yr=(t,n)=>function(r,e){return Dt(t(r),t(e))*n},Ir=(t,n,r)=>(n.push(0),function(e,a){let u,o=0,i=-1;for(;o===0&&++i<r;)u=t[i],o=Dt(u(e),u(a));return o*n[i]});function an(t){return B(t)?t:()=>t}function $r(t,n){let r;return e=>{r&&clearTimeout(r),r=setTimeout(()=>(n(e),r=null),t)}}function z(t){for(let n,r,e=1,a=arguments.length;e<a;++e)for(r in n=arguments[e],n)t[r]=n[r];return t}function Rr(t,n){let r=0,e,a,u,o;if(t&&(e=t.length))if(n==null){for(a=t[r];r<e&&(a==null||a!==a);a=t[++r]);for(u=o=a;r<e;++r)a=t[r],a!=null&&(a<u&&(u=a),a>o&&(o=a))}else{for(a=n(t[r]);r<e&&(a==null||a!==a);a=n(t[++r]));for(u=o=a;r<e;++r)a=n(t[r]),a!=null&&(a<u&&(u=a),a>o&&(o=a))}return[u,o]}function Br(t,n){let r=t.length,e=-1,a,u,o,i,c;if(n==null){for(;++e<r;)if(u=t[e],u!=null&&u>=u){a=o=u;break}if(e===r)return[-1,-1];for(i=c=e;++e<r;)u=t[e],u!=null&&(a>u&&(a=u,i=e),o<u&&(o=u,c=e))}else{for(;++e<r;)if(u=n(t[e],e,t),u!=null&&u>=u){a=o=u;break}if(e===r)return[-1,-1];for(i=c=e;++e<r;)u=n(t[e],e,t),u!=null&&(a>u&&(a=u,i=e),o<u&&(o=u,c=e))}return[i,c]}function N(t,n){return Object.hasOwn(t,n)}var gt={};function Lr(t){let n={},r;function e(u){return N(n,u)&&n[u]!==gt}let a={size:0,empty:0,object:n,has:e,get(u){return e(u)?n[u]:void 0},set(u,o){return e(u)||(++a.size,n[u]===gt&&--a.empty),n[u]=o,this},delete(u){return e(u)&&(--a.size,++a.empty,n[u]=gt),this},clear(){a.size=a.empty=0,a.object=n={}},test(u){return arguments.length?(r=u,a):r},clean(){let u={},o=0;for(let i in n){let c=n[i];c!==gt&&(!r||!r(c))&&(u[i]=c,++o)}a.size=o,a.empty=0,a.object=n=u}};return t&&Object.keys(t).forEach(u=>{a.set(u,t[u])}),a}function _r(t,n,r,e,a,u){if(!r&&r!==0)return u;let o=+r,i=t[0],c=P(t),l;c<i&&(l=i,i=c,c=l),l=Math.abs(n-i);let h=Math.abs(c-n);return l<h&&l<=o?e:h<=o?a:u}function Wr(t,n,r){let e=t.prototype=Object.create(n.prototype);return Object.defineProperty(e,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),z(e,r)}function Jr(t,n,r,e){let a=n[0],u=n[n.length-1],o;return a>u&&(o=a,a=u,u=o),r=r===void 0||r,e=e===void 0||e,(r?a<=t:a<t)&&(e?t<=u:t<u)}function qr(t){return typeof t=="boolean"}function un(t){return Object.prototype.toString.call(t)==="[object Date]"}function on(t){return t&&B(t[Symbol.iterator])}function sn(t){return typeof t=="number"}function Hr(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function pt(t){return typeof t=="string"}function Gr(t,n,r){t&&(t=n?R(t).map(i=>i.replace(/\\(.)/g,"$1")):R(t));let e=t&&t.length,a=r&&r.get||Qt,u=i=>a(n?[i]:wt(i)),o;if(!e)o=function(){return""};else if(e===1){let i=u(t[0]);o=function(c){return""+i(c)}}else{let i=t.map(u);o=function(c){let l=""+i[0](c),h=0;for(;++h<e;)l+="|"+i[h](c);return l}}return E(o,t,"key")}function Zr(t,n){let r=t[0],e=P(t),a=+n;return a?a===1?e:r+a*(e-r):r}var Vr=1e4;function Qr(t){t=+t||Vr;let n,r,e,a=()=>{n={},r={},e=0},u=(o,i)=>(++e>t&&(r=n,n={},e=1),n[o]=i);return a(),{clear:a,has:o=>N(n,o)||N(r,o),get:o=>N(n,o)?n[o]:N(r,o)?u(o,r[o]):void 0,set:(o,i)=>N(n,o)?n[o]=i:u(o,i)}}function Kr(t,n,r,e){let a=n.length,u=r.length;if(!u)return n;if(!a)return r;let o=e||new n.constructor(a+u),i=0,c=0,l=0;for(;i<a&&c<u;++l)o[l]=t(n[i],r[c])>0?r[c++]:n[i++];for(;i<a;++i,++l)o[l]=n[i];for(;c<u;++c,++l)o[l]=r[c];return o}function H(t,n){let r="";for(;--n>=0;)r+=t;return r}function Xr(t,n,r,e){let a=r||" ",u=t+"",o=n-u.length;return o<=0?u:e==="left"?H(a,o)+u:e==="center"?H(a,~~(o/2))+u+H(a,Math.ceil(o/2)):u+H(a,o)}function ln(t){return t&&P(t)-t[0]||0}function mt(t){return J(t)?`[${t.map(n=>n===null?"null":mt(n))}]`:$(t)||pt(t)?JSON.stringify(t).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):t}function cn(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}var te=t=>sn(t)||un(t)?t:Date.parse(t);function fn(t,n){return n||(n=te),t==null||t===""?null:n(t)}function hn(t){return t==null||t===""?null:t+""}function gn(t){let n={},r=t.length;for(let e=0;e<r;++e)n[t[e]]=!0;return n}function ne(t,n,r,e){let a=e??"\u2026",u=t+"",o=u.length,i=Math.max(0,n-a.length);return o<=n?u:r==="left"?a+u.slice(o-i):r==="center"?u.slice(0,Math.ceil(i/2))+a+u.slice(o-~~(i/2)):u.slice(0,i)+a}function re(t,n,r){if(t)if(n){let e=t.length;for(let a=0;a<e;++a){let u=n(t[a]);u&&r(u,a,t)}}else t.forEach(r)}var pn={},kt={},Ot=34,G=10,Ut=13;function mn(t){return Function("d","return {"+t.map(function(n,r){return JSON.stringify(n)+": d["+r+'] || ""'}).join(",")+"}")}function ee(t,n){var r=mn(t);return function(e,a){return n(r(e),a,t)}}function dn(t){var n=Object.create(null),r=[];return t.forEach(function(e){for(var a in e)a in n||r.push(n[a]=a)}),r}function T(t,n){var r=t+"",e=r.length;return e<n?Array(n-e+1).join(0)+r:r}function ae(t){return t<0?"-"+T(-t,6):t>9999?"+"+T(t,6):T(t,4)}function ue(t){var n=t.getUTCHours(),r=t.getUTCMinutes(),e=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":ae(t.getUTCFullYear(),4)+"-"+T(t.getUTCMonth()+1,2)+"-"+T(t.getUTCDate(),2)+(a?"T"+T(n,2)+":"+T(r,2)+":"+T(e,2)+"."+T(a,3)+"Z":e?"T"+T(n,2)+":"+T(r,2)+":"+T(e,2)+"Z":r||n?"T"+T(n,2)+":"+T(r,2)+"Z":"")}function oe(t){var n=RegExp('["'+t+`
1
+ import{a as Tt,n as _n,r as Wn,s as Jn,t as qn}from"./precisionRound-CU2C3Vxx.js";import{i as _t,n as Hn,r as Gn,t as Zn}from"./defaultLocale-JieDVWC_.js";import{C as Vn,N as Wt,S as Qn,T as Jt,_ as qt,a as Kn,b as it,c as Ht,i as Xn,l as Gt,n as tr,o as nr,p as Zt,r as rr,s as er,t as ar,v as st,w as ur,x as or}from"./defaultLocale-BLne0bXb.js";function E(t,n,r){return t.fields=n||[],t.fname=r,t}function ir(t){return t==null?null:t.fname}function Vt(t){return t==null?null:t.fields}function Qt(t){return t.length===1?sr(t[0]):lr(t)}var sr=t=>function(n){return n[t]},lr=t=>{let n=t.length;return function(r){for(let e=0;e<n;++e)r=r[t[e]];return r}};function v(t){throw Error(t)}function wt(t){let n=[],r=t.length,e=null,a=0,u="",o,i,c;t+="";function l(){n.push(u+t.substring(o,i)),u="",o=i+1}for(o=i=0;i<r;++i)if(c=t[i],c==="\\")u+=t.substring(o,i++),o=i;else if(c===e)l(),e=null,a=-1;else{if(e)continue;o===a&&c==='"'||o===a&&c==="'"?(o=i+1,e=c):c==="."&&!a?i>o?l():o=i+1:c==="["?(i>o&&l(),a=o=i+1):c==="]"&&(a||v("Access path missing open bracket: "+t),a>0&&l(),a=0,o=i+1)}return a&&v("Access path missing closing bracket: "+t),e&&v("Access path missing closing quote: "+t),i>o&&(i++,l()),n}function lt(t,n,r){let e=wt(t);return t=e.length===1?e[0]:t,E((r&&r.get||Qt)(e),[t],n||t)}var cr=lt("id"),W=E(t=>t,[],"identity"),I=E(()=>0,[],"zero"),Kt=E(()=>1,[],"one"),fr=E(()=>!0,[],"true"),hr=E(()=>!1,[],"false"),gr=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(t=>typeof Object.prototype[t]=="function"),"__proto__"]);function pr(t,n,r){let e=[n].concat([].slice.call(r));console[t].apply(console,e)}var mr=0,dr=1,yr=2,vr=3,br=4;function Mr(t,n,r=pr){let e=t||0;return{level(a){return arguments.length?(e=+a,this):e},error(){return e>=1&&r(n||"error","ERROR",arguments),this},warn(){return e>=2&&r(n||"warn","WARN",arguments),this},info(){return e>=3&&r(n||"log","INFO",arguments),this},debug(){return e>=4&&r(n||"log","DEBUG",arguments),this}}}var J=Array.isArray;function $(t){return t===Object(t)}var Xt=t=>t!=="__proto__";function Cr(...t){return t.reduce((n,r)=>{for(let e in r)if(e==="signals")n.signals=Tr(n.signals,r.signals);else{let a=e==="legend"?{layout:1}:e==="style"?!0:null;jt(n,e,r[e],a)}return n},{})}function jt(t,n,r,e){if(!Xt(n))return;let a,u;if($(r)&&!J(r))for(a in u=$(t[n])?t[n]:t[n]={},r)e&&(e===!0||e[a])?jt(u,a,r[a]):Xt(a)&&(u[a]=r[a]);else t[n]=r}function Tr(t,n){if(t==null)return n;let r={},e=[];function a(u){r[u.name]||(r[u.name]=1,e.push(u))}return n.forEach(a),t.forEach(a),e}function P(t){return t[t.length-1]}function q(t){return t==null||t===""?null:+t}var tn=t=>n=>t*Math.exp(n),nn=t=>n=>Math.log(t*n),rn=t=>n=>Math.sign(n)*Math.log1p(Math.abs(n/t)),en=t=>n=>Math.sign(n)*Math.expm1(Math.abs(n))*t,ct=t=>n=>n<0?-((-n)**+t):n**+t;function ft(t,n,r,e){let a=r(t[0]),u=r(P(t)),o=(u-a)*n;return[e(a-o),e(u-o)]}function wr(t,n){return ft(t,n,q,W)}function jr(t,n){var r=Math.sign(t[0]);return ft(t,n,nn(r),tn(r))}function Dr(t,n,r){return ft(t,n,ct(r),ct(1/r))}function kr(t,n,r){return ft(t,n,rn(r),en(r))}function ht(t,n,r,e,a){let u=e(t[0]),o=e(P(t)),i=n==null?(u+o)/2:e(n);return[a(i+(u-i)*r),a(i+(o-i)*r)]}function Or(t,n,r){return ht(t,n,r,q,W)}function Ur(t,n,r){let e=Math.sign(t[0]);return ht(t,n,r,nn(e),tn(e))}function xr(t,n,r,e){return ht(t,n,r,ct(e),ct(1/e))}function Nr(t,n,r,e){return ht(t,n,r,rn(e),en(e))}function Ar(t){return 1+~~(new Date(t).getMonth()/3)}function Er(t){return 1+~~(new Date(t).getUTCMonth()/3)}function R(t){return t==null?[]:J(t)?t:[t]}function Sr(t,n,r){let e=t[0],a=t[1],u;return a<e&&(u=a,a=e,e=u),u=a-e,u>=r-n?[n,r]:[e=Math.min(Math.max(e,n),r-u),e+u]}function B(t){return typeof t=="function"}var Fr="descending";function Pr(t,n,r){r||(r={}),n=R(n)||[];let e=[],a=[],u={},o=r.comparator||zr;return R(t).forEach((i,c)=>{i!=null&&(e.push(n[c]===Fr?-1:1),a.push(i=B(i)?i:lt(i,null,r)),(Vt(i)||[]).forEach(l=>u[l]=1))}),a.length===0?null:E(o(a,e),Object.keys(u))}var Dt=(t,n)=>(t<n||t==null)&&n!=null?-1:(t>n||n==null)&&t!=null?1:(n=n instanceof Date?+n:n,(t=t instanceof Date?+t:t)!==t&&n===n?-1:n!==n&&t===t?1:0),zr=(t,n)=>t.length===1?Yr(t[0],n[0]):Ir(t,n,t.length),Yr=(t,n)=>function(r,e){return Dt(t(r),t(e))*n},Ir=(t,n,r)=>(n.push(0),function(e,a){let u,o=0,i=-1;for(;o===0&&++i<r;)u=t[i],o=Dt(u(e),u(a));return o*n[i]});function an(t){return B(t)?t:()=>t}function $r(t,n){let r;return e=>{r&&clearTimeout(r),r=setTimeout(()=>(n(e),r=null),t)}}function z(t){for(let n,r,e=1,a=arguments.length;e<a;++e)for(r in n=arguments[e],n)t[r]=n[r];return t}function Rr(t,n){let r=0,e,a,u,o;if(t&&(e=t.length))if(n==null){for(a=t[r];r<e&&(a==null||a!==a);a=t[++r]);for(u=o=a;r<e;++r)a=t[r],a!=null&&(a<u&&(u=a),a>o&&(o=a))}else{for(a=n(t[r]);r<e&&(a==null||a!==a);a=n(t[++r]));for(u=o=a;r<e;++r)a=n(t[r]),a!=null&&(a<u&&(u=a),a>o&&(o=a))}return[u,o]}function Br(t,n){let r=t.length,e=-1,a,u,o,i,c;if(n==null){for(;++e<r;)if(u=t[e],u!=null&&u>=u){a=o=u;break}if(e===r)return[-1,-1];for(i=c=e;++e<r;)u=t[e],u!=null&&(a>u&&(a=u,i=e),o<u&&(o=u,c=e))}else{for(;++e<r;)if(u=n(t[e],e,t),u!=null&&u>=u){a=o=u;break}if(e===r)return[-1,-1];for(i=c=e;++e<r;)u=n(t[e],e,t),u!=null&&(a>u&&(a=u,i=e),o<u&&(o=u,c=e))}return[i,c]}function N(t,n){return Object.hasOwn(t,n)}var gt={};function Lr(t){let n={},r;function e(u){return N(n,u)&&n[u]!==gt}let a={size:0,empty:0,object:n,has:e,get(u){return e(u)?n[u]:void 0},set(u,o){return e(u)||(++a.size,n[u]===gt&&--a.empty),n[u]=o,this},delete(u){return e(u)&&(--a.size,++a.empty,n[u]=gt),this},clear(){a.size=a.empty=0,a.object=n={}},test(u){return arguments.length?(r=u,a):r},clean(){let u={},o=0;for(let i in n){let c=n[i];c!==gt&&(!r||!r(c))&&(u[i]=c,++o)}a.size=o,a.empty=0,a.object=n=u}};return t&&Object.keys(t).forEach(u=>{a.set(u,t[u])}),a}function _r(t,n,r,e,a,u){if(!r&&r!==0)return u;let o=+r,i=t[0],c=P(t),l;c<i&&(l=i,i=c,c=l),l=Math.abs(n-i);let h=Math.abs(c-n);return l<h&&l<=o?e:h<=o?a:u}function Wr(t,n,r){let e=t.prototype=Object.create(n.prototype);return Object.defineProperty(e,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),z(e,r)}function Jr(t,n,r,e){let a=n[0],u=n[n.length-1],o;return a>u&&(o=a,a=u,u=o),r=r===void 0||r,e=e===void 0||e,(r?a<=t:a<t)&&(e?t<=u:t<u)}function qr(t){return typeof t=="boolean"}function un(t){return Object.prototype.toString.call(t)==="[object Date]"}function on(t){return t&&B(t[Symbol.iterator])}function sn(t){return typeof t=="number"}function Hr(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function pt(t){return typeof t=="string"}function Gr(t,n,r){t&&(t=n?R(t).map(i=>i.replace(/\\(.)/g,"$1")):R(t));let e=t&&t.length,a=r&&r.get||Qt,u=i=>a(n?[i]:wt(i)),o;if(!e)o=function(){return""};else if(e===1){let i=u(t[0]);o=function(c){return""+i(c)}}else{let i=t.map(u);o=function(c){let l=""+i[0](c),h=0;for(;++h<e;)l+="|"+i[h](c);return l}}return E(o,t,"key")}function Zr(t,n){let r=t[0],e=P(t),a=+n;return a?a===1?e:r+a*(e-r):r}var Vr=1e4;function Qr(t){t=+t||Vr;let n,r,e,a=()=>{n={},r={},e=0},u=(o,i)=>(++e>t&&(r=n,n={},e=1),n[o]=i);return a(),{clear:a,has:o=>N(n,o)||N(r,o),get:o=>N(n,o)?n[o]:N(r,o)?u(o,r[o]):void 0,set:(o,i)=>N(n,o)?n[o]=i:u(o,i)}}function Kr(t,n,r,e){let a=n.length,u=r.length;if(!u)return n;if(!a)return r;let o=e||new n.constructor(a+u),i=0,c=0,l=0;for(;i<a&&c<u;++l)o[l]=t(n[i],r[c])>0?r[c++]:n[i++];for(;i<a;++i,++l)o[l]=n[i];for(;c<u;++c,++l)o[l]=r[c];return o}function H(t,n){let r="";for(;--n>=0;)r+=t;return r}function Xr(t,n,r,e){let a=r||" ",u=t+"",o=n-u.length;return o<=0?u:e==="left"?H(a,o)+u:e==="center"?H(a,~~(o/2))+u+H(a,Math.ceil(o/2)):u+H(a,o)}function ln(t){return t&&P(t)-t[0]||0}function mt(t){return J(t)?`[${t.map(n=>n===null?"null":mt(n))}]`:$(t)||pt(t)?JSON.stringify(t).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):t}function cn(t){return t==null||t===""?null:!t||t==="false"||t==="0"?!1:!!t}var te=t=>sn(t)||un(t)?t:Date.parse(t);function fn(t,n){return n||(n=te),t==null||t===""?null:n(t)}function hn(t){return t==null||t===""?null:t+""}function gn(t){let n={},r=t.length;for(let e=0;e<r;++e)n[t[e]]=!0;return n}function ne(t,n,r,e){let a=e??"\u2026",u=t+"",o=u.length,i=Math.max(0,n-a.length);return o<=n?u:r==="left"?a+u.slice(o-i):r==="center"?u.slice(0,Math.ceil(i/2))+a+u.slice(o-~~(i/2)):u.slice(0,i)+a}function re(t,n,r){if(t)if(n){let e=t.length;for(let a=0;a<e;++a){let u=n(t[a]);u&&r(u,a,t)}}else t.forEach(r)}var pn={},kt={},Ot=34,G=10,Ut=13;function mn(t){return Function("d","return {"+t.map(function(n,r){return JSON.stringify(n)+": d["+r+'] || ""'}).join(",")+"}")}function ee(t,n){var r=mn(t);return function(e,a){return n(r(e),a,t)}}function dn(t){var n=Object.create(null),r=[];return t.forEach(function(e){for(var a in e)a in n||r.push(n[a]=a)}),r}function T(t,n){var r=t+"",e=r.length;return e<n?Array(n-e+1).join(0)+r:r}function ae(t){return t<0?"-"+T(-t,6):t>9999?"+"+T(t,6):T(t,4)}function ue(t){var n=t.getUTCHours(),r=t.getUTCMinutes(),e=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":ae(t.getUTCFullYear(),4)+"-"+T(t.getUTCMonth()+1,2)+"-"+T(t.getUTCDate(),2)+(a?"T"+T(n,2)+":"+T(r,2)+":"+T(e,2)+"."+T(a,3)+"Z":e?"T"+T(n,2)+":"+T(r,2)+":"+T(e,2)+"Z":r||n?"T"+T(n,2)+":"+T(r,2)+"Z":"")}function oe(t){var n=RegExp('["'+t+`
2
2
  \r]`),r=t.charCodeAt(0);function e(s,f){var g,p,m=a(s,function(d,C){if(g)return g(d,C-1);p=d,g=f?ee(d,f):mn(d)});return m.columns=p||[],m}function a(s,f){var g=[],p=s.length,m=0,d=0,C,x=p<=0,j=!1;s.charCodeAt(p-1)===G&&--p,s.charCodeAt(p-1)===Ut&&--p;function y(){if(x)return kt;if(j)return j=!1,pn;var ut,ot=m,_;if(s.charCodeAt(ot)===Ot){for(;m++<p&&s.charCodeAt(m)!==Ot||s.charCodeAt(++m)===Ot;);return(ut=m)>=p?x=!0:(_=s.charCodeAt(m++))===G?j=!0:_===Ut&&(j=!0,s.charCodeAt(m)===G&&++m),s.slice(ot+1,ut-1).replace(/""/g,'"')}for(;m<p;){if((_=s.charCodeAt(ut=m++))===G)j=!0;else if(_===Ut)j=!0,s.charCodeAt(m)===G&&++m;else if(_!==r)continue;return s.slice(ot,ut)}return x=!0,s.slice(ot,p)}for(;(C=y())!==kt;){for(var at=[];C!==pn&&C!==kt;)at.push(C),C=y();f&&(at=f(at,d++))==null||g.push(at)}return g}function u(s,f){return s.map(function(g){return f.map(function(p){return h(g[p])}).join(t)})}function o(s,f){return f??(f=dn(s)),[f.map(h).join(t)].concat(u(s,f)).join(`
3
3
  `)}function i(s,f){return f??(f=dn(s)),u(s,f).join(`
4
4
  `)}function c(s){return s.map(l).join(`