@nonoun/native-ai 1.0.71 → 1.0.72
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/native-ai.js +43 -47
- package/dist/register.js +349 -353
- package/package.json +1 -1
- package/dist/a2ui/a2ui-diagnostics.d.ts +0 -31
- package/dist/a2ui/a2ui-diagnostics.d.ts.map +0 -1
- package/dist/a2ui/a2ui-element.d.ts +0 -30
- package/dist/a2ui/a2ui-element.d.ts.map +0 -1
- package/dist/a2ui/a2ui-presets.d.ts +0 -22
- package/dist/a2ui/a2ui-presets.d.ts.map +0 -1
- package/dist/a2ui/adapters/a2a-adapter.d.ts +0 -38
- package/dist/a2ui/adapters/a2a-adapter.d.ts.map +0 -1
- package/dist/a2ui/adapters/adapter-types.d.ts +0 -19
- package/dist/a2ui/adapters/adapter-types.d.ts.map +0 -1
- package/dist/a2ui/adapters/ag-ui-adapter.d.ts +0 -42
- package/dist/a2ui/adapters/ag-ui-adapter.d.ts.map +0 -1
- package/dist/a2ui/adapters/direct-adapter.d.ts +0 -30
- package/dist/a2ui/adapters/direct-adapter.d.ts.map +0 -1
- package/dist/a2ui/adapters/index.d.ts +0 -8
- package/dist/a2ui/adapters/index.d.ts.map +0 -1
- package/dist/a2ui/builder/pipeline.d.ts +0 -33
- package/dist/a2ui/builder/pipeline.d.ts.map +0 -1
- package/dist/a2ui/builder/step-prompts.d.ts +0 -5
- package/dist/a2ui/builder/step-prompts.d.ts.map +0 -1
- package/dist/a2ui/index.d.ts +0 -15
- package/dist/a2ui/index.d.ts.map +0 -1
- package/dist/a2ui/install.d.ts +0 -23
- package/dist/a2ui/install.d.ts.map +0 -1
- package/dist/a2ui/protocol/a2ui-adapter.d.ts +0 -52
- package/dist/a2ui/protocol/a2ui-adapter.d.ts.map +0 -1
- package/dist/a2ui/protocol/a2ui-component-map.d.ts +0 -98
- package/dist/a2ui/protocol/a2ui-component-map.d.ts.map +0 -1
- package/dist/a2ui/protocol/a2ui-composition-map.d.ts +0 -101
- package/dist/a2ui/protocol/a2ui-composition-map.d.ts.map +0 -1
- package/dist/a2ui/protocol/a2ui-converter.d.ts +0 -37
- package/dist/a2ui/protocol/a2ui-converter.d.ts.map +0 -1
- package/dist/a2ui/protocol/a2ui-surface.d.ts +0 -34
- package/dist/a2ui/protocol/a2ui-surface.d.ts.map +0 -1
- package/dist/a2ui/protocol/a2ui-transport.d.ts +0 -80
- package/dist/a2ui/protocol/a2ui-transport.d.ts.map +0 -1
- package/dist/a2ui/protocol/a2ui-types.d.ts +0 -104
- package/dist/a2ui/protocol/a2ui-types.d.ts.map +0 -1
- package/dist/a2ui/protocol/index.d.ts +0 -15
- package/dist/a2ui/protocol/index.d.ts.map +0 -1
- package/dist/a2ui/protocol/kernel-bridge.d.ts +0 -114
- package/dist/a2ui/protocol/kernel-bridge.d.ts.map +0 -1
- package/dist/a2ui/register.d.ts +0 -12
- package/dist/a2ui/register.d.ts.map +0 -1
- package/dist/a2ui/session/agent-session.d.ts +0 -44
- package/dist/a2ui/session/agent-session.d.ts.map +0 -1
- package/dist/a2ui/session/catalog.d.ts +0 -41
- package/dist/a2ui/session/catalog.d.ts.map +0 -1
- package/dist/a2ui/session/event-emitter.d.ts +0 -17
- package/dist/a2ui/session/event-emitter.d.ts.map +0 -1
- package/dist/a2ui/session/index.d.ts +0 -9
- package/dist/a2ui/session/index.d.ts.map +0 -1
- package/dist/a2ui/session/session-manager.d.ts +0 -33
- package/dist/a2ui/session/session-manager.d.ts.map +0 -1
- package/dist/a2ui/session/surface-registry.d.ts +0 -32
- package/dist/a2ui/session/surface-registry.d.ts.map +0 -1
- package/dist/a2ui/session/types.d.ts +0 -27
- package/dist/a2ui/session/types.d.ts.map +0 -1
- package/dist/chat/avatar/chat-avatar-element.d.ts +0 -18
- package/dist/chat/avatar/chat-avatar-element.d.ts.map +0 -1
- package/dist/chat/avatar/index.d.ts +0 -2
- package/dist/chat/avatar/index.d.ts.map +0 -1
- package/dist/chat/avatar/n-chat-avatar.d.ts +0 -2
- package/dist/chat/avatar/n-chat-avatar.d.ts.map +0 -1
- package/dist/chat/chat-input-element.d.ts +0 -35
- package/dist/chat/chat-input-element.d.ts.map +0 -1
- package/dist/chat/chat-panel-element.d.ts +0 -100
- package/dist/chat/chat-panel-element.d.ts.map +0 -1
- package/dist/chat/feed/chat-feed-element.d.ts +0 -48
- package/dist/chat/feed/chat-feed-element.d.ts.map +0 -1
- package/dist/chat/feed/index.d.ts +0 -2
- package/dist/chat/feed/index.d.ts.map +0 -1
- package/dist/chat/feed/n-chat-feed.d.ts +0 -2
- package/dist/chat/feed/n-chat-feed.d.ts.map +0 -1
- package/dist/chat/gateway/adapter-chatgpt.d.ts +0 -67
- package/dist/chat/gateway/adapter-chatgpt.d.ts.map +0 -1
- package/dist/chat/gateway/adapter-claude.d.ts +0 -68
- package/dist/chat/gateway/adapter-claude.d.ts.map +0 -1
- package/dist/chat/gateway/adapter-mock.d.ts +0 -3
- package/dist/chat/gateway/adapter-mock.d.ts.map +0 -1
- package/dist/chat/gateway/adapter.d.ts +0 -71
- package/dist/chat/gateway/adapter.d.ts.map +0 -1
- package/dist/chat/gateway/controller.d.ts +0 -46
- package/dist/chat/gateway/controller.d.ts.map +0 -1
- package/dist/chat/gateway/index.d.ts +0 -9
- package/dist/chat/gateway/index.d.ts.map +0 -1
- package/dist/chat/gateway/runtime.d.ts +0 -53
- package/dist/chat/gateway/runtime.d.ts.map +0 -1
- package/dist/chat/gateway/types.d.ts +0 -73
- package/dist/chat/gateway/types.d.ts.map +0 -1
- package/dist/chat/gateway.d.ts +0 -2
- package/dist/chat/gateway.d.ts.map +0 -1
- package/dist/chat/index.d.ts +0 -17
- package/dist/chat/index.d.ts.map +0 -1
- package/dist/chat/message/chat-input-structured-element.d.ts +0 -43
- package/dist/chat/message/chat-input-structured-element.d.ts.map +0 -1
- package/dist/chat/message/chat-message-activity-element.d.ts +0 -32
- package/dist/chat/message/chat-message-activity-element.d.ts.map +0 -1
- package/dist/chat/message/chat-message-element.d.ts +0 -44
- package/dist/chat/message/chat-message-element.d.ts.map +0 -1
- package/dist/chat/message/chat-message-genui-element.d.ts +0 -45
- package/dist/chat/message/chat-message-genui-element.d.ts.map +0 -1
- package/dist/chat/message/chat-message-seed-element.d.ts +0 -32
- package/dist/chat/message/chat-message-seed-element.d.ts.map +0 -1
- package/dist/chat/message/chat-message-text-element.d.ts +0 -37
- package/dist/chat/message/chat-message-text-element.d.ts.map +0 -1
- package/dist/chat/message/chat-messages-element.d.ts +0 -39
- package/dist/chat/message/chat-messages-element.d.ts.map +0 -1
- package/dist/chat/message/index.d.ts +0 -8
- package/dist/chat/message/index.d.ts.map +0 -1
- package/dist/chat/message/n-chat-message.d.ts +0 -2
- package/dist/chat/message/n-chat-message.d.ts.map +0 -1
- package/dist/chat/register.d.ts +0 -13
- package/dist/chat/register.d.ts.map +0 -1
- package/dist/chat/stream/classify.d.ts +0 -19
- package/dist/chat/stream/classify.d.ts.map +0 -1
- package/dist/chat/stream/create-transport.d.ts +0 -19
- package/dist/chat/stream/create-transport.d.ts.map +0 -1
- package/dist/chat/stream/index.d.ts +0 -9
- package/dist/chat/stream/index.d.ts.map +0 -1
- package/dist/chat/stream/parse-json.d.ts +0 -9
- package/dist/chat/stream/parse-json.d.ts.map +0 -1
- package/dist/chat/stream/parse-ndjson.d.ts +0 -9
- package/dist/chat/stream/parse-ndjson.d.ts.map +0 -1
- package/dist/chat/stream/parse-sse.d.ts +0 -9
- package/dist/chat/stream/parse-sse.d.ts.map +0 -1
- package/dist/chat/stream/types.d.ts +0 -42
- package/dist/chat/stream/types.d.ts.map +0 -1
- package/dist/chat/telemetry/emitter.d.ts +0 -20
- package/dist/chat/telemetry/emitter.d.ts.map +0 -1
- package/dist/chat/telemetry/events.d.ts +0 -11
- package/dist/chat/telemetry/events.d.ts.map +0 -1
- package/dist/chat/telemetry/index.d.ts +0 -5
- package/dist/chat/telemetry/index.d.ts.map +0 -1
- package/dist/chat/telemetry/redactor.d.ts +0 -17
- package/dist/chat/telemetry/redactor.d.ts.map +0 -1
- package/dist/chat/telemetry/types.d.ts +0 -27
- package/dist/chat/telemetry/types.d.ts.map +0 -1
- package/dist/gateway.d.ts +0 -2
- package/dist/gateway.d.ts.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +0 -1
- package/dist/native-ai.css +0 -1567
- package/dist/register.d.ts +0 -12
- package/dist/register.d.ts.map +0 -1
package/dist/register.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NButton as e, NContainer as t, NDialog as n, NIcon as r, NListbox as i, NOption as a, NOptionGroup as o, NOptionGroupHeader as s,
|
|
2
|
-
import { Decoration as
|
|
3
|
-
import { json as
|
|
4
|
-
import { linter as
|
|
1
|
+
import { NButton as e, NContainer as t, NDialog as n, NIcon as r, NListbox as i, NOption as a, NOptionGroup as o, NOptionGroupHeader as s, NPane as c, NSegment as l, NSegmentedControl as u, NSelect as d, NTextarea as f, NToolbar as p, NativeElement as m, PresentController as h, ResizeController as g, VirtualScrollController as _, computed as v, createDisabledEffect as y, define as b, effect as ee, registerIcon as x, signal as S, uid as C } from "@nonoun/native-ui";
|
|
2
|
+
import { Decoration as w, EditorView as T, StateEffect as te, StateField as ne, keymap as re } from "@nonoun/native-code";
|
|
3
|
+
import { json as E } from "@codemirror/lang-json";
|
|
4
|
+
import { linter as ie } from "@codemirror/lint";
|
|
5
5
|
import "@nonoun/native-code/register";
|
|
6
|
-
import { Kernel as
|
|
7
|
-
var
|
|
6
|
+
import { Kernel as ae, resetKernel as oe } from "@nonoun/native-ui/kernel";
|
|
7
|
+
var D = new Set([
|
|
8
8
|
"createSurface",
|
|
9
9
|
"updateComponents",
|
|
10
10
|
"updateDataModel",
|
|
@@ -15,7 +15,7 @@ var T = new Set([
|
|
|
15
15
|
* Find top-level `{}` blocks using brace-counting with string-escape awareness.
|
|
16
16
|
* Same algorithm as the workbench's `#getEnvelopes()` method.
|
|
17
17
|
*/
|
|
18
|
-
function
|
|
18
|
+
function se(e) {
|
|
19
19
|
let t = [], n = 0, r = -1, i = !1, a = !1;
|
|
20
20
|
for (let o = 0; o < e.length; o++) {
|
|
21
21
|
let s = e[o];
|
|
@@ -48,8 +48,8 @@ function ce(e) {
|
|
|
48
48
|
* const ext = linter(a2uiLinter);
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
function
|
|
52
|
-
let t = e.state.doc.toString(), n = [], r =
|
|
51
|
+
function ce(e) {
|
|
52
|
+
let t = e.state.doc.toString(), n = [], r = se(t), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = [], s = /* @__PURE__ */ new Map();
|
|
53
53
|
for (let e of r) {
|
|
54
54
|
let { from: t, to: r, text: c } = e, l;
|
|
55
55
|
try {
|
|
@@ -73,13 +73,13 @@ function le(e) {
|
|
|
73
73
|
});
|
|
74
74
|
continue;
|
|
75
75
|
}
|
|
76
|
-
let u = Object.keys(l), d = u.find((e) =>
|
|
76
|
+
let u = Object.keys(l), d = u.find((e) => D.has(e)), f = u.filter((e) => !D.has(e) && e !== "version");
|
|
77
77
|
if (!d && f.length > 0) {
|
|
78
78
|
n.push({
|
|
79
79
|
from: t,
|
|
80
80
|
to: r,
|
|
81
81
|
severity: "error",
|
|
82
|
-
message: `Unknown envelope key: "${f[0]}". Expected one of: ${[...
|
|
82
|
+
message: `Unknown envelope key: "${f[0]}". Expected one of: ${[...D].join(", ")}`
|
|
83
83
|
});
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
@@ -88,7 +88,7 @@ function le(e) {
|
|
|
88
88
|
from: t,
|
|
89
89
|
to: r,
|
|
90
90
|
severity: "error",
|
|
91
|
-
message: `Missing envelope key. Expected one of: ${[...
|
|
91
|
+
message: `Missing envelope key. Expected one of: ${[...D].join(", ")}`
|
|
92
92
|
});
|
|
93
93
|
continue;
|
|
94
94
|
}
|
|
@@ -150,29 +150,29 @@ function le(e) {
|
|
|
150
150
|
}
|
|
151
151
|
return n;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function O(e) {
|
|
154
154
|
return typeof e == "object" && !!e && "path" in e && typeof e.path == "string" && Object.keys(e).length === 1;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function le(e) {
|
|
157
157
|
return "createSurface" in e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function ue(e) {
|
|
160
160
|
return "updateComponents" in e;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function de(e) {
|
|
163
163
|
return "updateDataModel" in e;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function fe(e) {
|
|
166
166
|
return "deleteSurface" in e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function pe(e) {
|
|
169
169
|
return "requestCatalog" in e;
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Parse a raw JSON string into a typed A2UI server message.
|
|
173
173
|
* Returns null if the JSON is not a valid A2UI message.
|
|
174
174
|
*/
|
|
175
|
-
function
|
|
175
|
+
function me(e) {
|
|
176
176
|
try {
|
|
177
177
|
let t = JSON.parse(e);
|
|
178
178
|
return "createSurface" in t || "updateComponents" in t || "updateDataModel" in t || "deleteSurface" in t || "requestCatalog" in t ? t : null;
|
|
@@ -196,7 +196,7 @@ var he = class e {
|
|
|
196
196
|
#n = /* @__PURE__ */ new Map();
|
|
197
197
|
#r;
|
|
198
198
|
constructor(e, t) {
|
|
199
|
-
this.#r =
|
|
199
|
+
this.#r = S(0);
|
|
200
200
|
for (let t of e) this.#i(t);
|
|
201
201
|
if (t) for (let [e, n] of Object.entries(t)) this.#n.set(e, n);
|
|
202
202
|
}
|
|
@@ -293,7 +293,7 @@ var he = class e {
|
|
|
293
293
|
this.#t.clear();
|
|
294
294
|
for (let e of this.#e.values()) e.nativeTag !== "div" && e.nativeTag !== "span" && !this.#t.has(e.nativeTag) && this.#t.set(e.nativeTag, e);
|
|
295
295
|
}
|
|
296
|
-
},
|
|
296
|
+
}, k = [
|
|
297
297
|
{
|
|
298
298
|
attr: "intent",
|
|
299
299
|
type: "'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'",
|
|
@@ -320,7 +320,7 @@ var he = class e {
|
|
|
320
320
|
note: "compact=reduced padding, inline=minimal height"
|
|
321
321
|
}
|
|
322
322
|
];
|
|
323
|
-
const
|
|
323
|
+
const A = new he([
|
|
324
324
|
{
|
|
325
325
|
a2uiType: "Text",
|
|
326
326
|
nativeTag: "span",
|
|
@@ -353,7 +353,7 @@ const k = new he([
|
|
|
353
353
|
description: "Fires on click or keyboard activation (Enter/Space)."
|
|
354
354
|
}],
|
|
355
355
|
properties: [
|
|
356
|
-
...
|
|
356
|
+
...k,
|
|
357
357
|
{
|
|
358
358
|
attr: "disabled",
|
|
359
359
|
type: "boolean",
|
|
@@ -398,7 +398,7 @@ const k = new he([
|
|
|
398
398
|
}
|
|
399
399
|
],
|
|
400
400
|
properties: [
|
|
401
|
-
...
|
|
401
|
+
...k,
|
|
402
402
|
{
|
|
403
403
|
attr: "value",
|
|
404
404
|
type: "string",
|
|
@@ -485,7 +485,7 @@ const k = new he([
|
|
|
485
485
|
}
|
|
486
486
|
],
|
|
487
487
|
properties: [
|
|
488
|
-
...
|
|
488
|
+
...k,
|
|
489
489
|
{
|
|
490
490
|
attr: "value",
|
|
491
491
|
type: "string",
|
|
@@ -557,7 +557,7 @@ const k = new he([
|
|
|
557
557
|
description: "Fires when checked state toggles."
|
|
558
558
|
}],
|
|
559
559
|
properties: [
|
|
560
|
-
...
|
|
560
|
+
...k,
|
|
561
561
|
{
|
|
562
562
|
attr: "checked",
|
|
563
563
|
type: "boolean",
|
|
@@ -605,7 +605,7 @@ const k = new he([
|
|
|
605
605
|
description: "Fires when toggled on/off."
|
|
606
606
|
}],
|
|
607
607
|
properties: [
|
|
608
|
-
...
|
|
608
|
+
...k,
|
|
609
609
|
{
|
|
610
610
|
attr: "checked",
|
|
611
611
|
type: "boolean",
|
|
@@ -650,7 +650,7 @@ const k = new he([
|
|
|
650
650
|
description: "Fires when selection changes."
|
|
651
651
|
}],
|
|
652
652
|
properties: [
|
|
653
|
-
...
|
|
653
|
+
...k,
|
|
654
654
|
{
|
|
655
655
|
attr: "value",
|
|
656
656
|
type: "string",
|
|
@@ -705,7 +705,7 @@ const k = new he([
|
|
|
705
705
|
description: "Fires when slider value changes."
|
|
706
706
|
}],
|
|
707
707
|
properties: [
|
|
708
|
-
...
|
|
708
|
+
...k,
|
|
709
709
|
{
|
|
710
710
|
attr: "value",
|
|
711
711
|
type: "number",
|
|
@@ -748,7 +748,7 @@ const k = new he([
|
|
|
748
748
|
description: "Fires when date/time value changes."
|
|
749
749
|
}],
|
|
750
750
|
properties: [
|
|
751
|
-
...
|
|
751
|
+
...k,
|
|
752
752
|
{
|
|
753
753
|
attr: "value",
|
|
754
754
|
type: "string",
|
|
@@ -852,7 +852,7 @@ const k = new he([
|
|
|
852
852
|
description: "Fires when the dialog is closed."
|
|
853
853
|
}],
|
|
854
854
|
properties: [
|
|
855
|
-
...
|
|
855
|
+
...k,
|
|
856
856
|
{
|
|
857
857
|
attr: "no-close-on-escape",
|
|
858
858
|
type: "boolean"
|
|
@@ -885,7 +885,7 @@ const k = new he([
|
|
|
885
885
|
description: "Fires when the active tab changes."
|
|
886
886
|
}],
|
|
887
887
|
properties: [
|
|
888
|
-
...
|
|
888
|
+
...k,
|
|
889
889
|
{
|
|
890
890
|
attr: "value",
|
|
891
891
|
type: "string",
|
|
@@ -918,7 +918,7 @@ const k = new he([
|
|
|
918
918
|
description: "Fires when the selected option changes."
|
|
919
919
|
}],
|
|
920
920
|
properties: [
|
|
921
|
-
...
|
|
921
|
+
...k,
|
|
922
922
|
{
|
|
923
923
|
attr: "disabled",
|
|
924
924
|
type: "boolean",
|
|
@@ -1060,7 +1060,7 @@ const k = new he([
|
|
|
1060
1060
|
description: "Fires when selection changes."
|
|
1061
1061
|
}],
|
|
1062
1062
|
properties: [
|
|
1063
|
-
...
|
|
1063
|
+
...k,
|
|
1064
1064
|
{
|
|
1065
1065
|
attr: "value",
|
|
1066
1066
|
type: "string",
|
|
@@ -1134,7 +1134,7 @@ const k = new he([
|
|
|
1134
1134
|
childStrategy: "children",
|
|
1135
1135
|
events: [],
|
|
1136
1136
|
properties: [
|
|
1137
|
-
...
|
|
1137
|
+
...k,
|
|
1138
1138
|
{
|
|
1139
1139
|
attr: "multiple",
|
|
1140
1140
|
type: "boolean",
|
|
@@ -1205,7 +1205,7 @@ const k = new he([
|
|
|
1205
1205
|
}
|
|
1206
1206
|
],
|
|
1207
1207
|
properties: [
|
|
1208
|
-
...
|
|
1208
|
+
...k,
|
|
1209
1209
|
{
|
|
1210
1210
|
attr: "selectable",
|
|
1211
1211
|
type: "boolean",
|
|
@@ -1242,7 +1242,7 @@ const k = new he([
|
|
|
1242
1242
|
},
|
|
1243
1243
|
events: [],
|
|
1244
1244
|
properties: [
|
|
1245
|
-
...
|
|
1245
|
+
...k,
|
|
1246
1246
|
{
|
|
1247
1247
|
attr: "value",
|
|
1248
1248
|
type: "number",
|
|
@@ -1272,7 +1272,7 @@ const k = new he([
|
|
|
1272
1272
|
description: "Fires when the toast dismiss button is clicked."
|
|
1273
1273
|
}],
|
|
1274
1274
|
properties: [
|
|
1275
|
-
...
|
|
1275
|
+
...k,
|
|
1276
1276
|
{
|
|
1277
1277
|
attr: "message",
|
|
1278
1278
|
type: "string"
|
|
@@ -1440,14 +1440,14 @@ const k = new he([
|
|
|
1440
1440
|
Chart: "data-viz",
|
|
1441
1441
|
Controller: "behavior"
|
|
1442
1442
|
});
|
|
1443
|
-
function
|
|
1444
|
-
return
|
|
1443
|
+
function j(e) {
|
|
1444
|
+
return A.resolveNativeTag(e);
|
|
1445
1445
|
}
|
|
1446
|
-
function
|
|
1447
|
-
return
|
|
1446
|
+
function M(e, t) {
|
|
1447
|
+
return A.resolveA2UIType(e, t);
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1450
|
-
return
|
|
1449
|
+
function N() {
|
|
1450
|
+
return A.getSupportedTypes();
|
|
1451
1451
|
}
|
|
1452
1452
|
var ge = {
|
|
1453
1453
|
h1: "h1",
|
|
@@ -1495,7 +1495,7 @@ var xe = new Set(/* @__PURE__ */ "id.component.children.child.text.label.variant
|
|
|
1495
1495
|
"Body",
|
|
1496
1496
|
"Footer"
|
|
1497
1497
|
]);
|
|
1498
|
-
function
|
|
1498
|
+
function P(e, t) {
|
|
1499
1499
|
if (e.length === 0) return {
|
|
1500
1500
|
root: {
|
|
1501
1501
|
id: "empty-root",
|
|
@@ -1527,7 +1527,7 @@ function N(e, t) {
|
|
|
1527
1527
|
warnings: ["No root component found"],
|
|
1528
1528
|
orphans: []
|
|
1529
1529
|
};
|
|
1530
|
-
let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map(), s = [], c = t?.surfaceId ?? "default", l = t?.registry ? (e) => t.registry.resolveNativeTag(e) :
|
|
1530
|
+
let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map(), s = [], c = t?.surfaceId ?? "default", l = t?.registry ? (e) => t.registry.resolveNativeTag(e) : j, u = F(i, n, a, o, s, c, l), d = e.filter((e) => !a.has(e.id)).map((e) => e.id);
|
|
1531
1531
|
return d.length > 0 && s.push(`Orphan components not reachable from root: ${d.join(", ")}`), {
|
|
1532
1532
|
root: u,
|
|
1533
1533
|
bindings: o,
|
|
@@ -1535,7 +1535,7 @@ function N(e, t) {
|
|
|
1535
1535
|
orphans: d
|
|
1536
1536
|
};
|
|
1537
1537
|
}
|
|
1538
|
-
function
|
|
1538
|
+
function F(e, t, n, r, i, a, o = j) {
|
|
1539
1539
|
if (n.has(e)) return i.push(`Cycle detected at component "${e}"`), {
|
|
1540
1540
|
id: `${e}-cycle`,
|
|
1541
1541
|
tag: "div",
|
|
@@ -1563,7 +1563,7 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1563
1563
|
} else s.variant && s.component !== "Text" && (u.variant = s.variant);
|
|
1564
1564
|
if (c.propertyMap) for (let [t, n] of Object.entries(c.propertyMap)) {
|
|
1565
1565
|
let i = s[t];
|
|
1566
|
-
if (i !== void 0) if (
|
|
1566
|
+
if (i !== void 0) if (O(i)) {
|
|
1567
1567
|
let t = r.get(e);
|
|
1568
1568
|
t || (t = [], r.set(e, t)), t.push({
|
|
1569
1569
|
property: n,
|
|
@@ -1575,7 +1575,7 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1575
1575
|
let e = be(s.variant);
|
|
1576
1576
|
e !== "text" && (u.type = e);
|
|
1577
1577
|
}
|
|
1578
|
-
if (s.component === "DateTimeInput" && (u.type = ve(s.enableDate, s.enableTime)), (s.component === "TextField" || s.component === "DateTimeInput" || s.component === "Slider") && s.label) if (
|
|
1578
|
+
if (s.component === "DateTimeInput" && (u.type = ve(s.enableDate, s.enableTime)), (s.component === "TextField" || s.component === "DateTimeInput" || s.component === "Slider") && s.label) if (O(s.label)) {
|
|
1579
1579
|
let t = r.get(e);
|
|
1580
1580
|
t || (t = [], r.set(e, t)), t.push({
|
|
1581
1581
|
property: "aria-label",
|
|
@@ -1587,7 +1587,7 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1587
1587
|
u.style = `--n-progress: ${t > 0 ? Math.min(1, Math.max(0, e / t)) : 0}`, u.value && (u["data-value"] = u.value, delete u.value), u.max && (u["data-max"] = u.max, delete u.max);
|
|
1588
1588
|
}
|
|
1589
1589
|
let d;
|
|
1590
|
-
if (s.text !== void 0) if (
|
|
1590
|
+
if (s.text !== void 0) if (O(s.text)) {
|
|
1591
1591
|
let t = r.get(e);
|
|
1592
1592
|
t || (t = [], r.set(e, t)), t.push({
|
|
1593
1593
|
property: "textContent",
|
|
@@ -1612,7 +1612,7 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1612
1612
|
attributes: { value: u },
|
|
1613
1613
|
textContent: d
|
|
1614
1614
|
});
|
|
1615
|
-
let f = l.children ?? (l.child ? [l.child] : void 0), h = f ? f.map((e) =>
|
|
1615
|
+
let f = l.children ?? (l.child ? [l.child] : void 0), h = f ? f.map((e) => F(e, t, n, r, i, a, o)) : void 0, g = typeof l.text == "string" ? l.text : void 0;
|
|
1616
1616
|
s.push({
|
|
1617
1617
|
id: `${c}-panel`,
|
|
1618
1618
|
tag: "n-tab-panel",
|
|
@@ -1651,7 +1651,7 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1651
1651
|
} else if (s.component === "Card" && m && m.length > 0) if (m.some((e) => {
|
|
1652
1652
|
let n = t.get(e);
|
|
1653
1653
|
return n ? Se.has(n.component) : !1;
|
|
1654
|
-
})) p = m.map((e) =>
|
|
1654
|
+
})) p = m.map((e) => F(e, t, n, r, i, a, o));
|
|
1655
1655
|
else {
|
|
1656
1656
|
p = [];
|
|
1657
1657
|
let c = s.header ?? s.label;
|
|
@@ -1665,7 +1665,7 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1665
1665
|
textContent: c
|
|
1666
1666
|
}]
|
|
1667
1667
|
});
|
|
1668
|
-
let l = m.map((e) =>
|
|
1668
|
+
let l = m.map((e) => F(e, t, n, r, i, a, o));
|
|
1669
1669
|
p.push({
|
|
1670
1670
|
id: `${e}-body`,
|
|
1671
1671
|
tag: "n-body",
|
|
@@ -1678,14 +1678,14 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1678
1678
|
textContent: u
|
|
1679
1679
|
}), c && (d = void 0);
|
|
1680
1680
|
}
|
|
1681
|
-
else m && m.length > 0 && (p = m.map((e) =>
|
|
1681
|
+
else m && m.length > 0 && (p = m.map((e) => F(e, t, n, r, i, a, o)));
|
|
1682
1682
|
if (c.childStrategy === "slot-label" && d && !p) p = [{
|
|
1683
1683
|
id: `${e}-label`,
|
|
1684
1684
|
tag: "span",
|
|
1685
1685
|
attributes: { slot: "label" },
|
|
1686
1686
|
textContent: d
|
|
1687
1687
|
}], d = void 0;
|
|
1688
|
-
else if (c.childStrategy === "textContent" && s.label && !d) if (
|
|
1688
|
+
else if (c.childStrategy === "textContent" && s.label && !d) if (O(s.label)) {
|
|
1689
1689
|
let t = r.get(e);
|
|
1690
1690
|
t || (t = [], r.set(e, t)), t.push({
|
|
1691
1691
|
property: "textContent",
|
|
@@ -1701,7 +1701,7 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1701
1701
|
"poster"
|
|
1702
1702
|
]) u[e] && (n[e] = u[e], delete u[e]);
|
|
1703
1703
|
if (s.component === "Image" && s.url !== void 0) {
|
|
1704
|
-
if (
|
|
1704
|
+
if (O(s.url)) {
|
|
1705
1705
|
let t = r.get(`${e}-inner`);
|
|
1706
1706
|
t || (t = [], r.set(`${e}-inner`, t)), t.push({
|
|
1707
1707
|
property: "src",
|
|
@@ -1727,10 +1727,10 @@ function P(e, t, n, r, i, a, o = A) {
|
|
|
1727
1727
|
};
|
|
1728
1728
|
}
|
|
1729
1729
|
function Ce(e, t) {
|
|
1730
|
-
let n = [], r = t?.registry ? (e, n) => t.registry.resolveA2UIType(e, n) :
|
|
1731
|
-
return
|
|
1730
|
+
let n = [], r = t?.registry ? (e, n) => t.registry.resolveA2UIType(e, n) : M, i = t?.registry ? (e) => t.registry.resolveNativeTag(e) : j;
|
|
1731
|
+
return I(e, n, t?.surfaceId ?? "default", r, i), n;
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1733
|
+
function I(e, t, n, r = M, i = j) {
|
|
1734
1734
|
let a = r(e.tag, e.attributes);
|
|
1735
1735
|
if (!a) {
|
|
1736
1736
|
let a = {
|
|
@@ -1739,7 +1739,7 @@ function F(e, t, n, r = j, i = A) {
|
|
|
1739
1739
|
...e.children ? { children: e.children.map((e) => e.id) } : {},
|
|
1740
1740
|
...e.textContent ? { text: e.textContent } : {}
|
|
1741
1741
|
};
|
|
1742
|
-
if (t.push(a), e.children) for (let a of e.children)
|
|
1742
|
+
if (t.push(a), e.children) for (let a of e.children) I(a, t, n, r, i);
|
|
1743
1743
|
return;
|
|
1744
1744
|
}
|
|
1745
1745
|
let o = i(a), s = {
|
|
@@ -1752,11 +1752,11 @@ function F(e, t, n, r = j, i = A) {
|
|
|
1752
1752
|
} else if (o?.childStrategy === "slot-label" && e.children.length === 1 && e.children[0].attributes?.slot === "label" && e.children[0].textContent) s.text = e.children[0].textContent;
|
|
1753
1753
|
else {
|
|
1754
1754
|
s.children = e.children.map((e) => e.id);
|
|
1755
|
-
for (let a of e.children)
|
|
1755
|
+
for (let a of e.children) I(a, t, n, r, i);
|
|
1756
1756
|
}
|
|
1757
1757
|
if (e.textContent && (a === "CheckBox" || a === "Switch" || a === "ListItem" ? s.label = e.textContent : s.text = e.textContent), e.attributes) {
|
|
1758
|
-
let t = o?.propertyMap ?
|
|
1759
|
-
for (let [n, r] of Object.entries(e.attributes)) n === "style" || n === "data-a2ui" || n === "slot" || (t[n] ? s[t[n]] = r : n === "aria-label" ? s.label = r : n === "disabled" && r === "" ? s.disabled = !0 : n === "variant" && (s.variant = (o?.variantMap ?
|
|
1758
|
+
let t = o?.propertyMap ? L(o.propertyMap) : {};
|
|
1759
|
+
for (let [n, r] of Object.entries(e.attributes)) n === "style" || n === "data-a2ui" || n === "slot" || (t[n] ? s[t[n]] = r : n === "aria-label" ? s.label = r : n === "disabled" && r === "" ? s.disabled = !0 : n === "variant" && (s.variant = (o?.variantMap ? L(o.variantMap) : {})[r] ?? r));
|
|
1760
1760
|
}
|
|
1761
1761
|
if (e.events) for (let [t, n] of Object.entries(e.events)) {
|
|
1762
1762
|
let e = n.split(":");
|
|
@@ -1764,7 +1764,7 @@ function F(e, t, n, r = j, i = A) {
|
|
|
1764
1764
|
}
|
|
1765
1765
|
t.push(s);
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1767
|
+
function L(e) {
|
|
1768
1768
|
let t = {};
|
|
1769
1769
|
for (let [n, r] of Object.entries(e)) t[r] = n;
|
|
1770
1770
|
return t;
|
|
@@ -1772,9 +1772,9 @@ function we(e) {
|
|
|
1772
1772
|
/**
|
|
1773
1773
|
* Wrap a conversion result as a UIPlan.
|
|
1774
1774
|
*/
|
|
1775
|
-
function
|
|
1775
|
+
function we(e, t = "generated") {
|
|
1776
1776
|
return Object.freeze({
|
|
1777
|
-
id:
|
|
1777
|
+
id: C("a2ui-plan"),
|
|
1778
1778
|
version: 1,
|
|
1779
1779
|
root: e.root,
|
|
1780
1780
|
source: t,
|
|
@@ -1787,18 +1787,18 @@ function Te(e, t = "generated") {
|
|
|
1787
1787
|
* Manages A2UI surface lifecycle: create → updateComponents → updateDataModel → delete.
|
|
1788
1788
|
* Each surface maps to one UIPlan in the kernel.
|
|
1789
1789
|
*/
|
|
1790
|
-
function
|
|
1790
|
+
function R(e, t) {
|
|
1791
1791
|
if (!t || t === "/") return e;
|
|
1792
|
-
let n = t.replace(/^\//, "").split("/").map(
|
|
1792
|
+
let n = t.replace(/^\//, "").split("/").map(z), r = e;
|
|
1793
1793
|
for (let e of n) {
|
|
1794
1794
|
if (typeof r != "object" || !r) return;
|
|
1795
1795
|
r = r[e];
|
|
1796
1796
|
}
|
|
1797
1797
|
return r;
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1799
|
+
function Te(e, t, n) {
|
|
1800
1800
|
if (!t || t === "/") return;
|
|
1801
|
-
let r = t.replace(/^\//, "").split("/").map(
|
|
1801
|
+
let r = t.replace(/^\//, "").split("/").map(z), i = e;
|
|
1802
1802
|
for (let e = 0; e < r.length - 1; e++) {
|
|
1803
1803
|
let t = r[e];
|
|
1804
1804
|
(i[t] == null || typeof i[t] != "object") && (i[t] = {}), i = i[t];
|
|
@@ -1806,22 +1806,22 @@ function Ee(e, t, n) {
|
|
|
1806
1806
|
let a = r[r.length - 1];
|
|
1807
1807
|
n === void 0 ? delete i[a] : i[a] = n;
|
|
1808
1808
|
}
|
|
1809
|
-
function
|
|
1809
|
+
function z(e) {
|
|
1810
1810
|
return e.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
1811
1811
|
}
|
|
1812
|
-
var
|
|
1812
|
+
var Ee = class {
|
|
1813
1813
|
#e;
|
|
1814
1814
|
#t;
|
|
1815
1815
|
#n;
|
|
1816
1816
|
#r;
|
|
1817
1817
|
#i = /* @__PURE__ */ new Map();
|
|
1818
|
-
#a =
|
|
1819
|
-
surfaceCount =
|
|
1818
|
+
#a = S(0);
|
|
1819
|
+
surfaceCount = v(() => this.#a.value);
|
|
1820
1820
|
constructor(e, t, n, r) {
|
|
1821
1821
|
this.#e = e, this.#t = t, this.#n = n ?? null, this.#r = r;
|
|
1822
1822
|
}
|
|
1823
1823
|
handleMessage(e, t) {
|
|
1824
|
-
|
|
1824
|
+
le(e) ? this.#o(e, t) : ue(e) ? this.#s(e, t) : de(e) ? this.#u(e) : fe(e) && this.#d(e);
|
|
1825
1825
|
}
|
|
1826
1826
|
#o(e, t) {
|
|
1827
1827
|
let { surfaceId: n, catalogId: r, theme: i } = e.createSurface, a = this.#i.get(n);
|
|
@@ -1831,12 +1831,12 @@ var De = class {
|
|
|
1831
1831
|
}
|
|
1832
1832
|
let o = {
|
|
1833
1833
|
surfaceId: n,
|
|
1834
|
-
planId:
|
|
1834
|
+
planId: C("a2ui-plan"),
|
|
1835
1835
|
catalogId: r,
|
|
1836
1836
|
theme: i,
|
|
1837
1837
|
container: t ?? document.createElement("div"),
|
|
1838
1838
|
components: [],
|
|
1839
|
-
dataModel:
|
|
1839
|
+
dataModel: S({}),
|
|
1840
1840
|
bindings: /* @__PURE__ */ new Map(),
|
|
1841
1841
|
bindingDisposers: [],
|
|
1842
1842
|
actionDisposer: null,
|
|
@@ -1848,10 +1848,10 @@ var De = class {
|
|
|
1848
1848
|
let { surfaceId: n, components: r } = e.updateComponents, i = this.#i.get(n);
|
|
1849
1849
|
i ? t && (i.container = t) : (i = {
|
|
1850
1850
|
surfaceId: n,
|
|
1851
|
-
planId:
|
|
1851
|
+
planId: C("a2ui-plan"),
|
|
1852
1852
|
container: t ?? document.createElement("div"),
|
|
1853
1853
|
components: [],
|
|
1854
|
-
dataModel:
|
|
1854
|
+
dataModel: S({}),
|
|
1855
1855
|
bindings: /* @__PURE__ */ new Map(),
|
|
1856
1856
|
bindingDisposers: [],
|
|
1857
1857
|
actionDisposer: null,
|
|
@@ -1859,12 +1859,12 @@ var De = class {
|
|
|
1859
1859
|
}, this.#i.set(n, i), this.#a.value = this.#i.size), i.rendered ? (this.#l(i, r), i.components = [...r]) : (i.components = [...r], this.#c(i)), i.rendered && this.#n?.(i.surfaceId, i.container);
|
|
1860
1860
|
}
|
|
1861
1861
|
#c(e) {
|
|
1862
|
-
let t =
|
|
1862
|
+
let t = P(e.components, {
|
|
1863
1863
|
surfaceId: e.surfaceId,
|
|
1864
1864
|
registry: this.#r
|
|
1865
1865
|
});
|
|
1866
1866
|
e.bindings = new Map(t.bindings);
|
|
1867
|
-
let n =
|
|
1867
|
+
let n = we(t);
|
|
1868
1868
|
e.planId = n.id;
|
|
1869
1869
|
try {
|
|
1870
1870
|
let t = this.#e.executePlan(n, e.container);
|
|
@@ -1872,7 +1872,7 @@ var De = class {
|
|
|
1872
1872
|
} catch {}
|
|
1873
1873
|
}
|
|
1874
1874
|
#l(e, t) {
|
|
1875
|
-
let n =
|
|
1875
|
+
let n = Ae(e.components, t, e.surfaceId, this.#r);
|
|
1876
1876
|
if (n.length === 0) return;
|
|
1877
1877
|
this.#e.patchPlan({
|
|
1878
1878
|
planId: e.planId,
|
|
@@ -1880,7 +1880,7 @@ var De = class {
|
|
|
1880
1880
|
source: "generated",
|
|
1881
1881
|
timestamp: Date.now()
|
|
1882
1882
|
});
|
|
1883
|
-
let r =
|
|
1883
|
+
let r = P(t, {
|
|
1884
1884
|
surfaceId: e.surfaceId,
|
|
1885
1885
|
registry: this.#r
|
|
1886
1886
|
});
|
|
@@ -1894,7 +1894,7 @@ var De = class {
|
|
|
1894
1894
|
let { surfaceId: t, path: n, value: r } = e.updateDataModel, i = this.#i.get(t);
|
|
1895
1895
|
if (!i) return;
|
|
1896
1896
|
let a = { ...i.dataModel.value };
|
|
1897
|
-
!n || n === "/" ? i.dataModel.value = r ?? {} : (
|
|
1897
|
+
!n || n === "/" ? i.dataModel.value = r ?? {} : (Te(a, n, r), i.dataModel.value = a);
|
|
1898
1898
|
}
|
|
1899
1899
|
#d(e) {
|
|
1900
1900
|
let { surfaceId: t } = e.deleteSurface, n = this.#i.get(t);
|
|
@@ -1909,7 +1909,7 @@ var De = class {
|
|
|
1909
1909
|
let i = t.get(n);
|
|
1910
1910
|
if (i) for (let t of r) {
|
|
1911
1911
|
let n = ee(() => {
|
|
1912
|
-
let n = e.dataModel.value, r =
|
|
1912
|
+
let n = e.dataModel.value, r = R(n, t.path);
|
|
1913
1913
|
r !== void 0 && (t.property === "textContent" ? i.textContent = String(r) : t.property === "src" || t.property === "alt" || t.property.startsWith("aria-") ? i.setAttribute(t.property, String(r)) : i[t.property] = r);
|
|
1914
1914
|
});
|
|
1915
1915
|
e.bindingDisposers.push(n);
|
|
@@ -1921,7 +1921,7 @@ var De = class {
|
|
|
1921
1921
|
e.actionDisposer = this.#e.bus.on((e) => e.type.startsWith(t), (t) => {
|
|
1922
1922
|
let n = t.type.split(":");
|
|
1923
1923
|
if (n.length < 4) return;
|
|
1924
|
-
let r = n[2], i = n[3], a = e.components.find((e) => e.id === r)?.action?.event?.context, o = a ?
|
|
1924
|
+
let r = n[2], i = n[3], a = e.components.find((e) => e.id === r)?.action?.event?.context, o = a ? De(a, e.dataModel.value) : void 0;
|
|
1925
1925
|
this.#t({ action: {
|
|
1926
1926
|
surfaceId: e.surfaceId,
|
|
1927
1927
|
sourceComponentId: r,
|
|
@@ -1952,13 +1952,13 @@ var De = class {
|
|
|
1952
1952
|
for (let e of this.#i.keys()) this.#d({ deleteSurface: { surfaceId: e } });
|
|
1953
1953
|
}
|
|
1954
1954
|
};
|
|
1955
|
-
function
|
|
1955
|
+
function De(e, t) {
|
|
1956
1956
|
let n = {};
|
|
1957
|
-
for (let [r, i] of Object.entries(e)) typeof i == "object" && i && "path" in i ? n[r] =
|
|
1957
|
+
for (let [r, i] of Object.entries(e)) typeof i == "object" && i && "path" in i ? n[r] = R(t, i.path) : n[r] = i;
|
|
1958
1958
|
return n;
|
|
1959
1959
|
}
|
|
1960
1960
|
/** A2UI properties that map to HTML attributes on the rendered element. */
|
|
1961
|
-
var
|
|
1961
|
+
var Oe = [
|
|
1962
1962
|
"variant",
|
|
1963
1963
|
"placeholder",
|
|
1964
1964
|
"name",
|
|
@@ -1971,8 +1971,8 @@ var ke = [
|
|
|
1971
1971
|
"fit",
|
|
1972
1972
|
"style",
|
|
1973
1973
|
"intent"
|
|
1974
|
-
],
|
|
1975
|
-
function
|
|
1974
|
+
], ke = ["value"];
|
|
1975
|
+
function Ae(e, t, n, r) {
|
|
1976
1976
|
let i = /* @__PURE__ */ new Map();
|
|
1977
1977
|
for (let t of e) i.set(t.id, t);
|
|
1978
1978
|
let a = /* @__PURE__ */ new Map();
|
|
@@ -1983,9 +1983,9 @@ function je(e, t, n, r) {
|
|
|
1983
1983
|
targetId: e
|
|
1984
1984
|
});
|
|
1985
1985
|
for (let [e, s] of a) if (!i.has(e)) {
|
|
1986
|
-
let i =
|
|
1986
|
+
let i = je(e, t);
|
|
1987
1987
|
if (i) {
|
|
1988
|
-
let t =
|
|
1988
|
+
let t = P([s], {
|
|
1989
1989
|
surfaceId: n,
|
|
1990
1990
|
rootId: e,
|
|
1991
1991
|
registry: r
|
|
@@ -2001,7 +2001,7 @@ function je(e, t, n, r) {
|
|
|
2001
2001
|
let a = i.get(e);
|
|
2002
2002
|
if (a) {
|
|
2003
2003
|
if (s.component !== a.component) {
|
|
2004
|
-
let i =
|
|
2004
|
+
let i = P(B(e, t), {
|
|
2005
2005
|
surfaceId: n,
|
|
2006
2006
|
rootId: e,
|
|
2007
2007
|
registry: r
|
|
@@ -2014,7 +2014,7 @@ function je(e, t, n, r) {
|
|
|
2014
2014
|
continue;
|
|
2015
2015
|
}
|
|
2016
2016
|
if (JSON.stringify(a.children ?? a.child ?? []) !== JSON.stringify(s.children ?? s.child ?? [])) {
|
|
2017
|
-
let i =
|
|
2017
|
+
let i = P(B(e, t), {
|
|
2018
2018
|
surfaceId: n,
|
|
2019
2019
|
rootId: e,
|
|
2020
2020
|
registry: r
|
|
@@ -2044,7 +2044,7 @@ function je(e, t, n, r) {
|
|
|
2044
2044
|
targetId: e,
|
|
2045
2045
|
name: "disabled"
|
|
2046
2046
|
}));
|
|
2047
|
-
for (let t of
|
|
2047
|
+
for (let t of Oe) {
|
|
2048
2048
|
let n = a[t], r = s[t];
|
|
2049
2049
|
r !== n && (r == null || r === !1 ? o.push({
|
|
2050
2050
|
type: "remove-attribute",
|
|
@@ -2057,7 +2057,7 @@ function je(e, t, n, r) {
|
|
|
2057
2057
|
value: String(r)
|
|
2058
2058
|
}));
|
|
2059
2059
|
}
|
|
2060
|
-
for (let t of
|
|
2060
|
+
for (let t of ke) {
|
|
2061
2061
|
let n = a[t], r = s[t];
|
|
2062
2062
|
r !== n && r !== void 0 && o.push({
|
|
2063
2063
|
type: "set-property",
|
|
@@ -2070,11 +2070,11 @@ function je(e, t, n, r) {
|
|
|
2070
2070
|
}
|
|
2071
2071
|
return o;
|
|
2072
2072
|
}
|
|
2073
|
-
function
|
|
2073
|
+
function je(e, t) {
|
|
2074
2074
|
for (let n of t) if (n.children?.includes(e) || n.child === e) return n.id;
|
|
2075
2075
|
return null;
|
|
2076
2076
|
}
|
|
2077
|
-
function
|
|
2077
|
+
function B(e, t) {
|
|
2078
2078
|
let n = /* @__PURE__ */ new Map();
|
|
2079
2079
|
for (let e of t) n.set(e.id, e);
|
|
2080
2080
|
let r = [], i = /* @__PURE__ */ new Set();
|
|
@@ -2089,11 +2089,11 @@ function R(e, t) {
|
|
|
2089
2089
|
}
|
|
2090
2090
|
return a(e), r;
|
|
2091
2091
|
}
|
|
2092
|
-
var
|
|
2092
|
+
var Me = class {
|
|
2093
2093
|
#e;
|
|
2094
2094
|
#t;
|
|
2095
2095
|
constructor(e, t) {
|
|
2096
|
-
this.#t = t ?? {}, this.#e = new
|
|
2096
|
+
this.#t = t ?? {}, this.#e = new Ee(e, (e) => {
|
|
2097
2097
|
this.#t.onClientMessage?.(e);
|
|
2098
2098
|
}, (e, t) => {
|
|
2099
2099
|
this.#t.onRender?.(e, t);
|
|
@@ -2105,7 +2105,7 @@ var Ne = class {
|
|
|
2105
2105
|
* If a container is provided, it is used as the render target for new surfaces.
|
|
2106
2106
|
*/
|
|
2107
2107
|
receive(e, t) {
|
|
2108
|
-
let n = typeof e == "string" ?
|
|
2108
|
+
let n = typeof e == "string" ? me(e) : e;
|
|
2109
2109
|
if (!n) {
|
|
2110
2110
|
this.#t.onClientMessage?.({ error: {
|
|
2111
2111
|
surfaceId: "",
|
|
@@ -2114,14 +2114,14 @@ var Ne = class {
|
|
|
2114
2114
|
} });
|
|
2115
2115
|
return;
|
|
2116
2116
|
}
|
|
2117
|
-
if (
|
|
2117
|
+
if (pe(n)) {
|
|
2118
2118
|
this.#n(n.requestCatalog.surfaceId);
|
|
2119
2119
|
return;
|
|
2120
2120
|
}
|
|
2121
2121
|
this.#e.handleMessage(n, t);
|
|
2122
2122
|
}
|
|
2123
2123
|
#n(e) {
|
|
2124
|
-
let t = this.#t.registry?.getSupportedTypes() ??
|
|
2124
|
+
let t = this.#t.registry?.getSupportedTypes() ?? N(), n = { catalog: {
|
|
2125
2125
|
...e ? { surfaceId: e } : {},
|
|
2126
2126
|
supportedTypes: [...t],
|
|
2127
2127
|
version: this.#t.version ?? "0.9"
|
|
@@ -2133,7 +2133,7 @@ var Ne = class {
|
|
|
2133
2133
|
* Returns null if invalid.
|
|
2134
2134
|
*/
|
|
2135
2135
|
parse(e) {
|
|
2136
|
-
return
|
|
2136
|
+
return me(e);
|
|
2137
2137
|
}
|
|
2138
2138
|
/**
|
|
2139
2139
|
* Convert a UIPlan to A2UI updateComponents format.
|
|
@@ -2168,16 +2168,16 @@ var Ne = class {
|
|
|
2168
2168
|
* Returns the list of A2UI component types supported by this adapter.
|
|
2169
2169
|
*/
|
|
2170
2170
|
getSupportedTypes() {
|
|
2171
|
-
return this.#t.registry?.getSupportedTypes() ??
|
|
2171
|
+
return this.#t.registry?.getSupportedTypes() ?? N();
|
|
2172
2172
|
}
|
|
2173
2173
|
destroy() {
|
|
2174
2174
|
this.#e.destroy();
|
|
2175
2175
|
}
|
|
2176
2176
|
};
|
|
2177
|
-
function
|
|
2178
|
-
return new
|
|
2177
|
+
function Ne(e, t) {
|
|
2178
|
+
return new Me(e, t);
|
|
2179
2179
|
}
|
|
2180
|
-
const
|
|
2180
|
+
const Pe = [
|
|
2181
2181
|
{
|
|
2182
2182
|
id: "general",
|
|
2183
2183
|
label: "General"
|
|
@@ -2195,7 +2195,7 @@ const Fe = [
|
|
|
2195
2195
|
label: "Travel",
|
|
2196
2196
|
hidden: !0
|
|
2197
2197
|
}
|
|
2198
|
-
],
|
|
2198
|
+
], V = {
|
|
2199
2199
|
hello: {
|
|
2200
2200
|
label: "Hello World",
|
|
2201
2201
|
group: "general",
|
|
@@ -9570,7 +9570,7 @@ const Fe = [
|
|
|
9570
9570
|
*
|
|
9571
9571
|
* Layout: chip-toggled multi-panel — preview left, N resizable panes right.
|
|
9572
9572
|
* Chips: JSON-IN, JSON-OUT, HTML, CSS, JS, COMPONENTS (multiple active at once).
|
|
9573
|
-
* Chrome & layout patterns mirror <
|
|
9573
|
+
* Chrome & layout patterns mirror <n-playground> for a unified devtool look.
|
|
9574
9574
|
*
|
|
9575
9575
|
* Renders A2UI components directly (no iframe) using a local Kernel + A2UIAdapter.
|
|
9576
9576
|
* Native-ui components must be registered on the page for rendering to work.
|
|
@@ -9579,7 +9579,7 @@ const Fe = [
|
|
|
9579
9579
|
* @fires native:a2ui-action - When an action fires inside the preview
|
|
9580
9580
|
* @fires native:a2ui-state - When surface state updates after processing envelopes
|
|
9581
9581
|
*/
|
|
9582
|
-
var
|
|
9582
|
+
var H = [
|
|
9583
9583
|
"json-in",
|
|
9584
9584
|
"json-out",
|
|
9585
9585
|
"html",
|
|
@@ -9587,7 +9587,7 @@ var B = [
|
|
|
9587
9587
|
"js",
|
|
9588
9588
|
"components",
|
|
9589
9589
|
"schema"
|
|
9590
|
-
],
|
|
9590
|
+
], U = {
|
|
9591
9591
|
"json-in": "IN",
|
|
9592
9592
|
"json-out": "OUT",
|
|
9593
9593
|
html: "HTML",
|
|
@@ -9595,7 +9595,7 @@ var B = [
|
|
|
9595
9595
|
js: "JS",
|
|
9596
9596
|
components: "UI",
|
|
9597
9597
|
schema: "SCHEMA"
|
|
9598
|
-
},
|
|
9598
|
+
}, Fe = {
|
|
9599
9599
|
"json-in": "brackets-curly",
|
|
9600
9600
|
"json-out": "chat-circle-dots",
|
|
9601
9601
|
html: "code",
|
|
@@ -9603,34 +9603,34 @@ var B = [
|
|
|
9603
9603
|
js: "terminal",
|
|
9604
9604
|
components: "squares-four",
|
|
9605
9605
|
schema: "file-code"
|
|
9606
|
-
},
|
|
9606
|
+
}, Ie = te.define(), Le = w.line({ class: "cm-a2ui-sent" }), Re = w.line({ class: "cm-a2ui-next" }), ze = ne.define({
|
|
9607
9607
|
create() {
|
|
9608
|
-
return
|
|
9608
|
+
return w.none;
|
|
9609
9609
|
},
|
|
9610
9610
|
update(e, t) {
|
|
9611
|
-
for (let e of t.effects) if (e.is(
|
|
9611
|
+
for (let e of t.effects) if (e.is(Ie)) {
|
|
9612
9612
|
let n = t.state.doc, { sentUpToLine: r, nextFromLine: i, nextToLine: a } = e.value, o = [];
|
|
9613
|
-
for (let e = 1; e <= Math.min(r, n.lines); e++) o.push(
|
|
9614
|
-
for (let e = Math.max(1, i); e <= Math.min(a, n.lines); e++) o.push(
|
|
9615
|
-
return
|
|
9613
|
+
for (let e = 1; e <= Math.min(r, n.lines); e++) o.push(Le.range(n.line(e).from));
|
|
9614
|
+
for (let e = Math.max(1, i); e <= Math.min(a, n.lines); e++) o.push(Re.range(n.line(e).from));
|
|
9615
|
+
return w.set(o, !0);
|
|
9616
9616
|
}
|
|
9617
9617
|
return e;
|
|
9618
9618
|
},
|
|
9619
|
-
provide: (e) =>
|
|
9620
|
-
}),
|
|
9619
|
+
provide: (e) => T.decorations.from(e)
|
|
9620
|
+
}), Be = class extends m {
|
|
9621
9621
|
static observedAttributes = ["stream"];
|
|
9622
|
-
#e =
|
|
9623
|
-
#t =
|
|
9624
|
-
#n =
|
|
9625
|
-
#r =
|
|
9626
|
-
#i =
|
|
9627
|
-
#a =
|
|
9628
|
-
#o =
|
|
9629
|
-
#s =
|
|
9630
|
-
#c =
|
|
9631
|
-
#l =
|
|
9632
|
-
#u =
|
|
9633
|
-
#d =
|
|
9622
|
+
#e = S("");
|
|
9623
|
+
#t = S(0);
|
|
9624
|
+
#n = S(new Set(["json-in"]));
|
|
9625
|
+
#r = S([]);
|
|
9626
|
+
#i = S([]);
|
|
9627
|
+
#a = S([]);
|
|
9628
|
+
#o = S(null);
|
|
9629
|
+
#s = S("");
|
|
9630
|
+
#c = S(null);
|
|
9631
|
+
#l = S(/* @__PURE__ */ new Set());
|
|
9632
|
+
#u = S("demo");
|
|
9633
|
+
#d = S(!1);
|
|
9634
9634
|
#f = 0;
|
|
9635
9635
|
#p = null;
|
|
9636
9636
|
#m = null;
|
|
@@ -9645,7 +9645,7 @@ var B = [
|
|
|
9645
9645
|
#C = /* @__PURE__ */ new Map();
|
|
9646
9646
|
#w = /* @__PURE__ */ new Map();
|
|
9647
9647
|
#T = /* @__PURE__ */ new Map();
|
|
9648
|
-
#E =
|
|
9648
|
+
#E = A.clone();
|
|
9649
9649
|
#D = null;
|
|
9650
9650
|
#O = null;
|
|
9651
9651
|
#k = null;
|
|
@@ -9676,7 +9676,7 @@ var B = [
|
|
|
9676
9676
|
this.#ae();
|
|
9677
9677
|
}
|
|
9678
9678
|
setup() {
|
|
9679
|
-
super.setup(), this.#Z(), this.#F(), this.#j = new
|
|
9679
|
+
super.setup(), this.#Z(), this.#F(), this.#j = new h(this, { closeButton: !1 }), this.addEventListener("native:present", this.#ve), this.addEventListener("native:dismiss", this.#ye), this.#x && (this.#A = new g(this.#x, {
|
|
9680
9680
|
handleSelector: ".a2ui-resize-handle",
|
|
9681
9681
|
axis: "horizontal",
|
|
9682
9682
|
min: 200
|
|
@@ -9695,7 +9695,7 @@ var B = [
|
|
|
9695
9695
|
if (e) {
|
|
9696
9696
|
if (!e.extensions?.length) {
|
|
9697
9697
|
requestAnimationFrame(() => {
|
|
9698
|
-
e.extensions = [
|
|
9698
|
+
e.extensions = [E()], e.value = JSON.stringify(this.#E.toJSON(), null, 2);
|
|
9699
9699
|
});
|
|
9700
9700
|
return;
|
|
9701
9701
|
}
|
|
@@ -9714,7 +9714,7 @@ var B = [
|
|
|
9714
9714
|
this.#m.value = r ? r + "\n\n" + n : n;
|
|
9715
9715
|
}), this.addEffect(() => {
|
|
9716
9716
|
let e = this.#s.value;
|
|
9717
|
-
this.#h && (this.#h.value = e ?
|
|
9717
|
+
this.#h && (this.#h.value = e ? Ve(e) : "");
|
|
9718
9718
|
}), this.addEffect(() => {
|
|
9719
9719
|
let e = this.#c.value;
|
|
9720
9720
|
this.#g && (typeof e == "object" && e && Object.keys(e).length > 0 ? this.#g.value = JSON.stringify(e, null, 2) : this.#g.value = "");
|
|
@@ -9727,7 +9727,7 @@ var B = [
|
|
|
9727
9727
|
i = n[t].startLine, a = n[t].endLine;
|
|
9728
9728
|
break;
|
|
9729
9729
|
}
|
|
9730
|
-
t.dispatch({ effects:
|
|
9730
|
+
t.dispatch({ effects: Ie.of({
|
|
9731
9731
|
sentUpToLine: r,
|
|
9732
9732
|
nextFromLine: i,
|
|
9733
9733
|
nextToLine: a
|
|
@@ -9740,7 +9740,7 @@ var B = [
|
|
|
9740
9740
|
this.#A?.destroy(), this.#A = null, this.removeEventListener("native:present", this.#ve), this.removeEventListener("native:dismiss", this.#ye), this.#j?.destroy(), this.#j = null, this.#M = null, this.#N = null, this.#x?.removeEventListener("native:resize-end", this.#De), this.#S?.removeEventListener("pointerdown", this.#q), this.#S?.removeEventListener("dblclick", this.#X), document.removeEventListener("pointermove", this.#J), document.removeEventListener("pointerup", this.#Y), this.#P = null, this.#x = null, this.#S = null, this.#C.clear(), this.#w.clear(), this.#T.clear(), this.#I(), this.#p = null, this.#m = null, this.#h = null, this.#g = null, this.#_ = null, this.#v = null, this.#y = null, this.#b = null, super.teardown();
|
|
9741
9741
|
}
|
|
9742
9742
|
#F() {
|
|
9743
|
-
|
|
9743
|
+
oe(), this.#D = new ae({ allowUnregistered: !0 }), this.#O = Ne(this.#D, {
|
|
9744
9744
|
registry: this.#E,
|
|
9745
9745
|
onClientMessage: (e) => {
|
|
9746
9746
|
this.#se("received", e);
|
|
@@ -9792,7 +9792,7 @@ var B = [
|
|
|
9792
9792
|
} catch {}
|
|
9793
9793
|
}
|
|
9794
9794
|
#B() {
|
|
9795
|
-
this.#E =
|
|
9795
|
+
this.#E = A.clone(), this.#L(), this.#y && (this.#y.value = JSON.stringify(this.#E.toJSON(), null, 2)), this.#v && this.#fe(this.#v, this.#l.value);
|
|
9796
9796
|
}
|
|
9797
9797
|
#V() {
|
|
9798
9798
|
if (!this.#O) return;
|
|
@@ -9857,7 +9857,7 @@ var B = [
|
|
|
9857
9857
|
/** Get visible pane IDs in DOM order. */
|
|
9858
9858
|
#K() {
|
|
9859
9859
|
let e = this.#n.value;
|
|
9860
|
-
return
|
|
9860
|
+
return H.filter((t) => e.has(t));
|
|
9861
9861
|
}
|
|
9862
9862
|
#q = (e) => {
|
|
9863
9863
|
if (e.button !== 0) return;
|
|
@@ -9953,54 +9953,52 @@ var B = [
|
|
|
9953
9953
|
let e = document.createElement("n-header"), t = document.createElement("n-toolbar");
|
|
9954
9954
|
t.setAttribute("size", "sm"), t.setAttribute("variant", "ghost");
|
|
9955
9955
|
let n = document.createElement("n-select");
|
|
9956
|
-
n.setAttribute("size", "sm"), n.setAttribute("inline", "");
|
|
9957
|
-
let r = document.createElement("n-
|
|
9958
|
-
r.setAttribute("
|
|
9959
|
-
let
|
|
9960
|
-
i.setAttribute("popover", "");
|
|
9961
|
-
for (let e of Fe) {
|
|
9956
|
+
n.setAttribute("size", "sm"), n.setAttribute("inline", ""), n.setAttribute("placeholder", "Presets");
|
|
9957
|
+
let r = document.createElement("n-listbox");
|
|
9958
|
+
r.setAttribute("popover", "");
|
|
9959
|
+
for (let e of Pe) {
|
|
9962
9960
|
if ("hidden" in e && e.hidden) continue;
|
|
9963
|
-
let t = Object.entries(
|
|
9961
|
+
let t = Object.entries(V).filter(([t, n]) => n.group === e.id);
|
|
9964
9962
|
if (t.length === 0) continue;
|
|
9965
|
-
let n = document.createElement("n-option-group"),
|
|
9966
|
-
|
|
9963
|
+
let n = document.createElement("n-option-group"), i = document.createElement("n-option-group-header");
|
|
9964
|
+
i.textContent = e.label, n.appendChild(i);
|
|
9967
9965
|
for (let [e, r] of t) {
|
|
9968
9966
|
let t = document.createElement("n-option");
|
|
9969
9967
|
t.setAttribute("value", e), t.setAttribute("label", r.label), t.textContent = r.label, n.appendChild(t);
|
|
9970
9968
|
}
|
|
9971
|
-
|
|
9969
|
+
r.appendChild(n);
|
|
9972
9970
|
}
|
|
9973
|
-
n.appendChild(
|
|
9974
|
-
for (let e of
|
|
9971
|
+
n.appendChild(r), n.addEventListener("native:change", this.#be), t.appendChild(n);
|
|
9972
|
+
for (let e of H) {
|
|
9975
9973
|
let n = document.createElement("n-button");
|
|
9976
|
-
n.setAttribute("variant", "ghost"), n.setAttribute("size", "sm"), n.textContent =
|
|
9974
|
+
n.setAttribute("variant", "ghost"), n.setAttribute("size", "sm"), n.textContent = U[e], this.#n.value.has(e) && n.toggleAttribute("data-active", !0), n.addEventListener("native:press", this.#je(e)), t.appendChild(n), this.#T.set(e, n);
|
|
9977
9975
|
}
|
|
9976
|
+
let i = document.createElement("n-button");
|
|
9977
|
+
i.setAttribute("variant", "ghost"), i.setAttribute("size", "sm"), i.title = "Auto-play presets on load", i.innerHTML = "<n-icon name=\"lightning\"></n-icon>", i.addEventListener("native:press", this.#ke), t.appendChild(i), this.#N = i;
|
|
9978
9978
|
let a = document.createElement("n-button");
|
|
9979
|
-
a.setAttribute("variant", "ghost"), a.setAttribute("size", "sm"), a.title = "
|
|
9980
|
-
let o = document.createElement("
|
|
9981
|
-
o.
|
|
9979
|
+
a.setAttribute("variant", "ghost"), a.setAttribute("size", "sm"), a.title = "Expand", a.innerHTML = "<n-icon name=\"arrows-out-simple\"></n-icon>", a.addEventListener("native:press", this.#_e), t.appendChild(a), this.#M = a;
|
|
9980
|
+
let o = document.createElement("div");
|
|
9981
|
+
o.className = "a2ui-split", this.#S = o;
|
|
9982
9982
|
let s = document.createElement("div");
|
|
9983
|
-
s.className = "a2ui-
|
|
9983
|
+
s.className = "a2ui-preview", this.#x = s;
|
|
9984
9984
|
let c = document.createElement("div");
|
|
9985
|
-
c.className = "a2ui-preview", this.#
|
|
9985
|
+
c.className = "a2ui-preview-content", s.appendChild(c), this.#b = c;
|
|
9986
9986
|
let l = document.createElement("div");
|
|
9987
|
-
l.className = "a2ui-
|
|
9988
|
-
let
|
|
9989
|
-
u.className = "a2ui-resize-handle", c.appendChild(u), s.appendChild(c);
|
|
9990
|
-
for (let e of B) {
|
|
9987
|
+
l.className = "a2ui-resize-handle", s.appendChild(l), o.appendChild(s);
|
|
9988
|
+
for (let e of H) {
|
|
9991
9989
|
let t = document.createElement("n-pane");
|
|
9992
9990
|
t.dataset.panel = e, this.#n.value.has(e) || (t.hidden = !0);
|
|
9993
9991
|
let n = document.createElement("n-header"), r = document.createElement("nav"), i = document.createElement("n-icon");
|
|
9994
|
-
i.setAttribute("name",
|
|
9992
|
+
i.setAttribute("name", Fe[e]), r.appendChild(i), n.appendChild(r);
|
|
9995
9993
|
let a = document.createElement("span");
|
|
9996
|
-
a.textContent =
|
|
9997
|
-
let
|
|
9994
|
+
a.textContent = U[e], n.appendChild(a);
|
|
9995
|
+
let s = document.createElement("aside");
|
|
9998
9996
|
if (e === "js" || e === "html" || e === "css") {
|
|
9999
9997
|
let t = document.createElement("n-button");
|
|
10000
|
-
t.setAttribute("variant", "ghost"), t.setAttribute("size", "sm"), t.title = "Reset to computed", t.innerHTML = "<n-icon name=\"arrow-counter-clockwise\"></n-icon>", t.addEventListener("native:press", this.#Ae(e)),
|
|
9998
|
+
t.setAttribute("variant", "ghost"), t.setAttribute("size", "sm"), t.title = "Reset to computed", t.innerHTML = "<n-icon name=\"arrow-counter-clockwise\"></n-icon>", t.addEventListener("native:press", this.#Ae(e)), s.appendChild(t);
|
|
10001
9999
|
}
|
|
10002
10000
|
let c = document.createElement("n-button");
|
|
10003
|
-
if (c.setAttribute("variant", "ghost"), c.setAttribute("size", "sm"), c.title = "Close pane", c.innerHTML = "<n-icon name=\"x\"></n-icon>", c.addEventListener("native:press", this.#je(e)),
|
|
10001
|
+
if (c.setAttribute("variant", "ghost"), c.setAttribute("size", "sm"), c.title = "Close pane", c.innerHTML = "<n-icon name=\"x\"></n-icon>", c.addEventListener("native:press", this.#je(e)), s.appendChild(c), n.appendChild(s), t.appendChild(n), e === "json-in") {
|
|
10004
10002
|
let e = document.createElement("n-toolbar");
|
|
10005
10003
|
e.setAttribute("variant", "plain"), e.setAttribute("size", "sm"), e.setAttribute("fill", "");
|
|
10006
10004
|
let n = this.#Q("Step back", "caret-left");
|
|
@@ -10036,17 +10034,17 @@ var B = [
|
|
|
10036
10034
|
}
|
|
10037
10035
|
let l = document.createElement("n-body");
|
|
10038
10036
|
if (t.appendChild(l), this.#w.set(e, l), e === "json-in" || e === "js" || e === "html" || e === "css") {
|
|
10039
|
-
let t = document.createElement("
|
|
10037
|
+
let t = document.createElement("n-editor");
|
|
10040
10038
|
t.setAttribute("line-numbers", "false"), l.appendChild(t), e === "json-in" ? this.#p = t : e === "js" ? this.#m = t : e === "html" ? this.#h = t : e === "css" && (this.#g = t);
|
|
10041
10039
|
} else if (e === "components") this.#v = l;
|
|
10042
10040
|
else if (e === "schema") {
|
|
10043
|
-
let e = document.createElement("
|
|
10041
|
+
let e = document.createElement("n-editor");
|
|
10044
10042
|
e.setAttribute("line-numbers", "false"), l.appendChild(e), this.#y = e;
|
|
10045
10043
|
}
|
|
10046
10044
|
let u = document.createElement("div");
|
|
10047
|
-
u.className = "a2ui-resize-handle", t.appendChild(u),
|
|
10045
|
+
u.className = "a2ui-resize-handle", t.appendChild(u), o.appendChild(t), this.#C.set(e, t);
|
|
10048
10046
|
}
|
|
10049
|
-
e.appendChild(t), this.append(e,
|
|
10047
|
+
e.appendChild(t), this.append(e, o);
|
|
10050
10048
|
}
|
|
10051
10049
|
#Q(e, t, n = !1) {
|
|
10052
10050
|
let r = document.createElement("n-button");
|
|
@@ -10062,20 +10060,20 @@ var B = [
|
|
|
10062
10060
|
#ee() {
|
|
10063
10061
|
if (!this.#p) return;
|
|
10064
10062
|
this.#p.value = this.#e.value, this.#p.extensions = [
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10063
|
+
E(),
|
|
10064
|
+
ze,
|
|
10065
|
+
ie(ce)
|
|
10068
10066
|
], this.#p.addEventListener("native:input", (e) => {
|
|
10069
10067
|
this.#e.value = e.detail.value;
|
|
10070
10068
|
});
|
|
10071
|
-
let e =
|
|
10069
|
+
let e = re.of([{
|
|
10072
10070
|
key: "Mod-s",
|
|
10073
10071
|
run: () => (this.#U(), !0)
|
|
10074
|
-
}]), t =
|
|
10072
|
+
}]), t = re.of([{
|
|
10075
10073
|
key: "Mod-s",
|
|
10076
10074
|
run: () => (this.#W(), !0)
|
|
10077
10075
|
}]);
|
|
10078
|
-
this.#m && (this.#m.extensions = [
|
|
10076
|
+
this.#m && (this.#m.extensions = [E()]), this.#h && (this.#h.extensions = [e]), this.#g && (this.#g.extensions = [E(), t]);
|
|
10079
10077
|
}
|
|
10080
10078
|
/** Parse JSON envelopes from the editor stream (supports multi-line formatted JSON). */
|
|
10081
10079
|
#te() {
|
|
@@ -10316,9 +10314,9 @@ var B = [
|
|
|
10316
10314
|
r.className = "a2ui-map-editor-toolbar";
|
|
10317
10315
|
let i = document.createElement("n-button");
|
|
10318
10316
|
i.setAttribute("variant", "ghost"), i.setAttribute("size", "sm"), i.title = "Apply changes to stream", i.innerHTML = "<n-icon name=\"play\" weight=\"fill\"></n-icon>", i.addEventListener("native:press", () => this.#he(t)), r.appendChild(i), n.appendChild(r);
|
|
10319
|
-
let a = document.createElement("
|
|
10317
|
+
let a = document.createElement("n-editor");
|
|
10320
10318
|
a.setAttribute("line-numbers", "false"), n.appendChild(a), this.#_ = a, requestAnimationFrame(() => {
|
|
10321
|
-
a.extensions = [
|
|
10319
|
+
a.extensions = [E()], a.value = JSON.stringify(s, null, 2);
|
|
10322
10320
|
}), e.appendChild(n);
|
|
10323
10321
|
return;
|
|
10324
10322
|
}
|
|
@@ -10393,8 +10391,8 @@ var B = [
|
|
|
10393
10391
|
t && this.#xe(t);
|
|
10394
10392
|
};
|
|
10395
10393
|
#xe(e) {
|
|
10396
|
-
if (!
|
|
10397
|
-
let t =
|
|
10394
|
+
if (!V[e]) return;
|
|
10395
|
+
let t = V[e].envelopes.map((e) => JSON.stringify(e, null, 2)).join("\n\n");
|
|
10398
10396
|
this.#ae(), this.stream = t, this.#ne();
|
|
10399
10397
|
}
|
|
10400
10398
|
#Se = () => {
|
|
@@ -10448,7 +10446,7 @@ var B = [
|
|
|
10448
10446
|
let a = this.#p?.editorView;
|
|
10449
10447
|
if (a) {
|
|
10450
10448
|
let e = a.state.doc.lines;
|
|
10451
|
-
a.dispatch({ selection: { anchor: a.state.doc.line(e).from } }), a.dispatch({ effects:
|
|
10449
|
+
a.dispatch({ selection: { anchor: a.state.doc.line(e).from } }), a.dispatch({ effects: T.scrollIntoView(a.state.doc.line(e).from) });
|
|
10452
10450
|
}
|
|
10453
10451
|
};
|
|
10454
10452
|
#De = () => {
|
|
@@ -10480,7 +10478,7 @@ var B = [
|
|
|
10480
10478
|
} else if (e === "html") {
|
|
10481
10479
|
if (!this.#h) return;
|
|
10482
10480
|
let e = this.#s.value;
|
|
10483
|
-
this.#h.value = e ?
|
|
10481
|
+
this.#h.value = e ? Ve(e) : "";
|
|
10484
10482
|
} else if (e === "css") {
|
|
10485
10483
|
if (!this.#g) return;
|
|
10486
10484
|
let e = this.#c.value;
|
|
@@ -10492,7 +10490,7 @@ var B = [
|
|
|
10492
10490
|
t.has(e) ? t.delete(e) : t.add(e), this.#n.value = t;
|
|
10493
10491
|
};
|
|
10494
10492
|
};
|
|
10495
|
-
function
|
|
10493
|
+
function Ve(e) {
|
|
10496
10494
|
let t = "", n = 0, r = 0;
|
|
10497
10495
|
for (; r < e.length;) if (e[r] === "<") {
|
|
10498
10496
|
let i = e.indexOf(">", r);
|
|
@@ -10507,7 +10505,7 @@ function H(e) {
|
|
|
10507
10505
|
}
|
|
10508
10506
|
return t.trimEnd();
|
|
10509
10507
|
}
|
|
10510
|
-
|
|
10508
|
+
b("native-a2ui", Be), b("n-button", e), b("n-icon", r), b("n-toolbar", p), b("n-select", d), b("n-listbox", i), b("n-option", a), b("n-option-group", o), b("n-option-group-header", s), b("n-segmented-control", u), b("n-segment", l), b("n-pane", c), x("caret-left", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z\"/></svg>"), x("caret-right", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z\"/></svg>"), x("arrow-counter-clockwise", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z\"/></svg>"), x("play-fill", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z\"/></svg>"), x("arrows-out-simple", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z\"/></svg>"), x("arrows-in-simple", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z\"/></svg>"), x("x", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z\"/></svg>"), x("caret-up-down", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M181.66,170.34a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32,0l-48-48a8,8,0,0,1,11.32-11.32L128,212.69l42.34-42.35A8,8,0,0,1,181.66,170.34Zm-96-84.68L128,43.31l42.34,42.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,85.66Z\"/></svg>"), x("lightning", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M215.79,118.17a8,8,0,0,0-5-5.66L153.18,90.9l14.66-73.33a8,8,0,0,0-13.69-7l-112,120a8,8,0,0,0,3,13l57.63,21.61L88.16,238.43a8,8,0,0,0,13.69,7l112-120A8,8,0,0,0,215.79,118.17ZM109.37,214l10.47-52.38a8,8,0,0,0-5-9.06L62,132.71l84.62-90.66L136.16,94.38a8,8,0,0,0,5,9.06l52.8,19.8Z\"/></svg>"), x("plus", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z\"/></svg>"), x("arrows-left-right", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M213.66,181.66l-32,32a8,8,0,0,1-11.32-11.32L188.69,184H48a8,8,0,0,1,0-16H188.69l-18.35-18.34a8,8,0,0,1,11.32-11.32l32,32A8,8,0,0,1,213.66,181.66Zm-139.32-64a8,8,0,0,0,11.32-11.32L67.31,88H208a8,8,0,0,0,0-16H67.31L85.66,53.66A8,8,0,0,0,74.34,42.34l-32,32a8,8,0,0,0,0,11.32Z\"/></svg>"), x("plus-circle", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z\"/></svg>"), x("minus-circle", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M176,128a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,128Zm56,0A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z\"/></svg>"), x("database", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z\"/></svg>"), x("play", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z\"/></svg>"), x("brackets-curly", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M43.18,128a29.78,29.78,0,0,1,8,10.26c4.8,9.9,4.8,22,4.8,33.74,0,24.31,1,36,24,36a8,8,0,0,1,0,16c-17.48,0-29.32-6.14-35.2-18.26-4.8-9.9-4.8-22-4.8-33.74,0-24.31-1-36-24-36a8,8,0,0,1,0-16c23,0,24-11.69,24-36,0-11.72,0-23.84,4.8-33.74C50.68,38.14,62.52,32,80,32a8,8,0,0,1,0,16C57,48,56,59.69,56,84c0,11.72,0,23.84-4.8,33.74A29.78,29.78,0,0,1,43.18,128ZM240,120c-23,0-24-11.69-24-36,0-11.72,0-23.84-4.8-33.74C205.32,38.14,193.48,32,176,32a8,8,0,0,0,0,16c23,0,24,11.69,24,36,0,11.72,0,23.84,4.8,33.74a29.78,29.78,0,0,0,8,10.26,29.78,29.78,0,0,0-8,10.26c-4.8,9.9-4.8,22-4.8,33.74,0,24.31-1,36-24,36a8,8,0,0,0,0,16c17.48,0,29.32-6.14,35.2-18.26,4.8-9.9,4.8-22,4.8-33.74,0-24.31,1-36,24-36a8,8,0,0,0,0-16Z\"/></svg>"), x("chat-circle-dots", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM84,116a12,12,0,1,0,12,12A12,12,0,0,0,84,116Zm88,0a12,12,0,1,0,12,12A12,12,0,0,0,172,116Zm60,12A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z\"/></svg>"), x("code", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z\"/></svg>"), x("palette", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z\"/></svg>"), x("terminal", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M117.31,134l-72,64a8,8,0,1,1-10.63-12L100,128,34.69,70A8,8,0,1,1,45.32,58l72,64a8,8,0,0,1,0,12ZM216,184H120a8,8,0,0,0,0,16h96a8,8,0,0,0,0-16Z\"/></svg>"), x("squares-four", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z\"/></svg>");
|
|
10511
10509
|
/**
|
|
10512
10510
|
* Chat message input with textarea, submit button, and Enter-to-send behavior.
|
|
10513
10511
|
* @attr {boolean} disabled - Disables interaction
|
|
@@ -10520,15 +10518,15 @@ y("native-a2ui", V), y("n-button", e), y("n-icon", r), y("n-toolbar", f), y("n-s
|
|
|
10520
10518
|
* @fires native:composer-focus - Fired when the composer textarea gains focus
|
|
10521
10519
|
* @fires native:composer-blur - Fired when the composer textarea loses focus
|
|
10522
10520
|
*/
|
|
10523
|
-
var
|
|
10521
|
+
var W = class extends m {
|
|
10524
10522
|
static observedAttributes = [
|
|
10525
10523
|
"disabled",
|
|
10526
10524
|
"busy",
|
|
10527
10525
|
"value"
|
|
10528
10526
|
];
|
|
10529
10527
|
#e;
|
|
10530
|
-
#t =
|
|
10531
|
-
#n =
|
|
10528
|
+
#t = S(!1);
|
|
10529
|
+
#n = S(!1);
|
|
10532
10530
|
#r = null;
|
|
10533
10531
|
#i = null;
|
|
10534
10532
|
constructor() {
|
|
@@ -10577,7 +10575,7 @@ var U = class extends p {
|
|
|
10577
10575
|
}
|
|
10578
10576
|
}
|
|
10579
10577
|
setup() {
|
|
10580
|
-
super.setup(), this.addEffect(
|
|
10578
|
+
super.setup(), this.addEffect(y(this, this.#t, this.#e)), this.deferChildren(() => {
|
|
10581
10579
|
this.#a();
|
|
10582
10580
|
let e = this.getAttribute("value");
|
|
10583
10581
|
e && this.#r && (this.#r.value = e), this.addEffect(() => {
|
|
@@ -10650,7 +10648,7 @@ var U = class extends p {
|
|
|
10650
10648
|
})) && !this.hasAttribute("no-auto-clear") && (this.value = "", this.#i?.setAttribute("disabled", ""));
|
|
10651
10649
|
}
|
|
10652
10650
|
}
|
|
10653
|
-
}, He = class extends
|
|
10651
|
+
}, He = class extends W {}, G = class extends Error {
|
|
10654
10652
|
kind;
|
|
10655
10653
|
status;
|
|
10656
10654
|
body;
|
|
@@ -10660,7 +10658,7 @@ var U = class extends p {
|
|
|
10660
10658
|
super(e.message), this.name = "GatewayRequestError", this.kind = e.kind, this.status = e.status ?? 0, this.body = e.body ?? "", this.requestId = e.requestId, this.contentType = e.contentType;
|
|
10661
10659
|
}
|
|
10662
10660
|
};
|
|
10663
|
-
async function
|
|
10661
|
+
async function Ue(e) {
|
|
10664
10662
|
return K(e, e.retryPolicy ?? {
|
|
10665
10663
|
delaysMs: [
|
|
10666
10664
|
1e3,
|
|
@@ -10670,7 +10668,7 @@ async function G(e) {
|
|
|
10670
10668
|
jitterRatio: 0
|
|
10671
10669
|
}, 0);
|
|
10672
10670
|
}
|
|
10673
|
-
function
|
|
10671
|
+
function We(e, t) {
|
|
10674
10672
|
let n = { ...e };
|
|
10675
10673
|
if (!t) return n;
|
|
10676
10674
|
if (t instanceof Headers) return t.forEach((e, t) => {
|
|
@@ -10696,7 +10694,7 @@ async function K(e, t, n) {
|
|
|
10696
10694
|
maxAttempts: t.delaysMs.length + 1
|
|
10697
10695
|
});
|
|
10698
10696
|
try {
|
|
10699
|
-
let s =
|
|
10697
|
+
let s = We(e.defaultHeaders ?? {}, i.headers), c = e.auth;
|
|
10700
10698
|
if (c?.token) {
|
|
10701
10699
|
let e = c.headerName ?? "Authorization";
|
|
10702
10700
|
s[e] = c.scheme === "raw" ? c.token : `Bearer ${c.token}`;
|
|
@@ -10709,7 +10707,7 @@ async function K(e, t, n) {
|
|
|
10709
10707
|
signal: d
|
|
10710
10708
|
}), p = Math.round(performance.now() - o);
|
|
10711
10709
|
if (!f.ok) {
|
|
10712
|
-
let o = await f.text(), s =
|
|
10710
|
+
let o = await f.text(), s = Ge(f.status), c = f.headers.get("content-type") ?? void 0;
|
|
10713
10711
|
if (!e.noRetry && (s === "rate-limit" || s === "server") && n < t.delaysMs.length) return a?.({
|
|
10714
10712
|
type: "request:retry",
|
|
10715
10713
|
requestId: i.requestId,
|
|
@@ -10720,7 +10718,7 @@ async function K(e, t, n) {
|
|
|
10720
10718
|
durationMs: p,
|
|
10721
10719
|
status: f.status,
|
|
10722
10720
|
errorKind: s
|
|
10723
|
-
}), await
|
|
10721
|
+
}), await qe(Ke(t.delaysMs[n], t.jitterRatio ?? 0)), K(e, t, n + 1);
|
|
10724
10722
|
throw a?.({
|
|
10725
10723
|
type: "request:error",
|
|
10726
10724
|
requestId: i.requestId,
|
|
@@ -10731,8 +10729,8 @@ async function K(e, t, n) {
|
|
|
10731
10729
|
durationMs: p,
|
|
10732
10730
|
status: f.status,
|
|
10733
10731
|
errorKind: s
|
|
10734
|
-
}), new
|
|
10735
|
-
message:
|
|
10732
|
+
}), new G({
|
|
10733
|
+
message: Xe(f.status, o, c),
|
|
10736
10734
|
kind: s,
|
|
10737
10735
|
requestId: i.requestId,
|
|
10738
10736
|
status: f.status,
|
|
@@ -10751,7 +10749,7 @@ async function K(e, t, n) {
|
|
|
10751
10749
|
status: f.status
|
|
10752
10750
|
}), f;
|
|
10753
10751
|
} catch (s) {
|
|
10754
|
-
if (s instanceof DOMException && s.name === "AbortError" || s instanceof
|
|
10752
|
+
if (s instanceof DOMException && s.name === "AbortError" || s instanceof G) throw s;
|
|
10755
10753
|
let c = Math.round(performance.now() - o);
|
|
10756
10754
|
if (!e.noRetry && n < t.delaysMs.length) return a?.({
|
|
10757
10755
|
type: "request:retry",
|
|
@@ -10762,7 +10760,7 @@ async function K(e, t, n) {
|
|
|
10762
10760
|
maxAttempts: t.delaysMs.length + 1,
|
|
10763
10761
|
durationMs: c,
|
|
10764
10762
|
errorKind: "network"
|
|
10765
|
-
}), await
|
|
10763
|
+
}), await qe(Ke(t.delaysMs[n], t.jitterRatio ?? 0)), K(e, t, n + 1);
|
|
10766
10764
|
throw a?.({
|
|
10767
10765
|
type: "request:error",
|
|
10768
10766
|
requestId: i.requestId,
|
|
@@ -10772,19 +10770,19 @@ async function K(e, t, n) {
|
|
|
10772
10770
|
maxAttempts: t.delaysMs.length + 1,
|
|
10773
10771
|
durationMs: c,
|
|
10774
10772
|
errorKind: "network"
|
|
10775
|
-
}), new
|
|
10773
|
+
}), new G({
|
|
10776
10774
|
message: s instanceof Error ? s.message : "Network error",
|
|
10777
10775
|
kind: "network",
|
|
10778
10776
|
requestId: i.requestId
|
|
10779
10777
|
});
|
|
10780
10778
|
}
|
|
10781
10779
|
}
|
|
10782
|
-
function
|
|
10780
|
+
function Ge(e) {
|
|
10783
10781
|
return e === 401 || e === 403 ? "auth" : e === 429 ? "rate-limit" : e >= 500 ? "server" : e >= 400 ? "client" : "unknown";
|
|
10784
10782
|
}
|
|
10785
10783
|
async function q(e, t) {
|
|
10786
10784
|
let n = e.headers.get("content-type") ?? "", r = await e.text();
|
|
10787
|
-
if (!r.trim()) throw new
|
|
10785
|
+
if (!r.trim()) throw new G({
|
|
10788
10786
|
message: "Empty response body",
|
|
10789
10787
|
kind: "unknown",
|
|
10790
10788
|
requestId: t,
|
|
@@ -10794,7 +10792,7 @@ async function q(e, t) {
|
|
|
10794
10792
|
try {
|
|
10795
10793
|
return JSON.parse(r);
|
|
10796
10794
|
} catch {
|
|
10797
|
-
throw new
|
|
10795
|
+
throw new G({
|
|
10798
10796
|
message: `Invalid JSON response (status ${e.status}, content-type "${n || "unknown"}")`,
|
|
10799
10797
|
kind: "unknown",
|
|
10800
10798
|
requestId: t,
|
|
@@ -10807,15 +10805,15 @@ async function q(e, t) {
|
|
|
10807
10805
|
function J() {
|
|
10808
10806
|
return crypto.randomUUID();
|
|
10809
10807
|
}
|
|
10810
|
-
function
|
|
10808
|
+
function Ke(e, t) {
|
|
10811
10809
|
if (t <= 0) return e;
|
|
10812
10810
|
let n = 1 + Math.random() * t;
|
|
10813
10811
|
return Math.round(e * n);
|
|
10814
10812
|
}
|
|
10815
|
-
function
|
|
10813
|
+
function qe(e) {
|
|
10816
10814
|
return new Promise((t) => setTimeout(t, e));
|
|
10817
10815
|
}
|
|
10818
|
-
function
|
|
10816
|
+
function Je(e) {
|
|
10819
10817
|
let t = e.split("\n"), n = "message", r = [];
|
|
10820
10818
|
for (let e of t) e.startsWith(":") || (e.startsWith("event:") ? n = e.slice(6).trim() : e.startsWith("data:") && r.push(e.slice(5).replace(/^ /, "")));
|
|
10821
10819
|
return r.length ? {
|
|
@@ -10823,12 +10821,12 @@ function Ke(e) {
|
|
|
10823
10821
|
data: r.join("\n")
|
|
10824
10822
|
} : null;
|
|
10825
10823
|
}
|
|
10826
|
-
const
|
|
10824
|
+
const Ye = [
|
|
10827
10825
|
1e3,
|
|
10828
10826
|
2e3,
|
|
10829
10827
|
4e3
|
|
10830
10828
|
];
|
|
10831
|
-
function
|
|
10829
|
+
function Xe(e, t, n) {
|
|
10832
10830
|
let r = `Request failed with ${e}`;
|
|
10833
10831
|
if (!t.trim()) return r;
|
|
10834
10832
|
if ((n ?? "").toLowerCase().includes("application/json") || t.trim().startsWith("{")) try {
|
|
@@ -10839,7 +10837,7 @@ function Je(e, t, n) {
|
|
|
10839
10837
|
}
|
|
10840
10838
|
return (n ?? "").toLowerCase().includes("text/html") ? `${r} (received HTML instead of API JSON)` : r;
|
|
10841
10839
|
}
|
|
10842
|
-
var
|
|
10840
|
+
var Ze = class {
|
|
10843
10841
|
clientId;
|
|
10844
10842
|
baseUrl;
|
|
10845
10843
|
model;
|
|
@@ -10942,7 +10940,7 @@ var Ye = class {
|
|
|
10942
10940
|
return {
|
|
10943
10941
|
healthy: !1,
|
|
10944
10942
|
requestId: t,
|
|
10945
|
-
status: e instanceof
|
|
10943
|
+
status: e instanceof G ? e.status : 0,
|
|
10946
10944
|
durationMs: Math.round(performance.now() - n)
|
|
10947
10945
|
};
|
|
10948
10946
|
}
|
|
@@ -10962,7 +10960,7 @@ var Ye = class {
|
|
|
10962
10960
|
signal: e?.signal,
|
|
10963
10961
|
requestId: t
|
|
10964
10962
|
}
|
|
10965
|
-
}), t)).data ?? []).filter((e) => typeof e.id == "string" && e.id.length > 0).map((e) => e.id), r = n.filter((e) =>
|
|
10963
|
+
}), t)).data ?? []).filter((e) => typeof e.id == "string" && e.id.length > 0).map((e) => e.id), r = n.filter((e) => $e(e));
|
|
10966
10964
|
return (r.length ? r : n).map((e) => ({
|
|
10967
10965
|
id: e,
|
|
10968
10966
|
label: e,
|
|
@@ -10988,7 +10986,7 @@ var Ye = class {
|
|
|
10988
10986
|
}))), n;
|
|
10989
10987
|
}
|
|
10990
10988
|
async parseEventStream(e, t, n, r, i) {
|
|
10991
|
-
if (!e.body) throw new
|
|
10989
|
+
if (!e.body) throw new G({
|
|
10992
10990
|
message: "Missing stream body",
|
|
10993
10991
|
kind: "unknown",
|
|
10994
10992
|
requestId: t,
|
|
@@ -11004,7 +11002,7 @@ var Ye = class {
|
|
|
11004
11002
|
for (; p !== -1;) {
|
|
11005
11003
|
let a = s.slice(0, p);
|
|
11006
11004
|
s = s.slice(p + 2), p = s.indexOf("\n\n");
|
|
11007
|
-
let o =
|
|
11005
|
+
let o = Je(a);
|
|
11008
11006
|
if (!o) continue;
|
|
11009
11007
|
if (o.data === "[DONE]") {
|
|
11010
11008
|
u = !0;
|
|
@@ -11024,7 +11022,7 @@ var Ye = class {
|
|
|
11024
11022
|
mode: "sse",
|
|
11025
11023
|
contentType: i,
|
|
11026
11024
|
message: n
|
|
11027
|
-
}), new
|
|
11025
|
+
}), new G({
|
|
11028
11026
|
message: n,
|
|
11029
11027
|
kind: "server",
|
|
11030
11028
|
requestId: t,
|
|
@@ -11054,7 +11052,7 @@ var Ye = class {
|
|
|
11054
11052
|
} finally {
|
|
11055
11053
|
a.releaseLock();
|
|
11056
11054
|
}
|
|
11057
|
-
if (!c.trim()) throw new
|
|
11055
|
+
if (!c.trim()) throw new G({
|
|
11058
11056
|
message: "Empty stream response body",
|
|
11059
11057
|
kind: "unknown",
|
|
11060
11058
|
requestId: t,
|
|
@@ -11080,11 +11078,11 @@ var Ye = class {
|
|
|
11080
11078
|
};
|
|
11081
11079
|
}
|
|
11082
11080
|
request(e) {
|
|
11083
|
-
return
|
|
11081
|
+
return Ue({
|
|
11084
11082
|
url: e.url,
|
|
11085
11083
|
init: e.init,
|
|
11086
11084
|
noRetry: e.noRetry,
|
|
11087
|
-
retryPolicy: { delaysMs:
|
|
11085
|
+
retryPolicy: { delaysMs: Ye },
|
|
11088
11086
|
auth: {
|
|
11089
11087
|
token: this.apiKey,
|
|
11090
11088
|
headerName: "Authorization",
|
|
@@ -11099,9 +11097,9 @@ var Ye = class {
|
|
|
11099
11097
|
});
|
|
11100
11098
|
}
|
|
11101
11099
|
};
|
|
11102
|
-
const
|
|
11100
|
+
const Qe = ({ clientId: e, baseUrl: t, gatewayConfig: n, onEvent: r, auth: i }) => {
|
|
11103
11101
|
let a = n?.model ?? "gpt-4.1-mini", o = Number(n?.max_tokens ?? n?.maxTokens ?? 1024), s = n?.temperature, c = n?.api_key ?? n?.apiKey ?? i?.token ?? null, l = n?.organization ?? n?.openai_organization ?? n?.openaiOrganization ?? null, u = n?.session_id ?? n?.sessionId ?? null;
|
|
11104
|
-
return new
|
|
11102
|
+
return new Ze({
|
|
11105
11103
|
clientId: e,
|
|
11106
11104
|
baseUrl: t,
|
|
11107
11105
|
model: String(a),
|
|
@@ -11114,11 +11112,11 @@ const Xe = ({ clientId: e, baseUrl: t, gatewayConfig: n, onEvent: r, auth: i })
|
|
|
11114
11112
|
onEvent: r
|
|
11115
11113
|
});
|
|
11116
11114
|
};
|
|
11117
|
-
function
|
|
11115
|
+
function $e(e) {
|
|
11118
11116
|
let t = e.trim().toLowerCase();
|
|
11119
11117
|
return t ? t.startsWith("gpt-") || t.startsWith("chatgpt-") : !1;
|
|
11120
11118
|
}
|
|
11121
|
-
var
|
|
11119
|
+
var et = class {
|
|
11122
11120
|
clientId;
|
|
11123
11121
|
baseUrl;
|
|
11124
11122
|
model;
|
|
@@ -11217,7 +11215,7 @@ var Qe = class {
|
|
|
11217
11215
|
return {
|
|
11218
11216
|
healthy: !1,
|
|
11219
11217
|
requestId: t,
|
|
11220
|
-
status: e instanceof
|
|
11218
|
+
status: e instanceof G ? e.status : 0,
|
|
11221
11219
|
durationMs: Math.round(performance.now() - n)
|
|
11222
11220
|
};
|
|
11223
11221
|
}
|
|
@@ -11263,7 +11261,7 @@ var Qe = class {
|
|
|
11263
11261
|
return (e.content ?? []).filter((e) => e.type === "text").map((e) => e.text ?? "").join("") || "No response returned.";
|
|
11264
11262
|
}
|
|
11265
11263
|
async parseEventStream(e, t, n, r, i) {
|
|
11266
|
-
if (!e.body) throw new
|
|
11264
|
+
if (!e.body) throw new G({
|
|
11267
11265
|
message: "Missing stream body",
|
|
11268
11266
|
kind: "unknown",
|
|
11269
11267
|
requestId: t,
|
|
@@ -11279,7 +11277,7 @@ var Qe = class {
|
|
|
11279
11277
|
for (; p !== -1;) {
|
|
11280
11278
|
let a = s.slice(0, p);
|
|
11281
11279
|
s = s.slice(p + 2), p = s.indexOf("\n\n");
|
|
11282
|
-
let o =
|
|
11280
|
+
let o = Je(a);
|
|
11283
11281
|
if (!o) continue;
|
|
11284
11282
|
if (o.data === "[DONE]") {
|
|
11285
11283
|
u = !0;
|
|
@@ -11298,7 +11296,7 @@ var Qe = class {
|
|
|
11298
11296
|
mode: "sse",
|
|
11299
11297
|
contentType: i,
|
|
11300
11298
|
message: a
|
|
11301
|
-
}), new
|
|
11299
|
+
}), new G({
|
|
11302
11300
|
message: a,
|
|
11303
11301
|
kind: "server",
|
|
11304
11302
|
requestId: t,
|
|
@@ -11331,7 +11329,7 @@ var Qe = class {
|
|
|
11331
11329
|
} finally {
|
|
11332
11330
|
a.releaseLock();
|
|
11333
11331
|
}
|
|
11334
|
-
if (!c.trim()) throw new
|
|
11332
|
+
if (!c.trim()) throw new G({
|
|
11335
11333
|
message: "Empty stream response body",
|
|
11336
11334
|
kind: "unknown",
|
|
11337
11335
|
requestId: t,
|
|
@@ -11357,11 +11355,11 @@ var Qe = class {
|
|
|
11357
11355
|
};
|
|
11358
11356
|
}
|
|
11359
11357
|
request(e) {
|
|
11360
|
-
return
|
|
11358
|
+
return Ue({
|
|
11361
11359
|
url: e.url,
|
|
11362
11360
|
init: e.init,
|
|
11363
11361
|
noRetry: e.noRetry,
|
|
11364
|
-
retryPolicy: { delaysMs:
|
|
11362
|
+
retryPolicy: { delaysMs: Ye },
|
|
11365
11363
|
auth: {
|
|
11366
11364
|
token: this.apiKey,
|
|
11367
11365
|
headerName: "x-api-key",
|
|
@@ -11377,9 +11375,9 @@ var Qe = class {
|
|
|
11377
11375
|
});
|
|
11378
11376
|
}
|
|
11379
11377
|
};
|
|
11380
|
-
const
|
|
11378
|
+
const tt = ({ clientId: e, baseUrl: t, gatewayConfig: n, onEvent: r, auth: i }) => {
|
|
11381
11379
|
let a = n?.model ?? "claude-sonnet-4-6", o = Number(n?.max_tokens ?? n?.maxTokens ?? 1024), s = n?.temperature, c = n?.anthropic_version ?? n?.anthropicVersion ?? "2023-06-01", l = n?.api_key ?? n?.apiKey ?? i?.token ?? null, u = n?.session_id ?? n?.sessionId ?? null;
|
|
11382
|
-
return new
|
|
11380
|
+
return new et({
|
|
11383
11381
|
clientId: e,
|
|
11384
11382
|
baseUrl: t,
|
|
11385
11383
|
model: String(a),
|
|
@@ -11392,17 +11390,17 @@ const $e = ({ clientId: e, baseUrl: t, gatewayConfig: n, onEvent: r, auth: i })
|
|
|
11392
11390
|
onEvent: r
|
|
11393
11391
|
});
|
|
11394
11392
|
};
|
|
11395
|
-
var
|
|
11393
|
+
var Y = [
|
|
11396
11394
|
"That's a great question! Here's what I think:\n\n**Web components** are built on three main browser APIs:\n\n1. **Custom Elements** — define your own HTML tags\n2. **Shadow DOM** — encapsulated styling and markup\n3. **HTML Templates** — reusable content fragments\n\nThey work natively in all modern browsers.",
|
|
11397
11395
|
"Sure, I can help with that! Let me break it down:\n\n- First, you'll want to understand the **component lifecycle**\n- Then look at how **attributes** map to **properties**\n- Finally, consider your **event strategy**\n\n```js\nclass MyElement extends HTMLElement {\n connectedCallback() {\n console.log('Connected!');\n }\n}\n```",
|
|
11398
11396
|
"Here are some key points to consider:\n\n> The best code is the code you don't have to write.\n\n1. Keep components **small and focused**\n2. Use **composition** over inheritance\n3. Leverage **CSS custom properties** for theming\n4. Always consider **accessibility**\n\nLet me know if you'd like more detail on any of these!"
|
|
11399
|
-
],
|
|
11397
|
+
], nt = 25, rt = class {
|
|
11400
11398
|
#e = 0;
|
|
11401
11399
|
bootstrapSession() {
|
|
11402
11400
|
return Promise.resolve({ id: "mock-session" });
|
|
11403
11401
|
}
|
|
11404
11402
|
sendMessage(e) {
|
|
11405
|
-
let t =
|
|
11403
|
+
let t = Y[this.#e++ % Y.length];
|
|
11406
11404
|
return Promise.resolve({
|
|
11407
11405
|
role: "assistant",
|
|
11408
11406
|
message: t,
|
|
@@ -11410,7 +11408,7 @@ var X = [
|
|
|
11410
11408
|
});
|
|
11411
11409
|
}
|
|
11412
11410
|
async sendMessageStream(e) {
|
|
11413
|
-
let t =
|
|
11411
|
+
let t = Y[this.#e++ % Y.length], n = t.split(/(\s+)/);
|
|
11414
11412
|
e.onMode?.("sse", "text/event-stream"), e.onStreamEvent?.({
|
|
11415
11413
|
phase: "start",
|
|
11416
11414
|
mode: "sse"
|
|
@@ -11426,7 +11424,7 @@ var X = [
|
|
|
11426
11424
|
role: "assistant",
|
|
11427
11425
|
datetime: Date.now(),
|
|
11428
11426
|
done: i
|
|
11429
|
-
}), i || await new Promise((e) => setTimeout(e,
|
|
11427
|
+
}), i || await new Promise((e) => setTimeout(e, nt));
|
|
11430
11428
|
}
|
|
11431
11429
|
return e.onStreamEvent?.({
|
|
11432
11430
|
phase: "complete",
|
|
@@ -11460,8 +11458,8 @@ var X = [
|
|
|
11460
11458
|
}]);
|
|
11461
11459
|
}
|
|
11462
11460
|
};
|
|
11463
|
-
function
|
|
11464
|
-
return new
|
|
11461
|
+
function it(e) {
|
|
11462
|
+
return new rt();
|
|
11465
11463
|
}
|
|
11466
11464
|
/**
|
|
11467
11465
|
* Stamped panel for the chat interface.
|
|
@@ -11508,7 +11506,7 @@ function nt(e) {
|
|
|
11508
11506
|
* @attr {string} gateway-config - JSON config for the adapter (model, apiKey, system, etc.)
|
|
11509
11507
|
* @attr {string} gateway-urls - JSON map of provider prefixes to URLs (e.g. '{"claude":"/api/anthropic","openai":"/api/openai"}'). When set, auto-switches gateway based on model prefix.
|
|
11510
11508
|
*/
|
|
11511
|
-
var
|
|
11509
|
+
var at = class extends m {
|
|
11512
11510
|
static MAX_CONTEXT_MESSAGES = 50;
|
|
11513
11511
|
static observedAttributes = [
|
|
11514
11512
|
"show-stop",
|
|
@@ -11522,17 +11520,17 @@ var rt = class extends p {
|
|
|
11522
11520
|
"gateway-config",
|
|
11523
11521
|
"gateway-urls"
|
|
11524
11522
|
];
|
|
11525
|
-
#e =
|
|
11526
|
-
#t =
|
|
11527
|
-
#n =
|
|
11528
|
-
#r =
|
|
11529
|
-
#i =
|
|
11530
|
-
#a =
|
|
11531
|
-
#o =
|
|
11532
|
-
#s =
|
|
11533
|
-
#c =
|
|
11534
|
-
#l =
|
|
11535
|
-
#u =
|
|
11523
|
+
#e = S(!1);
|
|
11524
|
+
#t = S(!1);
|
|
11525
|
+
#n = S("open-request");
|
|
11526
|
+
#r = S(!1);
|
|
11527
|
+
#i = S([]);
|
|
11528
|
+
#a = S(null);
|
|
11529
|
+
#o = S(null);
|
|
11530
|
+
#s = S(null);
|
|
11531
|
+
#c = S(null);
|
|
11532
|
+
#l = S(null);
|
|
11533
|
+
#u = S(!1);
|
|
11536
11534
|
#d = null;
|
|
11537
11535
|
#f = [];
|
|
11538
11536
|
#p = null;
|
|
@@ -11725,15 +11723,13 @@ var rt = class extends p {
|
|
|
11725
11723
|
let e = this.#i.value;
|
|
11726
11724
|
if (e.length > 0 && !this.#b) {
|
|
11727
11725
|
let e = document.createElement("n-select");
|
|
11728
|
-
e.setAttribute("aria-label", "Select model"), e.setAttribute("data-role", "model-picker"), e.addEventListener("native:change", this.#M);
|
|
11729
|
-
let t = document.createElement("n-
|
|
11730
|
-
t.setAttribute("
|
|
11731
|
-
let n = document.createElement("n-
|
|
11732
|
-
n.setAttribute("
|
|
11733
|
-
let r =
|
|
11734
|
-
r
|
|
11735
|
-
let i = this.#y?.querySelector("[data-submit]");
|
|
11736
|
-
i ? this.#y?.insertBefore(e, i) : this.#y?.appendChild(e);
|
|
11726
|
+
e.setAttribute("aria-label", "Select model"), e.setAttribute("data-role", "model-picker"), e.setAttribute("variant", "ghost"), e.setAttribute("inline", ""), e.addEventListener("native:change", this.#M);
|
|
11727
|
+
let t = document.createElement("n-icon");
|
|
11728
|
+
t.setAttribute("name", "dots-three-outline-fill"), t.setAttribute("slot", "label");
|
|
11729
|
+
let n = document.createElement("n-listbox");
|
|
11730
|
+
n.setAttribute("popover", "manual"), e.append(t, n), this.#b = e, this.#x = n;
|
|
11731
|
+
let r = this.#y?.querySelector("[data-submit]");
|
|
11732
|
+
r ? this.#y?.insertBefore(e, r) : this.#y?.appendChild(e);
|
|
11737
11733
|
} else e.length === 0 && this.#b && this.#B();
|
|
11738
11734
|
}), this.addEffect(() => {
|
|
11739
11735
|
let e = this.#i.value, t = this.#a.value, n = this.#b, r = this.#x;
|
|
@@ -11770,7 +11766,7 @@ var rt = class extends p {
|
|
|
11770
11766
|
baseUrl: t,
|
|
11771
11767
|
gatewayConfig: n ?? {}
|
|
11772
11768
|
}, i = null;
|
|
11773
|
-
e === "openai" ? i =
|
|
11769
|
+
e === "openai" ? i = Qe(r) : e === "claude" ? i = tt(r) : e === "mock" && (i = it(r)), this.#d = i, i && i.bootstrapSession().catch(() => {});
|
|
11774
11770
|
}), this.addEffect(() => {
|
|
11775
11771
|
this.#o.value && (this.#e.value = this.#u.value);
|
|
11776
11772
|
}), this.addEventListener("native:send", this.#N), this.addEventListener("native:chat-stop", this.#L), this.addEventListener("native:chat-restart", this.#R), this.deferChildren(() => {
|
|
@@ -11975,9 +11971,9 @@ var rt = class extends p {
|
|
|
11975
11971
|
#F(e) {
|
|
11976
11972
|
let t = this.#h;
|
|
11977
11973
|
if (!t) return;
|
|
11978
|
-
let n = document.createElement("n-
|
|
11974
|
+
let n = document.createElement("n-agent-dialogue");
|
|
11979
11975
|
n.setAttribute("data-role", e.role), n.setAttribute("sender", e.role === "user" ? "You" : "Assistant");
|
|
11980
|
-
let r = document.createElement("n-
|
|
11976
|
+
let r = document.createElement("n-agent-dialogue-item");
|
|
11981
11977
|
r.setAttribute("data-role", e.role), r.setAttribute("message-id", `msg-${J()}`), r.setAttribute("status", "sent");
|
|
11982
11978
|
let i = document.createElement("n-chat-message-text");
|
|
11983
11979
|
i.content = e.message, r.appendChild(i), n.appendChild(r), t.appendChild(n);
|
|
@@ -11985,9 +11981,9 @@ var rt = class extends p {
|
|
|
11985
11981
|
#I(e) {
|
|
11986
11982
|
let t = this.#h;
|
|
11987
11983
|
if (!t) return null;
|
|
11988
|
-
let n = document.createElement("n-
|
|
11984
|
+
let n = document.createElement("n-agent-dialogue");
|
|
11989
11985
|
n.setAttribute("data-role", "assistant"), n.setAttribute("sender", "Assistant");
|
|
11990
|
-
let r = document.createElement("n-
|
|
11986
|
+
let r = document.createElement("n-agent-dialogue-item");
|
|
11991
11987
|
r.setAttribute("data-role", "assistant"), r.setAttribute("message-id", e), r.setAttribute("status", "streaming");
|
|
11992
11988
|
let i = document.createElement("n-chat-message-text");
|
|
11993
11989
|
return r.appendChild(i), n.appendChild(r), t.appendChild(n), r;
|
|
@@ -12027,7 +12023,7 @@ var rt = class extends p {
|
|
|
12027
12023
|
#B() {
|
|
12028
12024
|
this.#b &&= (this.#b.removeEventListener("native:change", this.#M), this.#b.remove(), null), this.#x = null;
|
|
12029
12025
|
}
|
|
12030
|
-
},
|
|
12026
|
+
}, ot = 40, st = class extends m {
|
|
12031
12027
|
static observedAttributes = [
|
|
12032
12028
|
"auto-scroll",
|
|
12033
12029
|
"scrollable",
|
|
@@ -12036,12 +12032,12 @@ var rt = class extends p {
|
|
|
12036
12032
|
"virtual-overscan"
|
|
12037
12033
|
];
|
|
12038
12034
|
#e;
|
|
12039
|
-
#t =
|
|
12040
|
-
#n =
|
|
12035
|
+
#t = S(!0);
|
|
12036
|
+
#n = S(!0);
|
|
12041
12037
|
#r = null;
|
|
12042
12038
|
#i = null;
|
|
12043
12039
|
#a = null;
|
|
12044
|
-
#o =
|
|
12040
|
+
#o = S([]);
|
|
12045
12041
|
#s = null;
|
|
12046
12042
|
constructor() {
|
|
12047
12043
|
super(), this.#e = this.attachInternals();
|
|
@@ -12101,7 +12097,7 @@ var rt = class extends p {
|
|
|
12101
12097
|
#c() {
|
|
12102
12098
|
if (this.#i) return;
|
|
12103
12099
|
let e = Number(this.getAttribute("virtual-item-height")) || 80, t = Number(this.getAttribute("virtual-overscan")) || 5;
|
|
12104
|
-
for (this.#i = new
|
|
12100
|
+
for (this.#i = new _(this, {
|
|
12105
12101
|
itemHeight: e,
|
|
12106
12102
|
overscan: t
|
|
12107
12103
|
}), this.#a = document.createElement("div"), this.#a.className = "n-chat-feed-virtual-container"; this.firstChild;) this.#a.appendChild(this.firstChild);
|
|
@@ -12136,7 +12132,7 @@ var rt = class extends p {
|
|
|
12136
12132
|
}
|
|
12137
12133
|
}
|
|
12138
12134
|
#f = () => {
|
|
12139
|
-
let e = this.#n.value, t = this.scrollTop + this.clientHeight >= this.scrollHeight -
|
|
12135
|
+
let e = this.#n.value, t = this.scrollTop + this.clientHeight >= this.scrollHeight - ot;
|
|
12140
12136
|
this.#n.value = t, t !== e && this.dispatchEvent(new CustomEvent("native:feed-scroll", {
|
|
12141
12137
|
bubbles: !0,
|
|
12142
12138
|
composed: !0,
|
|
@@ -12154,15 +12150,15 @@ var rt = class extends p {
|
|
|
12154
12150
|
});
|
|
12155
12151
|
});
|
|
12156
12152
|
};
|
|
12157
|
-
},
|
|
12153
|
+
}, ct = class extends m {
|
|
12158
12154
|
static observedAttributes = [
|
|
12159
12155
|
"src",
|
|
12160
12156
|
"name",
|
|
12161
12157
|
"icon"
|
|
12162
12158
|
];
|
|
12163
|
-
#e =
|
|
12164
|
-
#t =
|
|
12165
|
-
#n =
|
|
12159
|
+
#e = S("");
|
|
12160
|
+
#t = S("");
|
|
12161
|
+
#n = S("");
|
|
12166
12162
|
attributeChangedCallback(e, t, n) {
|
|
12167
12163
|
if (t !== n) {
|
|
12168
12164
|
switch (e) {
|
|
@@ -12194,7 +12190,7 @@ var rt = class extends p {
|
|
|
12194
12190
|
}
|
|
12195
12191
|
if (n) {
|
|
12196
12192
|
let e = document.createElement("span");
|
|
12197
|
-
e.className = "n-chat-avatar-initials", e.textContent =
|
|
12193
|
+
e.className = "n-chat-avatar-initials", e.textContent = lt(n), e.setAttribute("aria-hidden", "true"), this.appendChild(e);
|
|
12198
12194
|
return;
|
|
12199
12195
|
}
|
|
12200
12196
|
let r = document.createElement("n-icon");
|
|
@@ -12205,11 +12201,11 @@ var rt = class extends p {
|
|
|
12205
12201
|
this.textContent = "", super.teardown();
|
|
12206
12202
|
}
|
|
12207
12203
|
};
|
|
12208
|
-
function
|
|
12204
|
+
function lt(e) {
|
|
12209
12205
|
let t = e.trim().split(/\s+/);
|
|
12210
12206
|
return t.length === 0 ? "" : t.length === 1 ? t[0][0].toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
12211
12207
|
}
|
|
12212
|
-
const
|
|
12208
|
+
const ut = {
|
|
12213
12209
|
copy: {
|
|
12214
12210
|
label: "Copy",
|
|
12215
12211
|
icon: "copy"
|
|
@@ -12234,7 +12230,7 @@ const ct = {
|
|
|
12234
12230
|
label: "Continue",
|
|
12235
12231
|
icon: "arrow-right"
|
|
12236
12232
|
}
|
|
12237
|
-
},
|
|
12233
|
+
}, dt = {
|
|
12238
12234
|
assistant: [
|
|
12239
12235
|
"copy",
|
|
12240
12236
|
"retry",
|
|
@@ -12259,7 +12255,7 @@ const ct = {
|
|
|
12259
12255
|
* @fires native:message-action - Fired when an action button is clicked
|
|
12260
12256
|
* @fires native:continue-request - Fired when continue is requested for a partial message
|
|
12261
12257
|
*/
|
|
12262
|
-
var
|
|
12258
|
+
var ft = class extends m {
|
|
12263
12259
|
static observedAttributes = [
|
|
12264
12260
|
"data-role",
|
|
12265
12261
|
"message-id",
|
|
@@ -12270,11 +12266,11 @@ var ut = class extends p {
|
|
|
12270
12266
|
"actions-position"
|
|
12271
12267
|
];
|
|
12272
12268
|
#e;
|
|
12273
|
-
#t =
|
|
12274
|
-
#n =
|
|
12275
|
-
#r =
|
|
12276
|
-
#i =
|
|
12277
|
-
#a =
|
|
12269
|
+
#t = S("assistant");
|
|
12270
|
+
#n = S("sent");
|
|
12271
|
+
#r = S(null);
|
|
12272
|
+
#i = S("icon");
|
|
12273
|
+
#a = S("below");
|
|
12278
12274
|
#o = null;
|
|
12279
12275
|
#s = !1;
|
|
12280
12276
|
#c = 0;
|
|
@@ -12378,17 +12374,17 @@ var ut = class extends p {
|
|
|
12378
12374
|
#p(e, t, n, r, i) {
|
|
12379
12375
|
if (this.#o &&= (this.#f(), null), clearTimeout(this.#l), t === "none" || this.querySelector("[slot=\"actions\"]")) return;
|
|
12380
12376
|
let a;
|
|
12381
|
-
if (a = t ? t.split(",").map((e) => e.trim()).filter(Boolean) :
|
|
12377
|
+
if (a = t ? t.split(",").map((e) => e.trim()).filter(Boolean) : dt[e] ?? [], i === "partial" && !a.includes("continue") && (a = [...a, "continue"]), a.length === 0) return;
|
|
12382
12378
|
let o = document.createElement("n-toolbar");
|
|
12383
12379
|
o.dataset.role = "actions", o.setAttribute("padding", "tight"), o.setAttribute("aria-label", "Message actions"), n !== "label" && o.setAttribute("data-style", n);
|
|
12384
12380
|
for (let e of a) {
|
|
12385
|
-
let t =
|
|
12386
|
-
t && o.appendChild(
|
|
12381
|
+
let t = ut[e];
|
|
12382
|
+
t && o.appendChild(pt(e, t, n));
|
|
12387
12383
|
}
|
|
12388
12384
|
if (o.children.length !== 0) {
|
|
12389
12385
|
if (o.addEventListener("native:press", this.#m), r === "below") {
|
|
12390
12386
|
o.setAttribute("popover", "manual");
|
|
12391
|
-
let e =
|
|
12387
|
+
let e = C("msg");
|
|
12392
12388
|
this.style.setProperty("anchor-name", `--${e}`), o.style.setProperty("position-anchor", `--${e}`), this.appendChild(o), this.#s = !0, o.addEventListener("pointerenter", this.#u), o.addEventListener("pointerleave", this.#d), o.addEventListener("focusin", this.#u), o.addEventListener("focusout", this.#d), i === "partial" && o.showPopover();
|
|
12393
12389
|
} else this.appendChild(o);
|
|
12394
12390
|
this.#o = o;
|
|
@@ -12416,7 +12412,7 @@ var ut = class extends p {
|
|
|
12416
12412
|
}
|
|
12417
12413
|
};
|
|
12418
12414
|
};
|
|
12419
|
-
function
|
|
12415
|
+
function pt(e, t, n) {
|
|
12420
12416
|
let r = document.createElement("n-button");
|
|
12421
12417
|
if (r.setAttribute("variant", "ghost"), r.setAttribute("size", "sm"), r.setAttribute("inline", ""), r.setAttribute("data-action", e), r.setAttribute("aria-label", t.label), n === "icon" || n === "icon-label") {
|
|
12422
12418
|
let e = document.createElement("n-icon");
|
|
@@ -12434,26 +12430,26 @@ function dt(e, t, n) {
|
|
|
12434
12430
|
*
|
|
12435
12431
|
* On setup, non-avatar children are sorted into two wrapper divs:
|
|
12436
12432
|
* - `.n-chat-context` — non-message children (row 1)
|
|
12437
|
-
* - `.n-chat-bubbles` — `n-
|
|
12433
|
+
* - `.n-chat-bubbles` — `n-agent-dialogue-item` children (row 2)
|
|
12438
12434
|
*
|
|
12439
12435
|
* A MutationObserver routes dynamically added children into the
|
|
12440
12436
|
* correct wrapper automatically.
|
|
12441
12437
|
*
|
|
12442
12438
|
* ```html
|
|
12443
|
-
* <n-
|
|
12439
|
+
* <n-agent-dialogue role="assistant" sender="AI">
|
|
12444
12440
|
* <n-chat-avatar>AI</n-chat-avatar>
|
|
12445
12441
|
* <span class="reasoning">Thinking...</span>
|
|
12446
|
-
* <n-
|
|
12442
|
+
* <n-agent-dialogue-item role="assistant">
|
|
12447
12443
|
* <n-chat-message-text>Hello!</n-chat-message-text>
|
|
12448
|
-
* </n-
|
|
12449
|
-
* </n-
|
|
12444
|
+
* </n-agent-dialogue-item>
|
|
12445
|
+
* </n-agent-dialogue>
|
|
12450
12446
|
* ```
|
|
12451
12447
|
*
|
|
12452
12448
|
* @attr {string} role - `user` | `assistant` | `system`
|
|
12453
12449
|
* @attr {string} sender - Display name of the sender
|
|
12454
12450
|
* @attr {string} avatar-align - `"top"` | `"center"` | `"bottom"` (default) — avatar vertical alignment
|
|
12455
12451
|
*/
|
|
12456
|
-
var
|
|
12452
|
+
var mt = class extends m {
|
|
12457
12453
|
static observedAttributes = [
|
|
12458
12454
|
"data-role",
|
|
12459
12455
|
"sender",
|
|
@@ -12473,7 +12469,7 @@ var ft = class extends p {
|
|
|
12473
12469
|
super.setup(), this.#e.role = "group";
|
|
12474
12470
|
let e = this.getAttribute("sender");
|
|
12475
12471
|
e && this.setAttribute("aria-label", `Messages from ${e}`), this.#i(), this.#r = new MutationObserver((e) => {
|
|
12476
|
-
for (let t of e) for (let e of t.addedNodes) e instanceof Element && e.localName !== "n-chat-avatar" && (e === this.#t || e === this.#n || (e.localName === "n-
|
|
12472
|
+
for (let t of e) for (let e of t.addedNodes) e instanceof Element && e.localName !== "n-chat-avatar" && (e === this.#t || e === this.#n || (e.localName === "n-agent-dialogue-item" ? this.#n?.appendChild(e) : this.#t?.appendChild(e)));
|
|
12477
12473
|
}), this.#r.observe(this, { childList: !0 });
|
|
12478
12474
|
}
|
|
12479
12475
|
teardown() {
|
|
@@ -12493,13 +12489,13 @@ var ft = class extends p {
|
|
|
12493
12489
|
let t = document.createElement("div");
|
|
12494
12490
|
t.className = "n-chat-bubbles";
|
|
12495
12491
|
let n = Array.from(this.childNodes);
|
|
12496
|
-
for (let r of n) r instanceof Element && r.localName === "n-chat-avatar" || (r instanceof Element && r.localName === "n-
|
|
12492
|
+
for (let r of n) r instanceof Element && r.localName === "n-chat-avatar" || (r instanceof Element && r.localName === "n-agent-dialogue-item" ? t.appendChild(r) : e.appendChild(r));
|
|
12497
12493
|
this.appendChild(e), this.appendChild(t), this.#t = e, this.#n = t;
|
|
12498
12494
|
}
|
|
12499
|
-
},
|
|
12495
|
+
}, ht = class extends m {
|
|
12500
12496
|
static observedAttributes = ["format"];
|
|
12501
|
-
#e =
|
|
12502
|
-
#t =
|
|
12497
|
+
#e = S("markdown");
|
|
12498
|
+
#t = S("");
|
|
12503
12499
|
#n = null;
|
|
12504
12500
|
#r = 0;
|
|
12505
12501
|
get content() {
|
|
@@ -12522,7 +12518,7 @@ var ft = class extends p {
|
|
|
12522
12518
|
!this.#t.value && this.textContent?.trim() && (this.#t.value = this.textContent.trim()), this.#n = document.createElement("div"), this.#n.className = "n-chat-prose", this.textContent = "", this.appendChild(this.#n), this.addEffect(() => {
|
|
12523
12519
|
let e = this.#t.value, t = this.#e.value;
|
|
12524
12520
|
this.#n && (t === "plain" ? this.#n.textContent = e : (cancelAnimationFrame(this.#r), this.#r = requestAnimationFrame(() => {
|
|
12525
|
-
this.#n && (this.#n.innerHTML =
|
|
12521
|
+
this.#n && (this.#n.innerHTML = vt(_t(e)));
|
|
12526
12522
|
})));
|
|
12527
12523
|
});
|
|
12528
12524
|
});
|
|
@@ -12530,7 +12526,7 @@ var ft = class extends p {
|
|
|
12530
12526
|
teardown() {
|
|
12531
12527
|
cancelAnimationFrame(this.#r), this.#n = null, super.teardown();
|
|
12532
12528
|
}
|
|
12533
|
-
},
|
|
12529
|
+
}, gt = new Set([
|
|
12534
12530
|
"p",
|
|
12535
12531
|
"br",
|
|
12536
12532
|
"strong",
|
|
@@ -12550,14 +12546,14 @@ var ft = class extends p {
|
|
|
12550
12546
|
"blockquote",
|
|
12551
12547
|
"hr"
|
|
12552
12548
|
]);
|
|
12553
|
-
function
|
|
12549
|
+
function X(e) {
|
|
12554
12550
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
12555
12551
|
}
|
|
12556
|
-
function
|
|
12557
|
-
let t =
|
|
12552
|
+
function Z(e) {
|
|
12553
|
+
let t = X(e);
|
|
12558
12554
|
return t = t.replace(/`([^`]+)`/g, "<code>$1</code>"), t = t.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/__(.+?)__/g, "<strong>$1</strong>"), t = t.replace(/\*(.+?)\*/g, "<em>$1</em>"), t = t.replace(/(?<!\w)_(.+?)_(?!\w)/g, "<em>$1</em>"), t = t.replace(/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g, "<a href=\"$2\" rel=\"noopener noreferrer\" target=\"_blank\">$1</a>"), t;
|
|
12559
12555
|
}
|
|
12560
|
-
function
|
|
12556
|
+
function _t(e) {
|
|
12561
12557
|
if (!e) return "";
|
|
12562
12558
|
let t = e.split("\n"), n = [], r = 0;
|
|
12563
12559
|
for (; r < t.length;) {
|
|
@@ -12566,14 +12562,14 @@ function ht(e) {
|
|
|
12566
12562
|
let i = e.slice(3).trim(), a = [];
|
|
12567
12563
|
for (r += 1; r < t.length && !t[r].startsWith("```");) a.push(t[r]), r += 1;
|
|
12568
12564
|
r += 1;
|
|
12569
|
-
let o = i ? ` data-lang="${
|
|
12570
|
-
n.push(`<pre${o}><code>${
|
|
12565
|
+
let o = i ? ` data-lang="${X(i)}"` : "";
|
|
12566
|
+
n.push(`<pre${o}><code>${X(a.join("\n"))}</code></pre>`);
|
|
12571
12567
|
continue;
|
|
12572
12568
|
}
|
|
12573
12569
|
let i = e.match(/^(#{1,6})\s+(.+)/);
|
|
12574
12570
|
if (i) {
|
|
12575
12571
|
let e = i[1].length;
|
|
12576
|
-
n.push(`<h${e}>${
|
|
12572
|
+
n.push(`<h${e}>${Z(i[2])}</h${e}>`), r += 1;
|
|
12577
12573
|
continue;
|
|
12578
12574
|
}
|
|
12579
12575
|
if (/^---+$/.test(e.trim()) || /^\*\*\*+$/.test(e.trim())) {
|
|
@@ -12583,7 +12579,7 @@ function ht(e) {
|
|
|
12583
12579
|
if (e.startsWith("> ")) {
|
|
12584
12580
|
let e = [];
|
|
12585
12581
|
for (; r < t.length && t[r].startsWith("> ");) e.push(t[r].slice(2)), r += 1;
|
|
12586
|
-
n.push(`<blockquote>${
|
|
12582
|
+
n.push(`<blockquote>${_t(e.join("\n"))}</blockquote>`);
|
|
12587
12583
|
continue;
|
|
12588
12584
|
}
|
|
12589
12585
|
if (/^[-*+]\s/.test(e)) {
|
|
@@ -12591,7 +12587,7 @@ function ht(e) {
|
|
|
12591
12587
|
for (; r < t.length;) if (/^[-*+]\s/.test(t[r])) e.push(t[r].replace(/^[-*+]\s/, "")), r += 1;
|
|
12592
12588
|
else if (!t[r].trim() && r + 1 < t.length && /^[-*+]\s/.test(t[r + 1])) r += 1;
|
|
12593
12589
|
else break;
|
|
12594
|
-
n.push("<ul>" + e.map((e) => `<li>${
|
|
12590
|
+
n.push("<ul>" + e.map((e) => `<li>${Z(e)}</li>`).join("") + "</ul>");
|
|
12595
12591
|
continue;
|
|
12596
12592
|
}
|
|
12597
12593
|
if (/^\d+\.\s/.test(e)) {
|
|
@@ -12599,7 +12595,7 @@ function ht(e) {
|
|
|
12599
12595
|
for (; r < t.length;) if (/^\d+\.\s/.test(t[r])) e.push(t[r].replace(/^\d+\.\s/, "")), r += 1;
|
|
12600
12596
|
else if (!t[r].trim() && r + 1 < t.length && /^\d+\.\s/.test(t[r + 1])) r += 1;
|
|
12601
12597
|
else break;
|
|
12602
|
-
n.push("<ol>" + e.map((e) => `<li>${
|
|
12598
|
+
n.push("<ol>" + e.map((e) => `<li>${Z(e)}</li>`).join("") + "</ol>");
|
|
12603
12599
|
continue;
|
|
12604
12600
|
}
|
|
12605
12601
|
if (!e.trim()) {
|
|
@@ -12608,15 +12604,15 @@ function ht(e) {
|
|
|
12608
12604
|
}
|
|
12609
12605
|
let a = [];
|
|
12610
12606
|
for (; r < t.length && t[r].trim() && !t[r].startsWith("#") && !t[r].startsWith("```") && !t[r].startsWith("> ") && !/^[-*+]\s/.test(t[r]) && !/^\d+\.\s/.test(t[r]) && !/^---+$/.test(t[r].trim());) a.push(t[r]), r += 1;
|
|
12611
|
-
a.length > 0 && n.push(`<p>${
|
|
12607
|
+
a.length > 0 && n.push(`<p>${Z(a.join("\n"))}</p>`);
|
|
12612
12608
|
}
|
|
12613
12609
|
return n.join("");
|
|
12614
12610
|
}
|
|
12615
12611
|
/** Sanitize rendered HTML — strip any tags not in allowlist. */
|
|
12616
|
-
function
|
|
12612
|
+
function vt(e) {
|
|
12617
12613
|
return e.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g, (e, t) => {
|
|
12618
12614
|
let n = t.toLowerCase();
|
|
12619
|
-
return
|
|
12615
|
+
return gt.has(n) ? e : "";
|
|
12620
12616
|
});
|
|
12621
12617
|
}
|
|
12622
12618
|
/**
|
|
@@ -12637,7 +12633,7 @@ function gt(e) {
|
|
|
12637
12633
|
* @attr {boolean} expandable - Allow click to expand trace content
|
|
12638
12634
|
* @fires native:activity-toggle - Fired when trace is expanded/collapsed
|
|
12639
12635
|
*/
|
|
12640
|
-
var
|
|
12636
|
+
var yt = class extends m {
|
|
12641
12637
|
static observedAttributes = [
|
|
12642
12638
|
"type",
|
|
12643
12639
|
"label",
|
|
@@ -12645,11 +12641,11 @@ var _t = class extends p {
|
|
|
12645
12641
|
"expandable"
|
|
12646
12642
|
];
|
|
12647
12643
|
#e;
|
|
12648
|
-
#t =
|
|
12649
|
-
#n =
|
|
12650
|
-
#r =
|
|
12651
|
-
#i =
|
|
12652
|
-
#a =
|
|
12644
|
+
#t = S("typing");
|
|
12645
|
+
#n = S("");
|
|
12646
|
+
#r = S(!1);
|
|
12647
|
+
#i = S(!1);
|
|
12648
|
+
#a = S(!1);
|
|
12653
12649
|
#o = 0;
|
|
12654
12650
|
#s = 0;
|
|
12655
12651
|
#c = null;
|
|
@@ -12695,7 +12691,7 @@ var _t = class extends p {
|
|
|
12695
12691
|
this.#r.value ? (this.#p(), this.#e.states.add("active")) : (this.#m(), this.#e.states.delete("active"));
|
|
12696
12692
|
}), this.addEffect(() => {
|
|
12697
12693
|
if (!this.#c) return;
|
|
12698
|
-
let e = this.#n.value ||
|
|
12694
|
+
let e = this.#n.value || bt(this.#t.value);
|
|
12699
12695
|
this.#c.textContent = e;
|
|
12700
12696
|
}), this.addEffect(() => {
|
|
12701
12697
|
this.#u && (this.#u.hidden = !this.#r.value);
|
|
@@ -12725,7 +12721,7 @@ var _t = class extends p {
|
|
|
12725
12721
|
#h = () => {
|
|
12726
12722
|
if (!this.#r.value || !this.#l) return;
|
|
12727
12723
|
let e = performance.now() - this.#o;
|
|
12728
|
-
this.#l.textContent =
|
|
12724
|
+
this.#l.textContent = xt(e), this.#s = requestAnimationFrame(this.#h);
|
|
12729
12725
|
};
|
|
12730
12726
|
#g = () => {
|
|
12731
12727
|
this.#i.value && (this.#a.value = !this.#a.value, this.toggleAttribute("expanded", this.#a.value), this.dispatchEvent(new CustomEvent("native:activity-toggle", {
|
|
@@ -12735,14 +12731,14 @@ var _t = class extends p {
|
|
|
12735
12731
|
})));
|
|
12736
12732
|
};
|
|
12737
12733
|
};
|
|
12738
|
-
function
|
|
12734
|
+
function bt(e) {
|
|
12739
12735
|
switch (e) {
|
|
12740
12736
|
case "thinking": return "Thinking…";
|
|
12741
12737
|
case "tool-use": return "Using tools…";
|
|
12742
12738
|
default: return "Host is typing…";
|
|
12743
12739
|
}
|
|
12744
12740
|
}
|
|
12745
|
-
function
|
|
12741
|
+
function xt(e) {
|
|
12746
12742
|
let t = Math.floor(e / 1e3);
|
|
12747
12743
|
if (t < 60) return `${t}s`;
|
|
12748
12744
|
let n = Math.floor(t / 60), r = t % 60;
|
|
@@ -12762,11 +12758,11 @@ function yt(e) {
|
|
|
12762
12758
|
* @attr {boolean} disabled - Disables all chips
|
|
12763
12759
|
* @fires native:seed-select - Fired when a chip is clicked
|
|
12764
12760
|
*/
|
|
12765
|
-
var
|
|
12761
|
+
var St = class extends m {
|
|
12766
12762
|
static observedAttributes = ["options", "disabled"];
|
|
12767
12763
|
#e;
|
|
12768
|
-
#t =
|
|
12769
|
-
#n =
|
|
12764
|
+
#t = S([]);
|
|
12765
|
+
#n = S(!1);
|
|
12770
12766
|
constructor() {
|
|
12771
12767
|
super(), this.#e = this.attachInternals();
|
|
12772
12768
|
}
|
|
@@ -12800,7 +12796,7 @@ var bt = class extends p {
|
|
|
12800
12796
|
}
|
|
12801
12797
|
}
|
|
12802
12798
|
setup() {
|
|
12803
|
-
super.setup(), this.addEffect(
|
|
12799
|
+
super.setup(), this.addEffect(y(this, this.#n, this.#e)), this.addEffect(() => {
|
|
12804
12800
|
let e = this.#t.value;
|
|
12805
12801
|
this.textContent = "";
|
|
12806
12802
|
let t = document.createElement("n-stack");
|
|
@@ -12826,7 +12822,7 @@ var bt = class extends p {
|
|
|
12826
12822
|
this.appendChild(t);
|
|
12827
12823
|
});
|
|
12828
12824
|
}
|
|
12829
|
-
},
|
|
12825
|
+
}, Ct = new Set([
|
|
12830
12826
|
"script",
|
|
12831
12827
|
"style",
|
|
12832
12828
|
"link",
|
|
@@ -12843,12 +12839,12 @@ var bt = class extends p {
|
|
|
12843
12839
|
"frame",
|
|
12844
12840
|
"frameset",
|
|
12845
12841
|
"noscript"
|
|
12846
|
-
]),
|
|
12842
|
+
]), wt = class extends m {
|
|
12847
12843
|
static observedAttributes = ["schema-type", "mode"];
|
|
12848
12844
|
#e;
|
|
12849
|
-
#t =
|
|
12850
|
-
#n =
|
|
12851
|
-
#r =
|
|
12845
|
+
#t = S("a2ui");
|
|
12846
|
+
#n = S("inline");
|
|
12847
|
+
#r = S(null);
|
|
12852
12848
|
#i = null;
|
|
12853
12849
|
#a = null;
|
|
12854
12850
|
constructor() {
|
|
@@ -12889,7 +12885,7 @@ var bt = class extends p {
|
|
|
12889
12885
|
super.setup(), this.#i = document.createElement("div"), this.#i.className = "n-chat-genui-container", this.appendChild(this.#i), this.addEffect(() => {
|
|
12890
12886
|
let e = this.#r.value, t = this.#n.value;
|
|
12891
12887
|
if (!this.#i || (this.#i.textContent = "", !e)) return;
|
|
12892
|
-
let n =
|
|
12888
|
+
let n = Tt(e);
|
|
12893
12889
|
if (n.length > 0) {
|
|
12894
12890
|
this.#o(n), this.dispatchEvent(new CustomEvent("native:genui-error", {
|
|
12895
12891
|
bubbles: !0,
|
|
@@ -12900,7 +12896,7 @@ var bt = class extends p {
|
|
|
12900
12896
|
}
|
|
12901
12897
|
if (t === "lightbox") this.#s(e);
|
|
12902
12898
|
else {
|
|
12903
|
-
let t =
|
|
12899
|
+
let t = Q(e);
|
|
12904
12900
|
t && this.#i.appendChild(t);
|
|
12905
12901
|
}
|
|
12906
12902
|
this.#e.states.add("rendered");
|
|
@@ -12925,7 +12921,7 @@ var bt = class extends p {
|
|
|
12925
12921
|
}
|
|
12926
12922
|
#c(e) {
|
|
12927
12923
|
this.#l();
|
|
12928
|
-
let t = document.createElement("n-dialog"), n =
|
|
12924
|
+
let t = document.createElement("n-dialog"), n = Q(e);
|
|
12929
12925
|
n && t.appendChild(n), this.appendChild(t), this.#a = t, requestAnimationFrame(() => {
|
|
12930
12926
|
let e = t.querySelector("dialog");
|
|
12931
12927
|
e && e.showModal();
|
|
@@ -12953,20 +12949,20 @@ var bt = class extends p {
|
|
|
12953
12949
|
}));
|
|
12954
12950
|
};
|
|
12955
12951
|
};
|
|
12956
|
-
function
|
|
12952
|
+
function Tt(e, t = 0) {
|
|
12957
12953
|
let n = [];
|
|
12958
12954
|
if (t > 20) return n.push("Maximum nesting depth (20) exceeded"), n;
|
|
12959
12955
|
if (!e.tag || typeof e.tag != "string") return n.push("Node missing required \"tag\" property"), n;
|
|
12960
|
-
if (
|
|
12956
|
+
if (Ct.has(e.tag.toLowerCase()) && n.push(`Forbidden tag: <${e.tag}>`), e.children) for (let r of e.children) n.push(...Tt(r, t + 1));
|
|
12961
12957
|
return n;
|
|
12962
12958
|
}
|
|
12963
|
-
function
|
|
12964
|
-
if (
|
|
12959
|
+
function Q(e) {
|
|
12960
|
+
if (Ct.has(e.tag.toLowerCase())) return null;
|
|
12965
12961
|
let t = document.createElement(e.tag);
|
|
12966
12962
|
if (e.id && (t.id = e.id), e.slot && (t.slot = e.slot), e.attributes) for (let [n, r] of Object.entries(e.attributes)) t.setAttribute(n, r);
|
|
12967
12963
|
if (e.properties) for (let [n, r] of Object.entries(e.properties)) t[n] = r;
|
|
12968
12964
|
if (e.text && (t.textContent = e.text), e.children) for (let n of e.children) {
|
|
12969
|
-
let e =
|
|
12965
|
+
let e = Q(n);
|
|
12970
12966
|
e && t.appendChild(e);
|
|
12971
12967
|
}
|
|
12972
12968
|
return t;
|
|
@@ -12991,7 +12987,7 @@ function $(e) {
|
|
|
12991
12987
|
* @fires native:structured-submit - Fired on submit with selections
|
|
12992
12988
|
* @fires native:structured-cancel - Fired when dismissed without selecting
|
|
12993
12989
|
*/
|
|
12994
|
-
var
|
|
12990
|
+
var $ = class extends m {
|
|
12995
12991
|
static observedAttributes = [
|
|
12996
12992
|
"question",
|
|
12997
12993
|
"type",
|
|
@@ -13000,12 +12996,12 @@ var wt = class extends p {
|
|
|
13000
12996
|
"disabled"
|
|
13001
12997
|
];
|
|
13002
12998
|
#e;
|
|
13003
|
-
#t =
|
|
13004
|
-
#n =
|
|
13005
|
-
#r =
|
|
13006
|
-
#i =
|
|
13007
|
-
#a =
|
|
13008
|
-
#o =
|
|
12999
|
+
#t = S("");
|
|
13000
|
+
#n = S("single");
|
|
13001
|
+
#r = S([]);
|
|
13002
|
+
#i = S(!1);
|
|
13003
|
+
#a = S(!1);
|
|
13004
|
+
#o = S(/* @__PURE__ */ new Set());
|
|
13009
13005
|
constructor() {
|
|
13010
13006
|
super(), this.#e = this.attachInternals();
|
|
13011
13007
|
}
|
|
@@ -13058,7 +13054,7 @@ var wt = class extends p {
|
|
|
13058
13054
|
}
|
|
13059
13055
|
}
|
|
13060
13056
|
setup() {
|
|
13061
|
-
super.setup(), this.addEffect(
|
|
13057
|
+
super.setup(), this.addEffect(y(this, this.#a, this.#e)), this.addEffect(() => {
|
|
13062
13058
|
this.#t.value, this.#r.value, this.#n.value, this.#s();
|
|
13063
13059
|
}), this.addEffect(() => {
|
|
13064
13060
|
let e = this.#o.value, t = this.querySelectorAll("[data-value]");
|
|
@@ -13126,5 +13122,5 @@ var wt = class extends p {
|
|
|
13126
13122
|
}));
|
|
13127
13123
|
};
|
|
13128
13124
|
};
|
|
13129
|
-
y("n-chat-input", U), y("n-chat-input-advanced", He), y("native-chat-panel", rt), y("n-chat-feed", at), y("n-chat-avatar", ot), y("n-chat-message", ut), y("n-chat-messages", ft), y("n-chat-message-text", pt), y("n-chat-message-activity", _t), y("n-chat-message-seed", bt), y("n-chat-message-genui", St), y("n-chat-input-structured", wt), y("n-textarea", d), y("n-button", e), y("n-icon", r), y("n-toolbar", f), y("n-dialog", n), y("n-container", t), y("n-listbox", i), y("n-option", a), y("n-option-group", o), y("n-option-group-header", s), y("n-select", u), b("chat-dots", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z\"/></svg>"), b("user", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8C55.71,194.74,89.05,176,128,176s72.29,18.74,89.07,44a8,8,0,0,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z\"/></svg>"), b("stop", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z\"/></svg>"), b("arrow-counter-clockwise", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z\"/></svg>"), b("caret-up-down", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M181.66,170.34a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32,0l-48-48a8,8,0,0,1,11.32-11.32L128,212.69l42.34-42.35A8,8,0,0,1,181.66,170.34Zm-96-84.68L128,43.31l42.34,42.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,85.66Z\"/></svg>"), b("dots-three-outline-fill", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128ZM48,100a28,28,0,1,0,28,28A28,28,0,0,0,48,100Zm160,0a28,28,0,1,0,28,28A28,28,0,0,0,208,100Z\"/></svg>"), b("plus", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z\"/></svg>"), b("microphone", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z\"/></svg>"), b("arrow-up", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z\"/></svg>"), b("copy", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z\"/></svg>"), b("arrow-clockwise", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z\"/></svg>"), b("pencil-simple", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z\"/></svg>"), b("thumbs-up", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z\"/></svg>"), b("thumbs-down", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z\"/></svg>"), b("arrow-right", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z\"/></svg>"), b("brain", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z\"/></svg>"), b("sliders", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M64,105V40a8,8,0,0,0-16,0v65a32,32,0,0,0,0,62v49a8,8,0,0,0,16,0V167a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,56,152Zm80-95V40a8,8,0,0,0-16,0V57a32,32,0,0,0,0,62v97a8,8,0,0,0,16,0V119a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,128,104Zm104,64a32.06,32.06,0,0,0-24-31V40a8,8,0,0,0-16,0v97a32,32,0,0,0,0,62v17a8,8,0,0,0,16,0V199A32.06,32.06,0,0,0,232,168Zm-32,16a16,16,0,1,1,16-16A16,16,0,0,1,200,184Z\"/></svg>"), b("clock", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z\"/></svg>"), b("magnifying-glass", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z\"/></svg>"), b("compass", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z\"/></svg>"), b("flask", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M221.69,199.77,160,96.92V40h8a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16h8V96.92L34.31,199.77A16,16,0,0,0,48,224H208a16,16,0,0,0,13.72-24.23ZM110.86,103.25A7.93,7.93,0,0,0,112,99.14V40h32V99.14a7.93,7.93,0,0,0,1.14,4.11L183.36,167c-12,2.37-29.07,1.37-51.75-10.11-15.91-8.05-31.05-12.32-45.22-12.81ZM48,208l28.54-47.58c14.25-1.74,30.31,1.85,47.82,10.72,19,9.61,35,12.88,48,12.88a69.89,69.89,0,0,0,19.55-2.7L208,208Z\"/></svg>"), b("lightbulb", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z\"/></svg>"), b("crosshair", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M232,120h-8.34A96.14,96.14,0,0,0,136,32.34V24a8,8,0,0,0-16,0v8.34A96.14,96.14,0,0,0,32.34,120H24a8,8,0,0,0,0,16h8.34A96.14,96.14,0,0,0,120,223.66V232a8,8,0,0,0,16,0v-8.34A96.14,96.14,0,0,0,223.66,136H232a8,8,0,0,0,0-16Zm-96,87.6V200a8,8,0,0,0-16,0v7.6A80.15,80.15,0,0,1,48.4,136H56a8,8,0,0,0,0-16H48.4A80.15,80.15,0,0,1,120,48.4V56a8,8,0,0,0,16,0V48.4A80.15,80.15,0,0,1,207.6,120H200a8,8,0,0,0,0,16h7.6A80.15,80.15,0,0,1,136,207.6ZM128,88a40,40,0,1,0,40,40A40,40,0,0,0,128,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,152Z\"/></svg>"), b("list-checks", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a8,8,0,0,1-8,8H128a8,8,0,0,1,0-16h88A8,8,0,0,1,224,128ZM128,72h88a8,8,0,0,0,0-16H128a8,8,0,0,0,0,16Zm88,112H128a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16ZM82.34,42.34,56,68.69,45.66,58.34A8,8,0,0,0,34.34,69.66l16,16a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,82.34,42.34Zm0,64L56,132.69,45.66,122.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm0,64L56,196.69,45.66,186.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z\"/></svg>"), b("sparkle", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z\"/></svg>"), b("record", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm0-160a72,72,0,1,0,72,72A72.08,72.08,0,0,0,128,56Zm0,128a56,56,0,1,1,56-56A56.06,56.06,0,0,1,128,184Z\"/></svg>");
|
|
13130
|
-
export {
|
|
13125
|
+
b("n-chat-input", W), b("n-agent-input", He), b("native-chat-panel", at), b("n-chat-feed", st), b("n-chat-avatar", ct), b("n-agent-dialogue-item", ft), b("n-agent-dialogue", mt), b("n-chat-message-text", ht), b("n-chat-message-activity", yt), b("n-chat-message-seed", St), b("n-chat-message-genui", wt), b("n-chat-input-structured", $), b("n-textarea", f), b("n-button", e), b("n-icon", r), b("n-toolbar", p), b("n-dialog", n), b("n-container", t), b("n-listbox", i), b("n-option", a), b("n-option-group", o), b("n-option-group-header", s), b("n-select", d), x("chat-dots", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z\"/></svg>"), x("user", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8C55.71,194.74,89.05,176,128,176s72.29,18.74,89.07,44a8,8,0,0,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z\"/></svg>"), x("stop", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z\"/></svg>"), x("arrow-counter-clockwise", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z\"/></svg>"), x("caret-up-down", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M181.66,170.34a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32,0l-48-48a8,8,0,0,1,11.32-11.32L128,212.69l42.34-42.35A8,8,0,0,1,181.66,170.34Zm-96-84.68L128,43.31l42.34,42.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,85.66Z\"/></svg>"), x("dots-three-outline-fill", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128ZM48,100a28,28,0,1,0,28,28A28,28,0,0,0,48,100Zm160,0a28,28,0,1,0,28,28A28,28,0,0,0,208,100Z\"/></svg>"), x("plus", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z\"/></svg>"), x("microphone", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z\"/></svg>"), x("arrow-up", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z\"/></svg>"), x("copy", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z\"/></svg>"), x("arrow-clockwise", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z\"/></svg>"), x("pencil-simple", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z\"/></svg>"), x("thumbs-up", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M234,80.12A24,24,0,0,0,216,72H160V56a40,40,0,0,0-40-40,8,8,0,0,0-7.16,4.42L75.06,96H32a16,16,0,0,0-16,16v88a16,16,0,0,0,16,16H204a24,24,0,0,0,23.82-21l12-96A24,24,0,0,0,234,80.12ZM32,112H72v88H32ZM223.94,97l-12,96a8,8,0,0,1-7.94,7H88V105.89l36.71-73.43A24,24,0,0,1,144,56V80a8,8,0,0,0,8,8h64a8,8,0,0,1,7.94,9Z\"/></svg>"), x("thumbs-down", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M239.82,157l-12-96A24,24,0,0,0,204,40H32A16,16,0,0,0,16,56v88a16,16,0,0,0,16,16H75.06l37.78,75.58A8,8,0,0,0,120,240a40,40,0,0,0,40-40V184h56a24,24,0,0,0,23.82-27ZM72,144H32V56H72Zm150,21.29a7.88,7.88,0,0,1-6,2.71H152a8,8,0,0,0-8,8v24a24,24,0,0,1-19.29,23.54L88,150.11V56H204a8,8,0,0,1,7.94,7l12,96A7.87,7.87,0,0,1,222,165.29Z\"/></svg>"), x("arrow-right", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z\"/></svg>"), x("brain", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M248,124a56.11,56.11,0,0,0-32-50.61V72a48,48,0,0,0-88-26.49A48,48,0,0,0,40,72v1.39a56,56,0,0,0,0,101.2V176a48,48,0,0,0,88,26.49A48,48,0,0,0,216,176v-1.41A56.09,56.09,0,0,0,248,124ZM88,208a32,32,0,0,1-31.81-28.56A55.87,55.87,0,0,0,64,180h8a8,8,0,0,0,0-16H64A40,40,0,0,1,50.67,86.27,8,8,0,0,0,56,78.73V72a32,32,0,0,1,64,0v68.26A47.8,47.8,0,0,0,88,128a8,8,0,0,0,0,16,32,32,0,0,1,0,64Zm104-44h-8a8,8,0,0,0,0,16h8a55.87,55.87,0,0,0,7.81-.56A32,32,0,1,1,168,144a8,8,0,0,0,0-16,47.8,47.8,0,0,0-32,12.26V72a32,32,0,0,1,64,0v6.73a8,8,0,0,0,5.33,7.54A40,40,0,0,1,192,164Zm16-52a8,8,0,0,1-8,8h-4a36,36,0,0,1-36-36V80a8,8,0,0,1,16,0v4a20,20,0,0,0,20,20h4A8,8,0,0,1,208,112ZM60,120H56a8,8,0,0,1,0-16h4A20,20,0,0,0,80,84V80a8,8,0,0,1,16,0v4A36,36,0,0,1,60,120Z\"/></svg>"), x("sliders", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M64,105V40a8,8,0,0,0-16,0v65a32,32,0,0,0,0,62v49a8,8,0,0,0,16,0V167a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,56,152Zm80-95V40a8,8,0,0,0-16,0V57a32,32,0,0,0,0,62v97a8,8,0,0,0,16,0V119a32,32,0,0,0,0-62Zm-8,47a16,16,0,1,1,16-16A16,16,0,0,1,128,104Zm104,64a32.06,32.06,0,0,0-24-31V40a8,8,0,0,0-16,0v97a32,32,0,0,0,0,62v17a8,8,0,0,0,16,0V199A32.06,32.06,0,0,0,232,168Zm-32,16a16,16,0,1,1,16-16A16,16,0,0,1,200,184Z\"/></svg>"), x("clock", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z\"/></svg>"), x("magnifying-glass", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z\"/></svg>"), x("compass", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z\"/></svg>"), x("flask", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M221.69,199.77,160,96.92V40h8a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16h8V96.92L34.31,199.77A16,16,0,0,0,48,224H208a16,16,0,0,0,13.72-24.23ZM110.86,103.25A7.93,7.93,0,0,0,112,99.14V40h32V99.14a7.93,7.93,0,0,0,1.14,4.11L183.36,167c-12,2.37-29.07,1.37-51.75-10.11-15.91-8.05-31.05-12.32-45.22-12.81ZM48,208l28.54-47.58c14.25-1.74,30.31,1.85,47.82,10.72,19,9.61,35,12.88,48,12.88a69.89,69.89,0,0,0,19.55-2.7L208,208Z\"/></svg>"), x("lightbulb", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z\"/></svg>"), x("crosshair", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M232,120h-8.34A96.14,96.14,0,0,0,136,32.34V24a8,8,0,0,0-16,0v8.34A96.14,96.14,0,0,0,32.34,120H24a8,8,0,0,0,0,16h8.34A96.14,96.14,0,0,0,120,223.66V232a8,8,0,0,0,16,0v-8.34A96.14,96.14,0,0,0,223.66,136H232a8,8,0,0,0,0-16Zm-96,87.6V200a8,8,0,0,0-16,0v7.6A80.15,80.15,0,0,1,48.4,136H56a8,8,0,0,0,0-16H48.4A80.15,80.15,0,0,1,120,48.4V56a8,8,0,0,0,16,0V48.4A80.15,80.15,0,0,1,207.6,120H200a8,8,0,0,0,0,16h7.6A80.15,80.15,0,0,1,136,207.6ZM128,88a40,40,0,1,0,40,40A40,40,0,0,0,128,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,152Z\"/></svg>"), x("list-checks", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M224,128a8,8,0,0,1-8,8H128a8,8,0,0,1,0-16h88A8,8,0,0,1,224,128ZM128,72h88a8,8,0,0,0,0-16H128a8,8,0,0,0,0,16Zm88,112H128a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16ZM82.34,42.34,56,68.69,45.66,58.34A8,8,0,0,0,34.34,69.66l16,16a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,82.34,42.34Zm0,64L56,132.69,45.66,122.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Zm0,64L56,196.69,45.66,186.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z\"/></svg>"), x("sparkle", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z\"/></svg>"), x("record", "<svg viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm0-160a72,72,0,1,0,72,72A72.08,72.08,0,0,0,128,56Zm0,128a56,56,0,1,1,56-56A56.06,56.06,0,0,1,128,184Z\"/></svg>");
|
|
13126
|
+
export { Be as NA2UI, mt as NAgentDialogue, ft as NAgentDialogueItem, ct as NChatAvatar, st as NChatFeed, W as NChatInput, $ as NChatInputStructured, yt as NChatMessageActivity, wt as NChatMessageGenUI, St as NChatMessageSeed, ht as NChatMessageText, at as NChatPanel };
|