jaml-ui 0.26.6 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +11 -6
  2. package/dist/assets/{searchPoolWorker-CejAnH4a.js → searchPoolWorker-BtlROziN.js} +9 -4
  3. package/dist/assets/searchPoolWorker-BtlROziN.js.map +1 -0
  4. package/dist/chunks/Layer-BBPJFHfs.js.map +1 -1
  5. package/dist/chunks/assets-RWUiFSTc.js.map +1 -1
  6. package/dist/chunks/motelyItemDecoder-BvFrQpaI.js +2061 -0
  7. package/dist/chunks/motelyItemDecoder-BvFrQpaI.js.map +1 -0
  8. package/dist/chunks/{searchPoolWorker-CTtPOuxF.js → searchPoolWorker-D1xR43D2.js} +2 -2
  9. package/dist/chunks/searchPoolWorker-D1xR43D2.js.map +1 -0
  10. package/dist/chunks/spriteMapper-CFjN0_TV.js.map +1 -1
  11. package/dist/chunks/tokens-B65Fzble.js.map +1 -1
  12. package/dist/chunks/ui-BEtq_JNg.js +3229 -0
  13. package/dist/chunks/ui-BEtq_JNg.js.map +1 -0
  14. package/dist/components/JamlAestheticSelector.d.ts +2 -3
  15. package/dist/components/JamlIdeToolbar.d.ts +3 -1
  16. package/dist/components/JamlSeedInput.d.ts +14 -4
  17. package/dist/components/JamlSeedSpinner.d.ts +7 -0
  18. package/dist/components/Jamlyzer.d.ts +5 -1
  19. package/dist/components/RunConfigModal.d.ts +1 -1
  20. package/dist/components/jamlSeedUtils.d.ts +1 -0
  21. package/dist/config.d.ts +5 -4
  22. package/dist/core.js.map +1 -1
  23. package/dist/decode/motelyItemFormats.d.ts +3124 -0
  24. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  25. package/dist/hooks/useMotelyRuntime.d.ts +1 -1
  26. package/dist/hooks/useSearch.d.ts +3 -3
  27. package/dist/index.d.ts +4 -2
  28. package/dist/index.js +3298 -3268
  29. package/dist/index.js.map +1 -1
  30. package/dist/lib/hooks/useDragScroll.d.ts +1 -1
  31. package/dist/motely.d.ts +2 -2
  32. package/dist/motely.js +23 -22
  33. package/dist/motely.js.map +1 -1
  34. package/dist/r3f.js.map +1 -1
  35. package/dist/ui/JimboPanelSpinner.d.ts +15 -0
  36. package/dist/ui/footer.d.ts +7 -1
  37. package/dist/ui/hooks.d.ts +2 -2
  38. package/dist/ui/jimbo.css +1 -1
  39. package/dist/ui/jimboText.d.ts +4 -6
  40. package/dist/ui/panel.d.ts +1 -2
  41. package/dist/ui.d.ts +2 -0
  42. package/dist/ui.js +3 -3
  43. package/jaml.schema.json +1219 -1165
  44. package/package.json +20 -22
  45. package/DESIGN.md +0 -236
  46. package/dist/assets/searchPoolWorker-CejAnH4a.js.map +0 -1
  47. package/dist/chunks/motelyItemDecoder-Bg12hhB2.js +0 -248
  48. package/dist/chunks/motelyItemDecoder-Bg12hhB2.js.map +0 -1
  49. package/dist/chunks/searchPoolWorker-CTtPOuxF.js.map +0 -1
  50. package/dist/chunks/ui-ByciFBYB.js +0 -1387
  51. package/dist/chunks/ui-ByciFBYB.js.map +0 -1
  52. package/dist/motelyBoot.d.ts +0 -15
  53. package/dist/ui/ide/DeckSprite.d.ts +0 -1
