artifactuse 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/{index-W575iBkm.js → index-vmcpJRYe.js} +149 -143
- package/dist/index.js +1 -1
- package/dist/react/ArtifactusePanel.d.ts +2 -1
- package/dist/react/index.js +946 -893
- package/dist/styles/components/panel.css +152 -0
- package/dist/svelte/index.js +2046 -1912
- package/dist/vue/index.js +1403 -1318
- package/dist/vue2/index.js +369 -2
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { g as
|
|
3
|
-
import { J as
|
|
4
|
-
const
|
|
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";
|
|
3
|
+
import { J as ua } from "../jszip.min-CdmYyw5L.js";
|
|
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,
|
|
6
6
|
viewBox: "0 0 24 24",
|
|
7
7
|
fill: "none",
|
|
8
8
|
stroke: "currentColor",
|
|
9
9
|
"stroke-width": "2"
|
|
10
|
-
},
|
|
10
|
+
}, wa = {
|
|
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
|
-
},
|
|
16
|
+
}, ba = {
|
|
17
17
|
__name: "ArtifactuseCard",
|
|
18
18
|
props: {
|
|
19
19
|
artifact: {
|
|
@@ -26,58 +26,58 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
emits: ["open", "copy", "download"],
|
|
29
|
-
setup(
|
|
30
|
-
const _ =
|
|
29
|
+
setup(P, { emit: c }) {
|
|
30
|
+
const _ = P, T = c, p = M(!1), r = b(() => Ie(_.artifact.language)), q = b(() => {
|
|
31
31
|
var $;
|
|
32
|
-
return
|
|
33
|
-
}),
|
|
32
|
+
return gt(_.artifact.size || (($ = _.artifact.code) == null ? void 0 : $.length) || 0);
|
|
33
|
+
}), A = b(() => Ze(_.artifact.language));
|
|
34
34
|
function g($) {
|
|
35
|
-
$.stopPropagation(),
|
|
35
|
+
$.stopPropagation(), T("open", _.artifact);
|
|
36
36
|
}
|
|
37
|
-
async function
|
|
37
|
+
async function o() {
|
|
38
38
|
try {
|
|
39
|
-
await navigator.clipboard.writeText(_.artifact.code),
|
|
40
|
-
|
|
41
|
-
}, 2e3),
|
|
39
|
+
await navigator.clipboard.writeText(_.artifact.code), p.value = !0, setTimeout(() => {
|
|
40
|
+
p.value = !1;
|
|
41
|
+
}, 2e3), T("copy", _.artifact);
|
|
42
42
|
} catch ($) {
|
|
43
43
|
console.error("Failed to copy:", $);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function h() {
|
|
47
|
-
var
|
|
48
|
-
const $ = new Blob([_.artifact.code], { type: "text/plain" }),
|
|
49
|
-
x.href =
|
|
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);
|
|
50
50
|
}
|
|
51
|
-
return ($,
|
|
52
|
-
class:
|
|
51
|
+
return ($, V) => (a(), s("div", {
|
|
52
|
+
class: I(["artifactuse-card", { "artifactuse-card--active": P.isActive }]),
|
|
53
53
|
onClick: g
|
|
54
54
|
}, [
|
|
55
|
-
e("div",
|
|
55
|
+
e("div", da, [
|
|
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:
|
|
62
|
-
}, null, 8,
|
|
61
|
+
innerHTML: A.value
|
|
62
|
+
}, null, 8, va))
|
|
63
63
|
]),
|
|
64
|
-
e("div",
|
|
65
|
-
e("div",
|
|
66
|
-
e("div",
|
|
67
|
-
e("span",
|
|
68
|
-
|
|
69
|
-
e("span",
|
|
64
|
+
e("div", fa, [
|
|
65
|
+
e("div", pa, n(P.artifact.title), 1),
|
|
66
|
+
e("div", _a, [
|
|
67
|
+
e("span", ha, n(r.value), 1),
|
|
68
|
+
V[0] || (V[0] = e("span", { class: "artifactuse-card__separator" }, "•", -1)),
|
|
69
|
+
e("span", ma, n(q.value), 1)
|
|
70
70
|
])
|
|
71
71
|
]),
|
|
72
|
-
e("div",
|
|
72
|
+
e("div", ya, [
|
|
73
73
|
e("button", {
|
|
74
74
|
class: "artifactuse-card__action",
|
|
75
|
-
onClick:
|
|
76
|
-
title:
|
|
75
|
+
onClick: _e(o, ["stop"]),
|
|
76
|
+
title: p.value ? "Copied!" : "Copy code"
|
|
77
77
|
}, [
|
|
78
|
-
|
|
78
|
+
p.value ? (a(), s("svg", wa, [...V[2] || (V[2] = [
|
|
79
79
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
80
|
-
])])) : (a(), s("svg",
|
|
80
|
+
])])) : (a(), s("svg", ka, [...V[1] || (V[1] = [
|
|
81
81
|
e("rect", {
|
|
82
82
|
x: "9",
|
|
83
83
|
y: "9",
|
|
@@ -88,12 +88,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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,
|
|
91
|
+
], 8, ga),
|
|
92
92
|
e("button", {
|
|
93
93
|
class: "artifactuse-card__action",
|
|
94
|
-
onClick:
|
|
94
|
+
onClick: _e(h, ["stop"]),
|
|
95
95
|
title: "Download file"
|
|
96
|
-
}, [...
|
|
96
|
+
}, [...V[3] || (V[3] = [
|
|
97
97
|
e("svg", {
|
|
98
98
|
viewBox: "0 0 24 24",
|
|
99
99
|
fill: "none",
|
|
@@ -111,7 +111,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
111
111
|
], -1)
|
|
112
112
|
])])
|
|
113
113
|
]),
|
|
114
|
-
|
|
114
|
+
V[4] || (V[4] = e("div", { class: "artifactuse-card__arrow" }, [
|
|
115
115
|
e("svg", {
|
|
116
116
|
viewBox: "0 0 24 24",
|
|
117
117
|
fill: "none",
|
|
@@ -123,10 +123,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
123
123
|
], -1))
|
|
124
124
|
], 2));
|
|
125
125
|
}
|
|
126
|
-
},
|
|
126
|
+
}, Ca = ["data-artifactuse-theme"], xa = {
|
|
127
127
|
key: 0,
|
|
128
128
|
class: "artifactuse-form-collapsed"
|
|
129
|
-
},
|
|
129
|
+
}, $a = { class: "artifactuse-form-collapsed-icon" }, Ma = {
|
|
130
130
|
key: 0,
|
|
131
131
|
viewBox: "0 0 24 24",
|
|
132
132
|
fill: "none",
|
|
@@ -134,7 +134,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
134
134
|
"stroke-width": "2.5",
|
|
135
135
|
"stroke-linecap": "round",
|
|
136
136
|
"stroke-linejoin": "round"
|
|
137
|
-
},
|
|
137
|
+
}, Ta = {
|
|
138
138
|
key: 1,
|
|
139
139
|
viewBox: "0 0 24 24",
|
|
140
140
|
fill: "none",
|
|
@@ -142,7 +142,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
142
142
|
"stroke-width": "2.5",
|
|
143
143
|
"stroke-linecap": "round",
|
|
144
144
|
"stroke-linejoin": "round"
|
|
145
|
-
},
|
|
145
|
+
}, La = {
|
|
146
146
|
key: 2,
|
|
147
147
|
viewBox: "0 0 24 24",
|
|
148
148
|
fill: "none",
|
|
@@ -150,64 +150,64 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
150
150
|
"stroke-width": "2.5",
|
|
151
151
|
"stroke-linecap": "round",
|
|
152
152
|
"stroke-linejoin": "round"
|
|
153
|
-
},
|
|
153
|
+
}, Pa = { class: "artifactuse-form-collapsed-title" }, Ea = {
|
|
154
154
|
key: 0,
|
|
155
155
|
class: "artifactuse-form-header"
|
|
156
|
-
},
|
|
156
|
+
}, Aa = {
|
|
157
157
|
key: 0,
|
|
158
158
|
class: "artifactuse-form-title"
|
|
159
|
-
},
|
|
159
|
+
}, Ha = {
|
|
160
160
|
key: 1,
|
|
161
161
|
class: "artifactuse-form-description"
|
|
162
|
-
},
|
|
162
|
+
}, Ba = {
|
|
163
163
|
key: 1,
|
|
164
164
|
class: "artifactuse-form-buttons"
|
|
165
|
-
},
|
|
165
|
+
}, Sa = ["disabled", "onClick"], za = ["innerHTML"], Va = { class: "artifactuse-form-fields" }, Ia = {
|
|
166
166
|
key: 0,
|
|
167
167
|
class: "artifactuse-form-buttons"
|
|
168
|
-
},
|
|
168
|
+
}, Fa = ["type", "disabled", "onClick"], Ra = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "artifactuse-form-btn-spinner"
|
|
171
|
-
},
|
|
171
|
+
}, qa = ["innerHTML"], Oa = {
|
|
172
172
|
key: 1,
|
|
173
173
|
class: "artifactuse-form-divider"
|
|
174
|
-
},
|
|
174
|
+
}, Ua = {
|
|
175
175
|
key: 2,
|
|
176
176
|
class: "artifactuse-form-heading"
|
|
177
|
-
},
|
|
177
|
+
}, Da = {
|
|
178
178
|
key: 3,
|
|
179
179
|
class: "artifactuse-form-field"
|
|
180
|
-
},
|
|
180
|
+
}, ja = { class: "artifactuse-checkbox-label" }, Na = ["checked", "disabled", "onChange"], Wa = { class: "artifactuse-checkbox-text" }, Ja = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "artifactuse-required"
|
|
183
|
-
},
|
|
183
|
+
}, Xa = {
|
|
184
184
|
key: 0,
|
|
185
185
|
class: "artifactuse-help-text"
|
|
186
|
-
},
|
|
186
|
+
}, Za = {
|
|
187
187
|
key: 1,
|
|
188
188
|
class: "artifactuse-error-text"
|
|
189
|
-
},
|
|
189
|
+
}, Ka = {
|
|
190
190
|
key: 4,
|
|
191
191
|
class: "artifactuse-form-field"
|
|
192
|
-
},
|
|
192
|
+
}, Ya = ["for"], Qa = {
|
|
193
193
|
key: 0,
|
|
194
194
|
class: "artifactuse-required"
|
|
195
|
-
},
|
|
195
|
+
}, Ga = ["id", "type", "value", "placeholder", "disabled", "required", "onInput"], es = ["id", "value", "placeholder", "disabled", "required", "rows", "onInput"], ts = ["id", "value", "disabled", "required", "onChange"], as = { value: "" }, ss = ["value", "disabled"], ls = {
|
|
196
196
|
key: 3,
|
|
197
197
|
class: "artifactuse-radio-group"
|
|
198
|
-
},
|
|
198
|
+
}, is = ["name", "value", "checked", "disabled", "onChange"], ns = {
|
|
199
199
|
key: 4,
|
|
200
200
|
class: "artifactuse-help-text"
|
|
201
|
-
},
|
|
201
|
+
}, os = {
|
|
202
202
|
key: 5,
|
|
203
203
|
class: "artifactuse-error-text"
|
|
204
|
-
},
|
|
204
|
+
}, rs = {
|
|
205
205
|
key: 0,
|
|
206
206
|
class: "artifactuse-form-buttons artifactuse-form-buttons-default"
|
|
207
|
-
},
|
|
207
|
+
}, cs = ["disabled"], us = {
|
|
208
208
|
key: 0,
|
|
209
209
|
class: "artifactuse-form-btn-spinner"
|
|
210
|
-
},
|
|
210
|
+
}, ds = {
|
|
211
211
|
__name: "ArtifactuseInlineForm",
|
|
212
212
|
props: {
|
|
213
213
|
artifact: { type: Object, required: !0 },
|
|
@@ -216,136 +216,136 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
216
216
|
initialState: {
|
|
217
217
|
type: String,
|
|
218
218
|
default: "active",
|
|
219
|
-
validator: (
|
|
219
|
+
validator: (P) => ["active", "submitted", "cancelled", "inactive"].includes(P)
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
222
|
emits: ["submit", "cancel", "reset", "button-click"],
|
|
223
|
-
setup(
|
|
224
|
-
const _ =
|
|
225
|
-
function
|
|
226
|
-
|
|
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}`);
|
|
225
|
+
function A(w) {
|
|
226
|
+
p.value = w;
|
|
227
227
|
}
|
|
228
|
-
const g =
|
|
228
|
+
const g = b(() => {
|
|
229
229
|
try {
|
|
230
230
|
return JSON.parse(_.artifact.code);
|
|
231
231
|
} catch {
|
|
232
232
|
return { title: "Invalid Form", variant: "fields", data: { fields: [] } };
|
|
233
233
|
}
|
|
234
|
-
}),
|
|
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(() => {
|
|
235
235
|
var w;
|
|
236
236
|
return ((w = g.value.data) == null ? void 0 : w.fields) || [];
|
|
237
|
-
}),
|
|
237
|
+
}), ee = b(() => {
|
|
238
238
|
var w;
|
|
239
239
|
return g.value.variant === "buttons" ? ((w = g.value.data) == null ? void 0 : w.fields) || [] : [];
|
|
240
|
-
}),
|
|
241
|
-
function
|
|
240
|
+
}), B = b(() => N.value.some((w) => w.type === "buttons"));
|
|
241
|
+
function re(w) {
|
|
242
242
|
if (!w) return null;
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
let
|
|
246
|
-
if (
|
|
247
|
-
const
|
|
248
|
-
if (!isNaN(
|
|
243
|
+
const E = w.trim();
|
|
244
|
+
if (E.startsWith("#")) {
|
|
245
|
+
let d = E.slice(1);
|
|
246
|
+
if (d.length === 3 && (d = d.split("").map((L) => L + L).join("")), d.length === 6) {
|
|
247
|
+
const L = parseInt(d.slice(0, 2), 16), se = parseInt(d.slice(2, 4), 16), ce = parseInt(d.slice(4, 6), 16);
|
|
248
|
+
if (!isNaN(L) && !isNaN(se) && !isNaN(ce)) return `${L}, ${se}, ${ce}`;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
return
|
|
255
|
-
}
|
|
256
|
-
function
|
|
257
|
-
if (
|
|
258
|
-
const w =
|
|
259
|
-
w &&
|
|
251
|
+
const i = E.match(/^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
|
|
252
|
+
if (i) return `${i[1]}, ${i[2]}, ${i[3]}`;
|
|
253
|
+
const H = E.split(/[\s,]+/).map(Number).filter((d) => !isNaN(d));
|
|
254
|
+
return H.length >= 3 ? `${H[0]}, ${H[1]}, ${H[2]}` : null;
|
|
255
|
+
}
|
|
256
|
+
function K() {
|
|
257
|
+
if (o.value && _.accent) {
|
|
258
|
+
const w = re(_.accent);
|
|
259
|
+
w && o.value.style.setProperty("--artifactuse-primary", w);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}),
|
|
265
|
-
|
|
262
|
+
Te(() => {
|
|
263
|
+
K(), p.value = _.initialState;
|
|
264
|
+
}), oe(() => _.accent, K), oe(() => _.initialState, (w) => {
|
|
265
|
+
p.value = w;
|
|
266
266
|
});
|
|
267
|
-
function
|
|
268
|
-
var
|
|
267
|
+
function Z() {
|
|
268
|
+
var i;
|
|
269
269
|
const w = {};
|
|
270
|
-
|
|
271
|
-
["buttons", "divider", "heading"].includes(
|
|
272
|
-
}), (
|
|
270
|
+
N.value.forEach((H) => {
|
|
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
|
+
}), (i = g.value.data) != null && i.defaults && Object.assign(w, g.value.data.defaults), x.value = w;
|
|
273
273
|
}
|
|
274
|
-
|
|
275
|
-
function
|
|
274
|
+
Z(), oe(() => _.artifact.code, Z);
|
|
275
|
+
function ve(w) {
|
|
276
276
|
return ["text", "email", "password", "tel", "url", "number", "date", "time", "datetime-local"].includes(w);
|
|
277
277
|
}
|
|
278
278
|
function m(w) {
|
|
279
|
-
return w ? w.map((
|
|
279
|
+
return w ? w.map((E) => typeof E == "string" ? { label: E, value: E } : E) : [];
|
|
280
280
|
}
|
|
281
|
-
function k(w,
|
|
282
|
-
x.value[w] =
|
|
281
|
+
function k(w, E) {
|
|
282
|
+
x.value[w] = E, D.value[w] && delete D.value[w];
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
var
|
|
284
|
+
function ae() {
|
|
285
|
+
var H;
|
|
286
286
|
const w = {};
|
|
287
|
-
|
|
288
|
-
if (["buttons", "divider", "heading"].includes(
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
w[
|
|
287
|
+
N.value.forEach((d) => {
|
|
288
|
+
if (["buttons", "divider", "heading"].includes(d.type)) return;
|
|
289
|
+
const L = x.value[d.name];
|
|
290
|
+
if (d.required && !L && L !== 0 && L !== !1) {
|
|
291
|
+
w[d.name] = `${d.label || "This field"} is required`;
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
|
-
if (
|
|
295
|
-
w[
|
|
294
|
+
if (d.pattern && L && !new RegExp(d.pattern).test(L)) {
|
|
295
|
+
w[d.name] = d.patternMessage || `${d.label || "This field"} is invalid`;
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
299
|
-
w[
|
|
298
|
+
if (d.type === "email" && L && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(L)) {
|
|
299
|
+
w[d.name] = "Please enter a valid email address";
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
if (
|
|
303
|
-
w[
|
|
302
|
+
if (d.minLength && L && L.length < d.minLength) {
|
|
303
|
+
w[d.name] = `Minimum ${d.minLength} characters required`;
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
|
-
if (
|
|
307
|
-
w[
|
|
306
|
+
if (d.maxLength && L && L.length > d.maxLength) {
|
|
307
|
+
w[d.name] = `Maximum ${d.maxLength} characters allowed`;
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
if (w[
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
}),
|
|
317
|
-
}
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
function
|
|
322
|
-
|
|
311
|
+
const i = (H = g.value.data) == null ? void 0 : H.validation;
|
|
312
|
+
return i && Object.entries(i).forEach(([d, L]) => {
|
|
313
|
+
if (w[d]) return;
|
|
314
|
+
const se = x.value[d];
|
|
315
|
+
L.pattern && se && (new RegExp(L.pattern).test(se) || (w[d] = L.message || `${d} is invalid`));
|
|
316
|
+
}), D.value = w, Object.keys(w).length === 0;
|
|
317
|
+
}
|
|
318
|
+
function Q() {
|
|
319
|
+
Z(), D.value = {};
|
|
320
|
+
}
|
|
321
|
+
function W() {
|
|
322
|
+
ae() && (U.value = !0, T("submit", {
|
|
323
323
|
formId: h.value,
|
|
324
324
|
action: "submit",
|
|
325
325
|
values: { ...x.value },
|
|
326
326
|
timestamp: Date.now()
|
|
327
327
|
}), setTimeout(() => {
|
|
328
|
-
|
|
328
|
+
U.value = !1, A("submitted");
|
|
329
329
|
}, 300));
|
|
330
330
|
}
|
|
331
|
-
function
|
|
332
|
-
const
|
|
333
|
-
switch (
|
|
331
|
+
function ie(w) {
|
|
332
|
+
const E = w.action || "custom";
|
|
333
|
+
switch (E) {
|
|
334
334
|
case "submit":
|
|
335
|
-
|
|
335
|
+
W();
|
|
336
336
|
break;
|
|
337
337
|
case "cancel":
|
|
338
|
-
|
|
338
|
+
T("cancel", {
|
|
339
339
|
formId: h.value,
|
|
340
340
|
action: "cancel",
|
|
341
341
|
buttonName: w.name || "cancel",
|
|
342
342
|
timestamp: Date.now()
|
|
343
343
|
}), setTimeout(() => {
|
|
344
|
-
|
|
344
|
+
A("cancelled");
|
|
345
345
|
}, 150);
|
|
346
346
|
break;
|
|
347
347
|
case "reset":
|
|
348
|
-
|
|
348
|
+
Q(), T("reset", {
|
|
349
349
|
formId: h.value,
|
|
350
350
|
action: "reset",
|
|
351
351
|
buttonName: w.name || "reset",
|
|
@@ -354,34 +354,34 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
354
354
|
break;
|
|
355
355
|
case "custom":
|
|
356
356
|
default:
|
|
357
|
-
|
|
357
|
+
T("button-click", {
|
|
358
358
|
formId: h.value,
|
|
359
|
-
action:
|
|
359
|
+
action: E,
|
|
360
360
|
buttonName: w.name || w.label,
|
|
361
361
|
buttonLabel: w.label,
|
|
362
362
|
values: { ...x.value },
|
|
363
363
|
timestamp: Date.now()
|
|
364
364
|
}), setTimeout(() => {
|
|
365
|
-
|
|
365
|
+
A("submitted");
|
|
366
366
|
}, 150);
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
return (w,
|
|
370
|
+
return (w, E) => (a(), s("div", {
|
|
371
371
|
ref_key: "containerRef",
|
|
372
|
-
ref:
|
|
373
|
-
class:
|
|
372
|
+
ref: o,
|
|
373
|
+
class: I([
|
|
374
374
|
"artifactuse-inline-form",
|
|
375
375
|
$.value,
|
|
376
376
|
q.value
|
|
377
377
|
]),
|
|
378
|
-
"data-artifactuse-theme":
|
|
378
|
+
"data-artifactuse-theme": P.theme
|
|
379
379
|
}, [
|
|
380
|
-
|
|
381
|
-
e("div",
|
|
382
|
-
|
|
380
|
+
r.value ? (a(), s("div", xa, [
|
|
381
|
+
e("div", $a, [
|
|
382
|
+
p.value === "submitted" ? (a(), s("svg", Ma, [...E[1] || (E[1] = [
|
|
383
383
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
384
|
-
])])) :
|
|
384
|
+
])])) : p.value === "cancelled" ? (a(), s("svg", Ta, [...E[2] || (E[2] = [
|
|
385
385
|
e("line", {
|
|
386
386
|
x1: "18",
|
|
387
387
|
y1: "6",
|
|
@@ -394,7 +394,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
394
394
|
x2: "18",
|
|
395
395
|
y2: "18"
|
|
396
396
|
}, null, -1)
|
|
397
|
-
])])) : (a(), s("svg",
|
|
397
|
+
])])) : (a(), s("svg", La, [...E[3] || (E[3] = [
|
|
398
398
|
e("line", {
|
|
399
399
|
x1: "5",
|
|
400
400
|
y1: "12",
|
|
@@ -403,216 +403,216 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
403
403
|
}, null, -1)
|
|
404
404
|
])]))
|
|
405
405
|
]),
|
|
406
|
-
e("span",
|
|
407
|
-
])) : (a(), s(
|
|
408
|
-
g.value.title || g.value.description ? (a(), s("div",
|
|
409
|
-
g.value.title ? (a(), s("div",
|
|
410
|
-
g.value.description ? (a(), s("p",
|
|
406
|
+
e("span", Pa, n(V.value), 1)
|
|
407
|
+
])) : (a(), s(F, { key: 1 }, [
|
|
408
|
+
g.value.title || g.value.description ? (a(), s("div", Ea, [
|
|
409
|
+
g.value.title ? (a(), s("div", Aa, n(g.value.title), 1)) : v("", !0),
|
|
410
|
+
g.value.description ? (a(), s("p", Ha, n(g.value.description), 1)) : v("", !0)
|
|
411
411
|
])) : v("", !0),
|
|
412
|
-
g.value.variant === "buttons" ? (a(), s("div",
|
|
413
|
-
(a(!0), s(
|
|
414
|
-
key:
|
|
412
|
+
g.value.variant === "buttons" ? (a(), s("div", Ba, [
|
|
413
|
+
(a(!0), s(F, null, de(ee.value, (i) => (a(), s("button", {
|
|
414
|
+
key: i.name || i.label,
|
|
415
415
|
type: "button",
|
|
416
|
-
class:
|
|
417
|
-
disabled:
|
|
418
|
-
onClick: (
|
|
416
|
+
class: I(["artifactuse-form-btn", `artifactuse-form-btn-${i.variant || "secondary"}`]),
|
|
417
|
+
disabled: i.disabled || U.value,
|
|
418
|
+
onClick: (H) => ie(i)
|
|
419
419
|
}, [
|
|
420
|
-
|
|
420
|
+
i.icon ? (a(), s("span", {
|
|
421
421
|
key: 0,
|
|
422
422
|
class: "artifactuse-form-btn-icon",
|
|
423
|
-
innerHTML:
|
|
424
|
-
}, null, 8,
|
|
425
|
-
|
|
426
|
-
], 10,
|
|
423
|
+
innerHTML: i.icon
|
|
424
|
+
}, null, 8, za)) : v("", !0),
|
|
425
|
+
Y(" " + n(i.label), 1)
|
|
426
|
+
], 10, Sa))), 128))
|
|
427
427
|
])) : (a(), s("form", {
|
|
428
428
|
key: 2,
|
|
429
429
|
class: "artifactuse-form",
|
|
430
|
-
onSubmit:
|
|
430
|
+
onSubmit: _e(W, ["prevent"])
|
|
431
431
|
}, [
|
|
432
|
-
e("div",
|
|
433
|
-
(a(!0), s(
|
|
434
|
-
key:
|
|
432
|
+
e("div", Va, [
|
|
433
|
+
(a(!0), s(F, null, de(N.value, (i, H) => (a(), s(F, {
|
|
434
|
+
key: i.name || H
|
|
435
435
|
}, [
|
|
436
|
-
|
|
437
|
-
(a(!0), s(
|
|
438
|
-
key:
|
|
439
|
-
type:
|
|
440
|
-
class:
|
|
441
|
-
disabled:
|
|
442
|
-
onClick: (
|
|
436
|
+
i.type === "buttons" ? (a(), s("div", Ia, [
|
|
437
|
+
(a(!0), s(F, null, de(i.fields || [], (d) => (a(), s("button", {
|
|
438
|
+
key: d.name || d.label,
|
|
439
|
+
type: d.action === "submit" ? "submit" : "button",
|
|
440
|
+
class: I(["artifactuse-form-btn", `artifactuse-form-btn-${d.variant || "secondary"}`]),
|
|
441
|
+
disabled: d.disabled || d.action === "submit" && U.value,
|
|
442
|
+
onClick: (L) => d.action !== "submit" ? ie(d) : null
|
|
443
443
|
}, [
|
|
444
|
-
|
|
444
|
+
U.value && d.action === "submit" ? (a(), s("span", Ra)) : d.icon ? (a(), s("span", {
|
|
445
445
|
key: 1,
|
|
446
446
|
class: "artifactuse-form-btn-icon",
|
|
447
|
-
innerHTML:
|
|
448
|
-
}, null, 8,
|
|
449
|
-
|
|
450
|
-
], 10,
|
|
451
|
-
])) :
|
|
452
|
-
e("label",
|
|
447
|
+
innerHTML: d.icon
|
|
448
|
+
}, null, 8, qa)) : v("", !0),
|
|
449
|
+
Y(" " + n(U.value && d.action === "submit" ? "Submitting..." : d.label), 1)
|
|
450
|
+
], 10, Fa))), 128))
|
|
451
|
+
])) : i.type === "divider" ? (a(), s("div", Oa)) : i.type === "heading" ? (a(), s("div", Ua, n(i.label), 1)) : i.type === "checkbox" ? (a(), s("div", Da, [
|
|
452
|
+
e("label", ja, [
|
|
453
453
|
e("input", {
|
|
454
454
|
type: "checkbox",
|
|
455
|
-
checked: x.value[
|
|
456
|
-
disabled:
|
|
455
|
+
checked: x.value[i.name],
|
|
456
|
+
disabled: i.disabled,
|
|
457
457
|
class: "artifactuse-checkbox",
|
|
458
|
-
onChange: (
|
|
459
|
-
}, null, 40,
|
|
460
|
-
e("span",
|
|
461
|
-
|
|
462
|
-
|
|
458
|
+
onChange: (d) => k(i.name, d.target.checked)
|
|
459
|
+
}, null, 40, Na),
|
|
460
|
+
e("span", Wa, [
|
|
461
|
+
Y(n(i.label) + " ", 1),
|
|
462
|
+
i.required ? (a(), s("span", Ja, "*")) : v("", !0)
|
|
463
463
|
])
|
|
464
464
|
]),
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
])) : (a(), s("div",
|
|
465
|
+
i.helpText ? (a(), s("span", Xa, n(i.helpText), 1)) : v("", !0),
|
|
466
|
+
D.value[i.name] ? (a(), s("span", Za, n(D.value[i.name]), 1)) : v("", !0)
|
|
467
|
+
])) : (a(), s("div", Ka, [
|
|
468
468
|
e("label", {
|
|
469
|
-
for: `${h.value}-${
|
|
469
|
+
for: `${h.value}-${i.name}`,
|
|
470
470
|
class: "artifactuse-label"
|
|
471
471
|
}, [
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
], 8,
|
|
475
|
-
|
|
472
|
+
Y(n(i.label) + " ", 1),
|
|
473
|
+
i.required ? (a(), s("span", Qa, "*")) : v("", !0)
|
|
474
|
+
], 8, Ya),
|
|
475
|
+
ve(i.type) ? (a(), s("input", {
|
|
476
476
|
key: 0,
|
|
477
|
-
id: `${h.value}-${
|
|
478
|
-
type:
|
|
479
|
-
value: x.value[
|
|
480
|
-
placeholder:
|
|
481
|
-
disabled:
|
|
482
|
-
required:
|
|
477
|
+
id: `${h.value}-${i.name}`,
|
|
478
|
+
type: i.type,
|
|
479
|
+
value: x.value[i.name],
|
|
480
|
+
placeholder: i.placeholder,
|
|
481
|
+
disabled: i.disabled,
|
|
482
|
+
required: i.required,
|
|
483
483
|
class: "artifactuse-input",
|
|
484
|
-
onInput: (
|
|
485
|
-
}, null, 40,
|
|
484
|
+
onInput: (d) => k(i.name, d.target.value)
|
|
485
|
+
}, null, 40, Ga)) : i.type === "textarea" ? (a(), s("textarea", {
|
|
486
486
|
key: 1,
|
|
487
|
-
id: `${h.value}-${
|
|
488
|
-
value: x.value[
|
|
489
|
-
placeholder:
|
|
490
|
-
disabled:
|
|
491
|
-
required:
|
|
492
|
-
rows:
|
|
487
|
+
id: `${h.value}-${i.name}`,
|
|
488
|
+
value: x.value[i.name],
|
|
489
|
+
placeholder: i.placeholder,
|
|
490
|
+
disabled: i.disabled,
|
|
491
|
+
required: i.required,
|
|
492
|
+
rows: i.rows || 3,
|
|
493
493
|
class: "artifactuse-textarea",
|
|
494
|
-
onInput: (
|
|
495
|
-
}, null, 40,
|
|
494
|
+
onInput: (d) => k(i.name, d.target.value)
|
|
495
|
+
}, null, 40, es)) : i.type === "select" ? (a(), s("select", {
|
|
496
496
|
key: 2,
|
|
497
|
-
id: `${h.value}-${
|
|
498
|
-
value: x.value[
|
|
499
|
-
disabled:
|
|
500
|
-
required:
|
|
497
|
+
id: `${h.value}-${i.name}`,
|
|
498
|
+
value: x.value[i.name],
|
|
499
|
+
disabled: i.disabled,
|
|
500
|
+
required: i.required,
|
|
501
501
|
class: "artifactuse-select",
|
|
502
|
-
onChange: (
|
|
502
|
+
onChange: (d) => k(i.name, d.target.value)
|
|
503
503
|
}, [
|
|
504
|
-
e("option",
|
|
505
|
-
(a(!0), s(
|
|
506
|
-
key:
|
|
507
|
-
value:
|
|
508
|
-
disabled:
|
|
509
|
-
},
|
|
510
|
-
], 40,
|
|
511
|
-
(a(!0), s(
|
|
512
|
-
key:
|
|
504
|
+
e("option", as, n(i.placeholder || "Select..."), 1),
|
|
505
|
+
(a(!0), s(F, null, de(m(i.options), (d) => (a(), s("option", {
|
|
506
|
+
key: d.value,
|
|
507
|
+
value: d.value,
|
|
508
|
+
disabled: d.disabled
|
|
509
|
+
}, n(d.label), 9, ss))), 128))
|
|
510
|
+
], 40, ts)) : i.type === "radio" ? (a(), s("div", ls, [
|
|
511
|
+
(a(!0), s(F, null, de(m(i.options), (d) => (a(), s("label", {
|
|
512
|
+
key: d.value,
|
|
513
513
|
class: "artifactuse-radio-label"
|
|
514
514
|
}, [
|
|
515
515
|
e("input", {
|
|
516
516
|
type: "radio",
|
|
517
|
-
name:
|
|
518
|
-
value:
|
|
519
|
-
checked: x.value[
|
|
520
|
-
disabled:
|
|
517
|
+
name: i.name,
|
|
518
|
+
value: d.value,
|
|
519
|
+
checked: x.value[i.name] === d.value,
|
|
520
|
+
disabled: d.disabled || i.disabled,
|
|
521
521
|
class: "artifactuse-radio",
|
|
522
|
-
onChange: (
|
|
523
|
-
}, null, 40,
|
|
524
|
-
e("span", null,
|
|
522
|
+
onChange: (L) => k(i.name, d.value)
|
|
523
|
+
}, null, 40, is),
|
|
524
|
+
e("span", null, n(d.label), 1)
|
|
525
525
|
]))), 128))
|
|
526
526
|
])) : v("", !0),
|
|
527
|
-
|
|
528
|
-
|
|
527
|
+
i.helpText ? (a(), s("span", ns, n(i.helpText), 1)) : v("", !0),
|
|
528
|
+
D.value[i.name] ? (a(), s("span", os, n(D.value[i.name]), 1)) : v("", !0)
|
|
529
529
|
]))
|
|
530
530
|
], 64))), 128))
|
|
531
531
|
]),
|
|
532
|
-
|
|
532
|
+
B.value ? v("", !0) : (a(), s("div", rs, [
|
|
533
533
|
e("button", {
|
|
534
534
|
type: "button",
|
|
535
535
|
class: "artifactuse-form-btn artifactuse-form-btn-ghost",
|
|
536
|
-
onClick:
|
|
536
|
+
onClick: E[0] || (E[0] = (i) => ie({ 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:
|
|
541
|
+
disabled: U.value
|
|
542
542
|
}, [
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
], 8,
|
|
543
|
+
U.value ? (a(), s("span", us)) : v("", !0),
|
|
544
|
+
Y(" " + n(U.value ? "Submitting..." : "Submit"), 1)
|
|
545
|
+
], 8, cs)
|
|
546
546
|
]))
|
|
547
547
|
], 32))
|
|
548
548
|
], 64))
|
|
549
|
-
], 10,
|
|
549
|
+
], 10, Ca));
|
|
550
550
|
}
|
|
551
|
-
},
|
|
551
|
+
}, vs = ["data-artifactuse-theme"], fs = { class: "artifactuse-social-header" }, ps = ["src", "alt"], _s = { class: "artifactuse-social-author" }, hs = { class: "artifactuse-social-author-name" }, ms = { class: "artifactuse-social-author-meta" }, ys = { class: "artifactuse-social-author-handle" }, gs = { class: "artifactuse-social-timestamp" }, ks = { class: "artifactuse-social-content" }, ws = ["innerHTML"], bs = {
|
|
552
552
|
key: 0,
|
|
553
553
|
class: "artifactuse-social-media"
|
|
554
|
-
},
|
|
554
|
+
}, Cs = ["data-count"], xs = ["src", "alt"], $s = {
|
|
555
555
|
key: 1,
|
|
556
556
|
class: "artifactuse-social-link-card"
|
|
557
|
-
},
|
|
557
|
+
}, Ms = ["src", "alt"], Ts = { class: "artifactuse-social-link-info" }, Ls = { class: "artifactuse-social-link-domain" }, Ps = { class: "artifactuse-social-link-title" }, Es = {
|
|
558
558
|
key: 0,
|
|
559
559
|
class: "artifactuse-social-link-description"
|
|
560
|
-
},
|
|
560
|
+
}, As = {
|
|
561
561
|
key: 2,
|
|
562
562
|
class: "artifactuse-social-poll"
|
|
563
|
-
},
|
|
563
|
+
}, Hs = { class: "artifactuse-social-poll-label" }, Bs = { class: "artifactuse-social-poll-label-percent" }, Ss = { class: "artifactuse-social-poll-meta" }, zs = {
|
|
564
564
|
key: 3,
|
|
565
565
|
class: "artifactuse-social-quote"
|
|
566
|
-
},
|
|
566
|
+
}, Vs = { class: "artifactuse-social-quote-header" }, Is = ["src"], Fs = { class: "artifactuse-social-quote-author" }, Rs = { class: "artifactuse-social-quote-handle" }, qs = { class: "artifactuse-social-quote-text" }, Os = {
|
|
567
567
|
key: 0,
|
|
568
568
|
class: "artifactuse-social-engagement"
|
|
569
|
-
},
|
|
569
|
+
}, Us = { class: "artifactuse-social-stat" }, Ds = { class: "artifactuse-social-stat" }, js = { class: "artifactuse-social-stat" }, Ns = { class: "artifactuse-social-stat" }, Ws = { class: "artifactuse-social-header" }, Js = ["src", "alt"], Xs = { class: "artifactuse-social-author-info" }, Zs = { class: "artifactuse-social-author-name" }, Ks = {
|
|
570
570
|
key: 0,
|
|
571
571
|
class: "artifactuse-social-author-connection"
|
|
572
|
-
},
|
|
572
|
+
}, Ys = { class: "artifactuse-social-author-headline" }, Qs = { class: "artifactuse-social-timestamp" }, Gs = { class: "artifactuse-social-content" }, el = ["innerHTML"], tl = {
|
|
573
573
|
key: 0,
|
|
574
574
|
class: "artifactuse-social-link-card"
|
|
575
|
-
},
|
|
575
|
+
}, al = ["src", "alt"], sl = { class: "artifactuse-social-link-info" }, ll = { class: "artifactuse-social-link-title" }, il = { class: "artifactuse-social-link-domain" }, nl = {
|
|
576
576
|
key: 0,
|
|
577
577
|
class: "artifactuse-social-engagement"
|
|
578
|
-
},
|
|
578
|
+
}, ol = { class: "artifactuse-social-reactions" }, rl = { class: "artifactuse-social-header" }, cl = ["src", "alt"], ul = { class: "artifactuse-social-author-name" }, dl = {
|
|
579
579
|
key: 0,
|
|
580
580
|
class: "artifactuse-social-verified",
|
|
581
581
|
viewBox: "0 0 24 24",
|
|
582
582
|
fill: "currentColor"
|
|
583
|
-
},
|
|
583
|
+
}, vl = {
|
|
584
584
|
key: 0,
|
|
585
585
|
class: "artifactuse-social-media"
|
|
586
|
-
},
|
|
586
|
+
}, fl = ["src", "alt"], pl = { class: "artifactuse-social-likes" }, _l = { class: "artifactuse-social-caption" }, hl = { class: "artifactuse-social-caption-author" }, ml = ["innerHTML"], yl = { class: "artifactuse-social-timestamp" }, gl = { class: "artifactuse-social-header" }, kl = ["src", "alt"], wl = { class: "artifactuse-social-author-info" }, bl = { class: "artifactuse-social-author-name" }, Cl = { class: "artifactuse-social-timestamp" }, xl = { class: "artifactuse-social-content" }, $l = ["innerHTML"], Ml = {
|
|
587
587
|
key: 0,
|
|
588
588
|
class: "artifactuse-social-link-card"
|
|
589
|
-
},
|
|
589
|
+
}, Tl = ["src", "alt"], Ll = { class: "artifactuse-social-link-info" }, Pl = { class: "artifactuse-social-link-domain" }, El = { class: "artifactuse-social-link-title" }, Al = {
|
|
590
590
|
key: 0,
|
|
591
591
|
class: "artifactuse-social-link-description"
|
|
592
|
-
},
|
|
592
|
+
}, Hl = {
|
|
593
593
|
key: 0,
|
|
594
594
|
class: "artifactuse-social-engagement"
|
|
595
|
-
},
|
|
595
|
+
}, Bl = { class: "artifactuse-social-reactions" }, Sl = { class: "artifactuse-social-reaction-count" }, zl = { class: "artifactuse-social-comments-shares" }, Vl = { class: "artifactuse-social-header" }, Il = ["src", "alt"], Fl = { class: "artifactuse-social-author-info" }, Rl = { class: "artifactuse-social-author-name" }, ql = {
|
|
596
596
|
key: 0,
|
|
597
597
|
class: "artifactuse-social-verified",
|
|
598
598
|
viewBox: "0 0 24 24",
|
|
599
599
|
fill: "currentColor"
|
|
600
|
-
},
|
|
600
|
+
}, Ol = { class: "artifactuse-social-timestamp" }, Ul = { class: "artifactuse-social-content" }, Dl = ["innerHTML"], jl = {
|
|
601
601
|
key: 0,
|
|
602
602
|
class: "artifactuse-social-engagement"
|
|
603
|
-
},
|
|
603
|
+
}, Nl = { class: "artifactuse-social-stat" }, Wl = { class: "artifactuse-social-stat" }, Jl = { class: "artifactuse-social-stat" }, Xl = { class: "artifactuse-social-thumbnail" }, Zl = ["src", "alt"], Kl = {
|
|
604
604
|
key: 1,
|
|
605
605
|
class: "artifactuse-social-duration"
|
|
606
|
-
},
|
|
606
|
+
}, Yl = { class: "artifactuse-social-info" }, Ql = { class: "artifactuse-social-header" }, Gl = ["src", "alt"], ei = { class: "artifactuse-social-author-name" }, ti = ["innerHTML"], ai = {
|
|
607
607
|
key: 0,
|
|
608
608
|
class: "artifactuse-social-sound"
|
|
609
|
-
},
|
|
609
|
+
}, si = {
|
|
610
610
|
key: 1,
|
|
611
611
|
class: "artifactuse-social-engagement"
|
|
612
|
-
},
|
|
612
|
+
}, li = { class: "artifactuse-social-thumbnail" }, ii = ["src", "alt"], ni = {
|
|
613
613
|
key: 1,
|
|
614
614
|
class: "artifactuse-social-duration"
|
|
615
|
-
},
|
|
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 = {
|
|
616
616
|
__name: "ArtifactuseSocialPreview",
|
|
617
617
|
props: {
|
|
618
618
|
artifact: {
|
|
@@ -625,37 +625,37 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
627
|
emits: ["copy", "edit"],
|
|
628
|
-
setup(
|
|
629
|
-
const _ =
|
|
628
|
+
setup(P, { emit: c }) {
|
|
629
|
+
const _ = P, T = c, p = M(null), r = M("Copy"), q = b(() => {
|
|
630
630
|
try {
|
|
631
631
|
return JSON.parse(_.artifact.code);
|
|
632
632
|
} catch {
|
|
633
633
|
return { platform: "twitter", data: {} };
|
|
634
634
|
}
|
|
635
|
-
}),
|
|
635
|
+
}), A = b(() => {
|
|
636
636
|
var m;
|
|
637
637
|
return ((m = q.value) == null ? void 0 : m.platform) || "twitter";
|
|
638
638
|
});
|
|
639
|
-
|
|
639
|
+
b(() => {
|
|
640
640
|
var m;
|
|
641
641
|
return ((m = q.value) == null ? void 0 : m.variant) || "post";
|
|
642
642
|
});
|
|
643
|
-
const g =
|
|
643
|
+
const g = b(() => {
|
|
644
644
|
var m, k;
|
|
645
645
|
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.author) || {};
|
|
646
|
-
}),
|
|
646
|
+
}), o = b(() => {
|
|
647
647
|
var m, k;
|
|
648
648
|
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.content) || {};
|
|
649
|
-
}), h =
|
|
649
|
+
}), h = b(() => {
|
|
650
650
|
var m, k;
|
|
651
651
|
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.engagement) || {};
|
|
652
|
-
}), $ =
|
|
652
|
+
}), $ = b(() => {
|
|
653
653
|
var m, k;
|
|
654
654
|
return ((k = (m = q.value) == null ? void 0 : m.data) == null ? void 0 : k.meta) || {};
|
|
655
|
-
}),
|
|
655
|
+
}), V = b(() => {
|
|
656
656
|
const m = h.value;
|
|
657
657
|
return m.likes || m.comments || m.shares || m.retweets || m.replies || m.views;
|
|
658
|
-
}), x =
|
|
658
|
+
}), x = b(() => `artifactuse-social-verified-${g.value.verifiedType || "blue"}`), D = b(() => ({
|
|
659
659
|
twitter: "X",
|
|
660
660
|
linkedin: "LinkedIn",
|
|
661
661
|
instagram: "Instagram",
|
|
@@ -663,127 +663,127 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
663
663
|
threads: "Threads",
|
|
664
664
|
tiktok: "TikTok",
|
|
665
665
|
youtube: "YouTube"
|
|
666
|
-
})[
|
|
666
|
+
})[A.value] || A.value), U = b(() => {
|
|
667
667
|
const m = {
|
|
668
|
-
twitter: () =>
|
|
669
|
-
|
|
668
|
+
twitter: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
669
|
+
ne("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" })
|
|
670
670
|
]),
|
|
671
|
-
linkedin: () =>
|
|
672
|
-
|
|
671
|
+
linkedin: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
672
|
+
ne("path", { d: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" })
|
|
673
673
|
]),
|
|
674
|
-
instagram: () =>
|
|
675
|
-
|
|
674
|
+
instagram: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
675
|
+
ne("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z" })
|
|
676
676
|
]),
|
|
677
|
-
facebook: () =>
|
|
678
|
-
|
|
677
|
+
facebook: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
678
|
+
ne("path", { d: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" })
|
|
679
679
|
]),
|
|
680
|
-
threads: () =>
|
|
681
|
-
|
|
680
|
+
threads: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
681
|
+
ne("path", { d: "M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.59 12c.025 3.086.718 5.496 2.057 7.164 1.43 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.96-.065-1.182.408-2.256 1.33-3.022.88-.73 2.108-1.152 3.457-1.187 1.357-.035 2.573.283 3.58.89.034-.497.04-1.017.015-1.558-.083-1.792-.648-3.095-1.68-3.876-.99-.75-2.453-1.123-4.35-1.108-.987.008-1.866.09-2.613.246l-.464-2.086c.912-.19 1.965-.29 3.133-.298 2.467-.02 4.42.554 5.807 1.706 1.46 1.213 2.24 3.007 2.354 5.411.039.827.026 1.69-.04 2.576.962.681 1.735 1.542 2.268 2.553.846 1.6 1.026 3.639.508 5.622-.57 2.181-1.782 3.94-3.503 5.079C17.194 23.394 14.88 24 12.186 24zM9.15 13.476c-.927.037-1.628.282-2.085.728-.418.408-.618.945-.578 1.553.04.638.347 1.165.866 1.483.586.36 1.39.521 2.266.45 1.053-.085 1.86-.473 2.4-1.153.457-.576.763-1.39.884-2.356-.893-.41-1.944-.636-3.095-.705h-.009c-.216-.008-.436-.008-.65 0z" })
|
|
682
682
|
]),
|
|
683
|
-
tiktok: () =>
|
|
684
|
-
|
|
683
|
+
tiktok: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
684
|
+
ne("path", { d: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z" })
|
|
685
685
|
]),
|
|
686
|
-
youtube: () =>
|
|
687
|
-
|
|
686
|
+
youtube: () => ne("svg", { viewBox: "0 0 24 24", fill: "currentColor" }, [
|
|
687
|
+
ne("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 m[
|
|
691
|
-
}),
|
|
692
|
-
let m =
|
|
690
|
+
return m[A.value] || m.twitter;
|
|
691
|
+
}), N = b(() => {
|
|
692
|
+
let m = o.value.text || "";
|
|
693
693
|
return m = m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), m = m.replace(/#(\w+)/g, '<span class="artifactuse-social-hashtag">#$1</span>'), m = m.replace(/@(\w+)/g, '<span class="artifactuse-social-mention">@$1</span>'), m = m.replace(
|
|
694
694
|
/(https?:\/\/[^\s]+)/g,
|
|
695
695
|
'<a href="$1" target="_blank" rel="noopener">$1</a>'
|
|
696
696
|
), m;
|
|
697
|
-
}),
|
|
697
|
+
}), ee = b(() => {
|
|
698
698
|
const m = h.value.reactions || {};
|
|
699
|
-
return Object.values(m).reduce((k,
|
|
699
|
+
return Object.values(m).reduce((k, ae) => k + (ae || 0), 0) || h.value.likes || 0;
|
|
700
700
|
});
|
|
701
|
-
function
|
|
701
|
+
function B(m) {
|
|
702
702
|
return m ? m >= 1e6 ? `${(m / 1e6).toFixed(1)}M` : m >= 1e3 ? `${(m / 1e3).toFixed(1)}K` : m.toString() : "0";
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function re(m) {
|
|
705
705
|
try {
|
|
706
706
|
return new URL(m).hostname.replace("www.", "");
|
|
707
707
|
} catch {
|
|
708
708
|
return m;
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
m.target.src =
|
|
711
|
+
function K(m) {
|
|
712
|
+
m.target.src = he;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function Z(m) {
|
|
715
715
|
m.target.style.display = "none";
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
const m =
|
|
717
|
+
function ve() {
|
|
718
|
+
const m = o.value.text || "";
|
|
719
719
|
navigator.clipboard.writeText(m).then(() => {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
}, 2e3),
|
|
720
|
+
r.value = "Copied!", setTimeout(() => {
|
|
721
|
+
r.value = "Copy";
|
|
722
|
+
}, 2e3), T("copy", { platform: A.value, text: m });
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
725
|
return (m, k) => {
|
|
726
|
-
var
|
|
726
|
+
var ae, Q, W, ie, w, E;
|
|
727
727
|
return a(), s("div", {
|
|
728
728
|
ref_key: "containerRef",
|
|
729
|
-
ref:
|
|
730
|
-
class:
|
|
731
|
-
"data-artifactuse-theme":
|
|
729
|
+
ref: p,
|
|
730
|
+
class: I(["artifactuse-social", [`artifactuse-social-${A.value}`]]),
|
|
731
|
+
"data-artifactuse-theme": P.theme
|
|
732
732
|
}, [
|
|
733
|
-
|
|
734
|
-
e("div",
|
|
733
|
+
A.value === "twitter" ? (a(), s(F, { key: 0 }, [
|
|
734
|
+
e("div", fs, [
|
|
735
735
|
e("img", {
|
|
736
|
-
src: g.value.avatar ||
|
|
736
|
+
src: g.value.avatar || he,
|
|
737
737
|
alt: g.value.name,
|
|
738
738
|
class: "artifactuse-social-avatar",
|
|
739
|
-
onError:
|
|
740
|
-
}, null, 40,
|
|
741
|
-
e("div",
|
|
742
|
-
e("div",
|
|
743
|
-
e("span", null,
|
|
739
|
+
onError: K
|
|
740
|
+
}, null, 40, ps),
|
|
741
|
+
e("div", _s, [
|
|
742
|
+
e("div", hs, [
|
|
743
|
+
e("span", null, n(g.value.name), 1),
|
|
744
744
|
g.value.verified ? (a(), s("svg", {
|
|
745
745
|
key: 0,
|
|
746
|
-
class:
|
|
746
|
+
class: I(["artifactuse-social-verified", x.value]),
|
|
747
747
|
viewBox: "0 0 24 24",
|
|
748
748
|
fill: "currentColor"
|
|
749
749
|
}, [...k[0] || (k[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)) : v("", !0)
|
|
752
752
|
]),
|
|
753
|
-
e("div",
|
|
754
|
-
e("span",
|
|
755
|
-
e("span",
|
|
753
|
+
e("div", ms, [
|
|
754
|
+
e("span", ys, n(g.value.handle), 1),
|
|
755
|
+
e("span", gs, "· " + n($.value.timestamp || "Just now"), 1)
|
|
756
756
|
])
|
|
757
757
|
])
|
|
758
758
|
]),
|
|
759
|
-
e("div",
|
|
759
|
+
e("div", ks, [
|
|
760
760
|
e("p", {
|
|
761
761
|
class: "artifactuse-social-text",
|
|
762
|
-
innerHTML:
|
|
763
|
-
}, null, 8,
|
|
764
|
-
(
|
|
762
|
+
innerHTML: N.value
|
|
763
|
+
}, null, 8, ws),
|
|
764
|
+
(ae = o.value.media) != null && ae.length ? (a(), s("div", bs, [
|
|
765
765
|
e("div", {
|
|
766
|
-
class:
|
|
767
|
-
"data-count":
|
|
766
|
+
class: I(["artifactuse-social-media-grid", { "artifactuse-social-media-single": o.value.media.length === 1 }]),
|
|
767
|
+
"data-count": o.value.media.length
|
|
768
768
|
}, [
|
|
769
|
-
(a(!0), s(
|
|
770
|
-
key:
|
|
771
|
-
src:
|
|
772
|
-
alt:
|
|
773
|
-
onError:
|
|
774
|
-
}, null, 40,
|
|
775
|
-
], 10,
|
|
769
|
+
(a(!0), s(F, null, de(o.value.media.slice(0, 4), (i, H) => (a(), s("img", {
|
|
770
|
+
key: H,
|
|
771
|
+
src: i.url,
|
|
772
|
+
alt: i.alt || "",
|
|
773
|
+
onError: Z
|
|
774
|
+
}, null, 40, xs))), 128))
|
|
775
|
+
], 10, Cs)
|
|
776
776
|
])) : v("", !0),
|
|
777
|
-
|
|
778
|
-
|
|
777
|
+
o.value.link && !((Q = o.value.media) != null && Q.length) ? (a(), s("div", $s, [
|
|
778
|
+
o.value.link.image ? (a(), s("img", {
|
|
779
779
|
key: 0,
|
|
780
|
-
src:
|
|
781
|
-
alt:
|
|
780
|
+
src: o.value.link.image,
|
|
781
|
+
alt: o.value.link.title,
|
|
782
782
|
class: "artifactuse-social-link-image",
|
|
783
|
-
onError:
|
|
784
|
-
}, null, 40,
|
|
785
|
-
e("div",
|
|
786
|
-
e("div",
|
|
783
|
+
onError: Z
|
|
784
|
+
}, null, 40, Ms)) : v("", !0),
|
|
785
|
+
e("div", Ts, [
|
|
786
|
+
e("div", Ls, [
|
|
787
787
|
k[1] || (k[1] = e("svg", {
|
|
788
788
|
fill: "none",
|
|
789
789
|
viewBox: "0 0 24 24",
|
|
@@ -796,45 +796,45 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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
|
-
|
|
799
|
+
Y(" " + n(o.value.link.domain || re(o.value.link.url)), 1)
|
|
800
800
|
]),
|
|
801
|
-
e("div",
|
|
802
|
-
|
|
801
|
+
e("div", Ps, n(o.value.link.title), 1),
|
|
802
|
+
o.value.link.description ? (a(), s("div", Es, n(o.value.link.description), 1)) : v("", !0)
|
|
803
803
|
])
|
|
804
804
|
])) : v("", !0),
|
|
805
|
-
|
|
806
|
-
(a(!0), s(
|
|
807
|
-
var
|
|
805
|
+
o.value.poll ? (a(), s("div", As, [
|
|
806
|
+
(a(!0), s(F, null, de(o.value.poll.options, (i, H) => {
|
|
807
|
+
var d, L;
|
|
808
808
|
return a(), s("div", {
|
|
809
|
-
key:
|
|
809
|
+
key: H,
|
|
810
810
|
class: "artifactuse-social-poll-option"
|
|
811
811
|
}, [
|
|
812
812
|
e("div", {
|
|
813
813
|
class: "artifactuse-social-poll-bar",
|
|
814
|
-
style:
|
|
814
|
+
style: Se({ width: `${((d = o.value.poll.votes) == null ? void 0 : d[H]) || 0}%` })
|
|
815
815
|
}, null, 4),
|
|
816
|
-
e("div",
|
|
817
|
-
e("span", null,
|
|
818
|
-
e("span",
|
|
816
|
+
e("div", Hs, [
|
|
817
|
+
e("span", null, n(i), 1),
|
|
818
|
+
e("span", Bs, n(((L = o.value.poll.votes) == null ? void 0 : L[H]) || 0) + "%", 1)
|
|
819
819
|
])
|
|
820
820
|
]);
|
|
821
821
|
}), 128)),
|
|
822
|
-
e("div",
|
|
822
|
+
e("div", Ss, n(B(o.value.poll.totalVotes || 0)) + " votes · " + n(o.value.poll.duration || "Poll ended"), 1)
|
|
823
823
|
])) : v("", !0),
|
|
824
|
-
|
|
825
|
-
e("div",
|
|
824
|
+
o.value.quote ? (a(), s("div", zs, [
|
|
825
|
+
e("div", Vs, [
|
|
826
826
|
e("img", {
|
|
827
|
-
src: ((
|
|
827
|
+
src: ((W = o.value.quote.author) == null ? void 0 : W.avatar) || he,
|
|
828
828
|
class: "artifactuse-social-quote-avatar"
|
|
829
|
-
}, null, 8,
|
|
830
|
-
e("span",
|
|
831
|
-
e("span",
|
|
829
|
+
}, null, 8, Is),
|
|
830
|
+
e("span", Fs, n((ie = o.value.quote.author) == null ? void 0 : ie.name), 1),
|
|
831
|
+
e("span", Rs, n((w = o.value.quote.author) == null ? void 0 : w.handle), 1)
|
|
832
832
|
]),
|
|
833
|
-
e("p",
|
|
833
|
+
e("p", qs, n(o.value.quote.text), 1)
|
|
834
834
|
])) : v("", !0)
|
|
835
835
|
]),
|
|
836
|
-
|
|
837
|
-
e("div",
|
|
836
|
+
V.value ? (a(), s("div", Os, [
|
|
837
|
+
e("div", Us, [
|
|
838
838
|
k[2] || (k[2] = e("svg", {
|
|
839
839
|
viewBox: "0 0 24 24",
|
|
840
840
|
fill: "none",
|
|
@@ -843,9 +843,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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,
|
|
846
|
+
e("span", null, n(B(h.value.replies || 0)), 1)
|
|
847
847
|
]),
|
|
848
|
-
e("div",
|
|
848
|
+
e("div", Ds, [
|
|
849
849
|
k[3] || (k[3] = e("svg", {
|
|
850
850
|
viewBox: "0 0 24 24",
|
|
851
851
|
fill: "none",
|
|
@@ -854,9 +854,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
854
854
|
}, [
|
|
855
855
|
e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
|
|
856
856
|
], -1)),
|
|
857
|
-
e("span", null,
|
|
857
|
+
e("span", null, n(B(h.value.retweets || 0)), 1)
|
|
858
858
|
]),
|
|
859
|
-
e("div",
|
|
859
|
+
e("div", js, [
|
|
860
860
|
k[4] || (k[4] = e("svg", {
|
|
861
861
|
viewBox: "0 0 24 24",
|
|
862
862
|
fill: "none",
|
|
@@ -865,9 +865,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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,
|
|
868
|
+
e("span", null, n(B(h.value.likes || 0)), 1)
|
|
869
869
|
]),
|
|
870
|
-
e("div",
|
|
870
|
+
e("div", Ns, [
|
|
871
871
|
k[5] || (k[5] = e("svg", {
|
|
872
872
|
viewBox: "0 0 24 24",
|
|
873
873
|
fill: "none",
|
|
@@ -876,25 +876,25 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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,
|
|
879
|
+
e("span", null, n(B(h.value.views || 0)), 1)
|
|
880
880
|
])
|
|
881
881
|
])) : v("", !0)
|
|
882
|
-
], 64)) :
|
|
883
|
-
e("div",
|
|
882
|
+
], 64)) : A.value === "linkedin" ? (a(), s(F, { key: 1 }, [
|
|
883
|
+
e("div", Ws, [
|
|
884
884
|
e("img", {
|
|
885
|
-
src: g.value.avatar ||
|
|
885
|
+
src: g.value.avatar || he,
|
|
886
886
|
alt: g.value.name,
|
|
887
887
|
class: "artifactuse-social-avatar",
|
|
888
|
-
onError:
|
|
889
|
-
}, null, 40,
|
|
890
|
-
e("div",
|
|
891
|
-
e("div",
|
|
892
|
-
|
|
893
|
-
g.value.connection ? (a(), s("span",
|
|
888
|
+
onError: K
|
|
889
|
+
}, null, 40, Js),
|
|
890
|
+
e("div", Xs, [
|
|
891
|
+
e("div", Zs, [
|
|
892
|
+
Y(n(g.value.name) + " ", 1),
|
|
893
|
+
g.value.connection ? (a(), s("span", Ks, "· " + n(g.value.connection), 1)) : v("", !0)
|
|
894
894
|
]),
|
|
895
|
-
e("div",
|
|
896
|
-
e("div",
|
|
897
|
-
|
|
895
|
+
e("div", Ys, n(g.value.headline), 1),
|
|
896
|
+
e("div", Qs, [
|
|
897
|
+
Y(n($.value.timestamp || "Just now") + " · ", 1),
|
|
898
898
|
k[6] || (k[6] = e("svg", {
|
|
899
899
|
viewBox: "0 0 24 24",
|
|
900
900
|
fill: "currentColor"
|
|
@@ -904,80 +904,80 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
904
904
|
])
|
|
905
905
|
])
|
|
906
906
|
]),
|
|
907
|
-
e("div",
|
|
907
|
+
e("div", Gs, [
|
|
908
908
|
e("p", {
|
|
909
909
|
class: "artifactuse-social-text",
|
|
910
|
-
innerHTML:
|
|
911
|
-
}, null, 8,
|
|
912
|
-
|
|
913
|
-
|
|
910
|
+
innerHTML: N.value
|
|
911
|
+
}, null, 8, el),
|
|
912
|
+
o.value.link ? (a(), s("div", tl, [
|
|
913
|
+
o.value.link.image ? (a(), s("img", {
|
|
914
914
|
key: 0,
|
|
915
|
-
src:
|
|
916
|
-
alt:
|
|
915
|
+
src: o.value.link.image,
|
|
916
|
+
alt: o.value.link.title,
|
|
917
917
|
class: "artifactuse-social-link-image",
|
|
918
|
-
onError:
|
|
919
|
-
}, null, 40,
|
|
920
|
-
e("div",
|
|
921
|
-
e("div",
|
|
922
|
-
e("div",
|
|
918
|
+
onError: Z
|
|
919
|
+
}, null, 40, al)) : v("", !0),
|
|
920
|
+
e("div", sl, [
|
|
921
|
+
e("div", ll, n(o.value.link.title), 1),
|
|
922
|
+
e("div", il, n(o.value.link.domain || re(o.value.link.url)), 1)
|
|
923
923
|
])
|
|
924
924
|
])) : v("", !0)
|
|
925
925
|
]),
|
|
926
|
-
|
|
927
|
-
e("div",
|
|
926
|
+
V.value ? (a(), s("div", nl, [
|
|
927
|
+
e("div", ol, [
|
|
928
928
|
k[7] || (k[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,
|
|
933
|
+
e("span", null, n(B(h.value.likes || 0)), 1)
|
|
934
934
|
]),
|
|
935
|
-
e("span", null,
|
|
935
|
+
e("span", null, n(B(h.value.comments || 0)) + " comments · " + n(B(h.value.shares || 0)) + " shares", 1)
|
|
936
936
|
])) : v("", !0)
|
|
937
|
-
], 64)) :
|
|
938
|
-
e("div",
|
|
937
|
+
], 64)) : A.value === "instagram" ? (a(), s(F, { key: 2 }, [
|
|
938
|
+
e("div", rl, [
|
|
939
939
|
e("img", {
|
|
940
|
-
src: g.value.avatar ||
|
|
940
|
+
src: g.value.avatar || he,
|
|
941
941
|
alt: g.value.name,
|
|
942
942
|
class: "artifactuse-social-avatar",
|
|
943
|
-
onError:
|
|
944
|
-
}, null, 40,
|
|
945
|
-
e("div",
|
|
946
|
-
|
|
947
|
-
g.value.verified ? (a(), s("svg",
|
|
943
|
+
onError: K
|
|
944
|
+
}, null, 40, cl),
|
|
945
|
+
e("div", ul, [
|
|
946
|
+
Y(n(g.value.name) + " ", 1),
|
|
947
|
+
g.value.verified ? (a(), s("svg", dl, [...k[8] || (k[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
|
])])) : v("", !0)
|
|
950
950
|
])
|
|
951
951
|
]),
|
|
952
|
-
(
|
|
952
|
+
(E = o.value.media) != null && E.length ? (a(), s("div", vl, [
|
|
953
953
|
e("img", {
|
|
954
|
-
src:
|
|
955
|
-
alt:
|
|
956
|
-
onError:
|
|
957
|
-
}, null, 40,
|
|
954
|
+
src: o.value.media[0].url,
|
|
955
|
+
alt: o.value.media[0].alt || "",
|
|
956
|
+
onError: Z
|
|
957
|
+
}, null, 40, fl)
|
|
958
958
|
])) : v("", !0),
|
|
959
|
-
k[9] || (k[9] =
|
|
960
|
-
e("div",
|
|
961
|
-
e("div",
|
|
962
|
-
e("span",
|
|
959
|
+
k[9] || (k[9] = ea('<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", pl, n(B(h.value.likes || 0)) + " likes", 1),
|
|
961
|
+
e("div", _l, [
|
|
962
|
+
e("span", hl, n(g.value.name), 1),
|
|
963
963
|
e("span", {
|
|
964
964
|
class: "artifactuse-social-caption-text",
|
|
965
|
-
innerHTML:
|
|
966
|
-
}, null, 8,
|
|
965
|
+
innerHTML: N.value
|
|
966
|
+
}, null, 8, ml)
|
|
967
967
|
]),
|
|
968
|
-
e("div",
|
|
969
|
-
], 64)) :
|
|
970
|
-
e("div",
|
|
968
|
+
e("div", yl, n($.value.timestamp || "Just now"), 1)
|
|
969
|
+
], 64)) : A.value === "facebook" ? (a(), s(F, { key: 3 }, [
|
|
970
|
+
e("div", gl, [
|
|
971
971
|
e("img", {
|
|
972
|
-
src: g.value.avatar ||
|
|
972
|
+
src: g.value.avatar || he,
|
|
973
973
|
alt: g.value.name,
|
|
974
974
|
class: "artifactuse-social-avatar",
|
|
975
|
-
onError:
|
|
976
|
-
}, null, 40,
|
|
977
|
-
e("div",
|
|
978
|
-
e("div",
|
|
979
|
-
e("div",
|
|
980
|
-
|
|
975
|
+
onError: K
|
|
976
|
+
}, null, 40, kl),
|
|
977
|
+
e("div", wl, [
|
|
978
|
+
e("div", bl, n(g.value.name), 1),
|
|
979
|
+
e("div", Cl, [
|
|
980
|
+
Y(n($.value.timestamp || "Just now") + " · ", 1),
|
|
981
981
|
k[10] || (k[10] = e("svg", {
|
|
982
982
|
viewBox: "0 0 24 24",
|
|
983
983
|
fill: "currentColor"
|
|
@@ -987,63 +987,63 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
987
987
|
])
|
|
988
988
|
])
|
|
989
989
|
]),
|
|
990
|
-
e("div",
|
|
990
|
+
e("div", xl, [
|
|
991
991
|
e("p", {
|
|
992
992
|
class: "artifactuse-social-text",
|
|
993
|
-
innerHTML:
|
|
994
|
-
}, null, 8,
|
|
995
|
-
|
|
996
|
-
|
|
993
|
+
innerHTML: N.value
|
|
994
|
+
}, null, 8, $l),
|
|
995
|
+
o.value.link ? (a(), s("div", Ml, [
|
|
996
|
+
o.value.link.image ? (a(), s("img", {
|
|
997
997
|
key: 0,
|
|
998
|
-
src:
|
|
999
|
-
alt:
|
|
998
|
+
src: o.value.link.image,
|
|
999
|
+
alt: o.value.link.title,
|
|
1000
1000
|
class: "artifactuse-social-link-image",
|
|
1001
|
-
onError:
|
|
1002
|
-
}, null, 40,
|
|
1003
|
-
e("div",
|
|
1004
|
-
e("div",
|
|
1005
|
-
e("div",
|
|
1006
|
-
|
|
1001
|
+
onError: Z
|
|
1002
|
+
}, null, 40, Tl)) : v("", !0),
|
|
1003
|
+
e("div", Ll, [
|
|
1004
|
+
e("div", Pl, n(o.value.link.domain || re(o.value.link.url)), 1),
|
|
1005
|
+
e("div", El, n(o.value.link.title), 1),
|
|
1006
|
+
o.value.link.description ? (a(), s("div", Al, n(o.value.link.description), 1)) : v("", !0)
|
|
1007
1007
|
])
|
|
1008
1008
|
])) : v("", !0)
|
|
1009
1009
|
]),
|
|
1010
|
-
|
|
1011
|
-
e("div",
|
|
1010
|
+
V.value ? (a(), s("div", Hl, [
|
|
1011
|
+
e("div", Bl, [
|
|
1012
1012
|
k[11] || (k[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",
|
|
1017
|
+
e("span", Sl, n(B(ee.value)), 1)
|
|
1018
1018
|
]),
|
|
1019
|
-
e("span",
|
|
1019
|
+
e("span", zl, n(B(h.value.comments || 0)) + " comments · " + n(B(h.value.shares || 0)) + " shares", 1)
|
|
1020
1020
|
])) : v("", !0)
|
|
1021
|
-
], 64)) :
|
|
1022
|
-
e("div",
|
|
1021
|
+
], 64)) : A.value === "threads" ? (a(), s(F, { key: 4 }, [
|
|
1022
|
+
e("div", Vl, [
|
|
1023
1023
|
e("img", {
|
|
1024
|
-
src: g.value.avatar ||
|
|
1024
|
+
src: g.value.avatar || he,
|
|
1025
1025
|
alt: g.value.name,
|
|
1026
1026
|
class: "artifactuse-social-avatar",
|
|
1027
|
-
onError:
|
|
1028
|
-
}, null, 40,
|
|
1029
|
-
e("div",
|
|
1030
|
-
e("div",
|
|
1031
|
-
|
|
1032
|
-
g.value.verified ? (a(), s("svg",
|
|
1027
|
+
onError: K
|
|
1028
|
+
}, null, 40, Il),
|
|
1029
|
+
e("div", Fl, [
|
|
1030
|
+
e("div", Rl, [
|
|
1031
|
+
Y(n(g.value.name) + " ", 1),
|
|
1032
|
+
g.value.verified ? (a(), s("svg", ql, [...k[12] || (k[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
|
])])) : v("", !0)
|
|
1035
1035
|
]),
|
|
1036
|
-
e("span",
|
|
1036
|
+
e("span", Ol, n($.value.timestamp || "Just now"), 1)
|
|
1037
1037
|
])
|
|
1038
1038
|
]),
|
|
1039
|
-
e("div",
|
|
1039
|
+
e("div", Ul, [
|
|
1040
1040
|
e("p", {
|
|
1041
1041
|
class: "artifactuse-social-text",
|
|
1042
|
-
innerHTML:
|
|
1043
|
-
}, null, 8,
|
|
1042
|
+
innerHTML: N.value
|
|
1043
|
+
}, null, 8, Dl)
|
|
1044
1044
|
]),
|
|
1045
|
-
|
|
1046
|
-
e("div",
|
|
1045
|
+
V.value ? (a(), s("div", jl, [
|
|
1046
|
+
e("div", Nl, [
|
|
1047
1047
|
k[13] || (k[13] = e("svg", {
|
|
1048
1048
|
viewBox: "0 0 24 24",
|
|
1049
1049
|
fill: "none",
|
|
@@ -1052,9 +1052,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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,
|
|
1055
|
+
e("span", null, n(B(h.value.likes || 0)), 1)
|
|
1056
1056
|
]),
|
|
1057
|
-
e("div",
|
|
1057
|
+
e("div", Wl, [
|
|
1058
1058
|
k[14] || (k[14] = e("svg", {
|
|
1059
1059
|
viewBox: "0 0 24 24",
|
|
1060
1060
|
fill: "none",
|
|
@@ -1063,9 +1063,9 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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,
|
|
1066
|
+
e("span", null, n(B(h.value.comments || 0)), 1)
|
|
1067
1067
|
]),
|
|
1068
|
-
e("div",
|
|
1068
|
+
e("div", Jl, [
|
|
1069
1069
|
k[15] || (k[15] = e("svg", {
|
|
1070
1070
|
viewBox: "0 0 24 24",
|
|
1071
1071
|
fill: "none",
|
|
@@ -1074,17 +1074,17 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1074
1074
|
}, [
|
|
1075
1075
|
e("path", { d: "M7 17L17 7M17 7H8M17 7V16" })
|
|
1076
1076
|
], -1)),
|
|
1077
|
-
e("span", null,
|
|
1077
|
+
e("span", null, n(B(h.value.shares || 0)), 1)
|
|
1078
1078
|
])
|
|
1079
1079
|
])) : v("", !0)
|
|
1080
|
-
], 64)) :
|
|
1081
|
-
e("div",
|
|
1082
|
-
|
|
1080
|
+
], 64)) : A.value === "tiktok" ? (a(), s(F, { key: 5 }, [
|
|
1081
|
+
e("div", Xl, [
|
|
1082
|
+
o.value.thumbnail ? (a(), s("img", {
|
|
1083
1083
|
key: 0,
|
|
1084
|
-
src:
|
|
1085
|
-
alt:
|
|
1086
|
-
onError:
|
|
1087
|
-
}, null, 40,
|
|
1084
|
+
src: o.value.thumbnail,
|
|
1085
|
+
alt: o.value.text,
|
|
1086
|
+
onError: Z
|
|
1087
|
+
}, null, 40, Zl)) : v("", !0),
|
|
1088
1088
|
k[16] || (k[16] = e("div", { class: "artifactuse-social-play-button" }, [
|
|
1089
1089
|
e("div", { class: "artifactuse-social-play-icon" }, [
|
|
1090
1090
|
e("svg", {
|
|
@@ -1095,69 +1095,69 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1095
1095
|
])
|
|
1096
1096
|
])
|
|
1097
1097
|
], -1)),
|
|
1098
|
-
|
|
1098
|
+
o.value.duration ? (a(), s("div", Kl, n(o.value.duration), 1)) : v("", !0)
|
|
1099
1099
|
]),
|
|
1100
|
-
e("div",
|
|
1101
|
-
e("div",
|
|
1100
|
+
e("div", Yl, [
|
|
1101
|
+
e("div", Ql, [
|
|
1102
1102
|
e("img", {
|
|
1103
|
-
src: g.value.avatar ||
|
|
1103
|
+
src: g.value.avatar || he,
|
|
1104
1104
|
alt: g.value.name,
|
|
1105
1105
|
class: "artifactuse-social-avatar",
|
|
1106
|
-
onError:
|
|
1107
|
-
}, null, 40,
|
|
1108
|
-
e("span",
|
|
1106
|
+
onError: K
|
|
1107
|
+
}, null, 40, Gl),
|
|
1108
|
+
e("span", ei, n(g.value.name), 1)
|
|
1109
1109
|
]),
|
|
1110
1110
|
e("p", {
|
|
1111
1111
|
class: "artifactuse-social-text",
|
|
1112
|
-
innerHTML:
|
|
1113
|
-
}, null, 8,
|
|
1114
|
-
|
|
1112
|
+
innerHTML: N.value
|
|
1113
|
+
}, null, 8, ti),
|
|
1114
|
+
o.value.sound ? (a(), s("div", ai, [
|
|
1115
1115
|
k[17] || (k[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
|
-
|
|
1121
|
+
Y(" " + n(o.value.sound), 1)
|
|
1122
1122
|
])) : v("", !0),
|
|
1123
|
-
|
|
1124
|
-
e("span", null,
|
|
1125
|
-
e("span", null,
|
|
1126
|
-
e("span", null,
|
|
1123
|
+
V.value ? (a(), s("div", si, [
|
|
1124
|
+
e("span", null, n(B(h.value.likes || 0)) + " likes", 1),
|
|
1125
|
+
e("span", null, n(B(h.value.comments || 0)) + " comments", 1),
|
|
1126
|
+
e("span", null, n(B(h.value.shares || 0)) + " shares", 1)
|
|
1127
1127
|
])) : v("", !0)
|
|
1128
1128
|
])
|
|
1129
|
-
], 64)) :
|
|
1130
|
-
e("div",
|
|
1131
|
-
|
|
1129
|
+
], 64)) : A.value === "youtube" ? (a(), s(F, { key: 6 }, [
|
|
1130
|
+
e("div", li, [
|
|
1131
|
+
o.value.thumbnail ? (a(), s("img", {
|
|
1132
1132
|
key: 0,
|
|
1133
|
-
src:
|
|
1134
|
-
alt:
|
|
1135
|
-
onError:
|
|
1136
|
-
}, null, 40,
|
|
1137
|
-
|
|
1133
|
+
src: o.value.thumbnail,
|
|
1134
|
+
alt: o.value.title,
|
|
1135
|
+
onError: Z
|
|
1136
|
+
}, null, 40, ii)) : v("", !0),
|
|
1137
|
+
o.value.duration ? (a(), s("div", ni, n(o.value.duration), 1)) : v("", !0)
|
|
1138
1138
|
]),
|
|
1139
|
-
e("div",
|
|
1139
|
+
e("div", oi, [
|
|
1140
1140
|
e("img", {
|
|
1141
|
-
src: g.value.avatar ||
|
|
1141
|
+
src: g.value.avatar || he,
|
|
1142
1142
|
alt: g.value.name,
|
|
1143
1143
|
class: "artifactuse-social-avatar",
|
|
1144
|
-
onError:
|
|
1145
|
-
}, null, 40,
|
|
1144
|
+
onError: K
|
|
1145
|
+
}, null, 40, ri),
|
|
1146
1146
|
e("div", null, [
|
|
1147
|
-
e("div",
|
|
1148
|
-
e("div",
|
|
1149
|
-
e("div",
|
|
1147
|
+
e("div", ci, n(o.value.title || o.value.text), 1),
|
|
1148
|
+
e("div", ui, n(g.value.name), 1),
|
|
1149
|
+
e("div", di, n(B(h.value.views || 0)) + " views · " + n($.value.timestamp || "Just now"), 1)
|
|
1150
1150
|
])
|
|
1151
1151
|
])
|
|
1152
1152
|
], 64)) : v("", !0),
|
|
1153
|
-
e("div",
|
|
1154
|
-
e("div",
|
|
1155
|
-
(a(),
|
|
1156
|
-
e("span", null,
|
|
1153
|
+
e("div", vi, [
|
|
1154
|
+
e("div", fi, [
|
|
1155
|
+
(a(), Me(ta(U.value))),
|
|
1156
|
+
e("span", null, n(D.value), 1)
|
|
1157
1157
|
]),
|
|
1158
1158
|
e("button", {
|
|
1159
1159
|
class: "artifactuse-social-copy-btn",
|
|
1160
|
-
onClick:
|
|
1160
|
+
onClick: ve
|
|
1161
1161
|
}, [
|
|
1162
1162
|
k[18] || (k[18] = e("svg", {
|
|
1163
1163
|
viewBox: "0 0 24 24",
|
|
@@ -1175,31 +1175,31 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { 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
|
-
|
|
1178
|
+
Y(" " + n(r.value), 1)
|
|
1179
1179
|
])
|
|
1180
1180
|
])
|
|
1181
|
-
], 10,
|
|
1181
|
+
], 10, vs);
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
|
-
},
|
|
1184
|
+
}, _i = ["src", "alt"], hi = ["src"], mi = {
|
|
1185
1185
|
key: 2,
|
|
1186
1186
|
class: "artifactuse-viewer-controls"
|
|
1187
|
-
},
|
|
1187
|
+
}, yi = ["title"], gi = {
|
|
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
|
-
},
|
|
1193
|
+
}, ki = {
|
|
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
|
-
},
|
|
1199
|
+
}, wi = {
|
|
1200
1200
|
key: 3,
|
|
1201
1201
|
class: "artifactuse-viewer-caption"
|
|
1202
|
-
},
|
|
1202
|
+
}, bi = {
|
|
1203
1203
|
__name: "ArtifactuseViewer",
|
|
1204
1204
|
props: {
|
|
1205
1205
|
// Whether the viewer is open
|
|
@@ -1229,58 +1229,58 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1229
1229
|
}
|
|
1230
1230
|
},
|
|
1231
1231
|
emits: ["close"],
|
|
1232
|
-
setup(
|
|
1233
|
-
const _ =
|
|
1232
|
+
setup(P, { emit: c }) {
|
|
1233
|
+
const _ = P, T = c, p = M(null), r = M(!1);
|
|
1234
1234
|
function q() {
|
|
1235
|
-
|
|
1235
|
+
r.value = !1, T("close");
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1238
|
-
_.type === "image" && (
|
|
1237
|
+
function A() {
|
|
1238
|
+
_.type === "image" && (r.value = !r.value);
|
|
1239
1239
|
}
|
|
1240
1240
|
function g() {
|
|
1241
1241
|
const h = document.createElement("a");
|
|
1242
1242
|
h.href = _.src, h.download = _.alt || "download", document.body.appendChild(h), h.click(), document.body.removeChild(h);
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function o(h) {
|
|
1245
1245
|
h.key === "Escape" && _.isOpen && q();
|
|
1246
1246
|
}
|
|
1247
|
-
return
|
|
1248
|
-
h ? (
|
|
1247
|
+
return oe(() => _.isOpen, (h) => {
|
|
1248
|
+
h ? (ke(() => {
|
|
1249
1249
|
var $;
|
|
1250
|
-
($ =
|
|
1251
|
-
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "",
|
|
1252
|
-
}),
|
|
1253
|
-
document.addEventListener("keydown",
|
|
1254
|
-
}),
|
|
1255
|
-
document.removeEventListener("keydown",
|
|
1256
|
-
}), (h, $) => (a(),
|
|
1257
|
-
ze
|
|
1258
|
-
default:
|
|
1259
|
-
|
|
1250
|
+
($ = p.value) == null || $.focus();
|
|
1251
|
+
}), document.body.style.overflow = "hidden") : (document.body.style.overflow = "", r.value = !1);
|
|
1252
|
+
}), Te(() => {
|
|
1253
|
+
document.addEventListener("keydown", o);
|
|
1254
|
+
}), Ye(() => {
|
|
1255
|
+
document.removeEventListener("keydown", o), document.body.style.overflow = "";
|
|
1256
|
+
}), (h, $) => (a(), Me(aa, { to: "body" }, [
|
|
1257
|
+
Fe(ze, { name: "artifactuse-viewer" }, {
|
|
1258
|
+
default: Ve(() => [
|
|
1259
|
+
P.isOpen ? (a(), s("div", {
|
|
1260
1260
|
key: 0,
|
|
1261
1261
|
class: "artifactuse-viewer-overlay",
|
|
1262
1262
|
onClick: q,
|
|
1263
|
-
onKeydown:
|
|
1263
|
+
onKeydown: sa(q, ["escape"]),
|
|
1264
1264
|
tabindex: "-1",
|
|
1265
1265
|
ref_key: "overlayRef",
|
|
1266
|
-
ref:
|
|
1266
|
+
ref: p
|
|
1267
1267
|
}, [
|
|
1268
1268
|
e("div", {
|
|
1269
1269
|
class: "artifactuse-viewer-content",
|
|
1270
|
-
onClick: $[0] || ($[0] =
|
|
1270
|
+
onClick: $[0] || ($[0] = _e(() => {
|
|
1271
1271
|
}, ["stop"]))
|
|
1272
1272
|
}, [
|
|
1273
|
-
|
|
1273
|
+
P.type === "image" ? (a(), s("img", {
|
|
1274
1274
|
key: 0,
|
|
1275
|
-
src:
|
|
1276
|
-
alt:
|
|
1277
|
-
class:
|
|
1278
|
-
onClick:
|
|
1279
|
-
}, null, 10,
|
|
1275
|
+
src: P.src,
|
|
1276
|
+
alt: P.alt,
|
|
1277
|
+
class: I(["artifactuse-viewer-image", { "artifactuse-viewer-image--zoomed": r.value }]),
|
|
1278
|
+
onClick: A
|
|
1279
|
+
}, null, 10, _i)) : P.type === "pdf" ? (a(), s("iframe", {
|
|
1280
1280
|
key: 1,
|
|
1281
|
-
src:
|
|
1281
|
+
src: P.src,
|
|
1282
1282
|
class: "artifactuse-viewer-pdf"
|
|
1283
|
-
}, null, 8,
|
|
1283
|
+
}, null, 8, hi)) : v("", !0),
|
|
1284
1284
|
e("button", {
|
|
1285
1285
|
class: "artifactuse-viewer-close",
|
|
1286
1286
|
onClick: q,
|
|
@@ -1306,13 +1306,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1306
1306
|
})
|
|
1307
1307
|
], -1)
|
|
1308
1308
|
])]),
|
|
1309
|
-
|
|
1309
|
+
P.type === "image" ? (a(), s("div", mi, [
|
|
1310
1310
|
e("button", {
|
|
1311
1311
|
class: "artifactuse-viewer-control",
|
|
1312
|
-
onClick:
|
|
1313
|
-
title:
|
|
1312
|
+
onClick: _e(A, ["stop"]),
|
|
1313
|
+
title: r.value ? "Zoom out" : "Zoom in"
|
|
1314
1314
|
}, [
|
|
1315
|
-
|
|
1315
|
+
r.value ? (a(), s("svg", ki, [...$[3] || ($[3] = [
|
|
1316
1316
|
e("circle", {
|
|
1317
1317
|
cx: "11",
|
|
1318
1318
|
cy: "11",
|
|
@@ -1330,7 +1330,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1330
1330
|
x2: "14",
|
|
1331
1331
|
y2: "11"
|
|
1332
1332
|
}, null, -1)
|
|
1333
|
-
])])) : (a(), s("svg",
|
|
1333
|
+
])])) : (a(), s("svg", gi, [...$[2] || ($[2] = [
|
|
1334
1334
|
e("circle", {
|
|
1335
1335
|
cx: "11",
|
|
1336
1336
|
cy: "11",
|
|
@@ -1355,10 +1355,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1355
1355
|
y2: "11"
|
|
1356
1356
|
}, null, -1)
|
|
1357
1357
|
])]))
|
|
1358
|
-
], 8,
|
|
1358
|
+
], 8, yi),
|
|
1359
1359
|
e("button", {
|
|
1360
1360
|
class: "artifactuse-viewer-control",
|
|
1361
|
-
onClick:
|
|
1361
|
+
onClick: _e(g, ["stop"]),
|
|
1362
1362
|
title: "Download"
|
|
1363
1363
|
}, [...$[4] || ($[4] = [
|
|
1364
1364
|
e("svg", {
|
|
@@ -1378,7 +1378,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1378
1378
|
], -1)
|
|
1379
1379
|
])])
|
|
1380
1380
|
])) : v("", !0),
|
|
1381
|
-
|
|
1381
|
+
P.caption ? (a(), s("div", wi, n(P.caption), 1)) : v("", !0)
|
|
1382
1382
|
])
|
|
1383
1383
|
], 544)) : v("", !0)
|
|
1384
1384
|
]),
|
|
@@ -1386,7 +1386,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1386
1386
|
})
|
|
1387
1387
|
]));
|
|
1388
1388
|
}
|
|
1389
|
-
},
|
|
1389
|
+
}, Ci = ["innerHTML"], Mo = {
|
|
1390
1390
|
__name: "ArtifactuseAgentMessage",
|
|
1391
1391
|
props: {
|
|
1392
1392
|
// The raw message content (markdown/HTML from AI)
|
|
@@ -1447,211 +1447,211 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1447
1447
|
"social-copy",
|
|
1448
1448
|
"media-open"
|
|
1449
1449
|
],
|
|
1450
|
-
setup(
|
|
1451
|
-
const
|
|
1452
|
-
processMessage:
|
|
1450
|
+
setup(P, { expose: c, emit: _ }) {
|
|
1451
|
+
const T = P, p = _, {
|
|
1452
|
+
processMessage: r,
|
|
1453
1453
|
openArtifact: q,
|
|
1454
|
-
state:
|
|
1454
|
+
state: A,
|
|
1455
1455
|
getTheme: g,
|
|
1456
|
-
instance:
|
|
1457
|
-
} =
|
|
1458
|
-
let
|
|
1459
|
-
const
|
|
1460
|
-
var
|
|
1461
|
-
return
|
|
1462
|
-
}), m =
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
}),
|
|
1466
|
-
|
|
1456
|
+
instance: o
|
|
1457
|
+
} = Re(), h = M(null), $ = M(null), V = M(""), x = M([]);
|
|
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(() => {
|
|
1460
|
+
var C;
|
|
1461
|
+
return T.inlineCards ?? ((C = o == null ? void 0 : o.config) == null ? void 0 : C.inlineCards) ?? !0;
|
|
1462
|
+
}), m = M(!1);
|
|
1463
|
+
Te(() => {
|
|
1464
|
+
T.typing && (m.value = !0);
|
|
1465
|
+
}), oe(() => T.typing, (C) => {
|
|
1466
|
+
C && (m.value = !0);
|
|
1467
1467
|
});
|
|
1468
|
-
const k =
|
|
1469
|
-
function
|
|
1470
|
-
if (!
|
|
1468
|
+
const k = b(() => m.value || T.isLastMessage ? "active" : "inactive");
|
|
1469
|
+
function ae(C) {
|
|
1470
|
+
if (!C) return null;
|
|
1471
1471
|
try {
|
|
1472
|
-
const
|
|
1473
|
-
return JSON.parse(
|
|
1472
|
+
const R = decodeURIComponent(escape(atob(C)));
|
|
1473
|
+
return JSON.parse(R);
|
|
1474
1474
|
} catch {
|
|
1475
1475
|
try {
|
|
1476
|
-
const
|
|
1476
|
+
const O = C.replace(/ /g, `
|
|
1477
1477
|
`).replace(/ /g, "\r").replace(/	/g, " ").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
1478
|
-
return JSON.parse(
|
|
1479
|
-
} catch (
|
|
1480
|
-
return console.error("Failed to parse artifact data:",
|
|
1478
|
+
return JSON.parse(O);
|
|
1479
|
+
} catch (O) {
|
|
1480
|
+
return console.error("Failed to parse artifact data:", O), null;
|
|
1481
1481
|
}
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
|
-
const
|
|
1485
|
-
const
|
|
1486
|
-
if (!
|
|
1487
|
-
const
|
|
1488
|
-
let
|
|
1489
|
-
for (; (
|
|
1490
|
-
if (
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1484
|
+
const Q = b(() => {
|
|
1485
|
+
const C = [], R = V.value;
|
|
1486
|
+
if (!R) return C;
|
|
1487
|
+
const O = /<div\s+class="artifactuse-placeholder[^"]*"[^>]*data-artifact-id="([^"]+)"[^>]*data-artifact-type="([^"]+)"[^>]*data-artifact=["']([^"']*)["'][^>]*><\/div>/gi;
|
|
1488
|
+
let J = 0, S;
|
|
1489
|
+
for (; (S = O.exec(R)) !== null; ) {
|
|
1490
|
+
if (S.index > J) {
|
|
1491
|
+
const j = R.slice(J, S.index);
|
|
1492
|
+
j.trim() && C.push({ type: "html", content: j });
|
|
1493
1493
|
}
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1494
|
+
const te = ae(S[3]), f = S[2];
|
|
1495
|
+
te && (f === "form" && te.isInline ? C.push({ type: "form", artifact: te }) : f === "social" ? C.push({ type: "social", artifact: te }) : C.push({ type: "panel", artifact: te })), J = S.index + S[0].length;
|
|
1496
1496
|
}
|
|
1497
|
-
if (
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1497
|
+
if (J < R.length) {
|
|
1498
|
+
const te = R.slice(J);
|
|
1499
|
+
te.trim() && C.push({ type: "html", content: te });
|
|
1500
1500
|
}
|
|
1501
|
-
return
|
|
1501
|
+
return C.length === 0 && R.trim() && C.push({ type: "html", content: R }), C;
|
|
1502
1502
|
});
|
|
1503
|
-
function
|
|
1504
|
-
|
|
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);
|
|
1505
1505
|
}
|
|
1506
|
-
function
|
|
1507
|
-
|
|
1506
|
+
function ie() {
|
|
1507
|
+
U.value = !1, ee.value = "", B.value = "", re.value = "";
|
|
1508
1508
|
}
|
|
1509
1509
|
function w() {
|
|
1510
1510
|
if (!$.value) return;
|
|
1511
|
-
$.value.querySelectorAll('img[data-lightbox="true"]').forEach((
|
|
1512
|
-
|
|
1513
|
-
|
|
1511
|
+
$.value.querySelectorAll('img[data-lightbox="true"]').forEach((f) => {
|
|
1512
|
+
f._lightboxHandler && f.removeEventListener("click", f._lightboxHandler), f._lightboxHandler = (j) => {
|
|
1513
|
+
j.preventDefault(), j.stopPropagation(), W({
|
|
1514
1514
|
type: "image",
|
|
1515
|
-
src:
|
|
1516
|
-
alt:
|
|
1517
|
-
caption:
|
|
1515
|
+
src: f.src,
|
|
1516
|
+
alt: f.alt || "",
|
|
1517
|
+
caption: f.dataset.caption || f.alt || ""
|
|
1518
1518
|
});
|
|
1519
|
-
},
|
|
1520
|
-
}), $.value.querySelectorAll(".artifactuse-image-container img").forEach((
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1519
|
+
}, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in";
|
|
1520
|
+
}), $.value.querySelectorAll(".artifactuse-image-container img").forEach((f) => {
|
|
1521
|
+
f._lightboxHandler || (f._lightboxHandler = (j) => {
|
|
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 || "";
|
|
1524
|
+
W({
|
|
1525
1525
|
type: "image",
|
|
1526
|
-
src:
|
|
1527
|
-
alt:
|
|
1528
|
-
caption:
|
|
1526
|
+
src: f.src,
|
|
1527
|
+
alt: f.alt || "",
|
|
1528
|
+
caption: me
|
|
1529
1529
|
});
|
|
1530
|
-
},
|
|
1531
|
-
}), $.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1530
|
+
}, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
|
|
1531
|
+
}), $.value.querySelectorAll(".artifactuse-gallery-item img, .artifactuse-image-gallery img").forEach((f) => {
|
|
1532
|
+
f._lightboxHandler || (f._lightboxHandler = (j) => {
|
|
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 || "";
|
|
1535
|
+
W({
|
|
1536
1536
|
type: "image",
|
|
1537
|
-
src:
|
|
1538
|
-
alt:
|
|
1539
|
-
caption:
|
|
1537
|
+
src: f.src,
|
|
1538
|
+
alt: f.alt || "",
|
|
1539
|
+
caption: me
|
|
1540
1540
|
});
|
|
1541
|
-
},
|
|
1542
|
-
}), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((
|
|
1543
|
-
|
|
1544
|
-
|
|
1541
|
+
}, f.addEventListener("click", f._lightboxHandler), f.style.cursor = "zoom-in");
|
|
1542
|
+
}), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((f) => {
|
|
1543
|
+
f._pdfHandler && f.removeEventListener("click", f._pdfHandler), f._pdfHandler = (j) => {
|
|
1544
|
+
j.preventDefault(), j.stopPropagation(), W({
|
|
1545
1545
|
type: "pdf",
|
|
1546
|
-
src:
|
|
1547
|
-
alt:
|
|
1548
|
-
caption:
|
|
1546
|
+
src: f.href,
|
|
1547
|
+
alt: f.textContent || "PDF Document",
|
|
1548
|
+
caption: f.title || f.textContent || ""
|
|
1549
1549
|
});
|
|
1550
|
-
},
|
|
1551
|
-
}), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((
|
|
1552
|
-
var
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
|
|
1550
|
+
}, f.addEventListener("click", f._pdfHandler);
|
|
1551
|
+
}), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((f) => {
|
|
1552
|
+
var le;
|
|
1553
|
+
f._pdfHandler && f.removeEventListener("click", f._pdfHandler);
|
|
1554
|
+
const j = f.dataset.pdfSrc || ((le = f.querySelector("iframe")) == null ? void 0 : le.src) || "";
|
|
1555
|
+
j && (f._pdfHandler = (G) => {
|
|
1556
|
+
G.preventDefault(), G.stopPropagation(), W({
|
|
1557
1557
|
type: "pdf",
|
|
1558
|
-
src:
|
|
1558
|
+
src: j,
|
|
1559
1559
|
alt: "PDF Document",
|
|
1560
|
-
caption:
|
|
1560
|
+
caption: f.dataset.caption || ""
|
|
1561
1561
|
});
|
|
1562
|
-
},
|
|
1563
|
-
}), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((
|
|
1564
|
-
|
|
1565
|
-
if (
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1568
|
-
},
|
|
1562
|
+
}, f.addEventListener("click", f._pdfHandler), f.style.cursor = "pointer");
|
|
1563
|
+
}), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((f) => {
|
|
1564
|
+
f._clickHandler && f.removeEventListener("click", f._clickHandler), f._clickHandler = (j) => {
|
|
1565
|
+
if (j.target.closest(".artifactuse-video-play-button")) return;
|
|
1566
|
+
const le = f.dataset.videoUrl || f.dataset.url;
|
|
1567
|
+
le && window.open(le, "_blank", "noopener,noreferrer");
|
|
1568
|
+
}, f.addEventListener("click", f._clickHandler);
|
|
1569
1569
|
});
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1571
|
+
function E() {
|
|
1572
1572
|
if (!$.value) return;
|
|
1573
|
-
$.value.querySelectorAll("img").forEach((
|
|
1574
|
-
|
|
1575
|
-
}), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((
|
|
1576
|
-
|
|
1577
|
-
}), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((
|
|
1578
|
-
|
|
1579
|
-
}), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((
|
|
1580
|
-
|
|
1573
|
+
$.value.querySelectorAll("img").forEach((S) => {
|
|
1574
|
+
S._lightboxHandler && (S.removeEventListener("click", S._lightboxHandler), delete S._lightboxHandler);
|
|
1575
|
+
}), $.value.querySelectorAll('a[href$=".pdf"], a[data-type="pdf"]').forEach((S) => {
|
|
1576
|
+
S._pdfHandler && (S.removeEventListener("click", S._pdfHandler), delete S._pdfHandler);
|
|
1577
|
+
}), $.value.querySelectorAll(".artifactuse-pdf-container, [data-pdf-viewer]").forEach((S) => {
|
|
1578
|
+
S._pdfHandler && (S.removeEventListener("click", S._pdfHandler), delete S._pdfHandler);
|
|
1579
|
+
}), $.value.querySelectorAll(".artifactuse-video-preview-wrapper, .video-preview-wrapper").forEach((S) => {
|
|
1580
|
+
S._clickHandler && (S.removeEventListener("click", S._clickHandler), delete S._clickHandler);
|
|
1581
1581
|
});
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1584
|
-
|
|
1585
|
-
if (await
|
|
1583
|
+
function i() {
|
|
1584
|
+
D && clearTimeout(D), D = setTimeout(async () => {
|
|
1585
|
+
if (await ke(), o != null && o.initializeContent && $.value)
|
|
1586
1586
|
try {
|
|
1587
|
-
await
|
|
1588
|
-
} catch (
|
|
1589
|
-
console.error("Failed to initialize content:",
|
|
1587
|
+
await o.initializeContent($.value);
|
|
1588
|
+
} catch (C) {
|
|
1589
|
+
console.error("Failed to initialize content:", C);
|
|
1590
1590
|
}
|
|
1591
1591
|
w();
|
|
1592
1592
|
}, 100);
|
|
1593
1593
|
}
|
|
1594
|
-
|
|
1595
|
-
() =>
|
|
1596
|
-
(
|
|
1597
|
-
if (
|
|
1598
|
-
const
|
|
1599
|
-
inlinePreview:
|
|
1600
|
-
inlineCode:
|
|
1601
|
-
tabs:
|
|
1602
|
-
viewMode:
|
|
1594
|
+
oe(
|
|
1595
|
+
() => T.content,
|
|
1596
|
+
(C) => {
|
|
1597
|
+
if (C) {
|
|
1598
|
+
const R = r(C, T.messageId, {
|
|
1599
|
+
inlinePreview: T.inlinePreview,
|
|
1600
|
+
inlineCode: T.inlineCode,
|
|
1601
|
+
tabs: T.tabs,
|
|
1602
|
+
viewMode: T.viewMode
|
|
1603
1603
|
});
|
|
1604
|
-
|
|
1604
|
+
V.value = R.html, x.value = R.artifacts, R.artifacts.length > 0 && p("artifact-detected", R.artifacts), T.typing || i();
|
|
1605
1605
|
}
|
|
1606
1606
|
},
|
|
1607
1607
|
{ immediate: !0 }
|
|
1608
|
-
),
|
|
1609
|
-
() =>
|
|
1610
|
-
(
|
|
1611
|
-
|
|
1608
|
+
), oe(
|
|
1609
|
+
() => T.typing,
|
|
1610
|
+
(C, R) => {
|
|
1611
|
+
R === !0 && C === !1 && i();
|
|
1612
1612
|
}
|
|
1613
|
-
),
|
|
1614
|
-
|
|
1615
|
-
}),
|
|
1616
|
-
|
|
1613
|
+
), Te(() => {
|
|
1614
|
+
T.typing || i();
|
|
1615
|
+
}), la(() => {
|
|
1616
|
+
D && clearTimeout(D), E();
|
|
1617
1617
|
});
|
|
1618
|
-
function
|
|
1619
|
-
const
|
|
1620
|
-
if (
|
|
1621
|
-
if (
|
|
1622
|
-
const
|
|
1623
|
-
if (
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1618
|
+
function H(C) {
|
|
1619
|
+
const R = C.target.closest(".artifactuse-inline-preview");
|
|
1620
|
+
if (R) {
|
|
1621
|
+
if (R.dataset.nonClickable) return;
|
|
1622
|
+
const O = R.dataset.artifactId;
|
|
1623
|
+
if (O) {
|
|
1624
|
+
const J = A.artifacts.find((S) => S.id === O);
|
|
1625
|
+
J && d(J);
|
|
1626
1626
|
}
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
q(
|
|
1629
|
+
function d(C) {
|
|
1630
|
+
q(C), p("artifact-open", C);
|
|
1631
1631
|
}
|
|
1632
|
-
function
|
|
1633
|
-
|
|
1632
|
+
function L(C) {
|
|
1633
|
+
p("artifact-copy", C);
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1636
|
-
|
|
1635
|
+
function se(C) {
|
|
1636
|
+
p("artifact-download", C);
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1639
|
-
|
|
1638
|
+
function ce(C) {
|
|
1639
|
+
p("form-submit", C);
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1642
|
-
|
|
1641
|
+
function we(C) {
|
|
1642
|
+
p("form-cancel", C);
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1645
|
-
|
|
1644
|
+
function be(C) {
|
|
1645
|
+
p("form-button-click", C);
|
|
1646
1646
|
}
|
|
1647
|
-
function
|
|
1648
|
-
|
|
1647
|
+
function Le(C) {
|
|
1648
|
+
p("social-copy", C);
|
|
1649
1649
|
}
|
|
1650
|
-
return
|
|
1651
|
-
openViewer:
|
|
1652
|
-
closeViewer:
|
|
1650
|
+
return b(() => A.artifacts.filter((C) => C.messageId === T.messageId)), c({
|
|
1651
|
+
openViewer: W,
|
|
1652
|
+
closeViewer: ie,
|
|
1653
1653
|
attachMediaListeners: w
|
|
1654
|
-
}), (
|
|
1654
|
+
}), (C, R) => (a(), s("div", {
|
|
1655
1655
|
class: "artifactuse-agent-message",
|
|
1656
1656
|
ref_key: "messageRef",
|
|
1657
1657
|
ref: h
|
|
@@ -1660,566 +1660,586 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
1660
1660
|
class: "artifactuse-message-content",
|
|
1661
1661
|
ref_key: "contentRef",
|
|
1662
1662
|
ref: $,
|
|
1663
|
-
onClick:
|
|
1663
|
+
onClick: H
|
|
1664
1664
|
}, [
|
|
1665
|
-
(a(!0), s(
|
|
1666
|
-
|
|
1665
|
+
(a(!0), s(F, null, de(Q.value, (O, J) => (a(), s(F, { key: J }, [
|
|
1666
|
+
O.type === "html" ? (a(), s("div", {
|
|
1667
1667
|
key: 0,
|
|
1668
|
-
innerHTML:
|
|
1669
|
-
}, null, 8,
|
|
1668
|
+
innerHTML: O.content
|
|
1669
|
+
}, null, 8, Ci)) : O.type === "form" && O.artifact.isInline ? (a(), Me(ds, {
|
|
1670
1670
|
key: 1,
|
|
1671
|
-
artifact:
|
|
1672
|
-
theme:
|
|
1671
|
+
artifact: O.artifact,
|
|
1672
|
+
theme: K.value,
|
|
1673
1673
|
"initial-state": k.value,
|
|
1674
|
-
onSubmit:
|
|
1675
|
-
onCancel:
|
|
1676
|
-
onButtonClick:
|
|
1677
|
-
}, null, 8, ["artifact", "theme", "initial-state"])) :
|
|
1674
|
+
onSubmit: ce,
|
|
1675
|
+
onCancel: we,
|
|
1676
|
+
onButtonClick: be
|
|
1677
|
+
}, null, 8, ["artifact", "theme", "initial-state"])) : O.type === "social" ? (a(), Me(pi, {
|
|
1678
1678
|
key: 2,
|
|
1679
|
-
artifact:
|
|
1680
|
-
theme:
|
|
1681
|
-
onCopy:
|
|
1682
|
-
}, null, 8, ["artifact", "theme"])) :
|
|
1679
|
+
artifact: O.artifact,
|
|
1680
|
+
theme: K.value,
|
|
1681
|
+
onCopy: Le
|
|
1682
|
+
}, null, 8, ["artifact", "theme"])) : O.type === "panel" && ve.value ? (a(), Me(ba, {
|
|
1683
1683
|
key: 3,
|
|
1684
|
-
artifact:
|
|
1685
|
-
"is-active":
|
|
1686
|
-
onOpen:
|
|
1687
|
-
onCopy:
|
|
1688
|
-
onDownload:
|
|
1684
|
+
artifact: O.artifact,
|
|
1685
|
+
"is-active": Z.value === O.artifact.id,
|
|
1686
|
+
onOpen: d,
|
|
1687
|
+
onCopy: L,
|
|
1688
|
+
onDownload: se
|
|
1689
1689
|
}, null, 8, ["artifact", "is-active"])) : v("", !0)
|
|
1690
1690
|
], 64))), 128))
|
|
1691
1691
|
], 512),
|
|
1692
|
-
|
|
1693
|
-
"is-open":
|
|
1694
|
-
type:
|
|
1695
|
-
src:
|
|
1696
|
-
alt:
|
|
1697
|
-
caption:
|
|
1698
|
-
onClose:
|
|
1692
|
+
Fe(bi, {
|
|
1693
|
+
"is-open": U.value,
|
|
1694
|
+
type: N.value,
|
|
1695
|
+
src: ee.value,
|
|
1696
|
+
alt: B.value,
|
|
1697
|
+
caption: re.value,
|
|
1698
|
+
onClose: ie
|
|
1699
1699
|
}, null, 8, ["is-open", "type", "src", "alt", "caption"])
|
|
1700
1700
|
], 512));
|
|
1701
1701
|
}
|
|
1702
|
-
},
|
|
1702
|
+
}, xi = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, $i = { class: "artifactuse-panel__title" }, Mi = { class: "artifactuse-panel__icon" }, Ti = {
|
|
1703
1703
|
key: 0,
|
|
1704
1704
|
viewBox: "0 0 24 24",
|
|
1705
1705
|
fill: "none",
|
|
1706
1706
|
stroke: "currentColor",
|
|
1707
1707
|
"stroke-width": "2"
|
|
1708
|
-
},
|
|
1708
|
+
}, Li = {
|
|
1709
1709
|
key: 1,
|
|
1710
1710
|
viewBox: "0 0 24 24",
|
|
1711
1711
|
fill: "none",
|
|
1712
1712
|
stroke: "currentColor",
|
|
1713
1713
|
"stroke-width": "2"
|
|
1714
|
-
},
|
|
1714
|
+
}, Pi = { class: "artifactuse-panel__title-content" }, Ei = { class: "artifactuse-panel__name" }, Ai = { class: "artifactuse-panel__actions" }, Hi = { class: "artifactuse-panel__empty" }, Bi = { class: "artifactuse-panel__empty-title" }, Si = { class: "artifactuse-panel__empty-text" }, zi = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Vi = {
|
|
1715
1715
|
key: 0,
|
|
1716
1716
|
href: "https://artifactuse.com",
|
|
1717
1717
|
target: "_blank",
|
|
1718
1718
|
rel: "noopener noreferrer",
|
|
1719
1719
|
class: "artifactuse-panel__branding"
|
|
1720
|
-
},
|
|
1720
|
+
}, Ii = { class: "artifactuse-panel__header artifactuse-panel__header--simple" }, Fi = { class: "artifactuse-panel__title" }, Ri = { class: "artifactuse-panel__title-content" }, qi = { class: "artifactuse-panel__meta" }, Oi = { class: "artifactuse-panel__actions" }, Ui = ["disabled"], Di = {
|
|
1721
1721
|
key: 0,
|
|
1722
1722
|
viewBox: "0 0 24 24",
|
|
1723
1723
|
fill: "none",
|
|
1724
1724
|
stroke: "currentColor",
|
|
1725
1725
|
"stroke-width": "2"
|
|
1726
|
-
},
|
|
1726
|
+
}, ji = {
|
|
1727
1727
|
key: 1,
|
|
1728
1728
|
class: "artifactuse-panel__spinner-icon",
|
|
1729
1729
|
viewBox: "0 0 24 24",
|
|
1730
1730
|
fill: "none",
|
|
1731
1731
|
stroke: "currentColor",
|
|
1732
1732
|
"stroke-width": "2"
|
|
1733
|
-
},
|
|
1733
|
+
}, Ni = { class: "artifactuse-panel__list" }, Wi = { class: "artifactuse-panel__list-items" }, Ji = ["onClick"], Xi = ["innerHTML"], Zi = { class: "artifactuse-panel__list-item-content" }, Ki = { class: "artifactuse-panel__list-item-title" }, Yi = { class: "artifactuse-panel__list-item-meta" }, Qi = { class: "artifactuse-panel__footer artifactuse-panel__footer--simple" }, Gi = {
|
|
1734
1734
|
key: 0,
|
|
1735
1735
|
href: "https://artifactuse.com",
|
|
1736
1736
|
target: "_blank",
|
|
1737
1737
|
rel: "noopener noreferrer",
|
|
1738
1738
|
class: "artifactuse-panel__branding"
|
|
1739
|
-
},
|
|
1739
|
+
}, en = { class: "artifactuse-panel__header" }, tn = ["title"], an = { class: "artifactuse-panel__title" }, sn = ["innerHTML"], ln = { class: "artifactuse-panel__title-content" }, nn = { class: "artifactuse-panel__name" }, on = { class: "artifactuse-panel__meta" }, rn = { class: "artifactuse-panel__tabs" }, cn = ["disabled"], un = ["disabled"], dn = { class: "artifactuse-panel__actions" }, vn = ["title"], fn = {
|
|
1740
1740
|
key: 0,
|
|
1741
1741
|
viewBox: "0 0 24 24",
|
|
1742
1742
|
fill: "none",
|
|
1743
1743
|
stroke: "currentColor",
|
|
1744
1744
|
"stroke-width": "2"
|
|
1745
|
-
},
|
|
1745
|
+
}, pn = {
|
|
1746
1746
|
key: 1,
|
|
1747
1747
|
viewBox: "0 0 24 24",
|
|
1748
1748
|
fill: "none",
|
|
1749
1749
|
stroke: "currentColor",
|
|
1750
1750
|
"stroke-width": "2"
|
|
1751
|
-
},
|
|
1751
|
+
}, _n = {
|
|
1752
1752
|
key: 0,
|
|
1753
1753
|
class: "artifactuse-panel__file-tabs"
|
|
1754
|
-
},
|
|
1754
|
+
}, hn = { class: "artifactuse-panel__file-tabs-scroll" }, mn = ["onClick"], yn = ["innerHTML"], gn = { class: "artifactuse-panel__file-tab-title" }, kn = ["onClick"], wn = {
|
|
1755
1755
|
key: 0,
|
|
1756
1756
|
class: "artifactuse-panel__loading"
|
|
1757
|
-
},
|
|
1757
|
+
}, bn = {
|
|
1758
1758
|
key: 0,
|
|
1759
1759
|
class: "artifactuse-panel__loading"
|
|
1760
|
-
},
|
|
1760
|
+
}, Cn = ["src"], xn = {
|
|
1761
1761
|
key: 2,
|
|
1762
1762
|
class: "artifactuse-panel__no-preview"
|
|
1763
|
-
},
|
|
1763
|
+
}, $n = { class: "artifactuse-panel__edit" }, Mn = { class: "artifactuse-panel__console-type" }, Tn = { class: "artifactuse-panel__console-content" }, Ln = { class: "artifactuse-panel__console-timestamp" }, Pn = { class: "artifactuse-panel__footer" }, En = { class: "artifactuse-panel__footer-left" }, An = {
|
|
1764
1764
|
key: 0,
|
|
1765
1765
|
href: "https://artifactuse.com",
|
|
1766
1766
|
target: "_blank",
|
|
1767
1767
|
rel: "noopener noreferrer",
|
|
1768
1768
|
class: "artifactuse-panel__branding"
|
|
1769
|
-
},
|
|
1769
|
+
}, Hn = {
|
|
1770
1770
|
key: 1,
|
|
1771
1771
|
class: "artifactuse-panel__badge"
|
|
1772
|
-
},
|
|
1772
|
+
}, Bn = { class: "artifactuse-panel__footer-right" }, Sn = ["title"], zn = {
|
|
1773
1773
|
key: 0,
|
|
1774
1774
|
viewBox: "0 0 24 24",
|
|
1775
1775
|
fill: "none",
|
|
1776
1776
|
stroke: "currentColor",
|
|
1777
1777
|
"stroke-width": "2"
|
|
1778
|
-
},
|
|
1778
|
+
}, Vn = {
|
|
1779
1779
|
key: 1,
|
|
1780
1780
|
viewBox: "0 0 24 24",
|
|
1781
1781
|
fill: "none",
|
|
1782
1782
|
stroke: "currentColor",
|
|
1783
1783
|
"stroke-width": "2"
|
|
1784
|
-
},
|
|
1784
|
+
}, In = {
|
|
1785
1785
|
key: 0,
|
|
1786
1786
|
style: { position: "relative" }
|
|
1787
|
-
},
|
|
1787
|
+
}, Fn = {
|
|
1788
1788
|
key: 0,
|
|
1789
1789
|
class: "artifactuse-share-popup"
|
|
1790
|
-
},
|
|
1790
|
+
}, Rn = { class: "artifactuse-share-popup__header" }, qn = { class: "artifactuse-share-popup__title" }, On = { class: "artifactuse-share-popup__body" }, Un = {
|
|
1791
1791
|
key: 0,
|
|
1792
1792
|
class: "artifactuse-share-popup__loading"
|
|
1793
|
-
},
|
|
1793
|
+
}, Dn = { key: 1 }, jn = { class: "artifactuse-share-popup__error" }, Nn = { class: "artifactuse-share-popup__error-text" }, Wn = { class: "artifactuse-share-popup__actions" }, Jn = {
|
|
1794
1794
|
key: 2,
|
|
1795
1795
|
class: "artifactuse-share-popup__options"
|
|
1796
|
-
},
|
|
1796
|
+
}, Xn = { key: 3 }, Zn = {
|
|
1797
1797
|
key: 0,
|
|
1798
1798
|
class: "artifactuse-share-popup__loading"
|
|
1799
|
-
},
|
|
1799
|
+
}, Kn = {
|
|
1800
1800
|
key: 1,
|
|
1801
1801
|
class: "artifactuse-share-popup__empty"
|
|
1802
|
-
},
|
|
1802
|
+
}, Yn = {
|
|
1803
1803
|
key: 2,
|
|
1804
1804
|
class: "artifactuse-share-popup__artifact-list"
|
|
1805
|
-
},
|
|
1805
|
+
}, Qn = ["onClick"], Gn = { class: "artifactuse-share-popup__artifact-name" }, eo = { class: "artifactuse-share-popup__artifact-date" }, to = {
|
|
1806
1806
|
key: 4,
|
|
1807
1807
|
class: "artifactuse-share-popup__success"
|
|
1808
|
-
},
|
|
1808
|
+
}, ao = { class: "artifactuse-share-popup__link-wrapper" }, so = ["value"], lo = {
|
|
1809
1809
|
key: 0,
|
|
1810
1810
|
class: "artifactuse-share-popup__expiry"
|
|
1811
|
-
},
|
|
1811
|
+
}, io = { class: "artifactuse-share-popup__expiry-text" }, no = {
|
|
1812
1812
|
key: 1,
|
|
1813
1813
|
class: "artifactuse-share-popup__save-prompt"
|
|
1814
|
-
},
|
|
1814
|
+
}, oo = {
|
|
1815
1815
|
key: 2,
|
|
1816
1816
|
class: "artifactuse-panel__nav"
|
|
1817
|
-
},
|
|
1817
|
+
}, ro = ["disabled"], co = ["disabled"], uo = {
|
|
1818
1818
|
key: 0,
|
|
1819
1819
|
class: "artifactuse-panel__artifact-list"
|
|
1820
|
-
},
|
|
1820
|
+
}, vo = { class: "artifactuse-panel__artifact-list-header" }, fo = { class: "artifactuse-panel__artifact-list-items" }, po = ["onClick"], _o = ["innerHTML"], ho = { class: "artifactuse-panel__artifact-item-content" }, mo = { class: "artifactuse-panel__artifact-item-title" }, yo = { class: "artifactuse-panel__artifact-item-meta" }, go = { class: "artifactuse-panel__artifact-item-index" }, To = {
|
|
1821
1821
|
__name: "ArtifactusePanel",
|
|
1822
1822
|
props: {
|
|
1823
1823
|
panelWidth: { type: Number, default: void 0 },
|
|
1824
1824
|
splitPosition: { type: Number, default: void 0 },
|
|
1825
|
-
externalPreview: { type: Boolean, default: void 0 }
|
|
1825
|
+
externalPreview: { type: Boolean, default: void 0 },
|
|
1826
|
+
consolePanel: { type: Boolean, default: void 0 }
|
|
1826
1827
|
},
|
|
1827
1828
|
emits: ["close", "ai-request", "save", "export", "resize"],
|
|
1828
|
-
setup(
|
|
1829
|
-
var
|
|
1830
|
-
const _ = c,
|
|
1831
|
-
state:
|
|
1832
|
-
activeArtifact:
|
|
1829
|
+
setup(P, { emit: c }) {
|
|
1830
|
+
var ft, pt;
|
|
1831
|
+
const _ = c, T = P, {
|
|
1832
|
+
state: p,
|
|
1833
|
+
activeArtifact: r,
|
|
1833
1834
|
artifactCount: q,
|
|
1834
|
-
hasArtifacts:
|
|
1835
|
+
hasArtifacts: A,
|
|
1835
1836
|
closePanel: g,
|
|
1836
|
-
toggleFullscreen:
|
|
1837
|
+
toggleFullscreen: o,
|
|
1837
1838
|
setViewMode: h,
|
|
1838
1839
|
getPanelUrl: $,
|
|
1839
|
-
openArtifact:
|
|
1840
|
+
openArtifact: V,
|
|
1840
1841
|
instance: x
|
|
1841
|
-
} =
|
|
1842
|
-
let
|
|
1843
|
-
const
|
|
1844
|
-
var
|
|
1845
|
-
return ((
|
|
1846
|
-
}),
|
|
1847
|
-
Math.min(Math.max(
|
|
1848
|
-
),
|
|
1849
|
-
Math.min(Math.max(
|
|
1850
|
-
),
|
|
1851
|
-
if (!
|
|
1852
|
-
let
|
|
1853
|
-
return
|
|
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("");
|
|
1843
|
+
let C = null, R = null, O = null, J = null;
|
|
1844
|
+
const S = b(() => {
|
|
1845
|
+
var l;
|
|
1846
|
+
return ((l = x.editor) == null ? void 0 : l.isAvailable()) || !1;
|
|
1847
|
+
}), te = M(
|
|
1848
|
+
Math.min(Math.max(T.panelWidth ?? ((ft = x.config) == null ? void 0 : ft.panelWidth) ?? 65, 25), 75)
|
|
1849
|
+
), f = M(
|
|
1850
|
+
Math.min(Math.max(T.splitPosition ?? ((pt = x.config) == null ? void 0 : pt.splitPosition) ?? 50, 20), 80)
|
|
1851
|
+
), j = b(() => r.value ? Ie(r.value.language) : ""), le = b(() => r.value ? `<svg viewBox="0 0 24 24" fill="currentColor">${Ze(r.value.language)}</svg>` : ""), G = b(() => {
|
|
1852
|
+
if (!r.value) return null;
|
|
1853
|
+
let l = $(r.value);
|
|
1854
|
+
return l && r.value._refreshToken && (l += (l.includes("?") ? "&" : "?") + "_t=" + r.value._refreshToken), l;
|
|
1854
1855
|
});
|
|
1855
|
-
|
|
1856
|
-
const
|
|
1857
|
-
var
|
|
1858
|
-
return ((
|
|
1859
|
-
}),
|
|
1860
|
-
var
|
|
1861
|
-
return
|
|
1862
|
-
}),
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
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(() => {
|
|
1858
|
+
var l;
|
|
1859
|
+
return ((l = x.config) == null ? void 0 : l.branding) !== !1;
|
|
1860
|
+
}), Ct = b(() => {
|
|
1861
|
+
var l, t;
|
|
1862
|
+
return G.value ? ((l = r.value) == null ? void 0 : l.externalPreview) !== void 0 ? r.value.externalPreview : T.externalPreview !== void 0 ? T.externalPreview : ((t = x.config) == null ? void 0 : t.externalPreview) ?? !1 : !1;
|
|
1863
|
+
}), Oe = b(() => Q.value.filter((l) => l.type === "error").length), Qe = b(() => Q.value.filter((l) => l.type === "warn").length), Ge = b(() => Q.value.filter((l) => l.type === "info").length), et = b(() => Q.value.filter((l) => l.type === "log").length), xt = b(() => Q.value.filter((l) => w.value.has(l.type)));
|
|
1864
|
+
function He(l) {
|
|
1865
|
+
const t = new Set(w.value);
|
|
1866
|
+
t.has(l) ? t.delete(l) : t.add(l), w.value = t;
|
|
1867
|
+
}
|
|
1868
|
+
const $t = b(() => {
|
|
1869
|
+
var l;
|
|
1870
|
+
return (T.consolePanel ?? ((l = x == null ? void 0 : x.config) == null ? void 0 : l.consolePanel)) !== !1 && Q.value.length > 0;
|
|
1871
|
+
}), Mt = b(() => {
|
|
1872
|
+
var l;
|
|
1873
|
+
return ((l = x.share) == null ? void 0 : l.enabled) !== !1;
|
|
1874
|
+
}), tt = b(() => {
|
|
1875
|
+
var l;
|
|
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(() => {
|
|
1878
|
+
var l;
|
|
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) : []);
|
|
1881
|
+
function Ue(l) {
|
|
1882
|
+
return `<svg viewBox="0 0 24 24" fill="currentColor">${Ze(l)}</svg>`;
|
|
1883
|
+
}
|
|
1884
|
+
function Lt(l) {
|
|
1885
|
+
V(l);
|
|
1886
|
+
}
|
|
1887
|
+
function Pt(l) {
|
|
1888
|
+
x.closeTab(l), p.openTabs.length === 0 && (k.value = !1);
|
|
1877
1889
|
}
|
|
1878
|
-
function
|
|
1879
|
-
x.closeTab(i), f.openTabs.length === 0 && (k.value = !1);
|
|
1880
|
-
}
|
|
1881
|
-
function yt() {
|
|
1890
|
+
function Et() {
|
|
1882
1891
|
k.value = !1, x.state.clearActiveArtifact();
|
|
1883
1892
|
}
|
|
1884
|
-
function
|
|
1885
|
-
if (
|
|
1893
|
+
function st(l) {
|
|
1894
|
+
if (l.language !== "smartdiff") return null;
|
|
1886
1895
|
try {
|
|
1887
|
-
const t = JSON.parse(
|
|
1896
|
+
const t = JSON.parse(l.code);
|
|
1888
1897
|
if (t.oldCode === void 0 || t.newCode === void 0) return null;
|
|
1889
|
-
const
|
|
1898
|
+
const u = t.language || "plaintext", z = mt() && window.Prism.languages[u], X = ra(t.oldCode, t.newCode).split(`
|
|
1890
1899
|
`);
|
|
1891
|
-
return { html:
|
|
1892
|
-
const
|
|
1893
|
-
return
|
|
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;
|
|
1894
1903
|
}).join(`
|
|
1895
|
-
`), lineCount:
|
|
1904
|
+
`), lineCount: X.length };
|
|
1896
1905
|
} catch {
|
|
1897
1906
|
return null;
|
|
1898
1907
|
}
|
|
1899
1908
|
}
|
|
1900
|
-
function
|
|
1901
|
-
var
|
|
1902
|
-
if (
|
|
1903
|
-
const t =
|
|
1909
|
+
function At() {
|
|
1910
|
+
var l;
|
|
1911
|
+
if (ee.value && ((l = r.value) != null && l.code)) {
|
|
1912
|
+
const t = st(r.value), u = t ? t.lineCount : r.value.code.split(`
|
|
1904
1913
|
`).length;
|
|
1905
|
-
|
|
1914
|
+
ee.value.innerHTML = Array.from({ length: u }, (z, X) => `<div>${X + 1}</div>`).join("");
|
|
1906
1915
|
}
|
|
1907
1916
|
}
|
|
1908
|
-
function
|
|
1909
|
-
var
|
|
1910
|
-
if (
|
|
1911
|
-
const t =
|
|
1917
|
+
function Ht() {
|
|
1918
|
+
var l;
|
|
1919
|
+
if (U.value && mt() && ((l = r.value) != null && l.code)) {
|
|
1920
|
+
const t = st(r.value);
|
|
1912
1921
|
if (t)
|
|
1913
|
-
|
|
1922
|
+
U.value.innerHTML = t.html;
|
|
1914
1923
|
else {
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
) :
|
|
1924
|
+
const u = window.Prism.languages[me.value];
|
|
1925
|
+
u ? U.value.innerHTML = window.Prism.highlight(
|
|
1926
|
+
r.value.code,
|
|
1927
|
+
u,
|
|
1928
|
+
me.value
|
|
1929
|
+
) : U.value.textContent = r.value.code;
|
|
1921
1930
|
}
|
|
1922
|
-
|
|
1923
|
-
|
|
1931
|
+
U.value.dataset.highlighted = "true", ke(() => {
|
|
1932
|
+
Bt();
|
|
1924
1933
|
});
|
|
1925
1934
|
}
|
|
1926
1935
|
}
|
|
1927
|
-
function
|
|
1936
|
+
function Bt() {
|
|
1928
1937
|
var t;
|
|
1929
|
-
const
|
|
1930
|
-
if (
|
|
1931
|
-
const
|
|
1932
|
-
|
|
1938
|
+
const l = (t = U.value) == null ? void 0 : t.closest("pre");
|
|
1939
|
+
if (l && B.value && ee.value) {
|
|
1940
|
+
const z = window.getComputedStyle(l).backgroundColor;
|
|
1941
|
+
z && z !== "rgba(0, 0, 0, 0)" && z !== "transparent" && (B.value.style.backgroundColor = z, ee.value.style.backgroundColor = z);
|
|
1933
1942
|
}
|
|
1934
1943
|
}
|
|
1935
|
-
function
|
|
1936
|
-
|
|
1944
|
+
function St() {
|
|
1945
|
+
B.value && (B.value.style.backgroundColor = ""), ee.value && (ee.value.style.backgroundColor = "");
|
|
1937
1946
|
}
|
|
1938
|
-
function
|
|
1939
|
-
|
|
1940
|
-
|
|
1947
|
+
function Be() {
|
|
1948
|
+
ke(() => {
|
|
1949
|
+
At(), Ht();
|
|
1941
1950
|
});
|
|
1942
1951
|
}
|
|
1943
|
-
function
|
|
1944
|
-
!
|
|
1945
|
-
code:
|
|
1946
|
-
language:
|
|
1952
|
+
function lt() {
|
|
1953
|
+
!S.value || !re.value || !r.value || (De(), J = x.editor.create(re.value, {
|
|
1954
|
+
code: r.value.code || "",
|
|
1955
|
+
language: r.value.editorLanguage || r.value.language || "plaintext",
|
|
1947
1956
|
sdkTheme: x.getTheme()
|
|
1948
1957
|
}));
|
|
1949
1958
|
}
|
|
1950
|
-
function
|
|
1951
|
-
|
|
1959
|
+
function De() {
|
|
1960
|
+
J && (J.destroy(), J = null);
|
|
1952
1961
|
}
|
|
1953
|
-
function
|
|
1954
|
-
if (!
|
|
1955
|
-
const
|
|
1962
|
+
function zt() {
|
|
1963
|
+
if (!J || !r.value) return;
|
|
1964
|
+
const l = J.getCode();
|
|
1956
1965
|
x.emit("edit:save", {
|
|
1957
|
-
artifactId:
|
|
1958
|
-
artifact:
|
|
1959
|
-
code:
|
|
1966
|
+
artifactId: r.value.id,
|
|
1967
|
+
artifact: r.value,
|
|
1968
|
+
code: l
|
|
1960
1969
|
});
|
|
1961
1970
|
}
|
|
1962
|
-
function
|
|
1963
|
-
clearTimeout(
|
|
1971
|
+
function Vt() {
|
|
1972
|
+
clearTimeout(O), ve.value = !1, D.value && r.value && (x.bridge.setIframe(D.value), x.bridge.loadArtifact(r.value));
|
|
1964
1973
|
}
|
|
1965
|
-
function
|
|
1966
|
-
clearTimeout(
|
|
1974
|
+
function It() {
|
|
1975
|
+
clearTimeout(O), ve.value = !1;
|
|
1967
1976
|
}
|
|
1968
|
-
function
|
|
1969
|
-
clearTimeout(
|
|
1970
|
-
|
|
1977
|
+
function Ft() {
|
|
1978
|
+
clearTimeout(O), O = setTimeout(() => {
|
|
1979
|
+
ve.value = !1;
|
|
1971
1980
|
}, 1e3);
|
|
1972
1981
|
}
|
|
1973
|
-
async function
|
|
1974
|
-
if (
|
|
1982
|
+
async function Rt() {
|
|
1983
|
+
if (r.value)
|
|
1975
1984
|
try {
|
|
1976
|
-
await navigator.clipboard.writeText(
|
|
1977
|
-
|
|
1985
|
+
await navigator.clipboard.writeText(r.value.code), K.value = !0, setTimeout(() => {
|
|
1986
|
+
K.value = !1;
|
|
1978
1987
|
}, 2e3);
|
|
1979
|
-
} catch (
|
|
1980
|
-
console.error("Failed to copy:",
|
|
1988
|
+
} catch (l) {
|
|
1989
|
+
console.error("Failed to copy:", l);
|
|
1981
1990
|
}
|
|
1982
1991
|
}
|
|
1983
|
-
function
|
|
1984
|
-
if (!
|
|
1985
|
-
const { code:
|
|
1986
|
-
|
|
1992
|
+
function qt() {
|
|
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);
|
|
1987
1996
|
}
|
|
1988
|
-
async function
|
|
1989
|
-
if (!(
|
|
1990
|
-
|
|
1997
|
+
async function Ot() {
|
|
1998
|
+
if (!(ae.value || fe.value.length === 0)) {
|
|
1999
|
+
ae.value = !0;
|
|
1991
2000
|
try {
|
|
1992
|
-
const
|
|
1993
|
-
for (const
|
|
1994
|
-
if (!
|
|
1995
|
-
const
|
|
1996
|
-
let ge = (
|
|
1997
|
-
const
|
|
1998
|
-
|
|
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}`;
|
|
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);
|
|
1999
2008
|
}
|
|
2000
|
-
const
|
|
2001
|
-
|
|
2002
|
-
} catch (
|
|
2003
|
-
console.error("Failed to create ZIP:",
|
|
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);
|
|
2011
|
+
} catch (l) {
|
|
2012
|
+
console.error("Failed to create ZIP:", l);
|
|
2004
2013
|
} finally {
|
|
2005
|
-
|
|
2014
|
+
ae.value = !1;
|
|
2006
2015
|
}
|
|
2007
2016
|
}
|
|
2008
2017
|
}
|
|
2009
|
-
function
|
|
2010
|
-
if (
|
|
2011
|
-
|
|
2018
|
+
function Ut() {
|
|
2019
|
+
if (E.value) {
|
|
2020
|
+
E.value = !1;
|
|
2012
2021
|
return;
|
|
2013
2022
|
}
|
|
2014
|
-
|
|
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);
|
|
2015
2024
|
}
|
|
2016
|
-
function
|
|
2017
|
-
|
|
2025
|
+
function Dt() {
|
|
2026
|
+
E.value = !1;
|
|
2018
2027
|
}
|
|
2019
|
-
function
|
|
2020
|
-
return
|
|
2028
|
+
function it(l) {
|
|
2029
|
+
return l ? new Date(l).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) : "";
|
|
2021
2030
|
}
|
|
2022
|
-
async function
|
|
2023
|
-
if (!(!
|
|
2024
|
-
|
|
2031
|
+
async function nt() {
|
|
2032
|
+
if (!(!r.value || !x.share)) {
|
|
2033
|
+
i.value = "loading", L.value = "";
|
|
2025
2034
|
try {
|
|
2026
|
-
const
|
|
2027
|
-
|
|
2028
|
-
} catch (
|
|
2029
|
-
L.value =
|
|
2035
|
+
const l = await x.share.share(r.value);
|
|
2036
|
+
H.value = l.url, d.value = l.expiresAt, ce.value = !1, i.value = "success";
|
|
2037
|
+
} catch (l) {
|
|
2038
|
+
L.value = l.message || "Failed to create share link", i.value = "error";
|
|
2030
2039
|
}
|
|
2031
2040
|
}
|
|
2032
2041
|
}
|
|
2033
|
-
async function
|
|
2034
|
-
if (
|
|
2035
|
-
|
|
2042
|
+
async function ot() {
|
|
2043
|
+
if (tt.value)
|
|
2044
|
+
je();
|
|
2036
2045
|
else {
|
|
2037
|
-
|
|
2046
|
+
i.value = "loading";
|
|
2038
2047
|
try {
|
|
2039
|
-
await x.share.openAuthPopup(),
|
|
2040
|
-
} catch (
|
|
2041
|
-
|
|
2048
|
+
await x.share.openAuthPopup(), je();
|
|
2049
|
+
} catch (l) {
|
|
2050
|
+
l.message === "Authentication cancelled" ? i.value = "options" : (L.value = l.message || "Authentication failed", i.value = "error");
|
|
2042
2051
|
}
|
|
2043
2052
|
}
|
|
2044
2053
|
}
|
|
2045
|
-
async function
|
|
2046
|
-
if (!(!
|
|
2047
|
-
|
|
2054
|
+
async function je() {
|
|
2055
|
+
if (!(!r.value || !x.share)) {
|
|
2056
|
+
i.value = "loading", L.value = "";
|
|
2048
2057
|
try {
|
|
2049
|
-
const
|
|
2050
|
-
|
|
2051
|
-
} catch (
|
|
2052
|
-
L.value =
|
|
2058
|
+
const l = await x.share.save(r.value);
|
|
2059
|
+
H.value = l.url, d.value = null, ce.value = !0, i.value = "success";
|
|
2060
|
+
} catch (l) {
|
|
2061
|
+
L.value = l.message || "Failed to save artifact", i.value = "error";
|
|
2053
2062
|
}
|
|
2054
2063
|
}
|
|
2055
2064
|
}
|
|
2056
|
-
function
|
|
2057
|
-
|
|
2065
|
+
function jt() {
|
|
2066
|
+
ce.value ? je() : nt();
|
|
2058
2067
|
}
|
|
2059
|
-
async function
|
|
2060
|
-
var
|
|
2068
|
+
async function Nt() {
|
|
2069
|
+
var l;
|
|
2061
2070
|
if (x.share) {
|
|
2062
|
-
if (!
|
|
2063
|
-
|
|
2071
|
+
if (!tt.value) {
|
|
2072
|
+
i.value = "loading";
|
|
2064
2073
|
try {
|
|
2065
2074
|
await x.share.openAuthPopup();
|
|
2066
2075
|
} catch (t) {
|
|
2067
|
-
t.message === "Authentication cancelled" ?
|
|
2076
|
+
t.message === "Authentication cancelled" ? i.value = "options" : (L.value = t.message || "Authentication failed", i.value = "error");
|
|
2068
2077
|
return;
|
|
2069
2078
|
}
|
|
2070
2079
|
}
|
|
2071
|
-
|
|
2080
|
+
i.value = "update-list", be.value = !0;
|
|
2072
2081
|
try {
|
|
2073
|
-
const t = ((
|
|
2074
|
-
|
|
2082
|
+
const t = ((l = r.value) == null ? void 0 : l.language) || null, u = await x.share.listArtifacts(t);
|
|
2083
|
+
we.value = u.projects || [];
|
|
2075
2084
|
} catch (t) {
|
|
2076
|
-
L.value = t.message || "Failed to load artifacts",
|
|
2085
|
+
L.value = t.message || "Failed to load artifacts", i.value = "error";
|
|
2077
2086
|
} finally {
|
|
2078
|
-
|
|
2087
|
+
be.value = !1;
|
|
2079
2088
|
}
|
|
2080
2089
|
}
|
|
2081
2090
|
}
|
|
2082
|
-
async function
|
|
2083
|
-
var
|
|
2084
|
-
if (!
|
|
2085
|
-
const t = (
|
|
2091
|
+
async function Wt(l) {
|
|
2092
|
+
var u, z;
|
|
2093
|
+
if (!r.value || !x.share) return;
|
|
2094
|
+
const t = (u = l.project) == null ? void 0 : u.uuid;
|
|
2086
2095
|
if (t) {
|
|
2087
|
-
|
|
2096
|
+
i.value = "loading", L.value = "";
|
|
2088
2097
|
try {
|
|
2089
|
-
const
|
|
2090
|
-
|
|
2091
|
-
} catch (
|
|
2092
|
-
L.value =
|
|
2098
|
+
const X = await x.share.updateArtifact(t, r.value);
|
|
2099
|
+
H.value = X.url || "", d.value = null, ce.value = !0, Le.value = ((z = l.project) == null ? void 0 : z.name) || "Untitled", i.value = "success";
|
|
2100
|
+
} catch (X) {
|
|
2101
|
+
L.value = X.message || "Failed to update artifact", i.value = "error";
|
|
2093
2102
|
}
|
|
2094
2103
|
}
|
|
2095
2104
|
}
|
|
2096
|
-
async function
|
|
2097
|
-
if (
|
|
2105
|
+
async function Jt() {
|
|
2106
|
+
if (H.value)
|
|
2098
2107
|
try {
|
|
2099
|
-
await navigator.clipboard.writeText(
|
|
2100
|
-
|
|
2108
|
+
await navigator.clipboard.writeText(H.value), se.value = !0, setTimeout(() => {
|
|
2109
|
+
se.value = !1;
|
|
2101
2110
|
}, 2e3);
|
|
2102
|
-
} catch (
|
|
2103
|
-
console.error("Failed to copy link:",
|
|
2111
|
+
} catch (l) {
|
|
2112
|
+
console.error("Failed to copy link:", l);
|
|
2104
2113
|
}
|
|
2105
2114
|
}
|
|
2106
|
-
function
|
|
2107
|
-
|
|
2115
|
+
function rt() {
|
|
2116
|
+
G.value && window.open(G.value, "_blank", "noopener,noreferrer");
|
|
2108
2117
|
}
|
|
2109
|
-
function
|
|
2110
|
-
|
|
2118
|
+
function Xt() {
|
|
2119
|
+
ee.value && B.value && (ee.value.style.transform = `translateY(-${B.value.scrollTop}px)`);
|
|
2111
2120
|
}
|
|
2112
|
-
function
|
|
2113
|
-
|
|
2121
|
+
function Zt() {
|
|
2122
|
+
Z.value = !Z.value;
|
|
2114
2123
|
}
|
|
2115
|
-
function
|
|
2116
|
-
k.value = !0,
|
|
2124
|
+
function ct(l) {
|
|
2125
|
+
k.value = !0, V(l), Z.value = !1;
|
|
2117
2126
|
}
|
|
2118
|
-
function
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2127
|
+
function Kt() {
|
|
2128
|
+
const l = Pe.value - 1;
|
|
2129
|
+
l >= 0 && V(fe.value[l]);
|
|
2121
2130
|
}
|
|
2122
|
-
function
|
|
2123
|
-
const
|
|
2124
|
-
|
|
2131
|
+
function Yt() {
|
|
2132
|
+
const l = Pe.value + 1;
|
|
2133
|
+
l < fe.value.length && V(fe.value[l]);
|
|
2125
2134
|
}
|
|
2126
|
-
function
|
|
2135
|
+
function ut(l) {
|
|
2127
2136
|
const t = document.querySelector(".artifactuse-panel__nav");
|
|
2128
|
-
t && !t.contains(
|
|
2129
|
-
}
|
|
2130
|
-
let
|
|
2131
|
-
function
|
|
2132
|
-
|
|
2133
|
-
startX:
|
|
2134
|
-
startWidth:
|
|
2135
|
-
}, document.addEventListener("mousemove",
|
|
2136
|
-
}
|
|
2137
|
-
function
|
|
2138
|
-
if (!
|
|
2139
|
-
const t = window.innerWidth,
|
|
2140
|
-
|
|
2141
|
-
}
|
|
2142
|
-
function
|
|
2143
|
-
const
|
|
2144
|
-
|
|
2145
|
-
}
|
|
2146
|
-
let
|
|
2147
|
-
function
|
|
2148
|
-
if (!
|
|
2149
|
-
const t =
|
|
2150
|
-
|
|
2151
|
-
startX:
|
|
2152
|
-
startPosition:
|
|
2137
|
+
t && !t.contains(l.target) && (Z.value = !1);
|
|
2138
|
+
}
|
|
2139
|
+
let xe = null;
|
|
2140
|
+
function Qt(l) {
|
|
2141
|
+
xe = {
|
|
2142
|
+
startX: l.clientX,
|
|
2143
|
+
startWidth: te.value
|
|
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
|
+
}
|
|
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 });
|
|
2150
|
+
}
|
|
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 });
|
|
2154
|
+
}
|
|
2155
|
+
let Ae = null;
|
|
2156
|
+
function Gt(l) {
|
|
2157
|
+
if (!N.value) return;
|
|
2158
|
+
const t = N.value.getBoundingClientRect();
|
|
2159
|
+
Ae = {
|
|
2160
|
+
startX: l.clientX,
|
|
2161
|
+
startPosition: f.value,
|
|
2153
2162
|
contentLeft: t.left,
|
|
2154
2163
|
contentWidth: t.width
|
|
2155
|
-
}, document.addEventListener("mousemove",
|
|
2164
|
+
}, document.addEventListener("mousemove", vt), document.addEventListener("mouseup", We), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.querySelectorAll("iframe").forEach((z) => z.style.pointerEvents = "none");
|
|
2156
2165
|
}
|
|
2157
|
-
function
|
|
2158
|
-
if (!
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2166
|
+
function vt(l) {
|
|
2167
|
+
if (!Ae) return;
|
|
2168
|
+
const u = (l.clientX - Ae.contentLeft) / Ae.contentWidth * 100;
|
|
2169
|
+
f.value = Math.min(Math.max(u, 20), 80);
|
|
2161
2170
|
}
|
|
2162
|
-
function
|
|
2163
|
-
|
|
2171
|
+
function We() {
|
|
2172
|
+
Ae = null, document.removeEventListener("mousemove", vt), document.removeEventListener("mouseup", We), document.body.style.cursor = "", document.body.style.userSelect = "", document.querySelectorAll("iframe").forEach((t) => t.style.pointerEvents = "");
|
|
2164
2173
|
}
|
|
2165
|
-
return
|
|
2166
|
-
|
|
2174
|
+
return oe(r, (l, t) => {
|
|
2175
|
+
l && (t && t.isPreviewable !== l.isPreviewable && (m.value = !0, setTimeout(() => {
|
|
2167
2176
|
m.value = !1;
|
|
2168
|
-
}, 150)), (!t ||
|
|
2169
|
-
|
|
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(() => {
|
|
2178
|
+
D.value && l.isPreviewable && x.bridge.loadArtifact(l);
|
|
2170
2179
|
}, 500)));
|
|
2171
|
-
}, { deep: !0 }),
|
|
2172
|
-
(
|
|
2173
|
-
}),
|
|
2174
|
-
|
|
2175
|
-
}),
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2180
|
+
}, { deep: !0 }), oe(() => p.viewMode, (l) => {
|
|
2181
|
+
(l === "code" || l === "split") && Be(), l === "edit" && ke(() => lt());
|
|
2182
|
+
}), oe(() => p.isPanelOpen, (l) => {
|
|
2183
|
+
l && r.value && Be(), l || De();
|
|
2184
|
+
}), oe(() => {
|
|
2185
|
+
var l;
|
|
2186
|
+
return (l = r.value) == null ? void 0 : l.id;
|
|
2187
|
+
}, () => {
|
|
2188
|
+
Q.value = [], W.value = !1;
|
|
2189
|
+
}), oe([Q, W], () => {
|
|
2190
|
+
ie.value && W.value && ke(() => {
|
|
2191
|
+
ie.value.scrollTop = ie.value.scrollHeight;
|
|
2192
|
+
});
|
|
2193
|
+
}), oe(() => T.panelWidth, (l) => {
|
|
2194
|
+
l !== void 0 && (te.value = Math.min(Math.max(l, 25), 75));
|
|
2195
|
+
}), oe(() => T.splitPosition, (l) => {
|
|
2196
|
+
l !== void 0 && (f.value = Math.min(Math.max(l, 20), 80));
|
|
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 }) => {
|
|
2199
|
+
Q.value = [...Q.value, l].slice(-500), l.type === "error" && (W.value = !0);
|
|
2200
|
+
})), document.addEventListener("click", ut), p.isPanelOpen && r.value && Be();
|
|
2201
|
+
}), Ye(() => {
|
|
2202
|
+
Ne(), We(), De(), document.removeEventListener("click", ut), clearTimeout(R), clearTimeout(O), C && C();
|
|
2203
|
+
}), (l, t) => (a(), Me(ze, { name: "artifactuse-panel" }, {
|
|
2204
|
+
default: Ve(() => [
|
|
2205
|
+
y(p).isPanelOpen ? (a(), s("div", {
|
|
2186
2206
|
key: 0,
|
|
2187
|
-
class:
|
|
2188
|
-
"artifactuse-panel--fullscreen": y(
|
|
2189
|
-
"artifactuse-panel--list": !y(
|
|
2190
|
-
"artifactuse-panel--empty": !y(
|
|
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
|
|
2191
2211
|
}]),
|
|
2192
|
-
style:
|
|
2212
|
+
style: Se(y(p).isFullscreen ? void 0 : { width: `${Tt.value}%` })
|
|
2193
2213
|
}, [
|
|
2194
|
-
y(
|
|
2214
|
+
y(p).isFullscreen ? v("", !0) : (a(), s("div", {
|
|
2195
2215
|
key: 0,
|
|
2196
2216
|
class: "artifactuse-panel__resize-handle",
|
|
2197
|
-
onMousedown:
|
|
2198
|
-
}, [...t[
|
|
2217
|
+
onMousedown: _e(Qt, ["prevent"])
|
|
2218
|
+
}, [...t[19] || (t[19] = [
|
|
2199
2219
|
e("div", { class: "artifactuse-panel__resize-handle-line" }, null, -1)
|
|
2200
2220
|
])], 32)),
|
|
2201
|
-
!y(
|
|
2202
|
-
e("header",
|
|
2203
|
-
e("div",
|
|
2204
|
-
e("span",
|
|
2205
|
-
|
|
2221
|
+
!y(A) || Ce.value ? (a(), s(F, { key: 1 }, [
|
|
2222
|
+
e("header", xi, [
|
|
2223
|
+
e("div", $i, [
|
|
2224
|
+
e("span", Mi, [
|
|
2225
|
+
Ce.value ? (a(), s("svg", Ti, [...t[20] || (t[20] = [
|
|
2206
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),
|
|
2207
2227
|
e("polyline", { points: "14 2 14 8 20 8" }, null, -1)
|
|
2208
|
-
])])) : (a(), s("svg",
|
|
2228
|
+
])])) : (a(), s("svg", Li, [...t[21] || (t[21] = [
|
|
2209
2229
|
e("polyline", { points: "16 18 22 12 16 6" }, null, -1),
|
|
2210
2230
|
e("polyline", { points: "8 6 2 12 8 18" }, null, -1)
|
|
2211
2231
|
])]))
|
|
2212
2232
|
]),
|
|
2213
|
-
e("div",
|
|
2214
|
-
e("span",
|
|
2233
|
+
e("div", Pi, [
|
|
2234
|
+
e("span", Ei, n(Ce.value ? "Artifact Viewer" : "Artifacts"), 1)
|
|
2215
2235
|
])
|
|
2216
2236
|
]),
|
|
2217
|
-
e("div",
|
|
2237
|
+
e("div", Ai, [
|
|
2218
2238
|
e("button", {
|
|
2219
2239
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2220
2240
|
title: "Close panel",
|
|
2221
|
-
onClick: t[0] || (t[0] = (...
|
|
2222
|
-
}, [...t[
|
|
2241
|
+
onClick: t[0] || (t[0] = (...u) => y(g) && y(g)(...u))
|
|
2242
|
+
}, [...t[22] || (t[22] = [
|
|
2223
2243
|
e("svg", {
|
|
2224
2244
|
viewBox: "0 0 24 24",
|
|
2225
2245
|
fill: "none",
|
|
@@ -2242,8 +2262,8 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2242
2262
|
])])
|
|
2243
2263
|
])
|
|
2244
2264
|
]),
|
|
2245
|
-
e("div",
|
|
2246
|
-
t[
|
|
2265
|
+
e("div", Hi, [
|
|
2266
|
+
t[23] || (t[23] = e("div", { class: "artifactuse-panel__empty-icon" }, [
|
|
2247
2267
|
e("svg", {
|
|
2248
2268
|
viewBox: "0 0 24 24",
|
|
2249
2269
|
fill: "none",
|
|
@@ -2254,11 +2274,11 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2254
2274
|
e("polyline", { points: "14 2 14 8 20 8" })
|
|
2255
2275
|
])
|
|
2256
2276
|
], -1)),
|
|
2257
|
-
e("h3",
|
|
2258
|
-
e("p",
|
|
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)
|
|
2259
2279
|
]),
|
|
2260
|
-
e("footer",
|
|
2261
|
-
|
|
2280
|
+
e("footer", zi, [
|
|
2281
|
+
qe.value ? (a(), s("a", Vi, [...t[24] || (t[24] = [
|
|
2262
2282
|
e("svg", {
|
|
2263
2283
|
width: "16",
|
|
2264
2284
|
height: "16",
|
|
@@ -2278,10 +2298,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2278
2298
|
e("span", null, "Artifactuse", -1)
|
|
2279
2299
|
])])) : v("", !0)
|
|
2280
2300
|
])
|
|
2281
|
-
], 64)) : !y(
|
|
2282
|
-
e("header",
|
|
2283
|
-
e("div",
|
|
2284
|
-
t[
|
|
2301
|
+
], 64)) : !y(r) && !Ce.value ? (a(), s(F, { key: 2 }, [
|
|
2302
|
+
e("header", Ii, [
|
|
2303
|
+
e("div", Fi, [
|
|
2304
|
+
t[26] || (t[26] = e("span", { class: "artifactuse-panel__icon" }, [
|
|
2285
2305
|
e("svg", {
|
|
2286
2306
|
viewBox: "0 0 24 24",
|
|
2287
2307
|
fill: "none",
|
|
@@ -2292,19 +2312,19 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2292
2312
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2293
2313
|
])
|
|
2294
2314
|
], -1)),
|
|
2295
|
-
e("div",
|
|
2296
|
-
t[
|
|
2297
|
-
e("span",
|
|
2315
|
+
e("div", Ri, [
|
|
2316
|
+
t[25] || (t[25] = e("span", { class: "artifactuse-panel__name" }, "Artifacts", -1)),
|
|
2317
|
+
e("span", qi, n(fe.value.length) + " available", 1)
|
|
2298
2318
|
])
|
|
2299
2319
|
]),
|
|
2300
|
-
e("div",
|
|
2320
|
+
e("div", Oi, [
|
|
2301
2321
|
e("button", {
|
|
2302
|
-
class:
|
|
2303
|
-
disabled:
|
|
2322
|
+
class: I(["artifactuse-panel__action", { "artifactuse-panel__action--loading": ae.value }]),
|
|
2323
|
+
disabled: ae.value,
|
|
2304
2324
|
title: "Download all as ZIP",
|
|
2305
|
-
onClick:
|
|
2325
|
+
onClick: Ot
|
|
2306
2326
|
}, [
|
|
2307
|
-
|
|
2327
|
+
ae.value ? (a(), s("svg", ji, [...t[28] || (t[28] = [
|
|
2308
2328
|
e("circle", {
|
|
2309
2329
|
cx: "12",
|
|
2310
2330
|
cy: "12",
|
|
@@ -2312,7 +2332,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2312
2332
|
"stroke-dasharray": "32",
|
|
2313
2333
|
"stroke-dashoffset": "32"
|
|
2314
2334
|
}, null, -1)
|
|
2315
|
-
])])) : (a(), s("svg",
|
|
2335
|
+
])])) : (a(), s("svg", Di, [...t[27] || (t[27] = [
|
|
2316
2336
|
e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }, null, -1),
|
|
2317
2337
|
e("polyline", { points: "7 10 12 15 17 10" }, null, -1),
|
|
2318
2338
|
e("line", {
|
|
@@ -2322,12 +2342,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2322
2342
|
y2: "3"
|
|
2323
2343
|
}, null, -1)
|
|
2324
2344
|
])]))
|
|
2325
|
-
], 10,
|
|
2345
|
+
], 10, Ui),
|
|
2326
2346
|
e("button", {
|
|
2327
2347
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2328
2348
|
title: "Close panel",
|
|
2329
|
-
onClick: t[1] || (t[1] = (...
|
|
2330
|
-
}, [...t[
|
|
2349
|
+
onClick: t[1] || (t[1] = (...u) => y(g) && y(g)(...u))
|
|
2350
|
+
}, [...t[29] || (t[29] = [
|
|
2331
2351
|
e("svg", {
|
|
2332
2352
|
viewBox: "0 0 24 24",
|
|
2333
2353
|
fill: "none",
|
|
@@ -2350,27 +2370,27 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2350
2370
|
])])
|
|
2351
2371
|
])
|
|
2352
2372
|
]),
|
|
2353
|
-
e("div",
|
|
2354
|
-
e("div",
|
|
2355
|
-
(a(!0), s(
|
|
2356
|
-
key:
|
|
2373
|
+
e("div", Ni, [
|
|
2374
|
+
e("div", Wi, [
|
|
2375
|
+
(a(!0), s(F, null, de(fe.value, (u, z) => (a(), s("button", {
|
|
2376
|
+
key: u.id,
|
|
2357
2377
|
class: "artifactuse-panel__list-item",
|
|
2358
|
-
onClick: (
|
|
2378
|
+
onClick: (X) => ct(u)
|
|
2359
2379
|
}, [
|
|
2360
2380
|
e("span", {
|
|
2361
2381
|
class: "artifactuse-panel__list-item-icon",
|
|
2362
|
-
innerHTML:
|
|
2363
|
-
}, null, 8,
|
|
2364
|
-
e("div",
|
|
2365
|
-
e("span",
|
|
2366
|
-
e("span",
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2382
|
+
innerHTML: Ue(u.language)
|
|
2383
|
+
}, null, 8, Xi),
|
|
2384
|
+
e("div", Zi, [
|
|
2385
|
+
e("span", Ki, n(u.title || "Untitled"), 1),
|
|
2386
|
+
e("span", Yi, [
|
|
2387
|
+
Y(n(y(Ie)(u.language)) + " ", 1),
|
|
2388
|
+
u.lineCount ? (a(), s(F, { key: 0 }, [
|
|
2389
|
+
Y(" • " + n(u.lineCount) + " lines ", 1)
|
|
2370
2390
|
], 64)) : v("", !0)
|
|
2371
2391
|
])
|
|
2372
2392
|
]),
|
|
2373
|
-
t[
|
|
2393
|
+
t[30] || (t[30] = e("span", { class: "artifactuse-panel__list-item-arrow" }, [
|
|
2374
2394
|
e("svg", {
|
|
2375
2395
|
viewBox: "0 0 24 24",
|
|
2376
2396
|
fill: "none",
|
|
@@ -2380,11 +2400,11 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2380
2400
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
2381
2401
|
])
|
|
2382
2402
|
], -1))
|
|
2383
|
-
], 8,
|
|
2403
|
+
], 8, Ji))), 128))
|
|
2384
2404
|
])
|
|
2385
2405
|
]),
|
|
2386
|
-
e("footer",
|
|
2387
|
-
|
|
2406
|
+
e("footer", Qi, [
|
|
2407
|
+
qe.value ? (a(), s("a", Gi, [...t[31] || (t[31] = [
|
|
2388
2408
|
e("svg", {
|
|
2389
2409
|
width: "16",
|
|
2390
2410
|
height: "16",
|
|
@@ -2404,14 +2424,14 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2404
2424
|
e("span", null, "Artifactuse", -1)
|
|
2405
2425
|
])])) : v("", !0)
|
|
2406
2426
|
])
|
|
2407
|
-
], 64)) : (a(), s(
|
|
2408
|
-
e("header",
|
|
2409
|
-
|
|
2427
|
+
], 64)) : (a(), s(F, { key: 3 }, [
|
|
2428
|
+
e("header", en, [
|
|
2429
|
+
Ee.value || k.value ? (a(), s("button", {
|
|
2410
2430
|
key: 0,
|
|
2411
2431
|
class: "artifactuse-panel__back",
|
|
2412
|
-
title:
|
|
2413
|
-
onClick:
|
|
2414
|
-
}, [...t[
|
|
2432
|
+
title: Ee.value ? "Browse artifacts" : "Back to list",
|
|
2433
|
+
onClick: Et
|
|
2434
|
+
}, [...t[32] || (t[32] = [
|
|
2415
2435
|
e("svg", {
|
|
2416
2436
|
viewBox: "0 0 24 24",
|
|
2417
2437
|
fill: "none",
|
|
@@ -2420,30 +2440,30 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2420
2440
|
}, [
|
|
2421
2441
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
2422
2442
|
], -1)
|
|
2423
|
-
])], 8,
|
|
2424
|
-
e("div",
|
|
2443
|
+
])], 8, tn)) : v("", !0),
|
|
2444
|
+
e("div", an, [
|
|
2425
2445
|
e("span", {
|
|
2426
2446
|
class: "artifactuse-panel__icon",
|
|
2427
|
-
innerHTML:
|
|
2428
|
-
}, null, 8,
|
|
2429
|
-
e("div",
|
|
2430
|
-
e("span",
|
|
2431
|
-
e("span",
|
|
2432
|
-
|
|
2433
|
-
y(
|
|
2434
|
-
|
|
2447
|
+
innerHTML: le.value
|
|
2448
|
+
}, null, 8, sn),
|
|
2449
|
+
e("div", ln, [
|
|
2450
|
+
e("span", nn, n(y(r).title || "Untitled"), 1),
|
|
2451
|
+
e("span", on, [
|
|
2452
|
+
Y(n(j.value) + " ", 1),
|
|
2453
|
+
y(r).lineCount ? (a(), s(F, { key: 0 }, [
|
|
2454
|
+
Y(" • " + n(y(r).lineCount) + " lines ", 1)
|
|
2435
2455
|
], 64)) : v("", !0)
|
|
2436
2456
|
])
|
|
2437
2457
|
])
|
|
2438
2458
|
]),
|
|
2439
|
-
e("div",
|
|
2440
|
-
!y(
|
|
2459
|
+
e("div", rn, [
|
|
2460
|
+
!y(r).tabs || y(r).tabs.includes("preview") ? (a(), s("button", {
|
|
2441
2461
|
key: 0,
|
|
2442
|
-
class:
|
|
2443
|
-
disabled: !y(
|
|
2462
|
+
class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "preview" }]),
|
|
2463
|
+
disabled: !y(r).isPreviewable,
|
|
2444
2464
|
title: "Preview",
|
|
2445
|
-
onClick: t[2] || (t[2] = (
|
|
2446
|
-
}, [...t[
|
|
2465
|
+
onClick: t[2] || (t[2] = (u) => y(h)("preview"))
|
|
2466
|
+
}, [...t[33] || (t[33] = [
|
|
2447
2467
|
e("svg", {
|
|
2448
2468
|
viewBox: "0 0 24 24",
|
|
2449
2469
|
fill: "none",
|
|
@@ -2457,13 +2477,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2457
2477
|
r: "3"
|
|
2458
2478
|
})
|
|
2459
2479
|
], -1)
|
|
2460
|
-
])], 10,
|
|
2461
|
-
!y(
|
|
2480
|
+
])], 10, cn)) : v("", !0),
|
|
2481
|
+
!y(r).tabs || y(r).tabs.includes("code") ? (a(), s("button", {
|
|
2462
2482
|
key: 1,
|
|
2463
|
-
class:
|
|
2483
|
+
class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "code" }]),
|
|
2464
2484
|
title: "Code",
|
|
2465
|
-
onClick: t[3] || (t[3] = (
|
|
2466
|
-
}, [...t[
|
|
2485
|
+
onClick: t[3] || (t[3] = (u) => y(h)("code"))
|
|
2486
|
+
}, [...t[34] || (t[34] = [
|
|
2467
2487
|
e("svg", {
|
|
2468
2488
|
viewBox: "0 0 24 24",
|
|
2469
2489
|
fill: "none",
|
|
@@ -2474,13 +2494,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2474
2494
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
2475
2495
|
], -1)
|
|
2476
2496
|
])], 2)) : v("", !0),
|
|
2477
|
-
!y(
|
|
2497
|
+
!y(r).tabs || y(r).tabs.includes("split") ? (a(), s("button", {
|
|
2478
2498
|
key: 2,
|
|
2479
|
-
class:
|
|
2480
|
-
disabled: !y(
|
|
2499
|
+
class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "split" }]),
|
|
2500
|
+
disabled: !y(r).isPreviewable,
|
|
2481
2501
|
title: "Split view",
|
|
2482
|
-
onClick: t[4] || (t[4] = (
|
|
2483
|
-
}, [...t[
|
|
2502
|
+
onClick: t[4] || (t[4] = (u) => y(h)("split"))
|
|
2503
|
+
}, [...t[35] || (t[35] = [
|
|
2484
2504
|
e("svg", {
|
|
2485
2505
|
viewBox: "0 0 24 24",
|
|
2486
2506
|
fill: "none",
|
|
@@ -2502,13 +2522,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2502
2522
|
y2: "21"
|
|
2503
2523
|
})
|
|
2504
2524
|
], -1)
|
|
2505
|
-
])], 10,
|
|
2506
|
-
y(
|
|
2525
|
+
])], 10, un)) : v("", !0),
|
|
2526
|
+
y(r).tabs && y(r).tabs.includes("edit") && S.value ? (a(), s("button", {
|
|
2507
2527
|
key: 3,
|
|
2508
|
-
class:
|
|
2528
|
+
class: I(["artifactuse-panel__tab", { "artifactuse-panel__tab--active": y(p).viewMode === "edit" }]),
|
|
2509
2529
|
title: "Edit",
|
|
2510
|
-
onClick: t[5] || (t[5] = (
|
|
2511
|
-
}, [...t[
|
|
2530
|
+
onClick: t[5] || (t[5] = (u) => y(h)("edit"))
|
|
2531
|
+
}, [...t[36] || (t[36] = [
|
|
2512
2532
|
e("svg", {
|
|
2513
2533
|
viewBox: "0 0 24 24",
|
|
2514
2534
|
fill: "none",
|
|
@@ -2520,13 +2540,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2520
2540
|
], -1)
|
|
2521
2541
|
])], 2)) : v("", !0)
|
|
2522
2542
|
]),
|
|
2523
|
-
e("div",
|
|
2524
|
-
y(
|
|
2543
|
+
e("div", dn, [
|
|
2544
|
+
y(p).viewMode === "edit" ? (a(), s("button", {
|
|
2525
2545
|
key: 0,
|
|
2526
2546
|
class: "artifactuse-panel__action artifactuse-panel__action--save",
|
|
2527
2547
|
title: "Save",
|
|
2528
|
-
onClick:
|
|
2529
|
-
}, [...t[
|
|
2548
|
+
onClick: zt
|
|
2549
|
+
}, [...t[37] || (t[37] = [
|
|
2530
2550
|
e("svg", {
|
|
2531
2551
|
viewBox: "0 0 24 24",
|
|
2532
2552
|
fill: "none",
|
|
@@ -2538,12 +2558,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2538
2558
|
e("polyline", { points: "7 3 7 8 15 8" })
|
|
2539
2559
|
], -1)
|
|
2540
2560
|
])])) : v("", !0),
|
|
2541
|
-
|
|
2561
|
+
Ct.value ? (a(), s("button", {
|
|
2542
2562
|
key: 1,
|
|
2543
2563
|
class: "artifactuse-panel__action",
|
|
2544
2564
|
title: "Open in new tab",
|
|
2545
|
-
onClick:
|
|
2546
|
-
}, [...t[
|
|
2565
|
+
onClick: rt
|
|
2566
|
+
}, [...t[38] || (t[38] = [
|
|
2547
2567
|
e("svg", {
|
|
2548
2568
|
viewBox: "0 0 24 24",
|
|
2549
2569
|
fill: "none",
|
|
@@ -2562,10 +2582,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2562
2582
|
])])) : v("", !0),
|
|
2563
2583
|
e("button", {
|
|
2564
2584
|
class: "artifactuse-panel__action",
|
|
2565
|
-
title: y(
|
|
2566
|
-
onClick: t[6] || (t[6] = (...
|
|
2585
|
+
title: y(p).isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
2586
|
+
onClick: t[6] || (t[6] = (...u) => y(o) && y(o)(...u))
|
|
2567
2587
|
}, [
|
|
2568
|
-
y(
|
|
2588
|
+
y(p).isFullscreen ? (a(), s("svg", pn, [...t[40] || (t[40] = [
|
|
2569
2589
|
e("polyline", { points: "4 14 10 14 10 20" }, null, -1),
|
|
2570
2590
|
e("polyline", { points: "20 10 14 10 14 4" }, null, -1),
|
|
2571
2591
|
e("line", {
|
|
@@ -2580,7 +2600,7 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2580
2600
|
x2: "10",
|
|
2581
2601
|
y2: "14"
|
|
2582
2602
|
}, null, -1)
|
|
2583
|
-
])])) : (a(), s("svg",
|
|
2603
|
+
])])) : (a(), s("svg", fn, [...t[39] || (t[39] = [
|
|
2584
2604
|
e("polyline", { points: "15 3 21 3 21 9" }, null, -1),
|
|
2585
2605
|
e("polyline", { points: "9 21 3 21 3 15" }, null, -1),
|
|
2586
2606
|
e("line", {
|
|
@@ -2596,12 +2616,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2596
2616
|
y2: "14"
|
|
2597
2617
|
}, null, -1)
|
|
2598
2618
|
])]))
|
|
2599
|
-
], 8,
|
|
2619
|
+
], 8, vn),
|
|
2600
2620
|
e("button", {
|
|
2601
2621
|
class: "artifactuse-panel__action artifactuse-panel__action--close",
|
|
2602
2622
|
title: "Close panel",
|
|
2603
|
-
onClick: t[7] || (t[7] = (...
|
|
2604
|
-
}, [...t[
|
|
2623
|
+
onClick: t[7] || (t[7] = (...u) => y(g) && y(g)(...u))
|
|
2624
|
+
}, [...t[41] || (t[41] = [
|
|
2605
2625
|
e("svg", {
|
|
2606
2626
|
viewBox: "0 0 24 24",
|
|
2607
2627
|
fill: "none",
|
|
@@ -2624,25 +2644,25 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2624
2644
|
])])
|
|
2625
2645
|
])
|
|
2626
2646
|
]),
|
|
2627
|
-
|
|
2628
|
-
e("div",
|
|
2629
|
-
(a(!0), s(
|
|
2630
|
-
var
|
|
2647
|
+
Ee.value && at.value.length > 0 ? (a(), s("div", _n, [
|
|
2648
|
+
e("div", hn, [
|
|
2649
|
+
(a(!0), s(F, null, de(at.value, (u) => {
|
|
2650
|
+
var z;
|
|
2631
2651
|
return a(), s("button", {
|
|
2632
|
-
key:
|
|
2633
|
-
class:
|
|
2634
|
-
onClick: (
|
|
2652
|
+
key: u.id,
|
|
2653
|
+
class: I(["artifactuse-panel__file-tab", { "artifactuse-panel__file-tab--active": u.id === ((z = y(r)) == null ? void 0 : z.id) }]),
|
|
2654
|
+
onClick: (X) => Lt(u)
|
|
2635
2655
|
}, [
|
|
2636
2656
|
e("span", {
|
|
2637
2657
|
class: "artifactuse-panel__file-tab-icon",
|
|
2638
|
-
innerHTML:
|
|
2639
|
-
}, null, 8,
|
|
2640
|
-
e("span",
|
|
2658
|
+
innerHTML: Ue(u.language)
|
|
2659
|
+
}, null, 8, yn),
|
|
2660
|
+
e("span", gn, n(u.title || "Untitled"), 1),
|
|
2641
2661
|
e("button", {
|
|
2642
2662
|
class: "artifactuse-panel__file-tab-close",
|
|
2643
2663
|
title: "Close tab",
|
|
2644
|
-
onClick:
|
|
2645
|
-
}, [...t[
|
|
2664
|
+
onClick: _e((X) => Pt(u.id), ["stop"])
|
|
2665
|
+
}, [...t[42] || (t[42] = [
|
|
2646
2666
|
e("svg", {
|
|
2647
2667
|
viewBox: "0 0 24 24",
|
|
2648
2668
|
fill: "none",
|
|
@@ -2662,42 +2682,42 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2662
2682
|
y2: "18"
|
|
2663
2683
|
})
|
|
2664
2684
|
], -1)
|
|
2665
|
-
])], 8,
|
|
2666
|
-
], 10,
|
|
2685
|
+
])], 8, kn)
|
|
2686
|
+
], 10, mn);
|
|
2667
2687
|
}), 128))
|
|
2668
2688
|
])
|
|
2669
2689
|
])) : v("", !0),
|
|
2670
2690
|
e("div", {
|
|
2671
2691
|
ref_key: "contentRef",
|
|
2672
|
-
ref:
|
|
2673
|
-
class:
|
|
2674
|
-
`artifactuse-panel__content--${y(
|
|
2692
|
+
ref: N,
|
|
2693
|
+
class: I(["artifactuse-panel__content", [
|
|
2694
|
+
`artifactuse-panel__content--${y(p).viewMode}`,
|
|
2675
2695
|
{ "artifactuse-panel__content--transitioning": m.value }
|
|
2676
2696
|
]])
|
|
2677
2697
|
}, [
|
|
2678
|
-
m.value ? (a(), s("div",
|
|
2698
|
+
m.value ? (a(), s("div", wn, [...t[43] || (t[43] = [
|
|
2679
2699
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2680
2700
|
])])) : v("", !0),
|
|
2681
|
-
y(
|
|
2701
|
+
y(p).viewMode === "preview" || y(p).viewMode === "split" ? (a(), s("div", {
|
|
2682
2702
|
key: 1,
|
|
2683
2703
|
class: "artifactuse-panel__preview",
|
|
2684
|
-
style:
|
|
2704
|
+
style: Se(y(p).viewMode === "split" ? { width: `${f.value}%` } : void 0)
|
|
2685
2705
|
}, [
|
|
2686
|
-
|
|
2706
|
+
ve.value && G.value ? (a(), s("div", bn, [...t[44] || (t[44] = [
|
|
2687
2707
|
e("div", { class: "artifactuse-panel__spinner" }, null, -1)
|
|
2688
2708
|
])])) : v("", !0),
|
|
2689
|
-
|
|
2709
|
+
G.value ? (a(), s("iframe", {
|
|
2690
2710
|
key: 1,
|
|
2691
2711
|
ref_key: "iframeRef",
|
|
2692
|
-
ref:
|
|
2693
|
-
src:
|
|
2694
|
-
class:
|
|
2712
|
+
ref: D,
|
|
2713
|
+
src: G.value,
|
|
2714
|
+
class: I(["artifactuse-panel__iframe", { "artifactuse-panel__iframe--loading": ve.value }]),
|
|
2695
2715
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads allow-top-navigation-by-user-activation",
|
|
2696
2716
|
allow: "camera; microphone; fullscreen; geolocation; display-capture; autoplay; clipboard-write; encrypted-media; gyroscope; accelerometer; picture-in-picture",
|
|
2697
|
-
onLoad:
|
|
2698
|
-
onError:
|
|
2699
|
-
}, null, 42,
|
|
2700
|
-
t[
|
|
2717
|
+
onLoad: Vt,
|
|
2718
|
+
onError: It
|
|
2719
|
+
}, null, 42, Cn)) : (a(), s("div", xn, [
|
|
2720
|
+
t[45] || (t[45] = e("svg", {
|
|
2701
2721
|
viewBox: "0 0 24 24",
|
|
2702
2722
|
fill: "none",
|
|
2703
2723
|
stroke: "currentColor",
|
|
@@ -2712,58 +2732,123 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2712
2732
|
y2: "12"
|
|
2713
2733
|
})
|
|
2714
2734
|
], -1)),
|
|
2715
|
-
e("p", null, "Preview not available for " +
|
|
2735
|
+
e("p", null, "Preview not available for " + n(j.value), 1)
|
|
2716
2736
|
]))
|
|
2717
2737
|
], 4)) : v("", !0),
|
|
2718
|
-
|
|
2738
|
+
_t(e("div", {
|
|
2719
2739
|
class: "artifactuse-panel__code",
|
|
2720
|
-
style:
|
|
2740
|
+
style: Se(y(p).viewMode === "split" ? { width: `${100 - f.value}%` } : void 0)
|
|
2721
2741
|
}, [
|
|
2722
|
-
y(
|
|
2742
|
+
y(p).viewMode === "split" ? (a(), s("div", {
|
|
2723
2743
|
key: 0,
|
|
2724
2744
|
class: "artifactuse-panel__split-handle",
|
|
2725
|
-
onMousedown:
|
|
2726
|
-
}, [...t[
|
|
2745
|
+
onMousedown: _e(Gt, ["prevent"])
|
|
2746
|
+
}, [...t[46] || (t[46] = [
|
|
2727
2747
|
e("div", { class: "artifactuse-panel__split-handle-line" }, null, -1)
|
|
2728
2748
|
])], 32)) : v("", !0),
|
|
2729
2749
|
e("div", {
|
|
2730
2750
|
class: "artifactuse-panel__code-scroll",
|
|
2731
2751
|
ref_key: "codeScrollRef",
|
|
2732
|
-
ref:
|
|
2733
|
-
onScroll:
|
|
2752
|
+
ref: B,
|
|
2753
|
+
onScroll: Xt
|
|
2734
2754
|
}, [
|
|
2735
2755
|
e("div", {
|
|
2736
2756
|
class: "artifactuse-panel__line-numbers",
|
|
2737
2757
|
ref_key: "lineNumbersRef",
|
|
2738
|
-
ref:
|
|
2758
|
+
ref: ee
|
|
2739
2759
|
}, null, 512),
|
|
2740
2760
|
e("pre", {
|
|
2741
|
-
class:
|
|
2761
|
+
class: I(["artifactuse-panel__code-block", `language-${me.value}`])
|
|
2742
2762
|
}, [
|
|
2743
2763
|
(a(), s("code", {
|
|
2744
2764
|
ref_key: "codeRef",
|
|
2745
|
-
ref:
|
|
2746
|
-
key: y(
|
|
2747
|
-
class:
|
|
2765
|
+
ref: U,
|
|
2766
|
+
key: y(r).id,
|
|
2767
|
+
class: I(`language-${me.value}`)
|
|
2748
2768
|
}, null, 2))
|
|
2749
2769
|
], 2)
|
|
2750
2770
|
], 544)
|
|
2751
2771
|
], 4), [
|
|
2752
|
-
[
|
|
2772
|
+
[ht, y(p).viewMode === "code" || y(p).viewMode === "split"]
|
|
2753
2773
|
]),
|
|
2754
|
-
|
|
2774
|
+
_t(e("div", $n, [
|
|
2755
2775
|
e("div", {
|
|
2756
2776
|
ref_key: "editorContainerRef",
|
|
2757
|
-
ref:
|
|
2777
|
+
ref: re,
|
|
2758
2778
|
class: "artifactuse-panel__editor-container"
|
|
2759
2779
|
}, null, 512)
|
|
2760
2780
|
], 512), [
|
|
2761
|
-
[
|
|
2781
|
+
[ht, y(p).viewMode === "edit"]
|
|
2762
2782
|
])
|
|
2763
2783
|
], 2),
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2784
|
+
$t.value ? (a(), s("div", {
|
|
2785
|
+
key: 1,
|
|
2786
|
+
class: I(["artifactuse-panel__console", { "artifactuse-panel__console--expanded": W.value }])
|
|
2787
|
+
}, [
|
|
2788
|
+
e("div", {
|
|
2789
|
+
class: "artifactuse-panel__console-header",
|
|
2790
|
+
onClick: t[14] || (t[14] = (u) => W.value = !W.value)
|
|
2791
|
+
}, [
|
|
2792
|
+
t[47] || (t[47] = e("svg", {
|
|
2793
|
+
class: "artifactuse-panel__console-chevron",
|
|
2794
|
+
viewBox: "0 0 24 24",
|
|
2795
|
+
fill: "none",
|
|
2796
|
+
stroke: "currentColor",
|
|
2797
|
+
"stroke-width": "2"
|
|
2798
|
+
}, [
|
|
2799
|
+
e("polyline", { points: "18 15 12 9 6 15" })
|
|
2800
|
+
], -1)),
|
|
2801
|
+
t[48] || (t[48] = e("span", null, "Console", -1)),
|
|
2802
|
+
e("div", {
|
|
2803
|
+
class: "artifactuse-panel__console-filters",
|
|
2804
|
+
onClick: t[12] || (t[12] = _e(() => {
|
|
2805
|
+
}, ["stop"]))
|
|
2806
|
+
}, [
|
|
2807
|
+
Oe.value > 0 ? (a(), s("button", {
|
|
2808
|
+
key: 0,
|
|
2809
|
+
class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--error", { "artifactuse-panel__console-filter--inactive": !w.value.has("error") }]),
|
|
2810
|
+
onClick: t[8] || (t[8] = (u) => He("error"))
|
|
2811
|
+
}, n(Oe.value) + " error" + n(Oe.value !== 1 ? "s" : ""), 3)) : v("", !0),
|
|
2812
|
+
Qe.value > 0 ? (a(), s("button", {
|
|
2813
|
+
key: 1,
|
|
2814
|
+
class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--warn", { "artifactuse-panel__console-filter--inactive": !w.value.has("warn") }]),
|
|
2815
|
+
onClick: t[9] || (t[9] = (u) => He("warn"))
|
|
2816
|
+
}, n(Qe.value) + " warn", 3)) : v("", !0),
|
|
2817
|
+
Ge.value > 0 ? (a(), s("button", {
|
|
2818
|
+
key: 2,
|
|
2819
|
+
class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--info", { "artifactuse-panel__console-filter--inactive": !w.value.has("info") }]),
|
|
2820
|
+
onClick: t[10] || (t[10] = (u) => He("info"))
|
|
2821
|
+
}, n(Ge.value) + " info", 3)) : v("", !0),
|
|
2822
|
+
et.value > 0 ? (a(), s("button", {
|
|
2823
|
+
key: 3,
|
|
2824
|
+
class: I(["artifactuse-panel__console-filter", "artifactuse-panel__console-filter--log", { "artifactuse-panel__console-filter--inactive": !w.value.has("log") }]),
|
|
2825
|
+
onClick: t[11] || (t[11] = (u) => He("log"))
|
|
2826
|
+
}, n(et.value) + " log", 3)) : v("", !0)
|
|
2827
|
+
]),
|
|
2828
|
+
e("button", {
|
|
2829
|
+
class: "artifactuse-panel__console-clear",
|
|
2830
|
+
onClick: t[13] || (t[13] = _e((u) => Q.value = [], ["stop"]))
|
|
2831
|
+
}, "Clear")
|
|
2832
|
+
]),
|
|
2833
|
+
W.value ? (a(), s("div", {
|
|
2834
|
+
key: 0,
|
|
2835
|
+
ref_key: "consoleEntriesEl",
|
|
2836
|
+
ref: ie,
|
|
2837
|
+
class: "artifactuse-panel__console-entries"
|
|
2838
|
+
}, [
|
|
2839
|
+
(a(!0), s(F, null, de(xt.value, (u, z) => (a(), s("div", {
|
|
2840
|
+
key: z,
|
|
2841
|
+
class: I("artifactuse-panel__console-entry artifactuse-panel__console-entry--" + u.type)
|
|
2842
|
+
}, [
|
|
2843
|
+
e("span", Mn, "[" + n(u.type) + "]", 1),
|
|
2844
|
+
e("span", Tn, n(u.content), 1),
|
|
2845
|
+
e("span", Ln, n(new Date(u.timestamp).toLocaleTimeString()), 1)
|
|
2846
|
+
], 2))), 128))
|
|
2847
|
+
], 512)) : v("", !0)
|
|
2848
|
+
], 2)) : v("", !0),
|
|
2849
|
+
e("footer", Pn, [
|
|
2850
|
+
e("div", En, [
|
|
2851
|
+
qe.value ? (a(), s("a", An, [...t[49] || (t[49] = [
|
|
2767
2852
|
e("svg", {
|
|
2768
2853
|
width: "16",
|
|
2769
2854
|
height: "16",
|
|
@@ -2782,17 +2867,17 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2782
2867
|
], -1),
|
|
2783
2868
|
e("span", null, "Artifactuse", -1)
|
|
2784
2869
|
])])) : v("", !0),
|
|
2785
|
-
y(
|
|
2870
|
+
y(r).size ? (a(), s("span", Hn, n(y(gt)(y(r).size)), 1)) : v("", !0)
|
|
2786
2871
|
]),
|
|
2787
|
-
e("div",
|
|
2872
|
+
e("div", Bn, [
|
|
2788
2873
|
e("button", {
|
|
2789
|
-
class:
|
|
2790
|
-
title:
|
|
2791
|
-
onClick:
|
|
2874
|
+
class: I(["artifactuse-panel__footer-action", { "artifactuse-panel__footer-action--success": K.value }]),
|
|
2875
|
+
title: K.value ? "Copied!" : "Copy code",
|
|
2876
|
+
onClick: Rt
|
|
2792
2877
|
}, [
|
|
2793
|
-
|
|
2878
|
+
K.value ? (a(), s("svg", Vn, [...t[51] || (t[51] = [
|
|
2794
2879
|
e("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
2795
|
-
])])) : (a(), s("svg",
|
|
2880
|
+
])])) : (a(), s("svg", zn, [...t[50] || (t[50] = [
|
|
2796
2881
|
e("rect", {
|
|
2797
2882
|
x: "9",
|
|
2798
2883
|
y: "9",
|
|
@@ -2803,12 +2888,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2803
2888
|
}, null, -1),
|
|
2804
2889
|
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)
|
|
2805
2890
|
])]))
|
|
2806
|
-
], 10,
|
|
2891
|
+
], 10, Sn),
|
|
2807
2892
|
e("button", {
|
|
2808
2893
|
class: "artifactuse-panel__footer-action",
|
|
2809
2894
|
title: "Download file",
|
|
2810
|
-
onClick:
|
|
2811
|
-
}, [...t[
|
|
2895
|
+
onClick: qt
|
|
2896
|
+
}, [...t[52] || (t[52] = [
|
|
2812
2897
|
e("svg", {
|
|
2813
2898
|
viewBox: "0 0 24 24",
|
|
2814
2899
|
fill: "none",
|
|
@@ -2825,12 +2910,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2825
2910
|
})
|
|
2826
2911
|
], -1)
|
|
2827
2912
|
])]),
|
|
2828
|
-
|
|
2913
|
+
Mt.value ? (a(), s("div", In, [
|
|
2829
2914
|
e("button", {
|
|
2830
2915
|
class: "artifactuse-panel__footer-action",
|
|
2831
2916
|
title: "Share",
|
|
2832
|
-
onClick:
|
|
2833
|
-
}, [...t[
|
|
2917
|
+
onClick: Ut
|
|
2918
|
+
}, [...t[53] || (t[53] = [
|
|
2834
2919
|
e("svg", {
|
|
2835
2920
|
viewBox: "0 0 24 24",
|
|
2836
2921
|
fill: "none",
|
|
@@ -2866,15 +2951,15 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2866
2951
|
})
|
|
2867
2952
|
], -1)
|
|
2868
2953
|
])]),
|
|
2869
|
-
ze
|
|
2870
|
-
default:
|
|
2871
|
-
|
|
2872
|
-
e("div",
|
|
2873
|
-
e("span",
|
|
2954
|
+
Fe(ze, { name: "artifactuse-popup" }, {
|
|
2955
|
+
default: Ve(() => [
|
|
2956
|
+
E.value ? (a(), s("div", Fn, [
|
|
2957
|
+
e("div", Rn, [
|
|
2958
|
+
e("span", qn, n(i.value === "success" ? Le.value ? "Artifact updated!" : "Link created!" : i.value === "update-list" ? "Update saved artifact" : "Share Artifact"), 1),
|
|
2874
2959
|
e("button", {
|
|
2875
2960
|
class: "artifactuse-share-popup__close",
|
|
2876
|
-
onClick:
|
|
2877
|
-
}, [...t[
|
|
2961
|
+
onClick: Dt
|
|
2962
|
+
}, [...t[54] || (t[54] = [
|
|
2878
2963
|
e("svg", {
|
|
2879
2964
|
viewBox: "0 0 24 24",
|
|
2880
2965
|
fill: "none",
|
|
@@ -2896,29 +2981,29 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2896
2981
|
], -1)
|
|
2897
2982
|
])])
|
|
2898
2983
|
]),
|
|
2899
|
-
e("div",
|
|
2900
|
-
|
|
2984
|
+
e("div", On, [
|
|
2985
|
+
i.value === "loading" ? (a(), s("div", Un, [...t[55] || (t[55] = [
|
|
2901
2986
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2902
2987
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Creating link...", -1)
|
|
2903
|
-
])])) :
|
|
2904
|
-
e("div",
|
|
2905
|
-
e("p",
|
|
2988
|
+
])])) : i.value === "error" ? (a(), s("div", Dn, [
|
|
2989
|
+
e("div", jn, [
|
|
2990
|
+
e("p", Nn, n(L.value), 1)
|
|
2906
2991
|
]),
|
|
2907
|
-
e("div",
|
|
2992
|
+
e("div", Wn, [
|
|
2908
2993
|
e("button", {
|
|
2909
2994
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--secondary",
|
|
2910
|
-
onClick: t[
|
|
2995
|
+
onClick: t[15] || (t[15] = (u) => i.value = "options")
|
|
2911
2996
|
}, " Back "),
|
|
2912
2997
|
e("button", {
|
|
2913
2998
|
class: "artifactuse-share-popup__btn artifactuse-share-popup__btn--primary",
|
|
2914
|
-
onClick:
|
|
2999
|
+
onClick: jt
|
|
2915
3000
|
}, " Retry ")
|
|
2916
3001
|
])
|
|
2917
|
-
])) :
|
|
3002
|
+
])) : i.value === "options" ? (a(), s("div", Jn, [
|
|
2918
3003
|
e("button", {
|
|
2919
3004
|
class: "artifactuse-share-popup__option",
|
|
2920
|
-
onClick:
|
|
2921
|
-
}, [...t[
|
|
3005
|
+
onClick: nt
|
|
3006
|
+
}, [...t[56] || (t[56] = [
|
|
2922
3007
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2923
3008
|
e("svg", {
|
|
2924
3009
|
viewBox: "0 0 24 24",
|
|
@@ -2937,8 +3022,8 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2937
3022
|
])]),
|
|
2938
3023
|
e("button", {
|
|
2939
3024
|
class: "artifactuse-share-popup__option",
|
|
2940
|
-
onClick:
|
|
2941
|
-
}, [...t[
|
|
3025
|
+
onClick: ot
|
|
3026
|
+
}, [...t[57] || (t[57] = [
|
|
2942
3027
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2943
3028
|
e("svg", {
|
|
2944
3029
|
viewBox: "0 0 24 24",
|
|
@@ -2958,8 +3043,8 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2958
3043
|
])]),
|
|
2959
3044
|
e("button", {
|
|
2960
3045
|
class: "artifactuse-share-popup__option",
|
|
2961
|
-
onClick:
|
|
2962
|
-
}, [...t[
|
|
3046
|
+
onClick: Nt
|
|
3047
|
+
}, [...t[58] || (t[58] = [
|
|
2963
3048
|
e("div", { class: "artifactuse-share-popup__option-icon" }, [
|
|
2964
3049
|
e("svg", {
|
|
2965
3050
|
viewBox: "0 0 24 24",
|
|
@@ -2977,29 +3062,29 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
2977
3062
|
e("p", { class: "artifactuse-share-popup__option-desc" }, "Replace an existing artifact")
|
|
2978
3063
|
], -1)
|
|
2979
3064
|
])])
|
|
2980
|
-
])) :
|
|
2981
|
-
|
|
3065
|
+
])) : i.value === "update-list" ? (a(), s("div", Xn, [
|
|
3066
|
+
be.value ? (a(), s("div", Zn, [...t[59] || (t[59] = [
|
|
2982
3067
|
e("div", { class: "artifactuse-share-popup__spinner" }, null, -1),
|
|
2983
3068
|
e("p", { class: "artifactuse-share-popup__loading-text" }, "Loading artifacts...", -1)
|
|
2984
|
-
])])) :
|
|
2985
|
-
(a(!0), s(
|
|
2986
|
-
var
|
|
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;
|
|
2987
3072
|
return a(), s("button", {
|
|
2988
|
-
key: ((
|
|
3073
|
+
key: ((z = u.project) == null ? void 0 : z.uuid) || u.id,
|
|
2989
3074
|
class: "artifactuse-share-popup__artifact-item",
|
|
2990
|
-
onClick: (
|
|
3075
|
+
onClick: (pe) => Wt(u)
|
|
2991
3076
|
}, [
|
|
2992
|
-
e("span",
|
|
2993
|
-
e("span",
|
|
2994
|
-
], 8,
|
|
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)
|
|
3079
|
+
], 8, Qn);
|
|
2995
3080
|
}), 128))
|
|
2996
3081
|
])),
|
|
2997
3082
|
e("button", {
|
|
2998
3083
|
class: "artifactuse-share-popup__back-btn",
|
|
2999
|
-
onClick: t[
|
|
3084
|
+
onClick: t[16] || (t[16] = (u) => i.value = "options")
|
|
3000
3085
|
}, "Back")
|
|
3001
|
-
])) :
|
|
3002
|
-
t[
|
|
3086
|
+
])) : i.value === "success" ? (a(), s("div", to, [
|
|
3087
|
+
t[62] || (t[62] = e("div", { class: "artifactuse-share-popup__success-icon" }, [
|
|
3003
3088
|
e("svg", {
|
|
3004
3089
|
viewBox: "0 0 24 24",
|
|
3005
3090
|
fill: "none",
|
|
@@ -3009,21 +3094,21 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3009
3094
|
e("polyline", { points: "20 6 9 17 4 12" })
|
|
3010
3095
|
])
|
|
3011
3096
|
], -1)),
|
|
3012
|
-
e("div",
|
|
3097
|
+
e("div", ao, [
|
|
3013
3098
|
e("input", {
|
|
3014
3099
|
type: "text",
|
|
3015
3100
|
class: "artifactuse-share-popup__link",
|
|
3016
|
-
value:
|
|
3101
|
+
value: H.value,
|
|
3017
3102
|
readonly: "",
|
|
3018
|
-
onClick: t[
|
|
3019
|
-
}, null, 8,
|
|
3103
|
+
onClick: t[17] || (t[17] = (u) => u.target.select())
|
|
3104
|
+
}, null, 8, so),
|
|
3020
3105
|
e("button", {
|
|
3021
|
-
class:
|
|
3022
|
-
onClick:
|
|
3023
|
-
},
|
|
3106
|
+
class: I(["artifactuse-share-popup__copy-btn", { "artifactuse-share-popup__copy-btn--copied": se.value }]),
|
|
3107
|
+
onClick: Jt
|
|
3108
|
+
}, n(se.value ? "Copied!" : "Copy"), 3)
|
|
3024
3109
|
]),
|
|
3025
|
-
|
|
3026
|
-
t[
|
|
3110
|
+
d.value && !ce.value ? (a(), s("div", lo, [
|
|
3111
|
+
t[60] || (t[60] = e("span", { class: "artifactuse-share-popup__expiry-icon" }, [
|
|
3027
3112
|
e("svg", {
|
|
3028
3113
|
viewBox: "0 0 24 24",
|
|
3029
3114
|
fill: "none",
|
|
@@ -3049,18 +3134,18 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3049
3134
|
})
|
|
3050
3135
|
])
|
|
3051
3136
|
], -1)),
|
|
3052
|
-
e("span",
|
|
3137
|
+
e("span", io, " Expires " + n(it(d.value)), 1)
|
|
3053
3138
|
])) : v("", !0),
|
|
3054
|
-
|
|
3055
|
-
t[
|
|
3139
|
+
ce.value ? v("", !0) : (a(), s("div", no, [
|
|
3140
|
+
t[61] || (t[61] = e("p", { class: "artifactuse-share-popup__save-prompt-text" }, "Keep it permanently?", -1)),
|
|
3056
3141
|
e("button", {
|
|
3057
3142
|
class: "artifactuse-share-popup__save-prompt-btn",
|
|
3058
|
-
onClick:
|
|
3143
|
+
onClick: ot
|
|
3059
3144
|
}, " Save to account ")
|
|
3060
3145
|
]))
|
|
3061
3146
|
])) : v("", !0)
|
|
3062
3147
|
]),
|
|
3063
|
-
t[
|
|
3148
|
+
t[63] || (t[63] = e("div", { class: "artifactuse-share-popup__footer" }, [
|
|
3064
3149
|
e("a", {
|
|
3065
3150
|
href: "https://artifactuse.com",
|
|
3066
3151
|
target: "_blank",
|
|
@@ -3091,12 +3176,12 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3091
3176
|
_: 1
|
|
3092
3177
|
})
|
|
3093
3178
|
])) : v("", !0),
|
|
3094
|
-
|
|
3179
|
+
G.value ? (a(), s("button", {
|
|
3095
3180
|
key: 1,
|
|
3096
3181
|
class: "artifactuse-panel__footer-action",
|
|
3097
3182
|
title: "Open in new tab",
|
|
3098
|
-
onClick:
|
|
3099
|
-
}, [...t[
|
|
3183
|
+
onClick: rt
|
|
3184
|
+
}, [...t[64] || (t[64] = [
|
|
3100
3185
|
e("svg", {
|
|
3101
3186
|
viewBox: "0 0 24 24",
|
|
3102
3187
|
fill: "none",
|
|
@@ -3113,13 +3198,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3113
3198
|
})
|
|
3114
3199
|
], -1)
|
|
3115
3200
|
])])) : v("", !0),
|
|
3116
|
-
!
|
|
3201
|
+
!Ee.value && fe.value.length > 1 ? (a(), s("div", oo, [
|
|
3117
3202
|
e("button", {
|
|
3118
3203
|
class: "artifactuse-panel__nav-btn",
|
|
3119
|
-
disabled:
|
|
3204
|
+
disabled: Pe.value <= 0,
|
|
3120
3205
|
title: "Previous artifact",
|
|
3121
|
-
onClick:
|
|
3122
|
-
}, [...t[
|
|
3206
|
+
onClick: Kt
|
|
3207
|
+
}, [...t[65] || (t[65] = [
|
|
3123
3208
|
e("svg", {
|
|
3124
3209
|
viewBox: "0 0 24 24",
|
|
3125
3210
|
fill: "none",
|
|
@@ -3128,14 +3213,14 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3128
3213
|
}, [
|
|
3129
3214
|
e("polyline", { points: "15 18 9 12 15 6" })
|
|
3130
3215
|
], -1)
|
|
3131
|
-
])], 8,
|
|
3216
|
+
])], 8, ro),
|
|
3132
3217
|
e("button", {
|
|
3133
3218
|
class: "artifactuse-panel__nav-trigger",
|
|
3134
3219
|
title: "View all artifacts",
|
|
3135
|
-
onClick:
|
|
3220
|
+
onClick: Zt
|
|
3136
3221
|
}, [
|
|
3137
|
-
e("span", null,
|
|
3138
|
-
t[
|
|
3222
|
+
e("span", null, n(Pe.value + 1) + " / " + n(fe.value.length), 1),
|
|
3223
|
+
t[66] || (t[66] = e("svg", {
|
|
3139
3224
|
viewBox: "0 0 24 24",
|
|
3140
3225
|
fill: "none",
|
|
3141
3226
|
stroke: "currentColor",
|
|
@@ -3146,10 +3231,10 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3146
3231
|
]),
|
|
3147
3232
|
e("button", {
|
|
3148
3233
|
class: "artifactuse-panel__nav-btn",
|
|
3149
|
-
disabled:
|
|
3234
|
+
disabled: Pe.value >= fe.value.length - 1,
|
|
3150
3235
|
title: "Next artifact",
|
|
3151
|
-
onClick:
|
|
3152
|
-
}, [...t[
|
|
3236
|
+
onClick: Yt
|
|
3237
|
+
}, [...t[67] || (t[67] = [
|
|
3153
3238
|
e("svg", {
|
|
3154
3239
|
viewBox: "0 0 24 24",
|
|
3155
3240
|
fill: "none",
|
|
@@ -3158,16 +3243,16 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3158
3243
|
}, [
|
|
3159
3244
|
e("polyline", { points: "9 18 15 12 9 6" })
|
|
3160
3245
|
], -1)
|
|
3161
|
-
])], 8,
|
|
3162
|
-
ze
|
|
3163
|
-
default:
|
|
3164
|
-
|
|
3165
|
-
e("div",
|
|
3166
|
-
t[
|
|
3246
|
+
])], 8, co),
|
|
3247
|
+
Fe(ze, { name: "artifactuse-popup" }, {
|
|
3248
|
+
default: Ve(() => [
|
|
3249
|
+
Z.value ? (a(), s("div", uo, [
|
|
3250
|
+
e("div", vo, [
|
|
3251
|
+
t[69] || (t[69] = e("span", null, "Artifacts", -1)),
|
|
3167
3252
|
e("button", {
|
|
3168
3253
|
class: "artifactuse-panel__artifact-list-close",
|
|
3169
|
-
onClick: t[
|
|
3170
|
-
}, [...t[
|
|
3254
|
+
onClick: t[18] || (t[18] = (u) => Z.value = !1)
|
|
3255
|
+
}, [...t[68] || (t[68] = [
|
|
3171
3256
|
e("svg", {
|
|
3172
3257
|
viewBox: "0 0 24 24",
|
|
3173
3258
|
fill: "none",
|
|
@@ -3189,27 +3274,27 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3189
3274
|
], -1)
|
|
3190
3275
|
])])
|
|
3191
3276
|
]),
|
|
3192
|
-
e("div",
|
|
3193
|
-
(a(!0), s(
|
|
3194
|
-
key:
|
|
3195
|
-
class:
|
|
3196
|
-
onClick: (
|
|
3277
|
+
e("div", fo, [
|
|
3278
|
+
(a(!0), s(F, null, de(fe.value, (u, z) => (a(), s("button", {
|
|
3279
|
+
key: u.id,
|
|
3280
|
+
class: I(["artifactuse-panel__artifact-item", { "artifactuse-panel__artifact-item--active": u.id === y(r).id }]),
|
|
3281
|
+
onClick: (X) => ct(u)
|
|
3197
3282
|
}, [
|
|
3198
3283
|
e("span", {
|
|
3199
3284
|
class: "artifactuse-panel__artifact-item-icon",
|
|
3200
|
-
innerHTML:
|
|
3201
|
-
}, null, 8,
|
|
3202
|
-
e("div",
|
|
3203
|
-
e("span",
|
|
3204
|
-
e("span",
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3285
|
+
innerHTML: Ue(u.language)
|
|
3286
|
+
}, null, 8, _o),
|
|
3287
|
+
e("div", ho, [
|
|
3288
|
+
e("span", mo, n(u.title || "Untitled"), 1),
|
|
3289
|
+
e("span", yo, [
|
|
3290
|
+
Y(n(y(Ie)(u.language)) + " ", 1),
|
|
3291
|
+
u.lineCount ? (a(), s(F, { key: 0 }, [
|
|
3292
|
+
Y(" • " + n(u.lineCount) + " lines ", 1)
|
|
3208
3293
|
], 64)) : v("", !0)
|
|
3209
3294
|
])
|
|
3210
3295
|
]),
|
|
3211
|
-
e("span",
|
|
3212
|
-
], 10,
|
|
3296
|
+
e("span", go, n(z + 1), 1)
|
|
3297
|
+
], 10, po))), 128))
|
|
3213
3298
|
])
|
|
3214
3299
|
])) : v("", !0)
|
|
3215
3300
|
]),
|
|
@@ -3224,19 +3309,19 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3224
3309
|
_: 1
|
|
3225
3310
|
}));
|
|
3226
3311
|
}
|
|
3227
|
-
},
|
|
3312
|
+
}, ko = ["title"], wo = {
|
|
3228
3313
|
key: 0,
|
|
3229
3314
|
class: "artifactuse-panel-toggle-badge"
|
|
3230
|
-
},
|
|
3315
|
+
}, Lo = {
|
|
3231
3316
|
__name: "ArtifactusePanelToggle",
|
|
3232
|
-
setup(
|
|
3233
|
-
const { state: c, artifactCount: _, hasArtifacts:
|
|
3234
|
-
return (
|
|
3235
|
-
class:
|
|
3317
|
+
setup(P) {
|
|
3318
|
+
const { state: c, artifactCount: _, hasArtifacts: T, togglePanel: p } = Re();
|
|
3319
|
+
return (r, q) => (a(), s("button", {
|
|
3320
|
+
class: I(["artifactuse-panel-toggle", {
|
|
3236
3321
|
"artifactuse-panel-toggle--active": y(c).isPanelOpen,
|
|
3237
|
-
"artifactuse-panel-toggle--has-artifacts": y(
|
|
3322
|
+
"artifactuse-panel-toggle--has-artifacts": y(T)
|
|
3238
3323
|
}]),
|
|
3239
|
-
onClick: q[0] || (q[0] = (...
|
|
3324
|
+
onClick: q[0] || (q[0] = (...A) => y(p) && y(p)(...A)),
|
|
3240
3325
|
title: y(c).isPanelOpen ? "Close artifacts panel" : "Open artifacts panel"
|
|
3241
3326
|
}, [
|
|
3242
3327
|
q[1] || (q[1] = e("svg", {
|
|
@@ -3250,13 +3335,13 @@ const Gt = { class: "artifactuse-card__icon" }, ea = ["innerHTML"], ta = { class
|
|
|
3250
3335
|
e("polyline", { points: "16 18 22 12 16 6" }),
|
|
3251
3336
|
e("polyline", { points: "8 6 2 12 8 18" })
|
|
3252
3337
|
], -1)),
|
|
3253
|
-
y(_) > 0 ? (a(), s("span",
|
|
3254
|
-
], 10,
|
|
3338
|
+
y(_) > 0 ? (a(), s("span", wo, n(y(_) > 99 ? "99+" : y(_)), 1)) : v("", !0)
|
|
3339
|
+
], 10, ko));
|
|
3255
3340
|
}
|
|
3256
|
-
},
|
|
3257
|
-
function
|
|
3258
|
-
var
|
|
3259
|
-
const c =
|
|
3341
|
+
}, wt = Symbol("artifactuse");
|
|
3342
|
+
function bt(P = {}) {
|
|
3343
|
+
var o;
|
|
3344
|
+
const c = kt(P), _ = yt({
|
|
3260
3345
|
artifacts: [],
|
|
3261
3346
|
activeArtifactId: null,
|
|
3262
3347
|
isPanelOpen: !1,
|
|
@@ -3269,9 +3354,9 @@ function pt(H = {}) {
|
|
|
3269
3354
|
c.state.subscribe((h) => {
|
|
3270
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;
|
|
3271
3356
|
});
|
|
3272
|
-
const
|
|
3273
|
-
if (c.applyTheme(),
|
|
3274
|
-
const h = ((
|
|
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);
|
|
3358
|
+
if (c.applyTheme(), P.theme === "auto" || !P.theme) {
|
|
3359
|
+
const h = ((o = c.bridge) == null ? void 0 : o.theme) || c.theme;
|
|
3275
3360
|
h != null && h.watchSystemTheme && h.watchSystemTheme(() => {
|
|
3276
3361
|
c.applyTheme();
|
|
3277
3362
|
});
|
|
@@ -3279,12 +3364,12 @@ function pt(H = {}) {
|
|
|
3279
3364
|
const g = {
|
|
3280
3365
|
instance: c,
|
|
3281
3366
|
state: _,
|
|
3282
|
-
activeArtifact:
|
|
3283
|
-
artifactCount:
|
|
3284
|
-
hasArtifacts:
|
|
3367
|
+
activeArtifact: T,
|
|
3368
|
+
artifactCount: p,
|
|
3369
|
+
hasArtifacts: r,
|
|
3285
3370
|
// Panel computed
|
|
3286
3371
|
panelTypes: q,
|
|
3287
|
-
activePanelUrl:
|
|
3372
|
+
activePanelUrl: A,
|
|
3288
3373
|
// Methods
|
|
3289
3374
|
processMessage: c.processMessage,
|
|
3290
3375
|
initializeContent: c.initializeContent,
|
|
@@ -3320,14 +3405,14 @@ function pt(H = {}) {
|
|
|
3320
3405
|
},
|
|
3321
3406
|
getTheme: c.getTheme
|
|
3322
3407
|
};
|
|
3323
|
-
return
|
|
3408
|
+
return ia(wt, g), g;
|
|
3324
3409
|
}
|
|
3325
|
-
function
|
|
3326
|
-
const
|
|
3327
|
-
return
|
|
3410
|
+
function Re() {
|
|
3411
|
+
const P = na(wt);
|
|
3412
|
+
return P || (console.warn("useArtifactuse() called without provideArtifactuse(). Creating standalone instance."), bt());
|
|
3328
3413
|
}
|
|
3329
|
-
function
|
|
3330
|
-
const c =
|
|
3414
|
+
function bo(P = {}) {
|
|
3415
|
+
const c = kt(P), _ = yt({
|
|
3331
3416
|
artifacts: [],
|
|
3332
3417
|
activeArtifactId: null,
|
|
3333
3418
|
isPanelOpen: !1,
|
|
@@ -3337,23 +3422,23 @@ function no(H = {}) {
|
|
|
3337
3422
|
tabViewModes: {},
|
|
3338
3423
|
forceEmptyView: !1
|
|
3339
3424
|
});
|
|
3340
|
-
let
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
_.artifacts =
|
|
3425
|
+
let T;
|
|
3426
|
+
Te(() => {
|
|
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;
|
|
3344
3429
|
}), c.applyTheme();
|
|
3345
|
-
}),
|
|
3346
|
-
|
|
3430
|
+
}), Ye(() => {
|
|
3431
|
+
T && T(), c.destroy();
|
|
3347
3432
|
});
|
|
3348
|
-
const
|
|
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);
|
|
3349
3434
|
return {
|
|
3350
3435
|
instance: c,
|
|
3351
3436
|
state: _,
|
|
3352
|
-
activeArtifact:
|
|
3353
|
-
artifactCount:
|
|
3437
|
+
activeArtifact: p,
|
|
3438
|
+
artifactCount: r,
|
|
3354
3439
|
hasArtifacts: q,
|
|
3355
3440
|
// Panel computed
|
|
3356
|
-
panelTypes:
|
|
3441
|
+
panelTypes: A,
|
|
3357
3442
|
activePanelUrl: g,
|
|
3358
3443
|
// Methods
|
|
3359
3444
|
processMessage: c.processMessage,
|
|
@@ -3385,29 +3470,29 @@ function no(H = {}) {
|
|
|
3385
3470
|
clearArtifacts: () => c.state.clear(),
|
|
3386
3471
|
// Theme - wrap setTheme to also apply
|
|
3387
3472
|
applyTheme: c.applyTheme,
|
|
3388
|
-
setTheme: (
|
|
3389
|
-
c.setTheme(
|
|
3473
|
+
setTheme: (o) => {
|
|
3474
|
+
c.setTheme(o), c.applyTheme();
|
|
3390
3475
|
},
|
|
3391
3476
|
getTheme: c.getTheme
|
|
3392
3477
|
};
|
|
3393
3478
|
}
|
|
3394
|
-
const
|
|
3395
|
-
provideArtifactuse:
|
|
3396
|
-
useArtifactuse:
|
|
3397
|
-
createArtifactuseComposable:
|
|
3398
|
-
DEFAULT_PANELS:
|
|
3479
|
+
const Po = {
|
|
3480
|
+
provideArtifactuse: bt,
|
|
3481
|
+
useArtifactuse: Re,
|
|
3482
|
+
createArtifactuseComposable: bo,
|
|
3483
|
+
DEFAULT_PANELS: ca
|
|
3399
3484
|
};
|
|
3400
3485
|
export {
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3486
|
+
Mo as ArtifactuseAgentMessage,
|
|
3487
|
+
ba as ArtifactuseCard,
|
|
3488
|
+
ds as ArtifactuseInlineForm,
|
|
3489
|
+
To as ArtifactusePanel,
|
|
3490
|
+
Lo as ArtifactusePanelToggle,
|
|
3491
|
+
pi as ArtifactuseSocialPreview,
|
|
3492
|
+
bi as ArtifactuseViewer,
|
|
3493
|
+
ca as DEFAULT_PANELS,
|
|
3494
|
+
bo as createArtifactuseComposable,
|
|
3495
|
+
Po as default,
|
|
3496
|
+
bt as provideArtifactuse,
|
|
3497
|
+
Re as useArtifactuse
|
|
3413
3498
|
};
|