@actioneer/ads 0.1.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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/bin/ads-init.mjs +314 -0
  3. package/components/accordion.d.ts +13 -0
  4. package/components/accordion.js +91 -0
  5. package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
  6. package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
  7. package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
  8. package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
  9. package/components/agents-ui/react-shader-toy.d.ts +87 -0
  10. package/components/agents-ui/react-shader-toy.js +531 -0
  11. package/components/ai-elements/chain-of-thought.d.ts +30 -0
  12. package/components/ai-elements/chain-of-thought.js +182 -0
  13. package/components/ai-elements/index.d.ts +11 -0
  14. package/components/ai-elements/inline-citation.d.ts +44 -0
  15. package/components/ai-elements/inline-citation.js +314 -0
  16. package/components/ai-elements/message.d.ts +96 -0
  17. package/components/ai-elements/message.js +308 -0
  18. package/components/ai-elements/queue.d.ts +60 -0
  19. package/components/ai-elements/queue.js +193 -0
  20. package/components/ai-elements/reasoning.d.ts +26 -0
  21. package/components/ai-elements/reasoning.js +131 -0
  22. package/components/ai-elements/shimmer.d.ts +25 -0
  23. package/components/ai-elements/shimmer.js +44 -0
  24. package/components/ai-elements/speech-input.d.ts +16 -0
  25. package/components/ai-elements/speech-input.js +151 -0
  26. package/components/ai-elements/task-progress.d.ts +41 -0
  27. package/components/ai-elements/task-progress.js +211 -0
  28. package/components/ai-elements/task.d.ts +35 -0
  29. package/components/ai-elements/task.js +73 -0
  30. package/components/ai-elements/tool.d.ts +53 -0
  31. package/components/ai-elements/tool.js +116 -0
  32. package/components/ai-elements/voice.d.ts +74 -0
  33. package/components/ai-elements/voice.js +875 -0
  34. package/components/alert.d.ts +21 -0
  35. package/components/alert.js +76 -0
  36. package/components/answer.d.ts +984 -0
  37. package/components/answer.js +543 -0
  38. package/components/assistant-ui/action-bar.d.ts +3 -0
  39. package/components/assistant-ui/action-bar.js +57 -0
  40. package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
  41. package/components/assistant-ui/answer-tool-ui.js +42 -0
  42. package/components/assistant-ui/attachment.d.ts +50 -0
  43. package/components/assistant-ui/attachment.js +353 -0
  44. package/components/assistant-ui/badge.d.ts +11 -0
  45. package/components/assistant-ui/badge.js +54 -0
  46. package/components/assistant-ui/branch-picker.d.ts +3 -0
  47. package/components/assistant-ui/branch-picker.js +36 -0
  48. package/components/assistant-ui/chain-of-thought.d.ts +46 -0
  49. package/components/assistant-ui/composer-add-context.d.ts +50 -0
  50. package/components/assistant-ui/composer-add-context.js +209 -0
  51. package/components/assistant-ui/composer-deep-research.d.ts +16 -0
  52. package/components/assistant-ui/composer-deep-research.js +38 -0
  53. package/components/assistant-ui/composer-harness.d.ts +18 -0
  54. package/components/assistant-ui/composer-harness.js +186 -0
  55. package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
  56. package/components/assistant-ui/composer-trigger-popover.js +147 -0
  57. package/components/assistant-ui/composer.d.ts +8 -0
  58. package/components/assistant-ui/composer.js +276 -0
  59. package/components/assistant-ui/directive-text.d.ts +16 -0
  60. package/components/assistant-ui/directive-text.js +40 -0
  61. package/components/assistant-ui/error.d.ts +6 -0
  62. package/components/assistant-ui/error.js +39 -0
  63. package/components/assistant-ui/file.d.ts +37 -0
  64. package/components/assistant-ui/file.js +159 -0
  65. package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
  66. package/components/assistant-ui/follow-up-suggestions.js +44 -0
  67. package/components/assistant-ui/image.d.ts +46 -0
  68. package/components/assistant-ui/image.js +351 -0
  69. package/components/assistant-ui/index.d.ts +28 -0
  70. package/components/assistant-ui/markdown-text.d.ts +1 -0
  71. package/components/assistant-ui/markdown-text.js +242 -0
  72. package/components/assistant-ui/message-timing.d.ts +25 -0
  73. package/components/assistant-ui/message-timing.js +56 -0
  74. package/components/assistant-ui/message.d.ts +4 -0
  75. package/components/assistant-ui/message.js +159 -0
  76. package/components/assistant-ui/primitives.d.ts +2 -0
  77. package/components/assistant-ui/quote.d.ts +37 -0
  78. package/components/assistant-ui/quote.js +150 -0
  79. package/components/assistant-ui/reasoning.d.ts +44 -0
  80. package/components/assistant-ui/reasoning.js +261 -0
  81. package/components/assistant-ui/selection-toolbar.d.ts +29 -0
  82. package/components/assistant-ui/selection-toolbar.js +91 -0
  83. package/components/assistant-ui/smart-message-text.d.ts +15 -0
  84. package/components/assistant-ui/smart-message-text.js +29 -0
  85. package/components/assistant-ui/sources.d.ts +17 -0
  86. package/components/assistant-ui/sources.js +121 -0
  87. package/components/assistant-ui/suggestions.d.ts +7 -0
  88. package/components/assistant-ui/suggestions.js +19 -0
  89. package/components/assistant-ui/thread-context.d.ts +37 -0
  90. package/components/assistant-ui/thread-context.js +8 -0
  91. package/components/assistant-ui/thread.d.ts +5 -0
  92. package/components/assistant-ui/thread.js +77 -0
  93. package/components/assistant-ui/tool-fallback.d.ts +36 -0
  94. package/components/assistant-ui/tool-fallback.js +428 -0
  95. package/components/assistant-ui/tool-group.d.ts +33 -0
  96. package/components/assistant-ui/tool-group.js +173 -0
  97. package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
  98. package/components/assistant-ui/tooltip-icon-button.js +31 -0
  99. package/components/assistant-ui/voice.d.ts +18 -0
  100. package/components/autocomplete.d.ts +18 -0
  101. package/components/autocomplete.js +162 -0
  102. package/components/avatar.d.ts +26 -0
  103. package/components/avatar.js +92 -0
  104. package/components/badge.d.ts +10 -0
  105. package/components/badge.js +83 -0
  106. package/components/brand-loader.d.ts +16 -0
  107. package/components/brand-loader.js +64 -0
  108. package/components/breadcrumbs.d.ts +8 -0
  109. package/components/breadcrumbs.js +58 -0
  110. package/components/button.d.ts +13 -0
  111. package/components/button.js +100 -0
  112. package/components/card.d.ts +19 -0
  113. package/components/card.js +82 -0
  114. package/components/carousel.d.ts +31 -0
  115. package/components/carousel.js +351 -0
  116. package/components/chart.d.ts +165 -0
  117. package/components/chart.js +841 -0
  118. package/components/checkbox.d.ts +13 -0
  119. package/components/checkbox.js +84 -0
  120. package/components/chip.d.ts +13 -0
  121. package/components/chip.js +112 -0
  122. package/components/collapsible.d.ts +5 -0
  123. package/components/collapsible.js +31 -0
  124. package/components/connector-card.d.ts +62 -0
  125. package/components/connector-card.js +154 -0
  126. package/components/divider.d.ts +23 -0
  127. package/components/divider.js +69 -0
  128. package/components/drawer.d.ts +45 -0
  129. package/components/drawer.js +234 -0
  130. package/components/dropdown.d.ts +33 -0
  131. package/components/dropdown.js +198 -0
  132. package/components/empty-state.d.ts +8 -0
  133. package/components/empty-state.js +30 -0
  134. package/components/field.d.ts +20 -0
  135. package/components/field.js +74 -0
  136. package/components/index.d.ts +56 -0
  137. package/components/index.js +444 -0
  138. package/components/input-field.d.ts +22 -0
  139. package/components/input-field.js +91 -0
  140. package/components/input.d.ts +8 -0
  141. package/components/input.js +61 -0
  142. package/components/kbd.d.ts +6 -0
  143. package/components/kbd.js +26 -0
  144. package/components/link.d.ts +14 -0
  145. package/components/link.js +72 -0
  146. package/components/modal.d.ts +18 -0
  147. package/components/modal.js +156 -0
  148. package/components/navbar.d.ts +15 -0
  149. package/components/navbar.js +68 -0
  150. package/components/number-field.d.ts +11 -0
  151. package/components/number-field.js +89 -0
  152. package/components/pagination.d.ts +28 -0
  153. package/components/pagination.js +179 -0
  154. package/components/panel.d.ts +14 -0
  155. package/components/panel.js +71 -0
  156. package/components/pixel-blast-svg.d.ts +22 -0
  157. package/components/pixel-blast-svg.js +154 -0
  158. package/components/popover.d.ts +20 -0
  159. package/components/popover.js +101 -0
  160. package/components/progress-circle.d.ts +11 -0
  161. package/components/progress-circle.js +75 -0
  162. package/components/progress.d.ts +22 -0
  163. package/components/progress.js +66 -0
  164. package/components/radio.d.ts +16 -0
  165. package/components/radio.js +101 -0
  166. package/components/segmented.d.ts +16 -0
  167. package/components/segmented.js +103 -0
  168. package/components/select.d.ts +28 -0
  169. package/components/select.js +180 -0
  170. package/components/selection-action-bar.d.ts +11 -0
  171. package/components/selection-action-bar.js +59 -0
  172. package/components/sidebar.d.ts +118 -0
  173. package/components/sidebar.js +375 -0
  174. package/components/skeleton.d.ts +6 -0
  175. package/components/skeleton.js +26 -0
  176. package/components/slider.d.ts +11 -0
  177. package/components/slider.js +62 -0
  178. package/components/spinner.d.ts +11 -0
  179. package/components/spinner.js +62 -0
  180. package/components/switch.d.ts +7 -0
  181. package/components/switch.js +61 -0
  182. package/components/table.d.ts +59 -0
  183. package/components/table.js +254 -0
  184. package/components/tabs.d.ts +29 -0
  185. package/components/tabs.js +371 -0
  186. package/components/textarea.d.ts +5 -0
  187. package/components/textarea.js +24 -0
  188. package/components/timeline.d.ts +7 -0
  189. package/components/timeline.js +47 -0
  190. package/components/toast.d.ts +74 -0
  191. package/components/toast.js +211 -0
  192. package/components/tooltip.d.ts +11 -0
  193. package/components/tooltip.js +143 -0
  194. package/components/tree.d.ts +42 -0
  195. package/components/tree.js +86 -0
  196. package/components/typography.d.ts +33 -0
  197. package/components/typography.js +65 -0
  198. package/components/ui/avatar.d.ts +11 -0
  199. package/components/ui/avatar.js +56 -0
  200. package/components/ui/button.d.ts +10 -0
  201. package/components/ui/button.js +57 -0
  202. package/components/ui/collapsible.d.ts +5 -0
  203. package/components/ui/collapsible.js +35 -0
  204. package/components/ui/dialog.d.ts +17 -0
  205. package/components/ui/dialog.js +93 -0
  206. package/components/ui/tabs.d.ts +22 -0
  207. package/components/ui/tooltip.d.ts +7 -0
  208. package/components/ui/tooltip.js +56 -0
  209. package/fonts/aribau-grotesk-400.otf +0 -0
  210. package/fonts/aribau-grotesk-700.otf +0 -0
  211. package/fonts.css +21 -0
  212. package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
  213. package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
  214. package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
  215. package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
  216. package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
  217. package/lib/cn.d.ts +3 -0
  218. package/lib/cn.js +9 -0
  219. package/lib/icons.d.ts +378 -0
  220. package/lib/icons.js +119 -0
  221. package/lib/interactive.d.ts +24 -0
  222. package/lib/interactive.js +36 -0
  223. package/lib/motion.d.ts +58 -0
  224. package/lib/motion.js +70 -0
  225. package/lib/router.d.ts +3 -0
  226. package/lib/utils.d.ts +6 -0
  227. package/llms.txt +537 -0
  228. package/manifest.json +5085 -0
  229. package/package.json +60 -0
  230. package/styles.css +653 -0
  231. package/theme.css +273 -0
