@mkbabb/glass-ui 3.10.1 → 3.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/{CardAction-DrAcAV4d.js → CardAction-DuArVky-.js} +2 -2
  2. package/dist/{CommandShortcut-mV2e1aG6.js → CommandShortcut-CefCj5mt.js} +2 -2
  3. package/dist/{DataTable-C3E6jZ5B.js → DataTable-CUHMukiQ.js} +2 -2
  4. package/dist/DeckProgress-Dmk4_AKN.js +23 -0
  5. package/dist/{DialogContent-BxaaafFi.js → DialogContent-BRkT1cjP.js} +1 -1
  6. package/dist/{HoverPopover-CDA_SaCe.js → HoverPopover-2LOIW34a.js} +1 -1
  7. package/dist/InstrumentRail-CUJ05YVG.js +44 -0
  8. package/dist/{MetricBadge-idgrkqoP.js → MetricBadge-BZVWIxNy.js} +7 -5
  9. package/dist/{Notification-Cu0nN17_.js → Notification-DLMhblXR.js} +1 -1
  10. package/dist/{NumberFieldContent-CHEWghnY.js → NumberFieldContent-BbLOh8RU.js} +2 -2
  11. package/dist/{PopoverContent-DpUvdYY-.js → PopoverContent-BId6ggf_.js} +1 -1
  12. package/dist/{Progress-BW-StFw2.js → Progress-iEuD9pxG.js} +1 -1
  13. package/dist/{ScrollingText-DruYCni_.js → ScrollingText-BPP84wKo.js} +1 -1
  14. package/dist/{SelectScrollDownButton-pirzjm--.js → SelectScrollDownButton-T32cVFeM.js} +3 -3
  15. package/dist/{Switch-DeAqg6pi.js → Switch-Ch-k3Rv-.js} +1 -1
  16. package/dist/{TabsList-BAVzOZpg.js → TabsList-B8CVOQPC.js} +2 -2
  17. package/dist/{Toaster-CvuuW_y9.js → Toaster-1rYWrmAm.js} +46 -49
  18. package/dist/{ToggleGroupItem-DtD37b4G.js → ToggleGroupItem-COu_4IW4.js} +21 -17
  19. package/dist/animated-digit.js +2 -2
  20. package/dist/api/index.d.ts +5 -4
  21. package/dist/api.js +2 -2
  22. package/dist/aurora.js +70 -70
  23. package/dist/{badge-NdCQMvvB.js → badge-CaoFJzRb.js} +1 -1
  24. package/dist/badge.js +1 -1
  25. package/dist/{button-DyiWFAOE.js → button-DN39cGqL.js} +12 -12
  26. package/dist/button.js +1 -1
  27. package/dist/canvas.js +2 -2
  28. package/dist/card.js +1 -1
  29. package/dist/carousel.js +5 -5
  30. package/dist/collapsible.js +1 -1
  31. package/dist/{color-B65wWyQz.js → color-C5ls_QF7.js} +7 -9
  32. package/dist/color.js +1 -1
  33. package/dist/command.js +1 -1
  34. package/dist/components/custom/aurora/constants/presets.d.ts +62 -5
  35. package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +1 -1
  36. package/dist/components/custom/aurora/index.d.ts +1 -1
  37. package/dist/components/custom/constellation/Constellation.vue.d.ts +0 -12
  38. package/dist/components/custom/constellation/constellationField.d.ts +151 -10
  39. package/dist/components/custom/constellation/index.d.ts +1 -3
  40. package/dist/components/custom/controls/DarkModeToggle.vue.d.ts +0 -11
  41. package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +27 -0
  42. package/dist/components/custom/deck-progress/index.d.ts +2 -0
  43. package/dist/components/custom/dialog-native/GlassDialogNative.vue.d.ts +57 -0
  44. package/dist/components/custom/dialog-native/index.d.ts +1 -0
  45. package/dist/components/custom/dock/DockTabButton.vue.d.ts +4 -3
  46. package/dist/components/custom/dock/GlassDock.vue.d.ts +115 -3
  47. package/dist/components/custom/dock/composables/dockMorphContext.d.ts +0 -36
  48. package/dist/components/custom/dock/composables/useLayerTransition.d.ts +0 -44
  49. package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +37 -5
  50. package/dist/components/custom/fourier-field/index.d.ts +1 -1
  51. package/dist/components/custom/fourier-field/math.d.ts +0 -17
  52. package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +41 -0
  53. package/dist/components/custom/glass-panel/index.d.ts +2 -0
  54. package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +3 -4
  55. package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +8 -11
  56. package/dist/components/custom/handmark/HandMark.vue.d.ts +29 -0
  57. package/dist/components/custom/handmark/brush.d.ts +242 -0
  58. package/dist/components/custom/handmark/freehand.d.ts +69 -0
  59. package/dist/components/custom/handmark/geometry.d.ts +50 -0
  60. package/dist/components/custom/handmark/index.d.ts +21 -0
  61. package/dist/components/custom/handmark/ink.d.ts +11 -0
  62. package/dist/components/custom/handmark/texture.d.ts +39 -0
  63. package/dist/components/custom/handmark/types.d.ts +53 -0
  64. package/dist/components/custom/handmark/useHandMark.d.ts +87 -0
  65. package/dist/components/custom/header-ribbon/HeaderRibbon.vue.d.ts +31 -0
  66. package/dist/components/custom/header-ribbon/index.d.ts +2 -0
  67. package/dist/components/custom/header-ribbon/types.d.ts +7 -0
  68. package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +2 -2
  69. package/dist/components/custom/instrument-rail/InstrumentRail.vue.d.ts +91 -0
  70. package/dist/components/custom/instrument-rail/index.d.ts +2 -0
  71. package/dist/components/custom/metric-badge/MetricBadge.vue.d.ts +8 -0
  72. package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -1
  73. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -2
  74. package/dist/components/ui/slider/index.d.ts +19 -22
  75. package/dist/components/ui/toast/use-toast.d.ts +2 -2
  76. package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
  77. package/dist/components/ui/toggle/index.d.ts +1 -1
  78. package/dist/components/ui/toggle-group/ToggleGroup.vue.d.ts +7 -1
  79. package/dist/components/ui/toggle-group/ToggleGroupItem.vue.d.ts +3 -1
  80. package/dist/components/ui/toggle-group/toggleGroupContext.d.ts +13 -0
  81. package/dist/composables/color/index.d.ts +0 -12
  82. package/dist/composables/dark/index.d.ts +1 -1
  83. package/dist/composables/dark/useGlobalDark.d.ts +21 -1
  84. package/dist/composables/glass/useSpecularTracking.d.ts +3 -12
  85. package/dist/composables/motion/core/index.d.ts +1 -0
  86. package/dist/composables/motion/index.d.ts +0 -2
  87. package/dist/composables/motion/useRouteTransition.d.ts +42 -0
  88. package/dist/composables/motion/useSpringMount.d.ts +1 -1
  89. package/dist/configurator.js +1 -1
  90. package/dist/confirm-dialog.js +2 -2
  91. package/dist/constellation.js +225 -260
  92. package/dist/controls.js +14 -48
  93. package/dist/dark.d.ts +1 -1
  94. package/dist/dark.js +1 -1
  95. package/dist/data-table.js +1 -1
  96. package/dist/deck-progress.d.ts +1 -0
  97. package/dist/deck-progress.js +2 -0
  98. package/dist/dialog.js +2 -2
  99. package/dist/dock.js +345 -340
  100. package/dist/dockContext-BKeIMmNk.js +9 -0
  101. package/dist/{dropdown-menu-DVnQcA0E.js → dropdown-menu-D77jX6Df.js} +4 -7
  102. package/dist/dropdown-menu.js +1 -1
  103. package/dist/expandable-container.js +79 -38
  104. package/dist/forms.js +2 -2
  105. package/dist/fourier-field.js +102 -137
  106. package/dist/fourier-math.js +2 -2
  107. package/dist/glass-panel.d.ts +1 -0
  108. package/dist/glass-panel.js +44 -0
  109. package/dist/glass-ui.css +1 -1
  110. package/dist/glass-ui.js +209 -287
  111. package/dist/goo-blob.js +212 -243
  112. package/dist/handmark.d.ts +1 -0
  113. package/dist/handmark.js +663 -0
  114. package/dist/header-ribbon.d.ts +1 -0
  115. package/dist/header-ribbon.js +63 -0
  116. package/dist/hover-popover.js +1 -1
  117. package/dist/icon-tooltip.js +1 -1
  118. package/dist/index.d.ts +3 -0
  119. package/dist/instrument-rail.d.ts +1 -0
  120. package/dist/instrument-rail.js +2 -0
  121. package/dist/keyboard.js +1 -1
  122. package/dist/labeled-field.js +5 -5
  123. package/dist/{math-BUU9hHID.js → math-DTpRVC0e.js} +2 -18
  124. package/dist/metric-badge.js +1 -1
  125. package/dist/metric-stack.js +1 -1
  126. package/dist/motion-core.js +70 -69
  127. package/dist/motion.js +37 -38
  128. package/dist/notification.js +1 -1
  129. package/dist/number-field.js +1 -1
  130. package/dist/popover.js +1 -1
  131. package/dist/{presets-1OhFpaIC.js → presets-BP_ALM0m.js} +14 -1
  132. package/dist/progress.js +1 -1
  133. package/dist/pulse.js +1 -1
  134. package/dist/reactive.js +1 -1
  135. package/dist/scrolling-text.js +1 -1
  136. package/dist/search.js +6 -6
  137. package/dist/select.js +1 -1
  138. package/dist/{sheet-ChSXcJpU.js → sheet-VZEtNFvO.js} +1 -1
  139. package/dist/sheet.js +1 -1
  140. package/dist/{slider-sfl8gFDD.js → slider-ClgpP7EB.js} +4 -4
  141. package/dist/slider.js +1 -1
  142. package/dist/sortable-list.js +2 -2
  143. package/dist/stacked-icons.js +6 -6
  144. package/dist/styles/animations.css +111 -15
  145. package/dist/styles/components.css +1 -1
  146. package/dist/styles/dock/layer-group.css +0 -22
  147. package/dist/styles/dock/layers.css +1 -11
  148. package/dist/styles/dock/morph.css +19 -95
  149. package/dist/styles/dock/shell.css +0 -12
  150. package/dist/styles/dock-controls.css +31 -28
  151. package/dist/styles/drawer.css +0 -2
  152. package/dist/styles/floating-panel.css +0 -2
  153. package/dist/styles/glass-refract.css +0 -2
  154. package/dist/styles/glass.css +1188 -31
  155. package/dist/styles/hover-popover.css +0 -2
  156. package/dist/styles/index.css +6 -24
  157. package/dist/styles/instrument-chassis.css +0 -4
  158. package/dist/styles/paper.css +68 -2
  159. package/dist/styles/theme.css +20 -13
  160. package/dist/styles/tokens.css +2360 -22
  161. package/dist/styles/typography.css +6 -18
  162. package/dist/styles/utilities.css +1291 -19
  163. package/dist/styles/view-transition.css +51 -0
  164. package/dist/switch.js +1 -1
  165. package/dist/tabs.js +98 -98
  166. package/dist/timeline.js +2 -2
  167. package/dist/toast.js +1 -1
  168. package/dist/toggle-group.js +1 -1
  169. package/dist/typewriter.js +1 -1
  170. package/dist/{useAnimatedNumber-DfVgP4te.js → useAnimatedNumber-Bcpy5Etf.js} +1 -1
  171. package/dist/{useConfiguratorState-BdQXh9ie.js → useConfiguratorState-DxAqksK6.js} +1 -1
  172. package/dist/useGlassRenderer-D7YGOYiM.js +69 -0
  173. package/dist/{useGlobalDark-D7R9OypB.js → useGlobalDark-D1wgEqfW.js} +21 -2
  174. package/dist/useSpecularTracking-BVRZsRHA.js +26 -0
  175. package/dist/useSpringMount-BJSHcLl3.js +113 -0
  176. package/dist/useViewTransition-DaN5Zrox.js +21 -0
  177. package/dist/vReveal-zUIQk-rJ.js +53 -0
  178. package/dist/watercolor-dot.js +2 -2
  179. package/package.json +57 -33
  180. package/src/styles/animations.css +111 -15
  181. package/src/styles/dock/layer-group.css +0 -22
  182. package/src/styles/dock/layers.css +1 -11
  183. package/src/styles/dock/morph.css +19 -95
  184. package/src/styles/dock/shell.css +0 -12
  185. package/src/styles/dock-controls.css +31 -28
  186. package/src/styles/glass.css +1188 -31
  187. package/src/styles/index.css +6 -24
  188. package/src/styles/paper.css +68 -2
  189. package/src/styles/theme.css +20 -13
  190. package/src/styles/tokens.css +2360 -22
  191. package/src/styles/typography.css +6 -18
  192. package/src/styles/utilities.css +1291 -19
  193. package/src/styles/view-transition.css +51 -0
  194. package/dist/components/custom/aurora/constants/shaders/vangogh-medium.glsl.d.ts +0 -1
  195. package/dist/components/custom/constellation/composables/createConstellationField.d.ts +0 -35
  196. package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
  197. package/dist/components/custom/constellation/constants.d.ts +0 -36
  198. package/dist/components/custom/constellation/constellationDraw.d.ts +0 -18
  199. package/dist/components/custom/constellation/constellationInteraction.d.ts +0 -102
  200. package/dist/components/custom/dock/composables/useDockMorphWindow.d.ts +0 -15
  201. package/dist/components/custom/dock/composables/useDockShellProps.d.ts +0 -131
  202. package/dist/components/custom/dock/constants.d.ts +0 -23
  203. package/dist/components/custom/fourier-field/presets.d.ts +0 -54
  204. package/dist/components/custom/goo-blob/composables/buildMetaballProgram.d.ts +0 -18
  205. package/dist/components/custom/goo-blob/composables/uploadBlobUniforms.d.ts +0 -41
  206. package/dist/components/custom/goo-blob/constants.d.ts +0 -52
  207. package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +0 -1
  208. package/dist/components/custom/tabs/constants.d.ts +0 -12
  209. package/dist/components/custom/underline/GlassUnderline.vue.d.ts +0 -84
  210. package/dist/components/custom/underline/index.d.ts +0 -2
  211. package/dist/components/custom/underline/types.d.ts +0 -56
  212. package/dist/composables/motion/curves.d.ts +0 -48
  213. package/dist/composables/motion/springPresets.d.ts +0 -33
  214. package/dist/composables/motion/suite.d.ts +0 -2
  215. package/dist/dockContext-bho8B1A4.js +0 -17
  216. package/dist/motion-curves.d.ts +0 -1
  217. package/dist/motion-curves.js +0 -130
  218. package/dist/springPresets-aRSm-4_k.js +0 -40
  219. package/dist/styles/glass/a11y-fallback.css +0 -245
  220. package/dist/styles/glass/ladder.css +0 -304
  221. package/dist/styles/glass/material.css +0 -238
  222. package/dist/styles/glass/progress-rail.css +0 -78
  223. package/dist/styles/glass/squircle.css +0 -66
  224. package/dist/styles/glass/surfaces.css +0 -306
  225. package/dist/styles/tokens/color-radius.css +0 -250
  226. package/dist/styles/tokens/dark-arm.css +0 -194
  227. package/dist/styles/tokens/glass.css +0 -413
  228. package/dist/styles/tokens/light-dark.css +0 -158
  229. package/dist/styles/tokens/offsets-sizing.css +0 -406
  230. package/dist/styles/tokens/property-regs.css +0 -169
  231. package/dist/styles/tokens/scale-paper.css +0 -361
  232. package/dist/styles/tokens/scheme-motion.css +0 -334
  233. package/dist/styles/tokens/shadow.css +0 -132
  234. package/dist/styles/utilities/a11y-overrides.css +0 -140
  235. package/dist/styles/utilities/animate.css +0 -26
  236. package/dist/styles/utilities/base.css +0 -365
  237. package/dist/styles/utilities/btn.css +0 -399
  238. package/dist/styles/utilities/components.css +0 -317
  239. package/dist/underline.d.ts +0 -1
  240. package/dist/underline.js +0 -85
  241. package/dist/useSpecularTracking-DFK_fhpG.js +0 -32
  242. package/dist/useSpringMount-DXUzxBjV.js +0 -108
  243. package/dist/vReveal-CqaCz_mC.js +0 -44
  244. package/src/styles/glass/a11y-fallback.css +0 -245
  245. package/src/styles/glass/ladder.css +0 -304
  246. package/src/styles/glass/material.css +0 -238
  247. package/src/styles/glass/progress-rail.css +0 -78
  248. package/src/styles/glass/squircle.css +0 -66
  249. package/src/styles/glass/surfaces.css +0 -306
  250. package/src/styles/tokens/color-radius.css +0 -250
  251. package/src/styles/tokens/dark-arm.css +0 -194
  252. package/src/styles/tokens/glass.css +0 -413
  253. package/src/styles/tokens/light-dark.css +0 -158
  254. package/src/styles/tokens/offsets-sizing.css +0 -406
  255. package/src/styles/tokens/property-regs.css +0 -169
  256. package/src/styles/tokens/scale-paper.css +0 -361
  257. package/src/styles/tokens/scheme-motion.css +0 -334
  258. package/src/styles/tokens/shadow.css +0 -132
  259. package/src/styles/utilities/a11y-overrides.css +0 -140
  260. package/src/styles/utilities/animate.css +0 -26
  261. package/src/styles/utilities/base.css +0 -365
  262. package/src/styles/utilities/btn.css +0 -399
  263. package/src/styles/utilities/components.css +0 -317
  264. /package/dist/{CollapsibleContent-Drow5WkV.js → CollapsibleContent-CP9qF1v4.js} +0 -0
  265. /package/dist/{DialogFooter-DufLHi0y.js → DialogFooter-Gprw8H_A.js} +0 -0
  266. /package/dist/{IconTooltip-BrQ5p181.js → IconTooltip-Cus0fvK0.js} +0 -0
  267. /package/dist/{Input-B-F818RU.js → Input-xuDwALQR.js} +0 -0
  268. /package/dist/{_plugin-vue_export-helper-DWghtRt7.js → _plugin-vue_export-helper-ok8pgSl5.js} +0 -0
  269. /package/dist/{compile-Ce_V55zi.js → compile-BOXjLUxu.js} +0 -0
  270. /package/dist/{constants-C8NMonuo.js → constants-yKeKnE84.js} +0 -0
  271. /package/dist/{prng-CjVgzjQT.js → prng-D27-B3tK.js} +0 -0
  272. /package/dist/{resolveCanvasColor-CRvVzOvP.js → resolveCanvasColor-BBiYfp8g.js} +0 -0
  273. /package/dist/{useCanvas2D-CSeH8h16.js → useCanvas2D-ClrQuZtp.js} +0 -0
  274. /package/dist/{useIntersectionPause-DAdVPVp4.js → useIntersectionPause-Cck5Uxk8.js} +0 -0
  275. /package/dist/{useInterval-D3USn0yc.js → useInterval-Dsmqwi03.js} +0 -0
  276. /package/dist/{useKeyboardShortcuts-i8tHd5WO.js → useKeyboardShortcuts-CyIYrndH.js} +0 -0
  277. /package/dist/{useScrollProgress-CcgmgMQt.js → useScrollProgress-CffFGLa5.js} +0 -0
  278. /package/dist/{useSortable-DnyGXKKY.js → useSortable-C8ReQ50P.js} +0 -0
  279. /package/dist/{useTextHighlight-B3b10W6r.js → useTextHighlight-CWEi25hf.js} +0 -0
