@mkbabb/glass-ui 3.2.0 → 3.4.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 (306) hide show
  1. package/dist/{CardFooter-3-VGho1J.js → CardFooter-C390imy7.js} +2 -2
  2. package/dist/{CollapsibleContent-wlmlDujU.js → CollapsibleContent-cauTbZEM.js} +1 -1
  3. package/dist/{CommandShortcut-C6lsz3pG.js → CommandShortcut-BiVyqipe.js} +5 -4
  4. package/dist/DataTable-FfkaAg2z.js +465 -0
  5. package/dist/DialogContent-IQ8_BRrC.js +100 -0
  6. package/dist/{DiscoGlyph-B7YooI2-.js → DiscoGlyph-BaZ8OawK.js} +1 -1
  7. package/dist/{GlyphFace-Bvk6OIas.js → GlyphFace-B_7vOmYn.js} +1 -1
  8. package/dist/HoverPopover-DTSYkJtw.js +96 -0
  9. package/dist/{IconTooltip-DXveGjx7.js → IconTooltip-BTyYn4mr.js} +1 -1
  10. package/dist/Input-CU9CNKmo.js +52 -0
  11. package/dist/{MetricBadge-J_GBCb8e.js → MetricBadge-BlrdbOGN.js} +1 -1
  12. package/dist/{NumberFieldContent-B6L6YrQz.js → NumberFieldContent-iOTQ5rGO.js} +8 -4
  13. package/dist/{PopoverContent-CxEEUL7Y.js → PopoverContent-B8WtJECb.js} +1 -1
  14. package/dist/Progress-DjM86vfb.js +254 -0
  15. package/dist/{ScrollingText-1Qjnwz6H.js → ScrollingText-P9o_DuMn.js} +1 -1
  16. package/dist/{SelectScrollDownButton-BvvvAbuh.js → SelectScrollDownButton-BGn3rjs9.js} +9 -8
  17. package/dist/TabsIndicator-DA0x9gPr.js +97 -0
  18. package/dist/{ToggleGroupItem-Cy7xHFEo.js → ToggleGroupItem-gyXj998A.js} +37 -40
  19. package/dist/UnderlineTabs-Cq_AD03t.js +39 -0
  20. package/dist/animated-digit.js +2 -2
  21. package/dist/api/index.d.ts +2 -0
  22. package/dist/api.js +1 -1
  23. package/dist/aurora.js +454 -271
  24. package/dist/{button-DS3ULf5i.js → button-Ckn3eDfB.js} +27 -22
  25. package/dist/button.js +1 -1
  26. package/dist/card.js +1 -1
  27. package/dist/carousel.js +2 -2
  28. package/dist/collapsible.js +1 -1
  29. package/dist/color-rkK4RMx2.js +33 -0
  30. package/dist/color.d.ts +1 -0
  31. package/dist/color.js +2 -0
  32. package/dist/command.js +1 -1
  33. package/dist/compile-DVgAxagk.js +106 -0
  34. package/dist/components/custom/animated-digit/AnimatedDigit.vue.d.ts +7 -7
  35. package/dist/components/custom/aurora/Aurora.vue.d.ts +3 -3
  36. package/dist/components/custom/aurora/composables/color.d.ts +3 -25
  37. package/dist/components/custom/aurora/composables/cursorModel.d.ts +45 -0
  38. package/dist/components/custom/aurora/composables/frameLoop.d.ts +30 -0
  39. package/dist/components/custom/aurora/composables/glSetup.d.ts +29 -0
  40. package/dist/components/custom/aurora/composables/runtime.d.ts +45 -35
  41. package/dist/components/custom/aurora/composables/uniformBridge.d.ts +67 -0
  42. package/dist/components/custom/aurora/composables/useAurora.d.ts +14 -1
  43. package/dist/components/custom/aurora/composables/useCursorInteraction.d.ts +1 -1
  44. package/dist/components/custom/aurora/constants/budget.d.ts +50 -0
  45. package/dist/components/custom/aurora/{presets.d.ts → constants/presets.d.ts} +2 -5
  46. package/dist/components/custom/aurora/constants/shaders/aurora.frag.d.ts +1 -0
  47. package/dist/components/custom/aurora/constants/shaders/brush.glsl.d.ts +1 -0
  48. package/dist/components/custom/aurora/constants/shaders/composition.glsl.d.ts +1 -0
  49. package/dist/components/custom/aurora/constants/shaders/flow.glsl.d.ts +1 -0
  50. package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +2 -0
  51. package/dist/components/custom/aurora/constants/shaders/tonemap.glsl.d.ts +1 -0
  52. package/dist/components/custom/aurora/index.d.ts +2 -2
  53. package/dist/components/custom/configurator/ConfiguratorLayer.vue.d.ts +14 -7
  54. package/dist/components/custom/configurator/density.d.ts +3 -8
  55. package/dist/components/custom/dock/DockBackgroundToggle.vue.d.ts +46 -0
  56. package/dist/components/custom/dock/DockIconButton.vue.d.ts +3 -3
  57. package/dist/components/custom/dock/DockLayerGroup.vue.d.ts +2 -2
  58. package/dist/components/custom/dock/GlassDock.vue.d.ts +22 -18
  59. package/dist/components/custom/dock/composables/dockContext.d.ts +4 -4
  60. package/dist/components/custom/dock/composables/dockLayerContext.d.ts +13 -6
  61. package/dist/components/custom/dock/composables/useLayerTransition.d.ts +32 -8
  62. package/dist/components/custom/dock/index.d.ts +1 -0
  63. package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +10 -0
  64. package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +1 -1
  65. package/dist/components/custom/glyph-face/keys.d.ts +3 -29
  66. package/dist/components/custom/goo-blob/GooBlob.vue.d.ts +48 -0
  67. package/dist/components/custom/goo-blob/composables/easing.d.ts +6 -0
  68. package/dist/components/custom/goo-blob/composables/useBlobMood.d.ts +14 -0
  69. package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +18 -0
  70. package/dist/components/custom/goo-blob/composables/useBlobSatellites.d.ts +13 -0
  71. package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +42 -0
  72. package/dist/components/custom/goo-blob/index.d.ts +7 -0
  73. package/dist/components/custom/goo-blob/shaders/metaball.frag.d.ts +1 -0
  74. package/dist/components/custom/goo-blob/shaders/metaball.vert.d.ts +1 -0
  75. package/dist/components/custom/goo-blob/shaders/oklch-perturb.glsl.d.ts +1 -0
  76. package/dist/components/custom/goo-blob/shaders/sdf-body.glsl.d.ts +1 -0
  77. package/dist/components/custom/goo-blob/shaders/watercolor-edges.glsl.d.ts +2 -0
  78. package/dist/components/custom/goo-blob/types.d.ts +77 -0
  79. package/dist/components/custom/hover-popover/HoverPopover.vue.d.ts +48 -9
  80. package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +2 -0
  81. package/dist/components/custom/labeled-field/LabeledSelect.vue.d.ts +2 -2
  82. package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +2 -2
  83. package/dist/components/custom/responsive-tabs/ResponsiveTabs.vue.d.ts +13 -7
  84. package/dist/components/custom/search/FuzzySearch.vue.d.ts +1 -1
  85. package/dist/components/custom/search/SearchBar.vue.d.ts +1 -1
  86. package/dist/components/custom/sortable-list/SortableHandle.vue.d.ts +7 -1
  87. package/dist/components/custom/sortable-list/context.d.ts +2 -3
  88. package/dist/components/custom/tabs/BouncyTabs.vue.d.ts +6 -3
  89. package/dist/components/custom/tabs/BouncyToggle.vue.d.ts +7 -3
  90. package/dist/components/custom/tabs/UnderlineTabs.vue.d.ts +6 -3
  91. package/dist/components/custom/tabs/composables/useBouncySlider.d.ts +39 -0
  92. package/dist/components/custom/timeline/ContinuousMarkers.vue.d.ts +49 -0
  93. package/dist/components/custom/timeline/ContinuousRail.vue.d.ts +26 -0
  94. package/dist/components/custom/timeline/ContinuousTimeline.vue.d.ts +4 -4
  95. package/dist/components/custom/typewriter/TypewriterText.vue.d.ts +2 -2
  96. package/dist/components/custom/watercolor-dot/WatercolorDot.vue.d.ts +45 -0
  97. package/dist/components/custom/watercolor-dot/index.d.ts +3 -0
  98. package/dist/components/custom/watercolor-dot/prng.d.ts +5 -0
  99. package/dist/components/custom/watercolor-dot/useWatercolorBlob.d.ts +24 -0
  100. package/dist/components/ui/_shared/menuItemVariants.d.ts +1 -1
  101. package/dist/components/ui/avatar/Avatar.vue.d.ts +1 -1
  102. package/dist/components/ui/avatar/AvatarImage.vue.d.ts +5 -1
  103. package/dist/components/ui/avatar/index.d.ts +1 -1
  104. package/dist/components/ui/badge/index.d.ts +2 -2
  105. package/dist/components/ui/button/Button.vue.d.ts +3 -1
  106. package/dist/components/ui/button/index.d.ts +2 -2
  107. package/dist/components/ui/carousel/CarouselNext.vue.d.ts +2 -2
  108. package/dist/components/ui/carousel/CarouselPrevious.vue.d.ts +2 -2
  109. package/dist/components/ui/combobox/Combobox.vue.d.ts +2 -2
  110. package/dist/components/ui/combobox/ComboboxInput.vue.d.ts +2 -1
  111. package/dist/components/ui/command/Command.vue.d.ts +3 -3
  112. package/dist/components/ui/command/CommandInput.vue.d.ts +2 -1
  113. package/dist/components/ui/data-table/DataTable.vue.d.ts +5 -4
  114. package/dist/components/ui/dialog/DialogContent.vue.d.ts +8 -0
  115. package/dist/components/ui/drawer/Drawer.vue.d.ts +4 -4
  116. package/dist/components/ui/input/Input.vue.d.ts +19 -1
  117. package/dist/components/ui/multi-select/MultiSelect.vue.d.ts +8 -4
  118. package/dist/components/ui/progress/Progress.vue.d.ts +26 -88
  119. package/dist/components/ui/progress/ProgressDefault.vue.d.ts +14 -0
  120. package/dist/components/ui/progress/ProgressGradient.vue.d.ts +25 -0
  121. package/dist/components/ui/progress/ProgressSectioned.vue.d.ts +36 -0
  122. package/dist/components/ui/progress/index.d.ts +5 -2
  123. package/dist/components/ui/progress/useProgressGeometry.d.ts +60 -0
  124. package/dist/components/ui/select/Select.vue.d.ts +2 -2
  125. package/dist/components/ui/select/SelectContent.vue.d.ts +1 -1
  126. package/dist/components/ui/select/SelectTrigger.vue.d.ts +3 -0
  127. package/dist/components/ui/sheet/index.d.ts +1 -1
  128. package/dist/components/ui/slider/index.d.ts +12 -11
  129. package/dist/components/ui/tags-input/TagsInput.vue.d.ts +2 -2
  130. package/dist/components/ui/textarea/Textarea.vue.d.ts +5 -1
  131. package/dist/components/ui/toast/Toast.vue.d.ts +4 -4
  132. package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
  133. package/dist/components/ui/toggle/index.d.ts +1 -1
  134. package/dist/components/ui/toggle-group/toggleGroupContext.d.ts +2 -3
  135. package/dist/composables/color/index.d.ts +49 -0
  136. package/dist/composables/context/createContext.d.ts +56 -0
  137. package/dist/composables/context/index.d.ts +1 -0
  138. package/dist/composables/dark/darkModeSyncScript.d.ts +23 -0
  139. package/dist/composables/dark/index.d.ts +3 -0
  140. package/dist/composables/dark/useGlobalDark.d.ts +19 -2
  141. package/dist/composables/dom/index.d.ts +0 -3
  142. package/dist/composables/dom/useClipboard.d.ts +35 -12
  143. package/dist/composables/dom/useDocumentVisibility.d.ts +20 -0
  144. package/dist/composables/glass/webgl/compile.d.ts +15 -0
  145. package/dist/composables/glass/webgl/shaders/procedural-color.glsl.d.ts +3 -0
  146. package/dist/composables/glass/webgl/useWebGLCanvas.d.ts +55 -0
  147. package/dist/composables/motion/core/index.d.ts +1 -1
  148. package/dist/composables/motion/index.d.ts +1 -1
  149. package/dist/composables/motion/useCountup.d.ts +29 -0
  150. package/dist/composables/motion/useNumericTransition.d.ts +14 -3
  151. package/dist/composables/motion/vReveal.d.ts +2 -0
  152. package/dist/composables/sidebar/useSidebarState.d.ts +2 -2
  153. package/dist/composables/sortable/dragController.d.ts +44 -0
  154. package/dist/composables/sortable/dropResolver.d.ts +34 -0
  155. package/dist/composables/sortable/ghostRenderer.d.ts +44 -0
  156. package/dist/composables/sortable/index.d.ts +1 -1
  157. package/dist/composables/sortable/touchGate.d.ts +26 -0
  158. package/dist/composables/sortable/transitionTiming.d.ts +50 -0
  159. package/dist/composables/sortable/types.d.ts +133 -0
  160. package/dist/composables/sortable/useSortable.d.ts +25 -153
  161. package/dist/configurator.js +1 -1
  162. package/dist/confirm-dialog.js +1 -1
  163. package/dist/controls.js +4 -4
  164. package/dist/createContext-DBMGRlx4.js +25 -0
  165. package/dist/dark.d.ts +2 -1
  166. package/dist/dark.js +9 -2
  167. package/dist/data-table.js +1 -1
  168. package/dist/dialog.js +1 -1
  169. package/dist/disco-glyph.js +1 -1
  170. package/dist/dock.js +400 -261
  171. package/dist/dockContext-spUj_-E5.js +9 -0
  172. package/dist/dom.js +6 -6
  173. package/dist/{dropdown-menu-naE0skDg.js → dropdown-menu-EFjl5iKo.js} +1 -1
  174. package/dist/dropdown-menu.js +1 -1
  175. package/dist/expandable-container.js +26 -20
  176. package/dist/fonts/README.md +21 -0
  177. package/dist/fonts/fraunces/fraunces-latin.woff2 +0 -0
  178. package/dist/forms.js +68 -59
  179. package/dist/glass-panel.js +1 -1
  180. package/dist/glass-ui.css +1 -1
  181. package/dist/glass-ui.js +226 -328
  182. package/dist/glyph-face.js +2 -2
  183. package/dist/goo-blob.d.ts +1 -0
  184. package/dist/goo-blob.js +538 -0
  185. package/dist/header-ribbon.js +2 -2
  186. package/dist/hover-card.js +1 -1
  187. package/dist/hover-popover.js +1 -1
  188. package/dist/icon-tooltip.js +1 -1
  189. package/dist/index.d.ts +1 -0
  190. package/dist/instrument-chassis.js +1 -1
  191. package/dist/instrument-rail.js +1 -1
  192. package/dist/keys-BFoma9vm.js +9 -0
  193. package/dist/label.js +1 -1
  194. package/dist/labeled-field.js +57 -39
  195. package/dist/metric-badge.js +1 -1
  196. package/dist/motion-core.js +82 -123
  197. package/dist/motion.js +62 -14
  198. package/dist/number-field.js +1 -1
  199. package/dist/paper-backdrop.js +1 -1
  200. package/dist/popover.js +1 -1
  201. package/dist/{presets-BpTf63Hp.js → presets-1OhFpaIC.js} +1 -1
  202. package/dist/prng-Bz_1Tydc.js +15 -0
  203. package/dist/progress.js +2 -2
  204. package/dist/reactive.js +2 -2
  205. package/dist/responsive-tabs.js +38 -32
  206. package/dist/scrolling-text.js +1 -1
  207. package/dist/search.js +8 -8
  208. package/dist/select.js +3 -3
  209. package/dist/separator.js +1 -1
  210. package/dist/sheet.js +1 -1
  211. package/dist/{slider-wx8ifVFB.js → slider-BOh8ycfZ.js} +7 -11
  212. package/dist/slider.js +1 -1
  213. package/dist/sortable-list.js +36 -38
  214. package/dist/stacked-icons.js +2 -2
  215. package/dist/styles/animations.css +1 -1
  216. package/dist/styles/cards.css +1 -1
  217. package/dist/styles/components.css +1 -1
  218. package/dist/styles/dock-controls.css +486 -0
  219. package/dist/styles/dock.css +284 -450
  220. package/dist/styles/fonts.css +25 -0
  221. package/dist/styles/glass-specular-track.css +154 -0
  222. package/dist/styles/glass.css +74 -2
  223. package/dist/styles/index.css +21 -2
  224. package/dist/styles/instrument-chassis.css +11 -4
  225. package/dist/styles/theme.css +73 -21
  226. package/dist/styles/tokens.css +271 -140
  227. package/dist/styles/typography.css +14 -8
  228. package/dist/styles/utilities.css +36 -8
  229. package/dist/styles/view-transition.css +10 -4
  230. package/dist/switch.js +1 -1
  231. package/dist/tabs.js +139 -112
  232. package/dist/timeline.js +219 -158
  233. package/dist/toast.js +1 -1
  234. package/dist/toggle-group.js +1 -1
  235. package/dist/tokens.d.ts +1 -1
  236. package/dist/tooltip.js +1 -1
  237. package/dist/{useAnimatedNumber-BOxrS3a6.js → useAnimatedNumber-BF6r64lA.js} +1 -1
  238. package/dist/useClipboard-D8vFyRCa.js +97 -0
  239. package/dist/{useConfiguratorState-Dq2gNv4A.js → useConfiguratorState-DUtC1jxr.js} +82 -86
  240. package/dist/useGlobalDark-CWiaCoEw.js +34 -0
  241. package/dist/useIntersectionPause-DAdVPVp4.js +53 -0
  242. package/dist/useSortable-DnyGXKKY.js +246 -0
  243. package/dist/{useTouchGate-XX8gHfay.js → useTouchGate-CS5Csc2h.js} +1 -1
  244. package/dist/utils/prng.d.ts +4 -0
  245. package/dist/vReveal-u2wSG2El.js +35 -0
  246. package/dist/watercolor-dot.d.ts +1 -0
  247. package/dist/watercolor-dot.js +129 -0
  248. package/package.json +101 -16
  249. package/src/fonts/README.md +21 -0
  250. package/src/fonts/fraunces/fraunces-latin.woff2 +0 -0
  251. package/src/styles/animations.css +1 -1
  252. package/src/styles/cards.css +1 -1
  253. package/src/styles/dock-controls.css +486 -0
  254. package/src/styles/dock.css +284 -450
  255. package/src/styles/fonts.css +25 -0
  256. package/src/styles/glass-specular-track.css +154 -0
  257. package/src/styles/glass.css +74 -2
  258. package/src/styles/index.css +21 -2
  259. package/src/styles/instrument-chassis.css +11 -4
  260. package/src/styles/theme.css +73 -21
  261. package/src/styles/tokens.css +271 -140
  262. package/src/styles/typography.css +14 -8
  263. package/src/styles/utilities.css +36 -8
  264. package/src/styles/view-transition.css +10 -4
  265. package/dist/DataTable-BsrDYdoE.js +0 -460
  266. package/dist/DialogContent-B61rP8lj.js +0 -93
  267. package/dist/HoverPopover-BlEwqG7S.js +0 -96
  268. package/dist/Input-IFsIzId2.js +0 -30
  269. package/dist/Progress-Bs44qWEM.js +0 -126
  270. package/dist/UnderlineTabs-B4FV2zi_.js +0 -37
  271. package/dist/components/custom/aurora/shaders/aurora.frag.d.ts +0 -1
  272. package/dist/composables/dom/useBreakpoint.d.ts +0 -38
  273. package/dist/composables/dom/useIdleReady.d.ts +0 -63
  274. package/dist/composables/dom/useViewportReady.d.ts +0 -87
  275. package/dist/composables/glass/webgl/frostShader.d.ts +0 -27
  276. package/dist/composables/motion/useAnimatedNumberMap.d.ts +0 -29
  277. package/dist/composables/motion/useStagger.d.ts +0 -50
  278. package/dist/dockContext-DM58L1Jt.js +0 -16
  279. package/dist/keys-SIKQYNx1.js +0 -11
  280. package/dist/supportsCssTimeline-IQY3gfKD.js +0 -12
  281. package/dist/useGlobalDark-BUUTZvkU.js +0 -24
  282. package/dist/useIdleReady-sLhGo6CL.js +0 -162
  283. package/dist/useIntersectionPause-CUmANkoc.js +0 -39
  284. package/dist/useSortable-DLK9kwZp.js +0 -189
  285. /package/dist/{HoverCardContent-DGUhpRVt.js → HoverCardContent-ICfIMZX1.js} +0 -0
  286. /package/dist/{InstrumentChassis-CqKPBNqp.js → InstrumentChassis-DaHIZCqy.js} +0 -0
  287. /package/dist/{InstrumentRail-CCjvKkpB.js → InstrumentRail-B0qqLFN0.js} +0 -0
  288. /package/dist/{Label-D53EOwLE.js → Label-CZk-3nTc.js} +0 -0
  289. /package/dist/{PaperBackdrop-Ds-wDsKf.js → PaperBackdrop-D_YZW47j.js} +0 -0
  290. /package/dist/{SelectGroup-DAgcsfFw.js → SelectGroup-CMdoCjRE.js} +0 -0
  291. /package/dist/{SelectSeparator-DN1jzLaI.js → SelectSeparator-CaJnPF3_.js} +0 -0
  292. /package/dist/{Separator-DXxac0j8.js → Separator-C2XtAXRp.js} +0 -0
  293. /package/dist/{Switch-imA0Hdjs.js → Switch-x8n6husW.js} +0 -0
  294. /package/dist/{Toaster-Brs6QjBU.js → Toaster-DdhMKfus.js} +0 -0
  295. /package/dist/{TooltipProvider-MZFRxOvT.js → TooltipProvider-D-JrSqDu.js} +0 -0
  296. /package/dist/components/custom/aurora/{renderMode.d.ts → constants/renderMode.d.ts} +0 -0
  297. /package/dist/components/custom/aurora/{shaders → constants/shaders}/aurora.vert.d.ts +0 -0
  298. /package/dist/{constants-DfWPi8kh.js → constants-DsCdlK9I.js} +0 -0
  299. /package/dist/{sheet-BnvZRXPq.js → sheet-CQYYrkr9.js} +0 -0
  300. /package/dist/{useGlassRenderer-C98tZnJ7.js → useGlassRenderer-Dn3WpfG-.js} +0 -0
  301. /package/dist/{useInterval-B58LmYth.js → useInterval-CHVYFpXV.js} +0 -0
  302. /package/dist/{useResizeObserver-C_7GjpRn.js → useResizeObserver-DX-STszm.js} +0 -0
  303. /package/dist/{useTextHighlight-CLST6an0.js → useTextHighlight-Dmtofpk2.js} +0 -0
  304. /package/dist/{useTimer-6FoosoDY.js → useTimer-DGgoxTXL.js} +0 -0
  305. /package/dist/{useUserInvalidAria-BW5iyqWR.js → useUserInvalidAria-DmvZ_6Dx.js} +0 -0
  306. /package/dist/{useViewTransition-CUJM7fXT.js → useViewTransition-D4ssvnXZ.js} +0 -0
