artifactuse 0.1.25 → 0.1.28

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/vue/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as N, createElementVNode as e, toDisplayString as n, withModifiers as he, onMounted as we, watch as fe, Fragment as R, createCommentVNode as d, renderList as ue, createTextVNode as K, h as le, normalizeStyle as $e, createStaticVNode as Pt, createBlock as ke, resolveDynamicComponent as Bt, nextTick as ge, onUnmounted as Oe, Teleport as Et, createVNode as Ae, Transition as Me, withCtx as Le, withKeys as St, onBeforeUnmount as zt, unref as y, withDirectives as Qe, vShow as Ge, reactive as et, provide as It, inject as Ft } from "vue";
2
- import { g as Te, f as tt, a as Re, b as qe, n as Vt, i as Rt, D as qt, c as at } from "../index-Bzk5VnG1.js";
3
- import { J as Ot } from "../jszip.min-CdmYyw5L.js";
4
- const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class: "artifactuse-card__content" }, Nt = { class: "artifactuse-card__title" }, Jt = { class: "artifactuse-card__meta" }, Xt = { class: "artifactuse-card__type" }, Zt = { class: "artifactuse-card__size" }, Wt = { class: "artifactuse-card__actions" }, Kt = ["title"], Yt = {
1
+ import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as J, createElementVNode as e, toDisplayString as o, withModifiers as ye, onMounted as xe, watch as pe, Fragment as F, createCommentVNode as d, renderList as de, createTextVNode as G, h as le, normalizeStyle as Ae, createStaticVNode as Bt, createBlock as be, resolveDynamicComponent as Et, nextTick as Ce, onUnmounted as De, Teleport as zt, createVNode as Be, Transition as Pe, withCtx as He, withKeys as It, onBeforeUnmount as Ft, unref as k, withDirectives as et, vShow as tt, reactive as st, provide as Vt, inject as Rt } from "vue";
2
+ import { g as Se, f as it, a as Oe, b as Ue, n as qt, i as at, c as Ot, D as Ut, d as lt } from "../index-D56xsAnF.js";
3
+ import { J as Dt } from "../jszip.min-CdmYyw5L.js";
4
+ const jt = { class: "artifactuse-card__icon" }, Nt = ["innerHTML"], Jt = { class: "artifactuse-card__content" }, Xt = { class: "artifactuse-card__title" }, Zt = { class: "artifactuse-card__meta" }, Wt = { class: "artifactuse-card__type" }, Kt = { class: "artifactuse-card__size" }, Yt = { class: "artifactuse-card__actions" }, Qt = ["title"], Gt = {
5
5
  key: 0,
6
6
  viewBox: "0 0 24 24",
7
7
  fill: "none",
8
8
  stroke: "currentColor",
9
9
  "stroke-width": "2"
10
- }, Qt = {
10
+ }, ea = {
11
11
  key: 1,
12
12
  viewBox: "0 0 24 24",
13
13
  fill: "none",
14
14
  stroke: "currentColor",
15
15
  "stroke-width": "2"
16
- }, Gt = {
16
+ }, ta = {
17
17
  __name: "ArtifactuseCard",
18
18
  props: {
19
19
  artifact: {
@@ -26,58 +26,58 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
26
26
  }
27
27
  },
28
28
  emits: ["open", "copy", "download"],
29
- setup(H, { emit: u }) {
30
- const h = H, k = u, l = M(!1), U = b(() => Te(h.artifact.language)), S = b(() => {
31
- var C;
32
- return tt(h.artifact.size || ((C = h.artifact.code) == null ? void 0 : C.length) || 0);
33
- }), A = b(() => Re(h.artifact.language));
34
- function g(C) {
35
- C.stopPropagation(), k("open", h.artifact);
36
- }
37
- async function o() {
29
+ setup(A, { emit: u }) {
30
+ const h = A, m = u, l = M(!1), U = b(() => Se(h.artifact.language)), E = b(() => {
31
+ var x;
32
+ return it(h.artifact.size || ((x = h.artifact.code) == null ? void 0 : x.length) || 0);
33
+ }), L = b(() => Oe(h.artifact.language));
34
+ function w(x) {
35
+ x.stopPropagation(), m("open", h.artifact);
36
+ }
37
+ async function n() {
38
38
  try {
39
39
  await navigator.clipboard.writeText(h.artifact.code), l.value = !0, setTimeout(() => {
40
40
  l.value = !1;
41
- }, 2e3), k("copy", h.artifact);
42
- } catch (C) {
43
- console.error("Failed to copy:", C);
41
+ }, 2e3), m("copy", h.artifact);
42
+ } catch (x) {
43
+ console.error("Failed to copy:", x);
44
44
  }
45
45
  }
46
- function m() {
47
- var F;
48
- const C = new Blob([h.artifact.code], { type: "text/plain" }), $ = URL.createObjectURL(C), q = document.createElement("a"), O = qe(h.artifact.language), J = ((F = h.artifact.title) == null ? void 0 : F.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
- q.href = $, q.download = `${J}.${O}`, document.body.appendChild(q), q.click(), document.body.removeChild(q), URL.revokeObjectURL($), k("download", h.artifact);
46
+ function y() {
47
+ var I;
48
+ const x = new Blob([h.artifact.code], { type: "text/plain" }), $ = URL.createObjectURL(x), V = document.createElement("a"), R = Ue(h.artifact.language), X = ((I = h.artifact.title) == null ? void 0 : I.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
+ V.href = $, V.download = `${X}.${R}`, document.body.appendChild(V), V.click(), document.body.removeChild(V), URL.revokeObjectURL($), m("download", h.artifact);
50
50
  }
51
- return (C, $) => (a(), s("div", {
52
- class: N(["artifactuse-card", { "artifactuse-card--active": H.isActive }]),
53
- onClick: g
51
+ return (x, $) => (a(), s("div", {
52
+ class: J(["artifactuse-card", { "artifactuse-card--active": A.isActive }]),
53
+ onClick: w
54
54
  }, [
55
- e("div", Ut, [
55
+ e("div", jt, [
56
56
  (a(), s("svg", {
57
57
  viewBox: "0 0 24 24",
58
58
  fill: "none",
59
59
  stroke: "currentColor",
60
60
  "stroke-width": "1.5",
61
- innerHTML: A.value
62
- }, null, 8, Dt))
61
+ innerHTML: L.value
62
+ }, null, 8, Nt))
63
63
  ]),
64
- e("div", jt, [
65
- e("div", Nt, n(H.artifact.title), 1),
66
- e("div", Jt, [
67
- e("span", Xt, n(U.value), 1),
64
+ e("div", Jt, [
65
+ e("div", Xt, o(A.artifact.title), 1),
66
+ e("div", Zt, [
67
+ e("span", Wt, o(U.value), 1),
68
68
  $[0] || ($[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
69
- e("span", Zt, n(S.value), 1)
69
+ e("span", Kt, o(E.value), 1)
70
70
  ])
71
71
  ]),
72
- e("div", Wt, [
72
+ e("div", Yt, [
73
73
  e("button", {
74
74
  class: "artifactuse-card__action",
75
- onClick: he(o, ["stop"]),
75
+ onClick: ye(n, ["stop"]),
76
76
  title: l.value ? "Copied!" : "Copy code"
77
77
  }, [
78
- l.value ? (a(), s("svg", Qt, [...$[2] || ($[2] = [
78
+ l.value ? (a(), s("svg", ea, [...$[2] || ($[2] = [
79
79
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
80
- ])])) : (a(), s("svg", Yt, [...$[1] || ($[1] = [
80
+ ])])) : (a(), s("svg", Gt, [...$[1] || ($[1] = [
81
81
  e("rect", {
82
82
  x: "9",
83
83
  y: "9",
@@ -88,10 +88,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
88
88
  }, null, -1),
89
89
  e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
90
90
  ])]))
91
- ], 8, Kt),
91
+ ], 8, Qt),
92
92
  e("button", {
93
93
  class: "artifactuse-card__action",
94
- onClick: he(m, ["stop"]),
94
+ onClick: ye(y, ["stop"]),
95
95
  title: "Download file"
96
96
  }, [...$[3] || ($[3] = [
97
97
  e("svg", {
@@ -123,10 +123,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
123
123
  ], -1))
124
124
  ], 2));
125
125
  }
126
- }, ea = ["data-artifactuse-theme"], ta = {
126
+ }, aa = ["data-artifactuse-theme"], sa = {
127
127
  key: 0,
128
128
  class: "artifactuse-form-collapsed"
129
- }, aa = { class: "artifactuse-form-collapsed-icon" }, sa = {
129
+ }, ia = { class: "artifactuse-form-collapsed-icon" }, la = {
130
130
  key: 0,
131
131
  viewBox: "0 0 24 24",
132
132
  fill: "none",
@@ -134,7 +134,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
134
134
  "stroke-width": "2.5",
135
135
  "stroke-linecap": "round",
136
136
  "stroke-linejoin": "round"
137
- }, ia = {
137
+ }, na = {
138
138
  key: 1,
139
139
  viewBox: "0 0 24 24",
140
140
  fill: "none",
@@ -142,7 +142,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
142
142
  "stroke-width": "2.5",
143
143
  "stroke-linecap": "round",
144
144
  "stroke-linejoin": "round"
145
- }, la = {
145
+ }, oa = {
146
146
  key: 2,
147
147
  viewBox: "0 0 24 24",
148
148
  fill: "none",
@@ -150,64 +150,64 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
150
150
  "stroke-width": "2.5",
151
151
  "stroke-linecap": "round",
152
152
  "stroke-linejoin": "round"
153
- }, na = { class: "artifactuse-form-collapsed-title" }, oa = {
153
+ }, ra = { class: "artifactuse-form-collapsed-title" }, ca = {
154
154
  key: 0,
155
155
  class: "artifactuse-form-header"
156
- }, ra = {
156
+ }, ua = {
157
157
  key: 0,
158
158
  class: "artifactuse-form-title"
159
- }, ca = {
159
+ }, da = {
160
160
  key: 1,
161
161
  class: "artifactuse-form-description"
162
- }, ua = {
162
+ }, va = {
163
163
  key: 1,
164
164
  class: "artifactuse-form-buttons"
165
- }, da = ["disabled", "onClick"], va = ["innerHTML"], fa = { class: "artifactuse-form-fields" }, pa = {
165
+ }, fa = ["disabled", "onClick"], pa = ["innerHTML"], _a = { class: "artifactuse-form-fields" }, ha = {
166
166
  key: 0,
167
167
  class: "artifactuse-form-buttons"
168
- }, _a = ["type", "disabled", "onClick"], ha = {
168
+ }, ma = ["type", "disabled", "onClick"], ya = {
169
169
  key: 0,
170
170
  class: "artifactuse-form-btn-spinner"
171
- }, ma = ["innerHTML"], ya = {
171
+ }, ga = ["innerHTML"], ka = {
172
172
  key: 1,
173
173
  class: "artifactuse-form-divider"
174
- }, ga = {
174
+ }, wa = {
175
175
  key: 2,
176
176
  class: "artifactuse-form-heading"
177
- }, ka = {
177
+ }, Ca = {
178
178
  key: 3,
179
179
  class: "artifactuse-form-field"
180
- }, wa = { class: "artifactuse-checkbox-label" }, Ca = ["checked", "disabled", "onChange"], ba = { class: "artifactuse-checkbox-text" }, xa = {
180
+ }, ba = { class: "artifactuse-checkbox-label" }, xa = ["checked", "disabled", "onChange"], $a = { class: "artifactuse-checkbox-text" }, Ma = {
181
181
  key: 0,
182
182
  class: "artifactuse-required"
183
- }, $a = {
183
+ }, La = {
184
184
  key: 0,
185
185
  class: "artifactuse-help-text"
186
- }, Ma = {
186
+ }, Ta = {
187
187
  key: 1,
188
188
  class: "artifactuse-error-text"
189
- }, La = {
189
+ }, Aa = {
190
190
  key: 4,
191
191
  class: "artifactuse-form-field"
192
- }, Ta = ["for"], Aa = {
192
+ }, Pa = ["for"], Ha = {
193
193
  key: 0,
194
194
  class: "artifactuse-required"
195
- }, Ha = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], Pa = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Ba = ["id", "value", "disabled", "required", "onChange"], Ea = { value: "" }, Sa = ["value", "disabled"], za = {
195
+ }, Sa = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], Ba = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], Ea = ["id", "value", "disabled", "required", "onChange"], za = { value: "" }, Ia = ["value", "disabled"], Fa = {
196
196
  key: 3,
197
197
  class: "artifactuse-radio-group"
198
- }, Ia = ["name", "value", "checked", "disabled", "onChange"], Fa = {
198
+ }, Va = ["name", "value", "checked", "disabled", "onChange"], Ra = {
199
199
  key: 4,
200
200
  class: "artifactuse-help-text"
201
- }, Va = {
201
+ }, qa = {
202
202
  key: 5,
203
203
  class: "artifactuse-error-text"
204
- }, Ra = {
204
+ }, Oa = {
205
205
  key: 0,
206
206
  class: "artifactuse-form-buttons artifactuse-form-buttons-default"
207
- }, qa = ["disabled"], Oa = {
207
+ }, Ua = ["disabled"], Da = {
208
208
  key: 0,
209
209
  class: "artifactuse-form-btn-spinner"
210
- }, Ua = {
210
+ }, ja = {
211
211
  __name: "ArtifactuseInlineForm",
212
212
  props: {
213
213
  artifact: { type: Object, required: !0 },
@@ -216,172 +216,172 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
216
216
  initialState: {
217
217
  type: String,
218
218
  default: "active",
219
- validator: (H) => ["active", "submitted", "cancelled", "inactive"].includes(H)
219
+ validator: (A) => ["active", "submitted", "cancelled", "inactive"].includes(A)
220
220
  }
221
221
  },
222
222
  emits: ["submit", "cancel", "reset", "button-click"],
223
- setup(H, { emit: u }) {
224
- const h = H, k = u, l = M(h.initialState), U = b(() => l.value !== "active"), S = b(() => l.value === "active" ? "" : `artifactuse-form--${l.value}`);
225
- function A(_) {
226
- l.value = _;
223
+ setup(A, { emit: u }) {
224
+ const h = A, m = u, l = M(h.initialState), U = b(() => l.value !== "active"), E = b(() => l.value === "active" ? "" : `artifactuse-form--${l.value}`);
225
+ function L(p) {
226
+ l.value = p;
227
227
  }
228
- const g = b(() => {
228
+ const w = b(() => {
229
229
  try {
230
230
  return JSON.parse(h.artifact.code);
231
231
  } catch {
232
232
  return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
233
233
  }
234
- }), o = M(null), m = b(() => h.artifact.id || g.value.id || `form-${Date.now()}`), C = b(() => `artifactuse-form-${g.value.variant || "fields"}`), $ = b(() => g.value.title || "Form"), q = M({}), O = M({}), J = M(!1), F = b(() => {
235
- var _;
236
- return ((_ = g.value.data) == null ? void 0 : _.fields) || [];
237
- }), ee = b(() => {
238
- var _;
239
- return g.value.variant === "buttons" ? ((_ = g.value.data) == null ? void 0 : _.fields) || [] : [];
240
- }), I = b(() => F.value.some((_) => _.type === "buttons"));
241
- function te(_) {
242
- if (!_) return null;
243
- const T = _.trim();
234
+ }), n = M(null), y = b(() => h.artifact.id || w.value.id || `form-${Date.now()}`), x = b(() => `artifactuse-form-${w.value.variant || "fields"}`), $ = b(() => w.value.title || "Form"), V = M({}), R = M({}), X = M(!1), I = b(() => {
235
+ var p;
236
+ return ((p = w.value.data) == null ? void 0 : p.fields) || [];
237
+ }), te = b(() => {
238
+ var p;
239
+ return w.value.variant === "buttons" ? ((p = w.value.data) == null ? void 0 : p.fields) || [] : [];
240
+ }), z = b(() => I.value.some((p) => p.type === "buttons"));
241
+ function ae(p) {
242
+ if (!p) return null;
243
+ const T = p.trim();
244
244
  if (T.startsWith("#")) {
245
245
  let c = T.slice(1);
246
- if (c.length === 3 && (c = c.split("").map((P) => P + P).join("")), c.length === 6) {
247
- const P = parseInt(c.slice(0, 2), 16), ne = parseInt(c.slice(2, 4), 16), ce = parseInt(c.slice(4, 6), 16);
248
- if (!isNaN(P) && !isNaN(ne) && !isNaN(ce)) return `${P}, ${ne}, ${ce}`;
246
+ if (c.length === 3 && (c = c.split("").map((S) => S + S).join("")), c.length === 6) {
247
+ const S = parseInt(c.slice(0, 2), 16), ne = parseInt(c.slice(2, 4), 16), ue = parseInt(c.slice(4, 6), 16);
248
+ if (!isNaN(S) && !isNaN(ne) && !isNaN(ue)) return `${S}, ${ne}, ${ue}`;
249
249
  }
250
250
  }
251
251
  const r = T.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
252
252
  if (r) return `${r[1]}, ${r[2]}, ${r[3]}`;
253
- const E = T.split(/[\s,]+/).map(Number).filter((c) => !isNaN(c));
254
- return E.length >= 3 ? `${E[0]}, ${E[1]}, ${E[2]}` : null;
253
+ const B = T.split(/[\s,]+/).map(Number).filter((c) => !isNaN(c));
254
+ return B.length >= 3 ? `${B[0]}, ${B[1]}, ${B[2]}` : null;
255
255
  }
256
- function X() {
257
- if (o.value && h.accent) {
258
- const _ = te(h.accent);
259
- _ && o.value.style.setProperty("--artifactuse-primary", _);
256
+ function Z() {
257
+ if (n.value && h.accent) {
258
+ const p = ae(h.accent);
259
+ p && n.value.style.setProperty("--artifactuse-primary", p);
260
260
  }
261
261
  }
262
- we(() => {
263
- X(), l.value = h.initialState;
264
- }), fe(() => h.accent, X), fe(() => h.initialState, (_) => {
265
- l.value = _;
262
+ xe(() => {
263
+ Z(), l.value = h.initialState;
264
+ }), pe(() => h.accent, Z), pe(() => h.initialState, (p) => {
265
+ l.value = p;
266
266
  });
267
- function Z() {
267
+ function W() {
268
268
  var r;
269
- const _ = {};
270
- F.value.forEach((E) => {
271
- ["buttons", "divider", "heading"].includes(E.type) || (E.defaultValue !== void 0 ? _[E.name] = E.defaultValue : E.type === "checkbox" ? _[E.name] = !1 : _[E.name] = "");
272
- }), (r = g.value.data) != null && r.defaults && Object.assign(_, g.value.data.defaults), q.value = _;
269
+ const p = {};
270
+ I.value.forEach((B) => {
271
+ ["buttons", "divider", "heading"].includes(B.type) || (B.defaultValue !== void 0 ? p[B.name] = B.defaultValue : B.type === "checkbox" ? p[B.name] = !1 : p[B.name] = "");
272
+ }), (r = w.value.data) != null && r.defaults && Object.assign(p, w.value.data.defaults), V.value = p;
273
273
  }
274
- Z(), fe(() => h.artifact.code, Z);
275
- function oe(_) {
276
- return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(_);
274
+ W(), pe(() => h.artifact.code, W);
275
+ function ve(p) {
276
+ return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(p);
277
277
  }
278
- function f(_) {
279
- return _ ? _.map((T) => typeof T == "string" ? { label: T, value: T } : T) : [];
278
+ function f(p) {
279
+ return p ? p.map((T) => typeof T == "string" ? { label: T, value: T } : T) : [];
280
280
  }
281
- function p(_, T) {
282
- q.value[_] = T, O.value[_] && delete O.value[_];
281
+ function _(p, T) {
282
+ V.value[p] = T, R.value[p] && delete R.value[p];
283
283
  }
284
- function ae() {
285
- var E;
286
- const _ = {};
287
- F.value.forEach((c) => {
284
+ function ie() {
285
+ var B;
286
+ const p = {};
287
+ I.value.forEach((c) => {
288
288
  if (["buttons", "divider", "heading"].includes(c.type)) return;
289
- const P = q.value[c.name];
290
- if (c.required && !P && P !== 0 && P !== !1) {
291
- _[c.name] = `${c.label || "This field"} is required`;
289
+ const S = V.value[c.name];
290
+ if (c.required && !S && S !== 0 && S !== !1) {
291
+ p[c.name] = `${c.label || "This field"} is required`;
292
292
  return;
293
293
  }
294
- if (c.pattern && P && !new RegExp(c.pattern).test(P)) {
295
- _[c.name] = c.patternMessage || `${c.label || "This field"} is invalid`;
294
+ if (c.pattern && S && !new RegExp(c.pattern).test(S)) {
295
+ p[c.name] = c.patternMessage || `${c.label || "This field"} is invalid`;
296
296
  return;
297
297
  }
298
- if (c.type === "email" && P && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(P)) {
299
- _[c.name] = "Please enter a valid email address";
298
+ if (c.type === "email" && S && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(S)) {
299
+ p[c.name] = "Please enter a valid email address";
300
300
  return;
301
301
  }
302
- if (c.minLength && P && P.length < c.minLength) {
303
- _[c.name] = `Minimum ${c.minLength} characters required`;
302
+ if (c.minLength && S && S.length < c.minLength) {
303
+ p[c.name] = `Minimum ${c.minLength} characters required`;
304
304
  return;
305
305
  }
306
- if (c.maxLength && P && P.length > c.maxLength) {
307
- _[c.name] = `Maximum ${c.maxLength} characters allowed`;
306
+ if (c.maxLength && S && S.length > c.maxLength) {
307
+ p[c.name] = `Maximum ${c.maxLength} characters allowed`;
308
308
  return;
309
309
  }
310
310
  });
311
- const r = (E = g.value.data) == null ? void 0 : E.validation;
312
- return r && Object.entries(r).forEach(([c, P]) => {
313
- if (_[c]) return;
314
- const ne = q.value[c];
315
- P.pattern && ne && (new RegExp(P.pattern).test(ne) || (_[c] = P.message || `${c} is invalid`));
316
- }), O.value = _, Object.keys(_).length === 0;
317
- }
318
- function L() {
319
- Z(), O.value = {};
320
- }
321
- function Y() {
322
- ae() && (J.value = !0, k("submit", {
323
- formId: m.value,
311
+ const r = (B = w.value.data) == null ? void 0 : B.validation;
312
+ return r && Object.entries(r).forEach(([c, S]) => {
313
+ if (p[c]) return;
314
+ const ne = V.value[c];
315
+ S.pattern && ne && (new RegExp(S.pattern).test(ne) || (p[c] = S.message || `${c} is invalid`));
316
+ }), R.value = p, Object.keys(p).length === 0;
317
+ }
318
+ function H() {
319
+ W(), R.value = {};
320
+ }
321
+ function K() {
322
+ ie() && (X.value = !0, m("submit", {
323
+ formId: y.value,
324
324
  action: "submit",
325
- values: { ...q.value },
325
+ values: { ...V.value },
326
326
  timestamp: Date.now()
327
327
  }), setTimeout(() => {
328
- J.value = !1, A("submitted");
328
+ X.value = !1, L("submitted");
329
329
  }, 300));
330
330
  }
331
- function Q(_) {
332
- const T = _.action || "custom";
331
+ function ee(p) {
332
+ const T = p.action || "custom";
333
333
  switch (T) {
334
334
  case "submit":
335
- Y();
335
+ K();
336
336
  break;
337
337
  case "cancel":
338
- k("cancel", {
339
- formId: m.value,
338
+ m("cancel", {
339
+ formId: y.value,
340
340
  action: "cancel",
341
- buttonName: _.name || "cancel",
341
+ buttonName: p.name || "cancel",
342
342
  timestamp: Date.now()
343
343
  }), setTimeout(() => {
344
- A("cancelled");
344
+ L("cancelled");
345
345
  }, 150);
346
346
  break;
347
347
  case "reset":
348
- L(), k("reset", {
349
- formId: m.value,
348
+ H(), m("reset", {
349
+ formId: y.value,
350
350
  action: "reset",
351
- buttonName: _.name || "reset",
351
+ buttonName: p.name || "reset",
352
352
  timestamp: Date.now()
353
353
  });
354
354
  break;
355
355
  case "custom":
356
356
  default:
357
- k("button-click", {
358
- formId: m.value,
357
+ m("button-click", {
358
+ formId: y.value,
359
359
  action: T,
360
- buttonName: _.name || _.label,
361
- buttonLabel: _.label,
362
- values: { ...q.value },
360
+ buttonName: p.name || p.label,
361
+ buttonLabel: p.label,
362
+ values: { ...V.value },
363
363
  timestamp: Date.now()
364
364
  }), setTimeout(() => {
365
- A("submitted");
365
+ L("submitted");
366
366
  }, 150);
367
367
  break;
368
368
  }
369
369
  }
370
- return (_, T) => (a(), s("div", {
370
+ return (p, T) => (a(), s("div", {
371
371
  ref_key: "containerRef",
372
- ref: o,
373
- class: N([
372
+ ref: n,
373
+ class: J([
374
374
  "artifactuse-inline-form",
375
- C.value,
376
- S.value
375
+ x.value,
376
+ E.value
377
377
  ]),
378
- "data-artifactuse-theme": H.theme
378
+ "data-artifactuse-theme": A.theme
379
379
  }, [
380
- U.value ? (a(), s("div", ta, [
381
- e("div", aa, [
382
- l.value === "submitted" ? (a(), s("svg", sa, [...T[1] || (T[1] = [
380
+ U.value ? (a(), s("div", sa, [
381
+ e("div", ia, [
382
+ l.value === "submitted" ? (a(), s("svg", la, [...T[1] || (T[1] = [
383
383
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
384
- ])])) : l.value === "cancelled" ? (a(), s("svg", ia, [...T[2] || (T[2] = [
384
+ ])])) : l.value === "cancelled" ? (a(), s("svg", na, [...T[2] || (T[2] = [
385
385
  e("line", {
386
386
  x1: "18",
387
387
  y1: "6",
@@ -394,7 +394,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
394
394
  x2: "18",
395
395
  y2: "18"
396
396
  }, null, -1)
397
- ])])) : (a(), s("svg", la, [...T[3] || (T[3] = [
397
+ ])])) : (a(), s("svg", oa, [...T[3] || (T[3] = [
398
398
  e("line", {
399
399
  x1: "5",
400
400
  y1: "12",
@@ -403,112 +403,112 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
403
403
  }, null, -1)
404
404
  ])]))
405
405
  ]),
406
- e("span", na, n($.value), 1)
407
- ])) : (a(), s(R, { key: 1 }, [
408
- g.value.title || g.value.description ? (a(), s("div", oa, [
409
- g.value.title ? (a(), s("div", ra, n(g.value.title), 1)) : d("", !0),
410
- g.value.description ? (a(), s("p", ca, n(g.value.description), 1)) : d("", !0)
406
+ e("span", ra, o($.value), 1)
407
+ ])) : (a(), s(F, { key: 1 }, [
408
+ w.value.title || w.value.description ? (a(), s("div", ca, [
409
+ w.value.title ? (a(), s("div", ua, o(w.value.title), 1)) : d("", !0),
410
+ w.value.description ? (a(), s("p", da, o(w.value.description), 1)) : d("", !0)
411
411
  ])) : d("", !0),
412
- g.value.variant === "buttons" ? (a(), s("div", ua, [
413
- (a(!0), s(R, null, ue(ee.value, (r) => (a(), s("button", {
412
+ w.value.variant === "buttons" ? (a(), s("div", va, [
413
+ (a(!0), s(F, null, de(te.value, (r) => (a(), s("button", {
414
414
  key: r.name || r.label,
415
415
  type: "button",
416
- class: N(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
417
- disabled: r.disabled || J.value,
418
- onClick: (E) => Q(r)
416
+ class: J(["artifactuse-form-btn", `artifactuse-form-btn-${r.variant || "secondary"}`]),
417
+ disabled: r.disabled || X.value,
418
+ onClick: (B) => ee(r)
419
419
  }, [
420
420
  r.icon ? (a(), s("span", {
421
421
  key: 0,
422
422
  class: "artifactuse-form-btn-icon",
423
423
  innerHTML: r.icon
424
- }, null, 8, va)) : d("", !0),
425
- K(" " + n(r.label), 1)
426
- ], 10, da))), 128))
424
+ }, null, 8, pa)) : d("", !0),
425
+ G(" " + o(r.label), 1)
426
+ ], 10, fa))), 128))
427
427
  ])) : (a(), s("form", {
428
428
  key: 2,
429
429
  class: "artifactuse-form",
430
- onSubmit: he(Y, ["prevent"])
430
+ onSubmit: ye(K, ["prevent"])
431
431
  }, [
432
- e("div", fa, [
433
- (a(!0), s(R, null, ue(F.value, (r, E) => (a(), s(R, {
434
- key: r.name || E
432
+ e("div", _a, [
433
+ (a(!0), s(F, null, de(I.value, (r, B) => (a(), s(F, {
434
+ key: r.name || B
435
435
  }, [
436
- r.type === "buttons" ? (a(), s("div", pa, [
437
- (a(!0), s(R, null, ue(r.fields || [], (c) => (a(), s("button", {
436
+ r.type === "buttons" ? (a(), s("div", ha, [
437
+ (a(!0), s(F, null, de(r.fields || [], (c) => (a(), s("button", {
438
438
  key: c.name || c.label,
439
439
  type: c.action === "submit" ? "submit" : "button",
440
- class: N(["artifactuse-form-btn", `artifactuse-form-btn-${c.variant || "secondary"}`]),
441
- disabled: c.disabled || c.action === "submit" && J.value,
442
- onClick: (P) => c.action !== "submit" ? Q(c) : null
440
+ class: J(["artifactuse-form-btn", `artifactuse-form-btn-${c.variant || "secondary"}`]),
441
+ disabled: c.disabled || c.action === "submit" && X.value,
442
+ onClick: (S) => c.action !== "submit" ? ee(c) : null
443
443
  }, [
444
- J.value && c.action === "submit" ? (a(), s("span", ha)) : c.icon ? (a(), s("span", {
444
+ X.value && c.action === "submit" ? (a(), s("span", ya)) : c.icon ? (a(), s("span", {
445
445
  key: 1,
446
446
  class: "artifactuse-form-btn-icon",
447
447
  innerHTML: c.icon
448
- }, null, 8, ma)) : d("", !0),
449
- K(" " + n(J.value && c.action === "submit" ? "Submitting..." : c.label), 1)
450
- ], 10, _a))), 128))
451
- ])) : r.type === "divider" ? (a(), s("div", ya)) : r.type === "heading" ? (a(), s("div", ga, n(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", ka, [
452
- e("label", wa, [
448
+ }, null, 8, ga)) : d("", !0),
449
+ G(" " + o(X.value && c.action === "submit" ? "Submitting..." : c.label), 1)
450
+ ], 10, ma))), 128))
451
+ ])) : r.type === "divider" ? (a(), s("div", ka)) : r.type === "heading" ? (a(), s("div", wa, o(r.label), 1)) : r.type === "checkbox" ? (a(), s("div", Ca, [
452
+ e("label", ba, [
453
453
  e("input", {
454
454
  type: "checkbox",
455
- checked: q.value[r.name],
455
+ checked: V.value[r.name],
456
456
  disabled: r.disabled,
457
457
  class: "artifactuse-checkbox",
458
- onChange: (c) => p(r.name, c.target.checked)
459
- }, null, 40, Ca),
460
- e("span", ba, [
461
- K(n(r.label) + " ", 1),
462
- r.required ? (a(), s("span", xa, "*")) : d("", !0)
458
+ onChange: (c) => _(r.name, c.target.checked)
459
+ }, null, 40, xa),
460
+ e("span", $a, [
461
+ G(o(r.label) + " ", 1),
462
+ r.required ? (a(), s("span", Ma, "*")) : d("", !0)
463
463
  ])
464
464
  ]),
465
- r.helpText ? (a(), s("span", $a, n(r.helpText), 1)) : d("", !0),
466
- O.value[r.name] ? (a(), s("span", Ma, n(O.value[r.name]), 1)) : d("", !0)
467
- ])) : (a(), s("div", La, [
465
+ r.helpText ? (a(), s("span", La, o(r.helpText), 1)) : d("", !0),
466
+ R.value[r.name] ? (a(), s("span", Ta, o(R.value[r.name]), 1)) : d("", !0)
467
+ ])) : (a(), s("div", Aa, [
468
468
  e("label", {
469
- for: `${m.value}-${r.name}`,
469
+ for: `${y.value}-${r.name}`,
470
470
  class: "artifactuse-label"
471
471
  }, [
472
- K(n(r.label) + " ", 1),
473
- r.required ? (a(), s("span", Aa, "*")) : d("", !0)
474
- ], 8, Ta),
475
- oe(r.type) ? (a(), s("input", {
472
+ G(o(r.label) + " ", 1),
473
+ r.required ? (a(), s("span", Ha, "*")) : d("", !0)
474
+ ], 8, Pa),
475
+ ve(r.type) ? (a(), s("input", {
476
476
  key: 0,
477
- id: `${m.value}-${r.name}`,
477
+ id: `${y.value}-${r.name}`,
478
478
  type: r.type,
479
- value: q.value[r.name],
479
+ value: V.value[r.name],
480
480
  placeholder: r.placeholder,
481
481
  disabled: r.disabled,
482
482
  required: r.required,
483
483
  class: "artifactuse-input",
484
- onInput: (c) => p(r.name, c.target.value)
485
- }, null, 40, Ha)) : r.type === "textarea" ? (a(), s("textarea", {
484
+ onInput: (c) => _(r.name, c.target.value)
485
+ }, null, 40, Sa)) : r.type === "textarea" ? (a(), s("textarea", {
486
486
  key: 1,
487
- id: `${m.value}-${r.name}`,
488
- value: q.value[r.name],
487
+ id: `${y.value}-${r.name}`,
488
+ value: V.value[r.name],
489
489
  placeholder: r.placeholder,
490
490
  disabled: r.disabled,
491
491
  required: r.required,
492
492
  rows: r.rows || 3,
493
493
  class: "artifactuse-textarea",
494
- onInput: (c) => p(r.name, c.target.value)
495
- }, null, 40, Pa)) : r.type === "select" ? (a(), s("select", {
494
+ onInput: (c) => _(r.name, c.target.value)
495
+ }, null, 40, Ba)) : r.type === "select" ? (a(), s("select", {
496
496
  key: 2,
497
- id: `${m.value}-${r.name}`,
498
- value: q.value[r.name],
497
+ id: `${y.value}-${r.name}`,
498
+ value: V.value[r.name],
499
499
  disabled: r.disabled,
500
500
  required: r.required,
501
501
  class: "artifactuse-select",
502
- onChange: (c) => p(r.name, c.target.value)
502
+ onChange: (c) => _(r.name, c.target.value)
503
503
  }, [
504
- e("option", Ea, n(r.placeholder || "Select..."), 1),
505
- (a(!0), s(R, null, ue(f(r.options), (c) => (a(), s("option", {
504
+ e("option", za, o(r.placeholder || "Select..."), 1),
505
+ (a(!0), s(F, null, de(f(r.options), (c) => (a(), s("option", {
506
506
  key: c.value,
507
507
  value: c.value,
508
508
  disabled: c.disabled
509
- }, n(c.label), 9, Sa))), 128))
510
- ], 40, Ba)) : r.type === "radio" ? (a(), s("div", za, [
511
- (a(!0), s(R, null, ue(f(r.options), (c) => (a(), s("label", {
509
+ }, o(c.label), 9, Ia))), 128))
510
+ ], 40, Ea)) : r.type === "radio" ? (a(), s("div", Fa, [
511
+ (a(!0), s(F, null, de(f(r.options), (c) => (a(), s("label", {
512
512
  key: c.value,
513
513
  class: "artifactuse-radio-label"
514
514
  }, [
@@ -516,103 +516,103 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
516
516
  type: "radio",
517
517
  name: r.name,
518
518
  value: c.value,
519
- checked: q.value[r.name] === c.value,
519
+ checked: V.value[r.name] === c.value,
520
520
  disabled: c.disabled || r.disabled,
521
521
  class: "artifactuse-radio",
522
- onChange: (P) => p(r.name, c.value)
523
- }, null, 40, Ia),
524
- e("span", null, n(c.label), 1)
522
+ onChange: (S) => _(r.name, c.value)
523
+ }, null, 40, Va),
524
+ e("span", null, o(c.label), 1)
525
525
  ]))), 128))
526
526
  ])) : d("", !0),
527
- r.helpText ? (a(), s("span", Fa, n(r.helpText), 1)) : d("", !0),
528
- O.value[r.name] ? (a(), s("span", Va, n(O.value[r.name]), 1)) : d("", !0)
527
+ r.helpText ? (a(), s("span", Ra, o(r.helpText), 1)) : d("", !0),
528
+ R.value[r.name] ? (a(), s("span", qa, o(R.value[r.name]), 1)) : d("", !0)
529
529
  ]))
530
530
  ], 64))), 128))
531
531
  ]),
532
- I.value ? d("", !0) : (a(), s("div", Ra, [
532
+ z.value ? d("", !0) : (a(), s("div", Oa, [
533
533
  e("button", {
534
534
  type: "button",
535
535
  class: "artifactuse-form-btn artifactuse-form-btn-ghost",
536
- onClick: T[0] || (T[0] = (r) => Q({ action: "cancel", label: "Cancel" }))
536
+ onClick: T[0] || (T[0] = (r) => ee({ action: "cancel", label: "Cancel" }))
537
537
  }, " Cancel "),
538
538
  e("button", {
539
539
  type: "submit",
540
540
  class: "artifactuse-form-btn artifactuse-form-btn-primary",
541
- disabled: J.value
541
+ disabled: X.value
542
542
  }, [
543
- J.value ? (a(), s("span", Oa)) : d("", !0),
544
- K(" " + n(J.value ? "Submitting..." : "Submit"), 1)
545
- ], 8, qa)
543
+ X.value ? (a(), s("span", Da)) : d("", !0),
544
+ G(" " + o(X.value ? "Submitting..." : "Submit"), 1)
545
+ ], 8, Ua)
546
546
  ]))
547
547
  ], 32))
548
548
  ], 64))
549
- ], 10, ea));
549
+ ], 10, aa));
550
550
  }
551
- }, Da = ["data-artifactuse-theme"], ja = { class: "artifactuse-social-header" }, Na = ["src", "alt"], Ja = { class: "artifactuse-social-author" }, Xa = { class: "artifactuse-social-author-name" }, Za = { class: "artifactuse-social-author-meta" }, Wa = { class: "artifactuse-social-author-handle" }, Ka = { class: "artifactuse-social-timestamp" }, Ya = { class: "artifactuse-social-content" }, Qa = ["innerHTML"], Ga = {
551
+ }, Na = ["data-artifactuse-theme"], Ja = { class: "artifactuse-social-header" }, Xa = ["src", "alt"], Za = { class: "artifactuse-social-author" }, Wa = { class: "artifactuse-social-author-name" }, Ka = { class: "artifactuse-social-author-meta" }, Ya = { class: "artifactuse-social-author-handle" }, Qa = { class: "artifactuse-social-timestamp" }, Ga = { class: "artifactuse-social-content" }, es = ["innerHTML"], ts = {
552
552
  key: 0,
553
553
  class: "artifactuse-social-media"
554
- }, es = ["data-count"], ts = ["src", "alt"], as = {
554
+ }, as = ["data-count"], ss = ["src", "alt"], is = {
555
555
  key: 1,
556
556
  class: "artifactuse-social-link-card"
557
- }, ss = ["src", "alt"], is = { class: "artifactuse-social-link-info" }, ls = { class: "artifactuse-social-link-domain" }, ns = { class: "artifactuse-social-link-title" }, os = {
557
+ }, ls = ["src", "alt"], ns = { class: "artifactuse-social-link-info" }, os = { class: "artifactuse-social-link-domain" }, rs = { class: "artifactuse-social-link-title" }, cs = {
558
558
  key: 0,
559
559
  class: "artifactuse-social-link-description"
560
- }, rs = {
560
+ }, us = {
561
561
  key: 2,
562
562
  class: "artifactuse-social-poll"
563
- }, cs = { class: "artifactuse-social-poll-label" }, us = { class: "artifactuse-social-poll-label-percent" }, ds = { class: "artifactuse-social-poll-meta" }, vs = {
563
+ }, ds = { class: "artifactuse-social-poll-label" }, vs = { class: "artifactuse-social-poll-label-percent" }, fs = { class: "artifactuse-social-poll-meta" }, ps = {
564
564
  key: 3,
565
565
  class: "artifactuse-social-quote"
566
- }, fs = { class: "artifactuse-social-quote-header" }, ps = ["src"], _s = { class: "artifactuse-social-quote-author" }, hs = { class: "artifactuse-social-quote-handle" }, ms = { class: "artifactuse-social-quote-text" }, ys = {
566
+ }, _s = { class: "artifactuse-social-quote-header" }, hs = ["src"], ms = { class: "artifactuse-social-quote-author" }, ys = { class: "artifactuse-social-quote-handle" }, gs = { class: "artifactuse-social-quote-text" }, ks = {
567
567
  key: 0,
568
568
  class: "artifactuse-social-engagement"
569
- }, gs = { class: "artifactuse-social-stat" }, ks = { class: "artifactuse-social-stat" }, ws = { class: "artifactuse-social-stat" }, Cs = { class: "artifactuse-social-stat" }, bs = { class: "artifactuse-social-header" }, xs = ["src", "alt"], $s = { class: "artifactuse-social-author-info" }, Ms = { class: "artifactuse-social-author-name" }, Ls = {
569
+ }, ws = { class: "artifactuse-social-stat" }, Cs = { class: "artifactuse-social-stat" }, bs = { class: "artifactuse-social-stat" }, xs = { class: "artifactuse-social-stat" }, $s = { class: "artifactuse-social-header" }, Ms = ["src", "alt"], Ls = { class: "artifactuse-social-author-info" }, Ts = { class: "artifactuse-social-author-name" }, As = {
570
570
  key: 0,
571
571
  class: "artifactuse-social-author-connection"
572
- }, Ts = { class: "artifactuse-social-author-headline" }, As = { class: "artifactuse-social-timestamp" }, Hs = { class: "artifactuse-social-content" }, Ps = ["innerHTML"], Bs = {
572
+ }, Ps = { class: "artifactuse-social-author-headline" }, Hs = { class: "artifactuse-social-timestamp" }, Ss = { class: "artifactuse-social-content" }, Bs = ["innerHTML"], Es = {
573
573
  key: 0,
574
574
  class: "artifactuse-social-link-card"
575
- }, Es = ["src", "alt"], Ss = { class: "artifactuse-social-link-info" }, zs = { class: "artifactuse-social-link-title" }, Is = { class: "artifactuse-social-link-domain" }, Fs = {
575
+ }, zs = ["src", "alt"], Is = { class: "artifactuse-social-link-info" }, Fs = { class: "artifactuse-social-link-title" }, Vs = { class: "artifactuse-social-link-domain" }, Rs = {
576
576
  key: 0,
577
577
  class: "artifactuse-social-engagement"
578
- }, Vs = { class: "artifactuse-social-reactions" }, Rs = { class: "artifactuse-social-header" }, qs = ["src", "alt"], Os = { class: "artifactuse-social-author-name" }, Us = {
578
+ }, qs = { class: "artifactuse-social-reactions" }, Os = { class: "artifactuse-social-header" }, Us = ["src", "alt"], Ds = { class: "artifactuse-social-author-name" }, js = {
579
579
  key: 0,
580
580
  class: "artifactuse-social-verified",
581
581
  viewBox: "0 0 24 24",
582
582
  fill: "currentColor"
583
- }, Ds = {
583
+ }, Ns = {
584
584
  key: 0,
585
585
  class: "artifactuse-social-media"
586
- }, js = ["src", "alt"], Ns = { class: "artifactuse-social-likes" }, Js = { class: "artifactuse-social-caption" }, Xs = { class: "artifactuse-social-caption-author" }, Zs = ["innerHTML"], Ws = { class: "artifactuse-social-timestamp" }, Ks = { class: "artifactuse-social-header" }, Ys = ["src", "alt"], Qs = { class: "artifactuse-social-author-info" }, Gs = { class: "artifactuse-social-author-name" }, ei = { class: "artifactuse-social-timestamp" }, ti = { class: "artifactuse-social-content" }, ai = ["innerHTML"], si = {
586
+ }, Js = ["src", "alt"], Xs = { class: "artifactuse-social-likes" }, Zs = { class: "artifactuse-social-caption" }, Ws = { class: "artifactuse-social-caption-author" }, Ks = ["innerHTML"], Ys = { class: "artifactuse-social-timestamp" }, Qs = { class: "artifactuse-social-header" }, Gs = ["src", "alt"], ei = { class: "artifactuse-social-author-info" }, ti = { class: "artifactuse-social-author-name" }, ai = { class: "artifactuse-social-timestamp" }, si = { class: "artifactuse-social-content" }, ii = ["innerHTML"], li = {
587
587
  key: 0,
588
588
  class: "artifactuse-social-link-card"
589
- }, ii = ["src", "alt"], li = { class: "artifactuse-social-link-info" }, ni = { class: "artifactuse-social-link-domain" }, oi = { class: "artifactuse-social-link-title" }, ri = {
589
+ }, ni = ["src", "alt"], oi = { class: "artifactuse-social-link-info" }, ri = { class: "artifactuse-social-link-domain" }, ci = { class: "artifactuse-social-link-title" }, ui = {
590
590
  key: 0,
591
591
  class: "artifactuse-social-link-description"
592
- }, ci = {
592
+ }, di = {
593
593
  key: 0,
594
594
  class: "artifactuse-social-engagement"
595
- }, ui = { class: "artifactuse-social-reactions" }, di = { class: "artifactuse-social-reaction-count" }, vi = { class: "artifactuse-social-comments-shares" }, fi = { class: "artifactuse-social-header" }, pi = ["src", "alt"], _i = { class: "artifactuse-social-author-info" }, hi = { class: "artifactuse-social-author-name" }, mi = {
595
+ }, vi = { class: "artifactuse-social-reactions" }, fi = { class: "artifactuse-social-reaction-count" }, pi = { class: "artifactuse-social-comments-shares" }, _i = { class: "artifactuse-social-header" }, hi = ["src", "alt"], mi = { class: "artifactuse-social-author-info" }, yi = { class: "artifactuse-social-author-name" }, gi = {
596
596
  key: 0,
597
597
  class: "artifactuse-social-verified",
598
598
  viewBox: "0 0 24 24",
599
599
  fill: "currentColor"
600
- }, yi = { class: "artifactuse-social-timestamp" }, gi = { class: "artifactuse-social-content" }, ki = ["innerHTML"], wi = {
600
+ }, ki = { class: "artifactuse-social-timestamp" }, wi = { class: "artifactuse-social-content" }, Ci = ["innerHTML"], bi = {
601
601
  key: 0,
602
602
  class: "artifactuse-social-engagement"
603
- }, Ci = { class: "artifactuse-social-stat" }, bi = { class: "artifactuse-social-stat" }, xi = { class: "artifactuse-social-stat" }, $i = { class: "artifactuse-social-thumbnail" }, Mi = ["src", "alt"], Li = {
603
+ }, xi = { class: "artifactuse-social-stat" }, $i = { class: "artifactuse-social-stat" }, Mi = { class: "artifactuse-social-stat" }, Li = { class: "artifactuse-social-thumbnail" }, Ti = ["src", "alt"], Ai = {
604
604
  key: 1,
605
605
  class: "artifactuse-social-duration"
606
- }, Ti = { class: "artifactuse-social-info" }, Ai = { class: "artifactuse-social-header" }, Hi = ["src", "alt"], Pi = { class: "artifactuse-social-author-name" }, Bi = ["innerHTML"], Ei = {
606
+ }, Pi = { class: "artifactuse-social-info" }, Hi = { class: "artifactuse-social-header" }, Si = ["src", "alt"], Bi = { class: "artifactuse-social-author-name" }, Ei = ["innerHTML"], zi = {
607
607
  key: 0,
608
608
  class: "artifactuse-social-sound"
609
- }, Si = {
609
+ }, Ii = {
610
610
  key: 1,
611
611
  class: "artifactuse-social-engagement"
612
- }, zi = { class: "artifactuse-social-thumbnail" }, Ii = ["src", "alt"], Fi = {
612
+ }, Fi = { class: "artifactuse-social-thumbnail" }, Vi = ["src", "alt"], Ri = {
613
613
  key: 1,
614
614
  class: "artifactuse-social-duration"
615
- }, Vi = { class: "artifactuse-social-info" }, Ri = ["src", "alt"], qi = { class: "artifactuse-social-title" }, Oi = { class: "artifactuse-social-channel" }, Ui = { class: "artifactuse-social-meta" }, Di = { class: "artifactuse-social-actions-bar" }, ji = { class: "artifactuse-social-platform-badge" }, _e = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23888"><circle cx="12" cy="8" r="4"/><path d="M12 14c-6 0-8 3-8 6v2h16v-2c0-3-2-6-8-6z"/></svg>', Ni = {
615
+ }, qi = { class: "artifactuse-social-info" }, Oi = ["src", "alt"], Ui = { class: "artifactuse-social-title" }, Di = { class: "artifactuse-social-channel" }, ji = { class: "artifactuse-social-meta" }, Ni = { class: "artifactuse-social-actions-bar" }, Ji = { class: "artifactuse-social-platform-badge" }, _e = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23888"><circle cx="12" cy="8" r="4"/><path d="M12 14c-6 0-8 3-8 6v2h16v-2c0-3-2-6-8-6z"/></svg>', Xi = {
616
616
  __name: "ArtifactuseSocialPreview",
617
617
  props: {
618
618
  artifact: {
@@ -625,37 +625,37 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
625
625
  }
626
626
  },
627
627
  emits: ["copy", "edit"],
628
- setup(H, { emit: u }) {
629
- const h = H, k = u, l = M(null), U = M("Copy"), S = b(() => {
628
+ setup(A, { emit: u }) {
629
+ const h = A, m = u, l = M(null), U = M("Copy"), E = b(() => {
630
630
  try {
631
631
  return JSON.parse(h.artifact.code);
632
632
  } catch {
633
633
  return { platform: "twitter", data: {} };
634
634
  }
635
- }), A = b(() => {
635
+ }), L = b(() => {
636
636
  var f;
637
- return ((f = S.value) == null ? void 0 : f.platform) || "twitter";
637
+ return ((f = E.value) == null ? void 0 : f.platform) || "twitter";
638
638
  });
639
639
  b(() => {
640
640
  var f;
641
- return ((f = S.value) == null ? void 0 : f.variant) || "post";
641
+ return ((f = E.value) == null ? void 0 : f.variant) || "post";
642
642
  });
643
- const g = b(() => {
644
- var f, p;
645
- return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.author) || {};
646
- }), o = b(() => {
647
- var f, p;
648
- return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.content) || {};
649
- }), m = b(() => {
650
- var f, p;
651
- return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.engagement) || {};
652
- }), C = b(() => {
653
- var f, p;
654
- return ((p = (f = S.value) == null ? void 0 : f.data) == null ? void 0 : p.meta) || {};
643
+ const w = b(() => {
644
+ var f, _;
645
+ return ((_ = (f = E.value) == null ? void 0 : f.data) == null ? void 0 : _.author) || {};
646
+ }), n = b(() => {
647
+ var f, _;
648
+ return ((_ = (f = E.value) == null ? void 0 : f.data) == null ? void 0 : _.content) || {};
649
+ }), y = b(() => {
650
+ var f, _;
651
+ return ((_ = (f = E.value) == null ? void 0 : f.data) == null ? void 0 : _.engagement) || {};
652
+ }), x = b(() => {
653
+ var f, _;
654
+ return ((_ = (f = E.value) == null ? void 0 : f.data) == null ? void 0 : _.meta) || {};
655
655
  }), $ = b(() => {
656
- const f = m.value;
656
+ const f = y.value;
657
657
  return f.likes || f.comments || f.shares || f.retweets || f.replies || f.views;
658
- }), q = b(() => `artifactuse-social-verified-${g.value.verifiedType || "blue"}`), O = b(() => ({
658
+ }), V = b(() => `artifactuse-social-verified-${w.value.verifiedType || "blue"}`), R = b(() => ({
659
659
  twitter: "X",
660
660
  linkedin: "LinkedIn",
661
661
  instagram: "Instagram",
@@ -663,7 +663,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
663
663
  threads: "Threads",
664
664
  tiktok: "TikTok",
665
665
  youtube: "YouTube"
666
- })[A.value] || A.value), J = b(() => {
666
+ })[L.value] || L.value), X = b(() => {
667
667
  const f = {
668
668
  twitter: () => le("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
669
669
  le("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" })
@@ -687,104 +687,104 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
687
687
  le("path", { d: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z" })
688
688
  ])
689
689
  };
690
- return f[A.value] || f.twitter;
691
- }), F = b(() => {
692
- let f = o.value.text || "";
690
+ return f[L.value] || f.twitter;
691
+ }), I = b(() => {
692
+ let f = n.value.text || "";
693
693
  return f = f.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), f = f.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), f = f.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), f = f.replace(
694
694
  /(https?:\/\/[^\s]+)/g,
695
695
  '<a href="$1" target="_blank" rel="noopener">$1</a>'
696
696
  ), f;
697
- }), ee = b(() => {
698
- const f = m.value.reactions || {};
699
- return Object.values(f).reduce((p, ae) => p + (ae || 0), 0) || m.value.likes || 0;
697
+ }), te = b(() => {
698
+ const f = y.value.reactions || {};
699
+ return Object.values(f).reduce((_, ie) => _ + (ie || 0), 0) || y.value.likes || 0;
700
700
  });
701
- function I(f) {
701
+ function z(f) {
702
702
  return f ? f >= 1e6 ? `${(f / 1e6).toFixed(1)}M` : f >= 1e3 ? `${(f / 1e3).toFixed(1)}K` : f.toString() : "0";
703
703
  }
704
- function te(f) {
704
+ function ae(f) {
705
705
  try {
706
706
  return new URL(f).hostname.replace("www.", "");
707
707
  } catch {
708
708
  return f;
709
709
  }
710
710
  }
711
- function X(f) {
711
+ function Z(f) {
712
712
  f.target.src = _e;
713
713
  }
714
- function Z(f) {
714
+ function W(f) {
715
715
  f.target.style.display = "none";
716
716
  }
717
- function oe() {
718
- const f = o.value.text || "";
717
+ function ve() {
718
+ const f = n.value.text || "";
719
719
  navigator.clipboard.writeText(f).then(() => {
720
720
  U.value = "Copied!", setTimeout(() => {
721
721
  U.value = "Copy";
722
- }, 2e3), k("copy", { platform: A.value, text: f });
722
+ }, 2e3), m("copy", { platform: L.value, text: f });
723
723
  });
724
724
  }
725
- return (f, p) => {
726
- var ae, L, Y, Q, _, T;
725
+ return (f, _) => {
726
+ var ie, H, K, ee, p, T;
727
727
  return a(), s("div", {
728
728
  ref_key: "containerRef",
729
729
  ref: l,
730
- class: N(["artifactuse-social", [`artifactuse-social-${A.value}`]]),
731
- "data-artifactuse-theme": H.theme
730
+ class: J(["artifactuse-social", [`artifactuse-social-${L.value}`]]),
731
+ "data-artifactuse-theme": A.theme
732
732
  }, [
733
- A.value === "twitter" ? (a(), s(R, { key: 0 }, [
734
- e("div", ja, [
733
+ L.value === "twitter" ? (a(), s(F, { key: 0 }, [
734
+ e("div", Ja, [
735
735
  e("img", {
736
- src: g.value.avatar || _e,
737
- alt: g.value.name,
736
+ src: w.value.avatar || _e,
737
+ alt: w.value.name,
738
738
  class: "artifactuse-social-avatar",
739
- onError: X
740
- }, null, 40, Na),
741
- e("div", Ja, [
742
- e("div", Xa, [
743
- e("span", null, n(g.value.name), 1),
744
- g.value.verified ? (a(), s("svg", {
739
+ onError: Z
740
+ }, null, 40, Xa),
741
+ e("div", Za, [
742
+ e("div", Wa, [
743
+ e("span", null, o(w.value.name), 1),
744
+ w.value.verified ? (a(), s("svg", {
745
745
  key: 0,
746
- class: N(["artifactuse-social-verified", q.value]),
746
+ class: J(["artifactuse-social-verified", V.value]),
747
747
  viewBox: "0 0 24 24",
748
748
  fill: "currentColor"
749
- }, [...p[0] || (p[0] = [
749
+ }, [..._[0] || (_[0] = [
750
750
  e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
751
751
  ])], 2)) : d("", !0)
752
752
  ]),
753
- e("div", Za, [
754
- e("span", Wa, n(g.value.handle), 1),
755
- e("span", Ka, "· " + n(C.value.timestamp || "Just now"), 1)
753
+ e("div", Ka, [
754
+ e("span", Ya, o(w.value.handle), 1),
755
+ e("span", Qa, "· " + o(x.value.timestamp || "Just now"), 1)
756
756
  ])
757
757
  ])
758
758
  ]),
759
- e("div", Ya, [
759
+ e("div", Ga, [
760
760
  e("p", {
761
761
  class: "artifactuse-social-text",
762
- innerHTML: F.value
763
- }, null, 8, Qa),
764
- (ae = o.value.media) != null && ae.length ? (a(), s("div", Ga, [
762
+ innerHTML: I.value
763
+ }, null, 8, es),
764
+ (ie = n.value.media) != null && ie.length ? (a(), s("div", ts, [
765
765
  e("div", {
766
- class: N(["artifactuse-social-media-grid", { "artifactuse-social-media-single": o.value.media.length === 1 }]),
767
- "data-count": o.value.media.length
766
+ class: J(["artifactuse-social-media-grid", { "artifactuse-social-media-single": n.value.media.length === 1 }]),
767
+ "data-count": n.value.media.length
768
768
  }, [
769
- (a(!0), s(R, null, ue(o.value.media.slice(0, 4), (r, E) => (a(), s("img", {
770
- key: E,
769
+ (a(!0), s(F, null, de(n.value.media.slice(0, 4), (r, B) => (a(), s("img", {
770
+ key: B,
771
771
  src: r.url,
772
772
  alt: r.alt || "",
773
- onError: Z
774
- }, null, 40, ts))), 128))
775
- ], 10, es)
773
+ onError: W
774
+ }, null, 40, ss))), 128))
775
+ ], 10, as)
776
776
  ])) : d("", !0),
777
- o.value.link && !((L = o.value.media) != null && L.length) ? (a(), s("div", as, [
778
- o.value.link.image ? (a(), s("img", {
777
+ n.value.link && !((H = n.value.media) != null && H.length) ? (a(), s("div", is, [
778
+ n.value.link.image ? (a(), s("img", {
779
779
  key: 0,
780
- src: o.value.link.image,
781
- alt: o.value.link.title,
780
+ src: n.value.link.image,
781
+ alt: n.value.link.title,
782
782
  class: "artifactuse-social-link-image",
783
- onError: Z
784
- }, null, 40, ss)) : d("", !0),
785
- e("div", is, [
786
- e("div", ls, [
787
- p[1] || (p[1] = e("svg", {
783
+ onError: W
784
+ }, null, 40, ls)) : d("", !0),
785
+ e("div", ns, [
786
+ e("div", os, [
787
+ _[1] || (_[1] = e("svg", {
788
788
  fill: "none",
789
789
  viewBox: "0 0 24 24",
790
790
  stroke: "currentColor"
@@ -796,46 +796,46 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
796
796
  d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
797
797
  })
798
798
  ], -1)),
799
- K(" " + n(o.value.link.domain || te(o.value.link.url)), 1)
799
+ G(" " + o(n.value.link.domain || ae(n.value.link.url)), 1)
800
800
  ]),
801
- e("div", ns, n(o.value.link.title), 1),
802
- o.value.link.description ? (a(), s("div", os, n(o.value.link.description), 1)) : d("", !0)
801
+ e("div", rs, o(n.value.link.title), 1),
802
+ n.value.link.description ? (a(), s("div", cs, o(n.value.link.description), 1)) : d("", !0)
803
803
  ])
804
804
  ])) : d("", !0),
805
- o.value.poll ? (a(), s("div", rs, [
806
- (a(!0), s(R, null, ue(o.value.poll.options, (r, E) => {
807
- var c, P;
805
+ n.value.poll ? (a(), s("div", us, [
806
+ (a(!0), s(F, null, de(n.value.poll.options, (r, B) => {
807
+ var c, S;
808
808
  return a(), s("div", {
809
- key: E,
809
+ key: B,
810
810
  class: "artifactuse-social-poll-option"
811
811
  }, [
812
812
  e("div", {
813
813
  class: "artifactuse-social-poll-bar",
814
- style: $e({ width: `${((c = o.value.poll.votes) == null ? void 0 : c[E]) || 0}%` })
814
+ style: Ae({ width: `${((c = n.value.poll.votes) == null ? void 0 : c[B]) || 0}%` })
815
815
  }, null, 4),
816
- e("div", cs, [
817
- e("span", null, n(r), 1),
818
- e("span", us, n(((P = o.value.poll.votes) == null ? void 0 : P[E]) || 0) + "%", 1)
816
+ e("div", ds, [
817
+ e("span", null, o(r), 1),
818
+ e("span", vs, o(((S = n.value.poll.votes) == null ? void 0 : S[B]) || 0) + "%", 1)
819
819
  ])
820
820
  ]);
821
821
  }), 128)),
822
- e("div", ds, n(I(o.value.poll.totalVotes || 0)) + " votes · " + n(o.value.poll.duration || "Poll ended"), 1)
822
+ e("div", fs, o(z(n.value.poll.totalVotes || 0)) + " votes · " + o(n.value.poll.duration || "Poll ended"), 1)
823
823
  ])) : d("", !0),
824
- o.value.quote ? (a(), s("div", vs, [
825
- e("div", fs, [
824
+ n.value.quote ? (a(), s("div", ps, [
825
+ e("div", _s, [
826
826
  e("img", {
827
- src: ((Y = o.value.quote.author) == null ? void 0 : Y.avatar) || _e,
827
+ src: ((K = n.value.quote.author) == null ? void 0 : K.avatar) || _e,
828
828
  class: "artifactuse-social-quote-avatar"
829
- }, null, 8, ps),
830
- e("span", _s, n((Q = o.value.quote.author) == null ? void 0 : Q.name), 1),
831
- e("span", hs, n((_ = o.value.quote.author) == null ? void 0 : _.handle), 1)
829
+ }, null, 8, hs),
830
+ e("span", ms, o((ee = n.value.quote.author) == null ? void 0 : ee.name), 1),
831
+ e("span", ys, o((p = n.value.quote.author) == null ? void 0 : p.handle), 1)
832
832
  ]),
833
- e("p", ms, n(o.value.quote.text), 1)
833
+ e("p", gs, o(n.value.quote.text), 1)
834
834
  ])) : d("", !0)
835
835
  ]),
836
- $.value ? (a(), s("div", ys, [
837
- e("div", gs, [
838
- p[2] || (p[2] = e("svg", {
836
+ $.value ? (a(), s("div", ks, [
837
+ e("div", ws, [
838
+ _[2] || (_[2] = e("svg", {
839
839
  viewBox: "0 0 24 24",
840
840
  fill: "none",
841
841
  stroke: "currentColor",
@@ -843,10 +843,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
843
843
  }, [
844
844
  e("path", { d: "M12 21C6.5 21 2 16.5 2 11V3l7 3 3-3 3 3 7-3v8c0 5.5-4.5 10-10 10z" })
845
845
  ], -1)),
846
- e("span", null, n(I(m.value.replies || 0)), 1)
846
+ e("span", null, o(z(y.value.replies || 0)), 1)
847
847
  ]),
848
- e("div", ks, [
849
- p[3] || (p[3] = e("svg", {
848
+ e("div", Cs, [
849
+ _[3] || (_[3] = e("svg", {
850
850
  viewBox: "0 0 24 24",
851
851
  fill: "none",
852
852
  stroke: "currentColor",
@@ -854,10 +854,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
854
854
  }, [
855
855
  e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
856
856
  ], -1)),
857
- e("span", null, n(I(m.value.retweets || 0)), 1)
857
+ e("span", null, o(z(y.value.retweets || 0)), 1)
858
858
  ]),
859
- e("div", ws, [
860
- p[4] || (p[4] = e("svg", {
859
+ e("div", bs, [
860
+ _[4] || (_[4] = e("svg", {
861
861
  viewBox: "0 0 24 24",
862
862
  fill: "none",
863
863
  stroke: "currentColor",
@@ -865,10 +865,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
865
865
  }, [
866
866
  e("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
867
867
  ], -1)),
868
- e("span", null, n(I(m.value.likes || 0)), 1)
868
+ e("span", null, o(z(y.value.likes || 0)), 1)
869
869
  ]),
870
- e("div", Cs, [
871
- p[5] || (p[5] = e("svg", {
870
+ e("div", xs, [
871
+ _[5] || (_[5] = e("svg", {
872
872
  viewBox: "0 0 24 24",
873
873
  fill: "none",
874
874
  stroke: "currentColor",
@@ -876,26 +876,26 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
876
876
  }, [
877
877
  e("path", { d: "M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M13.8 12H3" })
878
878
  ], -1)),
879
- e("span", null, n(I(m.value.views || 0)), 1)
879
+ e("span", null, o(z(y.value.views || 0)), 1)
880
880
  ])
881
881
  ])) : d("", !0)
882
- ], 64)) : A.value === "linkedin" ? (a(), s(R, { key: 1 }, [
883
- e("div", bs, [
882
+ ], 64)) : L.value === "linkedin" ? (a(), s(F, { key: 1 }, [
883
+ e("div", $s, [
884
884
  e("img", {
885
- src: g.value.avatar || _e,
886
- alt: g.value.name,
885
+ src: w.value.avatar || _e,
886
+ alt: w.value.name,
887
887
  class: "artifactuse-social-avatar",
888
- onError: X
889
- }, null, 40, xs),
890
- e("div", $s, [
891
- e("div", Ms, [
892
- K(n(g.value.name) + " ", 1),
893
- g.value.connection ? (a(), s("span", Ls, "· " + n(g.value.connection), 1)) : d("", !0)
888
+ onError: Z
889
+ }, null, 40, Ms),
890
+ e("div", Ls, [
891
+ e("div", Ts, [
892
+ G(o(w.value.name) + " ", 1),
893
+ w.value.connection ? (a(), s("span", As, "· " + o(w.value.connection), 1)) : d("", !0)
894
894
  ]),
895
- e("div", Ts, n(g.value.headline), 1),
896
- e("div", As, [
897
- K(n(C.value.timestamp || "Just now") + " · ", 1),
898
- p[6] || (p[6] = e("svg", {
895
+ e("div", Ps, o(w.value.headline), 1),
896
+ e("div", Hs, [
897
+ G(o(x.value.timestamp || "Just now") + " · ", 1),
898
+ _[6] || (_[6] = e("svg", {
899
899
  viewBox: "0 0 24 24",
900
900
  fill: "currentColor"
901
901
  }, [
@@ -904,81 +904,81 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
904
904
  ])
905
905
  ])
906
906
  ]),
907
- e("div", Hs, [
907
+ e("div", Ss, [
908
908
  e("p", {
909
909
  class: "artifactuse-social-text",
910
- innerHTML: F.value
911
- }, null, 8, Ps),
912
- o.value.link ? (a(), s("div", Bs, [
913
- o.value.link.image ? (a(), s("img", {
910
+ innerHTML: I.value
911
+ }, null, 8, Bs),
912
+ n.value.link ? (a(), s("div", Es, [
913
+ n.value.link.image ? (a(), s("img", {
914
914
  key: 0,
915
- src: o.value.link.image,
916
- alt: o.value.link.title,
915
+ src: n.value.link.image,
916
+ alt: n.value.link.title,
917
917
  class: "artifactuse-social-link-image",
918
- onError: Z
919
- }, null, 40, Es)) : d("", !0),
920
- e("div", Ss, [
921
- e("div", zs, n(o.value.link.title), 1),
922
- e("div", Is, n(o.value.link.domain || te(o.value.link.url)), 1)
918
+ onError: W
919
+ }, null, 40, zs)) : d("", !0),
920
+ e("div", Is, [
921
+ e("div", Fs, o(n.value.link.title), 1),
922
+ e("div", Vs, o(n.value.link.domain || ae(n.value.link.url)), 1)
923
923
  ])
924
924
  ])) : d("", !0)
925
925
  ]),
926
- $.value ? (a(), s("div", Fs, [
927
- e("div", Vs, [
928
- p[7] || (p[7] = e("div", { class: "artifactuse-social-reaction-icons" }, [
926
+ $.value ? (a(), s("div", Rs, [
927
+ e("div", qs, [
928
+ _[7] || (_[7] = e("div", { class: "artifactuse-social-reaction-icons" }, [
929
929
  e("span", { class: "artifactuse-social-reaction-icon" }, "👍"),
930
930
  e("span", { class: "artifactuse-social-reaction-icon" }, "❤️"),
931
931
  e("span", { class: "artifactuse-social-reaction-icon" }, "👏")
932
932
  ], -1)),
933
- e("span", null, n(I(m.value.likes || 0)), 1)
933
+ e("span", null, o(z(y.value.likes || 0)), 1)
934
934
  ]),
935
- e("span", null, n(I(m.value.comments || 0)) + " comments · " + n(I(m.value.shares || 0)) + " shares", 1)
935
+ e("span", null, o(z(y.value.comments || 0)) + " comments · " + o(z(y.value.shares || 0)) + " shares", 1)
936
936
  ])) : d("", !0)
937
- ], 64)) : A.value === "instagram" ? (a(), s(R, { key: 2 }, [
938
- e("div", Rs, [
937
+ ], 64)) : L.value === "instagram" ? (a(), s(F, { key: 2 }, [
938
+ e("div", Os, [
939
939
  e("img", {
940
- src: g.value.avatar || _e,
941
- alt: g.value.name,
940
+ src: w.value.avatar || _e,
941
+ alt: w.value.name,
942
942
  class: "artifactuse-social-avatar",
943
- onError: X
944
- }, null, 40, qs),
945
- e("div", Os, [
946
- K(n(g.value.name) + " ", 1),
947
- g.value.verified ? (a(), s("svg", Us, [...p[8] || (p[8] = [
943
+ onError: Z
944
+ }, null, 40, Us),
945
+ e("div", Ds, [
946
+ G(o(w.value.name) + " ", 1),
947
+ w.value.verified ? (a(), s("svg", js, [..._[8] || (_[8] = [
948
948
  e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
949
949
  ])])) : d("", !0)
950
950
  ])
951
951
  ]),
952
- (T = o.value.media) != null && T.length ? (a(), s("div", Ds, [
952
+ (T = n.value.media) != null && T.length ? (a(), s("div", Ns, [
953
953
  e("img", {
954
- src: o.value.media[0].url,
955
- alt: o.value.media[0].alt || "",
956
- onError: Z
957
- }, null, 40, js)
954
+ src: n.value.media[0].url,
955
+ alt: n.value.media[0].alt || "",
956
+ onError: W
957
+ }, null, 40, Js)
958
958
  ])) : d("", !0),
959
- p[9] || (p[9] = Pt('<div class="artifactuse-social-actions"><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"></path></svg></div></div>', 1)),
960
- e("div", Ns, n(I(m.value.likes || 0)) + " likes", 1),
961
- e("div", Js, [
962
- e("span", Xs, n(g.value.name), 1),
959
+ _[9] || (_[9] = Bt('<div class="artifactuse-social-actions"><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z"></path></svg></div><div class="artifactuse-social-action"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"></path></svg></div></div>', 1)),
960
+ e("div", Xs, o(z(y.value.likes || 0)) + " likes", 1),
961
+ e("div", Zs, [
962
+ e("span", Ws, o(w.value.name), 1),
963
963
  e("span", {
964
964
  class: "artifactuse-social-caption-text",
965
- innerHTML: F.value
966
- }, null, 8, Zs)
965
+ innerHTML: I.value
966
+ }, null, 8, Ks)
967
967
  ]),
968
- e("div", Ws, n(C.value.timestamp || "Just now"), 1)
969
- ], 64)) : A.value === "facebook" ? (a(), s(R, { key: 3 }, [
970
- e("div", Ks, [
968
+ e("div", Ys, o(x.value.timestamp || "Just now"), 1)
969
+ ], 64)) : L.value === "facebook" ? (a(), s(F, { key: 3 }, [
970
+ e("div", Qs, [
971
971
  e("img", {
972
- src: g.value.avatar || _e,
973
- alt: g.value.name,
972
+ src: w.value.avatar || _e,
973
+ alt: w.value.name,
974
974
  class: "artifactuse-social-avatar",
975
- onError: X
976
- }, null, 40, Ys),
977
- e("div", Qs, [
978
- e("div", Gs, n(g.value.name), 1),
979
- e("div", ei, [
980
- K(n(C.value.timestamp || "Just now") + " · ", 1),
981
- p[10] || (p[10] = e("svg", {
975
+ onError: Z
976
+ }, null, 40, Gs),
977
+ e("div", ei, [
978
+ e("div", ti, o(w.value.name), 1),
979
+ e("div", ai, [
980
+ G(o(x.value.timestamp || "Just now") + " · ", 1),
981
+ _[10] || (_[10] = e("svg", {
982
982
  viewBox: "0 0 24 24",
983
983
  fill: "currentColor"
984
984
  }, [
@@ -987,64 +987,64 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
987
987
  ])
988
988
  ])
989
989
  ]),
990
- e("div", ti, [
990
+ e("div", si, [
991
991
  e("p", {
992
992
  class: "artifactuse-social-text",
993
- innerHTML: F.value
994
- }, null, 8, ai),
995
- o.value.link ? (a(), s("div", si, [
996
- o.value.link.image ? (a(), s("img", {
993
+ innerHTML: I.value
994
+ }, null, 8, ii),
995
+ n.value.link ? (a(), s("div", li, [
996
+ n.value.link.image ? (a(), s("img", {
997
997
  key: 0,
998
- src: o.value.link.image,
999
- alt: o.value.link.title,
998
+ src: n.value.link.image,
999
+ alt: n.value.link.title,
1000
1000
  class: "artifactuse-social-link-image",
1001
- onError: Z
1002
- }, null, 40, ii)) : d("", !0),
1003
- e("div", li, [
1004
- e("div", ni, n(o.value.link.domain || te(o.value.link.url)), 1),
1005
- e("div", oi, n(o.value.link.title), 1),
1006
- o.value.link.description ? (a(), s("div", ri, n(o.value.link.description), 1)) : d("", !0)
1001
+ onError: W
1002
+ }, null, 40, ni)) : d("", !0),
1003
+ e("div", oi, [
1004
+ e("div", ri, o(n.value.link.domain || ae(n.value.link.url)), 1),
1005
+ e("div", ci, o(n.value.link.title), 1),
1006
+ n.value.link.description ? (a(), s("div", ui, o(n.value.link.description), 1)) : d("", !0)
1007
1007
  ])
1008
1008
  ])) : d("", !0)
1009
1009
  ]),
1010
- $.value ? (a(), s("div", ci, [
1011
- e("div", ui, [
1012
- p[11] || (p[11] = e("div", { class: "artifactuse-social-reaction-emojis" }, [
1010
+ $.value ? (a(), s("div", di, [
1011
+ e("div", vi, [
1012
+ _[11] || (_[11] = e("div", { class: "artifactuse-social-reaction-emojis" }, [
1013
1013
  e("span", { class: "artifactuse-social-reaction-emoji" }, "👍"),
1014
1014
  e("span", { class: "artifactuse-social-reaction-emoji" }, "❤️"),
1015
1015
  e("span", { class: "artifactuse-social-reaction-emoji" }, "😂")
1016
1016
  ], -1)),
1017
- e("span", di, n(I(ee.value)), 1)
1017
+ e("span", fi, o(z(te.value)), 1)
1018
1018
  ]),
1019
- e("span", vi, n(I(m.value.comments || 0)) + " comments · " + n(I(m.value.shares || 0)) + " shares", 1)
1019
+ e("span", pi, o(z(y.value.comments || 0)) + " comments · " + o(z(y.value.shares || 0)) + " shares", 1)
1020
1020
  ])) : d("", !0)
1021
- ], 64)) : A.value === "threads" ? (a(), s(R, { key: 4 }, [
1022
- e("div", fi, [
1021
+ ], 64)) : L.value === "threads" ? (a(), s(F, { key: 4 }, [
1022
+ e("div", _i, [
1023
1023
  e("img", {
1024
- src: g.value.avatar || _e,
1025
- alt: g.value.name,
1024
+ src: w.value.avatar || _e,
1025
+ alt: w.value.name,
1026
1026
  class: "artifactuse-social-avatar",
1027
- onError: X
1028
- }, null, 40, pi),
1029
- e("div", _i, [
1030
- e("div", hi, [
1031
- K(n(g.value.name) + " ", 1),
1032
- g.value.verified ? (a(), s("svg", mi, [...p[12] || (p[12] = [
1027
+ onError: Z
1028
+ }, null, 40, hi),
1029
+ e("div", mi, [
1030
+ e("div", yi, [
1031
+ G(o(w.value.name) + " ", 1),
1032
+ w.value.verified ? (a(), s("svg", gi, [..._[12] || (_[12] = [
1033
1033
  e("path", { d: "M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.34 2.19c-1.39-.46-2.9-.2-3.91.81s-1.27 2.52-.81 3.91C2.63 9.33 1.75 10.57 1.75 12s.88 2.67 2.19 3.34c-.46 1.39-.2 2.9.81 3.91s2.52 1.27 3.91.81c.66 1.31 1.91 2.19 3.34 2.19s2.67-.88 3.34-2.19c1.39.46 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z" }, null, -1)
1034
1034
  ])])) : d("", !0)
1035
1035
  ]),
1036
- e("span", yi, n(C.value.timestamp || "Just now"), 1)
1036
+ e("span", ki, o(x.value.timestamp || "Just now"), 1)
1037
1037
  ])
1038
1038
  ]),
1039
- e("div", gi, [
1039
+ e("div", wi, [
1040
1040
  e("p", {
1041
1041
  class: "artifactuse-social-text",
1042
- innerHTML: F.value
1043
- }, null, 8, ki)
1042
+ innerHTML: I.value
1043
+ }, null, 8, Ci)
1044
1044
  ]),
1045
- $.value ? (a(), s("div", wi, [
1046
- e("div", Ci, [
1047
- p[13] || (p[13] = e("svg", {
1045
+ $.value ? (a(), s("div", bi, [
1046
+ e("div", xi, [
1047
+ _[13] || (_[13] = e("svg", {
1048
1048
  viewBox: "0 0 24 24",
1049
1049
  fill: "none",
1050
1050
  stroke: "currentColor",
@@ -1052,10 +1052,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1052
1052
  }, [
1053
1053
  e("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" })
1054
1054
  ], -1)),
1055
- e("span", null, n(I(m.value.likes || 0)), 1)
1055
+ e("span", null, o(z(y.value.likes || 0)), 1)
1056
1056
  ]),
1057
- e("div", bi, [
1058
- p[14] || (p[14] = e("svg", {
1057
+ e("div", $i, [
1058
+ _[14] || (_[14] = e("svg", {
1059
1059
  viewBox: "0 0 24 24",
1060
1060
  fill: "none",
1061
1061
  stroke: "currentColor",
@@ -1063,10 +1063,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1063
1063
  }, [
1064
1064
  e("path", { d: "M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z" })
1065
1065
  ], -1)),
1066
- e("span", null, n(I(m.value.comments || 0)), 1)
1066
+ e("span", null, o(z(y.value.comments || 0)), 1)
1067
1067
  ]),
1068
- e("div", xi, [
1069
- p[15] || (p[15] = e("svg", {
1068
+ e("div", Mi, [
1069
+ _[15] || (_[15] = e("svg", {
1070
1070
  viewBox: "0 0 24 24",
1071
1071
  fill: "none",
1072
1072
  stroke: "currentColor",
@@ -1074,18 +1074,18 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1074
1074
  }, [
1075
1075
  e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
1076
1076
  ], -1)),
1077
- e("span", null, n(I(m.value.shares || 0)), 1)
1077
+ e("span", null, o(z(y.value.shares || 0)), 1)
1078
1078
  ])
1079
1079
  ])) : d("", !0)
1080
- ], 64)) : A.value === "tiktok" ? (a(), s(R, { key: 5 }, [
1081
- e("div", $i, [
1082
- o.value.thumbnail ? (a(), s("img", {
1080
+ ], 64)) : L.value === "tiktok" ? (a(), s(F, { key: 5 }, [
1081
+ e("div", Li, [
1082
+ n.value.thumbnail ? (a(), s("img", {
1083
1083
  key: 0,
1084
- src: o.value.thumbnail,
1085
- alt: o.value.text,
1086
- onError: Z
1087
- }, null, 40, Mi)) : d("", !0),
1088
- p[16] || (p[16] = e("div", { class: "artifactuse-social-play-button" }, [
1084
+ src: n.value.thumbnail,
1085
+ alt: n.value.text,
1086
+ onError: W
1087
+ }, null, 40, Ti)) : d("", !0),
1088
+ _[16] || (_[16] = e("div", { class: "artifactuse-social-play-button" }, [
1089
1089
  e("div", { class: "artifactuse-social-play-icon" }, [
1090
1090
  e("svg", {
1091
1091
  viewBox: "0 0 24 24",
@@ -1095,71 +1095,71 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1095
1095
  ])
1096
1096
  ])
1097
1097
  ], -1)),
1098
- o.value.duration ? (a(), s("div", Li, n(o.value.duration), 1)) : d("", !0)
1098
+ n.value.duration ? (a(), s("div", Ai, o(n.value.duration), 1)) : d("", !0)
1099
1099
  ]),
1100
- e("div", Ti, [
1101
- e("div", Ai, [
1100
+ e("div", Pi, [
1101
+ e("div", Hi, [
1102
1102
  e("img", {
1103
- src: g.value.avatar || _e,
1104
- alt: g.value.name,
1103
+ src: w.value.avatar || _e,
1104
+ alt: w.value.name,
1105
1105
  class: "artifactuse-social-avatar",
1106
- onError: X
1107
- }, null, 40, Hi),
1108
- e("span", Pi, n(g.value.name), 1)
1106
+ onError: Z
1107
+ }, null, 40, Si),
1108
+ e("span", Bi, o(w.value.name), 1)
1109
1109
  ]),
1110
1110
  e("p", {
1111
1111
  class: "artifactuse-social-text",
1112
- innerHTML: F.value
1113
- }, null, 8, Bi),
1114
- o.value.sound ? (a(), s("div", Ei, [
1115
- p[17] || (p[17] = e("svg", {
1112
+ innerHTML: I.value
1113
+ }, null, 8, Ei),
1114
+ n.value.sound ? (a(), s("div", zi, [
1115
+ _[17] || (_[17] = e("svg", {
1116
1116
  viewBox: "0 0 24 24",
1117
1117
  fill: "currentColor"
1118
1118
  }, [
1119
1119
  e("path", { d: "M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" })
1120
1120
  ], -1)),
1121
- K(" " + n(o.value.sound), 1)
1121
+ G(" " + o(n.value.sound), 1)
1122
1122
  ])) : d("", !0),
1123
- $.value ? (a(), s("div", Si, [
1124
- e("span", null, n(I(m.value.likes || 0)) + " likes", 1),
1125
- e("span", null, n(I(m.value.comments || 0)) + " comments", 1),
1126
- e("span", null, n(I(m.value.shares || 0)) + " shares", 1)
1123
+ $.value ? (a(), s("div", Ii, [
1124
+ e("span", null, o(z(y.value.likes || 0)) + " likes", 1),
1125
+ e("span", null, o(z(y.value.comments || 0)) + " comments", 1),
1126
+ e("span", null, o(z(y.value.shares || 0)) + " shares", 1)
1127
1127
  ])) : d("", !0)
1128
1128
  ])
1129
- ], 64)) : A.value === "youtube" ? (a(), s(R, { key: 6 }, [
1130
- e("div", zi, [
1131
- o.value.thumbnail ? (a(), s("img", {
1129
+ ], 64)) : L.value === "youtube" ? (a(), s(F, { key: 6 }, [
1130
+ e("div", Fi, [
1131
+ n.value.thumbnail ? (a(), s("img", {
1132
1132
  key: 0,
1133
- src: o.value.thumbnail,
1134
- alt: o.value.title,
1135
- onError: Z
1136
- }, null, 40, Ii)) : d("", !0),
1137
- o.value.duration ? (a(), s("div", Fi, n(o.value.duration), 1)) : d("", !0)
1133
+ src: n.value.thumbnail,
1134
+ alt: n.value.title,
1135
+ onError: W
1136
+ }, null, 40, Vi)) : d("", !0),
1137
+ n.value.duration ? (a(), s("div", Ri, o(n.value.duration), 1)) : d("", !0)
1138
1138
  ]),
1139
- e("div", Vi, [
1139
+ e("div", qi, [
1140
1140
  e("img", {
1141
- src: g.value.avatar || _e,
1142
- alt: g.value.name,
1141
+ src: w.value.avatar || _e,
1142
+ alt: w.value.name,
1143
1143
  class: "artifactuse-social-avatar",
1144
- onError: X
1145
- }, null, 40, Ri),
1144
+ onError: Z
1145
+ }, null, 40, Oi),
1146
1146
  e("div", null, [
1147
- e("div", qi, n(o.value.title || o.value.text), 1),
1148
- e("div", Oi, n(g.value.name), 1),
1149
- e("div", Ui, n(I(m.value.views || 0)) + " views · " + n(C.value.timestamp || "Just now"), 1)
1147
+ e("div", Ui, o(n.value.title || n.value.text), 1),
1148
+ e("div", Di, o(w.value.name), 1),
1149
+ e("div", ji, o(z(y.value.views || 0)) + " views · " + o(x.value.timestamp || "Just now"), 1)
1150
1150
  ])
1151
1151
  ])
1152
1152
  ], 64)) : d("", !0),
1153
- e("div", Di, [
1154
- e("div", ji, [
1155
- (a(), ke(Bt(J.value))),
1156
- e("span", null, n(O.value), 1)
1153
+ e("div", Ni, [
1154
+ e("div", Ji, [
1155
+ (a(), be(Et(X.value))),
1156
+ e("span", null, o(R.value), 1)
1157
1157
  ]),
1158
1158
  e("button", {
1159
1159
  class: "artifactuse-social-copy-btn",
1160
- onClick: oe
1160
+ onClick: ve
1161
1161
  }, [
1162
- p[18] || (p[18] = e("svg", {
1162
+ _[18] || (_[18] = e("svg", {
1163
1163
  viewBox: "0 0 24 24",
1164
1164
  fill: "none",
1165
1165
  stroke: "currentColor",
@@ -1175,31 +1175,31 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1175
1175
  }),
1176
1176
  e("path", { d: "M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" })
1177
1177
  ], -1)),
1178
- K(" " + n(U.value), 1)
1178
+ G(" " + o(U.value), 1)
1179
1179
  ])
1180
1180
  ])
1181
- ], 10, Da);
1181
+ ], 10, Na);
1182
1182
  };
1183
1183
  }
1184
- }, Ji = ["src", "alt"], Xi = ["src"], Zi = {
1184
+ }, Zi = ["src", "alt"], Wi = ["src"], Ki = {
1185
1185
  key: 2,
1186
1186
  class: "artifactuse-viewer-controls"
1187
- }, Wi = ["title"], Ki = {
1187
+ }, Yi = ["title"], Qi = {
1188
1188
  key: 0,
1189
1189
  viewBox: "0 0 24 24",
1190
1190
  fill: "none",
1191
1191
  stroke: "currentColor",
1192
1192
  "stroke-width": "2"
1193
- }, Yi = {
1193
+ }, Gi = {
1194
1194
  key: 1,
1195
1195
  viewBox: "0 0 24 24",
1196
1196
  fill: "none",
1197
1197
  stroke: "currentColor",
1198
1198
  "stroke-width": "2"
1199
- }, Qi = {
1199
+ }, el = {
1200
1200
  key: 3,
1201
1201
  class: "artifactuse-viewer-caption"
1202
- }, Gi = {
1202
+ }, tl = {
1203
1203
  __name: "ArtifactuseViewer",
1204
1204
  props: {
1205
1205
  // Whether the viewer is open
@@ -1229,63 +1229,63 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1229
1229
  }
1230
1230
  },
1231
1231
  emits: ["close"],
1232
- setup(H, { emit: u }) {
1233
- const h = H, k = u, l = M(null), U = M(!1);
1234
- function S() {
1235
- U.value = !1, k("close");
1232
+ setup(A, { emit: u }) {
1233
+ const h = A, m = u, l = M(null), U = M(!1);
1234
+ function E() {
1235
+ U.value = !1, m("close");
1236
1236
  }
1237
- function A() {
1237
+ function L() {
1238
1238
  h.type === "image" && (U.value = !U.value);
1239
1239
  }
1240
- function g() {
1241
- const m = document.createElement("a");
1242
- m.href = h.src, m.download = h.alt || "download", document.body.appendChild(m), m.click(), document.body.removeChild(m);
1240
+ function w() {
1241
+ const y = document.createElement("a");
1242
+ y.href = h.src, y.download = h.alt || "download", document.body.appendChild(y), y.click(), document.body.removeChild(y);
1243
1243
  }
1244
- function o(m) {
1245
- m.key === "Escape" && h.isOpen && S();
1244
+ function n(y) {
1245
+ y.key === "Escape" && h.isOpen && E();
1246
1246
  }
1247
- return fe(() => h.isOpen, (m) => {
1248
- m ? (ge(() => {
1249
- var C;
1250
- (C = l.value) == null || C.focus();
1247
+ return pe(() => h.isOpen, (y) => {
1248
+ y ? (Ce(() => {
1249
+ var x;
1250
+ (x = l.value) == null || x.focus();
1251
1251
  }), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", U.value = !1);
1252
- }), we(() => {
1253
- document.addEventListener("keydown", o);
1254
- }), Oe(() => {
1255
- document.removeEventListener("keydown", o), document.body.style.overflow = "";
1256
- }), (m, C) => (a(), ke(Et, { to: "body" }, [
1257
- Ae(Me, { name: "artifactuse-viewer" }, {
1258
- default: Le(() => [
1259
- H.isOpen ? (a(), s("div", {
1252
+ }), xe(() => {
1253
+ document.addEventListener("keydown", n);
1254
+ }), De(() => {
1255
+ document.removeEventListener("keydown", n), document.body.style.overflow = "";
1256
+ }), (y, x) => (a(), be(zt, { to: "body" }, [
1257
+ Be(Pe, { name: "artifactuse-viewer" }, {
1258
+ default: He(() => [
1259
+ A.isOpen ? (a(), s("div", {
1260
1260
  key: 0,
1261
1261
  class: "artifactuse-viewer-overlay",
1262
- onClick: S,
1263
- onKeydown: St(S, ["escape"]),
1262
+ onClick: E,
1263
+ onKeydown: It(E, ["escape"]),
1264
1264
  tabindex: "-1",
1265
1265
  ref_key: "overlayRef",
1266
1266
  ref: l
1267
1267
  }, [
1268
1268
  e("div", {
1269
1269
  class: "artifactuse-viewer-content",
1270
- onClick: C[0] || (C[0] = he(() => {
1270
+ onClick: x[0] || (x[0] = ye(() => {
1271
1271
  }, ["stop"]))
1272
1272
  }, [
1273
- H.type === "image" ? (a(), s("img", {
1273
+ A.type === "image" ? (a(), s("img", {
1274
1274
  key: 0,
1275
- src: H.src,
1276
- alt: H.alt,
1277
- class: N(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": U.value }]),
1278
- onClick: A
1279
- }, null, 10, Ji)) : H.type === "pdf" ? (a(), s("iframe", {
1275
+ src: A.src,
1276
+ alt: A.alt,
1277
+ class: J(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": U.value }]),
1278
+ onClick: L
1279
+ }, null, 10, Zi)) : A.type === "pdf" ? (a(), s("iframe", {
1280
1280
  key: 1,
1281
- src: H.src,
1281
+ src: A.src,
1282
1282
  class: "artifactuse-viewer-pdf"
1283
- }, null, 8, Xi)) : d("", !0),
1283
+ }, null, 8, Wi)) : d("", !0),
1284
1284
  e("button", {
1285
1285
  class: "artifactuse-viewer-close",
1286
- onClick: S,
1286
+ onClick: E,
1287
1287
  title: "Close (Esc)"
1288
- }, [...C[1] || (C[1] = [
1288
+ }, [...x[1] || (x[1] = [
1289
1289
  e("svg", {
1290
1290
  viewBox: "0 0 24 24",
1291
1291
  fill: "none",
@@ -1306,13 +1306,13 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1306
1306
  })
1307
1307
  ], -1)
1308
1308
  ])]),
1309
- H.type === "image" ? (a(), s("div", Zi, [
1309
+ A.type === "image" ? (a(), s("div", Ki, [
1310
1310
  e("button", {
1311
1311
  class: "artifactuse-viewer-control",
1312
- onClick: he(A, ["stop"]),
1312
+ onClick: ye(L, ["stop"]),
1313
1313
  title: U.value ? "Zoom out" : "Zoom in"
1314
1314
  }, [
1315
- U.value ? (a(), s("svg", Yi, [...C[3] || (C[3] = [
1315
+ U.value ? (a(), s("svg", Gi, [...x[3] || (x[3] = [
1316
1316
  e("circle", {
1317
1317
  cx: "11",
1318
1318
  cy: "11",
@@ -1330,7 +1330,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1330
1330
  x2: "14",
1331
1331
  y2: "11"
1332
1332
  }, null, -1)
1333
- ])])) : (a(), s("svg", Ki, [...C[2] || (C[2] = [
1333
+ ])])) : (a(), s("svg", Qi, [...x[2] || (x[2] = [
1334
1334
  e("circle", {
1335
1335
  cx: "11",
1336
1336
  cy: "11",
@@ -1355,12 +1355,12 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1355
1355
  y2: "11"
1356
1356
  }, null, -1)
1357
1357
  ])]))
1358
- ], 8, Wi),
1358
+ ], 8, Yi),
1359
1359
  e("button", {
1360
1360
  class: "artifactuse-viewer-control",
1361
- onClick: he(g, ["stop"]),
1361
+ onClick: ye(w, ["stop"]),
1362
1362
  title: "Download"
1363
- }, [...C[4] || (C[4] = [
1363
+ }, [...x[4] || (x[4] = [
1364
1364
  e("svg", {
1365
1365
  viewBox: "0 0 24 24",
1366
1366
  fill: "none",
@@ -1378,7 +1378,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1378
1378
  ], -1)
1379
1379
  ])])
1380
1380
  ])) : d("", !0),
1381
- H.caption ? (a(), s("div", Qi, n(H.caption), 1)) : d("", !0)
1381
+ A.caption ? (a(), s("div", el, o(A.caption), 1)) : d("", !0)
1382
1382
  ])
1383
1383
  ], 544)) : d("", !0)
1384
1384
  ]),
@@ -1386,7 +1386,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1386
1386
  })
1387
1387
  ]));
1388
1388
  }
1389
- }, el = ["innerHTML"], Fn = {
1389
+ }, al = ["innerHTML"], Rn = {
1390
1390
  __name: "ArtifactuseAgentMessage",
1391
1391
  props: {
1392
1392
  // The raw message content (markdown/HTML from AI)
@@ -1414,6 +1414,26 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1414
1414
  isLastMessage: {
1415
1415
  type: Boolean,
1416
1416
  default: !1
1417
+ },
1418
+ // Override global inlinePreview config for this message
1419
+ inlinePreview: {
1420
+ type: Object,
1421
+ default: null
1422
+ },
1423
+ // Show full inline code (no extraction) for listed languages
1424
+ inlineCode: {
1425
+ type: Object,
1426
+ default: null
1427
+ },
1428
+ // Override visible panel tabs for artifacts from this message
1429
+ tabs: {
1430
+ type: Array,
1431
+ default: null
1432
+ },
1433
+ // Override initial panel view mode for artifacts from this message
1434
+ viewMode: {
1435
+ type: String,
1436
+ default: null
1417
1437
  }
1418
1438
  },
1419
1439
  emits: [
@@ -1427,30 +1447,33 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1427
1447
  "social-copy",
1428
1448
  "media-open"
1429
1449
  ],
1430
- setup(H, { expose: u, emit: h }) {
1431
- const k = H, l = h, {
1450
+ setup(A, { expose: u, emit: h }) {
1451
+ const m = A, l = h, {
1432
1452
  processMessage: U,
1433
- openArtifact: S,
1434
- state: A,
1435
- getTheme: g,
1436
- instance: o
1437
- } = He(), m = M(null), C = M(null), $ = M(""), q = M([]);
1438
- let O = null;
1439
- const J = M(!1), F = M("image"), ee = M(""), I = M(""), te = M(""), X = b(() => (g == null ? void 0 : g()) || "dark"), Z = b(() => A.activeArtifactId), oe = M(!1);
1440
- we(() => {
1441
- k.typing && (oe.value = !0);
1442
- }), fe(() => k.typing, (x) => {
1443
- x && (oe.value = !0);
1453
+ openArtifact: E,
1454
+ state: L,
1455
+ getTheme: w,
1456
+ instance: n
1457
+ } = Ee(), y = M(null), x = M(null), $ = M(""), V = M([]);
1458
+ let R = null;
1459
+ const X = M(!1), I = M("image"), te = M(""), z = M(""), ae = M(""), Z = b(() => (w == null ? void 0 : w()) || "dark"), W = b(() => L.activeArtifactId), ve = b(() => {
1460
+ var C;
1461
+ return m.inlineCards ?? ((C = n == null ? void 0 : n.config) == null ? void 0 : C.inlineCards) ?? !0;
1462
+ }), f = M(!1);
1463
+ xe(() => {
1464
+ m.typing && (f.value = !0);
1465
+ }), pe(() => m.typing, (C) => {
1466
+ C && (f.value = !0);
1444
1467
  });
1445
- const f = b(() => oe.value || k.isLastMessage ? "active" : "inactive");
1446
- function p(x) {
1447
- if (!x) return null;
1468
+ const _ = b(() => f.value || m.isLastMessage ? "active" : "inactive");
1469
+ function ie(C) {
1470
+ if (!C) return null;
1448
1471
  try {
1449
- const V = decodeURIComponent(escape(atob(x)));
1450
- return JSON.parse(V);
1472
+ const q = decodeURIComponent(escape(atob(C)));
1473
+ return JSON.parse(q);
1451
1474
  } catch {
1452
1475
  try {
1453
- const D = x.replace(/&#10;/g, `
1476
+ const D = C.replace(/&#10;/g, `
1454
1477
  `).replace(/&#13;/g, "\r").replace(/&#9;/g, " ").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&");
1455
1478
  return JSON.parse(D);
1456
1479
  } catch (D) {
@@ -1458,650 +1481,688 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
1458
1481
  }
1459
1482
  }
1460
1483
  }
1461
- const ae = b(() => {
1462
- const x = [], V = $.value;
1463
- if (!V) return x;
1484
+ const H = b(() => {
1485
+ const C = [], q = $.value;
1486
+ if (!q) return C;
1464
1487
  const D = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
1465
- let re = 0, z;
1466
- for (; (z = D.exec(V)) !== null; ) {
1467
- if (z.index > re) {
1468
- const B = V.slice(re, z.index);
1469
- B.trim() && x.push({ type: "html", content: B });
1488
+ let Y = 0, P;
1489
+ for (; (P = D.exec(q)) !== null; ) {
1490
+ if (P.index > Y) {
1491
+ const j = q.slice(Y, P.index);
1492
+ j.trim() && C.push({ type: "html", content: j });
1470
1493
  }
1471
- const G = p(z[3]), v = z[2];
1472
- G && (v === "form" && G.isInline ? x.push({ type: "form", artifact: G }) : v === "social" ? x.push({ type: "social", artifact: G }) : x.push({ type: "panel", artifact: G })), re = z.index + z[0].length;
1494
+ const N = ie(P[3]), v = P[2];
1495
+ N && (v === "form" && N.isInline ? C.push({ type: "form", artifact: N }) : v === "social" ? C.push({ type: "social", artifact: N }) : C.push({ type: "panel", artifact: N })), Y = P.index + P[0].length;
1473
1496
  }
1474
- if (re < V.length) {
1475
- const G = V.slice(re);
1476
- G.trim() && x.push({ type: "html", content: G });
1497
+ if (Y < q.length) {
1498
+ const N = q.slice(Y);
1499
+ N.trim() && C.push({ type: "html", content: N });
1477
1500
  }
1478
- return x.length === 0 && V.trim() && x.push({ type: "html", content: V }), x;
1501
+ return C.length === 0 && q.trim() && C.push({ type: "html", content: q }), C;
1479
1502
  });
1480
- function L(x) {
1481
- F.value = x.type || "image", ee.value = x.src || "", I.value = x.alt || "", te.value = x.caption || "", J.value = !0, l("media-open", x);
1503
+ function K(C) {
1504
+ I.value = C.type || "image", te.value = C.src || "", z.value = C.alt || "", ae.value = C.caption || "", X.value = !0, l("media-open", C);
1482
1505
  }
1483
- function Y() {
1484
- J.value = !1, ee.value = "", I.value = "", te.value = "";
1506
+ function ee() {
1507
+ X.value = !1, te.value = "", z.value = "", ae.value = "";
1485
1508
  }
1486
- function Q() {
1487
- if (!C.value) return;
1488
- C.value.querySelectorAll('img[data-lightbox="true"]').forEach((v) => {
1489
- v._lightboxHandler && v.removeEventListener("click", v._lightboxHandler), v._lightboxHandler = (B) => {
1490
- B.preventDefault(), B.stopPropagation(), L({
1509
+ function p() {
1510
+ if (!x.value) return;
1511
+ x.value.querySelectorAll('img[data-lightbox="true"]').forEach((v) => {
1512
+ v._lightboxHandler && v.removeEventListener("click", v._lightboxHandler), v._lightboxHandler = (j) => {
1513
+ j.preventDefault(), j.stopPropagation(), K({
1491
1514
  type: "image",
1492
1515
  src: v.src,
1493
1516
  alt: v.alt || "",
1494
1517
  caption: v.dataset.caption || v.alt || ""
1495
1518
  });
1496
1519
  }, v.addEventListener("click", v._lightboxHandler), v.style.cursor = "zoom-in";
1497
- }), C.value.querySelectorAll(".artifactuse-image-container img").forEach((v) => {
1498
- v._lightboxHandler || (v._lightboxHandler = (B) => {
1499
- B.preventDefault(), B.stopPropagation();
1500
- const W = v.closest(".artifactuse-image-container"), se = W == null ? void 0 : W.querySelector(".artifactuse-image-caption"), Ce = (se == null ? void 0 : se.textContent) || v.dataset.caption || v.alt || "";
1501
- L({
1520
+ }), x.value.querySelectorAll(".artifactuse-image-container img").forEach((v) => {
1521
+ v._lightboxHandler || (v._lightboxHandler = (j) => {
1522
+ j.preventDefault(), j.stopPropagation();
1523
+ const se = v.closest(".artifactuse-image-container"), oe = se == null ? void 0 : se.querySelector(".artifactuse-image-caption"), $e = (oe == null ? void 0 : oe.textContent) || v.dataset.caption || v.alt || "";
1524
+ K({
1502
1525
  type: "image",
1503
1526
  src: v.src,
1504
1527
  alt: v.alt || "",
1505
- caption: Ce
1528
+ caption: $e
1506
1529
  });
1507
1530
  }, v.addEventListener("click", v._lightboxHandler), v.style.cursor = "zoom-in");
1508
- }), C.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((v) => {
1509
- v._lightboxHandler || (v._lightboxHandler = (B) => {
1510
- B.preventDefault(), B.stopPropagation();
1511
- const W = v.closest(".artifactuse-gallery-item"), se = W == null ? void 0 : W.querySelector(".artifactuse-gallery-caption"), Ce = (se == null ? void 0 : se.textContent) || v.dataset.caption || v.alt || "";
1512
- L({
1531
+ }), x.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((v) => {
1532
+ v._lightboxHandler || (v._lightboxHandler = (j) => {
1533
+ j.preventDefault(), j.stopPropagation();
1534
+ const se = v.closest(".artifactuse-gallery-item"), oe = se == null ? void 0 : se.querySelector(".artifactuse-gallery-caption"), $e = (oe == null ? void 0 : oe.textContent) || v.dataset.caption || v.alt || "";
1535
+ K({
1513
1536
  type: "image",
1514
1537
  src: v.src,
1515
1538
  alt: v.alt || "",
1516
- caption: Ce
1539
+ caption: $e
1517
1540
  });
1518
1541
  }, v.addEventListener("click", v._lightboxHandler), v.style.cursor = "zoom-in");
1519
- }), C.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((v) => {
1520
- v._pdfHandler && v.removeEventListener("click", v._pdfHandler), v._pdfHandler = (B) => {
1521
- B.preventDefault(), B.stopPropagation(), L({
1542
+ }), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((v) => {
1543
+ v._pdfHandler && v.removeEventListener("click", v._pdfHandler), v._pdfHandler = (j) => {
1544
+ j.preventDefault(), j.stopPropagation(), K({
1522
1545
  type: "pdf",
1523
1546
  src: v.href,
1524
1547
  alt: v.textContent || "PDF Document",
1525
1548
  caption: v.title || v.textContent || ""
1526
1549
  });
1527
1550
  }, v.addEventListener("click", v._pdfHandler);
1528
- }), C.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((v) => {
1529
- var W;
1551
+ }), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((v) => {
1552
+ var se;
1530
1553
  v._pdfHandler && v.removeEventListener("click", v._pdfHandler);
1531
- const B = v.dataset.pdfSrc || ((W = v.querySelector("iframe")) == null ? void 0 : W.src) || "";
1532
- B && (v._pdfHandler = (se) => {
1533
- se.preventDefault(), se.stopPropagation(), L({
1554
+ const j = v.dataset.pdfSrc || ((se = v.querySelector("iframe")) == null ? void 0 : se.src) || "";
1555
+ j && (v._pdfHandler = (oe) => {
1556
+ oe.preventDefault(), oe.stopPropagation(), K({
1534
1557
  type: "pdf",
1535
- src: B,
1558
+ src: j,
1536
1559
  alt: "PDF Document",
1537
1560
  caption: v.dataset.caption || ""
1538
1561
  });
1539
1562
  }, v.addEventListener("click", v._pdfHandler), v.style.cursor = "pointer");
1540
- }), C.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((v) => {
1541
- v._clickHandler && v.removeEventListener("click", v._clickHandler), v._clickHandler = (B) => {
1542
- if (B.target.closest(".artifactuse-video-play-button")) return;
1543
- const W = v.dataset.videoUrl || v.dataset.url;
1544
- W && window.open(W, "_blank", "noopener,noreferrer");
1563
+ }), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((v) => {
1564
+ v._clickHandler && v.removeEventListener("click", v._clickHandler), v._clickHandler = (j) => {
1565
+ if (j.target.closest(".artifactuse-video-play-button")) return;
1566
+ const se = v.dataset.videoUrl || v.dataset.url;
1567
+ se && window.open(se, "_blank", "noopener,noreferrer");
1545
1568
  }, v.addEventListener("click", v._clickHandler);
1546
1569
  });
1547
1570
  }
1548
- function _() {
1549
- if (!C.value) return;
1550
- C.value.querySelectorAll("img").forEach((z) => {
1551
- z._lightboxHandler && (z.removeEventListener("click", z._lightboxHandler), delete z._lightboxHandler);
1552
- }), C.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((z) => {
1553
- z._pdfHandler && (z.removeEventListener("click", z._pdfHandler), delete z._pdfHandler);
1554
- }), C.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((z) => {
1555
- z._pdfHandler && (z.removeEventListener("click", z._pdfHandler), delete z._pdfHandler);
1556
- }), C.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((z) => {
1557
- z._clickHandler && (z.removeEventListener("click", z._clickHandler), delete z._clickHandler);
1571
+ function T() {
1572
+ if (!x.value) return;
1573
+ x.value.querySelectorAll("img").forEach((P) => {
1574
+ P._lightboxHandler && (P.removeEventListener("click", P._lightboxHandler), delete P._lightboxHandler);
1575
+ }), x.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((P) => {
1576
+ P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
1577
+ }), x.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((P) => {
1578
+ P._pdfHandler && (P.removeEventListener("click", P._pdfHandler), delete P._pdfHandler);
1579
+ }), x.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((P) => {
1580
+ P._clickHandler && (P.removeEventListener("click", P._clickHandler), delete P._clickHandler);
1558
1581
  });
1559
1582
  }
1560
- function T() {
1561
- O && clearTimeout(O), O = setTimeout(async () => {
1562
- if (await ge(), o != null && o.initializeContent && C.value)
1583
+ function r() {
1584
+ R && clearTimeout(R), R = setTimeout(async () => {
1585
+ if (await Ce(), n != null && n.initializeContent && x.value)
1563
1586
  try {
1564
- await o.initializeContent(C.value);
1565
- } catch (x) {
1566
- console.error("Failed to initialize content:", x);
1587
+ await n.initializeContent(x.value);
1588
+ } catch (C) {
1589
+ console.error("Failed to initialize content:", C);
1567
1590
  }
1568
- Q();
1591
+ p();
1569
1592
  }, 100);
1570
1593
  }
1571
- fe(
1572
- () => k.content,
1573
- (x) => {
1574
- if (x) {
1575
- const V = U(x, k.messageId);
1576
- $.value = V.html, q.value = V.artifacts, V.artifacts.length > 0 && l("artifact-detected", V.artifacts), k.typing || T();
1594
+ pe(
1595
+ () => m.content,
1596
+ (C) => {
1597
+ if (C) {
1598
+ const q = U(C, m.messageId, {
1599
+ inlinePreview: m.inlinePreview,
1600
+ inlineCode: m.inlineCode,
1601
+ tabs: m.tabs,
1602
+ viewMode: m.viewMode
1603
+ });
1604
+ $.value = q.html, V.value = q.artifacts, q.artifacts.length > 0 && l("artifact-detected", q.artifacts), m.typing || r();
1577
1605
  }
1578
1606
  },
1579
1607
  { immediate: !0 }
1580
- ), fe(
1581
- () => k.typing,
1582
- (x, V) => {
1583
- V === !0 && x === !1 && T();
1608
+ ), pe(
1609
+ () => m.typing,
1610
+ (C, q) => {
1611
+ q === !0 && C === !1 && r();
1584
1612
  }
1585
- ), we(() => {
1586
- k.typing || T();
1587
- }), zt(() => {
1588
- O && clearTimeout(O), _();
1613
+ ), xe(() => {
1614
+ m.typing || r();
1615
+ }), Ft(() => {
1616
+ R && clearTimeout(R), T();
1589
1617
  });
1590
- function r(x) {
1591
- S(x), l("artifact-open", x);
1618
+ function B(C) {
1619
+ const q = C.target.closest(".artifactuse-inline-preview");
1620
+ if (q) {
1621
+ const D = q.dataset.artifactId;
1622
+ if (D) {
1623
+ const Y = L.artifacts.find((P) => P.id === D);
1624
+ Y && c(Y);
1625
+ }
1626
+ }
1592
1627
  }
1593
- function E(x) {
1594
- l("artifact-copy", x);
1628
+ function c(C) {
1629
+ E(C), l("artifact-open", C);
1595
1630
  }
1596
- function c(x) {
1597
- l("artifact-download", x);
1631
+ function S(C) {
1632
+ l("artifact-copy", C);
1598
1633
  }
1599
- function P(x) {
1600
- l("form-submit", x);
1634
+ function ne(C) {
1635
+ l("artifact-download", C);
1601
1636
  }
1602
- function ne(x) {
1603
- l("form-cancel", x);
1637
+ function ue(C) {
1638
+ l("form-submit", C);
1604
1639
  }
1605
- function ce(x) {
1606
- l("form-button-click", x);
1640
+ function fe(C) {
1641
+ l("form-cancel", C);
1607
1642
  }
1608
- function de(x) {
1609
- l("social-copy", x);
1643
+ function Le(C) {
1644
+ l("form-button-click", C);
1610
1645
  }
1611
- return b(() => A.artifacts.filter((x) => x.messageId === k.messageId)), u({
1612
- openViewer: L,
1613
- closeViewer: Y,
1614
- attachMediaListeners: Q
1615
- }), (x, V) => (a(), s("div", {
1646
+ function he(C) {
1647
+ l("social-copy", C);
1648
+ }
1649
+ return b(() => L.artifacts.filter((C) => C.messageId === m.messageId)), u({
1650
+ openViewer: K,
1651
+ closeViewer: ee,
1652
+ attachMediaListeners: p
1653
+ }), (C, q) => (a(), s("div", {
1616
1654
  class: "artifactuse-agent-message",
1617
1655
  ref_key: "messageRef",
1618
- ref: m
1656
+ ref: y
1619
1657
  }, [
1620
1658
  e("div", {
1621
1659
  class: "artifactuse-message-content",
1622
1660
  ref_key: "contentRef",
1623
- ref: C
1661
+ ref: x,
1662
+ onClick: B
1624
1663
  }, [
1625
- (a(!0), s(R, null, ue(ae.value, (D, re) => (a(), s(R, { key: re }, [
1664
+ (a(!0), s(F, null, de(H.value, (D, Y) => (a(), s(F, { key: Y }, [
1626
1665
  D.type === "html" ? (a(), s("div", {
1627
1666
  key: 0,
1628
1667
  innerHTML: D.content
1629
- }, null, 8, el)) : D.type === "form" && D.artifact.isInline ? (a(), ke(Ua, {
1668
+ }, null, 8, al)) : D.type === "form" && D.artifact.isInline ? (a(), be(ja, {
1630
1669
  key: 1,
1631
1670
  artifact: D.artifact,
1632
- theme: X.value,
1633
- "initial-state": f.value,
1634
- onSubmit: P,
1635
- onCancel: ne,
1636
- onButtonClick: ce
1637
- }, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), ke(Ni, {
1671
+ theme: Z.value,
1672
+ "initial-state": _.value,
1673
+ onSubmit: ue,
1674
+ onCancel: fe,
1675
+ onButtonClick: Le
1676
+ }, null, 8, ["artifact", "theme", "initial-state"])) : D.type === "social" ? (a(), be(Xi, {
1638
1677
  key: 2,
1639
1678
  artifact: D.artifact,
1640
- theme: X.value,
1641
- onCopy: de
1642
- }, null, 8, ["artifact", "theme"])) : D.type === "panel" && H.inlineCards ? (a(), ke(Gt, {
1679
+ theme: Z.value,
1680
+ onCopy: he
1681
+ }, null, 8, ["artifact", "theme"])) : D.type === "panel" && ve.value ? (a(), be(ta, {
1643
1682
  key: 3,
1644
1683
  artifact: D.artifact,
1645
- "is-active": Z.value === D.artifact.id,
1646
- onOpen: r,
1647
- onCopy: E,
1648
- onDownload: c
1684
+ "is-active": W.value === D.artifact.id,
1685
+ onOpen: c,
1686
+ onCopy: S,
1687
+ onDownload: ne
1649
1688
  }, null, 8, ["artifact", "is-active"])) : d("", !0)
1650
1689
  ], 64))), 128))
1651
1690
  ], 512),
1652
- Ae(Gi, {
1653
- "is-open": J.value,
1654
- type: F.value,
1655
- src: ee.value,
1656
- alt: I.value,
1657
- caption: te.value,
1658
- onClose: Y
1691
+ Be(tl, {
1692
+ "is-open": X.value,
1693
+ type: I.value,
1694
+ src: te.value,
1695
+ alt: z.value,
1696
+ caption: ae.value,
1697
+ onClose: ee
1659
1698
  }, null, 8, ["is-open", "type", "src", "alt", "caption"])
1660
1699
  ], 512));
1661
1700
  }
1662
- }, tl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, al = { class: "artifactuse-panel__actions" }, sl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, il = {
1701
+ }, sl = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, il = { class: "artifactuse-panel__actions" }, ll = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, nl = {
1663
1702
  key: 0,
1664
1703
  href: "https://artifactuse.com",
1665
1704
  target: "_blank",
1666
1705
  rel: "noopener noreferrer",
1667
1706
  class: "artifactuse-panel__branding"
1668
- }, ll = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, nl = { class: "artifactuse-panel__title" }, ol = { class: "artifactuse-panel__title-content" }, rl = { class: "artifactuse-panel__meta" }, cl = { class: "artifactuse-panel__actions" }, ul = ["disabled"], dl = {
1707
+ }, ol = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, rl = { class: "artifactuse-panel__title" }, cl = { class: "artifactuse-panel__title-content" }, ul = { class: "artifactuse-panel__meta" }, dl = { class: "artifactuse-panel__actions" }, vl = ["disabled"], fl = {
1669
1708
  key: 0,
1670
1709
  viewBox: "0 0 24 24",
1671
1710
  fill: "none",
1672
1711
  stroke: "currentColor",
1673
1712
  "stroke-width": "2"
1674
- }, vl = {
1713
+ }, pl = {
1675
1714
  key: 1,
1676
1715
  class: "artifactuse-panel__spinner-icon",
1677
1716
  viewBox: "0 0 24 24",
1678
1717
  fill: "none",
1679
1718
  stroke: "currentColor",
1680
1719
  "stroke-width": "2"
1681
- }, fl = { class: "artifactuse-panel__list" }, pl = { class: "artifactuse-panel__list-items" }, _l = ["onClick"], hl = ["innerHTML"], ml = { class: "artifactuse-panel__list-item-content" }, yl = { class: "artifactuse-panel__list-item-title" }, gl = { class: "artifactuse-panel__list-item-meta" }, kl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, wl = {
1720
+ }, _l = { class: "artifactuse-panel__list" }, hl = { class: "artifactuse-panel__list-items" }, ml = ["onClick"], yl = ["innerHTML"], gl = { class: "artifactuse-panel__list-item-content" }, kl = { class: "artifactuse-panel__list-item-title" }, wl = { class: "artifactuse-panel__list-item-meta" }, Cl = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, bl = {
1682
1721
  key: 0,
1683
1722
  href: "https://artifactuse.com",
1684
1723
  target: "_blank",
1685
1724
  rel: "noopener noreferrer",
1686
1725
  class: "artifactuse-panel__branding"
1687
- }, Cl = { class: "artifactuse-panel__header" }, bl = { class: "artifactuse-panel__title" }, xl = ["innerHTML"], $l = { class: "artifactuse-panel__title-content" }, Ml = { class: "artifactuse-panel__name" }, Ll = { class: "artifactuse-panel__meta" }, Tl = { class: "artifactuse-panel__tabs" }, Al = ["disabled"], Hl = ["disabled"], Pl = { class: "artifactuse-panel__actions" }, Bl = ["title"], El = {
1726
+ }, xl = { class: "artifactuse-panel__header" }, $l = { class: "artifactuse-panel__title" }, Ml = ["innerHTML"], Ll = { class: "artifactuse-panel__title-content" }, Tl = { class: "artifactuse-panel__name" }, Al = { class: "artifactuse-panel__meta" }, Pl = { class: "artifactuse-panel__tabs" }, Hl = ["disabled"], Sl = ["disabled"], Bl = { class: "artifactuse-panel__actions" }, El = ["title"], zl = {
1688
1727
  key: 0,
1689
1728
  viewBox: "0 0 24 24",
1690
1729
  fill: "none",
1691
1730
  stroke: "currentColor",
1692
1731
  "stroke-width": "2"
1693
- }, Sl = {
1732
+ }, Il = {
1694
1733
  key: 1,
1695
1734
  viewBox: "0 0 24 24",
1696
1735
  fill: "none",
1697
1736
  stroke: "currentColor",
1698
1737
  "stroke-width": "2"
1699
- }, zl = {
1738
+ }, Fl = {
1700
1739
  key: 0,
1701
1740
  class: "artifactuse-panel__loading"
1702
- }, Il = {
1741
+ }, Vl = {
1703
1742
  key: 0,
1704
1743
  class: "artifactuse-panel__loading"
1705
- }, Fl = ["src"], Vl = {
1744
+ }, Rl = ["src"], ql = {
1706
1745
  key: 2,
1707
1746
  class: "artifactuse-panel__no-preview"
1708
- }, Rl = { class: "artifactuse-panel__edit" }, ql = { class: "artifactuse-panel__footer" }, Ol = { class: "artifactuse-panel__footer-left" }, Ul = {
1747
+ }, Ol = { class: "artifactuse-panel__edit" }, Ul = { class: "artifactuse-panel__footer" }, Dl = { class: "artifactuse-panel__footer-left" }, jl = {
1709
1748
  key: 0,
1710
1749
  href: "https://artifactuse.com",
1711
1750
  target: "_blank",
1712
1751
  rel: "noopener noreferrer",
1713
1752
  class: "artifactuse-panel__branding"
1714
- }, Dl = {
1753
+ }, Nl = {
1715
1754
  key: 1,
1716
1755
  class: "artifactuse-panel__badge"
1717
- }, jl = { class: "artifactuse-panel__footer-right" }, Nl = ["title"], Jl = {
1756
+ }, Jl = { class: "artifactuse-panel__footer-right" }, Xl = ["title"], Zl = {
1718
1757
  key: 0,
1719
1758
  viewBox: "0 0 24 24",
1720
1759
  fill: "none",
1721
1760
  stroke: "currentColor",
1722
1761
  "stroke-width": "2"
1723
- }, Xl = {
1762
+ }, Wl = {
1724
1763
  key: 1,
1725
1764
  viewBox: "0 0 24 24",
1726
1765
  fill: "none",
1727
1766
  stroke: "currentColor",
1728
1767
  "stroke-width": "2"
1729
- }, Zl = {
1768
+ }, Kl = {
1730
1769
  key: 0,
1731
1770
  style: { position: "relative" }
1732
- }, Wl = {
1771
+ }, Yl = {
1733
1772
  key: 0,
1734
1773
  class: "artifactuse-share-popup"
1735
- }, Kl = { class: "artifactuse-share-popup__header" }, Yl = { class: "artifactuse-share-popup__title" }, Ql = { class: "artifactuse-share-popup__body" }, Gl = {
1774
+ }, Ql = { class: "artifactuse-share-popup__header" }, Gl = { class: "artifactuse-share-popup__title" }, en = { class: "artifactuse-share-popup__body" }, tn = {
1736
1775
  key: 0,
1737
1776
  class: "artifactuse-share-popup__loading"
1738
- }, en = { key: 1 }, tn = { class: "artifactuse-share-popup__error" }, an = { class: "artifactuse-share-popup__error-text" }, sn = { class: "artifactuse-share-popup__actions" }, ln = {
1777
+ }, an = { key: 1 }, sn = { class: "artifactuse-share-popup__error" }, ln = { class: "artifactuse-share-popup__error-text" }, nn = { class: "artifactuse-share-popup__actions" }, on = {
1739
1778
  key: 2,
1740
1779
  class: "artifactuse-share-popup__options"
1741
- }, nn = { key: 3 }, on = {
1780
+ }, rn = { key: 3 }, cn = {
1742
1781
  key: 0,
1743
1782
  class: "artifactuse-share-popup__loading"
1744
- }, rn = {
1783
+ }, un = {
1745
1784
  key: 1,
1746
1785
  class: "artifactuse-share-popup__empty"
1747
- }, cn = {
1786
+ }, dn = {
1748
1787
  key: 2,
1749
1788
  class: "artifactuse-share-popup__artifact-list"
1750
- }, un = ["onClick"], dn = { class: "artifactuse-share-popup__artifact-name" }, vn = { class: "artifactuse-share-popup__artifact-date" }, fn = {
1789
+ }, vn = ["onClick"], fn = { class: "artifactuse-share-popup__artifact-name" }, pn = { class: "artifactuse-share-popup__artifact-date" }, _n = {
1751
1790
  key: 4,
1752
1791
  class: "artifactuse-share-popup__success"
1753
- }, pn = { class: "artifactuse-share-popup__link-wrapper" }, _n = ["value"], hn = {
1792
+ }, hn = { class: "artifactuse-share-popup__link-wrapper" }, mn = ["value"], yn = {
1754
1793
  key: 0,
1755
1794
  class: "artifactuse-share-popup__expiry"
1756
- }, mn = { class: "artifactuse-share-popup__expiry-text" }, yn = {
1795
+ }, gn = { class: "artifactuse-share-popup__expiry-text" }, kn = {
1757
1796
  key: 1,
1758
1797
  class: "artifactuse-share-popup__save-prompt"
1759
- }, gn = {
1798
+ }, wn = {
1760
1799
  key: 2,
1761
1800
  class: "artifactuse-panel__nav"
1762
- }, kn = ["disabled"], wn = ["disabled"], Cn = {
1801
+ }, Cn = ["disabled"], bn = ["disabled"], xn = {
1763
1802
  key: 0,
1764
1803
  class: "artifactuse-panel__artifact-list"
1765
- }, bn = { class: "artifactuse-panel__artifact-list-header" }, xn = { class: "artifactuse-panel__artifact-list-items" }, $n = ["onClick"], Mn = ["innerHTML"], Ln = { class: "artifactuse-panel__artifact-item-content" }, Tn = { class: "artifactuse-panel__artifact-item-title" }, An = { class: "artifactuse-panel__artifact-item-meta" }, Hn = { class: "artifactuse-panel__artifact-item-index" }, Vn = {
1804
+ }, $n = { class: "artifactuse-panel__artifact-list-header" }, Mn = { class: "artifactuse-panel__artifact-list-items" }, Ln = ["onClick"], Tn = ["innerHTML"], An = { class: "artifactuse-panel__artifact-item-content" }, Pn = { class: "artifactuse-panel__artifact-item-title" }, Hn = { class: "artifactuse-panel__artifact-item-meta" }, Sn = { class: "artifactuse-panel__artifact-item-index" }, qn = {
1766
1805
  __name: "ArtifactusePanel",
1767
1806
  emits: ["close", "ai-request", "save", "export", "resize"],
1768
- setup(H, { emit: u }) {
1807
+ setup(A, { emit: u }) {
1769
1808
  const h = u, {
1770
- state: k,
1809
+ state: m,
1771
1810
  activeArtifact: l,
1772
1811
  artifactCount: U,
1773
- hasArtifacts: S,
1774
- closePanel: A,
1775
- toggleFullscreen: g,
1776
- setViewMode: o,
1777
- getPanelUrl: m,
1778
- openArtifact: C,
1812
+ hasArtifacts: E,
1813
+ closePanel: L,
1814
+ toggleFullscreen: w,
1815
+ setViewMode: n,
1816
+ getPanelUrl: y,
1817
+ openArtifact: x,
1779
1818
  instance: $
1780
- } = He(), q = M(null), O = M(null), J = M(null), F = M(null), ee = M(null), I = M(null), te = M(!1), X = M(!1), Z = M(!0), oe = M(!1), f = M(!1), p = M(!1), ae = M(!1), L = M("options"), Y = M(""), Q = M(null), _ = M(""), T = M(!1), r = M(!1), E = M([]), c = M(!1), P = M("");
1781
- let ne = null, ce = null, de = null;
1782
- const x = b(() => {
1819
+ } = Ee(), V = M(null), R = M(null), X = M(null), I = M(null), te = M(null), z = M(null), ae = M(!1), Z = M(!1), W = M(!0), ve = M(!1), f = M(!1), _ = M(!1), ie = M(!1), H = M("options"), K = M(""), ee = M(null), p = M(""), T = M(!1), r = M(!1), B = M([]), c = M(!1), S = M("");
1820
+ let ne = null, ue = null, fe = null;
1821
+ const Le = b(() => {
1783
1822
  var i;
1784
1823
  return ((i = $.editor) == null ? void 0 : i.isAvailable()) || !1;
1785
- }), V = M(65), D = M(50), re = b(() => l.value ? Te(l.value.language) : ""), z = b(() => l.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${Re(l.value.language)}</svg>` : ""), G = b(() => {
1824
+ }), he = M(65), C = M(50), q = b(() => l.value ? Se(l.value.language) : ""), D = b(() => l.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${Oe(l.value.language)}</svg>` : ""), Y = b(() => {
1786
1825
  if (!l.value) return null;
1787
- let i = m(l.value);
1826
+ let i = y(l.value);
1788
1827
  return i && l.value._refreshToken && (i += (i.includes("?") ? "&" : "?") + "_t=" + l.value._refreshToken), i;
1789
1828
  });
1790
- b(() => !l.value || !k.artifacts.length ? -1 : k.artifacts.findIndex((i) => i.id === l.value.id));
1791
- const v = b(() => l.value ? Vt(l.value.language || "plaintext") : "plaintext"), B = b(() => k.artifacts.filter((i) => !i.isInline)), W = b(() => l.value ? B.value.findIndex((i) => i.id === l.value.id) : -1), se = b(() => {
1829
+ b(() => !l.value || !m.artifacts.length ? -1 : m.artifacts.findIndex((i) => i.id === l.value.id));
1830
+ const P = b(() => l.value ? qt(l.value.language || "plaintext") : "plaintext"), N = b(() => m.artifacts.filter((i) => !i.isInline)), v = b(() => l.value ? N.value.findIndex((i) => i.id === l.value.id) : -1), j = b(() => {
1792
1831
  var i;
1793
1832
  return ((i = $.config) == null ? void 0 : i.branding) !== !1;
1794
- }), Ce = b(() => {
1833
+ }), se = b(() => {
1795
1834
  var i;
1796
1835
  return ((i = $.share) == null ? void 0 : i.enabled) !== !1;
1797
- }), Ue = b(() => {
1836
+ }), oe = b(() => {
1798
1837
  var i;
1799
1838
  return ((i = $.share) == null ? void 0 : i.isAuthenticated()) || !1;
1800
- }), lt = b(() => l.value ? V.value : Math.min(V.value, 30));
1801
- function De(i) {
1802
- return `<svg viewBox="0 0 24 24" fill="currentColor">${Re(i)}</svg>`;
1839
+ }), $e = b(() => l.value ? he.value : Math.min(he.value, 30));
1840
+ function je(i) {
1841
+ return `<svg viewBox="0 0 24 24" fill="currentColor">${Oe(i)}</svg>`;
1803
1842
  }
1804
- function nt() {
1843
+ function rt() {
1805
1844
  f.value = !1, $.state.clearActiveArtifact();
1806
1845
  }
1807
- function ot() {
1808
- var i;
1809
- if (F.value && ((i = l.value) != null && i.code)) {
1810
- const t = l.value.code.split(`
1846
+ function Ne(i) {
1847
+ if (i.language !== "smartdiff") return null;
1848
+ try {
1849
+ const t = JSON.parse(i.code);
1850
+ if (t.oldCode === void 0 || t.newCode === void 0) return null;
1851
+ const g = t.language || "plaintext", O = at() && window.Prism.languages[g], Q = Ot(t.oldCode, t.newCode).split(`
1811
1852
  `);
1812
- F.value.innerHTML = t.map((w, j) => `<div>${j + 1}</div>`).join("");
1853
+ return { html: Q.map((ce) => {
1854
+ const re = ce[0], we = ce.slice(1), ge = O ? window.Prism.highlight(we, O, g) : we;
1855
+ return re === "-" ? `<span class="token deleted">${ge}</span>` : re === "+" ? `<span class="token inserted">${ge}</span>` : ge;
1856
+ }).join(`
1857
+ `), lineCount: Q.length };
1858
+ } catch {
1859
+ return null;
1813
1860
  }
1814
1861
  }
1815
- function rt() {
1862
+ function ct() {
1863
+ var i;
1864
+ if (I.value && ((i = l.value) != null && i.code)) {
1865
+ const t = Ne(l.value), g = t ? t.lineCount : l.value.code.split(`
1866
+ `).length;
1867
+ I.value.innerHTML = Array.from({ length: g }, (O, Q) => `<div>${Q + 1}</div>`).join("");
1868
+ }
1869
+ }
1870
+ function ut() {
1816
1871
  var i;
1817
- if (O.value && Rt() && ((i = l.value) != null && i.code)) {
1818
- const t = window.Prism.languages[v.value];
1819
- t ? O.value.innerHTML = window.Prism.highlight(
1820
- l.value.code,
1821
- t,
1822
- v.value
1823
- ) : O.value.textContent = l.value.code, O.value.dataset.highlighted = "true", ge(() => {
1824
- ct();
1872
+ if (R.value && at() && ((i = l.value) != null && i.code)) {
1873
+ const t = Ne(l.value);
1874
+ if (t)
1875
+ R.value.innerHTML = t.html;
1876
+ else {
1877
+ const g = window.Prism.languages[P.value];
1878
+ g ? R.value.innerHTML = window.Prism.highlight(
1879
+ l.value.code,
1880
+ g,
1881
+ P.value
1882
+ ) : R.value.textContent = l.value.code;
1883
+ }
1884
+ R.value.dataset.highlighted = "true", Ce(() => {
1885
+ dt();
1825
1886
  });
1826
1887
  }
1827
1888
  }
1828
- function ct() {
1889
+ function dt() {
1829
1890
  var t;
1830
- const i = (t = O.value) == null ? void 0 : t.closest("pre");
1831
- if (i && ee.value && F.value) {
1832
- const j = window.getComputedStyle(i).backgroundColor;
1833
- j && j !== "rgba(0, 0, 0, 0)" && j !== "transparent" && (ee.value.style.backgroundColor = j, F.value.style.backgroundColor = j);
1891
+ const i = (t = R.value) == null ? void 0 : t.closest("pre");
1892
+ if (i && te.value && I.value) {
1893
+ const O = window.getComputedStyle(i).backgroundColor;
1894
+ O && O !== "rgba(0, 0, 0, 0)" && O !== "transparent" && (te.value.style.backgroundColor = O, I.value.style.backgroundColor = O);
1834
1895
  }
1835
1896
  }
1836
- function ut() {
1837
- ee.value && (ee.value.style.backgroundColor = ""), F.value && (F.value.style.backgroundColor = "");
1897
+ function vt() {
1898
+ te.value && (te.value.style.backgroundColor = ""), I.value && (I.value.style.backgroundColor = "");
1838
1899
  }
1839
- function xe() {
1840
- ge(() => {
1841
- ot(), rt();
1900
+ function Te() {
1901
+ Ce(() => {
1902
+ ct(), ut();
1842
1903
  });
1843
1904
  }
1844
- function je() {
1845
- !x.value || !I.value || !l.value || (Pe(), de = $.editor.create(I.value, {
1905
+ function Je() {
1906
+ !Le.value || !z.value || !l.value || (ze(), fe = $.editor.create(z.value, {
1846
1907
  code: l.value.code || "",
1847
1908
  language: l.value.editorLanguage || l.value.language || "plaintext",
1848
1909
  sdkTheme: $.getTheme()
1849
1910
  }));
1850
1911
  }
1851
- function Pe() {
1852
- de && (de.destroy(), de = null);
1912
+ function ze() {
1913
+ fe && (fe.destroy(), fe = null);
1853
1914
  }
1854
- function dt() {
1855
- if (!de || !l.value) return;
1856
- const i = de.getCode();
1915
+ function ft() {
1916
+ if (!fe || !l.value) return;
1917
+ const i = fe.getCode();
1857
1918
  $.emit("edit:save", {
1858
1919
  artifactId: l.value.id,
1859
1920
  artifact: l.value,
1860
1921
  code: i
1861
1922
  });
1862
1923
  }
1863
- function vt() {
1864
- clearTimeout(ce), Z.value = !1, q.value && l.value && ($.bridge.setIframe(q.value), $.bridge.loadArtifact(l.value));
1924
+ function pt() {
1925
+ clearTimeout(ue), W.value = !1, V.value && l.value && ($.bridge.setIframe(V.value), $.bridge.loadArtifact(l.value));
1865
1926
  }
1866
- function ft() {
1867
- clearTimeout(ce), Z.value = !1;
1927
+ function _t() {
1928
+ clearTimeout(ue), W.value = !1;
1868
1929
  }
1869
- function pt() {
1870
- clearTimeout(ce), ce = setTimeout(() => {
1871
- Z.value = !1;
1930
+ function ht() {
1931
+ clearTimeout(ue), ue = setTimeout(() => {
1932
+ W.value = !1;
1872
1933
  }, 1e3);
1873
1934
  }
1874
- async function _t() {
1935
+ async function mt() {
1875
1936
  if (l.value)
1876
1937
  try {
1877
- await navigator.clipboard.writeText(l.value.code), te.value = !0, setTimeout(() => {
1878
- te.value = !1;
1938
+ await navigator.clipboard.writeText(l.value.code), ae.value = !0, setTimeout(() => {
1939
+ ae.value = !1;
1879
1940
  }, 2e3);
1880
1941
  } catch (i) {
1881
1942
  console.error("Failed to copy:", i);
1882
1943
  }
1883
1944
  }
1884
- function ht() {
1945
+ function yt() {
1885
1946
  if (!l.value) return;
1886
- const { code: i, language: t, title: w } = l.value, j = qe(t), ie = `${w.toLowerCase().replace(/\s+/g, "-")}.${j}`, me = new Blob([i], { type: "text/plain" }), pe = URL.createObjectURL(me), ve = document.createElement("a");
1887
- ve.href = pe, ve.download = ie, document.body.appendChild(ve), ve.click(), document.body.removeChild(ve), URL.revokeObjectURL(pe);
1947
+ const { code: i, language: t, title: g } = l.value, O = Ue(t), Q = `${g.toLowerCase().replace(/\s+/g, "-")}.${O}`, me = new Blob([i], { type: "text/plain" }), ce = URL.createObjectURL(me), re = document.createElement("a");
1948
+ re.href = ce, re.download = Q, document.body.appendChild(re), re.click(), document.body.removeChild(re), URL.revokeObjectURL(ce);
1888
1949
  }
1889
- async function mt() {
1890
- if (!(p.value || B.value.length === 0)) {
1891
- p.value = !0;
1950
+ async function gt() {
1951
+ if (!(_.value || N.value.length === 0)) {
1952
+ _.value = !0;
1892
1953
  try {
1893
- const i = new Ot(), t = /* @__PURE__ */ new Map();
1894
- for (const ve of B.value) {
1895
- if (!ve.code) continue;
1896
- const ze = qe(ve.language);
1897
- let Ie = (ve.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Fe = `${Ie}.${ze}`;
1898
- const Ve = t.get(Fe) || 0;
1899
- Ve > 0 && (Fe = `${Ie}-${Ve}.${ze}`), t.set(`${Ie}.${ze}`, Ve + 1), i.file(Fe, ve.code);
1954
+ const i = new Dt(), t = /* @__PURE__ */ new Map();
1955
+ for (const re of N.value) {
1956
+ if (!re.code) continue;
1957
+ const we = Ue(re.language);
1958
+ let ge = (re.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Re = `${ge}.${we}`;
1959
+ const qe = t.get(Re) || 0;
1960
+ qe > 0 && (Re = `${ge}-${qe}.${we}`), t.set(`${ge}.${we}`, qe + 1), i.file(Re, re.code);
1900
1961
  }
1901
- const w = await i.generateAsync({ type: "blob" }), ie = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, me = URL.createObjectURL(w), pe = document.createElement("a");
1902
- pe.href = me, pe.download = ie, document.body.appendChild(pe), pe.click(), document.body.removeChild(pe), URL.revokeObjectURL(me);
1962
+ const g = await i.generateAsync({ type: "blob" }), Q = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, me = URL.createObjectURL(g), ce = document.createElement("a");
1963
+ ce.href = me, ce.download = Q, document.body.appendChild(ce), ce.click(), document.body.removeChild(ce), URL.revokeObjectURL(me);
1903
1964
  } catch (i) {
1904
1965
  console.error("Failed to create ZIP:", i);
1905
1966
  } finally {
1906
- p.value = !1;
1967
+ _.value = !1;
1907
1968
  }
1908
1969
  }
1909
1970
  }
1910
- function yt() {
1911
- if (ae.value) {
1912
- ae.value = !1;
1971
+ function kt() {
1972
+ if (ie.value) {
1973
+ ie.value = !1;
1913
1974
  return;
1914
1975
  }
1915
- l.value && (L.value = "options", Y.value = "", Q.value = null, _.value = "", T.value = !1, r.value = !1, E.value = [], c.value = !1, P.value = "", ae.value = !0);
1976
+ l.value && (H.value = "options", K.value = "", ee.value = null, p.value = "", T.value = !1, r.value = !1, B.value = [], c.value = !1, S.value = "", ie.value = !0);
1916
1977
  }
1917
- function gt() {
1918
- ae.value = !1;
1978
+ function wt() {
1979
+ ie.value = !1;
1919
1980
  }
1920
- function Ne(i) {
1981
+ function Xe(i) {
1921
1982
  return i ? new Date(i).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
1922
1983
  }
1923
- async function Je() {
1984
+ async function Ze() {
1924
1985
  if (!(!l.value || !$.share)) {
1925
- L.value = "loading", _.value = "";
1986
+ H.value = "loading", p.value = "";
1926
1987
  try {
1927
1988
  const i = await $.share.share(l.value);
1928
- Y.value = i.url, Q.value = i.expiresAt, r.value = !1, L.value = "success";
1989
+ K.value = i.url, ee.value = i.expiresAt, r.value = !1, H.value = "success";
1929
1990
  } catch (i) {
1930
- _.value = i.message || "Failed to create share link", L.value = "error";
1991
+ p.value = i.message || "Failed to create share link", H.value = "error";
1931
1992
  }
1932
1993
  }
1933
1994
  }
1934
- async function Xe() {
1935
- if (Ue.value)
1936
- Be();
1995
+ async function We() {
1996
+ if (oe.value)
1997
+ Ie();
1937
1998
  else {
1938
- L.value = "loading";
1999
+ H.value = "loading";
1939
2000
  try {
1940
- await $.share.openAuthPopup(), Be();
2001
+ await $.share.openAuthPopup(), Ie();
1941
2002
  } catch (i) {
1942
- i.message === "Authentication cancelled" ? L.value = "options" : (_.value = i.message || "Authentication failed", L.value = "error");
2003
+ i.message === "Authentication cancelled" ? H.value = "options" : (p.value = i.message || "Authentication failed", H.value = "error");
1943
2004
  }
1944
2005
  }
1945
2006
  }
1946
- async function Be() {
2007
+ async function Ie() {
1947
2008
  if (!(!l.value || !$.share)) {
1948
- L.value = "loading", _.value = "";
2009
+ H.value = "loading", p.value = "";
1949
2010
  try {
1950
2011
  const i = await $.share.save(l.value);
1951
- Y.value = i.url, Q.value = null, r.value = !0, L.value = "success";
2012
+ K.value = i.url, ee.value = null, r.value = !0, H.value = "success";
1952
2013
  } catch (i) {
1953
- _.value = i.message || "Failed to save artifact", L.value = "error";
2014
+ p.value = i.message || "Failed to save artifact", H.value = "error";
1954
2015
  }
1955
2016
  }
1956
2017
  }
1957
- function kt() {
1958
- r.value ? Be() : Je();
2018
+ function Ct() {
2019
+ r.value ? Ie() : Ze();
1959
2020
  }
1960
- async function wt() {
2021
+ async function bt() {
1961
2022
  var i;
1962
2023
  if ($.share) {
1963
- if (!Ue.value) {
1964
- L.value = "loading";
2024
+ if (!oe.value) {
2025
+ H.value = "loading";
1965
2026
  try {
1966
2027
  await $.share.openAuthPopup();
1967
2028
  } catch (t) {
1968
- t.message === "Authentication cancelled" ? L.value = "options" : (_.value = t.message || "Authentication failed", L.value = "error");
2029
+ t.message === "Authentication cancelled" ? H.value = "options" : (p.value = t.message || "Authentication failed", H.value = "error");
1969
2030
  return;
1970
2031
  }
1971
2032
  }
1972
- L.value = "update-list", c.value = !0;
2033
+ H.value = "update-list", c.value = !0;
1973
2034
  try {
1974
- const t = ((i = l.value) == null ? void 0 : i.language) || null, w = await $.share.listArtifacts(t);
1975
- E.value = w.projects || [];
2035
+ const t = ((i = l.value) == null ? void 0 : i.language) || null, g = await $.share.listArtifacts(t);
2036
+ B.value = g.projects || [];
1976
2037
  } catch (t) {
1977
- _.value = t.message || "Failed to load artifacts", L.value = "error";
2038
+ p.value = t.message || "Failed to load artifacts", H.value = "error";
1978
2039
  } finally {
1979
2040
  c.value = !1;
1980
2041
  }
1981
2042
  }
1982
2043
  }
1983
- async function Ct(i) {
1984
- var w, j;
2044
+ async function xt(i) {
2045
+ var g, O;
1985
2046
  if (!l.value || !$.share) return;
1986
- const t = (w = i.project) == null ? void 0 : w.uuid;
2047
+ const t = (g = i.project) == null ? void 0 : g.uuid;
1987
2048
  if (t) {
1988
- L.value = "loading", _.value = "";
2049
+ H.value = "loading", p.value = "";
1989
2050
  try {
1990
- const ie = await $.share.updateArtifact(t, l.value);
1991
- Y.value = ie.url || "", Q.value = null, r.value = !0, P.value = ((j = i.project) == null ? void 0 : j.name) || "Untitled", L.value = "success";
1992
- } catch (ie) {
1993
- _.value = ie.message || "Failed to update artifact", L.value = "error";
2051
+ const Q = await $.share.updateArtifact(t, l.value);
2052
+ K.value = Q.url || "", ee.value = null, r.value = !0, S.value = ((O = i.project) == null ? void 0 : O.name) || "Untitled", H.value = "success";
2053
+ } catch (Q) {
2054
+ p.value = Q.message || "Failed to update artifact", H.value = "error";
1994
2055
  }
1995
2056
  }
1996
2057
  }
1997
- async function bt() {
1998
- if (Y.value)
2058
+ async function $t() {
2059
+ if (K.value)
1999
2060
  try {
2000
- await navigator.clipboard.writeText(Y.value), T.value = !0, setTimeout(() => {
2061
+ await navigator.clipboard.writeText(K.value), T.value = !0, setTimeout(() => {
2001
2062
  T.value = !1;
2002
2063
  }, 2e3);
2003
2064
  } catch (i) {
2004
2065
  console.error("Failed to copy link:", i);
2005
2066
  }
2006
2067
  }
2007
- function xt() {
2008
- G.value && window.open(G.value, "_blank");
2009
- }
2010
- function $t() {
2011
- F.value && ee.value && (F.value.style.transform = `translateY(-${ee.value.scrollTop}px)`);
2012
- }
2013
2068
  function Mt() {
2014
- X.value = !X.value;
2015
- }
2016
- function Ze(i) {
2017
- f.value = !0, C(i), X.value = !1;
2069
+ Y.value && window.open(Y.value, "_blank");
2018
2070
  }
2019
2071
  function Lt() {
2020
- const i = W.value - 1;
2021
- i >= 0 && C(B.value[i]);
2072
+ I.value && te.value && (I.value.style.transform = `translateY(-${te.value.scrollTop}px)`);
2022
2073
  }
2023
2074
  function Tt() {
2024
- const i = W.value + 1;
2025
- i < B.value.length && C(B.value[i]);
2075
+ Z.value = !Z.value;
2026
2076
  }
2027
- function We(i) {
2028
- const t = document.querySelector(".artifactuse-panel__nav");
2029
- t && !t.contains(i.target) && (X.value = !1);
2077
+ function Ke(i) {
2078
+ f.value = !0, x(i), Z.value = !1;
2030
2079
  }
2031
- let ye = null;
2032
- function At(i) {
2033
- ye = {
2034
- startX: i.clientX,
2035
- startWidth: V.value
2036
- }, document.addEventListener("mousemove", Ke), document.addEventListener("mouseup", Ee), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((w) => w.style.pointerEvents = "none");
2080
+ function At() {
2081
+ const i = v.value - 1;
2082
+ i >= 0 && x(N.value[i]);
2037
2083
  }
2038
- function Ke(i) {
2039
- if (!ye) return;
2040
- const t = window.innerWidth, j = (ye.startX - i.clientX) / t * 100, ie = ye.startWidth + j;
2041
- V.value = Math.min(Math.max(ie, 25), 75), h("resize", { width: V.value });
2084
+ function Pt() {
2085
+ const i = v.value + 1;
2086
+ i < N.value.length && x(N.value[i]);
2042
2087
  }
2043
- function Ee() {
2044
- const i = ye !== null;
2045
- ye = null, document.removeEventListener("mousemove", Ke), document.removeEventListener("mouseup", Ee), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((w) => w.style.pointerEvents = ""), i && h("resize", { width: V.value });
2088
+ function Ye(i) {
2089
+ const t = document.querySelector(".artifactuse-panel__nav");
2090
+ t && !t.contains(i.target) && (Z.value = !1);
2046
2091
  }
2047
- let be = null;
2092
+ let ke = null;
2048
2093
  function Ht(i) {
2049
- if (!J.value) return;
2050
- const t = J.value.getBoundingClientRect();
2051
- be = {
2094
+ ke = {
2095
+ startX: i.clientX,
2096
+ startWidth: he.value
2097
+ }, document.addEventListener("mousemove", Qe), document.addEventListener("mouseup", Fe), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((g) => g.style.pointerEvents = "none");
2098
+ }
2099
+ function Qe(i) {
2100
+ if (!ke) return;
2101
+ const t = window.innerWidth, O = (ke.startX - i.clientX) / t * 100, Q = ke.startWidth + O;
2102
+ he.value = Math.min(Math.max(Q, 25), 75), h("resize", { width: he.value });
2103
+ }
2104
+ function Fe() {
2105
+ const i = ke !== null;
2106
+ ke = null, document.removeEventListener("mousemove", Qe), document.removeEventListener("mouseup", Fe), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((g) => g.style.pointerEvents = ""), i && h("resize", { width: he.value });
2107
+ }
2108
+ let Me = null;
2109
+ function St(i) {
2110
+ if (!X.value) return;
2111
+ const t = X.value.getBoundingClientRect();
2112
+ Me = {
2052
2113
  startX: i.clientX,
2053
- startPosition: D.value,
2114
+ startPosition: C.value,
2054
2115
  contentLeft: t.left,
2055
2116
  contentWidth: t.width
2056
- }, document.addEventListener("mousemove", Ye), document.addEventListener("mouseup", Se), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((j) => j.style.pointerEvents = "none");
2117
+ }, document.addEventListener("mousemove", Ge), document.addEventListener("mouseup", Ve), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((O) => O.style.pointerEvents = "none");
2057
2118
  }
2058
- function Ye(i) {
2059
- if (!be) return;
2060
- const w = (i.clientX - be.contentLeft) / be.contentWidth * 100;
2061
- D.value = Math.min(Math.max(w, 20), 80);
2062
- }
2063
- function Se() {
2064
- be = null, document.removeEventListener("mousemove", Ye), document.removeEventListener("mouseup", Se), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
2065
- }
2066
- return fe(l, (i, t) => {
2067
- i && (t && t.isPreviewable !== i.isPreviewable && (oe.value = !0, setTimeout(() => {
2068
- oe.value = !1;
2069
- }, 150)), (!t || i.id !== t.id) && (ut(), Z.value = !0, pt()), (!t || i.id !== t.id || i.code !== t.code) && (xe(), k.viewMode === "edit" && (!t || i.id !== t.id ? ge(() => je()) : de && de.setCode(i.code || "")), clearTimeout(ne), ne = setTimeout(() => {
2070
- q.value && i.isPreviewable && $.bridge.loadArtifact(i);
2119
+ function Ge(i) {
2120
+ if (!Me) return;
2121
+ const g = (i.clientX - Me.contentLeft) / Me.contentWidth * 100;
2122
+ C.value = Math.min(Math.max(g, 20), 80);
2123
+ }
2124
+ function Ve() {
2125
+ Me = null, document.removeEventListener("mousemove", Ge), document.removeEventListener("mouseup", Ve), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
2126
+ }
2127
+ return pe(l, (i, t) => {
2128
+ i && (t && t.isPreviewable !== i.isPreviewable && (ve.value = !0, setTimeout(() => {
2129
+ ve.value = !1;
2130
+ }, 150)), (!t || i.id !== t.id) && (vt(), W.value = !0, ht()), (!t || i.id !== t.id || i.code !== t.code) && (Te(), m.viewMode === "edit" && (!t || i.id !== t.id ? Ce(() => Je()) : fe && fe.setCode(i.code || "")), clearTimeout(ne), ne = setTimeout(() => {
2131
+ V.value && i.isPreviewable && $.bridge.loadArtifact(i);
2071
2132
  }, 500)));
2072
- }, { deep: !0 }), fe(() => k.viewMode, (i) => {
2073
- (i === "code" || i === "split") && xe(), i === "edit" && ge(() => je());
2074
- }), fe(() => k.isPanelOpen, (i) => {
2075
- i && l.value && xe(), i || Pe();
2076
- }), we(() => {
2077
- $.on("ai:request", (i) => h("ai-request", i)), $.on("save:request", (i) => h("save", i)), $.on("export:complete", (i) => h("export", i)), document.addEventListener("click", We), k.isPanelOpen && l.value && xe();
2078
- }), Oe(() => {
2079
- Ee(), Se(), Pe(), document.removeEventListener("click", We), clearTimeout(ne), clearTimeout(ce);
2080
- }), (i, t) => (a(), ke(Me, { name: "artifactuse-panel" }, {
2081
- default: Le(() => [
2082
- y(k).isPanelOpen ? (a(), s("div", {
2133
+ }, { deep: !0 }), pe(() => m.viewMode, (i) => {
2134
+ (i === "code" || i === "split") && Te(), i === "edit" && Ce(() => Je());
2135
+ }), pe(() => m.isPanelOpen, (i) => {
2136
+ i && l.value && Te(), i || ze();
2137
+ }), xe(() => {
2138
+ $.on("ai:request", (i) => h("ai-request", i)), $.on("save:request", (i) => h("save", i)), $.on("export:complete", (i) => h("export", i)), document.addEventListener("click", Ye), m.isPanelOpen && l.value && Te();
2139
+ }), De(() => {
2140
+ Fe(), Ve(), ze(), document.removeEventListener("click", Ye), clearTimeout(ne), clearTimeout(ue);
2141
+ }), (i, t) => (a(), be(Pe, { name: "artifactuse-panel" }, {
2142
+ default: He(() => [
2143
+ k(m).isPanelOpen ? (a(), s("div", {
2083
2144
  key: 0,
2084
- class: N(["artifactuse-panel", {
2085
- "artifactuse-panel--fullscreen": y(k).isFullscreen,
2086
- "artifactuse-panel--list": !y(l) && y(S),
2087
- "artifactuse-panel--empty": !y(S)
2145
+ class: J(["artifactuse-panel", {
2146
+ "artifactuse-panel--fullscreen": k(m).isFullscreen,
2147
+ "artifactuse-panel--list": !k(l) && k(E),
2148
+ "artifactuse-panel--empty": !k(E)
2088
2149
  }]),
2089
- style: $e(y(k).isFullscreen ? void 0 : { width: `${lt.value}%` })
2150
+ style: Ae(k(m).isFullscreen ? void 0 : { width: `${$e.value}%` })
2090
2151
  }, [
2091
- y(k).isFullscreen ? d("", !0) : (a(), s("div", {
2152
+ k(m).isFullscreen ? d("", !0) : (a(), s("div", {
2092
2153
  key: 0,
2093
2154
  class: "artifactuse-panel__resize-handle",
2094
- onMousedown: he(At, ["prevent"])
2155
+ onMousedown: ye(Ht, ["prevent"])
2095
2156
  }, [...t[12] || (t[12] = [
2096
2157
  e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
2097
2158
  ])], 32)),
2098
- y(S) ? y(l) ? (a(), s(R, { key: 3 }, [
2099
- e("header", Cl, [
2159
+ k(E) ? k(l) ? (a(), s(F, { key: 3 }, [
2160
+ e("header", xl, [
2100
2161
  f.value ? (a(), s("button", {
2101
2162
  key: 0,
2102
2163
  class: "artifactuse-panel__back",
2103
2164
  title: "Back to list",
2104
- onClick: nt
2165
+ onClick: rt
2105
2166
  }, [...t[24] || (t[24] = [
2106
2167
  e("svg", {
2107
2168
  viewBox: "0 0 24 24",
@@ -2112,28 +2173,28 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2112
2173
  e("polyline", { points: "15 18 9 12 15 6" })
2113
2174
  ], -1)
2114
2175
  ])])) : d("", !0),
2115
- e("div", bl, [
2176
+ e("div", $l, [
2116
2177
  e("span", {
2117
2178
  class: "artifactuse-panel__icon",
2118
- innerHTML: z.value
2119
- }, null, 8, xl),
2120
- e("div", $l, [
2121
- e("span", Ml, n(y(l).title || "Untitled"), 1),
2122
- e("span", Ll, [
2123
- K(n(re.value) + " ", 1),
2124
- y(l).lineCount ? (a(), s(R, { key: 0 }, [
2125
- K(" • " + n(y(l).lineCount) + " lines ", 1)
2179
+ innerHTML: D.value
2180
+ }, null, 8, Ml),
2181
+ e("div", Ll, [
2182
+ e("span", Tl, o(k(l).title || "Untitled"), 1),
2183
+ e("span", Al, [
2184
+ G(o(q.value) + " ", 1),
2185
+ k(l).lineCount ? (a(), s(F, { key: 0 }, [
2186
+ G(" • " + o(k(l).lineCount) + " lines ", 1)
2126
2187
  ], 64)) : d("", !0)
2127
2188
  ])
2128
2189
  ])
2129
2190
  ]),
2130
- e("div", Tl, [
2131
- !y(l).tabs || y(l).tabs.includes("preview") ? (a(), s("button", {
2191
+ e("div", Pl, [
2192
+ !k(l).tabs || k(l).tabs.includes("preview") ? (a(), s("button", {
2132
2193
  key: 0,
2133
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "preview" }]),
2134
- disabled: !y(l).isPreviewable,
2194
+ class: J(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": k(m).viewMode === "preview" }]),
2195
+ disabled: !k(l).isPreviewable,
2135
2196
  title: "Preview",
2136
- onClick: t[2] || (t[2] = (w) => y(o)("preview"))
2197
+ onClick: t[2] || (t[2] = (g) => k(n)("preview"))
2137
2198
  }, [...t[25] || (t[25] = [
2138
2199
  e("svg", {
2139
2200
  viewBox: "0 0 24 24",
@@ -2148,12 +2209,12 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2148
2209
  r: "3"
2149
2210
  })
2150
2211
  ], -1)
2151
- ])], 10, Al)) : d("", !0),
2152
- !y(l).tabs || y(l).tabs.includes("code") ? (a(), s("button", {
2212
+ ])], 10, Hl)) : d("", !0),
2213
+ !k(l).tabs || k(l).tabs.includes("code") ? (a(), s("button", {
2153
2214
  key: 1,
2154
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "code" }]),
2215
+ class: J(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": k(m).viewMode === "code" }]),
2155
2216
  title: "Code",
2156
- onClick: t[3] || (t[3] = (w) => y(o)("code"))
2217
+ onClick: t[3] || (t[3] = (g) => k(n)("code"))
2157
2218
  }, [...t[26] || (t[26] = [
2158
2219
  e("svg", {
2159
2220
  viewBox: "0 0 24 24",
@@ -2165,12 +2226,12 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2165
2226
  e("polyline", { points: "8 6 2 12 8 18" })
2166
2227
  ], -1)
2167
2228
  ])], 2)) : d("", !0),
2168
- !y(l).tabs || y(l).tabs.includes("split") ? (a(), s("button", {
2229
+ !k(l).tabs || k(l).tabs.includes("split") ? (a(), s("button", {
2169
2230
  key: 2,
2170
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "split" }]),
2171
- disabled: !y(l).isPreviewable,
2231
+ class: J(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": k(m).viewMode === "split" }]),
2232
+ disabled: !k(l).isPreviewable,
2172
2233
  title: "Split view",
2173
- onClick: t[4] || (t[4] = (w) => y(o)("split"))
2234
+ onClick: t[4] || (t[4] = (g) => k(n)("split"))
2174
2235
  }, [...t[27] || (t[27] = [
2175
2236
  e("svg", {
2176
2237
  viewBox: "0 0 24 24",
@@ -2193,12 +2254,12 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2193
2254
  y2: "21"
2194
2255
  })
2195
2256
  ], -1)
2196
- ])], 10, Hl)) : d("", !0),
2197
- y(l).tabs && y(l).tabs.includes("edit") && x.value ? (a(), s("button", {
2257
+ ])], 10, Sl)) : d("", !0),
2258
+ k(l).tabs && k(l).tabs.includes("edit") && Le.value ? (a(), s("button", {
2198
2259
  key: 3,
2199
- class: N(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(k).viewMode === "edit" }]),
2260
+ class: J(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": k(m).viewMode === "edit" }]),
2200
2261
  title: "Edit",
2201
- onClick: t[5] || (t[5] = (w) => y(o)("edit"))
2262
+ onClick: t[5] || (t[5] = (g) => k(n)("edit"))
2202
2263
  }, [...t[28] || (t[28] = [
2203
2264
  e("svg", {
2204
2265
  viewBox: "0 0 24 24",
@@ -2211,12 +2272,12 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2211
2272
  ], -1)
2212
2273
  ])], 2)) : d("", !0)
2213
2274
  ]),
2214
- e("div", Pl, [
2215
- y(k).viewMode === "edit" ? (a(), s("button", {
2275
+ e("div", Bl, [
2276
+ k(m).viewMode === "edit" ? (a(), s("button", {
2216
2277
  key: 0,
2217
2278
  class: "artifactuse-panel__action artifactuse-panel__action--save",
2218
2279
  title: "Save",
2219
- onClick: dt
2280
+ onClick: ft
2220
2281
  }, [...t[29] || (t[29] = [
2221
2282
  e("svg", {
2222
2283
  viewBox: "0 0 24 24",
@@ -2231,10 +2292,10 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2231
2292
  ])])) : d("", !0),
2232
2293
  e("button", {
2233
2294
  class: "artifactuse-panel__action",
2234
- title: y(k).isFullscreen ? "Exit fullscreen" : "Fullscreen",
2235
- onClick: t[6] || (t[6] = (...w) => y(g) && y(g)(...w))
2295
+ title: k(m).isFullscreen ? "Exit fullscreen" : "Fullscreen",
2296
+ onClick: t[6] || (t[6] = (...g) => k(w) && k(w)(...g))
2236
2297
  }, [
2237
- y(k).isFullscreen ? (a(), s("svg", Sl, [...t[31] || (t[31] = [
2298
+ k(m).isFullscreen ? (a(), s("svg", Il, [...t[31] || (t[31] = [
2238
2299
  e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
2239
2300
  e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
2240
2301
  e("line", {
@@ -2249,7 +2310,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2249
2310
  x2: "10",
2250
2311
  y2: "14"
2251
2312
  }, null, -1)
2252
- ])])) : (a(), s("svg", El, [...t[30] || (t[30] = [
2313
+ ])])) : (a(), s("svg", zl, [...t[30] || (t[30] = [
2253
2314
  e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
2254
2315
  e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
2255
2316
  e("line", {
@@ -2265,11 +2326,11 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2265
2326
  y2: "14"
2266
2327
  }, null, -1)
2267
2328
  ])]))
2268
- ], 8, Bl),
2329
+ ], 8, El),
2269
2330
  e("button", {
2270
2331
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2271
2332
  title: "Close panel",
2272
- onClick: t[7] || (t[7] = (...w) => y(A) && y(A)(...w))
2333
+ onClick: t[7] || (t[7] = (...g) => k(L) && k(L)(...g))
2273
2334
  }, [...t[32] || (t[32] = [
2274
2335
  e("svg", {
2275
2336
  viewBox: "0 0 24 24",
@@ -2295,34 +2356,34 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2295
2356
  ]),
2296
2357
  e("div", {
2297
2358
  ref_key: "contentRef",
2298
- ref: J,
2299
- class: N(["artifactuse-panel__content", [
2300
- `artifactuse-panel__content--${y(k).viewMode}`,
2301
- { "artifactuse-panel__content--transitioning": oe.value }
2359
+ ref: X,
2360
+ class: J(["artifactuse-panel__content", [
2361
+ `artifactuse-panel__content--${k(m).viewMode}`,
2362
+ { "artifactuse-panel__content--transitioning": ve.value }
2302
2363
  ]])
2303
2364
  }, [
2304
- oe.value ? (a(), s("div", zl, [...t[33] || (t[33] = [
2365
+ ve.value ? (a(), s("div", Fl, [...t[33] || (t[33] = [
2305
2366
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2306
2367
  ])])) : d("", !0),
2307
- y(k).viewMode === "preview" || y(k).viewMode === "split" ? (a(), s("div", {
2368
+ k(m).viewMode === "preview" || k(m).viewMode === "split" ? (a(), s("div", {
2308
2369
  key: 1,
2309
2370
  class: "artifactuse-panel__preview",
2310
- style: $e(y(k).viewMode === "split" ? { width: `${D.value}%` } : void 0)
2371
+ style: Ae(k(m).viewMode === "split" ? { width: `${C.value}%` } : void 0)
2311
2372
  }, [
2312
- Z.value && G.value ? (a(), s("div", Il, [...t[34] || (t[34] = [
2373
+ W.value && Y.value ? (a(), s("div", Vl, [...t[34] || (t[34] = [
2313
2374
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2314
2375
  ])])) : d("", !0),
2315
- G.value ? (a(), s("iframe", {
2376
+ Y.value ? (a(), s("iframe", {
2316
2377
  key: 1,
2317
2378
  ref_key: "iframeRef",
2318
- ref: q,
2319
- src: G.value,
2320
- class: N(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": Z.value }]),
2379
+ ref: V,
2380
+ src: Y.value,
2381
+ class: J(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": W.value }]),
2321
2382
  sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
2322
2383
  allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write",
2323
- onLoad: vt,
2324
- onError: ft
2325
- }, null, 42, Fl)) : (a(), s("div", Vl, [
2384
+ onLoad: pt,
2385
+ onError: _t
2386
+ }, null, 42, Rl)) : (a(), s("div", ql, [
2326
2387
  t[35] || (t[35] = e("svg", {
2327
2388
  viewBox: "0 0 24 24",
2328
2389
  fill: "none",
@@ -2338,58 +2399,58 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2338
2399
  y2: "12"
2339
2400
  })
2340
2401
  ], -1)),
2341
- e("p", null, "Preview not available for " + n(re.value), 1)
2402
+ e("p", null, "Preview not available for " + o(q.value), 1)
2342
2403
  ]))
2343
2404
  ], 4)) : d("", !0),
2344
- Qe(e("div", {
2405
+ et(e("div", {
2345
2406
  class: "artifactuse-panel__code",
2346
- style: $e(y(k).viewMode === "split" ? { width: `${100 - D.value}%` } : void 0)
2407
+ style: Ae(k(m).viewMode === "split" ? { width: `${100 - C.value}%` } : void 0)
2347
2408
  }, [
2348
- y(k).viewMode === "split" ? (a(), s("div", {
2409
+ k(m).viewMode === "split" ? (a(), s("div", {
2349
2410
  key: 0,
2350
2411
  class: "artifactuse-panel__split-handle",
2351
- onMousedown: he(Ht, ["prevent"])
2412
+ onMousedown: ye(St, ["prevent"])
2352
2413
  }, [...t[36] || (t[36] = [
2353
2414
  e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
2354
2415
  ])], 32)) : d("", !0),
2355
2416
  e("div", {
2356
2417
  class: "artifactuse-panel__code-scroll",
2357
2418
  ref_key: "codeScrollRef",
2358
- ref: ee,
2359
- onScroll: $t
2419
+ ref: te,
2420
+ onScroll: Lt
2360
2421
  }, [
2361
2422
  e("div", {
2362
2423
  class: "artifactuse-panel__line-numbers",
2363
2424
  ref_key: "lineNumbersRef",
2364
- ref: F
2425
+ ref: I
2365
2426
  }, null, 512),
2366
2427
  e("pre", {
2367
- class: N(["artifactuse-panel__code-block", `language-${v.value}`])
2428
+ class: J(["artifactuse-panel__code-block", `language-${P.value}`])
2368
2429
  }, [
2369
2430
  (a(), s("code", {
2370
2431
  ref_key: "codeRef",
2371
- ref: O,
2372
- key: y(l).id,
2373
- class: N(`language-${v.value}`)
2432
+ ref: R,
2433
+ key: k(l).id,
2434
+ class: J(`language-${P.value}`)
2374
2435
  }, null, 2))
2375
2436
  ], 2)
2376
2437
  ], 544)
2377
2438
  ], 4), [
2378
- [Ge, y(k).viewMode === "code" || y(k).viewMode === "split"]
2439
+ [tt, k(m).viewMode === "code" || k(m).viewMode === "split"]
2379
2440
  ]),
2380
- Qe(e("div", Rl, [
2441
+ et(e("div", Ol, [
2381
2442
  e("div", {
2382
2443
  ref_key: "editorContainerRef",
2383
- ref: I,
2444
+ ref: z,
2384
2445
  class: "artifactuse-panel__editor-container"
2385
2446
  }, null, 512)
2386
2447
  ], 512), [
2387
- [Ge, y(k).viewMode === "edit"]
2448
+ [tt, k(m).viewMode === "edit"]
2388
2449
  ])
2389
2450
  ], 2),
2390
- e("footer", ql, [
2391
- e("div", Ol, [
2392
- se.value ? (a(), s("a", Ul, [...t[37] || (t[37] = [
2451
+ e("footer", Ul, [
2452
+ e("div", Dl, [
2453
+ j.value ? (a(), s("a", jl, [...t[37] || (t[37] = [
2393
2454
  e("svg", {
2394
2455
  width: "16",
2395
2456
  height: "16",
@@ -2408,17 +2469,17 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2408
2469
  ], -1),
2409
2470
  e("span", null, "Artifactuse", -1)
2410
2471
  ])])) : d("", !0),
2411
- y(l).size ? (a(), s("span", Dl, n(y(tt)(y(l).size)), 1)) : d("", !0)
2472
+ k(l).size ? (a(), s("span", Nl, o(k(it)(k(l).size)), 1)) : d("", !0)
2412
2473
  ]),
2413
- e("div", jl, [
2474
+ e("div", Jl, [
2414
2475
  e("button", {
2415
- class: N(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": te.value }]),
2416
- title: te.value ? "Copied!" : "Copy code",
2417
- onClick: _t
2476
+ class: J(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": ae.value }]),
2477
+ title: ae.value ? "Copied!" : "Copy code",
2478
+ onClick: mt
2418
2479
  }, [
2419
- te.value ? (a(), s("svg", Xl, [...t[39] || (t[39] = [
2480
+ ae.value ? (a(), s("svg", Wl, [...t[39] || (t[39] = [
2420
2481
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
2421
- ])])) : (a(), s("svg", Jl, [...t[38] || (t[38] = [
2482
+ ])])) : (a(), s("svg", Zl, [...t[38] || (t[38] = [
2422
2483
  e("rect", {
2423
2484
  x: "9",
2424
2485
  y: "9",
@@ -2429,11 +2490,11 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2429
2490
  }, null, -1),
2430
2491
  e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2431
2492
  ])]))
2432
- ], 10, Nl),
2493
+ ], 10, Xl),
2433
2494
  e("button", {
2434
2495
  class: "artifactuse-panel__footer-action",
2435
2496
  title: "Download file",
2436
- onClick: ht
2497
+ onClick: yt
2437
2498
  }, [...t[40] || (t[40] = [
2438
2499
  e("svg", {
2439
2500
  viewBox: "0 0 24 24",
@@ -2451,11 +2512,11 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2451
2512
  })
2452
2513
  ], -1)
2453
2514
  ])]),
2454
- Ce.value ? (a(), s("div", Zl, [
2515
+ se.value ? (a(), s("div", Kl, [
2455
2516
  e("button", {
2456
2517
  class: "artifactuse-panel__footer-action",
2457
2518
  title: "Share",
2458
- onClick: yt
2519
+ onClick: kt
2459
2520
  }, [...t[41] || (t[41] = [
2460
2521
  e("svg", {
2461
2522
  viewBox: "0 0 24 24",
@@ -2492,14 +2553,14 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2492
2553
  })
2493
2554
  ], -1)
2494
2555
  ])]),
2495
- Ae(Me, { name: "artifactuse-popup" }, {
2496
- default: Le(() => [
2497
- ae.value ? (a(), s("div", Wl, [
2498
- e("div", Kl, [
2499
- e("span", Yl, n(L.value === "success" ? P.value ? "Artifact updated!" : "Link created!" : L.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
2556
+ Be(Pe, { name: "artifactuse-popup" }, {
2557
+ default: He(() => [
2558
+ ie.value ? (a(), s("div", Yl, [
2559
+ e("div", Ql, [
2560
+ e("span", Gl, o(H.value === "success" ? S.value ? "Artifact updated!" : "Link created!" : H.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
2500
2561
  e("button", {
2501
2562
  class: "artifactuse-share-popup__close",
2502
- onClick: gt
2563
+ onClick: wt
2503
2564
  }, [...t[42] || (t[42] = [
2504
2565
  e("svg", {
2505
2566
  viewBox: "0 0 24 24",
@@ -2522,28 +2583,28 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2522
2583
  ], -1)
2523
2584
  ])])
2524
2585
  ]),
2525
- e("div", Ql, [
2526
- L.value === "loading" ? (a(), s("div", Gl, [...t[43] || (t[43] = [
2586
+ e("div", en, [
2587
+ H.value === "loading" ? (a(), s("div", tn, [...t[43] || (t[43] = [
2527
2588
  e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
2528
2589
  e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
2529
- ])])) : L.value === "error" ? (a(), s("div", en, [
2530
- e("div", tn, [
2531
- e("p", an, n(_.value), 1)
2532
- ]),
2590
+ ])])) : H.value === "error" ? (a(), s("div", an, [
2533
2591
  e("div", sn, [
2592
+ e("p", ln, o(p.value), 1)
2593
+ ]),
2594
+ e("div", nn, [
2534
2595
  e("button", {
2535
2596
  class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
2536
- onClick: t[8] || (t[8] = (w) => L.value = "options")
2597
+ onClick: t[8] || (t[8] = (g) => H.value = "options")
2537
2598
  }, " Back "),
2538
2599
  e("button", {
2539
2600
  class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
2540
- onClick: kt
2601
+ onClick: Ct
2541
2602
  }, " Retry ")
2542
2603
  ])
2543
- ])) : L.value === "options" ? (a(), s("div", ln, [
2604
+ ])) : H.value === "options" ? (a(), s("div", on, [
2544
2605
  e("button", {
2545
2606
  class: "artifactuse-share-popup__option",
2546
- onClick: Je
2607
+ onClick: Ze
2547
2608
  }, [...t[44] || (t[44] = [
2548
2609
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2549
2610
  e("svg", {
@@ -2563,7 +2624,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2563
2624
  ])]),
2564
2625
  e("button", {
2565
2626
  class: "artifactuse-share-popup__option",
2566
- onClick: Xe
2627
+ onClick: We
2567
2628
  }, [...t[45] || (t[45] = [
2568
2629
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2569
2630
  e("svg", {
@@ -2584,7 +2645,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2584
2645
  ])]),
2585
2646
  e("button", {
2586
2647
  class: "artifactuse-share-popup__option",
2587
- onClick: wt
2648
+ onClick: bt
2588
2649
  }, [...t[46] || (t[46] = [
2589
2650
  e("div", { class: "artifactuse-share-popup__option-icon" }, [
2590
2651
  e("svg", {
@@ -2603,28 +2664,28 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2603
2664
  e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
2604
2665
  ], -1)
2605
2666
  ])])
2606
- ])) : L.value === "update-list" ? (a(), s("div", nn, [
2607
- c.value ? (a(), s("div", on, [...t[47] || (t[47] = [
2667
+ ])) : H.value === "update-list" ? (a(), s("div", rn, [
2668
+ c.value ? (a(), s("div", cn, [...t[47] || (t[47] = [
2608
2669
  e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
2609
2670
  e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
2610
- ])])) : E.value.length === 0 ? (a(), s("div", rn, " No saved artifacts of this type ")) : (a(), s("div", cn, [
2611
- (a(!0), s(R, null, ue(E.value, (w) => {
2612
- var j, ie, me;
2671
+ ])])) : B.value.length === 0 ? (a(), s("div", un, " No saved artifacts of this type ")) : (a(), s("div", dn, [
2672
+ (a(!0), s(F, null, de(B.value, (g) => {
2673
+ var O, Q, me;
2613
2674
  return a(), s("button", {
2614
- key: ((j = w.project) == null ? void 0 : j.uuid) || w.id,
2675
+ key: ((O = g.project) == null ? void 0 : O.uuid) || g.id,
2615
2676
  class: "artifactuse-share-popup__artifact-item",
2616
- onClick: (pe) => Ct(w)
2677
+ onClick: (ce) => xt(g)
2617
2678
  }, [
2618
- e("span", dn, n(((ie = w.project) == null ? void 0 : ie.name) || "Untitled"), 1),
2619
- e("span", vn, n(Ne((me = w.project) == null ? void 0 : me.created_at)), 1)
2620
- ], 8, un);
2679
+ e("span", fn, o(((Q = g.project) == null ? void 0 : Q.name) || "Untitled"), 1),
2680
+ e("span", pn, o(Xe((me = g.project) == null ? void 0 : me.created_at)), 1)
2681
+ ], 8, vn);
2621
2682
  }), 128))
2622
2683
  ])),
2623
2684
  e("button", {
2624
2685
  class: "artifactuse-share-popup__back-btn",
2625
- onClick: t[9] || (t[9] = (w) => L.value = "options")
2686
+ onClick: t[9] || (t[9] = (g) => H.value = "options")
2626
2687
  }, "Back")
2627
- ])) : L.value === "success" ? (a(), s("div", fn, [
2688
+ ])) : H.value === "success" ? (a(), s("div", _n, [
2628
2689
  t[50] || (t[50] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
2629
2690
  e("svg", {
2630
2691
  viewBox: "0 0 24 24",
@@ -2635,20 +2696,20 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2635
2696
  e("polyline", { points: "20 6 9 17 4 12" })
2636
2697
  ])
2637
2698
  ], -1)),
2638
- e("div", pn, [
2699
+ e("div", hn, [
2639
2700
  e("input", {
2640
2701
  type: "text",
2641
2702
  class: "artifactuse-share-popup__link",
2642
- value: Y.value,
2703
+ value: K.value,
2643
2704
  readonly: "",
2644
- onClick: t[10] || (t[10] = (w) => w.target.select())
2645
- }, null, 8, _n),
2705
+ onClick: t[10] || (t[10] = (g) => g.target.select())
2706
+ }, null, 8, mn),
2646
2707
  e("button", {
2647
- class: N(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": T.value }]),
2648
- onClick: bt
2649
- }, n(T.value ? "Copied!" : "Copy"), 3)
2708
+ class: J(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": T.value }]),
2709
+ onClick: $t
2710
+ }, o(T.value ? "Copied!" : "Copy"), 3)
2650
2711
  ]),
2651
- Q.value && !r.value ? (a(), s("div", hn, [
2712
+ ee.value && !r.value ? (a(), s("div", yn, [
2652
2713
  t[48] || (t[48] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
2653
2714
  e("svg", {
2654
2715
  viewBox: "0 0 24 24",
@@ -2675,13 +2736,13 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2675
2736
  })
2676
2737
  ])
2677
2738
  ], -1)),
2678
- e("span", mn, " Expires " + n(Ne(Q.value)), 1)
2739
+ e("span", gn, " Expires " + o(Xe(ee.value)), 1)
2679
2740
  ])) : d("", !0),
2680
- r.value ? d("", !0) : (a(), s("div", yn, [
2741
+ r.value ? d("", !0) : (a(), s("div", kn, [
2681
2742
  t[49] || (t[49] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
2682
2743
  e("button", {
2683
2744
  class: "artifactuse-share-popup__save-prompt-btn",
2684
- onClick: Xe
2745
+ onClick: We
2685
2746
  }, " Save to account ")
2686
2747
  ]))
2687
2748
  ])) : d("", !0)
@@ -2717,11 +2778,11 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2717
2778
  _: 1
2718
2779
  })
2719
2780
  ])) : d("", !0),
2720
- G.value ? (a(), s("button", {
2781
+ Y.value ? (a(), s("button", {
2721
2782
  key: 1,
2722
2783
  class: "artifactuse-panel__footer-action",
2723
2784
  title: "Open in new tab",
2724
- onClick: xt
2785
+ onClick: Mt
2725
2786
  }, [...t[52] || (t[52] = [
2726
2787
  e("svg", {
2727
2788
  viewBox: "0 0 24 24",
@@ -2739,12 +2800,12 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2739
2800
  })
2740
2801
  ], -1)
2741
2802
  ])])) : d("", !0),
2742
- B.value.length > 1 ? (a(), s("div", gn, [
2803
+ N.value.length > 1 ? (a(), s("div", wn, [
2743
2804
  e("button", {
2744
2805
  class: "artifactuse-panel__nav-btn",
2745
- disabled: W.value <= 0,
2806
+ disabled: v.value <= 0,
2746
2807
  title: "Previous artifact",
2747
- onClick: Lt
2808
+ onClick: At
2748
2809
  }, [...t[53] || (t[53] = [
2749
2810
  e("svg", {
2750
2811
  viewBox: "0 0 24 24",
@@ -2754,13 +2815,13 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2754
2815
  }, [
2755
2816
  e("polyline", { points: "15 18 9 12 15 6" })
2756
2817
  ], -1)
2757
- ])], 8, kn),
2818
+ ])], 8, Cn),
2758
2819
  e("button", {
2759
2820
  class: "artifactuse-panel__nav-trigger",
2760
2821
  title: "View all artifacts",
2761
- onClick: Mt
2822
+ onClick: Tt
2762
2823
  }, [
2763
- e("span", null, n(W.value + 1) + " / " + n(B.value.length), 1),
2824
+ e("span", null, o(v.value + 1) + " / " + o(N.value.length), 1),
2764
2825
  t[54] || (t[54] = e("svg", {
2765
2826
  viewBox: "0 0 24 24",
2766
2827
  fill: "none",
@@ -2772,9 +2833,9 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2772
2833
  ]),
2773
2834
  e("button", {
2774
2835
  class: "artifactuse-panel__nav-btn",
2775
- disabled: W.value >= B.value.length - 1,
2836
+ disabled: v.value >= N.value.length - 1,
2776
2837
  title: "Next artifact",
2777
- onClick: Tt
2838
+ onClick: Pt
2778
2839
  }, [...t[55] || (t[55] = [
2779
2840
  e("svg", {
2780
2841
  viewBox: "0 0 24 24",
@@ -2784,15 +2845,15 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2784
2845
  }, [
2785
2846
  e("polyline", { points: "9 18 15 12 9 6" })
2786
2847
  ], -1)
2787
- ])], 8, wn),
2788
- Ae(Me, { name: "artifactuse-popup" }, {
2789
- default: Le(() => [
2790
- X.value ? (a(), s("div", Cn, [
2791
- e("div", bn, [
2848
+ ])], 8, bn),
2849
+ Be(Pe, { name: "artifactuse-popup" }, {
2850
+ default: He(() => [
2851
+ Z.value ? (a(), s("div", xn, [
2852
+ e("div", $n, [
2792
2853
  t[57] || (t[57] = e("span", null, "Artifacts", -1)),
2793
2854
  e("button", {
2794
2855
  class: "artifactuse-panel__artifact-list-close",
2795
- onClick: t[11] || (t[11] = (w) => X.value = !1)
2856
+ onClick: t[11] || (t[11] = (g) => Z.value = !1)
2796
2857
  }, [...t[56] || (t[56] = [
2797
2858
  e("svg", {
2798
2859
  viewBox: "0 0 24 24",
@@ -2815,27 +2876,27 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2815
2876
  ], -1)
2816
2877
  ])])
2817
2878
  ]),
2818
- e("div", xn, [
2819
- (a(!0), s(R, null, ue(B.value, (w, j) => (a(), s("button", {
2820
- key: w.id,
2821
- class: N(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": w.id === y(l).id }]),
2822
- onClick: (ie) => Ze(w)
2879
+ e("div", Mn, [
2880
+ (a(!0), s(F, null, de(N.value, (g, O) => (a(), s("button", {
2881
+ key: g.id,
2882
+ class: J(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": g.id === k(l).id }]),
2883
+ onClick: (Q) => Ke(g)
2823
2884
  }, [
2824
2885
  e("span", {
2825
2886
  class: "artifactuse-panel__artifact-item-icon",
2826
- innerHTML: De(w.language)
2827
- }, null, 8, Mn),
2828
- e("div", Ln, [
2829
- e("span", Tn, n(w.title || "Untitled"), 1),
2830
- e("span", An, [
2831
- K(n(y(Te)(w.language)) + " ", 1),
2832
- w.lineCount ? (a(), s(R, { key: 0 }, [
2833
- K(" • " + n(w.lineCount) + " lines ", 1)
2887
+ innerHTML: je(g.language)
2888
+ }, null, 8, Tn),
2889
+ e("div", An, [
2890
+ e("span", Pn, o(g.title || "Untitled"), 1),
2891
+ e("span", Hn, [
2892
+ G(o(k(Se)(g.language)) + " ", 1),
2893
+ g.lineCount ? (a(), s(F, { key: 0 }, [
2894
+ G(" • " + o(g.lineCount) + " lines ", 1)
2834
2895
  ], 64)) : d("", !0)
2835
2896
  ])
2836
2897
  ]),
2837
- e("span", Hn, n(j + 1), 1)
2838
- ], 10, $n))), 128))
2898
+ e("span", Sn, o(O + 1), 1)
2899
+ ], 10, Ln))), 128))
2839
2900
  ])
2840
2901
  ])) : d("", !0)
2841
2902
  ]),
@@ -2844,9 +2905,9 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2844
2905
  ])) : d("", !0)
2845
2906
  ])
2846
2907
  ])
2847
- ], 64)) : (a(), s(R, { key: 2 }, [
2848
- e("header", ll, [
2849
- e("div", nl, [
2908
+ ], 64)) : (a(), s(F, { key: 2 }, [
2909
+ e("header", ol, [
2910
+ e("div", rl, [
2850
2911
  t[18] || (t[18] = e("span", { class: "artifactuse-panel__icon" }, [
2851
2912
  e("svg", {
2852
2913
  viewBox: "0 0 24 24",
@@ -2858,19 +2919,19 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2858
2919
  e("polyline", { points: "8 6 2 12 8 18" })
2859
2920
  ])
2860
2921
  ], -1)),
2861
- e("div", ol, [
2922
+ e("div", cl, [
2862
2923
  t[17] || (t[17] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
2863
- e("span", rl, n(B.value.length) + " available", 1)
2924
+ e("span", ul, o(N.value.length) + " available", 1)
2864
2925
  ])
2865
2926
  ]),
2866
- e("div", cl, [
2927
+ e("div", dl, [
2867
2928
  e("button", {
2868
- class: N(["artifactuse-panel__action", { "artifactuse-panel__action--loading": p.value }]),
2869
- disabled: p.value,
2929
+ class: J(["artifactuse-panel__action", { "artifactuse-panel__action--loading": _.value }]),
2930
+ disabled: _.value,
2870
2931
  title: "Download all as ZIP",
2871
- onClick: mt
2932
+ onClick: gt
2872
2933
  }, [
2873
- p.value ? (a(), s("svg", vl, [...t[20] || (t[20] = [
2934
+ _.value ? (a(), s("svg", pl, [...t[20] || (t[20] = [
2874
2935
  e("circle", {
2875
2936
  cx: "12",
2876
2937
  cy: "12",
@@ -2878,7 +2939,7 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2878
2939
  "stroke-dasharray": "32",
2879
2940
  "stroke-dashoffset": "32"
2880
2941
  }, null, -1)
2881
- ])])) : (a(), s("svg", dl, [...t[19] || (t[19] = [
2942
+ ])])) : (a(), s("svg", fl, [...t[19] || (t[19] = [
2882
2943
  e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
2883
2944
  e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
2884
2945
  e("line", {
@@ -2888,11 +2949,11 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2888
2949
  y2: "3"
2889
2950
  }, null, -1)
2890
2951
  ])]))
2891
- ], 10, ul),
2952
+ ], 10, vl),
2892
2953
  e("button", {
2893
2954
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2894
2955
  title: "Close panel",
2895
- onClick: t[1] || (t[1] = (...w) => y(A) && y(A)(...w))
2956
+ onClick: t[1] || (t[1] = (...g) => k(L) && k(L)(...g))
2896
2957
  }, [...t[21] || (t[21] = [
2897
2958
  e("svg", {
2898
2959
  viewBox: "0 0 24 24",
@@ -2916,23 +2977,23 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2916
2977
  ])])
2917
2978
  ])
2918
2979
  ]),
2919
- e("div", fl, [
2920
- e("div", pl, [
2921
- (a(!0), s(R, null, ue(B.value, (w, j) => (a(), s("button", {
2922
- key: w.id,
2980
+ e("div", _l, [
2981
+ e("div", hl, [
2982
+ (a(!0), s(F, null, de(N.value, (g, O) => (a(), s("button", {
2983
+ key: g.id,
2923
2984
  class: "artifactuse-panel__list-item",
2924
- onClick: (ie) => Ze(w)
2985
+ onClick: (Q) => Ke(g)
2925
2986
  }, [
2926
2987
  e("span", {
2927
2988
  class: "artifactuse-panel__list-item-icon",
2928
- innerHTML: De(w.language)
2929
- }, null, 8, hl),
2930
- e("div", ml, [
2931
- e("span", yl, n(w.title || "Untitled"), 1),
2932
- e("span", gl, [
2933
- K(n(y(Te)(w.language)) + " ", 1),
2934
- w.lineCount ? (a(), s(R, { key: 0 }, [
2935
- K(" • " + n(w.lineCount) + " lines ", 1)
2989
+ innerHTML: je(g.language)
2990
+ }, null, 8, yl),
2991
+ e("div", gl, [
2992
+ e("span", kl, o(g.title || "Untitled"), 1),
2993
+ e("span", wl, [
2994
+ G(o(k(Se)(g.language)) + " ", 1),
2995
+ g.lineCount ? (a(), s(F, { key: 0 }, [
2996
+ G(" • " + o(g.lineCount) + " lines ", 1)
2936
2997
  ], 64)) : d("", !0)
2937
2998
  ])
2938
2999
  ]),
@@ -2946,11 +3007,11 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2946
3007
  e("polyline", { points: "9 18 15 12 9 6" })
2947
3008
  ])
2948
3009
  ], -1))
2949
- ], 8, _l))), 128))
3010
+ ], 8, ml))), 128))
2950
3011
  ])
2951
3012
  ]),
2952
- e("footer", kl, [
2953
- se.value ? (a(), s("a", wl, [...t[23] || (t[23] = [
3013
+ e("footer", Cl, [
3014
+ j.value ? (a(), s("a", bl, [...t[23] || (t[23] = [
2954
3015
  e("svg", {
2955
3016
  width: "16",
2956
3017
  height: "16",
@@ -2970,8 +3031,8 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2970
3031
  e("span", null, "Artifactuse", -1)
2971
3032
  ])])) : d("", !0)
2972
3033
  ])
2973
- ], 64)) : (a(), s(R, { key: 1 }, [
2974
- e("header", tl, [
3034
+ ], 64)) : (a(), s(F, { key: 1 }, [
3035
+ e("header", sl, [
2975
3036
  t[14] || (t[14] = e("div", { class: "artifactuse-panel__title" }, [
2976
3037
  e("span", { class: "artifactuse-panel__icon" }, [
2977
3038
  e("svg", {
@@ -2988,11 +3049,11 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
2988
3049
  e("span", { class: "artifactuse-panel__name" }, "Artifacts")
2989
3050
  ])
2990
3051
  ], -1)),
2991
- e("div", al, [
3052
+ e("div", il, [
2992
3053
  e("button", {
2993
3054
  class: "artifactuse-panel__action artifactuse-panel__action--close",
2994
3055
  title: "Close panel",
2995
- onClick: t[0] || (t[0] = (...w) => y(A) && y(A)(...w))
3056
+ onClick: t[0] || (t[0] = (...g) => k(L) && k(L)(...g))
2996
3057
  }, [...t[13] || (t[13] = [
2997
3058
  e("svg", {
2998
3059
  viewBox: "0 0 24 24",
@@ -3031,8 +3092,8 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
3031
3092
  e("h3", { class: "artifactuse-panel__empty-title" }, "No artifacts yet"),
3032
3093
  e("p", { class: "artifactuse-panel__empty-text" }, " Code blocks, forms, and other interactive content will appear here as the AI generates them. ")
3033
3094
  ], -1)),
3034
- e("footer", sl, [
3035
- se.value ? (a(), s("a", il, [...t[15] || (t[15] = [
3095
+ e("footer", ll, [
3096
+ j.value ? (a(), s("a", nl, [...t[15] || (t[15] = [
3036
3097
  e("svg", {
3037
3098
  width: "16",
3038
3099
  height: "16",
@@ -3058,22 +3119,22 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
3058
3119
  _: 1
3059
3120
  }));
3060
3121
  }
3061
- }, Pn = ["title"], Bn = {
3122
+ }, Bn = ["title"], En = {
3062
3123
  key: 0,
3063
3124
  class: "artifactuse-panel-toggle-badge"
3064
- }, Rn = {
3125
+ }, On = {
3065
3126
  __name: "ArtifactusePanelToggle",
3066
- setup(H) {
3067
- const { state: u, artifactCount: h, hasArtifacts: k, togglePanel: l } = He();
3068
- return (U, S) => (a(), s("button", {
3069
- class: N(["artifactuse-panel-toggle", {
3070
- "artifactuse-panel-toggle--active": y(u).isPanelOpen,
3071
- "artifactuse-panel-toggle--has-artifacts": y(k)
3127
+ setup(A) {
3128
+ const { state: u, artifactCount: h, hasArtifacts: m, togglePanel: l } = Ee();
3129
+ return (U, E) => (a(), s("button", {
3130
+ class: J(["artifactuse-panel-toggle", {
3131
+ "artifactuse-panel-toggle--active": k(u).isPanelOpen,
3132
+ "artifactuse-panel-toggle--has-artifacts": k(m)
3072
3133
  }]),
3073
- onClick: S[0] || (S[0] = (...A) => y(l) && y(l)(...A)),
3074
- title: y(u).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
3134
+ onClick: E[0] || (E[0] = (...L) => k(l) && k(l)(...L)),
3135
+ title: k(u).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
3075
3136
  }, [
3076
- S[1] || (S[1] = e("svg", {
3137
+ E[1] || (E[1] = e("svg", {
3077
3138
  viewBox: "0 0 24 24",
3078
3139
  fill: "none",
3079
3140
  stroke: "currentColor",
@@ -3084,38 +3145,38 @@ const Ut = { class: "artifactuse-card__icon" }, Dt = ["innerHTML"], jt = { class
3084
3145
  e("polyline", { points: "16 18 22 12 16 6" }),
3085
3146
  e("polyline", { points: "8 6 2 12 8 18" })
3086
3147
  ], -1)),
3087
- y(h) > 0 ? (a(), s("span", Bn, n(y(h) > 99 ? "99+" : y(h)), 1)) : d("", !0)
3088
- ], 10, Pn));
3148
+ k(h) > 0 ? (a(), s("span", En, o(k(h) > 99 ? "99+" : k(h)), 1)) : d("", !0)
3149
+ ], 10, Bn));
3089
3150
  }
3090
- }, st = Symbol("artifactuse");
3091
- function it(H = {}) {
3092
- var o;
3093
- const u = at(H), h = et({
3151
+ }, nt = Symbol("artifactuse");
3152
+ function ot(A = {}) {
3153
+ var n;
3154
+ const u = lt(A), h = st({
3094
3155
  artifacts: [],
3095
3156
  activeArtifactId: null,
3096
3157
  isPanelOpen: !1,
3097
3158
  viewMode: "preview",
3098
3159
  isFullscreen: !1
3099
3160
  });
3100
- u.state.subscribe((m) => {
3101
- h.artifacts = m.artifacts, h.activeArtifactId = m.activeArtifactId, h.isPanelOpen = m.isPanelOpen, h.viewMode = m.viewMode, h.isFullscreen = m.isFullscreen;
3161
+ u.state.subscribe((y) => {
3162
+ h.artifacts = y.artifacts, h.activeArtifactId = y.activeArtifactId, h.isPanelOpen = y.isPanelOpen, h.viewMode = y.viewMode, h.isFullscreen = y.isFullscreen;
3102
3163
  });
3103
- const k = b(() => h.activeArtifactId && h.artifacts.find((m) => m.id === h.activeArtifactId) || null), l = b(() => h.artifacts.filter((m) => !m.isInline).length), U = b(() => h.artifacts.some((m) => !m.isInline)), S = b(() => u.getPanelTypes()), A = b(() => k.value ? u.getPanelUrl(k.value) : null);
3104
- if (u.applyTheme(), H.theme === "auto" || !H.theme) {
3105
- const m = ((o = u.bridge) == null ? void 0 : o.theme) || u.theme;
3106
- m != null && m.watchSystemTheme && m.watchSystemTheme(() => {
3164
+ const m = b(() => h.activeArtifactId && h.artifacts.find((y) => y.id === h.activeArtifactId) || null), l = b(() => h.artifacts.filter((y) => !y.isInline).length), U = b(() => h.artifacts.some((y) => !y.isInline)), E = b(() => u.getPanelTypes()), L = b(() => m.value ? u.getPanelUrl(m.value) : null);
3165
+ if (u.applyTheme(), A.theme === "auto" || !A.theme) {
3166
+ const y = ((n = u.bridge) == null ? void 0 : n.theme) || u.theme;
3167
+ y != null && y.watchSystemTheme && y.watchSystemTheme(() => {
3107
3168
  u.applyTheme();
3108
3169
  });
3109
3170
  }
3110
- const g = {
3171
+ const w = {
3111
3172
  instance: u,
3112
3173
  state: h,
3113
- activeArtifact: k,
3174
+ activeArtifact: m,
3114
3175
  artifactCount: l,
3115
3176
  hasArtifacts: U,
3116
3177
  // Panel computed
3117
- panelTypes: S,
3118
- activePanelUrl: A,
3178
+ panelTypes: E,
3179
+ activePanelUrl: L,
3119
3180
  // Methods
3120
3181
  processMessage: u.processMessage,
3121
3182
  initializeContent: u.initializeContent,
@@ -3141,43 +3202,43 @@ function it(H = {}) {
3141
3202
  clearArtifacts: () => u.state.clear(),
3142
3203
  // Theme - wrap setTheme to also apply
3143
3204
  applyTheme: u.applyTheme,
3144
- setTheme: (m) => {
3145
- u.setTheme(m), u.applyTheme();
3205
+ setTheme: (y) => {
3206
+ u.setTheme(y), u.applyTheme();
3146
3207
  },
3147
3208
  getTheme: u.getTheme
3148
3209
  };
3149
- return It(st, g), g;
3210
+ return Vt(nt, w), w;
3150
3211
  }
3151
- function He() {
3152
- const H = Ft(st);
3153
- return H || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), it());
3212
+ function Ee() {
3213
+ const A = Rt(nt);
3214
+ return A || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), ot());
3154
3215
  }
3155
- function En(H = {}) {
3156
- const u = at(H), h = et({
3216
+ function zn(A = {}) {
3217
+ const u = lt(A), h = st({
3157
3218
  artifacts: [],
3158
3219
  activeArtifactId: null,
3159
3220
  isPanelOpen: !1,
3160
3221
  viewMode: "preview",
3161
3222
  isFullscreen: !1
3162
3223
  });
3163
- let k;
3164
- we(() => {
3165
- k = u.state.subscribe((o) => {
3166
- h.artifacts = o.artifacts, h.activeArtifactId = o.activeArtifactId, h.isPanelOpen = o.isPanelOpen, h.viewMode = o.viewMode, h.isFullscreen = o.isFullscreen;
3224
+ let m;
3225
+ xe(() => {
3226
+ m = u.state.subscribe((n) => {
3227
+ h.artifacts = n.artifacts, h.activeArtifactId = n.activeArtifactId, h.isPanelOpen = n.isPanelOpen, h.viewMode = n.viewMode, h.isFullscreen = n.isFullscreen;
3167
3228
  }), u.applyTheme();
3168
- }), Oe(() => {
3169
- k && k(), u.destroy();
3229
+ }), De(() => {
3230
+ m && m(), u.destroy();
3170
3231
  });
3171
- const l = b(() => h.activeArtifactId && h.artifacts.find((o) => o.id === h.activeArtifactId) || null), U = b(() => h.artifacts.filter((o) => !o.isInline).length), S = b(() => h.artifacts.some((o) => !o.isInline)), A = b(() => u.getPanelTypes()), g = b(() => l.value ? u.getPanelUrl(l.value) : null);
3232
+ const l = b(() => h.activeArtifactId && h.artifacts.find((n) => n.id === h.activeArtifactId) || null), U = b(() => h.artifacts.filter((n) => !n.isInline).length), E = b(() => h.artifacts.some((n) => !n.isInline)), L = b(() => u.getPanelTypes()), w = b(() => l.value ? u.getPanelUrl(l.value) : null);
3172
3233
  return {
3173
3234
  instance: u,
3174
3235
  state: h,
3175
3236
  activeArtifact: l,
3176
3237
  artifactCount: U,
3177
- hasArtifacts: S,
3238
+ hasArtifacts: E,
3178
3239
  // Panel computed
3179
- panelTypes: A,
3180
- activePanelUrl: g,
3240
+ panelTypes: L,
3241
+ activePanelUrl: w,
3181
3242
  // Methods
3182
3243
  processMessage: u.processMessage,
3183
3244
  initializeContent: u.initializeContent,
@@ -3203,29 +3264,29 @@ function En(H = {}) {
3203
3264
  clearArtifacts: () => u.state.clear(),
3204
3265
  // Theme - wrap setTheme to also apply
3205
3266
  applyTheme: u.applyTheme,
3206
- setTheme: (o) => {
3207
- u.setTheme(o), u.applyTheme();
3267
+ setTheme: (n) => {
3268
+ u.setTheme(n), u.applyTheme();
3208
3269
  },
3209
3270
  getTheme: u.getTheme
3210
3271
  };
3211
3272
  }
3212
- const qn = {
3213
- provideArtifactuse: it,
3214
- useArtifactuse: He,
3215
- createArtifactuseComposable: En,
3216
- DEFAULT_PANELS: qt
3273
+ const Un = {
3274
+ provideArtifactuse: ot,
3275
+ useArtifactuse: Ee,
3276
+ createArtifactuseComposable: zn,
3277
+ DEFAULT_PANELS: Ut
3217
3278
  };
3218
3279
  export {
3219
- Fn as ArtifactuseAgentMessage,
3220
- Gt as ArtifactuseCard,
3221
- Ua as ArtifactuseInlineForm,
3222
- Vn as ArtifactusePanel,
3223
- Rn as ArtifactusePanelToggle,
3224
- Ni as ArtifactuseSocialPreview,
3225
- Gi as ArtifactuseViewer,
3226
- qt as DEFAULT_PANELS,
3227
- En as createArtifactuseComposable,
3228
- qn as default,
3229
- it as provideArtifactuse,
3230
- He as useArtifactuse
3280
+ Rn as ArtifactuseAgentMessage,
3281
+ ta as ArtifactuseCard,
3282
+ ja as ArtifactuseInlineForm,
3283
+ qn as ArtifactusePanel,
3284
+ On as ArtifactusePanelToggle,
3285
+ Xi as ArtifactuseSocialPreview,
3286
+ tl as ArtifactuseViewer,
3287
+ Ut as DEFAULT_PANELS,
3288
+ zn as createArtifactuseComposable,
3289
+ Un as default,
3290
+ ot as provideArtifactuse,
3291
+ Ee as useArtifactuse
3231
3292
  };