@@ -1,33 +1,41 @@
1
1
  import { t as e } from "./cn-DJXf4yaB.js";
2
- import { t } from "./useCanvas2D-CSeH8h16.js";
3
- import { t as n } from "./_plugin-vue_export-helper-DWghtRt7.js";
4
- import { n as r, t as i } from "./prng-CjVgzjQT.js";
2
+ import { t } from "./useCanvas2D-ClrQuZtp.js";
3
+ import { t as n } from "./_plugin-vue_export-helper-ok8pgSl5.js";
4
+ import { n as r, t as i } from "./prng-D27-B3tK.js";
5
5
  import { computed as a, createElementBlock as o, createElementVNode as s, defineComponent as c, getCurrentInstance as l, normalizeClass as u, onMounted as d, openBlock as f, ref as p, unref as m, useTemplateRef as h } from "vue";
6
- //#region src/components/custom/constellation/constants.ts
7
- var g = 1280, _ = {
6
+ //#region src/components/custom/constellation/constellationField.ts
7
+ var g = 1280, _ = 8e3, v = 8e3, y = {
8
8
  node: "#b4afa3",
9
9
  nodeDim: "#cdc8bd",
10
10
  line: "#1c1714",
11
11
  edgeAlpha: .22,
12
12
  edgeFocusAlpha: .34,
13
- alpha: .8
14
- }, v = .55, y = 1, b = {
15
- gain: 14e3,
16
- reach: 340,
17
- ramp: 4,
18
- maxSpeed: 4,
19
- soften: 8,
20
- holdMs: 140
21
- }, x = 8e3, S = 8e3;
22
- //#endregion
23
- //#region src/components/custom/constellation/constellationInteraction.ts
24
- function C(e) {
13
+ alpha: .84
14
+ };
15
+ function b(e) {
16
+ if (typeof window > "u") return { ...y };
17
+ let t = getComputedStyle(e), n = (e, n) => t.getPropertyValue(e).trim() || n, r = (e, n) => {
18
+ let r = t.getPropertyValue(e).trim();
19
+ if (!r) return n;
20
+ let i = Number.parseFloat(r);
21
+ return Number.isFinite(i) ? i : n;
22
+ };
23
+ return {
24
+ node: n("--constellation-node", y.node),
25
+ nodeDim: n("--constellation-node-dim", y.nodeDim),
26
+ line: n("--constellation-line", y.line),
27
+ edgeAlpha: r("--constellation-edge-alpha", y.edgeAlpha),
28
+ edgeFocusAlpha: r("--constellation-edge-focus-alpha", y.edgeFocusAlpha),
29
+ alpha: r("--constellation-alpha", y.alpha)
30
+ };
31
+ }
32
+ function x(e) {
25
33
  let t = {
26
- response: v,
34
+ response: A,
27
35
  zeta: 1
28
- }, n = { ...b }, r = {
29
- minIdle: x,
30
- jitter: S
36
+ }, n = { ...N }, r = {
37
+ minIdle: _,
38
+ jitter: v
31
39
  };
32
40
  if (typeof window > "u") return {
33
41
  warp: t,
@@ -40,19 +48,61 @@ function C(e) {
40
48
  let r = Number.parseFloat(n);
41
49
  return Number.isFinite(r) ? r : t;
42
50
  };
43
- return t.response = a("--constellation-warp-response", v), t.zeta = a("--constellation-warp-zeta", 1), n.gain = a("--constellation-well-gain", b.gain), n.reach = a("--constellation-well-reach", b.reach), n.ramp = a("--constellation-well-ramp", b.ramp), n.maxSpeed = a("--constellation-well-max-speed", b.maxSpeed), n.holdMs = a("--constellation-well-hold-ms", b.holdMs), r.minIdle = a("--constellation-wander-idle", x), r.jitter = a("--constellation-wander-jitter", S), {
51
+ return t.response = a("--constellation-warp-response", A), t.zeta = a("--constellation-warp-zeta", 1), n.gain = a("--constellation-well-gain", N.gain), n.reach = a("--constellation-well-reach", N.reach), n.ramp = a("--constellation-well-ramp", N.ramp), n.maxSpeed = a("--constellation-well-max-speed", N.maxSpeed), n.holdMs = a("--constellation-well-hold-ms", N.holdMs), r.minIdle = a("--constellation-wander-idle", _), r.jitter = a("--constellation-wander-jitter", v), {
44
52
  warp: t,
45
53
  well: n,
46
54
  wander: r
47
55
  };
48
56
  }
49
- var w = .001, T = 1.5, E = 7, D = 22;
50
- function O(e, t, n, r) {
57
+ function S(e, t, n, r, i) {
58
+ let a = [];
59
+ for (let o = 0; o < t; o++) {
60
+ let t = e() * Math.PI * 2;
61
+ a.push({
62
+ x: e() * n,
63
+ y: e() * r,
64
+ vx: Math.cos(t) * i,
65
+ vy: Math.sin(t) * i,
66
+ r: 1.6 + e() * 1.6,
67
+ dim: e() < .45
68
+ });
69
+ }
70
+ return a;
71
+ }
72
+ function C(e, t, n) {
73
+ if (!(t > 0) || !(n > 0) || t === e.w && n === e.h) return;
74
+ let r = e.w / t, i = e.h / n;
75
+ for (let t of e.nodes) t.x *= r, t.y *= i;
76
+ e.warp.x *= r, e.warp.y *= i;
77
+ }
78
+ function w(e, t, n, r, i = 0, a = 0, o = Math.random) {
79
+ let { nodes: s, w: c, h: l } = e;
80
+ for (let e = 0; e < s.length; e++) {
81
+ let n = s[e];
82
+ n.x += n.vx * t, n.y += n.vy * t, n.x < 0 ? (n.x = 0, n.vx *= -1) : n.x > c && (n.x = c, n.vx *= -1), n.y < 0 ? (n.y = 0, n.vy *= -1) : n.y > l && (n.y = l, n.vy *= -1);
83
+ }
84
+ if (r && r.x >= 0) {
85
+ let e = 180 * t;
86
+ for (let t = 0; t < s.length; t++) {
87
+ let i = s[t], a = r.x - i.x, o = r.y - i.y, c = Math.hypot(a, o);
88
+ if (c > .5 && c < e) {
89
+ let t = Math.hypot(i.vx, i.vy) || n, r = (1 - c / e) * .08, s = i.vx + a / c * r * t, l = i.vy + o / c * r * t, u = Math.hypot(s, l) || 1;
90
+ i.vx = s / u * t, i.vy = l / u * t;
91
+ }
92
+ }
93
+ }
94
+ if (k(e, t, n, i), F(e, i), e.wander && a > 0) {
95
+ let t = e.wander;
96
+ t.nextAt < 0 ? t.nextAt = a + t.minIdle + o() * t.jitter : a >= t.nextAt && z(e) && (I(e, B(e, o)), t.nextAt = a + t.minIdle + o() * t.jitter);
97
+ }
98
+ }
99
+ var T = .001, E = 1.5, D = 7, O = 22;
100
+ function k(e, t, n, r) {
51
101
  let i = e.well;
52
102
  if (!i || !(r > 0)) return;
53
- let a = Math.min(r, k), o = i.cfg, s = i.target > 0 ? o.ramp : D, c = Math.min(s * a, 1);
54
- i.strength += (i.target - i.strength) * c, i.strength < w && (i.strength = i.target <= 0 ? 0 : i.strength);
55
- let { nodes: l } = e, u = o.reach * t, d = u * u, f = o.maxSpeed * t, p = i.target > 0 ? T : E, m = Math.min(p * a, 1), h = i.strength > w && i.x >= 0;
103
+ let a = Math.min(r, M), o = i.cfg, s = i.target > 0 ? o.ramp : O, c = Math.min(s * a, 1);
104
+ i.strength += (i.target - i.strength) * c, i.strength < T && (i.strength = i.target <= 0 ? 0 : i.strength);
105
+ let { nodes: l } = e, u = o.reach * t, d = u * u, f = o.maxSpeed * t, p = i.target > 0 ? E : D, m = Math.min(p * a, 1), h = i.strength > T && i.x >= 0;
56
106
  for (let e = 0; e < l.length; e++) {
57
107
  let t = l[e];
58
108
  if (h) {
@@ -69,8 +119,15 @@ function O(e, t, n, r) {
69
119
  }
70
120
  }
71
121
  }
72
- var k = .05;
73
- function A(e, t, n, r = -1) {
122
+ var A = .55, j = 1, M = .05, N = {
123
+ gain: 14e3,
124
+ reach: 340,
125
+ ramp: 4,
126
+ maxSpeed: 4,
127
+ soften: 8,
128
+ holdMs: 140
129
+ };
130
+ function P(e, t, n, r = -1) {
74
131
  let { nodes: i } = e, a = -1, o = Infinity;
75
132
  for (let e = 0; e < i.length; e++) {
76
133
  if (e === r) continue;
@@ -79,13 +136,13 @@ function A(e, t, n, r = -1) {
79
136
  }
80
137
  return a;
81
138
  }
82
- function j(e, t) {
139
+ function F(e, t) {
83
140
  let { warp: n, nodes: r } = e;
84
141
  if (!n || n.targetIdx < 0 || n.targetIdx >= r.length || !(t > 0)) return;
85
- let i = Math.min(t, k), a = e.warpCfg?.response ?? .55, o = e.warpCfg?.zeta ?? 1, s = 2 * Math.PI / a, c = r[n.targetIdx], l = -2 * o * s * n.vx - s * s * (n.x - c.x), u = -2 * o * s * n.vy - s * s * (n.y - c.y);
142
+ let i = Math.min(t, M), a = e.warpCfg?.response ?? .55, o = e.warpCfg?.zeta ?? 1, s = 2 * Math.PI / a, c = r[n.targetIdx], l = -2 * o * s * n.vx - s * s * (n.x - c.x), u = -2 * o * s * n.vy - s * s * (n.y - c.y);
86
143
  n.vx += l * i, n.vy += u * i, n.x += n.vx * i, n.y += n.vy * i;
87
144
  }
88
- function M(e, t) {
145
+ function I(e, t) {
89
146
  let { warp: n, nodes: r } = e;
90
147
  if (t < 0 || t >= r.length) {
91
148
  n.targetIdx = -1, e.focalIndex = -1;
@@ -93,20 +150,20 @@ function M(e, t) {
93
150
  }
94
151
  e.focalIndex = t, n.targetIdx = t;
95
152
  }
96
- function N(e, t, n) {
97
- let r = A(e, t, n, -1);
153
+ function L(e, t, n) {
154
+ let r = P(e, t, n, -1);
98
155
  if (r >= 0 && r === e.focalIndex) return e.focalIndex;
99
- let i = A(e, t, n, e.focalIndex);
100
- return i < 0 ? -1 : (M(e, i), i);
156
+ let i = P(e, t, n, e.focalIndex);
157
+ return i < 0 ? -1 : (I(e, i), i);
101
158
  }
102
- var P = 24;
103
- function F(e) {
159
+ var R = 24;
160
+ function z(e) {
104
161
  let { warp: t, nodes: n } = e;
105
162
  if (!t || t.targetIdx < 0 || t.targetIdx >= n.length) return !0;
106
163
  let r = n[t.targetIdx];
107
- return Math.hypot(t.x - r.x, t.y - r.y) < P;
164
+ return Math.hypot(t.x - r.x, t.y - r.y) < R;
108
165
  }
109
- function I(e, t) {
166
+ function B(e, t) {
110
167
  let n = e.nodes.length;
111
168
  if (n <= 1) return e.focalIndex;
112
169
  let r = e.focalIndex;
@@ -114,208 +171,58 @@ function I(e, t) {
114
171
  let i = Math.floor(t() * (n - 1));
115
172
  return i < r ? i : i + 1;
116
173
  }
117
- //#endregion
118
- //#region src/components/custom/constellation/constellationField.ts
119
- function L(e, t, n, r, i) {
120
- let a = [];
121
- for (let o = 0; o < t; o++) {
122
- let t = e() * Math.PI * 2;
123
- a.push({
124
- x: e() * n,
125
- y: e() * r,
126
- vx: Math.cos(t) * i,
127
- vy: Math.sin(t) * i,
128
- r: 1.6 + e() * 1.6,
129
- dim: e() < .45
130
- });
131
- }
132
- return a;
133
- }
134
- function R(e, t, n) {
135
- if (!(t > 0) || !(n > 0) || t === e.w && n === e.h) return;
136
- let r = e.w / t, i = e.h / n;
137
- for (let t of e.nodes) t.x *= r, t.y *= i;
138
- e.warp.x *= r, e.warp.y *= i;
139
- }
140
- function z(e, t, n, r, i = 0, a = 0, o = Math.random) {
141
- let { nodes: s, w: c, h: l } = e;
142
- for (let e = 0; e < s.length; e++) {
143
- let n = s[e];
144
- n.x += n.vx * t, n.y += n.vy * t, n.x < 0 ? (n.x = 0, n.vx *= -1) : n.x > c && (n.x = c, n.vx *= -1), n.y < 0 ? (n.y = 0, n.vy *= -1) : n.y > l && (n.y = l, n.vy *= -1);
145
- }
146
- if (r && r.x >= 0) {
147
- let e = 180 * t;
148
- for (let t = 0; t < s.length; t++) {
149
- let i = s[t], a = r.x - i.x, o = r.y - i.y, c = Math.hypot(a, o);
150
- if (c > .5 && c < e) {
151
- let t = Math.hypot(i.vx, i.vy) || n, r = (1 - c / e) * .08, s = i.vx + a / c * r * t, l = i.vy + o / c * r * t, u = Math.hypot(s, l) || 1;
152
- i.vx = s / u * t, i.vy = l / u * t;
153
- }
154
- }
155
- }
156
- if (O(e, t, n, i), j(e, i), e.wander && a > 0) {
157
- let t = e.wander;
158
- t.nextAt < 0 ? t.nextAt = a + t.minIdle + o() * t.jitter : a >= t.nextAt && F(e) && (M(e, I(e, o)), t.nextAt = a + t.minIdle + o() * t.jitter);
159
- }
160
- }
161
- //#endregion
162
- //#region src/components/custom/constellation/constellationDraw.ts
163
- function B(e) {
164
- if (typeof window > "u") return { ..._ };
165
- let t = getComputedStyle(e), n = (e, n) => t.getPropertyValue(e).trim() || n, r = (e, n) => {
166
- let r = t.getPropertyValue(e).trim();
167
- if (!r) return n;
168
- let i = Number.parseFloat(r);
169
- return Number.isFinite(i) ? i : n;
170
- };
171
- return {
172
- node: n("--constellation-node", _.node),
173
- nodeDim: n("--constellation-node-dim", _.nodeDim),
174
- line: n("--constellation-line", _.line),
175
- edgeAlpha: r("--constellation-edge-alpha", _.edgeAlpha),
176
- edgeFocusAlpha: r("--constellation-edge-focus-alpha", _.edgeFocusAlpha),
177
- alpha: r("--constellation-alpha", _.alpha)
178
- };
179
- }
180
- function V(e, t, n, r, i = 1) {
181
- let { nodes: a, k: o } = t, s = n * o, c = s * s, l = r.edgeAlpha * r.alpha * i;
182
- e.strokeStyle = r.line, e.lineWidth = 1 * o;
183
- for (let t = 0; t < a.length; t++) {
184
- let n = a[t];
185
- for (let r = t + 1; r < a.length; r++) {
186
- let t = a[r], i = n.x - t.x, o = n.y - t.y, s = i * i + o * o;
187
- s > c || (e.globalAlpha = l * (1 - s / c), e.beginPath(), e.moveTo(n.x, n.y), e.lineTo(t.x, t.y), e.stroke());
174
+ function V(e, t, n, r) {
175
+ let { nodes: i, k: a } = t, o = n * a, s = o * o, c = r.edgeAlpha * r.alpha;
176
+ e.strokeStyle = r.line, e.lineWidth = 1 * a;
177
+ for (let t = 0; t < i.length; t++) {
178
+ let n = i[t];
179
+ for (let r = t + 1; r < i.length; r++) {
180
+ let t = i[r], a = n.x - t.x, o = n.y - t.y, l = a * a + o * o;
181
+ l > s || (e.globalAlpha = c * (1 - l / s), e.beginPath(), e.moveTo(n.x, n.y), e.lineTo(t.x, t.y), e.stroke());
188
182
  }
189
183
  }
190
184
  e.globalAlpha = 1;
191
185
  }
192
- function H(e, t, n, r = 1) {
193
- let { nodes: i, k: a } = t;
194
- e.globalAlpha = r;
195
- for (let t = 0; t < i.length; t++) {
196
- let r = i[t];
197
- e.fillStyle = r.dim ? n.nodeDim : n.node, e.beginPath(), e.arc(r.x, r.y, r.r * a, 0, Math.PI * 2), e.fill();
186
+ function H(e, t, n) {
187
+ let { nodes: r, k: i } = t;
188
+ for (let t = 0; t < r.length; t++) {
189
+ let a = r[t];
190
+ e.fillStyle = a.dim ? n.nodeDim : n.node, e.beginPath(), e.arc(a.x, a.y, a.r * i, 0, Math.PI * 2), e.fill();
198
191
  }
199
- e.globalAlpha = 1;
200
192
  }
201
- function U(e, t, n, r, i, a = 1) {
193
+ function U(e, t, n, r, i) {
202
194
  if (!i || i.x < 0) return;
203
- let { nodes: o, k: s } = t, c = n * s, l = c * c, u = r.edgeFocusAlpha * r.alpha * a;
204
- e.strokeStyle = r.line, e.lineWidth = 1 * s;
205
- for (let t of o) {
195
+ let { nodes: a, k: o } = t, s = n * o, c = s * s, l = r.edgeFocusAlpha * r.alpha;
196
+ e.strokeStyle = r.line, e.lineWidth = 1 * o;
197
+ for (let t of a) {
206
198
  let n = t.x - i.x, r = t.y - i.y, a = n * n + r * r;
207
- a > l || (e.globalAlpha = (1 - a / l) * u, e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(t.x, t.y), e.stroke());
199
+ a > c || (e.globalAlpha = (1 - a / c) * l, e.beginPath(), e.moveTo(i.x, i.y), e.lineTo(t.x, t.y), e.stroke());
208
200
  }
209
- e.globalAlpha = .55 * a, e.fillStyle = r.node, e.beginPath(), e.arc(i.x, i.y, 2.6 * s, 0, Math.PI * 2), e.fill(), e.globalAlpha = 1;
201
+ e.globalAlpha = .55, e.fillStyle = r.node, e.beginPath(), e.arc(i.x, i.y, 2.6 * o, 0, Math.PI * 2), e.fill(), e.globalAlpha = 1;
210
202
  }
211
- function W(e, t, n, r, i, a = 1) {
212
- let { k: o } = t;
203
+ function W(e, t, n, r, i) {
204
+ let { k: a } = t;
213
205
  e.strokeStyle = i.line;
214
206
  for (let t = r.length - 1; t >= 0; t--) {
215
207
  let i = r[t];
216
208
  i.start < 0 && (i.start = n);
217
- let s = (n - i.start) / 900;
218
- if (s >= 1) {
209
+ let o = (n - i.start) / 900;
210
+ if (o >= 1) {
219
211
  r.splice(t, 1);
220
212
  continue;
221
213
  }
222
- e.globalAlpha = (1 - s) * .5 * a, e.lineWidth = 1.4 * o, e.beginPath(), e.arc(i.x, i.y, (8 + s * 130) * o, 0, Math.PI * 2), e.stroke();
214
+ e.globalAlpha = (1 - o) * .5, e.lineWidth = 1.4 * a, e.beginPath(), e.arc(i.x, i.y, (8 + o * 130) * a, 0, Math.PI * 2), e.stroke();
223
215
  }
224
216
  e.globalAlpha = 1;
225
217
  }
226
218
  //#endregion
227
- //#region src/components/custom/constellation/composables/useConstellationPointer.ts
228
- function G(e) {
229
- let { host: t, canvas: n, field: r, pointer: i, ripples: a, handle: o, toLocalRef: s, pointerReactive: c, warpOnClick: l, gravityWell: u, isFrozen: d } = e, f = (e) => {
230
- let t = n.getBoundingClientRect();
231
- if (!t.width || !t.height) return null;
232
- let i = (e.clientX - t.left) / t.width, a = (e.clientY - t.top) / t.height;
233
- return i < 0 || a < 0 || i > 1 || a > 1 ? null : {
234
- x: i * r.w,
235
- y: a * r.h
236
- };
237
- };
238
- if (s.value = f, c && t && !d && !o.reducedMotion && (t.addEventListener("pointermove", (e) => {
239
- let t = f(e);
240
- t ? (i.x = t.x, i.y = t.y) : (i.x = -1, i.y = -1), o.wake();
241
- }), t.addEventListener("pointerleave", () => {
242
- i.x = -1, i.y = -1;
243
- }), t.addEventListener("pointerdown", (e) => {
244
- let t = f(e);
245
- t && a.push({
246
- x: t.x,
247
- y: t.y,
248
- start: -1
249
- }), o.wake();
250
- })), l && t && !d && !o.reducedMotion && t.addEventListener("pointerdown", (e) => {
251
- let t = f(e);
252
- t && (N(r, t.x, t.y), o.wake());
253
- }), u && t && r.well && !d && !o.reducedMotion) {
254
- let e = r.well, n, i = (t) => {
255
- let r = f(t);
256
- r && (e.x = r.x, e.y = r.y, n = window.setTimeout(() => {
257
- e.target = 1, o.wake();
258
- }, e.cfg.holdMs), o.wake());
259
- }, a = (t) => {
260
- if (e.target > 0) {
261
- let n = f(t);
262
- n && (e.x = n.x, e.y = n.y);
263
- }
264
- }, s = () => {
265
- n !== void 0 && (clearTimeout(n), n = void 0), e.target = 0, o.wake();
266
- };
267
- t.addEventListener("pointerdown", i), t.addEventListener("pointermove", a), t.addEventListener("pointerup", s), t.addEventListener("pointerleave", s), t.addEventListener("pointercancel", s);
268
- }
269
- }
270
- //#endregion
271
- //#region src/components/custom/constellation/composables/createConstellationField.ts
272
- function K(e, t) {
273
- let n = {
274
- nodes: [],
275
- canvas: null,
276
- w: 0,
277
- h: 0,
278
- k: 1,
279
- dpr: 1,
280
- focalIndex: -1,
281
- warp: {
282
- x: 0,
283
- y: 0,
284
- vx: 0,
285
- vy: 0,
286
- targetIdx: -1
287
- }
288
- }, r = e && e !== !0 ? e : {};
289
- n.wander = e ? {
290
- nextAt: -1,
291
- minIdle: r.minIdle ?? 8e3,
292
- jitter: r.jitter ?? 8e3
293
- } : void 0;
294
- let i = t && t !== !0 ? t : {};
295
- return n.well = t ? {
296
- x: -1,
297
- y: -1,
298
- strength: 0,
299
- target: 0,
300
- cfg: {
301
- ...b,
302
- ...i
303
- }
304
- } : void 0, {
305
- field: n,
306
- wanderOverride: r,
307
- wellOverride: i
308
- };
309
- }
310
- //#endregion
311
219
  //#region src/components/custom/constellation/Constellation.vue?vue&type=script&setup=true&lang.ts
312
- var q = 0, J = /* @__PURE__ */ n(/* @__PURE__ */ c({
220
+ var G = 0, K = /* @__PURE__ */ n(/* @__PURE__ */ c({
313
221
  __name: "Constellation",
314
222
  props: {
315
223
  count: { default: 64 },
316
224
  link: { default: 132 },
317
225
  speed: { default: .16 },
318
- opacityCeiling: { default: 1 },
319
226
  seed: {},
320
227
  pointerReactive: {
321
228
  type: Boolean,
@@ -344,83 +251,141 @@ var q = 0, J = /* @__PURE__ */ n(/* @__PURE__ */ c({
344
251
  drawOverlay: { type: Function }
345
252
  },
346
253
  setup(n, { expose: c }) {
347
- let v = h("hostRef"), y = h("canvasRef"), b = a(() => n.seed === void 0 ? Math.random : r(typeof n.seed == "string" ? i(n.seed) : n.seed)), x = () => typeof window < "u" && /[?&](export|print|freeze)\b/.test(window.location.search), S = l()?.vnode.props?.freeze, w = a(() => S === void 0 ? x() : S === !0 || S === ""), { field: T, wanderOverride: E, wellOverride: D } = K(n.wander, n.gravityWell), O = {
254
+ let _ = h("hostRef"), v = h("canvasRef"), T = a(() => n.seed === void 0 ? Math.random : r(typeof n.seed == "string" ? i(n.seed) : n.seed)), E = () => typeof window < "u" && /[?&](export|print|freeze)\b/.test(window.location.search), D = l()?.vnode.props?.freeze, O = a(() => D === void 0 ? E() : D === !0 || D === ""), k = {
255
+ nodes: [],
256
+ canvas: null,
257
+ w: 0,
258
+ h: 0,
259
+ k: 1,
260
+ dpr: 1,
261
+ focalIndex: -1,
262
+ warp: {
263
+ x: 0,
264
+ y: 0,
265
+ vx: 0,
266
+ vy: 0,
267
+ targetIdx: -1
268
+ }
269
+ }, A = n.wander && n.wander !== !0 ? n.wander : {};
270
+ k.wander = n.wander ? {
271
+ nextAt: -1,
272
+ minIdle: A.minIdle ?? 8e3,
273
+ jitter: A.jitter ?? 8e3
274
+ } : void 0;
275
+ let j = n.gravityWell && n.gravityWell !== !0 ? n.gravityWell : {};
276
+ k.well = n.gravityWell ? {
277
+ x: -1,
278
+ y: -1,
279
+ strength: 0,
280
+ target: 0,
281
+ cfg: {
282
+ ...N,
283
+ ...j
284
+ }
285
+ } : void 0;
286
+ let M = {
348
287
  x: -1,
349
288
  y: -1
350
- }, k = [], A = { ..._ }, j = -1, M = !1, P = p(null);
289
+ }, P = [], F = { ...y }, I = -1, R = !1, z = p(null);
351
290
  return d(() => {
352
- let e = y.value;
291
+ let e = v.value;
353
292
  if (!e) return;
354
293
  let r = t({
355
- canvas: y,
294
+ canvas: v,
356
295
  setup: (t) => ({ render(t, i) {
357
296
  let a = e.clientWidth || e.offsetWidth || 1280, o = e.clientHeight || e.offsetHeight || 720, s = a / g;
358
- if (T.canvas = e, T.dpr = Math.min(typeof window < "u" && window.devicePixelRatio || 1, 2), T.w !== a || T.h !== o) {
359
- let t = T.w, r = T.h;
360
- if (T.w = a, T.h = o, T.k = s, T.nodes.length ? R(T, t, r) : (T.nodes = L(b.value, n.count, a, o, n.speed), T.warp.x = a / 2, T.warp.y = o / 2), A = B(e), !M) {
361
- M = !0;
362
- let t = C(e);
363
- T.warpCfg = t.warp, T.well && (T.well.cfg = {
297
+ if (k.canvas = e, k.dpr = Math.min(typeof window < "u" && window.devicePixelRatio || 1, 2), k.w !== a || k.h !== o) {
298
+ let t = k.w, r = k.h;
299
+ if (k.w = a, k.h = o, k.k = s, k.nodes.length ? C(k, t, r) : (k.nodes = S(T.value, n.count, a, o, n.speed), k.warp.x = a / 2, k.warp.y = o / 2), F = b(e), !R) {
300
+ R = !0;
301
+ let t = x(e);
302
+ k.warpCfg = t.warp, k.well && (k.well.cfg = {
364
303
  ...t.well,
365
- ...D
366
- }), T.wander && (T.wander.minIdle = E.minIdle ?? t.wander.minIdle, T.wander.jitter = E.jitter ?? t.wander.jitter);
304
+ ...j
305
+ }), k.wander && (k.wander.minIdle = A.minIdle ?? t.wander.minIdle, k.wander.jitter = A.jitter ?? t.wander.jitter);
367
306
  }
368
307
  }
369
- T.k = s;
370
- let c = j < 0 ? 0 : (i - j) / 1e3;
371
- j = i;
372
- let l = w.value || r.reducedMotion;
373
- if (l && T.well && (T.well.strength = 0, T.well.target = 0, T.well.x = -1, T.well.y = -1), !l) {
374
- let e = n.pointerReactive ? O : null;
375
- z(T, s, n.speed, e, c, i, b.value);
308
+ k.k = s;
309
+ let c = I < 0 ? 0 : (i - I) / 1e3;
310
+ I = i;
311
+ let l = O.value || r.reducedMotion;
312
+ if (l && k.well && (k.well.strength = 0, k.well.target = 0, k.well.x = -1, k.well.y = -1), !l) {
313
+ let e = n.pointerReactive ? M : null;
314
+ w(k, s, n.speed, e, c, i, T.value);
376
315
  }
377
- t.clearRect(0, 0, a, o), V(t, T, n.link, A, n.opacityCeiling), H(t, T, A, n.opacityCeiling), n.pointerReactive && !l && (U(t, T, n.link, A, O, n.opacityCeiling), W(t, T, i, k, A, n.opacityCeiling)), n.drawOverlay?.(t, T, l ? q : i);
316
+ t.clearRect(0, 0, a, o), V(t, k, n.link, F), H(t, k, F), n.pointerReactive && !l && (U(t, k, n.link, F, M), W(t, k, i, P, F)), n.drawOverlay?.(t, k, l ? G : i);
378
317
  } })
379
- });
380
- G({
381
- host: v.value,
382
- canvas: e,
383
- field: T,
384
- pointer: O,
385
- ripples: k,
386
- handle: r,
387
- toLocalRef: P,
388
- pointerReactive: n.pointerReactive,
389
- warpOnClick: n.warpOnClick,
390
- gravityWell: !!n.gravityWell,
391
- isFrozen: w.value
392
- });
318
+ }), i = _.value, a = (t) => {
319
+ let n = e.getBoundingClientRect();
320
+ if (!n.width || !n.height) return null;
321
+ let r = (t.clientX - n.left) / n.width, i = (t.clientY - n.top) / n.height;
322
+ return r < 0 || i < 0 || r > 1 || i > 1 ? null : {
323
+ x: r * k.w,
324
+ y: i * k.h
325
+ };
326
+ };
327
+ if (z.value = a, n.pointerReactive && i && !O.value && !r.reducedMotion && (i.addEventListener("pointermove", (e) => {
328
+ let t = a(e);
329
+ t ? (M.x = t.x, M.y = t.y) : (M.x = -1, M.y = -1), r.wake();
330
+ }), i.addEventListener("pointerleave", () => {
331
+ M.x = -1, M.y = -1;
332
+ }), i.addEventListener("pointerdown", (e) => {
333
+ let t = a(e);
334
+ t && P.push({
335
+ x: t.x,
336
+ y: t.y,
337
+ start: -1
338
+ }), r.wake();
339
+ })), n.warpOnClick && i && !O.value && !r.reducedMotion && i.addEventListener("pointerdown", (e) => {
340
+ let t = a(e);
341
+ t && (L(k, t.x, t.y), r.wake());
342
+ }), n.gravityWell && i && k.well && !O.value && !r.reducedMotion) {
343
+ let e = k.well, t, n = (n) => {
344
+ let i = a(n);
345
+ i && (e.x = i.x, e.y = i.y, t = window.setTimeout(() => {
346
+ e.target = 1, r.wake();
347
+ }, e.cfg.holdMs), r.wake());
348
+ }, o = (t) => {
349
+ if (e.target > 0) {
350
+ let n = a(t);
351
+ n && (e.x = n.x, e.y = n.y);
352
+ }
353
+ }, s = () => {
354
+ t !== void 0 && (clearTimeout(t), t = void 0), e.target = 0, r.wake();
355
+ };
356
+ i.addEventListener("pointerdown", n), i.addEventListener("pointermove", o), i.addEventListener("pointerup", s), i.addEventListener("pointerleave", s), i.addEventListener("pointercancel", s);
357
+ }
393
358
  }), c({
394
- field: T,
395
- isFrozen: w,
359
+ field: k,
360
+ isFrozen: O,
396
361
  warpTo(e, t) {
397
362
  if (typeof e == "number" && typeof t == "number") {
398
- let n = P.value?.({
363
+ let n = z.value?.({
399
364
  clientX: e,
400
365
  clientY: t
401
366
  });
402
- return n ? N(T, n.x, n.y) : -1;
367
+ return n ? L(k, n.x, n.y) : -1;
403
368
  }
404
369
  let n = e;
405
- return N(T, n.x, n.y);
370
+ return L(k, n.x, n.y);
406
371
  },
407
372
  holdWellAt(e, t) {
408
- return T.well ? (T.well.x = e, T.well.y = t, T.well.target = 1, !0) : !1;
373
+ return k.well ? (k.well.x = e, k.well.y = t, k.well.target = 1, !0) : !1;
409
374
  },
410
375
  releaseWell() {
411
- T.well && (T.well.target = 0);
376
+ k.well && (k.well.target = 0);
412
377
  }
413
378
  }), (t, r) => (f(), o("div", {
414
379
  ref_key: "hostRef",
415
- ref: v,
380
+ ref: _,
416
381
  class: u(m(e)("constellation", n.class))
417
382
  }, [s("canvas", {
418
383
  ref_key: "canvasRef",
419
- ref: y,
384
+ ref: v,
420
385
  class: "constellation-canvas",
421
386
  "aria-hidden": "true"
422
387
  }, null, 512)], 2));
423
388
  }
424
- }), [["__scopeId", "data-v-0f4665ba"]]);
389
+ }), [["__scopeId", "data-v-a8ae86fe"]]);
425
390
  //#endregion
426
- export { g as BASE_WIDTH, J as Constellation, _ as DEFAULT_PALETTE, x as DEFAULT_WANDER_IDLE, S as DEFAULT_WANDER_JITTER, b as DEFAULT_WELL_CONFIG, v as WARP_RESPONSE, y as WARP_ZETA, V as drawEdges, H as drawNodes, U as drawPointerWeb, W as drawRipples, A as nearestNode, I as pickWanderTarget, C as readInteractionConfig, B as readPalette, R as refitField, L as seedField, M as setWarpTarget, z as stepField, O as stepWell, F as warpSettled, j as warpStep, N as warpTo };
391
+ export { g as BASE_WIDTH, K as Constellation, y as DEFAULT_PALETTE, _ as DEFAULT_WANDER_IDLE, v as DEFAULT_WANDER_JITTER, N as DEFAULT_WELL_CONFIG, A as WARP_RESPONSE, j as WARP_ZETA, V as drawEdges, H as drawNodes, U as drawPointerWeb, W as drawRipples, P as nearestNode, B as pickWanderTarget, x as readInteractionConfig, b as readPalette, C as refitField, S as seedField, I as setWarpTarget, w as stepField, k as stepWell, z as warpSettled, F as warpStep, L as warpTo };