package/dist/aurora.js CHANGED
@@ -1,74 +1,286 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-C1je1s0u.js";
2
- import { n as t, r as n, t as r } from "./presets-BpTf63Hp.js";
3
- import { t as i } from "./useIntersectionPause-CUmANkoc.js";
4
- import { computed as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, onMounted as f, openBlock as p, readonly as m, ref as h, unref as g, watch as _ } from "vue";
5
- import { colorUnit2 as v, gamutMapOKLab as y, isInSRGBGamut as b, oklabToLinearSRGB as x, oklabToRgb255 as S, parseCSSColor as C, rawOklabToOklch as w, rawOklchToOklab as T, srgbToOKLab as E } from "@mkbabb/value.js";
6
- //#region src/components/custom/aurora/shaders/aurora.vert.ts
7
- var D = "#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main() {\n vUv = aPos * 0.5 + 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n}", O = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\n#define MAX_NUCLEI 6\n#define MAX_STOPS 8\n\n// ── Uniforms ───────────────────────────────────────────────────────────────\nuniform float uTime;\n\n// Palette baked CPU-side to linear-sRGB\nuniform vec3 uPalette[MAX_STOPS];\nuniform int uStopCount;\n\n// Nuclei (parallel arrays)\nuniform int uNucleiCount;\nuniform vec2 uNucleiPos[MAX_NUCLEI];\nuniform float uNucleiRadius[MAX_NUCLEI];\nuniform float uNucleiPaletteBias[MAX_NUCLEI];\nuniform float uNucleiValueBias[MAX_NUCLEI];\nuniform float uNucleiDriftRadius[MAX_NUCLEI];\nuniform float uNucleiDriftPhase[MAX_NUCLEI];\n// Anisotropy: per-nucleus elongation (1.0 = isotropic) and major-axis angle (radians).\n// Defaults (1.0 / 0.0) reduce to the original circular Gaussian.\nuniform float uNucleiElong[MAX_NUCLEI];\nuniform float uNucleiAngle[MAX_NUCLEI];\nuniform float uSoftmaxBeta;\nuniform float uValueVariance;\n\n// Warp\nuniform float uWarpAmount;\nuniform float uWarpScale;\nuniform float uWarpDrift;\nuniform int uWarpMode; // 0=fbm 1=cellular 2=hybrid\nuniform int uNoiseOctaves;\n\n// Medium\n// 0 smooth, 1 pastel, 2 watercolor, 3 oil\nuniform int uMedium;\nuniform int uFlowPattern; // 0 none, 1 radial, 2 swirl, 3 diagonal, 4 multi\nuniform vec2 uFlowFocal;\nuniform float uFlowAngle;\nuniform float uFlowCurl;\nuniform vec2 uCursor; // in 0..1 screen space (matches pN)\nuniform float uCursorStrength; // 0..1 attraction amount\nuniform float uCursorRadius; // radius of influence (0.05..0.5)\nuniform float uStrokeAmount;\nuniform float uStrokeScale;\nuniform float uStrokeAnisotropy;\nuniform int uStrokeLayers; // 1 or 2 (crosshatch)\nuniform int uStrokeMode; // 0 oil (modern gestural), 1 palette-knife, 2 crayon/oil-pastel, 3 modern-chunky\nuniform float uWetEdge;\nuniform float uGranulation;\nuniform float uImpasto;\nuniform float uBrokenColor;\nuniform float uCanvasGrain;\n\n// Motion\nuniform float uNucleiDrift;\nuniform float uPaletteDrift;\nuniform float uBreathDepth;\nuniform float uBreathPeriod;\n\n// Output\nuniform float uSaturation;\nuniform float uPaperGrain;\nuniform float uAlpha;\n\n// ── Time rate ────────────────────────────────────────────────────────────────\n// The authoring coefficients (uNucleiDrift, uPaletteDrift, uWarpDrift) live in a\n// human-friendly 0..~0.05 band — that scale is what the config schema and every\n// demo preset are tuned against. But that band, multiplied straight into uTime\n// (seconds), yields rad/sec rates so small the field reads visually static (one\n// nuclei orbit took ~10 min at the old default). These K_* constants decouple\n// the AUTHORING scale from the RAD/SEC scale: each time term wraps its coefficient\n// in the matching K_, lifting the same authored value to a perceptible period\n// without touching any preset. Tuned so the field reads SLOWLY ALIVE — drift over\n// a ~5–15s window, never a frantic pan. These are downstream of uTime, which the\n// runtime FREEZES under reduced-motion (t = frozenOffset) before the shader sees\n// it, so the lift cannot leak motion into the reduced-motion path.\nconst float K_NUCLEI = 14.0; // nuclei orbit: ~one cycle per ~45s at default 0.01\nconst float K_PAL = 24.0; // palette hue breathe: ~one cycle per ~33s at default\nconst float K_WARP = 5.0; // domain warp scroll: a perceptible fbm-cell traverse\n\n// ── Noise ──────────────────────────────────────────────────────────────────\nfloat hash21(vec2 p) {\n p = fract(p * vec2(123.34, 456.21));\n p += dot(p, p + 45.32);\n return fract(p.x * p.y);\n}\n\nvec2 hash22(vec2 p) {\n p = vec2(dot(p, vec2(127.1, 311.7)),\n dot(p, vec2(269.5, 183.3)));\n return fract(sin(p) * 43758.5453);\n}\n\nfloat vnoise(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n vec2 u = f * f * (3.0 - 2.0 * f);\n float a = hash21(i);\n float b = hash21(i + vec2(1.0, 0.0));\n float c = hash21(i + vec2(0.0, 1.0));\n float d = hash21(i + vec2(1.0, 1.0));\n return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n}\n\nfloat fbm(vec2 p) {\n float v = 0.0;\n float a = 0.5;\n mat2 r = mat2(0.8, 0.6, -0.6, 0.8);\n for (int i = 0; i < 5; i++) {\n if (i >= uNoiseOctaves) break;\n v += a * vnoise(p);\n p = r * p * 2.02;\n a *= 0.5;\n }\n return v;\n}\n\n// Cellular / Worley f1\nfloat cellular(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n float m = 1e9;\n for (int y = -1; y <= 1; y++) {\n for (int x = -1; x <= 1; x++) {\n vec2 g = vec2(float(x), float(y));\n vec2 o = hash22(i + g);\n vec2 r = g + o - f;\n m = min(m, dot(r, r));\n }\n }\n return sqrt(m);\n}\n\n// ── Warp ──────────────────────────────────────────────────────────────────\nvec2 domainWarp(vec2 p, float t) {\n // Quilez canonical double warp\n vec2 q = vec2(fbm(p * uWarpScale + vec2(0.0, 0.0) + t * uWarpDrift * K_WARP),\n fbm(p * uWarpScale + vec2(5.2, 1.3) + t * uWarpDrift * K_WARP));\n vec2 r = vec2(fbm(p * uWarpScale + 4.0 * q + vec2(1.7, 9.2)),\n fbm(p * uWarpScale + 4.0 * q + vec2(8.3, 2.8)));\n\n vec2 warp = r;\n if (uWarpMode == 1) {\n // cellular — chunky territories (MEADOW block-like)\n float c1 = cellular(p * uWarpScale * 1.5 + vec2(t * uWarpDrift * K_WARP * 2.0, 0.0));\n float c2 = cellular(p * uWarpScale * 1.5 + vec2(11.0, 7.0 + t * uWarpDrift * K_WARP * 2.0));\n warp = vec2(c1, c2);\n } else if (uWarpMode == 2) {\n // hybrid — fbm + cellular averaged\n float c1 = cellular(p * uWarpScale * 1.2);\n float c2 = cellular(p * uWarpScale * 1.2 + vec2(11.0, 7.0));\n warp = mix(r, vec2(c1, c2), 0.5);\n }\n vec2 warped = p + uWarpAmount * warp;\n\n // Cursor swirl — rotate p around uCursor with radial falloff.\n // This warps the underlying color field so the bands sweep around the pointer.\n if (uCursorStrength > 0.001) {\n vec2 toP = p - uCursor;\n float d = length(toP);\n float r = max(uCursorRadius, 0.01);\n // Smooth falloff; strong near cursor, zero beyond ~1.5× radius.\n float w = exp(-(d * d) / (r * r * 0.45));\n // Max rotation ~120° at cursor center, scaled by strength\n float ang = w * uCursorStrength * 2.1;\n float ca = cos(ang), sa = sin(ang);\n vec2 rotated = vec2(ca * toP.x - sa * toP.y, sa * toP.x + ca * toP.y) + uCursor;\n // Also pinch slightly toward the cursor (gravity) — adds depth to swirl\n float pinch = w * uCursorStrength * 0.08;\n rotated = mix(rotated, uCursor, pinch);\n // Blend original warped position with cursor-rotated version\n warped = mix(warped, rotated + uWarpAmount * warp * 0.7, w * uCursorStrength);\n }\n\n return warped;\n}\n\n// ── Palette LUT ───────────────────────────────────────────────────────────\nvec3 samplePalette(float id) {\n id = clamp(id, 0.0, 1.0);\n float scaled = id * float(uStopCount - 1);\n int i0 = int(floor(scaled));\n int i1 = min(i0 + 1, uStopCount - 1);\n float t = fract(scaled);\n t = smoothstep(0.0, 1.0, t);\n return mix(uPalette[i0], uPalette[i1], t);\n}\n\n// ── Nuclei field ──────────────────────────────────────────────────────────\nvoid nucleiField(vec2 p, float t, out float paletteId, out float valueMod) {\n float accumBias = 0.0;\n float accumValue = 0.0;\n float accumW = 0.0;\n for (int i = 0; i < MAX_NUCLEI; i++) {\n if (i >= uNucleiCount) break;\n vec2 posI = uNucleiPos[i]\n + uNucleiDriftRadius[i] * vec2(\n cos(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i]),\n sin(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i] * 1.13)\n );\n vec2 diff = p - posI;\n // Anisotropic Gaussian: rotate diff into the nucleus's local frame\n // (major axis along uNucleiAngle), then scale the major-axis component by\n // 1/elongation so the squared distance describes an ellipse. Defaults\n // 1.0/0.0 reduce to the isotropic dot(diff, diff).\n float ca = cos(uNucleiAngle[i]);\n float sa = sin(uNucleiAngle[i]);\n vec2 local = vec2( ca * diff.x + sa * diff.y,\n -sa * diff.x + ca * diff.y);\n float along = local.x / max(uNucleiElong[i], 0.01);\n float across = local.y;\n float d2 = along * along + across * across;\n float r = max(uNucleiRadius[i], 0.01);\n float w = exp(-uSoftmaxBeta * d2 / (r * r));\n accumBias += w * uNucleiPaletteBias[i];\n accumValue += w * uNucleiValueBias[i];\n accumW += w;\n }\n paletteId = accumBias / max(accumW, 1e-4);\n valueMod = accumValue / max(accumW, 1e-4);\n\n // Palette drift — slow global paletteId breathe between adjacent stops. The\n // rate rides K_PAL (perceptible ~30–60s hue cycle at the default coefficient);\n // the amplitude lifts the authored coefficient into a 0.03..0.06 paletteId band\n // so the palette visibly travels rather than dithering within one stop.\n float palAmp = clamp(uPaletteDrift * 6.0, 0.0, 0.06);\n paletteId += palAmp * sin(t * uPaletteDrift * K_PAL);\n paletteId = clamp(paletteId, 0.0, 1.0);\n}\n\n// ── Flow field ────────────────────────────────────────────────────────────\nvec2 flowField(vec2 p, float t) {\n vec2 dir = vec2(1.0, 0.0);\n if (uFlowPattern == 1) {\n // radial\n dir = normalize(p - uFlowFocal + 1e-4);\n } else if (uFlowPattern == 2) {\n // swirl — tangent to radial\n vec2 rad = normalize(p - uFlowFocal + 1e-4);\n dir = vec2(-rad.y, rad.x);\n } else if (uFlowPattern == 3) {\n // diagonal\n float a = radians(uFlowAngle);\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 4) {\n // multi — curl-noise driven\n float n = fbm(p * 2.0 + t * 0.02);\n float a = n * 6.2831;\n dir = vec2(cos(a), sin(a));\n }\n // curl — perturb by noise. Radial gets much less curl so rays stay clean.\n if (uFlowCurl > 0.0) {\n float n = fbm(p * 3.0) - 0.5;\n float curlAmt = uFlowCurl;\n if (uFlowPattern == 1) curlAmt *= 0.25; // radial: preserve ray clarity\n if (uFlowPattern == 2) curlAmt *= 0.55; // swirl: allow moderate curl\n float a = atan(dir.y, dir.x) + n * 3.14159 * curlAmt;\n dir = vec2(cos(a), sin(a));\n }\n // cursor influence — swirl around the cursor position\n if (uCursorStrength > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.5));\n // swirl tangent\n vec2 tangent = vec2(-toCur.y, toCur.x) / max(d, 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(tangent.y, tangent.x);\n // blend angle\n float da = a1 - a0;\n da = atan(sin(da), cos(da)); // wrap to [-pi, pi]\n float a = a0 + da * w * uCursorStrength;\n dir = vec2(cos(a), sin(a));\n }\n return dir;\n}\n\n// ── Color utils ───────────────────────────────────────────────────────────\nconst vec3 W_LUMA = vec3(0.2126, 0.7152, 0.0722);\n\nvec3 hueShift(vec3 c, float degrees) {\n float a = radians(degrees);\n float co = cos(a), si = sin(a);\n mat3 m = mat3(\n 0.299 + 0.701 * co + 0.168 * si,\n 0.587 - 0.587 * co + 0.330 * si,\n 0.114 - 0.114 * co - 0.497 * si,\n\n 0.299 - 0.299 * co - 0.328 * si,\n 0.587 + 0.413 * co + 0.035 * si,\n 0.114 - 0.114 * co + 0.292 * si,\n\n 0.299 - 0.300 * co + 1.250 * si,\n 0.587 - 0.588 * co - 1.050 * si,\n 0.114 + 0.886 * co - 0.203 * si\n );\n return m * c;\n}\n\nvec3 brokenColorJitter(vec3 c, float hueSeed, float valueSeed, float strength) {\n float amt = clamp(uBrokenColor * strength, 0.0, 1.0);\n if (amt <= 0.001) return c;\n float hueDeg = (hueSeed - 0.5) * 32.0 * amt;\n float valueMul = 1.0 + (valueSeed - 0.5) * 0.28 * amt;\n return max(hueShift(c, hueDeg) * valueMul, vec3(0.0));\n}\n\nvec3 saturate3(vec3 c, float amt) {\n float l = dot(c, W_LUMA);\n return mix(vec3(l), c, amt);\n}\n\n// ACES approximation\nvec3 aces(vec3 x) {\n float a = 2.51;\n float b = 0.03;\n float c = 2.43;\n float d = 0.59;\n float e = 0.14;\n return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0.0, 1.0);\n}\n\n// ── Medium overlays ───────────────────────────────────────────────────────\n\n// A quick re-computation of base color for edge-mask sampling\nvec3 sampleBase(vec2 p, float t) {\n vec2 pw = domainWarp(p, t);\n float id; float vm;\n nucleiField(pw, t, id, vm);\n vec3 c = samplePalette(id);\n c *= 1.0 + uValueVariance * vm;\n return c;\n}\n\nvec3 mediumWatercolor(vec3 col, vec2 p, float t) {\n // Wet-edge cauliflowers via luma-gradient magnitude\n float eps = 0.004;\n vec3 cx1 = sampleBase(p + vec2(eps, 0.0), t);\n vec3 cx2 = sampleBase(p - vec2(eps, 0.0), t);\n vec3 cy1 = sampleBase(p + vec2(0.0, eps), t);\n vec3 cy2 = sampleBase(p - vec2(0.0, eps), t);\n float gx = dot(cx1 - cx2, W_LUMA);\n float gy = dot(cy1 - cy2, W_LUMA);\n float edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n float mask = smoothstep(0.0, 2.5, edge);\n col *= mix(1.0, 0.78, mask * uWetEdge);\n\n // Granulation — pigment settles in paper tooth\n float paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n float pigLoad = 1.0 - dot(col, W_LUMA);\n col *= 1.0 - uGranulation * pigLoad * (paper - 0.5);\n\n // Wash banding — faint horizontal wet gradient\n float band = fbm(vec2(p.x * 1.5, p.y * 0.4));\n col *= 1.0 + 0.04 * (band - 0.5);\n return col;\n}\n\nvec3 mediumPastel(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n vec2 perp = vec2(-flow.y, flow.x);\n float along = dot(p, flow) * uStrokeScale;\n float across = dot(p, perp) * uStrokeScale;\n across += 0.03 * (vnoise(p * 260.0) - 0.5);\n\n float aniso = mix(1.0, 0.18, uStrokeAnisotropy);\n float stroke = fbm(vec2(along * aniso, across));\n col *= mix(1.0, 0.82 + 0.32 * stroke, uStrokeAmount);\n\n // Pastel tooth — tiny high-frequency grain\n float tooth = vnoise(p * 800.0);\n col *= 1.0 - 0.08 * uStrokeAmount * (tooth - 0.5);\n return col;\n}\n\n// ── Curved swept brushstroke primitive ────────────────────────────────────\n// A stroke is a curved spine from A to B with quadratic bulge K (sideways offset\n// at midpoint). Width varies along length via a shape profile. Edge is ragged\n// (bristle-modulated), ends are rounded blobs, inside has streak modulation.\n//\n// For pixel p, we invert an approximate projection onto the curved spine:\n// 1) project p onto straight AB axis -> along0, cross0\n// 2) at parameter along0, spine offset = 4·K·along0·(1-along0) perpendicular\n// 3) cross = cross0 - spineOffset, refine along one iteration\n// Coverage blends paint atop col based on per-stroke color sampled from the\n// underlying base at spine midpoint — so overlapping strokes from different\n// palette regions meet at hard, ragged demarcations.\n\nstruct StrokeHit {\n float coverage; // 0..1\n vec3 color;\n float alongT; // 0..1 along spine, for internal modulation\n float crossN; // cross distance / current half-width, signed\n float edgeN; // distance to edge in half-widths (0 = at edge, 1 = at spine)\n};\n\nStrokeHit noHit() { return StrokeHit(0.0, vec3(0.0), 0.0, 0.0, 0.0); }\n\nvec2 rotateDir(vec2 dir, float angle) {\n float ca = cos(angle), sa = sin(angle);\n return vec2(dir.x * ca - dir.y * sa, dir.x * sa + dir.y * ca);\n}\n\nvec2 safeDir(vec2 dir) {\n float len = length(dir);\n return len > 1e-4 ? dir / len : vec2(1.0, 0.0);\n}\n\n// Shape profile along the stroke. type:\n// 0 tapered — thin-fat-thin (classic brush)\n// 1 load-drag — fat start, tapers to a point\n// 2 dab — ellipse-like, round center\n// 3 even — near-constant, slight end taper\nfloat strokeShape(float t, int type) {\n t = clamp(t, 0.0, 1.0);\n if (type == 1) {\n // loaded at t=0, tapering\n return pow(1.0 - t, 0.55) * smoothstep(0.0, 0.08, t);\n } else if (type == 2) {\n // dab / blob\n float d = t - 0.5;\n return exp(-d * d * 12.0);\n } else if (type == 3) {\n // mostly even, slight end softening\n return smoothstep(0.0, 0.08, t) * smoothstep(1.0, 0.92, t) * 0.95 + 0.05;\n }\n // 0 tapered\n return smoothstep(0.0, 0.22, t) * smoothstep(1.0, 0.78, t);\n}\n\n// A single curved stroke.\n// a, b — endpoints\n// halfW — base half-width (world units)\n// bulge — signed perpendicular midpoint offset, in world units\n// shapeType — 0..3\n// bristleFreq — spatial frequency of edge raggedness\n// bristleAmp — 0..0.5 fraction of halfW chewed away at edge extrema\n// streakSeed — uniqueness seed for internal streaks\n// colAtMid — pre-sampled color at midpoint\nStrokeHit curvedStroke(vec2 p, vec2 a, vec2 b, float halfW,\n float bulge, int shapeType,\n float bristleFreq, float bristleAmp,\n float streakSeed, vec3 colAtMid) {\n vec2 ab = b - a;\n float L = length(ab);\n if (L < 1e-5) return noHit();\n vec2 tang = ab / L;\n vec2 norm = vec2(-tang.y, tang.x);\n\n vec2 rel = p - a;\n float along0 = dot(rel, tang) / L; // straight projection 0..1 along AB\n float cross0 = dot(rel, norm); // signed cross\n\n // Spine sideways offset due to bulge (parabolic)\n float bend = 4.0 * bulge * along0 * (1.0 - along0);\n float cross1 = cross0 - bend;\n\n // One refinement step: as the spine bends, the closest-point along shifts.\n // Spine tangent differs from straight tangent; first-order correction:\n float dBend = 4.0 * bulge * (1.0 - 2.0 * along0); // d(bend)/d(along)\n float along1 = along0 + (cross1 * dBend) / (L * (1.0 + dBend * dBend / (L * L)));\n\n // Bristle-ragged edge: half-width gets chewed by 1D noise along the spine\n float edgeNoise = fbm(vec2(along1 * bristleFreq, streakSeed * 7.3)) - 0.5;\n float edgeNoise2 = fbm(vec2(along1 * bristleFreq * 2.3, streakSeed * 3.1 + 17.0)) - 0.5;\n float edgeMod = 1.0 - bristleAmp * (0.6 + 0.4 * edgeNoise) * (0.5 + edgeNoise2);\n\n // Width profile along the stroke\n float shape = strokeShape(along1, shapeType);\n float halfWNow = halfW * shape * edgeMod;\n\n // Inside-segment coverage\n float cov = 0.0;\n if (along1 >= 0.0 && along1 <= 1.0 && halfWNow > 1e-6) {\n float cn = abs(cross1) / halfWNow;\n // razor-hard edge with tiny aa\n cov = 1.0 - smoothstep(0.88, 1.02, cn);\n }\n\n // End-cap blobs (rounded tips, not perpendicular cuts)\n float capA = 0.0, capB = 0.0;\n {\n vec2 capCenterA = a + norm * (bulge * 0.0); // at a\n vec2 capCenterB = a + tang * L + norm * bend * 0.0 + norm * 0.0; // at b; bend is 0 at endpoints\n capCenterB = b;\n float endShapeA = strokeShape(0.02, shapeType);\n float endShapeB = strokeShape(0.98, shapeType);\n float rA = halfW * endShapeA * (0.9 + 0.2 * fbm(vec2(streakSeed * 13.0)));\n float rB = halfW * endShapeB * (0.9 + 0.2 * fbm(vec2(streakSeed * 19.0 + 5.0)));\n float dA = length(p - capCenterA);\n float dB = length(p - capCenterB);\n capA = 1.0 - smoothstep(rA * 0.85, rA * 1.05, dA);\n capB = 1.0 - smoothstep(rB * 0.85, rB * 1.05, dB);\n // Only apply caps if we're BEYOND the segment; otherwise the segment wins.\n capA *= (along1 < 0.05) ? 1.0 : 0.0;\n capB *= (along1 > 0.95) ? 1.0 : 0.0;\n }\n\n float coverage = max(cov, max(capA, capB));\n if (coverage < 0.002) return noHit();\n\n // Edge distance (for impasto later): 0 at edge, 1 at spine\n float edgeDist = halfWNow > 1e-6 ? clamp(1.0 - abs(cross1) / halfWNow, 0.0, 1.0) : 0.0;\n\n return StrokeHit(\n coverage,\n colAtMid,\n clamp(along1, 0.0, 1.0),\n halfWNow > 1e-6 ? cross1 / halfWNow : 0.0,\n edgeDist\n );\n}\n\n// Composite stroke over col with internal streaking + impasto edge highlight.\n// streakAmp — 0..0.2 how much internal streaks darken/lighten\n// impastoAmp — 0..1 edge catch-light strength\n// hardness — 0..1 how crisp the compositing transition is (1 = razor, 0 = creamy)\nvoid paintOver(inout vec3 col, StrokeHit s, float streakFreq, float streakAmp,\n float impastoAmp, float hardness, float streakSeed) {\n if (s.coverage < 0.002) return;\n float strokeOpacity = clamp(uStrokeAmount, 0.0, 1.0);\n if (strokeOpacity <= 0.001) return;\n vec3 c = s.color;\n\n // Internal streaks — fbm along spine, modulated by cross position. Gives\n // the loaded-brush look: some bristles carry more pigment than others.\n float streakA = fbm(vec2(s.alongT * streakFreq, s.crossN * 2.7 + streakSeed));\n float streakB = fbm(vec2(s.alongT * streakFreq * 0.6 + streakSeed * 3.7, s.crossN * 4.1));\n float streak = 0.6 * (streakA - 0.5) + 0.4 * (streakB - 0.5);\n c *= 1.0 + streak * streakAmp * 2.0;\n\n // Subtle value variance across width (hollow-center catch-light)\n float crossShade = smoothstep(0.0, 0.4, s.edgeN) * (1.0 - smoothstep(0.65, 1.0, s.edgeN));\n c *= 1.0 + crossShade * 0.05;\n\n // Impasto edge highlight — bright rim on one side of the stroke\n float rim = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, s.crossN);\n c += impastoAmp * rim * vec3(0.18, 0.15, 0.11);\n // Shadow on the other side (darker, cooler)\n float shadow = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, -s.crossN);\n c -= impastoAmp * shadow * 0.25 * vec3(0.10, 0.09, 0.07);\n\n float softLimit = mix(0.35, 0.98, hardness);\n float alpha = smoothstep(0.0, 1.0 - softLimit, s.coverage) * strokeOpacity;\n col = mix(col, c, alpha);\n}\n\n// Best-of-9-neighbor placement: sample 3x3 surrounding cells and take the\n// stroke that covers this pixel most. Breaks the grid by per-cell jitter and\n// sparse density via noise thresholding.\nStrokeHit bestOil(vec2 p, float cellSize, float lenMul, float halfWMul,\n float jitterAmt, float density, int shapeType,\n float bristleAmp, vec2 flow, float t, float seed) {\n vec2 cell = floor(p / cellSize);\n\n StrokeHit best = noHit();\n // 3x3 neighborhood\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n vec2 hh = hash22(cc + seed) - 0.5;\n // Density gate — noise threshold; sparse placement.\n float gate = hash21(cc * 1.7 + seed * 0.3);\n if (gate > density) continue;\n\n vec2 center = (cc + 0.5 + hh * jitterAmt) * cellSize;\n\n // Per-stroke direction: consume the layer-provided flow, then add only\n // deterministic local perturbation so alternate stroke layers stay live.\n vec2 f = safeDir(flow);\n float angJ = (hash21(cc + seed + 11.0) - 0.5) * 0.9; // +/- 0.45 rad\n float localCurl = (fbm(center * (2.6 + seed * 0.11) + seed * 1.9) - 0.5) * 0.55 * uFlowCurl;\n vec2 dir = rotateDir(f, angJ + localCurl);\n\n float lenV = cellSize * lenMul * (0.65 + 0.55 * hash21(cc + seed + 23.0));\n float halfW = cellSize * halfWMul * (0.70 + 0.55 * hash21(cc + seed + 41.0));\n float bulge = (hash21(cc + seed + 53.0) - 0.5) * lenV * 0.35;\n\n vec2 a = center - dir * (lenV * 0.5);\n vec2 b = center + dir * (lenV * 0.5);\n\n vec3 colMid = brokenColorJitter(\n sampleBase(center, t),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n StrokeHit h = curvedStroke(p, a, b, halfW, bulge, shapeType,\n 7.0, bristleAmp,\n hash21(cc + seed + 67.0), colMid);\n if (h.coverage > best.coverage) best = h;\n }\n }\n return best;\n}\n\n// ── Crayon / oil-pastel — paper tooth × wax pigment ───────────────────────\n// Crayon is not strokes. It's pigment crumbs dragged across paper tooth.\n// Model: heavy 2D tooth noise at multiple scales, anisotropically stretched\n// along flow direction, multiplied into the base color. Add a slow \"waxy\n// film\" that slightly unifies hues, and occasional darker \"pressed\" spots\n// where the crayon dug in. NO straight segments.\nvec3 mediumOil_crayon(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n float ang = atan(flow.y, flow.x);\n float ca = cos(-ang), sa = sin(-ang);\n vec2 pr = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n // Anisotropic tooth — squished along flow, coarse cross flow.\n float aniso = mix(0.45, 0.95, uStrokeAnisotropy);\n float scale = max(uStrokeScale * 1.6, 180.0);\n\n float t1 = vnoise(vec2(pr.x * scale * aniso, pr.y * scale));\n float t2 = vnoise(vec2(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + 11.0);\n float t3 = vnoise(vec2(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + 23.0);\n float tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n // Center at 0, amplify\n tooth = (tooth - 0.5) * 1.4;\n\n // Multiplicative darkening where tooth is low (pigment skipped paper valleys)\n float lay = 1.0 + tooth * 0.32 * uStrokeAmount;\n vec3 result = col * lay;\n\n // Occasional pressed-in crumbs — rare darker crumbs\n float crumbs = smoothstep(0.78, 0.95, vnoise(pr * scale * 3.0));\n result *= 1.0 - crumbs * 0.18 * uStrokeAmount;\n\n // Waxy highlight film — slight lightening on tooth peaks\n float waxy = smoothstep(0.55, 0.85, t1);\n result += waxy * 0.04 * vec3(1.0);\n\n // Paper tooth overlay (subtler than oil's canvas)\n float paperTooth = vnoise(p * 340.0) - 0.5;\n result *= 1.0 + paperTooth * 0.14 * uCanvasGrain;\n\n // Broken-color pigment: stable wax/pigment patches, not temporal flicker.\n vec2 pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n float pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + 19.0));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + 17.0),\n hash21(pigmentCell * 2.1 + 31.0),\n 0.45 + 0.55 * pigmentMask\n );\n\n // Crayon is saturation-amplified\n result = saturate3(result, 1.12);\n\n return result;\n}\n\nvec3 mediumOil(vec3 col, vec2 p, float t) {\n // Mode knobs (uStrokeMode):\n // 0 oil — balanced modern-abstract/palette-knife hybrid\n // 1 knife — palette-knife impasto: razor edges, heavy bristle/shadow\n // 2 crayon — soft-edged wax smudges on tooth (no straight segments)\n // 3 brushwork — thick bristle brush\n int mode = uStrokeMode;\n\n // Per-mode parameters\n int shapeType = 0; // tapered\n float bristleAmp = 0.25; // 0..0.5\n float streakFreq = 9.0;\n float streakAmp = 0.09;\n float impastoAmp = 0.9;\n float hardness = 0.80; // edge compositing\n float toothScale = 240.0;\n float toothAmp = 0.09;\n float pigmentSat = 1.03;\n float densityBig = 0.65;\n float densityMed = 0.78;\n float densitySml = 0.90;\n\n if (mode == 1) { // palette knife\n shapeType = 3; // flat, even\n bristleAmp = 0.12;\n streakFreq = 4.0; streakAmp = 0.05;\n impastoAmp = 1.6;\n hardness = 0.95;\n toothAmp = 0.04;\n densityBig = 0.80; densityMed = 0.88; densitySml = 0.70;\n } else if (mode == 2) { // crayon — handled specially below\n return mediumOil_crayon(col, p, t);\n } else if (mode == 3) { // thick brushwork\n shapeType = 0; // tapered\n bristleAmp = 0.32;\n streakFreq = 14.0; streakAmp = 0.14;\n impastoAmp = 1.2;\n hardness = 0.85;\n toothAmp = 0.07;\n }\n\n // Scales & multipliers from uniforms\n float baseScale = max(uStrokeScale * 0.006, 0.008);\n // Three layers: big gestural, medium body, small dabs\n float sBig = baseScale * 2.4;\n float sMed = baseScale * 1.1;\n float sSml = baseScale * 0.45;\n\n float lenMulBig = mix(2.2, 3.8, uStrokeAnisotropy);\n float widMulBig = mix(0.55, 0.32, uStrokeAnisotropy);\n float lenMulMed = mix(2.0, 3.4, uStrokeAnisotropy);\n float widMulMed = mix(0.50, 0.30, uStrokeAnisotropy);\n float lenMulSml = mix(1.6, 2.6, uStrokeAnisotropy);\n float widMulSml = mix(0.45, 0.32, uStrokeAnisotropy);\n\n float jitterAmt = 0.75; // large jitter — no grid\n vec2 flow = flowField(p, t);\n\n vec3 result = col;\n\n // Layer 1 — big gestural strokes (sparse, shaping)\n StrokeHit hBig = bestOil(p, sBig, lenMulBig, widMulBig, jitterAmt * 0.55,\n densityBig, shapeType, bristleAmp, flow, t, 1.3);\n paintOver(result, hBig, streakFreq * 0.7, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 1.3);\n\n // Layer 2 — medium body strokes\n StrokeHit hMed = bestOil(p + vec2(11.3, 3.7), sMed, lenMulMed, widMulMed,\n jitterAmt, densityMed, shapeType, bristleAmp, flow, t, 2.7);\n paintOver(result, hMed, streakFreq, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 2.7);\n\n // Layer 3 — small dabs (more frequent, smaller)\n int smlShape = (mode == 1) ? 2 : shapeType; // knife uses dabs for sparkle\n StrokeHit hSml = bestOil(p + vec2(-5.1, 8.4), sSml, lenMulSml, widMulSml,\n jitterAmt * 1.3, densitySml, smlShape,\n bristleAmp * 0.85, flow, t, 4.1);\n paintOver(result, hSml, streakFreq * 1.4, streakAmp * 0.8,\n uImpasto * impastoAmp * 0.65 * uStrokeAmount, hardness, 4.1);\n\n // Layer 4 — fill dabs (very dense, very small) — covers bald spots\n float sFill = baseScale * 0.22;\n float lenMulFill = mix(1.4, 2.0, uStrokeAnisotropy);\n float widMulFill = mix(0.50, 0.38, uStrokeAnisotropy);\n int fillShape = (mode == 1) ? 3 : 2; // knife=even, others=dab (round fills)\n StrokeHit hFill = bestOil(p + vec2(3.9, -6.2), sFill, lenMulFill, widMulFill,\n jitterAmt * 1.5, 0.95, fillShape,\n bristleAmp * 0.6, flow, t, 8.9);\n paintOver(result, hFill, streakFreq * 1.8, streakAmp * 0.6,\n uImpasto * impastoAmp * 0.4 * uStrokeAmount, hardness * 0.9, 8.9);\n\n // Optional crosshatch layer\n if (uStrokeLayers == 2) {\n vec2 flow2 = vec2(-flow.y, flow.x);\n StrokeHit hX = bestOil(p + vec2(7.3, -2.1), sMed, lenMulMed * 0.9, widMulMed,\n jitterAmt, densityMed * 0.7, shapeType, bristleAmp, flow2, t, 6.5);\n paintOver(result, hX, streakFreq, streakAmp * 0.85,\n uImpasto * impastoAmp * 0.55 * uStrokeAmount, hardness, 6.5);\n }\n\n // Canvas tooth — linen weave\n float tooth1 = vnoise(p * toothScale);\n float tooth2 = vnoise(p * toothScale * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * toothAmp * uCanvasGrain;\n\n // Pigment saturation boost\n result = saturate3(result, pigmentSat);\n\n return result;\n}\n\n// ── Main ──────────────────────────────────────────────────────────────────\nvoid main() {\n // Normalized 0..1 coordinates for nuclei, domain warp, and medium sampling.\n vec2 uv = vUv;\n vec2 pN = uv;\n\n float t = uTime;\n\n // Warp in pN space\n vec2 p_warp = domainWarp(pN, t);\n\n // Composition\n float paletteId; float valueMod;\n nucleiField(p_warp, t, paletteId, valueMod);\n vec3 col = samplePalette(paletteId);\n col *= 1.0 + uValueVariance * valueMod;\n\n // Breath — slow global luminance wobble\n float breath = sin(t * 6.2831 / max(uBreathPeriod, 1.0));\n col *= 1.0 + uBreathDepth * breath * 0.5;\n\n // Medium\n if (uMedium == 1) col = mediumPastel(col, pN, t);\n else if (uMedium == 2) col = mediumWatercolor(col, pN, t);\n else if (uMedium == 3) col = mediumOil(col, pN, t);\n\n // Saturation trim\n col = saturate3(col, uSaturation);\n\n // Tonemap + film grain\n col = aces(col);\n float grain = hash21(gl_FragCoord.xy + t * 17.0);\n col += (grain - 0.5) * uPaperGrain;\n\n col = clamp(col * 0.985 + 0.008, 0.0, 1.0);\n fragColor = vec4(col * uAlpha, uAlpha);\n}\n";
2
+ import { a as t, i as n, n as r, o as i, r as a, t as o } from "./compile-DVgAxagk.js";
3
+ import { n as s, r as c, t as l } from "./presets-1OhFpaIC.js";
4
+ import { a as u, r as d, t as f } from "./color-rkK4RMx2.js";
5
+ import { t as p } from "./useIntersectionPause-DAdVPVp4.js";
6
+ import { computed as m, createElementBlock as h, createElementVNode as g, defineComponent as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, readonly as C, ref as w, unref as ee, watch as T } from "vue";
7
+ import { gamutMapOKLab as E, isInSRGBGamut as D, oklabToLinearSRGB as O, rawOklabToOklch as k, rawOklchToOklab as A, srgbToOKLab as te } from "@mkbabb/value.js";
8
+ //#region src/components/custom/aurora/constants/shaders/aurora.vert.ts
9
+ var ne = "#version 300 es\nin vec2 aPos;\nout vec2 vUv;\nvoid main() {\n vUv = aPos * 0.5 + 0.5;\n gl_Position = vec4(aPos, 0.0, 1.0);\n}", re = "// ── Palette LUT ───────────────────────────────────────────────────────────\nvec3 samplePalette(float id) {\n id = clamp(id, 0.0, 1.0);\n float scaled = id * float(uStopCount - 1);\n int i0 = int(floor(scaled));\n int i1 = min(i0 + 1, uStopCount - 1);\n float t = fract(scaled);\n t = smoothstep(0.0, 1.0, t);\n return mix(uPalette[i0], uPalette[i1], t);\n}\n\n// ── Nuclei field ──────────────────────────────────────────────────────────\nvoid nucleiField(vec2 p, float t, out float paletteId, out float valueMod) {\n float accumBias = 0.0;\n float accumValue = 0.0;\n float accumW = 0.0;\n for (int i = 0; i < MAX_NUCLEI; i++) {\n if (i >= uNucleiCount) break;\n vec2 posI = uNucleiPos[i]\n + uNucleiDriftRadius[i] * vec2(\n cos(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i]),\n sin(t * uNucleiDrift * K_NUCLEI + uNucleiDriftPhase[i] * 1.13)\n );\n vec2 diff = p - posI;\n // Anisotropic Gaussian: rotate diff into the nucleus's local frame\n // (major axis along uNucleiAngle), then scale the major-axis component by\n // 1/elongation so the squared distance describes an ellipse. Defaults\n // 1.0/0.0 reduce to the isotropic dot(diff, diff).\n float ca = cos(uNucleiAngle[i]);\n float sa = sin(uNucleiAngle[i]);\n vec2 local = vec2( ca * diff.x + sa * diff.y,\n -sa * diff.x + ca * diff.y);\n float along = local.x / max(uNucleiElong[i], 0.01);\n float across = local.y;\n float d2 = along * along + across * across;\n float r = max(uNucleiRadius[i], 0.01);\n float w = exp(-uSoftmaxBeta * d2 / (r * r));\n accumBias += w * uNucleiPaletteBias[i];\n accumValue += w * uNucleiValueBias[i];\n accumW += w;\n }\n paletteId = accumBias / max(accumW, 1e-4);\n valueMod = accumValue / max(accumW, 1e-4);\n\n // Palette drift — slow global paletteId breathe between adjacent stops. The\n // rate rides K_PAL (perceptible ~30–60s hue cycle at the default coefficient);\n // the amplitude lifts the authored coefficient into a 0.03..0.06 paletteId band\n // so the palette visibly travels rather than dithering within one stop.\n float palAmp = clamp(uPaletteDrift * 6.0, 0.0, 0.06);\n paletteId += palAmp * sin(t * uPaletteDrift * K_PAL);\n paletteId = clamp(paletteId, 0.0, 1.0);\n}\n", ie = "// ── Flow field ────────────────────────────────────────────────────────────\nvec2 flowField(vec2 p, float t) {\n vec2 dir = vec2(1.0, 0.0);\n if (uFlowPattern == 1) {\n // radial\n dir = normalize(p - uFlowFocal + 1e-4);\n } else if (uFlowPattern == 2) {\n // swirl — tangent to radial\n vec2 rad = normalize(p - uFlowFocal + 1e-4);\n dir = vec2(-rad.y, rad.x);\n } else if (uFlowPattern == 3) {\n // diagonal\n float a = radians(uFlowAngle);\n dir = vec2(cos(a), sin(a));\n } else if (uFlowPattern == 4) {\n // multi — curl-noise driven\n float n = fbm(p * 2.0 + t * 0.02);\n float a = n * 6.2831;\n dir = vec2(cos(a), sin(a));\n }\n // curl — perturb by noise. Radial gets much less curl so rays stay clean.\n if (uFlowCurl > 0.0) {\n float n = fbm(p * 3.0) - 0.5;\n float curlAmt = uFlowCurl;\n if (uFlowPattern == 1) curlAmt *= 0.25; // radial: preserve ray clarity\n if (uFlowPattern == 2) curlAmt *= 0.55; // swirl: allow moderate curl\n float a = atan(dir.y, dir.x) + n * 3.14159 * curlAmt;\n dir = vec2(cos(a), sin(a));\n }\n // cursor influence — swirl around the cursor position\n if (uCursorStrength > 0.001) {\n vec2 toCur = uCursor - p;\n float d = length(toCur);\n float r = max(uCursorRadius, 0.01);\n float w = exp(-(d * d) / (r * r * 0.5));\n // swirl tangent\n vec2 tangent = vec2(-toCur.y, toCur.x) / max(d, 1e-4);\n float a0 = atan(dir.y, dir.x);\n float a1 = atan(tangent.y, tangent.x);\n // blend angle\n float da = a1 - a0;\n da = atan(sin(da), cos(da)); // wrap to [-pi, pi]\n float a = a0 + da * w * uCursorStrength;\n dir = vec2(cos(a), sin(a));\n }\n return dir;\n}\n", ae = "// ACES approximation\nvec3 aces(vec3 x) {\n float a = 2.51;\n float b = 0.03;\n float c = 2.43;\n float d = 0.59;\n float e = 0.14;\n return clamp((x * (a * x + b)) / (x * (c * x + d) + e), 0.0, 1.0);\n}\n", oe = "// ── Curved swept brushstroke primitive ────────────────────────────────────\n// A stroke is a curved spine from A to B with quadratic bulge K (sideways offset\n// at midpoint). Width varies along length via a shape profile. Edge is ragged\n// (bristle-modulated), ends are rounded blobs, inside has streak modulation.\n//\n// For pixel p, we invert an approximate projection onto the curved spine:\n// 1) project p onto straight AB axis -> along0, cross0\n// 2) at parameter along0, spine offset = 4·K·along0·(1-along0) perpendicular\n// 3) cross = cross0 - spineOffset, refine along one iteration\n// Coverage blends paint atop col based on per-stroke color sampled from the\n// underlying base at spine midpoint — so overlapping strokes from different\n// palette regions meet at hard, ragged demarcations.\n\nstruct StrokeHit {\n float coverage; // 0..1\n vec3 color;\n float alongT; // 0..1 along spine, for internal modulation\n float crossN; // cross distance / current half-width, signed\n float edgeN; // distance to edge in half-widths (0 = at edge, 1 = at spine)\n};\n\nStrokeHit noHit() { return StrokeHit(0.0, vec3(0.0), 0.0, 0.0, 0.0); }\n\nvec2 rotateDir(vec2 dir, float angle) {\n float ca = cos(angle), sa = sin(angle);\n return vec2(dir.x * ca - dir.y * sa, dir.x * sa + dir.y * ca);\n}\n\nvec2 safeDir(vec2 dir) {\n float len = length(dir);\n return len > 1e-4 ? dir / len : vec2(1.0, 0.0);\n}\n\n// Shape profile along the stroke. type:\n// 0 tapered — thin-fat-thin (classic brush)\n// 1 load-drag — fat start, tapers to a point\n// 2 dab — ellipse-like, round center\n// 3 even — near-constant, slight end taper\nfloat strokeShape(float t, int type) {\n t = clamp(t, 0.0, 1.0);\n if (type == 1) {\n // loaded at t=0, tapering\n return pow(1.0 - t, 0.55) * smoothstep(0.0, 0.08, t);\n } else if (type == 2) {\n // dab / blob\n float d = t - 0.5;\n return exp(-d * d * 12.0);\n } else if (type == 3) {\n // mostly even, slight end softening\n return smoothstep(0.0, 0.08, t) * smoothstep(1.0, 0.92, t) * 0.95 + 0.05;\n }\n // 0 tapered\n return smoothstep(0.0, 0.22, t) * smoothstep(1.0, 0.78, t);\n}\n\n// A single curved stroke.\n// a, b — endpoints\n// halfW — base half-width (world units)\n// bulge — signed perpendicular midpoint offset, in world units\n// shapeType — 0..3\n// bristleFreq — spatial frequency of edge raggedness\n// bristleAmp — 0..0.5 fraction of halfW chewed away at edge extrema\n// streakSeed — uniqueness seed for internal streaks\n// colAtMid — pre-sampled color at midpoint\nStrokeHit curvedStroke(vec2 p, vec2 a, vec2 b, float halfW,\n float bulge, int shapeType,\n float bristleFreq, float bristleAmp,\n float streakSeed, vec3 colAtMid) {\n vec2 ab = b - a;\n float L = length(ab);\n if (L < 1e-5) return noHit();\n vec2 tang = ab / L;\n vec2 norm = vec2(-tang.y, tang.x);\n\n vec2 rel = p - a;\n float along0 = dot(rel, tang) / L; // straight projection 0..1 along AB\n float cross0 = dot(rel, norm); // signed cross\n\n // Spine sideways offset due to bulge (parabolic)\n float bend = 4.0 * bulge * along0 * (1.0 - along0);\n float cross1 = cross0 - bend;\n\n // One refinement step: as the spine bends, the closest-point along shifts.\n // Spine tangent differs from straight tangent; first-order correction:\n float dBend = 4.0 * bulge * (1.0 - 2.0 * along0); // d(bend)/d(along)\n float along1 = along0 + (cross1 * dBend) / (L * (1.0 + dBend * dBend / (L * L)));\n\n // Bristle-ragged edge: half-width gets chewed by 1D noise along the spine\n float edgeNoise = fbm(vec2(along1 * bristleFreq, streakSeed * 7.3)) - 0.5;\n float edgeNoise2 = fbm(vec2(along1 * bristleFreq * 2.3, streakSeed * 3.1 + 17.0)) - 0.5;\n float edgeMod = 1.0 - bristleAmp * (0.6 + 0.4 * edgeNoise) * (0.5 + edgeNoise2);\n\n // Width profile along the stroke\n float shape = strokeShape(along1, shapeType);\n float halfWNow = halfW * shape * edgeMod;\n\n // Inside-segment coverage\n float cov = 0.0;\n if (along1 >= 0.0 && along1 <= 1.0 && halfWNow > 1e-6) {\n float cn = abs(cross1) / halfWNow;\n // fwidth-derived AA: half-width from the field's screen-space gradient so the\n // edge holds ~1px regardless of zoom/DPR (mirrors metaball.frag.ts:252-255).\n float aaC = max(fwidth(cn), 1e-6);\n cov = 1.0 - smoothstep(1.0 - aaC, 1.0 + aaC, cn);\n }\n\n // End-cap blobs (rounded tips, not perpendicular cuts)\n float capA = 0.0, capB = 0.0;\n {\n vec2 capCenterA = a + norm * (bulge * 0.0); // at a\n vec2 capCenterB = a + tang * L + norm * bend * 0.0 + norm * 0.0; // at b; bend is 0 at endpoints\n capCenterB = b;\n float endShapeA = strokeShape(0.02, shapeType);\n float endShapeB = strokeShape(0.98, shapeType);\n float rA = halfW * endShapeA * (0.9 + 0.2 * fbm(vec2(streakSeed * 13.0)));\n float rB = halfW * endShapeB * (0.9 + 0.2 * fbm(vec2(streakSeed * 19.0 + 5.0)));\n float dA = length(p - capCenterA);\n float dB = length(p - capCenterB);\n // fwidth-derived AA on the clean Euclidean cap distances (mirrors metaball.frag.ts:252-255).\n float aaA = max(fwidth(dA), 1e-6);\n float aaB = max(fwidth(dB), 1e-6);\n capA = 1.0 - smoothstep(rA - aaA, rA + aaA, dA);\n capB = 1.0 - smoothstep(rB - aaB, rB + aaB, dB);\n // Only apply caps if we're BEYOND the segment; otherwise the segment wins.\n capA *= (along1 < 0.05) ? 1.0 : 0.0;\n capB *= (along1 > 0.95) ? 1.0 : 0.0;\n }\n\n float coverage = max(cov, max(capA, capB));\n if (coverage < 0.002) return noHit();\n\n // Edge distance (for impasto later): 0 at edge, 1 at spine\n float edgeDist = halfWNow > 1e-6 ? clamp(1.0 - abs(cross1) / halfWNow, 0.0, 1.0) : 0.0;\n\n return StrokeHit(\n coverage,\n colAtMid,\n clamp(along1, 0.0, 1.0),\n halfWNow > 1e-6 ? cross1 / halfWNow : 0.0,\n edgeDist\n );\n}\n\n// Composite stroke over col with internal streaking + impasto edge highlight.\n// streakAmp — 0..0.2 how much internal streaks darken/lighten\n// impastoAmp — 0..1 edge catch-light strength\n// hardness — 0..1 how crisp the compositing transition is (1 = razor, 0 = creamy)\nvoid paintOver(inout vec3 col, StrokeHit s, float streakFreq, float streakAmp,\n float impastoAmp, float hardness, float streakSeed) {\n if (s.coverage < 0.002) return;\n float strokeOpacity = clamp(uStrokeAmount, 0.0, 1.0);\n if (strokeOpacity <= 0.001) return;\n vec3 c = s.color;\n\n // Internal streaks — fbm along spine, modulated by cross position. Gives\n // the loaded-brush look: some bristles carry more pigment than others.\n float streakA = fbm(vec2(s.alongT * streakFreq, s.crossN * 2.7 + streakSeed));\n float streakB = fbm(vec2(s.alongT * streakFreq * 0.6 + streakSeed * 3.7, s.crossN * 4.1));\n float streak = 0.6 * (streakA - 0.5) + 0.4 * (streakB - 0.5);\n c *= 1.0 + streak * streakAmp * 2.0;\n\n // Subtle value variance across width (hollow-center catch-light)\n float crossShade = smoothstep(0.0, 0.4, s.edgeN) * (1.0 - smoothstep(0.65, 1.0, s.edgeN));\n c *= 1.0 + crossShade * 0.05;\n\n // Impasto edge highlight — bright rim on one side of the stroke\n float rim = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, s.crossN);\n c += impastoAmp * rim * vec3(0.18, 0.15, 0.11);\n // Shadow on the other side (darker, cooler)\n float shadow = smoothstep(0.85, 1.0, 1.0 - s.edgeN) * step(0.0, -s.crossN);\n c -= impastoAmp * shadow * 0.25 * vec3(0.10, 0.09, 0.07);\n\n float softLimit = mix(0.35, 0.98, hardness);\n float alpha = smoothstep(0.0, 1.0 - softLimit, s.coverage) * strokeOpacity;\n col = mix(col, c, alpha);\n}\n\n// Best-of-9-neighbor placement: sample 3x3 surrounding cells and take the\n// stroke that covers this pixel most. Breaks the grid by per-cell jitter and\n// sparse density via noise thresholding.\nStrokeHit bestOil(vec2 p, float cellSize, float lenMul, float halfWMul,\n float jitterAmt, float density, int shapeType,\n float bristleAmp, vec2 flow, float t, float seed) {\n vec2 cell = floor(p / cellSize);\n\n StrokeHit best = noHit();\n // 3x3 neighborhood\n for (int dy = -1; dy <= 1; dy++) {\n for (int dx = -1; dx <= 1; dx++) {\n vec2 cc = cell + vec2(float(dx), float(dy));\n vec2 hh = hash22(cc + seed) - 0.5;\n // Density gate — noise threshold; sparse placement.\n float gate = hash21(cc * 1.7 + seed * 0.3);\n if (gate > density) continue;\n\n vec2 center = (cc + 0.5 + hh * jitterAmt) * cellSize;\n\n // Per-stroke direction: consume the layer-provided flow, then add only\n // deterministic local perturbation so alternate stroke layers stay live.\n vec2 f = safeDir(flow);\n float angJ = (hash21(cc + seed + 11.0) - 0.5) * 0.9; // +/- 0.45 rad\n float localCurl = (fbm(center * (2.6 + seed * 0.11) + seed * 1.9) - 0.5) * 0.55 * uFlowCurl;\n vec2 dir = rotateDir(f, angJ + localCurl);\n\n float lenV = cellSize * lenMul * (0.65 + 0.55 * hash21(cc + seed + 23.0));\n float halfW = cellSize * halfWMul * (0.70 + 0.55 * hash21(cc + seed + 41.0));\n float bulge = (hash21(cc + seed + 53.0) - 0.5) * lenV * 0.35;\n\n vec2 a = center - dir * (lenV * 0.5);\n vec2 b = center + dir * (lenV * 0.5);\n\n vec3 colMid = brokenColorJitter(\n sampleBase(center, t),\n hash21(cc + seed + 89.0),\n hash21(cc * 2.3 + seed + 97.0),\n 1.0\n );\n\n StrokeHit h = curvedStroke(p, a, b, halfW, bulge, shapeType,\n 7.0, bristleAmp,\n hash21(cc + seed + 67.0), colMid);\n if (h.coverage > best.coverage) best = h;\n }\n }\n return best;\n}\n", j = "// ── Medium overlays ───────────────────────────────────────────────────────\n\n// A quick re-computation of base color for edge-mask sampling\nvec3 sampleBase(vec2 p, float t) {\n vec2 pw = domainWarp(p, t);\n float id; float vm;\n nucleiField(pw, t, id, vm);\n vec3 c = samplePalette(id);\n c *= 1.0 + uValueVariance * vm;\n return c;\n}\n\nvec3 mediumWatercolor(vec3 col, vec2 p, float t) {\n // Wet-edge cauliflowers via luma-gradient magnitude\n float eps = 0.004;\n vec3 cx1 = sampleBase(p + vec2(eps, 0.0), t);\n vec3 cx2 = sampleBase(p - vec2(eps, 0.0), t);\n vec3 cy1 = sampleBase(p + vec2(0.0, eps), t);\n vec3 cy2 = sampleBase(p - vec2(0.0, eps), t);\n float gx = dot(cx1 - cx2, W_LUMA);\n float gy = dot(cy1 - cy2, W_LUMA);\n float edge = sqrt(gx * gx + gy * gy) / (2.0 * eps);\n float mask = smoothstep(0.0, 2.5, edge);\n col *= mix(1.0, 0.78, mask * uWetEdge);\n\n // Granulation — pigment settles in paper tooth\n float paper = 0.5 * vnoise(p * 160.0) + 0.5 * vnoise(p * 360.0);\n float pigLoad = 1.0 - dot(col, W_LUMA);\n col *= 1.0 - uGranulation * pigLoad * (paper - 0.5);\n\n // Wash banding — faint horizontal wet gradient\n float band = fbm(vec2(p.x * 1.5, p.y * 0.4));\n col *= 1.0 + 0.04 * (band - 0.5);\n return col;\n}\n\nvec3 mediumPastel(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n vec2 perp = vec2(-flow.y, flow.x);\n float along = dot(p, flow) * uStrokeScale;\n float across = dot(p, perp) * uStrokeScale;\n across += 0.03 * (vnoise(p * 260.0) - 0.5);\n\n float aniso = mix(1.0, 0.18, uStrokeAnisotropy);\n float stroke = fbm(vec2(along * aniso, across));\n col *= mix(1.0, 0.82 + 0.32 * stroke, uStrokeAmount);\n\n // Pastel tooth — tiny high-frequency grain\n float tooth = vnoise(p * 800.0);\n col *= 1.0 - 0.08 * uStrokeAmount * (tooth - 0.5);\n return col;\n}\n", M = "// ── Crayon / oil-pastel — paper tooth × wax pigment (PEER medium) ─────────\n// Crayon is not strokes. It's pigment crumbs dragged across paper tooth.\n// Model: heavy 2D tooth noise at multiple scales, anisotropically stretched\n// along flow direction, multiplied into the base color. Add a slow \"waxy\n// film\" that slightly unifies hues, and occasional darker \"pressed\" spots\n// where the crayon dug in. NO straight segments. Dispatched at main() level as\n// a peer of pastel/watercolor/oil — never a branch inside mediumOil().\nvec3 mediumCrayon(vec3 col, vec2 p, float t) {\n vec2 flow = flowField(p, t);\n float ang = atan(flow.y, flow.x);\n float ca = cos(-ang), sa = sin(-ang);\n vec2 pr = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca);\n\n // Anisotropic tooth — squished along flow, coarse cross flow.\n float aniso = mix(0.45, 0.95, uStrokeAnisotropy);\n float scale = max(uStrokeScale * 1.6, 180.0);\n\n float t1 = vnoise(vec2(pr.x * scale * aniso, pr.y * scale));\n float t2 = vnoise(vec2(pr.x * scale * aniso * 0.4, pr.y * scale * 0.4) + 11.0);\n float t3 = vnoise(vec2(pr.x * scale * aniso * 2.1, pr.y * scale * 2.1) + 23.0);\n float tooth = 0.55 * t1 + 0.30 * t2 + 0.15 * t3;\n // Center at 0, amplify\n tooth = (tooth - 0.5) * 1.4;\n\n // Multiplicative darkening where tooth is low (pigment skipped paper valleys)\n float lay = 1.0 + tooth * 0.32 * uStrokeAmount;\n vec3 result = col * lay;\n\n // Occasional pressed-in crumbs — rare darker crumbs\n float crumbs = smoothstep(0.78, 0.95, vnoise(pr * scale * 3.0));\n result *= 1.0 - crumbs * 0.18 * uStrokeAmount;\n\n // Waxy highlight film — slight lightening on tooth peaks\n float waxy = smoothstep(0.55, 0.85, t1);\n result += waxy * 0.04 * vec3(1.0);\n\n // Paper tooth overlay (subtler than oil's canvas)\n float paperTooth = vnoise(p * 340.0) - 0.5;\n result *= 1.0 + paperTooth * 0.14 * uCanvasGrain;\n\n // Broken-color pigment: stable wax/pigment patches, not temporal flicker.\n vec2 pigmentCell = floor(pr * max(scale * 0.18, 32.0));\n float pigmentMask = smoothstep(0.28, 0.82, vnoise(pr * scale * 0.21 + 19.0));\n result = brokenColorJitter(\n result,\n hash21(pigmentCell + 17.0),\n hash21(pigmentCell * 2.1 + 31.0),\n 0.45 + 0.55 * pigmentMask\n );\n\n // Crayon is saturation-amplified\n result = saturate3(result, 1.12);\n\n return result;\n}\n\nvec3 mediumOil(vec3 col, vec2 p, float t) {\n // Mode knobs (uStrokeMode) — oil-stroke modes ONLY (crayon is a peer medium,\n // uMedium==4, dispatched at main()):\n // 0 oil — balanced modern-abstract/palette-knife hybrid\n // 1 knife — palette-knife impasto: razor edges, heavy bristle/shadow\n // 3 brushwork — thick bristle brush\n int mode = uStrokeMode;\n\n // Per-mode parameters\n int shapeType = 0; // tapered\n float bristleAmp = 0.25; // 0..0.5\n float streakFreq = 9.0;\n float streakAmp = 0.09;\n float impastoAmp = 0.9;\n float hardness = 0.80; // edge compositing\n float toothScale = 240.0;\n float toothAmp = 0.09;\n float pigmentSat = 1.03;\n float densityBig = 0.65;\n float densityMed = 0.78;\n float densitySml = 0.90;\n\n if (mode == 1) { // palette knife\n shapeType = 3; // flat, even\n bristleAmp = 0.12;\n streakFreq = 4.0; streakAmp = 0.05;\n impastoAmp = 1.6;\n hardness = 0.95;\n toothAmp = 0.04;\n densityBig = 0.80; densityMed = 0.88; densitySml = 0.70;\n } else if (mode == 3) { // thick brushwork\n shapeType = 0; // tapered\n bristleAmp = 0.32;\n streakFreq = 14.0; streakAmp = 0.14;\n impastoAmp = 1.2;\n hardness = 0.85;\n toothAmp = 0.07;\n }\n\n // Scales & multipliers from uniforms\n float baseScale = max(uStrokeScale * 0.006, 0.008);\n // Three layers: big gestural, medium body, small dabs\n float sBig = baseScale * 2.4;\n float sMed = baseScale * 1.1;\n float sSml = baseScale * 0.45;\n\n float lenMulBig = mix(2.2, 3.8, uStrokeAnisotropy);\n float widMulBig = mix(0.55, 0.32, uStrokeAnisotropy);\n float lenMulMed = mix(2.0, 3.4, uStrokeAnisotropy);\n float widMulMed = mix(0.50, 0.30, uStrokeAnisotropy);\n float lenMulSml = mix(1.6, 2.6, uStrokeAnisotropy);\n float widMulSml = mix(0.45, 0.32, uStrokeAnisotropy);\n\n float jitterAmt = 0.75; // large jitter — no grid\n vec2 flow = flowField(p, t);\n\n vec3 result = col;\n\n // Layer 1 — big gestural strokes (sparse, shaping)\n StrokeHit hBig = bestOil(p, sBig, lenMulBig, widMulBig, jitterAmt * 0.55,\n densityBig, shapeType, bristleAmp, flow, t, 1.3);\n paintOver(result, hBig, streakFreq * 0.7, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 1.3);\n\n // Layer 2 — medium body strokes\n StrokeHit hMed = bestOil(p + vec2(11.3, 3.7), sMed, lenMulMed, widMulMed,\n jitterAmt, densityMed, shapeType, bristleAmp, flow, t, 2.7);\n paintOver(result, hMed, streakFreq, streakAmp,\n uImpasto * impastoAmp * uStrokeAmount, hardness, 2.7);\n\n // Layer 3 — small dabs (more frequent, smaller)\n int smlShape = (mode == 1) ? 2 : shapeType; // knife uses dabs for sparkle\n StrokeHit hSml = bestOil(p + vec2(-5.1, 8.4), sSml, lenMulSml, widMulSml,\n jitterAmt * 1.3, densitySml, smlShape,\n bristleAmp * 0.85, flow, t, 4.1);\n paintOver(result, hSml, streakFreq * 1.4, streakAmp * 0.8,\n uImpasto * impastoAmp * 0.65 * uStrokeAmount, hardness, 4.1);\n\n // Layer 4 — fill dabs (very dense, very small) — covers bald spots\n float sFill = baseScale * 0.22;\n float lenMulFill = mix(1.4, 2.0, uStrokeAnisotropy);\n float widMulFill = mix(0.50, 0.38, uStrokeAnisotropy);\n int fillShape = (mode == 1) ? 3 : 2; // knife=even, others=dab (round fills)\n StrokeHit hFill = bestOil(p + vec2(3.9, -6.2), sFill, lenMulFill, widMulFill,\n jitterAmt * 1.5, 0.95, fillShape,\n bristleAmp * 0.6, flow, t, 8.9);\n paintOver(result, hFill, streakFreq * 1.8, streakAmp * 0.6,\n uImpasto * impastoAmp * 0.4 * uStrokeAmount, hardness * 0.9, 8.9);\n\n // Optional crosshatch layer\n if (uStrokeLayers == 2) {\n vec2 flow2 = vec2(-flow.y, flow.x);\n StrokeHit hX = bestOil(p + vec2(7.3, -2.1), sMed, lenMulMed * 0.9, widMulMed,\n jitterAmt, densityMed * 0.7, shapeType, bristleAmp, flow2, t, 6.5);\n paintOver(result, hX, streakFreq, streakAmp * 0.85,\n uImpasto * impastoAmp * 0.55 * uStrokeAmount, hardness, 6.5);\n }\n\n // Canvas tooth — linen weave\n float tooth1 = vnoise(p * toothScale);\n float tooth2 = vnoise(p * toothScale * vec2(0.6, 2.4) + 37.0);\n float tooth = (0.6 * tooth1 + 0.4 * tooth2) - 0.5;\n result *= 1.0 + tooth * toothAmp * uCanvasGrain;\n\n // Pigment saturation boost\n result = saturate3(result, pigmentSat);\n\n return result;\n}", N = "\n", P = `#version 300 es
10
+ precision highp float;
11
+
12
+ in vec2 vUv;
13
+ out vec4 fragColor;
14
+
15
+ #define MAX_NUCLEI 6
16
+ #define MAX_STOPS 8
17
+
18
+ // ── Uniforms ───────────────────────────────────────────────────────────────
19
+ uniform float uTime;
20
+
21
+ // Palette baked CPU-side to linear-sRGB
22
+ uniform vec3 uPalette[MAX_STOPS];
23
+ uniform int uStopCount;
24
+
25
+ // Nuclei (parallel arrays)
26
+ uniform int uNucleiCount;
27
+ uniform vec2 uNucleiPos[MAX_NUCLEI];
28
+ uniform float uNucleiRadius[MAX_NUCLEI];
29
+ uniform float uNucleiPaletteBias[MAX_NUCLEI];
30
+ uniform float uNucleiValueBias[MAX_NUCLEI];
31
+ uniform float uNucleiDriftRadius[MAX_NUCLEI];
32
+ uniform float uNucleiDriftPhase[MAX_NUCLEI];
33
+ // Anisotropy: per-nucleus elongation (1.0 = isotropic) and major-axis angle (radians).
34
+ // Defaults (1.0 / 0.0) reduce to the original circular Gaussian.
35
+ uniform float uNucleiElong[MAX_NUCLEI];
36
+ uniform float uNucleiAngle[MAX_NUCLEI];
37
+ uniform float uSoftmaxBeta;
38
+ uniform float uValueVariance;
39
+
40
+ // Warp
41
+ uniform float uWarpAmount;
42
+ uniform float uWarpScale;
43
+ uniform float uWarpDrift;
44
+ uniform int uWarpMode; // 0=fbm 1=cellular 2=hybrid
45
+ uniform int uNoiseOctaves;
46
+
47
+ // Medium
48
+ // 0 smooth, 1 pastel, 2 watercolor, 3 oil, 4 crayon (peer medium — wax pigment
49
+ // on paper tooth; NOT an oil-stroke sub-mode, so it dispatches at main() level).
50
+ uniform int uMedium;
51
+ uniform int uFlowPattern; // 0 none, 1 radial, 2 swirl, 3 diagonal, 4 multi
52
+ uniform vec2 uFlowFocal;
53
+ uniform float uFlowAngle;
54
+ uniform float uFlowCurl;
55
+ uniform vec2 uCursor; // in 0..1 screen space (matches pN)
56
+ uniform float uCursorStrength; // 0..1 attraction amount
57
+ uniform float uCursorRadius; // radius of influence (0.05..0.5)
58
+ uniform float uStrokeAmount;
59
+ uniform float uStrokeScale;
60
+ uniform float uStrokeAnisotropy;
61
+ uniform int uStrokeLayers; // 1 or 2 (crosshatch)
62
+ uniform int uStrokeMode; // 0 oil (modern gestural), 1 palette-knife, 3 modern-chunky (crayon is uMedium==4, a peer medium)
63
+ uniform float uWetEdge;
64
+ uniform float uGranulation;
65
+ uniform float uImpasto;
66
+ uniform float uBrokenColor;
67
+ uniform float uCanvasGrain;
68
+
69
+ // Motion
70
+ uniform float uNucleiDrift;
71
+ uniform float uPaletteDrift;
72
+ uniform float uBreathDepth;
73
+ uniform float uBreathPeriod;
74
+
75
+ // Output
76
+ uniform float uSaturation;
77
+ uniform float uPaperGrain;
78
+ uniform float uAlpha;
79
+
80
+ // ── Time rate ────────────────────────────────────────────────────────────────
81
+ // The authoring coefficients (uNucleiDrift, uPaletteDrift, uWarpDrift) live in a
82
+ // human-friendly 0..~0.05 band — that scale is what the config schema and every
83
+ // demo preset are tuned against. But that band, multiplied straight into uTime
84
+ // (seconds), yields rad/sec rates so small the field reads visually static (one
85
+ // nuclei orbit took ~10 min at the old default). These K_* constants decouple
86
+ // the AUTHORING scale from the RAD/SEC scale: each time term wraps its coefficient
87
+ // in the matching K_, lifting the same authored value to a perceptible period
88
+ // without touching any preset. Tuned so the field reads SLOWLY ALIVE — drift over
89
+ // a ~5–15s window, never a frantic pan. These are downstream of uTime, which the
90
+ // runtime FREEZES under reduced-motion (t = frozenOffset) before the shader sees
91
+ // it, so the lift cannot leak motion into the reduced-motion path.
92
+ const float K_NUCLEI = 14.0; // nuclei orbit: ~one cycle per ~45s at default 0.01
93
+ const float K_PAL = 24.0; // palette hue breathe: ~one cycle per ~33s at default
94
+ const float K_WARP = 5.0; // domain warp scroll: a perceptible fbm-cell traverse
95
+
96
+ // ── Noise ──────────────────────────────────────────────────────────────────
97
+ float hash21(vec2 p) {
98
+ p = fract(p * vec2(123.34, 456.21));
99
+ p += dot(p, p + 45.32);
100
+ return fract(p.x * p.y);
101
+ }
102
+
103
+ vec2 hash22(vec2 p) {
104
+ p = vec2(dot(p, vec2(127.1, 311.7)),
105
+ dot(p, vec2(269.5, 183.3)));
106
+ return fract(sin(p) * 43758.5453);
107
+ }
108
+
109
+ float vnoise(vec2 p) {
110
+ vec2 i = floor(p);
111
+ vec2 f = fract(p);
112
+ vec2 u = f * f * (3.0 - 2.0 * f);
113
+ float a = hash21(i);
114
+ float b = hash21(i + vec2(1.0, 0.0));
115
+ float c = hash21(i + vec2(0.0, 1.0));
116
+ float d = hash21(i + vec2(1.0, 1.0));
117
+ return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
118
+ }
119
+
120
+ // The rotated-octave FBM rotation constant — spliced from the shared chunk (AV.W2
121
+ // — the one FBM_ROT). The loop below stays aurora-local (2.02 lacunarity +
122
+ // uniform-driven octaves, per §3a — only the rotation constant converges).
123
+ ${t}
124
+
125
+ float fbm(vec2 p) {
126
+ float v = 0.0;
127
+ float a = 0.5;
128
+ for (int i = 0; i < 5; i++) {
129
+ if (i >= uNoiseOctaves) break;
130
+ v += a * vnoise(p);
131
+ p = FBM_ROT * p * 2.02;
132
+ a *= 0.5;
133
+ }
134
+ return v;
135
+ }
136
+
137
+ // The sRGB OETF (linearToSrgb) — spliced from the shared procedural-color chunk
138
+ // (AV.W2 — the single OETF source; the AV.W1 local copy is deleted here). Aurora's
139
+ // linear pipeline closes the seam with this transfer before fragColor (the
140
+ // proof:aurora-space-gamma seam).
141
+ ${i}
142
+
143
+ // Interleaved Gradient Noise (Jimenez) — a 1-LSB triangular dither applied in
144
+ // DISPLAY space AFTER the OETF, so 8-bit mid-tone banding on the soft gradient is
145
+ // quantization-dithered at the value being quantized (post-transfer, not linear).
146
+ float ign(vec2 p) {
147
+ return fract(52.9829189 * fract(dot(p, vec2(0.06711056, 0.00583715))));
148
+ }
149
+
150
+ // Cellular / Worley f1
151
+ float cellular(vec2 p) {
152
+ vec2 i = floor(p);
153
+ vec2 f = fract(p);
154
+ float m = 1e9;
155
+ for (int y = -1; y <= 1; y++) {
156
+ for (int x = -1; x <= 1; x++) {
157
+ vec2 g = vec2(float(x), float(y));
158
+ vec2 o = hash22(i + g);
159
+ vec2 r = g + o - f;
160
+ m = min(m, dot(r, r));
161
+ }
162
+ }
163
+ return sqrt(m);
164
+ }
165
+
166
+ // ── Warp ──────────────────────────────────────────────────────────────────
167
+ vec2 domainWarp(vec2 p, float t) {
168
+ // Quilez canonical double warp
169
+ vec2 q = vec2(fbm(p * uWarpScale + vec2(0.0, 0.0) + t * uWarpDrift * K_WARP),
170
+ fbm(p * uWarpScale + vec2(5.2, 1.3) + t * uWarpDrift * K_WARP));
171
+ vec2 r = vec2(fbm(p * uWarpScale + 4.0 * q + vec2(1.7, 9.2)),
172
+ fbm(p * uWarpScale + 4.0 * q + vec2(8.3, 2.8)));
173
+
174
+ vec2 warp = r;
175
+ if (uWarpMode == 1) {
176
+ // cellular — chunky territories (MEADOW block-like)
177
+ float c1 = cellular(p * uWarpScale * 1.5 + vec2(t * uWarpDrift * K_WARP * 2.0, 0.0));
178
+ float c2 = cellular(p * uWarpScale * 1.5 + vec2(11.0, 7.0 + t * uWarpDrift * K_WARP * 2.0));
179
+ warp = vec2(c1, c2);
180
+ } else if (uWarpMode == 2) {
181
+ // hybrid — fbm + cellular averaged
182
+ float c1 = cellular(p * uWarpScale * 1.2);
183
+ float c2 = cellular(p * uWarpScale * 1.2 + vec2(11.0, 7.0));
184
+ warp = mix(r, vec2(c1, c2), 0.5);
185
+ }
186
+ vec2 warped = p + uWarpAmount * warp;
187
+
188
+ // Cursor swirl — rotate p around uCursor with radial falloff.
189
+ // This warps the underlying color field so the bands sweep around the pointer.
190
+ if (uCursorStrength > 0.001) {
191
+ vec2 toP = p - uCursor;
192
+ float d = length(toP);
193
+ float r = max(uCursorRadius, 0.01);
194
+ // Smooth falloff; strong near cursor, zero beyond ~1.5× radius.
195
+ float w = exp(-(d * d) / (r * r * 0.45));
196
+ // Max rotation ~120° at cursor center, scaled by strength
197
+ float ang = w * uCursorStrength * 2.1;
198
+ float ca = cos(ang), sa = sin(ang);
199
+ vec2 rotated = vec2(ca * toP.x - sa * toP.y, sa * toP.x + ca * toP.y) + uCursor;
200
+ // Also pinch slightly toward the cursor (gravity) — adds depth to swirl
201
+ float pinch = w * uCursorStrength * 0.08;
202
+ rotated = mix(rotated, uCursor, pinch);
203
+ // Blend original warped position with cursor-rotated version
204
+ warped = mix(warped, rotated + uWarpAmount * warp * 0.7, w * uCursorStrength);
205
+ }
206
+
207
+ return warped;
208
+ }
209
+
210
+ ` + re + N + ie + N + "// ── Color utils ───────────────────────────────────────────────────────────\nconst vec3 W_LUMA = vec3(0.2126, 0.7152, 0.0722);\n\nvec3 hueShift(vec3 c, float degrees) {\n float a = radians(degrees);\n float co = cos(a), si = sin(a);\n mat3 m = mat3(\n 0.299 + 0.701 * co + 0.168 * si,\n 0.587 - 0.587 * co + 0.330 * si,\n 0.114 - 0.114 * co - 0.497 * si,\n\n 0.299 - 0.299 * co - 0.328 * si,\n 0.587 + 0.413 * co + 0.035 * si,\n 0.114 - 0.114 * co + 0.292 * si,\n\n 0.299 - 0.300 * co + 1.250 * si,\n 0.587 - 0.588 * co - 1.050 * si,\n 0.114 + 0.886 * co - 0.203 * si\n );\n return m * c;\n}\n\nvec3 brokenColorJitter(vec3 c, float hueSeed, float valueSeed, float strength) {\n float amt = clamp(uBrokenColor * strength, 0.0, 1.0);\n if (amt <= 0.001) return c;\n float hueDeg = (hueSeed - 0.5) * 32.0 * amt;\n float valueMul = 1.0 + (valueSeed - 0.5) * 0.28 * amt;\n return max(hueShift(c, hueDeg) * valueMul, vec3(0.0));\n}\n\nvec3 saturate3(vec3 c, float amt) {\n float l = dot(c, W_LUMA);\n return mix(vec3(l), c, amt);\n}\n\n" + ae + N + j + N + oe + N + M + N + "\n// ── Main ──────────────────────────────────────────────────────────────────\nvoid main() {\n // Normalized 0..1 coordinates for nuclei, domain warp, and medium sampling.\n vec2 uv = vUv;\n vec2 pN = uv;\n\n float t = uTime;\n\n // Warp in pN space\n vec2 p_warp = domainWarp(pN, t);\n\n // Composition\n float paletteId; float valueMod;\n nucleiField(p_warp, t, paletteId, valueMod);\n vec3 col = samplePalette(paletteId);\n col *= 1.0 + uValueVariance * valueMod;\n\n // Breath — slow global luminance wobble\n float breath = sin(t * 6.2831 / max(uBreathPeriod, 1.0));\n col *= 1.0 + uBreathDepth * breath * 0.5;\n\n // Medium — crayon (4) is a peer dispatched here, not a mediumOil sub-mode.\n if (uMedium == 1) col = mediumPastel(col, pN, t);\n else if (uMedium == 2) col = mediumWatercolor(col, pN, t);\n else if (uMedium == 3) col = mediumOil(col, pN, t);\n else if (uMedium == 4) col = mediumCrayon(col, pN, t);\n\n // Saturation trim\n col = saturate3(col, uSaturation);\n\n // Tonemap + film grain\n col = aces(col);\n float grain = hash21(gl_FragCoord.xy + t * 17.0);\n col += (grain - 0.5) * uPaperGrain;\n\n col = clamp(col * 0.985 + 0.008, 0.0, 1.0);\n\n // MANDATORY OETF — closes the seam (mirrors metaball.frag.ts:278). The whole\n // pipeline above (linear palette LUT, ACES tonemap, grain) runs in LINEAR; without\n // this transfer the aurora ships ~2.2× too dark (linear 0.5 → ~0.215, not ~0.735).\n col = linearToSrgb(col);\n\n // 1-LSB triangular IGN dither in DISPLAY space, AFTER the OETF — breaks 8-bit\n // mid-tone banding on the soft gradient. Texture-free (the canonical Jimenez IGN).\n col += (1.0 / 255.0) * (ign(gl_FragCoord.xy) - 0.5);\n\n // Premultiply operates on DISPLAY-space color (matches the blob: OETF, then premul).\n fragColor = vec4(col * uAlpha, uAlpha);\n}\n", F = "[Aurora]", I = /* @__PURE__ */ "uTime.uPalette.uStopCount.uNucleiCount.uNucleiPos.uNucleiRadius.uNucleiPaletteBias.uNucleiValueBias.uNucleiDriftRadius.uNucleiDriftPhase.uNucleiElong.uNucleiAngle.uSoftmaxBeta.uValueVariance.uWarpAmount.uWarpScale.uWarpDrift.uWarpMode.uNoiseOctaves.uMedium.uFlowPattern.uFlowFocal.uFlowAngle.uFlowCurl.uCursor.uCursorStrength.uCursorRadius.uStrokeAmount.uStrokeScale.uStrokeAnisotropy.uStrokeLayers.uStrokeMode.uWetEdge.uGranulation.uImpasto.uBrokenColor.uCanvasGrain.uNucleiDrift.uPaletteDrift.uBreathDepth.uBreathPeriod.uSaturation.uPaperGrain.uAlpha".split(".");
211
+ function L(e, t, n) {
212
+ let i = o(e, e.VERTEX_SHADER, t, F), a = o(e, e.FRAGMENT_SHADER, n, F), s = r(e, i, a, F);
213
+ e.useProgram(s);
214
+ let c = e.createVertexArray();
215
+ e.bindVertexArray(c);
216
+ let l = e.createBuffer();
217
+ e.bindBuffer(e.ARRAY_BUFFER, l), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
218
+ -1,
219
+ -1,
220
+ 3,
221
+ -1,
222
+ -1,
223
+ 3
224
+ ]), e.STATIC_DRAW);
225
+ let u = e.getAttribLocation(s, "aPos");
226
+ e.enableVertexAttribArray(u), e.vertexAttribPointer(u, 2, e.FLOAT, !1, 0, 0);
227
+ let d = {};
228
+ for (let t of I) d[t] = e.getUniformLocation(s, t);
229
+ return {
230
+ program: s,
231
+ vs: i,
232
+ fs: a,
233
+ uniforms: d,
234
+ geometry: {
235
+ vao: c,
236
+ buf: l
237
+ }
238
+ };
239
+ }
8
240
  //#endregion