@@ -1,1387 +0,0 @@
1
- import { n as e } from "./assets-RWUiFSTc.js";
2
- import { n as t, t as n } from "./tokens-B65Fzble.js";
3
- import { n as r, p as i, r as a, t as o } from "./spriteMapper-CFjN0_TV.js";
4
- import s, { memo as c, useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
5
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
6
- //#region src/ui/hooks.ts
7
- function _(e) {
8
- return new Promise((t) => {
9
- let n = new window.Image();
10
- n.addEventListener("load", () => t(n)), n.addEventListener("error", () => t(null)), n.src = e;
11
- });
12
- }
13
- function v(e, t, n, r, i) {
14
- if (!n || !r || !r?.pos) return 0;
15
- let a = n.width / r.columns, o = n.height / r.rows, s = e.style;
16
- if (r.order === 0 && (e.width = a, e.height = o, s.width = `${a}px`, s.height = `${o}px`), s.imageRendering = "pixelated", t.imageSmoothingEnabled = !0, t.save(), r.animated && i) {
17
- let e = i, n = Math.sin(e / 1e3) * 3, r = Math.sin(e / 1500) * 1.5;
18
- t.globalAlpha = .65 + (Math.sin(e / 2e3) + 1) * .075, t.translate(r, n);
19
- }
20
- return t.drawImage(n, r.pos.x * a, r.pos.y * o, a, o, 0, 0, e.width, e.height), t.restore(), a / o;
21
- }
22
- function y(e) {
23
- let t = f(null);
24
- return u(() => {
25
- if (!e || !t.current) return;
26
- let r, i = Date.now(), a = t.current, o = () => {
27
- let e = (Date.now() - i) % n.SWAY_DURATION / n.SWAY_DURATION * Math.PI * 2;
28
- a.style.transform = `translate(${Math.sin(e) * n.SWAY_AMOUNT * .3}px, ${Math.sin(e * .8) * n.SWAY_AMOUNT}px)`, r = requestAnimationFrame(o);
29
- };
30
- return r = requestAnimationFrame(o), () => {
31
- cancelAnimationFrame(r), a && (a.style.transform = "");
32
- };
33
- }, [e]), t;
34
- }
35
- function b() {
36
- let e = f(null);
37
- return u(() => {
38
- let t = e.current;
39
- if (!t) return;
40
- let n = t.getContext("webgl");
41
- if (!n) return;
42
- let r = (e, t) => {
43
- let r = n.createShader(e);
44
- return r ? (n.shaderSource(r, t), n.compileShader(r), n.getShaderParameter(r, n.COMPILE_STATUS) ? r : (console.error("[JimboBackground] shader compile error:", n.getShaderInfoLog(r)), n.deleteShader(r), null)) : null;
45
- }, i = r(n.VERTEX_SHADER, "\n attribute vec2 position;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n }\n "), a = r(n.FRAGMENT_SHADER, "\n precision mediump float;\n\n uniform float u_time;\n uniform vec2 u_resolution;\n\n const float SPIN_ROTATION = -2.0;\n const float SPIN_SPEED = 4.5;\n const vec4 COLOUR_1 = vec4(1.0, 0.2, 0.2, 1.0);\n const vec4 COLOUR_2 = vec4(0.0, 0.5, 1.0, 1.0);\n const vec4 COLOUR_3 = vec4(0.05, 0.08, 0.1, 1.0);\n const float CONTRAST = 4.5;\n const float LIGTHING = 0.5;\n const float SPIN_AMOUNT = 0.35;\n const float PIXEL_FILTER = 1024.0;\n const float PI = 3.14159265359;\n\n void main() {\n vec2 screenSize = u_resolution;\n float pixel_size = length(screenSize.xy) / PIXEL_FILTER;\n vec2 uv = (floor(gl_FragCoord.xy*(1.0/pixel_size))*pixel_size - 0.5*screenSize.xy)/length(screenSize.xy);\n float uv_len = length(uv);\n\n float speed = (SPIN_ROTATION * 0.2) + 302.2;\n float new_pixel_angle = atan(uv.y, uv.x) + speed - 20.0*(1.0*SPIN_AMOUNT*uv_len + (1.0 - 1.0*SPIN_AMOUNT));\n\n vec2 mid = (screenSize.xy/length(screenSize.xy))/2.0;\n uv = (vec2((uv_len * cos(new_pixel_angle) + mid.x), (uv_len * sin(new_pixel_angle) + mid.y)) - mid);\n\n uv *= 30.0;\n speed = u_time * SPIN_SPEED;\n vec2 uv2 = vec2(uv.x, uv.y);\n\n for(int i=0; i < 5; i++) {\n uv2 += sin(max(uv.x, uv.y)) + uv;\n uv += 0.5*vec2(cos(5.1123314 + 0.353*uv2.y + speed*0.131121), sin(uv2.x - 0.113*speed));\n uv -= 1.0*cos(uv.x + uv.y) - 1.0*sin(uv.x*0.711 - uv.y);\n }\n\n float contrast_mod = (0.25*CONTRAST + 0.5*SPIN_AMOUNT + 1.2);\n float paint_res = min(2.0, max(0.0, length(uv)*(0.035)*contrast_mod));\n float c1p = max(0.0, 1.0 - contrast_mod*abs(1.0 - paint_res));\n float c2p = max(0.0, 1.0 - contrast_mod*abs(paint_res));\n float c3p = 1.0 - min(1.0, c1p + c2p);\n float light = (LIGTHING - 0.2)*max(c1p*5.0 - 4.0, 0.0) + LIGTHING*max(c2p*5.0 - 4.0, 0.0);\n\n vec4 finalCol = (0.3/CONTRAST)*COLOUR_1 + (1.0 - 0.3/CONTRAST)*(COLOUR_1*c1p + COLOUR_2*c2p + vec4(c3p*COLOUR_3.rgb, c3p*COLOUR_1.a)) + light;\n\n gl_FragColor = finalCol;\n }\n ");
46
- if (!i || !a) return;
47
- let o = n.createProgram();
48
- if (!o) return;
49
- if (n.attachShader(o, i), n.attachShader(o, a), n.linkProgram(o), !n.getProgramParameter(o, n.LINK_STATUS)) {
50
- console.error("[JimboBackground] program link error:", n.getProgramInfoLog(o));
51
- return;
52
- }
53
- n.useProgram(o);
54
- let s = n.createBuffer();
55
- n.bindBuffer(n.ARRAY_BUFFER, s), n.bufferData(n.ARRAY_BUFFER, new Float32Array([
56
- -1,
57
- -1,
58
- 1,
59
- -1,
60
- -1,
61
- 1,
62
- -1,
63
- 1,
64
- 1,
65
- -1,
66
- 1,
67
- 1
68
- ]), n.STATIC_DRAW);
69
- let c = n.getAttribLocation(o, "position");
70
- n.enableVertexAttribArray(c), n.vertexAttribPointer(c, 2, n.FLOAT, !1, 0, 0);
71
- let l = n.getUniformLocation(o, "u_time"), u = n.getUniformLocation(o, "u_resolution"), d = Date.now(), f, p = () => {
72
- let e = t.clientWidth, r = t.clientHeight;
73
- (t.width !== e || t.height !== r) && (t.width = e, t.height = r, n.viewport(0, 0, n.drawingBufferWidth, n.drawingBufferHeight));
74
- let i = (Date.now() - d) / 1e3;
75
- n.uniform1f(l, i), n.uniform2f(u, t.width, t.height), n.drawArrays(n.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
76
- };
77
- return p(), () => {
78
- cancelAnimationFrame(f), n.deleteProgram(o), n.deleteShader(i), n.deleteShader(a), n.deleteBuffer(s);
79
- };
80
- }, []), e;
81
- }
82
- function x({ mode: e = "snap", placement: t = "auto", delay: n = 80, disabled: r = !1 }) {
83
- let [i, a] = p(!1), [o, s] = p(null), c = f(null), d = f(null), m = f(null), h = l(() => {
84
- r || (m.current && clearTimeout(m.current), m.current = setTimeout(() => a(!0), n));
85
- }, [r, n]), g = l(() => {
86
- m.current && clearTimeout(m.current), a(!1), s(null);
87
- }, []), _ = l(() => {
88
- let e = c.current, n = d.current;
89
- if (!e || !n) return;
90
- let r = e.getBoundingClientRect(), i = n.getBoundingClientRect(), a = r.top, o = t === "top" ? "top" : t === "bottom" ? "bottom" : a >= i.height + 12 ? "top" : "bottom", l = r.left + r.width / 2 - i.width / 2, u = o === "top" ? r.top - i.height - 8 : r.bottom + 8;
91
- s({
92
- left: Math.max(8, Math.min(window.innerWidth - i.width - 8, l)),
93
- top: u,
94
- align: o
95
- });
96
- }, [t]);
97
- return u(() => {
98
- if (!i || e !== "snap") return;
99
- let t = requestAnimationFrame(_);
100
- return window.addEventListener("resize", _), window.addEventListener("scroll", _, !0), () => {
101
- cancelAnimationFrame(t), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
102
- };
103
- }, [
104
- i,
105
- e,
106
- _
107
- ]), u(() => () => {
108
- m.current && clearTimeout(m.current);
109
- }, []), {
110
- visible: i,
111
- pos: o,
112
- targetRef: c,
113
- tooltipRef: d,
114
- show: h,
115
- hide: g,
116
- handleMouseMove: l((t) => {
117
- e === "mouse" && s({
118
- left: t.clientX + 12,
119
- top: t.clientY + 16,
120
- align: "bottom"
121
- });
122
- }, [e])
123
- };
124
- }
125
- function S({ layers: e, invert: t = !1, hoverTilt: n = !1 }) {
126
- let r = f(null), a = f(/* @__PURE__ */ new Map()), [o, s] = p(3 / 4), [, c] = p(0), l = f(null), [d, m] = p(0), [h, g] = p(!1), [y, b] = p("none"), x = e?.some((e) => e.animated);
127
- return u(() => {
128
- let e = !1, t = a.current;
129
- return (async () => {
130
- let n = Array.from(new Set(Object.values(i).map((e) => e.src))), r = await Promise.all(n.map((e) => _(e)));
131
- e || (r.forEach((e, r) => {
132
- e && t.set(n[r], e);
133
- }), c((e) => e + 1));
134
- })().catch((e) => console.error("[JamlCardRenderer]", e)), () => {
135
- e = !0, t.clear();
136
- };
137
- }, []), u(() => {
138
- if (!x) return;
139
- let e, t = (n) => {
140
- e ||= n;
141
- let r = n - e;
142
- (!l.current || n - 100 > l.current) && (l.current = n, m(r)), l.current = requestAnimationFrame(t);
143
- };
144
- return l.current = requestAnimationFrame(t), () => {
145
- l.current && cancelAnimationFrame(l.current);
146
- };
147
- }, [x]), u(() => {
148
- let n = r.current;
149
- if (!n || !e || e.length === 0) return;
150
- let i = n.getContext("2d");
151
- if (!i) return;
152
- let o = !1;
153
- return i.clearRect(0, 0, n.width, n.height), [...e].sort((e, t) => e.order - t.order).forEach((e) => {
154
- if (a.current.has(e.source)) {
155
- let t = a.current.get(e.source);
156
- if (!t) return;
157
- let r = v(n, i, t, e, x ? d : void 0);
158
- e.order === 0 && s(r);
159
- return;
160
- }
161
- _(e.source).then((t) => {
162
- if (o || !t) return;
163
- let r = v(n, i, t, e, x ? d : void 0);
164
- a.current.set(e.source, t), e.order === 0 && s(r), c((e) => e + 1);
165
- });
166
- }), n.style.filter = t ? "invert(0.94)" : "none", () => {
167
- o = !0;
168
- };
169
- }, [
170
- e,
171
- d,
172
- t,
173
- x
174
- ]), {
175
- canvasRef: r,
176
- containerStyle: {
177
- aspectRatio: String(o),
178
- width: "100%",
179
- display: "flex",
180
- perspective: n ? "1000px" : void 0,
181
- userSelect: "none",
182
- WebkitUserSelect: "none"
183
- },
184
- canvasStyle: {
185
- transition: n && !h ? "transform 0.4s ease, box-shadow 0.4s ease-out" : "transform 0.1s ease-out",
186
- transform: n ? h ? y : "none" : void 0,
187
- transformStyle: n ? "preserve-3d" : void 0,
188
- transformOrigin: n ? "center center" : void 0,
189
- borderRadius: "6px",
190
- boxShadow: n && h ? "0 2px 12px rgba(0,0,0,0.3)" : "0 2px 8px rgba(0,0,0,0.2)",
191
- imageRendering: "pixelated",
192
- pointerEvents: "none"
193
- },
194
- handlers: {
195
- onPointerEnter: n ? (e) => {
196
- !n || e.pointerType === "touch" || g(!0);
197
- } : void 0,
198
- onPointerLeave: n ? () => {
199
- n && (g(!1), b("none"));
200
- } : void 0,
201
- onPointerMove: n ? (e) => {
202
- if (!n || e.pointerType === "touch") return;
203
- let t = e.currentTarget.getBoundingClientRect(), r = e.clientX - t.left, i = e.clientY - t.top, a = r / t.width * 12 - 6;
204
- b(`perspective(1000px) rotateX(${i / t.height * -16 + 8}deg) rotateY(${a}deg) scale(1.05) translateY(-2px)`);
205
- } : void 0
206
- }
207
- };
208
- }
209
- function C(e, t = {}) {
210
- let [n, r] = p(e[0]?.ante ?? 0), [i, a] = p(e[0]?.ante), o = f(null), s = f(/* @__PURE__ */ new Map());
211
- return e[0]?.ante !== i && (a(e[0]?.ante), e.length > 0 && r(e[0].ante)), u(() => {
212
- let n = o.current;
213
- if (!n || e.length === 0) return;
214
- let i = new IntersectionObserver((e) => {
215
- let t = e.filter((e) => e.isIntersecting).sort((e, t) => t.intersectionRatio - e.intersectionRatio)[0];
216
- if (t) {
217
- let e = Number(t.target.dataset.ante);
218
- Number.isNaN(e) || r(e);
219
- }
220
- }, {
221
- root: n,
222
- threshold: t.threshold ?? [
223
- .4,
224
- .6,
225
- .8
226
- ]
227
- });
228
- return s.current.forEach((e) => i.observe(e)), () => i.disconnect();
229
- }, [e, t.threshold]), {
230
- currentAnte: n,
231
- scrollRef: o,
232
- scrollToAnte: l((e) => {
233
- let t = s.current.get(e);
234
- t && t.scrollIntoView({
235
- behavior: "smooth",
236
- block: "start"
237
- });
238
- }, []),
239
- registerAnteRef: l((e, t) => {
240
- t ? s.current.set(e, t) : s.current.delete(e);
241
- }, [])
242
- };
243
- }
244
- function ee(e, t, n) {
245
- let [r, i] = p(null), [a, o] = p(null), [s, c] = p(null), d = l((e, t, n) => {
246
- let r = "touches" in e ? e.touches[0] : e, i = e.currentTarget.getBoundingClientRect();
247
- o({
248
- clause: t,
249
- fromZone: n,
250
- x: r.clientX,
251
- y: r.clientY,
252
- offX: r.clientX - i.left,
253
- offY: r.clientY - i.top
254
- }), c(null);
255
- }, []);
256
- return u(() => {
257
- if (!a && !r) return;
258
- let l = (e) => {
259
- let t = "touches" in e ? e : null, s = t ? t.touches[0] : e;
260
- if (!s) return;
261
- let l = r;
262
- if (!l && a) {
263
- let e = s.clientX - a.x, t = s.clientY - a.y;
264
- if (Math.hypot(e, t) < 8) return;
265
- l = {
266
- ...a,
267
- x: s.clientX,
268
- y: s.clientY
269
- }, o(null), i(l);
270
- } else l && (l = {
271
- ...l,
272
- x: s.clientX,
273
- y: s.clientY
274
- }, i(l));
275
- if (!l) return;
276
- t?.cancelable && t.preventDefault();
277
- let u = n.current?.querySelectorAll("[data-zone]") ?? [], d = null;
278
- for (let e of u) {
279
- let t = e.getBoundingClientRect();
280
- if (s.clientX >= t.left && s.clientX <= t.right && s.clientY >= t.top && s.clientY <= t.bottom) {
281
- d = e.getAttribute("data-zone");
282
- break;
283
- }
284
- }
285
- c(d);
286
- }, u = () => {
287
- if (r && s && s !== r.fromZone) {
288
- let n = s;
289
- t({
290
- ...e,
291
- [r.fromZone]: e[r.fromZone].filter((e) => e.id !== r.clause.id),
292
- [n]: [...e[n], { ...r.clause }]
293
- });
294
- }
295
- o(null), i(null), c(null);
296
- };
297
- return window.addEventListener("mousemove", l), window.addEventListener("mouseup", u), window.addEventListener("touchmove", l, { passive: !1 }), window.addEventListener("touchend", u), () => {
298
- window.removeEventListener("mousemove", l), window.removeEventListener("mouseup", u), window.removeEventListener("touchmove", l), window.removeEventListener("touchend", u);
299
- };
300
- }, [
301
- a,
302
- r,
303
- s,
304
- e,
305
- t,
306
- n
307
- ]), {
308
- drag: r,
309
- hoverZone: s,
310
- onDragStart: d
311
- };
312
- }
313
- //#endregion
314
- //#region src/ui/sprites.tsx
315
- function w({ name: t, sheet: n, width: i = 40, height: s, style: c }) {
316
- let l = a(t), u = n ?? l?.type ?? "Jokers", d = o[u], f = r(u), p = l?.pos ?? f.pos, m = i;
317
- [
318
- "Jokers",
319
- "Tarots",
320
- "Vouchers",
321
- "Boosters",
322
- "Decks",
323
- "Enhancers",
324
- "Editions"
325
- ].includes(u) && (m = Math.round(i * 95 / 71));
326
- let g = s ?? m;
327
- if (!d) return null;
328
- let _ = i * d.cols, v = g * d.rows, y = -(p.x * i), b = -(p.y * g);
329
- return /* @__PURE__ */ h("div", { style: {
330
- width: i,
331
- height: g,
332
- flexShrink: 0,
333
- backgroundImage: `url(${e(d.assetKey)})`,
334
- backgroundSize: `${_}px ${v}px`,
335
- backgroundPosition: `${y}px ${b}px`,
336
- backgroundRepeat: "no-repeat",
337
- imageRendering: "pixelated",
338
- ...c
339
- } });
340
- }
341
- var te = [
342
- "White",
343
- "Red",
344
- "Green",
345
- "Black",
346
- "Blue",
347
- "Purple",
348
- "Orange",
349
- "Gold"
350
- ];
351
- function ne({ stake: t, width: n = 29, height: r, style: i }) {
352
- let a = te.indexOf(t.replace(" Stake", "")), o = a >= 0 ? a : 0, s = o % 5, c = Math.floor(o / 5), l = r ?? n, u = n * 5, d = l * 2;
353
- return /* @__PURE__ */ h("div", { style: {
354
- width: n,
355
- height: l,
356
- flexShrink: 0,
357
- backgroundImage: `url(${e("stakes")})`,
358
- backgroundSize: `${u}px ${d}px`,
359
- backgroundPosition: `-${s * n}px -${c * l}px`,
360
- backgroundRepeat: "no-repeat",
361
- imageRendering: "pixelated",
362
- ...i
363
- } });
364
- }
365
- var re = {
366
- Red: 0,
367
- Blue: 1,
368
- Yellow: 2,
369
- Green: 3,
370
- Black: 0,
371
- Magic: 1,
372
- Nebula: 2,
373
- Ghost: 3
374
- };
375
- function ie({ deck: t, width: n = 71, height: r, style: i }) {
376
- let a = re[t.replace(" Deck", "")] ?? 0, o = r ?? n * 95 / 71, s = n * 13, c = o * 4;
377
- return /* @__PURE__ */ h("div", { style: {
378
- width: n,
379
- height: o,
380
- flexShrink: 0,
381
- backgroundImage: `url(${e("deck")})`,
382
- backgroundSize: `${s}px ${c}px`,
383
- backgroundPosition: `-${12 * n}px -${a * o}px`,
384
- backgroundRepeat: "no-repeat",
385
- imageRendering: "pixelated",
386
- ...i
387
- } });
388
- }
389
- //#endregion
390
- //#region src/ui/jimboText.tsx
391
- function T({ tone: e = "default", size: t = "md", shadow: n = !0, uppercase: r = !1, dance: i = !1, letterSpacing: a, as: o = "span", className: s = "", style: c, children: l, ...u }) {
392
- let d = `j-text--${t}`, f = `j-text--${e}`, p = n ? "" : "j-text--no-shadow", m = r ? "j-text--upper" : "", g = i ? "j-text--dance-container" : "", _ = {};
393
- a == null ? r && a == null && (_.letterSpacing = 2) : _.letterSpacing = a, c && Object.assign(_, c);
394
- let v = l;
395
- return i && typeof l == "string" && (v = l.split("").map((e, t) => /* @__PURE__ */ h("span", {
396
- className: "j-font-dance-char",
397
- style: { animationDelay: `${t * -.15}s` },
398
- children: e === " " ? "\xA0" : e
399
- }, t))), /* @__PURE__ */ h(o, {
400
- className: `j-text ${d} ${f} ${p} ${m} ${g} ${s}`.trim(),
401
- style: Object.keys(_).length > 0 ? _ : void 0,
402
- ...u,
403
- children: v
404
- });
405
- }
406
- //#endregion
407
- //#region src/ui/panel.tsx
408
- var E = c(({ children: e, className: t = "", sway: n = !1, onBack: r, hideBack: i = !1, style: a, ...o }) => /* @__PURE__ */ g("div", {
409
- ref: y(n),
410
- className: `j-panel ${t}`,
411
- style: a,
412
- ...o,
413
- children: [/* @__PURE__ */ h("div", {
414
- className: "j-panel__body",
415
- children: e
416
- }), r && !i && /* @__PURE__ */ h("div", {
417
- className: "j-panel__back",
418
- children: /* @__PURE__ */ h(k, { onClick: r })
419
- })]
420
- }));
421
- E.displayName = "JimboPanel";
422
- var D = c(({ children: e, className: t = "", style: n, ...r }) => /* @__PURE__ */ h("div", {
423
- className: `j-inner-panel ${t}`,
424
- style: n,
425
- ...r,
426
- children: e
427
- }));
428
- D.displayName = "JimboInnerPanel";
429
- function O({ tone: e = "orange", size: t = "md", fullWidth: n = !1, disabled: r = !1, uppercase: i = !1, onClick: a, style: o, className: s = "", children: c }) {
430
- let l = t === "xs" ? "xs" : t === "sm" ? "sm" : t === "lg" ? "lg" : "md";
431
- return /* @__PURE__ */ h("button", {
432
- type: "button",
433
- className: `j-btn j-btn--${e} j-btn--${t} ${n ? "j-btn--full" : ""} ${r ? "j-btn--disabled" : ""} ${s}`,
434
- disabled: r,
435
- onClick: a,
436
- style: o,
437
- children: /* @__PURE__ */ h("div", {
438
- className: "j-btn__face",
439
- children: /* @__PURE__ */ h(T, {
440
- size: l,
441
- uppercase: i,
442
- children: c
443
- })
444
- })
445
- });
446
- }
447
- function k({ onClick: e }) {
448
- return /* @__PURE__ */ h("div", {
449
- className: "j-flex j-justify-center j-w-full",
450
- style: { padding: "4px 0" },
451
- children: /* @__PURE__ */ h(O, {
452
- tone: "orange",
453
- size: "md",
454
- fullWidth: !0,
455
- onClick: e,
456
- className: "j-back-btn",
457
- children: "Back"
458
- })
459
- });
460
- }
461
- function A({ children: e, open: t, onClose: n, title: r, className: i, showBack: a = !0 }) {
462
- return t ? /* @__PURE__ */ h("div", {
463
- className: "j-modal-overlay",
464
- children: /* @__PURE__ */ g(E, {
465
- onBack: a ? n : void 0,
466
- className: `j-modal ${i ?? ""}`,
467
- children: [r && /* @__PURE__ */ h(T, {
468
- as: "h2",
469
- size: "lg",
470
- className: "j-modal__title",
471
- children: r
472
- }), e]
473
- })
474
- }) : null;
475
- }
476
- //#endregion
477
- //#region src/ui/jimboTabs.tsx
478
- function ae({ tabs: e, activeTab: t, onTabChange: n, className: r = "", style: i }) {
479
- return /* @__PURE__ */ h("div", {
480
- className: `j-tabs ${r}`,
481
- style: i,
482
- children: e.map((e) => /* @__PURE__ */ h(oe, {
483
- label: e.label,
484
- active: t === e.id,
485
- onClick: () => n(e.id)
486
- }, e.id))
487
- });
488
- }
489
- function oe({ label: e, active: t, onClick: n }) {
490
- return /* @__PURE__ */ g("div", {
491
- className: "j-tab",
492
- "data-active": t,
493
- children: [/* @__PURE__ */ h("div", {
494
- className: "j-tab__indicator",
495
- "data-active": t,
496
- "aria-hidden": !0,
497
- children: /* @__PURE__ */ h("svg", {
498
- width: 14,
499
- height: 10,
500
- viewBox: "0 0 14 10",
501
- children: /* @__PURE__ */ h("polygon", { points: "7,10 0,0 14,0" })
502
- })
503
- }), /* @__PURE__ */ h("button", {
504
- type: "button",
505
- className: "j-tab__btn",
506
- "data-active": t,
507
- onClick: n,
508
- children: /* @__PURE__ */ h(T, {
509
- size: "sm",
510
- tone: "default",
511
- children: e
512
- })
513
- })]
514
- });
515
- }
516
- function se({ tabs: e, activeTab: t, onTabChange: n, className: r = "", style: i }) {
517
- return /* @__PURE__ */ h("div", {
518
- className: `j-vtabs ${r}`,
519
- style: i,
520
- children: e.map((e) => {
521
- let r = t === e.id;
522
- return /* @__PURE__ */ h("button", {
523
- type: "button",
524
- className: "j-vtab",
525
- "data-active": r,
526
- onClick: () => n(e.id),
527
- children: /* @__PURE__ */ h(T, {
528
- size: "sm",
529
- tone: r ? "default" : "grey",
530
- children: e.label
531
- })
532
- }, e.id);
533
- })
534
- });
535
- }
536
- //#endregion
537
- //#region src/ui/jimboFlankNav.tsx
538
- function ce({ onPrev: e, onNext: t, canPrev: n = !0, canNext: r = !0, prevLabel: i = "Previous", nextLabel: a = "Next", children: o, className: s = "", style: c }) {
539
- return /* @__PURE__ */ g("div", {
540
- className: `j-flank ${s}`,
541
- style: c,
542
- children: [
543
- /* @__PURE__ */ h(j, {
544
- direction: "left",
545
- onClick: e,
546
- disabled: !n,
547
- "aria-label": i
548
- }),
549
- /* @__PURE__ */ h("div", {
550
- className: "j-flank__content",
551
- children: o
552
- }),
553
- /* @__PURE__ */ h(j, {
554
- direction: "right",
555
- onClick: t,
556
- disabled: !r,
557
- "aria-label": a
558
- })
559
- ]
560
- });
561
- }
562
- function j({ direction: e, onClick: t, disabled: n, "aria-label": r }) {
563
- let [i, a] = s.useState(!1);
564
- return /* @__PURE__ */ h("button", {
565
- type: "button",
566
- className: "j-flank__btn",
567
- "data-pressed": i && !n,
568
- onClick: t,
569
- disabled: n,
570
- "aria-label": r,
571
- title: r,
572
- onMouseDown: () => !n && a(!0),
573
- onMouseUp: () => a(!1),
574
- onMouseLeave: () => a(!1),
575
- onTouchStart: () => !n && a(!0),
576
- onTouchEnd: () => a(!1),
577
- children: /* @__PURE__ */ h(le, { direction: e })
578
- });
579
- }
580
- function le({ direction: e }) {
581
- return /* @__PURE__ */ h("svg", {
582
- width: 28,
583
- height: 28,
584
- viewBox: "0 0 28 28",
585
- fill: "none",
586
- stroke: "currentColor",
587
- strokeWidth: 2,
588
- strokeLinecap: "round",
589
- strokeLinejoin: "round",
590
- "aria-hidden": !0,
591
- children: /* @__PURE__ */ h("polyline", { points: e === "left" ? "18,4 8,14 18,24" : "10,4 20,14 10,24" })
592
- });
593
- }
594
- //#endregion
595
- //#region src/ui/JimboFloating.tsx
596
- function ue({ anchor: e = "top-right", offset: t = 12, zIndex: n = 20, children: r }) {
597
- let i = {
598
- position: "absolute",
599
- zIndex: n
600
- };
601
- return e.includes("top") && (i.top = t), e.includes("bottom") && (i.bottom = t), e.includes("left") && (i.left = t), e.includes("right") && (i.right = t), e.includes("center") && (i.left = "50%", i.transform = "translateX(-50%)"), /* @__PURE__ */ h("div", {
602
- style: i,
603
- children: r
604
- });
605
- }
606
- //#endregion
607
- //#region src/ui/JimboToggleList.tsx
608
- function de({ items: e, onToggle: t, title: n }) {
609
- return /* @__PURE__ */ h(E, { children: /* @__PURE__ */ g("div", {
610
- className: "j-toggle-list",
611
- children: [n && /* @__PURE__ */ h("div", {
612
- className: "j-toggle-list__title",
613
- children: n
614
- }), e.map((e) => /* @__PURE__ */ g("button", {
615
- type: "button",
616
- className: "j-toggle-item",
617
- onClick: () => t(e.id),
618
- children: [/* @__PURE__ */ h("div", {
619
- className: "j-toggle-check",
620
- "data-on": e.on
621
- }), e.label]
622
- }, e.id))]
623
- }) });
624
- }
625
- //#endregion
626
- //#region src/ui/JimboBadge.tsx
627
- function fe({ size: e = "sm", tone: t = "dark", className: n, children: r }) {
628
- return /* @__PURE__ */ h("span", {
629
- className: `j-badge j-badge--${e} j-badge--${t} ${n ?? ""}`,
630
- children: r
631
- });
632
- }
633
- //#endregion
634
- //#region src/ui/jimboFilterBar.tsx
635
- function M({ search: e, onSearchChange: t, searchPlaceholder: n = "Search...", searchLabel: r = "Search", sort: i, onSortChange: a, sortLabel: o = "Sort By", sortOptions: s, className: c = "", style: l }) {
636
- return /* @__PURE__ */ g("div", {
637
- className: `j-filter-bar ${c}`,
638
- style: l,
639
- children: [t ? /* @__PURE__ */ g("div", {
640
- className: "j-filter-bar__field",
641
- children: [/* @__PURE__ */ h("div", {
642
- className: "j-filter-bar__pill",
643
- children: /* @__PURE__ */ h(T, {
644
- size: "xs",
645
- children: r
646
- })
647
- }), /* @__PURE__ */ g("div", {
648
- className: "j-relative",
649
- children: [/* @__PURE__ */ h("div", {
650
- className: "j-filter-bar__search-icon",
651
- children: /* @__PURE__ */ h(N, {})
652
- }), /* @__PURE__ */ h("input", {
653
- type: "text",
654
- value: e ?? "",
655
- onChange: (e) => t(e.target.value),
656
- placeholder: n,
657
- className: "j-filter-bar__input"
658
- })]
659
- })]
660
- }) : null, s && a ? /* @__PURE__ */ g("div", {
661
- className: "j-filter-bar__field",
662
- children: [/* @__PURE__ */ h("div", {
663
- className: "j-filter-bar__pill",
664
- children: /* @__PURE__ */ h(T, {
665
- size: "xs",
666
- children: o
667
- })
668
- }), /* @__PURE__ */ g("div", {
669
- className: "j-relative",
670
- children: [/* @__PURE__ */ h("select", {
671
- value: i ?? s[0]?.value,
672
- onChange: (e) => a(e.target.value),
673
- className: "j-filter-bar__select",
674
- children: s.map((e) => /* @__PURE__ */ h("option", {
675
- value: e.value,
676
- children: e.label
677
- }, e.value))
678
- }), /* @__PURE__ */ h("div", {
679
- className: "j-filter-bar__sort-icon",
680
- children: /* @__PURE__ */ h(P, {})
681
- })]
682
- })]
683
- }) : null]
684
- });
685
- }
686
- function N() {
687
- return /* @__PURE__ */ g("svg", {
688
- width: 24,
689
- height: 24,
690
- viewBox: "0 0 24 24",
691
- fill: "none",
692
- stroke: "currentColor",
693
- strokeWidth: 3,
694
- strokeLinecap: "round",
695
- strokeLinejoin: "round",
696
- "aria-hidden": !0,
697
- children: [/* @__PURE__ */ h("circle", {
698
- cx: 11,
699
- cy: 11,
700
- r: 8
701
- }), /* @__PURE__ */ h("line", {
702
- x1: 21,
703
- y1: 21,
704
- x2: 16.65,
705
- y2: 16.65
706
- })]
707
- });
708
- }
709
- function P() {
710
- return /* @__PURE__ */ g("svg", {
711
- width: 20,
712
- height: 20,
713
- viewBox: "0 0 24 24",
714
- fill: "none",
715
- stroke: "currentColor",
716
- strokeWidth: 2.5,
717
- strokeLinecap: "round",
718
- strokeLinejoin: "round",
719
- "aria-hidden": !0,
720
- children: [
721
- /* @__PURE__ */ h("polyline", { points: "7 4 7 20" }),
722
- /* @__PURE__ */ h("polyline", { points: "3 8 7 4 11 8" }),
723
- /* @__PURE__ */ h("polyline", { points: "17 20 17 4" }),
724
- /* @__PURE__ */ h("polyline", { points: "21 16 17 20 13 16" })
725
- ]
726
- });
727
- }
728
- //#endregion
729
- //#region src/ui/footer.tsx
730
- var F = [
731
- {
732
- char: "♥️",
733
- kf: "jaml-heart"
734
- },
735
- {
736
- char: "♠️",
737
- kf: "jaml-spade"
738
- },
739
- {
740
- char: "♦️",
741
- kf: "jaml-diamond"
742
- },
743
- {
744
- char: "♣️",
745
- kf: "jaml-club"
746
- }
747
- ];
748
- function I({ className: e = "" }) {
749
- return /* @__PURE__ */ g("div", {
750
- className: `j-footer ${e}`,
751
- children: [/* @__PURE__ */ h("div", {
752
- className: "j-footer__bar",
753
- children: /* @__PURE__ */ g("p", {
754
- className: "j-footer__text",
755
- children: [
756
- /* @__PURE__ */ g("span", { children: ["Not affiliated with LocalThunk or PlayStack •", " "] }),
757
- /* @__PURE__ */ h("a", {
758
- href: "https://store.steampowered.com/app/2379780/Balatro/",
759
- target: "_blank",
760
- rel: "noopener noreferrer",
761
- className: "j-footer__link",
762
- children: "Buy Balatro"
763
- }),
764
- /* @__PURE__ */ g("span", { children: [
765
- " ",
766
- "• Created with",
767
- " "
768
- ] }),
769
- /* @__PURE__ */ g("span", {
770
- className: "j-footer__suits",
771
- children: [
772
- /* @__PURE__ */ h("span", {
773
- className: "j-footer__suit-stage",
774
- children: F.map(({ char: e, kf: t }) => /* @__PURE__ */ h("span", {
775
- className: "j-footer__suit-char",
776
- style: { animationName: t },
777
- children: e
778
- }, e))
779
- }),
780
- " ",
781
- "for the Balatro community"
782
- ]
783
- })
784
- ]
785
- })
786
- }), /* @__PURE__ */ h("style", { children: "\n @keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }\n @keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }\n @keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }\n @keyframes jaml-club { 0%,81.5%{opacity:0} 82%{opacity:1;transform:scale(1.45)} 84.5%{opacity:1;transform:scale(1)} 95%{opacity:1} 96%{opacity:0} 100%{opacity:0} }\n " })]
787
- });
788
- }
789
- //#endregion
790
- //#region src/ui/jimboBackground.tsx
791
- function L() {
792
- return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("canvas", {
793
- ref: b(),
794
- "aria-hidden": !0,
795
- style: {
796
- position: "fixed",
797
- inset: 0,
798
- width: "100%",
799
- height: "100%",
800
- zIndex: -10,
801
- pointerEvents: "none"
802
- }
803
- }), /* @__PURE__ */ h(I, {})] });
804
- }
805
- //#endregion
806
- //#region src/ui/jimboTooltip.tsx
807
- function R(e, t) {
808
- typeof e == "function" ? e(t) : e && typeof e == "object" && (e.current = t);
809
- }
810
- function z({ content: e, children: t, mode: n = "snap", placement: r = "auto", delay: i = 80, maxWidth: a = 280, disabled: o = !1 }) {
811
- let { visible: c, pos: u, targetRef: d, tooltipRef: f, show: p, hide: _, handleMouseMove: v } = x({
812
- mode: n,
813
- placement: r,
814
- delay: i,
815
- disabled: o
816
- }), y = s.Children.only(t), b = y.ref, S = l((e) => {
817
- d.current = e, R(b, e);
818
- }, [b, d]);
819
- return /* @__PURE__ */ g(m, { children: [s.cloneElement(y, {
820
- ref: S,
821
- onMouseEnter: (e) => {
822
- p(), y.props.onMouseEnter?.(e);
823
- },
824
- onMouseLeave: (e) => {
825
- _(), y.props.onMouseLeave?.(e);
826
- },
827
- onFocus: (e) => {
828
- p(), y.props.onFocus?.(e);
829
- },
830
- onBlur: (e) => {
831
- _(), y.props.onBlur?.(e);
832
- },
833
- onMouseMove: (e) => {
834
- v(e), y.props.onMouseMove?.(e);
835
- }
836
- }), c ? /* @__PURE__ */ h("div", {
837
- ref: f,
838
- role: "tooltip",
839
- className: "j-tooltip",
840
- style: {
841
- left: u?.left ?? -9999,
842
- top: u?.top ?? -9999,
843
- maxWidth: a,
844
- opacity: +!!u
845
- },
846
- children: e
847
- }) : null] });
848
- }
849
- //#endregion
850
- //#region src/ui/codeBlock.tsx
851
- function B({ code: e, language: t, filename: n, className: r = "" }) {
852
- let [i, a] = p(!1);
853
- return /* @__PURE__ */ g("div", {
854
- className: `j-code-block ${r}`,
855
- children: [/* @__PURE__ */ g("div", {
856
- className: "j-code-block__header",
857
- children: [/* @__PURE__ */ g("div", {
858
- className: "j-code-block__meta",
859
- children: [n && /* @__PURE__ */ h("span", {
860
- className: "j-code-block__filename",
861
- children: n
862
- }), t && /* @__PURE__ */ h("span", {
863
- className: "j-code-block__lang",
864
- children: t
865
- })]
866
- }), /* @__PURE__ */ h("button", {
867
- onClick: () => {
868
- navigator.clipboard.writeText(e), a(!0), setTimeout(() => a(!1), 2e3);
869
- },
870
- title: "Copy",
871
- className: "j-code-block__copy",
872
- "data-copied": i,
873
- children: i ? /* @__PURE__ */ h("svg", {
874
- width: "14",
875
- height: "14",
876
- viewBox: "0 0 24 24",
877
- fill: "none",
878
- stroke: "currentColor",
879
- strokeWidth: "2.5",
880
- strokeLinecap: "round",
881
- strokeLinejoin: "round",
882
- children: /* @__PURE__ */ h("polyline", { points: "20 6 9 17 4 12" })
883
- }) : /* @__PURE__ */ g("svg", {
884
- width: "14",
885
- height: "14",
886
- viewBox: "0 0 24 24",
887
- fill: "none",
888
- stroke: "currentColor",
889
- strokeWidth: "2",
890
- strokeLinecap: "round",
891
- strokeLinejoin: "round",
892
- children: [/* @__PURE__ */ h("rect", {
893
- x: "9",
894
- y: "9",
895
- width: "13",
896
- height: "13",
897
- rx: "2"
898
- }), /* @__PURE__ */ h("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })]
899
- })
900
- })]
901
- }), /* @__PURE__ */ h("pre", {
902
- className: "j-code-block__pre",
903
- children: /* @__PURE__ */ h("code", { children: e })
904
- })]
905
- });
906
- }
907
- //#endregion
908
- //#region src/ui/jimboApp.tsx
909
- function V({ children: e, fluid: t, className: n = "", ...r }) {
910
- return /* @__PURE__ */ h("div", {
911
- className: `j-app${t ? " j-app--fluid" : ""} ${n}`.trim(),
912
- ...r,
913
- children: e
914
- });
915
- }
916
- function pe({ children: e, className: t = "", ...n }) {
917
- return /* @__PURE__ */ h("div", {
918
- className: `j-app__scroll ${t}`,
919
- ...n,
920
- children: e
921
- });
922
- }
923
- function H({ children: e, className: t = "", ...n }) {
924
- return /* @__PURE__ */ h("div", {
925
- className: `j-app__footer ${t}`,
926
- ...n,
927
- children: e
928
- });
929
- }
930
- //#endregion
931
- //#region src/ui/jimboSectionHeader.tsx
932
- function U({ label: e, tone: t = "blue", className: n = "" }) {
933
- return /* @__PURE__ */ g("div", {
934
- className: `j-section-header ${n}`,
935
- children: [/* @__PURE__ */ h("div", {
936
- className: `j-section-header__tag j-bg--${t}`,
937
- children: e
938
- }), /* @__PURE__ */ h("div", { className: `j-section-header__rule j-bg--${t}` })]
939
- });
940
- }
941
- //#endregion
942
- //#region src/ui/jimboInfoCard.tsx
943
- function W({ tone: e, children: t, className: n = "", ...r }) {
944
- return /* @__PURE__ */ h("div", {
945
- className: `j-info-card ${e ? `j-border--${e}` : ""} ${n}`,
946
- style: e ? { borderColor: void 0 } : void 0,
947
- ...r,
948
- children: t
949
- });
950
- }
951
- function G({ children: e, className: t = "" }) {
952
- return /* @__PURE__ */ h("div", {
953
- className: `j-info-card__body ${t}`,
954
- children: e
955
- });
956
- }
957
- function K({ children: e, className: t = "" }) {
958
- return /* @__PURE__ */ h("div", {
959
- className: `j-info-card__title ${t}`,
960
- children: e
961
- });
962
- }
963
- function q({ children: e, className: t = "" }) {
964
- return /* @__PURE__ */ h("div", {
965
- className: `j-info-card__sub ${t}`,
966
- children: e
967
- });
968
- }
969
- function J({ children: e, className: t = "" }) {
970
- return /* @__PURE__ */ h("div", {
971
- className: `j-info-card__aside ${t}`,
972
- children: e
973
- });
974
- }
975
- //#endregion
976
- //#region src/ui/showcase.tsx
977
- function me({ title: e = "Balatro", subtitle: t = "Seed Curator", hotFilters: n = [], recentFinds: r = [], mcpInfo: i, onNewSearch: a, onBrowseFilters: o, onFilterClick: s }) {
978
- return /* @__PURE__ */ g(V, { children: [
979
- /* @__PURE__ */ g("div", {
980
- style: {
981
- padding: "12px 12px 8px",
982
- display: "flex",
983
- flexDirection: "column",
984
- gap: 6
985
- },
986
- children: [
987
- /* @__PURE__ */ g("div", {
988
- className: "j-text-center",
989
- children: [/* @__PURE__ */ h(T, {
990
- size: "lg",
991
- tone: "gold",
992
- children: e
993
- }), /* @__PURE__ */ h(T, {
994
- size: "micro",
995
- tone: "grey",
996
- style: { letterSpacing: 3 },
997
- children: t
998
- })]
999
- }),
1000
- i && /* @__PURE__ */ g("div", {
1001
- className: "j-flex j-justify-between",
1002
- style: {
1003
- padding: "3px 8px",
1004
- background: "var(--j-dark-grey)",
1005
- borderRadius: 4,
1006
- border: "1px solid var(--j-panel-edge)"
1007
- },
1008
- children: [/* @__PURE__ */ h(T, {
1009
- size: "micro",
1010
- tone: "purple",
1011
- children: i.engine
1012
- }), /* @__PURE__ */ h(T, {
1013
- size: "micro",
1014
- tone: "grey",
1015
- children: i.features
1016
- })]
1017
- }),
1018
- n.length > 0 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(U, {
1019
- label: "Filters",
1020
- tone: "blue"
1021
- }), /* @__PURE__ */ h("div", {
1022
- className: "j-flex-col",
1023
- style: { gap: 4 },
1024
- children: n.slice(0, 4).map((e, t) => /* @__PURE__ */ g(W, {
1025
- tone: e.tone,
1026
- onClick: () => s?.(e, t),
1027
- style: { cursor: s ? "pointer" : void 0 },
1028
- children: [
1029
- /* @__PURE__ */ h("div", {
1030
- className: "j-flex j-gap-xs",
1031
- children: e.sample.slice(0, 2).map((e, t) => /* @__PURE__ */ h("div", {
1032
- style: {
1033
- width: 22,
1034
- height: 28,
1035
- display: "flex",
1036
- alignItems: "center",
1037
- justifyContent: "center"
1038
- },
1039
- children: /* @__PURE__ */ h(w, {
1040
- name: e,
1041
- width: 20
1042
- })
1043
- }, t))
1044
- }),
1045
- /* @__PURE__ */ g(G, { children: [/* @__PURE__ */ h(K, { children: e.name }), /* @__PURE__ */ g(q, { children: ["by ", e.author] })] }),
1046
- /* @__PURE__ */ h(J, { children: /* @__PURE__ */ h(T, {
1047
- size: "xs",
1048
- tone: e.tone === "gold" ? "gold" : e.tone,
1049
- children: e.hits
1050
- }) })
1051
- ]
1052
- }, t))
1053
- })] }),
1054
- r.length > 0 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(U, {
1055
- label: "Recent",
1056
- tone: "green"
1057
- }), /* @__PURE__ */ h("div", {
1058
- style: { lineHeight: 1.5 },
1059
- children: r.slice(0, 3).map((e, t) => /* @__PURE__ */ g("div", {
1060
- className: "j-flex j-gap-sm",
1061
- children: [
1062
- /* @__PURE__ */ h(T, {
1063
- size: "micro",
1064
- tone: "gold",
1065
- children: e.seed
1066
- }),
1067
- /* @__PURE__ */ h(T, {
1068
- size: "micro",
1069
- tone: "grey",
1070
- children: e.filterName
1071
- }),
1072
- e.score > 0 && /* @__PURE__ */ g(T, {
1073
- size: "micro",
1074
- tone: "green",
1075
- children: ["+", e.score]
1076
- })
1077
- ]
1078
- }, t))
1079
- })] })
1080
- ]
1081
- }),
1082
- /* @__PURE__ */ g(H, { children: [/* @__PURE__ */ h(O, {
1083
- tone: "green",
1084
- fullWidth: !0,
1085
- size: "lg",
1086
- onClick: a,
1087
- children: "New Search"
1088
- }), /* @__PURE__ */ h(O, {
1089
- tone: "blue",
1090
- fullWidth: !0,
1091
- size: "lg",
1092
- onClick: o,
1093
- children: "Browse Filters"
1094
- })] }),
1095
- /* @__PURE__ */ h(I, {})
1096
- ] });
1097
- }
1098
- //#endregion
1099
- //#region src/ui/jimboCopyRow.tsx
1100
- function he({ value: e, label: t }) {
1101
- let [n, r] = p(!1);
1102
- function i() {
1103
- navigator.clipboard.writeText(e).then(() => {
1104
- r(!0), setTimeout(() => r(!1), 1500);
1105
- });
1106
- }
1107
- return /* @__PURE__ */ g("div", {
1108
- className: "j-copy-row",
1109
- children: [t && /* @__PURE__ */ h(T, {
1110
- size: "xs",
1111
- tone: "grey",
1112
- className: "j-copy-row__label",
1113
- children: t
1114
- }), /* @__PURE__ */ g("div", {
1115
- className: "j-copy-row__field",
1116
- children: [/* @__PURE__ */ h("div", {
1117
- className: "j-copy-row__value",
1118
- children: /* @__PURE__ */ h(T, {
1119
- size: "sm",
1120
- children: e
1121
- })
1122
- }), /* @__PURE__ */ h("button", {
1123
- type: "button",
1124
- className: "j-copy-row__btn",
1125
- "data-copied": n,
1126
- onClick: i,
1127
- children: n ? "Copied" : "Copy"
1128
- })]
1129
- })]
1130
- });
1131
- }
1132
- //#endregion
1133
- //#region src/ui/jimboWordmark.tsx
1134
- function ge({ title: e, subtitle: t, className: n = "" }) {
1135
- return /* @__PURE__ */ g("div", {
1136
- className: `j-wordmark ${n}`,
1137
- children: [/* @__PURE__ */ h("div", {
1138
- className: "j-wordmark__title",
1139
- children: e
1140
- }), t && /* @__PURE__ */ h("div", {
1141
- className: "j-wordmark__sub",
1142
- children: t
1143
- })]
1144
- });
1145
- }
1146
- //#endregion
1147
- //#region src/ui/jimboStatGrid.tsx
1148
- function _e({ items: e, className: t = "", ...n }) {
1149
- return /* @__PURE__ */ h("div", {
1150
- className: `j-stat-grid ${t}`,
1151
- ...n,
1152
- children: e.map((e) => /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("div", {
1153
- className: "j-stat-grid__value",
1154
- children: e.value
1155
- }), /* @__PURE__ */ h("div", {
1156
- className: "j-stat-grid__label",
1157
- children: e.label
1158
- })] }, e.label))
1159
- });
1160
- }
1161
- //#endregion
1162
- //#region src/ui/jimboInset.tsx
1163
- function Y({ children: e, className: t = "", ...n }) {
1164
- return /* @__PURE__ */ h("div", {
1165
- className: `j-inset ${t}`,
1166
- ...n,
1167
- children: e
1168
- });
1169
- }
1170
- //#endregion
1171
- //#region src/ui/JimboIconButton.tsx
1172
- var X = t;
1173
- function ve({ onClick: e, title: t, "aria-label": n, disabled: r = !1, size: i = "md", children: a }) {
1174
- let [o, s] = p(!1), c = i === "sm" ? 26 : 30;
1175
- return /* @__PURE__ */ h("button", {
1176
- "aria-label": n ?? t,
1177
- disabled: r,
1178
- onClick: () => !r && e?.(),
1179
- onMouseEnter: () => s(!0),
1180
- onMouseLeave: () => s(!1),
1181
- style: {
1182
- width: c,
1183
- height: c,
1184
- display: "inline-flex",
1185
- alignItems: "center",
1186
- justifyContent: "center",
1187
- background: o && !r ? X.DARK_GREY : X.DARKEST,
1188
- color: X.WHITE,
1189
- border: `1px solid ${X.PANEL_EDGE}`,
1190
- borderRadius: 4,
1191
- cursor: r ? "not-allowed" : "pointer",
1192
- opacity: r ? .55 : 1,
1193
- padding: 0,
1194
- fontSize: 14,
1195
- lineHeight: 1,
1196
- transition: "background 80ms ease"
1197
- },
1198
- title: t,
1199
- type: "button",
1200
- children: a
1201
- });
1202
- }
1203
- //#endregion
1204
- //#region src/ui/JimboInputModal.tsx
1205
- var Z = t;
1206
- function ye({ open: e, title: t, message: n, placeholder: r, initialValue: i = "", confirmLabel: a = "Confirm", cancelLabel: o = "Cancel", validate: s, onConfirm: c, onCancel: l }) {
1207
- let [d, m] = p(i), [_, v] = p(null), y = f(null), [b, x] = p(e);
1208
- e !== b && (x(e), e && (m(i), v(null))), u(() => {
1209
- if (e) {
1210
- let e = setTimeout(() => y.current?.focus(), 30);
1211
- return () => clearTimeout(e);
1212
- }
1213
- }, [e]);
1214
- function S() {
1215
- let e = s?.(d) ?? null;
1216
- if (e) {
1217
- v(e);
1218
- return;
1219
- }
1220
- c(d);
1221
- }
1222
- return /* @__PURE__ */ g(A, {
1223
- onClose: l,
1224
- open: e,
1225
- title: t,
1226
- children: [
1227
- n && /* @__PURE__ */ h(T, {
1228
- size: "sm",
1229
- style: {
1230
- display: "block",
1231
- marginBottom: 8
1232
- },
1233
- tone: "grey",
1234
- children: n
1235
- }),
1236
- /* @__PURE__ */ h("input", {
1237
- "aria-invalid": !!_,
1238
- onChange: (e) => {
1239
- m(e.target.value), _ && v(null);
1240
- },
1241
- onKeyDown: (e) => {
1242
- e.key === "Enter" && S(), e.key === "Escape" && l();
1243
- },
1244
- placeholder: r,
1245
- ref: y,
1246
- style: {
1247
- width: "100%",
1248
- padding: "8px 10px",
1249
- background: Z.DARKEST,
1250
- color: Z.WHITE,
1251
- border: `1px solid ${_ ? Z.RED : Z.PANEL_EDGE}`,
1252
- borderRadius: 4,
1253
- fontSize: 13,
1254
- fontFamily: "m6x11plus, monospace",
1255
- letterSpacing: 1,
1256
- outline: "none",
1257
- boxSizing: "border-box"
1258
- },
1259
- type: "text",
1260
- value: d
1261
- }),
1262
- _ && /* @__PURE__ */ h(T, {
1263
- size: "sm",
1264
- style: {
1265
- display: "block",
1266
- marginTop: 6
1267
- },
1268
- tone: "red",
1269
- children: _
1270
- }),
1271
- /* @__PURE__ */ g("div", {
1272
- style: {
1273
- display: "flex",
1274
- justifyContent: "flex-end",
1275
- gap: 8,
1276
- marginTop: 14
1277
- },
1278
- children: [/* @__PURE__ */ h(O, {
1279
- onClick: l,
1280
- size: "sm",
1281
- tone: "red",
1282
- children: o
1283
- }), /* @__PURE__ */ h(O, {
1284
- onClick: S,
1285
- size: "sm",
1286
- tone: "blue",
1287
- children: a
1288
- })]
1289
- })
1290
- ]
1291
- });
1292
- }
1293
- //#endregion
1294
- //#region src/ui/JimboSelect.tsx
1295
- var Q = t;
1296
- function be({ value: e, options: t, onChange: n, placeholder: r, disabled: i = !1, fullWidth: a = !0, size: o = "md", style: s, "aria-label": c }) {
1297
- let l;
1298
- l = t.length === 0 ? [] : typeof t[0] == "string" ? t.map((e) => ({ value: e })) : t;
1299
- let u = o === "sm" ? "4px 8px" : "6px 10px", d = o === "sm" ? 11 : 12;
1300
- return /* @__PURE__ */ g("select", {
1301
- "aria-label": c,
1302
- disabled: i,
1303
- onChange: (e) => n(e.target.value),
1304
- style: {
1305
- width: a ? "100%" : void 0,
1306
- padding: u,
1307
- background: Q.DARKEST,
1308
- color: Q.WHITE,
1309
- border: `1px solid ${Q.PANEL_EDGE}`,
1310
- borderRadius: 4,
1311
- fontSize: d,
1312
- fontFamily: "m6x11plus, monospace",
1313
- cursor: i ? "not-allowed" : "pointer",
1314
- opacity: i ? .55 : 1,
1315
- appearance: "none",
1316
- backgroundImage: "linear-gradient(45deg, transparent 50%, " + Q.GOLD_TEXT + " 50%), linear-gradient(135deg, " + Q.GOLD_TEXT + " 50%, transparent 50%)",
1317
- backgroundPosition: "calc(100% - 12px) 50%, calc(100% - 7px) 50%",
1318
- backgroundSize: "5px 5px, 5px 5px",
1319
- backgroundRepeat: "no-repeat",
1320
- paddingRight: 22,
1321
- ...s
1322
- },
1323
- value: e,
1324
- children: [r !== void 0 && /* @__PURE__ */ h("option", {
1325
- disabled: !0,
1326
- value: "",
1327
- children: r
1328
- }), l.map((e) => /* @__PURE__ */ h("option", {
1329
- disabled: e.disabled,
1330
- value: e.value,
1331
- children: e.label ?? e.value
1332
- }, e.value))]
1333
- });
1334
- }
1335
- //#endregion
1336
- //#region src/ui/PanelSplitter.tsx
1337
- var $ = t;
1338
- function xe({ orientation: e = "vertical", onDrag: t, onKeyAdjust: n, "aria-label": r }) {
1339
- let i = f(!1), a = f(0), o = f(t);
1340
- d(() => {
1341
- o.current = t;
1342
- });
1343
- let s = l((t) => {
1344
- t.preventDefault(), t.target.setPointerCapture(t.pointerId), i.current = !0, a.current = e === "vertical" ? t.clientX : t.clientY;
1345
- }, [e]);
1346
- u(() => {
1347
- function t(t) {
1348
- if (!i.current) return;
1349
- let n = e === "vertical" ? t.clientX : t.clientY, r = n - a.current;
1350
- r !== 0 && (a.current = n, o.current(r));
1351
- }
1352
- function n() {
1353
- i.current = !1;
1354
- }
1355
- return window.addEventListener("pointermove", t), window.addEventListener("pointerup", n), window.addEventListener("pointercancel", n), () => {
1356
- window.removeEventListener("pointermove", t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
1357
- };
1358
- }, [e]);
1359
- let c = e === "vertical";
1360
- return /* @__PURE__ */ h("button", {
1361
- "aria-label": r ?? "Resize panel",
1362
- onKeyDown: (e) => {
1363
- n && (c && e.key === "ArrowLeft" && n(-16), c && e.key === "ArrowRight" && n(16), !c && e.key === "ArrowUp" && n(-16), !c && e.key === "ArrowDown" && n(16));
1364
- },
1365
- onPointerDown: s,
1366
- style: {
1367
- all: "unset",
1368
- display: "block",
1369
- flex: "0 0 auto",
1370
- width: c ? 6 : void 0,
1371
- height: c ? void 0 : 6,
1372
- cursor: c ? "col-resize" : "row-resize",
1373
- background: $.PANEL_EDGE,
1374
- borderLeft: c ? `1px solid ${$.BLACK}` : void 0,
1375
- borderRight: c ? `1px solid ${$.BLACK}` : void 0,
1376
- borderTop: c ? void 0 : `1px solid ${$.BLACK}`,
1377
- borderBottom: c ? void 0 : `1px solid ${$.BLACK}`,
1378
- touchAction: "none",
1379
- userSelect: "none"
1380
- },
1381
- type: "button"
1382
- });
1383
- }
1384
- //#endregion
1385
- export { k as A, S as B, M as C, ce as D, ue as E, T as F, ie as I, w as L, D as M, A as N, ae as O, E as P, ne as R, I as S, de as T, ee as V, H as _, Y as a, z as b, he as c, J as d, G as f, V as g, U as h, ve as i, O as j, se as k, me as l, K as m, be as n, _e as o, q as p, ye as r, ge as s, xe as t, W as u, pe as v, fe as w, L as x, B as y, C as z };
1386
-
1387
- //# sourceMappingURL=ui-ByciFBYB.js.map