@marimo-team/islands 0.19.12-dev1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/Combination-Du-o_hC9.js +11897 -0
  2. package/dist/{ConnectedDataExplorerComponent-CkXO-pKy.js → ConnectedDataExplorerComponent-BMiGWK57.js} +19 -18
  3. package/dist/{_baseIsEqual-CBSjxu-D.js → _baseIsEqual-DN5YkPnl.js} +1 -1
  4. package/dist/{_baseProperty-BVGrW_NZ.js → _baseProperty-6juuyX7Z.js} +5 -5
  5. package/dist/{_baseUniq-4lqa8rDi.js → _baseUniq-BlF21ach.js} +1 -1
  6. package/dist/{any-language-editor-t_VsTNa-.js → any-language-editor-1OMbohwD.js} +19 -19
  7. package/dist/architecture-U656AL7Q-Jd2CvPgJ.js +6 -0
  8. package/dist/{architectureDiagram-VXUJARFQ-DmJQhcJb.js → architectureDiagram-VXUJARFQ-DhN0C3Xf.js} +15 -15
  9. package/dist/{blockDiagram-VD42YOAC-CRofISJs.js → blockDiagram-VD42YOAC-DrBkIcbV.js} +7 -7
  10. package/dist/{button-Cy0ElmIm.js → button-KYalaJYu.js} +783 -200
  11. package/dist/{c4Diagram-YG6GDRKO-Deqoag4I.js → c4Diagram-YG6GDRKO-pWt4zmu0.js} +4 -4
  12. package/dist/{channel-CMsnebrL.js → channel-C56Jz8EL.js} +1 -1
  13. package/dist/{check-DkNR52Mm.js → check-C50jsehH.js} +1 -1
  14. package/dist/{chunk-76Q3JFCE-jPuajZH_.js → chunk-76Q3JFCE-CQ6a2yGJ.js} +1 -1
  15. package/dist/{chunk-ABZYJK2D-BGWvKte3.js → chunk-ABZYJK2D-BwNsaa1P.js} +1 -1
  16. package/dist/{chunk-ATLVNIR6-BYZB6C5T.js → chunk-ATLVNIR6-DtFMAawc.js} +1 -1
  17. package/dist/{chunk-B4BG7PRW-CwYUp6Uj.js → chunk-B4BG7PRW-lfWcLlzS.js} +4 -4
  18. package/dist/{chunk-DI55MBZ5-Gyro6dvN.js → chunk-DI55MBZ5-RhhAimfG.js} +4 -4
  19. package/dist/{chunk-EXTU4WIE-BlA7aWEw.js → chunk-EXTU4WIE-Bmo660a9.js} +1 -1
  20. package/dist/{chunk-FPAJGGOC-CduL34ft.js → chunk-FPAJGGOC-quWdfNUB.js} +7 -7
  21. package/dist/{chunk-FWNWRKHM-C-2TI4gt.js → chunk-FWNWRKHM-DmrwhAQr.js} +1 -1
  22. package/dist/{chunk-JA3XYJ7Z-Cm-pccR-.js → chunk-JA3XYJ7Z-n8UTzfok.js} +2 -2
  23. package/dist/{chunk-JZLCHNYA-CoLqqXMe.js → chunk-JZLCHNYA-ChKqHUdB.js} +4 -4
  24. package/dist/{chunk-LBM3YZW2-DWgQiioW.js → chunk-LBM3YZW2-BkxsqkNK.js} +1 -1
  25. package/dist/{chunk-LHMN2FUI-Dj_AHSvI.js → chunk-LHMN2FUI-CgYPnxfN.js} +1 -1
  26. package/dist/{chunk-N4CR4FBY-ByLbY9L-.js → chunk-N4CR4FBY-BxOHGL3P.js} +5 -5
  27. package/dist/{chunk-O7ZBX7Z2-CRZ8i1rP.js → chunk-O7ZBX7Z2-CdpLwOP0.js} +1 -1
  28. package/dist/{chunk-QN33PNHL-eodIiY9F.js → chunk-QN33PNHL-Dda-55xY.js} +1 -1
  29. package/dist/{chunk-QXUST7PY-CuJlDW6A.js → chunk-QXUST7PY-ClIEpoCT.js} +5 -5
  30. package/dist/{chunk-S3R3BYOJ-CwDGYMVf.js → chunk-S3R3BYOJ-C_1SJcWo.js} +3 -3
  31. package/dist/{chunk-S6J4BHB3-DNVMr0_v.js → chunk-S6J4BHB3-zfWjyfUg.js} +1 -1
  32. package/dist/{chunk-T53DSG4Q-BFWkpOX5.js → chunk-T53DSG4Q-Bewz1tiU.js} +1 -1
  33. package/dist/{chunk-TZMSLE5B-DFDr5FCr.js → chunk-TZMSLE5B-XW3duOft.js} +1 -1
  34. package/dist/{classDiagram-2ON5EDUG-BDBX9etk.js → classDiagram-2ON5EDUG-CUJlS_eo.js} +10 -10
  35. package/dist/{classDiagram-v2-WZHVMYZB-Bzj_L_BF.js → classDiagram-v2-WZHVMYZB-BhSPpbkE.js} +10 -10
  36. package/dist/{clone-Cc_6PW77.js → clone-V9hndNcj.js} +1 -1
  37. package/dist/{constants-DrOu5vvd.js → constants-BGRTDzdW.js} +2 -2
  38. package/dist/{copy-DRaXIb_a.js → copy-oc-FcZzt.js} +2 -2
  39. package/dist/{dagre-6UL2VRFP-r2rSdJYL.js → dagre-6UL2VRFP-BArPH353.js} +11 -11
  40. package/dist/{dagre-D2F8UdM6.js → dagre-Dcgyn_Uy.js} +15 -15
  41. package/dist/{diagram-PSM6KHXK-BpxVUe9U.js → diagram-PSM6KHXK-B1xAkr9y.js} +16 -16
  42. package/dist/{diagram-QEK2KX5R-q3dHUcp6.js → diagram-QEK2KX5R-CaoqwzPb.js} +14 -14
  43. package/dist/{diagram-S2PKOQOG-MDBKrxSC.js → diagram-S2PKOQOG-NXCsFLvR.js} +14 -14
  44. package/dist/dist-B8Y11RWn.js +1381 -0
  45. package/dist/dist-BA-HK7pI.js +5 -0
  46. package/dist/dist-BD5GU948.js +5 -0
  47. package/dist/{dist-BfactX3G.js → dist-BGzkWRSl.js} +4 -4
  48. package/dist/dist-BIYmAsND.js +5 -0
  49. package/dist/{dist-CmZYrgd_.js → dist-BUEi7EKT.js} +1 -1
  50. package/dist/{dist-B94MxrQS.js → dist-B_i29Q6L.js} +2 -2
  51. package/dist/dist-BcKTJXJi.js +5 -0
  52. package/dist/dist-BgnrtcWg.js +8 -0
  53. package/dist/{dist-glA_fIK_.js → dist-BoagoQQw.js} +2 -2
  54. package/dist/{dist-C2-m5aEk.js → dist-BswsDM4k.js} +2 -2
  55. package/dist/dist-C1njTlBq.js +5 -0
  56. package/dist/{dist-B2-r9y-0.js → dist-C5QB1NtD.js} +3 -3
  57. package/dist/{dist-Crk9ejOy.js → dist-CD7uLx0M.js} +2 -2
  58. package/dist/{dist-B4tYJP_i.js → dist-CMOy93xY.js} +2 -2
  59. package/dist/dist-CSKHwJYH.js +5 -0
  60. package/dist/dist-CSKKyiIq.js +5 -0
  61. package/dist/{dist-iiugPhCC.js → dist-C_9IMrtt.js} +1 -1
  62. package/dist/{dist-CE43BRmt.js → dist-Cb3iqED3.js} +1 -1
  63. package/dist/{dist-Dit9tk8a.js → dist-CoZ8kKKW.js} +1 -1
  64. package/dist/{dist-B5ATpkxy.js → dist-CrAYcS_4.js} +2 -2
  65. package/dist/dist-CrQ_pOuK.js +6 -0
  66. package/dist/dist-Cskx1daf.js +5 -0
  67. package/dist/dist-D4i0Ef34.js +8 -0
  68. package/dist/{dist-T4g7Sr6e.js → dist-D8EhXZ4S.js} +3 -3
  69. package/dist/{dist-CJrHMxlI.js → dist-DOLQQtWK.js} +3 -3
  70. package/dist/dist-DOcn61TX.js +8 -0
  71. package/dist/{dist-DqJdzAYM.js → dist-Dmr_nXF6.js} +2 -2
  72. package/dist/{dist-yVJ4xE5n.js → dist-DpAbrLuF.js} +5 -5
  73. package/dist/{dist-CcOGT46m.js → dist-DrC0QKFK.js} +1 -1
  74. package/dist/{dist-BYmtF1W6.js → dist-Dv2Phbh5.js} +2 -2
  75. package/dist/dist-DwMejAPB.js +6 -0
  76. package/dist/dist-DzSe1wby.js +8 -0
  77. package/dist/{dist-BbBnU4tG.js → dist-EZFqUJhh.js} +1 -1
  78. package/dist/{dist-Cgf353Ki.js → dist-Ey9hP8-j.js} +1 -1
  79. package/dist/{dist-BLwfpZD-.js → dist-IlWGXVjO.js} +2 -2
  80. package/dist/{dist-DOil6y-3.js → dist-LNp8svLl.js} +4 -4
  81. package/dist/{dist-CPTE45iS.js → dist-W6TdeACj.js} +1 -1
  82. package/dist/{dist-Dc1SFk5I.js → dist-a6Obzr07.js} +2 -2
  83. package/dist/{dist-Bsv_ARko.js → dist-bz6WguLy.js} +2 -2
  84. package/dist/{dist-CC9VUnXd.js → dist-iDeoXzdN.js} +1 -1
  85. package/dist/{dist-BoAHOW2l.js → dist-iyBCcLRa.js} +2 -2
  86. package/dist/{dist-CkEUrAus.js → dist-xCB683Dh.js} +2 -2
  87. package/dist/{erDiagram-Q2GNP2WA-CX1XdqVD.js → erDiagram-Q2GNP2WA-DWCa11g5.js} +10 -10
  88. package/dist/error-banner-vCG-EbUQ.js +619 -0
  89. package/dist/{esm-BAS2d2Ad.js → esm-DZSk8vt3.js} +27 -27
  90. package/dist/{flatten-eGRGXrC3.js → flatten-CWZjF1fc.js} +1 -1
  91. package/dist/{flowDiagram-NV44I4VS-BCj-ONTw.js → flowDiagram-NV44I4VS-BQ5PQs4L.js} +10 -10
  92. package/dist/{ganttDiagram-JELNMOA3-D1l5ewiQ.js → ganttDiagram-JELNMOA3-NTOuNWeT.js} +3 -3
  93. package/dist/{gitGraph-F6HP7TQM-CDM3aU-T.js → gitGraph-F6HP7TQM-DfRNsaDw.js} +3 -3
  94. package/dist/{gitGraphDiagram-NY62KEGX-KdZh0iiW.js → gitGraphDiagram-NY62KEGX-CYke62Ot.js} +13 -13
  95. package/dist/{glide-data-editor-2RvcPqmc.js → glide-data-editor-DttqGjrT.js} +571 -572
  96. package/dist/{graphlib-7UgfJadv.js → graphlib-CwMnCnQ9.js} +8 -8
  97. package/dist/{info-NVLQJR56-CoL1x1Fy.js → info-NVLQJR56-CUaoPtis.js} +3 -3
  98. package/dist/{infoDiagram-WHAUD3N6-PSH7lQ0D.js → infoDiagram-WHAUD3N6-B42WjAPh.js} +13 -13
  99. package/dist/{isEmpty-DQXRKNtW.js → isEmpty-6z2uv6gM.js} +2 -2
  100. package/dist/{isString-Clqvtgmo.js → isString-D6abkXrl.js} +1 -1
  101. package/dist/{isSymbol-TWXhTa8k.js → isSymbol-hk7foJ70.js} +1 -1
  102. package/dist/{journeyDiagram-XKPGCS4Q-BrTAxQ1J.js → journeyDiagram-XKPGCS4Q-ahXD97kr.js} +3 -3
  103. package/dist/{kanban-definition-3W4ZIXB7-BoYCDp_9.js → kanban-definition-3W4ZIXB7-CiTIpnhy.js} +7 -7
  104. package/dist/{label-CxU5JNBW.js → label-Cc5tEavt.js} +250 -250
  105. package/dist/{loader-C0-eIoas.js → loader-Cob3XFOw.js} +2 -2
  106. package/dist/main.js +1791 -1056
  107. package/dist/{memoize-Bag7B41I.js → memoize-Ckyqzyu_.js} +1 -1
  108. package/dist/{merge-Dl1bfxsj.js → merge-Db4Uulx4.js} +1 -1
  109. package/dist/{mermaid-C2cSe5YL.js → mermaid-B5xl_2hx.js} +73 -62
  110. package/dist/{mermaid-parser.core-D20zFbMa.js → mermaid-parser.core-BXj7Il0J.js} +8 -8
  111. package/dist/{min-Bg4bqmiD.js → min-ypdVXicC.js} +4 -4
  112. package/dist/{mindmap-definition-VGOIOE7T-CmRjsKEt.js → mindmap-definition-VGOIOE7T-Mni766A_.js} +9 -9
  113. package/dist/{now-mivqkCIv.js → now-Dwu5ou19.js} +2 -2
  114. package/dist/{once-BqS42WgZ.js → once-C9dA9qgQ.js} +1 -1
  115. package/dist/{packet-BFZMPI3H-C6aZmgV-.js → packet-BFZMPI3H-DHtQCusE.js} +3 -3
  116. package/dist/{pie-7BOR55EZ-NB6xYwcB.js → pie-7BOR55EZ-2sVLYbpR.js} +3 -3
  117. package/dist/{pieDiagram-ADFJNKIX-CtxQlnsU.js → pieDiagram-ADFJNKIX-PbXpgT8_.js} +14 -14
  118. package/dist/{quadrantDiagram-AYHSOK5B-DllnB2Hl.js → quadrantDiagram-AYHSOK5B-BtXGnx8i.js} +2 -2
  119. package/dist/{radar-NHE76QYJ-RKhErikV.js → radar-NHE76QYJ-Be0pEUux.js} +3 -3
  120. package/dist/{range-LoQMRQIX.js → range-D9jxVFd_.js} +5 -5
  121. package/dist/{reduce-B9mZDxPo.js → reduce-C6NEPj6s.js} +4 -4
  122. package/dist/{requirementDiagram-UZGBJVZJ-D36MI1k0.js → requirementDiagram-UZGBJVZJ-DxzXQRgq.js} +9 -9
  123. package/dist/{sankeyDiagram-TZEHDZUN-D1mygNPC.js → sankeyDiagram-TZEHDZUN-D-I7dJ0_.js} +2 -2
  124. package/dist/{sequenceDiagram-WL72ISMW-CWdn91Rf.js → sequenceDiagram-WL72ISMW-VDme2ljw.js} +4 -4
  125. package/dist/{slides-component-DfwLApNr.js → slides-component-ql7-5GDI.js} +2 -2
  126. package/dist/{spec-HoYHAQo2.js → spec-GwhMEXwK.js} +8 -9
  127. package/dist/{stateDiagram-FKZM4ZOC-CPxroWXd.js → stateDiagram-FKZM4ZOC-g3GI1EcK.js} +12 -12
  128. package/dist/{stateDiagram-v2-4FDKWEC3-BpM9Q54b.js → stateDiagram-v2-4FDKWEC3-7i6jBXe6.js} +10 -10
  129. package/dist/stex-D2rme5UG.js +4 -0
  130. package/dist/style.css +1 -1
  131. package/dist/{timeline-definition-IT6M3QCI-CVnRHx_t.js → timeline-definition-IT6M3QCI-bhvLlX_b.js} +2 -2
  132. package/dist/{toString-C4TLO6FA.js → toString-BwTJvlyD.js} +2 -2
  133. package/dist/tooltip-CL8m4f9y.js +404 -0
  134. package/dist/{treemap-KMMF4GRG-B37ugcLd.js → treemap-KMMF4GRG-Ba9ifjpG.js} +3 -3
  135. package/dist/{types-Ckva8JJq.js → types-Dsh6yC4B.js} +412 -413
  136. package/dist/{useAsyncData-dr8GazGv.js → useAsyncData-BPpyKjTJ.js} +2 -2
  137. package/dist/{useDeepCompareMemoize-ChviuF5n.js → useDeepCompareMemoize-C8Ms87P-.js} +18 -19
  138. package/dist/{useIframeCapabilities-DurI5SJh.js → useIframeCapabilities-C7z8VrZ1.js} +2 -2
  139. package/dist/{useTheme-SlKl8MlS.js → useTheme-Cq-gIssy.js} +299 -300
  140. package/dist/{vega-component-CnG0vAjf.js → vega-component-B5sxdjMq.js} +10 -10
  141. package/dist/{xychartDiagram-PRI3JC2R-BltwMWKC.js → xychartDiagram-PRI3JC2R-CFxuifYY.js} +5 -5
  142. package/package.json +1 -1
  143. package/src/components/editor/Output.tsx +8 -6
  144. package/src/components/editor/__tests__/Output.test.tsx +59 -0
  145. package/src/components/editor/chrome/__tests__/state.test.ts +321 -0
  146. package/src/components/editor/chrome/state.ts +27 -2
  147. package/src/components/editor/file-tree/upload.tsx +46 -23
  148. package/src/components/editor/links/cell-link.tsx +3 -2
  149. package/src/components/editor/output/console/ConsoleOutput.tsx +13 -3
  150. package/src/components/pages/gallery-page.tsx +1 -1
  151. package/src/components/pages/home-page.tsx +5 -3
  152. package/src/components/tracing/tracing.tsx +50 -39
  153. package/src/core/documentation/DocHoverTarget.tsx +23 -0
  154. package/src/core/documentation/doc-lookup.ts +50 -0
  155. package/src/core/islands/main.ts +1 -0
  156. package/src/core/websocket/useMarimoKernelConnection.tsx +3 -0
  157. package/src/css/app/Cell.css +5 -0
  158. package/src/mount.tsx +2 -2
  159. package/src/plugins/core/RenderHTML.tsx +15 -0
  160. package/src/plugins/core/__test__/registerReactComponent.test.ts +204 -0
  161. package/src/plugins/core/registerReactComponent.tsx +33 -0
  162. package/src/plugins/impl/MatrixPlugin.tsx +275 -0
  163. package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +415 -0
  164. package/src/plugins/impl/anywidget/model.ts +1 -2
  165. package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +70 -0
  166. package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +152 -0
  167. package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +781 -0
  168. package/src/plugins/impl/matrix.css +45 -0
  169. package/src/plugins/layout/mermaid/mermaid.tsx +11 -3
  170. package/src/plugins/plugins.ts +4 -0
  171. package/src/utils/__tests__/download.test.tsx +47 -0
  172. package/src/utils/download.ts +13 -1
  173. package/src/utils/links.ts +1 -1
  174. package/src/utils/urls.ts +1 -1
  175. package/dist/Combination-BTMrlhzT.js +0 -2611
  176. package/dist/architecture-U656AL7Q-COfwZju8.js +0 -6
  177. package/dist/dist-4YNZxwMI.js +0 -8
  178. package/dist/dist-7nR3r2kG.js +0 -5
  179. package/dist/dist-B2gkyT3r.js +0 -5
  180. package/dist/dist-B8G3I6vJ.js +0 -8
  181. package/dist/dist-BJ96Ykfp.js +0 -8
  182. package/dist/dist-BKLIWGw4.js +0 -5
  183. package/dist/dist-Bf3ou00A.js +0 -6
  184. package/dist/dist-BvkKXuPm.js +0 -5
  185. package/dist/dist-C6NJ3n6r.js +0 -5
  186. package/dist/dist-CecLPYY5.js +0 -5
  187. package/dist/dist-Ch0SwRzK.js +0 -5
  188. package/dist/dist-D6eWHiFh.js +0 -6
  189. package/dist/dist-DCQ710Bv.js +0 -5
  190. package/dist/dist-P_pkS5f-.js +0 -8
  191. package/dist/error-banner-D2zjeN_a.js +0 -1015
  192. package/dist/hotkeys-B5WnGZXF.js +0 -587
  193. package/dist/stex-ChDHQs3R.js +0 -4
  194. package/dist/zod-bjADtMKr.js +0 -10663
  195. /package/dist/{_arrayReduce-DlK7U3Q6.js → _arrayReduce-REKcIEj3.js} +0 -0
  196. /package/dist/{_baseFor-DSVmVciX.js → _baseFor-B69PDbIz.js} +0 -0
  197. /package/dist/{_hasUnicode-Bz2x6u6r.js → _hasUnicode-DrSAc5A5.js} +0 -0
  198. /package/dist/{dist-r8ecBV-v.js → dist-CUOuFgHt.js} +0 -0
  199. /package/dist/{invariant-D9QLJ4SZ.js → invariant-D-K49MfV.js} +0 -0
  200. /package/dist/{main-DhFbkwoC.js → main-DmxVpB19.js} +0 -0
  201. /package/dist/{purify.es-Brw-U87Q.js → purify.es-D4vaFt5N.js} +0 -0
  202. /package/dist/{stex-DrxP7bb3.js → stex-DIvyJfNO.js} +0 -0