9
241
  //#region src/components/custom/aurora/composables/color.ts
10
- function k(e) {
11
- let [t, n, r] = T(e.L, e.C, e.h), [i, a, o] = x(t, n, r);
12
- return [
13
- Math.max(0, i),
14
- Math.max(0, a),
15
- Math.max(0, o)
16
- ];
17
- }
18
- function A(e, t = 8, n) {
242
+ function R(e, t = 8, n) {
19
243
  let r = n ?? new Float32Array(t * 3), i = Math.min(e.length, t);
20
244
  for (let t = 0; t < i; t++) {
21
- let [n, i, a] = k(e[t]);
245
+ let [n, i, a] = u(e[t]);
22
246
  r[t * 3 + 0] = n, r[t * 3 + 1] = i, r[t * 3 + 2] = a;
23
247
  }
24
248
  for (let e = i; e < t; e++) r[e * 3 + 0] = 0, r[e * 3 + 1] = 0, r[e * 3 + 2] = 0;
25
249
  return r;
26
250
  }
27
- function j(e) {
251
+ function z(e) {
28
252
  if (e.length === 0) return "transparent";
29
- if (e.length === 1) return M(e[0]);
253
+ if (e.length === 1) return d(e[0]);
30
254
  let t = e.length;
31
255
  return `linear-gradient(135deg, ${e.map((e, n) => {
32
256
  let r = Math.round(n / (t - 1) * 100);
33
- return `${M(e)} ${r}%`;
257
+ return `${d(e)} ${r}%`;
34
258
  }).join(", ")})`;
35
259
  }
36
- function M(e) {
37
- let [t, n, r] = T(e.L, e.C, e.h), [i, a, o] = S(t, n, r), s = (e) => Math.round(e).toString(16).padStart(2, "0");
38
- return `#${s(i)}${s(a)}${s(o)}`;
39
- }
40
- function N(e) {
41
- let t = e.replace("#", ""), n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), [a, o, s] = E(n / 255, r / 255, i / 255), [c, l, u] = w(a, o, s);
260
+ function B(e) {
261
+ let t = e.replace("#", ""), n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), [a, o, s] = te(n / 255, r / 255, i / 255), [c, l, u] = k(a, o, s);
42
262
  return {
43
263
  L: c,
44
264
  C: l,
45
265
  h: u
46
266
  };
47
267
  }
48
- function P(e) {
49
- let t = v(C(e), "rgb").value, [n, r, i] = E(Number(t.r), Number(t.g), Number(t.b)), [a, o, s] = w(n, r, i);
50
- return {
51
- L: a,
52
- C: o,
53
- h: s
54
- };
55
- }
56
- var F = [.35, .95];
57
- function I(e, t = {}) {
58
- let n = typeof e == "string" ? P(e) : e, { stopCount: r = 4, harmony: i = "analogous", lightnessSpread: a = .32, chromaFalloff: o = .85, hueSpread: s = 28 } = t, c = Math.max(2, Math.min(8, Math.round(r))), [l, u] = F, d = n.L - a / 2, f = n.L + a / 2;
59
- d < l && (f += l - d, d = l), f > u && (d -= f - u, f = u), d = Math.max(l, d), f = Math.min(u, f);
60
- let p = [];
268
+ var V = [.35, .95];
269
+ function H(e, t = {}) {
270
+ let n = typeof e == "string" ? f(e) : e, { stopCount: r = 4, harmony: i = "analogous", lightnessSpread: a = .32, chromaFalloff: o = .85, hueSpread: s = 28 } = t, c = Math.max(2, Math.min(8, Math.round(r))), [l, u] = V, d = n.L - a / 2, p = n.L + a / 2;
271
+ d < l && (p += l - d, d = l), p > u && (d -= p - u, p = u), d = Math.max(l, d), p = Math.min(u, p);
272
+ let m = [];
61
273
  for (let e = 0; e < c; e++) {
62
- let t = c === 1 ? 0 : e / (c - 1), r = d + (f - d) * t, a = n.C * (1 - (1 - o) * t), l = L(n.h, i, s, t);
63
- p.push(R({
274
+ let t = c === 1 ? 0 : e / (c - 1), r = d + (p - d) * t, a = n.C * (1 - (1 - o) * t), l = U(n.h, i, s, t);
275
+ m.push(W({
64
276
  L: r,
65
277
  C: a,
66
278
  h: l
67
279
  }));
68
280
  }
69
- return p;
281
+ return m;
70
282
  }
71
- function L(e, t, n, r) {
283
+ function U(e, t, n, r) {
72
284
  let i = (e) => (e % 360 + 360) % 360;
73
285
  switch (t) {
74
286
  case "monochrome": return i(e);
@@ -77,11 +289,11 @@ function L(e, t, n, r) {
77
289
  default: return i(e + n * (r - .5) * 2);
78
290
  }
79
291
  }
80
- function R(e) {
81
- let [t, n, r] = T(e.L, e.C, e.h), [i, a, o] = y(t, n, r), [s, c, l] = w(i, a, o), u = c;
292
+ function W(e) {
293
+ let [t, n, r] = A(e.L, e.C, e.h), [i, a, o] = E(t, n, r), [s, c, l] = k(i, a, o), u = c;
82
294
  for (let e = 0; e < 6; e++) {
83
- let [e, t, n] = T(s, u, l), [r, i, a] = x(e, t, n);
84
- if (b(r, i, a)) break;
295
+ let [e, t, n] = A(s, u, l), [r, i, a] = O(e, t, n);
296
+ if (D(r, i, a)) break;
85
297
  u *= .999;
86
298
  }
87
299
  return {
@@ -91,69 +303,63 @@ function R(e) {
91
303
  };
92
304
  }
93
305
  //#endregion
94
- //#region src/components/custom/aurora/composables/runtime.ts
95
- var z = {
306
+ //#region src/components/custom/aurora/composables/uniformBridge.ts
307
+ var G = {
96
308
  smooth: 0,
97
309
  pastel: 1,
98
310
  watercolor: 2,
99
- oil: 3
100
- }, B = {
311
+ oil: 3,
312
+ crayon: 4
313
+ }, K = {
101
314
  none: 0,
102
315
  radial: 1,
103
316
  swirl: 2,
104
317
  diagonal: 3,
105
318
  multi: 4
106
- }, V = {
319
+ }, se = {
107
320
  fbm: 0,
108
321
  cellular: 1,
109
322
  hybrid: 2
110
- }, H = {
323
+ }, q = {
111
324
  oil: 0,
112
325
  knife: 1,
113
- crayon: 2,
114
326
  chunky: 3
115
- }, U = .22, W = .18, G = .992, K = .001;
116
- function q(e) {
117
- return e.mode === "capture" ? !0 : e.initStrategy === "eager";
327
+ };
328
+ function ce(e) {
329
+ return e.medium === "oil" && e.strokeMode === "crayon" ? G.crayon : G[e.medium];
118
330
  }
119
- function J(e) {
120
- return typeof e.preserveDrawingBuffer == "boolean" ? e.preserveDrawingBuffer : e.mode === "capture";
331
+ function le(e) {
332
+ return e.strokeMode === "crayon" ? q.oil : q[e.strokeMode];
121
333
  }
122
- function Y(e, t, n) {
123
- let r = e.createShader(t);
124
- if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
125
- let t = e.getShaderInfoLog(r) ?? "unknown";
126
- throw e.deleteShader(r), Error(`[Aurora] shader compile failed:\n${t}`);
127
- }
128
- return r;
129
- }
130
- function ee(e, t, n) {
131
- let r = e.createProgram();
132
- if (e.attachShader(r, t), e.attachShader(r, n), e.linkProgram(r), !e.getProgramParameter(r, e.LINK_STATUS)) {
133
- let t = e.getProgramInfoLog(r) ?? "unknown";
134
- throw e.deleteProgram(r), Error(`[Aurora] program link failed:\n${t}`);
135
- }
136
- return r;
334
+ function ue(e, t, n, r) {
335
+ let i = (e) => 1 - e, a = {
336
+ palette: new Float32Array(24),
337
+ pos: new Float32Array(12),
338
+ rad: new Float32Array(6),
339
+ pb: new Float32Array(6),
340
+ vb: new Float32Array(6),
341
+ dr: new Float32Array(6),
342
+ dp: new Float32Array(6),
343
+ elong: new Float32Array(6),
344
+ angle: new Float32Array(6)
345
+ };
346
+ return function(o) {
347
+ e.useProgram(t), R(o.palette, 8, a.palette), e.uniform3fv(n.uPalette, a.palette), e.uniform1i(n.uStopCount, Math.min(o.palette.length, 8));
348
+ let s = Math.min(o.nuclei.length, 6);
349
+ e.uniform1i(n.uNucleiCount, s);
350
+ for (let e = 0; e < s; e++) {
351
+ let t = o.nuclei[e];
352
+ a.pos[e * 2 + 0] = t.x, a.pos[e * 2 + 1] = i(t.y), a.rad[e] = t.radius, a.pb[e] = t.paletteBias, a.vb[e] = t.valueBias, a.dr[e] = t.driftRadius, a.dp[e] = t.driftPhase, a.elong[e] = t.elongation ?? 1, a.angle[e] = -(t.angle ?? 0) * Math.PI / 180;
353
+ }
354
+ for (let e = s; e < 6; e++) a.pos[e * 2 + 0] = 0, a.pos[e * 2 + 1] = 0, a.rad[e] = 0, a.pb[e] = 0, a.vb[e] = 0, a.dr[e] = 0, a.dp[e] = 0, a.elong[e] = 1, a.angle[e] = 0;
355
+ e.uniform2fv(n.uNucleiPos, a.pos), e.uniform1fv(n.uNucleiRadius, a.rad), e.uniform1fv(n.uNucleiPaletteBias, a.pb), e.uniform1fv(n.uNucleiValueBias, a.vb), e.uniform1fv(n.uNucleiDriftRadius, a.dr), e.uniform1fv(n.uNucleiDriftPhase, a.dp), e.uniform1fv(n.uNucleiElong, a.elong), e.uniform1fv(n.uNucleiAngle, a.angle), e.uniform1f(n.uSoftmaxBeta, o.softmaxBeta), e.uniform1f(n.uValueVariance, o.valueVariance), e.uniform1f(n.uWarpAmount, o.warpAmount), e.uniform1f(n.uWarpScale, o.warpScale), e.uniform1f(n.uWarpDrift, o.warpDrift), e.uniform1i(n.uWarpMode, se[o.warpMode]), e.uniform1i(n.uNoiseOctaves, o.noiseOctaves), e.uniform1i(n.uMedium, ce(o)), e.uniform1i(n.uFlowPattern, K[o.flow.pattern]), e.uniform2f(n.uFlowFocal, o.flow.focalX, i(o.flow.focalY)), e.uniform1f(n.uFlowAngle, o.flow.angle), e.uniform1f(n.uFlowCurl, o.flow.curl), e.uniform2f(n.uCursor, r.x, i(r.y)), e.uniform1f(n.uCursorStrength, r.strength), e.uniform1f(n.uCursorRadius, r.radius), e.uniform1f(n.uStrokeAmount, o.strokeAmount), e.uniform1f(n.uStrokeScale, o.strokeScale), e.uniform1f(n.uStrokeAnisotropy, o.strokeAnisotropy), e.uniform1i(n.uStrokeLayers, o.strokeLayers), e.uniform1i(n.uStrokeMode, le(o)), e.uniform1f(n.uWetEdge, o.wetEdge), e.uniform1f(n.uGranulation, o.granulation), e.uniform1f(n.uImpasto, o.impasto), e.uniform1f(n.uBrokenColor, o.brokenColor), e.uniform1f(n.uCanvasGrain, o.canvasGrain), e.uniform1f(n.uNucleiDrift, o.nucleiDrift), e.uniform1f(n.uPaletteDrift, o.paletteDrift), e.uniform1f(n.uBreathDepth, o.breathDepth), e.uniform1f(n.uBreathPeriod, o.breathPeriod), e.uniform1f(n.uSaturation, o.saturation), e.uniform1f(n.uPaperGrain, o.paperGrain), e.uniform1f(n.uAlpha, o.alpha);
356
+ };
137
357
  }
138
- var te = /* @__PURE__ */ "uTime.uPalette.uStopCount.uNucleiCount.uNucleiPos.uNucleiRadius.uNucleiPaletteBias.uNucleiValueBias.uNucleiDriftRadius.uNucleiDriftPhase.uNucleiElong.uNucleiAngle.uSoftmaxBeta.uValueVariance.uWarpAmount.uWarpScale.uWarpDrift.uWarpMode.uNoiseOctaves.uMedium.uFlowPattern.uFlowFocal.uFlowAngle.uFlowCurl.uCursor.uCursorStrength.uCursorRadius.uStrokeAmount.uStrokeScale.uStrokeAnisotropy.uStrokeLayers.uStrokeMode.uWetEdge.uGranulation.uImpasto.uBrokenColor.uCanvasGrain.uNucleiDrift.uPaletteDrift.uBreathDepth.uBreathPeriod.uSaturation.uPaperGrain.uAlpha".split(".");
139
- function X(e, t, n = {}) {
140
- let r = J(n), i = t, a = /* @__PURE__ */ new Set();
141
- n.mode === "capture" && a.add("manual");
142
- let o = () => a.size === 0, s = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : !1, c = performance.now(), l = 0, u = null;
143
- function d(e) {
144
- let t = o();
145
- a.add(e), t && !o() && (cancelAnimationFrame(l), l = 0);
146
- }
147
- function f(e) {
148
- let t = !o();
149
- a.delete(e), t && o() && u && (c = performance.now() - 1e3, u());
150
- }
151
- let p = typeof document < "u";
152
- function m() {
153
- document.hidden ? d("tab-hidden") : f("tab-hidden");
154
- }
155
- p && document.addEventListener("visibilitychange", m);
156
- let h = {
358
+ //#endregion
359
+ //#region src/components/custom/aurora/composables/cursorModel.ts
360
+ var J = .22, de = .18, fe = .992;
361
+ function pe() {
362
+ return {
157
363
  x: .5,
158
364
  y: .5,
159
365
  targetX: .5,
@@ -161,127 +367,104 @@ function X(e, t, n = {}) {
161
367
  strength: 0,
162
368
  targetStrength: 0,
163
369
  radius: .25
164
- }, g = null, _ = !1;
165
- function v(e, t, n = .8) {
166
- h.targetX = e, h.targetY = t, h.targetStrength = n, g?.wake();
167
- }
168
- function y() {
169
- h.targetStrength = 0, g?.wake();
170
- }
171
- function b(e) {
172
- h.radius = e, g?.wake();
370
+ };
371
+ }
372
+ function me(e) {
373
+ e.x += (e.targetX - e.x) * J, e.y += (e.targetY - e.y) * J, e.strength += (e.targetStrength - e.strength) * de, e.targetStrength *= fe;
374
+ }
375
+ function he(e) {
376
+ return e.targetStrength > .001 || e.strength > .001 || Math.abs(e.x - e.targetX) > .001 || Math.abs(e.y - e.targetY) > .001;
377
+ }
378
+ //#endregion
379
+ //#region src/components/custom/aurora/composables/frameLoop.ts
380
+ function ge(e) {
381
+ let { gl: t, prog: n, uniforms: r, cursor: i, getConfig: a, getReducedMotion: o } = e, s = (e) => 1 - e;
382
+ function c(e) {
383
+ t.useProgram(n), t.uniform2f(r.uCursor, i.x, s(i.y)), t.uniform1f(r.uCursorStrength, i.strength), t.uniform1f(r.uCursorRadius, i.radius), t.uniform1f(r.uTime, e), t.clear(t.COLOR_BUFFER_BIT), t.drawArrays(t.TRIANGLES, 0, 3);
173
384
  }
174
- function x(e) {
175
- s = e, g?.wake();
385
+ function l() {
386
+ if (o()) return !1;
387
+ let e = a();
388
+ return e.nucleiDrift !== 0 || e.paletteDrift !== 0 || e.breathDepth !== 0 || e.warpDrift !== 0 ? !0 : he(i);
176
389
  }
177
- function S() {
178
- if (g || _) return;
179
- let t = e.getContext("webgl2", {
390
+ return {
391
+ frame: (e) => {
392
+ me(i), c(e);
393
+ },
394
+ needsAnimation: l
395
+ };
396
+ }
397
+ //#endregion
398
+ //#region src/components/custom/aurora/composables/runtime.ts
399
+ function _e(e) {
400
+ return e.mode === "capture" ? !0 : e.initStrategy === "eager";
401
+ }
402
+ function Y(e) {
403
+ return typeof e.preserveDrawingBuffer == "boolean" ? e.preserveDrawingBuffer : e.mode === "capture";
404
+ }
405
+ function X(e, t, r = {}) {
406
+ let i = Y(r), o = t, s = pe(), c = null, l = a(e, {
407
+ mode: r.mode === "capture" ? "capture" : "live",
408
+ contextAttrs: {
180
409
  antialias: !1,
181
410
  alpha: !0,
182
411
  premultipliedAlpha: !0,
183
- preserveDrawingBuffer: r
184
- });
185
- if (!t) throw Error("[Aurora] WebGL2 unavailable");
186
- let n = Y(t, t.VERTEX_SHADER, D), a = Y(t, t.FRAGMENT_SHADER, O), d = ee(t, n, a);
187
- t.useProgram(d);
188
- let f = t.createVertexArray();
189
- t.bindVertexArray(f);
190
- let p = t.createBuffer();
191
- t.bindBuffer(t.ARRAY_BUFFER, p), t.bufferData(t.ARRAY_BUFFER, new Float32Array([
192
- -1,
193
- -1,
194
- 3,
195
- -1,
196
- -1,
197
- 3
198
- ]), t.STATIC_DRAW);
199
- let m = t.getAttribLocation(d, "aPos");
200
- t.enableVertexAttribArray(m), t.vertexAttribPointer(m, 2, t.FLOAT, !1, 0, 0);
201
- let v = {};
202
- for (let e of te) v[e] = t.getUniformLocation(d, e);
203
- function y() {
204
- let n = Math.min(window.devicePixelRatio || 1, 2), r = e.clientWidth || e.parentElement?.clientWidth || 1, i = e.clientHeight || e.parentElement?.clientHeight || 1, a = Math.max(1, Math.floor(r * n)), o = Math.max(1, Math.floor(i * n));
205
- e.width = a, e.height = o, t.viewport(0, 0, a, o), t.useProgram(d);
206
- }
207
- let b = new ResizeObserver(() => y());
208
- b.observe(e), requestAnimationFrame(() => {
209
- y(), requestAnimationFrame(y);
210
- });
211
- let x = {
212
- palette: new Float32Array(24),
213
- pos: new Float32Array(12),
214
- rad: new Float32Array(6),
215
- pb: new Float32Array(6),
216
- vb: new Float32Array(6),
217
- dr: new Float32Array(6),
218
- dp: new Float32Array(6),
219
- elong: new Float32Array(6),
220
- angle: new Float32Array(6)
221
- };
222
- function S(e) {
223
- i = e, t.useProgram(d), A(e.palette, 8, x.palette), t.uniform3fv(v.uPalette, x.palette), t.uniform1i(v.uStopCount, Math.min(e.palette.length, 8));
224
- let n = Math.min(e.nuclei.length, 6);
225
- t.uniform1i(v.uNucleiCount, n);
226
- for (let t = 0; t < n; t++) {
227
- let n = e.nuclei[t];
228
- x.pos[t * 2 + 0] = n.x, x.pos[t * 2 + 1] = 1 - n.y, x.rad[t] = n.radius, x.pb[t] = n.paletteBias, x.vb[t] = n.valueBias, x.dr[t] = n.driftRadius, x.dp[t] = n.driftPhase, x.elong[t] = n.elongation ?? 1, x.angle[t] = -(n.angle ?? 0) * Math.PI / 180;
412
+ preserveDrawingBuffer: i
413
+ },
414
+ setup: (t) => {
415
+ let { program: r, vs: i, fs: a, uniforms: u, geometry: d } = L(t, ne, P);
416
+ function f() {
417
+ let i = n(), a = e.clientWidth || e.parentElement?.clientWidth || 1, o = e.clientHeight || e.parentElement?.clientHeight || 1, s = Math.max(1, Math.floor(a * i)), c = Math.max(1, Math.floor(o * i));
418
+ e.width = s, e.height = c, t.viewport(0, 0, s, c), t.useProgram(r);
229
419
  }
230
- for (let e = n; e < 6; e++) x.pos[e * 2 + 0] = 0, x.pos[e * 2 + 1] = 0, x.rad[e] = 0, x.pb[e] = 0, x.vb[e] = 0, x.dr[e] = 0, x.dp[e] = 0, x.elong[e] = 1, x.angle[e] = 0;
231
- t.uniform2fv(v.uNucleiPos, x.pos), t.uniform1fv(v.uNucleiRadius, x.rad), t.uniform1fv(v.uNucleiPaletteBias, x.pb), t.uniform1fv(v.uNucleiValueBias, x.vb), t.uniform1fv(v.uNucleiDriftRadius, x.dr), t.uniform1fv(v.uNucleiDriftPhase, x.dp), t.uniform1fv(v.uNucleiElong, x.elong), t.uniform1fv(v.uNucleiAngle, x.angle), t.uniform1f(v.uSoftmaxBeta, e.softmaxBeta), t.uniform1f(v.uValueVariance, e.valueVariance), t.uniform1f(v.uWarpAmount, e.warpAmount), t.uniform1f(v.uWarpScale, e.warpScale), t.uniform1f(v.uWarpDrift, e.warpDrift), t.uniform1i(v.uWarpMode, V[e.warpMode]), t.uniform1i(v.uNoiseOctaves, e.noiseOctaves), t.uniform1i(v.uMedium, z[e.medium]), t.uniform1i(v.uFlowPattern, B[e.flow.pattern]), t.uniform2f(v.uFlowFocal, e.flow.focalX, 1 - e.flow.focalY), t.uniform1f(v.uFlowAngle, e.flow.angle), t.uniform1f(v.uFlowCurl, e.flow.curl), t.uniform2f(v.uCursor, h.x, 1 - h.y), t.uniform1f(v.uCursorStrength, h.strength), t.uniform1f(v.uCursorRadius, h.radius), t.uniform1f(v.uStrokeAmount, e.strokeAmount), t.uniform1f(v.uStrokeScale, e.strokeScale), t.uniform1f(v.uStrokeAnisotropy, e.strokeAnisotropy), t.uniform1i(v.uStrokeLayers, e.strokeLayers), t.uniform1i(v.uStrokeMode, H[e.strokeMode]), t.uniform1f(v.uWetEdge, e.wetEdge), t.uniform1f(v.uGranulation, e.granulation), t.uniform1f(v.uImpasto, e.impasto), t.uniform1f(v.uBrokenColor, e.brokenColor), t.uniform1f(v.uCanvasGrain, e.canvasGrain), t.uniform1f(v.uNucleiDrift, e.nucleiDrift), t.uniform1f(v.uPaletteDrift, e.paletteDrift), t.uniform1f(v.uBreathDepth, e.breathDepth), t.uniform1f(v.uBreathPeriod, e.breathPeriod), t.uniform1f(v.uSaturation, e.saturation), t.uniform1f(v.uPaperGrain, e.paperGrain), t.uniform1f(v.uAlpha, e.alpha);
232
- }
233
- S(i), y(), t.clearColor(0, 0, 0, 0), t.disable(t.DEPTH_TEST), t.enable(t.BLEND), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA);
234
- function C() {
235
- h.x += (h.targetX - h.x) * U, h.y += (h.targetY - h.y) * U, h.strength += (h.targetStrength - h.strength) * W, h.targetStrength *= G;
236
- }
237
- function w(e) {
238
- t.useProgram(d), t.uniform2f(v.uCursor, h.x, 1 - h.y), t.uniform1f(v.uCursorStrength, h.strength), t.uniform1f(v.uCursorRadius, h.radius), t.uniform1f(v.uTime, e), t.clear(t.COLOR_BUFFER_BIT), t.drawArrays(t.TRIANGLES, 0, 3);
239
- }
240
- function T() {
241
- return s ? !1 : i.nucleiDrift !== 0 || i.paletteDrift !== 0 || i.breathDepth !== 0 || i.warpDrift !== 0 ? !0 : h.targetStrength > K || h.strength > K || Math.abs(h.x - h.targetX) > K || Math.abs(h.y - h.targetY) > K;
242
- }
243
- function E() {
244
- if (!o()) return;
245
- let e = s ? 3.7 : (performance.now() - c) / 1e3;
246
- C(), w(e), l = T() ? requestAnimationFrame(E) : 0;
247
- }
248
- u = E, o() && (l = requestAnimationFrame(E));
249
- function k() {
250
- o() && !l && (l = requestAnimationFrame(E));
251
- }
252
- function j(e) {
253
- w(e);
254
- }
255
- function M() {
256
- cancelAnimationFrame(l), l = 0, u = null, b.disconnect(), t.deleteProgram(d), t.deleteShader(n), t.deleteShader(a), t.deleteBuffer(p), t.deleteVertexArray(f);
257
- let e = t.getExtension("WEBGL_lose_context");
258
- e && e.loseContext();
420
+ let p = ue(t, r, u, s), m = ge({
421
+ gl: t,
422
+ prog: r,
423
+ uniforms: u,
424
+ cursor: s,
425
+ getConfig: () => o,
426
+ getReducedMotion: () => l.reducedMotion
427
+ });
428
+ return t.clearColor(0, 0, 0, 0), t.disable(t.DEPTH_TEST), t.enable(t.BLEND), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA), c = (e) => {
429
+ o = e, p(e);
430
+ }, c(o), requestAnimationFrame(() => {
431
+ f(), requestAnimationFrame(f);
432
+ }), {
433
+ frame: m.frame,
434
+ shouldContinue: m.needsAnimation,
435
+ resize: f,
436
+ time: (e) => l.reducedMotion ? 3.7 : e,
437
+ teardown: () => {
438
+ t.deleteProgram(r), t.deleteShader(i), t.deleteShader(a), t.deleteBuffer(d.buf), t.deleteVertexArray(d.vao);
439
+ }
440
+ };
259
441
  }
260
- g = {
261
- setConfig: S,
262
- renderAt: j,
263
- wake: k,
264
- dispose: M
265
- };
442
+ });
443
+ function u(e, t, n = .8) {
444
+ s.targetX = e, s.targetY = t, s.targetStrength = n, l.wake();
445
+ }
446
+ function d() {
447
+ s.targetStrength = 0, l.wake();
448
+ }
449
+ function f(e) {
450
+ s.radius = e, l.wake();
266
451
  }
267
- function C() {
268
- p && document.removeEventListener("visibilitychange", m), a.clear();
452
+ function p(e) {
453
+ l.wake();
269
454
  }
270
- return q(n) && S(), {
271
- arm: S,
455
+ return r.mode !== "capture" && _e(r) && l.arm(), {
456
+ arm: () => l.arm(),
272
457
  update: (e) => {
273
- i = e, g?.setConfig(e), g?.wake();
458
+ o = e, c?.(e), l.wake();
274
459
  },
275
- setCursor: v,
276
- clearCursor: y,
277
- setCursorRadius: b,
278
- setReducedMotion: x,
279
- pause: (e = "manual") => d(e),
280
- resume: (e = "manual") => f(e),
281
- renderAt: (e) => g?.renderAt(e),
282
- dispose: () => {
283
- g ? g.dispose() : _ = !0, C();
284
- }
460
+ setCursor: u,
461
+ clearCursor: d,
462
+ setCursorRadius: f,
463
+ setReducedMotion: p,
464
+ pause: (e = "manual") => l.suspend(e),
465
+ resume: (e = "manual") => l.resume(e),
466
+ renderAt: (e) => l.renderAt(e),
467
+ dispose: () => l.dispose()
285
468
  };
286
469
  }
287
470
  //#endregion
@@ -291,7 +474,7 @@ function Z(e) {
291
474
  }
292
475
  //#endregion
293
476
  //#region src/components/custom/aurora/composables/useAurora.ts
294
- function ne(e) {
477
+ function ve(e) {
295
478
  if (typeof window > "u") return () => {};
296
479
  if (typeof window.requestIdleCallback == "function") {
297
480
  let t = window.requestIdleCallback(() => e(), { timeout: 2e3 });
@@ -309,11 +492,11 @@ function ne(e) {
309
492
  };
310
493
  }
311
494
  function Q(e, t, n = {}, r = {}) {
312
- let a = Z(t), o = r.renderMode === "css", s = null, c = null, l = null, u = null, p = null, g = null, v = !1, y = h(!1), b = n.mode === "capture" || n.initStrategy === "eager";
313
- function x() {
314
- g && s && s.setReducedMotion(g.matches);
495
+ let i = Z(t), a = r.renderMode === "css", o = null, s = null, c = null, l = null, u = null, d = null, f = !1, m = w(!1), h = n.mode === "capture" || n.initStrategy === "eager";
496
+ function g() {
497
+ d && o && o.setReducedMotion(d.matches);
315
498
  }
316
- function S(e) {
499
+ function _(e) {
317
500
  let t = e instanceof Error ? e : Error(String(e));
318
501
  if (n.onInitError) {
319
502
  n.onInitError(t);
@@ -321,58 +504,58 @@ function Q(e, t, n = {}, r = {}) {
321
504
  }
322
505
  Promise.reject(t);
323
506
  }
324
- function C() {
325
- if (!(v || !s)) {
326
- v = !0;
507
+ function v() {
508
+ if (!(f || !o)) {
509
+ f = !0;
327
510
  try {
328
- s.arm();
511
+ o.arm();
329
512
  } catch (e) {
330
- S(e);
513
+ _(e);
331
514
  return;
332
515
  }
333
- y.value = !0, g = window.matchMedia("(prefers-reduced-motion: reduce)"), g.addEventListener("change", x), c = _(a, (e) => s?.update(e), { deep: !0 });
516
+ m.value = !0, d = window.matchMedia("(prefers-reduced-motion: reduce)"), d.addEventListener("change", g), s = T(i, (e) => o?.update(e), { deep: !0 });
334
517
  }
335
518
  }
336
- return f(() => {
519
+ return x(() => {
337
520
  let t = e.value;
338
- if (!t || o) return;
521
+ if (!t || a) return;
339
522
  try {
340
- s = X(t, a(), {
523
+ o = X(t, i(), {
341
524
  initStrategy: "deferred",
342
525
  ...n
343
526
  });
344
527
  } catch (e) {
345
- S(e);
528
+ _(e);
346
529
  return;
347
530
  }
348
- if (b) {
349
- C();
531
+ if (h) {
532
+ v();
350
533
  return;
351
534
  }
352
- p = i(e, {
353
- pause: () => s?.pause("off-screen"),
354
- resume: () => s?.resume("off-screen")
535
+ u = p(e, {
536
+ pause: () => o?.pause("off-screen"),
537
+ resume: () => o?.resume("off-screen")
355
538
  }, { pauseWhenHidden: !1 });
356
- let r = p.isIntersecting;
357
- l = _(r, (e) => {
358
- !e || v || u || (u = ne(() => {
359
- u = null, r.value && C();
539
+ let r = u.isIntersecting;
540
+ c = T(r, (e) => {
541
+ !e || f || l || (l = ve(() => {
542
+ l = null, r.value && v();
360
543
  }));
361
544
  }, { immediate: !0 });
362
- }), d(() => {
363
- u?.(), l?.(), c?.(), p?.dispose(), g?.removeEventListener("change", x), s?.dispose(), s = null;
545
+ }), b(() => {
546
+ l?.(), c?.(), s?.(), u?.dispose(), d?.removeEventListener("change", g), o?.dispose(), o = null;
364
547
  }), {
365
- setCursor: (e, t, n) => s?.setCursor(e, t, n),
366
- clearCursor: () => s?.clearCursor(),
367
- setCursorRadius: (e) => s?.setCursorRadius(e),
368
- renderAt: (e) => s?.renderAt(e),
369
- pause: () => s?.pause(),
370
- resume: () => s?.resume(),
371
- isArmed: m(y)
548
+ setCursor: (e, t, n) => o?.setCursor(e, t, n),
549
+ clearCursor: () => o?.clearCursor(),
550
+ setCursorRadius: (e) => o?.setCursorRadius(e),
551
+ renderAt: (e) => o?.renderAt(e),
552
+ pause: () => o?.pause(),
553
+ resume: () => o?.resume(),
554
+ isArmed: C(m)
372
555
  };
373
556
  }
374
557
  //#endregion
375
- //#region src/components/custom/aurora/renderMode.ts
558
+ //#region src/components/custom/aurora/constants/renderMode.ts
376
559
  function $(e) {
377
560
  if (e !== "auto") return e;
378
561
  if (typeof navigator > "u" || typeof window > "u") return "webgl";
@@ -381,48 +564,48 @@ function $(e) {
381
564
  }
382
565
  //#endregion
383
566
  //#region src/components/custom/aurora/Aurora.vue
384
- var re = /* @__PURE__ */ e(/* @__PURE__ */ c({
567
+ var ye = /* @__PURE__ */ e(/* @__PURE__ */ _({
385
568
  __name: "Aurora",
386
569
  props: {
387
- config: { default: () => r },
570
+ config: { default: () => l },
388
571
  runtimeOptions: {},
389
572
  onInitError: {},
390
573
  renderMode: { default: "auto" },
391
574
  opacityCeiling: { default: 1 }
392
575
  },
393
576
  setup(e, { expose: t }) {
394
- let n = e, r = $(n.renderMode), i = a(() => Math.max(0, Math.min(1, n.opacityCeiling))), c = h(null), d = Q(c, () => n.config, a(() => ({
577
+ let n = e, r = $(n.renderMode), i = m(() => Math.max(0, Math.min(1, n.opacityCeiling))), a = w(null), o = Q(a, () => n.config, m(() => ({
395
578
  ...n.runtimeOptions ?? {},
396
579
  ...n.onInitError ? { onInitError: n.onInitError } : {}
397
- })).value, { renderMode: r }), f = a(() => j(n.config.palette));
580
+ })).value, { renderMode: r }), s = m(() => z(n.config.palette));
398
581
  return t({
399
582
  config: n.config,
400
- canvasRef: c,
401
- setCursor: d.setCursor,
402
- clearCursor: d.clearCursor,
403
- setCursorRadius: d.setCursorRadius,
404
- renderAt: d.renderAt,
405
- pause: d.pause,
406
- resume: d.resume,
407
- isArmed: d.isArmed
408
- }), (e, t) => (p(), o("div", {
583
+ canvasRef: a,
584
+ setCursor: o.setCursor,
585
+ clearCursor: o.clearCursor,
586
+ setCursorRadius: o.setCursorRadius,
587
+ renderAt: o.renderAt,
588
+ pause: o.pause,
589
+ resume: o.resume,
590
+ isArmed: o.isArmed
591
+ }), (e, t) => (S(), h("div", {
409
592
  class: "aurora-root block h-full w-full overflow-hidden",
410
- style: u({ "--aurora-opacity-ceiling": i.value })
411
- }, [s("div", {
593
+ style: y({ "--aurora-opacity-ceiling": i.value })
594
+ }, [g("div", {
412
595
  class: "aurora-placeholder h-full w-full",
413
596
  "aria-hidden": "true",
414
- style: u({ backgroundImage: f.value })
415
- }, null, 4), s("canvas", {
597
+ style: y({ backgroundImage: s.value })
598
+ }, null, 4), g("canvas", {
416
599
  ref_key: "canvasRef",
417
- ref: c,
600
+ ref: a,
418
601
  "aria-hidden": "true",
419
- class: l(["aurora-canvas block h-full w-full", { "aurora-canvas--armed": g(d).isArmed.value }])
602
+ class: v(["aurora-canvas block h-full w-full", { "aurora-canvas--armed": ee(o).isArmed.value }])
420
603
  }, null, 2)], 4));
421
604
  }
422
- }), [["__scopeId", "data-v-80ea8f7d"]]);
605
+ }), [["__scopeId", "data-v-c5277232"]]);
423
606
  //#endregion
424
607
  //#region src/components/custom/aurora/composables/useCursorInteraction.ts
425
- function ie(e, t, n) {
608
+ function be(e, t, n) {
426
609
  let r = Z(t), i = n.hitFraction ?? .35, a = null, o = null;
427
610
  function s(e, t) {
428
611
  let n = t.getBoundingClientRect();
@@ -451,38 +634,38 @@ function ie(e, t, n) {
451
634
  }
452
635
  return i > 1e-4 ? n / i : .5;
453
636
  }
454
- function p() {
637
+ function d() {
455
638
  if (r().nuclei.length === 0) return .5;
456
639
  let e = r().nuclei.map((e) => e.radius).sort((e, t) => e - t);
457
640
  return e[Math.floor(e.length / 2)];
458
641
  }
459
- function m(e, t) {
642
+ function f(e, t) {
460
643
  return {
461
644
  x: e,
462
645
  y: t,
463
- radius: p(),
646
+ radius: d(),
464
647
  paletteBias: u(e, t),
465
648
  valueBias: 0,
466
649
  driftRadius: .012,
467
650
  driftPhase: Math.random() * Math.PI * 2
468
651
  };
469
652
  }
470
- function h(t) {
653
+ function p(t) {
471
654
  let i = e.value;
472
655
  if (!i) return;
473
656
  let { x: o, y: c } = s(t, i);
474
657
  a !== null && (r().nuclei[a].x = Math.max(0, Math.min(1, o)), r().nuclei[a].y = Math.max(0, Math.min(1, c))), n.setCursor(o, c, 1);
475
658
  }
476
- function g() {
659
+ function m() {
477
660
  a === null && n.clearCursor();
478
661
  }
479
- function _(t) {
662
+ function h(t) {
480
663
  let n = e.value;
481
664
  if (!n) return;
482
665
  let { x: i, y: c } = s(t, n), u = l(i, c);
483
666
  if (t.altKey && u === null) {
484
667
  if (r().nuclei.length >= 6) return;
485
- r().nuclei.push(m(i, c)), t.preventDefault();
668
+ r().nuclei.push(f(i, c)), t.preventDefault();
486
669
  return;
487
670
  }
488
671
  if ((t.shiftKey || t.button === 2) && u !== null) {
@@ -492,7 +675,7 @@ function ie(e, t, n) {
492
675
  }
493
676
  u !== null && t.button === 0 && (a = u, o = t.pointerId, n.setPointerCapture(t.pointerId), t.preventDefault());
494
677
  }
495
- function v(t) {
678
+ function g(t) {
496
679
  let n = e.value;
497
680
  if (n && o !== null && t.pointerId === o) {
498
681
  try {
@@ -501,7 +684,7 @@ function ie(e, t, n) {
501
684
  o = null, a = null;
502
685
  }
503
686
  }
504
- function y(t) {
687
+ function _(t) {
505
688
  let n = e.value;
506
689
  if (!n) return;
507
690
  let i = {
@@ -510,13 +693,13 @@ function ie(e, t, n) {
510
693
  }, a = n.getBoundingClientRect(), o = l((i.clientX - a.left) / Math.max(a.width, 1), (i.clientY - a.top) / Math.max(a.height, 1));
511
694
  o !== null && r().nuclei.length > 1 && (r().nuclei.splice(o, 1), t.preventDefault());
512
695
  }
513
- return f(() => {
696
+ return x(() => {
514
697
  let t = e.value;
515
- t && (t.addEventListener("pointermove", h), t.addEventListener("pointerleave", g), t.addEventListener("pointerdown", _), t.addEventListener("pointerup", v), t.addEventListener("pointercancel", v), t.addEventListener("contextmenu", y));
516
- }), d(() => {
698
+ t && (t.addEventListener("pointermove", p), t.addEventListener("pointerleave", m), t.addEventListener("pointerdown", h), t.addEventListener("pointerup", g), t.addEventListener("pointercancel", g), t.addEventListener("contextmenu", _));
699
+ }), b(() => {
517
700
  let t = e.value;
518
- t && (t.removeEventListener("pointermove", h), t.removeEventListener("pointerleave", g), t.removeEventListener("pointerdown", _), t.removeEventListener("pointerup", v), t.removeEventListener("pointercancel", v), t.removeEventListener("contextmenu", y));
701
+ t && (t.removeEventListener("pointermove", p), t.removeEventListener("pointerleave", m), t.removeEventListener("pointerdown", h), t.removeEventListener("pointerup", g), t.removeEventListener("pointercancel", g), t.removeEventListener("contextmenu", _));
519
702
  }), { isDragging: () => a };
520
703
  }
521
704
  //#endregion
522
- export { re as Aurora, r as DEFAULT_AURORA_CONFIG, t as MAX_NUCLEI, n as MAX_STOPS, X as createAurora, P as cssToOklch, I as deriveAurora, A as flattenPalette, N as hexToOklchStop, M as oklchStopToHex, k as oklchToLinear, j as paletteToCssGradient, $ as resolveRenderMode, Q as useAurora, ie as useCursorInteraction };
705
+ export { ye as Aurora, l as DEFAULT_AURORA_CONFIG, s as MAX_NUCLEI, c as MAX_STOPS, X as createAurora, f as cssToOklch, H as deriveAurora, R as flattenPalette, B as hexToOklchStop, d as oklchStopToHex, u as oklchToLinear, z as paletteToCssGradient, $ as resolveRenderMode, Q as useAurora, be as useCursorInteraction };