@syntrologie/adapt-viz 2.41.3 → 2.42.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.
package/dist/cdn.js
CHANGED
|
@@ -11,6 +11,21 @@ function n(n2) {
|
|
|
11
11
|
// ../../sdk-contracts/dist/canvas-context.js
|
|
12
12
|
var canvasRuntimeContext = n("syntrologie:canvas-runtime");
|
|
13
13
|
|
|
14
|
+
// ../../sdk-contracts/dist/detector-events.js
|
|
15
|
+
var DETECTOR_EVENT_NAMES = [
|
|
16
|
+
"ui.hover",
|
|
17
|
+
"ui.idle",
|
|
18
|
+
"ui.hesitate",
|
|
19
|
+
"ui.rage_click",
|
|
20
|
+
"ui.scroll_thrash",
|
|
21
|
+
"ui.focus_bounce"
|
|
22
|
+
];
|
|
23
|
+
var CANONICAL_BUS_EVENT_NAMES = [
|
|
24
|
+
...DETECTOR_EVENT_NAMES,
|
|
25
|
+
"nav.section_viewed",
|
|
26
|
+
"nav.scroll_depth"
|
|
27
|
+
];
|
|
28
|
+
|
|
14
29
|
// ../../sdk-contracts/dist/icons.js
|
|
15
30
|
var PREFIX = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"';
|
|
16
31
|
var EMOJI_SVG_PATHS = {
|
|
@@ -301,7 +316,103 @@ function stripMountPlumbing(config) {
|
|
|
301
316
|
}
|
|
302
317
|
|
|
303
318
|
// ../../sdk-contracts/dist/routes.js
|
|
319
|
+
var RESERVED_BYTES = /* @__PURE__ */ new Set([
|
|
320
|
+
33,
|
|
321
|
+
// !
|
|
322
|
+
35,
|
|
323
|
+
// #
|
|
324
|
+
36,
|
|
325
|
+
// $
|
|
326
|
+
38,
|
|
327
|
+
// &
|
|
328
|
+
39,
|
|
329
|
+
// '
|
|
330
|
+
40,
|
|
331
|
+
// (
|
|
332
|
+
41,
|
|
333
|
+
// )
|
|
334
|
+
42,
|
|
335
|
+
// *
|
|
336
|
+
43,
|
|
337
|
+
// +
|
|
338
|
+
44,
|
|
339
|
+
// ,
|
|
340
|
+
47,
|
|
341
|
+
// /
|
|
342
|
+
58,
|
|
343
|
+
// :
|
|
344
|
+
59,
|
|
345
|
+
// ;
|
|
346
|
+
61,
|
|
347
|
+
// =
|
|
348
|
+
63,
|
|
349
|
+
// ?
|
|
350
|
+
64,
|
|
351
|
+
// @
|
|
352
|
+
91,
|
|
353
|
+
// [
|
|
354
|
+
93
|
|
355
|
+
// ]
|
|
356
|
+
]);
|
|
304
357
|
var utf8Decoder = new TextDecoder("utf-8", { fatal: false });
|
|
358
|
+
function decodeUnreservedOnly(input) {
|
|
359
|
+
let out = "";
|
|
360
|
+
let pending = [];
|
|
361
|
+
const flushPending = () => {
|
|
362
|
+
if (pending.length === 0)
|
|
363
|
+
return;
|
|
364
|
+
const bytes = new Uint8Array(pending);
|
|
365
|
+
out += utf8Decoder.decode(bytes);
|
|
366
|
+
pending = [];
|
|
367
|
+
};
|
|
368
|
+
let i2 = 0;
|
|
369
|
+
while (i2 < input.length) {
|
|
370
|
+
const ch = input[i2];
|
|
371
|
+
if (ch === "%" && i2 + 2 < input.length && isHex(input[i2 + 1]) && isHex(input[i2 + 2])) {
|
|
372
|
+
const byte = parseInt(input.slice(i2 + 1, i2 + 3), 16);
|
|
373
|
+
if (RESERVED_BYTES.has(byte)) {
|
|
374
|
+
flushPending();
|
|
375
|
+
out += `%${input.slice(i2 + 1, i2 + 3).toUpperCase()}`;
|
|
376
|
+
i2 += 3;
|
|
377
|
+
} else {
|
|
378
|
+
pending.push(byte);
|
|
379
|
+
i2 += 3;
|
|
380
|
+
}
|
|
381
|
+
} else {
|
|
382
|
+
flushPending();
|
|
383
|
+
out += ch;
|
|
384
|
+
i2 += 1;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
flushPending();
|
|
388
|
+
return out;
|
|
389
|
+
}
|
|
390
|
+
function isHex(c2) {
|
|
391
|
+
return c2 >= "0" && c2 <= "9" || c2 >= "a" && c2 <= "f" || c2 >= "A" && c2 <= "F";
|
|
392
|
+
}
|
|
393
|
+
function stripQueryAndHash(s4) {
|
|
394
|
+
const q = s4.indexOf("?");
|
|
395
|
+
if (q !== -1)
|
|
396
|
+
s4 = s4.slice(0, q);
|
|
397
|
+
const h = s4.indexOf("#");
|
|
398
|
+
if (h !== -1)
|
|
399
|
+
s4 = s4.slice(0, h);
|
|
400
|
+
return s4;
|
|
401
|
+
}
|
|
402
|
+
function normalizeRoute(path) {
|
|
403
|
+
if (typeof path !== "string" || path.length === 0) {
|
|
404
|
+
throw new TypeError("normalizeRoute: input must be a non-empty string");
|
|
405
|
+
}
|
|
406
|
+
if (!path.startsWith("/")) {
|
|
407
|
+
throw new TypeError(`normalizeRoute: input must be absolute (start with '/'); got ${JSON.stringify(path)}`);
|
|
408
|
+
}
|
|
409
|
+
let s4 = stripQueryAndHash(path);
|
|
410
|
+
s4 = decodeUnreservedOnly(s4);
|
|
411
|
+
s4 = s4.replace(/\/+/g, "/");
|
|
412
|
+
if (s4.length > 1 && s4.endsWith("/"))
|
|
413
|
+
s4 = s4.slice(0, -1);
|
|
414
|
+
return s4;
|
|
415
|
+
}
|
|
305
416
|
|
|
306
417
|
// ../../sdk-contracts/dist/schemas.js
|
|
307
418
|
import { z } from "zod";
|
|
@@ -310,7 +421,26 @@ var AnchorIdZ = z.object({
|
|
|
310
421
|
selector: z.string().regex(NO_CSS_BREAKOUT_PATTERN, {
|
|
311
422
|
message: 'selector must not contain "{" or "}" \u2014 not valid CSS selector syntax, and content:hideBySelector injects this value directly into a <style> element where these characters would break out of the generated rule.'
|
|
312
423
|
}).describe("CSS selector for the target element"),
|
|
313
|
-
route: z.union([z.string(), z.array(z.string())]).
|
|
424
|
+
route: z.union([z.string(), z.array(z.string())]).superRefine((value, ctx) => {
|
|
425
|
+
for (const route of Array.isArray(value) ? value : [value]) {
|
|
426
|
+
let canonical;
|
|
427
|
+
try {
|
|
428
|
+
canonical = normalizeRoute(route);
|
|
429
|
+
} catch (err) {
|
|
430
|
+
ctx.addIssue({
|
|
431
|
+
code: z.ZodIssueCode.custom,
|
|
432
|
+
message: `route must be an absolute path starting with "/" (got ${JSON.stringify(route)}): ${err instanceof Error ? err.message : String(err)}`
|
|
433
|
+
});
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
if (canonical !== route) {
|
|
437
|
+
ctx.addIssue({
|
|
438
|
+
code: z.ZodIssueCode.custom,
|
|
439
|
+
message: `route ${JSON.stringify(route)} is not canonical \u2014 use ${JSON.stringify(canonical)} (this must match what the backend's RouteCanonicalityCheck accepts)`
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}).describe("URL path(s) where this element exists")
|
|
314
444
|
}).strict().describe("DOM element target. selector = CSS selector, route = URL path(s) where the element exists.");
|
|
315
445
|
var AuthoringFieldsZ = {
|
|
316
446
|
id: z.string().optional().describe('Stable action identifier (e.g. "act_3db6a14d2ab0").'),
|
|
@@ -872,4 +1002,4 @@ export {
|
|
|
872
1002
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
873
1003
|
*)
|
|
874
1004
|
*/
|
|
875
|
-
//# sourceMappingURL=chunk-
|
|
1005
|
+
//# sourceMappingURL=chunk-Y73G2UPR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../node_modules/@lit/context/src/lib/create-context.ts", "../../../sdk-contracts/dist/canvas-context.js", "../../../sdk-contracts/dist/detector-events.js", "../../../sdk-contracts/dist/icons.js", "../../../sdk-contracts/dist/mount-plumbing.js", "../../../sdk-contracts/dist/routes.js", "../../../sdk-contracts/dist/schemas.js", "../src/ChartWidgetLit.ts", "../src/layouts/bar.ts", "../src/layouts/line.ts", "../src/layouts/pie.ts", "../src/layouts/table.ts", "../src/layouts/index.ts", "../src/theme.ts", "../src/runtime.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The Context type defines a type brand to associate a key value with the context value type\n */\nexport type Context<KeyType, ValueType> = KeyType & {__context__: ValueType};\n\n/**\n * @deprecated use Context instead\n */\nexport type ContextKey<KeyType, ValueType> = Context<KeyType, ValueType>;\n\n/**\n * A helper type which can extract a Context value type from a Context type\n */\nexport type ContextType<Key extends Context<unknown, unknown>> =\n Key extends Context<unknown, infer ValueType> ? ValueType : never;\n\n/**\n * Creates a typed Context.\n *\n * Contexts are compared with strict equality.\n *\n * If you want two separate `createContext()` calls to referer to the same\n * context, then use a key that will by equal under strict equality like a\n * string for `Symbol.for()`:\n *\n * ```ts\n * // true\n * createContext('my-context') === createContext('my-context')\n * // true\n * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))\n * ```\n *\n * If you want a context to be unique so that it's guaranteed to not collide\n * with other contexts, use a key that's unique under strict equality, like\n * a `Symbol()` or object.:\n *\n * ```\n * // false\n * createContext({}) === createContext({})\n * // false\n * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))\n * ```\n *\n * @param key a context key value\n * @template ValueType the type of value that can be provided by this context.\n * @returns the context key value cast to `Context<K, ValueType>`\n */\nexport function createContext<ValueType, K = unknown>(key: K) {\n return key as Context<K, ValueType>;\n}\n", "/**\n * Canvas runtime context \u2014 the shared @lit/context symbol both\n * runtime-sdk (the provider) and canvas-sdk / canvas authors (the\n * consumers) use to thread a narrow runtime handle through the canvas\n * element tree.\n *\n * Living here keeps the symbol identity stable across both packages.\n * If canvas-sdk created its own symbol with `createContext(...)`, it\n * would never match the one runtime-sdk publishes, and `<sc-mount>`\n * would silently see `undefined` instead of the widget registry.\n *\n * The shape declared here is a NARROW VIEW of `SmartCanvasRuntime`.\n * Canvas-side code reads only this subset. The runtime-sdk's\n * `SmartCanvasRuntime` type is a structural superset.\n */\nimport { createContext } from '@lit/context';\n/**\n * The @lit/context symbol. Both runtime-sdk's ContextProvider and\n * canvas-sdk's ContextConsumer must import THIS exact symbol \u2014 not a\n * symbol with the same string name \u2014 for context propagation to work.\n */\nexport const canvasRuntimeContext = createContext('syntrologie:canvas-runtime');\n", "/**\n * The prop shapes of every CANONICAL runtime-bus event \u2014 the producer/consumer\n * contract for the visitor-behavior signals that reach the chat agent.\n *\n * ## Why this module exists\n *\n * Two independent packages have to agree on these prop names and nothing was\n * holding them to it:\n *\n * producer `packages/event-processor/src/detectors/*` (rrweb detectors)\n * `packages/runtime-sdk/src/instrumentation/*` (bus instrumentation)\n * consumer `packages/adaptives/adaptive-chatbot/src/observer/allowlist.ts`\n *\n * Both sides passed `Record<string, unknown>` around, so a disagreement was not\n * a build error \u2014 it was an observation rendered into the model's prompt with\n * its content missing. `hovered on ''`. `idle`. Shipped for months\n * (BUG-1786923485), and once before that as a name mismatch (BUG-1784146789).\n *\n * ## The rule this module enforces\n *\n * `CanonicalBusEventProps` is the ONE declaration. Producers emit through\n * `detectorEvent()` (event-processor), which types `props` as\n * `CanonicalBusEventProps[N]`; consumers render through an exhaustive\n * `Record<CanonicalBusEventName, \u2026>` whose functions receive\n * `Partial<CanonicalBusEventProps[N]>`. Therefore:\n *\n * - renaming a key in a detector \u2192 producer fails `tsc`\n * - renaming a key in the summarizer \u2192 consumer fails `tsc`\n * - adding an event with no summarizer case \u2192 consumer fails `tsc` (missing\n * key in the exhaustive record)\n * - renaming a key HERE \u2192 both sides fail `tsc`\n *\n * None of those can degrade to an empty string at runtime.\n *\n * ## Deliberately dependency-free\n *\n * No zod, no `@lit/context`, no DOM types \u2014 `@syntrologie/event-processor` has\n * zero runtime dependencies and imports this via the `./detector-events`\n * subpath so it stays that way.\n *\n * ## Deliberately WITHOUT string index signatures\n *\n * An index signature on a props type makes `props.anyTypoAtAll` legal and\n * silently reintroduces the exact bug this module exists to prevent. The one\n * index signature below is a template-literal pattern (`attr__${string}`), so\n * arbitrary DOM attributes are still expressible while `text` / `tag_name`\n * typos remain errors.\n */\nexport const DETECTOR_EVENT_NAMES = [\n 'ui.hover',\n 'ui.idle',\n 'ui.hesitate',\n 'ui.rage_click',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n];\nexport const CANONICAL_BUS_EVENT_NAMES = [\n ...DETECTOR_EVENT_NAMES,\n 'nav.section_viewed',\n 'nav.scroll_depth',\n];\nconst _canonicalExhaustive = true;\nconst _detectorExhaustive = true;\nvoid _canonicalExhaustive;\nvoid _detectorExhaustive;\n/** Runtime membership test \u2014 narrows an arbitrary event name to the contract. */\nexport function isCanonicalBusEvent(name) {\n return CANONICAL_BUS_EVENT_NAMES.includes(name);\n}\n", "/**\n * Centralized emoji \u2192 Lucide SVG icon mapping.\n *\n * Adaptives and the runtime can render config-supplied emoji icons as inline\n * Lucide SVGs without depending on `lucide-react`. Sourced from\n * https://lucide.dev (ISC license).\n *\n * Each entry is an array of inner SVG elements (`<path>`, `<polygon>`,\n * `<circle>`, etc.) for the canonical 24\u00D724 viewBox. `renderIcon()` wraps\n * them in a `<svg>` of the requested size + colour.\n *\n * If you add a new emoji to a config (action plan icon, FAQ icon, nav tip\n * icon, \u2026) add a matching entry here so it renders as a Lucide SVG instead\n * of falling back to the raw glyph.\n */\nconst PREFIX = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"';\n/** Inner-SVG path/shape data keyed by emoji character. */\nexport const EMOJI_SVG_PATHS = {\n // \u2500\u2500 existing in adaptive-nav \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCB5': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83C\uDFDB\uFE0F': [\n '<line x1=\"3\" x2=\"21\" y1=\"22\" y2=\"22\"/>',\n '<line x1=\"6\" x2=\"6\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"10\" x2=\"10\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"14\" x2=\"14\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"18\" x2=\"18\" y1=\"18\" y2=\"11\"/>',\n '<polygon points=\"12 2 20 7 4 7\"/>',\n ],\n '\u23ED\uFE0F': ['<polygon points=\"5 4 15 12 5 20 5 4\"/>', '<line x1=\"19\" x2=\"19\" y1=\"5\" y2=\"19\"/>'],\n '\u27A1\uFE0F': ['<path d=\"M5 12h14\"/>', '<path d=\"m12 5 7 7-7 7\"/>'],\n '\uD83D\uDCA1': [\n '<path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\"/>',\n '<path d=\"M9 18h6\"/>',\n '<path d=\"M10 22h4\"/>',\n ],\n '\uD83D\uDCB0': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83D\uDCCB': [\n '<rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\"/>',\n '<path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\"/>',\n '<path d=\"M12 11h4\"/>',\n '<path d=\"M12 16h4\"/>',\n '<path d=\"M8 11h.01\"/>',\n '<path d=\"M8 16h.01\"/>',\n ],\n '\u2705': ['<path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"/>', '<path d=\"m9 11 3 3L22 4\"/>'],\n '\u26A0\uFE0F': [\n '<path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\"/>',\n '<path d=\"M12 9v4\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n // \u2500\u2500 added for healthmaxxer action_plans \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDEE1\uFE0F': [\n '<path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\"/>',\n ],\n '\uD83D\uDCC8': [\n '<polyline points=\"22 7 13.5 15.5 8.5 10.5 2 17\"/>',\n '<polyline points=\"16 7 22 7 22 13\"/>',\n ],\n '\uD83D\uDD2C': [\n '<path d=\"M6 18h8\"/>',\n '<path d=\"M3 22h18\"/>',\n '<path d=\"M14 22a7 7 0 1 0 0-14h-1\"/>',\n '<path d=\"M9 14h2\"/>',\n '<path d=\"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z\"/>',\n '<path d=\"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3\"/>',\n ],\n '\uD83D\uDC8A': [\n '<path d=\"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z\"/>',\n '<path d=\"m8.5 8.5 7 7\"/>',\n ],\n '\uD83D\uDCC4': [\n '<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"/>',\n '<path d=\"M14 2v4a2 2 0 0 0 2 2h4\"/>',\n '<path d=\"M10 9H8\"/>',\n '<path d=\"M16 13H8\"/>',\n '<path d=\"M16 17H8\"/>',\n ],\n '\uD83E\uDDEA': [\n '<path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\"/>',\n '<path d=\"M6.453 15h11.094\"/>',\n '<path d=\"M8.5 2h7\"/>',\n ],\n '\uD83D\uDD01': [\n '<path d=\"m17 2 4 4-4 4\"/>',\n '<path d=\"M3 11v-1a4 4 0 0 1 4-4h14\"/>',\n '<path d=\"m7 22-4-4 4-4\"/>',\n '<path d=\"M21 13v1a4 4 0 0 1-4 4H3\"/>',\n ],\n '\uD83E\uDDE0': [\n '<path d=\"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z\"/>',\n '<path d=\"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z\"/>',\n '<path d=\"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4\"/>',\n '<path d=\"M17.599 6.5a3 3 0 0 0 .399-1.375\"/>',\n '<path d=\"M6.003 5.125A3 3 0 0 0 6.401 6.5\"/>',\n '<path d=\"M3.477 10.896a4 4 0 0 1 .585-.396\"/>',\n '<path d=\"M19.938 10.5a4 4 0 0 1 .585.396\"/>',\n '<path d=\"M6 18a4 4 0 0 1-1.967-.516\"/>',\n '<path d=\"M19.967 17.484A4 4 0 0 1 18 18\"/>',\n ],\n '\uD83C\uDF19': ['<path d=\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"/>'],\n '\uD83D\uDCE6': [\n '<path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\"/>',\n '<path d=\"M12 22V12\"/>',\n '<path d=\"m3.3 7 8.7 5 8.7-5\"/>',\n '<path d=\"m7.5 4.27 9 5.15\"/>',\n ],\n '\uD83D\uDE9A': [\n // Lucide truck\n '<path d=\"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2\"/>',\n '<path d=\"M15 18H9\"/>',\n '<path d=\"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14\"/>',\n '<circle cx=\"17\" cy=\"18\" r=\"2\"/>',\n '<circle cx=\"7\" cy=\"18\" r=\"2\"/>',\n ],\n '\uD83C\uDF31': [\n '<path d=\"M7 20h10\"/>',\n '<path d=\"M10 20c5.5-2.5.8-6.4 3-10\"/>',\n '<path d=\"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z\"/>',\n '<path d=\"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z\"/>',\n ],\n '\u26A1': [\n '<path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\"/>',\n ],\n '\uD83D\uDD25': [\n // Lucide flame\n '<path d=\"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z\"/>',\n ],\n '\uD83C\uDF33': [\n '<path d=\"M12 22V8\"/>',\n '<path d=\"m17 8-5-6-5 6\"/>',\n '<path d=\"M12 12c-2-2-4-2-4-2 0 0 0 4 2 6 1.5 1.5 3 1 4 0\"/>',\n '<path d=\"M12 12c2-2 4-2 4-2 0 0 0 4-2 6-1.5 1.5-3 1-4 0\"/>',\n ],\n '\uD83C\uDF3F': [\n '<path d=\"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19.2 2.96a1 1 0 0 1 1.8.5c0 6-2 11-9 16.5\"/>',\n '<path d=\"M2 21c0-3 1.85-5.36 5.08-6\"/>',\n ],\n // \u2500\u2500 added for runtime-sdk SyntroTileCard / SyntroToastStack \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\u2753': [\n // HelpCircle\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n '\uD83E\uDDED': [\n // Compass\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<polygon points=\"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76\"/>',\n ],\n '\uD83D\uDCDD': [\n // FileText\n '<path d=\"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z\"/>',\n '<polyline points=\"14 2 14 8 20 8\"/>',\n '<line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/>',\n '<line x1=\"10\" y1=\"9\" x2=\"8\" y2=\"9\"/>',\n ],\n '\uD83C\uDFAF': [\n // Layers (bullseye-shaped emoji rendered as Lucide Layers \u2014 historical)\n '<polygon points=\"12 2 2 7 12 12 22 7 12 2\"/>',\n '<polyline points=\"2 17 12 22 22 17\"/>',\n '<polyline points=\"2 12 12 17 22 12\"/>',\n ],\n '\uD83C\uDFC6': [\n // Trophy\n '<path d=\"M6 9H4.5a2.5 2.5 0 0 1 0-5H6\"/>',\n '<path d=\"M18 9h1.5a2.5 2.5 0 0 0 0-5H18\"/>',\n '<path d=\"M4 22h16\"/>',\n '<path d=\"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22\"/>',\n '<path d=\"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22\"/>',\n '<path d=\"M18 2H6v7a6 6 0 0 0 12 0V2Z\"/>',\n ],\n '\u2728': [\n // Sparkles\n '<path d=\"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z\"/>',\n '<path d=\"M5 3v4\"/>',\n '<path d=\"M19 17v4\"/>',\n '<path d=\"M3 5h4\"/>',\n '<path d=\"M17 19h4\"/>',\n ],\n '\uD83D\uDCAC': [\n // MessageCircle\n '<path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\"/>',\n ],\n '\uD83C\uDFAE': [\n // Gamepad2\n '<line x1=\"6\" y1=\"11\" x2=\"10\" y2=\"11\"/>',\n '<line x1=\"8\" y1=\"9\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"15\" y1=\"12\" x2=\"15.01\" y2=\"12\"/>',\n '<line x1=\"18\" y1=\"10\" x2=\"18.01\" y2=\"10\"/>',\n '<path d=\"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z\"/>',\n ],\n '\u23F1\uFE0F': [\n // Timer\n '<line x1=\"10\" y1=\"2\" x2=\"14\" y2=\"2\"/>',\n '<line x1=\"12\" y1=\"14\" x2=\"12\" y2=\"8\"/>',\n '<circle cx=\"12\" cy=\"14\" r=\"8\"/>',\n ],\n '\uD83D\uDCD6': [\n // BookOpen\n '<path d=\"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z\"/>',\n '<path d=\"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z\"/>',\n ],\n '\uD83D\uDD14': [\n // Bell\n '<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/>',\n '<path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>',\n ],\n // \u2500\u2500 common UI icons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83C\uDF93': [\n // GraduationCap\n '<path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\"/>',\n '<path d=\"M22 10v6\"/>',\n '<path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\"/>',\n ],\n '\u23F0': [\n // AlarmClock\n '<circle cx=\"12\" cy=\"13\" r=\"8\"/>',\n '<path d=\"M12 9v4l2 2\"/>',\n '<path d=\"M5 3 2 6\"/>',\n '<path d=\"m22 6-3-3\"/>',\n '<path d=\"M6.38 18.7 4 21\"/>',\n '<path d=\"M17.64 18.67 20 21\"/>',\n ],\n '\uD83D\uDD04': [\n // RefreshCw\n '<path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\"/>',\n '<path d=\"M21 3v5h-5\"/>',\n '<path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\"/>',\n '<path d=\"M8 16H3v5\"/>',\n ],\n '\uD83D\uDC64': [\n // User\n '<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/>',\n '<circle cx=\"12\" cy=\"7\" r=\"4\"/>',\n ],\n '\uD83C\uDFE0': [\n // House\n '<path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\"/>',\n '<path d=\"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/>',\n ],\n '\uD83D\uDED2': [\n // ShoppingCart\n '<circle cx=\"8\" cy=\"21\" r=\"1\"/>',\n '<circle cx=\"19\" cy=\"21\" r=\"1\"/>',\n '<path d=\"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\"/>',\n ],\n // \u2500\u2500 viz / chart icons (paired with adaptive-viz) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCCA': [\n // BarChart3 \u2014 pairs with \uD83D\uDCC8 (TrendingUp)\n '<path d=\"M3 3v18h18\"/>',\n '<path d=\"M18 17V9\"/>',\n '<path d=\"M13 17V5\"/>',\n '<path d=\"M8 17v-3\"/>',\n ],\n '\uD83D\uDCC9': [\n // TrendingDown\n '<polyline points=\"22 17 13.5 8.5 8.5 13.5 2 7\"/>',\n '<polyline points=\"16 17 22 17 22 11\"/>',\n ],\n '\uD83E\uDD67': [\n // PieChart\n '<path d=\"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\"/>',\n '<path d=\"M21.21 15.89A10 10 0 1 1 8 2.83\"/>',\n ],\n '\uD83D\uDCB9': [\n // Activity \u2014 line-chart-style waveform\n '<path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.5.5 0 0 1-.96 0L9.24 2.18a.5.5 0 0 0-.96 0l-2.35 8.36A2 2 0 0 1 4.02 12H2\"/>',\n ],\n '\uD83C\uDF21\uFE0F': [\n // Thermometer \u2014 gauge-style indicator\n '<path d=\"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z\"/>',\n ],\n};\n/**\n * Render a Lucide SVG for the given emoji. Returns the inline `<svg>` string.\n * If the emoji isn't mapped, returns an empty string \u2014 caller should fall back\n * to rendering the raw emoji glyph (e.g. via text or HTML escape).\n */\nexport function renderIcon(emoji, options = {}) {\n const paths = EMOJI_SVG_PATHS[emoji];\n if (!paths)\n return '';\n const size = options.size ?? 14;\n const stroke = options.color ?? 'currentColor';\n return `${PREFIX} width=\"${size}\" height=\"${size}\" stroke=\"${stroke}\">${paths.join('')}</svg>`;\n}\n/** Whether an emoji has a Lucide SVG mapping. */\nexport function hasIcon(emoji) {\n // biome-ignore lint/suspicious/noPrototypeBuiltins: tsconfig target ES2020 doesn't include Object.hasOwn\n return Object.prototype.hasOwnProperty.call(EMOJI_SVG_PATHS, emoji);\n}\n", "/**\n * Mount contract types and helper for adaptive widget mountables.\n *\n * The `WidgetRegistry` in `@syntrologie/runtime-sdk` delivers props to each\n * mountable as `{ ...tile.props, instanceId, runtime, tileId? }` spread flat\n * (see `MountableContract.test.ts` in runtime-sdk for the end-to-end lockdown).\n *\n * Adaptives that strip plumbing manually maintain private blacklists that\n * silently drift when the contract grows (PR #2234 and #2238 documented this).\n * `stripMountPlumbing` centralizes the list so adding a new plumbing key in\n * the future is a one-line change here that every adaptive picks up automatically.\n *\n * Adaptives whose widget schemas use Zod `.strict()` MUST call this before\n * validating, or strict-mode will reject the runtime-injected keys and the\n * widget will silently render its empty/error state.\n */\nexport const MOUNT_PLUMBING_KEYS = ['instanceId', 'runtime', 'tileId'];\nexport function stripMountPlumbing(config) {\n if (!config || typeof config !== 'object') {\n return {};\n }\n const out = { ...config };\n for (const key of MOUNT_PLUMBING_KEYS) {\n delete out[key];\n }\n return out;\n}\n", "/**\n * Canonical route normalization. See `routes.md` for rules and\n * `normalize-route.cases.json` for the parity corpus shared with the\n * Python implementation in syntrologie_common/sdk/routing.py.\n *\n * Two exports \u2014 `normalizeRoute` for literal paths, `normalizeRoutePattern`\n * for activation patterns containing `*`, `**`, `:param`. Today they share\n * an implementation because the rules happen to be wildcard-safe (no\n * lowercase, unreserved-only decode, slash collapse preserves `**`).\n * The seam is preserved as separate exports so the API can diverge\n * without consumer churn if rules change.\n */\n// RFC 3986 reserved characters (gen-delims + sub-delims). When a `%XX`\n// sequence decodes to one of these bytes, we keep the percent-encoded\n// form \u2014 decoding would re-segment the path or change its meaning.\nconst RESERVED_BYTES = new Set([\n 0x21, // !\n 0x23, // #\n 0x24, // $\n 0x26, // &\n 0x27, // '\n 0x28, // (\n 0x29, // )\n 0x2a, // *\n 0x2b, // +\n 0x2c, // ,\n 0x2f, // /\n 0x3a, // :\n 0x3b, // ;\n 0x3d, // =\n 0x3f, // ?\n 0x40, // @\n 0x5b, // [\n 0x5d, // ]\n]);\nconst utf8Decoder = new TextDecoder('utf-8', { fatal: false });\n/** Decode `%XX` sequences for unreserved bytes only. Collapses\n * adjacent `%XX` runs into a UTF-8 decode so `%C3%A9` \u2192 `\u00E9`. */\nfunction decodeUnreservedOnly(input) {\n let out = '';\n let pending = [];\n const flushPending = () => {\n if (pending.length === 0)\n return;\n const bytes = new Uint8Array(pending);\n out += utf8Decoder.decode(bytes);\n pending = [];\n };\n let i = 0;\n while (i < input.length) {\n const ch = input[i];\n if (ch === '%' && i + 2 < input.length && isHex(input[i + 1]) && isHex(input[i + 2])) {\n const byte = parseInt(input.slice(i + 1, i + 3), 16);\n if (RESERVED_BYTES.has(byte)) {\n flushPending();\n // Keep raw, but normalize hex case to uppercase so the\n // canonical form is stable across input casing.\n out += `%${input.slice(i + 1, i + 3).toUpperCase()}`;\n i += 3;\n }\n else {\n pending.push(byte);\n i += 3;\n }\n }\n else {\n flushPending();\n out += ch;\n i += 1;\n }\n }\n flushPending();\n return out;\n}\nfunction isHex(c) {\n return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');\n}\n/** Strip query string and hash fragment. */\nfunction stripQueryAndHash(s) {\n const q = s.indexOf('?');\n if (q !== -1)\n s = s.slice(0, q);\n const h = s.indexOf('#');\n if (h !== -1)\n s = s.slice(0, h);\n return s;\n}\n/**\n * Normalize a literal path (e.g. `window.location.pathname`, an\n * action's `route` field, a wiki route key).\n *\n * Throws `TypeError` if the input is not an absolute path. Callers\n * that want a soft API should use {@link normalizeRouteWithChange}.\n */\nexport function normalizeRoute(path) {\n if (typeof path !== 'string' || path.length === 0) {\n throw new TypeError('normalizeRoute: input must be a non-empty string');\n }\n if (!path.startsWith('/')) {\n throw new TypeError(`normalizeRoute: input must be absolute (start with '/'); got ${JSON.stringify(path)}`);\n }\n let s = stripQueryAndHash(path);\n s = decodeUnreservedOnly(s);\n s = s.replace(/\\/+/g, '/');\n if (s.length > 1 && s.endsWith('/'))\n s = s.slice(0, -1);\n return s;\n}\n/**\n * Normalize an activation route pattern. Preserves `*`, `**`,\n * `:param` exactly. Today equivalent to {@link normalizeRoute} \u2014 kept\n * as a separate export so rules can diverge later without API churn.\n */\nexport function normalizeRoutePattern(pattern) {\n return normalizeRoute(pattern);\n}\n/**\n * Normalize a route and report whether the input was already\n * canonical. Used by authoring tools to decide whether to emit a\n * warning to the LLM.\n */\nexport function normalizeRouteWithChange(path) {\n const canonical = normalizeRoute(path);\n return { canonical, changed: canonical !== path };\n}\n/** Pattern-side counterpart of {@link normalizeRouteWithChange}. */\nexport function normalizeRoutePatternWithChange(pattern) {\n const canonical = normalizeRoutePattern(pattern);\n return { canonical, changed: canonical !== pattern };\n}\n/**\n * Case-insensitive comparison of two already-canonical paths. Use\n * this anywhere two routes are compared for equality (wiki lookups,\n * non-pattern action route gates) \u2014 preserves casing in the inputs\n * while honoring case-insensitive routing on the customer's site.\n */\nexport function routesMatch(a, b) {\n return a.toLowerCase() === b.toLowerCase();\n}\n", "/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\nimport { normalizeRoute } from './routes.js';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\n// A selector containing \"{\" or \"}\" can never match a real DOM element via\n// querySelectorAll \u2014 those characters are exclusively CSS rule delimiters,\n// not valid selector syntax. They ARE, however, exactly what\n// content:hideBySelector's executor needs to escape the single CSS rule it\n// injects as raw text into a live <style> element\n// (`${selector} { ${prop}: ${value} !important; }` \u2014 see\n// executeHideBySelector in adaptive-content/src/runtime.ts): a selector\n// containing `}` closes that rule early and lets the rest of the string\n// splice in arbitrary attacker-controlled CSS anywhere on the host page\n// (defacement, CSS-based data exfiltration via attribute selectors,\n// clickjacking overlays). This constraint lives on THIS canonical AnchorIdZ\n// (not a hideBySelector-only variant, and not a second copy in a\n// downstream package) so that every action kind in every package \u2014 core\n// and adaptive \u2014 inherits it automatically: there is exactly one\n// `AnchorIdZ`, and every consumer imports it from here (SEC-067,\n// BUG-1786764688). No legitimate selector for any action kind needs a\n// literal brace.\nexport const NO_CSS_BREAKOUT_PATTERN = /^[^{}]*$/;\nexport const AnchorIdZ = z\n .object({\n selector: z\n .string()\n .regex(NO_CSS_BREAKOUT_PATTERN, {\n message: 'selector must not contain \"{\" or \"}\" \u2014 not valid CSS selector syntax, and content:hideBySelector injects this value directly into a <style> element where these characters would break out of the generated rule.',\n })\n .describe('CSS selector for the target element'),\n route: z\n .union([z.string(), z.array(z.string())])\n .superRefine((value, ctx) => {\n // Backend parity check (Finding 1, .superpowers/sdd/\n // duplicated-definitions-audit.md): the backend's\n // RouteCanonicalityCheck (platform/backend/app/services/\n // sdk_config_checks.py) rejects any actions[].anchorId.route that\n // isn't already in `normalize_route`'s canonical form (absolute,\n // no trailing slash, no doubled slashes, no query/hash, unreserved\n // percent-decoding only). Before this check, authoring accepted\n // configs the backend would 422 on (e.g. a trailing slash, or a\n // bare \"**\" missing the leading \"/\"). Reuses `normalizeRoute` from\n // ./routes.ts \u2014 the SAME function already parity-tested against\n // the Python implementation via normalize-route.cases.json \u2014 so\n // this is single-sourced, not a third reimplementation of the\n // canonicalization rule.\n for (const route of Array.isArray(value) ? value : [value]) {\n let canonical;\n try {\n canonical = normalizeRoute(route);\n }\n catch (err) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `route must be an absolute path starting with \"/\" (got ${JSON.stringify(route)}): ${err instanceof Error ? err.message : String(err)}`,\n });\n continue;\n }\n if (canonical !== route) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: `route ${JSON.stringify(route)} is not canonical \u2014 use ${JSON.stringify(canonical)} (this must match what the backend's RouteCanonicalityCheck accepts)`,\n });\n }\n }\n })\n .describe('URL path(s) where this element exists'),\n})\n .strict()\n .describe('DOM element target. selector = CSS selector, route = URL path(s) where the element exists.');\n// =============================================================================\n// AUTHORING FIELDS \u2014 id / title / description / validation\n//\n// Shared fields every action carries. `id` is the action identifier the\n// runtime uses to dispatch, dedupe, and drop/replace actions \u2014 it is NOT\n// stripped before serving. `title` / `description` / `validation` are\n// authoring-only metadata stripped server-side in `to_runtime_config`\n// (platform/backend/app/domains/experiments/helpers.py).\n//\n// They all appear in the JSON Schema (and therefore in the tactician's\n// prompt) because the LLM needs to know they are valid action properties \u2014\n// otherwise schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n id: z.string().optional().describe('Stable action identifier (e.g. \"act_3db6a14d2ab0\").'),\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions.\n *\n * Every value here must be an event the runtime actually emits \u2014 either a\n * PostHog-autocapture normalization (ui.click/scroll/input/change/submit) or\n * an event-processor detector (ui.hover/idle/scroll_thrash/focus_bounce/\n * hesitate/rage_click). Do not add aspirational names; a trigger counting an\n * event nothing emits never fires.\n */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n 'ui.hesitate',\n 'ui.rage_click',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors (hesitate, rage_click, scroll_thrash, focus_bounce, idle, hover); nav.* = page navigation.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .refine((operator) => Number(operator.equals !== undefined) + Number(operator.contains !== undefined) === 1, {\n message: 'Exactly one of equals or contains must be specified.',\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional().describe('Notification title'),\n body: z.string().optional().describe('Notification body text'),\n icon: z.string().optional().describe('Notification icon (emoji or URL)'),\n})\n .describe('Optional toast notification shown when this action triggers.')\n .nullable()\n .optional();\n", "/**\n * adaptive-viz \u2014 Lit web component\n *\n * <syntro-viz-chart> renders a chart from the typed ChartProps. Vega-Lite\n * is dynamically imported on first render so the core SDK bundle stays\n * slim \u2014 first chart in a session pays the load cost; subsequent charts\n * share the loaded module.\n */\n\nimport { renderIcon } from '@syntrologie/sdk-contracts';\nimport { html, LitElement } from 'lit';\nimport { compileToVegaLite } from './layouts';\nimport { buildVegaLiteConfigFromCssVars } from './theme';\nimport type { ChartProps, VegaLiteSpec } from './types';\n\ntype TableProps = Extract<ChartProps, { layout: 'table' }>;\ntype TableColumn = TableProps['columns'][number];\n\nexport class ChartWidgetLit extends LitElement {\n static override properties = {\n chartProps: { attribute: false },\n };\n\n chartProps: ChartProps | undefined = undefined;\n\n // Render into light DOM so the parent shadow root's CSS variables flow through.\n override createRenderRoot() {\n return this;\n }\n\n override async updated(changed: Map<string, unknown>): Promise<void> {\n if (changed.has('chartProps')) {\n await this.#renderChart();\n }\n }\n\n override render() {\n return html`<div data-syntro-viz-chart-container style=\"width:100%; min-height:200px;\"></div>`;\n }\n\n async #renderChart(): Promise<void> {\n const container = this.querySelector('[data-syntro-viz-chart-container]') as HTMLElement | null;\n if (!container) return;\n\n if (!this.chartProps) {\n container.textContent = '(no chart configured)';\n return;\n }\n\n // Tables are HTML, not vega. Vega-Lite has no native table mark \u2014 text-mark\n // hacks at hard-coded x offsets break on long values, mobile widths, and\n // theming. Render as a real <table> styled via the same CSS vars the rest\n // of the chart theme uses.\n if (this.chartProps.layout === 'table') {\n this.#renderTable(container, this.chartProps);\n return;\n }\n\n let spec: VegaLiteSpec;\n try {\n spec = compileToVegaLite(this.chartProps);\n } catch (err) {\n container.textContent = `Chart error: ${(err as Error).message}`;\n return;\n }\n\n const config = buildVegaLiteConfigFromCssVars(this);\n\n try {\n // Make the chart fill the tile width by default. Vega-Lite picks a\n // small intrinsic width per mark when neither width nor autosize is\n // set, which left bar charts hugging the left edge in narrow card\n // iframes. Explicit container-fit sizing fixes that for every layout.\n const sizedSpec = {\n width: 'container',\n autosize: { type: 'fit', contains: 'padding', resize: true },\n ...(spec as Record<string, unknown>),\n };\n\n const { default: embed } = await import('vega-embed');\n await embed(container, sizedSpec as never, {\n actions: false,\n config: config as never,\n renderer: 'svg',\n // CSP-safe: bypasses `new Function(...)` for expression evaluation\n // by using vega-interpreter (already bundled in vega-embed). Required\n // because card iframes run under a CSP that forbids `unsafe-eval`.\n ast: true,\n });\n } catch (err) {\n container.textContent = `Chart render error: ${(err as Error).message}`;\n }\n }\n\n #renderTable(container: HTMLElement, props: TableProps): void {\n container.innerHTML = '';\n container.style.minHeight = '0';\n\n if (props.title) {\n const h = document.createElement('div');\n h.style.cssText =\n 'font-weight:600;font-size:14px;margin-bottom:8px;color:var(--syntro-text-color, currentColor);';\n h.textContent = props.title;\n container.appendChild(h);\n }\n\n const table = document.createElement('table');\n table.style.cssText =\n 'width:100%;border-collapse:collapse;font-size:13px;color:var(--syntro-text-color, currentColor);';\n\n const thead = document.createElement('thead');\n const headRow = document.createElement('tr');\n for (const col of props.columns) {\n const th = document.createElement('th');\n th.textContent = col.header;\n th.style.cssText =\n 'text-align:left;padding:6px 8px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:0.04em;opacity:0.7;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.12));';\n headRow.appendChild(th);\n }\n thead.appendChild(headRow);\n table.appendChild(thead);\n\n const tbody = document.createElement('tbody');\n for (const row of props.data) {\n const tr = document.createElement('tr');\n for (const col of props.columns) {\n tr.appendChild(this.#renderTableCell(col, row));\n }\n tbody.appendChild(tr);\n }\n table.appendChild(tbody);\n\n if (props.footer) {\n const tfoot = document.createElement('tfoot');\n const ftrRow = document.createElement('tr');\n props.columns.forEach((col, idx) => {\n // First column shows the label; remaining cells render values from\n // footer.values keyed by column field, using the column's own renderer.\n if (idx === 0) {\n const td = document.createElement('td');\n td.textContent = props.footer?.label ?? '';\n td.style.cssText =\n 'padding:8px;border-top:2px solid var(--syntro-border-color, rgba(255,255,255,0.18));font-weight:600;';\n ftrRow.appendChild(td);\n } else {\n const synthRow = props.footer?.values ?? {};\n const td = this.#renderTableCell(col, synthRow);\n // Override styles to mark this as a footer cell.\n td.style.borderTop = '2px solid var(--syntro-border-color, rgba(255,255,255,0.18))';\n td.style.borderBottom = 'none';\n td.style.fontWeight = '600';\n ftrRow.appendChild(td);\n }\n });\n tfoot.appendChild(ftrRow);\n table.appendChild(tfoot);\n }\n\n container.appendChild(table);\n }\n\n #renderTableCell(col: TableColumn, row: Record<string, unknown>): HTMLTableCellElement {\n const td = document.createElement('td');\n td.style.cssText =\n 'padding:6px 8px;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.06));vertical-align:middle;word-break:break-word;';\n\n const value = row[col.field];\n const kind = col.kind ?? 'text';\n\n if (kind === 'bar') {\n const barCol = col as Extract<TableColumn, { kind: 'bar' }>;\n const max = barCol.max ?? 100;\n const suffix = barCol.suffix ?? '%';\n const colorField = barCol.colorField;\n const num = typeof value === 'number' ? value : Number.parseFloat(String(value ?? ''));\n if (Number.isFinite(num)) {\n const pct = Math.max(0, Math.min(100, (num / max) * 100));\n const color = colorField\n ? String(row[colorField] ?? 'var(--syntro-accent-color, #4a9a8a)')\n : 'var(--syntro-accent-color, #4a9a8a)';\n const wrapper = document.createElement('div');\n wrapper.dataset.barWrapper = '';\n wrapper.style.cssText = 'display:flex;align-items:center;gap:6px;min-width:70px;';\n\n const label = document.createElement('span');\n label.dataset.barLabel = '';\n label.textContent = `${num}${suffix}`;\n label.style.cssText = 'font-variant-numeric:tabular-nums;min-width:32px;font-size:12px;';\n wrapper.appendChild(label);\n\n const track = document.createElement('div');\n track.dataset.barTrack = '';\n track.style.cssText =\n 'flex:1;height:6px;border-radius:3px;background:var(--syntro-border-color, rgba(255,255,255,0.08));overflow:hidden;';\n const fill = document.createElement('div');\n fill.dataset.barFill = '';\n // Set static styles via cssText, but assign data-derived values\n // (width, background) via property setters. Property setters parse\n // each value strictly per-property, so a hostile color string like\n // \"red; display:none\" can't sneak extra declarations in.\n fill.style.cssText = 'height:100%;border-radius:3px;';\n fill.style.width = `${pct}%`;\n fill.style.background = color;\n track.appendChild(fill);\n wrapper.appendChild(track);\n td.appendChild(wrapper);\n } else {\n td.textContent = '';\n }\n return td;\n }\n\n if (kind === 'icon') {\n const emoji = typeof value === 'string' ? value : '';\n const svg = renderIcon(emoji, { size: 16 });\n if (svg) {\n // renderIcon returns trusted, hard-coded SVG built from a static map\n // in sdk-contracts; not user-supplied HTML.\n td.innerHTML = svg;\n } else {\n td.textContent = emoji;\n }\n return td;\n }\n\n if (kind === 'colorDot') {\n const color = typeof value === 'string' ? value : 'transparent';\n const dot = document.createElement('span');\n dot.style.cssText = 'display:inline-block;width:10px;height:10px;border-radius:50%;';\n // Property setter (not cssText) \u2014 parses strictly as a CSS color and\n // silently rejects values that try to inject extra declarations.\n dot.style.background = color;\n td.appendChild(dot);\n return td;\n }\n\n // Default: text\n td.textContent = value === undefined || value === null ? '' : String(value);\n return td;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'syntro-viz-chart': ChartWidgetLit;\n }\n}\n", "/**\n * adaptive-viz \u2014 Bar layout \u2192 Vega-Lite spec\n */\n\nimport type { z } from 'zod';\nimport type { barLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype BarProps = z.infer<typeof barLayoutSchema>;\n\nexport function barToVegaLite(props: BarProps): VegaLiteSpec {\n const encoding: Record<string, unknown> = {\n // - labelAngle: 0 keeps category labels flat at the bottom. Vega-Lite's\n // default is -90deg (vertical) which is unreadable in narrow tile widths.\n // - sort: null preserves the order of `data`. Default is alphabetical,\n // which mangles intuitive orderings like \"1\u00D7, 30\u00D7, 90\u00D7, 180\u00D7\" or\n // \"NeuroPeak, ImmunEdge, GreenSync, RestoreMax\" (priority/popularity).\n x: { field: props.xField, type: 'nominal', axis: { labelAngle: 0 }, sort: null },\n y: { field: props.yField, type: 'quantitative' },\n };\n\n if (props.colorField) {\n encoding.color = { field: props.colorField, type: 'nominal' };\n }\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: props.data },\n mark: 'bar',\n encoding,\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Line layout \u2192 Vega-Lite spec\n */\n\nimport type { z } from 'zod';\nimport type { lineLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype LineProps = z.infer<typeof lineLayoutSchema>;\n\nexport function lineToVegaLite(props: LineProps): VegaLiteSpec {\n const encoding: Record<string, unknown> = {\n x: { field: props.xField, type: 'quantitative' },\n y: { field: props.yField, type: 'quantitative' },\n };\n\n if (props.seriesField) {\n encoding.color = { field: props.seriesField, type: 'nominal' };\n }\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: props.data },\n mark: 'line',\n encoding,\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Pie layout \u2192 Vega-Lite spec\n *\n * Renders a pie/donut chart using Vega-Lite's `arc` mark. Use for\n * part-of-whole compositions like ingredient percentages, segment\n * shares, etc. (\u2264 ~10 slices reads cleanly; more than that, prefer bar.)\n */\n\nimport type { z } from 'zod';\nimport type { pieLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype PieProps = z.infer<typeof pieLayoutSchema>;\n\nexport function pieToVegaLite(props: PieProps): VegaLiteSpec {\n const mark: Record<string, unknown> = { type: 'arc' };\n if (typeof props.innerRadius === 'number') {\n mark.innerRadius = props.innerRadius;\n }\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: props.data },\n mark,\n encoding: {\n theta: { field: props.valueField, type: 'quantitative' },\n color: { field: props.categoryField, type: 'nominal' },\n tooltip: [\n { field: props.categoryField, type: 'nominal' },\n { field: props.valueField, type: 'quantitative' },\n ],\n },\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Table layout \u2192 Vega-Lite spec\n *\n * Renders a tabular layout as a layered Vega-Lite spec where each column\n * is its own text-mark layer positioned by ordinal x. Suitable for small\n * data tables (<= 50 rows). For large tables, prefer a custom layout\n * with a more efficient rendering strategy.\n */\n\nimport type { z } from 'zod';\nimport type { tableLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype TableProps = z.infer<typeof tableLayoutSchema>;\n\nexport function tableToVegaLite(props: TableProps): VegaLiteSpec {\n const layer = props.columns.map((col, idx) => ({\n mark: { type: 'text', align: 'left', baseline: 'middle' },\n encoding: {\n x: { value: idx * 120 },\n y: { field: '_row', type: 'ordinal', axis: null },\n text: { field: col.field },\n },\n }));\n\n // Add a row index so y-encoding has something stable to bind to\n const dataWithRowIdx = props.data.map((row, i) => ({ ...row, _row: i }));\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: dataWithRowIdx },\n layer,\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Layout dispatcher\n *\n * Given validated ChartProps, produce a Vega-Lite spec ready for rendering.\n */\n\nimport type { ChartProps, VegaLiteSpec } from '../types';\nimport { barToVegaLite } from './bar';\nimport { lineToVegaLite } from './line';\nimport { pieToVegaLite } from './pie';\nimport { tableToVegaLite } from './table';\n\nexport function compileToVegaLite(props: ChartProps): VegaLiteSpec {\n switch (props.layout) {\n case 'bar':\n return barToVegaLite(props);\n case 'line':\n return lineToVegaLite(props);\n case 'table':\n return tableToVegaLite(props);\n case 'pie':\n return pieToVegaLite(props);\n default: {\n const _exhaustive: never = props;\n throw new Error(\n `Unknown chart layout: ${(props as { layout?: string }).layout ?? 'undefined'}`\n );\n }\n }\n}\n\nexport { barToVegaLite } from './bar';\nexport { lineToVegaLite } from './line';\nexport { pieToVegaLite } from './pie';\nexport { tableToVegaLite } from './table';\n", "/**\n * adaptive-viz \u2014 Theme bridge\n *\n * Reads the Syntro CSS variables off the host element's computed style and\n * produces a Vega-Lite `config` block that matches the customer brand at\n * compile time. Vega-Lite uses this config as defaults applied across all\n * marks, axes, legends, and titles.\n */\n\nexport interface VegaLiteConfig {\n mark?: Record<string, unknown>;\n title?: Record<string, unknown>;\n axis?: Record<string, unknown>;\n legend?: Record<string, unknown>;\n view?: Record<string, unknown>;\n background?: string;\n}\n\nfunction readVar(style: CSSStyleDeclaration, name: string): string | undefined {\n const v = style.getPropertyValue(name).trim();\n return v.length > 0 ? v : undefined;\n}\n\nexport function buildVegaLiteConfigFromCssVars(host: HTMLElement): VegaLiteConfig {\n const style = getComputedStyle(host);\n\n const colorPrimary = readVar(style, '--sc-color-primary');\n const fontFamily = readVar(style, '--sc-font-family');\n const textColor = readVar(style, '--sc-overlay-text-color');\n const tileBg = readVar(style, '--sc-tile-background');\n\n const config: VegaLiteConfig = {};\n\n if (colorPrimary) {\n config.mark = { color: colorPrimary };\n }\n\n if (fontFamily) {\n config.title = { font: fontFamily };\n config.axis = { labelFont: fontFamily, titleFont: fontFamily };\n config.legend = { labelFont: fontFamily, titleFont: fontFamily };\n }\n\n if (textColor) {\n config.axis = { ...(config.axis ?? {}), labelColor: textColor, titleColor: textColor };\n config.legend = { ...(config.legend ?? {}), labelColor: textColor, titleColor: textColor };\n config.title = { ...(config.title ?? {}), color: textColor };\n }\n\n if (tileBg) {\n config.background = tileBg;\n }\n\n return config;\n}\n", "/**\n * adaptive-viz \u2014 Runtime manifest\n *\n * Exports the runtime descriptor consumed by the SDK's AppLoader.\n * Registers the <syntro-viz-chart> custom element as a side effect of\n * importing this module, and exposes the widget mountable used by\n * SmartCanvasRuntime's WidgetRegistry.\n */\n\nimport { type MountPlumbing, stripMountPlumbing } from '@syntrologie/sdk-contracts';\nimport { ChartWidgetLit } from './ChartWidgetLit';\nimport type { ChartProps } from './types';\n\nconst TAG = 'syntro-viz-chart';\n\nif (typeof customElements !== 'undefined' && !customElements.get(TAG)) {\n customElements.define(TAG, ChartWidgetLit);\n}\n\n/**\n * Mountable widget interface: receives a container element and the tile's\n * props (validated upstream against chartSchema), returns an unmount fn.\n */\nexport const ChartWidgetMountable = {\n mount(container: HTMLElement, config?: (ChartProps & MountPlumbing) | null) {\n const chartProps = stripMountPlumbing<ChartProps>(config ?? null);\n const el = document.createElement(TAG) as ChartWidgetLit;\n el.chartProps = chartProps as ChartProps;\n container.appendChild(el);\n return () => el.remove();\n },\n};\n\nexport const runtime = {\n id: 'adaptive-viz',\n version: '1.0.0',\n name: 'Chart',\n description:\n 'Vega-Lite-backed data visualization tile with baked layouts (bar, line, table) plus a custom escape hatch.',\n\n /**\n * No DOM-mutation executors \u2014 this widget renders only.\n */\n executors: [],\n\n /**\n * Widget definitions for the runtime's WidgetRegistry.\n */\n widgets: [\n {\n id: 'adaptive-viz:chart',\n component: ChartWidgetMountable,\n metadata: {\n name: 'Chart',\n description: 'Bar / line / table / custom Vega-Lite chart',\n icon: '\uD83D\uDCCA',\n },\n },\n ],\n};\n\nexport default runtime;\n"],
|
|
5
|
+
"mappings": ";;;;;;AAqDM,SAAUA,EAAsCC,IAAAA;AACpD,SAAOA;AACT;;;AClCO,IAAM,uBAAuB,EAAc,4BAA4B;;;AC2BvE,IAAM,uBAAuB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AA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AChB,cAAU,YAAY,EAAE;AACxB,WAAO,MAAM,GAAG,OAAO;AAAA,EACzB;AACF;AAEO,IAAM,UAAU;AAAA,EACrB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aACE;AAAA;AAAA;AAAA;AAAA,EAKF,WAAW,CAAC;AAAA;AAAA;AAAA;AAAA,EAKZ,SAAS;AAAA,IACP;AAAA,MACE,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,UAAU;AAAA,QACR,MAAM;AAAA,QACN,aAAa;AAAA,QACb,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,kBAAQ;",
|
|
6
|
+
"names": ["createContext", "key", "i", "c", "s", "VEGA_LITE_SCHEMA_URL", "VEGA_LITE_SCHEMA_URL", "VEGA_LITE_SCHEMA_URL", "i"]
|
|
7
|
+
}
|
package/dist/runtime.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntrologie/adapt-viz",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.42.0",
|
|
4
4
|
"description": "Adaptive Viz — Vega-Lite-backed data visualization tile with baked layouts (bar, line, table) and a custom escape hatch.",
|
|
5
5
|
"license": "Proprietary",
|
|
6
6
|
"private": false,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../node_modules/@lit/context/src/lib/create-context.ts", "../../../sdk-contracts/dist/canvas-context.js", "../../../sdk-contracts/dist/icons.js", "../../../sdk-contracts/dist/mount-plumbing.js", "../../../sdk-contracts/dist/routes.js", "../../../sdk-contracts/dist/schemas.js", "../src/ChartWidgetLit.ts", "../src/layouts/bar.ts", "../src/layouts/line.ts", "../src/layouts/pie.ts", "../src/layouts/table.ts", "../src/layouts/index.ts", "../src/theme.ts", "../src/runtime.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The Context type defines a type brand to associate a key value with the context value type\n */\nexport type Context<KeyType, ValueType> = KeyType & {__context__: ValueType};\n\n/**\n * @deprecated use Context instead\n */\nexport type ContextKey<KeyType, ValueType> = Context<KeyType, ValueType>;\n\n/**\n * A helper type which can extract a Context value type from a Context type\n */\nexport type ContextType<Key extends Context<unknown, unknown>> =\n Key extends Context<unknown, infer ValueType> ? ValueType : never;\n\n/**\n * Creates a typed Context.\n *\n * Contexts are compared with strict equality.\n *\n * If you want two separate `createContext()` calls to referer to the same\n * context, then use a key that will by equal under strict equality like a\n * string for `Symbol.for()`:\n *\n * ```ts\n * // true\n * createContext('my-context') === createContext('my-context')\n * // true\n * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))\n * ```\n *\n * If you want a context to be unique so that it's guaranteed to not collide\n * with other contexts, use a key that's unique under strict equality, like\n * a `Symbol()` or object.:\n *\n * ```\n * // false\n * createContext({}) === createContext({})\n * // false\n * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))\n * ```\n *\n * @param key a context key value\n * @template ValueType the type of value that can be provided by this context.\n * @returns the context key value cast to `Context<K, ValueType>`\n */\nexport function createContext<ValueType, K = unknown>(key: K) {\n return key as Context<K, ValueType>;\n}\n", "/**\n * Canvas runtime context \u2014 the shared @lit/context symbol both\n * runtime-sdk (the provider) and canvas-sdk / canvas authors (the\n * consumers) use to thread a narrow runtime handle through the canvas\n * element tree.\n *\n * Living here keeps the symbol identity stable across both packages.\n * If canvas-sdk created its own symbol with `createContext(...)`, it\n * would never match the one runtime-sdk publishes, and `<sc-mount>`\n * would silently see `undefined` instead of the widget registry.\n *\n * The shape declared here is a NARROW VIEW of `SmartCanvasRuntime`.\n * Canvas-side code reads only this subset. The runtime-sdk's\n * `SmartCanvasRuntime` type is a structural superset.\n */\nimport { createContext } from '@lit/context';\n/**\n * The @lit/context symbol. Both runtime-sdk's ContextProvider and\n * canvas-sdk's ContextConsumer must import THIS exact symbol \u2014 not a\n * symbol with the same string name \u2014 for context propagation to work.\n */\nexport const canvasRuntimeContext = createContext('syntrologie:canvas-runtime');\n", "/**\n * Centralized emoji \u2192 Lucide SVG icon mapping.\n *\n * Adaptives and the runtime can render config-supplied emoji icons as inline\n * Lucide SVGs without depending on `lucide-react`. Sourced from\n * https://lucide.dev (ISC license).\n *\n * Each entry is an array of inner SVG elements (`<path>`, `<polygon>`,\n * `<circle>`, etc.) for the canonical 24\u00D724 viewBox. `renderIcon()` wraps\n * them in a `<svg>` of the requested size + colour.\n *\n * If you add a new emoji to a config (action plan icon, FAQ icon, nav tip\n * icon, \u2026) add a matching entry here so it renders as a Lucide SVG instead\n * of falling back to the raw glyph.\n */\nconst PREFIX = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"';\n/** Inner-SVG path/shape data keyed by emoji character. */\nexport const EMOJI_SVG_PATHS = {\n // \u2500\u2500 existing in adaptive-nav \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCB5': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83C\uDFDB\uFE0F': [\n '<line x1=\"3\" x2=\"21\" y1=\"22\" y2=\"22\"/>',\n '<line x1=\"6\" x2=\"6\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"10\" x2=\"10\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"14\" x2=\"14\" y1=\"18\" y2=\"11\"/>',\n '<line x1=\"18\" x2=\"18\" y1=\"18\" y2=\"11\"/>',\n '<polygon points=\"12 2 20 7 4 7\"/>',\n ],\n '\u23ED\uFE0F': ['<polygon points=\"5 4 15 12 5 20 5 4\"/>', '<line x1=\"19\" x2=\"19\" y1=\"5\" y2=\"19\"/>'],\n '\u27A1\uFE0F': ['<path d=\"M5 12h14\"/>', '<path d=\"m12 5 7 7-7 7\"/>'],\n '\uD83D\uDCA1': [\n '<path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\"/>',\n '<path d=\"M9 18h6\"/>',\n '<path d=\"M10 22h4\"/>',\n ],\n '\uD83D\uDCB0': [\n '<rect width=\"20\" height=\"12\" x=\"2\" y=\"6\" rx=\"2\"/>',\n '<circle cx=\"12\" cy=\"12\" r=\"2\"/>',\n '<path d=\"M6 12h.01M18 12h.01\"/>',\n ],\n '\uD83D\uDCCB': [\n '<rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\"/>',\n '<path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\"/>',\n '<path d=\"M12 11h4\"/>',\n '<path d=\"M12 16h4\"/>',\n '<path d=\"M8 11h.01\"/>',\n '<path d=\"M8 16h.01\"/>',\n ],\n '\u2705': ['<path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"/>', '<path d=\"m9 11 3 3L22 4\"/>'],\n '\u26A0\uFE0F': [\n '<path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\"/>',\n '<path d=\"M12 9v4\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n // \u2500\u2500 added for healthmaxxer action_plans \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDEE1\uFE0F': [\n '<path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\"/>',\n ],\n '\uD83D\uDCC8': [\n '<polyline points=\"22 7 13.5 15.5 8.5 10.5 2 17\"/>',\n '<polyline points=\"16 7 22 7 22 13\"/>',\n ],\n '\uD83D\uDD2C': [\n '<path d=\"M6 18h8\"/>',\n '<path d=\"M3 22h18\"/>',\n '<path d=\"M14 22a7 7 0 1 0 0-14h-1\"/>',\n '<path d=\"M9 14h2\"/>',\n '<path d=\"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z\"/>',\n '<path d=\"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3\"/>',\n ],\n '\uD83D\uDC8A': [\n '<path d=\"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z\"/>',\n '<path d=\"m8.5 8.5 7 7\"/>',\n ],\n '\uD83D\uDCC4': [\n '<path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"/>',\n '<path d=\"M14 2v4a2 2 0 0 0 2 2h4\"/>',\n '<path d=\"M10 9H8\"/>',\n '<path d=\"M16 13H8\"/>',\n '<path d=\"M16 17H8\"/>',\n ],\n '\uD83E\uDDEA': [\n '<path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\"/>',\n '<path d=\"M6.453 15h11.094\"/>',\n '<path d=\"M8.5 2h7\"/>',\n ],\n '\uD83D\uDD01': [\n '<path d=\"m17 2 4 4-4 4\"/>',\n '<path d=\"M3 11v-1a4 4 0 0 1 4-4h14\"/>',\n '<path d=\"m7 22-4-4 4-4\"/>',\n '<path d=\"M21 13v1a4 4 0 0 1-4 4H3\"/>',\n ],\n '\uD83E\uDDE0': [\n '<path d=\"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z\"/>',\n '<path d=\"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z\"/>',\n '<path d=\"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4\"/>',\n '<path d=\"M17.599 6.5a3 3 0 0 0 .399-1.375\"/>',\n '<path d=\"M6.003 5.125A3 3 0 0 0 6.401 6.5\"/>',\n '<path d=\"M3.477 10.896a4 4 0 0 1 .585-.396\"/>',\n '<path d=\"M19.938 10.5a4 4 0 0 1 .585.396\"/>',\n '<path d=\"M6 18a4 4 0 0 1-1.967-.516\"/>',\n '<path d=\"M19.967 17.484A4 4 0 0 1 18 18\"/>',\n ],\n '\uD83C\uDF19': ['<path d=\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\"/>'],\n '\uD83D\uDCE6': [\n '<path d=\"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\"/>',\n '<path d=\"M12 22V12\"/>',\n '<path d=\"m3.3 7 8.7 5 8.7-5\"/>',\n '<path d=\"m7.5 4.27 9 5.15\"/>',\n ],\n '\uD83D\uDE9A': [\n // Lucide truck\n '<path d=\"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2\"/>',\n '<path d=\"M15 18H9\"/>',\n '<path d=\"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14\"/>',\n '<circle cx=\"17\" cy=\"18\" r=\"2\"/>',\n '<circle cx=\"7\" cy=\"18\" r=\"2\"/>',\n ],\n '\uD83C\uDF31': [\n '<path d=\"M7 20h10\"/>',\n '<path d=\"M10 20c5.5-2.5.8-6.4 3-10\"/>',\n '<path d=\"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z\"/>',\n '<path d=\"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z\"/>',\n ],\n '\u26A1': [\n '<path d=\"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\"/>',\n ],\n '\uD83D\uDD25': [\n // Lucide flame\n '<path d=\"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z\"/>',\n ],\n '\uD83C\uDF33': [\n '<path d=\"M12 22V8\"/>',\n '<path d=\"m17 8-5-6-5 6\"/>',\n '<path d=\"M12 12c-2-2-4-2-4-2 0 0 0 4 2 6 1.5 1.5 3 1 4 0\"/>',\n '<path d=\"M12 12c2-2 4-2 4-2 0 0 0 4-2 6-1.5 1.5-3 1-4 0\"/>',\n ],\n '\uD83C\uDF3F': [\n '<path d=\"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19.2 2.96a1 1 0 0 1 1.8.5c0 6-2 11-9 16.5\"/>',\n '<path d=\"M2 21c0-3 1.85-5.36 5.08-6\"/>',\n ],\n // \u2500\u2500 added for runtime-sdk SyntroTileCard / SyntroToastStack \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\u2753': [\n // HelpCircle\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<path d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\"/>',\n '<path d=\"M12 17h.01\"/>',\n ],\n '\uD83E\uDDED': [\n // Compass\n '<circle cx=\"12\" cy=\"12\" r=\"10\"/>',\n '<polygon points=\"16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76\"/>',\n ],\n '\uD83D\uDCDD': [\n // FileText\n '<path d=\"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z\"/>',\n '<polyline points=\"14 2 14 8 20 8\"/>',\n '<line x1=\"16\" y1=\"13\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"16\" y1=\"17\" x2=\"8\" y2=\"17\"/>',\n '<line x1=\"10\" y1=\"9\" x2=\"8\" y2=\"9\"/>',\n ],\n '\uD83C\uDFAF': [\n // Layers (bullseye-shaped emoji rendered as Lucide Layers \u2014 historical)\n '<polygon points=\"12 2 2 7 12 12 22 7 12 2\"/>',\n '<polyline points=\"2 17 12 22 22 17\"/>',\n '<polyline points=\"2 12 12 17 22 12\"/>',\n ],\n '\uD83C\uDFC6': [\n // Trophy\n '<path d=\"M6 9H4.5a2.5 2.5 0 0 1 0-5H6\"/>',\n '<path d=\"M18 9h1.5a2.5 2.5 0 0 0 0-5H18\"/>',\n '<path d=\"M4 22h16\"/>',\n '<path d=\"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22\"/>',\n '<path d=\"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22\"/>',\n '<path d=\"M18 2H6v7a6 6 0 0 0 12 0V2Z\"/>',\n ],\n '\u2728': [\n // Sparkles\n '<path d=\"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z\"/>',\n '<path d=\"M5 3v4\"/>',\n '<path d=\"M19 17v4\"/>',\n '<path d=\"M3 5h4\"/>',\n '<path d=\"M17 19h4\"/>',\n ],\n '\uD83D\uDCAC': [\n // MessageCircle\n '<path d=\"M7.9 20A9 9 0 1 0 4 16.1L2 22Z\"/>',\n ],\n '\uD83C\uDFAE': [\n // Gamepad2\n '<line x1=\"6\" y1=\"11\" x2=\"10\" y2=\"11\"/>',\n '<line x1=\"8\" y1=\"9\" x2=\"8\" y2=\"13\"/>',\n '<line x1=\"15\" y1=\"12\" x2=\"15.01\" y2=\"12\"/>',\n '<line x1=\"18\" y1=\"10\" x2=\"18.01\" y2=\"10\"/>',\n '<path d=\"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z\"/>',\n ],\n '\u23F1\uFE0F': [\n // Timer\n '<line x1=\"10\" y1=\"2\" x2=\"14\" y2=\"2\"/>',\n '<line x1=\"12\" y1=\"14\" x2=\"12\" y2=\"8\"/>',\n '<circle cx=\"12\" cy=\"14\" r=\"8\"/>',\n ],\n '\uD83D\uDCD6': [\n // BookOpen\n '<path d=\"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z\"/>',\n '<path d=\"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z\"/>',\n ],\n '\uD83D\uDD14': [\n // Bell\n '<path d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"/>',\n '<path d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"/>',\n ],\n // \u2500\u2500 common UI icons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83C\uDF93': [\n // GraduationCap\n '<path d=\"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\"/>',\n '<path d=\"M22 10v6\"/>',\n '<path d=\"M6 12.5V16a6 3 0 0 0 12 0v-3.5\"/>',\n ],\n '\u23F0': [\n // AlarmClock\n '<circle cx=\"12\" cy=\"13\" r=\"8\"/>',\n '<path d=\"M12 9v4l2 2\"/>',\n '<path d=\"M5 3 2 6\"/>',\n '<path d=\"m22 6-3-3\"/>',\n '<path d=\"M6.38 18.7 4 21\"/>',\n '<path d=\"M17.64 18.67 20 21\"/>',\n ],\n '\uD83D\uDD04': [\n // RefreshCw\n '<path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\"/>',\n '<path d=\"M21 3v5h-5\"/>',\n '<path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\"/>',\n '<path d=\"M8 16H3v5\"/>',\n ],\n '\uD83D\uDC64': [\n // User\n '<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/>',\n '<circle cx=\"12\" cy=\"7\" r=\"4\"/>',\n ],\n '\uD83C\uDFE0': [\n // House\n '<path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\"/>',\n '<path d=\"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"/>',\n ],\n '\uD83D\uDED2': [\n // ShoppingCart\n '<circle cx=\"8\" cy=\"21\" r=\"1\"/>',\n '<circle cx=\"19\" cy=\"21\" r=\"1\"/>',\n '<path d=\"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\"/>',\n ],\n // \u2500\u2500 viz / chart icons (paired with adaptive-viz) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n '\uD83D\uDCCA': [\n // BarChart3 \u2014 pairs with \uD83D\uDCC8 (TrendingUp)\n '<path d=\"M3 3v18h18\"/>',\n '<path d=\"M18 17V9\"/>',\n '<path d=\"M13 17V5\"/>',\n '<path d=\"M8 17v-3\"/>',\n ],\n '\uD83D\uDCC9': [\n // TrendingDown\n '<polyline points=\"22 17 13.5 8.5 8.5 13.5 2 7\"/>',\n '<polyline points=\"16 17 22 17 22 11\"/>',\n ],\n '\uD83E\uDD67': [\n // PieChart\n '<path d=\"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z\"/>',\n '<path d=\"M21.21 15.89A10 10 0 1 1 8 2.83\"/>',\n ],\n '\uD83D\uDCB9': [\n // Activity \u2014 line-chart-style waveform\n '<path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.5.5 0 0 1-.96 0L9.24 2.18a.5.5 0 0 0-.96 0l-2.35 8.36A2 2 0 0 1 4.02 12H2\"/>',\n ],\n '\uD83C\uDF21\uFE0F': [\n // Thermometer \u2014 gauge-style indicator\n '<path d=\"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z\"/>',\n ],\n};\n/**\n * Render a Lucide SVG for the given emoji. Returns the inline `<svg>` string.\n * If the emoji isn't mapped, returns an empty string \u2014 caller should fall back\n * to rendering the raw emoji glyph (e.g. via text or HTML escape).\n */\nexport function renderIcon(emoji, options = {}) {\n const paths = EMOJI_SVG_PATHS[emoji];\n if (!paths)\n return '';\n const size = options.size ?? 14;\n const stroke = options.color ?? 'currentColor';\n return `${PREFIX} width=\"${size}\" height=\"${size}\" stroke=\"${stroke}\">${paths.join('')}</svg>`;\n}\n/** Whether an emoji has a Lucide SVG mapping. */\nexport function hasIcon(emoji) {\n // biome-ignore lint/suspicious/noPrototypeBuiltins: tsconfig target ES2020 doesn't include Object.hasOwn\n return Object.prototype.hasOwnProperty.call(EMOJI_SVG_PATHS, emoji);\n}\n", "/**\n * Mount contract types and helper for adaptive widget mountables.\n *\n * The `WidgetRegistry` in `@syntrologie/runtime-sdk` delivers props to each\n * mountable as `{ ...tile.props, instanceId, runtime, tileId? }` spread flat\n * (see `MountableContract.test.ts` in runtime-sdk for the end-to-end lockdown).\n *\n * Adaptives that strip plumbing manually maintain private blacklists that\n * silently drift when the contract grows (PR #2234 and #2238 documented this).\n * `stripMountPlumbing` centralizes the list so adding a new plumbing key in\n * the future is a one-line change here that every adaptive picks up automatically.\n *\n * Adaptives whose widget schemas use Zod `.strict()` MUST call this before\n * validating, or strict-mode will reject the runtime-injected keys and the\n * widget will silently render its empty/error state.\n */\nexport const MOUNT_PLUMBING_KEYS = ['instanceId', 'runtime', 'tileId'];\nexport function stripMountPlumbing(config) {\n if (!config || typeof config !== 'object') {\n return {};\n }\n const out = { ...config };\n for (const key of MOUNT_PLUMBING_KEYS) {\n delete out[key];\n }\n return out;\n}\n", "/**\n * Canonical route normalization. See `routes.md` for rules and\n * `normalize-route.cases.json` for the parity corpus shared with the\n * Python implementation in syntrologie_common/sdk/routing.py.\n *\n * Two exports \u2014 `normalizeRoute` for literal paths, `normalizeRoutePattern`\n * for activation patterns containing `*`, `**`, `:param`. Today they share\n * an implementation because the rules happen to be wildcard-safe (no\n * lowercase, unreserved-only decode, slash collapse preserves `**`).\n * The seam is preserved as separate exports so the API can diverge\n * without consumer churn if rules change.\n */\n// RFC 3986 reserved characters (gen-delims + sub-delims). When a `%XX`\n// sequence decodes to one of these bytes, we keep the percent-encoded\n// form \u2014 decoding would re-segment the path or change its meaning.\nconst RESERVED_BYTES = new Set([\n 0x21, // !\n 0x23, // #\n 0x24, // $\n 0x26, // &\n 0x27, // '\n 0x28, // (\n 0x29, // )\n 0x2a, // *\n 0x2b, // +\n 0x2c, // ,\n 0x2f, // /\n 0x3a, // :\n 0x3b, // ;\n 0x3d, // =\n 0x3f, // ?\n 0x40, // @\n 0x5b, // [\n 0x5d, // ]\n]);\nconst utf8Decoder = new TextDecoder('utf-8', { fatal: false });\n/** Decode `%XX` sequences for unreserved bytes only. Collapses\n * adjacent `%XX` runs into a UTF-8 decode so `%C3%A9` \u2192 `\u00E9`. */\nfunction decodeUnreservedOnly(input) {\n let out = '';\n let pending = [];\n const flushPending = () => {\n if (pending.length === 0)\n return;\n const bytes = new Uint8Array(pending);\n out += utf8Decoder.decode(bytes);\n pending = [];\n };\n let i = 0;\n while (i < input.length) {\n const ch = input[i];\n if (ch === '%' && i + 2 < input.length && isHex(input[i + 1]) && isHex(input[i + 2])) {\n const byte = parseInt(input.slice(i + 1, i + 3), 16);\n if (RESERVED_BYTES.has(byte)) {\n flushPending();\n // Keep raw, but normalize hex case to uppercase so the\n // canonical form is stable across input casing.\n out += `%${input.slice(i + 1, i + 3).toUpperCase()}`;\n i += 3;\n }\n else {\n pending.push(byte);\n i += 3;\n }\n }\n else {\n flushPending();\n out += ch;\n i += 1;\n }\n }\n flushPending();\n return out;\n}\nfunction isHex(c) {\n return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');\n}\n/** Strip query string and hash fragment. */\nfunction stripQueryAndHash(s) {\n const q = s.indexOf('?');\n if (q !== -1)\n s = s.slice(0, q);\n const h = s.indexOf('#');\n if (h !== -1)\n s = s.slice(0, h);\n return s;\n}\n/**\n * Normalize a literal path (e.g. `window.location.pathname`, an\n * action's `route` field, a wiki route key).\n *\n * Throws `TypeError` if the input is not an absolute path. Callers\n * that want a soft API should use {@link normalizeRouteWithChange}.\n */\nexport function normalizeRoute(path) {\n if (typeof path !== 'string' || path.length === 0) {\n throw new TypeError('normalizeRoute: input must be a non-empty string');\n }\n if (!path.startsWith('/')) {\n throw new TypeError(`normalizeRoute: input must be absolute (start with '/'); got ${JSON.stringify(path)}`);\n }\n let s = stripQueryAndHash(path);\n s = decodeUnreservedOnly(s);\n s = s.replace(/\\/+/g, '/');\n if (s.length > 1 && s.endsWith('/'))\n s = s.slice(0, -1);\n return s;\n}\n/**\n * Normalize an activation route pattern. Preserves `*`, `**`,\n * `:param` exactly. Today equivalent to {@link normalizeRoute} \u2014 kept\n * as a separate export so rules can diverge later without API churn.\n */\nexport function normalizeRoutePattern(pattern) {\n return normalizeRoute(pattern);\n}\n/**\n * Normalize a route and report whether the input was already\n * canonical. Used by authoring tools to decide whether to emit a\n * warning to the LLM.\n */\nexport function normalizeRouteWithChange(path) {\n const canonical = normalizeRoute(path);\n return { canonical, changed: canonical !== path };\n}\n/** Pattern-side counterpart of {@link normalizeRouteWithChange}. */\nexport function normalizeRoutePatternWithChange(pattern) {\n const canonical = normalizeRoutePattern(pattern);\n return { canonical, changed: canonical !== pattern };\n}\n/**\n * Case-insensitive comparison of two already-canonical paths. Use\n * this anywhere two routes are compared for equality (wiki lookups,\n * non-pattern action route gates) \u2014 preserves casing in the inputs\n * while honoring case-insensitive routing on the customer's site.\n */\nexport function routesMatch(a, b) {\n return a.toLowerCase() === b.toLowerCase();\n}\n", "/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\n// A selector containing \"{\" or \"}\" can never match a real DOM element via\n// querySelectorAll \u2014 those characters are exclusively CSS rule delimiters,\n// not valid selector syntax. They ARE, however, exactly what\n// content:hideBySelector's executor needs to escape the single CSS rule it\n// injects as raw text into a live <style> element\n// (`${selector} { ${prop}: ${value} !important; }` \u2014 see\n// executeHideBySelector in adaptive-content/src/runtime.ts): a selector\n// containing `}` closes that rule early and lets the rest of the string\n// splice in arbitrary attacker-controlled CSS anywhere on the host page\n// (defacement, CSS-based data exfiltration via attribute selectors,\n// clickjacking overlays). This constraint lives on THIS canonical AnchorIdZ\n// (not a hideBySelector-only variant, and not a second copy in a\n// downstream package) so that every action kind in every package \u2014 core\n// and adaptive \u2014 inherits it automatically: there is exactly one\n// `AnchorIdZ`, and every consumer imports it from here (SEC-067,\n// BUG-1786764688). No legitimate selector for any action kind needs a\n// literal brace.\nexport const NO_CSS_BREAKOUT_PATTERN = /^[^{}]*$/;\nexport const AnchorIdZ = z\n .object({\n selector: z\n .string()\n .regex(NO_CSS_BREAKOUT_PATTERN, {\n message: 'selector must not contain \"{\" or \"}\" \u2014 not valid CSS selector syntax, and content:hideBySelector injects this value directly into a <style> element where these characters would break out of the generated rule.',\n })\n .describe('CSS selector for the target element'),\n route: z\n .union([z.string(), z.array(z.string())])\n .describe('URL path(s) where this element exists'),\n})\n .strict()\n .describe('DOM element target. selector = CSS selector, route = URL path(s) where the element exists.');\n// =============================================================================\n// AUTHORING FIELDS \u2014 id / title / description / validation\n//\n// Shared fields every action carries. `id` is the action identifier the\n// runtime uses to dispatch, dedupe, and drop/replace actions \u2014 it is NOT\n// stripped before serving. `title` / `description` / `validation` are\n// authoring-only metadata stripped server-side in `to_runtime_config`\n// (platform/backend/app/domains/experiments/helpers.py).\n//\n// They all appear in the JSON Schema (and therefore in the tactician's\n// prompt) because the LLM needs to know they are valid action properties \u2014\n// otherwise schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n id: z.string().optional().describe('Stable action identifier (e.g. \"act_3db6a14d2ab0\").'),\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions.\n *\n * Every value here must be an event the runtime actually emits \u2014 either a\n * PostHog-autocapture normalization (ui.click/scroll/input/change/submit) or\n * an event-processor detector (ui.hover/idle/scroll_thrash/focus_bounce/\n * hesitate/rage_click). Do not add aspirational names; a trigger counting an\n * event nothing emits never fires.\n */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n 'ui.hesitate',\n 'ui.rage_click',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors (hesitate, rage_click, scroll_thrash, focus_bounce, idle, hover); nav.* = page navigation.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .refine((operator) => Number(operator.equals !== undefined) + Number(operator.contains !== undefined) === 1, {\n message: 'Exactly one of equals or contains must be specified.',\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional().describe('Notification title'),\n body: z.string().optional().describe('Notification body text'),\n icon: z.string().optional().describe('Notification icon (emoji or URL)'),\n})\n .describe('Optional toast notification shown when this action triggers.')\n .nullable()\n .optional();\n", "/**\n * adaptive-viz \u2014 Lit web component\n *\n * <syntro-viz-chart> renders a chart from the typed ChartProps. Vega-Lite\n * is dynamically imported on first render so the core SDK bundle stays\n * slim \u2014 first chart in a session pays the load cost; subsequent charts\n * share the loaded module.\n */\n\nimport { renderIcon } from '@syntrologie/sdk-contracts';\nimport { html, LitElement } from 'lit';\nimport { compileToVegaLite } from './layouts';\nimport { buildVegaLiteConfigFromCssVars } from './theme';\nimport type { ChartProps, VegaLiteSpec } from './types';\n\ntype TableProps = Extract<ChartProps, { layout: 'table' }>;\ntype TableColumn = TableProps['columns'][number];\n\nexport class ChartWidgetLit extends LitElement {\n static override properties = {\n chartProps: { attribute: false },\n };\n\n chartProps: ChartProps | undefined = undefined;\n\n // Render into light DOM so the parent shadow root's CSS variables flow through.\n override createRenderRoot() {\n return this;\n }\n\n override async updated(changed: Map<string, unknown>): Promise<void> {\n if (changed.has('chartProps')) {\n await this.#renderChart();\n }\n }\n\n override render() {\n return html`<div data-syntro-viz-chart-container style=\"width:100%; min-height:200px;\"></div>`;\n }\n\n async #renderChart(): Promise<void> {\n const container = this.querySelector('[data-syntro-viz-chart-container]') as HTMLElement | null;\n if (!container) return;\n\n if (!this.chartProps) {\n container.textContent = '(no chart configured)';\n return;\n }\n\n // Tables are HTML, not vega. Vega-Lite has no native table mark \u2014 text-mark\n // hacks at hard-coded x offsets break on long values, mobile widths, and\n // theming. Render as a real <table> styled via the same CSS vars the rest\n // of the chart theme uses.\n if (this.chartProps.layout === 'table') {\n this.#renderTable(container, this.chartProps);\n return;\n }\n\n let spec: VegaLiteSpec;\n try {\n spec = compileToVegaLite(this.chartProps);\n } catch (err) {\n container.textContent = `Chart error: ${(err as Error).message}`;\n return;\n }\n\n const config = buildVegaLiteConfigFromCssVars(this);\n\n try {\n // Make the chart fill the tile width by default. Vega-Lite picks a\n // small intrinsic width per mark when neither width nor autosize is\n // set, which left bar charts hugging the left edge in narrow card\n // iframes. Explicit container-fit sizing fixes that for every layout.\n const sizedSpec = {\n width: 'container',\n autosize: { type: 'fit', contains: 'padding', resize: true },\n ...(spec as Record<string, unknown>),\n };\n\n const { default: embed } = await import('vega-embed');\n await embed(container, sizedSpec as never, {\n actions: false,\n config: config as never,\n renderer: 'svg',\n // CSP-safe: bypasses `new Function(...)` for expression evaluation\n // by using vega-interpreter (already bundled in vega-embed). Required\n // because card iframes run under a CSP that forbids `unsafe-eval`.\n ast: true,\n });\n } catch (err) {\n container.textContent = `Chart render error: ${(err as Error).message}`;\n }\n }\n\n #renderTable(container: HTMLElement, props: TableProps): void {\n container.innerHTML = '';\n container.style.minHeight = '0';\n\n if (props.title) {\n const h = document.createElement('div');\n h.style.cssText =\n 'font-weight:600;font-size:14px;margin-bottom:8px;color:var(--syntro-text-color, currentColor);';\n h.textContent = props.title;\n container.appendChild(h);\n }\n\n const table = document.createElement('table');\n table.style.cssText =\n 'width:100%;border-collapse:collapse;font-size:13px;color:var(--syntro-text-color, currentColor);';\n\n const thead = document.createElement('thead');\n const headRow = document.createElement('tr');\n for (const col of props.columns) {\n const th = document.createElement('th');\n th.textContent = col.header;\n th.style.cssText =\n 'text-align:left;padding:6px 8px;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:0.04em;opacity:0.7;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.12));';\n headRow.appendChild(th);\n }\n thead.appendChild(headRow);\n table.appendChild(thead);\n\n const tbody = document.createElement('tbody');\n for (const row of props.data) {\n const tr = document.createElement('tr');\n for (const col of props.columns) {\n tr.appendChild(this.#renderTableCell(col, row));\n }\n tbody.appendChild(tr);\n }\n table.appendChild(tbody);\n\n if (props.footer) {\n const tfoot = document.createElement('tfoot');\n const ftrRow = document.createElement('tr');\n props.columns.forEach((col, idx) => {\n // First column shows the label; remaining cells render values from\n // footer.values keyed by column field, using the column's own renderer.\n if (idx === 0) {\n const td = document.createElement('td');\n td.textContent = props.footer?.label ?? '';\n td.style.cssText =\n 'padding:8px;border-top:2px solid var(--syntro-border-color, rgba(255,255,255,0.18));font-weight:600;';\n ftrRow.appendChild(td);\n } else {\n const synthRow = props.footer?.values ?? {};\n const td = this.#renderTableCell(col, synthRow);\n // Override styles to mark this as a footer cell.\n td.style.borderTop = '2px solid var(--syntro-border-color, rgba(255,255,255,0.18))';\n td.style.borderBottom = 'none';\n td.style.fontWeight = '600';\n ftrRow.appendChild(td);\n }\n });\n tfoot.appendChild(ftrRow);\n table.appendChild(tfoot);\n }\n\n container.appendChild(table);\n }\n\n #renderTableCell(col: TableColumn, row: Record<string, unknown>): HTMLTableCellElement {\n const td = document.createElement('td');\n td.style.cssText =\n 'padding:6px 8px;border-bottom:1px solid var(--syntro-border-color, rgba(255,255,255,0.06));vertical-align:middle;word-break:break-word;';\n\n const value = row[col.field];\n const kind = col.kind ?? 'text';\n\n if (kind === 'bar') {\n const barCol = col as Extract<TableColumn, { kind: 'bar' }>;\n const max = barCol.max ?? 100;\n const suffix = barCol.suffix ?? '%';\n const colorField = barCol.colorField;\n const num = typeof value === 'number' ? value : Number.parseFloat(String(value ?? ''));\n if (Number.isFinite(num)) {\n const pct = Math.max(0, Math.min(100, (num / max) * 100));\n const color = colorField\n ? String(row[colorField] ?? 'var(--syntro-accent-color, #4a9a8a)')\n : 'var(--syntro-accent-color, #4a9a8a)';\n const wrapper = document.createElement('div');\n wrapper.dataset.barWrapper = '';\n wrapper.style.cssText = 'display:flex;align-items:center;gap:6px;min-width:70px;';\n\n const label = document.createElement('span');\n label.dataset.barLabel = '';\n label.textContent = `${num}${suffix}`;\n label.style.cssText = 'font-variant-numeric:tabular-nums;min-width:32px;font-size:12px;';\n wrapper.appendChild(label);\n\n const track = document.createElement('div');\n track.dataset.barTrack = '';\n track.style.cssText =\n 'flex:1;height:6px;border-radius:3px;background:var(--syntro-border-color, rgba(255,255,255,0.08));overflow:hidden;';\n const fill = document.createElement('div');\n fill.dataset.barFill = '';\n // Set static styles via cssText, but assign data-derived values\n // (width, background) via property setters. Property setters parse\n // each value strictly per-property, so a hostile color string like\n // \"red; display:none\" can't sneak extra declarations in.\n fill.style.cssText = 'height:100%;border-radius:3px;';\n fill.style.width = `${pct}%`;\n fill.style.background = color;\n track.appendChild(fill);\n wrapper.appendChild(track);\n td.appendChild(wrapper);\n } else {\n td.textContent = '';\n }\n return td;\n }\n\n if (kind === 'icon') {\n const emoji = typeof value === 'string' ? value : '';\n const svg = renderIcon(emoji, { size: 16 });\n if (svg) {\n // renderIcon returns trusted, hard-coded SVG built from a static map\n // in sdk-contracts; not user-supplied HTML.\n td.innerHTML = svg;\n } else {\n td.textContent = emoji;\n }\n return td;\n }\n\n if (kind === 'colorDot') {\n const color = typeof value === 'string' ? value : 'transparent';\n const dot = document.createElement('span');\n dot.style.cssText = 'display:inline-block;width:10px;height:10px;border-radius:50%;';\n // Property setter (not cssText) \u2014 parses strictly as a CSS color and\n // silently rejects values that try to inject extra declarations.\n dot.style.background = color;\n td.appendChild(dot);\n return td;\n }\n\n // Default: text\n td.textContent = value === undefined || value === null ? '' : String(value);\n return td;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'syntro-viz-chart': ChartWidgetLit;\n }\n}\n", "/**\n * adaptive-viz \u2014 Bar layout \u2192 Vega-Lite spec\n */\n\nimport type { z } from 'zod';\nimport type { barLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype BarProps = z.infer<typeof barLayoutSchema>;\n\nexport function barToVegaLite(props: BarProps): VegaLiteSpec {\n const encoding: Record<string, unknown> = {\n // - labelAngle: 0 keeps category labels flat at the bottom. Vega-Lite's\n // default is -90deg (vertical) which is unreadable in narrow tile widths.\n // - sort: null preserves the order of `data`. Default is alphabetical,\n // which mangles intuitive orderings like \"1\u00D7, 30\u00D7, 90\u00D7, 180\u00D7\" or\n // \"NeuroPeak, ImmunEdge, GreenSync, RestoreMax\" (priority/popularity).\n x: { field: props.xField, type: 'nominal', axis: { labelAngle: 0 }, sort: null },\n y: { field: props.yField, type: 'quantitative' },\n };\n\n if (props.colorField) {\n encoding.color = { field: props.colorField, type: 'nominal' };\n }\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: props.data },\n mark: 'bar',\n encoding,\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Line layout \u2192 Vega-Lite spec\n */\n\nimport type { z } from 'zod';\nimport type { lineLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype LineProps = z.infer<typeof lineLayoutSchema>;\n\nexport function lineToVegaLite(props: LineProps): VegaLiteSpec {\n const encoding: Record<string, unknown> = {\n x: { field: props.xField, type: 'quantitative' },\n y: { field: props.yField, type: 'quantitative' },\n };\n\n if (props.seriesField) {\n encoding.color = { field: props.seriesField, type: 'nominal' };\n }\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: props.data },\n mark: 'line',\n encoding,\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Pie layout \u2192 Vega-Lite spec\n *\n * Renders a pie/donut chart using Vega-Lite's `arc` mark. Use for\n * part-of-whole compositions like ingredient percentages, segment\n * shares, etc. (\u2264 ~10 slices reads cleanly; more than that, prefer bar.)\n */\n\nimport type { z } from 'zod';\nimport type { pieLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype PieProps = z.infer<typeof pieLayoutSchema>;\n\nexport function pieToVegaLite(props: PieProps): VegaLiteSpec {\n const mark: Record<string, unknown> = { type: 'arc' };\n if (typeof props.innerRadius === 'number') {\n mark.innerRadius = props.innerRadius;\n }\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: props.data },\n mark,\n encoding: {\n theta: { field: props.valueField, type: 'quantitative' },\n color: { field: props.categoryField, type: 'nominal' },\n tooltip: [\n { field: props.categoryField, type: 'nominal' },\n { field: props.valueField, type: 'quantitative' },\n ],\n },\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Table layout \u2192 Vega-Lite spec\n *\n * Renders a tabular layout as a layered Vega-Lite spec where each column\n * is its own text-mark layer positioned by ordinal x. Suitable for small\n * data tables (<= 50 rows). For large tables, prefer a custom layout\n * with a more efficient rendering strategy.\n */\n\nimport type { z } from 'zod';\nimport type { tableLayoutSchema } from '../schema';\nimport type { VegaLiteSpec } from '../types';\n\nconst VEGA_LITE_SCHEMA_URL = 'https://vega.github.io/schema/vega-lite/v5.json';\n\ntype TableProps = z.infer<typeof tableLayoutSchema>;\n\nexport function tableToVegaLite(props: TableProps): VegaLiteSpec {\n const layer = props.columns.map((col, idx) => ({\n mark: { type: 'text', align: 'left', baseline: 'middle' },\n encoding: {\n x: { value: idx * 120 },\n y: { field: '_row', type: 'ordinal', axis: null },\n text: { field: col.field },\n },\n }));\n\n // Add a row index so y-encoding has something stable to bind to\n const dataWithRowIdx = props.data.map((row, i) => ({ ...row, _row: i }));\n\n const spec: VegaLiteSpec = {\n $schema: VEGA_LITE_SCHEMA_URL,\n data: { values: dataWithRowIdx },\n layer,\n };\n\n if (props.title) {\n spec.title = props.title;\n }\n\n return spec;\n}\n", "/**\n * adaptive-viz \u2014 Layout dispatcher\n *\n * Given validated ChartProps, produce a Vega-Lite spec ready for rendering.\n */\n\nimport type { ChartProps, VegaLiteSpec } from '../types';\nimport { barToVegaLite } from './bar';\nimport { lineToVegaLite } from './line';\nimport { pieToVegaLite } from './pie';\nimport { tableToVegaLite } from './table';\n\nexport function compileToVegaLite(props: ChartProps): VegaLiteSpec {\n switch (props.layout) {\n case 'bar':\n return barToVegaLite(props);\n case 'line':\n return lineToVegaLite(props);\n case 'table':\n return tableToVegaLite(props);\n case 'pie':\n return pieToVegaLite(props);\n default: {\n const _exhaustive: never = props;\n throw new Error(\n `Unknown chart layout: ${(props as { layout?: string }).layout ?? 'undefined'}`\n );\n }\n }\n}\n\nexport { barToVegaLite } from './bar';\nexport { lineToVegaLite } from './line';\nexport { pieToVegaLite } from './pie';\nexport { tableToVegaLite } from './table';\n", "/**\n * adaptive-viz \u2014 Theme bridge\n *\n * Reads the Syntro CSS variables off the host element's computed style and\n * produces a Vega-Lite `config` block that matches the customer brand at\n * compile time. Vega-Lite uses this config as defaults applied across all\n * marks, axes, legends, and titles.\n */\n\nexport interface VegaLiteConfig {\n mark?: Record<string, unknown>;\n title?: Record<string, unknown>;\n axis?: Record<string, unknown>;\n legend?: Record<string, unknown>;\n view?: Record<string, unknown>;\n background?: string;\n}\n\nfunction readVar(style: CSSStyleDeclaration, name: string): string | undefined {\n const v = style.getPropertyValue(name).trim();\n return v.length > 0 ? v : undefined;\n}\n\nexport function buildVegaLiteConfigFromCssVars(host: HTMLElement): VegaLiteConfig {\n const style = getComputedStyle(host);\n\n const colorPrimary = readVar(style, '--sc-color-primary');\n const fontFamily = readVar(style, '--sc-font-family');\n const textColor = readVar(style, '--sc-overlay-text-color');\n const tileBg = readVar(style, '--sc-tile-background');\n\n const config: VegaLiteConfig = {};\n\n if (colorPrimary) {\n config.mark = { color: colorPrimary };\n }\n\n if (fontFamily) {\n config.title = { font: fontFamily };\n config.axis = { labelFont: fontFamily, titleFont: fontFamily };\n config.legend = { labelFont: fontFamily, titleFont: fontFamily };\n }\n\n if (textColor) {\n config.axis = { ...(config.axis ?? {}), labelColor: textColor, titleColor: textColor };\n config.legend = { ...(config.legend ?? {}), labelColor: textColor, titleColor: textColor };\n config.title = { ...(config.title ?? {}), color: textColor };\n }\n\n if (tileBg) {\n config.background = tileBg;\n }\n\n return config;\n}\n", "/**\n * adaptive-viz \u2014 Runtime manifest\n *\n * Exports the runtime descriptor consumed by the SDK's AppLoader.\n * Registers the <syntro-viz-chart> custom element as a side effect of\n * importing this module, and exposes the widget mountable used by\n * SmartCanvasRuntime's WidgetRegistry.\n */\n\nimport { type MountPlumbing, stripMountPlumbing } from '@syntrologie/sdk-contracts';\nimport { ChartWidgetLit } from './ChartWidgetLit';\nimport type { ChartProps } from './types';\n\nconst TAG = 'syntro-viz-chart';\n\nif (typeof customElements !== 'undefined' && !customElements.get(TAG)) {\n customElements.define(TAG, ChartWidgetLit);\n}\n\n/**\n * Mountable widget interface: receives a container element and the tile's\n * props (validated upstream against chartSchema), returns an unmount fn.\n */\nexport const ChartWidgetMountable = {\n mount(container: HTMLElement, config?: (ChartProps & MountPlumbing) | null) {\n const chartProps = stripMountPlumbing<ChartProps>(config ?? null);\n const el = document.createElement(TAG) as ChartWidgetLit;\n el.chartProps = chartProps as ChartProps;\n container.appendChild(el);\n return () => el.remove();\n },\n};\n\nexport const runtime = {\n id: 'adaptive-viz',\n version: '1.0.0',\n name: 'Chart',\n description:\n 'Vega-Lite-backed data visualization tile with baked layouts (bar, line, table) plus a custom escape hatch.',\n\n /**\n * No DOM-mutation executors \u2014 this widget renders only.\n */\n executors: [],\n\n /**\n * Widget definitions for the runtime's WidgetRegistry.\n */\n widgets: [\n {\n id: 'adaptive-viz:chart',\n component: ChartWidgetMountable,\n metadata: {\n name: 'Chart',\n description: 'Bar / line / table / custom Vega-Lite chart',\n icon: '\uD83D\uDCCA',\n },\n },\n ],\n};\n\nexport default runtime;\n"],
|
|
5
|
-
"mappings":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