openplanr 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/cli/commands/artifact-design-share.d.ts +9 -0
  3. package/dist/cli/commands/artifact-design-share.d.ts.map +1 -0
  4. package/dist/cli/commands/artifact-design-share.js +200 -0
  5. package/dist/cli/commands/artifact-design-share.js.map +1 -0
  6. package/dist/cli/commands/artifact.d.ts.map +1 -1
  7. package/dist/cli/commands/artifact.js +5 -18
  8. package/dist/cli/commands/artifact.js.map +1 -1
  9. package/dist/cli/commands/design.d.ts +3 -0
  10. package/dist/cli/commands/design.d.ts.map +1 -0
  11. package/dist/cli/commands/design.js +137 -0
  12. package/dist/cli/commands/design.js.map +1 -0
  13. package/dist/cli/commands/groups/operations.d.ts.map +1 -1
  14. package/dist/cli/commands/groups/operations.js +2 -0
  15. package/dist/cli/commands/groups/operations.js.map +1 -1
  16. package/dist/cli/commands/ship.d.ts.map +1 -1
  17. package/dist/cli/commands/ship.js +2 -0
  18. package/dist/cli/commands/ship.js.map +1 -1
  19. package/dist/dashboard/.vite/manifest.json +2 -2
  20. package/dist/dashboard/assets/index-B-l_941W.js +75 -0
  21. package/dist/dashboard/assets/index-B-l_941W.js.map +1 -0
  22. package/dist/dashboard/assets/index-Cv4Vwhuw.css +2 -0
  23. package/dist/dashboard/dashboard-manifest.json +14 -14
  24. package/dist/dashboard/index.html +2 -2
  25. package/dist/services/design-artifact-service.d.ts +42 -1
  26. package/dist/services/design-artifact-service.d.ts.map +1 -1
  27. package/dist/services/design-artifact-service.js +198 -19
  28. package/dist/services/design-artifact-service.js.map +1 -1
  29. package/dist/services/runtime-manager/runtime-package.js +1 -1
  30. package/dist/services/runtime-manager/runtime-package.js.map +1 -1
  31. package/dist/services/ship-checks/contract.d.ts +3 -1
  32. package/dist/services/ship-checks/contract.d.ts.map +1 -1
  33. package/dist/services/ship-checks/contract.js +1 -1
  34. package/dist/services/ship-checks/contract.js.map +1 -1
  35. package/dist/services/ship-checks/discover.d.ts.map +1 -1
  36. package/dist/services/ship-checks/discover.js +2 -1
  37. package/dist/services/ship-checks/discover.js.map +1 -1
  38. package/dist/services/ship-checks/package-contents.d.ts +4 -0
  39. package/dist/services/ship-checks/package-contents.d.ts.map +1 -0
  40. package/dist/services/ship-checks/package-contents.js +91 -0
  41. package/dist/services/ship-checks/package-contents.js.map +1 -0
  42. package/dist/services/ship-checks/packages.d.ts +2 -0
  43. package/dist/services/ship-checks/packages.d.ts.map +1 -1
  44. package/dist/services/ship-checks/packages.js +4 -0
  45. package/dist/services/ship-checks/packages.js.map +1 -1
  46. package/dist/services/ship-checks/scope.js +2 -1
  47. package/dist/services/ship-checks/scope.js.map +1 -1
  48. package/dist/utils/splice-managed-block.js +1 -1
  49. package/dist/utils/splice-managed-block.js.map +1 -1
  50. package/docs/CLI.md +67 -1
  51. package/lib/host-packages/adapter-registry.json +5 -5
  52. package/lib/host-packages/capability-map.json +1 -1
  53. package/lib/host-packages/claude/.claude-plugin/marketplace.json +3 -3
  54. package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +6 -6
  55. package/lib/host-packages/claude/openplanr/.openplanr-content.json +57 -429
  56. package/lib/host-packages/claude/openplanr/README.md +16 -16
  57. package/lib/host-packages/claude/openplanr/references/agents/shared/modes/shared/task-context-resolution.md +4 -4
  58. package/lib/host-packages/claude/openplanr/skills/artifact/references/design-sharing.md +2 -2
  59. package/lib/host-packages/claude/openplanr/skills/delegate/SKILL.md +2 -1
  60. package/lib/host-packages/claude/openplanr/skills/delegate/references/integration-review.md +26 -20
  61. package/lib/host-packages/claude/openplanr/skills/delegate/references/operator-guide.md +25 -1
  62. package/lib/host-packages/claude/openplanr/skills/delegate/references/run-handoff.md +2 -2
  63. package/lib/host-packages/claude/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  64. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  65. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  66. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  67. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  68. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  69. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  70. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  71. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  72. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  73. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  74. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  75. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  76. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  77. package/lib/host-packages/claude/openplanr/skills/design/SKILL.md +23 -12
  78. package/lib/host-packages/claude/openplanr/skills/design/references/design-system.md +2 -2
  79. package/lib/host-packages/claude/openplanr/skills/design/references/generation.md +3 -3
  80. package/lib/host-packages/claude/openplanr/skills/design/references/hosted-canvas.md +6 -3
  81. package/lib/host-packages/claude/openplanr/skills/design/references/review.md +6 -6
  82. package/lib/host-packages/claude/openplanr/skills/design/references/team-review.md +3 -4
  83. package/lib/host-packages/claude/openplanr/skills/design/references/utilities.md +78 -32
  84. package/lib/host-packages/claude/openplanr/skills/design-loop/SKILL.md +15 -7
  85. package/lib/host-packages/claude/openplanr/skills/design-loop/references/design-system.md +2 -2
  86. package/lib/host-packages/claude/openplanr/skills/design-loop/references/generation.md +3 -3
  87. package/lib/host-packages/claude/openplanr/skills/design-loop/references/review.md +6 -6
  88. package/lib/host-packages/claude/openplanr/skills/design-loop/references/team-review.md +3 -4
  89. package/lib/host-packages/claude/openplanr/skills/design-loop/references/utilities.md +78 -32
  90. package/lib/host-packages/claude/openplanr/skills/design-review/SKILL.md +25 -5
  91. package/lib/host-packages/claude/openplanr/skills/design-review/references/design-system.md +2 -2
  92. package/lib/host-packages/claude/openplanr/skills/design-review/references/generation.md +3 -3
  93. package/lib/host-packages/claude/openplanr/skills/design-review/references/review.md +6 -6
  94. package/lib/host-packages/claude/openplanr/skills/design-review/references/team-review.md +3 -4
  95. package/lib/host-packages/claude/openplanr/skills/design-review/references/utilities.md +78 -32
  96. package/lib/host-packages/claude/openplanr/skills/investigate/SKILL.md +1 -0
  97. package/lib/host-packages/claude/openplanr/skills/investigate/references/fail-first.md +40 -0
  98. package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +7 -3
  99. package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +22 -10
  100. package/lib/host-packages/claude/openplanr/skills/ship/references/fail-first.md +40 -0
  101. package/lib/host-packages/claude/openplanr/skills/ship/references/result-contract.md +7 -3
  102. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +55 -427
  103. package/lib/host-packages/cursor/openplanr/manifest.json +1 -1
  104. package/lib/host-packages/cursor/openplanr/rules/planr-artifact/references/design-sharing.md +2 -2
  105. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/integration-review.md +26 -20
  106. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/operator-guide.md +25 -1
  107. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/run-handoff.md +2 -2
  108. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/references/worktree-custody.md +17 -9
  109. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/claude.mjs +15 -3
  110. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/codex.mjs +38 -2
  111. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/adapters/native.mjs +5 -0
  112. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/custody.mjs +217 -10
  113. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/handoff.mjs +1080 -0
  114. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integrate.mjs +96 -201
  115. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-files.mjs +3 -382
  116. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/presentation.mjs +29 -12
  117. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-contract.mjs +11 -0
  118. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-execution.mjs +1 -1
  119. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-lifecycle.mjs +14 -10
  120. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-preparation.mjs +4 -0
  121. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/run-record.mjs +2 -2
  122. package/lib/host-packages/cursor/openplanr/rules/planr-delegate.mdc +2 -1
  123. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/design-system.md +2 -2
  124. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/generation.md +3 -3
  125. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/hosted-canvas.md +6 -3
  126. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/review.md +6 -6
  127. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/team-review.md +3 -4
  128. package/lib/host-packages/cursor/openplanr/rules/planr-design/references/utilities.md +78 -32
  129. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/design-system.md +2 -2
  130. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/generation.md +3 -3
  131. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/review.md +6 -6
  132. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/team-review.md +3 -4
  133. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/references/utilities.md +78 -32
  134. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop.mdc +15 -7
  135. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/design-system.md +2 -2
  136. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/generation.md +3 -3
  137. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/review.md +6 -6
  138. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/team-review.md +3 -4
  139. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/references/utilities.md +78 -32
  140. package/lib/host-packages/cursor/openplanr/rules/planr-design-review.mdc +25 -5
  141. package/lib/host-packages/cursor/openplanr/rules/planr-design.mdc +23 -12
  142. package/lib/host-packages/cursor/openplanr/rules/planr-investigate/references/fail-first.md +40 -0
  143. package/lib/host-packages/cursor/openplanr/rules/planr-investigate.mdc +1 -0
  144. package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +7 -3
  145. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/fail-first.md +40 -0
  146. package/lib/host-packages/cursor/openplanr/rules/planr-ship/references/result-contract.md +7 -3
  147. package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +22 -10
  148. package/lib/host-packages/openai/.claude-plugin/marketplace.json +3 -3
  149. package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +2 -2
  150. package/lib/host-packages/openai/openplanr/.openplanr-content.json +62 -434
  151. package/lib/host-packages/openai/openplanr/skills/artifact/references/design-sharing.md +2 -2
  152. package/lib/host-packages/openai/openplanr/skills/delegate/SKILL.md +2 -1
  153. package/lib/host-packages/openai/openplanr/skills/delegate/openplanr.skill.json +1 -1
  154. package/lib/host-packages/openai/openplanr/skills/delegate/references/integration-review.md +26 -20
  155. package/lib/host-packages/openai/openplanr/skills/delegate/references/operator-guide.md +25 -1
  156. package/lib/host-packages/openai/openplanr/skills/delegate/references/run-handoff.md +2 -2
  157. package/lib/host-packages/openai/openplanr/skills/delegate/references/worktree-custody.md +17 -9
  158. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/claude.mjs +15 -3
  159. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/codex.mjs +38 -2
  160. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/adapters/native.mjs +5 -0
  161. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/custody.mjs +217 -10
  162. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/handoff.mjs +1080 -0
  163. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integrate.mjs +96 -201
  164. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-files.mjs +3 -382
  165. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/presentation.mjs +29 -12
  166. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-contract.mjs +11 -0
  167. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-execution.mjs +1 -1
  168. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-lifecycle.mjs +14 -10
  169. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-preparation.mjs +4 -0
  170. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/run-record.mjs +2 -2
  171. package/lib/host-packages/openai/openplanr/skills/design/SKILL.md +23 -12
  172. package/lib/host-packages/openai/openplanr/skills/design/openplanr.skill.json +0 -11
  173. package/lib/host-packages/openai/openplanr/skills/design/references/design-system.md +2 -2
  174. package/lib/host-packages/openai/openplanr/skills/design/references/generation.md +3 -3
  175. package/lib/host-packages/openai/openplanr/skills/design/references/hosted-canvas.md +6 -3
  176. package/lib/host-packages/openai/openplanr/skills/design/references/review.md +6 -6
  177. package/lib/host-packages/openai/openplanr/skills/design/references/team-review.md +3 -4
  178. package/lib/host-packages/openai/openplanr/skills/design/references/utilities.md +78 -32
  179. package/lib/host-packages/openai/openplanr/skills/design-loop/SKILL.md +15 -7
  180. package/lib/host-packages/openai/openplanr/skills/design-loop/openplanr.skill.json +0 -11
  181. package/lib/host-packages/openai/openplanr/skills/design-loop/references/design-system.md +2 -2
  182. package/lib/host-packages/openai/openplanr/skills/design-loop/references/generation.md +3 -3
  183. package/lib/host-packages/openai/openplanr/skills/design-loop/references/review.md +6 -6
  184. package/lib/host-packages/openai/openplanr/skills/design-loop/references/team-review.md +3 -4
  185. package/lib/host-packages/openai/openplanr/skills/design-loop/references/utilities.md +78 -32
  186. package/lib/host-packages/openai/openplanr/skills/design-review/SKILL.md +25 -5
  187. package/lib/host-packages/openai/openplanr/skills/design-review/openplanr.skill.json +0 -11
  188. package/lib/host-packages/openai/openplanr/skills/design-review/references/design-system.md +2 -2
  189. package/lib/host-packages/openai/openplanr/skills/design-review/references/generation.md +3 -3
  190. package/lib/host-packages/openai/openplanr/skills/design-review/references/review.md +6 -6
  191. package/lib/host-packages/openai/openplanr/skills/design-review/references/team-review.md +3 -4
  192. package/lib/host-packages/openai/openplanr/skills/design-review/references/utilities.md +78 -32
  193. package/lib/host-packages/openai/openplanr/skills/investigate/SKILL.md +1 -0
  194. package/lib/host-packages/openai/openplanr/skills/investigate/openplanr.skill.json +12 -1
  195. package/lib/host-packages/openai/openplanr/skills/investigate/references/fail-first.md +40 -0
  196. package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +7 -3
  197. package/lib/host-packages/openai/openplanr/skills/plan/openplanr.skill.json +0 -11
  198. package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +22 -10
  199. package/lib/host-packages/openai/openplanr/skills/ship/openplanr.skill.json +12 -1
  200. package/lib/host-packages/openai/openplanr/skills/ship/references/fail-first.md +40 -0
  201. package/lib/host-packages/openai/openplanr/skills/ship/references/result-contract.md +7 -3
  202. package/package.json +8 -8
  203. package/dist/dashboard/assets/index-BU5fzjyz.css +0 -1
  204. package/dist/dashboard/assets/index-B_96uzCl.js +0 -572
  205. package/dist/dashboard/assets/index-B_96uzCl.js.map +0 -1
  206. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1774
  207. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  208. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  209. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  210. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  211. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  212. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-handoff.mjs +0 -1576
  213. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  214. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  215. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  216. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  217. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  218. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-review.mjs +0 -3385
  219. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -39
  220. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  221. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  222. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  223. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1113
  224. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +0 -505
  225. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  226. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  227. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  228. package/lib/host-packages/claude/openplanr/runtime/design/scripts/design.mjs +0 -1430
  229. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2050
  230. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  231. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  232. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -809
  233. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -5693
  234. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  235. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  236. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  237. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  238. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  239. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -124
  240. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  241. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  242. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  243. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  244. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -133
  245. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  246. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  247. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  248. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
  249. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
  250. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
  251. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
  252. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +0 -914
  253. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +0 -2578
  254. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
  255. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  256. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  257. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  258. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  259. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  260. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  261. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  262. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  263. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  264. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  265. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  266. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  267. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  268. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -159
  269. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  270. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  271. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  272. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  273. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  274. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  275. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  276. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  277. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  278. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  279. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  280. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  281. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  282. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  283. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  284. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  285. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  286. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  287. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  288. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  289. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  290. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  291. package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  292. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -5468
  293. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design.mjs +0 -2844
  294. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  295. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -159
  296. package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  297. package/lib/host-packages/claude/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
  298. package/lib/host-packages/claude/openplanr/skills/design/scripts/design.mjs +0 -12
  299. package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/design.mjs +0 -12
  300. package/lib/host-packages/claude/openplanr/skills/design-review/scripts/design.mjs +0 -12
  301. package/lib/host-packages/claude/openplanr/skills/plan/scripts/design.mjs +0 -12
  302. package/lib/host-packages/cursor/openplanr/rules/planr-delegate/scripts/integration-transaction.mjs +0 -958
  303. package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/design.mjs +0 -12
  304. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/design.mjs +0 -12
  305. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/design.mjs +0 -12
  306. package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/design.mjs +0 -12
  307. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1774
  308. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  309. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  310. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  311. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  312. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  313. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-handoff.mjs +0 -1576
  314. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  315. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  316. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  317. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  318. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  319. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-review.mjs +0 -3385
  320. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -39
  321. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  322. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  323. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  324. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1113
  325. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +0 -505
  326. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  327. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  328. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  329. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design.mjs +0 -1430
  330. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2050
  331. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  332. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  333. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -809
  334. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -5693
  335. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  336. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  337. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  338. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  339. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  340. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -124
  341. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  342. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  343. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  344. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  345. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -133
  346. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  347. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  348. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  349. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
  350. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
  351. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
  352. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
  353. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +0 -914
  354. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +0 -2578
  355. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
  356. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  357. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  358. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  359. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  360. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  361. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  362. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  363. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  364. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  365. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  366. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  367. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  368. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  369. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -159
  370. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  371. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  372. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  373. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  374. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  375. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  376. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  377. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  378. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  379. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  380. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  381. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  382. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  383. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  384. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  385. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  386. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  387. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  388. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  389. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  390. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  391. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  392. package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  393. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -5468
  394. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design.mjs +0 -2844
  395. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  396. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -159
  397. package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  398. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-artifact-shell.mjs +0 -1774
  399. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-chunked-workspace-client.mjs +0 -555
  400. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-compression.mjs +0 -4180
  401. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-document.mjs +0 -2937
  402. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-encrypted-workspace-client.mjs +0 -647
  403. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-entities.mjs +0 -439
  404. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-handoff.mjs +0 -1576
  405. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-loopback-server.mjs +0 -359
  406. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-owner-custody.mjs +0 -129
  407. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-parser.mjs +0 -3970
  408. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-parse5-tokenizer.mjs +0 -3501
  409. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-resource-pack.mjs +0 -698
  410. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-review.mjs +0 -3385
  411. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-home.mjs +0 -39
  412. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-runtime-support-25485dbf1cb2.mjs +0 -24
  413. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-sandbox-guards.mjs +0 -1102
  414. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +0 -1993
  415. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-dependencies-design-support-protocol-contracts-3d9b1a86.mjs +0 -1113
  416. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-artifact-support-protocol-contracts-ea2cd15e.mjs +0 -505
  417. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-75a938cc.mjs +0 -222
  418. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-b5f28f94.mjs +0 -5907
  419. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-upload-spool.mjs +0 -198
  420. package/lib/host-packages/openai/openplanr/runtime/design/scripts/design.mjs +0 -1430
  421. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -2050
  422. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +0 -2
  423. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/01-module-runtime.js +0 -18
  424. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/02-artifact-review-ui.js +0 -809
  425. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +0 -5693
  426. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/04-compression.js +0 -4175
  427. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/05-artifact-sharing.js +0 -65
  428. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/06-artifact-review-ui.js +0 -1755
  429. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/07-artifact-sharing.js +0 -62
  430. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/08-artifact-review-ui.js +0 -2633
  431. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +0 -124
  432. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +0 -65
  433. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/enhancements.css +0 -388
  434. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/handoff-center.css +0 -81
  435. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.css +0 -1
  436. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/share.js +0 -133
  437. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.css +0 -1159
  438. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/01-module-runtime.js +0 -30
  439. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +0 -900
  440. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +0 -2261
  441. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +0 -1595
  442. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +0 -1467
  443. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +0 -1860
  444. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +0 -914
  445. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +0 -2578
  446. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +0 -582
  447. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/10-react.js +0 -17
  448. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/11-artifact-review-ui.js +0 -12
  449. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/12-protocol-contracts.js +0 -285
  450. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/13-design-review-experience.js +0 -2773
  451. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-studio-shell.js +0 -134
  452. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-canvas-engine.js +0 -2207
  453. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-design-review-experience.js +0 -16
  454. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/17-studio-shell.js +0 -8
  455. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/18-interface-primitives.js +0 -3883
  456. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/19-interface-primitives.js +0 -966
  457. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/20-studio-shell.js +0 -520
  458. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/21-design-studio.js +0 -1597
  459. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +0 -311
  460. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +0 -159
  461. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/registries/artifact-theme.json +0 -64
  462. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.0.0/design-manifest.schema.json +0 -90
  463. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-envelope.schema.json +0 -142
  464. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-paste.schema.json +0 -49
  465. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  466. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-bundle.schema.json +0 -584
  467. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-context.schema.json +0 -191
  468. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-handoff.schema.json +0 -407
  469. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.10.0/design-review-metadata-payload.schema.json +0 -106
  470. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-handoff-readiness.schema.json +0 -398
  471. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-implementation-handoff.schema.json +0 -518
  472. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-planning-lineage.schema.json +0 -106
  473. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.11.0/design-review-metadata-payload.schema.json +0 -107
  474. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.14.0/artifact-theme.schema.json +0 -316
  475. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/artifact-envelope.schema.json +0 -408
  476. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.16.0/design-review-bundle.schema.json +0 -590
  477. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-document.schema.json +0 -506
  478. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.22.0/design-review-bundle.schema.json +0 -822
  479. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-bundle.schema.json +0 -346
  480. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-review-workspace.schema.json +0 -108
  481. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-create.schema.json +0 -170
  482. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-event.schema.json +0 -97
  483. package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/schemas/v1.9.0/design-workspace-revision.schema.json +0 -56
  484. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +0 -5468
  485. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design.mjs +0 -2844
  486. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +0 -21
  487. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +0 -159
  488. package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/schemas/v1.1.0/artifact-review.schema.json +0 -97
  489. package/lib/host-packages/openai/openplanr/skills/delegate/scripts/integration-transaction.mjs +0 -958
  490. package/lib/host-packages/openai/openplanr/skills/design/scripts/design.mjs +0 -12
  491. package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/design.mjs +0 -12
  492. package/lib/host-packages/openai/openplanr/skills/design-review/scripts/design.mjs +0 -12
  493. package/lib/host-packages/openai/openplanr/skills/plan/scripts/design.mjs +0 -12
