artifactuse 0.3.1 → 0.3.2

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,5 +1,5 @@
1
- import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as I, createElementVNode as e, toDisplayString as n, withModifiers as _e, onMounted as Te, watch as oe, Fragment as F, createCommentVNode as v, renderList as de, createTextVNode as Y, h as ne, normalizeStyle as Se, createStaticVNode as ea, createBlock as Me, resolveDynamicComponent as ta, nextTick as ke, onUnmounted as Ye, Teleport as aa, createVNode as Fe, Transition as ze, withCtx as Ve, withKeys as sa, onBeforeUnmount as la, unref as y, withDirectives as _t, vShow as ht, reactive as yt, provide as ia, inject as na } from "vue";
2
- import { g as Ie, f as gt, a as Ze, b as Ke, n as oa, i as mt, c as ra, D as ca, d as kt } from "../index-vmcpJRYe.js";
1
+ import { ref as M, computed as b, createElementBlock as s, openBlock as a, normalizeClass as I, createElementVNode as e, toDisplayString as n, withModifiers as he, onMounted as Te, watch as oe, Fragment as F, createCommentVNode as v, renderList as ue, createTextVNode as Y, h as ne, normalizeStyle as Se, createStaticVNode as ea, createBlock as Me, resolveDynamicComponent as ta, nextTick as we, onUnmounted as Ye, Teleport as aa, createVNode as Fe, Transition as ze, withCtx as Ve, withKeys as sa, onBeforeUnmount as la, unref as y, withDirectives as _t, vShow as ht, reactive as yt, provide as ia, inject as na } from "vue";
2
+ import { g as Ie, f as gt, a as Ze, b as Ke, n as oa, i as mt, c as ra, D as ca, d as kt } from "../index-ABusvYh9.js";
3
3
  import { J as ua } from "../jszip.min-CdmYyw5L.js";
4
4
  const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class: "artifactuse-card__content" }, pa = { class: "artifactuse-card__title" }, _a = { class: "artifactuse-card__meta" }, ha = { class: "artifactuse-card__type" }, ma = { class: "artifactuse-card__size" }, ya = { class: "artifactuse-card__actions" }, ga = ["title"], ka = {
5
5
  key: 0,
@@ -27,26 +27,26 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
27
27
  },
28
28
  emits: ["open", "copy", "download"],
