@jt-home/mfe-components 1.0.46 → 1.0.48

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,6 +1,6 @@
1
- import { ref as A, isRef as le, watch as $, defineComponent as E, openBlock as I, createElementBlock as O, createElementVNode as V, onBeforeUnmount as q, h as a, computed as j, onMounted as ee, nextTick as pe, render as _ } from "vue";
2
- import { ElIcon as N } from "element-plus";
3
- const he = {
1
+ import { ref as j, isRef as ue, watch as $, defineComponent as x, openBlock as O, createElementBlock as N, createElementVNode as V, onBeforeUnmount as G, h as o, computed as E, onMounted as ee, nextTick as we, render as _ } from "vue";
2
+ import { ElIcon as J } from "element-plus";
3
+ const be = {
4
4
  common: {
5
5
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js 无法读取该文件,已切换为浏览器内置预览",
6
6
  PDF加载中___: "PDF 加载中...",
@@ -56,7 +56,7 @@ const he = {
56
56
  附件预览: "附件预览",
57
57
  附件预览未初始化: "附件预览未初始化"
58
58
  }
59
- }, ge = {
59
+ }, ye = {
60
60
  common: {
61
61
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js cannot read the file. It has been switched to browser built-in preview",
62
62
  PDF加载中___: "PDF loading...",
@@ -112,7 +112,7 @@ const he = {
112
112
  附件预览: "Attachment Preview",
113
113
  附件预览未初始化: "Attachment preview not initialized"
114
114
  }
115
- }, we = {
115
+ }, ke = {
116
116
  common: {
117
117
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js ไม่สามารถอ่านไฟล์ได้ เปลี่ยนเป็นตัวอย่างในตัวเบราว์เซอร์",
118
118
  PDF加载中___: "กําลังโหลดไฟล์ PDF ...",
@@ -168,7 +168,7 @@ const he = {
168
168
  附件预览: "เอกสารแนบตัวอย่าง",
169
169
  附件预览未初始化: "การแสดงตัวอย่างของสิ่งที่แนบมาไม่ได้เริ่มต้น"
170
170
  }
171
- }, ye = {
171
+ }, Pe = {
172
172
  common: {
173
173
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js không thể đọc tập tin, đã chuyển sang trình duyệt built-in xem trước",
174
174
  PDF加载中___: "Đang tải PDF...",
@@ -224,7 +224,7 @@ const he = {
224
224
  附件预览: "Xem trước tệp đính kèm",
225
225
  附件预览未初始化: "Bản xem trước đính kèm không được khởi tạo"
226
226
  }
227
- }, be = {
227
+ }, _e = {
228
228
  common: {
229
229
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js no puede leer este archivo, cambió a la vista previa integrada del navegador",
230
230
  PDF加载中___: "Carga de PDF...",
@@ -280,7 +280,7 @@ const he = {
280
280
  附件预览: "Anexo Preview",
281
281
  附件预览未初始化: "Anexo Preview no inicializado"
282
282
  }
283
- }, ke = {
283
+ }, De = {
284
284
  common: {
285
285
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js tidak dapat membaca file ini, telah beralih ke pratinjau built-in browser",
286
286
  PDF加载中___: "PDF sedang memuat...",
@@ -336,7 +336,7 @@ const he = {
336
336
  附件预览: "Lampiran Pratinjau",
337
337
  附件预览未初始化: "Lampiran Pratinjau tidak diinisialisasi Lampiran Pratinjau tidak diinisialisasi Lampiran Pratinjau tidak diinisialisasi Lampiran Pratinjau tidak diinisialisasi"
338
338
  }
339
- }, _e = {
339
+ }, Ae = {
340
340
  common: {
341
341
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js kann die Datei nicht lesen, wurde auf die eingebaute Vorschau des Browsers umgeschaltet",
342
342
  PDF加载中___: "PDF wird geladen...",
@@ -392,7 +392,7 @@ const he = {
392
392
  附件预览: "Anhang Vorschau",
393
393
  附件预览未初始化: "Anlage Vorschau nicht initialisiert"
394
394
  }
395
- }, Pe = {
395
+ }, je = {
396
396
  common: {
397
397
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "O PDF.js não pode ler o arquivo, mudou para a visualização integrada do navegador",
398
398
  PDF加载中___: "PDF Carregando...",
@@ -448,17 +448,17 @@ const he = {
448
448
  附件预览: "Anexo Preview",
449
449
  附件预览未初始化: "Anexo Preview não inicializado"
450
450
  }
451
- }, Ae = {}, De = {
452
- "zh-cn": he,
453
- en: ge,
454
- th: we,
455
- vi: ye,
456
- es: be,
457
- id: ke,
458
- de: _e,
459
- pt: Pe,
460
- km: Ae
461
- }, S = [
451
+ }, Le = {}, Ee = {
452
+ "zh-cn": be,
453
+ en: ye,
454
+ th: ke,
455
+ vi: Pe,
456
+ es: _e,
457
+ id: De,
458
+ de: Ae,
459
+ pt: je,
460
+ km: Le
461
+ }, U = [
462
462
  { key: "zh", label: "简体中文", displayLabel: "简体中文", elementPlusLocale: "zh-cn" },
463
463
  { key: "en", label: "英语", displayLabel: "English", elementPlusLocale: "en" },
464
464
  { key: "th", label: "泰语", displayLabel: "ไทย", elementPlusLocale: "th" },
@@ -470,27 +470,27 @@ const he = {
470
470
  { key: "km", label: "柬埔寨语", displayLabel: "ភាសាខ្មែរ", elementPlusLocale: "km" }
471
471
  ];
472
472
  Object.freeze(
473
- Object.fromEntries(S.map((e) => [e.key, e.elementPlusLocale]))
473
+ Object.fromEntries(U.map((e) => [e.key, e.elementPlusLocale]))
474
474
  );
475
- function Le(e, t = {}) {
476
- const n = t.fallback ?? "zh", o = Ee(t.languageList), i = e.toLowerCase();
477
- return o.find((l) => l.key === i) ?? o.find((l) => l.key === n) ?? S[0];
475
+ function xe(e, t = {}) {
476
+ const a = t.fallback ?? "zh", r = Be(t.languageList), n = e.toLowerCase();
477
+ return r.find((i) => i.key === n) ?? r.find((i) => i.key === a) ?? U[0];
478
478
  }
479
- function je(e, t = {}) {
480
- return Le(e, t).elementPlusLocale;
479
+ function Re(e, t = {}) {
480
+ return xe(e, t).elementPlusLocale;
481
481
  }
482
- function Ee(e) {
482
+ function Be(e) {
483
483
  return e != null && e.length ? e.map((t) => {
484
- const n = t.key ?? t.value, o = S.find((i) => i.key === n) ?? S[0];
484
+ const a = t.key ?? t.value, r = U.find((n) => n.key === a) ?? U[0];
485
485
  return {
486
- ...o,
486
+ ...r,
487
487
  ...t,
488
- key: o.key,
489
- elementPlusLocale: t.elementPlusLocale ?? o.elementPlusLocale
488
+ key: r.key,
489
+ elementPlusLocale: t.elementPlusLocale ?? r.elementPlusLocale
490
490
  };
491
- }) : S;
491
+ }) : U;
492
492
  }
493
- const xe = {
493
+ const Te = {
494
494
  "zh-hans": "zh",
495
495
  "zh-cn": "zh",
496
496
  cn: "zh",
@@ -504,69 +504,69 @@ const xe = {
504
504
  "pt-br": "pt",
505
505
  "km-kh": "km"
506
506
  };
507
- function U(e) {
507
+ function q(e) {
508
508
  const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
509
- return je(xe[t] || t) || "zh-cn";
509
+ return Re(Te[t] || t) || "zh-cn";
510
510
  }
511
- const B = A("zh-cn");
512
- let W;
511
+ const C = j("zh-cn");
512
+ let Q;
513
513
  function te() {
514
- W?.(), W = void 0;
514
+ Q?.(), Q = void 0;
515
515
  }
516
- function oe(e) {
517
- return e ? typeof e == "function" ? U(e()) : le(e) ? U(e.value) : U(e) : B.value;
516
+ function le(e) {
517
+ return e ? typeof e == "function" ? q(e()) : ue(e) ? q(e.value) : q(e) : C.value;
518
518
  }
519
- function Re(e, t) {
519
+ function Ce(e, t) {
520
520
  if (e)
521
- return t.split(".").reduce((n, o) => {
522
- if (!(!n || typeof n != "object"))
523
- return n[o];
521
+ return t.split(".").reduce((a, r) => {
522
+ if (!(!a || typeof a != "object"))
523
+ return a[r];
524
524
  }, e);
525
525
  }
526
- function re(e, t) {
527
- const n = Re(De[e], t);
528
- return typeof n == "string" ? n : void 0;
526
+ function se(e, t) {
527
+ const a = Ce(Ee[e], t);
528
+ return typeof a == "string" ? a : void 0;
529
529
  }
530
- function Ce(e, t) {
531
- return t ? e.replace(/\{(\w+)\}/g, (n, o) => {
532
- const i = t[o];
533
- return i == null ? n : String(i);
530
+ function Se(e, t) {
531
+ return t ? e.replace(/\{(\w+)\}/g, (a, r) => {
532
+ const n = t[r];
533
+ return n == null ? a : String(n);
534
534
  }) : e;
535
535
  }
536
- function st(e) {
537
- te(), B.value = U(e);
536
+ function ft(e) {
537
+ te(), C.value = q(e);
538
538
  }
539
- function ct() {
540
- return B.value;
539
+ function pt() {
540
+ return C.value;
541
541
  }
542
- function ut() {
543
- te(), B.value = "zh-cn";
542
+ function vt() {
543
+ te(), C.value = "zh-cn";
544
544
  }
545
- function dt(e, t = {}) {
545
+ function ht(e, t = {}) {
546
546
  if (te(), t.locale) {
547
- if (typeof t.locale == "function" || le(t.locale)) {
548
- W = $(
549
- () => oe(t.locale),
550
- (n) => {
551
- B.value = n;
547
+ if (typeof t.locale == "function" || ue(t.locale)) {
548
+ Q = $(
549
+ () => le(t.locale),
550
+ (a) => {
551
+ C.value = a;
552
552
  },
553
553
  { immediate: !0, flush: "sync" }
554
554
  );
555
555
  return;
556
556
  }
557
- B.value = oe(t.locale);
557
+ C.value = le(t.locale);
558
558
  }
559
559
  }
560
- function s(e, t = e, n) {
561
- const o = t || e, i = B.value, l = re(i, e) || re("zh-cn", e) || o || e;
562
- return Ce(l, n);
560
+ function c(e, t = e, a) {
561
+ const r = t || e, n = C.value, i = se(n, e) || se("zh-cn", e) || r || e;
562
+ return Se(i, a);
563
563
  }
564
564
  /*! Element Plus Icons Vue v2.3.2 */
565
- var Be = /* @__PURE__ */ E({
565
+ var ze = /* @__PURE__ */ x({
566
566
  name: "Download",
567
567
  __name: "download",
568
568
  setup(e) {
569
- return (t, n) => (I(), O("svg", {
569
+ return (t, a) => (O(), N("svg", {
570
570
  xmlns: "http://www.w3.org/2000/svg",
571
571
  viewBox: "0 0 1024 1024"
572
572
  }, [
@@ -576,11 +576,11 @@ var Be = /* @__PURE__ */ E({
576
576
  })
577
577
  ]));
578
578
  }
579
- }), Te = Be, ze = /* @__PURE__ */ E({
579
+ }), Me = ze, Fe = /* @__PURE__ */ x({
580
580
  name: "RefreshLeft",
581
581
  __name: "refresh-left",
582
582
  setup(e) {
583
- return (t, n) => (I(), O("svg", {
583
+ return (t, a) => (O(), N("svg", {
584
584
  xmlns: "http://www.w3.org/2000/svg",
585
585
  viewBox: "0 0 1024 1024"
586
586
  }, [
@@ -590,11 +590,11 @@ var Be = /* @__PURE__ */ E({
590
590
  })
591
591
  ]));
592
592
  }
593
- }), Fe = ze, Me = /* @__PURE__ */ E({
593
+ }), Ue = Fe, Ie = /* @__PURE__ */ x({
594
594
  name: "ZoomIn",
595
595
  __name: "zoom-in",
596
596
  setup(e) {
597
- return (t, n) => (I(), O("svg", {
597
+ return (t, a) => (O(), N("svg", {
598
598
  xmlns: "http://www.w3.org/2000/svg",
599
599
  viewBox: "0 0 1024 1024"
600
600
  }, [
@@ -604,11 +604,11 @@ var Be = /* @__PURE__ */ E({
604
604
  })
605
605
  ]));
606
606
  }
607
- }), Se = Me, Je = /* @__PURE__ */ E({
607
+ }), Je = Ie, qe = /* @__PURE__ */ x({
608
608
  name: "ZoomOut",
609
609
  __name: "zoom-out",
610
610
  setup(e) {
611
- return (t, n) => (I(), O("svg", {
611
+ return (t, a) => (O(), N("svg", {
612
612
  xmlns: "http://www.w3.org/2000/svg",
613
613
  viewBox: "0 0 1024 1024"
614
614
  }, [
@@ -618,8 +618,8 @@ var Be = /* @__PURE__ */ E({
618
618
  })
619
619
  ]));
620
620
  }
621
- }), Ne = Je;
622
- const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8lfcJjS1+KjrsVXapWapr////9sfaKrtMrV2uWBj7B4iKqWob1wgaXr7fOBj6/Ax9dhc5yhq8OKl7Wba+6tAAAAE3RSTlMAgGDuDyVLoYDe2XuXRb68cy6e4BCQEAAAAyZJREFUeNrt29tyokAUheGOQjIoeMhuCQ4e0Pd/yCE1STU4mGq7bXqzZ/23ufoqYblTqkIIIYQQQggNlM42Lzctf5nMD22bKQYVOQ30s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Me+LQKBVWc2of5gwNis1kzdAYGt3nIJdQcDFpM9DTF1BgQ2u1fja2dAYMHbLqHOgMDCsW352w8iCKweWDHffhBBYOyba2Nabz+IKDB3eFk+36+IILDQXPlQRnpdKLC0d+W9sjMoMN8kJY04woEC+6kbJY05dIMC86OPSaHA0ugREQWWR7tQYP/atZcUBmEoCsNHA4FEBxHvyKJQ7P7X2EGdlHbiNYNjON8OfvIkZP2Zi9tqV7CE2V77TyxL2PdkXJ52GUuYvZbKL1IsYcfr9GPbq2WxhJ2gMIUpTGEcFKYwEgpTGAmFKYyEwhRGQmEKI+EJy3YDCeeNdgOesMH4ZTgk4zfAoxi9GR6dsctwCfRD1sNnNm7HCmtuY8wRH42dZSXCL/CW5QQcmtoax4iLIuOglQkVpIHrPlzGPqCSNE8diT4FiIiIiIjIP2/v9e/hKQXqEwAAAABJRU5ErkJggg==", Ve = /* @__PURE__ */ new Set([
623
623
  "jpg",
624
624
  "jpeg",
625
625
  "png",
@@ -629,7 +629,7 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
629
629
  "svg",
630
630
  "avif",
631
631
  "ico"
632
- ]), Oe = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), Ve = /* @__PURE__ */ new Set([
632
+ ]), Ge = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), He = /* @__PURE__ */ new Set([
633
633
  "mp3",
634
634
  "wav",
635
635
  "ogg",
@@ -637,7 +637,7 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
637
637
  "m4a",
638
638
  "aac",
639
639
  "flac"
640
- ]), qe = /* @__PURE__ */ new Set([
640
+ ]), Ke = /* @__PURE__ */ new Set([
641
641
  "html",
642
642
  "htm",
643
643
  "txt",
@@ -646,7 +646,7 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
646
646
  "csv",
647
647
  "md",
648
648
  "log"
649
- ]), Ge = /* @__PURE__ */ new Set([
649
+ ]), We = /* @__PURE__ */ new Set([
650
650
  "doc",
651
651
  "docx",
652
652
  "xls",
@@ -656,147 +656,150 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
656
656
  "zip",
657
657
  "rar",
658
658
  "7z"
659
- ]), Q = {
659
+ ]), X = {
660
660
  component: "JtAttachmentPreview",
661
- marker: "2026-06-25-download-fix-recheck",
661
+ marker: "2026-06-25-download-error-detail",
662
662
  source: "@jt-home/mfe-components/src/components/JtAttachmentPreview/index.ts",
663
663
  pdfLoadMode: "fetch-bytes-then-pdfjs-data",
664
- previewDownloadMode: "blob-only-no-raw-url-fallback"
664
+ previewDownloadMode: "openByParams-uses-registered-downloadRequest",
665
+ downloadResponseMode: "supports-blob-and-axios-response-data-blob"
665
666
  };
666
- function k(e, t) {
667
- console.info(`[JtAttachmentPreview DEBUG ${Q.marker}] ${e}`, {
668
- ...Q,
667
+ function p(e, t) {
668
+ console.info(`[JtAttachmentPreview DEBUG ${X.marker}] ${e}`, {
669
+ ...X,
669
670
  ...t
670
671
  });
671
672
  }
672
- typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = Q, k("module-loaded"));
673
- let P = null, H = null, Y = null;
674
- async function He() {
675
- return H || (H = Promise.all([
673
+ typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = X, p("module-loaded"));
674
+ let D = null, K = null, A = null;
675
+ async function Qe() {
676
+ return K || (K = Promise.all([
676
677
  import("./pdf-BmBuG7of.js"),
677
678
  import("./pdf.worker.min-4PI-nNLo.js")
678
- ]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), H;
679
+ ]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), K;
679
680
  }
680
- function Ke(e) {
681
+ function Xe(e) {
681
682
  return typeof e == "string" ? { url: e } : e;
682
683
  }
683
- function se(e) {
684
+ function de(e) {
684
685
  const [t] = e.split(/[?#]/);
685
686
  return t ?? "";
686
687
  }
687
- function ne(e, t) {
688
+ function ae(e, t) {
688
689
  if (t?.trim()) return t.trim();
689
- const n = se(e).split("/").filter(Boolean).pop();
690
- if (!n) return s("common.附件预览");
690
+ const a = de(e).split("/").filter(Boolean).pop();
691
+ if (!a) return c("common.附件预览");
691
692
  try {
692
- return decodeURIComponent(n);
693
+ return decodeURIComponent(a);
693
694
  } catch {
694
- return n;
695
+ return a;
695
696
  }
696
697
  }
697
- function X(e) {
698
- return se(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
698
+ function Z(e) {
699
+ return de(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
699
700
  }
700
- function We(e) {
701
+ function Ze(e) {
701
702
  return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
702
703
  }
703
- function Qe(e) {
704
- const t = We(e);
705
- return Ie.has(t) ? "image" : t === "pdf" ? "pdf" : Oe.has(t) ? "video" : Ve.has(t) ? "audio" : qe.has(t) ? "iframe" : Ge.has(t) ? "unsupported" : "unknown";
704
+ function $e(e) {
705
+ const t = Ze(e);
706
+ return Ve.has(t) ? "image" : t === "pdf" ? "pdf" : Ge.has(t) ? "video" : He.has(t) ? "audio" : Ke.has(t) ? "iframe" : We.has(t) ? "unsupported" : "unknown";
706
707
  }
707
- function ae(e) {
708
+ function ne(e) {
708
709
  const t = e.toLowerCase().split(";")[0]?.trim() ?? "";
709
710
  return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("text/") ? "iframe" : "unknown";
710
711
  }
711
- function ce(e) {
712
+ function me(e) {
712
713
  if (!e.url.trim()) return "empty";
713
714
  if (e.mode && e.mode !== "auto") return e.mode;
714
715
  if (e.mimeType) {
715
- const n = ae(e.mimeType);
716
- if (n !== "unknown") return n;
716
+ const a = ne(e.mimeType);
717
+ if (a !== "unknown") return a;
717
718
  }
718
- const t = Qe(
719
- e.extension || X(e.name || "") || X(e.url)
719
+ const t = $e(
720
+ e.extension || Z(e.name || "") || Z(e.url)
720
721
  );
721
722
  return t !== "unknown" ? t : "unknown";
722
723
  }
723
- async function Xe(e) {
724
+ async function et(e) {
724
725
  try {
725
- const n = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
726
- return ae(n);
726
+ const a = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
727
+ return ne(a);
727
728
  } catch {
728
729
  return "unknown";
729
730
  }
730
731
  }
731
- async function ue(e) {
732
- const t = await fetch(e);
733
- if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
734
- return t.blob();
732
+ async function fe(e, t) {
733
+ const a = await fetch(e, t);
734
+ if (!a.ok) throw new Error(`fetch failed: ${a.status}`);
735
+ return a.blob();
735
736
  }
736
- async function Ze(e) {
737
- k("fetch-pdf-bytes-start", {
737
+ async function tt(e) {
738
+ p("fetch-pdf-bytes-start", {
738
739
  url: e
739
740
  });
740
741
  const t = await fetch(e);
741
742
  if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
742
- const n = new Uint8Array(await t.arrayBuffer());
743
- return k("fetch-pdf-bytes-done", {
743
+ const a = new Uint8Array(await t.arrayBuffer());
744
+ return p("fetch-pdf-bytes-done", {
744
745
  url: e,
745
- byteLength: n.byteLength,
746
+ byteLength: a.byteLength,
746
747
  contentType: t.headers.get("content-type") ?? ""
747
- }), n;
748
+ }), a;
748
749
  }
749
- function $e(e, t) {
750
- const n = X(t);
751
- return n === "doc" || n === "docx" ? "W" : n === "xls" || n === "xlsx" ? "X" : n === "ppt" || n === "pptx" ? "P" : n === "zip" || n === "rar" || n === "7z" ? "ZIP" : e === "pdf" ? "PDF" : "FILE";
750
+ function at(e, t) {
751
+ const a = Z(t);
752
+ return a === "doc" || a === "docx" ? "W" : a === "xls" || a === "xlsx" ? "X" : a === "ppt" || a === "pptx" ? "P" : a === "zip" || a === "rar" || a === "7z" ? "ZIP" : e === "pdf" ? "PDF" : "FILE";
752
753
  }
753
- function de(e, t, n, o = !1) {
754
- return a(
754
+ function pe(e, t, a, r = !1) {
755
+ return o(
755
756
  "button",
756
757
  {
757
- class: n,
758
+ class: a,
758
759
  type: "button",
759
760
  onClick: () => {
760
- k("download-button-click", {
761
- url: e,
761
+ p("download-button-click", {
762
+ url: e.url,
762
763
  downloadName: t,
763
- fallbackToRawUrl: o
764
- }), fe(e, t, { fallbackToRawUrl: o });
764
+ fallbackToRawUrl: r
765
+ }), he(e, t, {
766
+ fallbackToRawUrl: r
767
+ });
765
768
  }
766
769
  },
767
770
  [
768
- a(
769
- N,
771
+ o(
772
+ J,
770
773
  { class: "jt-attachment-preview-service__download-icon" },
771
- () => a(Te)
774
+ () => o(Me)
772
775
  ),
773
- a(
776
+ o(
774
777
  "span",
775
778
  { class: "jt-attachment-preview-service__download-text" },
776
- s("common.下载")
779
+ c("common.下载")
777
780
  )
778
781
  ]
779
782
  );
780
783
  }
781
- function K(e) {
784
+ function W(e) {
782
785
  return e === "image" || e === "pdf";
783
786
  }
784
- function me(e) {
785
- return a(
787
+ function ve(e) {
788
+ return o(
786
789
  "div",
787
790
  { class: "jt-attachment-preview-service__preview-fallback" },
788
791
  [
789
- a("img", {
792
+ o("img", {
790
793
  class: "jt-attachment-preview-service__preview-fallback-icon",
791
794
  src: e.icon,
792
795
  alt: ""
793
796
  }),
794
- a(
797
+ o(
795
798
  "div",
796
799
  { class: "jt-attachment-preview-service__unsupported-text" },
797
- s("common.暂不支持预览此类型的文件")
800
+ c("common.暂不支持预览此类型的文件")
798
801
  ),
799
- a(
802
+ o(
800
803
  "div",
801
804
  {
802
805
  class: "jt-attachment-preview-service__file-name",
@@ -807,36 +810,145 @@ function me(e) {
807
810
  ]
808
811
  );
809
812
  }
810
- function Z(e, t) {
811
- const n = document.createElement("a");
812
- n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove();
813
+ function oe(e, t) {
814
+ const a = document.createElement("a");
815
+ a.href = e, a.download = t, a.style.display = "none", document.body.appendChild(a), a.click(), a.remove();
816
+ }
817
+ function re(e, t) {
818
+ const a = URL.createObjectURL(e);
819
+ oe(a, t), window.setTimeout(() => URL.revokeObjectURL(a), 1e3);
820
+ }
821
+ function Y(e) {
822
+ return e instanceof Blob || Object.prototype.toString.call(e) === "[object Blob]";
823
+ }
824
+ function nt(e, t) {
825
+ if (Y(e))
826
+ return e;
827
+ if (e && typeof e == "object") {
828
+ const a = e;
829
+ if (Y(a.data)) {
830
+ const r = a.data;
831
+ return {
832
+ blob: a.data,
833
+ name: a.fileName || a.name || r.name || t
834
+ };
835
+ }
836
+ }
837
+ return null;
813
838
  }
814
- async function fe(e, t, n = {}) {
815
- k("download-start", {
839
+ async function ot(e, t, a = {}) {
840
+ p("download-start", {
816
841
  url: e,
817
842
  downloadName: t,
818
- fallbackToRawUrl: !!n.fallbackToRawUrl
843
+ fallbackToRawUrl: !!a.fallbackToRawUrl,
844
+ hasRequestInit: !!a.requestInit
819
845
  });
820
- let o = "";
821
846
  try {
822
- const i = await ue(e);
823
- o = URL.createObjectURL(i), k("download-blob-ready", {
847
+ const r = await fe(e, a.requestInit);
848
+ p("download-blob-ready", {
824
849
  url: e,
825
850
  downloadName: t,
826
- blobType: i.type,
827
- blobSize: i.size
828
- }), Z(o, t);
851
+ blobType: r.type,
852
+ blobSize: r.size
853
+ }), re(r, t);
829
854
  } catch {
830
- k("download-blob-failed", {
855
+ p("download-blob-failed", {
831
856
  url: e,
832
857
  downloadName: t,
833
- fallbackToRawUrl: !!n.fallbackToRawUrl
834
- }), n.fallbackToRawUrl && Z(e, t);
835
- } finally {
836
- o && window.setTimeout(() => URL.revokeObjectURL(o), 1e3);
858
+ fallbackToRawUrl: !!a.fallbackToRawUrl
859
+ }), a.fallbackToRawUrl && oe(e, t);
837
860
  }
838
861
  }
839
- const et = E({
862
+ function ce(e, t) {
863
+ return e instanceof Blob ? { blob: e, name: t } : e ? {
864
+ url: e.url,
865
+ blob: e.blob,
866
+ name: e.name || t,
867
+ requestInit: e.requestInit,
868
+ fallbackToRawUrl: e.fallbackToRawUrl
869
+ } : null;
870
+ }
871
+ async function he(e, t, a = {}) {
872
+ const r = {
873
+ url: e.url,
874
+ name: t,
875
+ params: e.requestParams,
876
+ options: e
877
+ };
878
+ try {
879
+ let n = null;
880
+ if (p("download-resolve-start", {
881
+ url: e.url,
882
+ downloadName: t,
883
+ hasCustomDownload: !!e.download,
884
+ hasRegisteredDownload: !!A?.downloadRequest,
885
+ useRegisteredDownload: !!e.useRegisteredDownload,
886
+ hasRequestParams: Object.prototype.hasOwnProperty.call(
887
+ e,
888
+ "requestParams"
889
+ )
890
+ }), e.download) {
891
+ p("download-custom-handler-start", {
892
+ url: e.url,
893
+ downloadName: t
894
+ });
895
+ const l = await e.download(r);
896
+ if (n = ce(l, t), !n) {
897
+ p("download-custom-handler-done", {
898
+ url: e.url,
899
+ downloadName: t
900
+ });
901
+ return;
902
+ }
903
+ } else if (e.useRegisteredDownload && A?.downloadRequest) {
904
+ p("download-setup-request-start", {
905
+ url: e.url,
906
+ downloadName: t,
907
+ params: e.requestParams
908
+ });
909
+ const l = await A.downloadRequest(
910
+ e.requestParams
911
+ );
912
+ p("download-request-response", {
913
+ isBlob: Y(l),
914
+ isDataBlob: !!l && typeof l == "object" && Y(l.data),
915
+ responseType: Object.prototype.toString.call(l)
916
+ });
917
+ const h = nt(l, t), f = h || (A.mapDownloadResponse ? A.mapDownloadResponse(
918
+ l,
919
+ e.requestParams
920
+ ) : l);
921
+ n = ce(f, t);
922
+ }
923
+ if (n?.blob) {
924
+ p("download-result-blob", {
925
+ downloadName: n.name,
926
+ blobType: n.blob.type,
927
+ blobSize: n.blob.size
928
+ }), re(n.blob, n.name);
929
+ return;
930
+ }
931
+ const i = n?.url || e.downloadUrl || e.url, u = n?.name || t;
932
+ await ot(i, u, {
933
+ requestInit: n?.requestInit || e.downloadRequestInit,
934
+ fallbackToRawUrl: n?.fallbackToRawUrl ?? e.downloadFallbackToRawUrl ?? a.fallbackToRawUrl
935
+ });
936
+ } catch (n) {
937
+ p("download-handler-failed", {
938
+ url: e.url,
939
+ downloadName: t,
940
+ errorName: n instanceof Error ? n.name : "",
941
+ errorMessage: n instanceof Error ? n.message : String(n),
942
+ errorStack: n instanceof Error ? n.stack : "",
943
+ errorResponseStatus: n && typeof n == "object" ? n.response?.status : void 0,
944
+ errorResponseType: n && typeof n == "object" ? Object.prototype.toString.call(
945
+ n.response?.data
946
+ ) : void 0,
947
+ errorResponseDataType: n && typeof n == "object" ? n.response?.data?.type : void 0
948
+ }), a.fallbackToRawUrl && oe(e.downloadUrl || e.url, t);
949
+ }
950
+ }
951
+ const rt = x({
840
952
  name: "JtAttachmentPreviewPdfCanvas",
841
953
  props: {
842
954
  url: {
@@ -861,149 +973,149 @@ const et = E({
861
973
  previewError: (e) => e instanceof Event
862
974
  },
863
975
  setup(e, { emit: t }) {
864
- const n = A("loading"), o = A([]), i = A([]), l = /* @__PURE__ */ new Map(), c = A("");
865
- let m = null, b = [], f = 0;
866
- async function v(r, u) {
867
- if (!u) return null;
868
- const g = typeof u == "string" ? await r.getDestination(u) : u;
869
- return !Array.isArray(g) || !g[0] ? null : await r.getPageIndex(g[0]) + 1;
976
+ const a = j("loading"), r = j([]), n = j([]), i = /* @__PURE__ */ new Map(), u = j("");
977
+ let l = null, h = [], f = 0;
978
+ async function v(s, d) {
979
+ if (!d) return null;
980
+ const w = typeof d == "string" ? await s.getDestination(d) : d;
981
+ return !Array.isArray(w) || !w[0] ? null : await s.getPageIndex(w[0]) + 1;
870
982
  }
871
- async function x(r, u, g = 0) {
872
- if (!u?.length) return [];
873
- const w = [];
874
- for (const L of u) {
875
- const T = await v(r, L.dest);
876
- w.push({
877
- title: L.title || s("common.未命名标题"),
878
- pageNumber: T,
879
- level: g
983
+ async function k(s, d, w = 0) {
984
+ if (!d?.length) return [];
985
+ const b = [];
986
+ for (const L of d) {
987
+ const S = await v(s, L.dest);
988
+ b.push({
989
+ title: L.title || c("common.未命名标题"),
990
+ pageNumber: S,
991
+ level: w
880
992
  });
881
- const R = await x(r, L.items, g + 1);
882
- w.push(...R);
993
+ const B = await k(s, L.items, w + 1);
994
+ b.push(...B);
883
995
  }
884
- return w;
996
+ return b;
885
997
  }
886
- function h() {
998
+ function g() {
887
999
  f += 1;
888
- for (const r of b)
889
- r.cancel();
890
- b = [], m?.destroy(), m = null, l.clear();
1000
+ for (const s of h)
1001
+ s.cancel();
1002
+ h = [], l?.destroy(), l = null, i.clear();
891
1003
  }
892
- async function D() {
893
- h();
894
- const r = f;
895
- n.value = "loading", c.value = "", o.value = [], i.value = [];
1004
+ async function R() {
1005
+ g();
1006
+ const s = f;
1007
+ a.value = "loading", u.value = "", r.value = [], n.value = [];
896
1008
  try {
897
- const u = await He();
898
- if (r !== f) return;
899
- const g = await Ze(e.url);
900
- if (r !== f) return;
901
- k("render-pdf-get-document-data", {
902
- byteLength: g.byteLength
903
- }), m = u.getDocument({ data: g });
904
- const w = await m.promise;
905
- if (r !== f) return;
906
- o.value = Array.from(
907
- { length: w.numPages },
908
- (R, C) => C + 1
909
- ), i.value = await x(
910
- w,
911
- await w.getOutline()
912
- ), await pe();
913
- const L = l.values().next().value, T = Math.max(
1009
+ const d = await Qe();
1010
+ if (s !== f) return;
1011
+ const w = await tt(e.url);
1012
+ if (s !== f) return;
1013
+ p("render-pdf-get-document-data", {
1014
+ byteLength: w.byteLength
1015
+ }), l = d.getDocument({ data: w });
1016
+ const b = await l.promise;
1017
+ if (s !== f) return;
1018
+ r.value = Array.from(
1019
+ { length: b.numPages },
1020
+ (B, T) => T + 1
1021
+ ), n.value = await k(
1022
+ b,
1023
+ await b.getOutline()
1024
+ ), await we();
1025
+ const L = i.values().next().value, S = Math.max(
914
1026
  (L?.parentElement?.clientWidth ?? 800) - 32,
915
1027
  320
916
1028
  );
917
- for (const R of o.value) {
918
- if (r !== f) return;
919
- const C = await w.getPage(R), y = l.get(R), z = y?.getContext("2d");
1029
+ for (const B of r.value) {
1030
+ if (s !== f) return;
1031
+ const T = await b.getPage(B), y = i.get(B), z = y?.getContext("2d");
920
1032
  if (!y || !z) continue;
921
- const G = C.getViewport({ scale: 1 }), d = Math.min(T / G.width, 2), F = C.getViewport({ scale: d }), J = window.devicePixelRatio || 1;
922
- y.width = Math.floor(F.width * J), y.height = Math.floor(F.height * J), y.style.width = `${Math.floor(F.width)}px`, y.style.height = `${Math.floor(F.height)}px`, z.setTransform(J, 0, 0, J, 0, 0);
923
- const ie = C.render({
1033
+ const H = T.getViewport({ scale: 1 }), m = Math.min(S / H.width, 2), M = T.getViewport({ scale: m }), I = window.devicePixelRatio || 1;
1034
+ y.width = Math.floor(M.width * I), y.height = Math.floor(M.height * I), y.style.width = `${Math.floor(M.width)}px`, y.style.height = `${Math.floor(M.height)}px`, z.setTransform(I, 0, 0, I, 0, 0);
1035
+ const ie = T.render({
924
1036
  canvas: y,
925
1037
  canvasContext: z,
926
- viewport: F
1038
+ viewport: M
927
1039
  });
928
- b.push(ie), await ie.promise;
1040
+ h.push(ie), await ie.promise;
929
1041
  }
930
- if (r !== f) return;
931
- n.value = "ready", t("previewLoad", new Event("load"));
932
- } catch (u) {
933
- if (r !== f) return;
934
- n.value = "error", c.value = u instanceof Error ? u.message : s("common.PDF加载失败"), t("previewError", new Event("error"));
1042
+ if (s !== f) return;
1043
+ a.value = "ready", t("previewLoad", new Event("load"));
1044
+ } catch (d) {
1045
+ if (s !== f) return;
1046
+ a.value = "error", u.value = d instanceof Error ? d.message : c("common.PDF加载失败"), t("previewError", new Event("error"));
935
1047
  }
936
1048
  }
937
- $(() => e.url, D, { immediate: !0 }), q(h);
938
- function p(r) {
939
- if (!r) return;
940
- l.get(r)?.scrollIntoView({ behavior: "smooth", block: "start" });
1049
+ $(() => e.url, R, { immediate: !0 }), G(g);
1050
+ function P(s) {
1051
+ if (!s) return;
1052
+ i.get(s)?.scrollIntoView({ behavior: "smooth", block: "start" });
941
1053
  }
942
- return () => a("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
943
- n.value === "loading" ? a(
1054
+ return () => o("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
1055
+ a.value === "loading" ? o(
944
1056
  "div",
945
1057
  { class: "jt-attachment-preview-service__pdf-state" },
946
- s("common.PDF加载中___")
1058
+ c("common.PDF加载中___")
947
1059
  ) : null,
948
- n.value === "error" ? a("div", { class: "jt-attachment-preview-service__pdf-state" }, [
949
- me({
950
- icon: Ye,
1060
+ a.value === "error" ? o("div", { class: "jt-attachment-preview-service__pdf-state" }, [
1061
+ ve({
1062
+ icon: Ne,
951
1063
  name: e.name
952
1064
  })
953
1065
  ]) : null,
954
1066
  null,
955
1067
  null,
956
- a(
1068
+ o(
957
1069
  "div",
958
1070
  {
959
1071
  class: [
960
1072
  "jt-attachment-preview-service__pdf-layout",
961
- n.value !== "ready" ? "jt-attachment-preview-service__pdf-layout--hidden" : ""
1073
+ a.value !== "ready" ? "jt-attachment-preview-service__pdf-layout--hidden" : ""
962
1074
  ]
963
1075
  },
964
1076
  [
965
- i.value.length ? a(
1077
+ n.value.length ? o(
966
1078
  "aside",
967
1079
  { class: "jt-attachment-preview-service__pdf-outline" },
968
1080
  [
969
- a(
1081
+ o(
970
1082
  "div",
971
1083
  {
972
1084
  class: "jt-attachment-preview-service__pdf-outline-title"
973
1085
  },
974
- s("common.目录")
1086
+ c("common.目录")
975
1087
  ),
976
- a(
1088
+ o(
977
1089
  "div",
978
1090
  {
979
1091
  class: "jt-attachment-preview-service__pdf-outline-list"
980
1092
  },
981
- i.value.map(
982
- (r, u) => a(
1093
+ n.value.map(
1094
+ (s, d) => o(
983
1095
  "button",
984
1096
  {
985
- key: `${r.title}-${u}`,
1097
+ key: `${s.title}-${d}`,
986
1098
  class: "jt-attachment-preview-service__pdf-outline-item",
987
- style: { paddingLeft: `${12 + r.level * 14}px` },
1099
+ style: { paddingLeft: `${12 + s.level * 14}px` },
988
1100
  type: "button",
989
- disabled: !r.pageNumber,
990
- title: r.title,
991
- onClick: () => p(r.pageNumber)
1101
+ disabled: !s.pageNumber,
1102
+ title: s.title,
1103
+ onClick: () => P(s.pageNumber)
992
1104
  },
993
- r.title
1105
+ s.title
994
1106
  )
995
1107
  )
996
1108
  )
997
1109
  ]
998
1110
  ) : null,
999
- a(
1111
+ o(
1000
1112
  "div",
1001
1113
  { class: "jt-attachment-preview-service__pdf-pages" },
1002
- o.value.map(
1003
- (r) => a("canvas", {
1004
- key: r,
1005
- ref: (u) => {
1006
- u instanceof HTMLCanvasElement && l.set(r, u);
1114
+ r.value.map(
1115
+ (s) => o("canvas", {
1116
+ key: s,
1117
+ ref: (d) => {
1118
+ d instanceof HTMLCanvasElement && i.set(s, d);
1007
1119
  },
1008
1120
  class: "jt-attachment-preview-service__pdf-page"
1009
1121
  })
@@ -1013,7 +1125,7 @@ const et = E({
1013
1125
  )
1014
1126
  ]);
1015
1127
  }
1016
- }), tt = E({
1128
+ }), it = x({
1017
1129
  name: "JtAttachmentPreviewImageTransform",
1018
1130
  props: {
1019
1131
  url: {
@@ -1042,130 +1154,130 @@ const et = E({
1042
1154
  previewError: (e) => e instanceof Event
1043
1155
  },
1044
1156
  setup(e, { emit: t }) {
1045
- const n = A(null), o = A("ready"), i = A(1), l = A(!1);
1046
- let c = 0, m = 0, b = 0, f = 0, v = 0, x = 0, h = 0;
1047
- const D = j(
1157
+ const a = j(null), r = j("ready"), n = j(1), i = j(!1);
1158
+ let u = 0, l = 0, h = 0, f = 0, v = 0, k = 0, g = 0;
1159
+ const R = E(
1048
1160
  () => ({
1049
1161
  "--jt-attachment-preview-service-image-fit": e.fit,
1050
- transform: `translate(${c}px, ${m}px) scale(${i.value})`
1162
+ transform: `translate(${u}px, ${l}px) scale(${n.value})`
1051
1163
  })
1052
1164
  );
1053
- function p() {
1054
- n.value && (n.value.style.transform = `translate(${c}px, ${m}px) scale(${i.value})`);
1165
+ function P() {
1166
+ a.value && (a.value.style.transform = `translate(${u}px, ${l}px) scale(${n.value})`);
1055
1167
  }
1056
- function r() {
1057
- h || (h = window.requestAnimationFrame(() => {
1058
- h = 0, p();
1168
+ function s() {
1169
+ g || (g = window.requestAnimationFrame(() => {
1170
+ g = 0, P();
1059
1171
  }));
1060
1172
  }
1061
- function u(d) {
1062
- i.value = Math.min(Math.max(Number(d.toFixed(2)), 0.2), 5), i.value <= 1 && (c = 0, m = 0), p();
1063
- }
1064
- function g() {
1065
- u(i.value + 0.2);
1173
+ function d(m) {
1174
+ n.value = Math.min(Math.max(Number(m.toFixed(2)), 0.2), 5), n.value <= 1 && (u = 0, l = 0), P();
1066
1175
  }
1067
1176
  function w() {
1068
- const d = Math.max(Number((i.value - 0.2).toFixed(2)), 0.2);
1069
- i.value = d, d <= 1 && (c = 0, m = 0), p();
1177
+ d(n.value + 0.2);
1178
+ }
1179
+ function b() {
1180
+ const m = Math.max(Number((n.value - 0.2).toFixed(2)), 0.2);
1181
+ n.value = m, m <= 1 && (u = 0, l = 0), P();
1070
1182
  }
1071
1183
  function L() {
1072
- c = 0, m = 0, u(1);
1184
+ u = 0, l = 0, d(1);
1073
1185
  }
1074
- function T(d) {
1075
- o.value = "ready", t("previewLoad", d);
1186
+ function S(m) {
1187
+ r.value = "ready", t("previewLoad", m);
1076
1188
  }
1077
- function R(d) {
1078
- o.value = "error", t("previewError", d);
1189
+ function B(m) {
1190
+ r.value = "error", t("previewError", m);
1079
1191
  }
1080
- function C(d) {
1081
- i.value <= 1 || (d.preventDefault(), l.value = !0, b = d.clientX, f = d.clientY, v = c, x = m, window.addEventListener("pointermove", y), window.addEventListener("pointerup", z, { once: !0 }));
1192
+ function T(m) {
1193
+ n.value <= 1 || (m.preventDefault(), i.value = !0, h = m.clientX, f = m.clientY, v = u, k = l, window.addEventListener("pointermove", y), window.addEventListener("pointerup", z, { once: !0 }));
1082
1194
  }
1083
- function y(d) {
1084
- l.value && (c = v + d.clientX - b, m = x + d.clientY - f, r());
1195
+ function y(m) {
1196
+ i.value && (u = v + m.clientX - h, l = k + m.clientY - f, s());
1085
1197
  }
1086
1198
  function z() {
1087
- l.value = !1, window.removeEventListener("pointermove", y);
1199
+ i.value = !1, window.removeEventListener("pointermove", y);
1088
1200
  }
1089
- function G(d) {
1090
- d.preventDefault(), u(i.value + (d.deltaY < 0 ? 0.1 : -0.1));
1201
+ function H(m) {
1202
+ m.preventDefault(), d(n.value + (m.deltaY < 0 ? 0.1 : -0.1));
1091
1203
  }
1092
- return ee(p), $(
1204
+ return ee(P), $(
1093
1205
  () => e.url,
1094
1206
  () => {
1095
- o.value = "ready", L();
1207
+ r.value = "ready", L();
1096
1208
  }
1097
- ), q(() => {
1098
- window.removeEventListener("pointermove", y), h && window.cancelAnimationFrame(h);
1099
- }), () => a(
1209
+ ), G(() => {
1210
+ window.removeEventListener("pointermove", y), g && window.cancelAnimationFrame(g);
1211
+ }), () => o(
1100
1212
  "div",
1101
1213
  { class: "jt-attachment-preview-service__image-viewer" },
1102
- o.value === "error" ? me({
1103
- icon: Ue,
1214
+ r.value === "error" ? ve({
1215
+ icon: Oe,
1104
1216
  name: e.name
1105
1217
  }) : [
1106
- a("img", {
1107
- ref: n,
1218
+ o("img", {
1219
+ ref: a,
1108
1220
  class: [
1109
1221
  "jt-attachment-preview-service__media",
1110
1222
  "jt-attachment-preview-service__image",
1111
- i.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
1112
- l.value ? "jt-attachment-preview-service__image--dragging" : ""
1223
+ n.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
1224
+ i.value ? "jt-attachment-preview-service__image--dragging" : ""
1113
1225
  ],
1114
1226
  src: e.url,
1115
1227
  alt: e.name,
1116
- style: D.value,
1117
- onLoad: T,
1118
- onError: R,
1119
- onPointerdown: C,
1120
- onWheel: G,
1121
- onDragstart: (d) => d.preventDefault(),
1228
+ style: R.value,
1229
+ onLoad: S,
1230
+ onError: B,
1231
+ onPointerdown: T,
1232
+ onWheel: H,
1233
+ onDragstart: (m) => m.preventDefault(),
1122
1234
  draggable: !1
1123
1235
  }),
1124
- a(
1236
+ o(
1125
1237
  "div",
1126
1238
  { class: "jt-attachment-preview-service__image-toolbar" },
1127
1239
  [
1128
- a(
1240
+ o(
1129
1241
  "button",
1130
1242
  {
1131
1243
  class: "jt-attachment-preview-service__image-tool",
1132
1244
  type: "button",
1133
- title: s("common.缩小"),
1134
- onClick: w
1245
+ title: c("common.缩小"),
1246
+ onClick: b
1135
1247
  },
1136
- [a(N, () => a(Ne))]
1248
+ [o(J, () => o(Ye))]
1137
1249
  ),
1138
- a(
1250
+ o(
1139
1251
  "span",
1140
1252
  { class: "jt-attachment-preview-service__image-scale" },
1141
- `${Math.round(i.value * 100)}%`
1253
+ `${Math.round(n.value * 100)}%`
1142
1254
  ),
1143
- a(
1255
+ o(
1144
1256
  "button",
1145
1257
  {
1146
1258
  class: "jt-attachment-preview-service__image-tool",
1147
1259
  type: "button",
1148
- title: s("common.放大"),
1149
- onClick: g
1260
+ title: c("common.放大"),
1261
+ onClick: w
1150
1262
  },
1151
- [a(N, () => a(Se))]
1263
+ [o(J, () => o(Je))]
1152
1264
  ),
1153
- a(
1265
+ o(
1154
1266
  "button",
1155
1267
  {
1156
1268
  class: "jt-attachment-preview-service__image-tool",
1157
1269
  type: "button",
1158
- title: s("common.复位"),
1270
+ title: c("common.复位"),
1159
1271
  onClick: L
1160
1272
  },
1161
- [a(N, () => a(Fe))]
1273
+ [o(J, () => o(Ue))]
1162
1274
  )
1163
1275
  ]
1164
1276
  )
1165
1277
  ]
1166
1278
  );
1167
1279
  }
1168
- }), nt = E({
1280
+ }), lt = x({
1169
1281
  name: "JtAttachmentPreviewService",
1170
1282
  props: {
1171
1283
  options: {
@@ -1178,49 +1290,49 @@ const et = E({
1178
1290
  }
1179
1291
  },
1180
1292
  setup(e) {
1181
- const t = j(
1182
- () => ne(e.options.url, e.options.name)
1183
- ), n = j(
1293
+ const t = E(
1294
+ () => ae(e.options.url, e.options.name)
1295
+ ), a = E(
1184
1296
  () => e.options.downloadName || t.value
1185
- ), o = j(() => ce(e.options)), i = j(
1186
- () => $e(o.value, e.options.url)
1187
- ), l = j(
1297
+ ), r = E(() => me(e.options)), n = E(
1298
+ () => at(r.value, e.options.url)
1299
+ ), i = E(
1188
1300
  () => ({
1189
1301
  zIndex: e.options.zIndex ?? 3e3,
1190
1302
  "--jt-attachment-preview-service-image-fit": e.options.fit ?? "contain"
1191
1303
  })
1192
1304
  );
1193
- function c() {
1305
+ function u() {
1194
1306
  e.options.onClose?.(), e.onDestroy();
1195
1307
  }
1196
- function m(v) {
1197
- v.key === "Escape" && e.options.closeOnPressEscape !== !1 && c();
1308
+ function l(v) {
1309
+ v.key === "Escape" && e.options.closeOnPressEscape !== !1 && u();
1198
1310
  }
1199
- function b(v) {
1311
+ function h(v) {
1200
1312
  e.options.onLoad?.(v);
1201
1313
  }
1202
1314
  function f(v) {
1203
1315
  e.options.onError?.(v);
1204
1316
  }
1205
1317
  return ee(() => {
1206
- document.addEventListener("keydown", m), document.body.classList.add("jt-attachment-preview-service-lock");
1207
- }), q(() => {
1208
- document.removeEventListener("keydown", m), document.body.classList.remove("jt-attachment-preview-service-lock");
1318
+ document.addEventListener("keydown", l), document.body.classList.add("jt-attachment-preview-service-lock");
1319
+ }), G(() => {
1320
+ document.removeEventListener("keydown", l), document.body.classList.remove("jt-attachment-preview-service-lock");
1209
1321
  }), () => {
1210
1322
  const v = e.options.downloadable === !1 ? [] : [
1211
- de(
1212
- e.options.url,
1213
- n.value,
1323
+ pe(
1324
+ e.options,
1325
+ a.value,
1214
1326
  "jt-attachment-preview-service__top-download"
1215
1327
  )
1216
1328
  ];
1217
- return a(
1329
+ return o(
1218
1330
  "div",
1219
- { class: "jt-attachment-preview-service", style: l.value },
1331
+ { class: "jt-attachment-preview-service", style: i.value },
1220
1332
  [
1221
- a("div", { class: "jt-attachment-preview-service__modal" }, [
1222
- a("div", { class: "jt-attachment-preview-service__header" }, [
1223
- a(
1333
+ o("div", { class: "jt-attachment-preview-service__modal" }, [
1334
+ o("div", { class: "jt-attachment-preview-service__header" }, [
1335
+ o(
1224
1336
  "div",
1225
1337
  {
1226
1338
  class: "jt-attachment-preview-service__filename",
@@ -1228,34 +1340,35 @@ const et = E({
1228
1340
  },
1229
1341
  t.value
1230
1342
  ),
1231
- a(
1343
+ o(
1232
1344
  "div",
1233
1345
  { class: "jt-attachment-preview-service__header-actions" },
1234
1346
  [
1235
1347
  ...v,
1236
- a(
1348
+ o(
1237
1349
  "button",
1238
1350
  {
1239
1351
  class: "jt-attachment-preview-service__close",
1240
1352
  type: "button",
1241
- "aria-label": s("common.关闭"),
1242
- onClick: c
1353
+ "aria-label": c("common.关闭"),
1354
+ onClick: u
1243
1355
  },
1244
1356
  "×"
1245
1357
  )
1246
1358
  ]
1247
1359
  )
1248
1360
  ]),
1249
- a("div", { class: "jt-attachment-preview-service__body" }, [
1250
- at({
1251
- type: o.value,
1361
+ o("div", { class: "jt-attachment-preview-service__body" }, [
1362
+ st({
1363
+ type: r.value,
1252
1364
  url: e.options.url,
1253
1365
  name: t.value,
1254
- downloadName: n.value,
1366
+ downloadName: a.value,
1367
+ sourceOptions: e.options,
1255
1368
  sandbox: e.options.sandbox,
1256
- iconText: i.value,
1369
+ iconText: n.value,
1257
1370
  downloadable: e.options.downloadable !== !1,
1258
- onLoad: b,
1371
+ onLoad: h,
1259
1372
  onError: f
1260
1373
  })
1261
1374
  ])
@@ -1264,7 +1377,7 @@ const et = E({
1264
1377
  );
1265
1378
  };
1266
1379
  }
1267
- }), M = E({
1380
+ }), F = x({
1268
1381
  name: "JtAttachmentPreviewDetectingService",
1269
1382
  props: {
1270
1383
  options: {
@@ -1277,11 +1390,11 @@ const et = E({
1277
1390
  },
1278
1391
  title: {
1279
1392
  type: String,
1280
- default: s("common.正在识别文件类型")
1393
+ default: c("common.正在识别文件类型")
1281
1394
  },
1282
1395
  desc: {
1283
1396
  type: String,
1284
- default: s("common.请稍候,识别完成后将自动预览或下载")
1397
+ default: c("common.请稍候,识别完成后将自动预览或下载")
1285
1398
  },
1286
1399
  spinning: {
1287
1400
  type: Boolean,
@@ -1289,28 +1402,28 @@ const et = E({
1289
1402
  }
1290
1403
  },
1291
1404
  setup(e) {
1292
- const t = j(
1293
- () => ne(e.options.url, e.options.name)
1294
- ), n = j(() => ({
1405
+ const t = E(
1406
+ () => ae(e.options.url, e.options.name)
1407
+ ), a = E(() => ({
1295
1408
  zIndex: e.options.zIndex ?? 3e3
1296
1409
  }));
1297
- function o() {
1410
+ function r() {
1298
1411
  e.options.onClose?.(), e.onDestroy();
1299
1412
  }
1300
- function i(l) {
1301
- l.key === "Escape" && e.options.closeOnPressEscape !== !1 && o();
1413
+ function n(i) {
1414
+ i.key === "Escape" && e.options.closeOnPressEscape !== !1 && r();
1302
1415
  }
1303
1416
  return ee(() => {
1304
- document.addEventListener("keydown", i), document.body.classList.add("jt-attachment-preview-service-lock");
1305
- }), q(() => {
1306
- document.removeEventListener("keydown", i), document.body.classList.remove("jt-attachment-preview-service-lock");
1307
- }), () => a(
1417
+ document.addEventListener("keydown", n), document.body.classList.add("jt-attachment-preview-service-lock");
1418
+ }), G(() => {
1419
+ document.removeEventListener("keydown", n), document.body.classList.remove("jt-attachment-preview-service-lock");
1420
+ }), () => o(
1308
1421
  "div",
1309
- { class: "jt-attachment-preview-service", style: n.value },
1422
+ { class: "jt-attachment-preview-service", style: a.value },
1310
1423
  [
1311
- a("div", { class: "jt-attachment-preview-service__modal" }, [
1312
- a("div", { class: "jt-attachment-preview-service__header" }, [
1313
- a(
1424
+ o("div", { class: "jt-attachment-preview-service__modal" }, [
1425
+ o("div", { class: "jt-attachment-preview-service__header" }, [
1426
+ o(
1314
1427
  "div",
1315
1428
  {
1316
1429
  class: "jt-attachment-preview-service__filename",
@@ -1318,34 +1431,34 @@ const et = E({
1318
1431
  },
1319
1432
  t.value
1320
1433
  ),
1321
- a(
1434
+ o(
1322
1435
  "div",
1323
1436
  { class: "jt-attachment-preview-service__header-actions" },
1324
1437
  [
1325
- a(
1438
+ o(
1326
1439
  "button",
1327
1440
  {
1328
1441
  class: "jt-attachment-preview-service__close",
1329
1442
  type: "button",
1330
- "aria-label": s("common.关闭"),
1331
- onClick: o
1443
+ "aria-label": c("common.关闭"),
1444
+ onClick: r
1332
1445
  },
1333
1446
  "×"
1334
1447
  )
1335
1448
  ]
1336
1449
  )
1337
1450
  ]),
1338
- a("div", { class: "jt-attachment-preview-service__body" }, [
1339
- a("div", { class: "jt-attachment-preview-service__detecting" }, [
1340
- e.spinning ? a("span", {
1451
+ o("div", { class: "jt-attachment-preview-service__body" }, [
1452
+ o("div", { class: "jt-attachment-preview-service__detecting" }, [
1453
+ e.spinning ? o("span", {
1341
1454
  class: "jt-attachment-preview-service__detecting-spinner"
1342
1455
  }) : null,
1343
- a(
1456
+ o(
1344
1457
  "span",
1345
1458
  { class: "jt-attachment-preview-service__detecting-title" },
1346
1459
  e.title
1347
1460
  ),
1348
- a(
1461
+ o(
1349
1462
  "span",
1350
1463
  { class: "jt-attachment-preview-service__detecting-desc" },
1351
1464
  e.desc
@@ -1357,57 +1470,57 @@ const et = E({
1357
1470
  );
1358
1471
  }
1359
1472
  });
1360
- function at(e) {
1361
- return e.type === "empty" ? a(
1473
+ function st(e) {
1474
+ return e.type === "empty" ? o(
1362
1475
  "div",
1363
1476
  { class: "jt-attachment-preview-service__empty" },
1364
- s("common.暂无附件")
1365
- ) : e.type === "image" ? a(tt, {
1477
+ c("common.暂无附件")
1478
+ ) : e.type === "image" ? o(it, {
1366
1479
  url: e.url,
1367
1480
  name: e.name,
1368
1481
  downloadName: e.downloadName,
1369
1482
  downloadable: e.downloadable,
1370
1483
  onPreviewLoad: e.onLoad,
1371
1484
  onPreviewError: e.onError
1372
- }) : e.type === "video" ? a("video", {
1485
+ }) : e.type === "video" ? o("video", {
1373
1486
  class: "jt-attachment-preview-service__media",
1374
1487
  src: e.url,
1375
1488
  controls: !0,
1376
1489
  onLoadeddata: e.onLoad,
1377
1490
  onError: e.onError
1378
- }) : e.type === "audio" ? a("audio", {
1491
+ }) : e.type === "audio" ? o("audio", {
1379
1492
  class: "jt-attachment-preview-service__audio",
1380
1493
  src: e.url,
1381
1494
  controls: !0,
1382
1495
  onLoadeddata: e.onLoad,
1383
1496
  onError: e.onError
1384
- }) : e.type === "pdf" ? a(et, {
1497
+ }) : e.type === "pdf" ? o(rt, {
1385
1498
  url: e.url,
1386
1499
  name: e.name,
1387
1500
  downloadName: e.downloadName,
1388
1501
  downloadable: e.downloadable,
1389
1502
  onPreviewLoad: e.onLoad,
1390
1503
  onPreviewError: e.onError
1391
- }) : e.type === "iframe" ? a("iframe", {
1504
+ }) : e.type === "iframe" ? o("iframe", {
1392
1505
  class: "jt-attachment-preview-service__iframe",
1393
1506
  src: e.url,
1394
1507
  title: e.name,
1395
1508
  sandbox: e.sandbox || void 0,
1396
1509
  onLoad: e.onLoad
1397
- }) : a("div", { class: "jt-attachment-preview-service__unsupported" }, [
1398
- a("div", { class: "jt-attachment-preview-service__file-card" }, [
1399
- a(
1510
+ }) : o("div", { class: "jt-attachment-preview-service__unsupported" }, [
1511
+ o("div", { class: "jt-attachment-preview-service__file-card" }, [
1512
+ o(
1400
1513
  "div",
1401
1514
  { class: "jt-attachment-preview-service__file-icon" },
1402
1515
  e.iconText
1403
1516
  ),
1404
- a(
1517
+ o(
1405
1518
  "div",
1406
1519
  { class: "jt-attachment-preview-service__unsupported-text" },
1407
- s("common.暂不支持预览此类型的文件")
1520
+ c("common.暂不支持预览此类型的文件")
1408
1521
  )
1409
1522
  ]),
1410
- a(
1523
+ o(
1411
1524
  "div",
1412
1525
  {
1413
1526
  class: "jt-attachment-preview-service__file-name",
@@ -1415,158 +1528,159 @@ function at(e) {
1415
1528
  },
1416
1529
  e.name
1417
1530
  ),
1418
- e.downloadable ? de(
1419
- e.url,
1531
+ e.downloadable ? pe(
1532
+ e.sourceOptions,
1420
1533
  e.downloadName,
1421
1534
  "jt-attachment-preview-service__primary-download"
1422
1535
  ) : null
1423
1536
  ]);
1424
1537
  }
1425
- function ve(e) {
1538
+ function ge(e) {
1426
1539
  if (typeof document > "u")
1427
1540
  return { close: () => {
1428
1541
  } };
1429
- k("open-called", {
1542
+ p("open-called", {
1430
1543
  rawOptions: typeof e == "string" ? e : { ...e }
1431
- }), P?.close();
1432
- const t = Ke(e), n = t.downloadName || ne(t.url, t.name);
1433
- let o = !1, i = null, l = null;
1434
- const c = () => {
1435
- o = !0, i && (_(null, i), i.remove(), i = null), l && (URL.revokeObjectURL(l), l = null), P?.close === c && (P = null);
1544
+ }), D?.close();
1545
+ const t = Xe(
1546
+ e
1547
+ ), a = t.downloadName || ae(t.url, t.name);
1548
+ let r = !1, n = null, i = null;
1549
+ const u = () => {
1550
+ r = !0, n && (_(null, n), n.remove(), n = null), i && (URL.revokeObjectURL(i), i = null), D?.close === u && (D = null);
1436
1551
  };
1437
- function m() {
1438
- o || (i || (i = document.createElement("div"), document.body.appendChild(i)), _(
1439
- a(nt, {
1552
+ function l() {
1553
+ r || (n || (n = document.createElement("div"), document.body.appendChild(n)), _(
1554
+ o(lt, {
1440
1555
  options: t,
1441
- onDestroy: c
1556
+ onDestroy: u
1442
1557
  }),
1443
- i
1558
+ n
1444
1559
  ));
1445
1560
  }
1446
- function b() {
1447
- o || (i || (i = document.createElement("div"), document.body.appendChild(i)), _(
1448
- a(M, {
1561
+ function h() {
1562
+ r || (n || (n = document.createElement("div"), document.body.appendChild(n)), _(
1563
+ o(F, {
1449
1564
  options: t,
1450
- onDestroy: c
1565
+ onDestroy: u
1451
1566
  }),
1452
- i
1567
+ n
1453
1568
  ));
1454
1569
  }
1455
1570
  function f() {
1456
- i && (_(null, i), i.remove(), i = null);
1571
+ n && (_(null, n), n.remove(), n = null);
1457
1572
  }
1458
1573
  function v() {
1459
- o || fe(t.url, n, {
1574
+ r || he(t, a, {
1460
1575
  fallbackToRawUrl: !0
1461
1576
  });
1462
1577
  }
1463
- function x(D) {
1464
- if (o) return;
1465
- const p = URL.createObjectURL(D);
1466
- Z(p, n), URL.revokeObjectURL(p);
1467
- }
1468
- const h = ce(t);
1469
- return k("type-resolved", {
1470
- resolvedType: h,
1578
+ const k = me(t);
1579
+ return p("type-resolved", {
1580
+ resolvedType: k,
1471
1581
  url: t.url,
1472
1582
  name: t.name,
1473
1583
  mode: t.mode,
1474
1584
  mimeType: t.mimeType,
1475
1585
  extension: t.extension
1476
- }), K(h) ? m() : h === "unknown" ? (b(), Xe(t.url).then(async (D) => {
1477
- if (!o) {
1478
- if (K(D)) {
1479
- t.mode = D, m();
1586
+ }), W(k) ? l() : k === "unknown" ? (h(), et(t.url).then(async (g) => {
1587
+ if (!r) {
1588
+ if (W(g)) {
1589
+ t.mode = g, l();
1480
1590
  return;
1481
1591
  }
1482
1592
  try {
1483
- const p = await ue(t.url), r = ae(p.type);
1484
- if (K(r)) {
1485
- l = URL.createObjectURL(p), t.url = l, t.mode = r, m();
1593
+ const R = await fe(t.url), P = ne(R.type);
1594
+ if (W(P)) {
1595
+ i = URL.createObjectURL(R), t.url = i, t.mode = P, l();
1486
1596
  return;
1487
1597
  }
1488
- f(), x(p);
1598
+ f(), re(R, a);
1489
1599
  } catch {
1490
1600
  f(), v();
1491
1601
  }
1492
1602
  }
1493
- })) : v(), P = { close: c }, P;
1603
+ })) : v(), D = { close: u }, D;
1494
1604
  }
1495
- function it(e) {
1496
- Y = e;
1605
+ function ct(e) {
1606
+ A = e;
1497
1607
  }
1498
- function ot(e) {
1608
+ function ut(e) {
1499
1609
  if (typeof document > "u")
1500
1610
  return { close: () => {
1501
1611
  } };
1502
- P?.close();
1503
- let t = !1, n = document.createElement("div");
1504
- document.body.appendChild(n);
1505
- const o = () => {
1506
- t = !0, n && (_(null, n), n.remove(), n = null), P?.close === o && (P = null);
1507
- }, i = { close: o };
1508
- return P = i, Y ? (_(
1509
- a(M, {
1510
- options: { url: "", name: s("common.附件预览") },
1511
- title: s("common.正在获取文件信息"),
1512
- desc: s("common.请稍候,获取完成后将自动预览或下载"),
1612
+ D?.close();
1613
+ let t = !1, a = document.createElement("div");
1614
+ document.body.appendChild(a);
1615
+ const r = () => {
1616
+ t = !0, a && (_(null, a), a.remove(), a = null), D?.close === r && (D = null);
1617
+ }, n = { close: r };
1618
+ return D = n, A ? (_(
1619
+ o(F, {
1620
+ options: { url: "", name: c("common.附件预览") },
1621
+ title: c("common.正在获取文件信息"),
1622
+ desc: c("common.请稍候,获取完成后将自动预览或下载"),
1513
1623
  spinning: !0,
1514
- onDestroy: o
1624
+ onDestroy: r
1515
1625
  }),
1516
- n
1517
- ), Y.request(e).then((l) => {
1626
+ a
1627
+ ), A.request(e).then((i) => {
1518
1628
  if (t) return;
1519
- const c = Y?.mapResponse(l, e);
1520
- if (!c?.url) {
1629
+ const u = A?.mapResponse(i, e);
1630
+ if (!u?.url) {
1521
1631
  _(
1522
- a(M, {
1523
- options: { url: "", name: s("common.附件预览") },
1524
- title: s("common.文件信息缺少URL"),
1525
- desc: s("common.请检查mapResponse是否返回了url字段"),
1632
+ o(F, {
1633
+ options: { url: "", name: c("common.附件预览") },
1634
+ title: c("common.文件信息缺少URL"),
1635
+ desc: c("common.请检查mapResponse是否返回了url字段"),
1526
1636
  spinning: !1,
1527
- onDestroy: o
1637
+ onDestroy: r
1528
1638
  }),
1529
- n
1639
+ a
1530
1640
  );
1531
1641
  return;
1532
1642
  }
1533
- ve(c);
1534
- }).catch((l) => {
1643
+ ge({
1644
+ ...u,
1645
+ requestParams: e,
1646
+ useRegisteredDownload: !0
1647
+ });
1648
+ }).catch((i) => {
1535
1649
  if (t) return;
1536
- const c = l instanceof Error ? l.message : s("common.接口请求失败");
1650
+ const u = i instanceof Error ? i.message : c("common.接口请求失败");
1537
1651
  _(
1538
- a(M, {
1539
- options: { url: "", name: s("common.附件预览") },
1540
- title: s("common.文件信息获取失败"),
1541
- desc: c,
1652
+ o(F, {
1653
+ options: { url: "", name: c("common.附件预览") },
1654
+ title: c("common.文件信息获取失败"),
1655
+ desc: u,
1542
1656
  spinning: !1,
1543
- onDestroy: o
1657
+ onDestroy: r
1544
1658
  }),
1545
- n
1659
+ a
1546
1660
  );
1547
- }), i) : (_(
1548
- a(M, {
1549
- options: { url: "", name: s("common.附件预览") },
1550
- title: s("common.附件预览未初始化"),
1551
- desc: s("common.请先调用setupJtAttachmentPreview注册请求配置"),
1661
+ }), n) : (_(
1662
+ o(F, {
1663
+ options: { url: "", name: c("common.附件预览") },
1664
+ title: c("common.附件预览未初始化"),
1665
+ desc: c("common.请先调用setupJtAttachmentPreview注册请求配置"),
1552
1666
  spinning: !1,
1553
- onDestroy: o
1667
+ onDestroy: r
1554
1668
  }),
1555
- n
1556
- ), i);
1669
+ a
1670
+ ), n);
1557
1671
  }
1558
- const mt = Object.assign(ve, {
1559
- openByParams: ot,
1560
- setup: it
1672
+ const gt = Object.assign(ge, {
1673
+ openByParams: ut,
1674
+ setup: ct
1561
1675
  });
1562
1676
  export {
1563
- mt as J,
1564
- ot as a,
1565
- it as b,
1566
- ct as g,
1567
- dt as i,
1568
- U as n,
1569
- ut as r,
1570
- st as s,
1571
- s as t
1677
+ gt as J,
1678
+ ut as a,
1679
+ ct as b,
1680
+ pt as g,
1681
+ ht as i,
1682
+ q as n,
1683
+ vt as r,
1684
+ ft as s,
1685
+ c as t
1572
1686
  };