@nmorph/nmorph-ui-kit 2.2.54 → 2.2.55

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.
@@ -1,48 +1,48 @@
1
1
  import './NmorphMediaGallery.css';
2
- import { defineComponent as Ye, ref as _, computed as s, watch as S, onBeforeUnmount as Ge, openBlock as i, createElementBlock as u, Fragment as ve, normalizeStyle as me, normalizeClass as fe, renderList as Ue, createElementVNode as x, createBlock as B, unref as o, createVNode as r, withCtx as c, createCommentVNode as d, toDisplayString as A, withModifiers as P } from "vue";
3
- import { useModifiers as pe } from "../../../utils/create-modifiers.js";
4
- import { createCssSizeVariables as Ze } from "../../../utils/common.js";
5
- import We from "../nmorph-preview-portal/NmorphPreviewPortal.vue.js";
2
+ import { defineComponent as Ze, ref as k, computed as s, watch as E, onBeforeUnmount as We, openBlock as i, createElementBlock as u, Fragment as me, normalizeStyle as fe, normalizeClass as pe, renderList as je, createElementVNode as x, createBlock as B, unref as l, createVNode as r, withCtx as d, createCommentVNode as v, toDisplayString as D, withModifiers as $ } from "vue";
3
+ import { useModifiers as he } from "../../../utils/create-modifiers.js";
4
+ import { createCssSizeVariables as Je } from "../../../utils/common.js";
5
+ import Qe from "../nmorph-preview-portal/NmorphPreviewPortal.vue.js";
6
6
  /* empty css */
7
- import he from "../nmorph-image/NmorphImage.vue.js";
7
+ import ge from "../nmorph-image/NmorphImage.vue.js";
8
8
  /* empty css */
9
- import f from "../../basic/nmorph-icon/NmorphIcon.vue.js";
9
+ import p from "../../basic/nmorph-icon/NmorphIcon.vue.js";
10
10
  /* empty css */
11
- import je from "../../../assets/icons/eye.svg.js";
12
- import ge from "../../../assets/icons/full-screen.svg.js";
11
+ import ea from "../../../assets/icons/eye.svg.js";
12
+ import _e from "../../../assets/icons/full-screen.svg.js";
13
13
  import M from "../../basic/nmorph-button/NmorphButton.vue.js";
14
14
  /* empty css */