@@ -0,0 +1,531 @@
1
+ "use client";
2
+ var Be = Object.defineProperty;
3
+ var $e = (c, i, n) => i in c ? Be(c, i, { enumerable: !0, configurable: !0, writable: !0, value: n }) : c[i] = n;
4
+ var v = (c, i, n) => $e(c, typeof i != "symbol" ? i + "" : i, n);
5
+ import { jsx as Ve } from "react/jsx-runtime";
6
+ import { useRef as p, useEffect as q } from "react";
7
+ const de = ["lowp", "mediump", "highp"], Ye = `
8
+ void main(void){
9
+ vec4 color = vec4(0.0,0.0,0.0,1.0);
10
+ mainImage( color, gl_FragCoord.xy );
11
+ gl_FragColor = color;
12
+ }`, Ge = `void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
13
+ vec2 uv = fragCoord/iResolution.xy;
14
+ vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));
15
+ fragColor = vec4(col,1.0);
16
+ }`, me = `attribute vec3 aVertexPosition;
17
+ void main(void) {
18
+ gl_Position = vec4(aVertexPosition, 1.0);
19
+ }`, le = "iTime", he = "iTimeDelta", ve = "iDate", pe = "iFrame", ge = "iMouse", Te = "iResolution", He = "iChannel", Ee = "iChannelResolution", Re = "iDeviceOrientation";
20
+ function je(c, i) {
21
+ return c.includes("Matrix") && Array.isArray(i);
22
+ }
23
+ function ze(c, i) {
24
+ return c.includes("v") && Array.isArray(i) && i.length > Number.parseInt(c.charAt(0));
25
+ }
26
+ function ke(c, i) {
27
+ return !c.includes("v") && Array.isArray(i) && i.length > Number.parseInt(c.charAt(0));
28
+ }
29
+ const qe = (c, i, n, s) => {
30
+ if (ke(n, s))
31
+ switch (n) {
32
+ case "2f":
33
+ return c.uniform2f(i, s[0], s[1]);
34
+ case "3f":
35
+ return c.uniform3f(i, s[0], s[1], s[2]);
36
+ case "4f":
37
+ return c.uniform4f(i, s[0], s[1], s[2], s[3]);
38
+ case "2i":
39
+ return c.uniform2i(i, s[0], s[1]);
40
+ case "3i":
41
+ return c.uniform3i(i, s[0], s[1], s[2]);
42
+ case "4i":
43
+ return c.uniform4i(i, s[0], s[1], s[2], s[3]);
44
+ }
45
+ if (typeof s == "number")
46
+ switch (n) {
47
+ case "1i":
48
+ return c.uniform1i(i, s);
49
+ default:
50
+ return c.uniform1f(i, s);
51
+ }
52
+ switch (n) {
53
+ case "1iv":
54
+ return c.uniform1iv(i, s);
55
+ case "2iv":
56
+ return c.uniform2iv(i, s);
57
+ case "3iv":
58
+ return c.uniform3iv(i, s);
59
+ case "4iv":
60
+ return c.uniform4iv(i, s);
61
+ case "1fv":
62
+ return c.uniform1fv(i, s);
63
+ case "2fv":
64
+ return c.uniform2fv(i, s);
65
+ case "3fv":
66
+ return c.uniform3fv(i, s);
67
+ case "4fv":
68
+ return c.uniform4fv(i, s);
69
+ case "Matrix2fv":
70
+ return c.uniformMatrix2fv(i, !1, s);
71
+ case "Matrix3fv":
72
+ return c.uniformMatrix3fv(i, !1, s);
73
+ case "Matrix4fv":
74
+ return c.uniformMatrix4fv(i, !1, s);
75
+ }
76
+ }, Ke = (c) => {
77
+ switch (c) {
78
+ case "1f":
79
+ return "float";
80
+ case "2f":
81
+ return "vec2";
82
+ case "3f":
83
+ return "vec3";
84
+ case "4f":
85
+ return "vec4";
86
+ case "1i":
87
+ return "int";
88
+ case "2i":
89
+ return "ivec2";
90
+ case "3i":
91
+ return "ivec3";
92
+ case "4i":
93
+ return "ivec4";
94
+ case "1iv":
95
+ return "int";
96
+ case "2iv":
97
+ return "ivec2";
98
+ case "3iv":
99
+ return "ivec3";
100
+ case "4iv":
101
+ return "ivec4";
102
+ case "1fv":
103
+ return "float";
104
+ case "2fv":
105
+ return "vec2";
106
+ case "3fv":
107
+ return "vec3";
108
+ case "4fv":
109
+ return "vec4";
110
+ case "Matrix2fv":
111
+ return "mat2";
112
+ case "Matrix3fv":
113
+ return "mat3";
114
+ case "Matrix4fv":
115
+ return "mat4";
116
+ default:
117
+ console.error(
118
+ N(`The uniform type "${c}" is not valid, please make sure your uniform type is valid`)
119
+ );
120
+ }
121
+ }, ie = 9729, we = 9728, We = 9987, _e = 33071, ye = 10497;
122
+ class Qe {
123
+ constructor(i) {
124
+ v(this, "gl");
125
+ v(this, "url");
126
+ v(this, "wrapS");
127
+ v(this, "wrapT");
128
+ v(this, "minFilter");
129
+ v(this, "magFilter");
130
+ v(this, "source");
131
+ v(this, "pow2canvas");
132
+ v(this, "isLoaded", !1);
133
+ v(this, "isVideo", !1);
134
+ v(this, "flipY", -1);
135
+ v(this, "width", 0);
136
+ v(this, "height", 0);
137
+ v(this, "_webglTexture", null);
138
+ v(this, "updateTexture", (i, n, s) => {
139
+ const { gl: T } = this, L = 0, H = T.RGBA, D = T.RGBA, F = T.UNSIGNED_BYTE;
140
+ T.bindTexture(T.TEXTURE_2D, i), T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL, s), T.texImage2D(T.TEXTURE_2D, L, H, D, F, n);
141
+ });
142
+ v(this, "setupVideo", (i) => {
143
+ const n = document.createElement("video");
144
+ let s = !1, T = !1;
145
+ n.autoplay = !0, n.muted = !0, n.loop = !0, n.crossOrigin = "anonymous";
146
+ const L = () => {
147
+ s && T && (this.isLoaded = !0);
148
+ };
149
+ return n.addEventListener(
150
+ "playing",
151
+ () => {
152
+ s = !0, this.width = n.videoWidth || 0, this.height = n.videoHeight || 0, L();
153
+ },
154
+ !0
155
+ ), n.addEventListener(
156
+ "timeupdate",
157
+ () => {
158
+ T = !0, L();
159
+ },
160
+ !0
161
+ ), n.src = i, n;
162
+ });
163
+ v(this, "makePowerOf2", (i) => {
164
+ if (i instanceof HTMLImageElement || i instanceof HTMLCanvasElement || i instanceof ImageBitmap) {
165
+ this.pow2canvas === void 0 && (this.pow2canvas = document.createElement("canvas")), this.pow2canvas.width = 2 ** Math.floor(Math.log(i.width) / Math.LN2), this.pow2canvas.height = 2 ** Math.floor(Math.log(i.height) / Math.LN2);
166
+ const n = this.pow2canvas.getContext("2d");
167
+ return n == null || n.drawImage(i, 0, 0, this.pow2canvas.width, this.pow2canvas.height), console.warn(
168
+ N(
169
+ `Image is not power of two ${i.width} x ${i.height}. Resized to ${this.pow2canvas.width} x ${this.pow2canvas.height};`
170
+ )
171
+ ), this.pow2canvas;
172
+ }
173
+ return i;
174
+ });
175
+ v(this, "load", async (i) => {
176
+ const { gl: n } = this, { url: s, wrapS: T, wrapT: L, minFilter: H, magFilter: D, flipY: F = -1 } = i;
177
+ if (!s)
178
+ return Promise.reject(
179
+ new Error(
180
+ N("Missing url, please make sure to pass the url of your texture { url: ... }")
181
+ )
182
+ );
183
+ const b = /(\.jpg|\.jpeg|\.png|\.gif|\.bmp)$/i.exec(s), M = /(\.mp4|\.3gp|\.webm|\.ogv)$/i.exec(s);
184
+ if (b === null && M === null)
185
+ return Promise.reject(
186
+ new Error(N(`Please upload a video or an image with a valid format (url: ${s})`))
187
+ );
188
+ Object.assign(this, { url: s, wrapS: T, wrapT: L, minFilter: H, magFilter: D, flipY: F });
189
+ const w = 0, I = n.RGBA, S = 1, P = 1, re = 0, u = n.RGBA, g = n.UNSIGNED_BYTE, j = new Uint8Array([255, 255, 255, 0]), m = n.createTexture();
190
+ if (n.bindTexture(n.TEXTURE_2D, m), n.texImage2D(
191
+ n.TEXTURE_2D,
192
+ w,
193
+ I,
194
+ S,
195
+ P,
196
+ re,
197
+ u,
198
+ g,
199
+ j
200
+ ), M) {
201
+ const x = this.setupVideo(s);
202
+ return n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), this._webglTexture = m, this.source = x, this.isVideo = !0, x.play().then(() => this);
203
+ }
204
+ async function z() {
205
+ return new Promise((x, K) => {
206
+ const _ = new Image();
207
+ _.crossOrigin = "anonymous", _.onload = () => {
208
+ x(_);
209
+ }, _.onerror = () => {
210
+ K(new Error(N(`failed loading url: ${s}`)));
211
+ }, _.src = s ?? "";
212
+ });
213
+ }
214
+ let E = await z(), C = (E.width & E.width - 1) === 0 && (E.height & E.height - 1) === 0;
215
+ return (i.wrapS !== _e || i.wrapT !== _e || i.minFilter !== we && i.minFilter !== ie) && !C && (E = this.makePowerOf2(E), C = !0), n.bindTexture(n.TEXTURE_2D, m), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, F), n.texImage2D(n.TEXTURE_2D, w, I, u, g, E), C && i.minFilter !== we && i.minFilter !== ie && n.generateMipmap(n.TEXTURE_2D), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, this.wrapS || ye), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, this.wrapT || ye), n.texParameteri(
216
+ n.TEXTURE_2D,
217
+ n.TEXTURE_MIN_FILTER,
218
+ this.minFilter || We
219
+ ), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, this.magFilter || ie), this._webglTexture = m, this.source = E, this.isVideo = !1, this.isLoaded = !0, this.width = E.width || 0, this.height = E.height || 0, this;
220
+ });
221
+ this.gl = i;
222
+ }
223
+ }
224
+ const N = (c) => `react-shaders: ${c}`, Ae = (c) => {
225
+ if ("changedTouches" in c) {
226
+ const i = c.changedTouches[0];
227
+ return [(i == null ? void 0 : i.clientX) ?? 0, (i == null ? void 0 : i.clientY) ?? 0];
228
+ }
229
+ return [c.clientX, c.clientY];
230
+ }, Le = (c, i, n) => c * (1 - n) + i * n, Je = (c, i, n) => n > 0 ? c.substring(0, n) + i + c.substring(n, c.length) : i + c;
231
+ function rt({
232
+ fs: c,
233
+ vs: i = me,
234
+ textures: n = [],
235
+ uniforms: s,
236
+ clearColor: T = [0, 0, 0, 1],
237
+ precision: L = "highp",
238
+ style: H,
239
+ contextAttributes: D = {},
240
+ lerp: F = 1,
241
+ devicePixelRatio: b = 1,
242
+ onDoneLoadingTextures: M,
243
+ onError: w = console.error,
244
+ onWarning: I = console.warn,
245
+ animateWhenNotVisible: S = !1,
246
+ paused: P = !1,
247
+ ...re
248
+ }) {
249
+ const u = p(null), g = p(null), j = p(null), m = p(null), z = p(void 0), E = p(void 0), C = p(void 0), x = p(!0), K = p(S), _ = p(P), Ue = p(!1), U = p(void 0), Fe = p(0), X = p([0, 0]), B = p([]), W = p(0), Q = p(void 0), a = p({
250
+ [le]: { type: "float", isNeeded: !1, value: 0 },
251
+ [he]: { type: "float", isNeeded: !1, value: 0 },
252
+ [ve]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
253
+ [ge]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
254
+ [Te]: { type: "vec2", isNeeded: !1, value: [0, 0] },
255
+ [pe]: { type: "int", isNeeded: !1, value: 0 },
256
+ [Re]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] }
257
+ }), se = p(s), ce = (e, t) => {
258
+ const r = "width" in e ? e.width ?? 0 : 0, o = "height" in e ? e.height ?? 0 : 0, f = a.current.iChannelResolution;
259
+ if (!f) return;
260
+ const l = Array.isArray(f.value) ? f.value : f.value = [];
261
+ l[t * 3] = r * b, l[t * 3 + 1] = o * b, l[t * 3 + 2] = 0;
262
+ }, Me = () => {
263
+ var e, t;
264
+ u.current && (g.current = u.current.getContext("webgl", D) || u.current.getContext(
265
+ "experimental-webgl",
266
+ D
267
+ ), (e = g.current) == null || e.getExtension("OES_standard_derivatives"), (t = g.current) == null || t.getExtension("EXT_shader_texture_lod"));
268
+ }, Ie = () => {
269
+ const e = g.current;
270
+ j.current = (e == null ? void 0 : e.createBuffer()) ?? null, e == null || e.bindBuffer(e.ARRAY_BUFFER, j.current);
271
+ const t = [1, 1, 0, -1, 1, 0, 1, -1, 0, -1, -1, 0];
272
+ e == null || e.bufferData(e.ARRAY_BUFFER, new Float32Array(t), e.STATIC_DRAW);
273
+ }, oe = ({ alpha: e, beta: t, gamma: r }) => {
274
+ a.current.iDeviceOrientation.value = [
275
+ e ?? 0,
276
+ t ?? 0,
277
+ r ?? 0,
278
+ window.orientation ?? 0
279
+ ];
280
+ }, J = (e) => {
281
+ var h, R, y, O;
282
+ const [t = 0, r = 0] = Ae(e), o = t - (((h = U.current) == null ? void 0 : h.left) ?? 0) - window.pageXOffset, f = (((R = U.current) == null ? void 0 : R.height) ?? 0) - r - (((y = U.current) == null ? void 0 : y.top) ?? 0) - window.pageYOffset;
283
+ Ue.current = !0;
284
+ const l = Array.isArray((O = a.current.iMouse) == null ? void 0 : O.value) ? a.current.iMouse.value : void 0;
285
+ l && (l[2] = o, l[3] = f), X.current[0] = o, X.current[1] = f;
286
+ }, Z = (e) => {
287
+ var l, h, R, y, O;
288
+ U.current = (l = u.current) == null ? void 0 : l.getBoundingClientRect();
289
+ const [t = 0, r = 0] = Ae(e), o = t - (((h = U.current) == null ? void 0 : h.left) ?? 0), f = (((R = U.current) == null ? void 0 : R.height) ?? 0) - r - (((y = U.current) == null ? void 0 : y.top) ?? 0);
290
+ if (F !== 1)
291
+ X.current[0] = o, X.current[1] = f;
292
+ else {
293
+ const Y = Array.isArray((O = a.current.iMouse) == null ? void 0 : O.value) ? a.current.iMouse.value : void 0;
294
+ Y && (Y[0] = o, Y[1] = f);
295
+ }
296
+ }, $ = () => {
297
+ var t;
298
+ const e = Array.isArray((t = a.current.iMouse) == null ? void 0 : t.value) ? a.current.iMouse.value : void 0;
299
+ e && (e[2] = 0, e[3] = 0);
300
+ }, ee = () => {
301
+ var f, l, h, R;
302
+ const e = g.current;
303
+ if (!e) return;
304
+ U.current = (f = u.current) == null ? void 0 : f.getBoundingClientRect();
305
+ const t = b, r = Math.floor((((l = U.current) == null ? void 0 : l.width) ?? 1) * t), o = Math.floor((((h = U.current) == null ? void 0 : h.height) ?? 1) * t);
306
+ if (e.canvas.width = r, e.canvas.height = o, (R = a.current.iResolution) != null && R.isNeeded && m.current) {
307
+ const y = e.getUniformLocation(m.current, Te);
308
+ e.uniform2fv(y, [e.canvas.width, e.canvas.height]);
309
+ }
310
+ }, ue = (e, t) => {
311
+ const r = g.current;
312
+ if (!r) return null;
313
+ const o = r.createShader(e);
314
+ if (!o) return null;
315
+ if (r.shaderSource(o, t), r.compileShader(o), !r.getShaderParameter(o, r.COMPILE_STATUS)) {
316
+ I == null || I(N(`Error compiling the shader:
317
+ ${t}`));
318
+ const f = r.getShaderInfoLog(o);
319
+ r.deleteShader(o), w == null || w(N(`Shader compiler log: ${f}`));
320
+ }
321
+ return o;
322
+ }, Ne = (e, t) => {
323
+ const r = g.current;
324
+ if (!r) return;
325
+ const o = ue(r.FRAGMENT_SHADER, e), f = ue(r.VERTEX_SHADER, t);
326
+ if (m.current = r.createProgram(), !(!m.current || !f || !o)) {
327
+ if (r.attachShader(m.current, f), r.attachShader(m.current, o), r.linkProgram(m.current), !r.getProgramParameter(m.current, r.LINK_STATUS)) {
328
+ w == null || w(
329
+ N(
330
+ `Unable to initialize the shader program: ${r.getProgramInfoLog(m.current)}`
331
+ )
332
+ );
333
+ return;
334
+ }
335
+ r.useProgram(m.current), z.current = r.getAttribLocation(
336
+ m.current,
337
+ "aVertexPosition"
338
+ ), r.enableVertexAttribArray(z.current);
339
+ }
340
+ }, Se = () => {
341
+ if (s)
342
+ for (const e of Object.keys(s)) {
343
+ const t = s[e];
344
+ if (!t) continue;
345
+ const { value: r, type: o } = t, f = Ke(o);
346
+ if (!f) continue;
347
+ const l = {};
348
+ if (je(o, r)) {
349
+ const h = o.length, R = Number.parseInt(o.charAt(h - 3)), y = Math.floor(r.length / (R * R));
350
+ r.length > R * R && (l.arraySize = `[${y}]`);
351
+ } else ze(o, r) && (l.arraySize = `[${Math.floor(r.length / Number.parseInt(o.charAt(0)))}]`);
352
+ a.current[e] = { type: f, isNeeded: !1, value: r, ...l };
353
+ }
354
+ }, xe = () => {
355
+ const e = g.current;
356
+ if (e)
357
+ if (n && n.length > 0) {
358
+ a.current[`${Ee}`] = {
359
+ type: "vec3",
360
+ isNeeded: !1,
361
+ arraySize: `[${n.length}]`,
362
+ value: []
363
+ };
364
+ const t = n.map((r, o) => {
365
+ var f;
366
+ return a.current[`${He}${o}`] = {
367
+ type: "sampler2D",
368
+ isNeeded: !1
369
+ }, ce(r, o), B.current[o] = new Qe(e), (f = B.current[o]) == null ? void 0 : f.load(r).then((l) => {
370
+ ce(l, o);
371
+ });
372
+ });
373
+ Promise.all(t).then(() => {
374
+ M && M();
375
+ }).catch((r) => {
376
+ w == null || w(r), M && M();
377
+ });
378
+ } else M && M();
379
+ }, Oe = (e) => {
380
+ const t = de.includes(L ?? "highp"), r = `precision ${t ? L : de[1]} float;
381
+ `;
382
+ t || I == null || I(
383
+ N(
384
+ `wrong precision type ${L}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`
385
+ )
386
+ );
387
+ let o = r.concat(`#define DPR ${b.toFixed(1)}
388
+ `).concat(e.replace(/texture\(/g, "texture2D("));
389
+ for (const l of Object.keys(a.current))
390
+ if (e.includes(l)) {
391
+ const h = a.current[l];
392
+ if (!h) continue;
393
+ o = Je(
394
+ o,
395
+ `uniform ${h.type} ${l}${h.arraySize || ""};
396
+ `,
397
+ o.lastIndexOf(r) + r.length
398
+ ), h.isNeeded = !0;
399
+ }
400
+ return e.includes("mainImage") && (o = o.concat(Ye)), o;
401
+ }, Pe = (e) => {
402
+ var f, l, h, R, y, O, Y, ae, fe;
403
+ const t = g.current;
404
+ if (!t || !m.current) return;
405
+ const r = !_.current && W.current ? (e - W.current) / 1e3 : 0;
406
+ W.current = e;
407
+ const o = se.current;
408
+ if (o)
409
+ for (const d of Object.keys(o)) {
410
+ const A = o[d];
411
+ if (A && (f = a.current[d]) != null && f.isNeeded) {
412
+ if (!m.current) return;
413
+ const G = t.getUniformLocation(m.current, d);
414
+ if (!G) return;
415
+ qe(
416
+ t,
417
+ G,
418
+ A.type,
419
+ A.value
420
+ );
421
+ }
422
+ }
423
+ if ((l = a.current.iMouse) != null && l.isNeeded) {
424
+ const d = t.getUniformLocation(m.current, ge);
425
+ t.uniform4fv(d, a.current.iMouse.value);
426
+ }
427
+ if ((h = a.current.iChannelResolution) != null && h.isNeeded) {
428
+ const d = t.getUniformLocation(
429
+ m.current,
430
+ Ee
431
+ );
432
+ t.uniform3fv(d, a.current.iChannelResolution.value);
433
+ }
434
+ if ((R = a.current.iDeviceOrientation) != null && R.isNeeded) {
435
+ const d = t.getUniformLocation(
436
+ m.current,
437
+ Re
438
+ );
439
+ t.uniform4fv(
440
+ d,
441
+ a.current.iDeviceOrientation.value
442
+ );
443
+ }
444
+ if ((y = a.current.iTime) != null && y.isNeeded) {
445
+ const d = t.getUniformLocation(m.current, le);
446
+ t.uniform1f(d, Fe.current += r);
447
+ }
448
+ if ((O = a.current.iTimeDelta) != null && O.isNeeded) {
449
+ const d = t.getUniformLocation(m.current, he);
450
+ t.uniform1f(d, r);
451
+ }
452
+ if ((Y = a.current.iDate) != null && Y.isNeeded) {
453
+ const d = /* @__PURE__ */ new Date(), A = d.getMonth() + 1, G = d.getDate(), k = d.getFullYear(), te = d.getHours() * 60 * 60 + d.getMinutes() * 60 + d.getSeconds() + d.getMilliseconds() * 1e-3, ne = t.getUniformLocation(m.current, ve);
454
+ t.uniform4fv(ne, [k, A, G, te]);
455
+ }
456
+ if ((ae = a.current.iFrame) != null && ae.isNeeded) {
457
+ const d = t.getUniformLocation(m.current, pe), A = a.current.iFrame.value;
458
+ t.uniform1i(d, A), a.current.iFrame.value = A + 1;
459
+ }
460
+ if (B.current.length > 0)
461
+ for (let d = 0; d < B.current.length; d++) {
462
+ const A = B.current[d];
463
+ if (!A) return;
464
+ const { isVideo: G, _webglTexture: k, source: te, flipY: ne, isLoaded: Ce } = A;
465
+ if (!Ce || !k || !te) return;
466
+ if ((fe = a.current[`iChannel${d}`]) != null && fe.isNeeded) {
467
+ if (!m.current) return;
468
+ const Xe = t.getUniformLocation(m.current, `iChannel${d}`);
469
+ t.activeTexture(t.TEXTURE0 + d), t.bindTexture(t.TEXTURE_2D, k), t.uniform1i(Xe, d), G && A.updateTexture(k, te, ne);
470
+ }
471
+ }
472
+ }, V = (e) => {
473
+ var o, f;
474
+ const t = g.current;
475
+ if (!t) return;
476
+ t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, j.current), t.vertexAttribPointer(z.current ?? 0, 3, t.FLOAT, !1, 0, 0), Pe(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
477
+ const r = (o = a.current.iMouse) == null ? void 0 : o.value;
478
+ if ((f = a.current.iMouse) != null && f.isNeeded && F !== 1 && Array.isArray(r)) {
479
+ const l = r[0] ?? 0, h = r[1] ?? 0;
480
+ r[0] = Le(l, X.current[0] ?? 0, F), r[1] = Le(h, X.current[1] ?? 0, F);
481
+ }
482
+ !_.current && (K.current || x.current) && (E.current = requestAnimationFrame(V));
483
+ }, De = () => {
484
+ var t, r;
485
+ const e = { passive: !0 };
486
+ (t = a.current.iMouse) != null && t.isNeeded && u.current && (u.current.addEventListener("mousemove", Z, e), u.current.addEventListener("mouseout", $, e), u.current.addEventListener("mouseup", $, e), u.current.addEventListener("mousedown", J, e), u.current.addEventListener("touchmove", Z, e), u.current.addEventListener("touchend", $, e), u.current.addEventListener("touchstart", J, e)), (r = a.current.iDeviceOrientation) != null && r.isNeeded && window.addEventListener("deviceorientation", oe, e), u.current && (Q.current = new ResizeObserver(ee), Q.current.observe(u.current), window.addEventListener("resize", ee, e));
487
+ }, be = () => {
488
+ var t, r;
489
+ const e = { passive: !0 };
490
+ (t = a.current.iMouse) != null && t.isNeeded && u.current && (u.current.removeEventListener("mousemove", Z, e), u.current.removeEventListener("mouseout", $, e), u.current.removeEventListener("mouseup", $, e), u.current.removeEventListener("mousedown", J, e), u.current.removeEventListener("touchmove", Z, e), u.current.removeEventListener("touchend", $, e), u.current.removeEventListener("touchstart", J, e)), (r = a.current.iDeviceOrientation) != null && r.isNeeded && window.removeEventListener("deviceorientation", oe, e), Q.current && (Q.current.disconnect(), window.removeEventListener("resize", ee, e));
491
+ };
492
+ return q(() => {
493
+ se.current = s, _.current && g.current && (E.current = requestAnimationFrame(V));
494
+ }, [s]), q(() => {
495
+ const e = _.current;
496
+ _.current = P, !P && e && g.current ? (W.current = performance.now(), E.current = requestAnimationFrame(V)) : P && g.current && (E.current = requestAnimationFrame(V));
497
+ }, [P]), q(() => {
498
+ K.current = S, S && (x.current = !0);
499
+ }, [S]), q(() => {
500
+ if (S || !u.current) return;
501
+ const e = u.current, t = new IntersectionObserver(
502
+ (r) => {
503
+ for (const o of r)
504
+ x.current = o.isIntersecting, o.isIntersecting && !_.current && requestAnimationFrame(V);
505
+ },
506
+ { threshold: 0 }
507
+ );
508
+ return t.observe(e), () => t.disconnect();
509
+ }, [S]), q(() => {
510
+ const e = B.current;
511
+ function t() {
512
+ Me();
513
+ const r = g.current;
514
+ r && u.current && (r.clearColor(...T), r.clearDepth(1), r.enable(r.DEPTH_TEST), r.depthFunc(r.LEQUAL), r.viewport(0, 0, u.current.width, u.current.height), u.current.height = u.current.clientHeight, u.current.width = u.current.clientWidth, Se(), xe(), Ne(Oe(c || Ge), i || me), Ie(), requestAnimationFrame(V), De(), ee());
515
+ }
516
+ return C.current = requestAnimationFrame(t), () => {
517
+ var o;
518
+ const r = g.current;
519
+ if (r) {
520
+ if ((o = r.getExtension("WEBGL_lose_context")) == null || o.loseContext(), r.useProgram(null), r.deleteProgram(m.current ?? null), e.length > 0)
521
+ for (const f of e)
522
+ r.deleteTexture(f._webglTexture);
523
+ m.current = null;
524
+ }
525
+ be(), cancelAnimationFrame(C.current ?? 0), cancelAnimationFrame(E.current ?? 0);
526
+ };
527
+ }, []), /* @__PURE__ */ Ve("canvas", { ref: u, style: H, ...re });
528
+ }
529
+ export {
530
+ rt as ReactShaderToy
531
+ };
@@ -0,0 +1,30 @@
1
+ import { Badge } from '../badge';
2
+ import { CollapsibleContent, CollapsibleTrigger } from '../collapsible';
3
+ import { ComponentProps, ComponentType, ReactNode } from 'react';
4
+ export type ChainOfThoughtProps = ComponentProps<"div"> & {
5
+ open?: boolean;
6
+ defaultOpen?: boolean;
7
+ onOpenChange?: (open: boolean) => void;
8
+ };
9
+ export declare const ChainOfThought: import('react').MemoExoticComponent<({ className, open, defaultOpen, onOpenChange, children, ...props }: ChainOfThoughtProps) => import("react").JSX.Element>;
10
+ export type ChainOfThoughtHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
11
+ export declare const ChainOfThoughtHeader: import('react').MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtHeaderProps) => import("react").JSX.Element>;
12
+ export type ChainOfThoughtStepProps = ComponentProps<"div"> & {
13
+ icon?: ComponentType<{
14
+ className?: string;
15
+ }>;
16
+ label: ReactNode;
17
+ description?: ReactNode;
18
+ status?: "complete" | "active" | "pending";
19
+ };
20
+ export declare const ChainOfThoughtStep: import('react').MemoExoticComponent<({ className, icon: Icon, label, description, status, children, ...props }: ChainOfThoughtStepProps) => import("react").JSX.Element>;
21
+ export type ChainOfThoughtSearchResultsProps = ComponentProps<"div">;
22
+ export declare const ChainOfThoughtSearchResults: import('react').MemoExoticComponent<({ className, ...props }: ChainOfThoughtSearchResultsProps) => import("react").JSX.Element>;
23
+ export type ChainOfThoughtSearchResultProps = ComponentProps<typeof Badge>;
24
+ export declare const ChainOfThoughtSearchResult: import('react').MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtSearchResultProps) => import("react").JSX.Element>;
25
+ export type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;
26
+ export declare const ChainOfThoughtContent: import('react').MemoExoticComponent<({ className, children, ...props }: ChainOfThoughtContentProps) => import("react").JSX.Element>;
27
+ export type ChainOfThoughtImageProps = ComponentProps<"div"> & {
28
+ caption?: string;
29
+ };
30
+ export declare const ChainOfThoughtImage: import('react').MemoExoticComponent<({ className, children, caption, ...props }: ChainOfThoughtImageProps) => import("react").JSX.Element>;