@@ -1,1015 +0,0 @@
1
- import { s as __toESM } from "./chunk-BNovOVIE.js";
2
- import { t as require_react } from "./react-Bs6Z0kvn.js";
3
- import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { A as createContext2, E as Primitive, M as composeEventHandlers, O as createSlot, S as useId, _ as Arrow, b as createPopperScope, c as withSmartCollisionBoundary, d as Root$1, g as Anchor, h as Portal, i as useFocusGuards, j as createContextScope, k as createSlottable, m as Presence, n as hideOthers, p as useControllableState, r as FocusScope, s as withFullScreenAsRoot, t as Combination_default, u as StyleNamespace, v as Content$1, w as DismissableLayer, y as Root2$1 } from "./Combination-BTMrlhzT.js";
5
- import { a as cva, c as useComposedRefs, n as buttonVariants, u as cn } from "./button-Cy0ElmIm.js";
6
- import { s as Logger } from "./hotkeys-B5WnGZXF.js";
7
- import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
8
- import { P as object, R as string } from "./zod-bjADtMKr.js";
9
- var import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1), [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [createPopperScope]), usePopperScope = createPopperScope(), PROVIDER_NAME = "TooltipProvider", DEFAULT_DELAY_DURATION = 700, TOOLTIP_OPEN = "tooltip.open", [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME), TooltipProvider$1 = (t) => {
10
- let { __scopeTooltip: j, delayDuration: M = DEFAULT_DELAY_DURATION, skipDelayDuration: N = 300, disableHoverableContent: P = false, children: F } = t, I = import_react.useRef(true), L = import_react.useRef(false), R = import_react.useRef(0);
11
- return import_react.useEffect(() => {
12
- let t2 = R.current;
13
- return () => window.clearTimeout(t2);
14
- }, []), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipProviderContextProvider, {
15
- scope: j,
16
- isOpenDelayedRef: I,
17
- delayDuration: M,
18
- onOpen: import_react.useCallback(() => {
19
- window.clearTimeout(R.current), I.current = false;
20
- }, []),
21
- onClose: import_react.useCallback(() => {
22
- window.clearTimeout(R.current), R.current = window.setTimeout(() => I.current = true, N);
23
- }, [N]),
24
- isPointerInTransitRef: L,
25
- onPointerInTransitChange: import_react.useCallback((t2) => {
26
- L.current = t2;
27
- }, []),
28
- disableHoverableContent: P,
29
- children: F
30
- });
31
- };
32
- TooltipProvider$1.displayName = PROVIDER_NAME;
33
- var TOOLTIP_NAME = "Tooltip", [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME), Tooltip$1 = (t) => {
34
- let { __scopeTooltip: j, children: M, open: N, defaultOpen: P, onOpenChange: F, disableHoverableContent: I, delayDuration: R } = t, z = useTooltipProviderContext(TOOLTIP_NAME, t.__scopeTooltip), B = usePopperScope(j), [V, H] = import_react.useState(null), U = useId(), W = import_react.useRef(0), G = I ?? z.disableHoverableContent, K = R ?? z.delayDuration, q = import_react.useRef(false), [J, Y] = useControllableState({
35
- prop: N,
36
- defaultProp: P ?? false,
37
- onChange: (t2) => {
38
- t2 ? (z.onOpen(), document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN))) : z.onClose(), F == null ? void 0 : F(t2);
39
- },
40
- caller: TOOLTIP_NAME
41
- }), X = import_react.useMemo(() => J ? q.current ? "delayed-open" : "instant-open" : "closed", [J]), Z = import_react.useCallback(() => {
42
- window.clearTimeout(W.current), W.current = 0, q.current = false, Y(true);
43
- }, [Y]), Q = import_react.useCallback(() => {
44
- window.clearTimeout(W.current), W.current = 0, Y(false);
45
- }, [Y]), $ = import_react.useCallback(() => {
46
- window.clearTimeout(W.current), W.current = window.setTimeout(() => {
47
- q.current = true, Y(true), W.current = 0;
48
- }, K);
49
- }, [K, Y]);
50
- return import_react.useEffect(() => () => {
51
- W.current && (W.current = (window.clearTimeout(W.current), 0));
52
- }, []), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$1, {
53
- ...B,
54
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContextProvider, {
55
- scope: j,
56
- contentId: U,
57
- open: J,
58
- stateAttribute: X,
59
- trigger: V,
60
- onTriggerChange: H,
61
- onTriggerEnter: import_react.useCallback(() => {
62
- z.isOpenDelayedRef.current ? $() : Z();
63
- }, [
64
- z.isOpenDelayedRef,
65
- $,
66
- Z
67
- ]),
68
- onTriggerLeave: import_react.useCallback(() => {
69
- G ? Q() : (window.clearTimeout(W.current), W.current = 0);
70
- }, [Q, G]),
71
- onOpen: Z,
72
- onClose: Q,
73
- disableHoverableContent: G,
74
- children: M
75
- })
76
- });
77
- };
78
- Tooltip$1.displayName = TOOLTIP_NAME;
79
- var TRIGGER_NAME$2 = "TooltipTrigger", TooltipTrigger$1 = import_react.forwardRef((t, j) => {
80
- let { __scopeTooltip: M, ...N } = t, I = useTooltipContext(TRIGGER_NAME$2, M), L = useTooltipProviderContext(TRIGGER_NAME$2, M), R = usePopperScope(M), z = useComposedRefs(j, import_react.useRef(null), I.onTriggerChange), B = import_react.useRef(false), V = import_react.useRef(false), U = import_react.useCallback(() => B.current = false, []);
81
- return import_react.useEffect(() => () => document.removeEventListener("pointerup", U), [U]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Anchor, {
82
- asChild: true,
83
- ...R,
84
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
85
- "aria-describedby": I.open ? I.contentId : void 0,
86
- "data-state": I.stateAttribute,
87
- ...N,
88
- ref: z,
89
- onPointerMove: composeEventHandlers(t.onPointerMove, (t2) => {
90
- t2.pointerType !== "touch" && !V.current && !L.isPointerInTransitRef.current && (I.onTriggerEnter(), V.current = true);
91
- }),
92
- onPointerLeave: composeEventHandlers(t.onPointerLeave, () => {
93
- I.onTriggerLeave(), V.current = false;
94
- }),
95
- onPointerDown: composeEventHandlers(t.onPointerDown, () => {
96
- I.open && I.onClose(), B.current = true, document.addEventListener("pointerup", U, { once: true });
97
- }),
98
- onFocus: composeEventHandlers(t.onFocus, () => {
99
- B.current || I.onOpen();
100
- }),
101
- onBlur: composeEventHandlers(t.onBlur, I.onClose),
102
- onClick: composeEventHandlers(t.onClick, I.onClose)
103
- })
104
- });
105
- });
106
- TooltipTrigger$1.displayName = TRIGGER_NAME$2;
107
- var PORTAL_NAME$2 = "TooltipPortal", [PortalProvider$1, usePortalContext$1] = createTooltipContext(PORTAL_NAME$2, { forceMount: void 0 }), TooltipPortal$1 = (t) => {
108
- let { __scopeTooltip: j, forceMount: M, children: N, container: P } = t, F = useTooltipContext(PORTAL_NAME$2, j);
109
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider$1, {
110
- scope: j,
111
- forceMount: M,
112
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
113
- present: M || F.open,
114
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
115
- asChild: true,
116
- container: P,
117
- children: N
118
- })
119
- })
120
- });
121
- };
122
- TooltipPortal$1.displayName = PORTAL_NAME$2;
123
- var CONTENT_NAME$2 = "TooltipContent", TooltipContent$1 = import_react.forwardRef((t, j) => {
124
- let M = usePortalContext$1(CONTENT_NAME$2, t.__scopeTooltip), { forceMount: N = M.forceMount, side: P = "top", ...F } = t, I = useTooltipContext(CONTENT_NAME$2, t.__scopeTooltip);
125
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
126
- present: N || I.open,
127
- children: I.disableHoverableContent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContentImpl, {
128
- side: P,
129
- ...F,
130
- ref: j
131
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContentHoverable, {
132
- side: P,
133
- ...F,
134
- ref: j
135
- })
136
- });
137
- }), TooltipContentHoverable = import_react.forwardRef((t, j) => {
138
- let M = useTooltipContext(CONTENT_NAME$2, t.__scopeTooltip), N = useTooltipProviderContext(CONTENT_NAME$2, t.__scopeTooltip), P = import_react.useRef(null), F = useComposedRefs(j, P), [I, L] = import_react.useState(null), { trigger: R, onClose: z } = M, B = P.current, { onPointerInTransitChange: V } = N, H = import_react.useCallback(() => {
139
- L(null), V(false);
140
- }, [V]), U = import_react.useCallback((t2, j2) => {
141
- let M2 = t2.currentTarget, N2 = {
142
- x: t2.clientX,
143
- y: t2.clientY
144
- }, P2 = getPaddedExitPoints(N2, getExitSideFromRect(N2, M2.getBoundingClientRect())), F2 = getPointsFromRect(j2.getBoundingClientRect());
145
- L(getHull([...P2, ...F2])), V(true);
146
- }, [V]);
147
- return import_react.useEffect(() => () => H(), [H]), import_react.useEffect(() => {
148
- if (R && B) {
149
- let t2 = (t3) => U(t3, B), j2 = (t3) => U(t3, R);
150
- return R.addEventListener("pointerleave", t2), B.addEventListener("pointerleave", j2), () => {
151
- R.removeEventListener("pointerleave", t2), B.removeEventListener("pointerleave", j2);
152
- };
153
- }
154
- }, [
155
- R,
156
- B,
157
- U,
158
- H
159
- ]), import_react.useEffect(() => {
160
- if (I) {
161
- let t2 = (t3) => {
162
- let j2 = t3.target, M2 = {
163
- x: t3.clientX,
164
- y: t3.clientY
165
- }, N2 = (R == null ? void 0 : R.contains(j2)) || (B == null ? void 0 : B.contains(j2)), P2 = !isPointInPolygon(M2, I);
166
- N2 ? H() : P2 && (H(), z());
167
- };
168
- return document.addEventListener("pointermove", t2), () => document.removeEventListener("pointermove", t2);
169
- }
170
- }, [
171
- R,
172
- B,
173
- I,
174
- z,
175
- H
176
- ]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContentImpl, {
177
- ...t,
178
- ref: F
179
- });
180
- }), [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false }), Slottable$1 = createSlottable("TooltipContent"), TooltipContentImpl = import_react.forwardRef((t, j) => {
181
- let { __scopeTooltip: M, children: N, "aria-label": P, onEscapeKeyDown: F, onPointerDownOutside: I, ...L } = t, R = useTooltipContext(CONTENT_NAME$2, M), z = usePopperScope(M), { onClose: B } = R;
182
- return import_react.useEffect(() => (document.addEventListener(TOOLTIP_OPEN, B), () => document.removeEventListener(TOOLTIP_OPEN, B)), [B]), import_react.useEffect(() => {
183
- if (R.trigger) {
184
- let t2 = (t3) => {
185
- var _a;
186
- ((_a = t3.target) == null ? void 0 : _a.contains(R.trigger)) && B();
187
- };
188
- return window.addEventListener("scroll", t2, { capture: true }), () => window.removeEventListener("scroll", t2, { capture: true });
189
- }
190
- }, [R.trigger, B]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
191
- asChild: true,
192
- disableOutsidePointerEvents: false,
193
- onEscapeKeyDown: F,
194
- onPointerDownOutside: I,
195
- onFocusOutside: (t2) => t2.preventDefault(),
196
- onDismiss: B,
197
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content$1, {
198
- "data-state": R.stateAttribute,
199
- ...z,
200
- ...L,
201
- ref: j,
202
- style: {
203
- ...L.style,
204
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
205
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
206
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
207
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
208
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
209
- },
210
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slottable$1, { children: N }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VisuallyHiddenContentContextProvider, {
211
- scope: M,
212
- isInside: true,
213
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root$1, {
214
- id: R.contentId,
215
- role: "tooltip",
216
- children: P || N
217
- })
218
- })]
219
- })
220
- });
221
- });
222
- TooltipContent$1.displayName = CONTENT_NAME$2;
223
- var ARROW_NAME = "TooltipArrow", TooltipArrow = import_react.forwardRef((t, j) => {
224
- let { __scopeTooltip: M, ...N } = t, P = usePopperScope(M);
225
- return useVisuallyHiddenContentContext(ARROW_NAME, M).isInside ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow, {
226
- ...P,
227
- ...N,
228
- ref: j
229
- });
230
- });
231
- TooltipArrow.displayName = ARROW_NAME;
232
- function getExitSideFromRect(t, j) {
233
- let M = Math.abs(j.top - t.y), N = Math.abs(j.bottom - t.y), P = Math.abs(j.right - t.x), F = Math.abs(j.left - t.x);
234
- switch (Math.min(M, N, P, F)) {
235
- case F:
236
- return "left";
237
- case P:
238
- return "right";
239
- case M:
240
- return "top";
241
- case N:
242
- return "bottom";
243
- default:
244
- throw Error("unreachable");
245
- }
246
- }
247
- function getPaddedExitPoints(t, j, M = 5) {
248
- let N = [];
249
- switch (j) {
250
- case "top":
251
- N.push({
252
- x: t.x - M,
253
- y: t.y + M
254
- }, {
255
- x: t.x + M,
256
- y: t.y + M
257
- });
258
- break;
259
- case "bottom":
260
- N.push({
261
- x: t.x - M,
262
- y: t.y - M
263
- }, {
264
- x: t.x + M,
265
- y: t.y - M
266
- });
267
- break;
268
- case "left":
269
- N.push({
270
- x: t.x + M,
271
- y: t.y - M
272
- }, {
273
- x: t.x + M,
274
- y: t.y + M
275
- });
276
- break;
277
- case "right":
278
- N.push({
279
- x: t.x - M,
280
- y: t.y - M
281
- }, {
282
- x: t.x - M,
283
- y: t.y + M
284
- });
285
- break;
286
- }
287
- return N;
288
- }
289
- function getPointsFromRect(t) {
290
- let { top: j, right: M, bottom: N, left: P } = t;
291
- return [
292
- {
293
- x: P,
294
- y: j
295
- },
296
- {
297
- x: M,
298
- y: j
299
- },
300
- {
301
- x: M,
302
- y: N
303
- },
304
- {
305
- x: P,
306
- y: N
307
- }
308
- ];
309
- }
310
- function isPointInPolygon(t, j) {
311
- let { x: M, y: N } = t, P = false;
312
- for (let t2 = 0, F = j.length - 1; t2 < j.length; F = t2++) {
313
- let I = j[t2], L = j[F], R = I.x, z = I.y, B = L.x, V = L.y;
314
- z > N != V > N && M < (B - R) * (N - z) / (V - z) + R && (P = !P);
315
- }
316
- return P;
317
- }
318
- function getHull(t) {
319
- let j = t.slice();
320
- return j.sort((t2, j2) => t2.x < j2.x ? -1 : t2.x > j2.x ? 1 : t2.y < j2.y ? -1 : t2.y > j2.y ? 1 : 0), getHullPresorted(j);
321
- }
322
- function getHullPresorted(t) {
323
- if (t.length <= 1) return t.slice();
324
- let j = [];
325
- for (let M2 = 0; M2 < t.length; M2++) {
326
- let N = t[M2];
327
- for (; j.length >= 2; ) {
328
- let t2 = j[j.length - 1], M3 = j[j.length - 2];
329
- if ((t2.x - M3.x) * (N.y - M3.y) >= (t2.y - M3.y) * (N.x - M3.x)) j.pop();
330
- else break;
331
- }
332
- j.push(N);
333
- }
334
- j.pop();
335
- let M = [];
336
- for (let j2 = t.length - 1; j2 >= 0; j2--) {
337
- let N = t[j2];
338
- for (; M.length >= 2; ) {
339
- let t2 = M[M.length - 1], j3 = M[M.length - 2];
340
- if ((t2.x - j3.x) * (N.y - j3.y) >= (t2.y - j3.y) * (N.x - j3.x)) M.pop();
341
- else break;
342
- }
343
- M.push(N);
344
- }
345
- return M.pop(), j.length === 1 && M.length === 1 && j[0].x === M[0].x && j[0].y === M[0].y ? j : j.concat(M);
346
- }
347
- var Provider = TooltipProvider$1, Root3 = Tooltip$1, Trigger$1 = TooltipTrigger$1, Portal$2 = TooltipPortal$1, Content2$1 = TooltipContent$1, import_compiler_runtime$3 = require_compiler_runtime(), TooltipProvider = (t) => {
348
- let j = (0, import_compiler_runtime$3.c)(6), M, N;
349
- j[0] === t ? (M = j[1], N = j[2]) : ({ delayDuration: N, ...M } = t, j[0] = t, j[1] = M, j[2] = N);
350
- let P = N === void 0 ? 400 : N, F;
351
- return j[3] !== P || j[4] !== M ? (F = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, {
352
- delayDuration: P,
353
- ...M
354
- }), j[3] = P, j[4] = M, j[5] = F) : F = j[5], F;
355
- }, TooltipPortal = withFullScreenAsRoot(Portal$2), TooltipRoot = Root3, InternalTooltipContent = withSmartCollisionBoundary(Content2$1), TooltipTrigger = Trigger$1, TooltipContent = import_react.forwardRef((t, j) => {
356
- let M = (0, import_compiler_runtime$3.c)(11), N, P, F;
357
- M[0] === t ? (N = M[1], P = M[2], F = M[3]) : ({ className: N, sideOffset: F, ...P } = t, M[0] = t, M[1] = N, M[2] = P, M[3] = F);
358
- let I = F === void 0 ? 4 : F, L;
359
- M[4] === N ? L = M[5] : (L = cn("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-xs data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1", N), M[4] = N, M[5] = L);
360
- let R;
361
- return M[6] !== P || M[7] !== j || M[8] !== I || M[9] !== L ? (R = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleNamespace, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InternalTooltipContent, {
362
- ref: j,
363
- sideOffset: I,
364
- className: L,
365
- ...P
366
- }) }), M[6] = P, M[7] = j, M[8] = I, M[9] = L, M[10] = R) : R = M[10], R;
367
- });
368
- TooltipContent.displayName = Content2$1.displayName;
369
- var Tooltip = (t) => {
370
- let j = (0, import_compiler_runtime$3.c)(22), M, N, P, F, I, L, R, z;
371
- j[0] === t ? (M = j[1], N = j[2], P = j[3], F = j[4], I = j[5], L = j[6], R = j[7], z = j[8]) : ({ content: P, children: N, usePortal: L, asChild: R, tabIndex: z, side: I, align: M, ...F } = t, j[0] = t, j[1] = M, j[2] = N, j[3] = P, j[4] = F, j[5] = I, j[6] = L, j[7] = R, j[8] = z);
372
- let B = L === void 0 ? true : L, V = R === void 0 ? true : R;
373
- if (P == null || P === "") return N;
374
- let H;
375
- j[9] !== V || j[10] !== N || j[11] !== z ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipTrigger, {
376
- asChild: V,
377
- tabIndex: z,
378
- children: N
379
- }), j[9] = V, j[10] = N, j[11] = z, j[12] = H) : H = j[12];
380
- let U;
381
- j[13] !== M || j[14] !== P || j[15] !== I || j[16] !== B ? (U = B ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, {
382
- side: I,
383
- align: M,
384
- children: P
385
- }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContent, {
386
- side: I,
387
- align: M,
388
- children: P
389
- }), j[13] = M, j[14] = P, j[15] = I, j[16] = B, j[17] = U) : U = j[17];
390
- let W;
391
- return j[18] !== F || j[19] !== H || j[20] !== U ? (W = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipRoot, {
392
- disableHoverableContent: true,
393
- ...F,
394
- children: [H, U]
395
- }), j[18] = F, j[19] = H, j[20] = U, j[21] = W) : W = j[21], W;
396
- }, DetailsSchema = object({ detail: string() }), ErrorSchema = object({ error: string() });
397
- function prettyError(t) {
398
- if (!t) return "Unknown error";
399
- if (t instanceof Error) {
400
- let j = DetailsSchema.safeParse(t.cause);
401
- return j.success ? j.data.detail : maybeExtractDetails(t.message);
402
- }
403
- if (typeof t == "object") {
404
- let j = DetailsSchema.safeParse(t);
405
- if (j.success) return j.data.detail;
406
- let M = ErrorSchema.safeParse(t);
407
- if (M.success) return M.data.error;
408
- }
409
- try {
410
- return JSON.stringify(t);
411
- } catch {
412
- return String(t);
413
- }
414
- }
415
- function maybeExtractDetails(t) {
416
- let j = safeJSONParse(t);
417
- if (!j) return t;
418
- let M = DetailsSchema.safeParse(j);
419
- if (M.success) return M.data.detail;
420
- let N = ErrorSchema.safeParse(j);
421
- return N.success ? N.data.error : t;
422
- }
423
- function safeJSONParse(t) {
424
- try {
425
- return JSON.parse(t);
426
- } catch {
427
- return t;
428
- }
429
- }
430
- var CellNotInitializedError = class extends Error {
431
- constructor(t = "The cell containing this UI element has not been run yet. Please run the cell first.") {
432
- super(t), this.name = "CellNotInitializedError";
433
- }
434
- }, DIALOG_NAME = "Dialog", [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME), [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME), Dialog = (t) => {
435
- let { __scopeDialog: j, children: M, open: N, defaultOpen: P, onOpenChange: F, modal: I = true } = t, R = import_react.useRef(null), z = import_react.useRef(null), [B, V] = useControllableState({
436
- prop: N,
437
- defaultProp: P ?? false,
438
- onChange: F,
439
- caller: DIALOG_NAME
440
- });
441
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogProvider, {
442
- scope: j,
443
- triggerRef: R,
444
- contentRef: z,
445
- contentId: useId(),
446
- titleId: useId(),
447
- descriptionId: useId(),
448
- open: B,
449
- onOpenChange: V,
450
- onOpenToggle: import_react.useCallback(() => V((t2) => !t2), [V]),
451
- modal: I,
452
- children: M
453
- });
454
- };
455
- Dialog.displayName = DIALOG_NAME;
456
- var TRIGGER_NAME$1 = "DialogTrigger", DialogTrigger = import_react.forwardRef((t, j) => {
457
- let { __scopeDialog: M, ...N } = t, I = useDialogContext(TRIGGER_NAME$1, M), L = useComposedRefs(j, I.triggerRef);
458
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
459
- type: "button",
460
- "aria-haspopup": "dialog",
461
- "aria-expanded": I.open,
462
- "aria-controls": I.contentId,
463
- "data-state": getState(I.open),
464
- ...N,
465
- ref: L,
466
- onClick: composeEventHandlers(t.onClick, I.onOpenToggle)
467
- });
468
- });
469
- DialogTrigger.displayName = TRIGGER_NAME$1;
470
- var PORTAL_NAME$1 = "DialogPortal", [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME$1, { forceMount: void 0 }), DialogPortal = (t) => {
471
- let { __scopeDialog: j, forceMount: M, children: N, container: P } = t, F = useDialogContext(PORTAL_NAME$1, j);
472
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider, {
473
- scope: j,
474
- forceMount: M,
475
- children: import_react.Children.map(N, (t2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
476
- present: M || F.open,
477
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
478
- asChild: true,
479
- container: P,
480
- children: t2
481
- })
482
- }))
483
- });
484
- };
485
- DialogPortal.displayName = PORTAL_NAME$1;
486
- var OVERLAY_NAME$1 = "DialogOverlay", DialogOverlay = import_react.forwardRef((t, j) => {
487
- let M = usePortalContext(OVERLAY_NAME$1, t.__scopeDialog), { forceMount: N = M.forceMount, ...P } = t, F = useDialogContext(OVERLAY_NAME$1, t.__scopeDialog);
488
- return F.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
489
- present: N || F.open,
490
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlayImpl, {
491
- ...P,
492
- ref: j
493
- })
494
- }) : null;
495
- });
496
- DialogOverlay.displayName = OVERLAY_NAME$1;
497
- var Slot = createSlot("DialogOverlay.RemoveScroll"), DialogOverlayImpl = import_react.forwardRef((t, j) => {
498
- let { __scopeDialog: M, ...N } = t, F = useDialogContext(OVERLAY_NAME$1, M);
499
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Combination_default, {
500
- as: Slot,
501
- allowPinchZoom: true,
502
- shards: [F.contentRef],
503
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
504
- "data-state": getState(F.open),
505
- ...N,
506
- ref: j,
507
- style: {
508
- pointerEvents: "auto",
509
- ...N.style
510
- }
511
- })
512
- });
513
- }), CONTENT_NAME$1 = "DialogContent", DialogContent = import_react.forwardRef((t, j) => {
514
- let M = usePortalContext(CONTENT_NAME$1, t.__scopeDialog), { forceMount: N = M.forceMount, ...P } = t, F = useDialogContext(CONTENT_NAME$1, t.__scopeDialog);
515
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
516
- present: N || F.open,
517
- children: F.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, {
518
- ...P,
519
- ref: j
520
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentNonModal, {
521
- ...P,
522
- ref: j
523
- })
524
- });
525
- });
526
- DialogContent.displayName = CONTENT_NAME$1;
527
- var DialogContentModal = import_react.forwardRef((t, j) => {
528
- let M = useDialogContext(CONTENT_NAME$1, t.__scopeDialog), N = import_react.useRef(null), P = useComposedRefs(j, M.contentRef, N);
529
- return import_react.useEffect(() => {
530
- let t2 = N.current;
531
- if (t2) return hideOthers(t2);
532
- }, []), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
533
- ...t,
534
- ref: P,
535
- trapFocus: M.open,
536
- disableOutsidePointerEvents: true,
537
- onCloseAutoFocus: composeEventHandlers(t.onCloseAutoFocus, (t2) => {
538
- var _a;
539
- t2.preventDefault(), (_a = M.triggerRef.current) == null ? void 0 : _a.focus();
540
- }),
541
- onPointerDownOutside: composeEventHandlers(t.onPointerDownOutside, (t2) => {
542
- let j2 = t2.detail.originalEvent, M2 = j2.button === 0 && j2.ctrlKey === true;
543
- (j2.button === 2 || M2) && t2.preventDefault();
544
- }),
545
- onFocusOutside: composeEventHandlers(t.onFocusOutside, (t2) => t2.preventDefault())
546
- });
547
- }), DialogContentNonModal = import_react.forwardRef((t, j) => {
548
- let M = useDialogContext(CONTENT_NAME$1, t.__scopeDialog), N = import_react.useRef(false), P = import_react.useRef(false);
549
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
550
- ...t,
551
- ref: j,
552
- trapFocus: false,
553
- disableOutsidePointerEvents: false,
554
- onCloseAutoFocus: (j2) => {
555
- var _a, _b;
556
- (_a = t.onCloseAutoFocus) == null ? void 0 : _a.call(t, j2), j2.defaultPrevented || (N.current || ((_b = M.triggerRef.current) == null ? void 0 : _b.focus()), j2.preventDefault()), N.current = false, P.current = false;
557
- },
558
- onInteractOutside: (j2) => {
559
- var _a, _b;
560
- (_a = t.onInteractOutside) == null ? void 0 : _a.call(t, j2), j2.defaultPrevented || (N.current = true, j2.detail.originalEvent.type === "pointerdown" && (P.current = true));
561
- let F = j2.target;
562
- ((_b = M.triggerRef.current) == null ? void 0 : _b.contains(F)) && j2.preventDefault(), j2.detail.originalEvent.type === "focusin" && P.current && j2.preventDefault();
563
- }
564
- });
565
- }), DialogContentImpl = import_react.forwardRef((t, j) => {
566
- let { __scopeDialog: M, trapFocus: N, onOpenAutoFocus: P, onCloseAutoFocus: F, ...I } = t, L = useDialogContext(CONTENT_NAME$1, M), R = import_react.useRef(null), z = useComposedRefs(j, R);
567
- return useFocusGuards(), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusScope, {
568
- asChild: true,
569
- loop: true,
570
- trapped: N,
571
- onMountAutoFocus: P,
572
- onUnmountAutoFocus: F,
573
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
574
- role: "dialog",
575
- id: L.contentId,
576
- "aria-describedby": L.descriptionId,
577
- "aria-labelledby": L.titleId,
578
- "data-state": getState(L.open),
579
- ...I,
580
- ref: z,
581
- onDismiss: () => L.onOpenChange(false)
582
- })
583
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleWarning, { titleId: L.titleId }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning$1, {
584
- contentRef: R,
585
- descriptionId: L.descriptionId
586
- })] })] });
587
- }), TITLE_NAME$1 = "DialogTitle", DialogTitle = import_react.forwardRef((t, j) => {
588
- let { __scopeDialog: M, ...N } = t, F = useDialogContext(TITLE_NAME$1, M);
589
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.h2, {
590
- id: F.titleId,
591
- ...N,
592
- ref: j
593
- });
594
- });
595
- DialogTitle.displayName = TITLE_NAME$1;
596
- var DESCRIPTION_NAME$1 = "DialogDescription", DialogDescription = import_react.forwardRef((t, j) => {
597
- let { __scopeDialog: M, ...N } = t, F = useDialogContext(DESCRIPTION_NAME$1, M);
598
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.p, {
599
- id: F.descriptionId,
600
- ...N,
601
- ref: j
602
- });
603
- });
604
- DialogDescription.displayName = DESCRIPTION_NAME$1;
605
- var CLOSE_NAME = "DialogClose", DialogClose = import_react.forwardRef((t, j) => {
606
- let { __scopeDialog: M, ...N } = t, I = useDialogContext(CLOSE_NAME, M);
607
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
608
- type: "button",
609
- ...N,
610
- ref: j,
611
- onClick: composeEventHandlers(t.onClick, () => I.onOpenChange(false))
612
- });
613
- });
614
- DialogClose.displayName = CLOSE_NAME;
615
- function getState(t) {
616
- return t ? "open" : "closed";
617
- }
618
- var TITLE_WARNING_NAME = "DialogTitleWarning", [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
619
- contentName: CONTENT_NAME$1,
620
- titleName: TITLE_NAME$1,
621
- docsSlug: "dialog"
622
- }), TitleWarning = ({ titleId: t }) => {
623
- let j = useWarningContext(TITLE_WARNING_NAME), M = `\`${j.contentName}\` requires a \`${j.titleName}\` for the component to be accessible for screen reader users.
624
-
625
- If you want to hide the \`${j.titleName}\`, you can wrap it with our VisuallyHidden component.
626
-
627
- For more information, see https://radix-ui.com/primitives/docs/components/${j.docsSlug}`;
628
- return import_react.useEffect(() => {
629
- t && (document.getElementById(t) || console.error(M));
630
- }, [M, t]), null;
631
- }, DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning", DescriptionWarning$1 = ({ contentRef: t, descriptionId: j }) => {
632
- let M = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;
633
- return import_react.useEffect(() => {
634
- var _a;
635
- let N = (_a = t.current) == null ? void 0 : _a.getAttribute("aria-describedby");
636
- j && N && (document.getElementById(j) || console.warn(M));
637
- }, [
638
- M,
639
- t,
640
- j
641
- ]), null;
642
- }, Root = Dialog, Trigger = DialogTrigger, Portal$1 = DialogPortal, Overlay = DialogOverlay, Content = DialogContent, Title = DialogTitle, Description = DialogDescription, Close = DialogClose, ROOT_NAME = "AlertDialog", [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [createDialogScope]), useDialogScope = createDialogScope(), AlertDialog$1 = (t) => {
643
- let { __scopeAlertDialog: j, ...M } = t, N = useDialogScope(j);
644
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root, {
645
- ...N,
646
- ...M,
647
- modal: true
648
- });
649
- };
650
- AlertDialog$1.displayName = ROOT_NAME;
651
- var TRIGGER_NAME = "AlertDialogTrigger", AlertDialogTrigger$1 = import_react.forwardRef((t, j) => {
652
- let { __scopeAlertDialog: M, ...N } = t, P = useDialogScope(M);
653
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {
654
- ...P,
655
- ...N,
656
- ref: j
657
- });
658
- });
659
- AlertDialogTrigger$1.displayName = TRIGGER_NAME;
660
- var PORTAL_NAME = "AlertDialogPortal", AlertDialogPortal$1 = (t) => {
661
- let { __scopeAlertDialog: j, ...M } = t, N = useDialogScope(j);
662
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$1, {
663
- ...N,
664
- ...M
665
- });
666
- };
667
- AlertDialogPortal$1.displayName = PORTAL_NAME;
668
- var OVERLAY_NAME = "AlertDialogOverlay", AlertDialogOverlay$1 = import_react.forwardRef((t, j) => {
669
- let { __scopeAlertDialog: M, ...N } = t, P = useDialogScope(M);
670
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay, {
671
- ...P,
672
- ...N,
673
- ref: j
674
- });
675
- });
676
- AlertDialogOverlay$1.displayName = OVERLAY_NAME;
677
- var CONTENT_NAME = "AlertDialogContent", [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME), Slottable = createSlottable("AlertDialogContent"), AlertDialogContent$1 = import_react.forwardRef((t, j) => {
678
- let { __scopeAlertDialog: M, children: N, ...P } = t, I = useDialogScope(M), L = import_react.useRef(null), R = useComposedRefs(j, L), z = import_react.useRef(null);
679
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WarningProvider, {
680
- contentName: CONTENT_NAME,
681
- titleName: TITLE_NAME,
682
- docsSlug: "alert-dialog",
683
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContentProvider, {
684
- scope: M,
685
- cancelRef: z,
686
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, {
687
- role: "alertdialog",
688
- ...I,
689
- ...P,
690
- ref: R,
691
- onOpenAutoFocus: composeEventHandlers(P.onOpenAutoFocus, (t2) => {
692
- var _a;
693
- t2.preventDefault(), (_a = z.current) == null ? void 0 : _a.focus({ preventScroll: true });
694
- }),
695
- onPointerDownOutside: (t2) => t2.preventDefault(),
696
- onInteractOutside: (t2) => t2.preventDefault(),
697
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Slottable, { children: N }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef: L })]
698
- })
699
- })
700
- });
701
- });
702
- AlertDialogContent$1.displayName = CONTENT_NAME;
703
- var TITLE_NAME = "AlertDialogTitle", AlertDialogTitle$1 = import_react.forwardRef((t, j) => {
704
- let { __scopeAlertDialog: M, ...N } = t, P = useDialogScope(M);
705
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, {
706
- ...P,
707
- ...N,
708
- ref: j
709
- });
710
- });
711
- AlertDialogTitle$1.displayName = TITLE_NAME;
712
- var DESCRIPTION_NAME = "AlertDialogDescription", AlertDialogDescription$1 = import_react.forwardRef((t, j) => {
713
- let { __scopeAlertDialog: M, ...N } = t, P = useDialogScope(M);
714
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
715
- ...P,
716
- ...N,
717
- ref: j
718
- });
719
- });
720
- AlertDialogDescription$1.displayName = DESCRIPTION_NAME;
721
- var ACTION_NAME = "AlertDialogAction", AlertDialogAction$1 = import_react.forwardRef((t, j) => {
722
- let { __scopeAlertDialog: M, ...N } = t, P = useDialogScope(M);
723
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
724
- ...P,
725
- ...N,
726
- ref: j
727
- });
728
- });
729
- AlertDialogAction$1.displayName = ACTION_NAME;
730
- var CANCEL_NAME = "AlertDialogCancel", AlertDialogCancel$1 = import_react.forwardRef((t, j) => {
731
- let { __scopeAlertDialog: M, ...N } = t, { cancelRef: P } = useAlertDialogContentContext(CANCEL_NAME, M), F = useDialogScope(M), I = useComposedRefs(j, P);
732
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Close, {
733
- ...F,
734
- ...N,
735
- ref: I
736
- });
737
- });
738
- AlertDialogCancel$1.displayName = CANCEL_NAME;
739
- var DescriptionWarning = ({ contentRef: t }) => {
740
- let j = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
741
-
742
- You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
743
-
744
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
745
-
746
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
747
- return import_react.useEffect(() => {
748
- var _a;
749
- document.getElementById((_a = t.current) == null ? void 0 : _a.getAttribute("aria-describedby")) || console.warn(j);
750
- }, [j, t]), null;
751
- }, Root2 = AlertDialog$1, Portal2 = AlertDialogPortal$1, Overlay2 = AlertDialogOverlay$1, Content2 = AlertDialogContent$1, Action = AlertDialogAction$1, Cancel = AlertDialogCancel$1, Title2 = AlertDialogTitle$1, Description2 = AlertDialogDescription$1, import_compiler_runtime$2 = require_compiler_runtime();
752
- function useRestoreFocus() {
753
- let t = (0, import_compiler_runtime$2.c)(3), [j, M] = (0, import_react.useState)(null), N;
754
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = () => {
755
- M(document.activeElement);
756
- }, t[0] = N) : N = t[0];
757
- let P = N, F;
758
- return t[1] === j ? F = t[2] : (F = {
759
- onOpenAutoFocus: P,
760
- onCloseAutoFocus: (t2) => {
761
- document.activeElement === document.body && (j instanceof HTMLElement && j.focus(), t2.preventDefault());
762
- }
763
- }, t[1] = j, t[2] = F), F;
764
- }
765
- var import_compiler_runtime$1 = require_compiler_runtime(), AlertDialog = Root2, AlertDialogPortal = withFullScreenAsRoot(({ children: t, ...j }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, {
766
- ...j,
767
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleNamespace, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
768
- className: "fixed inset-0 z-50 flex items-end justify-center sm:items-start sm:top-[15%]",
769
- children: t
770
- }) })
771
- }));
772
- AlertDialogPortal.displayName = Portal2.displayName;
773
- var AlertDialogOverlay = import_react.forwardRef((t, j) => {
774
- let M = (0, import_compiler_runtime$1.c)(9), N, P;
775
- if (M[0] !== t) {
776
- let { className: j2, children: F2, ...I2 } = t;
777
- N = j2, P = I2, M[0] = t, M[1] = N, M[2] = P;
778
- } else N = M[1], P = M[2];
779
- let F;
780
- M[3] === N ? F = M[4] : (F = cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-xs transition-opacity animate-in fade-in", N), M[3] = N, M[4] = F);
781
- let I;
782
- return M[5] !== P || M[6] !== j || M[7] !== F ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Overlay2, {
783
- className: F,
784
- ...P,
785
- ref: j
786
- }), M[5] = P, M[6] = j, M[7] = F, M[8] = I) : I = M[8], I;
787
- });
788
- AlertDialogOverlay.displayName = Overlay2.displayName;
789
- var AlertDialogContent = import_react.forwardRef((t, j) => {
790
- let M = (0, import_compiler_runtime$1.c)(11), N, P;
791
- M[0] === t ? (N = M[1], P = M[2]) : ({ className: N, ...P } = t, M[0] = t, M[1] = N, M[2] = P);
792
- let F = useRestoreFocus(), I;
793
- M[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogOverlay, {}), M[3] = I) : I = M[3];
794
- let L;
795
- M[4] === N ? L = M[5] : (L = cn("fixed z-50 grid w-full max-w-2xl scale-100 gap-4 border bg-background p-6 opacity-100 shadow-sm animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full", N), M[4] = N, M[5] = L);
796
- let R;
797
- return M[6] !== P || M[7] !== j || M[8] !== F || M[9] !== L ? (R = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogPortal, { children: [I, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2, {
798
- ref: j,
799
- className: L,
800
- ...F,
801
- ...P
802
- })] }), M[6] = P, M[7] = j, M[8] = F, M[9] = L, M[10] = R) : R = M[10], R;
803
- });
804
- AlertDialogContent.displayName = Content2.displayName;
805
- var AlertDialogHeader = (t) => {
806
- let j = (0, import_compiler_runtime$1.c)(8), M, N;
807
- j[0] === t ? (M = j[1], N = j[2]) : ({ className: M, ...N } = t, j[0] = t, j[1] = M, j[2] = N);
808
- let P;
809
- j[3] === M ? P = j[4] : (P = cn("flex flex-col space-y-2 text-center sm:text-left", M), j[3] = M, j[4] = P);
810
- let F;
811
- return j[5] !== N || j[6] !== P ? (F = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
812
- className: P,
813
- ...N
814
- }), j[5] = N, j[6] = P, j[7] = F) : F = j[7], F;
815
- };
816
- AlertDialogHeader.displayName = "AlertDialogHeader";
817
- var AlertDialogFooter = (t) => {
818
- let j = (0, import_compiler_runtime$1.c)(8), M, N;
819
- j[0] === t ? (M = j[1], N = j[2]) : ({ className: M, ...N } = t, j[0] = t, j[1] = M, j[2] = N);
820
- let P;
821
- j[3] === M ? P = j[4] : (P = cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", M), j[3] = M, j[4] = P);
822
- let F;
823
- return j[5] !== N || j[6] !== P ? (F = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
824
- className: P,
825
- ...N
826
- }), j[5] = N, j[6] = P, j[7] = F) : F = j[7], F;
827
- };
828
- AlertDialogFooter.displayName = "AlertDialogFooter";
829
- var AlertDialogTitle = import_react.forwardRef((t, j) => {
830
- let M = (0, import_compiler_runtime$1.c)(9), N, P;
831
- M[0] === t ? (N = M[1], P = M[2]) : ({ className: N, ...P } = t, M[0] = t, M[1] = N, M[2] = P);
832
- let F;
833
- M[3] === N ? F = M[4] : (F = cn("text-lg font-semibold", N), M[3] = N, M[4] = F);
834
- let I;
835
- return M[5] !== P || M[6] !== j || M[7] !== F ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title2, {
836
- ref: j,
837
- className: F,
838
- ...P
839
- }), M[5] = P, M[6] = j, M[7] = F, M[8] = I) : I = M[8], I;
840
- });
841
- AlertDialogTitle.displayName = Title2.displayName;
842
- var AlertDialogDescription = import_react.forwardRef((t, j) => {
843
- let M = (0, import_compiler_runtime$1.c)(9), N, P;
844
- M[0] === t ? (N = M[1], P = M[2]) : ({ className: N, ...P } = t, M[0] = t, M[1] = N, M[2] = P);
845
- let F;
846
- M[3] === N ? F = M[4] : (F = cn("text-muted-foreground", N), M[3] = N, M[4] = F);
847
- let I;
848
- return M[5] !== P || M[6] !== j || M[7] !== F ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description2, {
849
- ref: j,
850
- className: F,
851
- ...P
852
- }), M[5] = P, M[6] = j, M[7] = F, M[8] = I) : I = M[8], I;
853
- });
854
- AlertDialogDescription.displayName = Description2.displayName;
855
- var AlertDialogAction = import_react.forwardRef((t, j) => {
856
- let M = (0, import_compiler_runtime$1.c)(9), N, P;
857
- M[0] === t ? (N = M[1], P = M[2]) : ({ className: N, ...P } = t, M[0] = t, M[1] = N, M[2] = P);
858
- let F;
859
- M[3] === N ? F = M[4] : (F = cn(buttonVariants(), N), M[3] = N, M[4] = F);
860
- let I;
861
- return M[5] !== P || M[6] !== j || M[7] !== F ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
862
- ref: j,
863
- className: F,
864
- ...P
865
- }), M[5] = P, M[6] = j, M[7] = F, M[8] = I) : I = M[8], I;
866
- });
867
- AlertDialogAction.displayName = Action.displayName;
868
- var AlertDialogDestructiveAction = import_react.forwardRef((t, j) => {
869
- let M = (0, import_compiler_runtime$1.c)(9), N, P;
870
- M[0] === t ? (N = M[1], P = M[2]) : ({ className: N, ...P } = t, M[0] = t, M[1] = N, M[2] = P);
871
- let F;
872
- M[3] === N ? F = M[4] : (F = cn(buttonVariants({ variant: "destructive" }), N), M[3] = N, M[4] = F);
873
- let I;
874
- return M[5] !== P || M[6] !== j || M[7] !== F ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Action, {
875
- ref: j,
876
- className: F,
877
- ...P
878
- }), M[5] = P, M[6] = j, M[7] = F, M[8] = I) : I = M[8], I;
879
- });
880
- AlertDialogDestructiveAction.displayName = "AlertDialogDestructiveAction";
881
- var AlertDialogCancel = import_react.forwardRef((t, j) => {
882
- let M = (0, import_compiler_runtime$1.c)(9), N, P;
883
- M[0] === t ? (N = M[1], P = M[2]) : ({ className: N, ...P } = t, M[0] = t, M[1] = N, M[2] = P);
884
- let F;
885
- M[3] === N ? F = M[4] : (F = cn(buttonVariants({ variant: "secondary" }), "mt-2 sm:mt-0", N), M[3] = N, M[4] = F);
886
- let I;
887
- return M[5] !== P || M[6] !== j || M[7] !== F ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Cancel, {
888
- ref: j,
889
- className: F,
890
- ...P
891
- }), M[5] = P, M[6] = j, M[7] = F, M[8] = I) : I = M[8], I;
892
- });
893
- AlertDialogCancel.displayName = Cancel.displayName;
894
- var import_compiler_runtime = require_compiler_runtime();
895
- const ErrorBanner = (t) => {
896
- let j = (0, import_compiler_runtime.c)(23), { error: M, className: N, action: P } = t, [F, I] = (0, import_react.useState)(false);
897
- if (!M) return null;
898
- Logger.error(M);
899
- let L;
900
- j[0] === M ? L = j[1] : (L = prettyError(M), j[0] = M, j[1] = L);
901
- let R = L, z;
902
- j[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = () => I(true), j[2] = z) : z = j[2];
903
- let B;
904
- j[3] === R ? B = j[4] : (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
905
- className: "line-clamp-4",
906
- children: R
907
- }), j[3] = R, j[4] = B);
908
- let V;
909
- j[5] === P ? V = j[6] : (V = P && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
910
- className: "flex justify-end",
911
- children: P
912
- }), j[5] = P, j[6] = V);
913
- let H;
914
- j[7] !== N || j[8] !== B || j[9] !== V ? (H = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Banner, {
915
- kind: "danger",
916
- className: N,
917
- clickable: true,
918
- onClick: z,
919
- children: [B, V]
920
- }), j[7] = N, j[8] = B, j[9] = V, j[10] = H) : H = j[10];
921
- let U;
922
- j[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogTitle, {
923
- className: "text-error",
924
- children: "Error"
925
- }) }), j[11] = U) : U = j[11];
926
- let W;
927
- j[12] === R ? W = j[13] : (W = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogDescription, {
928
- asChild: true,
929
- className: "text-error text-sm p-2 font-mono overflow-auto whitespace-pre-wrap",
930
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { children: R })
931
- }), j[12] = R, j[13] = W);
932
- let G;
933
- j[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogAction, {
934
- autoFocus: true,
935
- onClick: () => I(false),
936
- children: "Ok"
937
- }) }), j[14] = G) : G = j[14];
938
- let K;
939
- j[15] === W ? K = j[16] : (K = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogContent, {
940
- className: "max-w-[80%] max-h-[80%] overflow-hidden flex flex-col",
941
- children: [
942
- U,
943
- W,
944
- G
945
- ]
946
- }), j[15] = W, j[16] = K);
947
- let q;
948
- j[17] !== F || j[18] !== K ? (q = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialog, {
949
- open: F,
950
- onOpenChange: I,
951
- children: K
952
- }), j[17] = F, j[18] = K, j[19] = q) : q = j[19];
953
- let J;
954
- return j[20] !== q || j[21] !== H ? (J = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [H, q] }), j[20] = q, j[21] = H, j[22] = J) : J = j[22], J;
955
- };
956
- var bannerStyle = cva("text-sm p-2 border whitespace-pre-wrap overflow-hidden", {
957
- variants: {
958
- kind: {
959
- danger: "text-error border-(--red-6) shadow-md-solid shadow-error bg-(--red-1)",
960
- info: "text-primary border-(--blue-6) shadow-md-solid shadow-accent bg-(--blue-1)",
961
- warn: "border-(--yellow-6) bg-(--yellow-2) dark:bg-(--yellow-4) text-(--yellow-11) dark:text-(--yellow-12)"
962
- },
963
- clickable: { true: "cursor-pointer" }
964
- },
965
- compoundVariants: [
966
- {
967
- clickable: true,
968
- kind: "danger",
969
- className: "hover:bg-(--red-3)"
970
- },
971
- {
972
- clickable: true,
973
- kind: "info",
974
- className: "hover:bg-(--blue-3)"
975
- },
976
- {
977
- clickable: true,
978
- kind: "warn",
979
- className: "hover:bg-(--yellow-3)"
980
- }
981
- ],
982
- defaultVariants: { kind: "info" }
983
- });
984
- const Banner = (t) => {
985
- let j = (0, import_compiler_runtime.c)(14), M, N, P, F, I;
986
- j[0] === t ? (M = j[1], N = j[2], P = j[3], F = j[4], I = j[5]) : ({ kind: F, clickable: P, className: N, children: M, ...I } = t, j[0] = t, j[1] = M, j[2] = N, j[3] = P, j[4] = F, j[5] = I);
987
- let L;
988
- j[6] !== N || j[7] !== P || j[8] !== F ? (L = cn(bannerStyle({
989
- kind: F,
990
- clickable: P
991
- }), N), j[6] = N, j[7] = P, j[8] = F, j[9] = L) : L = j[9];
992
- let R;
993
- return j[10] !== M || j[11] !== I || j[12] !== L ? (R = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
994
- className: L,
995
- ...I,
996
- children: M
997
- }), j[10] = M, j[11] = I, j[12] = L, j[13] = R) : R = j[13], R;
998
- };
999
- export {
1000
- Portal$1 as a,
1001
- prettyError as c,
1002
- TooltipPortal as d,
1003
- TooltipProvider as f,
1004
- TooltipProvider$1 as h,
1005
- Overlay as i,
1006
- Tooltip as l,
1007
- TooltipTrigger as m,
1008
- ErrorBanner as n,
1009
- Root as o,
1010
- TooltipRoot as p,
1011
- Content as r,
1012
- CellNotInitializedError as s,
1013
- Banner as t,
1014
- TooltipContent as u
1015
- };