29
29
  setup(P, { emit: c }) {
30
- const _ = P, T = c, p = M(!1), r = b(() => Ie(_.artifact.language)), q = b(() => {
30
+ const p = P, T = c, _ = M(!1), r = b(() => Ie(p.artifact.language)), q = b(() => {
31
31
  var $;
32
- return gt(_.artifact.size || (($ = _.artifact.code) == null ? void 0 : $.length) || 0);
33
- }), A = b(() => Ze(_.artifact.language));
32
+ return gt(p.artifact.size || (($ = p.artifact.code) == null ? void 0 : $.length) || 0);
33
+ }), A = b(() => Ze(p.artifact.language));
34
34
  function g($) {
35
- $.stopPropagation(), T("open", _.artifact);
35
+ $.stopPropagation(), T("open", p.artifact);
36
36
  }
37
37
  async function o() {
38
38
  try {
39
- await navigator.clipboard.writeText(_.artifact.code), p.value = !0, setTimeout(() => {
40
- p.value = !1;
41
- }, 2e3), T("copy", _.artifact);
39
+ await navigator.clipboard.writeText(p.artifact.code), _.value = !0, setTimeout(() => {
40
+ _.value = !1;
41
+ }, 2e3), T("copy", p.artifact);
42
42
  } catch ($) {
43
43
  console.error("Failed to copy:", $);
44
44
  }
45
45
  }
46
46
  function h() {
47
47
  var N;
48
- const $ = new Blob([_.artifact.code], { type: "text/plain" }), V = URL.createObjectURL($), x = document.createElement("a"), D = Ke(_.artifact.language), U = ((N = _.artifact.title) == null ? void 0 : N.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
- x.href = V, x.download = `${U}.${D}`, document.body.appendChild(x), x.click(), document.body.removeChild(x), URL.revokeObjectURL(V), T("download", _.artifact);
48
+ const $ = new Blob([p.artifact.code], { type: "text/plain" }), V = URL.createObjectURL($), x = document.createElement("a"), D = Ke(p.artifact.editorLanguage || p.artifact.language), U = ((N = p.artifact.title) == null ? void 0 : N.replace(/[^a-z0-9]/gi, "_").toLowerCase()) || "code";
49
+ x.href = V, x.download = `${U}.${D}`, document.body.appendChild(x), x.click(), document.body.removeChild(x), URL.revokeObjectURL(V), T("download", p.artifact);
50
50
  }
51
51
  return ($, V) => (a(), s("div", {
52
52
  class: I(["artifactuse-card", { "artifactuse-card--active": P.isActive }]),
@@ -72,10 +72,10 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
72
72
  e("div", ya, [
73
73
  e("button", {
74
74
  class: "artifactuse-card__action",
75
- onClick: _e(o, ["stop"]),
76
- title: p.value ? "Copied!" : "Copy code"
75
+ onClick: he(o, ["stop"]),
76
+ title: _.value ? "Copied!" : "Copy code"
77
77
  }, [
78
- p.value ? (a(), s("svg", wa, [...V[2] || (V[2] = [
78
+ _.value ? (a(), s("svg", wa, [...V[2] || (V[2] = [
79
79
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
80
80
  ])])) : (a(), s("svg", ka, [...V[1] || (V[1] = [
81
81
  e("rect", {
@@ -91,7 +91,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
91
91
  ], 8, ga),
92
92
  e("button", {
93
93
  class: "artifactuse-card__action",
94
- onClick: _e(h, ["stop"]),
94
+ onClick: he(h, ["stop"]),
95
95
  title: "Download file"
96
96
  }, [...V[3] || (V[3] = [
97
97
  e("svg", {
@@ -221,17 +221,17 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
221
221
  },
222
222
  emits: ["submit", "cancel", "reset", "button-click"],
223
223
  setup(P, { emit: c }) {
224
- const _ = P, T = c, p = M(_.initialState), r = b(() => p.value !== "active"), q = b(() => p.value === "active" ? "" : `artifactuse-form--${p.value}`);
224
+ const p = P, T = c, _ = M(p.initialState), r = b(() => _.value !== "active"), q = b(() => _.value === "active" ? "" : `artifactuse-form--${_.value}`);
225
225
  function A(w) {
226
- p.value = w;
226
+ _.value = w;
227
227
  }
228
228
  const g = b(() => {
229
229
  try {
230
- return JSON.parse(_.artifact.code);
230
+ return JSON.parse(p.artifact.code);
231
231
  } catch {
232
232
  return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
233
233
  }
234
- }), o = M(null), h = b(() => _.artifact.id || g.value.id || `form-${Date.now()}`), $ = b(() => `artifactuse-form-${g.value.variant || "fields"}`), V = b(() => g.value.title || "Form"), x = M({}), D = M({}), U = M(!1), N = b(() => {
234
+ }), o = M(null), h = b(() => p.artifact.id || g.value.id || `form-${Date.now()}`), $ = b(() => `artifactuse-form-${g.value.variant || "fields"}`), V = b(() => g.value.title || "Form"), x = M({}), D = M({}), U = M(!1), N = b(() => {
235
235
  var w;
236
236
  return ((w = g.value.data) == null ? void 0 : w.fields) || [];
237
237
  }), ee = b(() => {
@@ -254,15 +254,15 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
254
254
  return H.length >= 3 ? `${H[0]}, ${H[1]}, ${H[2]}` : null;
255
255
  }
256
256
  function K() {
257
- if (o.value && _.accent) {
258
- const w = re(_.accent);
257
+ if (o.value && p.accent) {
258
+ const w = re(p.accent);
259
259
  w && o.value.style.setProperty("--artifactuse-primary", w);
260
260
  }
261
261
  }
262
262
  Te(() => {
263
- K(), p.value = _.initialState;
264
- }), oe(() => _.accent, K), oe(() => _.initialState, (w) => {
265
- p.value = w;
263
+ K(), _.value = p.initialState;
264
+ }), oe(() => p.accent, K), oe(() => p.initialState, (w) => {
265
+ _.value = w;
266
266
  });
267
267
  function Z() {
268
268
  var i;
@@ -271,8 +271,8 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
271
271
  ["buttons", "divider", "heading"].includes(H.type) || (H.defaultValue !== void 0 ? w[H.name] = H.defaultValue : H.type === "checkbox" ? w[H.name] = !1 : w[H.name] = "");
272
272
  }), (i = g.value.data) != null && i.defaults && Object.assign(w, g.value.data.defaults), x.value = w;
273
273
  }
274
- Z(), oe(() => _.artifact.code, Z);
275
- function ve(w) {
274
+ Z(), oe(() => p.artifact.code, Z);
275
+ function de(w) {
276
276
  return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(w);
277
277
  }
278
278
  function m(w) {
@@ -379,9 +379,9 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
379
379
  }, [
380
380
  r.value ? (a(), s("div", xa, [
381
381
  e("div", $a, [
382
- p.value === "submitted" ? (a(), s("svg", Ma, [...E[1] || (E[1] = [
382
+ _.value === "submitted" ? (a(), s("svg", Ma, [...E[1] || (E[1] = [
383
383
  e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
384
- ])])) : p.value === "cancelled" ? (a(), s("svg", Ta, [...E[2] || (E[2] = [
384
+ ])])) : _.value === "cancelled" ? (a(), s("svg", Ta, [...E[2] || (E[2] = [
385
385
  e("line", {
386
386
  x1: "18",
387
387
  y1: "6",
@@ -410,7 +410,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
410
410
  g.value.description ? (a(), s("p", Ha, n(g.value.description), 1)) : v("", !0)
411
411
  ])) : v("", !0),
412
412
  g.value.variant === "buttons" ? (a(), s("div", Ba, [
413
- (a(!0), s(F, null, de(ee.value, (i) => (a(), s("button", {
413
+ (a(!0), s(F, null, ue(ee.value, (i) => (a(), s("button", {
414
414
  key: i.name || i.label,
415
415
  type: "button",
416
416
  class: I(["artifactuse-form-btn", `artifactuse-form-btn-${i.variant || "secondary"}`]),
@@ -427,14 +427,14 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
427
427
  ])) : (a(), s("form", {
428
428
  key: 2,
429
429
  class: "artifactuse-form",
430
- onSubmit: _e(W, ["prevent"])
430
+ onSubmit: he(W, ["prevent"])
431
431
  }, [
432
432
  e("div", Va, [
433
- (a(!0), s(F, null, de(N.value, (i, H) => (a(), s(F, {
433
+ (a(!0), s(F, null, ue(N.value, (i, H) => (a(), s(F, {
434
434
  key: i.name || H
435
435
  }, [
436
436
  i.type === "buttons" ? (a(), s("div", Ia, [
437
- (a(!0), s(F, null, de(i.fields || [], (d) => (a(), s("button", {
437
+ (a(!0), s(F, null, ue(i.fields || [], (d) => (a(), s("button", {
438
438
  key: d.name || d.label,
439
439
  type: d.action === "submit" ? "submit" : "button",
440
440
  class: I(["artifactuse-form-btn", `artifactuse-form-btn-${d.variant || "secondary"}`]),
@@ -472,7 +472,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
472
472
  Y(n(i.label) + " ", 1),
473
473
  i.required ? (a(), s("span", Qa, "*")) : v("", !0)
474
474
  ], 8, Ya),
475
- ve(i.type) ? (a(), s("input", {
475
+ de(i.type) ? (a(), s("input", {
476
476
  key: 0,
477
477
  id: `${h.value}-${i.name}`,
478
478
  type: i.type,
@@ -502,13 +502,13 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
502
502
  onChange: (d) => k(i.name, d.target.value)
503
503
  }, [
504
504
  e("option", as, n(i.placeholder || "Select..."), 1),
505
- (a(!0), s(F, null, de(m(i.options), (d) => (a(), s("option", {
505
+ (a(!0), s(F, null, ue(m(i.options), (d) => (a(), s("option", {
506
506
  key: d.value,
507
507
  value: d.value,
508
508
  disabled: d.disabled
509
509
  }, n(d.label), 9, ss))), 128))
510
510
  ], 40, ts)) : i.type === "radio" ? (a(), s("div", ls, [
511
- (a(!0), s(F, null, de(m(i.options), (d) => (a(), s("label", {
511
+ (a(!0), s(F, null, ue(m(i.options), (d) => (a(), s("label", {
512
512
  key: d.value,
513
513
  class: "artifactuse-radio-label"
514
514
  }, [
@@ -612,7 +612,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
612
612
  }, li = { class: "artifactuse-social-thumbnail" }, ii = ["src", "alt"], ni = {
613
613
  key: 1,
614
614
  class: "artifactuse-social-duration"
615
- }, oi = { class: "artifactuse-social-info" }, ri = ["src", "alt"], ci = { class: "artifactuse-social-title" }, ui = { class: "artifactuse-social-channel" }, di = { class: "artifactuse-social-meta" }, vi = { class: "artifactuse-social-actions-bar" }, fi = { class: "artifactuse-social-platform-badge" }, he = '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>', pi = {
615
+ }, oi = { class: "artifactuse-social-info" }, ri = ["src", "alt"], ci = { class: "artifactuse-social-title" }, ui = { class: "artifactuse-social-channel" }, di = { class: "artifactuse-social-meta" }, vi = { class: "artifactuse-social-actions-bar" }, fi = { class: "artifactuse-social-platform-badge" }, me = '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>', pi = {
616
616
  __name: "ArtifactuseSocialPreview",
617
617
  props: {
618
618
  artifact: {
@@ -626,9 +626,9 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
626
626
  },
627
627
  emits: ["copy", "edit"],
628
628
  setup(P, { emit: c }) {
629
- const _ = P, T = c, p = M(null), r = M("Copy"), q = b(() => {
629
+ const p = P, T = c, _ = M(null), r = M("Copy"), q = b(() => {
630
630
  try {
631
- return JSON.parse(_.artifact.code);
631
+ return JSON.parse(p.artifact.code);
632
632
  } catch {
633
633
  return { platform: "twitter", data: {} };
634
634
  }
@@ -709,12 +709,12 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
709
709
  }
710
710
  }
711
711
  function K(m) {
712
- m.target.src = he;
712
+ m.target.src = me;
713
713
  }
714
714
  function Z(m) {
715
715
  m.target.style.display = "none";
716
716
  }
717
- function ve() {
717
+ function de() {
718
718
  const m = o.value.text || "";
719
719
  navigator.clipboard.writeText(m).then(() => {
720
720
  r.value = "Copied!", setTimeout(() => {
@@ -726,14 +726,14 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
726
726
  var ae, Q, W, ie, w, E;
727
727
  return a(), s("div", {
728
728
  ref_key: "containerRef",
729
- ref: p,
729
+ ref: _,
730
730
  class: I(["artifactuse-social", [`artifactuse-social-${A.value}`]]),
731
731
  "data-artifactuse-theme": P.theme
732
732
  }, [
733
733
  A.value === "twitter" ? (a(), s(F, { key: 0 }, [
734
734
  e("div", fs, [
735
735
  e("img", {
736
- src: g.value.avatar || he,
736
+ src: g.value.avatar || me,
737
737
  alt: g.value.name,
738
738
  class: "artifactuse-social-avatar",
739
739
  onError: K
@@ -766,7 +766,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
766
766
  class: I(["artifactuse-social-media-grid", { "artifactuse-social-media-single": o.value.media.length === 1 }]),
767
767
  "data-count": o.value.media.length
768
768
  }, [
769
- (a(!0), s(F, null, de(o.value.media.slice(0, 4), (i, H) => (a(), s("img", {
769
+ (a(!0), s(F, null, ue(o.value.media.slice(0, 4), (i, H) => (a(), s("img", {
770
770
  key: H,
771
771
  src: i.url,
772
772
  alt: i.alt || "",
@@ -803,7 +803,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
803
803
  ])
804
804
  ])) : v("", !0),
805
805
  o.value.poll ? (a(), s("div", As, [
806
- (a(!0), s(F, null, de(o.value.poll.options, (i, H) => {
806
+ (a(!0), s(F, null, ue(o.value.poll.options, (i, H) => {
807
807
  var d, L;
808
808
  return a(), s("div", {
809
809
  key: H,
@@ -824,7 +824,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
824
824
  o.value.quote ? (a(), s("div", zs, [
825
825
  e("div", Vs, [
826
826
  e("img", {
827
- src: ((W = o.value.quote.author) == null ? void 0 : W.avatar) || he,
827
+ src: ((W = o.value.quote.author) == null ? void 0 : W.avatar) || me,
828
828
  class: "artifactuse-social-quote-avatar"
829
829
  }, null, 8, Is),
830
830
  e("span", Fs, n((ie = o.value.quote.author) == null ? void 0 : ie.name), 1),
@@ -882,7 +882,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
882
882
  ], 64)) : A.value === "linkedin" ? (a(), s(F, { key: 1 }, [
883
883
  e("div", Ws, [
884
884
  e("img", {
885
- src: g.value.avatar || he,
885
+ src: g.value.avatar || me,
886
886
  alt: g.value.name,
887
887
  class: "artifactuse-social-avatar",
888
888
  onError: K
@@ -937,7 +937,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
937
937
  ], 64)) : A.value === "instagram" ? (a(), s(F, { key: 2 }, [
938
938
  e("div", rl, [
939
939
  e("img", {
940
- src: g.value.avatar || he,
940
+ src: g.value.avatar || me,
941
941
  alt: g.value.name,
942
942
  class: "artifactuse-social-avatar",
943
943
  onError: K
@@ -969,7 +969,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
969
969
  ], 64)) : A.value === "facebook" ? (a(), s(F, { key: 3 }, [
970
970
  e("div", gl, [
971
971
  e("img", {
972
- src: g.value.avatar || he,
972
+ src: g.value.avatar || me,
973
973
  alt: g.value.name,
974
974
  class: "artifactuse-social-avatar",
975
975
  onError: K
@@ -1021,7 +1021,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1021
1021
  ], 64)) : A.value === "threads" ? (a(), s(F, { key: 4 }, [
1022
1022
  e("div", Vl, [
1023
1023
  e("img", {
1024
- src: g.value.avatar || he,
1024
+ src: g.value.avatar || me,
1025
1025
  alt: g.value.name,
1026
1026
  class: "artifactuse-social-avatar",
1027
1027
  onError: K
@@ -1100,7 +1100,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1100
1100
  e("div", Yl, [
1101
1101
  e("div", Ql, [
1102
1102
  e("img", {
1103
- src: g.value.avatar || he,
1103
+ src: g.value.avatar || me,
1104
1104
  alt: g.value.name,
1105
1105
  class: "artifactuse-social-avatar",
1106
1106
  onError: K
@@ -1138,7 +1138,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1138
1138
  ]),
1139
1139
  e("div", oi, [
1140
1140
  e("img", {
1141
- src: g.value.avatar || he,
1141
+ src: g.value.avatar || me,
1142
1142
  alt: g.value.name,
1143
1143
  class: "artifactuse-social-avatar",
1144
1144
  onError: K
@@ -1157,7 +1157,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1157
1157
  ]),
1158
1158
  e("button", {
1159
1159
  class: "artifactuse-social-copy-btn",
1160
- onClick: ve
1160
+ onClick: de
1161
1161
  }, [
1162
1162
  k[18] || (k[18] = e("svg", {
1163
1163
  viewBox: "0 0 24 24",
@@ -1230,24 +1230,24 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1230
1230
  },
1231
1231
  emits: ["close"],
1232
1232
  setup(P, { emit: c }) {
1233
- const _ = P, T = c, p = M(null), r = M(!1);
1233
+ const p = P, T = c, _ = M(null), r = M(!1);
1234
1234
  function q() {
1235
1235
  r.value = !1, T("close");
1236
1236
  }
1237
1237
  function A() {
1238
- _.type === "image" && (r.value = !r.value);
1238
+ p.type === "image" && (r.value = !r.value);
1239
1239
  }
1240
1240
  function g() {
1241
1241
  const h = document.createElement("a");
1242
- h.href = _.src, h.download = _.alt || "download", document.body.appendChild(h), h.click(), document.body.removeChild(h);
1242
+ h.href = p.src, h.download = p.alt || "download", document.body.appendChild(h), h.click(), document.body.removeChild(h);
1243
1243
  }
1244
1244
  function o(h) {
1245
- h.key === "Escape" && _.isOpen && q();
1245
+ h.key === "Escape" && p.isOpen && q();
1246
1246
  }
1247
- return oe(() => _.isOpen, (h) => {
1248
- h ? (ke(() => {
1247
+ return oe(() => p.isOpen, (h) => {
1248
+ h ? (we(() => {
1249
1249
  var $;
1250
- ($ = p.value) == null || $.focus();
1250
+ ($ = _.value) == null || $.focus();
1251
1251
  }), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", r.value = !1);
1252
1252
  }), Te(() => {
1253
1253
  document.addEventListener("keydown", o);
@@ -1263,11 +1263,11 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1263
1263
  onKeydown: sa(q, ["escape"]),
1264
1264
  tabindex: "-1",
1265
1265
  ref_key: "overlayRef",
1266
- ref: p
1266
+ ref: _
1267
1267
  }, [
1268
1268
  e("div", {
1269
1269
  class: "artifactuse-viewer-content",
1270
- onClick: $[0] || ($[0] = _e(() => {
1270
+ onClick: $[0] || ($[0] = he(() => {
1271
1271
  }, ["stop"]))
1272
1272
  }, [
1273
1273
  P.type === "image" ? (a(), s("img", {
@@ -1309,7 +1309,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1309
1309
  P.type === "image" ? (a(), s("div", mi, [
1310
1310
  e("button", {
1311
1311
  class: "artifactuse-viewer-control",
1312
- onClick: _e(A, ["stop"]),
1312
+ onClick: he(A, ["stop"]),
1313
1313
  title: r.value ? "Zoom out" : "Zoom in"
1314
1314
  }, [
1315
1315
  r.value ? (a(), s("svg", ki, [...$[3] || ($[3] = [
@@ -1358,7 +1358,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1358
1358
  ], 8, yi),
1359
1359
  e("button", {
1360
1360
  class: "artifactuse-viewer-control",
1361
- onClick: _e(g, ["stop"]),
1361
+ onClick: he(g, ["stop"]),
1362
1362
  title: "Download"
1363
1363
  }, [...$[4] || ($[4] = [
1364
1364
  e("svg", {
@@ -1447,8 +1447,8 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1447
1447
  "social-copy",
1448
1448
  "media-open"
1449
1449
  ],
1450
- setup(P, { expose: c, emit: _ }) {
1451
- const T = P, p = _, {
1450
+ setup(P, { expose: c, emit: p }) {
1451
+ const T = P, _ = p, {
1452
1452
  processMessage: r,
1453
1453
  openArtifact: q,
1454
1454
  state: A,
@@ -1456,7 +1456,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1456
1456
  instance: o
1457
1457
  } = Re(), h = M(null), $ = M(null), V = M(""), x = M([]);
1458
1458
  let D = null;
1459
- const U = M(!1), N = M("image"), ee = M(""), B = M(""), re = M(""), K = b(() => (g == null ? void 0 : g()) || "dark"), Z = b(() => A.activeArtifactId), ve = b(() => {
1459
+ const U = M(!1), N = M("image"), ee = M(""), B = M(""), re = M(""), K = b(() => (g == null ? void 0 : g()) || "dark"), Z = b(() => A.activeArtifactId), de = b(() => {
1460
1460
  var C;
1461
1461
  return T.inlineCards ?? ((C = o == null ? void 0 : o.config) == null ? void 0 : C.inlineCards) ?? !0;
1462
1462
  }), m = M(!1);
@@ -1501,7 +1501,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1501
1501
  return C.length === 0 && R.trim() && C.push({ type: "html", content: R }), C;
1502
1502
  });
1503
1503
  function W(C) {
1504
- N.value = C.type || "image", ee.value = C.src || "", B.value = C.alt || "", re.value = C.caption || "", U.value = !0, p("media-open", C);
1504
+ N.value = C.type || "image", ee.value = C.src || "", B.value = C.alt || "", re.value = C.caption || "", U.value = !0, _("media-open", C);
1505
1505
  }
1506
1506
  function ie() {
1507
1507
  U.value = !1, ee.value = "", B.value = "", re.value = "";
@@ -1520,23 +1520,23 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1520
1520
  }), $.value.querySelectorAll(".artifactuse-image-container img").forEach((f) => {
1521
1521
  f._lightboxHandler || (f._lightboxHandler = (j) => {
1522
1522
  j.preventDefault(), j.stopPropagation();
1523
- const le = f.closest(".artifactuse-image-container"), G = le == null ? void 0 : le.querySelector(".artifactuse-image-caption"), me = (G == null ? void 0 : G.textContent) || f.dataset.caption || f.alt || "";
1523
+ const le = f.closest(".artifactuse-image-container"), G = le == null ? void 0 : le.querySelector(".artifactuse-image-caption"), ye = (G == null ? void 0 : G.textContent) || f.dataset.caption || f.alt || "";
1524
1524
  W({
1525
1525
  type: "image",
1526
1526
  src: f.src,
1527
1527
  alt: f.alt || "",
1528
- caption: me
1528
+ caption: ye
1529
1529
  });
1530
1530
  }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
1531
1531
  }), $.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((f) => {
1532
1532
  f._lightboxHandler || (f._lightboxHandler = (j) => {
1533
1533
  j.preventDefault(), j.stopPropagation();
1534
- const le = f.closest(".artifactuse-gallery-item"), G = le == null ? void 0 : le.querySelector(".artifactuse-gallery-caption"), me = (G == null ? void 0 : G.textContent) || f.dataset.caption || f.alt || "";
1534
+ const le = f.closest(".artifactuse-gallery-item"), G = le == null ? void 0 : le.querySelector(".artifactuse-gallery-caption"), ye = (G == null ? void 0 : G.textContent) || f.dataset.caption || f.alt || "";
1535
1535
  W({
1536
1536
  type: "image",
1537
1537
  src: f.src,
1538
1538
  alt: f.alt || "",
1539
- caption: me
1539
+ caption: ye
1540
1540
  });
1541
1541
  }, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
1542
1542
  }), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((f) => {
@@ -1582,7 +1582,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1582
1582
  }
1583
1583
  function i() {
1584
1584
  D && clearTimeout(D), D = setTimeout(async () => {
1585
- if (await ke(), o != null && o.initializeContent && $.value)
1585
+ if (await we(), o != null && o.initializeContent && $.value)
1586
1586
  try {
1587
1587
  await o.initializeContent($.value);
1588
1588
  } catch (C) {
@@ -1601,7 +1601,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1601
1601
  tabs: T.tabs,
1602
1602
  viewMode: T.viewMode
1603
1603
  });
1604
- V.value = R.html, x.value = R.artifacts, R.artifacts.length > 0 && p("artifact-detected", R.artifacts), T.typing || i();
1604
+ V.value = R.html, x.value = R.artifacts, R.artifacts.length > 0 && _("artifact-detected", R.artifacts), T.typing || i();
1605
1605
  }
1606
1606
  },
1607
1607
  { immediate: !0 }
@@ -1627,25 +1627,25 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1627
1627
  }
1628
1628
  }
1629
1629
  function d(C) {
1630
- q(C), p("artifact-open", C);
1630
+ q(C), _("artifact-open", C);
1631
1631
  }
1632
1632
  function L(C) {
1633
- p("artifact-copy", C);
1633
+ _("artifact-copy", C);
1634
1634
  }
1635
1635
  function se(C) {
1636
- p("artifact-download", C);
1636
+ _("artifact-download", C);
1637
1637
  }
1638
1638
  function ce(C) {
1639
- p("form-submit", C);
1640
- }
1641
- function we(C) {
1642
- p("form-cancel", C);
1639
+ _("form-submit", C);
1643
1640
  }
1644
1641
  function be(C) {
1645
- p("form-button-click", C);
1642
+ _("form-cancel", C);
1643
+ }
1644
+ function Ce(C) {
1645
+ _("form-button-click", C);
1646
1646
  }
1647
1647
  function Le(C) {
1648
- p("social-copy", C);
1648
+ _("social-copy", C);
1649
1649
  }
1650
1650
  return b(() => A.artifacts.filter((C) => C.messageId === T.messageId)), c({
1651
1651
  openViewer: W,
@@ -1662,7 +1662,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1662
1662
  ref: $,
1663
1663
  onClick: H
1664
1664
  }, [
1665
- (a(!0), s(F, null, de(Q.value, (O, J) => (a(), s(F, { key: J }, [
1665
+ (a(!0), s(F, null, ue(Q.value, (O, J) => (a(), s(F, { key: J }, [
1666
1666
  O.type === "html" ? (a(), s("div", {
1667
1667
  key: 0,
1668
1668
  innerHTML: O.content
@@ -1672,14 +1672,14 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1672
1672
  theme: K.value,
1673
1673
  "initial-state": k.value,
1674
1674
  onSubmit: ce,
1675
- onCancel: we,
1676
- onButtonClick: be
1675
+ onCancel: be,
1676
+ onButtonClick: Ce
1677
1677
  }, null, 8, ["artifact", "theme", "initial-state"])) : O.type === "social" ? (a(), Me(pi, {
1678
1678
  key: 2,
1679
1679
  artifact: O.artifact,
1680
1680
  theme: K.value,
1681
1681
  onCopy: Le
1682
- }, null, 8, ["artifact", "theme"])) : O.type === "panel" && ve.value ? (a(), Me(ba, {
1682
+ }, null, 8, ["artifact", "theme"])) : O.type === "panel" && de.value ? (a(), Me(ba, {
1683
1683
  key: 3,
1684
1684
  artifact: O.artifact,
1685
1685
  "is-active": Z.value === O.artifact.id,
@@ -1828,8 +1828,8 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1828
1828
  emits: ["close", "ai-request", "save", "export", "resize"],
1829
1829
  setup(P, { emit: c }) {
1830
1830
  var ft, pt;
1831
- const _ = c, T = P, {
1832
- state: p,
1831
+ const p = c, T = P, {
1832
+ state: _,
1833
1833
  activeArtifact: r,
1834
1834
  artifactCount: q,
1835
1835
  hasArtifacts: A,
@@ -1839,7 +1839,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1839
1839
  getPanelUrl: $,
1840
1840
  openArtifact: V,
1841
1841
  instance: x
1842
- } = Re(), D = M(null), U = M(null), N = M(null), ee = M(null), B = M(null), re = M(null), K = M(!1), Z = M(!1), ve = M(!0), m = M(!1), k = M(!1), ae = M(!1), Q = M([]), W = M(!1), ie = M(null), w = M(/* @__PURE__ */ new Set(["log", "warn", "error", "info"])), E = M(!1), i = M("options"), H = M(""), d = M(null), L = M(""), se = M(!1), ce = M(!1), we = M([]), be = M(!1), Le = M("");
1842
+ } = Re(), D = M(null), U = M(null), N = M(null), ee = M(null), B = M(null), re = M(null), K = M(!1), Z = M(!1), de = M(!0), m = M(!1), k = M(!1), ae = M(!1), Q = M([]), W = M(!1), ie = M(null), w = M(/* @__PURE__ */ new Set(["log", "warn", "error", "info"])), E = M(!1), i = M("options"), H = M(""), d = M(null), L = M(""), se = M(!1), ce = M(!1), be = M([]), Ce = M(!1), Le = M("");
1843
1843
  let C = null, R = null, O = null, J = null;
1844
1844
  const S = b(() => {
1845
1845
  var l;
@@ -1853,8 +1853,8 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1853
1853
  let l = $(r.value);
1854
1854
  return l && r.value._refreshToken && (l += (l.includes("?") ? "&" : "?") + "_t=" + r.value._refreshToken), l;
1855
1855
  });
1856
- b(() => !r.value || !p.artifacts.length ? -1 : p.artifacts.findIndex((l) => l.id === r.value.id));
1857
- const me = b(() => r.value ? oa(r.value.language || "plaintext") : "plaintext"), fe = b(() => p.artifacts.filter((l) => !l.isInline)), Pe = b(() => r.value ? fe.value.findIndex((l) => l.id === r.value.id) : -1), qe = b(() => {
1856
+ b(() => !r.value || !_.artifacts.length ? -1 : _.artifacts.findIndex((l) => l.id === r.value.id));
1857
+ const ye = b(() => r.value ? oa(r.value.language || "plaintext") : "plaintext"), ve = b(() => _.artifacts.filter((l) => !l.isInline)), Pe = b(() => r.value ? ve.value.findIndex((l) => l.id === r.value.id) : -1), qe = b(() => {
1858
1858
  var l;
1859
1859
  return ((l = x.config) == null ? void 0 : l.branding) !== !1;
1860
1860
  }), Ct = b(() => {
@@ -1874,10 +1874,10 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1874
1874
  }), tt = b(() => {
1875
1875
  var l;
1876
1876
  return ((l = x.share) == null ? void 0 : l.isAuthenticated()) || !1;
1877
- }), Tt = b(() => !r.value && !p.forceEmptyView ? Math.min(te.value, 30) : te.value), Ee = b(() => {
1877
+ }), Tt = b(() => !r.value && !_.forceEmptyView ? Math.min(te.value, 30) : te.value), Ee = b(() => {
1878
1878
  var l;
1879
1879
  return ((l = x.config) == null ? void 0 : l.multiTab) === !0;
1880
- }), Ce = b(() => p.forceEmptyView), at = b(() => Ee.value ? p.openTabs.map((l) => p.artifacts.find((t) => t.id === l)).filter(Boolean) : []);
1880
+ }), xe = b(() => _.forceEmptyView), at = b(() => Ee.value ? _.openTabs.map((l) => _.artifacts.find((t) => t.id === l)).filter(Boolean) : []);
1881
1881
  function Ue(l) {
1882
1882
  return `<svg viewBox="0 0 24 24" fill="currentColor">${Ze(l)}</svg>`;
1883
1883
  }
@@ -1885,7 +1885,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1885
1885
  V(l);
1886
1886
  }
1887
1887
  function Pt(l) {
1888
- x.closeTab(l), p.openTabs.length === 0 && (k.value = !1);
1888
+ x.closeTab(l), _.openTabs.length === 0 && (k.value = !1);
1889
1889
  }
1890
1890
  function Et() {
1891
1891
  k.value = !1, x.state.clearActiveArtifact();
@@ -1898,8 +1898,8 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1898
1898
  const u = t.language || "plaintext", z = mt() && window.Prism.languages[u], X = ra(t.oldCode, t.newCode).split(`
1899
1899
  `);
1900
1900
  return { html: X.map((pe) => {
1901
- const ue = pe[0], $e = pe.slice(1), ge = z ? window.Prism.highlight($e, z, u) : $e;
1902
- return ue === "-" ? `<span class="token deleted">${ge}</span>` : ue === "+" ? `<span class="token inserted">${ge}</span>` : ge;
1901
+ const _e = pe[0], fe = pe.slice(1), ke = z ? window.Prism.highlight(fe, z, u) : fe;
1902
+ return _e === "-" ? `<span class="token deleted">${ke}</span>` : _e === "+" ? `<span class="token inserted">${ke}</span>` : ke;
1903
1903
  }).join(`
1904
1904
  `), lineCount: X.length };
1905
1905
  } catch {
@@ -1921,14 +1921,14 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1921
1921
  if (t)
1922
1922
  U.value.innerHTML = t.html;
1923
1923
  else {
1924
- const u = window.Prism.languages[me.value];
1924
+ const u = window.Prism.languages[ye.value];
1925
1925
  u ? U.value.innerHTML = window.Prism.highlight(
1926
1926
  r.value.code,
1927
1927
  u,
1928
- me.value
1928
+ ye.value
1929
1929
  ) : U.value.textContent = r.value.code;
1930
1930
  }
1931
- U.value.dataset.highlighted = "true", ke(() => {
1931
+ U.value.dataset.highlighted = "true", we(() => {
1932
1932
  Bt();
1933
1933
  });
1934
1934
  }
@@ -1945,7 +1945,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1945
1945
  B.value && (B.value.style.backgroundColor = ""), ee.value && (ee.value.style.backgroundColor = "");
1946
1946
  }
1947
1947
  function Be() {
1948
- ke(() => {
1948
+ we(() => {
1949
1949
  At(), Ht();
1950
1950
  });
1951
1951
  }
@@ -1969,14 +1969,14 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1969
1969
  });
1970
1970
  }
1971
1971
  function Vt() {
1972
- clearTimeout(O), ve.value = !1, D.value && r.value && (x.bridge.setIframe(D.value), x.bridge.loadArtifact(r.value));
1972
+ clearTimeout(O), de.value = !1, D.value && r.value && (x.bridge.setIframe(D.value), x.bridge.loadArtifact(r.value));
1973
1973
  }
1974
1974
  function It() {
1975
- clearTimeout(O), ve.value = !1;
1975
+ clearTimeout(O), de.value = !1;
1976
1976
  }
1977
1977
  function Ft() {
1978
1978
  clearTimeout(O), O = setTimeout(() => {
1979
- ve.value = !1;
1979
+ de.value = !1;
1980
1980
  }, 1e3);
1981
1981
  }
1982
1982
  async function Rt() {
@@ -1991,23 +1991,23 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
1991
1991
  }
1992
1992
  function qt() {
1993
1993
  if (!r.value) return;
1994
- const { code: l, language: t, title: u } = r.value, z = Ke(t), X = `${u.toLowerCase().replace(/\s+/g, "-")}.${z}`, ye = new Blob([l], { type: "text/plain" }), pe = URL.createObjectURL(ye), ue = document.createElement("a");
1995
- ue.href = pe, ue.download = X, document.body.appendChild(ue), ue.click(), document.body.removeChild(ue), URL.revokeObjectURL(pe);
1994
+ const { code: l, language: t, editorLanguage: u, title: z } = r.value, X = Ke(u || t), ge = `${z.toLowerCase().replace(/\s+/g, "-")}.${X}`, pe = new Blob([l], { type: "text/plain" }), _e = URL.createObjectURL(pe), fe = document.createElement("a");
1995
+ fe.href = _e, fe.download = ge, document.body.appendChild(fe), fe.click(), document.body.removeChild(fe), URL.revokeObjectURL(_e);
1996
1996
  }
1997
1997
  async function Ot() {
1998
- if (!(ae.value || fe.value.length === 0)) {
1998
+ if (!(ae.value || ve.value.length === 0)) {
1999
1999
  ae.value = !0;
2000
2000
  try {
2001
2001
  const l = new ua(), t = /* @__PURE__ */ new Map();
2002
- for (const ue of fe.value) {
2003
- if (!ue.code) continue;
2004
- const $e = Ke(ue.language);
2005
- let ge = (ue.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Je = `${ge}.${$e}`;
2002
+ for (const _e of ve.value) {
2003
+ if (!_e.code) continue;
2004
+ const fe = Ke(_e.editorLanguage || _e.language);
2005
+ let ke = (_e.title || "untitled").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_]/g, ""), Je = `${ke}.${fe}`;
2006
2006
  const Xe = t.get(Je) || 0;
2007
- Xe > 0 && (Je = `${ge}-${Xe}.${$e}`), t.set(`${ge}.${$e}`, Xe + 1), l.file(Je, ue.code);
2007
+ Xe > 0 && (Je = `${ke}-${Xe}.${fe}`), t.set(`${ke}.${fe}`, Xe + 1), l.file(Je, _e.code);
2008
2008
  }
2009
- const u = await l.generateAsync({ type: "blob" }), X = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, ye = URL.createObjectURL(u), pe = document.createElement("a");
2010
- pe.href = ye, pe.download = X, document.body.appendChild(pe), pe.click(), document.body.removeChild(pe), URL.revokeObjectURL(ye);
2009
+ const u = await l.generateAsync({ type: "blob" }), X = `artifacts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.zip`, ge = URL.createObjectURL(u), pe = document.createElement("a");
2010
+ pe.href = ge, pe.download = X, document.body.appendChild(pe), pe.click(), document.body.removeChild(pe), URL.revokeObjectURL(ge);
2011
2011
  } catch (l) {
2012
2012
  console.error("Failed to create ZIP:", l);
2013
2013
  } finally {
@@ -2020,7 +2020,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2020
2020
  E.value = !1;
2021
2021
  return;
2022
2022
  }
2023
- r.value && (i.value = "options", H.value = "", d.value = null, L.value = "", se.value = !1, ce.value = !1, we.value = [], be.value = !1, Le.value = "", E.value = !0);
2023
+ r.value && (i.value = "options", H.value = "", d.value = null, L.value = "", se.value = !1, ce.value = !1, be.value = [], Ce.value = !1, Le.value = "", E.value = !0);
2024
2024
  }
2025
2025
  function Dt() {
2026
2026
  E.value = !1;
@@ -2077,14 +2077,14 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2077
2077
  return;
2078
2078
  }
2079
2079
  }
2080
- i.value = "update-list", be.value = !0;
2080
+ i.value = "update-list", Ce.value = !0;
2081
2081
  try {
2082
2082
  const t = ((l = r.value) == null ? void 0 : l.language) || null, u = await x.share.listArtifacts(t);
2083
- we.value = u.projects || [];
2083
+ be.value = u.projects || [];
2084
2084
  } catch (t) {
2085
2085
  L.value = t.message || "Failed to load artifacts", i.value = "error";
2086
2086
  } finally {
2087
- be.value = !1;
2087
+ Ce.value = !1;
2088
2088
  }
2089
2089
  }
2090
2090
  }
@@ -2126,31 +2126,31 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2126
2126
  }
2127
2127
  function Kt() {
2128
2128
  const l = Pe.value - 1;
2129
- l >= 0 && V(fe.value[l]);
2129
+ l >= 0 && V(ve.value[l]);
2130
2130
  }
2131
2131
  function Yt() {
2132
2132
  const l = Pe.value + 1;
2133
- l < fe.value.length && V(fe.value[l]);
2133
+ l < ve.value.length && V(ve.value[l]);
2134
2134
  }
2135
2135
  function ut(l) {
2136
2136
  const t = document.querySelector(".artifactuse-panel__nav");
2137
2137
  t && !t.contains(l.target) && (Z.value = !1);
2138
2138
  }
2139
- let xe = null;
2139
+ let $e = null;
2140
2140
  function Qt(l) {
2141
- xe = {
2141
+ $e = {
2142
2142
  startX: l.clientX,
2143
2143
  startWidth: te.value
2144
2144
  }, document.addEventListener("mousemove", dt), document.addEventListener("mouseup", Ne), document.body.style.cursor = "ew-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((u) => u.style.pointerEvents = "none");
2145
2145
  }
2146
2146
  function dt(l) {
2147
- if (!xe) return;
2148
- const t = window.innerWidth, z = (xe.startX - l.clientX) / t * 100, X = xe.startWidth + z;
2149
- te.value = Math.min(Math.max(X, 25), 75), _("resize", { width: te.value });
2147
+ if (!$e) return;
2148
+ const t = window.innerWidth, z = ($e.startX - l.clientX) / t * 100, X = $e.startWidth + z;
2149
+ te.value = Math.min(Math.max(X, 25), 75), p("resize", { width: te.value });
2150
2150
  }
2151
2151
  function Ne() {
2152
- const l = xe !== null;
2153
- xe = null, document.removeEventListener("mousemove", dt), document.removeEventListener("mouseup", Ne), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((u) => u.style.pointerEvents = ""), l && _("resize", { width: te.value });
2152
+ const l = $e !== null;
2153
+ $e = null, document.removeEventListener("mousemove", dt), document.removeEventListener("mouseup", Ne), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((u) => u.style.pointerEvents = ""), l && p("resize", { width: te.value });
2154
2154
  }
2155
2155
  let Ae = null;
2156
2156
  function Gt(l) {
@@ -2174,12 +2174,12 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2174
2174
  return oe(r, (l, t) => {
2175
2175
  l && (t && t.isPreviewable !== l.isPreviewable && (m.value = !0, setTimeout(() => {
2176
2176
  m.value = !1;
2177
- }, 150)), (!t || l.id !== t.id) && (St(), ve.value = !0, Ft()), (!t || l.id !== t.id || l.code !== t.code) && (Be(), p.viewMode === "edit" && (!t || l.id !== t.id ? ke(() => lt()) : J && J.setCode(l.code || "")), clearTimeout(R), R = setTimeout(() => {
2177
+ }, 150)), (!t || l.id !== t.id) && (St(), de.value = !0, Ft()), (!t || l.id !== t.id || l.code !== t.code) && (Be(), _.viewMode === "edit" && (!t || l.id !== t.id ? we(() => lt()) : J && J.setCode(l.code || "")), clearTimeout(R), R = setTimeout(() => {
2178
2178
  D.value && l.isPreviewable && x.bridge.loadArtifact(l);
2179
2179
  }, 500)));
2180
- }, { deep: !0 }), oe(() => p.viewMode, (l) => {
2181
- (l === "code" || l === "split") && Be(), l === "edit" && ke(() => lt());
2182
- }), oe(() => p.isPanelOpen, (l) => {
2180
+ }, { deep: !0 }), oe(() => _.viewMode, (l) => {
2181
+ (l === "code" || l === "split") && Be(), l === "edit" && we(() => lt());
2182
+ }), oe(() => _.isPanelOpen, (l) => {
2183
2183
  l && r.value && Be(), l || De();
2184
2184
  }), oe(() => {
2185
2185
  var l;
@@ -2187,7 +2187,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2187
2187
  }, () => {
2188
2188
  Q.value = [], W.value = !1;
2189
2189
  }), oe([Q, W], () => {
2190
- ie.value && W.value && ke(() => {
2190
+ ie.value && W.value && we(() => {
2191
2191
  ie.value.scrollTop = ie.value.scrollHeight;
2192
2192
  });
2193
2193
  }), oe(() => T.panelWidth, (l) => {
@@ -2195,34 +2195,34 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2195
2195
  }), oe(() => T.splitPosition, (l) => {
2196
2196
  l !== void 0 && (f.value = Math.min(Math.max(l, 20), 80));
2197
2197
  }), Te(() => {
2198
- x.on("ai:request", (l) => _("ai-request", l)), x.on("save:request", (l) => _("save", l)), x.on("export:complete", (l) => _("export", l)), x && (C = x.on("console:log", ({ entry: l }) => {
2198
+ x.on("ai:request", (l) => p("ai-request", l)), x.on("save:request", (l) => p("save", l)), x.on("export:complete", (l) => p("export", l)), x && (C = x.on("console:log", ({ entry: l }) => {
2199
2199
  Q.value = [...Q.value, l].slice(-500), l.type === "error" && (W.value = !0);
2200
- })), document.addEventListener("click", ut), p.isPanelOpen && r.value && Be();
2200
+ })), document.addEventListener("click", ut), _.isPanelOpen && r.value && Be();
2201
2201
  }), Ye(() => {
2202
2202
  Ne(), We(), De(), document.removeEventListener("click", ut), clearTimeout(R), clearTimeout(O), C && C();
2203
2203
  }), (l, t) => (a(), Me(ze, { name: "artifactuse-panel" }, {
2204
2204
  default: Ve(() => [
2205
- y(p).isPanelOpen ? (a(), s("div", {
2205
+ y(_).isPanelOpen ? (a(), s("div", {
2206
2206
  key: 0,
2207
2207
  class: I(["artifactuse-panel", {
2208
- "artifactuse-panel--fullscreen": y(p).isFullscreen,
2209
- "artifactuse-panel--list": !y(r) && y(A) && !y(p).forceEmptyView,
2210
- "artifactuse-panel--empty": !y(A) && !y(p).forceEmptyView
2208
+ "artifactuse-panel--fullscreen": y(_).isFullscreen,
2209
+ "artifactuse-panel--list": !y(r) && y(A) && !y(_).forceEmptyView,
2210
+ "artifactuse-panel--empty": !y(A) && !y(_).forceEmptyView
2211
2211
  }]),
2212
- style: Se(y(p).isFullscreen ? void 0 : { width: `${Tt.value}%` })
2212
+ style: Se(y(_).isFullscreen ? void 0 : { width: `${Tt.value}%` })
2213
2213
  }, [
2214
- y(p).isFullscreen ? v("", !0) : (a(), s("div", {
2214
+ y(_).isFullscreen ? v("", !0) : (a(), s("div", {
2215
2215
  key: 0,
2216
2216
  class: "artifactuse-panel__resize-handle",
2217
- onMousedown: _e(Qt, ["prevent"])
2217
+ onMousedown: he(Qt, ["prevent"])
2218
2218
  }, [...t[19] || (t[19] = [
2219
2219
  e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
2220
2220
  ])], 32)),
2221
- !y(A) || Ce.value ? (a(), s(F, { key: 1 }, [
2221
+ !y(A) || xe.value ? (a(), s(F, { key: 1 }, [
2222
2222
  e("header", xi, [
2223
2223
  e("div", $i, [
2224
2224
  e("span", Mi, [
2225
- Ce.value ? (a(), s("svg", Ti, [...t[20] || (t[20] = [
2225
+ xe.value ? (a(), s("svg", Ti, [...t[20] || (t[20] = [
2226
2226
  e("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }, null, -1),
2227
2227
  e("polyline", { points: "14 2 14 8 20 8" }, null, -1)
2228
2228
  ])])) : (a(), s("svg", Li, [...t[21] || (t[21] = [
@@ -2231,7 +2231,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2231
2231
  ])]))
2232
2232
  ]),
2233
2233
  e("div", Pi, [
2234
- e("span", Ei, n(Ce.value ? "Artifact Viewer" : "Artifacts"), 1)
2234
+ e("span", Ei, n(xe.value ? "Artifact Viewer" : "Artifacts"), 1)
2235
2235
  ])
2236
2236
  ]),
2237
2237
  e("div", Ai, [
@@ -2274,8 +2274,8 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2274
2274
  e("polyline", { points: "14 2 14 8 20 8" })
2275
2275
  ])
2276
2276
  ], -1)),
2277
- e("h3", Bi, n(Ce.value ? "No artifact selected" : "No artifacts yet"), 1),
2278
- e("p", Si, n(Ce.value ? "Open an artifact to have it appear here" : "Code blocks, forms, and other interactive content will appear here as the AI generates them."), 1)
2277
+ e("h3", Bi, n(xe.value ? "No artifact selected" : "No artifacts yet"), 1),
2278
+ e("p", Si, n(xe.value ? "Open an artifact to have it appear here" : "Code blocks, forms, and other interactive content will appear here as the AI generates them."), 1)
2279
2279
  ]),
2280
2280
  e("footer", zi, [
2281
2281
  qe.value ? (a(), s("a", Vi, [...t[24] || (t[24] = [
@@ -2298,7 +2298,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2298
2298
  e("span", null, "Artifactuse", -1)
2299
2299
  ])])) : v("", !0)
2300
2300
  ])
2301
- ], 64)) : !y(r) && !Ce.value ? (a(), s(F, { key: 2 }, [
2301
+ ], 64)) : !y(r) && !xe.value ? (a(), s(F, { key: 2 }, [
2302
2302
  e("header", Ii, [
2303
2303
  e("div", Fi, [
2304
2304
  t[26] || (t[26] = e("span", { class: "artifactuse-panel__icon" }, [
@@ -2314,7 +2314,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2314
2314
  ], -1)),
2315
2315
  e("div", Ri, [
2316
2316
  t[25] || (t[25] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
2317
- e("span", qi, n(fe.value.length) + " available", 1)
2317
+ e("span", qi, n(ve.value.length) + " available", 1)
2318
2318
  ])
2319
2319
  ]),
2320
2320
  e("div", Oi, [
@@ -2372,7 +2372,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2372
2372
  ]),
2373
2373
  e("div", Ni, [
2374
2374
  e("div", Wi, [
2375
- (a(!0), s(F, null, de(fe.value, (u, z) => (a(), s("button", {
2375
+ (a(!0), s(F, null, ue(ve.value, (u, z) => (a(), s("button", {
2376
2376
  key: u.id,
2377
2377
  class: "artifactuse-panel__list-item",
2378
2378
  onClick: (X) => ct(u)
@@ -2459,7 +2459,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2459
2459
  e("div", rn, [
2460
2460
  !y(r).tabs || y(r).tabs.includes("preview") ? (a(), s("button", {
2461
2461
  key: 0,
2462
- class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "preview" }]),
2462
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(_).viewMode === "preview" }]),
2463
2463
  disabled: !y(r).isPreviewable,
2464
2464
  title: "Preview",
2465
2465
  onClick: t[2] || (t[2] = (u) => y(h)("preview"))
@@ -2480,7 +2480,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2480
2480
  ])], 10, cn)) : v("", !0),
2481
2481
  !y(r).tabs || y(r).tabs.includes("code") ? (a(), s("button", {
2482
2482
  key: 1,
2483
- class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "code" }]),
2483
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(_).viewMode === "code" }]),
2484
2484
  title: "Code",
2485
2485
  onClick: t[3] || (t[3] = (u) => y(h)("code"))
2486
2486
  }, [...t[34] || (t[34] = [
@@ -2496,7 +2496,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2496
2496
  ])], 2)) : v("", !0),
2497
2497
  !y(r).tabs || y(r).tabs.includes("split") ? (a(), s("button", {
2498
2498
  key: 2,
2499
- class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "split" }]),
2499
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(_).viewMode === "split" }]),
2500
2500
  disabled: !y(r).isPreviewable,
2501
2501
  title: "Split view",
2502
2502
  onClick: t[4] || (t[4] = (u) => y(h)("split"))
@@ -2525,7 +2525,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2525
2525
  ])], 10, un)) : v("", !0),
2526
2526
  y(r).tabs && y(r).tabs.includes("edit") && S.value ? (a(), s("button", {
2527
2527
  key: 3,
2528
- class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "edit" }]),
2528
+ class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(_).viewMode === "edit" }]),
2529
2529
  title: "Edit",
2530
2530
  onClick: t[5] || (t[5] = (u) => y(h)("edit"))
2531
2531
  }, [...t[36] || (t[36] = [
@@ -2541,7 +2541,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2541
2541
  ])], 2)) : v("", !0)
2542
2542
  ]),
2543
2543
  e("div", dn, [
2544
- y(p).viewMode === "edit" ? (a(), s("button", {
2544
+ y(_).viewMode === "edit" ? (a(), s("button", {
2545
2545
  key: 0,
2546
2546
  class: "artifactuse-panel__action artifactuse-panel__action--save",
2547
2547
  title: "Save",
@@ -2582,10 +2582,10 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2582
2582
  ])])) : v("", !0),
2583
2583
  e("button", {
2584
2584
  class: "artifactuse-panel__action",
2585
- title: y(p).isFullscreen ? "Exit fullscreen" : "Fullscreen",
2585
+ title: y(_).isFullscreen ? "Exit fullscreen" : "Fullscreen",
2586
2586
  onClick: t[6] || (t[6] = (...u) => y(o) && y(o)(...u))
2587
2587
  }, [
2588
- y(p).isFullscreen ? (a(), s("svg", pn, [...t[40] || (t[40] = [
2588
+ y(_).isFullscreen ? (a(), s("svg", pn, [...t[40] || (t[40] = [
2589
2589
  e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
2590
2590
  e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
2591
2591
  e("line", {
@@ -2646,7 +2646,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2646
2646
  ]),
2647
2647
  Ee.value && at.value.length > 0 ? (a(), s("div", _n, [
2648
2648
  e("div", hn, [
2649
- (a(!0), s(F, null, de(at.value, (u) => {
2649
+ (a(!0), s(F, null, ue(at.value, (u) => {
2650
2650
  var z;
2651
2651
  return a(), s("button", {
2652
2652
  key: u.id,
@@ -2661,7 +2661,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2661
2661
  e("button", {
2662
2662
  class: "artifactuse-panel__file-tab-close",
2663
2663
  title: "Close tab",
2664
- onClick: _e((X) => Pt(u.id), ["stop"])
2664
+ onClick: he((X) => Pt(u.id), ["stop"])
2665
2665
  }, [...t[42] || (t[42] = [
2666
2666
  e("svg", {
2667
2667
  viewBox: "0 0 24 24",
@@ -2691,19 +2691,19 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2691
2691
  ref_key: "contentRef",
2692
2692
  ref: N,
2693
2693
  class: I(["artifactuse-panel__content", [
2694
- `artifactuse-panel__content--${y(p).viewMode}`,
2694
+ `artifactuse-panel__content--${y(_).viewMode}`,
2695
2695
  { "artifactuse-panel__content--transitioning": m.value }
2696
2696
  ]])
2697
2697
  }, [
2698
2698
  m.value ? (a(), s("div", wn, [...t[43] || (t[43] = [
2699
2699
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2700
2700
  ])])) : v("", !0),
2701
- y(p).viewMode === "preview" || y(p).viewMode === "split" ? (a(), s("div", {
2701
+ y(_).viewMode === "preview" || y(_).viewMode === "split" ? (a(), s("div", {
2702
2702
  key: 1,
2703
2703
  class: "artifactuse-panel__preview",
2704
- style: Se(y(p).viewMode === "split" ? { width: `${f.value}%` } : void 0)
2704
+ style: Se(y(_).viewMode === "split" ? { width: `${f.value}%` } : void 0)
2705
2705
  }, [
2706
- ve.value && G.value ? (a(), s("div", bn, [...t[44] || (t[44] = [
2706
+ de.value && G.value ? (a(), s("div", bn, [...t[44] || (t[44] = [
2707
2707
  e("div", { class: "artifactuse-panel__spinner" }, null, -1)
2708
2708
  ])])) : v("", !0),
2709
2709
  G.value ? (a(), s("iframe", {
@@ -2711,7 +2711,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2711
2711
  ref_key: "iframeRef",
2712
2712
  ref: D,
2713
2713
  src: G.value,
2714
- class: I(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": ve.value }]),
2714
+ class: I(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": de.value }]),
2715
2715
  sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
2716
2716
  allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write; encrypted-media; gyroscope; accelerometer; picture-in-picture",
2717
2717
  onLoad: Vt,
@@ -2737,12 +2737,12 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2737
2737
  ], 4)) : v("", !0),
2738
2738
  _t(e("div", {
2739
2739
  class: "artifactuse-panel__code",
2740
- style: Se(y(p).viewMode === "split" ? { width: `${100 - f.value}%` } : void 0)
2740
+ style: Se(y(_).viewMode === "split" ? { width: `${100 - f.value}%` } : void 0)
2741
2741
  }, [
2742
- y(p).viewMode === "split" ? (a(), s("div", {
2742
+ y(_).viewMode === "split" ? (a(), s("div", {
2743
2743
  key: 0,
2744
2744
  class: "artifactuse-panel__split-handle",
2745
- onMousedown: _e(Gt, ["prevent"])
2745
+ onMousedown: he(Gt, ["prevent"])
2746
2746
  }, [...t[46] || (t[46] = [
2747
2747
  e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
2748
2748
  ])], 32)) : v("", !0),
@@ -2758,18 +2758,18 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2758
2758
  ref: ee
2759
2759
  }, null, 512),
2760
2760
  e("pre", {
2761
- class: I(["artifactuse-panel__code-block", `language-${me.value}`])
2761
+ class: I(["artifactuse-panel__code-block", `language-${ye.value}`])
2762
2762
  }, [
2763
2763
  (a(), s("code", {
2764
2764
  ref_key: "codeRef",
2765
2765
  ref: U,
2766
2766
  key: y(r).id,
2767
- class: I(`language-${me.value}`)
2767
+ class: I(`language-${ye.value}`)
2768
2768
  }, null, 2))
2769
2769
  ], 2)
2770
2770
  ], 544)
2771
2771
  ], 4), [
2772
- [ht, y(p).viewMode === "code" || y(p).viewMode === "split"]
2772
+ [ht, y(_).viewMode === "code" || y(_).viewMode === "split"]
2773
2773
  ]),
2774
2774
  _t(e("div", $n, [
2775
2775
  e("div", {
@@ -2778,7 +2778,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2778
2778
  class: "artifactuse-panel__editor-container"
2779
2779
  }, null, 512)
2780
2780
  ], 512), [
2781
- [ht, y(p).viewMode === "edit"]
2781
+ [ht, y(_).viewMode === "edit"]
2782
2782
  ])
2783
2783
  ], 2),
2784
2784
  $t.value ? (a(), s("div", {
@@ -2801,7 +2801,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2801
2801
  t[48] || (t[48] = e("span", null, "Console", -1)),
2802
2802
  e("div", {
2803
2803
  class: "artifactuse-panel__console-filters",
2804
- onClick: t[12] || (t[12] = _e(() => {
2804
+ onClick: t[12] || (t[12] = he(() => {
2805
2805
  }, ["stop"]))
2806
2806
  }, [
2807
2807
  Oe.value > 0 ? (a(), s("button", {
@@ -2827,7 +2827,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2827
2827
  ]),
2828
2828
  e("button", {
2829
2829
  class: "artifactuse-panel__console-clear",
2830
- onClick: t[13] || (t[13] = _e((u) => Q.value = [], ["stop"]))
2830
+ onClick: t[13] || (t[13] = he((u) => Q.value = [], ["stop"]))
2831
2831
  }, "Clear")
2832
2832
  ]),
2833
2833
  W.value ? (a(), s("div", {
@@ -2836,7 +2836,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
2836
2836
  ref: ie,
2837
2837
  class: "artifactuse-panel__console-entries"
2838
2838
  }, [
2839
- (a(!0), s(F, null, de(xt.value, (u, z) => (a(), s("div", {
2839
+ (a(!0), s(F, null, ue(xt.value, (u, z) => (a(), s("div", {
2840
2840
  key: z,
2841
2841
  class: I("artifactuse-panel__console-entry artifactuse-panel__console-entry--" + u.type)
2842
2842
  }, [
@@ -3063,19 +3063,19 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
3063
3063
  ], -1)
3064
3064
  ])])
3065
3065
  ])) : i.value === "update-list" ? (a(), s("div", Xn, [
3066
- be.value ? (a(), s("div", Zn, [...t[59] || (t[59] = [
3066
+ Ce.value ? (a(), s("div", Zn, [...t[59] || (t[59] = [
3067
3067
  e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
3068
3068
  e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
3069
- ])])) : we.value.length === 0 ? (a(), s("div", Kn, " No saved artifacts of this type ")) : (a(), s("div", Yn, [
3070
- (a(!0), s(F, null, de(we.value, (u) => {
3071
- var z, X, ye;
3069
+ ])])) : be.value.length === 0 ? (a(), s("div", Kn, " No saved artifacts of this type ")) : (a(), s("div", Yn, [
3070
+ (a(!0), s(F, null, ue(be.value, (u) => {
3071
+ var z, X, ge;
3072
3072
  return a(), s("button", {
3073
3073
  key: ((z = u.project) == null ? void 0 : z.uuid) || u.id,
3074
3074
  class: "artifactuse-share-popup__artifact-item",
3075
3075
  onClick: (pe) => Wt(u)
3076
3076
  }, [
3077
3077
  e("span", Gn, n(((X = u.project) == null ? void 0 : X.name) || "Untitled"), 1),
3078
- e("span", eo, n(it((ye = u.project) == null ? void 0 : ye.created_at)), 1)
3078
+ e("span", eo, n(it((ge = u.project) == null ? void 0 : ge.created_at)), 1)
3079
3079
  ], 8, Qn);
3080
3080
  }), 128))
3081
3081
  ])),
@@ -3198,7 +3198,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
3198
3198
  })
3199
3199
  ], -1)
3200
3200
  ])])) : v("", !0),
3201
- !Ee.value && fe.value.length > 1 ? (a(), s("div", oo, [
3201
+ !Ee.value && ve.value.length > 1 ? (a(), s("div", oo, [
3202
3202
  e("button", {
3203
3203
  class: "artifactuse-panel__nav-btn",
3204
3204
  disabled: Pe.value <= 0,
@@ -3219,7 +3219,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
3219
3219
  title: "View all artifacts",
3220
3220
  onClick: Zt
3221
3221
  }, [
3222
- e("span", null, n(Pe.value + 1) + " / " + n(fe.value.length), 1),
3222
+ e("span", null, n(Pe.value + 1) + " / " + n(ve.value.length), 1),
3223
3223
  t[66] || (t[66] = e("svg", {
3224
3224
  viewBox: "0 0 24 24",
3225
3225
  fill: "none",
@@ -3231,7 +3231,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
3231
3231
  ]),
3232
3232
  e("button", {
3233
3233
  class: "artifactuse-panel__nav-btn",
3234
- disabled: Pe.value >= fe.value.length - 1,
3234
+ disabled: Pe.value >= ve.value.length - 1,
3235
3235
  title: "Next artifact",
3236
3236
  onClick: Yt
3237
3237
  }, [...t[67] || (t[67] = [
@@ -3275,7 +3275,7 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
3275
3275
  ])])
3276
3276
  ]),
3277
3277
  e("div", fo, [
3278
- (a(!0), s(F, null, de(fe.value, (u, z) => (a(), s("button", {
3278
+ (a(!0), s(F, null, ue(ve.value, (u, z) => (a(), s("button", {
3279
3279
  key: u.id,
3280
3280
  class: I(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": u.id === y(r).id }]),
3281
3281
  onClick: (X) => ct(u)
@@ -3315,13 +3315,13 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
3315
3315
  }, Lo = {
3316
3316
  __name: "ArtifactusePanelToggle",
3317
3317
  setup(P) {
3318
- const { state: c, artifactCount: _, hasArtifacts: T, togglePanel: p } = Re();
3318
+ const { state: c, artifactCount: p, hasArtifacts: T, togglePanel: _ } = Re();
3319
3319
  return (r, q) => (a(), s("button", {
3320
3320
  class: I(["artifactuse-panel-toggle", {
3321
3321
  "artifactuse-panel-toggle--active": y(c).isPanelOpen,
3322
3322
  "artifactuse-panel-toggle--has-artifacts": y(T)
3323
3323
  }]),
3324
- onClick: q[0] || (q[0] = (...A) => y(p) && y(p)(...A)),
3324
+ onClick: q[0] || (q[0] = (...A) => y(_) && y(_)(...A)),
3325
3325
  title: y(c).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
3326
3326
  }, [
3327
3327
  q[1] || (q[1] = e("svg", {
@@ -3335,13 +3335,13 @@ const da = { class: "artifactuse-card__icon" }, va = ["innerHTML"], fa = { class
3335
3335
  e("polyline", { points: "16 18 22 12 16 6" }),
3336
3336
  e("polyline", { points: "8 6 2 12 8 18" })
3337
3337
  ], -1)),
3338
- y(_) > 0 ? (a(), s("span", wo, n(y(_) > 99 ? "99+" : y(_)), 1)) : v("", !0)
3338
+ y(p) > 0 ? (a(), s("span", wo, n(y(p) > 99 ? "99+" : y(p)), 1)) : v("", !0)
3339
3339
  ], 10, ko));
3340
3340
  }
3341
3341
  }, wt = Symbol("artifactuse");
3342
3342
  function bt(P = {}) {
3343
3343
  var o;
3344
- const c = kt(P), _ = yt({
3344
+ const c = kt(P), p = yt({
3345
3345
  artifacts: [],
3346
3346
  activeArtifactId: null,
3347
3347
  isPanelOpen: !1,
@@ -3352,9 +3352,9 @@ function bt(P = {}) {
3352
3352
  forceEmptyView: !1
3353
3353
  });
3354
3354
  c.state.subscribe((h) => {
3355
- _.artifacts = h.artifacts, _.activeArtifactId = h.activeArtifactId, _.isPanelOpen = h.isPanelOpen, _.viewMode = h.viewMode, _.isFullscreen = h.isFullscreen, _.openTabs = h.openTabs, _.tabViewModes = h.tabViewModes, _.forceEmptyView = h.forceEmptyView;
3355
+ p.artifacts = h.artifacts, p.activeArtifactId = h.activeArtifactId, p.isPanelOpen = h.isPanelOpen, p.viewMode = h.viewMode, p.isFullscreen = h.isFullscreen, p.openTabs = h.openTabs, p.tabViewModes = h.tabViewModes, p.forceEmptyView = h.forceEmptyView;
3356
3356
  });
3357
- const T = b(() => _.activeArtifactId && _.artifacts.find((h) => h.id === _.activeArtifactId) || null), p = b(() => _.artifacts.filter((h) => !h.isInline).length), r = b(() => _.artifacts.some((h) => !h.isInline)), q = b(() => c.getPanelTypes()), A = b(() => T.value ? c.getPanelUrl(T.value) : null);
3357
+ const T = b(() => p.activeArtifactId && p.artifacts.find((h) => h.id === p.activeArtifactId) || null), _ = b(() => p.artifacts.filter((h) => !h.isInline).length), r = b(() => p.artifacts.some((h) => !h.isInline)), q = b(() => c.getPanelTypes()), A = b(() => T.value ? c.getPanelUrl(T.value) : null);
3358
3358
  if (c.applyTheme(), P.theme === "auto" || !P.theme) {
3359
3359
  const h = ((o = c.bridge) == null ? void 0 : o.theme) || c.theme;
3360
3360
  h != null && h.watchSystemTheme && h.watchSystemTheme(() => {
@@ -3363,9 +3363,9 @@ function bt(P = {}) {
3363
3363
  }
3364
3364
  const g = {
3365
3365
  instance: c,
3366
- state: _,
3366
+ state: p,
3367
3367
  activeArtifact: T,
3368
- artifactCount: p,
3368
+ artifactCount: _,
3369
3369
  hasArtifacts: r,
3370
3370
  // Panel computed
3371
3371
  panelTypes: q,
@@ -3412,7 +3412,7 @@ function Re() {
3412
3412
  return P || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), bt());
3413
3413
  }
3414
3414
  function bo(P = {}) {
3415
- const c = kt(P), _ = yt({
3415
+ const c = kt(P), p = yt({
3416
3416
  artifacts: [],
3417
3417
  activeArtifactId: null,
3418
3418
  isPanelOpen: !1,
@@ -3425,16 +3425,16 @@ function bo(P = {}) {
3425
3425
  let T;
3426
3426
  Te(() => {
3427
3427
  T = c.state.subscribe((o) => {
3428
- _.artifacts = o.artifacts, _.activeArtifactId = o.activeArtifactId, _.isPanelOpen = o.isPanelOpen, _.viewMode = o.viewMode, _.isFullscreen = o.isFullscreen, _.openTabs = o.openTabs, _.tabViewModes = o.tabViewModes, _.forceEmptyView = o.forceEmptyView;
3428
+ p.artifacts = o.artifacts, p.activeArtifactId = o.activeArtifactId, p.isPanelOpen = o.isPanelOpen, p.viewMode = o.viewMode, p.isFullscreen = o.isFullscreen, p.openTabs = o.openTabs, p.tabViewModes = o.tabViewModes, p.forceEmptyView = o.forceEmptyView;
3429
3429
  }), c.applyTheme();
3430
3430
  }), Ye(() => {
3431
3431
  T && T(), c.destroy();
3432
3432
  });
3433
- const p = b(() => _.activeArtifactId && _.artifacts.find((o) => o.id === _.activeArtifactId) || null), r = b(() => _.artifacts.filter((o) => !o.isInline).length), q = b(() => _.artifacts.some((o) => !o.isInline)), A = b(() => c.getPanelTypes()), g = b(() => p.value ? c.getPanelUrl(p.value) : null);
3433
+ const _ = b(() => p.activeArtifactId && p.artifacts.find((o) => o.id === p.activeArtifactId) || null), r = b(() => p.artifacts.filter((o) => !o.isInline).length), q = b(() => p.artifacts.some((o) => !o.isInline)), A = b(() => c.getPanelTypes()), g = b(() => _.value ? c.getPanelUrl(_.value) : null);
3434
3434
  return {
3435
3435
  instance: c,
3436
- state: _,
3437
- activeArtifact: p,
3436
+ state: p,
3437
+ activeArtifact: _,
3438
3438
  artifactCount: r,
3439
3439
  hasArtifacts: q,
3440
3440
  // Panel computed