@mtngtools/frame-vue 0.0.26-experimental.0 → 0.0.27-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FetchCard-BM8A35iP.js → FetchCard-IAJlHt45.js} +304 -268
- package/dist/components/live/LiveFrame/LiveFrame.vue.d.ts +4 -0
- package/dist/components/live/LiveFrame/LiveFrame.vue.d.ts.map +1 -1
- package/dist/components/live/LiveFrame/helpers.test.d.ts +90 -6
- package/dist/components/live/LiveFrame/helpers.test.d.ts.map +1 -1
- package/dist/components.js +2 -2
- package/dist/frame-vue.css +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- /package/dist/{IconClose-7R37a2Ma.js → IconClose-B7WnTow-.js} +0 -0
|
@@ -1,6 +1,171 @@
|
|
|
1
|
-
import { i as IconPanelRight_default, n as IconPanelFull_default, r as IconPanelBottom_default, t as IconClose_default } from "./IconClose-
|
|
1
|
+
import { i as IconPanelRight_default, n as IconPanelFull_default, r as IconPanelBottom_default, t as IconClose_default } from "./IconClose-B7WnTow-.js";
|
|
2
2
|
import { n as useSimpleLoggedIn } from "./useSimpleLoggedIn-DT4aMAWu.js";
|
|
3
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReadonly, shallowRef, toDisplayString, toRaw, toValue, unref, useSlots, vModelCheckbox, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, isRef, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReadonly, shallowRef, toDisplayString, toRaw, toValue, unref, useSlots, vModelCheckbox, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
4
|
+
function tryOnScopeDispose(e, t) {
|
|
5
|
+
return getCurrentScope() ? (onScopeDispose(e, t), !0) : !1;
|
|
6
|
+
}
|
|
7
|
+
var isClient = typeof window < "u" && typeof document < "u";
|
|
8
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
9
|
+
var toString = Object.prototype.toString, isObject = (e) => toString.call(e) === "[object Object]";
|
|
10
|
+
function createSingletonPromise(e) {
|
|
11
|
+
let t;
|
|
12
|
+
function n() {
|
|
13
|
+
return t ||= e(), t;
|
|
14
|
+
}
|
|
15
|
+
return n.reset = async () => {
|
|
16
|
+
let e = t;
|
|
17
|
+
t = void 0, e && await e;
|
|
18
|
+
}, n;
|
|
19
|
+
}
|
|
20
|
+
function toArray(e) {
|
|
21
|
+
return Array.isArray(e) ? e : [e];
|
|
22
|
+
}
|
|
23
|
+
function useIntervalFn(e, t = 1e3, n = {}) {
|
|
24
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = null, o = shallowRef(!1);
|
|
25
|
+
function s() {
|
|
26
|
+
a &&= (clearInterval(a), null);
|
|
27
|
+
}
|
|
28
|
+
function c() {
|
|
29
|
+
o.value = !1, s();
|
|
30
|
+
}
|
|
31
|
+
function l() {
|
|
32
|
+
let n = toValue(t);
|
|
33
|
+
n <= 0 || (o.value = !0, i && e(), s(), o.value && (a = setInterval(e, n)));
|
|
34
|
+
}
|
|
35
|
+
return r && isClient && l(), (isRef(t) || typeof t == "function") && tryOnScopeDispose(watch(t, () => {
|
|
36
|
+
o.value && isClient && l();
|
|
37
|
+
})), tryOnScopeDispose(c), {
|
|
38
|
+
isActive: shallowReadonly(o),
|
|
39
|
+
pause: c,
|
|
40
|
+
resume: l
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function useTimeoutFn(e, t, n = {}) {
|
|
44
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = shallowRef(!1), o;
|
|
45
|
+
function s() {
|
|
46
|
+
o &&= (clearTimeout(o), void 0);
|
|
47
|
+
}
|
|
48
|
+
function c() {
|
|
49
|
+
a.value = !1, s();
|
|
50
|
+
}
|
|
51
|
+
function l(...n) {
|
|
52
|
+
i && e(), s(), a.value = !0, o = setTimeout(() => {
|
|
53
|
+
a.value = !1, o = void 0, e(...n);
|
|
54
|
+
}, toValue(t));
|
|
55
|
+
}
|
|
56
|
+
return r && (a.value = !0, isClient && l()), tryOnScopeDispose(c), {
|
|
57
|
+
isPending: shallowReadonly(a),
|
|
58
|
+
start: l,
|
|
59
|
+
stop: c
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function watchImmediate(e, t, n) {
|
|
63
|
+
return watch(e, t, {
|
|
64
|
+
...n,
|
|
65
|
+
immediate: !0
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
var defaultWindow = isClient ? window : void 0;
|
|
69
|
+
isClient && window.document;
|
|
70
|
+
var defaultNavigator = isClient ? window.navigator : void 0;
|
|
71
|
+
isClient && window.location;
|
|
72
|
+
function unrefElement(e) {
|
|
73
|
+
let t = toValue(e);
|
|
74
|
+
return t?.$el ?? t;
|
|
75
|
+
}
|
|
76
|
+
function useEventListener(...e) {
|
|
77
|
+
let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = computed(() => {
|
|
78
|
+
let t = toArray(toValue(e[0])).filter((e) => e != null);
|
|
79
|
+
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
80
|
+
});
|
|
81
|
+
return watchImmediate(() => [
|
|
82
|
+
n.value?.map((e) => unrefElement(e)) ?? [defaultWindow].filter((e) => e != null),
|
|
83
|
+
toArray(toValue(n.value ? e[1] : e[0])),
|
|
84
|
+
toArray(unref(n.value ? e[2] : e[1])),
|
|
85
|
+
toValue(n.value ? e[3] : e[2])
|
|
86
|
+
], ([e, n, r, i], a, o) => {
|
|
87
|
+
if (!e?.length || !n?.length || !r?.length) return;
|
|
88
|
+
let s = isObject(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
|
|
89
|
+
o(() => {
|
|
90
|
+
c.forEach((e) => e());
|
|
91
|
+
});
|
|
92
|
+
}, { flush: "post" });
|
|
93
|
+
}
|
|
94
|
+
function useMounted() {
|
|
95
|
+
let e = shallowRef(!1), t = getCurrentInstance();
|
|
96
|
+
return t && onMounted(() => {
|
|
97
|
+
e.value = !0;
|
|
98
|
+
}, t), e;
|
|
99
|
+
}
|
|
100
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
101
|
+
function useSupported(e) {
|
|
102
|
+
let t = useMounted();
|
|
103
|
+
return computed(() => (t.value, !!e()));
|
|
104
|
+
}
|
|
105
|
+
function usePermission(e, t = {}) {
|
|
106
|
+
let { controls: n = !1, navigator: r = defaultNavigator } = t, i = /* @__PURE__ */ useSupported(() => r && "permissions" in r), a = shallowRef(), o = typeof e == "string" ? { name: e } : e, s = shallowRef(), c = () => {
|
|
107
|
+
s.value = a.value?.state ?? "prompt";
|
|
108
|
+
};
|
|
109
|
+
useEventListener(a, "change", c, { passive: !0 });
|
|
110
|
+
let l = createSingletonPromise(async () => {
|
|
111
|
+
if (i.value) {
|
|
112
|
+
if (!a.value) try {
|
|
113
|
+
a.value = await r.permissions.query(o);
|
|
114
|
+
} catch {
|
|
115
|
+
a.value = void 0;
|
|
116
|
+
} finally {
|
|
117
|
+
c();
|
|
118
|
+
}
|
|
119
|
+
if (n) return toRaw(a.value);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return l(), n ? {
|
|
123
|
+
state: s,
|
|
124
|
+
isSupported: i,
|
|
125
|
+
query: l
|
|
126
|
+
} : s;
|
|
127
|
+
}
|
|
128
|
+
function useClipboard(e = {}) {
|
|
129
|
+
let { navigator: t = defaultNavigator, read: n = !1, source: r, copiedDuring: i = 1500, legacy: a = !1 } = e, s = /* @__PURE__ */ useSupported(() => t && "clipboard" in t), c = usePermission("clipboard-read"), l = usePermission("clipboard-write"), u = computed(() => s.value || a), d = shallowRef(""), f = shallowRef(!1), p = useTimeoutFn(() => f.value = !1, i, { immediate: !1 });
|
|
130
|
+
async function m() {
|
|
131
|
+
let e = !(s.value && v(c.value));
|
|
132
|
+
if (!e) try {
|
|
133
|
+
d.value = await t.clipboard.readText();
|
|
134
|
+
} catch {
|
|
135
|
+
e = !0;
|
|
136
|
+
}
|
|
137
|
+
e && (d.value = _());
|
|
138
|
+
}
|
|
139
|
+
u.value && n && useEventListener(["copy", "cut"], m, { passive: !0 });
|
|
140
|
+
async function h(e = toValue(r)) {
|
|
141
|
+
if (u.value && e != null) {
|
|
142
|
+
let n = !(s.value && v(l.value));
|
|
143
|
+
if (!n) try {
|
|
144
|
+
await t.clipboard.writeText(e);
|
|
145
|
+
} catch {
|
|
146
|
+
n = !0;
|
|
147
|
+
}
|
|
148
|
+
n && g(e), d.value = e, f.value = !0, p.start();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function g(e) {
|
|
152
|
+
let t = document.createElement("textarea");
|
|
153
|
+
t.value = e, t.style.position = "absolute", t.style.opacity = "0", t.setAttribute("readonly", ""), document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
154
|
+
}
|
|
155
|
+
function _() {
|
|
156
|
+
var e, t;
|
|
157
|
+
return ((e = document) == null || (t = e.getSelection) == null || (t = t.call(e)) == null ? void 0 : t.toString()) ?? "";
|
|
158
|
+
}
|
|
159
|
+
function v(e) {
|
|
160
|
+
return e === "granted" || e === "prompt";
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
isSupported: u,
|
|
164
|
+
text: readonly(d),
|
|
165
|
+
copied: readonly(f),
|
|
166
|
+
copy: h
|
|
167
|
+
};
|
|
168
|
+
}
|
|
4
169
|
var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ */ defineComponent({
|
|
5
170
|
__name: "SidePanelControlButton",
|
|
6
171
|
props: {
|
|
@@ -43,7 +208,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
43
208
|
return u.activeResolved ? `${e} text-accent-400/80 bg-accent/20 border-accent-900/10` : `${e} text-accent-200 bg-accent/50 hover:bg-accent/90 border-accent hover:text-white hover:border-white`;
|
|
44
209
|
}
|
|
45
210
|
});
|
|
46
|
-
function
|
|
211
|
+
function _() {
|
|
47
212
|
u.disabled || f("click", u.state);
|
|
48
213
|
}
|
|
49
214
|
return (e, t) => (openBlock(), createElementBlock("button", {
|
|
@@ -65,7 +230,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
65
230
|
lineHeight: "1.2rem",
|
|
66
231
|
textTransform: "uppercase"
|
|
67
232
|
},
|
|
68
|
-
onClick:
|
|
233
|
+
onClick: _
|
|
69
234
|
}, [renderSlot(e.$slots, "icon", { state: i.state }, () => [!i.hideIcon && m[i.state] ? (openBlock(), createBlock(resolveDynamicComponent(m[i.state]), {
|
|
70
235
|
key: 0,
|
|
71
236
|
style: {
|
|
@@ -384,7 +549,12 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
384
549
|
type: Boolean,
|
|
385
550
|
default: !1
|
|
386
551
|
},
|
|
387
|
-
enforceSlotSizingQuerySelector: {}
|
|
552
|
+
enforceSlotSizingQuerySelector: {},
|
|
553
|
+
autoRefresh: {
|
|
554
|
+
type: Boolean,
|
|
555
|
+
default: !1
|
|
556
|
+
},
|
|
557
|
+
autoRefreshInterval: { default: 2e3 }
|
|
388
558
|
},
|
|
389
559
|
emits: [
|
|
390
560
|
"update:sidePanelPosition",
|
|
@@ -393,39 +563,39 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
393
563
|
"defaultSlotResize"
|
|
394
564
|
],
|
|
395
565
|
setup(e, { expose: t, emit: n }) {
|
|
396
|
-
let r = e, i = n, a = useSlots(), p = ref(null), m = ref(null), h = ref(null),
|
|
397
|
-
function
|
|
566
|
+
let r = e, i = n, a = useSlots(), p = ref(null), m = ref(null), h = ref(null), g = ref(0), v = ref(0), y = ref(0), b = ref(0), x = ref(0);
|
|
567
|
+
function S() {
|
|
398
568
|
let e = h.value;
|
|
399
569
|
if (!e) return;
|
|
400
|
-
let t = r.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(r.enforceSlotSizingQuerySelector)) : Array.from(e.children), n = `${
|
|
570
|
+
let t = r.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(r.enforceSlotSizingQuerySelector)) : Array.from(e.children), n = `${x.value}px`;
|
|
401
571
|
t.forEach((e) => {
|
|
402
572
|
e.style.height !== n && (e.style.height = n);
|
|
403
573
|
});
|
|
404
574
|
}
|
|
405
|
-
let w = ref("none"), T = ref("none"), E = ref([]),
|
|
575
|
+
let w = ref("none"), T = ref("none"), E = ref([]), D = ref("none"), O = ref(!0), k = ref(!1), A = {
|
|
406
576
|
sm: 640,
|
|
407
577
|
md: 768,
|
|
408
578
|
lg: 1024,
|
|
409
579
|
xl: 1280,
|
|
410
580
|
"2xl": 1536
|
|
411
|
-
},
|
|
581
|
+
}, j = computed(() => {
|
|
412
582
|
if (typeof window < "u" && r.displaySidePanelWindowFn && typeof window[r.displaySidePanelWindowFn] == "function") return !!window[r.displaySidePanelWindowFn]();
|
|
413
583
|
let e = unref(r.displaySidePanel);
|
|
414
584
|
return typeof e == "function" ? e() : !!e;
|
|
415
|
-
}),
|
|
416
|
-
let e =
|
|
417
|
-
return
|
|
418
|
-
}),
|
|
585
|
+
}), M = computed(() => !!a.sidePanelContent && j.value), N = computed(() => !!a.header), oe = computed(() => E.value.filter((e) => e !== "auto")), P = computed(() => Math.max(0, v.value - y.value)), F = computed(() => g.value < Se(r.controlsOverlayOnly)), se = computed(() => g.value === 0 ? !1 : P.value / g.value > 1.1), ce = computed(() => T.value === "right" && D.value === "wide-right" ? r.sidePanelMaxRightWide : r.sidePanelMaxRight), le = computed(() => Ce(r.mainContentAspectRatio, 16 / 9)), ue = computed(() => b.value > 0 ? b.value : Math.max(1, g.value)), de = computed(() => ue.value / le.value + 20), fe = computed(() => Math.max(1, g.value) / le.value), pe = computed(() => K(r.sidePanelMinBottom, g.value, v.value)), me = computed(() => {
|
|
586
|
+
let e = fe.value + pe.value;
|
|
587
|
+
return P.value >= e;
|
|
588
|
+
}), he = computed(() => Math.max(0, P.value - de.value)), ge = computed(() => {
|
|
419
589
|
if (T.value !== "bottom") return r.sidePanelMinBottom;
|
|
420
|
-
let e =
|
|
590
|
+
let e = K(r.sidePanelMinBottom, g.value, v.value), t = Math.min(e, I.value);
|
|
421
591
|
return `${Math.max(0, Math.floor(t))}px`;
|
|
422
|
-
}),
|
|
423
|
-
let e =
|
|
424
|
-
return Math.max(0, Math.min(e,
|
|
425
|
-
}),
|
|
592
|
+
}), I = computed(() => {
|
|
593
|
+
let e = K(T.value === "bottom" && D.value === "tall-bottom" ? r.sidePanelMaxBottomTall : r.sidePanelMaxBottom, g.value, v.value);
|
|
594
|
+
return Math.max(0, Math.min(e, he.value));
|
|
595
|
+
}), L = computed(() => T.value === "bottom" ? `${Math.max(0, Math.floor(I.value))}px` : r.sidePanelMaxBottom), _e = computed(() => T.value === "right" || T.value === "bottom" ? {} : T.value === "full" && !F.value ? {
|
|
426
596
|
opacity: 0,
|
|
427
597
|
pointerEvents: "none"
|
|
428
|
-
} : {}),
|
|
598
|
+
} : {}), R = computed(() => !M.value || F.value || T.value === "none" || T.value === "minimized" || T.value === "right" || T.value === "bottom" ? null : {
|
|
429
599
|
position: "absolute",
|
|
430
600
|
top: 0,
|
|
431
601
|
right: 0,
|
|
@@ -433,16 +603,16 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
433
603
|
left: 0,
|
|
434
604
|
zIndex: 10,
|
|
435
605
|
pointerEvents: "none"
|
|
436
|
-
}),
|
|
606
|
+
}), z = computed(() => !M.value || T.value === "none" || T.value === "full" ? { gridTemplate: "1fr / 1fr" } : T.value === "right" ? {
|
|
437
607
|
gridTemplateRows: "1fr",
|
|
438
608
|
gridTemplateColumns: `minmax(0, 1fr) max(${r.sidePanelMinRight}, ${ce.value})`
|
|
439
609
|
} : T.value === "bottom" ? {
|
|
440
|
-
gridTemplateRows: `minmax(0, 1fr) ${
|
|
610
|
+
gridTemplateRows: `minmax(0, 1fr) ${L.value}`,
|
|
441
611
|
gridTemplateColumns: "1fr"
|
|
442
612
|
} : T.value === "minimized" ? {
|
|
443
613
|
gridTemplateRows: "1fr max-content",
|
|
444
614
|
gridTemplateColumns: "1fr"
|
|
445
|
-
} : { gridTemplate: "1fr / 1fr" }),
|
|
615
|
+
} : { gridTemplate: "1fr / 1fr" }), ve = computed(() => {
|
|
446
616
|
let e = {
|
|
447
617
|
minWidth: 0,
|
|
448
618
|
minHeight: 0,
|
|
@@ -451,7 +621,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
451
621
|
placeSelf: "stretch",
|
|
452
622
|
zIndex: 20
|
|
453
623
|
};
|
|
454
|
-
if (
|
|
624
|
+
if (M.value) {
|
|
455
625
|
if (T.value === "right") return {
|
|
456
626
|
...e,
|
|
457
627
|
gridColumn: "2 / 3",
|
|
@@ -468,7 +638,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
468
638
|
gridColumn: "1 / 2",
|
|
469
639
|
gridRow: "2 / 3"
|
|
470
640
|
};
|
|
471
|
-
}),
|
|
641
|
+
}), ye = computed(() => {
|
|
472
642
|
let e = {
|
|
473
643
|
position: "fixed",
|
|
474
644
|
top: 0,
|
|
@@ -477,7 +647,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
477
647
|
left: 0,
|
|
478
648
|
overflow: "hidden"
|
|
479
649
|
};
|
|
480
|
-
return
|
|
650
|
+
return N.value ? {
|
|
481
651
|
...e,
|
|
482
652
|
display: "grid",
|
|
483
653
|
gridTemplateRows: "auto 1fr"
|
|
@@ -485,11 +655,11 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
485
655
|
...e,
|
|
486
656
|
display: "block"
|
|
487
657
|
};
|
|
488
|
-
}),
|
|
658
|
+
}), be = computed(() => N.value ? {
|
|
489
659
|
position: "relative",
|
|
490
660
|
zIndex: 0,
|
|
491
661
|
display: "grid",
|
|
492
|
-
...
|
|
662
|
+
...z.value,
|
|
493
663
|
gridRow: "2 / 3",
|
|
494
664
|
minWidth: 0,
|
|
495
665
|
minHeight: 0,
|
|
@@ -498,7 +668,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
498
668
|
position: "absolute",
|
|
499
669
|
zIndex: 0,
|
|
500
670
|
display: "grid",
|
|
501
|
-
...
|
|
671
|
+
...z.value,
|
|
502
672
|
minWidth: 0,
|
|
503
673
|
minHeight: 0,
|
|
504
674
|
overflow: "hidden",
|
|
@@ -506,9 +676,9 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
506
676
|
right: "0",
|
|
507
677
|
bottom: "0",
|
|
508
678
|
left: "0"
|
|
509
|
-
}),
|
|
679
|
+
}), xe = computed(() => !F.value || O.value), B = null, V, H, U = null, W = "", G = !1;
|
|
510
680
|
function Se(e) {
|
|
511
|
-
let t =
|
|
681
|
+
let t = A[e];
|
|
512
682
|
if (t !== void 0) return t;
|
|
513
683
|
if (e.endsWith("px")) {
|
|
514
684
|
let t = Number.parseFloat(e);
|
|
@@ -527,7 +697,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
527
697
|
let r = Number.parseFloat(n);
|
|
528
698
|
return Number.isFinite(r) && r > 0 ? r : t;
|
|
529
699
|
}
|
|
530
|
-
function
|
|
700
|
+
function K(e, t, n) {
|
|
531
701
|
let r = e.trim();
|
|
532
702
|
if (r.endsWith("px")) {
|
|
533
703
|
let e = Number.parseFloat(r);
|
|
@@ -545,8 +715,8 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
545
715
|
return Number.isFinite(i) ? i : 0;
|
|
546
716
|
}
|
|
547
717
|
function we() {
|
|
548
|
-
let e = Math.max(1,
|
|
549
|
-
return n < r.autoBottomAspectRatioBreakpoint && o ? (
|
|
718
|
+
let e = Math.max(1, g.value), t = Math.max(1, P.value), n = e / t, i = e / t, a = Se(r.sidePanelBreakpoint), o = me.value;
|
|
719
|
+
return n < r.autoBottomAspectRatioBreakpoint && o ? (D.value = "tall-bottom", {
|
|
550
720
|
states: [
|
|
551
721
|
"auto",
|
|
552
722
|
"full",
|
|
@@ -554,7 +724,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
554
724
|
"minimized"
|
|
555
725
|
],
|
|
556
726
|
resolved: "bottom"
|
|
557
|
-
}) : i > r.autoRightAspectRatioBreakpoint ? (
|
|
727
|
+
}) : i > r.autoRightAspectRatioBreakpoint ? (D.value = "wide-right", {
|
|
558
728
|
states: [
|
|
559
729
|
"auto",
|
|
560
730
|
"full",
|
|
@@ -562,7 +732,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
562
732
|
"minimized"
|
|
563
733
|
],
|
|
564
734
|
resolved: "right"
|
|
565
|
-
}) : (
|
|
735
|
+
}) : (D.value = "mixed", e >= a ? {
|
|
566
736
|
states: o ? [
|
|
567
737
|
"auto",
|
|
568
738
|
"full",
|
|
@@ -586,70 +756,70 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
586
756
|
});
|
|
587
757
|
}
|
|
588
758
|
function Te(e, t, n) {
|
|
589
|
-
e === t || t === "none" || !
|
|
759
|
+
e === t || t === "none" || !M.value || i("sidePanelTransition", {
|
|
590
760
|
from: e,
|
|
591
761
|
to: t,
|
|
592
762
|
reason: n
|
|
593
763
|
});
|
|
594
764
|
}
|
|
595
|
-
function
|
|
765
|
+
function q(e = !1) {
|
|
596
766
|
let t = {
|
|
597
|
-
availableStates:
|
|
598
|
-
sidePanelMode:
|
|
599
|
-
sidePanelModeResolved:
|
|
600
|
-
overlayOnly:
|
|
767
|
+
availableStates: M.value ? [...oe.value] : [],
|
|
768
|
+
sidePanelMode: M.value ? w.value : "none",
|
|
769
|
+
sidePanelModeResolved: M.value ? T.value : "none",
|
|
770
|
+
overlayOnly: F.value
|
|
601
771
|
};
|
|
602
|
-
if (!
|
|
603
|
-
if (
|
|
604
|
-
|
|
772
|
+
if (!M.value) {
|
|
773
|
+
if (G) return;
|
|
774
|
+
G = !0, i("sidePanelAvailableStates", t);
|
|
605
775
|
return;
|
|
606
776
|
}
|
|
607
|
-
|
|
777
|
+
G = !1;
|
|
608
778
|
let n = JSON.stringify(t);
|
|
609
|
-
!e && n ===
|
|
779
|
+
!e && n === W || (W = n, i("sidePanelAvailableStates", t));
|
|
610
780
|
}
|
|
611
|
-
function
|
|
781
|
+
function J(e) {
|
|
612
782
|
let t = T.value;
|
|
613
|
-
if (!
|
|
614
|
-
w.value = "none", T.value = "none", E.value = [],
|
|
783
|
+
if (!M.value) {
|
|
784
|
+
w.value = "none", T.value = "none", E.value = [], q();
|
|
615
785
|
return;
|
|
616
786
|
}
|
|
617
787
|
let n = we();
|
|
618
788
|
E.value = n.states;
|
|
619
789
|
let r = w.value === "none" ? "auto" : w.value;
|
|
620
|
-
r !== "auto" && !E.value.includes(r) ? (w.value = "auto", i("update:sidePanelPosition", "auto")) : w.value = r, T.value = w.value === "auto" ? n.resolved : w.value, Te(t, T.value, e),
|
|
790
|
+
r !== "auto" && !E.value.includes(r) ? (w.value = "auto", i("update:sidePanelPosition", "auto")) : w.value = r, T.value = w.value === "auto" ? n.resolved : w.value, Te(t, T.value, e), q(k.value === !1);
|
|
621
791
|
}
|
|
622
792
|
function Y(e, t = !1) {
|
|
623
|
-
if (
|
|
624
|
-
|
|
793
|
+
if (V &&= (clearTimeout(V), void 0), t || !k.value) {
|
|
794
|
+
J(e);
|
|
625
795
|
return;
|
|
626
796
|
}
|
|
627
|
-
|
|
628
|
-
|
|
797
|
+
V = setTimeout(() => {
|
|
798
|
+
J(e);
|
|
629
799
|
}, r.layoutDebounceMs);
|
|
630
800
|
}
|
|
631
|
-
function
|
|
632
|
-
if (!
|
|
801
|
+
function Ee(e) {
|
|
802
|
+
if (!M.value) return;
|
|
633
803
|
let t = E.value.includes(e) ? e : "auto";
|
|
634
804
|
t !== w.value && (w.value = t, i("update:sidePanelPosition", t)), Y("set-side-panel-mode", !0);
|
|
635
805
|
}
|
|
636
806
|
function De() {
|
|
637
|
-
!
|
|
807
|
+
!M.value || !F.value || Ee("minimized");
|
|
638
808
|
}
|
|
639
|
-
function
|
|
640
|
-
|
|
809
|
+
function X() {
|
|
810
|
+
H &&= (clearTimeout(H), void 0);
|
|
641
811
|
}
|
|
642
812
|
function Oe() {
|
|
643
|
-
if (
|
|
644
|
-
|
|
813
|
+
if (X(), !F.value || se.value || T.value === "none") {
|
|
814
|
+
O.value = !0;
|
|
645
815
|
return;
|
|
646
816
|
}
|
|
647
|
-
|
|
648
|
-
|
|
817
|
+
H = setTimeout(() => {
|
|
818
|
+
O.value = !1;
|
|
649
819
|
}, r.autoHideTimeout);
|
|
650
820
|
}
|
|
651
|
-
function
|
|
652
|
-
|
|
821
|
+
function Z() {
|
|
822
|
+
O.value = !0, Oe();
|
|
653
823
|
}
|
|
654
824
|
function ke() {
|
|
655
825
|
if (!p.value) return;
|
|
@@ -660,33 +830,45 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
660
830
|
"keydown",
|
|
661
831
|
"touchstart"
|
|
662
832
|
], t = () => {
|
|
663
|
-
|
|
833
|
+
Z();
|
|
664
834
|
};
|
|
665
835
|
for (let n of e) p.value.addEventListener(n, t, { passive: !0 });
|
|
666
|
-
|
|
836
|
+
U = () => {
|
|
667
837
|
if (p.value) for (let n of e) p.value.removeEventListener(n, t);
|
|
668
838
|
};
|
|
669
839
|
}
|
|
670
|
-
function
|
|
671
|
-
|
|
840
|
+
function Q() {
|
|
841
|
+
g.value = window.innerWidth, v.value = window.innerHeight, Y("viewport-resize");
|
|
672
842
|
}
|
|
673
|
-
function
|
|
674
|
-
|
|
843
|
+
function $() {
|
|
844
|
+
try {
|
|
845
|
+
if (typeof window > "u") return;
|
|
846
|
+
g.value = window.innerWidth, v.value = window.innerHeight, y.value = m.value?.offsetHeight ?? 0, b.value = h.value?.offsetWidth ?? 0, x.value = h.value?.offsetHeight ?? 0, S(), Y("manual-refresh", !0);
|
|
847
|
+
} catch (e) {
|
|
848
|
+
console.warn("[LiveFrame] Error during refresh cycle:", e);
|
|
849
|
+
}
|
|
675
850
|
}
|
|
676
|
-
|
|
677
|
-
|
|
851
|
+
t({ refresh: $ });
|
|
852
|
+
let { pause: Ae, resume: je } = useIntervalFn($, () => r.autoRefreshInterval, {
|
|
853
|
+
immediate: r.autoRefresh,
|
|
854
|
+
immediateCallback: !1
|
|
855
|
+
});
|
|
856
|
+
return watch(() => r.autoRefresh, (e) => {
|
|
857
|
+
e ? je() : Ae();
|
|
858
|
+
}), watch(() => r.sidePanelPosition, (e) => {
|
|
859
|
+
if (!M.value) {
|
|
678
860
|
w.value = "none";
|
|
679
861
|
return;
|
|
680
862
|
}
|
|
681
863
|
w.value = e, Y("prop-sync");
|
|
682
|
-
}, { immediate: !0 }), watch(
|
|
864
|
+
}, { immediate: !0 }), watch(M, (e) => {
|
|
683
865
|
if (!e) {
|
|
684
|
-
w.value = "none", T.value = "none", E.value = [],
|
|
866
|
+
w.value = "none", T.value = "none", E.value = [], q();
|
|
685
867
|
return;
|
|
686
868
|
}
|
|
687
869
|
w.value = r.sidePanelPosition, Y("slot-state-change", !0);
|
|
688
870
|
}, { immediate: !0 }), watch(() => [
|
|
689
|
-
|
|
871
|
+
F.value,
|
|
690
872
|
r.autoHideTimeout,
|
|
691
873
|
T.value
|
|
692
874
|
], () => {
|
|
@@ -694,35 +876,35 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
694
876
|
Oe();
|
|
695
877
|
return;
|
|
696
878
|
}
|
|
697
|
-
|
|
879
|
+
Z();
|
|
698
880
|
}), watch(se, (e, t) => {
|
|
699
881
|
if (e) {
|
|
700
|
-
|
|
882
|
+
O.value = !0, X();
|
|
701
883
|
return;
|
|
702
884
|
}
|
|
703
|
-
t &&
|
|
885
|
+
t && Z();
|
|
704
886
|
}), watch(() => [
|
|
887
|
+
b.value,
|
|
705
888
|
x.value,
|
|
706
|
-
S.value,
|
|
707
889
|
T.value,
|
|
708
|
-
|
|
890
|
+
M.value
|
|
709
891
|
], () => {
|
|
710
|
-
!
|
|
711
|
-
width:
|
|
712
|
-
height:
|
|
892
|
+
!M.value || T.value === "none" || i("defaultSlotResize", {
|
|
893
|
+
width: b.value,
|
|
894
|
+
height: x.value
|
|
713
895
|
});
|
|
714
896
|
}), onMounted(async () => {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}), m.value &&
|
|
897
|
+
k.value = !0, Q(), window.addEventListener("resize", Q), ke(), Z(), await nextTick(), B = new ResizeObserver(() => {
|
|
898
|
+
y.value = m.value?.offsetHeight ?? 0, b.value = h.value?.offsetWidth ?? 0, x.value = h.value?.offsetHeight ?? 0, S(), Y("slot-measure");
|
|
899
|
+
}), m.value && B.observe(m.value), h.value && (B.observe(h.value), b.value = h.value.offsetWidth, x.value = h.value.offsetHeight), y.value = m.value?.offsetHeight ?? 0, Y("mounted", !0);
|
|
718
900
|
}), onBeforeUnmount(() => {
|
|
719
|
-
window.removeEventListener("resize",
|
|
901
|
+
window.removeEventListener("resize", Q), U?.(), U = null, B?.disconnect(), B = null, X(), V &&= (clearTimeout(V), void 0);
|
|
720
902
|
}), (t, n) => (openBlock(), createElementBlock("section", {
|
|
721
903
|
ref_key: "rootRef",
|
|
722
904
|
ref: p,
|
|
723
905
|
class: "bg-black text-neutral-100",
|
|
724
|
-
style: normalizeStyle({ ...
|
|
725
|
-
}, [
|
|
906
|
+
style: normalizeStyle({ ...ye.value })
|
|
907
|
+
}, [N.value ? withDirectives((openBlock(), createElementBlock("header", {
|
|
726
908
|
key: 0,
|
|
727
909
|
ref_key: "headerRef",
|
|
728
910
|
ref: m,
|
|
@@ -736,9 +918,9 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
736
918
|
}, [(openBlock(), createBlock(resolveDynamicComponent("style"), null, {
|
|
737
919
|
default: withCtx(() => [createTextVNode(" #header-outer { display: none; } @media (min-width: " + toDisplayString(r.headerHideWidthThreshold) + ") and (min-height: " + toDisplayString(r.headerHideHeightThreshold) + ") { #header-outer { display: block; } } ", 1)]),
|
|
738
920
|
_: 1
|
|
739
|
-
})), createElementVNode("div", _hoisted_1$1, [renderSlot(t.$slots, "header")])], 512)), [[vShow,
|
|
921
|
+
})), createElementVNode("div", _hoisted_1$1, [renderSlot(t.$slots, "header")])], 512)), [[vShow, xe.value]]) : createCommentVNode("", !0), createElementVNode("article", {
|
|
740
922
|
class: "",
|
|
741
|
-
style: normalizeStyle({ ...
|
|
923
|
+
style: normalizeStyle({ ...be.value })
|
|
742
924
|
}, [
|
|
743
925
|
createElementVNode("main", {
|
|
744
926
|
ref_key: "defaultRef",
|
|
@@ -756,33 +938,33 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
756
938
|
gridColumn: "1 / 2",
|
|
757
939
|
gridRow: "1 / 2",
|
|
758
940
|
zIndex: 0,
|
|
759
|
-
...
|
|
941
|
+
..._e.value
|
|
760
942
|
})
|
|
761
943
|
}, [renderSlot(t.$slots, "default")], 4),
|
|
762
|
-
|
|
944
|
+
R.value ? (openBlock(), createElementBlock("div", {
|
|
763
945
|
key: 0,
|
|
764
946
|
class: "bg-black",
|
|
765
947
|
style: normalizeStyle({
|
|
766
|
-
...
|
|
948
|
+
...R.value,
|
|
767
949
|
gridColumn: "1 / 2",
|
|
768
950
|
gridRow: "1 / 2"
|
|
769
951
|
})
|
|
770
952
|
}, null, 4)) : createCommentVNode("", !0),
|
|
771
|
-
|
|
953
|
+
M.value && T.value !== "none" ? (openBlock(), createElementBlock("div", {
|
|
772
954
|
key: 1,
|
|
773
955
|
class: "",
|
|
774
|
-
style: normalizeStyle(
|
|
956
|
+
style: normalizeStyle(ve.value)
|
|
775
957
|
}, [createVNode(SidePanelFrame_default, {
|
|
776
958
|
"side-panel-mode": w.value,
|
|
777
959
|
"side-panel-mode-resolved": T.value,
|
|
778
960
|
"available-states": oe.value,
|
|
779
|
-
"overlay-only":
|
|
961
|
+
"overlay-only": F.value,
|
|
780
962
|
"hide-icons": e.hideSidePanelIcons,
|
|
781
963
|
"min-width": e.sidePanelMinRight,
|
|
782
964
|
"max-width": ce.value,
|
|
783
|
-
"min-height":
|
|
784
|
-
"max-height":
|
|
785
|
-
onSetSidePanelMode:
|
|
965
|
+
"min-height": ge.value,
|
|
966
|
+
"max-height": L.value,
|
|
967
|
+
onSetSidePanelMode: Ee,
|
|
786
968
|
onCloseSidePanel: De
|
|
787
969
|
}, {
|
|
788
970
|
default: withCtx(() => [renderSlot(t.$slots, "sidePanelContent")]),
|
|
@@ -800,7 +982,7 @@ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ *
|
|
|
800
982
|
])], 4)) : createCommentVNode("", !0)
|
|
801
983
|
], 4)], 4));
|
|
802
984
|
}
|
|
803
|
-
}), [["__scopeId", "data-v-
|
|
985
|
+
}), [["__scopeId", "data-v-f7a0b92e"]]), LoggedInOut_default = /* @__PURE__ */ defineComponent({
|
|
804
986
|
__name: "LoggedInOut",
|
|
805
987
|
props: {
|
|
806
988
|
initiallyLoggedIn: { type: Boolean },
|
|
@@ -1256,153 +1438,7 @@ var _globalThis = (function() {
|
|
|
1256
1438
|
fetch,
|
|
1257
1439
|
Headers: Headers$1,
|
|
1258
1440
|
AbortController: AbortController$1
|
|
1259
|
-
})
|
|
1260
|
-
function tryOnScopeDispose(e, t) {
|
|
1261
|
-
return getCurrentScope() ? (onScopeDispose(e, t), !0) : !1;
|
|
1262
|
-
}
|
|
1263
|
-
var isClient = typeof window < "u" && typeof document < "u";
|
|
1264
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1265
|
-
var toString = Object.prototype.toString, isObject = (e) => toString.call(e) === "[object Object]";
|
|
1266
|
-
function createSingletonPromise(e) {
|
|
1267
|
-
let t;
|
|
1268
|
-
function n() {
|
|
1269
|
-
return t ||= e(), t;
|
|
1270
|
-
}
|
|
1271
|
-
return n.reset = async () => {
|
|
1272
|
-
let e = t;
|
|
1273
|
-
t = void 0, e && await e;
|
|
1274
|
-
}, n;
|
|
1275
|
-
}
|
|
1276
|
-
function toArray(e) {
|
|
1277
|
-
return Array.isArray(e) ? e : [e];
|
|
1278
|
-
}
|
|
1279
|
-
function useTimeoutFn(e, t, n = {}) {
|
|
1280
|
-
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = shallowRef(!1), o;
|
|
1281
|
-
function s() {
|
|
1282
|
-
o &&= (clearTimeout(o), void 0);
|
|
1283
|
-
}
|
|
1284
|
-
function c() {
|
|
1285
|
-
a.value = !1, s();
|
|
1286
|
-
}
|
|
1287
|
-
function l(...n) {
|
|
1288
|
-
i && e(), s(), a.value = !0, o = setTimeout(() => {
|
|
1289
|
-
a.value = !1, o = void 0, e(...n);
|
|
1290
|
-
}, toValue(t));
|
|
1291
|
-
}
|
|
1292
|
-
return r && (a.value = !0, isClient && l()), tryOnScopeDispose(c), {
|
|
1293
|
-
isPending: shallowReadonly(a),
|
|
1294
|
-
start: l,
|
|
1295
|
-
stop: c
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
function watchImmediate(e, t, n) {
|
|
1299
|
-
return watch(e, t, {
|
|
1300
|
-
...n,
|
|
1301
|
-
immediate: !0
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1304
|
-
var defaultWindow = isClient ? window : void 0;
|
|
1305
|
-
isClient && window.document;
|
|
1306
|
-
var defaultNavigator = isClient ? window.navigator : void 0;
|
|
1307
|
-
isClient && window.location;
|
|
1308
|
-
function unrefElement(e) {
|
|
1309
|
-
let t = toValue(e);
|
|
1310
|
-
return t?.$el ?? t;
|
|
1311
|
-
}
|
|
1312
|
-
function useEventListener(...e) {
|
|
1313
|
-
let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = computed(() => {
|
|
1314
|
-
let t = toArray(toValue(e[0])).filter((e) => e != null);
|
|
1315
|
-
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
1316
|
-
});
|
|
1317
|
-
return watchImmediate(() => [
|
|
1318
|
-
n.value?.map((e) => unrefElement(e)) ?? [defaultWindow].filter((e) => e != null),
|
|
1319
|
-
toArray(toValue(n.value ? e[1] : e[0])),
|
|
1320
|
-
toArray(unref(n.value ? e[2] : e[1])),
|
|
1321
|
-
toValue(n.value ? e[3] : e[2])
|
|
1322
|
-
], ([e, n, r, i], a, o) => {
|
|
1323
|
-
if (!e?.length || !n?.length || !r?.length) return;
|
|
1324
|
-
let s = isObject(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
|
|
1325
|
-
o(() => {
|
|
1326
|
-
c.forEach((e) => e());
|
|
1327
|
-
});
|
|
1328
|
-
}, { flush: "post" });
|
|
1329
|
-
}
|
|
1330
|
-
function useMounted() {
|
|
1331
|
-
let e = shallowRef(!1), t = getCurrentInstance();
|
|
1332
|
-
return t && onMounted(() => {
|
|
1333
|
-
e.value = !0;
|
|
1334
|
-
}, t), e;
|
|
1335
|
-
}
|
|
1336
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
1337
|
-
function useSupported(e) {
|
|
1338
|
-
let t = useMounted();
|
|
1339
|
-
return computed(() => (t.value, !!e()));
|
|
1340
|
-
}
|
|
1341
|
-
function usePermission(e, t = {}) {
|
|
1342
|
-
let { controls: n = !1, navigator: r = defaultNavigator } = t, i = /* @__PURE__ */ useSupported(() => r && "permissions" in r), a = shallowRef(), o = typeof e == "string" ? { name: e } : e, s = shallowRef(), c = () => {
|
|
1343
|
-
s.value = a.value?.state ?? "prompt";
|
|
1344
|
-
};
|
|
1345
|
-
useEventListener(a, "change", c, { passive: !0 });
|
|
1346
|
-
let l = createSingletonPromise(async () => {
|
|
1347
|
-
if (i.value) {
|
|
1348
|
-
if (!a.value) try {
|
|
1349
|
-
a.value = await r.permissions.query(o);
|
|
1350
|
-
} catch {
|
|
1351
|
-
a.value = void 0;
|
|
1352
|
-
} finally {
|
|
1353
|
-
c();
|
|
1354
|
-
}
|
|
1355
|
-
if (n) return toRaw(a.value);
|
|
1356
|
-
}
|
|
1357
|
-
});
|
|
1358
|
-
return l(), n ? {
|
|
1359
|
-
state: s,
|
|
1360
|
-
isSupported: i,
|
|
1361
|
-
query: l
|
|
1362
|
-
} : s;
|
|
1363
|
-
}
|
|
1364
|
-
function useClipboard(e = {}) {
|
|
1365
|
-
let { navigator: t = defaultNavigator, read: n = !1, source: r, copiedDuring: i = 1500, legacy: a = !1 } = e, s = /* @__PURE__ */ useSupported(() => t && "clipboard" in t), c = usePermission("clipboard-read"), l = usePermission("clipboard-write"), u = computed(() => s.value || a), d = shallowRef(""), f = shallowRef(!1), p = useTimeoutFn(() => f.value = !1, i, { immediate: !1 });
|
|
1366
|
-
async function m() {
|
|
1367
|
-
let e = !(s.value && v(c.value));
|
|
1368
|
-
if (!e) try {
|
|
1369
|
-
d.value = await t.clipboard.readText();
|
|
1370
|
-
} catch {
|
|
1371
|
-
e = !0;
|
|
1372
|
-
}
|
|
1373
|
-
e && (d.value = _());
|
|
1374
|
-
}
|
|
1375
|
-
u.value && n && useEventListener(["copy", "cut"], m, { passive: !0 });
|
|
1376
|
-
async function h(e = toValue(r)) {
|
|
1377
|
-
if (u.value && e != null) {
|
|
1378
|
-
let n = !(s.value && v(l.value));
|
|
1379
|
-
if (!n) try {
|
|
1380
|
-
await t.clipboard.writeText(e);
|
|
1381
|
-
} catch {
|
|
1382
|
-
n = !0;
|
|
1383
|
-
}
|
|
1384
|
-
n && g(e), d.value = e, f.value = !0, p.start();
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
function g(e) {
|
|
1388
|
-
let t = document.createElement("textarea");
|
|
1389
|
-
t.value = e, t.style.position = "absolute", t.style.opacity = "0", t.setAttribute("readonly", ""), document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
1390
|
-
}
|
|
1391
|
-
function _() {
|
|
1392
|
-
var e, t;
|
|
1393
|
-
return ((e = document) == null || (t = e.getSelection) == null || (t = t.call(e)) == null ? void 0 : t.toString()) ?? "";
|
|
1394
|
-
}
|
|
1395
|
-
function v(e) {
|
|
1396
|
-
return e === "granted" || e === "prompt";
|
|
1397
|
-
}
|
|
1398
|
-
return {
|
|
1399
|
-
isSupported: u,
|
|
1400
|
-
text: readonly(d),
|
|
1401
|
-
copied: readonly(f),
|
|
1402
|
-
copy: h
|
|
1403
|
-
};
|
|
1404
|
-
}
|
|
1405
|
-
var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-sm grid grid-rows-[min-content_auto_min-content] overflow-hidden" }, _hoisted_2 = { class: "flex items-center justify-between px-3 py-1 bg-neutral-900 border-b border-neutral-800" }, _hoisted_3 = { class: "px-2 py-0.5 bg-neutral-800 text-neutral-300 font-mono text-[10px] uppercase font-bold rounded" }, _hoisted_4 = {
|
|
1441
|
+
}), _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-sm grid grid-rows-[min-content_auto_min-content] overflow-hidden" }, _hoisted_2 = { class: "flex items-center justify-between px-3 py-1 bg-neutral-900 border-b border-neutral-800" }, _hoisted_3 = { class: "px-2 py-0.5 bg-neutral-800 text-neutral-300 font-mono text-[10px] uppercase font-bold rounded" }, _hoisted_4 = {
|
|
1406
1442
|
key: 0,
|
|
1407
1443
|
class: "flex items-center gap-2"
|
|
1408
1444
|
}, _hoisted_5 = { class: "flex items-center gap-4 px-4 py-3 bg-white" }, _hoisted_6 = ["disabled"], _hoisted_7 = { key: 0 }, _hoisted_8 = { key: 1 }, _hoisted_9 = { class: "grid grid-cols-[10rem_1fr] bg-neutral-900 border-t border-neutral-800 group h-auto" }, _hoisted_10 = { class: "flex flex-col w-full min-w-0 p-3 relative h-max" }, _hoisted_11 = { class: "absolute top-2 right-2 flex justify-end z-10" }, _hoisted_12 = {
|
|
@@ -1439,11 +1475,11 @@ var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-
|
|
|
1439
1475
|
"onError"
|
|
1440
1476
|
],
|
|
1441
1477
|
setup(e, { emit: t }) {
|
|
1442
|
-
let n = e, r = t, i = ref(!1), s = ref(!1), d = ref(null), f = ref(null), p = ref(null), m = computed(() => toValue(n.requireCheckboxToEnable) ?? !1), h = computed(() => toValue(n.fetchOptions) ?? {}), g = computed(() => toValue(n.responseDisplayTimeout) ?? 2e4),
|
|
1443
|
-
|
|
1478
|
+
let n = e, r = t, i = ref(!1), s = ref(!1), d = ref(null), f = ref(null), p = ref(null), m = computed(() => toValue(n.requireCheckboxToEnable) ?? !1), h = computed(() => toValue(n.fetchOptions) ?? {}), g = computed(() => toValue(n.responseDisplayTimeout) ?? 2e4), _ = computed(() => toValue(n.fetchOnMount) ?? !1), ee = computed(() => toValue(n.fetchButtonText) ?? "Fetch"), y = computed(() => toValue(n.fetchButtonClass) ?? ""), b = computed(() => toValue(n.responseClass)), x = computed(() => toValue(n.responseMaxHeight) ?? "40vh"), te = computed(() => h.value.method || "GET"), C = computed(() => n.url === void 0 ? n.urlParts === void 0 ? "" : toValue(n.urlParts).join("") : toValue(n.url)), w = computed(() => m.value && !i.value ? !0 : s.value || !C.value), T = ref("neutral"), E = null, ne = () => {
|
|
1479
|
+
E && clearTimeout(E), E = setTimeout(() => {
|
|
1444
1480
|
T.value = "neutral";
|
|
1445
1481
|
}, g.value);
|
|
1446
|
-
},
|
|
1482
|
+
}, re = async () => {
|
|
1447
1483
|
if (!w.value) {
|
|
1448
1484
|
s.value = !0, T.value = "yellow", d.value = null, p.value = null, f.value = null, m.value && (i.value = !1), r("fetching", n);
|
|
1449
1485
|
try {
|
|
@@ -1452,24 +1488,24 @@ var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-
|
|
|
1452
1488
|
} catch (e) {
|
|
1453
1489
|
p.value = e.data || e.message || "Unknown error", f.value = e.status || 500, T.value = "red", r("onResult", n, e), r("onError", n, e);
|
|
1454
1490
|
} finally {
|
|
1455
|
-
s.value = !1,
|
|
1491
|
+
s.value = !1, ne();
|
|
1456
1492
|
}
|
|
1457
1493
|
}
|
|
1458
|
-
},
|
|
1494
|
+
}, ie = computed(() => {
|
|
1459
1495
|
switch (T.value) {
|
|
1460
1496
|
case "yellow": return "text-yellow-400 bg-yellow-900/30 border-yellow-700/50";
|
|
1461
1497
|
case "green": return "text-green-400 bg-green-900/30 border-green-700/50";
|
|
1462
1498
|
case "red": return "text-red-400 bg-red-900/30 border-red-700/50";
|
|
1463
1499
|
default: return "text-neutral-500 bg-neutral-800/50 border-neutral-700";
|
|
1464
1500
|
}
|
|
1465
|
-
}), { copy:
|
|
1501
|
+
}), { copy: ae, copied: A, isSupported: j } = useClipboard({ legacy: !0 }), M = () => {
|
|
1466
1502
|
let e = d.value || p.value;
|
|
1467
|
-
e &&
|
|
1503
|
+
e && ae(JSON.stringify(e, null, 2));
|
|
1468
1504
|
};
|
|
1469
1505
|
return onMounted(() => {
|
|
1470
|
-
C.value &&
|
|
1506
|
+
C.value && _.value && (!m.value || i.value) && re();
|
|
1471
1507
|
}), (e, t) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1472
|
-
createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(
|
|
1508
|
+
createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(te.value), 1), m.value ? (openBlock(), createElementBlock("div", _hoisted_4, [t[1] ||= createElementVNode("label", {
|
|
1473
1509
|
for: "enable-fetch",
|
|
1474
1510
|
class: "text-xs font-medium text-neutral-300 cursor-pointer select-none"
|
|
1475
1511
|
}, " Enable Request ", -1), withDirectives(createElementVNode("input", {
|
|
@@ -1488,17 +1524,17 @@ var _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-
|
|
|
1488
1524
|
key: 0,
|
|
1489
1525
|
class: normalizeClass(["font-mono text-sm break-all text-neutral-600", toValue(n.urlClass)])
|
|
1490
1526
|
}, toDisplayString(C.value), 3))], 2), createElementVNode("button", {
|
|
1491
|
-
onClick:
|
|
1527
|
+
onClick: re,
|
|
1492
1528
|
disabled: w.value,
|
|
1493
|
-
class: normalizeClass(["shrink-0 px-4 py-2 text-sm font-medium rounded disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1494
|
-
}, [s.value ? (openBlock(), createElementBlock("span", _hoisted_7, "Fetching...")) : (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(
|
|
1495
|
-
createElementVNode("div", _hoisted_9, [createElementVNode("div", { class: normalizeClass(["flex items-center justify-center font-mono text-2xl font-black shadow-sm transition-colors duration-300 h-16",
|
|
1529
|
+
class: normalizeClass(["shrink-0 px-4 py-2 text-sm font-medium rounded disabled:opacity-50 disabled:cursor-not-allowed transition-colors", y.value || "bg-indigo-600 text-white hover:bg-indigo-700"])
|
|
1530
|
+
}, [s.value ? (openBlock(), createElementBlock("span", _hoisted_7, "Fetching...")) : (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(ee.value), 1))], 10, _hoisted_6)]),
|
|
1531
|
+
createElementVNode("div", _hoisted_9, [createElementVNode("div", { class: normalizeClass(["flex items-center justify-center font-mono text-2xl font-black shadow-sm transition-colors duration-300 h-16", ie.value]) }, toDisplayString(f.value || "---"), 3), createElementVNode("div", _hoisted_10, [createElementVNode("div", _hoisted_11, [(d.value || p.value) && unref(j) ? (openBlock(), createElementBlock("button", {
|
|
1496
1532
|
key: 0,
|
|
1497
|
-
onClick: withModifiers(
|
|
1498
|
-
class: normalizeClass(["px-2.5 py-1.5 rounded-md text-xs font-bold font-mono border backdrop-blur-sm transition-all duration-200 opacity-0 transform -translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 shadow shadow-neutral-900", unref(
|
|
1499
|
-
}, toDisplayString(unref(
|
|
1500
|
-
class: normalizeClass(["w-full overflow-y-auto transition-all duration-300 custom-scrollbar mt-1 overflow-x-hidden pr-16",
|
|
1501
|
-
style: normalizeStyle({ "--hover-max-h":
|
|
1533
|
+
onClick: withModifiers(M, ["prevent"]),
|
|
1534
|
+
class: normalizeClass(["px-2.5 py-1.5 rounded-md text-xs font-bold font-mono border backdrop-blur-sm transition-all duration-200 opacity-0 transform -translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 shadow shadow-neutral-900", unref(A) ? "bg-emerald-900/80 text-emerald-300 border-emerald-700/50" : "bg-neutral-800/90 text-neutral-300 border-neutral-700 hover:bg-neutral-700"])
|
|
1535
|
+
}, toDisplayString(unref(A) ? "COPIED!" : "COPY"), 3)) : createCommentVNode("", !0)]), createElementVNode("div", {
|
|
1536
|
+
class: normalizeClass(["w-full overflow-y-auto transition-all duration-300 custom-scrollbar mt-1 overflow-x-hidden pr-16", b.value ? b.value : "max-h-12 hover:max-h-[var(--hover-max-h)]"]),
|
|
1537
|
+
style: normalizeStyle({ "--hover-max-h": x.value })
|
|
1502
1538
|
}, [d.value ? (openBlock(), createElementBlock("pre", _hoisted_12, toDisplayString(JSON.stringify(d.value, null, 2)), 1)) : p.value ? (openBlock(), createElementBlock("pre", _hoisted_13, toDisplayString(JSON.stringify(p.value, null, 2)), 1)) : (openBlock(), createElementBlock("div", _hoisted_14, "Awaiting request..."))], 6)])])
|
|
1503
1539
|
]));
|
|
1504
1540
|
}
|