@@ -1,3883 +0,0 @@
1
-
2
-
3
- // ../../node_modules/@radix-ui/react-primitive/dist/index.mjs
4
- var React3 = __toESM(require_react(), 1), ReactDOM = __toESM(require_react_dom(), 1);
5
-
6
- // ../../node_modules/@radix-ui/react-slot/dist/index.mjs
7
- var React2 = __toESM(require_react(), 1);
8
-
9
- // ../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs
10
- var React = __toESM(require_react(), 1), __defProp2 = Object.defineProperty, __name = (target, value) => __defProp2(target, "name", { value, configurable: !0 });
11
- function setRef(ref, value) {
12
- if (typeof ref == "function")
13
- return ref(value);
14
- ref != null && (ref.current = value);
15
- }
16
- __name(setRef, "setRef");
17
- function composeRefs(...refs) {
18
- return (node) => {
19
- let hasCleanup = !1, cleanups = refs.map((ref) => {
20
- let cleanup = setRef(ref, node);
21
- return !hasCleanup && typeof cleanup == "function" && (hasCleanup = !0), cleanup;
22
- });
23
- if (hasCleanup)
24
- return () => {
25
- for (let i = 0; i < cleanups.length; i++) {
26
- let cleanup = cleanups[i];
27
- typeof cleanup == "function" ? cleanup() : setRef(refs[i], null);
28
- }
29
- };
30
- };
31
- }
32
- __name(composeRefs, "composeRefs");
33
- function useComposedRefs(...refs) {
34
- return React.useCallback(composeRefs(...refs), refs);
35
- }
36
- __name(useComposedRefs, "useComposedRefs");
37
-
38
- // ../../node_modules/@radix-ui/react-slot/dist/index.mjs
39
- var __defProp3 = Object.defineProperty, __name2 = (target, value) => __defProp3(target, "name", { value, configurable: !0 });
40
- // @__NO_SIDE_EFFECTS__
41
- function createSlot(ownerName) {
42
- let Slot22 = React2.forwardRef((props, forwardedRef) => {
43
- let { children, ...slotProps } = props, slottableElement = null, hasSlottable = !1, newChildren = [];
44
- children = useUnwrappedLazy(children), React2.Children.forEach(children, (maybeSlottable) => {
45
- if (isSlottable(maybeSlottable)) {
46
- hasSlottable = !0;
47
- let slottable = maybeSlottable, child = "child" in slottable.props ? slottable.props.child : slottable.props.children;
48
- for (; isLazyComponent(child) && typeof use == "function"; )
49
- child = use(child._payload);
50
- slottableElement = getSlottableElementFromSlottable(slottable, child), newChildren.push(slottableElement?.props?.children);
51
- } else
52
- newChildren.push(maybeSlottable);
53
- }), slottableElement ? slottableElement = React2.cloneElement(slottableElement, void 0, newChildren) : (
54
- // A `Slottable` was found but it didn't resolve to a single element (e.g.
55
- // it wrapped multiple elements, text, or a render-prop `child` that
56
- // wasn't an element). Don't fall back to treating the `Slottable` wrapper
57
- // itself as the slot target — throw a descriptive error below instead.
58
- !hasSlottable && React2.Children.count(children) === 1 && React2.isValidElement(children) && (slottableElement = children)
59
- );
60
- let slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0, composedRef = useComposedRefs(forwardedRef, slottableElementRef);
61
- if (!slottableElement) {
62
- if (children || children === 0)
63
- throw new Error(
64
- hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)
65
- );
66
- return children;
67
- }
68
- let mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
69
- return slottableElement.type !== React2.Fragment && (mergedProps.ref = forwardedRef ? composedRef : slottableElementRef), React2.cloneElement(slottableElement, mergedProps);
70
- });
71
- return Slot22.displayName = `${ownerName}.Slot`, Slot22;
72
- }
73
- __name2(createSlot, "createSlot");
74
- var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol.for("radix.slottable");
75
- // @__NO_SIDE_EFFECTS__
76
- function createSlottable(ownerName) {
77
- let Slottable2 = /* @__PURE__ */ __name2((props) => "child" in props ? props.children(props.child) : props.children, "Slottable");
78
- return Slottable2.displayName = `${ownerName}.Slottable`, Slottable2.__radixId = SLOTTABLE_IDENTIFIER, Slottable2;
79
- }
80
- __name2(createSlottable, "createSlottable");
81
- var getSlottableElementFromSlottable = /* @__PURE__ */ __name2((slottable, child) => "child" in slottable.props ? React2.isValidElement(child) ? React2.cloneElement(child, void 0, slottable.props.children(child.props.children)) : null : React2.isValidElement(child) ? child : null, "getSlottableElementFromSlottable");
82
- function mergeProps(slotProps, childProps) {
83
- let overrideProps = { ...childProps };
84
- for (let propName in childProps) {
85
- let slotPropValue = slotProps[propName], childPropValue = childProps[propName];
86
- /^on[A-Z]/.test(propName) ? slotPropValue && childPropValue ? overrideProps[propName] = (...args) => {
87
- let result = childPropValue(...args);
88
- return slotPropValue(...args), result;
89
- } : slotPropValue && (overrideProps[propName] = slotPropValue) : propName === "style" ? overrideProps[propName] = { ...slotPropValue, ...childPropValue } : propName === "className" ? overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ") : propName === "aria-describedby" && (overrideProps[propName] = concatAriaDescribedby(childPropValue, slotPropValue));
90
- }
91
- return { ...slotProps, ...overrideProps };
92
- }
93
- __name2(mergeProps, "mergeProps");
94
- function getElementRef(element) {
95
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
96
- return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
97
- }
98
- __name2(getElementRef, "getElementRef");
99
- function isSlottable(child) {
100
- return React2.isValidElement(child) && typeof child.type == "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
101
- }
102
- __name2(isSlottable, "isSlottable");
103
- var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
104
- function isLazyComponent(element) {
105
- return element != null && typeof element == "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
106
- }
107
- __name2(isLazyComponent, "isLazyComponent");
108
- function isPromiseLike(value) {
109
- return typeof value == "object" && value !== null && "then" in value;
110
- }
111
- __name2(isPromiseLike, "isPromiseLike");
112
- function useUnwrappedLazy(value) {
113
- let unwrapped = value;
114
- for (; isLazyComponent(unwrapped) && typeof use == "function"; )
115
- unwrapped = use(unwrapped._payload);
116
- return unwrapped;
117
- }
118
- __name2(useUnwrappedLazy, "useUnwrappedLazy");
119
- function concatAriaDescribedby(...values) {
120
- let ids = /* @__PURE__ */ new Set();
121
- for (let value of values)
122
- if (typeof value == "string")
123
- for (let id of String(value).trim().split(/\s+/))
124
- id && ids.add(id);
125
- return ids.size > 0 ? Array.from(ids).join(" ") : void 0;
126
- }
127
- __name2(concatAriaDescribedby, "concatAriaDescribedby");
128
- var createSlotError = /* @__PURE__ */ __name2((ownerName) => `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`, "createSlotError"), createSlottableError = /* @__PURE__ */ __name2((ownerName) => `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`, "createSlottableError"), use = React2[" use ".trim().toString()];
129
-
130
- // ../../node_modules/@radix-ui/react-primitive/dist/index.mjs
131
- var import_jsx_runtime = __toESM(require_jsx_runtime(), 1), __defProp4 = Object.defineProperty, __name3 = (target, value) => __defProp4(target, "name", { value, configurable: !0 }), NODES = [
132
- "a",
133
- "button",
134
- "div",
135
- "form",
136
- "h2",
137
- "h3",
138
- "img",
139
- "input",
140
- "label",
141
- "li",
142
- "nav",
143
- "ol",
144
- "p",
145
- "select",
146
- "span",
147
- "svg",
148
- "ul"
149
- ], Primitive = NODES.reduce((primitive, node) => {
150
- let Slot3 = createSlot(`Primitive.${node}`), Node2 = React3.forwardRef((props, forwardedRef) => {
151
- let { asChild, ...primitiveProps } = props, Comp = asChild ? Slot3 : node;
152
- return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
153
- });
154
- return Node2.displayName = `Primitive.${node}`, { ...primitive, [node]: Node2 };
155
- }, {});
156
- function dispatchDiscreteCustomEvent(target, event) {
157
- target && ReactDOM.flushSync(() => target.dispatchEvent(event));
158
- }
159
- __name3(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
160
-
161
- // ../../node_modules/@radix-ui/react-context/dist/index.mjs
162
- var React4 = __toESM(require_react(), 1), import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1), __defProp5 = Object.defineProperty, __name4 = (target, value) => __defProp5(target, "name", { value, configurable: !0 });
163
- // @__NO_SIDE_EFFECTS__
164
- function createContext2(rootComponentName, defaultContext) {
165
- let Context = React4.createContext(defaultContext);
166
- Context.displayName = rootComponentName + "Context";
167
- let Provider = /* @__PURE__ */ __name4((props) => {
168
- let { children, ...context } = props, value = React4.useMemo(() => context, Object.values(context));
169
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Context.Provider, { value, children });
170
- }, "Provider");
171
- Provider.displayName = rootComponentName + "Provider";
172
- function useContext22(consumerName, options2 = {}) {
173
- let { optional = !1 } = options2, context = React4.useContext(Context);
174
- if (context) return context;
175
- if (defaultContext !== void 0) return defaultContext;
176
- if (!optional)
177
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
178
- }
179
- return __name4(useContext22, "useContext"), [Provider, useContext22];
180
- }
181
- __name4(createContext2, "createContext");
182
- // @__NO_SIDE_EFFECTS__
183
- function createContextScope(scopeName, createContextScopeDeps = []) {
184
- let defaultContexts = [];
185
- function createContext32(rootComponentName, defaultContext) {
186
- let BaseContext = React4.createContext(defaultContext);
187
- BaseContext.displayName = rootComponentName + "Context";
188
- let index2 = defaultContexts.length;
189
- defaultContexts = [...defaultContexts, defaultContext];
190
- let Provider = /* @__PURE__ */ __name4((props) => {
191
- let { scope, children, ...context } = props, Context = scope?.[scopeName]?.[index2] || BaseContext, value = React4.useMemo(() => context, Object.values(context));
192
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Context.Provider, { value, children });
193
- }, "Provider");
194
- Provider.displayName = rootComponentName + "Provider";
195
- function useContext22(consumerName, scope, options2 = {}) {
196
- let { optional = !1 } = options2, Context = scope?.[scopeName]?.[index2] || BaseContext, context = React4.useContext(Context);
197
- if (context) return context;
198
- if (defaultContext !== void 0) return defaultContext;
199
- if (!optional)
200
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
201
- }
202
- return __name4(useContext22, "useContext"), [Provider, useContext22];
203
- }
204
- __name4(createContext32, "createContext");
205
- let createScope = /* @__PURE__ */ __name4(() => {
206
- let scopeContexts = defaultContexts.map((defaultContext) => React4.createContext(defaultContext));
207
- return /* @__PURE__ */ __name4(function(scope) {
208
- let contexts = scope?.[scopeName] || scopeContexts;
209
- return React4.useMemo(
210
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
211
- [scope, contexts]
212
- );
213
- }, "useScope");
214
- }, "createScope");
215
- return createScope.scopeName = scopeName, [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
216
- }
217
- __name4(createContextScope, "createContextScope");
218
- function composeContextScopes(...scopes) {
219
- let baseScope = scopes[0];
220
- if (scopes.length === 1) return baseScope;
221
- let createScope = /* @__PURE__ */ __name4(() => {
222
- let scopeHooks = scopes.map((createScope2) => ({
223
- useScope: createScope2(),
224
- scopeName: createScope2.scopeName
225
- }));
226
- return /* @__PURE__ */ __name4(function(overrideScopes) {
227
- let nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
228
- let currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
229
- return { ...nextScopes2, ...currentScope };
230
- }, {});
231
- return React4.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
232
- }, "useComposedScopes");
233
- }, "createScope");
234
- return createScope.scopeName = baseScope.scopeName, createScope;
235
- }
236
- __name4(composeContextScopes, "composeContextScopes");
237
-
238
- // ../../node_modules/@radix-ui/react-collection/dist/index.mjs
239
- var React6 = __toESM(require_react(), 1);
240
- var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1), React22 = __toESM(require_react(), 1);
241
-
242
- // ../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
243
- var React5 = __toESM(require_react(), 1), useLayoutEffect2 = globalThis?.document ? React5.useLayoutEffect : () => {
244
- };
245
-
246
- // ../../node_modules/@radix-ui/react-collection/dist/index.mjs
247
- var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1), __defProp6 = Object.defineProperty, __name5 = (target, value) => __defProp6(target, "name", { value, configurable: !0 });
248
- // @__NO_SIDE_EFFECTS__
249
- function createCollection(name) {
250
- let PROVIDER_NAME = name + "CollectionProvider", [createCollectionContext, createCollectionScope3] = createContextScope(PROVIDER_NAME), [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
251
- PROVIDER_NAME,
252
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
253
- ), CollectionProvider = /* @__PURE__ */ __name5((props) => {
254
- let { scope, children } = props, ref = React6.useRef(null), itemMap = React6.useRef(/* @__PURE__ */ new Map()).current;
255
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
256
- }, "CollectionProvider");
257
- CollectionProvider.displayName = PROVIDER_NAME;
258
- let COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME), CollectionSlot = React6.forwardRef(
259
- (props, forwardedRef) => {
260
- let { scope, children } = props, context = useCollectionContext(COLLECTION_SLOT_NAME, scope), composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
261
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CollectionSlotImpl, { ref: composedRefs, children });
262
- }
263
- );
264
- CollectionSlot.displayName = COLLECTION_SLOT_NAME;
265
- let ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-radix-collection-item", CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME), CollectionItemSlot = React6.forwardRef(
266
- (props, forwardedRef) => {
267
- let { scope, children, ...itemData } = props, ref = React6.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), context = useCollectionContext(ITEM_SLOT_NAME, scope);
268
- return React6.useEffect(() => (context.itemMap.set(ref, { ref, ...itemData }), () => {
269
- context.itemMap.delete(ref);
270
- })), /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CollectionItemSlotImpl, { [ITEM_DATA_ATTR]: "", ref: composedRefs, children });
271
- }
272
- );
273
- CollectionItemSlot.displayName = ITEM_SLOT_NAME;
274
- function useCollection3(scope) {
275
- let context = useCollectionContext(name + "CollectionConsumer", scope);
276
- return React6.useCallback(() => {
277
- let collectionNode = context.collectionRef.current;
278
- if (!collectionNode) return [];
279
- let orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
280
- return Array.from(context.itemMap.values()).sort(
281
- (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
282
- );
283
- }, [context.collectionRef, context.itemMap]);
284
- }
285
- return __name5(useCollection3, "useCollection"), [
286
- { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
287
- useCollection3,
288
- createCollectionScope3
289
- ];
290
- }
291
- __name5(createCollection, "createCollection");
292
- var __instanciated = /* @__PURE__ */ new WeakMap(), OrderedDict = class _OrderedDict extends Map {
293
- static {
294
- __name5(this, "OrderedDict");
295
- }
296
- #keys;
297
- constructor(entries) {
298
- super(entries), this.#keys = [...super.keys()], __instanciated.set(this, !0);
299
- }
300
- set(key, value) {
301
- return __instanciated.get(this) && !this.has(key) && this.#keys.push(key), super.set(key, value), this;
302
- }
303
- /**
304
- * Sets a key-value pair so that it ends up at the given index.
305
- * - Existing keys are moved
306
- * - Negative indices count from the end of the resulting dictionary, so
307
- * inserting at -1 makes the item the last one, -2 the second to last, etc.
308
- * - Out-of-range indices are clamped
309
- */
310
- insert(index2, key, value) {
311
- let has = this.has(key), finalSize = has ? this.size : this.size + 1, relativeIndex = toSafeInteger(index2), targetIndex = relativeIndex >= 0 ? Math.min(relativeIndex, finalSize - 1) : Math.max(finalSize + relativeIndex, 0);
312
- if (has ? this.#keys.indexOf(key) === targetIndex : targetIndex === this.size)
313
- return this.set(key, value), this;
314
- let keys = this.#keys.filter((existingKey) => existingKey !== key);
315
- keys.splice(targetIndex, 0, key);
316
- let entries = keys.map((entryKey) => [
317
- entryKey,
318
- entryKey === key ? value : this.get(entryKey)
319
- ]);
320
- this.clear();
321
- for (let [entryKey, entryValue] of entries)
322
- this.set(entryKey, entryValue);
323
- return this;
324
- }
325
- with(index2, key, value) {
326
- let copy = new _OrderedDict(this);
327
- return copy.insert(index2, key, value), copy;
328
- }
329
- before(key) {
330
- let index2 = this.#keys.indexOf(key) - 1;
331
- if (!(index2 < 0))
332
- return this.entryAt(index2);
333
- }
334
- /**
335
- * Sets a new key-value pair at the position before the given key.
336
- */
337
- setBefore(key, newKey, value) {
338
- let index2 = this.#keys.indexOf(key);
339
- if (index2 === -1)
340
- return this;
341
- let currentIndex = this.#keys.indexOf(newKey), targetIndex = currentIndex !== -1 && currentIndex < index2 ? index2 - 1 : index2;
342
- return this.insert(targetIndex, newKey, value);
343
- }
344
- after(key) {
345
- let index2 = this.#keys.indexOf(key);
346
- if (index2 = index2 === -1 || index2 === this.size - 1 ? -1 : index2 + 1, index2 !== -1)
347
- return this.entryAt(index2);
348
- }
349
- /**
350
- * Sets a new key-value pair at the position after the given key.
351
- */
352
- setAfter(key, newKey, value) {
353
- let index2 = this.#keys.indexOf(key);
354
- if (index2 === -1)
355
- return this;
356
- let currentIndex = this.#keys.indexOf(newKey), targetIndex = currentIndex !== -1 && currentIndex <= index2 ? index2 : index2 + 1;
357
- return this.insert(targetIndex, newKey, value);
358
- }
359
- first() {
360
- return this.entryAt(0);
361
- }
362
- last() {
363
- return this.entryAt(-1);
364
- }
365
- clear() {
366
- return this.#keys = [], super.clear();
367
- }
368
- delete(key) {
369
- let deleted = super.delete(key);
370
- return deleted && this.#keys.splice(this.#keys.indexOf(key), 1), deleted;
371
- }
372
- deleteAt(index2) {
373
- let key = this.keyAt(index2);
374
- return key !== void 0 ? this.delete(key) : !1;
375
- }
376
- at(index2) {
377
- let key = at(this.#keys, index2);
378
- if (key !== void 0)
379
- return this.get(key);
380
- }
381
- entryAt(index2) {
382
- let key = at(this.#keys, index2);
383
- if (key !== void 0)
384
- return [key, this.get(key)];
385
- }
386
- indexOf(key) {
387
- return this.#keys.indexOf(key);
388
- }
389
- keyAt(index2) {
390
- return at(this.#keys, index2);
391
- }
392
- from(key, offset4) {
393
- let index2 = this.indexOf(key);
394
- if (index2 === -1)
395
- return;
396
- let dest = index2 + offset4;
397
- return dest < 0 && (dest = 0), dest >= this.size && (dest = this.size - 1), this.at(dest);
398
- }
399
- keyFrom(key, offset4) {
400
- let index2 = this.indexOf(key);
401
- if (index2 === -1)
402
- return;
403
- let dest = index2 + offset4;
404
- return dest < 0 && (dest = 0), dest >= this.size && (dest = this.size - 1), this.keyAt(dest);
405
- }
406
- find(predicate, thisArg) {
407
- let index2 = 0;
408
- for (let entry of this) {
409
- if (Reflect.apply(predicate, thisArg, [entry, index2, this]))
410
- return entry;
411
- index2++;
412
- }
413
- }
414
- findIndex(predicate, thisArg) {
415
- let index2 = 0;
416
- for (let entry of this) {
417
- if (Reflect.apply(predicate, thisArg, [entry, index2, this]))
418
- return index2;
419
- index2++;
420
- }
421
- return -1;
422
- }
423
- filter(predicate, thisArg) {
424
- let entries = [], index2 = 0;
425
- for (let entry of this)
426
- Reflect.apply(predicate, thisArg, [entry, index2, this]) && entries.push(entry), index2++;
427
- return new _OrderedDict(entries);
428
- }
429
- map(callbackfn, thisArg) {
430
- let entries = [], index2 = 0;
431
- for (let entry of this)
432
- entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index2, this])]), index2++;
433
- return new _OrderedDict(entries);
434
- }
435
- reduce(...args) {
436
- let [callbackfn, initialValue] = args, hasInitialValue = args.length > 1;
437
- if (!hasInitialValue && this.size === 0)
438
- throw new TypeError("Reduce of empty OrderedDict with no initial value");
439
- let index2 = 0, accumulator = initialValue;
440
- for (let entry of this)
441
- index2 === 0 && !hasInitialValue ? accumulator = entry : accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]), index2++;
442
- return accumulator;
443
- }
444
- reduceRight(...args) {
445
- let [callbackfn, initialValue] = args, hasInitialValue = args.length > 1;
446
- if (!hasInitialValue && this.size === 0)
447
- throw new TypeError("Reduce of empty OrderedDict with no initial value");
448
- let accumulator = initialValue;
449
- for (let index2 = this.size - 1; index2 >= 0; index2--) {
450
- let entry = this.entryAt(index2);
451
- index2 === this.size - 1 && !hasInitialValue ? accumulator = entry : accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
452
- }
453
- return accumulator;
454
- }
455
- /**
456
- * Sorts the dictionary in place. This method mutates the dictionary and
457
- * returns a reference to the same object
458
- *
459
- * @param compareFn Function used to determine the order of the elements. It
460
- * is expected to return a negative value if the first argument is less than
461
- * the second argument, zero if they're equal, and a positive value otherwise.
462
- */
463
- sort(compareFn) {
464
- if (typeof compareFn != "function")
465
- throw new TypeError("OrderedDict.sort requires a compare function");
466
- let entries = [...this.entries()].sort(compareFn);
467
- this.clear();
468
- for (let [key, value] of entries)
469
- this.set(key, value);
470
- return this;
471
- }
472
- /**
473
- * Returns a copy of the dictionary with its elements sorted.
474
- *
475
- * @param compareFn Function used to determine the order of the elements. It
476
- * is expected to return a negative value if the first argument is less than
477
- * the second argument, zero if they're equal, and a positive value otherwise.
478
- */
479
- toSorted(compareFn) {
480
- if (typeof compareFn != "function")
481
- throw new TypeError("OrderedDict.toSorted requires a compare function");
482
- let entries = [...this.entries()].sort(compareFn);
483
- return new _OrderedDict(entries);
484
- }
485
- toReversed() {
486
- let reversed = new _OrderedDict();
487
- for (let index2 = this.size - 1; index2 >= 0; index2--) {
488
- let key = this.keyAt(index2), element = this.get(key);
489
- reversed.set(key, element);
490
- }
491
- return reversed;
492
- }
493
- toSpliced(...args) {
494
- let entries = [...this.entries()];
495
- return entries.splice(...args), new _OrderedDict(entries);
496
- }
497
- slice(start2, end) {
498
- let result = new _OrderedDict();
499
- for (let key of this.#keys.slice(start2, end))
500
- result.set(key, this.get(key));
501
- return result;
502
- }
503
- every(predicate, thisArg) {
504
- let index2 = 0;
505
- for (let entry of this) {
506
- if (!Reflect.apply(predicate, thisArg, [entry, index2, this]))
507
- return !1;
508
- index2++;
509
- }
510
- return !0;
511
- }
512
- some(predicate, thisArg) {
513
- let index2 = 0;
514
- for (let entry of this) {
515
- if (Reflect.apply(predicate, thisArg, [entry, index2, this]))
516
- return !0;
517
- index2++;
518
- }
519
- return !1;
520
- }
521
- };
522
- function at(array, index2) {
523
- if ("at" in Array.prototype)
524
- return Array.prototype.at.call(array, index2);
525
- let actualIndex = toSafeIndex(array, index2);
526
- return actualIndex === -1 ? void 0 : array[actualIndex];
527
- }
528
- __name5(at, "at");
529
- function toSafeIndex(array, index2) {
530
- let length = array.length, relativeIndex = toSafeInteger(index2), actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;
531
- return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;
532
- }
533
- __name5(toSafeIndex, "toSafeIndex");
534
- function toSafeInteger(number) {
535
- return number !== number || number === 0 ? 0 : Math.trunc(number);
536
- }
537
- __name5(toSafeInteger, "toSafeInteger");
538
- // @__NO_SIDE_EFFECTS__
539
- function createCollection2(name) {
540
- let PROVIDER_NAME = name + "CollectionProvider", [createCollectionContext, createCollectionScope3] = createContextScope(PROVIDER_NAME), [CollectionStableContextProvider, useStableCollectionContext] = createCollectionContext(PROVIDER_NAME);
541
- CollectionStableContextProvider.displayName = name + "CollectionStableContextProvider";
542
- let [CollectionStatefulContextProvider, useStatefulCollectionContext] = createCollectionContext(PROVIDER_NAME);
543
- CollectionStatefulContextProvider.displayName = name + "CollectionStatefulContextProvider";
544
- let CollectionProvider = /* @__PURE__ */ __name5(({ state, ...props }) => state ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollectionInit, { ...props }), "CollectionProvider");
545
- CollectionProvider.displayName = PROVIDER_NAME;
546
- let CollectionInit = /* @__PURE__ */ __name5((props) => {
547
- let state = useInitCollection();
548
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollectionProviderImpl, { ...props, state });
549
- }, "CollectionInit");
550
- CollectionInit.displayName = name + "CollectionInit";
551
- let CollectionProviderImpl = /* @__PURE__ */ __name5((props) => {
552
- let { scope, children, state } = props, ref = React22.useRef(null), [collectionElement, setCollectionElement] = React22.useState(
553
- null
554
- ), composeRefs2 = useComposedRefs(ref, setCollectionElement), [collection, setCollection] = state, registryRef = React22.useRef(
555
- new OrderedDict()
556
- ), getCollection = React22.useCallback(() => {
557
- let registry = registryRef.current;
558
- return isInDocumentOrder(registry) || registry.sort(sortByDocumentPosition), registry;
559
- }, []);
560
- return React22.useEffect(() => {
561
- if (!collectionElement)
562
- return;
563
- let observer = getChildListObserver(() => {
564
- setCollection((map) => {
565
- let sorted = map.toSorted(sortByDocumentPosition);
566
- return sorted.some(([key], index2) => map.keyAt(index2) !== key) ? sorted : map;
567
- });
568
- });
569
- return observer.observe(collectionElement, {
570
- childList: !0,
571
- subtree: !0
572
- }), () => {
573
- observer.disconnect();
574
- };
575
- }, [collectionElement, setCollection]), /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
576
- CollectionStableContextProvider,
577
- {
578
- scope,
579
- collectionElementRef: composeRefs2,
580
- collectionElementRefObject: ref,
581
- getCollection,
582
- setCollection,
583
- registryRef,
584
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
585
- CollectionStatefulContextProvider,
586
- {
587
- scope,
588
- collectionElement,
589
- collection,
590
- children
591
- }
592
- )
593
- }
594
- );
595
- }, "CollectionProviderImpl");
596
- CollectionProviderImpl.displayName = name + "CollectionProviderImpl";
597
- let COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME), CollectionSlot = React22.forwardRef(
598
- (props, forwardedRef) => {
599
- let { scope, children } = props, context = useStableCollectionContext(COLLECTION_SLOT_NAME, scope), composedRefs = useComposedRefs(forwardedRef, context.collectionElementRef);
600
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollectionSlotImpl, { ref: composedRefs, children });
601
- }
602
- );
603
- CollectionSlot.displayName = COLLECTION_SLOT_NAME;
604
- let ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-radix-collection-item", CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME), CollectionItemSlot = React22.forwardRef(
605
- (props, forwardedRef) => {
606
- let { scope, children, ...itemData } = props, ref = React22.useRef(null), context = useStableCollectionContext(ITEM_SLOT_NAME, scope), { setCollection, registryRef } = context, itemDataRef = React22.useRef(itemData);
607
- shallowEqual(itemDataRef.current, itemData) || (itemDataRef.current = itemData);
608
- let memoizedItemData = itemDataRef.current, registerElement = React22.useCallback(
609
- (node) => {
610
- let registry = registryRef.current;
611
- node ? registry.set(node, {
612
- ...itemDataRef.current,
613
- element: node
614
- }) : ref.current && registry.delete(ref.current);
615
- },
616
- [registryRef]
617
- ), composedRefs = useComposedRefs(forwardedRef, registerElement, ref);
618
- useLayoutEffect2(() => {
619
- let node = ref.current, registry = registryRef.current;
620
- node && registry.has(node) && registry.set(node, { ...memoizedItemData, element: node });
621
- }, [memoizedItemData, registryRef]);
622
- let registeredRef = React22.useRef(null);
623
- return React22.useEffect(() => {
624
- let element = ref.current, registered = registeredRef.current;
625
- (registered?.element ?? null) === element && (!element || registered?.itemData === memoizedItemData) || (registeredRef.current = element ? { element, itemData: memoizedItemData } : null, setCollection((map) => {
626
- let next = new OrderedDict(map);
627
- return registered && registered.element !== element && next.delete(registered.element), element && next.set(element, { ...memoizedItemData, element }), next.sort(sortByDocumentPosition);
628
- }));
629
- }), React22.useEffect(() => () => {
630
- let registered = registeredRef.current;
631
- registeredRef.current = null, registered && setCollection((map) => {
632
- if (!map.has(registered.element))
633
- return map;
634
- let next = new OrderedDict(map);
635
- return next.delete(registered.element), next;
636
- });
637
- }, [setCollection]), /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollectionItemSlotImpl, { [ITEM_DATA_ATTR]: "", ref: composedRefs, children });
638
- }
639
- );
640
- CollectionItemSlot.displayName = ITEM_SLOT_NAME;
641
- function useInitCollection() {
642
- return React22.useState(new OrderedDict());
643
- }
644
- __name5(useInitCollection, "useInitCollection");
645
- function useCollection3(scope) {
646
- let { collection } = useStatefulCollectionContext(name + "CollectionConsumer", scope);
647
- return collection;
648
- }
649
- __name5(useCollection3, "useCollection");
650
- function useGetCollection(scope) {
651
- let { getCollection } = useStableCollectionContext(name + "CollectionConsumer", scope);
652
- return getCollection;
653
- }
654
- return __name5(useGetCollection, "useGetCollection"), [
655
- { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
656
- {
657
- createCollectionScope: createCollectionScope3,
658
- useCollection: useCollection3,
659
- useGetCollection,
660
- useInitCollection
661
- }
662
- ];
663
- }
664
- __name5(createCollection2, "createCollection");
665
- function shallowEqual(a, b) {
666
- if (a === b) return !0;
667
- if (typeof a != "object" || typeof b != "object" || a == null || b == null) return !1;
668
- let keysA = Object.keys(a), keysB = Object.keys(b);
669
- if (keysA.length !== keysB.length) return !1;
670
- for (let key of keysA)
671
- if (!Object.prototype.hasOwnProperty.call(b, key) || a[key] !== b[key]) return !1;
672
- return !0;
673
- }
674
- __name5(shallowEqual, "shallowEqual");
675
- function isElementPreceding(a, b) {
676
- return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);
677
- }
678
- __name5(isElementPreceding, "isElementPreceding");
679
- function isInDocumentOrder(dict) {
680
- let previous;
681
- for (let element of dict.keys()) {
682
- if (previous) {
683
- let position = previous.compareDocumentPosition(element);
684
- if (!(position & Node.DOCUMENT_POSITION_DISCONNECTED) && position & Node.DOCUMENT_POSITION_PRECEDING)
685
- return !1;
686
- }
687
- previous = element;
688
- }
689
- return !0;
690
- }
691
- __name5(isInDocumentOrder, "isInDocumentOrder");
692
- function sortByDocumentPosition(a, b) {
693
- return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;
694
- }
695
- __name5(sortByDocumentPosition, "sortByDocumentPosition");
696
- function getChildListObserver(callback) {
697
- return new MutationObserver((mutationsList) => {
698
- for (let mutation of mutationsList)
699
- if (mutation.type === "childList") {
700
- callback();
701
- return;
702
- }
703
- });
704
- }
705
- __name5(getChildListObserver, "getChildListObserver");
706
-
707
- // ../../node_modules/@radix-ui/primitive/dist/index.mjs
708
- var __defProp7 = Object.defineProperty, __name6 = (target, value) => __defProp7(target, "name", { value, configurable: !0 }), canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement);
709
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = !0 } = {}) {
710
- return /* @__PURE__ */ __name6(function(event) {
711
- if (originalEventHandler?.(event), checkForDefaultPrevented === !1 || !event || !event.defaultPrevented)
712
- return ourEventHandler?.(event);
713
- }, "handleEvent");
714
- }
715
- __name6(composeEventHandlers, "composeEventHandlers");
716
- function getOwnerWindow(element) {
717
- if (!canUseDOM)
718
- throw new Error("Cannot access window outside of the DOM");
719
- return element?.ownerDocument?.defaultView ?? window;
720
- }
721
- __name6(getOwnerWindow, "getOwnerWindow");
722
- function getOwnerDocument(element) {
723
- if (!canUseDOM)
724
- throw new Error("Cannot access document outside of the DOM");
725
- return element?.ownerDocument ?? document;
726
- }
727
- __name6(getOwnerDocument, "getOwnerDocument");
728
- function getActiveElement(node, activeDescendant = !1) {
729
- let { activeElement } = getOwnerDocument(node);
730
- if (!activeElement?.nodeName)
731
- return null;
732
- if (isFrame(activeElement) && activeElement.contentDocument)
733
- return getActiveElement(activeElement.contentDocument.body, activeDescendant);
734
- if (activeDescendant) {
735
- let id = activeElement.getAttribute("aria-activedescendant");
736
- if (id) {
737
- let element = getOwnerDocument(activeElement).getElementById(id);
738
- if (element)
739
- return element;
740
- }
741
- }
742
- return activeElement;
743
- }
744
- __name6(getActiveElement, "getActiveElement");
745
- function isFrame(element) {
746
- return element.tagName === "IFRAME";
747
- }
748
- __name6(isFrame, "isFrame");
749
-
750
- // ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
751
- var React8 = __toESM(require_react(), 1);
752
-
753
- // ../../node_modules/@radix-ui/primitive/dist/internal/is-development.false.mjs
754
- var IS_DEVELOPMENT = !1;
755
-
756
- // ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
757
- var React23 = __toESM(require_react(), 1);
758
-
759
- // ../../node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
760
- var React7 = __toESM(require_react(), 1), __defProp8 = Object.defineProperty, __name7 = (target, value) => __defProp8(target, "name", { value, configurable: !0 }), useReactEffectEvent = React7[" useEffectEvent ".trim().toString()], useReactInsertionEffect = React7[" useInsertionEffect ".trim().toString()];
761
- function useEffectEvent(callback) {
762
- if (typeof useReactEffectEvent == "function")
763
- return useReactEffectEvent(callback);
764
- let ref = React7.useRef(() => {
765
- throw new Error("Cannot call an event handler while rendering.");
766
- });
767
- return typeof useReactInsertionEffect == "function" ? useReactInsertionEffect(() => {
768
- ref.current = callback;
769
- }) : useLayoutEffect2(() => {
770
- ref.current = callback;
771
- }), React7.useMemo(() => ((...args) => ref.current?.(...args)), []);
772
- }
773
- __name7(useEffectEvent, "useEffectEvent");
774
-
775
- // ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
776
- var __defProp9 = Object.defineProperty, __name8 = (target, value) => __defProp9(target, "name", { value, configurable: !0 }), useInsertionEffect = React8[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
777
- function useControllableState({
778
- prop,
779
- defaultProp,
780
- onChange = /* @__PURE__ */ __name8(() => {
781
- }, "onChange"),
782
- caller
783
- }) {
784
- let [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
785
- defaultProp,
786
- onChange
787
- }), isControlled = prop !== void 0, value = isControlled ? prop : uncontrolledProp;
788
- if (IS_DEVELOPMENT) {
789
- let isControlledRef = React8.useRef(prop !== void 0);
790
- React8.useEffect(() => {
791
- let wasControlled = isControlledRef.current;
792
- wasControlled !== isControlled && console.warn(
793
- `${caller} is changing from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
794
- ), isControlledRef.current = isControlled;
795
- }, [isControlled, caller]);
796
- }
797
- let setValue = React8.useCallback(
798
- (nextValue) => {
799
- if (isControlled) {
800
- let value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
801
- value2 !== prop && onChangeRef.current?.(value2);
802
- } else
803
- setUncontrolledProp(nextValue);
804
- },
805
- [isControlled, prop, setUncontrolledProp, onChangeRef]
806
- );
807
- return [value, setValue];
808
- }
809
- __name8(useControllableState, "useControllableState");
810
- function useUncontrolledState({
811
- defaultProp,
812
- onChange
813
- }) {
814
- let [value, setValue] = React8.useState(defaultProp), prevValueRef = React8.useRef(value), onChangeRef = React8.useRef(onChange);
815
- return useInsertionEffect(() => {
816
- onChangeRef.current = onChange;
817
- }, [onChange]), React8.useEffect(() => {
818
- prevValueRef.current !== value && (onChangeRef.current?.(value), prevValueRef.current = value);
819
- }, [value, prevValueRef]), [value, setValue, onChangeRef];
820
- }
821
- __name8(useUncontrolledState, "useUncontrolledState");
822
- function isFunction(value) {
823
- return typeof value == "function";
824
- }
825
- __name8(isFunction, "isFunction");
826
- var SYNC_STATE = /* @__PURE__ */ Symbol("RADIX:SYNC_STATE");
827
- function useControllableStateReducer(reducer, userArgs, initialArg, init) {
828
- let { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs, isControlled = controlledState !== void 0, onChange = useEffectEvent(onChangeProp);
829
- if (IS_DEVELOPMENT) {
830
- let isControlledRef = React23.useRef(controlledState !== void 0);
831
- React23.useEffect(() => {
832
- let wasControlled = isControlledRef.current;
833
- wasControlled !== isControlled && console.warn(
834
- `${caller} is changing from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
835
- ), isControlledRef.current = isControlled;
836
- }, [isControlled, caller]);
837
- }
838
- let args = [{ ...initialArg, state: defaultProp }];
839
- init && args.push(init);
840
- let [internalState, dispatch] = React23.useReducer(
841
- (state2, action) => {
842
- if (action.type === SYNC_STATE)
843
- return { ...state2, state: action.state };
844
- let next = reducer(state2, action);
845
- return isControlled && !Object.is(next.state, state2.state) && onChange(next.state), next;
846
- },
847
- ...args
848
- ), uncontrolledState = internalState.state, prevValueRef = React23.useRef(uncontrolledState);
849
- React23.useEffect(() => {
850
- prevValueRef.current !== uncontrolledState && (prevValueRef.current = uncontrolledState, isControlled || onChange(uncontrolledState));
851
- }, [uncontrolledState, prevValueRef, isControlled]);
852
- let state = React23.useMemo(() => controlledState !== void 0 ? { ...internalState, state: controlledState } : internalState, [internalState, controlledState]);
853
- return React23.useEffect(() => {
854
- isControlled && !Object.is(controlledState, internalState.state) && dispatch({ type: SYNC_STATE, state: controlledState });
855
- }, [controlledState, internalState.state, isControlled]), [state, dispatch];
856
- }
857
- __name8(useControllableStateReducer, "useControllableStateReducer");
858
-
859
- // ../../node_modules/@radix-ui/react-presence/dist/index.mjs
860
- var React24 = __toESM(require_react(), 1);
861
- var React9 = __toESM(require_react(), 1), __defProp10 = Object.defineProperty, __name9 = (target, value) => __defProp10(target, "name", { value, configurable: !0 });
862
- function useStateMachine(initialState, machine) {
863
- return React9.useReducer((state, event) => machine[state][event] ?? state, initialState);
864
- }
865
- __name9(useStateMachine, "useStateMachine");
866
- var Presence = /* @__PURE__ */ __name9((props) => {
867
- let { present, children } = props, presence = usePresence(present), child = typeof children == "function" ? children({ present: presence.isPresent }) : React24.Children.only(children), ref = useStableComposedRefs(presence.ref, getElementRef2(child));
868
- return typeof children == "function" || presence.isPresent ? React24.cloneElement(child, { ref }) : null;
869
- }, "Presence");
870
- function usePresence(present) {
871
- let [node, setNode] = React24.useState(), stylesRef = React24.useRef(null), prevPresentRef = React24.useRef(present), prevAnimationNameRef = React24.useRef("none"), mountAnimationNameRef = React24.useRef(void 0), initialState = present ? "mounted" : "unmounted", [state, send] = useStateMachine(initialState, {
872
- mounted: {
873
- UNMOUNT: "unmounted",
874
- ANIMATION_OUT: "unmountSuspended"
875
- },
876
- unmountSuspended: {
877
- MOUNT: "mounted",
878
- ANIMATION_END: "unmounted"
879
- },
880
- unmounted: {
881
- MOUNT: "mounted"
882
- }
883
- });
884
- return React24.useEffect(() => {
885
- state === "mounted" ? (prevAnimationNameRef.current = mountAnimationNameRef.current ?? getAnimationName(stylesRef.current), mountAnimationNameRef.current = void 0) : prevAnimationNameRef.current = "none";
886
- }, [state]), useLayoutEffect2(() => {
887
- let styles = stylesRef.current, wasPresent = prevPresentRef.current;
888
- if (wasPresent !== present) {
889
- let prevAnimationName = prevAnimationNameRef.current, currentAnimationName = getAnimationName(styles);
890
- present ? (mountAnimationNameRef.current = currentAnimationName, send("MOUNT")) : currentAnimationName === "none" || styles?.display === "none" ? send("UNMOUNT") : send(wasPresent && prevAnimationName !== currentAnimationName ? "ANIMATION_OUT" : "UNMOUNT"), prevPresentRef.current = present;
891
- }
892
- }, [present, send]), useLayoutEffect2(() => {
893
- if (node) {
894
- let timeoutId, ownerWindow = node.ownerDocument.defaultView ?? window, handleAnimationEnd = /* @__PURE__ */ __name9((event) => {
895
- let isCurrentAnimation = getAnimationName(stylesRef.current).includes(CSS.escape(event.animationName));
896
- if (event.target === node && isCurrentAnimation && (send("ANIMATION_END"), !prevPresentRef.current)) {
897
- let currentFillMode = node.style.animationFillMode;
898
- node.style.animationFillMode = "forwards", timeoutId = ownerWindow.setTimeout(() => {
899
- node.style.animationFillMode === "forwards" && (node.style.animationFillMode = currentFillMode);
900
- });
901
- }
902
- }, "handleAnimationEnd"), handleAnimationStart = /* @__PURE__ */ __name9((event) => {
903
- event.target === node && (prevAnimationNameRef.current = getAnimationName(stylesRef.current));
904
- }, "handleAnimationStart");
905
- return node.addEventListener("animationstart", handleAnimationStart), node.addEventListener("animationcancel", handleAnimationEnd), node.addEventListener("animationend", handleAnimationEnd), () => {
906
- ownerWindow.clearTimeout(timeoutId), node.removeEventListener("animationstart", handleAnimationStart), node.removeEventListener("animationcancel", handleAnimationEnd), node.removeEventListener("animationend", handleAnimationEnd);
907
- };
908
- } else
909
- send("ANIMATION_END");
910
- }, [node, send]), {
911
- isPresent: ["mounted", "unmountSuspended"].includes(state),
912
- ref: React24.useCallback((node2) => {
913
- if (node2) {
914
- let styles = getComputedStyle(node2);
915
- stylesRef.current = styles, mountAnimationNameRef.current = getAnimationName(styles);
916
- } else
917
- stylesRef.current = null;
918
- setNode(node2);
919
- }, [])
920
- };
921
- }
922
- __name9(usePresence, "usePresence");
923
- function setRef2(ref, value) {
924
- if (typeof ref == "function")
925
- return ref(value);
926
- ref != null && (ref.current = value);
927
- }
928
- __name9(setRef2, "setRef");
929
- function useStableComposedRefs(...refs) {
930
- let refsRef = React24.useRef(refs);
931
- return refsRef.current = refs, React24.useCallback((node) => {
932
- let currentRefs = refsRef.current, hasCleanup = !1, cleanups = currentRefs.map((ref) => {
933
- let cleanup = setRef2(ref, node);
934
- return !hasCleanup && typeof cleanup == "function" && (hasCleanup = !0), cleanup;
935
- });
936
- if (hasCleanup)
937
- return () => {
938
- for (let i = 0; i < cleanups.length; i++) {
939
- let cleanup = cleanups[i];
940
- typeof cleanup == "function" ? cleanup() : setRef2(currentRefs[i], null);
941
- }
942
- };
943
- }, []);
944
- }
945
- __name9(useStableComposedRefs, "useStableComposedRefs");
946
- function getAnimationName(styles) {
947
- return styles?.animationName || "none";
948
- }
949
- __name9(getAnimationName, "getAnimationName");
950
- function getElementRef2(element) {
951
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
952
- return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
953
- }
954
- __name9(getElementRef2, "getElementRef");
955
-
956
- // ../../node_modules/@radix-ui/react-id/dist/index.mjs
957
- var React10 = __toESM(require_react(), 1);
958
- var __defProp11 = Object.defineProperty, __name10 = (target, value) => __defProp11(target, "name", { value, configurable: !0 }), useReactId = React10[" useId ".trim().toString()] || (() => {
959
- }), count = 0;
960
- function useId(deterministicId) {
961
- let [id, setId] = React10.useState(useReactId());
962
- return useLayoutEffect2(() => {
963
- deterministicId || setId((reactId) => reactId ?? String(count++));
964
- }, [deterministicId]), deterministicId || (id ? `radix-${id}` : "");
965
- }
966
- __name10(useId, "useId");
967
-
968
- // ../../node_modules/@radix-ui/react-direction/dist/index.mjs
969
- var React11 = __toESM(require_react(), 1), import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1), __defProp12 = Object.defineProperty, __name11 = (target, value) => __defProp12(target, "name", { value, configurable: !0 }), Direction = {
970
- LTR: "ltr",
971
- RTL: "rtl"
972
- }, DirectionContext = React11.createContext(void 0);
973
- function useDirection(localDir) {
974
- let globalDir = React11.useContext(DirectionContext);
975
- return localDir || globalDir || Direction.LTR;
976
- }
977
- __name11(useDirection, "useDirection");
978
-
979
- // ../../node_modules/@radix-ui/react-dialog/dist/index.mjs
980
- var dist_exports = {};
981
- __export(dist_exports, {
982
- Close: () => DialogClose,
983
- Content: () => DialogContent,
984
- Description: () => DialogDescription,
985
- Dialog: () => Dialog,
986
- DialogClose: () => DialogClose,
987
- DialogContent: () => DialogContent,
988
- DialogDescription: () => DialogDescription,
989
- DialogOverlay: () => DialogOverlay,
990
- DialogPortal: () => DialogPortal,
991
- DialogTitle: () => DialogTitle,
992
- DialogTrigger: () => DialogTrigger,
993
- Overlay: () => DialogOverlay,
994
- Portal: () => DialogPortal,
995
- Root: () => Dialog,
996
- Title: () => DialogTitle,
997
- Trigger: () => DialogTrigger,
998
- WarningProvider: () => WarningProvider,
999
- createDialogScope: () => createDialogScope
1000
- });
1001
- var React27 = __toESM(require_react(), 1);
1002
-
1003
- // ../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
1004
- var React13 = __toESM(require_react(), 1);
1005
-
1006
- // ../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
1007
- var React12 = __toESM(require_react(), 1), __defProp13 = Object.defineProperty, __name12 = (target, value) => __defProp13(target, "name", { value, configurable: !0 }), useReactInsertionEffect2 = React12[" useInsertionEffect ".trim().toString()];
1008
- function useCallbackRef(callback) {
1009
- let callbackRef = React12.useRef(callback);
1010
- return typeof useReactInsertionEffect2 == "function" ? useReactInsertionEffect2(() => {
1011
- callbackRef.current = callback;
1012
- }) : useLayoutEffect2(() => {
1013
- callbackRef.current = callback;
1014
- }), React12.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
1015
- }
1016
- __name12(useCallbackRef, "useCallbackRef");
1017
-
1018
- // ../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
1019
- var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1), __defProp14 = Object.defineProperty, __name13 = (target, value) => __defProp14(target, "name", { value, configurable: !0 }), CONTEXT_UPDATE = "dismissableLayer.update", POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside", FOCUS_OUTSIDE = "dismissableLayer.focusOutside", originalBodyPointerEvents, DismissableLayerContext = React13.createContext({
1020
- layers: /* @__PURE__ */ new Set(),
1021
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
1022
- branches: /* @__PURE__ */ new Set(),
1023
- // Outside elements that belong to a layer's own dismiss affordance (eg, a
1024
- // dialog overlay). Pressing them should dismiss the layer regardless of
1025
- // whether or not they stop propagation.
1026
- //
1027
- // See https://github.com/radix-ui/primitives/issues/3346
1028
- dismissableSurfaces: /* @__PURE__ */ new Set()
1029
- }), DismissableLayer = /* @__PURE__ */ React13.forwardRef(
1030
- // blank line to reduce diff noise
1031
- /* @__PURE__ */ __name13(function(props, forwardedRef) {
1032
- let {
1033
- disableOutsidePointerEvents = !1,
1034
- deferPointerDownOutside = !1,
1035
- onEscapeKeyDown,
1036
- onPointerDownOutside,
1037
- onFocusOutside,
1038
- onInteractOutside,
1039
- onDismiss,
1040
- ...layerProps
1041
- } = props, context = React13.useContext(DismissableLayerContext), [node, setNode] = React13.useState(null), ownerDocument = node?.ownerDocument ?? globalThis?.document, [, force] = React13.useState({}), composedRefs = useComposedRefs(forwardedRef, setNode), layers = Array.from(context.layers), [highestLayerWithOutsidePointerEventsDisabled] = [
1042
- ...context.layersWithOutsidePointerEventsDisabled
1043
- ].slice(-1), highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1, index2 = node ? layers.indexOf(node) : -1, isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0, isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex, isDeferredPointerDownOutsideRef = React13.useRef(!1), pointerDownOutside = usePointerDownOutside(
1044
- (event) => {
1045
- onPointerDownOutside?.(event), onInteractOutside?.(event), event.defaultPrevented || onDismiss?.();
1046
- },
1047
- {
1048
- ownerDocument,
1049
- deferPointerDownOutside,
1050
- isDeferredPointerDownOutsideRef,
1051
- dismissableSurfaces: context.dismissableSurfaces,
1052
- shouldHandlePointerDownOutside: React13.useCallback(
1053
- (target) => {
1054
- if (!(target instanceof Node))
1055
- return !1;
1056
- let isPointerDownOnBranch = [...context.branches].some(
1057
- (branch) => branch.contains(target)
1058
- );
1059
- return isPointerEventsEnabled && !isPointerDownOnBranch;
1060
- },
1061
- [context.branches, isPointerEventsEnabled]
1062
- )
1063
- }
1064
- ), focusOutside = useFocusOutside((event) => {
1065
- if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current)
1066
- return;
1067
- let target = event.target;
1068
- [...context.branches].some((branch) => branch.contains(target)) || (onFocusOutside?.(event), onInteractOutside?.(event), event.defaultPrevented || onDismiss?.());
1069
- }, ownerDocument), isHighestLayer = node ? index2 === layers.length - 1 : !1, handleKeyDown = useCallbackRef((event) => {
1070
- event.key === "Escape" && (onEscapeKeyDown?.(event), !event.defaultPrevented && onDismiss && (event.preventDefault(), onDismiss()));
1071
- });
1072
- return React13.useEffect(() => {
1073
- if (isHighestLayer)
1074
- return ownerDocument.addEventListener("keydown", handleKeyDown, { capture: !0 }), () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: !0 });
1075
- }, [ownerDocument, isHighestLayer, handleKeyDown]), React13.useEffect(() => {
1076
- if (node)
1077
- return disableOutsidePointerEvents && (context.layersWithOutsidePointerEventsDisabled.size === 0 && (originalBodyPointerEvents = ownerDocument.body.style.pointerEvents, ownerDocument.body.style.pointerEvents = "none"), context.layersWithOutsidePointerEventsDisabled.add(node)), context.layers.add(node), dispatchUpdate(), () => {
1078
- disableOutsidePointerEvents && (context.layersWithOutsidePointerEventsDisabled.delete(node), context.layersWithOutsidePointerEventsDisabled.size === 0 && (ownerDocument.body.style.pointerEvents = originalBodyPointerEvents));
1079
- };
1080
- }, [node, ownerDocument, disableOutsidePointerEvents, context]), React13.useEffect(() => () => {
1081
- node && (context.layers.delete(node), context.layersWithOutsidePointerEventsDisabled.delete(node), dispatchUpdate());
1082
- }, [node, context]), React13.useEffect(() => {
1083
- let handleUpdate = /* @__PURE__ */ __name13(() => force({}), "handleUpdate");
1084
- return document.addEventListener(CONTEXT_UPDATE, handleUpdate), () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
1085
- }, []), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1086
- Primitive.div,
1087
- {
1088
- ...layerProps,
1089
- ref: composedRefs,
1090
- style: {
1091
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
1092
- ...props.style
1093
- },
1094
- onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
1095
- onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
1096
- onPointerDownCapture: composeEventHandlers(
1097
- props.onPointerDownCapture,
1098
- pointerDownOutside.onPointerDownCapture
1099
- )
1100
- }
1101
- );
1102
- }, "DismissableLayer")
1103
- );
1104
- function useDismissableLayerSurface() {
1105
- let context = React13.useContext(DismissableLayerContext), [node, setNode] = React13.useState(null);
1106
- return React13.useEffect(() => {
1107
- if (node)
1108
- return context.dismissableSurfaces.add(node), () => {
1109
- context.dismissableSurfaces.delete(node);
1110
- };
1111
- }, [node, context.dismissableSurfaces]), setNode;
1112
- }
1113
- __name13(useDismissableLayerSurface, "useDismissableLayerSurface");
1114
- var IS_TRUE = /* @__PURE__ */ __name13(() => !0, "IS_TRUE");
1115
- function usePointerDownOutside(onPointerDownOutside, args) {
1116
- let {
1117
- ownerDocument = globalThis?.document,
1118
- deferPointerDownOutside = !1,
1119
- isDeferredPointerDownOutsideRef,
1120
- dismissableSurfaces,
1121
- shouldHandlePointerDownOutside = IS_TRUE
1122
- } = args, handlePointerDownOutside = useCallbackRef(onPointerDownOutside), isPointerInsideReactTreeRef = React13.useRef(!1), isPointerDownOutsideRef = React13.useRef(!1), interceptedOutsideInteractionEventsRef = React13.useRef(/* @__PURE__ */ new Map()), handleClickRef = React13.useRef(() => {
1123
- });
1124
- return React13.useEffect(() => {
1125
- function resetOutsideInteraction() {
1126
- isPointerDownOutsideRef.current = !1, isDeferredPointerDownOutsideRef.current = !1, interceptedOutsideInteractionEventsRef.current.clear();
1127
- }
1128
- __name13(resetOutsideInteraction, "resetOutsideInteraction");
1129
- function isOutsideInteractionIntercepted() {
1130
- return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);
1131
- }
1132
- __name13(isOutsideInteractionIntercepted, "isOutsideInteractionIntercepted");
1133
- function handleInteractionCapture(event) {
1134
- if (!isPointerDownOutsideRef.current)
1135
- return;
1136
- let target = event.target;
1137
- target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target)) || interceptedOutsideInteractionEventsRef.current.set(event.type, !0), event.type === "click" && window.setTimeout(() => {
1138
- isPointerDownOutsideRef.current && handleClickRef.current();
1139
- }, 0);
1140
- }
1141
- __name13(handleInteractionCapture, "handleInteractionCapture");
1142
- function handleInteractionBubble(event) {
1143
- isPointerDownOutsideRef.current && interceptedOutsideInteractionEventsRef.current.set(event.type, !1);
1144
- }
1145
- __name13(handleInteractionBubble, "handleInteractionBubble");
1146
- let handlePointerDown = /* @__PURE__ */ __name13((event) => {
1147
- if (event.target && !isPointerInsideReactTreeRef.current) {
1148
- let handleAndDispatchPointerDownOutsideEvent2 = function() {
1149
- ownerDocument.removeEventListener("click", handleClickRef.current);
1150
- let wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();
1151
- resetOutsideInteraction(), wasOutsideInteractionIntercepted || handleAndDispatchCustomEvent(
1152
- POINTER_DOWN_OUTSIDE,
1153
- handlePointerDownOutside,
1154
- eventDetail,
1155
- { discrete: !0 }
1156
- );
1157
- };
1158
- var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
1159
- if (__name13(handleAndDispatchPointerDownOutsideEvent2, "handleAndDispatchPointerDownOutsideEvent"), !shouldHandlePointerDownOutside(event.target)) {
1160
- ownerDocument.removeEventListener("click", handleClickRef.current), resetOutsideInteraction(), isPointerInsideReactTreeRef.current = !1;
1161
- return;
1162
- }
1163
- let eventDetail = { originalEvent: event };
1164
- isPointerDownOutsideRef.current = !0, isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0, interceptedOutsideInteractionEventsRef.current.clear(), !deferPointerDownOutside || event.button !== 0 ? handleAndDispatchPointerDownOutsideEvent2() : (ownerDocument.removeEventListener("click", handleClickRef.current), handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2, ownerDocument.addEventListener("click", handleClickRef.current, { once: !0 }));
1165
- } else
1166
- ownerDocument.removeEventListener("click", handleClickRef.current), resetOutsideInteraction();
1167
- isPointerInsideReactTreeRef.current = !1;
1168
- }, "handlePointerDown"), outsideInteractionEvents = [
1169
- "pointerup",
1170
- "mousedown",
1171
- "mouseup",
1172
- "touchstart",
1173
- "touchend",
1174
- "click"
1175
- ];
1176
- for (let eventName of outsideInteractionEvents)
1177
- ownerDocument.addEventListener(eventName, handleInteractionCapture, !0), ownerDocument.addEventListener(eventName, handleInteractionBubble);
1178
- let timerId = window.setTimeout(() => {
1179
- ownerDocument.addEventListener("pointerdown", handlePointerDown);
1180
- }, 0);
1181
- return () => {
1182
- window.clearTimeout(timerId), ownerDocument.removeEventListener("pointerdown", handlePointerDown), ownerDocument.removeEventListener("click", handleClickRef.current);
1183
- for (let eventName of outsideInteractionEvents)
1184
- ownerDocument.removeEventListener(eventName, handleInteractionCapture, !0), ownerDocument.removeEventListener(eventName, handleInteractionBubble);
1185
- };
1186
- }, [
1187
- ownerDocument,
1188
- handlePointerDownOutside,
1189
- deferPointerDownOutside,
1190
- isDeferredPointerDownOutsideRef,
1191
- dismissableSurfaces,
1192
- shouldHandlePointerDownOutside
1193
- ]), {
1194
- // ensures we check React component tree (not just DOM tree)
1195
- onPointerDownCapture: /* @__PURE__ */ __name13(() => isPointerInsideReactTreeRef.current = !0, "onPointerDownCapture")
1196
- };
1197
- }
1198
- __name13(usePointerDownOutside, "usePointerDownOutside");
1199
- function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
1200
- let handleFocusOutside = useCallbackRef(onFocusOutside), isFocusInsideReactTreeRef = React13.useRef(!1);
1201
- return React13.useEffect(() => {
1202
- let handleFocus = /* @__PURE__ */ __name13((event) => {
1203
- event.target && !isFocusInsideReactTreeRef.current && handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, { originalEvent: event }, {
1204
- discrete: !1
1205
- });
1206
- }, "handleFocus");
1207
- return ownerDocument.addEventListener("focusin", handleFocus), () => ownerDocument.removeEventListener("focusin", handleFocus);
1208
- }, [ownerDocument, handleFocusOutside]), {
1209
- onFocusCapture: /* @__PURE__ */ __name13(() => isFocusInsideReactTreeRef.current = !0, "onFocusCapture"),
1210
- onBlurCapture: /* @__PURE__ */ __name13(() => isFocusInsideReactTreeRef.current = !1, "onBlurCapture")
1211
- };
1212
- }
1213
- __name13(useFocusOutside, "useFocusOutside");
1214
- function dispatchUpdate() {
1215
- let event = new CustomEvent(CONTEXT_UPDATE);
1216
- document.dispatchEvent(event);
1217
- }
1218
- __name13(dispatchUpdate, "dispatchUpdate");
1219
- function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
1220
- let target = detail.originalEvent.target, event = new CustomEvent(name, { bubbles: !1, cancelable: !0, detail });
1221
- handler && target.addEventListener(name, handler, { once: !0 }), discrete ? dispatchDiscreteCustomEvent(target, event) : target.dispatchEvent(event);
1222
- }
1223
- __name13(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
1224
-
1225
- // ../../node_modules/@radix-ui/react-focus-scope/dist/index.mjs
1226
- var React14 = __toESM(require_react(), 1);
1227
- var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1), __defProp15 = Object.defineProperty, __name14 = (target, value) => __defProp15(target, "name", { value, configurable: !0 }), AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount", AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount", EVENT_OPTIONS = { bubbles: !1, cancelable: !0 }, FocusScope = /* @__PURE__ */ React14.forwardRef(
1228
- /* @__PURE__ */ __name14(function(props, forwardedRef) {
1229
- let {
1230
- loop = !1,
1231
- trapped = !1,
1232
- branches,
1233
- onMountAutoFocus: onMountAutoFocusProp,
1234
- onUnmountAutoFocus: onUnmountAutoFocusProp,
1235
- ...scopeProps
1236
- } = props, [container, setContainer] = React14.useState(null), onMountAutoFocus = useCallbackRef(onMountAutoFocusProp), onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp), lastFocusedElementRef = React14.useRef(null), composedRefs = useComposedRefs(forwardedRef, setContainer), branchesRef = React14.useRef(branches);
1237
- React14.useEffect(() => {
1238
- branchesRef.current = branches;
1239
- });
1240
- let isTargetInScope = React14.useCallback(
1241
- (target) => target ? container?.contains(target) ? !0 : !!branchesRef.current?.some((branch) => branch.contains(target)) : !1,
1242
- [container]
1243
- ), focusScope = React14.useRef({
1244
- paused: !1,
1245
- pause() {
1246
- this.paused = !0;
1247
- },
1248
- resume() {
1249
- this.paused = !1;
1250
- }
1251
- }).current;
1252
- React14.useEffect(() => {
1253
- if (trapped) {
1254
- let handleFocusIn2 = function(event) {
1255
- if (focusScope.paused || !container) return;
1256
- let target = event.target;
1257
- isTargetInScope(target) ? lastFocusedElementRef.current = target : focus(lastFocusedElementRef.current, { select: !0 });
1258
- }, handleFocusOut2 = function(event) {
1259
- if (focusScope.paused || !container) return;
1260
- let relatedTarget = event.relatedTarget;
1261
- relatedTarget !== null && (isTargetInScope(relatedTarget) || focus(lastFocusedElementRef.current, { select: !0 }));
1262
- }, handleMutations2 = function(mutations) {
1263
- if (document.activeElement === document.body)
1264
- for (let mutation of mutations)
1265
- mutation.removedNodes.length > 0 && focus(container);
1266
- };
1267
- var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
1268
- __name14(handleFocusIn2, "handleFocusIn"), __name14(handleFocusOut2, "handleFocusOut"), __name14(handleMutations2, "handleMutations"), document.addEventListener("focusin", handleFocusIn2), document.addEventListener("focusout", handleFocusOut2);
1269
- let mutationObserver = new MutationObserver(handleMutations2);
1270
- return container && mutationObserver.observe(container, { childList: !0, subtree: !0 }), () => {
1271
- document.removeEventListener("focusin", handleFocusIn2), document.removeEventListener("focusout", handleFocusOut2), mutationObserver.disconnect();
1272
- };
1273
- }
1274
- }, [trapped, container, focusScope.paused, isTargetInScope]), React14.useEffect(() => {
1275
- if (container) {
1276
- focusScopesStack.add(focusScope);
1277
- let previouslyFocusedElement = document.activeElement;
1278
- if (!container.contains(previouslyFocusedElement)) {
1279
- let mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
1280
- container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus), container.dispatchEvent(mountEvent), mountEvent.defaultPrevented || (focusFirst(removeLinks(getTabbableCandidates(container)), { select: !0 }), document.activeElement === previouslyFocusedElement && focus(container));
1281
- }
1282
- return () => {
1283
- container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
1284
- let ownerDocument = container.ownerDocument, UnmountEvent = CustomEvent;
1285
- setTimeout(() => {
1286
- let unmountEvent = new UnmountEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
1287
- container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus), container.dispatchEvent(unmountEvent), unmountEvent.defaultPrevented || focus(previouslyFocusedElement ?? ownerDocument.body, { select: !0 }), container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus), focusScopesStack.remove(focusScope);
1288
- }, 0);
1289
- };
1290
- }
1291
- }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
1292
- let handleKeyDown = React14.useCallback(
1293
- (event) => {
1294
- if (!loop && !trapped || focusScope.paused) return;
1295
- let isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey, focusedElement = document.activeElement;
1296
- if (isTabKey && focusedElement) {
1297
- let container2 = event.currentTarget, [first, last] = getTabbableEdges(container2);
1298
- first && last ? !event.shiftKey && focusedElement === last ? (event.preventDefault(), loop && focus(first, { select: !0 })) : event.shiftKey && focusedElement === first && (event.preventDefault(), loop && focus(last, { select: !0 })) : focusedElement === container2 && event.preventDefault();
1299
- }
1300
- },
1301
- [loop, trapped, focusScope.paused]
1302
- );
1303
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
1304
- }, "FocusScope")
1305
- ), FocusScopeBranchContext = React14.createContext(null);
1306
- function FocusScopeBranchProvider({ registry, children }) {
1307
- return registry ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FocusScopeBranchContext.Provider, { value: registry, children }) : children;
1308
- }
1309
- __name14(FocusScopeBranchProvider, "FocusScopeBranchProvider");
1310
- function useFocusScopeBranchRegistry() {
1311
- let [nodes, setNodes] = React14.useState([]), registry = React14.useMemo(
1312
- () => ({
1313
- add: /* @__PURE__ */ __name14((node) => setNodes((prev) => prev.includes(node) ? prev : [...prev, node]), "add"),
1314
- remove: /* @__PURE__ */ __name14((node) => setNodes((prev) => prev.filter((current) => current !== node)), "remove")
1315
- }),
1316
- []
1317
- );
1318
- return { nodes, registry };
1319
- }
1320
- __name14(useFocusScopeBranchRegistry, "useFocusScopeBranchRegistry");
1321
- function useFocusScopeBranch(node) {
1322
- let registry = React14.useContext(FocusScopeBranchContext);
1323
- React14.useEffect(() => {
1324
- if (!(!node || !registry))
1325
- return registry.add(node), () => registry.remove(node);
1326
- }, [node, registry]);
1327
- }
1328
- __name14(useFocusScopeBranch, "useFocusScopeBranch");
1329
- function focusFirst(candidates, { select = !1 } = {}) {
1330
- let previouslyFocusedElement = document.activeElement;
1331
- for (let candidate of candidates)
1332
- if (focus(candidate, { select }), document.activeElement !== previouslyFocusedElement) return;
1333
- }
1334
- __name14(focusFirst, "focusFirst");
1335
- function getTabbableEdges(container) {
1336
- let candidates = getTabbableCandidates(container), first = findVisible(candidates, container), last = findVisible(candidates.reverse(), container);
1337
- return [first, last];
1338
- }
1339
- __name14(getTabbableEdges, "getTabbableEdges");
1340
- function getTabbableCandidates(container) {
1341
- let nodes = [], walker = container.ownerDocument.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
1342
- acceptNode: /* @__PURE__ */ __name14((node) => {
1343
- let isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
1344
- return node.disabled || node.hidden || isHiddenInput ? NodeFilter.FILTER_SKIP : node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
1345
- }, "acceptNode")
1346
- });
1347
- for (; walker.nextNode(); )
1348
- nodes.push(walker.currentNode);
1349
- return nodes;
1350
- }
1351
- __name14(getTabbableCandidates, "getTabbableCandidates");
1352
- function findVisible(elements, container) {
1353
- let canUseCheckVisibility = typeof container.checkVisibility == "function" && container.checkVisibility({ checkVisibilityCSS: !0 });
1354
- for (let element of elements)
1355
- if (!(canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: !0 }) : isHidden(element, { upTo: container })))
1356
- return element;
1357
- }
1358
- __name14(findVisible, "findVisible");
1359
- function isHidden(node, { upTo }) {
1360
- if (getComputedStyle(node).visibility === "hidden") return !0;
1361
- for (; node; ) {
1362
- if (upTo !== void 0 && node === upTo) return !1;
1363
- if (getComputedStyle(node).display === "none") return !0;
1364
- node = node.parentElement;
1365
- }
1366
- return !1;
1367
- }
1368
- __name14(isHidden, "isHidden");
1369
- function isSelectableInput(element) {
1370
- return element.tagName === "INPUT" && typeof element.select == "function";
1371
- }
1372
- __name14(isSelectableInput, "isSelectableInput");
1373
- function focus(element, { select = !1 } = {}) {
1374
- if (element && element.focus) {
1375
- let previouslyFocusedElement = (element.ownerDocument ?? document).activeElement;
1376
- element.focus({ preventScroll: !0 }), element !== previouslyFocusedElement && isSelectableInput(element) && select && element.select();
1377
- }
1378
- }
1379
- __name14(focus, "focus");
1380
- var focusScopesStack = createFocusScopesStack();
1381
- function createFocusScopesStack() {
1382
- let stack = [];
1383
- return {
1384
- add(focusScope) {
1385
- let activeFocusScope = stack[0];
1386
- focusScope !== activeFocusScope && activeFocusScope?.pause(), stack = arrayRemove(stack, focusScope), stack.unshift(focusScope);
1387
- },
1388
- remove(focusScope) {
1389
- stack = arrayRemove(stack, focusScope), stack[0]?.resume();
1390
- }
1391
- };
1392
- }
1393
- __name14(createFocusScopesStack, "createFocusScopesStack");
1394
- function arrayRemove(array, item) {
1395
- let updatedArray = [...array], index2 = updatedArray.indexOf(item);
1396
- return index2 !== -1 && updatedArray.splice(index2, 1), updatedArray;
1397
- }
1398
- __name14(arrayRemove, "arrayRemove");
1399
- function removeLinks(items) {
1400
- return items.filter((item) => item.tagName !== "A");
1401
- }
1402
- __name14(removeLinks, "removeLinks");
1403
-
1404
- // ../../node_modules/@radix-ui/react-portal/dist/index.mjs
1405
- var React15 = __toESM(require_react(), 1), ReactDOM2 = __toESM(require_react_dom(), 1);
1406
- var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1), __defProp16 = Object.defineProperty, __name15 = (target, value) => __defProp16(target, "name", { value, configurable: !0 }), Portal = /* @__PURE__ */ React15.forwardRef(
1407
- /* @__PURE__ */ __name15(function(props, forwardedRef) {
1408
- let { container: containerProp, ...portalProps } = props, [mounted, setMounted] = React15.useState(!1);
1409
- useLayoutEffect2(() => setMounted(!0), []);
1410
- let container = containerProp || mounted && globalThis?.document?.body;
1411
- return container ? ReactDOM2.createPortal(/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
1412
- }, "Portal")
1413
- );
1414
-
1415
- // ../../node_modules/@radix-ui/react-focus-guards/dist/index.mjs
1416
- var React16 = __toESM(require_react(), 1), __defProp17 = Object.defineProperty, __name16 = (target, value) => __defProp17(target, "name", { value, configurable: !0 }), count2 = 0, guards = null;
1417
- function FocusGuards(props) {
1418
- return useFocusGuards(), props.children;
1419
- }
1420
- __name16(FocusGuards, "FocusGuards");
1421
- function useFocusGuards() {
1422
- React16.useEffect(() => {
1423
- guards || (guards = { start: createFocusGuard(), end: createFocusGuard() });
1424
- let { start: start2, end } = guards;
1425
- return document.body.firstElementChild !== start2 && document.body.insertAdjacentElement("afterbegin", start2), document.body.lastElementChild !== end && document.body.insertAdjacentElement("beforeend", end), count2++, () => {
1426
- count2 === 1 && (guards?.start.remove(), guards?.end.remove(), guards = null), count2 = Math.max(0, count2 - 1);
1427
- };
1428
- }, []);
1429
- }
1430
- __name16(useFocusGuards, "useFocusGuards");
1431
- function createFocusGuard() {
1432
- let element = document.createElement("span");
1433
- return element.setAttribute("data-radix-focus-guard", ""), element.tabIndex = 0, element.style.outline = "none", element.style.opacity = "0", element.style.position = "fixed", element.style.pointerEvents = "none", element;
1434
- }
1435
- __name16(createFocusGuard, "createFocusGuard");
1436
-
1437
- // ../../node_modules/tslib/tslib.es6.mjs
1438
- var __assign = function() {
1439
- return __assign = Object.assign || function(t) {
1440
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1441
- s = arguments[i];
1442
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
1443
- }
1444
- return t;
1445
- }, __assign.apply(this, arguments);
1446
- };
1447
- function __rest(s, e) {
1448
- var t = {};
1449
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
1450
- if (s != null && typeof Object.getOwnPropertySymbols == "function")
1451
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
1452
- e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
1453
- return t;
1454
- }
1455
- function __spreadArray(to, from, pack) {
1456
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++)
1457
- (ar || !(i in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
1458
- return to.concat(ar || Array.prototype.slice.call(from));
1459
- }
1460
-
1461
- // ../../node_modules/react-remove-scroll/dist/es2015/Combination.js
1462
- var React26 = __toESM(require_react());
1463
-
1464
- // ../../node_modules/react-remove-scroll/dist/es2015/UI.js
1465
- var React19 = __toESM(require_react());
1466
-
1467
- // ../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js
1468
- var zeroRightClassName = "right-scroll-bar-position", fullWidthClassName = "width-before-scroll-bar", noScrollbarsClassName = "with-scroll-bars-hidden", removedBarSizeVariable = "--removed-body-scroll-bar-size";
1469
-
1470
- // ../../node_modules/use-callback-ref/dist/es2015/assignRef.js
1471
- function assignRef(ref, value) {
1472
- return typeof ref == "function" ? ref(value) : ref && (ref.current = value), ref;
1473
- }
1474
-
1475
- // ../../node_modules/use-callback-ref/dist/es2015/useRef.js
1476
- var import_react = __toESM(require_react());
1477
- function useCallbackRef2(initialValue, callback) {
1478
- var ref = (0, import_react.useState)(function() {
1479
- return {
1480
- // value
1481
- value: initialValue,
1482
- // last callback
1483
- callback,
1484
- // "memoized" public interface
1485
- facade: {
1486
- get current() {
1487
- return ref.value;
1488
- },
1489
- set current(value) {
1490
- var last = ref.value;
1491
- last !== value && (ref.value = value, ref.callback(value, last));
1492
- }
1493
- }
1494
- };
1495
- })[0];
1496
- return ref.callback = callback, ref.facade;
1497
- }
1498
-
1499
- // ../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js
1500
- var React17 = __toESM(require_react());
1501
- var useIsomorphicLayoutEffect = typeof window < "u" ? React17.useLayoutEffect : React17.useEffect, currentValues = /* @__PURE__ */ new WeakMap();
1502
- function useMergeRefs(refs, defaultValue) {
1503
- var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
1504
- return refs.forEach(function(ref) {
1505
- return assignRef(ref, newValue);
1506
- });
1507
- });
1508
- return useIsomorphicLayoutEffect(function() {
1509
- var oldValue = currentValues.get(callbackRef);
1510
- if (oldValue) {
1511
- var prevRefs_1 = new Set(oldValue), nextRefs_1 = new Set(refs), current_1 = callbackRef.current;
1512
- prevRefs_1.forEach(function(ref) {
1513
- nextRefs_1.has(ref) || assignRef(ref, null);
1514
- }), nextRefs_1.forEach(function(ref) {
1515
- prevRefs_1.has(ref) || assignRef(ref, current_1);
1516
- });
1517
- }
1518
- currentValues.set(callbackRef, refs);
1519
- }, [refs]), callbackRef;
1520
- }
1521
-
1522
- // ../../node_modules/use-sidecar/dist/es2015/medium.js
1523
- function ItoI(a) {
1524
- return a;
1525
- }
1526
- function innerCreateMedium(defaults, middleware) {
1527
- middleware === void 0 && (middleware = ItoI);
1528
- var buffer = [], assigned = !1, medium = {
1529
- read: function() {
1530
- if (assigned)
1531
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
1532
- return buffer.length ? buffer[buffer.length - 1] : defaults;
1533
- },
1534
- useMedium: function(data) {
1535
- var item = middleware(data, assigned);
1536
- return buffer.push(item), function() {
1537
- buffer = buffer.filter(function(x) {
1538
- return x !== item;
1539
- });
1540
- };
1541
- },
1542
- assignSyncMedium: function(cb) {
1543
- for (assigned = !0; buffer.length; ) {
1544
- var cbs = buffer;
1545
- buffer = [], cbs.forEach(cb);
1546
- }
1547
- buffer = {
1548
- push: function(x) {
1549
- return cb(x);
1550
- },
1551
- filter: function() {
1552
- return buffer;
1553
- }
1554
- };
1555
- },
1556
- assignMedium: function(cb) {
1557
- assigned = !0;
1558
- var pendingQueue = [];
1559
- if (buffer.length) {
1560
- var cbs = buffer;
1561
- buffer = [], cbs.forEach(cb), pendingQueue = buffer;
1562
- }
1563
- var executeQueue = function() {
1564
- var cbs2 = pendingQueue;
1565
- pendingQueue = [], cbs2.forEach(cb);
1566
- }, cycle = function() {
1567
- return Promise.resolve().then(executeQueue);
1568
- };
1569
- cycle(), buffer = {
1570
- push: function(x) {
1571
- pendingQueue.push(x), cycle();
1572
- },
1573
- filter: function(filter) {
1574
- return pendingQueue = pendingQueue.filter(filter), buffer;
1575
- }
1576
- };
1577
- }
1578
- };
1579
- return medium;
1580
- }
1581
- function createSidecarMedium(options2) {
1582
- options2 === void 0 && (options2 = {});
1583
- var medium = innerCreateMedium(null);
1584
- return medium.options = __assign({ async: !0, ssr: !1 }, options2), medium;
1585
- }
1586
-
1587
- // ../../node_modules/use-sidecar/dist/es2015/exports.js
1588
- var React18 = __toESM(require_react()), SideCar = function(_a) {
1589
- var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
1590
- if (!sideCar)
1591
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
1592
- var Target = sideCar.read();
1593
- if (!Target)
1594
- throw new Error("Sidecar medium not found");
1595
- return React18.createElement(Target, __assign({}, rest));
1596
- };
1597
- SideCar.isSideCarExport = !0;
1598
- function exportSidecar(medium, exported) {
1599
- return medium.useMedium(exported), SideCar;
1600
- }
1601
-
1602
- // ../../node_modules/react-remove-scroll/dist/es2015/medium.js
1603
- var effectCar = createSidecarMedium();
1604
-
1605
- // ../../node_modules/react-remove-scroll/dist/es2015/UI.js
1606
- var nothing = function() {
1607
- }, RemoveScroll = React19.forwardRef(function(props, parentRef) {
1608
- var ref = React19.useRef(null), _a = React19.useState({
1609
- onScrollCapture: nothing,
1610
- onWheelCapture: nothing,
1611
- onTouchMoveCapture: nothing
1612
- }), callbacks = _a[0], setCallbacks = _a[1], forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), SideCar2 = sideCar, containerRef = useMergeRefs([ref, parentRef]), containerProps = __assign(__assign({}, rest), callbacks);
1613
- return React19.createElement(
1614
- React19.Fragment,
1615
- null,
1616
- enabled && React19.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
1617
- forwardProps ? React19.cloneElement(React19.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React19.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
1618
- );
1619
- });
1620
- RemoveScroll.defaultProps = {
1621
- enabled: !0,
1622
- removeScrollBar: !0,
1623
- inert: !1
1624
- };
1625
- RemoveScroll.classNames = {
1626
- fullWidth: fullWidthClassName,
1627
- zeroRight: zeroRightClassName
1628
- };
1629
-
1630
- // ../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js
1631
- var React25 = __toESM(require_react());
1632
-
1633
- // ../../node_modules/react-remove-scroll-bar/dist/es2015/component.js
1634
- var React21 = __toESM(require_react());
1635
-
1636
- // ../../node_modules/react-style-singleton/dist/es2015/hook.js
1637
- var React20 = __toESM(require_react());
1638
-
1639
- // ../../node_modules/get-nonce/dist/es2015/index.js
1640
- var currentNonce;
1641
- var getNonce = function() {
1642
- if (currentNonce)
1643
- return currentNonce;
1644
- if (typeof __webpack_nonce__ < "u")
1645
- return __webpack_nonce__;
1646
- };
1647
-
1648
- // ../../node_modules/react-style-singleton/dist/es2015/singleton.js
1649
- function makeStyleTag() {
1650
- if (!document)
1651
- return null;
1652
- var tag = document.createElement("style");
1653
- tag.type = "text/css";
1654
- var nonce = getNonce();
1655
- return nonce && tag.setAttribute("nonce", nonce), tag;
1656
- }
1657
- function injectStyles(tag, css) {
1658
- tag.styleSheet ? tag.styleSheet.cssText = css : tag.appendChild(document.createTextNode(css));
1659
- }
1660
- function insertStyleTag(tag) {
1661
- var head = document.head || document.getElementsByTagName("head")[0];
1662
- head.appendChild(tag);
1663
- }
1664
- var stylesheetSingleton = function() {
1665
- var counter = 0, stylesheet = null;
1666
- return {
1667
- add: function(style) {
1668
- counter == 0 && (stylesheet = makeStyleTag()) && (injectStyles(stylesheet, style), insertStyleTag(stylesheet)), counter++;
1669
- },
1670
- remove: function() {
1671
- counter--, !counter && stylesheet && (stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet), stylesheet = null);
1672
- }
1673
- };
1674
- };
1675
-
1676
- // ../../node_modules/react-style-singleton/dist/es2015/hook.js
1677
- var styleHookSingleton = function() {
1678
- var sheet = stylesheetSingleton();
1679
- return function(styles, isDynamic) {
1680
- React20.useEffect(function() {
1681
- return sheet.add(styles), function() {
1682
- sheet.remove();
1683
- };
1684
- }, [styles && isDynamic]);
1685
- };
1686
- };
1687
-
1688
- // ../../node_modules/react-style-singleton/dist/es2015/component.js
1689
- var styleSingleton = function() {
1690
- var useStyle = styleHookSingleton(), Sheet = function(_a) {
1691
- var styles = _a.styles, dynamic = _a.dynamic;
1692
- return useStyle(styles, dynamic), null;
1693
- };
1694
- return Sheet;
1695
- };
1696
-
1697
- // ../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js
1698
- var zeroGap = {
1699
- left: 0,
1700
- top: 0,
1701
- right: 0,
1702
- gap: 0
1703
- }, parse = function(x) {
1704
- return parseInt(x || "", 10) || 0;
1705
- }, getOffset = function(gapMode) {
1706
- var cs = window.getComputedStyle(document.body), left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"], top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"], right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
1707
- return [parse(left), parse(top), parse(right)];
1708
- }, getGapWidth = function(gapMode) {
1709
- if (gapMode === void 0 && (gapMode = "margin"), typeof window > "u")
1710
- return zeroGap;
1711
- var offsets = getOffset(gapMode), documentWidth = document.documentElement.clientWidth, windowWidth = window.innerWidth;
1712
- return {
1713
- left: offsets[0],
1714
- top: offsets[1],
1715
- right: offsets[2],
1716
- gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
1717
- };
1718
- };
1719
-
1720
- // ../../node_modules/react-remove-scroll-bar/dist/es2015/component.js
1721
- var Style = styleSingleton(), lockAttribute = "data-scroll-locked", getStyles = function(_a, allowRelative, gapMode, important) {
1722
- var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
1723
- return gapMode === void 0 && (gapMode = "margin"), `
1724
- .`.concat(noScrollbarsClassName, ` {
1725
- overflow: hidden `).concat(important, `;
1726
- padding-right: `).concat(gap, "px ").concat(important, `;
1727
- }
1728
- body[`).concat(lockAttribute, `] {
1729
- overflow: hidden `).concat(important, `;
1730
- overscroll-behavior: contain;
1731
- `).concat([
1732
- allowRelative && "position: relative ".concat(important, ";"),
1733
- gapMode === "margin" && `
1734
- padding-left: `.concat(left, `px;
1735
- padding-top: `).concat(top, `px;
1736
- padding-right: `).concat(right, `px;
1737
- margin-left:0;
1738
- margin-top:0;
1739
- margin-right: `).concat(gap, "px ").concat(important, `;
1740
- `),
1741
- gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
1742
- ].filter(Boolean).join(""), `
1743
- }
1744
-
1745
- .`).concat(zeroRightClassName, ` {
1746
- right: `).concat(gap, "px ").concat(important, `;
1747
- }
1748
-
1749
- .`).concat(fullWidthClassName, ` {
1750
- margin-right: `).concat(gap, "px ").concat(important, `;
1751
- }
1752
-
1753
- .`).concat(zeroRightClassName, " .").concat(zeroRightClassName, ` {
1754
- right: 0 `).concat(important, `;
1755
- }
1756
-
1757
- .`).concat(fullWidthClassName, " .").concat(fullWidthClassName, ` {
1758
- margin-right: 0 `).concat(important, `;
1759
- }
1760
-
1761
- body[`).concat(lockAttribute, `] {
1762
- `).concat(removedBarSizeVariable, ": ").concat(gap, `px;
1763
- }
1764
- `);
1765
- }, getCurrentUseCounter = function() {
1766
- var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
1767
- return isFinite(counter) ? counter : 0;
1768
- }, useLockAttribute = function() {
1769
- React21.useEffect(function() {
1770
- return document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString()), function() {
1771
- var newCounter = getCurrentUseCounter() - 1;
1772
- newCounter <= 0 ? document.body.removeAttribute(lockAttribute) : document.body.setAttribute(lockAttribute, newCounter.toString());
1773
- };
1774
- }, []);
1775
- }, RemoveScrollBar = function(_a) {
1776
- var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
1777
- useLockAttribute();
1778
- var gap = React21.useMemo(function() {
1779
- return getGapWidth(gapMode);
1780
- }, [gapMode]);
1781
- return React21.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, noImportant ? "" : "!important") });
1782
- };
1783
-
1784
- // ../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
1785
- var passiveSupported = !1;
1786
- if (typeof window < "u")
1787
- try {
1788
- options = Object.defineProperty({}, "passive", {
1789
- get: function() {
1790
- return passiveSupported = !0, !0;
1791
- }
1792
- }), window.addEventListener("test", options, options), window.removeEventListener("test", options, options);
1793
- } catch {
1794
- passiveSupported = !1;
1795
- }
1796
- var options, nonPassive = passiveSupported ? { passive: !1 } : !1;
1797
-
1798
- // ../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js
1799
- var alwaysContainsScroll = function(node) {
1800
- return node.tagName === "TEXTAREA";
1801
- }, elementCanBeScrolled = function(node, overflow) {
1802
- if (!(node instanceof Element))
1803
- return !1;
1804
- var styles = window.getComputedStyle(node);
1805
- return (
1806
- // not-not-scrollable
1807
- styles[overflow] !== "hidden" && // contains scroll inside self
1808
- !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
1809
- );
1810
- }, elementCouldBeVScrolled = function(node) {
1811
- return elementCanBeScrolled(node, "overflowY");
1812
- }, elementCouldBeHScrolled = function(node) {
1813
- return elementCanBeScrolled(node, "overflowX");
1814
- }, locationCouldBeScrolled = function(axis, node) {
1815
- var ownerDocument = node.ownerDocument, current = node;
1816
- do {
1817
- typeof ShadowRoot < "u" && current instanceof ShadowRoot && (current = current.host);
1818
- var isScrollable = elementCouldBeScrolled(axis, current);
1819
- if (isScrollable) {
1820
- var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
1821
- if (scrollHeight > clientHeight)
1822
- return !0;
1823
- }
1824
- current = current.parentNode;
1825
- } while (current && current !== ownerDocument.body);
1826
- return !1;
1827
- }, getVScrollVariables = function(_a) {
1828
- var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
1829
- return [
1830
- scrollTop,
1831
- scrollHeight,
1832
- clientHeight
1833
- ];
1834
- }, getHScrollVariables = function(_a) {
1835
- var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
1836
- return [
1837
- scrollLeft,
1838
- scrollWidth,
1839
- clientWidth
1840
- ];
1841
- }, elementCouldBeScrolled = function(axis, node) {
1842
- return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
1843
- }, getScrollVariables = function(axis, node) {
1844
- return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
1845
- }, getDirectionFactor = function(axis, direction) {
1846
- return axis === "h" && direction === "rtl" ? -1 : 1;
1847
- }, handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
1848
- var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction), delta = directionFactor * sourceDelta, target = event.target, targetInLock = endTarget.contains(target), shouldCancelScroll = !1, isDeltaPositive = delta > 0, availableScroll = 0, availableScrollTop = 0;
1849
- do {
1850
- if (!target)
1851
- break;
1852
- var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2], elementScroll = scroll_1 - capacity - directionFactor * position;
1853
- (position || elementScroll) && elementCouldBeScrolled(axis, target) && (availableScroll += elementScroll, availableScrollTop += position);
1854
- var parent_1 = target.parentNode;
1855
- target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
1856
- } while (
1857
- // portaled content
1858
- !targetInLock && target !== document.body || // self content
1859
- targetInLock && (endTarget.contains(target) || endTarget === target)
1860
- );
1861
- return (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll) || !isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) && (shouldCancelScroll = !0), shouldCancelScroll;
1862
- };
1863
-
1864
- // ../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js
1865
- var getTouchXY = function(event) {
1866
- return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
1867
- }, getDeltaXY = function(event) {
1868
- return [event.deltaX, event.deltaY];
1869
- }, extractRef = function(ref) {
1870
- return ref && "current" in ref ? ref.current : ref;
1871
- }, deltaCompare = function(x, y) {
1872
- return x[0] === y[0] && x[1] === y[1];
1873
- }, generateStyle = function(id) {
1874
- return `
1875
- .block-interactivity-`.concat(id, ` {pointer-events: none;}
1876
- .allow-interactivity-`).concat(id, ` {pointer-events: all;}
1877
- `);
1878
- }, idCounter = 0, lockStack = [];
1879
- function RemoveScrollSideCar(props) {
1880
- var shouldPreventQueue = React25.useRef([]), touchStartRef = React25.useRef([0, 0]), activeAxis = React25.useRef(), id = React25.useState(idCounter++)[0], Style2 = React25.useState(styleSingleton)[0], lastProps = React25.useRef(props);
1881
- React25.useEffect(function() {
1882
- lastProps.current = props;
1883
- }, [props]), React25.useEffect(function() {
1884
- if (props.inert) {
1885
- document.body.classList.add("block-interactivity-".concat(id));
1886
- var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), !0).filter(Boolean);
1887
- return allow_1.forEach(function(el) {
1888
- return el.classList.add("allow-interactivity-".concat(id));
1889
- }), function() {
1890
- document.body.classList.remove("block-interactivity-".concat(id)), allow_1.forEach(function(el) {
1891
- return el.classList.remove("allow-interactivity-".concat(id));
1892
- });
1893
- };
1894
- }
1895
- }, [props.inert, props.lockRef.current, props.shards]);
1896
- var shouldCancelEvent = React25.useCallback(function(event, parent2) {
1897
- if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey)
1898
- return !lastProps.current.allowPinchZoom;
1899
- var touch = getTouchXY(event), touchStart = touchStartRef.current, deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0], deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1], currentAxis, target = event.target, moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
1900
- if ("touches" in event && moveDirection === "h" && target.type === "range")
1901
- return !1;
1902
- var selection = window.getSelection(), anchorNode = selection && selection.anchorNode, isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : !1;
1903
- if (isTouchingSelection)
1904
- return !1;
1905
- var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
1906
- if (!canBeScrolledInMainDirection)
1907
- return !0;
1908
- if (canBeScrolledInMainDirection ? currentAxis = moveDirection : (currentAxis = moveDirection === "v" ? "h" : "v", canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target)), !canBeScrolledInMainDirection)
1909
- return !1;
1910
- if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY) && (activeAxis.current = currentAxis), !currentAxis)
1911
- return !0;
1912
- var cancelingAxis = activeAxis.current || currentAxis;
1913
- return handleScroll(cancelingAxis, parent2, event, cancelingAxis === "h" ? deltaX : deltaY, !0);
1914
- }, []), shouldPrevent = React25.useCallback(function(_event) {
1915
- var event = _event;
1916
- if (!(!lockStack.length || lockStack[lockStack.length - 1] !== Style2)) {
1917
- var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event), sourceEvent = shouldPreventQueue.current.filter(function(e) {
1918
- return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
1919
- })[0];
1920
- if (sourceEvent && sourceEvent.should) {
1921
- event.cancelable && event.preventDefault();
1922
- return;
1923
- }
1924
- if (!sourceEvent) {
1925
- var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
1926
- return node.contains(event.target);
1927
- }), shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
1928
- shouldStop && event.cancelable && event.preventDefault();
1929
- }
1930
- }
1931
- }, []), shouldCancel = React25.useCallback(function(name, delta, target, should) {
1932
- var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
1933
- shouldPreventQueue.current.push(event), setTimeout(function() {
1934
- shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
1935
- return e !== event;
1936
- });
1937
- }, 1);
1938
- }, []), scrollTouchStart = React25.useCallback(function(event) {
1939
- touchStartRef.current = getTouchXY(event), activeAxis.current = void 0;
1940
- }, []), scrollWheel = React25.useCallback(function(event) {
1941
- shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1942
- }, []), scrollTouchMove = React25.useCallback(function(event) {
1943
- shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
1944
- }, []);
1945
- React25.useEffect(function() {
1946
- return lockStack.push(Style2), props.setCallbacks({
1947
- onScrollCapture: scrollWheel,
1948
- onWheelCapture: scrollWheel,
1949
- onTouchMoveCapture: scrollTouchMove
1950
- }), document.addEventListener("wheel", shouldPrevent, nonPassive), document.addEventListener("touchmove", shouldPrevent, nonPassive), document.addEventListener("touchstart", scrollTouchStart, nonPassive), function() {
1951
- lockStack = lockStack.filter(function(inst) {
1952
- return inst !== Style2;
1953
- }), document.removeEventListener("wheel", shouldPrevent, nonPassive), document.removeEventListener("touchmove", shouldPrevent, nonPassive), document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
1954
- };
1955
- }, []);
1956
- var removeScrollBar = props.removeScrollBar, inert = props.inert;
1957
- return React25.createElement(
1958
- React25.Fragment,
1959
- null,
1960
- inert ? React25.createElement(Style2, { styles: generateStyle(id) }) : null,
1961
- removeScrollBar ? React25.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
1962
- );
1963
- }
1964
- function getOutermostShadowParent(node) {
1965
- for (var shadowParent = null; node !== null; )
1966
- node instanceof ShadowRoot && (shadowParent = node.host, node = node.host), node = node.parentNode;
1967
- return shadowParent;
1968
- }
1969
-
1970
- // ../../node_modules/react-remove-scroll/dist/es2015/sidecar.js
1971
- var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
1972
-
1973
- // ../../node_modules/react-remove-scroll/dist/es2015/Combination.js
1974
- var ReactRemoveScroll = React26.forwardRef(function(props, ref) {
1975
- return React26.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
1976
- });
1977
- ReactRemoveScroll.classNames = RemoveScroll.classNames;
1978
- var Combination_default = ReactRemoveScroll;
1979
-
1980
- // ../../node_modules/aria-hidden/dist/es2015/index.js
1981
- var getDefaultParent = function(originalTarget) {
1982
- if (typeof document > "u")
1983
- return null;
1984
- var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
1985
- return sampleTarget.ownerDocument.body;
1986
- }, counterMap = /* @__PURE__ */ new WeakMap(), uncontrolledNodes = /* @__PURE__ */ new WeakMap(), markerMap = {}, lockCount = 0, unwrapHost = function(node) {
1987
- return node && (node.host || unwrapHost(node.parentNode));
1988
- }, correctTargets = function(parent2, targets) {
1989
- return targets.map(function(target) {
1990
- if (parent2.contains(target))
1991
- return target;
1992
- var correctedTarget = unwrapHost(target);
1993
- return correctedTarget && parent2.contains(correctedTarget) ? correctedTarget : (console.error("aria-hidden", target, "in not contained inside", parent2, ". Doing nothing"), null);
1994
- }).filter(function(x) {
1995
- return !!x;
1996
- });
1997
- }, applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
1998
- var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1999
- markerMap[markerName] || (markerMap[markerName] = /* @__PURE__ */ new WeakMap());
2000
- var markerCounter = markerMap[markerName], hiddenNodes = [], elementsToKeep = /* @__PURE__ */ new Set(), elementsToStop = new Set(targets), keep = function(el) {
2001
- !el || elementsToKeep.has(el) || (elementsToKeep.add(el), keep(el.parentNode));
2002
- };
2003
- targets.forEach(keep);
2004
- var deep = function(parent2) {
2005
- !parent2 || elementsToStop.has(parent2) || Array.prototype.forEach.call(parent2.children, function(node) {
2006
- if (elementsToKeep.has(node))
2007
- deep(node);
2008
- else
2009
- try {
2010
- var attr = node.getAttribute(controlAttribute), alreadyHidden = attr !== null && attr !== "false", counterValue = (counterMap.get(node) || 0) + 1, markerValue = (markerCounter.get(node) || 0) + 1;
2011
- counterMap.set(node, counterValue), markerCounter.set(node, markerValue), hiddenNodes.push(node), counterValue === 1 && alreadyHidden && uncontrolledNodes.set(node, !0), markerValue === 1 && node.setAttribute(markerName, "true"), alreadyHidden || node.setAttribute(controlAttribute, "true");
2012
- } catch (e) {
2013
- console.error("aria-hidden: cannot operate on ", node, e);
2014
- }
2015
- });
2016
- };
2017
- return deep(parentNode), elementsToKeep.clear(), lockCount++, function() {
2018
- hiddenNodes.forEach(function(node) {
2019
- var counterValue = counterMap.get(node) - 1, markerValue = markerCounter.get(node) - 1;
2020
- counterMap.set(node, counterValue), markerCounter.set(node, markerValue), counterValue || (uncontrolledNodes.has(node) || node.removeAttribute(controlAttribute), uncontrolledNodes.delete(node)), markerValue || node.removeAttribute(markerName);
2021
- }), lockCount--, lockCount || (counterMap = /* @__PURE__ */ new WeakMap(), counterMap = /* @__PURE__ */ new WeakMap(), uncontrolledNodes = /* @__PURE__ */ new WeakMap(), markerMap = {});
2022
- };
2023
- }, hideOthers = function(originalTarget, parentNode, markerName) {
2024
- markerName === void 0 && (markerName = "data-aria-hidden");
2025
- var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]), activeParentNode = parentNode || getDefaultParent(originalTarget);
2026
- return activeParentNode ? (targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script"))), applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden")) : function() {
2027
- return null;
2028
- };
2029
- };
2030
-
2031
- // ../../node_modules/@radix-ui/react-dialog/dist/index.mjs
2032
- var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1), __defProp18 = Object.defineProperty, __name17 = (target, value) => __defProp18(target, "name", { value, configurable: !0 }), DIALOG_NAME = "Dialog", [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME), [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME), Dialog = /* @__PURE__ */ __name17((props) => {
2033
- let {
2034
- __scopeDialog,
2035
- children,
2036
- open: openProp,
2037
- defaultOpen,
2038
- onOpenChange,
2039
- modal = !0
2040
- } = props, triggerRef = React27.useRef(null), contentRef = React27.useRef(null), { nodes: branchNodes, registry: branchRegistry } = useFocusScopeBranchRegistry(), [open, setOpen] = useControllableState({
2041
- prop: openProp,
2042
- defaultProp: defaultOpen ?? !1,
2043
- onChange: onOpenChange,
2044
- caller: DIALOG_NAME
2045
- }), [titleCount, setTitleCount] = React27.useState(0), [descriptionCount, setDescriptionCount] = React27.useState(0);
2046
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2047
- DialogProvider,
2048
- {
2049
- scope: __scopeDialog,
2050
- triggerRef,
2051
- contentRef,
2052
- contentId: useId(),
2053
- titleId: useId(),
2054
- descriptionId: useId(),
2055
- titlePresent: titleCount > 0,
2056
- descriptionPresent: descriptionCount > 0,
2057
- setTitleCount,
2058
- setDescriptionCount,
2059
- open,
2060
- onOpenChange: setOpen,
2061
- onOpenToggle: React27.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
2062
- modal,
2063
- branchNodes,
2064
- branchRegistry,
2065
- children
2066
- }
2067
- );
2068
- }, "Dialog"), TRIGGER_NAME = "DialogTrigger", DialogTrigger = /* @__PURE__ */ React27.forwardRef(
2069
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2070
- let { __scopeDialog, ...triggerProps } = props, context = useDialogContext(TRIGGER_NAME, __scopeDialog), composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
2071
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2072
- Primitive.button,
2073
- {
2074
- type: "button",
2075
- "aria-haspopup": "dialog",
2076
- "aria-expanded": context.open,
2077
- "aria-controls": context.open ? context.contentId : void 0,
2078
- "data-state": getState(context.open),
2079
- ...triggerProps,
2080
- ref: composedTriggerRef,
2081
- onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
2082
- }
2083
- );
2084
- }, "DialogTrigger")
2085
- ), PORTAL_NAME = "DialogPortal", [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
2086
- forceMount: void 0
2087
- }), DialogPortal = /* @__PURE__ */ __name17((props) => {
2088
- let { __scopeDialog, forceMount, children, container } = props, context = useDialogContext(PORTAL_NAME, __scopeDialog);
2089
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PortalProvider, { scope: __scopeDialog, forceMount, children: React27.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Portal, { asChild: !0, container, children: child }) })) });
2090
- }, "DialogPortal"), OVERLAY_NAME = "DialogOverlay", DialogOverlay = /* @__PURE__ */ React27.forwardRef(
2091
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2092
- let portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog), { forceMount = portalContext.forceMount, ...overlayProps } = props, context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
2093
- return context.modal ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
2094
- }, "DialogOverlay")
2095
- ), Slot = createSlot("DialogOverlay.RemoveScroll"), DialogOverlayImpl = /* @__PURE__ */ React27.forwardRef(
2096
- // blank line to reduce diff noise
2097
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2098
- let { __scopeDialog, ...overlayProps } = props, context = useDialogContext(OVERLAY_NAME, __scopeDialog), registerDismissableSurface = useDismissableLayerSurface(), composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);
2099
- return (
2100
- // Make sure `Content` is scrollable even when it doesn't live inside
2101
- // `RemoveScroll` (eg. when `Overlay` and `Content` are siblings). Nested
2102
- // layers are registered as branches and added as shards so they remain
2103
- // scrollable too. See https://github.com/radix-ui/primitives/issues/3423
2104
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2105
- Combination_default,
2106
- {
2107
- as: Slot,
2108
- allowPinchZoom: !0,
2109
- shards: React27.useMemo(
2110
- () => [context.contentRef, ...context.branchNodes.map((node) => ({ current: node }))],
2111
- [context.contentRef, context.branchNodes]
2112
- ),
2113
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2114
- Primitive.div,
2115
- {
2116
- "data-state": getState(context.open),
2117
- ...overlayProps,
2118
- ref: composedRefs,
2119
- style: { pointerEvents: "auto", ...overlayProps.style }
2120
- }
2121
- )
2122
- }
2123
- )
2124
- );
2125
- }, "DialogOverlayImpl")
2126
- ), CONTENT_NAME = "DialogContent", DialogContent = /* @__PURE__ */ React27.forwardRef(
2127
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2128
- let portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog), { forceMount = portalContext.forceMount, ...contentProps } = props, context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
2129
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
2130
- }, "DialogContent")
2131
- ), DialogContentModal = /* @__PURE__ */ React27.forwardRef(
2132
- // blank line to reduce diff noise
2133
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2134
- let context = useDialogContext(CONTENT_NAME, props.__scopeDialog), contentRef = React27.useRef(null), composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
2135
- return React27.useEffect(() => {
2136
- let content = contentRef.current;
2137
- if (content) return hideOthers(content);
2138
- }, []), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2139
- DialogContentImpl,
2140
- {
2141
- ...props,
2142
- ref: composedRefs,
2143
- trapFocus: context.open,
2144
- disableOutsidePointerEvents: context.open,
2145
- onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
2146
- event.preventDefault(), context.triggerRef.current?.focus();
2147
- }),
2148
- onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
2149
- let originalEvent = event.detail.originalEvent, ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === !0;
2150
- (originalEvent.button === 2 || ctrlLeftClick) && event.preventDefault();
2151
- }),
2152
- onFocusOutside: composeEventHandlers(
2153
- props.onFocusOutside,
2154
- (event) => event.preventDefault()
2155
- )
2156
- }
2157
- );
2158
- }, "DialogContentModal")
2159
- ), DialogContentNonModal = /* @__PURE__ */ React27.forwardRef(
2160
- // blank line to reduce diff noise
2161
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2162
- let context = useDialogContext(CONTENT_NAME, props.__scopeDialog), hasInteractedOutsideRef = React27.useRef(!1), hasPointerDownOutsideRef = React27.useRef(!1);
2163
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2164
- DialogContentImpl,
2165
- {
2166
- ...props,
2167
- ref: forwardedRef,
2168
- trapFocus: !1,
2169
- disableOutsidePointerEvents: !1,
2170
- onCloseAutoFocus: (event) => {
2171
- props.onCloseAutoFocus?.(event), event.defaultPrevented || (hasInteractedOutsideRef.current || context.triggerRef.current?.focus(), event.preventDefault()), hasInteractedOutsideRef.current = !1, hasPointerDownOutsideRef.current = !1;
2172
- },
2173
- onInteractOutside: (event) => {
2174
- props.onInteractOutside?.(event), event.defaultPrevented || (hasInteractedOutsideRef.current = !0, event.detail.originalEvent.type === "pointerdown" && (hasPointerDownOutsideRef.current = !0));
2175
- let target = event.target;
2176
- context.triggerRef.current?.contains(target) && event.preventDefault(), event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current && event.preventDefault();
2177
- }
2178
- }
2179
- );
2180
- }, "DialogContentNonModal")
2181
- ), DialogContentImpl = /* @__PURE__ */ React27.forwardRef(
2182
- // blank line to reduce diff noise
2183
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2184
- let {
2185
- __scopeDialog,
2186
- trapFocus,
2187
- onOpenAutoFocus,
2188
- onCloseAutoFocus,
2189
- "aria-describedby": ariaDescribedby,
2190
- children,
2191
- ...contentProps
2192
- } = props, context = useDialogContext(CONTENT_NAME, __scopeDialog);
2193
- return useFocusGuards(), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FocusScopeBranchProvider, { registry: context.branchRegistry, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2194
- FocusScope,
2195
- {
2196
- asChild: !0,
2197
- loop: !0,
2198
- trapped: trapFocus,
2199
- branches: context.branchNodes,
2200
- onMountAutoFocus: onOpenAutoFocus,
2201
- onUnmountAutoFocus: onCloseAutoFocus,
2202
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2203
- DismissableLayer,
2204
- {
2205
- role: "dialog",
2206
- id: context.contentId,
2207
- "aria-labelledby": context.titlePresent ? context.titleId : void 0,
2208
- "aria-describedby": context.descriptionPresent ? concatAriaDescribedby2(ariaDescribedby, context.descriptionId) : ariaDescribedby,
2209
- "data-state": getState(context.open),
2210
- ...contentProps,
2211
- ref: forwardedRef,
2212
- deferPointerDownOutside: !0,
2213
- onDismiss: () => context.onOpenChange(!1),
2214
- children
2215
- }
2216
- )
2217
- }
2218
- ) });
2219
- }, "DialogContentImpl")
2220
- ), DialogTitle = /* @__PURE__ */ React27.forwardRef(
2221
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2222
- let { __scopeDialog, ...titleProps } = props, context = useDialogContext("DialogTitle", __scopeDialog), { setTitleCount } = context;
2223
- return useLayoutEffect2(() => (setTitleCount((count3) => count3 + 1), () => setTitleCount((count3) => count3 - 1)), [setTitleCount]), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
2224
- }, "DialogTitle")
2225
- ), DialogDescription = /* @__PURE__ */ React27.forwardRef(
2226
- // blank line to reduce diff noise
2227
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2228
- let { __scopeDialog, ...descriptionProps } = props, context = useDialogContext("DialogDescription", __scopeDialog), { setDescriptionCount } = context;
2229
- return useLayoutEffect2(() => (setDescriptionCount((count3) => count3 + 1), () => setDescriptionCount((count3) => count3 - 1)), [setDescriptionCount]), /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
2230
- }, "DialogDescription")
2231
- ), CLOSE_NAME = "DialogClose", DialogClose = /* @__PURE__ */ React27.forwardRef(
2232
- /* @__PURE__ */ __name17(function(props, forwardedRef) {
2233
- let { __scopeDialog, ...closeProps } = props, context = useDialogContext(CLOSE_NAME, __scopeDialog);
2234
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2235
- Primitive.button,
2236
- {
2237
- type: "button",
2238
- ...closeProps,
2239
- ref: forwardedRef,
2240
- onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(!1))
2241
- }
2242
- );
2243
- }, "DialogClose")
2244
- ), WarningProvider = /* @__PURE__ */ __name17((props) => props.children, "WarningProvider");
2245
- function concatAriaDescribedby2(...values) {
2246
- let ids = /* @__PURE__ */ new Set();
2247
- for (let value of values)
2248
- if (typeof value == "string")
2249
- for (let id of String(value).trim().split(/\s+/))
2250
- id && ids.add(id);
2251
- return ids.size > 0 ? Array.from(ids).join(" ") : void 0;
2252
- }
2253
- __name17(concatAriaDescribedby2, "concatAriaDescribedby");
2254
- function getState(open) {
2255
- return open ? "open" : "closed";
2256
- }
2257
- __name17(getState, "getState");
2258
-
2259
- // ../../node_modules/@radix-ui/react-use-size/dist/index.mjs
2260
- var React28 = __toESM(require_react(), 1);
2261
- var __defProp19 = Object.defineProperty, __name18 = (target, value) => __defProp19(target, "name", { value, configurable: !0 });
2262
- function useSize(element) {
2263
- let [size4, setSize] = React28.useState(void 0);
2264
- return useLayoutEffect2(() => {
2265
- if (element) {
2266
- setSize({ width: element.offsetWidth, height: element.offsetHeight });
2267
- let rAF = 0, resizeObserver = new ResizeObserver((entries) => {
2268
- if (!Array.isArray(entries) || !entries.length)
2269
- return;
2270
- let entry = entries[0];
2271
- window.cancelAnimationFrame(rAF), rAF = window.requestAnimationFrame(() => {
2272
- let width, height;
2273
- if ("borderBoxSize" in entry) {
2274
- let borderSizeEntry = entry.borderBoxSize, borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
2275
- width = borderSize.inlineSize, height = borderSize.blockSize;
2276
- } else
2277
- width = element.offsetWidth, height = element.offsetHeight;
2278
- setSize({ width, height });
2279
- });
2280
- });
2281
- return resizeObserver.observe(element, { box: "border-box" }), () => {
2282
- window.cancelAnimationFrame(rAF), resizeObserver.unobserve(element);
2283
- };
2284
- } else
2285
- setSize(void 0);
2286
- }, [element]), size4;
2287
- }
2288
- __name18(useSize, "useSize");
2289
-
2290
- // ../../node_modules/@radix-ui/react-menu/dist/index.mjs
2291
- var React34 = __toESM(require_react(), 1);
2292
-
2293
- // ../../node_modules/@radix-ui/react-popper/dist/index.mjs
2294
- var React31 = __toESM(require_react(), 1);
2295
-
2296
- // ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
2297
- var sides = ["top", "right", "bottom", "left"];
2298
- var min = Math.min, max = Math.max, round = Math.round, floor = Math.floor, createCoords = (v) => ({
2299
- x: v,
2300
- y: v
2301
- }), oppositeSideMap = {
2302
- left: "right",
2303
- right: "left",
2304
- bottom: "top",
2305
- top: "bottom"
2306
- };
2307
- function clamp(start2, value, end) {
2308
- return max(start2, min(value, end));
2309
- }
2310
- function evaluate(value, param) {
2311
- return typeof value == "function" ? value(param) : value;
2312
- }
2313
- function getSide(placement) {
2314
- return placement.split("-")[0];
2315
- }
2316
- function getAlignment(placement) {
2317
- return placement.split("-")[1];
2318
- }
2319
- function getOppositeAxis(axis) {
2320
- return axis === "x" ? "y" : "x";
2321
- }
2322
- function getAxisLength(axis) {
2323
- return axis === "y" ? "height" : "width";
2324
- }
2325
- function getSideAxis(placement) {
2326
- let firstChar = placement[0];
2327
- return firstChar === "t" || firstChar === "b" ? "y" : "x";
2328
- }
2329
- function getAlignmentAxis(placement) {
2330
- return getOppositeAxis(getSideAxis(placement));
2331
- }
2332
- function getAlignmentSides(placement, rects, rtl) {
2333
- rtl === void 0 && (rtl = !1);
2334
- let alignment = getAlignment(placement), alignmentAxis = getAlignmentAxis(placement), length = getAxisLength(alignmentAxis), mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
2335
- return rects.reference[length] > rects.floating[length] && (mainAlignmentSide = getOppositePlacement(mainAlignmentSide)), [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
2336
- }
2337
- function getExpandedPlacements(placement) {
2338
- let oppositePlacement = getOppositePlacement(placement);
2339
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
2340
- }
2341
- function getOppositeAlignmentPlacement(placement) {
2342
- return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
2343
- }
2344
- var lrPlacement = ["left", "right"], rlPlacement = ["right", "left"], tbPlacement = ["top", "bottom"], btPlacement = ["bottom", "top"];
2345
- function getSideList(side, isStart, rtl) {
2346
- switch (side) {
2347
- case "top":
2348
- case "bottom":
2349
- return rtl ? isStart ? rlPlacement : lrPlacement : isStart ? lrPlacement : rlPlacement;
2350
- case "left":
2351
- case "right":
2352
- return isStart ? tbPlacement : btPlacement;
2353
- default:
2354
- return [];
2355
- }
2356
- }
2357
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
2358
- let alignment = getAlignment(placement), list = getSideList(getSide(placement), direction === "start", rtl);
2359
- return alignment && (list = list.map((side) => side + "-" + alignment), flipAlignment && (list = list.concat(list.map(getOppositeAlignmentPlacement)))), list;
2360
- }
2361
- function getOppositePlacement(placement) {
2362
- let side = getSide(placement);
2363
- return oppositeSideMap[side] + placement.slice(side.length);
2364
- }
2365
- function expandPaddingObject(padding) {
2366
- var _padding$top, _padding$right, _padding$bottom, _padding$left;
2367
- return {
2368
- top: (_padding$top = padding.top) != null ? _padding$top : 0,
2369
- right: (_padding$right = padding.right) != null ? _padding$right : 0,
2370
- bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
2371
- left: (_padding$left = padding.left) != null ? _padding$left : 0
2372
- };
2373
- }
2374
- function getPaddingObject(padding) {
2375
- return typeof padding != "number" ? expandPaddingObject(padding) : {
2376
- top: padding,
2377
- right: padding,
2378
- bottom: padding,
2379
- left: padding
2380
- };
2381
- }
2382
- function rectToClientRect(rect2) {
2383
- let {
2384
- x,
2385
- y,
2386
- width,
2387
- height
2388
- } = rect2;
2389
- return {
2390
- width,
2391
- height,
2392
- top: y,
2393
- left: x,
2394
- right: x + width,
2395
- bottom: y + height,
2396
- x,
2397
- y
2398
- };
2399
- }
2400
-
2401
- // ../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs
2402
- function computeCoordsFromPlacement(_ref, placement, rtl) {
2403
- let {
2404
- reference,
2405
- floating
2406
- } = _ref, sideAxis = getSideAxis(placement), alignmentAxis = getAlignmentAxis(placement), alignLength = getAxisLength(alignmentAxis), side = getSide(placement), isVertical = sideAxis === "y", commonX = reference.x + reference.width / 2 - floating.width / 2, commonY = reference.y + reference.height / 2 - floating.height / 2, commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2, coords;
2407
- switch (side) {
2408
- case "top":
2409
- coords = {
2410
- x: commonX,
2411
- y: reference.y - floating.height
2412
- };
2413
- break;
2414
- case "bottom":
2415
- coords = {
2416
- x: commonX,
2417
- y: reference.y + reference.height
2418
- };
2419
- break;
2420
- case "right":
2421
- coords = {
2422
- x: reference.x + reference.width,
2423
- y: commonY
2424
- };
2425
- break;
2426
- case "left":
2427
- coords = {
2428
- x: reference.x - floating.width,
2429
- y: commonY
2430
- };
2431
- break;
2432
- default:
2433
- coords = {
2434
- x: reference.x,
2435
- y: reference.y
2436
- };
2437
- }
2438
- let alignment = getAlignment(placement);
2439
- return alignment && (coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1)), coords;
2440
- }
2441
- async function detectOverflow(state, options2) {
2442
- var _await$platform$isEle;
2443
- options2 === void 0 && (options2 = {});
2444
- let {
2445
- x,
2446
- y,
2447
- platform: platform2,
2448
- rects,
2449
- elements,
2450
- strategy
2451
- } = state, {
2452
- boundary = "clippingAncestors",
2453
- rootBoundary = "viewport",
2454
- elementContext = "floating",
2455
- altBoundary = !1,
2456
- padding = 0
2457
- } = evaluate(options2, state), paddingObject = getPaddingObject(padding), element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext], clippingClientRect = rectToClientRect(await platform2.getClippingRect({
2458
- element: (_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) == null || _await$platform$isEle ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
2459
- boundary,
2460
- rootBoundary,
2461
- strategy
2462
- })), rect2 = elementContext === "floating" ? {
2463
- x,
2464
- y,
2465
- width: rects.floating.width,
2466
- height: rects.floating.height
2467
- } : rects.reference, offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating)), offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) && await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
2468
- x: 1,
2469
- y: 1
2470
- }, elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
2471
- elements,
2472
- rect: rect2,
2473
- offsetParent,
2474
- strategy
2475
- }) : rect2);
2476
- return {
2477
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
2478
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
2479
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
2480
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
2481
- };
2482
- }
2483
- var MAX_RESET_COUNT = 50, computePosition = async (reference, floating, config) => {
2484
- let {
2485
- placement = "bottom",
2486
- strategy = "absolute",
2487
- middleware = [],
2488
- platform: platform2
2489
- } = config, platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
2490
- ...platform2,
2491
- detectOverflow
2492
- }, rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating)), rects = await platform2.getElementRects({
2493
- reference,
2494
- floating,
2495
- strategy
2496
- }), {
2497
- x,
2498
- y
2499
- } = computeCoordsFromPlacement(rects, placement, rtl), statefulPlacement = placement, resetCount = 0, middlewareData = {};
2500
- for (let i = 0; i < middleware.length; i++) {
2501
- let currentMiddleware = middleware[i];
2502
- if (!currentMiddleware)
2503
- continue;
2504
- let {
2505
- name,
2506
- fn
2507
- } = currentMiddleware, {
2508
- x: nextX,
2509
- y: nextY,
2510
- data,
2511
- reset
2512
- } = await fn({
2513
- x,
2514
- y,
2515
- initialPlacement: placement,
2516
- placement: statefulPlacement,
2517
- strategy,
2518
- middlewareData,
2519
- rects,
2520
- platform: platformWithDetectOverflow,
2521
- elements: {
2522
- reference,
2523
- floating
2524
- }
2525
- });
2526
- x = nextX ?? x, y = nextY ?? y, middlewareData[name] = {
2527
- ...middlewareData[name],
2528
- ...data
2529
- }, reset && resetCount < MAX_RESET_COUNT && (resetCount++, typeof reset == "object" && (reset.placement && (statefulPlacement = reset.placement), reset.rects && (rects = reset.rects === !0 ? await platform2.getElementRects({
2530
- reference,
2531
- floating,
2532
- strategy
2533
- }) : reset.rects), {
2534
- x,
2535
- y
2536
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)), i = -1);
2537
- }
2538
- return {
2539
- x,
2540
- y,
2541
- placement: statefulPlacement,
2542
- strategy,
2543
- middlewareData
2544
- };
2545
- }, arrow = (options2) => ({
2546
- name: "arrow",
2547
- options: options2,
2548
- async fn(state) {
2549
- let {
2550
- x,
2551
- y,
2552
- placement,
2553
- rects,
2554
- platform: platform2,
2555
- elements,
2556
- middlewareData
2557
- } = state, {
2558
- element,
2559
- padding = 0
2560
- } = evaluate(options2, state) || {};
2561
- if (element == null)
2562
- return {};
2563
- let paddingObject = getPaddingObject(padding), coords = {
2564
- x,
2565
- y
2566
- }, axis = getAlignmentAxis(placement), length = getAxisLength(axis), arrowDimensions = await platform2.getDimensions(element), isYAxis = axis === "y", minProp = isYAxis ? "top" : "left", maxProp = isYAxis ? "bottom" : "right", clientProp = isYAxis ? "clientHeight" : "clientWidth", endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length], startDiff = coords[axis] - rects.reference[axis], arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element)), clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
2567
- (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) && (clientSize = elements.floating[clientProp] || rects.floating[length]);
2568
- let centerToReference = endDiff / 2 - startDiff / 2, largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1, minPadding = min(paddingObject[minProp], largestPossiblePadding), maxPadding = min(paddingObject[maxProp], largestPossiblePadding), max2 = clientSize - arrowDimensions[length] - maxPadding, center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference, offset4 = clamp(minPadding, center, max2), shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0, alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max2 : 0;
2569
- return {
2570
- [axis]: coords[axis] + alignmentOffset,
2571
- data: {
2572
- [axis]: offset4,
2573
- centerOffset: center - offset4 - alignmentOffset,
2574
- ...shouldAddOffset && {
2575
- alignmentOffset
2576
- }
2577
- },
2578
- reset: shouldAddOffset
2579
- };
2580
- }
2581
- });
2582
- var flip = function(options2) {
2583
- return options2 === void 0 && (options2 = {}), {
2584
- name: "flip",
2585
- options: options2,
2586
- async fn(state) {
2587
- var _middlewareData$arrow, _middlewareData$flip;
2588
- let {
2589
- placement,
2590
- middlewareData,
2591
- rects,
2592
- initialPlacement,
2593
- platform: platform2,
2594
- elements
2595
- } = state, {
2596
- mainAxis: checkMainAxis = !0,
2597
- crossAxis: checkCrossAxis = !0,
2598
- fallbackPlacements: specifiedFallbackPlacements,
2599
- fallbackStrategy = "bestFit",
2600
- fallbackAxisSideDirection = "none",
2601
- flipAlignment = !0,
2602
- ...detectOverflowOptions
2603
- } = evaluate(options2, state);
2604
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)
2605
- return {};
2606
- let side = getSide(placement), initialSideAxis = getSideAxis(initialPlacement), isBasePlacement = getSide(initialPlacement) === initialPlacement, rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)), fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)), hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
2607
- !specifiedFallbackPlacements && hasFallbackAxisSideDirection && fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
2608
- let placements2 = [initialPlacement, ...fallbackPlacements], overflow = await platform2.detectOverflow(state, detectOverflowOptions), overflows = [], overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
2609
- if (checkMainAxis && overflows.push(overflow[side]), checkCrossAxis) {
2610
- let sides2 = getAlignmentSides(placement, rects, rtl);
2611
- overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
2612
- }
2613
- if (overflowsData = [...overflowsData, {
2614
- placement,
2615
- overflows
2616
- }], !overflows.every((side2) => side2 <= 0)) {
2617
- var _middlewareData$flip2, _overflowsData$filter;
2618
- let nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1, nextPlacement = placements2[nextIndex];
2619
- if (nextPlacement && (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : !1) || // We leave the current main axis only if every placement on that axis
2620
- // overflows the main axis.
2621
- overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : !0)))
2622
- return {
2623
- data: {
2624
- index: nextIndex,
2625
- overflows: overflowsData
2626
- },
2627
- reset: {
2628
- placement: nextPlacement
2629
- }
2630
- };
2631
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
2632
- if (!resetPlacement)
2633
- switch (fallbackStrategy) {
2634
- case "bestFit": {
2635
- var _overflowsData$filter2;
2636
- let placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
2637
- if (hasFallbackAxisSideDirection) {
2638
- let currentSideAxis = getSideAxis(d.placement);
2639
- return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
2640
- // reading directions favoring greater width.
2641
- currentSideAxis === "y";
2642
- }
2643
- return !0;
2644
- }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
2645
- placement2 && (resetPlacement = placement2);
2646
- break;
2647
- }
2648
- case "initialPlacement":
2649
- resetPlacement = initialPlacement;
2650
- break;
2651
- }
2652
- if (placement !== resetPlacement)
2653
- return {
2654
- reset: {
2655
- placement: resetPlacement
2656
- }
2657
- };
2658
- }
2659
- return {};
2660
- }
2661
- };
2662
- };
2663
- function getSideOffsets(overflow, rect2) {
2664
- return {
2665
- top: overflow.top - rect2.height,
2666
- right: overflow.right - rect2.width,
2667
- bottom: overflow.bottom - rect2.height,
2668
- left: overflow.left - rect2.width
2669
- };
2670
- }
2671
- function isAnySideFullyClipped(overflow) {
2672
- return sides.some((side) => overflow[side] >= 0);
2673
- }
2674
- var hide = function(options2) {
2675
- return options2 === void 0 && (options2 = {}), {
2676
- name: "hide",
2677
- options: options2,
2678
- async fn(state) {
2679
- let {
2680
- rects,
2681
- platform: platform2
2682
- } = state, {
2683
- strategy = "referenceHidden",
2684
- ...detectOverflowOptions
2685
- } = evaluate(options2, state);
2686
- switch (strategy) {
2687
- case "referenceHidden": {
2688
- let overflow = await platform2.detectOverflow(state, {
2689
- ...detectOverflowOptions,
2690
- elementContext: "reference"
2691
- }), offsets = getSideOffsets(overflow, rects.reference);
2692
- return {
2693
- data: {
2694
- referenceHiddenOffsets: offsets,
2695
- referenceHidden: isAnySideFullyClipped(offsets)
2696
- }
2697
- };
2698
- }
2699
- case "escaped": {
2700
- let overflow = await platform2.detectOverflow(state, {
2701
- ...detectOverflowOptions,
2702
- altBoundary: !0
2703
- }), offsets = getSideOffsets(overflow, rects.floating);
2704
- return {
2705
- data: {
2706
- escapedOffsets: offsets,
2707
- escaped: isAnySideFullyClipped(offsets)
2708
- }
2709
- };
2710
- }
2711
- default:
2712
- return {};
2713
- }
2714
- }
2715
- };
2716
- };
2717
- var originSides = /* @__PURE__ */ new Set(["left", "top"]);
2718
- async function convertValueToCoords(state, options2) {
2719
- let {
2720
- placement,
2721
- platform: platform2,
2722
- elements
2723
- } = state, rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)), side = getSide(placement), alignment = getAlignment(placement), isVertical = getSideAxis(placement) === "y", mainAxisMulti = originSides.has(side) ? -1 : 1, crossAxisMulti = rtl && isVertical ? -1 : 1, rawValue = evaluate(options2, state), {
2724
- mainAxis,
2725
- crossAxis,
2726
- alignmentAxis
2727
- } = typeof rawValue == "number" ? {
2728
- mainAxis: rawValue,
2729
- crossAxis: 0,
2730
- alignmentAxis: null
2731
- } : {
2732
- mainAxis: rawValue.mainAxis || 0,
2733
- crossAxis: rawValue.crossAxis || 0,
2734
- alignmentAxis: rawValue.alignmentAxis
2735
- };
2736
- return alignment && typeof alignmentAxis == "number" && (crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis), isVertical ? {
2737
- x: crossAxis * crossAxisMulti,
2738
- y: mainAxis * mainAxisMulti
2739
- } : {
2740
- x: mainAxis * mainAxisMulti,
2741
- y: crossAxis * crossAxisMulti
2742
- };
2743
- }
2744
- var offset = function(options2) {
2745
- return options2 === void 0 && (options2 = 0), {
2746
- name: "offset",
2747
- options: options2,
2748
- async fn(state) {
2749
- var _middlewareData$offse, _middlewareData$arrow;
2750
- let {
2751
- x,
2752
- y,
2753
- placement,
2754
- middlewareData
2755
- } = state, diffCoords = await convertValueToCoords(state, options2);
2756
- return placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset ? {} : {
2757
- x: x + diffCoords.x,
2758
- y: y + diffCoords.y,
2759
- data: {
2760
- ...diffCoords,
2761
- placement
2762
- }
2763
- };
2764
- }
2765
- };
2766
- }, shift = function(options2) {
2767
- return options2 === void 0 && (options2 = {}), {
2768
- name: "shift",
2769
- options: options2,
2770
- async fn(state) {
2771
- let {
2772
- x,
2773
- y,
2774
- placement,
2775
- platform: platform2
2776
- } = state, {
2777
- mainAxis: checkMainAxis = !0,
2778
- crossAxis: checkCrossAxis = !1,
2779
- limiter = {
2780
- fn: (_ref) => {
2781
- let {
2782
- x: x2,
2783
- y: y2
2784
- } = _ref;
2785
- return {
2786
- x: x2,
2787
- y: y2
2788
- };
2789
- }
2790
- },
2791
- ...detectOverflowOptions
2792
- } = evaluate(options2, state), coords = {
2793
- x,
2794
- y
2795
- }, overflow = await platform2.detectOverflow(state, detectOverflowOptions), crossAxis = getSideAxis(placement), mainAxis = getOppositeAxis(crossAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis], clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
2796
- checkMainAxis && (mainAxisCoord = clampCoord(mainAxis, mainAxisCoord)), checkCrossAxis && (crossAxisCoord = clampCoord(crossAxis, crossAxisCoord));
2797
- let limitedCoords = limiter.fn({
2798
- ...state,
2799
- [mainAxis]: mainAxisCoord,
2800
- [crossAxis]: crossAxisCoord
2801
- });
2802
- return {
2803
- ...limitedCoords,
2804
- data: {
2805
- x: limitedCoords.x - x,
2806
- y: limitedCoords.y - y,
2807
- enabled: {
2808
- [mainAxis]: checkMainAxis,
2809
- [crossAxis]: checkCrossAxis
2810
- }
2811
- }
2812
- };
2813
- }
2814
- };
2815
- }, limitShift = function(options2) {
2816
- return options2 === void 0 && (options2 = {}), {
2817
- options: options2,
2818
- fn(state) {
2819
- var _rawOffset$mainAxis, _rawOffset$crossAxis;
2820
- let {
2821
- x,
2822
- y,
2823
- placement,
2824
- rects,
2825
- middlewareData
2826
- } = state, {
2827
- offset: offset4 = 0,
2828
- mainAxis: checkMainAxis = !0,
2829
- crossAxis: checkCrossAxis = !0
2830
- } = evaluate(options2, state), coords = {
2831
- x,
2832
- y
2833
- }, crossAxis = getSideAxis(placement), mainAxis = getOppositeAxis(crossAxis), mainAxisCoord = coords[mainAxis], crossAxisCoord = coords[crossAxis], rawOffset = evaluate(offset4, state), computedOffset = typeof rawOffset == "number" ? {
2834
- mainAxis: rawOffset,
2835
- crossAxis: 0
2836
- } : {
2837
- mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
2838
- crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
2839
- };
2840
- if (checkMainAxis) {
2841
- let len = mainAxis === "y" ? "height" : "width", limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis, limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
2842
- mainAxisCoord < limitMin ? mainAxisCoord = limitMin : mainAxisCoord > limitMax && (mainAxisCoord = limitMax);
2843
- }
2844
- if (checkCrossAxis) {
2845
- var _middlewareData$offse, _middlewareData$offse2;
2846
- let len = mainAxis === "y" ? "width" : "height", isOriginSide = originSides.has(getSide(placement)), limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide && ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0) + (isOriginSide ? 0 : computedOffset.crossAxis), limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
2847
- crossAxisCoord < limitMin ? crossAxisCoord = limitMin : crossAxisCoord > limitMax && (crossAxisCoord = limitMax);
2848
- }
2849
- return {
2850
- [mainAxis]: mainAxisCoord,
2851
- [crossAxis]: crossAxisCoord
2852
- };
2853
- }
2854
- };
2855
- }, size = function(options2) {
2856
- return options2 === void 0 && (options2 = {}), {
2857
- name: "size",
2858
- options: options2,
2859
- async fn(state) {
2860
- let {
2861
- placement,
2862
- rects,
2863
- platform: platform2,
2864
- elements
2865
- } = state, {
2866
- apply = () => {
2867
- },
2868
- ...detectOverflowOptions
2869
- } = evaluate(options2, state), overflow = await platform2.detectOverflow(state, detectOverflowOptions), side = getSide(placement), alignment = getAlignment(placement), isYAxis = getSideAxis(placement) === "y", {
2870
- width,
2871
- height
2872
- } = rects.floating, heightSide, widthSide;
2873
- side === "top" || side === "bottom" ? (heightSide = side, widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right") : (widthSide = side, heightSide = alignment === "end" ? "top" : "bottom");
2874
- let maximumClippingHeight = height - overflow.top - overflow.bottom, maximumClippingWidth = width - overflow.left - overflow.right, overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight), overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth), shiftData = state.middlewareData.shift, noShift = !shiftData, availableHeight = overflowAvailableHeight, availableWidth = overflowAvailableWidth;
2875
- shiftData != null && shiftData.enabled.x && (availableWidth = maximumClippingWidth), shiftData != null && shiftData.enabled.y && (availableHeight = maximumClippingHeight), noShift && !alignment && (isYAxis ? availableWidth = width - 2 * max(overflow.left, overflow.right) : availableHeight = height - 2 * max(overflow.top, overflow.bottom)), await apply({
2876
- ...state,
2877
- availableWidth,
2878
- availableHeight
2879
- });
2880
- let nextDimensions = await platform2.getDimensions(elements.floating);
2881
- return width !== nextDimensions.width || height !== nextDimensions.height ? {
2882
- reset: {
2883
- rects: !0
2884
- }
2885
- } : {};
2886
- }
2887
- };
2888
- };
2889
-
2890
- // ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2891
- function hasWindow() {
2892
- return typeof window < "u";
2893
- }
2894
- function getNodeName(node) {
2895
- return isNode(node) ? (node.nodeName || "").toLowerCase() : "#document";
2896
- }
2897
- function getWindow(node) {
2898
- var _node$ownerDocument;
2899
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
2900
- }
2901
- function getDocumentElement(node) {
2902
- var _ref;
2903
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
2904
- }
2905
- function isNode(value) {
2906
- return hasWindow() ? value instanceof Node || value instanceof getWindow(value).Node : !1;
2907
- }
2908
- function isElement(value) {
2909
- return hasWindow() ? value instanceof Element || value instanceof getWindow(value).Element : !1;
2910
- }
2911
- function isHTMLElement(value) {
2912
- return hasWindow() ? value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement : !1;
2913
- }
2914
- function isShadowRoot(value) {
2915
- return !hasWindow() || typeof ShadowRoot > "u" ? !1 : value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
2916
- }
2917
- function isOverflowElement(element) {
2918
- let {
2919
- overflow,
2920
- overflowX,
2921
- overflowY,
2922
- display
2923
- } = getComputedStyle2(element);
2924
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
2925
- }
2926
- function isTableElement(element) {
2927
- return /^(table|td|th)$/.test(getNodeName(element));
2928
- }
2929
- function isTopLayer(element) {
2930
- try {
2931
- if (element.matches(":popover-open"))
2932
- return !0;
2933
- } catch {
2934
- }
2935
- try {
2936
- return element.matches(":modal");
2937
- } catch {
2938
- return !1;
2939
- }
2940
- }
2941
- var willChangeRe = /transform|translate|scale|rotate|perspective|filter/, containRe = /paint|layout|strict|content/, isNotNone = (value) => !!value && value !== "none", isWebKitValue;
2942
- function isContainingBlock(elementOrCss) {
2943
- let css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
2944
- return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
2945
- }
2946
- function getContainingBlock(element) {
2947
- let currentNode = getParentNode(element);
2948
- for (; isHTMLElement(currentNode) && !isLastTraversableNode(currentNode); ) {
2949
- if (isContainingBlock(currentNode))
2950
- return currentNode;
2951
- if (isTopLayer(currentNode))
2952
- return null;
2953
- currentNode = getParentNode(currentNode);
2954
- }
2955
- return null;
2956
- }
2957
- function isWebKit() {
2958
- return isWebKitValue == null && (isWebKitValue = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), isWebKitValue;
2959
- }
2960
- function isLastTraversableNode(node) {
2961
- return /^(html|body|#document)$/.test(getNodeName(node));
2962
- }
2963
- function getComputedStyle2(element) {
2964
- return getWindow(element).getComputedStyle(element);
2965
- }
2966
- function getNodeScroll(element) {
2967
- return isElement(element) ? {
2968
- scrollLeft: element.scrollLeft,
2969
- scrollTop: element.scrollTop
2970
- } : {
2971
- scrollLeft: element.scrollX,
2972
- scrollTop: element.scrollY
2973
- };
2974
- }
2975
- function getParentNode(node) {
2976
- if (getNodeName(node) === "html")
2977
- return node;
2978
- let result = (
2979
- // Step into the shadow DOM of the parent of a slotted node.
2980
- node.assignedSlot || // DOM Element detected.
2981
- node.parentNode || // ShadowRoot detected.
2982
- isShadowRoot(node) && node.host || // Fallback.
2983
- getDocumentElement(node)
2984
- );
2985
- return isShadowRoot(result) ? result.host : result;
2986
- }
2987
- function getNearestOverflowAncestor(node) {
2988
- let parentNode = getParentNode(node);
2989
- return isLastTraversableNode(parentNode) ? (node.ownerDocument || node).body : isHTMLElement(parentNode) && isOverflowElement(parentNode) ? parentNode : getNearestOverflowAncestor(parentNode);
2990
- }
2991
- function getOverflowAncestors(node, list, traverseIframes) {
2992
- var _node$ownerDocument2;
2993
- list === void 0 && (list = []), traverseIframes === void 0 && (traverseIframes = !0);
2994
- let scrollableAncestor = getNearestOverflowAncestor(node), isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body), win = getWindow(scrollableAncestor);
2995
- if (isBody) {
2996
- let frameElement = getFrameElement(win);
2997
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
2998
- } else
2999
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
3000
- }
3001
- function getFrameElement(win) {
3002
- return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
3003
- }
3004
-
3005
- // ../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
3006
- function getCssDimensions(element) {
3007
- let css = getComputedStyle2(element), width = parseFloat(css.width) || 0, height = parseFloat(css.height) || 0, hasOffset = isHTMLElement(element), offsetWidth = hasOffset ? element.offsetWidth : width, offsetHeight = hasOffset ? element.offsetHeight : height, shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
3008
- return shouldFallback && (width = offsetWidth, height = offsetHeight), {
3009
- width,
3010
- height,
3011
- $: shouldFallback
3012
- };
3013
- }
3014
- function unwrapElement(element) {
3015
- return isElement(element) ? element : element.contextElement;
3016
- }
3017
- function getScale(element) {
3018
- let domElement = unwrapElement(element);
3019
- if (!isHTMLElement(domElement))
3020
- return createCoords(1);
3021
- let rect2 = domElement.getBoundingClientRect(), {
3022
- width,
3023
- height,
3024
- $
3025
- } = getCssDimensions(domElement), x = ($ ? round(rect2.width) : rect2.width) / width, y = ($ ? round(rect2.height) : rect2.height) / height;
3026
- return (!x || !Number.isFinite(x)) && (x = 1), (!y || !Number.isFinite(y)) && (y = 1), {
3027
- x,
3028
- y
3029
- };
3030
- }
3031
- var noOffsets = /* @__PURE__ */ createCoords(0);
3032
- function getVisualOffsets(element) {
3033
- let win = getWindow(element);
3034
- return !isWebKit() || !win.visualViewport ? noOffsets : {
3035
- x: win.visualViewport.offsetLeft,
3036
- y: win.visualViewport.offsetTop
3037
- };
3038
- }
3039
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
3040
- return isFixed === void 0 && (isFixed = !1), !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
3041
- }
3042
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
3043
- includeScale === void 0 && (includeScale = !1), isFixedStrategy === void 0 && (isFixedStrategy = !1);
3044
- let clientRect = element.getBoundingClientRect(), domElement = unwrapElement(element), scale = createCoords(1);
3045
- includeScale && (offsetParent ? isElement(offsetParent) && (scale = getScale(offsetParent)) : scale = getScale(element));
3046
- let visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0), x = (clientRect.left + visualOffsets.x) / scale.x, y = (clientRect.top + visualOffsets.y) / scale.y, width = clientRect.width / scale.x, height = clientRect.height / scale.y;
3047
- if (domElement && offsetParent) {
3048
- let win = getWindow(domElement), offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent, currentWin = win, currentIFrame = getFrameElement(currentWin);
3049
- for (; currentIFrame && offsetWin !== currentWin; ) {
3050
- let iframeScale = getScale(currentIFrame), iframeRect = currentIFrame.getBoundingClientRect(), css = getComputedStyle2(currentIFrame), left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x, top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
3051
- x *= iframeScale.x, y *= iframeScale.y, width *= iframeScale.x, height *= iframeScale.y, x += left, y += top, currentWin = getWindow(currentIFrame), currentIFrame = getFrameElement(currentWin);
3052
- }
3053
- }
3054
- return rectToClientRect({
3055
- width,
3056
- height,
3057
- x,
3058
- y
3059
- });
3060
- }
3061
- function getWindowScrollBarX(element, rect2) {
3062
- let leftScroll = getNodeScroll(element).scrollLeft;
3063
- return rect2 ? rect2.left + leftScroll : getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
3064
- }
3065
- function getHTMLOffset(documentElement, scroll) {
3066
- let htmlRect = documentElement.getBoundingClientRect(), x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect), y = htmlRect.top + scroll.scrollTop;
3067
- return {
3068
- x,
3069
- y
3070
- };
3071
- }
3072
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
3073
- let {
3074
- elements,
3075
- rect: rect2,
3076
- offsetParent,
3077
- strategy
3078
- } = _ref, isFixed = strategy === "fixed", documentElement = getDocumentElement(offsetParent), topLayer = elements ? isTopLayer(elements.floating) : !1;
3079
- if (offsetParent === documentElement || topLayer && isFixed)
3080
- return rect2;
3081
- let scroll = {
3082
- scrollLeft: 0,
3083
- scrollTop: 0
3084
- }, scale = createCoords(1), offsets = createCoords(0), isOffsetParentAnElement = isHTMLElement(offsetParent);
3085
- if ((isOffsetParentAnElement || !isFixed) && ((getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) && (scroll = getNodeScroll(offsetParent)), isOffsetParentAnElement)) {
3086
- let offsetRect = getBoundingClientRect(offsetParent);
3087
- scale = getScale(offsetParent), offsets.x = offsetRect.x + offsetParent.clientLeft, offsets.y = offsetRect.y + offsetParent.clientTop;
3088
- }
3089
- let htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
3090
- return {
3091
- width: rect2.width * scale.x,
3092
- height: rect2.height * scale.y,
3093
- x: rect2.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
3094
- y: rect2.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
3095
- };
3096
- }
3097
- function getClientRects(element) {
3098
- return element.getClientRects ? Array.from(element.getClientRects()) : [];
3099
- }
3100
- function getDocumentRect(html) {
3101
- let scroll = getNodeScroll(html), body = html.ownerDocument.body, width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth), height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight), x = -scroll.scrollLeft + getWindowScrollBarX(html), y = -scroll.scrollTop;
3102
- return getComputedStyle2(body).direction === "rtl" && (x += max(html.clientWidth, body.clientWidth) - width), {
3103
- width,
3104
- height,
3105
- x,
3106
- y
3107
- };
3108
- }
3109
- var SCROLLBAR_MAX = 25;
3110
- function getViewportRect(element, strategy, rootBoundary) {
3111
- rootBoundary === void 0 && (rootBoundary = "viewport");
3112
- let isLayoutViewport = rootBoundary === "layoutViewport", win = getWindow(element), html = getDocumentElement(element), visualViewport = win.visualViewport, width = html.clientWidth, height = html.clientHeight, x = 0, y = 0;
3113
- if (visualViewport) {
3114
- let layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
3115
- isLayoutViewport ? layoutRelativeClientCoords || (x = -visualViewport.offsetLeft, y = -visualViewport.offsetTop) : (width = visualViewport.width, height = visualViewport.height, layoutRelativeClientCoords && (x = visualViewport.offsetLeft, y = visualViewport.offsetTop));
3116
- }
3117
- if (getWindowScrollBarX(html) <= 0) {
3118
- let doc = html.ownerDocument, body = doc.body, bodyStyles = getComputedStyle(body), bodyMarginInline = doc.compatMode === "CSS1Compat" && parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0, reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline), gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
3119
- gutter <= SCROLLBAR_MAX && (width -= gutter);
3120
- }
3121
- return {
3122
- width,
3123
- height,
3124
- x,
3125
- y
3126
- };
3127
- }
3128
- function getInnerBoundingClientRect(element, strategy) {
3129
- let clientRect = getBoundingClientRect(element, !0, strategy === "fixed"), top = clientRect.top + element.clientTop, left = clientRect.left + element.clientLeft, scale = getScale(element), width = element.clientWidth * scale.x, height = element.clientHeight * scale.y, x = left * scale.x, y = top * scale.y;
3130
- return {
3131
- width,
3132
- height,
3133
- x,
3134
- y
3135
- };
3136
- }
3137
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
3138
- let rect2;
3139
- if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport")
3140
- rect2 = getViewportRect(element, strategy, clippingAncestor);
3141
- else if (clippingAncestor === "document")
3142
- rect2 = getDocumentRect(getDocumentElement(element));
3143
- else if (isElement(clippingAncestor))
3144
- rect2 = getInnerBoundingClientRect(clippingAncestor, strategy);
3145
- else {
3146
- let visualOffsets = getVisualOffsets(element);
3147
- rect2 = {
3148
- x: clippingAncestor.x - visualOffsets.x,
3149
- y: clippingAncestor.y - visualOffsets.y,
3150
- width: clippingAncestor.width,
3151
- height: clippingAncestor.height
3152
- };
3153
- }
3154
- return rectToClientRect(rect2);
3155
- }
3156
- function getClippingElementAncestors(element, cache) {
3157
- let cachedResult = cache.get(element);
3158
- if (cachedResult)
3159
- return cachedResult;
3160
- let result = getOverflowAncestors(element, [], !1).filter((el) => isElement(el) && getNodeName(el) !== "body"), lastKeptComputedStyle = null, elementIsFixed = getComputedStyle2(element).position === "fixed", currentNode = elementIsFixed ? getParentNode(element) : element;
3161
- for (; isElement(currentNode) && !isLastTraversableNode(currentNode); ) {
3162
- let computedStyle = getComputedStyle2(currentNode), currentNodeIsContaining = isContainingBlock(currentNode), lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
3163
- !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static") ? result = result.filter((ancestor) => ancestor !== currentNode) : lastKeptComputedStyle = computedStyle, currentNode = getParentNode(currentNode);
3164
- }
3165
- return cache.set(element, result), result;
3166
- }
3167
- function getClippingRect(_ref) {
3168
- let {
3169
- element,
3170
- boundary,
3171
- rootBoundary,
3172
- strategy
3173
- } = _ref, clippingAncestors = [...boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary), rootBoundary], firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy), top = firstRect.top, right = firstRect.right, bottom = firstRect.bottom, left = firstRect.left;
3174
- for (let i = 1; i < clippingAncestors.length; i++) {
3175
- let rect2 = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
3176
- top = max(rect2.top, top), right = min(rect2.right, right), bottom = min(rect2.bottom, bottom), left = max(rect2.left, left);
3177
- }
3178
- return {
3179
- width: right - left,
3180
- height: bottom - top,
3181
- x: left,
3182
- y: top
3183
- };
3184
- }
3185
- function getDimensions(element) {
3186
- let {
3187
- width,
3188
- height
3189
- } = getCssDimensions(element);
3190
- return {
3191
- width,
3192
- height
3193
- };
3194
- }
3195
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
3196
- let isOffsetParentAnElement = isHTMLElement(offsetParent), documentElement = getDocumentElement(offsetParent), isFixed = strategy === "fixed", rect2 = getBoundingClientRect(element, !0, isFixed, offsetParent), scroll = {
3197
- scrollLeft: 0,
3198
- scrollTop: 0
3199
- }, offsets = createCoords(0);
3200
- if ((isOffsetParentAnElement || !isFixed) && ((getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) && (scroll = getNodeScroll(offsetParent)), isOffsetParentAnElement)) {
3201
- let offsetRect = getBoundingClientRect(offsetParent, !0, isFixed, offsetParent);
3202
- offsets.x = offsetRect.x + offsetParent.clientLeft, offsets.y = offsetRect.y + offsetParent.clientTop;
3203
- }
3204
- !isOffsetParentAnElement && documentElement && (offsets.x = getWindowScrollBarX(documentElement));
3205
- let htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0), x = rect2.left + scroll.scrollLeft - offsets.x - htmlOffset.x, y = rect2.top + scroll.scrollTop - offsets.y - htmlOffset.y;
3206
- return {
3207
- x,
3208
- y,
3209
- width: rect2.width,
3210
- height: rect2.height
3211
- };
3212
- }
3213
- function isStaticPositioned(element) {
3214
- return getComputedStyle2(element).position === "static";
3215
- }
3216
- function getTrueOffsetParent(element, polyfill) {
3217
- if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed")
3218
- return null;
3219
- if (polyfill)
3220
- return polyfill(element);
3221
- let rawOffsetParent = element.offsetParent;
3222
- return getDocumentElement(element) === rawOffsetParent && (rawOffsetParent = rawOffsetParent.ownerDocument.body), rawOffsetParent;
3223
- }
3224
- function getOffsetParent(element, polyfill) {
3225
- let win = getWindow(element);
3226
- if (isTopLayer(element))
3227
- return win;
3228
- if (!isHTMLElement(element)) {
3229
- let svgOffsetParent = getParentNode(element);
3230
- for (; svgOffsetParent && !isLastTraversableNode(svgOffsetParent); ) {
3231
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent))
3232
- return svgOffsetParent;
3233
- svgOffsetParent = getParentNode(svgOffsetParent);
3234
- }
3235
- return win;
3236
- }
3237
- let offsetParent = getTrueOffsetParent(element, polyfill);
3238
- for (; offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent); )
3239
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
3240
- return offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent) ? win : offsetParent || getContainingBlock(element) || win;
3241
- }
3242
- var getElementRects = async function(data) {
3243
- let getOffsetParentFn = this.getOffsetParent || getOffsetParent, getDimensionsFn = this.getDimensions, floatingDimensions = await getDimensionsFn(data.floating);
3244
- return {
3245
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
3246
- floating: {
3247
- x: 0,
3248
- y: 0,
3249
- width: floatingDimensions.width,
3250
- height: floatingDimensions.height
3251
- }
3252
- };
3253
- };
3254
- function isRTL(element) {
3255
- return getComputedStyle2(element).direction === "rtl";
3256
- }
3257
- var platform = {
3258
- convertOffsetParentRelativeRectToViewportRelativeRect,
3259
- getDocumentElement,
3260
- getClippingRect,
3261
- getOffsetParent,
3262
- getElementRects,
3263
- getClientRects,
3264
- getDimensions,
3265
- getScale,
3266
- isElement,
3267
- isRTL
3268
- };
3269
- function rectsAreEqual(a, b) {
3270
- return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
3271
- }
3272
- function observeMove(element, onMove, ancestorResize) {
3273
- let io = null, timeoutId, root = getDocumentElement(element);
3274
- function cleanup() {
3275
- var _io;
3276
- clearTimeout(timeoutId), (_io = io) == null || _io.disconnect(), io = null;
3277
- }
3278
- function refresh(skip, threshold) {
3279
- skip === void 0 && (skip = !1), threshold === void 0 && (threshold = 1), cleanup();
3280
- let elementRectForRootMargin = element.getBoundingClientRect(), {
3281
- left,
3282
- top,
3283
- width,
3284
- height
3285
- } = elementRectForRootMargin;
3286
- if (skip || onMove(), !width || !height)
3287
- return;
3288
- let insetTop = floor(top), insetRight = floor(root.clientWidth - (left + width)), insetBottom = floor(root.clientHeight - (top + height)), insetLeft = floor(left), options2 = {
3289
- rootMargin: -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px",
3290
- threshold: max(0, min(1, threshold)) || 1
3291
- }, isFirstUpdate = !0;
3292
- function handleObserve(entries) {
3293
- let ratio = entries[0].intersectionRatio;
3294
- if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect()))
3295
- return refresh();
3296
- if (ratio !== threshold) {
3297
- if (!isFirstUpdate)
3298
- return refresh();
3299
- ratio ? refresh(!1, ratio) : timeoutId = setTimeout(() => {
3300
- refresh(!1, 1e-7);
3301
- }, 1e3);
3302
- }
3303
- isFirstUpdate = !1;
3304
- }
3305
- try {
3306
- io = new IntersectionObserver(handleObserve, {
3307
- ...options2,
3308
- // Handle <iframe>s
3309
- root: root.ownerDocument
3310
- });
3311
- } catch {
3312
- io = new IntersectionObserver(handleObserve, options2);
3313
- }
3314
- io.observe(element);
3315
- }
3316
- let win = getWindow(element), handleResize = () => refresh(ancestorResize);
3317
- return win.addEventListener("resize", handleResize), refresh(!0), () => {
3318
- win.removeEventListener("resize", handleResize), cleanup();
3319
- };
3320
- }
3321
- function autoUpdate(reference, floating, update, options2) {
3322
- options2 === void 0 && (options2 = {});
3323
- let {
3324
- ancestorScroll = !0,
3325
- ancestorResize = !0,
3326
- elementResize = typeof ResizeObserver == "function",
3327
- layoutShift = typeof IntersectionObserver == "function",
3328
- animationFrame = !1
3329
- } = options2, referenceEl = unwrapElement(reference), ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
3330
- ancestors.forEach((ancestor) => {
3331
- ancestorScroll && ancestor.addEventListener("scroll", update), ancestorResize && ancestor.addEventListener("resize", update);
3332
- });
3333
- let cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null, reobserveFrame = -1, resizeObserver = null;
3334
- elementResize && (resizeObserver = new ResizeObserver((_ref) => {
3335
- let [firstEntry] = _ref;
3336
- firstEntry && firstEntry.target === referenceEl && resizeObserver && floating && (resizeObserver.unobserve(floating), cancelAnimationFrame(reobserveFrame), reobserveFrame = requestAnimationFrame(() => {
3337
- var _resizeObserver;
3338
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
3339
- })), update();
3340
- }), referenceEl && !animationFrame && resizeObserver.observe(referenceEl), floating && resizeObserver.observe(floating));
3341
- let frameId, prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
3342
- animationFrame && frameLoop();
3343
- function frameLoop() {
3344
- let nextRefRect = getBoundingClientRect(reference);
3345
- prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect) && update(), prevRefRect = nextRefRect, frameId = requestAnimationFrame(frameLoop);
3346
- }
3347
- return update(), () => {
3348
- var _resizeObserver2;
3349
- ancestors.forEach((ancestor) => {
3350
- ancestorScroll && ancestor.removeEventListener("scroll", update), ancestorResize && ancestor.removeEventListener("resize", update);
3351
- }), cleanupIo?.(), (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(), resizeObserver = null, animationFrame && cancelAnimationFrame(frameId);
3352
- };
3353
- }
3354
- var offset2 = offset;
3355
- var shift2 = shift, flip2 = flip, size2 = size, hide2 = hide, arrow2 = arrow;
3356
- var limitShift2 = limitShift, computePosition2 = (reference, floating, options2) => {
3357
- let cache = /* @__PURE__ */ new Map(), mergedOptions = options2 ?? {}, platformWithCache = {
3358
- ...platform,
3359
- ...mergedOptions.platform,
3360
- _c: cache
3361
- };
3362
- return computePosition(reference, floating, {
3363
- ...mergedOptions,
3364
- platform: platformWithCache
3365
- });
3366
- };
3367
-
3368
- // ../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
3369
- var React29 = __toESM(require_react(), 1), import_react2 = __toESM(require_react(), 1), ReactDOM3 = __toESM(require_react_dom(), 1), isClient = typeof document < "u", noop = function() {
3370
- }, index = isClient ? import_react2.useLayoutEffect : noop;
3371
- function deepEqual(a, b) {
3372
- if (a === b)
3373
- return !0;
3374
- if (typeof a != typeof b)
3375
- return !1;
3376
- if (typeof a == "function" && a.toString() === b.toString())
3377
- return !0;
3378
- let length, i, keys;
3379
- if (a && b && typeof a == "object") {
3380
- if (Array.isArray(a)) {
3381
- if (length = a.length, length !== b.length) return !1;
3382
- for (i = length; i-- !== 0; )
3383
- if (!deepEqual(a[i], b[i]))
3384
- return !1;
3385
- return !0;
3386
- }
3387
- if (keys = Object.keys(a), length = keys.length, length !== Object.keys(b).length)
3388
- return !1;
3389
- for (i = length; i-- !== 0; )
3390
- if (!{}.hasOwnProperty.call(b, keys[i]))
3391
- return !1;
3392
- for (i = length; i-- !== 0; ) {
3393
- let key = keys[i];
3394
- if (!(key === "_owner" && a.$$typeof) && !deepEqual(a[key], b[key]))
3395
- return !1;
3396
- }
3397
- return !0;
3398
- }
3399
- return a !== a && b !== b;
3400
- }
3401
- function getDPR(element) {
3402
- return typeof window > "u" ? 1 : (element.ownerDocument.defaultView || window).devicePixelRatio || 1;
3403
- }
3404
- function roundByDPR(element, value) {
3405
- let dpr = getDPR(element);
3406
- return Math.round(value * dpr) / dpr;
3407
- }
3408
- function useLatestRef(value) {
3409
- let ref = React29.useRef(value);
3410
- return index(() => {
3411
- ref.current = value;
3412
- }), ref;
3413
- }
3414
- function useFloating(options2) {
3415
- options2 === void 0 && (options2 = {});
3416
- let {
3417
- placement = "bottom",
3418
- strategy = "absolute",
3419
- middleware = [],
3420
- platform: platform2,
3421
- elements: {
3422
- reference: externalReference,
3423
- floating: externalFloating
3424
- } = {},
3425
- transform = !0,
3426
- whileElementsMounted,
3427
- open
3428
- } = options2, [data, setData] = React29.useState({
3429
- x: 0,
3430
- y: 0,
3431
- strategy,
3432
- placement,
3433
- middlewareData: {},
3434
- isPositioned: !1
3435
- }), [latestMiddleware, setLatestMiddleware] = React29.useState(middleware);
3436
- deepEqual(latestMiddleware, middleware) || setLatestMiddleware(middleware);
3437
- let [_reference, _setReference] = React29.useState(null), [_floating, _setFloating] = React29.useState(null), setReference = React29.useCallback((node) => {
3438
- node !== referenceRef.current && (referenceRef.current = node, _setReference(node));
3439
- }, []), setFloating = React29.useCallback((node) => {
3440
- node !== floatingRef.current && (floatingRef.current = node, _setFloating(node));
3441
- }, []), referenceEl = externalReference || _reference, floatingEl = externalFloating || _floating, referenceRef = React29.useRef(null), floatingRef = React29.useRef(null), dataRef = React29.useRef(data), hasWhileElementsMounted = whileElementsMounted != null, whileElementsMountedRef = useLatestRef(whileElementsMounted), platformRef = useLatestRef(platform2), openRef = useLatestRef(open), update = React29.useCallback(() => {
3442
- if (!referenceRef.current || !floatingRef.current)
3443
- return;
3444
- let config = {
3445
- placement,
3446
- strategy,
3447
- middleware: latestMiddleware
3448
- };
3449
- platformRef.current && (config.platform = platformRef.current), computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
3450
- let fullData = {
3451
- ...data2,
3452
- // The floating element's position may be recomputed while it's closed
3453
- // but still mounted (such as when transitioning out). To ensure
3454
- // `isPositioned` will be `false` initially on the next open, avoid
3455
- // setting it to `true` when `open === false` (must be specified).
3456
- isPositioned: openRef.current !== !1
3457
- };
3458
- isMountedRef.current && !deepEqual(dataRef.current, fullData) && (dataRef.current = fullData, ReactDOM3.flushSync(() => {
3459
- setData(fullData);
3460
- }));
3461
- });
3462
- }, [latestMiddleware, placement, strategy, platformRef, openRef]);
3463
- index(() => {
3464
- open === !1 && dataRef.current.isPositioned && (dataRef.current.isPositioned = !1, setData((data2) => ({
3465
- ...data2,
3466
- isPositioned: !1
3467
- })));
3468
- }, [open]);
3469
- let isMountedRef = React29.useRef(!1);
3470
- index(() => (isMountedRef.current = !0, () => {
3471
- isMountedRef.current = !1;
3472
- }), []), index(() => {
3473
- if (referenceEl && (referenceRef.current = referenceEl), floatingEl && (floatingRef.current = floatingEl), referenceEl && floatingEl) {
3474
- if (whileElementsMountedRef.current)
3475
- return whileElementsMountedRef.current(referenceEl, floatingEl, update);
3476
- update();
3477
- }
3478
- }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
3479
- let refs = React29.useMemo(() => ({
3480
- reference: referenceRef,
3481
- floating: floatingRef,
3482
- setReference,
3483
- setFloating
3484
- }), [setReference, setFloating]), elements = React29.useMemo(() => ({
3485
- reference: referenceEl,
3486
- floating: floatingEl
3487
- }), [referenceEl, floatingEl]), floatingStyles = React29.useMemo(() => {
3488
- let initialStyles = {
3489
- position: strategy,
3490
- left: 0,
3491
- top: 0
3492
- };
3493
- if (!elements.floating)
3494
- return initialStyles;
3495
- let x = roundByDPR(elements.floating, data.x), y = roundByDPR(elements.floating, data.y);
3496
- return transform ? {
3497
- ...initialStyles,
3498
- transform: "translate(" + x + "px, " + y + "px)",
3499
- ...getDPR(elements.floating) >= 1.5 && {
3500
- willChange: "transform"
3501
- }
3502
- } : {
3503
- position: strategy,
3504
- left: x,
3505
- top: y
3506
- };
3507
- }, [strategy, transform, elements.floating, data.x, data.y]);
3508
- return React29.useMemo(() => ({
3509
- ...data,
3510
- update,
3511
- refs,
3512
- elements,
3513
- floatingStyles
3514
- }), [data, update, refs, elements, floatingStyles]);
3515
- }
3516
- var arrow$1 = (options2) => {
3517
- function isRef(value) {
3518
- return {}.hasOwnProperty.call(value, "current");
3519
- }
3520
- return {
3521
- name: "arrow",
3522
- options: options2,
3523
- fn(state) {
3524
- let {
3525
- element,
3526
- padding
3527
- } = typeof options2 == "function" ? options2(state) : options2;
3528
- return element && isRef(element) ? element.current != null ? arrow2({
3529
- element: element.current,
3530
- padding
3531
- }).fn(state) : {} : element ? arrow2({
3532
- element,
3533
- padding
3534
- }).fn(state) : {};
3535
- }
3536
- };
3537
- }, offset3 = (options2, deps) => {
3538
- let result = offset2(options2);
3539
- return {
3540
- name: result.name,
3541
- fn: result.fn,
3542
- options: [options2, deps]
3543
- };
3544
- }, shift3 = (options2, deps) => {
3545
- let result = shift2(options2);
3546
- return {
3547
- name: result.name,
3548
- fn: result.fn,
3549
- options: [options2, deps]
3550
- };
3551
- }, limitShift3 = (options2, deps) => ({
3552
- fn: limitShift2(options2).fn,
3553
- options: [options2, deps]
3554
- }), flip3 = (options2, deps) => {
3555
- let result = flip2(options2);
3556
- return {
3557
- name: result.name,
3558
- fn: result.fn,
3559
- options: [options2, deps]
3560
- };
3561
- }, size3 = (options2, deps) => {
3562
- let result = size2(options2);
3563
- return {
3564
- name: result.name,
3565
- fn: result.fn,
3566
- options: [options2, deps]
3567
- };
3568
- };
3569
- var hide3 = (options2, deps) => {
3570
- let result = hide2(options2);
3571
- return {
3572
- name: result.name,
3573
- fn: result.fn,
3574
- options: [options2, deps]
3575
- };
3576
- };
3577
- var arrow3 = (options2, deps) => {
3578
- let result = arrow$1(options2);
3579
- return {
3580
- name: result.name,
3581
- fn: result.fn,
3582
- options: [options2, deps]
3583
- };
3584
- };
3585
-
3586
- // ../../node_modules/@radix-ui/react-arrow/dist/index.mjs
3587
- var React30 = __toESM(require_react(), 1);
3588
- var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1), __defProp20 = Object.defineProperty, __name19 = (target, value) => __defProp20(target, "name", { value, configurable: !0 }), Arrow = /* @__PURE__ */ React30.forwardRef(
3589
- /* @__PURE__ */ __name19(function(props, forwardedRef) {
3590
- let { children, width = 10, height = 5, ...arrowProps } = props;
3591
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3592
- Primitive.svg,
3593
- {
3594
- ...arrowProps,
3595
- ref: forwardedRef,
3596
- width,
3597
- height,
3598
- viewBox: "0 0 30 10",
3599
- preserveAspectRatio: "none",
3600
- children: props.asChild ? children : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("polygon", { points: "0,0 30,0 15,10" })
3601
- }
3602
- );
3603
- }, "Arrow")
3604
- );
3605
-
3606
- // ../../node_modules/@radix-ui/react-popper/dist/index.mjs
3607
- var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1), __defProp21 = Object.defineProperty, __name20 = (target, value) => __defProp21(target, "name", { value, configurable: !0 });
3608
- var Sticky = {
3609
- Partial: "partial",
3610
- Always: "always"
3611
- }, UpdatePositionStrategy = {
3612
- Optimized: "optimized",
3613
- Always: "always"
3614
- }, POPPER_NAME = "Popper", [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME), [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME), Popper = /* @__PURE__ */ __name20((props) => {
3615
- let { __scopePopper, children } = props, [anchor, setAnchor] = React31.useState(null), [placementState, setPlacementState] = React31.useState(void 0);
3616
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3617
- PopperProvider,
3618
- {
3619
- scope: __scopePopper,
3620
- anchor,
3621
- onAnchorChange: setAnchor,
3622
- placementState,
3623
- setPlacementState,
3624
- children
3625
- }
3626
- );
3627
- }, "Popper"), ANCHOR_NAME = "PopperAnchor", PopperAnchor = /* @__PURE__ */ React31.forwardRef(
3628
- /* @__PURE__ */ __name20(function(props, forwardedRef) {
3629
- let { __scopePopper, virtualRef, ...anchorProps } = props, context = usePopperContext(ANCHOR_NAME, __scopePopper), ref = React31.useRef(null), onAnchorChange = context.onAnchorChange, callbackRef = React31.useCallback(
3630
- (node) => {
3631
- ref.current = node, node && onAnchorChange(node);
3632
- },
3633
- [onAnchorChange]
3634
- ), composedRefs = useComposedRefs(forwardedRef, callbackRef), anchorRef = React31.useRef(null);
3635
- React31.useEffect(() => {
3636
- if (!virtualRef)
3637
- return;
3638
- let previousAnchor = anchorRef.current;
3639
- anchorRef.current = virtualRef.current, previousAnchor !== anchorRef.current && onAnchorChange(anchorRef.current);
3640
- });
3641
- let sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState), placedSide = sideAndAlign?.[0], placedAlign = sideAndAlign?.[1];
3642
- return virtualRef ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3643
- Primitive.div,
3644
- {
3645
- "data-radix-popper-side": placedSide,
3646
- "data-radix-popper-align": placedAlign,
3647
- ...anchorProps,
3648
- ref: composedRefs
3649
- }
3650
- );
3651
- }, "PopperAnchor")
3652
- ), CONTENT_NAME2 = "PopperContent", [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME2), PopperContent = /* @__PURE__ */ React31.forwardRef(
3653
- /* @__PURE__ */ __name20(function(props, forwardedRef) {
3654
- let {
3655
- __scopePopper,
3656
- side = "bottom",
3657
- sideOffset = 0,
3658
- align = "center",
3659
- alignOffset = 0,
3660
- arrowPadding = 0,
3661
- avoidCollisions = !0,
3662
- collisionBoundary = [],
3663
- collisionPadding: collisionPaddingProp = 0,
3664
- sticky = Sticky.Partial,
3665
- hideWhenDetached = !1,
3666
- updatePositionStrategy = UpdatePositionStrategy.Optimized,
3667
- onPlaced,
3668
- ...contentProps
3669
- } = props, context = usePopperContext(CONTENT_NAME2, __scopePopper), [content, setContent] = React31.useState(null), composedRefs = useComposedRefs(forwardedRef, setContent), [arrow4, setArrow] = React31.useState(null), arrowSize = useSize(arrow4), arrowWidth = arrowSize?.width ?? 0, arrowHeight = arrowSize?.height ?? 0, desiredPlacement = side + (align !== "center" ? "-" + align : ""), collisionPadding = typeof collisionPaddingProp == "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp }, boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary], hasExplicitBoundaries = boundary.length > 0, detectOverflowOptions = {
3670
- padding: collisionPadding,
3671
- boundary: boundary.filter(isNotNull),
3672
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
3673
- altBoundary: hasExplicitBoundaries
3674
- }, { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
3675
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
3676
- strategy: "fixed",
3677
- placement: desiredPlacement,
3678
- whileElementsMounted: /* @__PURE__ */ __name20((...args) => autoUpdate(...args, {
3679
- animationFrame: updatePositionStrategy === UpdatePositionStrategy.Always
3680
- }), "whileElementsMounted"),
3681
- elements: {
3682
- reference: context.anchor
3683
- },
3684
- middleware: [
3685
- offset3({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
3686
- avoidCollisions && shift3({
3687
- mainAxis: !0,
3688
- crossAxis: !1,
3689
- // Spread rather than passing `limiter: undefined`, which
3690
- // `exactOptionalPropertyTypes` rejects for Floating UI's optional option.
3691
- ...sticky === Sticky.Partial ? { limiter: limitShift3() } : {},
3692
- ...detectOverflowOptions
3693
- }),
3694
- avoidCollisions && flip3({ ...detectOverflowOptions }),
3695
- size3({
3696
- ...detectOverflowOptions,
3697
- apply: /* @__PURE__ */ __name20(({ elements, rects, availableWidth, availableHeight }) => {
3698
- let { width: anchorWidth, height: anchorHeight } = rects.reference, contentStyle = elements.floating.style;
3699
- contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`), contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`), contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`), contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
3700
- }, "apply")
3701
- }),
3702
- arrow4 && arrow3({ element: arrow4, padding: arrowPadding }),
3703
- transformOrigin({ arrowWidth, arrowHeight }),
3704
- hideWhenDetached && // `hide` detects whether the anchor (reference) is clipped, so when
3705
- // no explicit `collisionBoundary` is set we omit `boundary` entirely
3706
- // and fall back to Floating UI's default clipping ancestors (e.g. a
3707
- // scrollable menu). This lets an occluded submenu hide once its anchor
3708
- // scrolls out of view (#3237). The collision/size middlewares
3709
- // deliberately keep the viewport-based default to avoid clamping
3710
- // content rendered inside transformed or overflow-clipping portal
3711
- // containers. The key is omitted rather than set to `undefined`
3712
- // because `exactOptionalPropertyTypes` rejects the explicit value.
3713
- hide3(
3714
- hasExplicitBoundaries ? { strategy: "referenceHidden", ...detectOverflowOptions } : {
3715
- strategy: "referenceHidden",
3716
- padding: detectOverflowOptions.padding,
3717
- altBoundary: detectOverflowOptions.altBoundary
3718
- }
3719
- )
3720
- ]
3721
- }), setPlacementState = context.setPlacementState;
3722
- useLayoutEffect2(() => (setPlacementState(placement), () => {
3723
- setPlacementState(void 0);
3724
- }), [placement, setPlacementState]);
3725
- let [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement), handlePlaced = useCallbackRef(onPlaced);
3726
- useLayoutEffect2(() => {
3727
- isPositioned && handlePlaced?.();
3728
- }, [isPositioned, handlePlaced]);
3729
- let arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0, [contentZIndex, setContentZIndex] = React31.useState();
3730
- return useLayoutEffect2(() => {
3731
- content && setContentZIndex(window.getComputedStyle(content).zIndex);
3732
- }, [content]), /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3733
- "div",
3734
- {
3735
- ref: refs.setFloating,
3736
- "data-radix-popper-content-wrapper": "",
3737
- style: {
3738
- ...floatingStyles,
3739
- transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
3740
- // keep off the page when measuring
3741
- minWidth: "max-content",
3742
- zIndex: contentZIndex,
3743
- "--radix-popper-transform-origin": [
3744
- middlewareData.transformOrigin?.x,
3745
- middlewareData.transformOrigin?.y
3746
- ].join(" "),
3747
- // hide the content if using the hide middleware and should be hidden
3748
- // set visibility to hidden and disable pointer events so the UI behaves
3749
- // as if the PopperContent isn't there at all
3750
- ...middlewareData.hide?.referenceHidden && {
3751
- visibility: "hidden",
3752
- pointerEvents: "none"
3753
- }
3754
- },
3755
- dir: props.dir,
3756
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3757
- PopperContentProvider,
3758
- {
3759
- scope: __scopePopper,
3760
- placedSide,
3761
- placedAlign,
3762
- onArrowChange: setArrow,
3763
- arrowX,
3764
- arrowY,
3765
- shouldHideArrow: cannotCenterArrow,
3766
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3767
- Primitive.div,
3768
- {
3769
- "data-side": placedSide,
3770
- "data-align": placedAlign,
3771
- ...contentProps,
3772
- ref: composedRefs,
3773
- style: {
3774
- ...contentProps.style,
3775
- // if the PopperContent hasn't been placed yet (not all
3776
- // measurements done) we prevent animations so that users'
3777
- // animations don't kick in too early from the wrong sides.
3778
- animation: isPositioned ? contentProps.style?.animation : "none"
3779
- }
3780
- }
3781
- )
3782
- }
3783
- )
3784
- }
3785
- );
3786
- }, "PopperContent")
3787
- ), ARROW_NAME = "PopperArrow", OPPOSITE_SIDE = {
3788
- top: "bottom",
3789
- right: "left",
3790
- bottom: "top",
3791
- left: "right"
3792
- }, PopperArrow = /* @__PURE__ */ React31.forwardRef(
3793
- /* @__PURE__ */ __name20(function(props, forwardedRef) {
3794
- let { __scopePopper, ...arrowProps } = props, contentContext = useContentContext(ARROW_NAME, __scopePopper), baseSide = OPPOSITE_SIDE[contentContext.placedSide];
3795
- return (
3796
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
3797
- // doesn't report size as we'd expect on SVG elements.
3798
- // it reports their bounding box which is effectively the largest path inside the SVG.
3799
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3800
- "span",
3801
- {
3802
- ref: contentContext.onArrowChange,
3803
- style: {
3804
- position: "absolute",
3805
- left: contentContext.arrowX,
3806
- top: contentContext.arrowY,
3807
- [baseSide]: 0,
3808
- transformOrigin: {
3809
- top: "",
3810
- right: "0 0",
3811
- bottom: "center 0",
3812
- left: "100% 0"
3813
- }[contentContext.placedSide],
3814
- transform: {
3815
- top: "translateY(100%)",
3816
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
3817
- bottom: "rotate(180deg)",
3818
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
3819
- }[contentContext.placedSide],
3820
- visibility: contentContext.shouldHideArrow ? "hidden" : void 0
3821
- },
3822
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3823
- Arrow,
3824
- {
3825
- ...arrowProps,
3826
- ref: forwardedRef,
3827
- style: {
3828
- ...arrowProps.style,
3829
- // ensures the element can be measured correctly (mostly for if SVG)
3830
- display: "block"
3831
- }
3832
- }
3833
- )
3834
- }
3835
- )
3836
- );
3837
- }, "PopperArrow")
3838
- );
3839
- function isNotNull(value) {
3840
- return value !== null;
3841
- }
3842
- __name20(isNotNull, "isNotNull");
3843
- var transformOrigin = /* @__PURE__ */ __name20((options2) => ({
3844
- name: "transformOrigin",
3845
- options: options2,
3846
- fn(data) {
3847
- let { placement, rects, middlewareData } = data, isArrowHidden = middlewareData.arrow?.centerOffset !== 0, arrowWidth = isArrowHidden ? 0 : options2.arrowWidth, arrowHeight = isArrowHidden ? 0 : options2.arrowHeight, [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement), noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign], arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2, arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2, x = "", y = "";
3848
- return placedSide === "bottom" ? (x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`, y = `${-arrowHeight}px`) : placedSide === "top" ? (x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`, y = `${rects.floating.height + arrowHeight}px`) : placedSide === "right" ? (x = `${-arrowHeight}px`, y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`) : placedSide === "left" && (x = `${rects.floating.width + arrowHeight}px`, y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`), { data: { x, y } };
3849
- }
3850
- }), "transformOrigin");
3851
- function getSideAndAlignFromPlacement(placement) {
3852
- let [side, align = "center"] = placement.split("-");
3853
- return [side, align];
3854
- }
3855
- __name20(getSideAndAlignFromPlacement, "getSideAndAlignFromPlacement");
3856
-
3857
- // ../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs
3858
- var React33 = __toESM(require_react(), 1);
3859
-
3860
- // ../../node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
3861
- var React210 = __toESM(require_react(), 1), React32 = __toESM(require_react(), 1), __defProp22 = Object.defineProperty, __name21 = (target, value) => __defProp22(target, "name", { value, configurable: !0 }), _isHydrated = !1;
3862
- function useIsHydrated() {
3863
- let [isHydrated, setIsHydrated] = React32.useState(_isHydrated);
3864
- return React32.useEffect(() => {
3865
- _isHydrated || (_isHydrated = !0, setIsHydrated(!0));
3866
- }, []), isHydrated;
3867
- }
3868
- __name21(useIsHydrated, "useIsHydrated");
3869
- var useReactSyncExternalStore = React210[" useSyncExternalStore ".trim().toString()];
3870
- function subscribe() {
3871
- return () => {
3872
- };
3873
- }
3874
- __name21(subscribe, "subscribe");
3875
- function useIsHydratedModern() {
3876
- return useReactSyncExternalStore(
3877
- subscribe,
3878
- () => !0,
3879
- () => !1
3880
- );
3881
- }
3882
- __name21(useIsHydratedModern, "useIsHydratedModern");
3883
- var useIsHydrated2 = typeof useReactSyncExternalStore == "function" ? useIsHydratedModern : useIsHydrated;