15
- import _e from "../../../assets/icons/play.svg.js";
16
- import ye from "../../../assets/icons/download.svg.js";
17
- import Je from "../../../assets/icons/pause.svg.js";
18
- import Qe from "../../../assets/icons/rotate-right.svg.js";
19
- import ea from "../../../assets/icons/rotate-left.svg.js";
20
- import aa from "../../../assets/icons/zoom-in.svg.js";
21
- import la from "../../../assets/icons/zoom-out.svg.js";
22
- import oa from "../../../assets/icons/enlarge.svg.js";
23
- import ta from "../../../assets/icons/shrink.svg.js";
24
- const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
15
+ import ye from "../../../assets/icons/play.svg.js";
16
+ import ke from "../../../assets/icons/download.svg.js";
17
+ import aa from "../../../assets/icons/pause.svg.js";
18
+ import ta from "../../../assets/icons/rotate-right.svg.js";
19
+ import la from "../../../assets/icons/rotate-left.svg.js";
20
+ import oa from "../../../assets/icons/zoom-in.svg.js";
21
+ import na from "../../../assets/icons/zoom-out.svg.js";
22
+ import ra from "../../../assets/icons/enlarge.svg.js";
23
+ import ia from "../../../assets/icons/shrink.svg.js";
24
+ const sa = ["aria-label", "onClick"], ua = ["src", "poster", "title"], da = {
25
25
  key: 2,
26
26
  class: "nmorph-media-gallery__trigger-play"
27
- }, sa = {
27
+ }, ca = {
28
28
  key: 3,
29
29
  class: "nmorph-media-gallery__trigger-name"
30
- }, ua = {
30
+ }, va = {
31
31
  key: 4,
32
32
  class: "nmorph-media-gallery__trigger-size"
33
- }, ca = {
33
+ }, ma = {
34
34
  key: 0,
35
35
  class: "nmorph-media-gallery__trigger-actions"
36
- }, da = ["aria-label", "onClick"], va = ["aria-label", "onClick"], ma = ["href", "download", "aria-label", "onClick"], fa = { class: "nmorph-media-gallery__stage" }, pa = ["src", "poster", "controls", "muted", "playsinline", "preload", "title"], ha = ["aria-label"], ga = {
36
+ }, fa = ["aria-label", "onClick"], pa = ["aria-label", "onClick"], ha = ["href", "download", "aria-label", "onClick"], ga = { class: "nmorph-media-gallery__stage" }, _a = ["src", "poster", "controls", "muted", "playsinline", "preload", "title"], ya = ["aria-label"], ka = {
37
37
  key: 3,
38
38
  class: "nmorph-media-gallery__file-name"
39
- }, _a = {
39
+ }, wa = {
40
40
  key: 4,
41
41
  class: "nmorph-media-gallery__file-actions"
42
- }, ya = ["aria-label"], ka = ["href", "download", "aria-label"], wa = {
42
+ }, ba = ["aria-label"], Ia = ["href", "download", "aria-label"], Na = {
43
43
  key: 5,
44
44
  class: "nmorph-media-gallery__file-size"
45
- }, ba = { class: "nmorph-media-gallery__action-element" }, Ia = { class: "nmorph-media-gallery__action-element" }, Na = { class: "nmorph-media-gallery__action-element" }, xa = { class: "nmorph-media-gallery__action-element" }, Ba = { class: "nmorph-media-gallery__action-element" }, Fa = 45, Wa = /* @__PURE__ */ Ye({
45
+ }, xa = { class: "nmorph-media-gallery__action-element" }, Ba = { class: "nmorph-media-gallery__action-element" }, Fa = { class: "nmorph-media-gallery__action-element" }, Ca = { class: "nmorph-media-gallery__action-element" }, Pa = { class: "nmorph-media-gallery__action-element" }, $a = 45, we = 0.25, Qa = /* @__PURE__ */ Ze({
46
46
  __name: "NmorphMediaGallery",
47
47
  props: {
48
48
  modelValue: { type: Boolean, default: !1 },
@@ -66,305 +66,318 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
66
66
  videoFit: { default: "contain" }
67
67
  },
68
68
  emits: ["update:model-value", "update:active-index", "close", "change", "download", "fullscreen"],
69
- setup(ke, { emit: we }) {
70
- const n = ke, h = we, y = _(n.modelValue), F = _(0), k = _(null), X = _({}), z = _(null), m = _(!1), I = _(!1), w = _(1), g = _(0), C = _(null), p = s(() => n.items || []), Y = s(() => p.value.length > 1), G = s(() => n.showNavigationButtons && Y.value), $ = (e) => {
71
- const l = p.value.length - 1;
72
- return l < 0 || !Number.isFinite(e) || e < 0 ? 0 : e > l ? l : e;
73
- }, b = s(() => $(F.value)), t = s(() => p.value[b.value]), U = s(() => t.value?.kind === "image"), H = s(() => t.value?.kind === "video"), Z = s(
74
- () => t.value?.kind === "video" ? t.value.controls !== !1 : !1
75
- ), be = s(() => t.value?.kind === "video" ? t.value.muted === !0 : !1), Ie = s(
76
- () => t.value?.kind === "video" ? t.value.playsinline !== !1 : !0
77
- ), Ne = s(
78
- () => t.value?.kind === "video" && t.value.preload || "metadata"
79
- ), E = s(
80
- () => t.value?.kind === "video" && t.value.name || "video"
81
- ), R = s(() => t.value?.name || ""), W = s(() => n.showFileName ? R.value : ""), D = s(() => t.value?.downloadHref || ""), xe = s(() => n.showPlaybackButton && H.value && I.value), j = s(() => n.showFileActions && H.value && !Z.value), Be = s(
82
- () => n.showFileActions && (j.value || !!D.value)
83
- ), Fe = s(
84
- () => pe({
69
+ setup(be, { emit: Ie }) {
70
+ const n = be, _ = Ie, w = k(n.modelValue), F = k(0), h = k(null), X = k({}), V = k(null), m = k(!1), b = k(!1), I = k(1), y = k(0), C = k(null), g = s(() => n.items || []), Y = s(() => g.value.length > 1), G = s(() => n.showNavigationButtons && Y.value), P = (e) => {
71
+ const t = g.value.length - 1;
72
+ return t < 0 || !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e;
73
+ }, N = s(() => P(F.value)), o = s(() => g.value[N.value]), Z = s(() => o.value?.kind === "image"), z = s(() => o.value?.kind === "video"), W = s(
74
+ () => o.value?.kind === "video" ? o.value.controls !== !1 : !1
75
+ ), Ne = s(() => o.value?.kind === "video" ? o.value.muted === !0 : !1), xe = s(
76
+ () => o.value?.kind === "video" ? o.value.playsinline !== !1 : !0
77
+ ), j = s(
78
+ () => o.value?.kind === "video" && o.value.preload || "metadata"
79
+ ), Be = s(
80
+ () => n.showPlaybackButton && j.value === "metadata" ? "auto" : j.value
81
+ ), R = s(
82
+ () => o.value?.kind === "video" && o.value.name || "video"
83
+ ), A = s(() => o.value?.name || ""), J = s(() => n.showFileName ? A.value : ""), K = s(() => o.value?.downloadHref || ""), Fe = s(() => n.showPlaybackButton && z.value && b.value), Q = s(() => n.showFileActions && z.value && !W.value), Ce = s(
84
+ () => n.showFileActions && (Q.value || !!K.value)
85
+ ), Pe = s(
86
+ () => he({
85
87
  "nmorph-media-gallery": [
86
- y.value && "opened",
87
- U.value && "image",
88
- H.value && "video",
89
- m.value && H.value && "video-playing",
90
- n.imageFit === "cover" && U.value && "image-cover",
91
- n.videoFit === "cover" && H.value && "video-cover"
88
+ w.value && "opened",
89
+ Z.value && "image",
90
+ z.value && "video",
91
+ m.value && z.value && "video-playing",
92
+ n.imageFit === "cover" && Z.value && "image-cover",
93
+ n.videoFit === "cover" && z.value && "video-cover"
92
94
  ]
93
95
  })
94
- ), Ce = s(() => `rotate(${g.value}deg) scale(${w.value})`), $e = s(
95
- () => Ze({
96
+ ), $e = s(() => `rotate(${y.value}deg) scale(${I.value})`), Ve = s(
97
+ () => Je({
96
98
  "--nmorph-media-gallery-trigger-height": n.height
97
99
  })
98
- ), Pe = s(
99
- () => pe({
100
+ ), ze = s(
101
+ () => he({
100
102
  "nmorph-media-gallery__trigger": [n.height !== void 0 && "fixed-height"]
101
103
  })
102
- ), J = (e) => {
104
+ ), ee = (e) => {
103
105
  if (e === void 0 || Number.isNaN(e) || e < 0) return "";
104
106
  if (e === 0) return "0 B";
105
- const l = ["B", "KB", "MB", "GB", "TB"], a = Math.min(Math.floor(Math.log(e) / Math.log(1024)), l.length - 1), v = e / 1024 ** a, N = v >= 10 || a === 0 || Number.isInteger(v) ? 0 : 1;
106
- return `${v.toFixed(N)} ${l[a]}`;
107
- }, Q = s(() => n.showFileSize ? J(t.value?.size) : ""), V = (e) => e.name || "", L = (e, l) => e.name || `${e.kind === "video" ? "Video" : "Image"} ${l + 1}`, ee = (e) => J(e.size), K = (e) => e.downloadHref || "", ze = (e, l) => {
108
- X.value[e] = l instanceof HTMLVideoElement ? l : null;
107
+ const t = ["B", "KB", "MB", "GB", "TB"], a = Math.min(Math.floor(Math.log(e) / Math.log(1024)), t.length - 1), c = e / 1024 ** a, f = c >= 10 || a === 0 || Number.isInteger(c) ? 0 : 1;
108
+ return `${c.toFixed(f)} ${t[a]}`;
109
+ }, ae = s(() => n.showFileSize ? ee(o.value?.size) : ""), H = (e) => e.name || "", S = (e, t) => e.name || `${e.kind === "video" ? "Video" : "Image"} ${t + 1}`, te = (e) => ee(e.size), O = (e) => e.downloadHref || "", He = (e, t) => {
110
+ X.value[e] = t instanceof HTMLVideoElement ? t : null;
109
111
  };
110
- S(
112
+ E(
111
113
  () => n.modelValue,
112
114
  (e) => {
113
- y.value = e;
115
+ w.value = e;
114
116
  }
115
- ), S(
117
+ ), E(
116
118
  () => n.activeIndex,
117
119
  (e) => {
118
- typeof e == "number" && (F.value = $(e));
120
+ typeof e == "number" && (F.value = P(e));
119
121
  },
120
122
  { immediate: !0 }
121
- ), S(
122
- () => [n.initialIndex, p.value.length],
123
+ ), E(
124
+ () => [n.initialIndex, g.value.length],
123
125
  () => {
124
- typeof n.activeIndex != "number" && (F.value = $(n.initialIndex));
126
+ typeof n.activeIndex != "number" && (F.value = P(n.initialIndex));
125
127
  },
126
128
  { immediate: !0 }
127
- ), S(
128
- () => [t.value?.kind, t.value?.src, b.value],
129
+ ), E(
130
+ () => [o.value?.kind, o.value?.src, N.value],
129
131
  () => {
130
- m.value = !1, I.value = !1, z.value = null;
132
+ m.value = !1, b.value = !1, V.value = null;
131
133
  }
132
134
  );
133
135
  const T = () => {
134
- !k.value || k.value === z.value || (k.value.pause(), m.value = !1, z.value = k.value);
135
- }, ae = () => {
136
- w.value = 1, g.value = 0;
137
- }, le = (e) => {
138
- if (!p.value.length) return;
139
- const l = $(e);
140
- if (l === b.value) return;
141
- T(), m.value = !1, I.value = !1, F.value = l, ae(), h("update:active-index", l);
142
- const a = p.value[l];
143
- a && h("change", a, l);
144
- }, q = () => {
145
- const e = p.value.length;
146
- e && le(b.value === 0 ? e - 1 : b.value - 1);
147
- }, O = () => {
148
- const e = p.value.length;
149
- e && le(b.value === e - 1 ? 0 : b.value + 1);
136
+ !h.value || h.value === V.value || (h.value.pause(), m.value = !1, V.value = h.value);
137
+ }, le = () => {
138
+ I.value = 1, y.value = 0;
150
139
  }, oe = (e) => {
151
- if (!p.value.length) return;
152
- const l = $(e);
153
- T(), m.value = !1, I.value = !1, F.value = l, ae(), y.value = !0, h("update:model-value", !0), h("update:active-index", l);
154
- const a = p.value[l];
155
- a && h("change", a, l);
156
- }, te = () => {
157
- y.value && (T(), y.value = !1, h("update:model-value", !1), h("close"));
158
- }, He = () => {
159
- g.value = g.value + 90, g.value >= 360 && (g.value = 0);
160
- }, Ve = () => {
161
- g.value = g.value - 90, g.value <= -360 && (g.value = 0);
162
- }, Le = () => {
163
- w.value = parseFloat(Math.min(w.value + 0.2, 4).toFixed(3));
140
+ if (!g.value.length) return;
141
+ const t = P(e);
142
+ if (t === N.value) return;
143
+ T(), m.value = !1, b.value = !1, F.value = t, le(), _("update:active-index", t);
144
+ const a = g.value[t];
145
+ a && _("change", a, t);
146
+ }, q = () => {
147
+ const e = g.value.length;
148
+ e && oe(N.value === 0 ? e - 1 : N.value - 1);
149
+ }, U = () => {
150
+ const e = g.value.length;
151
+ e && oe(N.value === e - 1 ? 0 : N.value + 1);
152
+ }, ne = (e) => {
153
+ if (!g.value.length) return;
154
+ const t = P(e);
155
+ T(), m.value = !1, b.value = !1, F.value = t, le(), w.value = !0, _("update:model-value", !0), _("update:active-index", t);
156
+ const a = g.value[t];
157
+ a && _("change", a, t);
158
+ }, re = () => {
159
+ w.value && (T(), w.value = !1, _("update:model-value", !1), _("close"));
164
160
  }, Se = () => {
165
- w.value = parseFloat(Math.max(w.value - 0.2, 0.2).toFixed(3));
161
+ y.value = y.value + 90, y.value >= 360 && (y.value = 0);
162
+ }, Le = () => {
163
+ y.value = y.value - 90, y.value <= -360 && (y.value = 0);
164
+ }, Ee = () => {
165
+ I.value = parseFloat(Math.min(I.value + 0.2, 4).toFixed(3));
166
166
  }, Me = () => {
167
- w.value = 1;
168
- }, Te = async () => {
169
- if (k.value) {
167
+ I.value = parseFloat(Math.max(I.value - 0.2, 0.2).toFixed(3));
168
+ }, Te = () => {
169
+ I.value = 1;
170
+ }, De = async () => {
171
+ if (!(!h.value || !b.value)) {
170
172
  if (m.value) {
171
- k.value.pause();
173
+ h.value.pause();
172
174
  return;
173
175
  }
174
176
  try {
175
- await k.value.play();
177
+ await h.value.play();
176
178
  } catch {
177
179
  m.value = !1;
178
180
  }
179
181
  }
180
- }, ne = async (e) => {
182
+ }, ie = async (e) => {
181
183
  if (e)
182
184
  try {
183
- const l = e.requestFullscreen?.() || e.webkitRequestFullscreen?.();
184
- if (l) {
185
- await l;
185
+ const t = e.requestFullscreen?.() || e.webkitRequestFullscreen?.();
186
+ if (t) {
187
+ await t;
186
188
  return;
187
189
  }
188
190
  e.webkitEnterFullscreen?.();
189
191
  } catch {
190
192
  }
191
- }, Ae = async () => {
192
- !t.value || t.value.kind !== "video" || (h("fullscreen", t.value, b.value), await ne(k.value));
193
- }, Ee = async (e, l) => {
194
- e.kind === "video" && (h("fullscreen", e, l), await ne(X.value[l]));
195
- }, re = (e, l) => {
196
- h("download", e, l);
197
- }, Re = () => {
198
- t.value && re(t.value, b.value);
199
- }, De = () => {
200
- m.value = !0, z.value = null;
201
- }, ie = () => {
202
- I.value = !0;
193
+ }, Re = async () => {
194
+ !o.value || o.value.kind !== "video" || (_("fullscreen", o.value, N.value), await ie(h.value));
195
+ }, Ae = async (e, t) => {
196
+ e.kind === "video" && (_("fullscreen", e, t), await ie(X.value[t]));
197
+ }, se = (e, t) => {
198
+ _("download", e, t);
203
199
  }, Ke = () => {
200
+ o.value && se(o.value, N.value);
201
+ }, Oe = () => {
202
+ m.value = !0, V.value = null;
203
+ }, qe = (e) => {
204
+ const t = e.duration;
205
+ if (!Number.isFinite(t) || t <= 0) return !1;
206
+ const a = e.buffered, c = Math.max(0, t - we);
207
+ for (let f = 0; f < a.length; f += 1)
208
+ try {
209
+ if (a.start(f) <= we && a.end(f) >= c) return !0;
210
+ } catch {
211
+ return !1;
212
+ }
213
+ return !1;
214
+ }, L = () => {
215
+ b.value = h.value ? qe(h.value) : !1;
216
+ }, Ue = () => {
204
217
  m.value = !1;
205
- }, qe = () => {
218
+ }, Xe = () => {
206
219
  m.value = !1;
207
- }, Oe = () => {
208
- m.value = !1, I.value = !1;
209
- }, se = (e) => {
210
- if (y.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
220
+ }, Ye = () => {
221
+ m.value = !1, b.value = !1;
222
+ }, ue = (e) => {
223
+ if (w.value && !(e.altKey || e.ctrlKey || e.metaKey || e.shiftKey)) {
211
224
  if (e.key === "Escape") {
212
- e.preventDefault(), te();
225
+ e.preventDefault(), re();
213
226
  return;
214
227
  }
215
- Y.value && (e.key === "ArrowLeft" && (e.preventDefault(), q()), e.key === "ArrowRight" && (e.preventDefault(), O()));
228
+ Y.value && (e.key === "ArrowLeft" && (e.preventDefault(), q()), e.key === "ArrowRight" && (e.preventDefault(), U()));
216
229
  }
217
- }, Xe = () => {
218
- typeof document > "u" || document.addEventListener("keydown", se);
219
- }, ue = () => {
220
- typeof document > "u" || document.removeEventListener("keydown", se);
230
+ }, Ge = () => {
231
+ typeof document > "u" || document.addEventListener("keydown", ue);
232
+ }, de = () => {
233
+ typeof document > "u" || document.removeEventListener("keydown", ue);
221
234
  };
222
- S(
223
- y,
235
+ E(
236
+ w,
224
237
  (e) => {
225
- e ? (Xe(), z.value = null, I.value = !1, F.value = $(
238
+ e ? (Ge(), V.value = null, b.value = !1, F.value = P(
226
239
  typeof n.activeIndex == "number" ? n.activeIndex : n.initialIndex
227
- )) : (T(), m.value = !1, I.value = !1, ue());
240
+ )) : (T(), m.value = !1, b.value = !1, de());
228
241
  },
229
242
  { immediate: !0 }
230
- ), Ge(ue);
243
+ ), We(de);
231
244
  const ce = (e) => {
232
245
  C.value = { x: e.clientX, y: e.clientY };
233
- }, de = (e) => {
246
+ }, ve = (e) => {
234
247
  if (!C.value || !G.value) {
235
248
  C.value = null;
236
249
  return;
237
250
  }
238
- const l = e.clientX - C.value.x, a = e.clientY - C.value.y;
239
- C.value = null, !(Math.abs(l) < Fa || Math.abs(l) < Math.abs(a) * 1.2) && (l > 0 ? q() : O());
251
+ const t = e.clientX - C.value.x, a = e.clientY - C.value.y;
252
+ C.value = null, !(Math.abs(t) < $a || Math.abs(t) < Math.abs(a) * 1.2) && (t > 0 ? q() : U());
240
253
  };
241
- return (e, l) => (i(), u(ve, null, [
254
+ return (e, t) => (i(), u(me, null, [
242
255
  n.showTrigger ? (i(), u("div", {
243
256
  key: 0,
244
- class: fe(Pe.value),
245
- style: me($e.value)
257
+ class: pe(ze.value),
258
+ style: fe(Ve.value)
246
259
  }, [
247
- (i(!0), u(ve, null, Ue(p.value, (a, v) => (i(), u("div", {
248
- key: `${a.kind}-${a.src}-${v}`,
249
- class: fe(["nmorph-media-gallery__trigger-item", `nmorph-media-gallery__trigger-item--${a.kind}`])
260
+ (i(!0), u(me, null, je(g.value, (a, c) => (i(), u("div", {
261
+ key: `${a.kind}-${a.src}-${c}`,
262
+ class: pe(["nmorph-media-gallery__trigger-item", `nmorph-media-gallery__trigger-item--${a.kind}`])
250
263
  }, [
251
264
  x("button", {
252
265
  type: "button",
253
266
  class: "nmorph-media-gallery__trigger-open",
254
- "aria-label": `Open ${L(a, v)}`,
255
- onClick: (N) => oe(v)
267
+ "aria-label": `Open ${S(a, c)}`,
268
+ onClick: (f) => ne(c)
256
269
  }, [
257
- a.kind === "image" ? (i(), B(o(he), {
270
+ a.kind === "image" ? (i(), B(l(ge), {
258
271
  key: 0,
259
272
  src: a.src,
260
- alt: a.alt || L(a, v),
261
- title: V(a),
273
+ alt: a.alt || S(a, c),
274
+ title: H(a),
262
275
  fit: "cover",
263
276
  "frame-border": 0
264
277
  }, null, 8, ["src", "alt", "title"])) : (i(), u("video", {
265
278
  key: 1,
266
279
  ref_for: !0,
267
- ref: (N) => ze(v, N),
280
+ ref: (f) => He(c, f),
268
281
  class: "nmorph-media-gallery__trigger-video",
269
282
  src: a.src,
270
283
  poster: a.poster || void 0,
271
284
  muted: "",
272
285
  playsinline: "",
273
286
  preload: "metadata",
274
- title: V(a)
275
- }, null, 8, ra)),
276
- n.showTriggerPlayButton && a.kind === "video" ? (i(), u("span", ia, [
277
- r(o(f), {
287
+ title: H(a)
288
+ }, null, 8, ua)),
289
+ n.showTriggerPlayButton && a.kind === "video" ? (i(), u("span", da, [
290
+ r(l(p), {
278
291
  size: "medium",
279
292
  color: "var(--nmorph-contrast-text-color)"
280
293
  }, {
281
- default: c(() => [
282
- r(o(_e))
294
+ default: d(() => [
295
+ r(l(ye))
283
296
  ]),
284
297
  _: 1
285
298
  })
286
- ])) : d("", !0),
287
- n.showTriggerName && V(a) ? (i(), u("span", sa, A(V(a)), 1)) : d("", !0),
288
- n.showTriggerSize && ee(a) ? (i(), u("span", ua, A(ee(a)), 1)) : d("", !0)
289
- ], 8, na),
290
- n.showTriggerActions && (K(a) || a.kind === "video") ? (i(), u("div", ca, [
299
+ ])) : v("", !0),
300
+ n.showTriggerName && H(a) ? (i(), u("span", ca, D(H(a)), 1)) : v("", !0),
301
+ n.showTriggerSize && te(a) ? (i(), u("span", va, D(te(a)), 1)) : v("", !0)
302
+ ], 8, sa),
303
+ n.showTriggerActions && (O(a) || a.kind === "video") ? (i(), u("div", ma, [
291
304
  a.kind === "video" ? (i(), u("button", {
292
305
  key: 0,
293
306
  type: "button",
294
307
  class: "nmorph-media-gallery__trigger-action",
295
- "aria-label": `Preview ${L(a, v)}`,
296
- onClick: P((N) => oe(v), ["stop"])
308
+ "aria-label": `Preview ${S(a, c)}`,
309
+ onClick: $((f) => ne(c), ["stop"])
297
310
  }, [
298
- r(o(f), {
311
+ r(l(p), {
299
312
  size: "small",
300
313
  color: "var(--nmorph-contrast-text-color)"
301
314
  }, {
302
- default: c(() => [
303
- r(o(je))
315
+ default: d(() => [
316
+ r(l(ea))
304
317
  ]),
305
318
  _: 1
306
319
  })
307
- ], 8, da)) : d("", !0),
320
+ ], 8, fa)) : v("", !0),
308
321
  a.kind === "video" ? (i(), u("button", {
309
322
  key: 1,
310
323
  type: "button",
311
324
  class: "nmorph-media-gallery__trigger-action",
312
- "aria-label": `Fullscreen ${L(a, v)}`,
313
- onClick: P((N) => Ee(a, v), ["stop"])
325
+ "aria-label": `Fullscreen ${S(a, c)}`,
326
+ onClick: $((f) => Ae(a, c), ["stop"])
314
327
  }, [
315
- r(o(f), {
328
+ r(l(p), {
316
329
  size: "small",
317
330
  color: "var(--nmorph-contrast-text-color)"
318
331
  }, {
319
- default: c(() => [
320
- r(o(ge))
332
+ default: d(() => [
333
+ r(l(_e))
321
334
  ]),
322
335
  _: 1
323
336
  })
324
- ], 8, va)) : d("", !0),
325
- K(a) ? (i(), u("a", {
337
+ ], 8, pa)) : v("", !0),
338
+ O(a) ? (i(), u("a", {
326
339
  key: 2,
327
- href: K(a),
328
- download: V(a) || void 0,
340
+ href: O(a),
341
+ download: H(a) || void 0,
329
342
  class: "nmorph-media-gallery__trigger-action",
330
- "aria-label": `Download ${L(a, v)}`,
331
- onClick: P((N) => re(a, v), ["stop"])
343
+ "aria-label": `Download ${S(a, c)}`,
344
+ onClick: $((f) => se(a, c), ["stop"])
332
345
  }, [
333
- r(o(f), {
346
+ r(l(p), {
334
347
  size: "small",
335
348
  color: "var(--nmorph-contrast-text-color)"
336
349
  }, {
337
- default: c(() => [
338
- r(o(ye))
350
+ default: d(() => [
351
+ r(l(ke))
339
352
  ]),
340
353
  _: 1
341
354
  })
342
- ], 8, ma)) : d("", !0)
343
- ])) : d("", !0)
355
+ ], 8, ha)) : v("", !0)
356
+ ])) : v("", !0)
344
357
  ], 2))), 128))
345
- ], 6)) : d("", !0),
346
- y.value ? (i(), B(We, {
358
+ ], 6)) : v("", !0),
359
+ w.value ? (i(), B(Qe, {
347
360
  key: 1,
348
- show: y.value,
361
+ show: w.value,
349
362
  "z-index": n.zIndex,
350
- "state-class": Fe.value,
363
+ "state-class": Pe.value,
351
364
  "content-class": "nmorph-media-gallery__content",
352
365
  "left-class": "nmorph-media-gallery__left",
353
366
  "right-class": "nmorph-media-gallery__right",
354
367
  "actions-class": "nmorph-media-gallery__actions",
355
368
  "show-navigation": G.value,
356
- "show-action-bar": n.showActionBar && t.value?.kind === "image",
357
- onClose: te,
369
+ "show-action-bar": n.showActionBar && o.value?.kind === "image",
370
+ onClose: re,
358
371
  onPrevious: q,
359
- onNext: O
372
+ onNext: U
360
373
  }, {
361
- actions: c(() => [
362
- x("div", ba, [
363
- r(o(M), { onClick: He }, {
364
- default: c(() => [
365
- r(o(f), null, {
366
- default: c(() => [
367
- r(o(Qe))
374
+ actions: d(() => [
375
+ x("div", xa, [
376
+ r(l(M), { onClick: Se }, {
377
+ default: d(() => [
378
+ r(l(p), null, {
379
+ default: d(() => [
380
+ r(l(ta))
368
381
  ]),
369
382
  _: 1
370
383
  })
@@ -372,12 +385,12 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
372
385
  _: 1
373
386
  })
374
387
  ]),
375
- x("div", Ia, [
376
- r(o(M), { onClick: Ve }, {
377
- default: c(() => [
378
- r(o(f), null, {
379
- default: c(() => [
380
- r(o(ea))
388
+ x("div", Ba, [
389
+ r(l(M), { onClick: Le }, {
390
+ default: d(() => [
391
+ r(l(p), null, {
392
+ default: d(() => [
393
+ r(l(la))
381
394
  ]),
382
395
  _: 1
383
396
  })
@@ -385,12 +398,12 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
385
398
  _: 1
386
399
  })
387
400
  ]),
388
- x("div", Na, [
389
- r(o(M), { onClick: Le }, {
390
- default: c(() => [
391
- r(o(f), null, {
392
- default: c(() => [
393
- r(o(aa))
401
+ x("div", Fa, [
402
+ r(l(M), { onClick: Ee }, {
403
+ default: d(() => [
404
+ r(l(p), null, {
405
+ default: d(() => [
406
+ r(l(oa))
394
407
  ]),
395
408
  _: 1
396
409
  })
@@ -398,12 +411,12 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
398
411
  _: 1
399
412
  })
400
413
  ]),
401
- x("div", xa, [
402
- r(o(M), { onClick: Se }, {
403
- default: c(() => [
404
- r(o(f), null, {
405
- default: c(() => [
406
- r(o(la))
414
+ x("div", Ca, [
415
+ r(l(M), { onClick: Me }, {
416
+ default: d(() => [
417
+ r(l(p), null, {
418
+ default: d(() => [
419
+ r(l(na))
407
420
  ]),
408
421
  _: 1
409
422
  })
@@ -411,15 +424,15 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
411
424
  _: 1
412
425
  })
413
426
  ]),
414
- x("div", Ba, [
415
- r(o(M), {
416
- disabled: w.value === 1,
417
- onClick: Me
427
+ x("div", Pa, [
428
+ r(l(M), {
429
+ disabled: I.value === 1,
430
+ onClick: Te
418
431
  }, {
419
- default: c(() => [
420
- r(o(f), null, {
421
- default: c(() => [
422
- w.value < 1 ? (i(), B(o(oa), { key: 0 })) : (i(), B(o(ta), { key: 1 }))
432
+ default: d(() => [
433
+ r(l(p), null, {
434
+ default: d(() => [
435
+ I.value < 1 ? (i(), B(l(ra), { key: 0 })) : (i(), B(l(ia), { key: 1 }))
423
436
  ]),
424
437
  _: 1
425
438
  })
@@ -428,102 +441,105 @@ const na = ["aria-label", "onClick"], ra = ["src", "poster", "title"], ia = {
428
441
  }, 8, ["disabled"])
429
442
  ])
430
443
  ]),
431
- default: c(() => [
432
- x("div", fa, [
433
- t.value?.kind === "image" ? (i(), B(o(he), {
444
+ default: d(() => [
445
+ x("div", ga, [
446
+ o.value?.kind === "image" ? (i(), B(l(ge), {
434
447
  key: 0,
435
- src: t.value.src,
436
- alt: t.value.alt || t.value.name || "",
437
- title: t.value.name,
448
+ src: o.value.src,
449
+ alt: o.value.alt || o.value.name || "",
450
+ title: o.value.name,
438
451
  fit: n.imageFit,
439
452
  "frame-border": 0,
440
- style: me({ transform: Ce.value }),
453
+ style: fe({ transform: $e.value }),
441
454
  onPointerdown: ce,
442
- onPointerup: de
443
- }, null, 8, ["src", "alt", "title", "fit", "style"])) : t.value?.kind === "video" ? (i(), u("video", {
455
+ onPointerup: ve
456
+ }, null, 8, ["src", "alt", "title", "fit", "style"])) : o.value?.kind === "video" ? (i(), u("video", {
444
457
  key: 1,
445
458
  ref_key: "currentVideoRef",
446
- ref: k,
459
+ ref: h,
447
460
  class: "nmorph-media-gallery__video",
448
- src: t.value.src,
449
- poster: t.value.poster || void 0,
450
- controls: Z.value,
451
- muted: be.value,
452
- playsinline: Ie.value,
453
- preload: Ne.value,
454
- title: t.value.name,
461
+ src: o.value.src,
462
+ poster: o.value.poster || void 0,
463
+ controls: W.value,
464
+ muted: Ne.value,
465
+ playsinline: xe.value,
466
+ preload: Be.value,
467
+ title: o.value.name,
455
468
  onPointerdown: ce,
456
- onPointerup: de,
457
- onLoadeddata: ie,
458
- onCanplay: ie,
459
- onPlay: De,
460
- onPause: Ke,
461
- onEnded: qe,
462
- onError: Oe
463
- }, null, 40, pa)) : d("", !0),
464
- xe.value ? (i(), u("button", {
469
+ onPointerup: ve,
470
+ onLoadedmetadata: L,
471
+ onDurationchange: L,
472
+ onProgress: L,
473
+ onCanplaythrough: L,
474
+ onSuspend: L,
475
+ onPlay: Oe,
476
+ onPause: Ue,
477
+ onEnded: Xe,
478
+ onError: Ye
479
+ }, null, 40, _a)) : v("", !0),
480
+ Fe.value ? (i(), u("button", {
465
481
  key: 2,
466
482
  class: "nmorph-media-gallery__play",
467
483
  type: "button",
468
- "aria-label": m.value ? `Pause ${E.value}` : `Play ${E.value}`,
469
- onClick: P(Te, ["stop"])
484
+ "aria-label": m.value ? `Pause ${R.value}` : `Play ${R.value}`,
485
+ onClick: $(De, ["stop"])
470
486
  }, [
471
- r(o(f), {
487
+ r(l(p), {
472
488
  size: "medium",
473
489
  color: "var(--nmorph-contrast-text-color)"
474
490
  }, {
475
- default: c(() => [
476
- m.value ? (i(), B(o(Je), { key: 0 })) : (i(), B(o(_e), { key: 1 }))
491
+ default: d(() => [
492
+ m.value ? (i(), B(l(aa), { key: 0 })) : (i(), B(l(ye), { key: 1 }))
477
493
  ]),
478
494
  _: 1
479
495
  })
480
- ], 8, ha)) : d("", !0),
481
- W.value ? (i(), u("span", ga, A(W.value), 1)) : d("", !0),
482
- Be.value ? (i(), u("div", _a, [
483
- j.value ? (i(), u("button", {
496
+ ], 8, ya)) : v("", !0),
497
+ J.value ? (i(), u("span", ka, D(J.value), 1)) : v("", !0),
498
+ Ce.value ? (i(), u("div", wa, [
499
+ Q.value ? (i(), u("button", {
484
500
  key: 0,
485
501
  type: "button",
486
502
  class: "nmorph-media-gallery__file-action",
487
- "aria-label": `Fullscreen ${E.value}`,
488
- onClick: P(Ae, ["stop"])
503
+ "aria-label": `Fullscreen ${R.value}`,
504
+ onClick: $(Re, ["stop"])
489
505
  }, [
490
- r(o(f), {
506
+ r(l(p), {
491
507
  size: "small",
492
508
  color: "var(--nmorph-contrast-text-color)"
493
509
  }, {
494
- default: c(() => [
495
- r(o(ge))
510
+ default: d(() => [
511
+ r(l(_e))
496
512
  ]),
497
513
  _: 1
498
514
  })
499
- ], 8, ya)) : d("", !0),
500
- D.value ? (i(), u("a", {
515
+ ], 8, ba)) : v("", !0),
516
+ K.value ? (i(), u("a", {
501
517
  key: 1,
502
- href: D.value,
503
- download: R.value || void 0,
518
+ href: K.value,
519
+ download: A.value || void 0,
504
520
  class: "nmorph-media-gallery__file-action",
505
- "aria-label": `Download ${R.value || "media"}`,
506
- onClick: P(Re, ["stop"])
521
+ "aria-label": `Download ${A.value || "media"}`,
522
+ onClick: $(Ke, ["stop"])
507
523
  }, [
508
- r(o(f), {
524
+ r(l(p), {
509
525
  size: "small",
510
526
  color: "var(--nmorph-contrast-text-color)"
511
527
  }, {
512
- default: c(() => [
513
- r(o(ye))
528
+ default: d(() => [
529
+ r(l(ke))
514
530
  ]),
515
531
  _: 1
516
532
  })
517
- ], 8, ka)) : d("", !0)
518
- ])) : d("", !0),
519
- Q.value ? (i(), u("span", wa, A(Q.value), 1)) : d("", !0)
533
+ ], 8, Ia)) : v("", !0)
534
+ ])) : v("", !0),
535
+ ae.value ? (i(), u("span", Na, D(ae.value), 1)) : v("", !0)
520
536
  ])
521
537
  ]),
522
538
  _: 1
523
- }, 8, ["show", "z-index", "state-class", "show-navigation", "show-action-bar"])) : d("", !0)
539
+ }, 8, ["show", "z-index", "state-class", "show-navigation", "show-action-bar"])) : v("", !0)
524
540
  ], 64));
525
541
  }
526
542
  });
527
543
  export {
528
- Wa as default
544
+ Qa as default
529
545
  };