@templatical/media-library 0.26.3 → 0.27.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.
@@ -1,4 +1,4 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as ee, c as te, d as ne, et as re, f as ie, g as ae, h as oe, i as se, it as A, j, k as M, l as ce, m as le, n as ue, nt as de, o as fe, ot as N, p as pe, q as P, r as me, rt as F, s as he, st as I, t as ge, tt as L, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-BrkXiZSA.js";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as ee, Z as T, _ as E, a as D, at as O, b as te, c as ne, d as re, et as ie, f as k, g as ae, h as oe, i as se, it as A, j, k as M, l as ce, m as le, n as ue, nt as de, o as fe, ot as N, p as pe, q as P, r as me, rt as F, s as he, st as I, t as ge, tt as L, u as _e, v as ve, w as R, x as ye, y as be, z } from "./chunks/icons-BrkXiZSA.js";
2
2
  //#region ../types/src/config.ts
3
3
  var xe = class extends Error {
4
4
  statusCode;
@@ -153,10 +153,10 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
153
153
  "templates.export": `${V}/export`,
154
154
  "templates.importFromBeefree": `${we}/templates/import/from-beefree`,
155
155
  "templates.sendTestEmail": `${V}/send-test-email`,
156
- "snapshots.index": `${V}/snapshots`,
157
- "snapshots.store": `${V}/snapshots`,
158
- "snapshots.show": `${V}/snapshots/{snapshot}`,
159
- "snapshots.restore": `${V}/snapshots/{snapshot}/restore`,
156
+ "versions.index": `${V}/versions`,
157
+ "versions.store": `${V}/versions`,
158
+ "versions.show": `${V}/versions/{version}`,
159
+ "versions.restore": `${V}/versions/{version}/restore`,
160
160
  "comments.index": `${V}/comments`,
161
161
  "comments.store": `${V}/comments`,
162
162
  "comments.update": `${V}/comments/{comment}`,
@@ -225,10 +225,13 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
225
225
  }
226
226
  return e.message;
227
227
  }
228
- async createTemplate(e) {
228
+ async createTemplate(e, t) {
229
229
  return this.request(B(H["templates.store"], this.baseParams), {
230
230
  method: "POST",
231
- body: JSON.stringify({ content: e })
231
+ body: JSON.stringify(t === void 0 ? { content: e } : {
232
+ content: e,
233
+ name: t
234
+ })
232
235
  });
233
236
  }
234
237
  async getTemplate(e) {
@@ -243,16 +246,19 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
243
246
  template: e
244
247
  }), {
245
248
  method: "PUT",
246
- body: JSON.stringify({ content: t })
249
+ body: JSON.stringify(t)
247
250
  });
248
251
  }
249
- async createSnapshot(e, t) {
250
- return this.request(B(H["snapshots.store"], {
252
+ async createVersion(e, t, n) {
253
+ return this.request(B(H["versions.store"], {
251
254
  ...this.baseParams,
252
255
  template: e
253
256
  }), {
254
257
  method: "POST",
255
- body: JSON.stringify({ content: t })
258
+ body: JSON.stringify(n === void 0 ? { content: t } : {
259
+ content: t,
260
+ label: n
261
+ })
256
262
  });
257
263
  }
258
264
  async deleteTemplate(e) {
@@ -261,17 +267,24 @@ var we = "/api/v1/projects/{project}/tenants/{tenant}", V = `${we}/templates/{te
261
267
  template: e
262
268
  }), { method: "DELETE" });
263
269
  }
264
- async getSnapshots(e) {
265
- return this.request(B(H["snapshots.index"], {
270
+ async getVersions(e) {
271
+ return this.request(B(H["versions.index"], {
266
272
  ...this.baseParams,
267
273
  template: e
268
274
  }));
269
275
  }
270
- async restoreSnapshot(e, t) {
271
- return this.request(B(H["snapshots.restore"], {
276
+ async getVersion(e, t) {
277
+ return this.request(B(H["versions.show"], {
278
+ ...this.baseParams,
279
+ template: e,
280
+ version: t
281
+ }));
282
+ }
283
+ async restoreVersion(e, t) {
284
+ return this.request(B(H["versions.restore"], {
272
285
  ...this.baseParams,
273
286
  template: e,
274
- snapshot: t
287
+ version: t
275
288
  }), { method: "POST" });
276
289
  }
277
290
  async exportTemplate(e, t) {
@@ -427,11 +440,13 @@ var je = {
427
440
  onClick: (t) => o("navigate", e.id)
428
441
  }, I(e.name), 9, Me)) : (z(), t("span", Ne, I(e.name), 1))], 64))), 128))])) : M("", !0);
429
442
  }
430
- });
443
+ }), Fe = Symbol("templaticalMediaPlanConfig"), Ie = Symbol("templaticalMediaPopoverTarget");
431
444
  //#endregion
432
445
  //#region src/composables/useMediaCategories.ts
433
- function Fe() {
434
- let e = l("planConfig"), t = a(() => e.config.value?.media ?? null), n = a(() => t.value?.use_media_library ?? !0), r = a(() => t.value?.categories ?? null), i = a(() => r.value ? Object.values(r.value).flatMap((e) => e.mime_types) : []), o = a(() => i.value.join(",")), s = a(() => t.value?.max_file_size ?? 0);
446
+ function Le() {
447
+ let e = l(Fe, null);
448
+ if (!e) throw Error("[Templatical] useMediaCategories() needs a plan config in scope. Render it under <MediaLibraryModal> (pass its `planConfig` prop) or provide PLAN_CONFIG_KEY yourself.");
449
+ let t = a(() => e.config.value?.media ?? null), n = a(() => t.value?.use_media_library ?? !0), r = a(() => t.value?.categories ?? null), i = a(() => r.value ? Object.values(r.value).flatMap((e) => e.mime_types) : []), o = a(() => i.value.join(",")), s = a(() => t.value?.max_file_size ?? 0);
435
450
  function c(e, t) {
436
451
  return r.value ? !t || t.length === 0 ? i.value.includes(e) : t.some((t) => r.value[t]?.mime_types.includes(e)) : !1;
437
452
  }
@@ -456,14 +471,14 @@ function Fe() {
456
471
  }
457
472
  //#endregion
458
473
  //#region src/composables/useImageCrop.ts
459
- var Ie = {
474
+ var Re = {
460
475
  free: void 0,
461
476
  square: 1,
462
477
  landscape43: 4 / 3,
463
478
  landscape169: 16 / 9,
464
479
  original: void 0
465
480
  };
466
- function Le(e) {
481
+ function ze(e) {
467
482
  return e === "image/png" || e === "image/gif" ? {
468
483
  mimeType: "image/png",
469
484
  quality: 1
@@ -475,7 +490,7 @@ function Le(e) {
475
490
  quality: .92
476
491
  };
477
492
  }
478
- function Re(e, t, n) {
493
+ function Be(e, t, n) {
479
494
  let r = e.width, i = e.height;
480
495
  if (!t && !n) return e;
481
496
  let a = r, o = i;
@@ -489,7 +504,7 @@ function Re(e, t, n) {
489
504
  let c = s.getContext("2d");
490
505
  return c && (c.imageSmoothingEnabled = !0, c.imageSmoothingQuality = "high", c.drawImage(e, 0, 0, a, o)), s;
491
506
  }
492
- function ze(e, t, n) {
507
+ function Ve(e, t, n) {
493
508
  return new Promise((r, i) => {
494
509
  e.toBlob((e) => {
495
510
  if (!e) {
@@ -501,7 +516,7 @@ function ze(e, t, n) {
501
516
  }, n.mimeType, n.quality);
502
517
  });
503
518
  }
504
- function Be(e, t, n, r) {
519
+ function He(e, t, n, r) {
505
520
  let i = e, a = t;
506
521
  if (n && i > n) {
507
522
  let e = n / i;
@@ -517,11 +532,8 @@ function Be(e, t, n, r) {
517
532
  };
518
533
  }
519
534
  //#endregion
520
- //#region src/keys.ts
521
- var Ve = Symbol("templaticalMediaPopoverTarget");
522
- //#endregion
523
535
  //#region ../../node_modules/.pnpm/vue-advanced-cropper@2.8.9_vue@3.5.41_typescript@6.0.3_/node_modules/vue-advanced-cropper/dist/index.esm-bundler.js
524
- function He(e, t) {
536
+ function Ue(e, t) {
525
537
  var n = Object.keys(e);
526
538
  if (Object.getOwnPropertySymbols) {
527
539
  var r = Object.getOwnPropertySymbols(e);
@@ -534,9 +546,9 @@ function He(e, t) {
534
546
  function U(e) {
535
547
  for (var t = 1; t < arguments.length; t++) {
536
548
  var n = arguments[t] == null ? {} : arguments[t];
537
- t % 2 ? He(Object(n), !0).forEach((function(t) {
549
+ t % 2 ? Ue(Object(n), !0).forEach((function(t) {
538
550
  W(e, t, n[t]);
539
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : He(Object(n)).forEach((function(t) {
551
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ue(Object(n)).forEach((function(t) {
540
552
  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
541
553
  }));
542
554
  }
@@ -550,7 +562,7 @@ function W(e, t, n) {
550
562
  writable: !0
551
563
  }) : e[t] = n, e;
552
564
  }
553
- function Ue(e, t) {
565
+ function We(e, t) {
554
566
  if (e == null) return {};
555
567
  var n, r, i = function(e, t) {
556
568
  if (e == null) return {};
@@ -564,28 +576,28 @@ function Ue(e, t) {
564
576
  }
565
577
  return i;
566
578
  }
567
- function We(e) {
579
+ function Ge(e) {
568
580
  return function(e) {
569
- if (Array.isArray(e)) return Ge(e);
581
+ if (Array.isArray(e)) return Ke(e);
570
582
  }(e) || function(e) {
571
583
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
572
584
  }(e) || function(e, t) {
573
585
  if (e) {
574
- if (typeof e == "string") return Ge(e, t);
586
+ if (typeof e == "string") return Ke(e, t);
575
587
  var n = Object.prototype.toString.call(e).slice(8, -1);
576
588
  if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
577
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ge(e, t);
589
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ke(e, t);
578
590
  }
579
591
  }(e) || function() {
580
592
  throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
581
593
  }();
582
594
  }
583
- function Ge(e, t) {
595
+ function Ke(e, t) {
584
596
  (t == null || t > e.length) && (t = e.length);
585
597
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
586
598
  return r;
587
599
  }
588
- var Ke, qe, Je, G = (Ke = function(e) {
600
+ var qe, Je, Ye, G = (qe = function(e) {
589
601
  (function() {
590
602
  var t = {}.hasOwnProperty;
591
603
  function n() {
@@ -609,15 +621,15 @@ var Ke, qe, Je, G = (Ke = function(e) {
609
621
  }
610
622
  e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
611
623
  })();
612
- }, Ke(Je = {
613
- path: qe,
624
+ }, qe(Ye = {
625
+ path: Je,
614
626
  exports: {},
615
627
  require: function(e, t) {
616
628
  return function() {
617
629
  throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
618
- }(t == null && Je.path);
630
+ }(t == null && Ye.path);
619
631
  }
620
- }, Je.exports), Je.exports), Ye = function(e) {
632
+ }, Ye.exports), Ye.exports), Xe = function(e) {
621
633
  return function(t, n) {
622
634
  if (!t) return e;
623
635
  var r;
@@ -629,7 +641,7 @@ var Ke, qe, Je, G = (Ke = function(e) {
629
641
  }), "") : "");
630
642
  };
631
643
  };
632
- function Xe(e, t, n) {
644
+ function Ze(e, t, n) {
633
645
  var r, i, a, o, s;
634
646
  function c() {
635
647
  var l = Date.now() - o;
@@ -647,65 +659,65 @@ function Xe(e, t, n) {
647
659
  r &&= (s = e.apply(a, i), a = i = null, clearTimeout(r), null);
648
660
  }, l;
649
661
  }
650
- Xe.debounce = Xe;
651
- var Ze = Xe, K = function() {
662
+ Ze.debounce = Ze;
663
+ var Qe = Ze, K = function() {
652
664
  return K = Object.assign || function(e) {
653
665
  for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
654
666
  return e;
655
667
  }, K.apply(this, arguments);
656
668
  };
657
- function Qe(e, t) {
669
+ function $e(e, t) {
658
670
  var n, r;
659
671
  return e && t ? (n = "" + e + t[0].toUpperCase() + t.slice(1), r = e + "-" + t) : (n = e || t, r = e || t), {
660
672
  name: n,
661
673
  classname: r
662
674
  };
663
675
  }
664
- function $e(e) {
676
+ function et(e) {
665
677
  return /^blob:/.test(e);
666
678
  }
667
- function et(e) {
668
- return $e(e) || function(e) {
679
+ function tt(e) {
680
+ return et(e) || function(e) {
669
681
  return /^data:/.test(e);
670
682
  }(e);
671
683
  }
672
- function tt(e) {
684
+ function nt(e) {
673
685
  return !!(e && e.constructor && e.call && e.apply);
674
686
  }
675
687
  function q(e) {
676
688
  return e === void 0;
677
689
  }
678
- function nt(e) {
690
+ function rt(e) {
679
691
  return typeof e == "object" && !!e;
680
692
  }
681
- function rt(e, t, n) {
693
+ function it(e, t, n) {
682
694
  var r = {};
683
- return nt(e) ? (Object.keys(t).forEach((function(i) {
684
- r[i] = q(e[i]) ? t[i] : nt(t[i]) ? nt(e[i]) ? rt(e[i], t[i], n[i]) : e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? !!e[i] : e[i];
695
+ return rt(e) ? (Object.keys(t).forEach((function(i) {
696
+ r[i] = q(e[i]) ? t[i] : rt(t[i]) ? rt(e[i]) ? it(e[i], t[i], n[i]) : e[i] ? t[i] : n[i] : !0 === t[i] || !1 === t[i] ? !!e[i] : e[i];
685
697
  })), r) : e ? t : n;
686
698
  }
687
- function it(e) {
699
+ function at(e) {
688
700
  var t = Number(e);
689
701
  return Number.isNaN(t) ? e : t;
690
702
  }
691
- function at(e) {
703
+ function ot(e) {
692
704
  return typeof (e == "number" || function(e) {
693
705
  return typeof e == "object" && !!e;
694
- }(e) && toString.call(e) == "[object Number]") && !ot(e);
706
+ }(e) && toString.call(e) == "[object Number]") && !st(e);
695
707
  }
696
- function ot(e) {
708
+ function st(e) {
697
709
  return e != e;
698
710
  }
699
- function st(e, t) {
711
+ function ct(e, t) {
700
712
  return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
701
713
  }
702
- var ct = function(e, t) {
714
+ var lt = function(e, t) {
703
715
  e === void 0 && (e = {}), t === void 0 && (t = {}), this.type = "manipulateImage", this.move = e, this.scale = t;
704
- }, lt = function(e, t) {
716
+ }, ut = function(e, t) {
705
717
  t === void 0 && (t = {}), this.type = "resize", this.directions = e, this.params = t;
706
- }, ut = function(e) {
718
+ }, dt = function(e) {
707
719
  this.type = "move", this.directions = e;
708
- }, dt = function() {
720
+ }, ft = function() {
709
721
  function e(e, t, n, r, i) {
710
722
  this.type = "drag", this.nativeEvent = e, this.position = n, this.previousPosition = r, this.element = t, this.anchor = i;
711
723
  }
@@ -723,7 +735,7 @@ var ct = function(e, t) {
723
735
  top: 0
724
736
  };
725
737
  }, e;
726
- }(), ft = {
738
+ }(), pt = {
727
739
  name: "DraggableElement",
728
740
  props: { classname: { type: String } },
729
741
  beforeMount: function() {
@@ -744,7 +756,7 @@ var ct = function(e, t) {
744
756
  this.hovered && !this.touches.length && (this.hovered = !1, this.$emit("leave"));
745
757
  },
746
758
  onTouchStart: function(e) {
747
- e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = We(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
759
+ e.cancelable && !this.disabled && e.touches.length === 1 && (this.touches = Ge(e.touches), this.hovered ||= (this.$emit("enter"), !0), e.touches.length && this.initAnchor(this.touches.reduce((function(t, n) {
748
760
  return {
749
761
  clientX: t.clientX + n.clientX / e.touches.length,
750
762
  clientY: t.clientY + n.clientY / e.touches.length
@@ -790,11 +802,11 @@ var ct = function(e, t) {
790
802
  };
791
803
  },
792
804
  processMove: function(e, t) {
793
- var n = We(t);
805
+ var n = Ge(t);
794
806
  if (this.touches.length) {
795
807
  if (this.touches.length === 1 && n.length === 1) {
796
808
  var r = this.$refs.draggable;
797
- this.$emit("drag", new dt(e, r, {
809
+ this.$emit("drag", new ft(e, r, {
798
810
  left: n[0].clientX,
799
811
  top: n[0].clientY
800
812
  }, {
@@ -816,7 +828,7 @@ var ct = function(e, t) {
816
828
  "enter"
817
829
  ]
818
830
  };
819
- ft.render = function(e, t, n, r, i, a) {
831
+ pt.render = function(e, t, n, r, i, a) {
820
832
  return z(), h("div", {
821
833
  ref: "draggable",
822
834
  class: n.classname,
@@ -834,9 +846,9 @@ ft.render = function(e, t, n, r, i, a) {
834
846
  }
835
847
  }, [c(e.$slots, "default")], 34);
836
848
  };
837
- var pt = Ye("vue-handler-wrapper"), mt = {
849
+ var mt = Xe("vue-handler-wrapper"), ht = {
838
850
  name: "HandlerWrapper",
839
- components: { DraggableElement: ft },
851
+ components: { DraggableElement: pt },
840
852
  props: {
841
853
  horizontalPosition: { type: String },
842
854
  verticalPosition: { type: String },
@@ -848,12 +860,12 @@ var pt = Ye("vue-handler-wrapper"), mt = {
848
860
  computed: { classes: function() {
849
861
  var e;
850
862
  if (this.horizontalPosition || this.verticalPosition) {
851
- var t, n = Qe(this.horizontalPosition, this.verticalPosition);
852
- e = pt((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
853
- } else e = pt({ disabled: this.disabled });
863
+ var t, n = $e(this.horizontalPosition, this.verticalPosition);
864
+ e = mt((W(t = {}, n.classname, !0), W(t, "disabled", this.disabled), t));
865
+ } else e = mt({ disabled: this.disabled });
854
866
  return {
855
867
  root: e,
856
- draggable: pt("draggable")
868
+ draggable: mt("draggable")
857
869
  };
858
870
  } },
859
871
  emits: [
@@ -863,7 +875,7 @@ var pt = Ye("vue-handler-wrapper"), mt = {
863
875
  "drag-end"
864
876
  ]
865
877
  };
866
- mt.render = function(e, t, n, r, i, a) {
878
+ ht.render = function(e, t, n, r, i, a) {
867
879
  var o = x("DraggableElement");
868
880
  return z(), h("div", { class: a.classes.root }, [p(o, {
869
881
  class: a.classes.draggable,
@@ -886,9 +898,9 @@ mt.render = function(e, t, n, r, i, a) {
886
898
  _: 3
887
899
  }, 8, ["class"])], 2);
888
900
  };
889
- var ht = Ye("vue-line-wrapper"), gt = {
901
+ var gt = Xe("vue-line-wrapper"), _t = {
890
902
  name: "LineWrapper",
891
- components: { DraggableElement: ft },
903
+ components: { DraggableElement: pt },
892
904
  props: {
893
905
  position: {
894
906
  type: String,
@@ -901,7 +913,7 @@ var ht = Ye("vue-line-wrapper"), gt = {
901
913
  },
902
914
  computed: { classname: function() {
903
915
  var e;
904
- return ht((W(e = {}, this.position, !0), W(e, "disabled", this.disabled), e));
916
+ return gt((W(e = {}, this.position, !0), W(e, "disabled", this.disabled), e));
905
917
  } },
906
918
  emits: [
907
919
  "leave",
@@ -910,7 +922,7 @@ var ht = Ye("vue-line-wrapper"), gt = {
910
922
  "drag-end"
911
923
  ]
912
924
  };
913
- gt.render = function(e, t, n, r, i, a) {
925
+ _t.render = function(e, t, n, r, i, a) {
914
926
  var o = x("DraggableElement");
915
927
  return z(), h(o, {
916
928
  class: a.classname,
@@ -933,23 +945,23 @@ gt.render = function(e, t, n, r, i, a) {
933
945
  _: 3
934
946
  }, 8, ["class"]);
935
947
  };
936
- var _t = [
948
+ var vt = [
937
949
  "left",
938
950
  "right",
939
951
  "top",
940
952
  "bottom"
941
- ], vt = ["left", "right"], yt = ["top", "bottom"], bt = ["left", "top"], xt = [
953
+ ], yt = ["left", "right"], bt = ["top", "bottom"], xt = ["left", "top"], St = [
942
954
  "fill-area",
943
955
  "fit-area",
944
956
  "stencil",
945
957
  "none"
946
- ], St = {
958
+ ], Ct = {
947
959
  left: 0,
948
960
  top: 0,
949
961
  width: 0,
950
962
  height: 0
951
963
  };
952
- function Ct(e, t, n) {
964
+ function wt(e, t, n) {
953
965
  return !(n ||= [
954
966
  "width",
955
967
  "height",
@@ -959,7 +971,7 @@ function Ct(e, t, n) {
959
971
  return e[n] !== t[n];
960
972
  }));
961
973
  }
962
- function wt(e) {
974
+ function Tt(e) {
963
975
  return {
964
976
  left: e.left,
965
977
  top: e.top,
@@ -967,7 +979,7 @@ function wt(e) {
967
979
  bottom: e.top + e.height
968
980
  };
969
981
  }
970
- function Tt(e, t) {
982
+ function Et(e, t) {
971
983
  return {
972
984
  left: e.left - t.left,
973
985
  top: e.top - t.top
@@ -979,19 +991,19 @@ function J(e) {
979
991
  top: e.top + e.height / 2
980
992
  };
981
993
  }
982
- function Et(e, t) {
994
+ function Dt(e, t) {
983
995
  var n = {
984
996
  left: 0,
985
997
  top: 0,
986
998
  right: 0,
987
999
  bottom: 0
988
1000
  };
989
- return _t.forEach((function(r) {
990
- var i = t[r], a = wt(e)[r];
1001
+ return vt.forEach((function(r) {
1002
+ var i = t[r], a = Tt(e)[r];
991
1003
  n[r] = i !== void 0 && a !== void 0 ? r === "left" || r === "top" ? Math.max(0, i - a) : Math.max(0, a - i) : 0;
992
1004
  })), n;
993
1005
  }
994
- function Dt(e, t) {
1006
+ function Ot(e, t) {
995
1007
  return {
996
1008
  left: e.left - t.left,
997
1009
  top: e.top - t.top,
@@ -999,7 +1011,7 @@ function Dt(e, t) {
999
1011
  height: e.height + t.top + t.bottom
1000
1012
  };
1001
1013
  }
1002
- function Ot(e) {
1014
+ function kt(e) {
1003
1015
  return {
1004
1016
  left: -e.left,
1005
1017
  top: -e.top
@@ -1034,21 +1046,21 @@ function X(e, t, n, r) {
1034
1046
  function Z(e) {
1035
1047
  return e.width / e.height;
1036
1048
  }
1037
- function kt(e, t) {
1049
+ function At(e, t) {
1038
1050
  return Math.min(t.right !== void 0 && t.left !== void 0 ? (t.right - t.left) / e.width : 1 / 0, t.bottom !== void 0 && t.top !== void 0 ? (t.bottom - t.top) / e.height : 1 / 0);
1039
1051
  }
1040
- function At(e, t) {
1052
+ function jt(e, t) {
1041
1053
  var n = {
1042
1054
  left: 0,
1043
1055
  top: 0
1044
- }, r = Et(e, t);
1056
+ }, r = Dt(e, t);
1045
1057
  return r.left && r.left > 0 ? n.left = r.left : r.right && r.right > 0 && (n.left = -r.right), r.top && r.top > 0 ? n.top = r.top : r.bottom && r.bottom > 0 && (n.top = -r.bottom), n;
1046
1058
  }
1047
- function jt(e, t) {
1059
+ function Mt(e, t) {
1048
1060
  var n;
1049
1061
  return t.minimum && e < t.minimum ? n = t.minimum : t.maximum && e > t.maximum && (n = t.maximum), n;
1050
1062
  }
1051
- function Mt(e, t) {
1063
+ function Nt(e, t) {
1052
1064
  var n = Z(e), r = Z(t);
1053
1065
  return t.width < 1 / 0 && t.height < 1 / 0 ? n > r ? {
1054
1066
  width: t.width,
@@ -1064,36 +1076,36 @@ function Mt(e, t) {
1064
1076
  height: t.height
1065
1077
  } : e;
1066
1078
  }
1067
- function Nt(e, t) {
1079
+ function Pt(e, t) {
1068
1080
  var n = t * Math.PI / 180;
1069
1081
  return {
1070
1082
  width: Math.abs(e.width * Math.cos(n)) + Math.abs(e.height * Math.sin(n)),
1071
1083
  height: Math.abs(e.width * Math.sin(n)) + Math.abs(e.height * Math.cos(n))
1072
1084
  };
1073
1085
  }
1074
- function Pt(e, t) {
1086
+ function Ft(e, t) {
1075
1087
  var n = t * Math.PI / 180;
1076
1088
  return {
1077
1089
  left: e.left * Math.cos(n) - e.top * Math.sin(n),
1078
1090
  top: e.left * Math.sin(n) + e.top * Math.cos(n)
1079
1091
  };
1080
1092
  }
1081
- function Ft(e, t) {
1082
- var n = Et(Q(e, t), t);
1083
- return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, kt(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, kt(e, t)) : 1;
1093
+ function It(e, t) {
1094
+ var n = Dt(Q(e, t), t);
1095
+ return n.left + n.right + n.top + n.bottom ? n.left + n.right > n.top + n.bottom ? Math.min((e.width + n.left + n.right) / e.width, At(e, t)) : Math.min((e.height + n.top + n.bottom) / e.height, At(e, t)) : 1;
1084
1096
  }
1085
1097
  function Q(e, t, n) {
1086
1098
  n === void 0 && (n = !1);
1087
- var r = At(e, t);
1088
- return Y(e, n ? Ot(r) : r);
1099
+ var r = jt(e, t);
1100
+ return Y(e, n ? kt(r) : r);
1089
1101
  }
1090
- function It(e) {
1102
+ function Lt(e) {
1091
1103
  return {
1092
1104
  width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0,
1093
1105
  height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0
1094
1106
  };
1095
1107
  }
1096
- function Lt(e, t) {
1108
+ function Rt(e, t) {
1097
1109
  return K(K({}, e), {
1098
1110
  minWidth: Math.min(t.width, e.minWidth),
1099
1111
  minHeight: Math.min(t.height, e.minHeight),
@@ -1101,25 +1113,25 @@ function Lt(e, t) {
1101
1113
  maxHeight: Math.min(t.height, e.maxHeight)
1102
1114
  });
1103
1115
  }
1104
- function Rt(e, t, n) {
1116
+ function zt(e, t, n) {
1105
1117
  n === void 0 && (n = !0);
1106
1118
  var r = {};
1107
- return _t.forEach((function(i) {
1119
+ return vt.forEach((function(i) {
1108
1120
  var a = e[i], o = t[i];
1109
1121
  a !== void 0 && o !== void 0 ? r[i] = i === "left" || i === "top" ? n ? Math.max(a, o) : Math.min(a, o) : n ? Math.min(a, o) : Math.max(a, o) : o === void 0 ? a !== void 0 && (r[i] = a) : r[i] = o;
1110
1122
  })), r;
1111
1123
  }
1112
- function zt(e, t) {
1113
- return Rt(e, t, !0);
1124
+ function Bt(e, t) {
1125
+ return zt(e, t, !0);
1114
1126
  }
1115
- function Bt(e) {
1127
+ function Vt(e) {
1116
1128
  var t = e.size, n = e.aspectRatio, r = e.ignoreMinimum, i = e.sizeRestrictions;
1117
1129
  return !!((t.correctRatio || Z(t) >= n.minimum && Z(t) <= n.maximum) && t.height <= i.maxHeight && t.width <= i.maxWidth && t.width && t.height && (r || t.height >= i.minHeight && t.width >= i.minWidth));
1118
1130
  }
1119
- function Vt(e, t) {
1131
+ function Ht(e, t) {
1120
1132
  return (e.width - t.width) ** 2 + (e.height - t.height) ** 2;
1121
1133
  }
1122
- function Ht(e) {
1134
+ function Ut(e) {
1123
1135
  var t = e.width, n = e.height, r = e.sizeRestrictions, i = {
1124
1136
  minimum: e.aspectRatio && e.aspectRatio.minimum || 0,
1125
1137
  maximum: e.aspectRatio && e.aspectRatio.maximum || 1 / 0
@@ -1129,15 +1141,15 @@ function Ht(e) {
1129
1141
  };
1130
1142
  function o(e, a) {
1131
1143
  return a === void 0 && (a = !1), e.reduce((function(e, o) {
1132
- return Bt({
1144
+ return Vt({
1133
1145
  size: o,
1134
1146
  aspectRatio: i,
1135
1147
  sizeRestrictions: r,
1136
1148
  ignoreMinimum: a
1137
- }) && (!e || Vt(o, {
1149
+ }) && (!e || Ht(o, {
1138
1150
  width: t,
1139
1151
  height: n
1140
- }) < Vt(e, {
1152
+ }) < Ht(e, {
1141
1153
  width: t,
1142
1154
  height: n
1143
1155
  })) ? o : e;
@@ -1154,7 +1166,7 @@ function Ht(e) {
1154
1166
  height: a.height,
1155
1167
  correctRatio: !0
1156
1168
  });
1157
- })), Bt({
1169
+ })), Vt({
1158
1170
  size: a,
1159
1171
  aspectRatio: i,
1160
1172
  sizeRestrictions: r
@@ -1165,16 +1177,16 @@ function Ht(e) {
1165
1177
  height: c.height
1166
1178
  };
1167
1179
  }
1168
- function Ut(e) {
1180
+ function Wt(e) {
1169
1181
  var t = e.event, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = Y(n, t.directions);
1170
- return Y(a, At(a, i));
1182
+ return Y(a, jt(a, i));
1171
1183
  }
1172
- function Wt(e) {
1184
+ function Gt(e) {
1173
1185
  var t = e.coordinates, n = e.transform, r = e.imageSize, i = e.sizeRestrictions, a = e.positionRestrictions, o = e.aspectRatio, s = e.visibleArea, c = function(e, t) {
1174
- return Ut({
1186
+ return Wt({
1175
1187
  coordinates: e,
1176
1188
  positionRestrictions: a,
1177
- event: new ut({
1189
+ event: new dt({
1178
1190
  left: t.left - e.left,
1179
1191
  top: t.top - e.top
1180
1192
  })
@@ -1187,7 +1199,7 @@ function Wt(e) {
1187
1199
  imageSize: r,
1188
1200
  visibleArea: s
1189
1201
  }) : e).width) && q(t.height) || (l = function(e, t) {
1190
- return c(K(K(K({}, e), Ht({
1202
+ return c(K(K(K({}, e), Ut({
1191
1203
  width: t.width,
1192
1204
  height: t.height,
1193
1205
  sizeRestrictions: i,
@@ -1202,9 +1214,9 @@ function Wt(e) {
1202
1214
  }(l, K(K({}, l), t))), q(t.left) && q(t.top) || (l = c(l, K(K({}, l), t)));
1203
1215
  })), l;
1204
1216
  }
1205
- function Gt(e) {
1217
+ function Kt(e) {
1206
1218
  var t = e.getAreaRestrictions, n = e.boundaries, r = e.coordinates, i = e.visibleArea, a = e.stencilSize, o = e.sizeRestrictions, s = e.positionRestrictions, c, l, u, d = K({}, r), f = K({}, i), p = K({}, a);
1207
- c = Z(p), l = Z(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = K(K({}, d), Ht({
1219
+ c = Z(p), l = Z(d), u === void 0 && (u = .001), (c === 0 || l === 0 ? Math.abs(l - c) < u : Math.abs(l / c) < 1 + u && Math.abs(l / c) > 1 - u) || (d = K(K({}, d), Ut({
1208
1220
  sizeRestrictions: o,
1209
1221
  width: d.width,
1210
1222
  height: d.height,
@@ -1213,19 +1225,19 @@ function Gt(e) {
1213
1225
  maximum: Z(p)
1214
1226
  }
1215
1227
  })));
1216
- var m = Ft(f = X(f, d.width * n.width / (f.width * p.width)), t({
1228
+ var m = It(f = X(f, d.width * n.width / (f.width * p.width)), t({
1217
1229
  visibleArea: f,
1218
1230
  type: "resize"
1219
1231
  }));
1220
- return m !== 1 && (f = X(f, m), d = X(d, m)), f = Q(f = Y(f, Tt(J(d), J(f))), t({
1232
+ return m !== 1 && (f = X(f, m), d = X(d, m)), f = Q(f = Y(f, Et(J(d), J(f))), t({
1221
1233
  visibleArea: f,
1222
1234
  type: "move"
1223
1235
  })), {
1224
- coordinates: d = Q(d, zt(wt(f), s)),
1236
+ coordinates: d = Q(d, Bt(Tt(f), s)),
1225
1237
  visibleArea: f
1226
1238
  };
1227
1239
  }
1228
- function Kt(e) {
1240
+ function qt(e) {
1229
1241
  var t = e.event, n = e.getAreaRestrictions, r = e.boundaries, i = e.coordinates, a = e.visibleArea, o = e.positionRestrictions, s = K({}, i), c = K({}, a);
1230
1242
  if (i && a && t.type !== "manipulateImage") {
1231
1243
  var l = {
@@ -1233,31 +1245,31 @@ function Kt(e) {
1233
1245
  height: 0
1234
1246
  };
1235
1247
  Z(r) > Z(s) ? (l.height = .8 * r.height, l.width = l.height * Z(s)) : (l.width = .8 * r.width, l.height = l.width * Z(s));
1236
- var u = Ft(c = X(c, s.width * r.width / (c.width * l.width)), n({
1248
+ var u = It(c = X(c, s.width * r.width / (c.width * l.width)), n({
1237
1249
  visibleArea: c,
1238
1250
  type: "resize"
1239
1251
  }));
1240
- c = X(c, u), u !== 1 && (l.height /= u, l.width /= u), c = Q(c = Y(c, Tt(J(s), J(c))), n({
1252
+ c = X(c, u), u !== 1 && (l.height /= u, l.width /= u), c = Q(c = Y(c, Et(J(s), J(c))), n({
1241
1253
  visibleArea: c,
1242
1254
  type: "move"
1243
- })), s = Q(s, zt(wt(c), o));
1255
+ })), s = Q(s, Bt(Tt(c), o));
1244
1256
  }
1245
1257
  return {
1246
1258
  coordinates: s,
1247
1259
  visibleArea: c
1248
1260
  };
1249
1261
  }
1250
- function qt(e) {
1262
+ function Jt(e) {
1251
1263
  var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.getAreaRestrictions, a = K({}, r), o = K({}, n);
1252
1264
  if (t.type === "setCoordinates") {
1253
1265
  var s = Math.max(0, o.width - a.width), c = Math.max(0, o.height - a.height);
1254
- s > c ? a = X(a, Math.min(o.width / a.width, kt(a, i({
1266
+ s > c ? a = X(a, Math.min(o.width / a.width, At(a, i({
1255
1267
  visibleArea: a,
1256
1268
  type: "resize"
1257
- })))) : c > s && (a = X(a, Math.min(o.height / a.height, kt(a, i({
1269
+ })))) : c > s && (a = X(a, Math.min(o.height / a.height, At(a, i({
1258
1270
  visibleArea: a,
1259
1271
  type: "resize"
1260
- }))))), a = Q(a = Y(a, Ot(At(o, wt(a)))), i({
1272
+ }))))), a = Q(a = Y(a, kt(jt(o, Tt(a)))), i({
1261
1273
  visibleArea: a,
1262
1274
  type: "move"
1263
1275
  }));
@@ -1267,14 +1279,14 @@ function qt(e) {
1267
1279
  coordinates: o
1268
1280
  };
1269
1281
  }
1270
- function Jt(e) {
1282
+ function Yt(e) {
1271
1283
  var t = e.imageSize, n = e.visibleArea, r = e.coordinates, i = n || t;
1272
1284
  return {
1273
1285
  left: (n ? n.left : 0) + i.width / 2 - r.width / 2,
1274
1286
  top: (n ? n.top : 0) + i.height / 2 - r.height / 2
1275
1287
  };
1276
1288
  }
1277
- function Yt(e) {
1289
+ function Xt(e) {
1278
1290
  var t = e.imageSize, n = e.visibleArea, r = e.aspectRatio, i = e.sizeRestrictions, a = n || t, o = Math.min(r.maximum || 1 / 0, Math.max(r.minimum || 0, Z(a))), s = a.width < a.height ? {
1279
1291
  width: .8 * a.width,
1280
1292
  height: .8 * a.width / o
@@ -1282,35 +1294,35 @@ function Yt(e) {
1282
1294
  height: .8 * a.height,
1283
1295
  width: .8 * a.height * o
1284
1296
  };
1285
- return Ht(K(K({}, s), {
1297
+ return Ut(K(K({}, s), {
1286
1298
  aspectRatio: r,
1287
1299
  sizeRestrictions: i
1288
1300
  }));
1289
1301
  }
1290
- function Xt(e) {
1302
+ function Zt(e) {
1291
1303
  var t, n, r = e.imageSize, i = e.visibleArea, a = e.boundaries, o = e.aspectRatio, s = e.sizeRestrictions, c = e.stencilSize, l = i || r;
1292
- return Z(l) > Z(a) ? n = (t = c.height * l.height / a.height) * Z(c) : t = (n = c.width * l.width / a.width) / Z(c), Ht({
1304
+ return Z(l) > Z(a) ? n = (t = c.height * l.height / a.height) * Z(c) : t = (n = c.width * l.width / a.width) / Z(c), Ut({
1293
1305
  width: n,
1294
1306
  height: t,
1295
1307
  aspectRatio: o,
1296
1308
  sizeRestrictions: s
1297
1309
  });
1298
1310
  }
1299
- function Zt(e) {
1311
+ function Qt(e) {
1300
1312
  var t = e.getAreaRestrictions, n = e.coordinates, r = e.imageSize, i = Z(e.boundaries);
1301
1313
  if (n) {
1302
1314
  var a = {
1303
1315
  height: Math.max(n.height, r.height),
1304
1316
  width: Math.max(n.width, r.width)
1305
- }, o = Mt({
1317
+ }, o = Nt({
1306
1318
  width: Z(a) > i ? a.width : a.height * i,
1307
1319
  height: Z(a) > i ? a.width / i : a.height
1308
- }, It(t())), s = {
1320
+ }, Lt(t())), s = {
1309
1321
  left: n.left + n.width / 2 - o.width / 2,
1310
1322
  top: n.top + n.height / 2 - o.height / 2,
1311
1323
  width: o.width,
1312
1324
  height: o.height
1313
- }, c = Et(n, wt(K({
1325
+ }, c = Dt(n, Tt(K({
1314
1326
  left: 0,
1315
1327
  top: 0
1316
1328
  }, r))), l = {};
@@ -1327,10 +1339,10 @@ function Zt(e) {
1327
1339
  height: o.height
1328
1340
  };
1329
1341
  }
1330
- function Qt(e, t) {
1331
- return Rt(e, wt(t));
1342
+ function $t(e, t) {
1343
+ return zt(e, Tt(t));
1332
1344
  }
1333
- function $t(e) {
1345
+ function en(e) {
1334
1346
  var t = e.event, n = e.coordinates, r = e.visibleArea, i = e.sizeRestrictions, a = e.getAreaRestrictions, o = e.positionRestrictions, s = e.adjustStencil, c = t.scale, l = t.move, u = K({}, r), d = K({}, n), f = 1, p = 1, m = c.factor && Math.abs(c.factor - 1) > .001;
1335
1347
  u = Y(u, {
1336
1348
  left: l.left || 0,
@@ -1339,16 +1351,16 @@ function $t(e) {
1339
1351
  var h = {
1340
1352
  stencil: {
1341
1353
  minimum: Math.max(i.minWidth ? i.minWidth / d.width : 0, i.minHeight ? i.minHeight / d.height : 0),
1342
- maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0, kt(d, o))
1354
+ maximum: Math.min(i.maxWidth ? i.maxWidth / d.width : 1 / 0, i.maxHeight ? i.maxHeight / d.height : 1 / 0, At(d, o))
1343
1355
  },
1344
- area: { maximum: kt(u, a({
1356
+ area: { maximum: At(u, a({
1345
1357
  visibleArea: u,
1346
1358
  type: "resize"
1347
1359
  })) }
1348
1360
  };
1349
1361
  c.factor && m && (c.factor < 1 ? (p = Math.max(c.factor, h.stencil.minimum)) > 1 && (p = 1) : c.factor > 1 && (p = Math.min(c.factor, Math.min(h.area.maximum, h.stencil.maximum))) < 1 && (p = 1)), p && (u = X(u, p, c.center));
1350
1362
  var g = n.left - r.left, _ = r.width + r.left - (n.width + n.left), v = n.top - r.top, y = r.height + r.top - (n.height + n.top);
1351
- return u = Q(u = Y(u, At(u, {
1363
+ return u = Q(u = Y(u, jt(u, {
1352
1364
  left: o.left === void 0 ? void 0 : o.left - g * p,
1353
1365
  top: o.top === void 0 ? void 0 : o.top - v * p,
1354
1366
  bottom: o.bottom === void 0 ? void 0 : o.bottom + y * p,
@@ -1356,46 +1368,46 @@ function $t(e) {
1356
1368
  })), a({
1357
1369
  visibleArea: u,
1358
1370
  type: "move"
1359
- })), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Q(d, zt(wt(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = Y(u = Q(u = X(u, f, c.factor > 1 ? c.center : J(d)), a({
1371
+ })), d.width *= p, d.height *= p, d.left = u.left + g * p, d.top = u.top + v * p, d = Q(d, Bt(Tt(u), o)), c.factor && m && s && (c.factor > 1 ? f = Math.min(h.area.maximum, c.factor) / p : c.factor < 1 && (f = Math.max(d.height / u.height, d.width / u.width, c.factor / p)), f !== 1 && (u = Y(u = Q(u = X(u, f, c.factor > 1 ? c.center : J(d)), a({
1360
1372
  visibleArea: u,
1361
1373
  type: "move"
1362
- })), Ot(At(d, wt(u)))))), {
1374
+ })), kt(jt(d, Tt(u)))))), {
1363
1375
  coordinates: d,
1364
1376
  visibleArea: u
1365
1377
  };
1366
1378
  }
1367
- function en(e) {
1368
- var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = K({}, r), d = K({}, i), f = Pt(J(K({
1379
+ function tn(e) {
1380
+ var t = e.aspectRatio, n = e.getAreaRestrictions, r = e.coordinates, i = e.visibleArea, a = e.sizeRestrictions, o = e.positionRestrictions, s = e.imageSize, c = e.previousImageSize, l = e.angle, u = K({}, r), d = K({}, i), f = Ft(J(K({
1369
1381
  left: 0,
1370
1382
  top: 0
1371
1383
  }, c)), l);
1372
- return (u = K(K({}, Ht({
1384
+ return (u = K(K({}, Ut({
1373
1385
  sizeRestrictions: a,
1374
1386
  aspectRatio: t,
1375
1387
  width: u.width,
1376
1388
  height: u.height
1377
- })), Pt(J(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = X(d, Ft(d, n({
1389
+ })), Ft(J(u), l))).left -= f.left - s.width / 2 + u.width / 2, u.top -= f.top - s.height / 2 + u.height / 2, d = X(d, It(d, n({
1378
1390
  visibleArea: d,
1379
1391
  type: "resize"
1380
1392
  }))), {
1381
1393
  coordinates: u = Q(u, o),
1382
- visibleArea: d = Q(d = Y(d, Tt(J(u), J(r))), n({
1394
+ visibleArea: d = Q(d = Y(d, Et(J(u), J(r))), n({
1383
1395
  visibleArea: d,
1384
1396
  type: "move"
1385
1397
  }))
1386
1398
  };
1387
1399
  }
1388
- function tn(e) {
1400
+ function nn(e) {
1389
1401
  var t = e.flip, n = e.previousFlip, r = e.rotate, i = e.getAreaRestrictions, a = e.coordinates, o = e.visibleArea, s = e.imageSize, c = K({}, a), l = K({}, o), u = n.horizontal !== t.horizontal, d = n.vertical !== t.vertical;
1390
1402
  if (u || d) {
1391
- var f = Pt({
1403
+ var f = Ft({
1392
1404
  left: s.width / 2,
1393
1405
  top: s.height / 2
1394
- }, -r), p = Pt(J(c), -r), m = Pt({
1406
+ }, -r), p = Ft(J(c), -r), m = Ft({
1395
1407
  left: u ? f.left - (p.left - f.left) : p.left,
1396
1408
  top: d ? f.top - (p.top - f.top) : p.top
1397
1409
  }, r);
1398
- c = Y(c, Tt(m, J(c))), p = Pt(J(l), -r), l = Q(l = Y(l, Tt(m = Pt({
1410
+ c = Y(c, Et(m, J(c))), p = Ft(J(l), -r), l = Q(l = Y(l, Et(m = Ft({
1399
1411
  left: u ? f.left - (p.left - f.left) : p.left,
1400
1412
  top: d ? f.top - (p.top - f.top) : p.top
1401
1413
  }, r), J(l))), i({
@@ -1408,11 +1420,11 @@ function tn(e) {
1408
1420
  visibleArea: l
1409
1421
  };
1410
1422
  }
1411
- function nn(e) {
1412
- var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = K({}, t), l = Dt(n, c).width, u = Dt(n, c).height;
1423
+ function rn(e) {
1424
+ var t = e.directions, n = e.coordinates, r = e.positionRestrictions, i = r === void 0 ? {} : r, a = e.sizeRestrictions, o = e.preserveRatio, s = e.compensate, c = K({}, t), l = Ot(n, c).width, u = Ot(n, c).height;
1413
1425
  l < 0 && (c.left < 0 && c.right < 0 ? (c.left = -(n.width - a.minWidth) / (c.left / c.right), c.right = -(n.width - a.minWidth) / (c.right / c.left)) : c.left < 0 ? c.left = -(n.width - a.minWidth) : c.right < 0 && (c.right = -(n.width - a.minWidth))), u < 0 && (c.top < 0 && c.bottom < 0 ? (c.top = -(n.height - a.minHeight) / (c.top / c.bottom), c.bottom = -(n.height - a.minHeight) / (c.bottom / c.top)) : c.top < 0 ? c.top = -(n.height - a.minHeight) : c.bottom < 0 && (c.bottom = -(n.height - a.minHeight)));
1414
- var d = Et(Dt(n, c), i);
1415
- s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = Et(Dt(n, c), i));
1426
+ var d = Dt(Ot(n, c), i);
1427
+ s && (d.left && d.left > 0 && d.right === 0 ? (c.right += d.left, c.left -= d.left) : d.right && d.right > 0 && d.left === 0 && (c.left += d.right, c.right -= d.right), d.top && d.top > 0 && d.bottom === 0 ? (c.bottom += d.top, c.top -= d.top) : d.bottom && d.bottom > 0 && d.top === 0 && (c.top += d.bottom, c.bottom -= d.bottom), d = Dt(Ot(n, c), i));
1416
1428
  var f = {
1417
1429
  width: 1 / 0,
1418
1430
  height: 1 / 0,
@@ -1421,37 +1433,37 @@ function nn(e) {
1421
1433
  top: 1 / 0,
1422
1434
  bottom: 1 / 0
1423
1435
  };
1424
- if (_t.forEach((function(e) {
1436
+ if (vt.forEach((function(e) {
1425
1437
  var t = d[e];
1426
1438
  t && c[e] && (f[e] = Math.max(0, 1 - t / c[e]));
1427
1439
  })), o) {
1428
- var p = Math.min.apply(null, _t.map((function(e) {
1440
+ var p = Math.min.apply(null, vt.map((function(e) {
1429
1441
  return f[e];
1430
1442
  })));
1431
- p !== 1 / 0 && _t.forEach((function(e) {
1443
+ p !== 1 / 0 && vt.forEach((function(e) {
1432
1444
  c[e] *= p;
1433
1445
  }));
1434
- } else _t.forEach((function(e) {
1446
+ } else vt.forEach((function(e) {
1435
1447
  f[e] !== 1 / 0 && (c[e] *= f[e]);
1436
1448
  }));
1437
- if (l = Dt(n, c).width, u = Dt(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
1449
+ if (l = Ot(n, c).width, u = Ot(n, c).height, c.right + c.left && (l > a.maxWidth ? f.width = (a.maxWidth - n.width) / (c.right + c.left) : l < a.minWidth && (f.width = (a.minWidth - n.width) / (c.right + c.left))), c.bottom + c.top && (u > a.maxHeight ? f.height = (a.maxHeight - n.height) / (c.bottom + c.top) : u < a.minHeight && (f.height = (a.minHeight - n.height) / (c.bottom + c.top))), o) {
1438
1450
  var m = Math.min(f.width, f.height);
1439
- m !== 1 / 0 && _t.forEach((function(e) {
1451
+ m !== 1 / 0 && vt.forEach((function(e) {
1440
1452
  c[e] *= m;
1441
1453
  }));
1442
- } else f.width !== 1 / 0 && vt.forEach((function(e) {
1454
+ } else f.width !== 1 / 0 && yt.forEach((function(e) {
1443
1455
  c[e] *= f.width;
1444
- })), f.height !== 1 / 0 && yt.forEach((function(e) {
1456
+ })), f.height !== 1 / 0 && bt.forEach((function(e) {
1445
1457
  c[e] *= f.height;
1446
1458
  }));
1447
1459
  return c;
1448
1460
  }
1449
- function rn(e, t, n) {
1461
+ function an(e, t, n) {
1450
1462
  return t == 0 && n == 0 ? e / 2 : t == 0 ? 0 : n == 0 ? e : e * Math.abs(t / (t + n));
1451
1463
  }
1452
- var an = Ye("vue-simple-handler"), on = Ye("vue-simple-handler-wrapper"), sn = {
1464
+ var on = Xe("vue-simple-handler"), sn = Xe("vue-simple-handler-wrapper"), cn = {
1453
1465
  name: "SimpleHandler",
1454
- components: { HandlerWrapper: mt },
1466
+ components: { HandlerWrapper: ht },
1455
1467
  props: {
1456
1468
  defaultClass: { type: String },
1457
1469
  hoverClass: { type: String },
@@ -1469,8 +1481,8 @@ var an = Ye("vue-simple-handler"), on = Ye("vue-simple-handler-wrapper"), sn = {
1469
1481
  computed: { classes: function() {
1470
1482
  var e, t = (W(e = {}, this.horizontalPosition, !!this.horizontalPosition), W(e, this.verticalPosition, !!this.verticalPosition), W(e, `${this.horizontalPosition}-${this.verticalPosition}`, !!(this.verticalPosition && this.horizontalPosition)), W(e, "hover", this.hover), e);
1471
1483
  return {
1472
- default: G(an(t), this.defaultClass, this.hover && this.hoverClass),
1473
- wrapper: G(on(t), this.wrapperClass)
1484
+ default: G(on(t), this.defaultClass, this.hover && this.hoverClass),
1485
+ wrapper: G(sn(t), this.wrapperClass)
1474
1486
  };
1475
1487
  } },
1476
1488
  methods: {
@@ -1489,7 +1501,7 @@ var an = Ye("vue-simple-handler"), on = Ye("vue-simple-handler-wrapper"), sn = {
1489
1501
  },
1490
1502
  emits: ["drag", "drag-end"]
1491
1503
  };
1492
- sn.render = function(e, t, n, r, i, a) {
1504
+ cn.render = function(e, t, n, r, i, a) {
1493
1505
  var o = x("HandlerWrapper");
1494
1506
  return z(), h(o, {
1495
1507
  class: a.classes.wrapper,
@@ -1516,9 +1528,9 @@ sn.render = function(e, t, n, r, i, a) {
1516
1528
  "onLeave"
1517
1529
  ]);
1518
1530
  };
1519
- var cn = Ye("vue-simple-line"), ln = Ye("vue-simple-line-wrapper"), un = {
1531
+ var ln = Xe("vue-simple-line"), un = Xe("vue-simple-line-wrapper"), dn = {
1520
1532
  name: "SimpleLine",
1521
- components: { LineWrapper: gt },
1533
+ components: { LineWrapper: _t },
1522
1534
  props: {
1523
1535
  defaultClass: { type: String },
1524
1536
  hoverClass: { type: String },
@@ -1534,8 +1546,8 @@ var cn = Ye("vue-simple-line"), ln = Ye("vue-simple-line-wrapper"), un = {
1534
1546
  },
1535
1547
  computed: { classes: function() {
1536
1548
  return {
1537
- root: G(cn(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
1538
- wrapper: G(ln(W({}, this.position, !0)), this.wrapperClass)
1549
+ root: G(ln(W({}, this.position, !0)), this.defaultClass, this.hover && this.hoverClass),
1550
+ wrapper: G(un(W({}, this.position, !0)), this.wrapperClass)
1539
1551
  };
1540
1552
  } },
1541
1553
  methods: {
@@ -1554,7 +1566,7 @@ var cn = Ye("vue-simple-line"), ln = Ye("vue-simple-line-wrapper"), un = {
1554
1566
  },
1555
1567
  emits: ["drag", "drag-end"]
1556
1568
  };
1557
- un.render = function(e, t, n, r, i, a) {
1569
+ dn.render = function(e, t, n, r, i, a) {
1558
1570
  var o = x("LineWrapper");
1559
1571
  return z(), h(o, {
1560
1572
  class: a.classes.wrapper,
@@ -1579,15 +1591,15 @@ un.render = function(e, t, n, r, i, a) {
1579
1591
  "onLeave"
1580
1592
  ]);
1581
1593
  };
1582
- var dn = Ye("vue-bounding-box"), fn = [
1594
+ var fn = Xe("vue-bounding-box"), pn = [
1583
1595
  "east",
1584
1596
  "west",
1585
1597
  null
1586
- ], pn = [
1598
+ ], mn = [
1587
1599
  "south",
1588
1600
  "north",
1589
1601
  null
1590
- ], mn = {
1602
+ ], hn = {
1591
1603
  name: "BoundingBox",
1592
1604
  props: {
1593
1605
  width: { type: Number },
@@ -1611,7 +1623,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1611
1623
  handlersComponent: {
1612
1624
  type: [Object, String],
1613
1625
  default: function() {
1614
- return sn;
1626
+ return cn;
1615
1627
  }
1616
1628
  },
1617
1629
  handlersClasses: {
@@ -1640,7 +1652,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1640
1652
  linesComponent: {
1641
1653
  type: [Object, String],
1642
1654
  default: function() {
1643
- return un;
1655
+ return dn;
1644
1656
  }
1645
1657
  },
1646
1658
  linesClasses: {
@@ -1662,10 +1674,10 @@ var dn = Ye("vue-bounding-box"), fn = [
1662
1674
  },
1663
1675
  data: function() {
1664
1676
  var e = [];
1665
- return fn.forEach((function(t) {
1666
- pn.forEach((function(n) {
1677
+ return pn.forEach((function(t) {
1678
+ mn.forEach((function(n) {
1667
1679
  if (t !== n) {
1668
- var r = Qe(t, n);
1680
+ var r = $e(t, n);
1669
1681
  e.push({
1670
1682
  name: r.name,
1671
1683
  classname: r.classname,
@@ -1684,7 +1696,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1684
1696
  classes: function() {
1685
1697
  var e = this.handlersClasses, t = this.handlersWrappersClasses, n = this.linesClasses, r = this.linesWrappersClasses;
1686
1698
  return {
1687
- root: dn(),
1699
+ root: fn(),
1688
1700
  handlers: e,
1689
1701
  handlersWrappers: t,
1690
1702
  lines: n,
@@ -1722,8 +1734,8 @@ var dn = Ye("vue-bounding-box"), fn = [
1722
1734
  };
1723
1735
  if (n && r) {
1724
1736
  var o = i.horizontalDirection, s = i.verticalDirection, c = o === "east" ? n : o === "west" ? 0 : n / 2, l = s === "south" ? r : s === "north" ? 0 : r / 2;
1725
- a.wrapperClass = dn("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
1726
- } else a.wrapperClass = dn("handler", W({}, i.classname, !0));
1737
+ a.wrapperClass = fn("handler"), a.wrapperStyle = { transform: `translate(${c}px, ${l}px)` }, e.transitions && e.transitions.enabled && (a.wrapperStyle.transition = `${e.transitions.time}ms ${e.transitions.timingFunction}`);
1738
+ } else a.wrapperClass = fn("handler", W({}, i.classname, !0));
1727
1739
  t.push(a);
1728
1740
  }
1729
1741
  })), t;
@@ -1749,7 +1761,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1749
1761
  top: 0,
1750
1762
  bottom: 0
1751
1763
  };
1752
- t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new lt(s, {
1764
+ t === "west" ? s.left -= a : t === "east" && (s.right += a), n === "north" ? s.top -= o : n === "south" && (s.bottom += o), !n && t ? r = "width" : n && !t && (r = "height"), this.resizable && this.$emit("resize", new ut(s, {
1753
1765
  allowedDirections: {
1754
1766
  left: t === "west" || !t,
1755
1767
  right: t === "east" || !t,
@@ -1763,7 +1775,7 @@ var dn = Ye("vue-bounding-box"), fn = [
1763
1775
  },
1764
1776
  emits: ["resize", "resize-end"]
1765
1777
  };
1766
- mn.render = function(e, t, n, r, i, a) {
1778
+ hn.render = function(e, t, n, r, i, a) {
1767
1779
  return z(), h("div", {
1768
1780
  ref: "box",
1769
1781
  class: a.classes.root,
@@ -1823,7 +1835,7 @@ mn.render = function(e, t, n, r, i, a) {
1823
1835
  })), 128))
1824
1836
  ], 6);
1825
1837
  };
1826
- var hn = Ye("vue-draggable-area"), gn = {
1838
+ var gn = Xe("vue-draggable-area"), _n = {
1827
1839
  name: "DraggableArea",
1828
1840
  props: {
1829
1841
  movable: {
@@ -1836,7 +1848,7 @@ var hn = Ye("vue-draggable-area"), gn = {
1836
1848
  }
1837
1849
  },
1838
1850
  computed: { classnames: function() {
1839
- return { default: hn() };
1851
+ return { default: gn() };
1840
1852
  } },
1841
1853
  beforeMount: function() {
1842
1854
  window.addEventListener("mouseup", this.onMouseUp, { passive: !1 }), window.addEventListener("mousemove", this.onMouseMove, { passive: !1 }), window.addEventListener("touchmove", this.onTouchMove, { passive: !1 }), window.addEventListener("touchend", this.onTouchEnd, { passive: !1 });
@@ -1851,14 +1863,14 @@ var hn = Ye("vue-draggable-area"), gn = {
1851
1863
  onTouchStart: function(e) {
1852
1864
  if (e.cancelable) {
1853
1865
  var t = this.movable && e.touches.length === 1;
1854
- t && (this.touches = We(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1866
+ t && (this.touches = Ge(e.touches)), (this.touchStarted || t) && (e.preventDefault(), e.stopPropagation());
1855
1867
  }
1856
1868
  },
1857
1869
  onTouchEnd: function() {
1858
1870
  this.touchStarted = !1, this.processEnd();
1859
1871
  },
1860
1872
  onTouchMove: function(e) {
1861
- this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : st({
1873
+ this.touches.length >= 1 && (this.touchStarted ? (this.processMove(e, e.touches), e.preventDefault(), e.stopPropagation()) : ct({
1862
1874
  x: this.touches[0].clientX,
1863
1875
  y: this.touches[0].clientY
1864
1876
  }, {
@@ -1897,10 +1909,10 @@ var hn = Ye("vue-draggable-area"), gn = {
1897
1909
  };
1898
1910
  },
1899
1911
  processMove: function(e, t) {
1900
- var n = We(t);
1912
+ var n = Ge(t);
1901
1913
  if (this.touches.length) {
1902
1914
  var r = this.$refs.container.getBoundingClientRect(), i = r.left, a = r.top;
1903
- this.touches.length === 1 && n.length === 1 && this.$emit("move", new ut({
1915
+ this.touches.length === 1 && n.length === 1 && this.$emit("move", new dt({
1904
1916
  left: n[0].clientX - (i + this.anchor.x),
1905
1917
  top: n[0].clientY - (a + this.anchor.y)
1906
1918
  }));
@@ -1912,7 +1924,7 @@ var hn = Ye("vue-draggable-area"), gn = {
1912
1924
  },
1913
1925
  emits: ["move", "move-end"]
1914
1926
  };
1915
- gn.render = function(e, t, n, r, i, a) {
1927
+ _n.render = function(e, t, n, r, i, a) {
1916
1928
  return z(), h("div", {
1917
1929
  ref: "container",
1918
1930
  onTouchstart: t[1] ||= function() {
@@ -1923,7 +1935,7 @@ gn.render = function(e, t, n, r, i, a) {
1923
1935
  }
1924
1936
  }, [c(e.$slots, "default")], 544);
1925
1937
  };
1926
- function _n(e) {
1938
+ function vn(e) {
1927
1939
  return {
1928
1940
  rotate: e.rotate || 0,
1929
1941
  flip: {
@@ -1932,7 +1944,7 @@ function _n(e) {
1932
1944
  }
1933
1945
  };
1934
1946
  }
1935
- function vn(e) {
1947
+ function yn(e) {
1936
1948
  return new Promise((function(t, n) {
1937
1949
  try {
1938
1950
  if (e) {
@@ -1965,11 +1977,11 @@ function vn(e) {
1965
1977
  var a, o, s;
1966
1978
  }));
1967
1979
  }
1968
- function yn(e) {
1980
+ function bn(e) {
1969
1981
  var t = e.rotate, n = e.flip, r = e.scaleX, i = e.scaleY, a = "";
1970
1982
  return a += " rotate(" + t + "deg) ", a += " scaleX(" + r * (n.horizontal ? -1 : 1) + ") ", a += " scaleY(" + i * (n.vertical ? -1 : 1) + ") ";
1971
1983
  }
1972
- function bn(e) {
1984
+ function xn(e) {
1973
1985
  try {
1974
1986
  var t, n = new DataView(e), r = void 0, i = void 0, a = void 0, o = void 0;
1975
1987
  if (n.getUint8(0) === 255 && n.getUint8(1) === 216) for (var s = n.byteLength, c = 2; c + 1 < s;) {
@@ -2001,7 +2013,7 @@ function bn(e) {
2001
2013
  return null;
2002
2014
  }
2003
2015
  }
2004
- function xn(e, t) {
2016
+ function Sn(e, t) {
2005
2017
  var n = t.getBoundingClientRect(), r = n.left, i = n.top, a = {
2006
2018
  left: 0,
2007
2019
  top: 0
@@ -2009,7 +2021,7 @@ function xn(e, t) {
2009
2021
  return e.forEach((function(t) {
2010
2022
  a.left += (t.clientX - r) / e.length, a.top += (t.clientY - i) / e.length;
2011
2023
  })), e.forEach((function(e) {
2012
- o += st({
2024
+ o += ct({
2013
2025
  x: a.left,
2014
2026
  y: a.top
2015
2027
  }, {
@@ -2022,7 +2034,7 @@ function xn(e, t) {
2022
2034
  count: e.length
2023
2035
  };
2024
2036
  }
2025
- var Sn = {
2037
+ var Cn = {
2026
2038
  props: {
2027
2039
  touchMove: {
2028
2040
  type: Boolean,
@@ -2052,18 +2064,18 @@ var Sn = {
2052
2064
  window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("touchmove", this.onTouchMove), window.removeEventListener("touchend", this.onTouchEnd);
2053
2065
  },
2054
2066
  created: function() {
2055
- this.transforming = !1, this.debouncedProcessEnd = Ze(this.processEnd), this.touches = [];
2067
+ this.transforming = !1, this.debouncedProcessEnd = Qe(this.processEnd), this.touches = [];
2056
2068
  },
2057
2069
  methods: {
2058
2070
  processMove: function(e, t) {
2059
2071
  if (this.touches.length) {
2060
- if (this.touches.length === 1 && t.length === 1) this.$emit("move", new ct({
2072
+ if (this.touches.length === 1 && t.length === 1) this.$emit("move", new lt({
2061
2073
  left: this.touches[0].clientX - t[0].clientX,
2062
2074
  top: this.touches[0].clientY - t[0].clientY
2063
2075
  }));
2064
2076
  else if (this.touches.length > 1 && this.touchResize) {
2065
- var n = xn(t, this.$refs.container), r = this.oldGeometricProperties;
2066
- r.count === n.count && r.count > 1 && this.$emit("resize", new ct({
2077
+ var n = Sn(t, this.$refs.container), r = this.oldGeometricProperties;
2078
+ r.count === n.count && r.count > 1 && this.$emit("resize", new lt({
2067
2079
  left: r.centerMass.left - n.centerMass.left,
2068
2080
  top: r.centerMass.top - n.centerMass.top
2069
2081
  }, {
@@ -2086,9 +2098,9 @@ var Sn = {
2086
2098
  onTouchStart: function(e) {
2087
2099
  if (e.cancelable && (this.touchMove || this.touchResize && e.touches.length > 1) && this.processEvent(e)) {
2088
2100
  var t = this.$refs.container, n = t.getBoundingClientRect(), r = n.left, i = n.top, a = n.bottom, o = n.right;
2089
- this.touches = We(e.touches).filter((function(e) {
2101
+ this.touches = Ge(e.touches).filter((function(e) {
2090
2102
  return e.clientX > r && e.clientX < o && e.clientY > i && e.clientY < a;
2091
- })), this.oldGeometricProperties = xn(this.touches, t);
2103
+ })), this.oldGeometricProperties = Sn(this.touches, t);
2092
2104
  }
2093
2105
  },
2094
2106
  onTouchEnd: function(e) {
@@ -2097,7 +2109,7 @@ var Sn = {
2097
2109
  onTouchMove: function(e) {
2098
2110
  var t = this;
2099
2111
  if (this.touches.length) {
2100
- var n = We(e.touches).filter((function(e) {
2112
+ var n = Ge(e.touches).filter((function(e) {
2101
2113
  return !e.identifier || t.touches.find((function(t) {
2102
2114
  return t.identifier === e.identifier;
2103
2115
  }));
@@ -2126,11 +2138,11 @@ var Sn = {
2126
2138
  },
2127
2139
  onWheel: function(e) {
2128
2140
  if (this.wheelResize && this.processEvent(e)) {
2129
- var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || ot(s) ? s : s > 0 ? 1 : -1), a = {
2141
+ var t = this.$refs.container.getBoundingClientRect(), n = t.left, r = t.top, i = 1 + this.wheelResize.ratio * (o = e.deltaY || e.detail || e.wheelDelta, (s = +o) == 0 || st(s) ? s : s > 0 ? 1 : -1), a = {
2130
2142
  left: e.clientX - n,
2131
2143
  top: e.clientY - r
2132
2144
  };
2133
- this.$emit("resize", new ct({}, {
2145
+ this.$emit("resize", new lt({}, {
2134
2146
  factor: i,
2135
2147
  center: a
2136
2148
  })), this.touches.length || this.debouncedProcessEnd();
@@ -2144,7 +2156,7 @@ var Sn = {
2144
2156
  "transform-end"
2145
2157
  ]
2146
2158
  };
2147
- Sn.render = function(e, t, n, r, i, a) {
2159
+ Cn.render = function(e, t, n, r, i, a) {
2148
2160
  return z(), h("div", {
2149
2161
  ref: "container",
2150
2162
  onTouchstart: t[1] ||= function() {
@@ -2158,8 +2170,8 @@ Sn.render = function(e, t, n, r, i, a) {
2158
2170
  }
2159
2171
  }, [c(e.$slots, "default")], 544);
2160
2172
  };
2161
- var Cn = {
2162
- components: { TransformableImage: Sn },
2173
+ var wn = {
2174
+ components: { TransformableImage: Cn },
2163
2175
  props: {
2164
2176
  touchMove: {
2165
2177
  type: Boolean,
@@ -2180,7 +2192,7 @@ var Cn = {
2180
2192
  },
2181
2193
  emits: ["resize", "move"]
2182
2194
  };
2183
- Cn.render = function(e, t, n, r, i, a) {
2195
+ wn.render = function(e, t, n, r, i, a) {
2184
2196
  var o = x("transformable-image");
2185
2197
  return z(), h(o, {
2186
2198
  "touch-move": n.touchMove,
@@ -2205,7 +2217,7 @@ Cn.render = function(e, t, n, r, i, a) {
2205
2217
  "wheel-resize"
2206
2218
  ]);
2207
2219
  };
2208
- var wn = Ye("vue-preview"), Tn = {
2220
+ var Tn = Xe("vue-preview"), En = {
2209
2221
  props: {
2210
2222
  coordinates: { type: Object },
2211
2223
  transitions: { type: Object },
@@ -2235,10 +2247,10 @@ var wn = Ye("vue-preview"), Tn = {
2235
2247
  computed: {
2236
2248
  classes: function() {
2237
2249
  return {
2238
- root: wn({ fill: this.fill }),
2239
- wrapper: wn("wrapper"),
2240
- imageWrapper: wn("image-wrapper"),
2241
- image: G(wn("image"), this.imageClass)
2250
+ root: Tn({ fill: this.fill }),
2251
+ wrapper: Tn("wrapper"),
2252
+ imageWrapper: Tn("image-wrapper"),
2253
+ image: G(Tn("image"), this.imageClass)
2242
2254
  };
2243
2255
  },
2244
2256
  style: function() {
@@ -2266,7 +2278,7 @@ var wn = Ye("vue-preview"), Tn = {
2266
2278
  }, this.image.transforms), {}, {
2267
2279
  scaleX: 1 / e,
2268
2280
  scaleY: 1 / e
2269
- }), n = this.imageSize.width, r = this.imageSize.height, i = Nt({
2281
+ }), n = this.imageSize.width, r = this.imageSize.height, i = Pt({
2270
2282
  width: n,
2271
2283
  height: r
2272
2284
  }, t.rotate), a = {
@@ -2285,7 +2297,7 @@ var wn = Ye("vue-preview"), Tn = {
2285
2297
  }
2286
2298
  };
2287
2299
  return a.transform = `translate(
2288
- ${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + yn(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
2300
+ ${-this.coordinates.left / e - o.rotate.left - o.scale.left}px,${-this.coordinates.top / e - o.rotate.top - o.scale.top}px) ` + bn(t), this.transitions && this.transitions.enabled && (a.transition = `${this.transitions.time}ms ${this.transitions.timingFunction}`), a;
2289
2301
  }
2290
2302
  return {};
2291
2303
  },
@@ -2329,7 +2341,7 @@ var wn = Ye("vue-preview"), Tn = {
2329
2341
  }
2330
2342
  }
2331
2343
  };
2332
- Tn.render = function(e, t, n, r, i, a) {
2344
+ En.render = function(e, t, n, r, i, a) {
2333
2345
  return z(), h("div", {
2334
2346
  ref: "root",
2335
2347
  class: a.classes.root,
@@ -2345,20 +2357,20 @@ Tn.render = function(e, t, n, r, i, a) {
2345
2357
  style: a.imageStyle
2346
2358
  }, null, 14, ["src"]), [[ye, n.image && n.image.src]])], 6)], 6);
2347
2359
  };
2348
- var En = {
2349
- components: { Preview: Tn },
2360
+ var Dn = {
2361
+ components: { Preview: En },
2350
2362
  inheritAttrs: !1
2351
2363
  };
2352
- En.render = function(e, t, n, r, i, a) {
2364
+ Dn.render = function(e, t, n, r, i, a) {
2353
2365
  var o = x("preview");
2354
2366
  return z(), h(o, f(e.$attrs, { fill: !0 }), null, 16);
2355
2367
  };
2356
- var Dn = Ye("vue-rectangle-stencil"), On = {
2368
+ var On = Xe("vue-rectangle-stencil"), kn = {
2357
2369
  name: "RectangleStencil",
2358
2370
  components: {
2359
- StencilPreview: En,
2360
- BoundingBox: mn,
2361
- DraggableArea: gn
2371
+ StencilPreview: Dn,
2372
+ BoundingBox: hn,
2373
+ DraggableArea: _n
2362
2374
  },
2363
2375
  props: {
2364
2376
  image: { type: Object },
@@ -2368,14 +2380,14 @@ var Dn = Ye("vue-rectangle-stencil"), On = {
2368
2380
  handlersComponent: {
2369
2381
  type: [Object, String],
2370
2382
  default: function() {
2371
- return sn;
2383
+ return cn;
2372
2384
  }
2373
2385
  },
2374
2386
  lines: { type: Object },
2375
2387
  linesComponent: {
2376
2388
  type: [Object, String],
2377
2389
  default: function() {
2378
- return un;
2390
+ return dn;
2379
2391
  }
2380
2392
  },
2381
2393
  aspectRatio: { type: [Number, String] },
@@ -2428,13 +2440,13 @@ var Dn = Ye("vue-rectangle-stencil"), On = {
2428
2440
  computed: {
2429
2441
  classes: function() {
2430
2442
  return {
2431
- stencil: G(Dn({
2443
+ stencil: G(On({
2432
2444
  movable: this.movable,
2433
2445
  moving: this.moving,
2434
2446
  resizing: this.resizing
2435
2447
  }), this.moving && this.movingClass, this.resizing && this.resizingClass),
2436
- preview: G(Dn("preview"), this.previewClass),
2437
- boundingBox: G(Dn("bounding-box"), this.boundingBoxClass)
2448
+ preview: G(On("preview"), this.previewClass),
2449
+ boundingBox: G(On("bounding-box"), this.boundingBoxClass)
2438
2450
  };
2439
2451
  },
2440
2452
  style: function() {
@@ -2473,7 +2485,7 @@ var Dn = Ye("vue-rectangle-stencil"), On = {
2473
2485
  "move-end"
2474
2486
  ]
2475
2487
  };
2476
- On.render = function(e, t, n, r, i, a) {
2488
+ kn.render = function(e, t, n, r, i, a) {
2477
2489
  var o = x("stencil-preview"), s = x("draggable-area"), c = x("bounding-box");
2478
2490
  return z(), h("div", {
2479
2491
  class: a.classes.stencil,
@@ -2544,9 +2556,9 @@ On.render = function(e, t, n, r, i, a) {
2544
2556
  "onResizeEnd"
2545
2557
  ])], 6);
2546
2558
  };
2547
- var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2559
+ var An = ["transitions"], jn = Xe("vue-advanced-cropper"), Mn = {
2548
2560
  name: "Cropper",
2549
- components: { BackgroundWrapper: Cn },
2561
+ components: { BackgroundWrapper: wn },
2550
2562
  props: {
2551
2563
  src: {
2552
2564
  type: String,
@@ -2555,13 +2567,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2555
2567
  stencilComponent: {
2556
2568
  type: [Object, String],
2557
2569
  default: function() {
2558
- return On;
2570
+ return kn;
2559
2571
  }
2560
2572
  },
2561
2573
  backgroundWrapperComponent: {
2562
2574
  type: [Object, String],
2563
2575
  default: function() {
2564
- return Cn;
2576
+ return wn;
2565
2577
  }
2566
2578
  },
2567
2579
  stencilProps: {
@@ -2610,7 +2622,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2610
2622
  type: String,
2611
2623
  default: "fit-area",
2612
2624
  validator: function(e) {
2613
- return xt.indexOf(e) !== -1;
2625
+ return St.indexOf(e) !== -1;
2614
2626
  }
2615
2627
  },
2616
2628
  roundResult: {
@@ -2653,31 +2665,31 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2653
2665
  bottom: !0,
2654
2666
  top: !0
2655
2667
  };
2656
- a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), _t.forEach((function(e) {
2668
+ a.widthFrozen && (c.left = 0, c.right = 0), a.heightFrozen && (c.top = 0, c.bottom = 0), vt.forEach((function(e) {
2657
2669
  l[e] || (c[e] = 0);
2658
2670
  }));
2659
- var u = Dt(o, c = nn({
2671
+ var u = Ot(o, c = rn({
2660
2672
  coordinates: o,
2661
2673
  directions: c,
2662
2674
  sizeRestrictions: a,
2663
2675
  positionRestrictions: i
2664
- })).width, d = Dt(o, c).height, f = s.preserveRatio ? Z(o) : jt(u / d, r);
2676
+ })).width, d = Ot(o, c).height, f = s.preserveRatio ? Z(o) : Mt(u / d, r);
2665
2677
  if (f) {
2666
2678
  var p = s.respectDirection;
2667
2679
  if (p ||= o.width >= o.height || f === 1 ? "width" : "height", p === "width") {
2668
2680
  var m = u / f - o.height;
2669
2681
  if (l.top && l.bottom) {
2670
2682
  var h = c.top, g = c.bottom;
2671
- c.bottom = rn(m, g, h), c.top = rn(m, h, g);
2683
+ c.bottom = an(m, g, h), c.top = an(m, h, g);
2672
2684
  } else l.bottom ? c.bottom = m : l.top ? c.top = m : l.right ? c.right = 0 : l.left && (c.left = 0);
2673
2685
  } else if (p === "height") {
2674
2686
  var _ = o.width - d * f;
2675
2687
  if (l.left && l.right) {
2676
2688
  var v = c.left, y = c.right;
2677
- c.left = -rn(_, v, y), c.right = -rn(_, y, v);
2689
+ c.left = -an(_, v, y), c.right = -an(_, y, v);
2678
2690
  } else l.left ? c.left = -_ : l.right ? c.right = -_ : l.top ? c.top = 0 : l.bottom && (c.bottom = 0);
2679
2691
  }
2680
- c = nn({
2692
+ c = rn({
2681
2693
  directions: c,
2682
2694
  coordinates: o,
2683
2695
  sizeRestrictions: a,
@@ -2686,10 +2698,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2686
2698
  compensate: s.compensate
2687
2699
  });
2688
2700
  }
2689
- return u = Dt(o, c).width, d = Dt(o, c).height, (f = s.preserveRatio ? Z(o) : jt(u / d, r)) && Math.abs(f - u / d) > .001 && _t.forEach((function(e) {
2701
+ return u = Ot(o, c).width, d = Ot(o, c).height, (f = s.preserveRatio ? Z(o) : Mt(u / d, r)) && Math.abs(f - u / d) > .001 && vt.forEach((function(e) {
2690
2702
  l[e] || (c[e] = 0);
2691
- })), Ut({
2692
- event: new ut({
2703
+ })), Wt({
2704
+ event: new dt({
2693
2705
  left: -c.left,
2694
2706
  top: -c.top
2695
2707
  }),
@@ -2705,7 +2717,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2705
2717
  },
2706
2718
  moveAlgorithm: {
2707
2719
  type: Function,
2708
- default: Ut
2720
+ default: Wt
2709
2721
  },
2710
2722
  initStretcher: {
2711
2723
  type: Function,
@@ -2717,7 +2729,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2717
2729
  fitCoordinates: {
2718
2730
  type: Function,
2719
2731
  default: function(e) {
2720
- var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), Ht({
2732
+ var t = e.visibleArea, n = e.coordinates, r = e.aspectRatio, i = e.sizeRestrictions, a = e.positionRestrictions, o = K(K({}, n), Ut({
2721
2733
  width: n.width,
2722
2734
  height: n.height,
2723
2735
  aspectRatio: r,
@@ -2728,7 +2740,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2728
2740
  minWidth: Math.min(t.width, i.minWidth)
2729
2741
  }
2730
2742
  }));
2731
- return o = Q(o = Y(o, Tt(J(n), J(o))), zt(wt(t), a));
2743
+ return o = Q(o = Y(o, Et(J(n), J(o))), Bt(Tt(t), a));
2732
2744
  }
2733
2745
  },
2734
2746
  fitVisibleArea: {
@@ -2736,7 +2748,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2736
2748
  default: function(e) {
2737
2749
  var t = e.visibleArea, n = e.boundaries, r = e.getAreaRestrictions, i = e.coordinates, a = K({}, t);
2738
2750
  a.height = a.width / Z(n), a.top += (t.height - a.height) / 2, (i.height - a.height > 0 || i.width - a.width > 0) && (a = X(a, Math.max(i.height / a.height, i.width / a.width)));
2739
- var o = Ot(At(i, wt(a = X(a, Ft(a, r({
2751
+ var o = kt(jt(i, Tt(a = X(a, It(a, r({
2740
2752
  visibleArea: a,
2741
2753
  type: "resize"
2742
2754
  }))))));
@@ -2817,7 +2829,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2817
2829
  height: 0
2818
2830
  },
2819
2831
  visibleArea: null,
2820
- coordinates: U({}, St)
2832
+ coordinates: U({}, Ct)
2821
2833
  };
2822
2834
  },
2823
2835
  computed: {
@@ -2855,7 +2867,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2855
2867
  return !!(this.visibleArea && this.imageLoaded);
2856
2868
  },
2857
2869
  settings: function() {
2858
- var e = rt(this.resizeImage, {
2870
+ var e = it(this.resizeImage, {
2859
2871
  touch: !0,
2860
2872
  wheel: { ratio: .1 },
2861
2873
  adjustStencil: !0
@@ -2865,7 +2877,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2865
2877
  adjustStencil: !1
2866
2878
  });
2867
2879
  return {
2868
- moveImage: rt(this.moveImage, {
2880
+ moveImage: it(this.moveImage, {
2869
2881
  touch: !0,
2870
2882
  mouse: !0
2871
2883
  }, {
@@ -2896,10 +2908,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2896
2908
  if (this.boundaries.width && this.boundaries.height && this.imageSize.width && this.imageSize.height) {
2897
2909
  var e = this.sizeRestrictionsAlgorithm({
2898
2910
  imageSize: this.imageSize,
2899
- minWidth: q(this.minWidth) ? 0 : it(this.minWidth),
2900
- minHeight: q(this.minHeight) ? 0 : it(this.minHeight),
2901
- maxWidth: q(this.maxWidth) ? 1 / 0 : it(this.maxWidth),
2902
- maxHeight: q(this.maxHeight) ? 1 / 0 : it(this.maxHeight)
2911
+ minWidth: q(this.minWidth) ? 0 : at(this.minWidth),
2912
+ minHeight: q(this.minHeight) ? 0 : at(this.minHeight),
2913
+ maxWidth: q(this.maxWidth) ? 1 / 0 : at(this.maxWidth),
2914
+ maxHeight: q(this.maxHeight) ? 1 / 0 : at(this.maxHeight)
2903
2915
  });
2904
2916
  if (e = function(e) {
2905
2917
  var t = e.areaRestrictions, n = e.sizeRestrictions, r = e.boundaries, i = e.positionRestrictions, a = K(K({}, n), {
@@ -2909,7 +2921,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2909
2921
  maxHeight: n.maxHeight === void 0 ? 1 / 0 : n.maxHeight
2910
2922
  });
2911
2923
  i.left !== void 0 && i.right !== void 0 && (a.maxWidth = Math.min(a.maxWidth, i.right - i.left)), i.bottom !== void 0 && i.top !== void 0 && (a.maxHeight = Math.min(a.maxHeight, i.bottom - i.top));
2912
- var o = It(t), s = Mt(r, o);
2924
+ var o = Lt(t), s = Nt(r, o);
2913
2925
  return o.width < 1 / 0 && (!a.maxWidth || a.maxWidth > s.width) && (a.maxWidth = Math.min(a.maxWidth, s.width)), o.height < 1 / 0 && (!a.maxHeight || a.maxHeight > s.height) && (a.maxHeight = Math.min(a.maxHeight, s.height)), a.minWidth > a.maxWidth && (a.minWidth = a.maxWidth, a.widthFrozen = !0), a.minHeight > a.maxHeight && (a.minHeight = a.maxHeight, a.heightFrozen = !0), a;
2914
2926
  }({
2915
2927
  sizeRestrictions: e,
@@ -2924,7 +2936,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2924
2936
  visibleArea: this.visibleArea,
2925
2937
  stencilSize: this.getStencilSize()
2926
2938
  }), this.visibleArea && this.stencilSize) {
2927
- var t = this.getStencilSize(), n = It(this.getAreaRestrictions({
2939
+ var t = this.getStencilSize(), n = Lt(this.getAreaRestrictions({
2928
2940
  visibleArea: this.visibleArea,
2929
2941
  type: "resize"
2930
2942
  }));
@@ -2947,15 +2959,15 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
2947
2959
  },
2948
2960
  classes: function() {
2949
2961
  return {
2950
- cropper: An(),
2951
- image: G(An("image"), this.imageClass),
2952
- stencil: An("stencil"),
2953
- boundaries: G(An("boundaries"), this.boundariesClass),
2954
- stretcher: G(An("stretcher")),
2955
- background: G(An("background"), this.backgroundClass),
2956
- foreground: G(An("foreground"), this.foregroundClass),
2957
- imageWrapper: G(An("image-wrapper")),
2958
- cropperWrapper: G(An("cropper-wrapper"))
2962
+ cropper: jn(),
2963
+ image: G(jn("image"), this.imageClass),
2964
+ stencil: jn("stencil"),
2965
+ boundaries: G(jn("boundaries"), this.boundariesClass),
2966
+ stretcher: G(jn("stretcher")),
2967
+ background: G(jn("background"), this.backgroundClass),
2968
+ foreground: G(jn("foreground"), this.foregroundClass),
2969
+ imageWrapper: G(jn("image-wrapper")),
2970
+ cropperWrapper: G(jn("cropper-wrapper"))
2959
2971
  };
2960
2972
  },
2961
2973
  stencilCoordinates: function() {
@@ -3000,7 +3012,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3000
3012
  height: `${e.height}px`,
3001
3013
  left: "0px",
3002
3014
  top: "0px",
3003
- transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + yn(r)
3015
+ transform: `translate(${-t.left - n.left - this.imageTransforms.translateX}px, ${-t.top - n.top - this.imageTransforms.translateY}px)` + bn(r)
3004
3016
  };
3005
3017
  return this.transitionsOptions.enabled && (i.transition = `${this.transitionsOptions.time}ms ${this.transitionsOptions.timingFunction}`), i;
3006
3018
  }
@@ -3041,7 +3053,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3041
3053
  }
3042
3054
  },
3043
3055
  created: function() {
3044
- this.debouncedUpdate = Ze(this.update, this.debounce), this.debouncedDisableTransitions = Ze(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
3056
+ this.debouncedUpdate = Qe(this.update, this.debounce), this.debouncedDisableTransitions = Qe(this.disableTransitions, this.transitionsOptions.time), this.awaiting = !1;
3045
3057
  },
3046
3058
  mounted: function() {
3047
3059
  this.$refs.image.addEventListener("load", this.onSuccessLoadImage), this.$refs.image.addEventListener("error", this.onFailLoadImage), this.onChangeImage(), window.addEventListener("resize", this.refresh), window.addEventListener("orientationchange", this.refresh);
@@ -3077,7 +3089,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3077
3089
  },
3078
3090
  zoom: function(e, t) {
3079
3091
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3080
- this.onManipulateImage(new ct({}, {
3092
+ this.onManipulateImage(new lt({}, {
3081
3093
  factor: 1 / e,
3082
3094
  center: t
3083
3095
  }), {
@@ -3087,7 +3099,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3087
3099
  },
3088
3100
  move: function(e, t) {
3089
3101
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3090
- this.onManipulateImage(new ct({
3102
+ this.onManipulateImage(new lt({
3091
3103
  left: e || 0,
3092
3104
  top: t || 0
3093
3105
  }), {
@@ -3131,13 +3143,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3131
3143
  };
3132
3144
  return i.width > n.maxWidth ? i.width = Math.floor(t.width) : i.width < n.minWidth && (i.width = Math.ceil(t.width)), i.height > n.maxHeight ? i.height = Math.floor(t.height) : i.height < n.minHeight && (i.height = Math.ceil(t.height)), Q(i, r);
3133
3145
  }(U(U({}, this.getPublicProperties()), {}, {
3134
- positionRestrictions: Qt(this.positionRestrictions, this.visibleArea),
3146
+ positionRestrictions: $t(this.positionRestrictions, this.visibleArea),
3135
3147
  coordinates: e
3136
3148
  })) : e;
3137
3149
  },
3138
3150
  processAutoZoom: function(e, t, n, r) {
3139
3151
  var i = this.autoZoomAlgorithm;
3140
- i ||= this.stencilSize ? Gt : this.autoZoom ? Kt : qt;
3152
+ i ||= this.stencilSize ? Kt : this.autoZoom ? qt : Jt;
3141
3153
  var a = i({
3142
3154
  event: {
3143
3155
  type: e,
@@ -3152,10 +3164,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3152
3164
  sizeRestrictions: this.sizeRestrictions,
3153
3165
  stencilSize: this.getStencilSize()
3154
3166
  });
3155
- return U(U({}, a), {}, { changed: !Ct(a.visibleArea, t) || !Ct(a.coordinates, n) });
3167
+ return U(U({}, a), {}, { changed: !wt(a.visibleArea, t) || !wt(a.coordinates, n) });
3156
3168
  },
3157
3169
  runAutoZoom: function(e) {
3158
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = Ue(t, kn), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
3170
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.transitions, r = n !== void 0 && n, i = We(t, An), a = this.processAutoZoom(e, this.visibleArea, this.coordinates, i), o = a.visibleArea, s = a.coordinates, c = a.changed;
3159
3171
  r && c && this.enableTransitions(), this.visibleArea = o, this.coordinates = s, r && c && this.debouncedDisableTransitions();
3160
3172
  },
3161
3173
  normalizeEvent: function(e) {
@@ -3176,13 +3188,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3176
3188
  });
3177
3189
  if (t.type === "resize") {
3178
3190
  var i = K(K({}, t), { directions: K({}, t.directions) });
3179
- return _t.forEach((function(e) {
3191
+ return vt.forEach((function(e) {
3180
3192
  i.directions[e] *= r;
3181
3193
  })), i;
3182
3194
  }
3183
3195
  if (t.type === "move") {
3184
3196
  var a = K(K({}, t), { directions: K({}, t.directions) });
3185
- return bt.forEach((function(e) {
3197
+ return xt.forEach((function(e) {
3186
3198
  a.directions[e] *= r;
3187
3199
  })), a;
3188
3200
  }
@@ -3195,9 +3207,9 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3195
3207
  var r = n.rotate, i = n.flip, a = {
3196
3208
  width: t.naturalWidth,
3197
3209
  height: t.naturalHeight
3198
- }, o = Nt(a, r), s = e.getContext("2d");
3210
+ }, o = Pt(a, r), s = e.getContext("2d");
3199
3211
  e.height = o.height, e.width = o.width, s.save();
3200
- var c = Pt(J(K({
3212
+ var c = Ft(J(K({
3201
3213
  left: 0,
3202
3214
  top: 0
3203
3215
  }, a)), r);
@@ -3216,7 +3228,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3216
3228
  return t = e, !Number.isNaN(parseFloat(t)) && isFinite(t);
3217
3229
  var t;
3218
3230
  }));
3219
- }, a = Ht({
3231
+ }, a = Ut({
3220
3232
  sizeRestrictions: {
3221
3233
  minWidth: i([r.width, r.minWidth]) || 0,
3222
3234
  minHeight: i([r.height, r.minHeight]) || 0,
@@ -3250,8 +3262,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3250
3262
  this.$emit("change", this.getResult());
3251
3263
  },
3252
3264
  applyTransform: function(e) {
3253
- var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Lt(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? Qt(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
3254
- return Wt({
3265
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], n = this.visibleArea && t ? Rt(this.sizeRestrictions, this.visibleArea) : this.sizeRestrictions, r = this.visibleArea && t ? $t(this.positionRestrictions, this.visibleArea) : this.positionRestrictions;
3266
+ return Gt({
3255
3267
  transform: e,
3256
3268
  coordinates: this.coordinates,
3257
3269
  imageSize: this.imageSize,
@@ -3266,23 +3278,23 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3266
3278
  if (this.$refs.image) {
3267
3279
  this.$refs.cropper, this.$refs.image;
3268
3280
  var t = this.defaultSize;
3269
- t ||= this.stencilSize ? Xt : Yt, this.sizeRestrictions;
3270
- var n = tt(t) ? t({
3281
+ t ||= this.stencilSize ? Zt : Xt, this.sizeRestrictions;
3282
+ var n = nt(t) ? t({
3271
3283
  boundaries: this.boundaries,
3272
3284
  imageSize: this.imageSize,
3273
3285
  aspectRatio: this.getAspectRatio(),
3274
3286
  sizeRestrictions: this.sizeRestrictions,
3275
3287
  stencilSize: this.getStencilSize(),
3276
3288
  visibleArea: this.visibleArea
3277
- }) : t, r = this.defaultPosition || Jt, i = [n, function(t) {
3289
+ }) : t, r = this.defaultPosition || Yt, i = [n, function(t) {
3278
3290
  var n = t.coordinates;
3279
- return U({}, tt(r) ? r({
3291
+ return U({}, nt(r) ? r({
3280
3292
  coordinates: n,
3281
3293
  imageSize: e.imageSize,
3282
3294
  visibleArea: e.visibleArea
3283
3295
  }) : e.defaultPosition);
3284
3296
  }];
3285
- this.delayedTransforms && i.push.apply(i, We(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
3297
+ this.delayedTransforms && i.push.apply(i, Ge(Array.isArray(this.delayedTransforms) ? this.delayedTransforms : [this.delayedTransforms])), this.coordinates = this.applyTransform(i, !0), this.delayedTransforms = null;
3286
3298
  }
3287
3299
  },
3288
3300
  clearImage: function() {
@@ -3312,7 +3324,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3312
3324
  cropper: n,
3313
3325
  imageSize: e.imageSize
3314
3326
  };
3315
- if (e.boundaries = tt(e.defaultBoundaries) ? e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? function(e) {
3327
+ if (e.boundaries = nt(e.defaultBoundaries) ? e.defaultBoundaries(t) : e.defaultBoundaries === "fit" ? function(e) {
3316
3328
  var t = e.cropper, n = e.imageSize, r = t.clientHeight, i = t.clientWidth, a = r, o = n.width * r / n.height;
3317
3329
  return o > i && (o = i, a = n.height * i / n.width), {
3318
3330
  width: o,
@@ -3331,8 +3343,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3331
3343
  var e = this;
3332
3344
  return this.appliedImageTransforms = U(U({}, this.defaultImageTransforms), {}, { flip: U({}, this.defaultImageTransforms.flip) }), this.updateBoundaries().then((function() {
3333
3345
  e.priority !== "visible-area" && (e.visibleArea = null, e.resetCoordinates());
3334
- var t, n, r, i, a, o, s = e.defaultVisibleArea || Zt;
3335
- e.visibleArea = tt(s) ? s({
3346
+ var t, n, r, i, a, o, s = e.defaultVisibleArea || Qt;
3347
+ e.visibleArea = nt(s) ? s({
3336
3348
  imageSize: e.imageSize,
3337
3349
  boundaries: e.boundaries,
3338
3350
  coordinates: e.priority === "visible-area" ? null : e.coordinates,
@@ -3383,7 +3395,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3383
3395
  var e, t = this;
3384
3396
  if (this.imageLoaded = !1, this.delayedTransforms = null, this.src) {
3385
3397
  if (function(e) {
3386
- if (et(e)) return !1;
3398
+ if (tt(e)) return !1;
3387
3399
  var t = window.location, n = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e) || [], r = {
3388
3400
  protocol: n[1] || "",
3389
3401
  host: n[2] || "",
@@ -3398,8 +3410,8 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3398
3410
  }
3399
3411
  if (this.checkOrientation) {
3400
3412
  var r = (e = this.src, new Promise((function(t) {
3401
- vn(e).then((function(n) {
3402
- var r = bn(n);
3413
+ yn(e).then((function(n) {
3414
+ var r = xn(n);
3403
3415
  t(n ? {
3404
3416
  source: e,
3405
3417
  arrayBuffer: n,
@@ -3436,14 +3448,14 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3436
3448
  },
3437
3449
  onParseImage: function(e) {
3438
3450
  var t = this, n = e.source, r = e.arrayBuffer, i = e.orientation;
3439
- this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? $e(n) || !et(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
3451
+ this.imageAttributes.revoke && this.imageAttributes.src && URL.revokeObjectURL(this.imageAttributes.src), this.imageAttributes.revoke = !1, r && i && i > 1 ? et(n) || !tt(n) ? (this.imageAttributes.src = URL.createObjectURL(new Blob([r])), this.imageAttributes.revoke = !0) : this.imageAttributes.src = function(e) {
3440
3452
  for (var t = [], n = new Uint8Array(e); n.length > 0;) {
3441
3453
  var r = n.subarray(0, 8192);
3442
3454
  t.push(String.fromCharCode.apply(null, Array.from ? Array.from(r) : r.slice())), n = n.subarray(8192);
3443
3455
  }
3444
3456
  return "data:image/jpeg;base64," + btoa(t.join(""));
3445
- }(r) : this.imageAttributes.src = n, this.appliedImageTransforms = tt(this.defaultTransforms) ? _n(this.defaultTransforms()) : nt(this.defaultTransforms) ? _n(this.defaultTransforms) : function(e) {
3446
- var t = _n({});
3457
+ }(r) : this.imageAttributes.src = n, this.appliedImageTransforms = nt(this.defaultTransforms) ? vn(this.defaultTransforms()) : rt(this.defaultTransforms) ? vn(this.defaultTransforms) : function(e) {
3458
+ var t = vn({});
3447
3459
  if (e) switch (e) {
3448
3460
  case 2:
3449
3461
  t.flip.horizontal = !0;
@@ -3483,7 +3495,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3483
3495
  var t = this;
3484
3496
  this.transitionsOptions.enabled || this.awaitRender((function() {
3485
3497
  t.coordinates = t.moveAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3486
- positionRestrictions: Qt(t.positionRestrictions, t.visibleArea),
3498
+ positionRestrictions: $t(t.positionRestrictions, t.visibleArea),
3487
3499
  coordinates: t.coordinates,
3488
3500
  event: t.normalizeEvent(e)
3489
3501
  })), t.onChange();
@@ -3494,7 +3506,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3494
3506
  this.transitionsOptions.enabled || this.stencilSize && !this.autoZoom || this.awaitRender((function() {
3495
3507
  var n = t.sizeRestrictions, r = Math.min(t.coordinates.width, t.coordinates.height, 20 * t.coefficient);
3496
3508
  t.coordinates = t.resizeAlgorithm(U(U({}, t.getPublicProperties()), {}, {
3497
- positionRestrictions: Qt(t.positionRestrictions, t.visibleArea),
3509
+ positionRestrictions: $t(t.positionRestrictions, t.visibleArea),
3498
3510
  sizeRestrictions: {
3499
3511
  maxWidth: Math.min(n.maxWidth, t.visibleArea.width),
3500
3512
  maxHeight: Math.min(n.maxHeight, t.visibleArea.height),
@@ -3510,7 +3522,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3510
3522
  if (!this.transitionsOptions.enabled) {
3511
3523
  var n = t.transitions, r = n !== void 0 && n, i = t.normalize, a = i === void 0 || i;
3512
3524
  r && this.enableTransitions();
3513
- var o = $t(U(U({}, this.getPublicProperties()), {}, {
3525
+ var o = en(U(U({}, this.getPublicProperties()), {}, {
3514
3526
  event: a ? this.normalizeEvent(e) : e,
3515
3527
  getAreaRestrictions: this.getAreaRestrictions,
3516
3528
  imageRestriction: this.imageRestriction,
@@ -3540,7 +3552,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3540
3552
  }
3541
3553
  if (q(t) && (t = q(i) ? a : i), q(n) && (n = q(i) ? o : i), !e && (q(t) || q(n))) {
3542
3554
  var c = this.getStencilSize(), l = c ? Z(c) : null;
3543
- q(t) && (t = at(l) ? l : void 0), q(n) && (n = at(l) ? l : void 0);
3555
+ q(t) && (t = ot(l) ? l : void 0), q(n) && (n = ot(l) ? l : void 0);
3544
3556
  }
3545
3557
  return {
3546
3558
  minimum: t,
@@ -3558,10 +3570,10 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3558
3570
  coefficient: this.coefficient,
3559
3571
  coordinates: this.coordinates,
3560
3572
  aspectRatio: this.getAspectRatio(!0)
3561
- }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, jt(Z(i = tt(n) ? n({
3573
+ }, t = e.boundaries, n = e.stencilSize, r = e.aspectRatio, Mt(Z(i = nt(n) ? n({
3562
3574
  boundaries: t,
3563
3575
  aspectRatio: r
3564
- }) : n), r) && (i = Ht({
3576
+ }) : n), r) && (i = Ut({
3565
3577
  sizeRestrictions: {
3566
3578
  maxWidth: t.width,
3567
3579
  maxHeight: t.height,
@@ -3574,7 +3586,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3574
3586
  minimum: r.minimum,
3575
3587
  maximum: r.maximum
3576
3588
  }
3577
- })), (i.width > t.width || i.height > t.height) && (i = Ht({
3589
+ })), (i.width > t.width || i.height > t.height) && (i = Ut({
3578
3590
  sizeRestrictions: {
3579
3591
  maxWidth: t.width,
3580
3592
  maxHeight: t.height,
@@ -3603,13 +3615,13 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3603
3615
  };
3604
3616
  },
3605
3617
  defaultCoordinates: function() {
3606
- return U({}, St);
3618
+ return U({}, Ct);
3607
3619
  },
3608
3620
  flip: function(e, t) {
3609
3621
  var n = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).transitions, r = n === void 0 || n;
3610
3622
  if (!this.transitionsActive) {
3611
3623
  r && this.enableTransitions();
3612
- var i = U({}, this.imageTransforms.flip), a = tn({
3624
+ var i = U({}, this.imageTransforms.flip), a = nn({
3613
3625
  flip: {
3614
3626
  horizontal: e ? !i.horizontal : i.horizontal,
3615
3627
  vertical: t ? !i.vertical : i.vertical
@@ -3633,7 +3645,7 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3633
3645
  n && this.enableTransitions();
3634
3646
  var r = U({}, this.imageSize);
3635
3647
  this.appliedImageTransforms.rotate += e;
3636
- var i = en({
3648
+ var i = tn({
3637
3649
  visibleArea: this.visibleArea,
3638
3650
  coordinates: this.coordinates,
3639
3651
  previousImageSize: r,
@@ -3653,16 +3665,16 @@ var kn = ["transitions"], An = Ye("vue-advanced-cropper"), jn = {
3653
3665
  "error",
3654
3666
  "ready"
3655
3667
  ]
3656
- }, Mn = {
3668
+ }, Nn = {
3657
3669
  key: 0,
3658
3670
  ref: "canvas",
3659
3671
  style: { display: "none" }
3660
- }, Nn = {
3672
+ }, Pn = {
3661
3673
  key: 1,
3662
3674
  ref: "sourceCanvas",
3663
3675
  style: { display: "none" }
3664
3676
  };
3665
- jn.render = function(e, t, n, i, a, o) {
3677
+ Mn.render = function(e, t, n, i, a, o) {
3666
3678
  return z(), h("div", {
3667
3679
  ref: "cropper",
3668
3680
  class: o.classes.cropper
@@ -3720,8 +3732,8 @@ jn.render = function(e, t, n, i, a, o) {
3720
3732
  "onMove",
3721
3733
  "onMoveEnd"
3722
3734
  ])), [[ye, a.imageLoaded]]),
3723
- n.canvas ? (z(), h("canvas", Mn, null, 512)) : M("", !0),
3724
- n.canvas ? (z(), h("canvas", Nn, null, 512)) : M("", !0)
3735
+ n.canvas ? (z(), h("canvas", Nn, null, 512)) : M("", !0),
3736
+ n.canvas ? (z(), h("canvas", Pn, null, 512)) : M("", !0)
3725
3737
  ];
3726
3738
  })),
3727
3739
  _: 1
@@ -3737,57 +3749,57 @@ jn.render = function(e, t, n, i, a, o) {
3737
3749
  };
3738
3750
  //#endregion
3739
3751
  //#region src/components/media/MediaEditModal.vue?vue&type=script&setup=true&lang.ts
3740
- var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In = {
3752
+ var Fn = ["data-tpl-theme"], In = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, Ln = {
3741
3753
  class: "tpl:text-sm tpl:font-semibold",
3742
3754
  style: { color: "var(--tpl-text)" }
3743
- }, Ln = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, Rn = {
3755
+ }, Rn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto tpl:px-5" }, zn = {
3744
3756
  key: 0,
3745
3757
  class: "tpl:mb-4"
3746
- }, zn = {
3758
+ }, Bn = {
3747
3759
  class: "tpl:relative tpl:mb-3 tpl:overflow-hidden tpl:rounded-md tpl:border",
3748
3760
  style: {
3749
3761
  "border-color": "var(--tpl-border)",
3750
3762
  height: "300px",
3751
3763
  "background-color": "var(--tpl-bg)"
3752
3764
  }
3753
- }, Bn = { class: "tpl:space-y-3" }, Vn = {
3765
+ }, Vn = { class: "tpl:space-y-3" }, Hn = {
3754
3766
  class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium",
3755
3767
  style: { color: "var(--tpl-text-muted)" }
3756
- }, Hn = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Un = ["onClick"], Wn = { class: "tpl:flex tpl:gap-3" }, Gn = { class: "tpl:flex-1" }, Kn = {
3768
+ }, Un = { class: "tpl:flex tpl:flex-wrap tpl:gap-1.5" }, Wn = ["onClick"], Gn = { class: "tpl:flex tpl:gap-3" }, Kn = { class: "tpl:flex-1" }, qn = {
3757
3769
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3758
3770
  style: { color: "var(--tpl-text-muted)" }
3759
- }, qn = {
3771
+ }, Jn = {
3760
3772
  class: "tpl:font-normal",
3761
3773
  style: { color: "var(--tpl-text-dim)" }
3762
- }, Jn = { class: "tpl:relative" }, Yn = ["value", "placeholder"], Xn = {
3774
+ }, Yn = { class: "tpl:relative" }, Xn = ["value", "placeholder"], Zn = {
3763
3775
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
3764
3776
  style: { color: "var(--tpl-text-dim)" }
3765
- }, Zn = { class: "tpl:flex-1" }, Qn = {
3777
+ }, Qn = { class: "tpl:flex-1" }, $n = {
3766
3778
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3767
3779
  style: { color: "var(--tpl-text-muted)" }
3768
- }, $n = {
3780
+ }, er = {
3769
3781
  class: "tpl:font-normal",
3770
3782
  style: { color: "var(--tpl-text-dim)" }
3771
- }, er = { class: "tpl:relative" }, tr = ["value", "placeholder"], nr = {
3783
+ }, tr = { class: "tpl:relative" }, nr = ["value", "placeholder"], rr = {
3772
3784
  class: "tpl:absolute tpl:top-1/2 tpl:right-2.5 tpl:-translate-y-1/2 tpl:text-xs",
3773
3785
  style: { color: "var(--tpl-text-dim)" }
3774
- }, rr = {
3786
+ }, ir = {
3775
3787
  key: 0,
3776
3788
  class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
3777
3789
  style: { color: "var(--tpl-text-muted)" }
3778
- }, ir = {
3790
+ }, ar = {
3779
3791
  class: "tpl:font-medium",
3780
3792
  style: { color: "var(--tpl-text)" }
3781
- }, ar = { class: "tpl:mb-3" }, or = {
3793
+ }, or = { class: "tpl:mb-3" }, sr = {
3782
3794
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3783
3795
  style: { color: "var(--tpl-text-muted)" }
3784
- }, sr = ["autofocus"], cr = {
3796
+ }, cr = ["autofocus"], lr = {
3785
3797
  key: 1,
3786
3798
  class: "tpl:mb-4"
3787
- }, lr = {
3799
+ }, ur = {
3788
3800
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
3789
3801
  style: { color: "var(--tpl-text-muted)" }
3790
- }, ur = ["placeholder"], dr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, fr = ["disabled"], pr = /*@__PURE__*/ m({
3802
+ }, dr = ["placeholder"], fr = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2 tpl:p-5 tpl:pt-4" }, pr = ["disabled"], mr = /*@__PURE__*/ m({
3791
3803
  __name: "MediaEditModal",
3792
3804
  props: {
3793
3805
  visible: { type: Boolean },
@@ -3795,54 +3807,54 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3795
3807
  },
3796
3808
  emits: ["save", "close"],
3797
3809
  setup(n, { emit: o }) {
3798
- let c = n, d = o, { t: f } = Ae(), m = l("tplUiTheme"), g = l(Ve, e(null)), _ = f.mediaLibrary, { isImageMimeType: v } = Fe(), y = e(""), x = e(""), C = e(null), w = e("free"), T = e(void 0), E = e(void 0), D = e(""), O = e(""), te = e(void 0), ne = e(null), re = e(!1), ie = e(!1), ae = e(!1), oe = a(() => c.item ? [
3810
+ let c = n, d = o, { t: f } = Ae(), m = l("tplUiTheme"), g = l(Ie, e(null)), _ = f.mediaLibrary, { isImageMimeType: v } = Le(), y = e(""), x = e(""), C = e(null), w = e("free"), ee = e(void 0), T = e(void 0), E = e(""), D = e(""), ne = e(void 0), re = e(null), ie = e(!1), k = e(!1), ae = e(!1), oe = a(() => c.item ? [
3799
3811
  "image/jpeg",
3800
3812
  "image/png",
3801
3813
  "image/webp",
3802
3814
  "image/gif"
3803
- ].includes(c.item.mime_type) : !1), se = a(() => w.value === "original" ? te.value : Ie[w.value]), ce = a(() => ne.value ? Be(ne.value.width, ne.value.height, T.value, E.value) : null);
3815
+ ].includes(c.item.mime_type) : !1), se = a(() => w.value === "original" ? ne.value : Re[w.value]), ce = a(() => re.value ? He(re.value.width, re.value.height, ee.value, T.value) : null);
3804
3816
  s(() => c.visible, (e) => {
3805
- e && c.item && (y.value = c.item.filename, x.value = c.item.alt_text || "", w.value = "free", T.value = void 0, E.value = void 0, D.value = "", O.value = "", te.value = void 0, ne.value = null, re.value = !1, ae.value = !1, c.item.width && c.item.height && (te.value = c.item.width / c.item.height));
3817
+ e && c.item && (y.value = c.item.filename, x.value = c.item.alt_text || "", w.value = "free", ee.value = void 0, T.value = void 0, E.value = "", D.value = "", ne.value = void 0, re.value = null, ie.value = !1, ae.value = !1, c.item.width && c.item.height && (ne.value = c.item.width / c.item.height));
3806
3818
  });
3807
3819
  function le(e) {
3808
- e.coordinates && (ne.value = {
3820
+ e.coordinates && (re.value = {
3809
3821
  width: Math.round(e.coordinates.width),
3810
3822
  height: Math.round(e.coordinates.height)
3811
3823
  }, ae.value = !0);
3812
3824
  }
3813
3825
  function ue() {
3814
- re.value = !0, !te.value && c.item?.width && c.item?.height && (te.value = c.item.width / c.item.height);
3826
+ ie.value = !0, !ne.value && c.item?.width && c.item?.height && (ne.value = c.item.width / c.item.height);
3815
3827
  }
3816
3828
  function de(e) {
3817
3829
  let t = e.target.value;
3818
- D.value = t, T.value = t && parseInt(t, 10) || void 0;
3830
+ E.value = t, ee.value = t && parseInt(t, 10) || void 0;
3819
3831
  }
3820
3832
  function fe(e) {
3821
3833
  let t = e.target.value;
3822
- O.value = t, E.value = t && parseInt(t, 10) || void 0;
3834
+ D.value = t, T.value = t && parseInt(t, 10) || void 0;
3823
3835
  }
3824
3836
  async function pe() {
3825
3837
  let e = y.value.trim();
3826
- if (!e || !c.item || ie.value) return;
3838
+ if (!e || !c.item || k.value) return;
3827
3839
  let t = v(c.item.mime_type), n;
3828
3840
  if (oe.value && C.value && ae.value) {
3829
- ie.value = !0;
3841
+ k.value = !0;
3830
3842
  try {
3831
3843
  let { canvas: e } = C.value.getResult();
3832
3844
  if (e) {
3833
- let t = Re(e, T.value, E.value), r = Le(c.item.mime_type);
3834
- n = { file: await ze(t, c.item.filename, r) };
3845
+ let t = Be(e, ee.value, T.value), r = ze(c.item.mime_type);
3846
+ n = { file: await Ve(t, c.item.filename, r) };
3835
3847
  }
3836
3848
  } catch {
3837
- ie.value = !1;
3849
+ k.value = !1;
3838
3850
  return;
3839
3851
  }
3840
- ie.value = !1;
3852
+ k.value = !1;
3841
3853
  }
3842
3854
  d("save", c.item.id, e, t ? x.value : void 0, n), d("close");
3843
3855
  }
3844
3856
  function me(e) {
3845
- e.key === "Enter" && !ie.value && (e.preventDefault(), pe()), e.key === "Escape" && d("close");
3857
+ e.key === "Enter" && !k.value && (e.preventDefault(), pe()), e.key === "Escape" && d("close");
3846
3858
  }
3847
3859
  return (e, a) => (z(), h(b, { to: A(g) || "body" }, [p(ve, {
3848
3860
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
@@ -3860,12 +3872,12 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3860
3872
  onClick: a[3] ||= r((e) => d("close"), ["self"]),
3861
3873
  onKeydown: me
3862
3874
  }, [i("div", {
3863
- class: k(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", oe.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
3875
+ class: O(["tpl:mx-4 tpl:flex tpl:max-h-[90vh] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-lg tpl:shadow-xl", oe.value ? "tpl:max-w-2xl" : "tpl:max-w-sm"]),
3864
3876
  style: { "background-color": "var(--tpl-bg-elevated)" }
3865
3877
  }, [
3866
- i("div", Fn, [i("h3", In, I(A(f).mediaLibrary.editFile), 1)]),
3867
- i("div", Ln, [
3868
- oe.value ? (z(), t("div", Rn, [i("div", zn, [p(A(jn), {
3878
+ i("div", In, [i("h3", Ln, I(A(f).mediaLibrary.editFile), 1)]),
3879
+ i("div", Rn, [
3880
+ oe.value ? (z(), t("div", zn, [i("div", Bn, [p(A(Mn), {
3869
3881
  ref_key: "cropperRef",
3870
3882
  ref: C,
3871
3883
  src: n.item.url,
@@ -3874,8 +3886,8 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3874
3886
  "background-class": "tpl-cropper-background",
3875
3887
  onChange: le,
3876
3888
  onReady: ue
3877
- }, null, 8, ["src", "stencil-props"])]), i("div", Bn, [
3878
- i("div", null, [i("label", Vn, I(A(f).mediaLibrary.cropAspectRatio), 1), i("div", Hn, [(z(), t(R, null, S([
3889
+ }, null, 8, ["src", "stencil-props"])]), i("div", Vn, [
3890
+ i("div", null, [i("label", Hn, I(A(f).mediaLibrary.cropAspectRatio), 1), i("div", Un, [(z(), t(R, null, S([
3879
3891
  "free",
3880
3892
  "square",
3881
3893
  "landscape43",
@@ -3891,9 +3903,9 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3891
3903
  color: w.value === e ? "var(--tpl-primary)" : "var(--tpl-text)"
3892
3904
  }),
3893
3905
  onClick: (t) => w.value = e
3894
- }, I(A(_)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Un)), 64))])]),
3895
- i("div", Wn, [i("div", Gn, [i("label", Kn, [j(I(A(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", qn, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", Jn, [i("input", {
3896
- value: D.value,
3906
+ }, I(A(_)[`crop${e.charAt(0).toUpperCase()}${e.slice(1)}`]), 13, Wn)), 64))])]),
3907
+ i("div", Gn, [i("div", Kn, [i("label", qn, [j(I(A(f).mediaLibrary.cropMaxWidth) + " ", 1), i("span", Jn, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", Yn, [i("input", {
3908
+ value: E.value,
3897
3909
  type: "number",
3898
3910
  min: "1",
3899
3911
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -3902,10 +3914,10 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3902
3914
  "background-color": "var(--tpl-bg)",
3903
3915
  color: "var(--tpl-text)"
3904
3916
  },
3905
- placeholder: ne.value?.width?.toString() || "",
3917
+ placeholder: re.value?.width?.toString() || "",
3906
3918
  onInput: de
3907
- }, null, 40, Yn), i("span", Xn, I(A(f).mediaLibrary.cropPixels), 1)])]), i("div", Zn, [i("label", Qn, [j(I(A(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", $n, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", er, [i("input", {
3908
- value: O.value,
3919
+ }, null, 40, Xn), i("span", Zn, I(A(f).mediaLibrary.cropPixels), 1)])]), i("div", Qn, [i("label", $n, [j(I(A(f).mediaLibrary.cropMaxHeight) + " ", 1), i("span", er, I(A(f).mediaLibrary.cropOptional), 1)]), i("div", tr, [i("input", {
3920
+ value: D.value,
3909
3921
  type: "number",
3910
3922
  min: "1",
3911
3923
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-8 tpl:pl-3 tpl:text-xs tpl:outline-none",
@@ -3914,12 +3926,12 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3914
3926
  "background-color": "var(--tpl-bg)",
3915
3927
  color: "var(--tpl-text)"
3916
3928
  },
3917
- placeholder: ne.value?.height?.toString() || "",
3929
+ placeholder: re.value?.height?.toString() || "",
3918
3930
  onInput: fe
3919
- }, null, 40, tr), i("span", nr, I(A(f).mediaLibrary.cropPixels), 1)])])]),
3920
- ce.value ? (z(), t("div", rr, [i("span", null, I(A(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", ir, I(ce.value.width) + " x " + I(ce.value.height) + " " + I(A(f).mediaLibrary.cropPixels), 1)])) : M("", !0)
3931
+ }, null, 40, nr), i("span", rr, I(A(f).mediaLibrary.cropPixels), 1)])])]),
3932
+ ce.value ? (z(), t("div", ir, [i("span", null, I(A(f).mediaLibrary.cropOutputSize) + ": ", 1), i("span", ar, I(ce.value.width) + " x " + I(ce.value.height) + " " + I(A(f).mediaLibrary.cropPixels), 1)])) : M("", !0)
3921
3933
  ])])) : M("", !0),
3922
- i("div", ar, [i("label", or, I(A(f).mediaLibrary.fileName), 1), u(i("input", {
3934
+ i("div", or, [i("label", sr, I(A(f).mediaLibrary.fileName), 1), u(i("input", {
3923
3935
  "onUpdate:modelValue": a[0] ||= (e) => y.value = e,
3924
3936
  type: "text",
3925
3937
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -3929,8 +3941,8 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3929
3941
  color: "var(--tpl-text)"
3930
3942
  },
3931
3943
  autofocus: !oe.value
3932
- }, null, 8, sr), [[ee, y.value]])]),
3933
- A(v)(n.item.mime_type) ? (z(), t("div", cr, [i("label", lr, I(A(f).mediaLibrary.altText), 1), u(i("input", {
3944
+ }, null, 8, cr), [[te, y.value]])]),
3945
+ A(v)(n.item.mime_type) ? (z(), t("div", lr, [i("label", ur, I(A(f).mediaLibrary.altText), 1), u(i("input", {
3934
3946
  "onUpdate:modelValue": a[1] ||= (e) => x.value = e,
3935
3947
  type: "text",
3936
3948
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -3940,9 +3952,9 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3940
3952
  color: "var(--tpl-text)"
3941
3953
  },
3942
3954
  placeholder: A(f).mediaLibrary.altTextPlaceholder
3943
- }, null, 8, ur), [[ee, x.value]])])) : M("", !0)
3955
+ }, null, 8, dr), [[te, x.value]])])) : M("", !0)
3944
3956
  ]),
3945
- i("div", dr, [i("button", {
3957
+ i("div", fr, [i("button", {
3946
3958
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
3947
3959
  style: {
3948
3960
  "border-color": "var(--tpl-border)",
@@ -3953,27 +3965,27 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3953
3965
  }, I(A(f).mediaLibrary.cancel), 1), i("button", {
3954
3966
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
3955
3967
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
3956
- disabled: ie.value,
3968
+ disabled: k.value,
3957
3969
  onClick: pe
3958
- }, I(ie.value ? A(f).mediaLibrary.saving : A(f).mediaLibrary.saveChanges), 9, fr)])
3959
- ], 2)], 40, Pn)) : M("", !0)]),
3970
+ }, I(k.value ? A(f).mediaLibrary.saving : A(f).mediaLibrary.saveChanges), 9, pr)])
3971
+ ], 2)], 40, Fn)) : M("", !0)]),
3960
3972
  _: 1
3961
3973
  })], 8, ["to"]));
3962
3974
  }
3963
- }), mr = (e, t) => {
3975
+ }), hr = (e, t) => {
3964
3976
  let n = e.__vccOpts || e;
3965
3977
  for (let [e, r] of t) n[e] = r;
3966
3978
  return n;
3967
- }, hr = /*#__PURE__*/ mr(pr, [["__scopeId", "data-v-6b677237"]]), gr = {
3979
+ }, gr = /*#__PURE__*/ hr(mr, [["__scopeId", "data-v-6b677237"]]), _r = {
3968
3980
  key: 1,
3969
3981
  class: "tpl:size-4 tpl:shrink-0"
3970
- }, _r = {
3982
+ }, vr = {
3971
3983
  key: 0,
3972
3984
  class: "tpl:truncate"
3973
- }, vr = {
3985
+ }, yr = {
3974
3986
  key: 3,
3975
3987
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
3976
- }, yr = ["title"], br = ["title"], xr = { key: 0 }, Sr = ["placeholder"], Cr = /* @__PURE__ */ m({
3988
+ }, br = ["title"], xr = ["title"], Sr = { key: 0 }, Cr = ["placeholder"], wr = /* @__PURE__ */ m({
3977
3989
  __name: "MediaFolderTreeNode",
3978
3990
  props: {
3979
3991
  folder: {},
@@ -3987,28 +3999,28 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
3987
3999
  "deleteFolder"
3988
4000
  ],
3989
4001
  setup(n, { emit: o }) {
3990
- let s = n, c = o, { t: l } = Ae(), d = e(!1), f = e(!1), m = e(""), g = e(!1), _ = e(""), v = a(() => (s.folder.children?.length ?? 0) > 0), b = a(() => s.depth < 4), C = a(() => s.currentFolderId === s.folder.id), w = a(() => !s.currentFolderId || !s.folder.children ? !1 : E(s.folder.children, s.currentFolderId)), T = a(() => d.value || w.value);
3991
- function E(e, t) {
3992
- for (let n of e) if (n.id === t || n.children && E(n.children, t)) return !0;
4002
+ let s = n, c = o, { t: l } = Ae(), d = e(!1), f = e(!1), m = e(""), g = e(!1), _ = e(""), v = a(() => (s.folder.children?.length ?? 0) > 0), b = a(() => s.depth < 4), C = a(() => s.currentFolderId === s.folder.id), w = a(() => !s.currentFolderId || !s.folder.children ? !1 : T(s.folder.children, s.currentFolderId)), ee = a(() => d.value || w.value);
4003
+ function T(e, t) {
4004
+ for (let n of e) if (n.id === t || n.children && T(n.children, t)) return !0;
3993
4005
  return !1;
3994
4006
  }
3995
- function D() {
4007
+ function E() {
3996
4008
  d.value = !d.value;
3997
4009
  }
3998
- function O() {
4010
+ function D() {
3999
4011
  f.value = !0, m.value = s.folder.name;
4000
4012
  }
4001
- function te() {
4013
+ function ne() {
4002
4014
  let e = m.value.trim();
4003
4015
  e && e !== s.folder.name && c("renameFolder", s.folder.id, e), f.value = !1, m.value = "";
4004
4016
  }
4005
- function ne() {
4017
+ function re() {
4006
4018
  f.value = !1, m.value = "";
4007
4019
  }
4008
- function re() {
4020
+ function ie() {
4009
4021
  g.value = !0, _.value = "", d.value = !0;
4010
4022
  }
4011
- function ie() {
4023
+ function k() {
4012
4024
  _.value.trim() && c("createFolder", _.value.trim(), s.folder.id), g.value = !1, _.value = "";
4013
4025
  }
4014
4026
  function oe() {
@@ -4027,12 +4039,12 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4027
4039
  v.value || g.value ? (z(), t("button", {
4028
4040
  key: 0,
4029
4041
  class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4030
- onClick: r(D, ["stop"])
4042
+ onClick: r(E, ["stop"])
4031
4043
  }, [p(A(ae), {
4032
- class: k(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": T.value }]),
4044
+ class: O(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": ee.value }]),
4033
4045
  size: 10,
4034
4046
  "stroke-width": 2
4035
- }, null, 8, ["class"])])) : (z(), t("span", gr)),
4047
+ }, null, 8, ["class"])])) : (z(), t("span", _r)),
4036
4048
  i("button", {
4037
4049
  class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
4038
4050
  onClick: a[0] ||= (e) => c("navigate", n.folder.id)
@@ -4040,7 +4052,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4040
4052
  class: "tpl:shrink-0",
4041
4053
  size: 14,
4042
4054
  "stroke-width": 1.5
4043
- }), f.value ? M("", !0) : (z(), t("span", _r, I(n.folder.name), 1))]),
4055
+ }), f.value ? M("", !0) : (z(), t("span", vr, I(n.folder.name), 1))]),
4044
4056
  f.value ? u((z(), t("input", {
4045
4057
  key: 2,
4046
4058
  "onUpdate:modelValue": a[1] ||= (e) => m.value = e,
@@ -4052,28 +4064,28 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4052
4064
  color: "var(--tpl-text)"
4053
4065
  },
4054
4066
  autofocus: "",
4055
- onKeydown: [y(te, ["enter"]), y(ne, ["escape"])],
4056
- onBlur: te,
4067
+ onKeydown: [y(ne, ["enter"]), y(re, ["escape"])],
4068
+ onBlur: ne,
4057
4069
  onClick: a[2] ||= r(() => {}, ["stop"])
4058
- }, null, 544)), [[ee, m.value]]) : M("", !0),
4059
- f.value ? M("", !0) : (z(), t("span", vr, [
4070
+ }, null, 544)), [[te, m.value]]) : M("", !0),
4071
+ f.value ? M("", !0) : (z(), t("span", yr, [
4060
4072
  b.value ? (z(), t("button", {
4061
4073
  key: 0,
4062
4074
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4063
4075
  title: A(l).mediaLibrary.addSubfolder,
4064
- onClick: r(re, ["stop"])
4076
+ onClick: r(ie, ["stop"])
4065
4077
  }, [p(A(fe), {
4066
4078
  size: 12,
4067
4079
  "stroke-width": 2
4068
- })], 8, yr)) : M("", !0),
4080
+ })], 8, br)) : M("", !0),
4069
4081
  i("button", {
4070
4082
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4071
4083
  title: A(l).mediaLibrary.renameFolder,
4072
- onClick: r(O, ["stop"])
4084
+ onClick: r(D, ["stop"])
4073
4085
  }, [p(A(he), {
4074
4086
  size: 12,
4075
4087
  "stroke-width": 2
4076
- })], 8, br),
4088
+ })], 8, xr),
4077
4089
  i("button", {
4078
4090
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
4079
4091
  onClick: a[3] ||= r((e) => c("deleteFolder", n.folder.id), ["stop"])
@@ -4083,7 +4095,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4083
4095
  style: { color: "var(--tpl-danger)" }
4084
4096
  })])
4085
4097
  ]))
4086
- ], 4), T.value ? (z(), t("div", xr, [(z(!0), t(R, null, S(n.folder.children, (e) => (z(), h(o, {
4098
+ ], 4), ee.value ? (z(), t("div", Sr, [(z(!0), t(R, null, S(n.folder.children, (e) => (z(), h(o, {
4087
4099
  key: e.id,
4088
4100
  folder: e,
4089
4101
  "current-folder-id": n.currentFolderId,
@@ -4111,15 +4123,15 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4111
4123
  },
4112
4124
  placeholder: A(l).mediaLibrary.subfolderName,
4113
4125
  autofocus: "",
4114
- onKeydown: [y(ie, ["enter"]), y(oe, ["escape"])],
4115
- onBlur: ie
4116
- }, null, 40, Sr), [[ee, _.value]])], 4)) : M("", !0)])) : M("", !0)]);
4126
+ onKeydown: [y(k, ["enter"]), y(oe, ["escape"])],
4127
+ onBlur: k
4128
+ }, null, 40, Cr), [[te, _.value]])], 4)) : M("", !0)])) : M("", !0)]);
4117
4129
  };
4118
4130
  }
4119
- }), wr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Tr = {
4131
+ }), Tr = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, Er = {
4120
4132
  key: 0,
4121
4133
  class: "tpl:px-3 tpl:py-2"
4122
- }, Er = ["placeholder"], Dr = /* @__PURE__ */ m({
4134
+ }, Dr = ["placeholder"], Or = /* @__PURE__ */ m({
4123
4135
  __name: "MediaFolderTree",
4124
4136
  props: {
4125
4137
  folders: {},
@@ -4145,7 +4157,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4145
4157
  function f() {
4146
4158
  s.value = !1, c.value = "";
4147
4159
  }
4148
- return (e, r) => (z(), t("div", wr, [
4160
+ return (e, r) => (z(), t("div", Tr, [
4149
4161
  i("button", {
4150
4162
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
4151
4163
  style: N({
@@ -4157,7 +4169,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4157
4169
  size: 14,
4158
4170
  "stroke-width": 1.5
4159
4171
  }), j(" " + I(A(o).mediaLibrary.allFiles), 1)], 4),
4160
- (z(!0), t(R, null, S(n.folders, (e) => (z(), h(Cr, {
4172
+ (z(!0), t(R, null, S(n.folders, (e) => (z(), h(wr, {
4161
4173
  key: e.id,
4162
4174
  folder: e,
4163
4175
  "current-folder-id": n.currentFolderId,
@@ -4167,7 +4179,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4167
4179
  onRenameFolder: r[3] ||= (e, t) => a("renameFolder", e, t),
4168
4180
  onDeleteFolder: r[4] ||= (e) => a("deleteFolder", e)
4169
4181
  }, null, 8, ["folder", "current-folder-id"]))), 128)),
4170
- s.value ? (z(), t("div", Tr, [u(i("input", {
4182
+ s.value ? (z(), t("div", Er, [u(i("input", {
4171
4183
  "onUpdate:modelValue": r[5] ||= (e) => c.value = e,
4172
4184
  type: "text",
4173
4185
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -4180,7 +4192,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4180
4192
  autofocus: "",
4181
4193
  onKeydown: [y(d, ["enter"]), y(f, ["escape"])],
4182
4194
  onBlur: d
4183
- }, null, 40, Er), [[ee, c.value]])])) : M("", !0),
4195
+ }, null, 40, Dr), [[te, c.value]])])) : M("", !0),
4184
4196
  s.value ? M("", !0) : (z(), t("button", {
4185
4197
  key: 1,
4186
4198
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
@@ -4206,7 +4218,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4206
4218
  }), j(" " + I(A(o).mediaLibrary.frequentlyUsed), 1)], 4)) : M("", !0)
4207
4219
  ]));
4208
4220
  }
4209
- }), Or = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, kr = /* @__PURE__ */ m({
4221
+ }), kr = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, Ar = /* @__PURE__ */ m({
4210
4222
  __name: "MediaFileIcon",
4211
4223
  props: { mimeType: {} },
4212
4224
  setup(e) {
@@ -4307,7 +4319,7 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4307
4319
  bgColor: "#f9fafb",
4308
4320
  icon: "document"
4309
4321
  }, s = a(() => r[n.mimeType] ?? o);
4310
- return (e, n) => (z(), t("div", Or, [s.value.icon === "document" ? (z(), t("svg", {
4322
+ return (e, n) => (z(), t("div", kr, [s.value.icon === "document" ? (z(), t("svg", {
4311
4323
  key: 0,
4312
4324
  width: "60",
4313
4325
  height: "60",
@@ -4379,10 +4391,10 @@ var Pn = ["data-tpl-theme"], Fn = { class: "tpl:shrink-0 tpl:p-5 tpl:pb-4" }, In
4379
4391
  });
4380
4392
  //#endregion
4381
4393
  //#region ../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
4382
- function Ar(e, t) {
4383
- return T() ? (E(e, t), !0) : !1;
4394
+ function jr(e, t) {
4395
+ return ee() ? (T(e, t), !0) : !1;
4384
4396
  }
4385
- function jr() {
4397
+ function Mr() {
4386
4398
  let e = /* @__PURE__ */ new Set(), t = (t) => {
4387
4399
  e.delete(t);
4388
4400
  };
@@ -4390,7 +4402,7 @@ function jr() {
4390
4402
  on: (n) => {
4391
4403
  e.add(n);
4392
4404
  let r = () => t(n);
4393
- return Ar(r), { off: r };
4405
+ return jr(r), { off: r };
4394
4406
  },
4395
4407
  off: t,
4396
4408
  trigger: (...t) => Promise.all(Array.from(e).map((e) => e(...t))),
@@ -4399,14 +4411,14 @@ function jr() {
4399
4411
  }
4400
4412
  };
4401
4413
  }
4402
- var Mr = typeof window < "u" && typeof document < "u";
4414
+ var Nr = typeof window < "u" && typeof document < "u";
4403
4415
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4404
- var Nr = (e) => e != null, Pr = Object.prototype.toString, Fr = (e) => Pr.call(e) === "[object Object]", $ = () => {}, Ir = (e, t) => Object.hasOwn(e, t), Lr = /* #__PURE__ */ Rr();
4405
- function Rr() {
4416
+ var Pr = (e) => e != null, Fr = Object.prototype.toString, Ir = (e) => Fr.call(e) === "[object Object]", $ = () => {}, Lr = (e, t) => Object.hasOwn(e, t), Rr = /* #__PURE__ */ zr();
4417
+ function zr() {
4406
4418
  var e, t;
4407
- return Mr && !!((e = window) != null && (e = e.navigator) != null && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
4419
+ return Nr && !!((e = window) != null && (e = e.navigator) != null && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
4408
4420
  }
4409
- function zr(e, t) {
4421
+ function Br(e, t) {
4410
4422
  function n(...n) {
4411
4423
  return new Promise((r, i) => {
4412
4424
  Promise.resolve(e(() => t.apply(this, n), {
@@ -4422,7 +4434,7 @@ function zr(e, t) {
4422
4434
  isPending: e.isPending
4423
4435
  }), n;
4424
4436
  }
4425
- function Br(e, t = {}) {
4437
+ function Vr(e, t = {}) {
4426
4438
  let n, r, i = $, a = $, o = L(!1), s = (e) => {
4427
4439
  clearTimeout(e), i(), i = $;
4428
4440
  }, c;
@@ -4446,10 +4458,10 @@ function Br(e, t = {}) {
4446
4458
  i = $, a = $, e(c());
4447
4459
  }
4448
4460
  },
4449
- isPending: re(o)
4461
+ isPending: ie(o)
4450
4462
  });
4451
4463
  }
4452
- function Vr(e) {
4464
+ function Hr(e) {
4453
4465
  let t;
4454
4466
  function n() {
4455
4467
  return t ||= e(), t;
@@ -4459,13 +4471,13 @@ function Vr(e) {
4459
4471
  t = void 0, e && await e;
4460
4472
  }, n;
4461
4473
  }
4462
- function Hr(e) {
4474
+ function Ur(e) {
4463
4475
  return Array.isArray(e) ? e : [e];
4464
4476
  }
4465
- function Ur(e, t = 200, n = {}) {
4466
- return zr(Br(t, n), e);
4477
+ function Wr(e, t = 200, n = {}) {
4478
+ return Br(Vr(t, n), e);
4467
4479
  }
4468
- function Wr(e, t, n = {}) {
4480
+ function Gr(e, t, n = {}) {
4469
4481
  let { immediate: r = !0, immediateCallback: i = !1 } = n, a = L(!1), o;
4470
4482
  function s() {
4471
4483
  o &&= (clearTimeout(o), void 0);
@@ -4478,13 +4490,13 @@ function Wr(e, t, n = {}) {
4478
4490
  a.value = !1, o = void 0, e(...n);
4479
4491
  }, F(t));
4480
4492
  }
4481
- return r && (a.value = !0, Mr && l()), Ar(c), {
4482
- isPending: re(a),
4493
+ return r && (a.value = !0, Nr && l()), jr(c), {
4494
+ isPending: ie(a),
4483
4495
  start: l,
4484
4496
  stop: c
4485
4497
  };
4486
4498
  }
4487
- function Gr(e, t, n) {
4499
+ function Kr(e, t, n) {
4488
4500
  return s(e, t, {
4489
4501
  ...n,
4490
4502
  immediate: !0
@@ -4492,46 +4504,46 @@ function Gr(e, t, n) {
4492
4504
  }
4493
4505
  //#endregion
4494
4506
  //#region ../../node_modules/.pnpm/@vueuse+core@14.4.0_vue@3.5.41_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
4495
- var Kr = Mr ? window : void 0, qr = Mr ? window.document : void 0, Jr = Mr ? window.navigator : void 0;
4496
- function Yr(e) {
4507
+ var qr = Nr ? window : void 0, Jr = Nr ? window.document : void 0, Yr = Nr ? window.navigator : void 0;
4508
+ function Xr(e) {
4497
4509
  let t = F(e);
4498
4510
  return t?.$el ?? t;
4499
4511
  }
4500
- function Xr(...e) {
4512
+ function Zr(...e) {
4501
4513
  let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = a(() => {
4502
- let t = Hr(F(e[0])).filter((e) => e != null);
4514
+ let t = Ur(F(e[0])).filter((e) => e != null);
4503
4515
  return t.every((e) => typeof e != "string") ? t : void 0;
4504
4516
  });
4505
- return Gr(() => [
4506
- n.value?.map((e) => Yr(e)) ?? [Kr].filter((e) => e != null),
4507
- Hr(F(n.value ? e[1] : e[0])),
4508
- Hr(A(n.value ? e[2] : e[1])),
4517
+ return Kr(() => [
4518
+ n.value?.map((e) => Xr(e)) ?? [qr].filter((e) => e != null),
4519
+ Ur(F(n.value ? e[1] : e[0])),
4520
+ Ur(A(n.value ? e[2] : e[1])),
4509
4521
  F(n.value ? e[3] : e[2])
4510
4522
  ], ([e, n, r, i], a, o) => {
4511
4523
  if (!e?.length || !n?.length || !r?.length) return;
4512
- let s = Fr(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
4524
+ let s = Ir(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
4513
4525
  o(() => {
4514
4526
  c.forEach((e) => e());
4515
4527
  });
4516
4528
  }, { flush: "post" });
4517
4529
  }
4518
- var Zr = !1;
4519
- function Qr(e, t, n = {}) {
4520
- let { window: r = Kr, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
4530
+ var Qr = !1;
4531
+ function $r(e, t, n = {}) {
4532
+ let { window: r = qr, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
4521
4533
  if (!r) return s ? {
4522
4534
  stop: $,
4523
4535
  cancel: $,
4524
4536
  trigger: $
4525
4537
  } : $;
4526
- if (Lr && !Zr) {
4527
- Zr = !0;
4538
+ if (Rr && !Qr) {
4539
+ Qr = !0;
4528
4540
  let e = { passive: !0 };
4529
4541
  Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", $, e)), r.document.documentElement.addEventListener("click", $, e);
4530
4542
  }
4531
4543
  let c = !0, l = (e) => F(i).some((t) => {
4532
4544
  if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
4533
4545
  {
4534
- let n = Yr(t);
4546
+ let n = Xr(t);
4535
4547
  return n && (e.target === n || e.composedPath().includes(n));
4536
4548
  }
4537
4549
  });
@@ -4544,7 +4556,7 @@ function Qr(e, t, n = {}) {
4544
4556
  return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
4545
4557
  }
4546
4558
  let f = (n) => {
4547
- let r = Yr(e);
4559
+ let r = Xr(e);
4548
4560
  if (n.target != null && !(!(r instanceof Element) && u(e) && d(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
4549
4561
  if ("detail" in n && n.detail === 0 && (c = !l(n)), !c) {
4550
4562
  c = !0;
@@ -4553,7 +4565,7 @@ function Qr(e, t, n = {}) {
4553
4565
  t(n);
4554
4566
  }
4555
4567
  }, p = !1, m = [
4556
- Xr(r, "click", (e) => {
4568
+ Zr(r, "click", (e) => {
4557
4569
  p || (p = !0, setTimeout(() => {
4558
4570
  p = !1;
4559
4571
  }, 0), f(e));
@@ -4561,13 +4573,13 @@ function Qr(e, t, n = {}) {
4561
4573
  passive: !0,
4562
4574
  capture: a
4563
4575
  }),
4564
- Xr(r, "pointerdown", (t) => {
4565
- let n = Yr(e);
4576
+ Zr(r, "pointerdown", (t) => {
4577
+ let n = Xr(e);
4566
4578
  c = !l(t) && !!(n && !t.composedPath().includes(n));
4567
4579
  }, { passive: !0 }),
4568
- o && Xr(r, "blur", (n) => {
4580
+ o && Zr(r, "blur", (n) => {
4569
4581
  setTimeout(() => {
4570
- let i = Yr(e), a = r.document.activeElement;
4582
+ let i = Xr(e), a = r.document.activeElement;
4571
4583
  for (; a?.shadowRoot;) a = a.shadowRoot.activeElement;
4572
4584
  a?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
4573
4585
  }, 0);
@@ -4583,22 +4595,22 @@ function Qr(e, t, n = {}) {
4583
4595
  }
4584
4596
  } : h;
4585
4597
  }
4586
- function $r() {
4598
+ function ei() {
4587
4599
  let e = L(!1), t = g();
4588
4600
  return t && v(() => {
4589
4601
  e.value = !0;
4590
4602
  }, t), e;
4591
4603
  }
4592
4604
  /* @__NO_SIDE_EFFECTS__ */
4593
- function ei(e) {
4594
- return $r(), a(() => !!e());
4605
+ function ti(e) {
4606
+ return ei(), a(() => !!e());
4595
4607
  }
4596
- function ti(e, t = {}) {
4597
- let { controls: n = !1, navigator: r = Jr } = t, i = /* @__PURE__ */ ei(() => r && "permissions" in r), a = L(), o = typeof e == "string" ? { name: e } : e, s = L(), c = () => {
4608
+ function ni(e, t = {}) {
4609
+ let { controls: n = !1, navigator: r = Yr } = t, i = /* @__PURE__ */ ti(() => r && "permissions" in r), a = L(), o = typeof e == "string" ? { name: e } : e, s = L(), c = () => {
4598
4610
  s.value = a.value?.state ?? "prompt";
4599
4611
  };
4600
- Xr(a, "change", c, { passive: !0 });
4601
- let l = Vr(async () => {
4612
+ Zr(a, "change", c, { passive: !0 });
4613
+ let l = Hr(async () => {
4602
4614
  if (i.value) {
4603
4615
  if (!a.value) try {
4604
4616
  a.value = await r.permissions.query(o);
@@ -4616,8 +4628,8 @@ function ti(e, t = {}) {
4616
4628
  query: l
4617
4629
  } : s;
4618
4630
  }
4619
- function ni(e = {}) {
4620
- let { navigator: t = Jr, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ ei(() => t && "clipboard" in t), c = ti("clipboard-read"), l = ti("clipboard-write"), u = a(() => s.value || o), d = L(""), f = L(!1), p = L(!1), m = Wr(() => f.value = !1, i, { immediate: !1 }), h = 0;
4631
+ function ri(e = {}) {
4632
+ let { navigator: t = Yr, read: n = !1, source: r, copiedDuring: i = 1500, legacy: o = !1 } = e, s = /* @__PURE__ */ ti(() => t && "clipboard" in t), c = ni("clipboard-read"), l = ni("clipboard-write"), u = a(() => s.value || o), d = L(""), f = L(!1), p = L(!1), m = Gr(() => f.value = !1, i, { immediate: !1 }), h = 0;
4621
4633
  async function g() {
4622
4634
  let e = !(s.value && x(c.value));
4623
4635
  if (!e) try {
@@ -4627,7 +4639,7 @@ function ni(e = {}) {
4627
4639
  }
4628
4640
  e && (d.value = b());
4629
4641
  }
4630
- u.value && n && Xr(["copy", "cut"], g, { passive: !0 });
4642
+ u.value && n && Zr(["copy", "cut"], g, { passive: !0 });
4631
4643
  async function _(e) {
4632
4644
  let n = e ?? F(r);
4633
4645
  if (u.value && n != null) {
@@ -4664,16 +4676,16 @@ function ni(e = {}) {
4664
4676
  return e === "granted" || e === "prompt";
4665
4677
  }
4666
4678
  return {
4667
- copyPending: re(p),
4679
+ copyPending: ie(p),
4668
4680
  isSupported: u,
4669
- text: re(d),
4670
- copied: re(f),
4681
+ text: ie(d),
4682
+ copied: ie(f),
4671
4683
  copy: _
4672
4684
  };
4673
4685
  }
4674
- function ri(e, t = {}) {
4686
+ function ii(e, t = {}) {
4675
4687
  let n = L(!1), r = L(null), i = 0, a = !0;
4676
- if (Mr) {
4688
+ if (Nr) {
4677
4689
  let o = typeof t == "function" ? { onDrop: t } : t, s = o.multiple ?? !0, c = o.preventDefaultForUnhandled ?? !1, l = (e) => {
4678
4690
  let t = Array.from(e.dataTransfer?.files ?? []);
4679
4691
  return t.length === 0 ? null : s ? t : [t[0]];
@@ -4711,23 +4723,23 @@ function ri(e, t = {}) {
4711
4723
  }
4712
4724
  }
4713
4725
  };
4714
- Xr(e, "dragenter", (e) => p(e, "enter")), Xr(e, "dragover", (e) => p(e, "over")), Xr(e, "dragleave", (e) => p(e, "leave")), Xr(e, "drop", (e) => p(e, "drop"));
4726
+ Zr(e, "dragenter", (e) => p(e, "enter")), Zr(e, "dragover", (e) => p(e, "over")), Zr(e, "dragleave", (e) => p(e, "leave")), Zr(e, "drop", (e) => p(e, "drop"));
4715
4727
  }
4716
4728
  return {
4717
4729
  files: r,
4718
4730
  isOverDropZone: n
4719
4731
  };
4720
4732
  }
4721
- function ii(e, t, n = {}) {
4722
- let { root: r, rootMargin: i, threshold: o = 0, window: c = Kr, immediate: l = !0 } = n, u = /* @__PURE__ */ ei(() => c && "IntersectionObserver" in c), d = a(() => Hr(F(e)).map(Yr).filter(Nr)), f = $, p = L(l), m = u.value ? s(() => [
4733
+ function ai(e, t, n = {}) {
4734
+ let { root: r, rootMargin: i, threshold: o = 0, window: c = qr, immediate: l = !0 } = n, u = /* @__PURE__ */ ti(() => c && "IntersectionObserver" in c), d = a(() => Ur(F(e)).map(Xr).filter(Pr)), f = $, p = L(l), m = u.value ? s(() => [
4723
4735
  d.value,
4724
- Yr(r),
4736
+ Xr(r),
4725
4737
  F(i),
4726
4738
  p.value
4727
4739
  ], ([e, n, r]) => {
4728
4740
  if (f(), !p.value || !e.length) return;
4729
4741
  let i = new IntersectionObserver(t, {
4730
- root: Yr(n),
4742
+ root: Xr(n),
4731
4743
  rootMargin: r,
4732
4744
  threshold: o
4733
4745
  });
@@ -4740,7 +4752,7 @@ function ii(e, t, n = {}) {
4740
4752
  }) : $, h = () => {
4741
4753
  f(), m(), p.value = !1;
4742
4754
  };
4743
- return Ar(h), {
4755
+ return jr(h), {
4744
4756
  isSupported: u,
4745
4757
  isActive: p,
4746
4758
  pause() {
@@ -4752,22 +4764,22 @@ function ii(e, t, n = {}) {
4752
4764
  stop: h
4753
4765
  };
4754
4766
  }
4755
- var ai = {
4767
+ var oi = {
4756
4768
  multiple: !0,
4757
4769
  accept: "*",
4758
4770
  reset: !1,
4759
4771
  directory: !1
4760
4772
  };
4761
- function oi(e) {
4773
+ function si(e) {
4762
4774
  if (!e) return null;
4763
4775
  if (e instanceof FileList) return e;
4764
4776
  let t = new DataTransfer();
4765
4777
  for (let n of e) t.items.add(n);
4766
4778
  return t.files;
4767
4779
  }
4768
- function si(t = {}) {
4769
- let { document: n = qr } = t, r = e(oi(t.initialFiles)), { on: i, trigger: o } = jr(), { on: s, trigger: c } = jr(), l = a(() => {
4770
- let e = Yr(t.input) ?? (n ? n.createElement("input") : void 0);
4780
+ function ci(t = {}) {
4781
+ let { document: n = Jr } = t, r = e(si(t.initialFiles)), { on: i, trigger: o } = Mr(), { on: s, trigger: c } = Mr(), l = a(() => {
4782
+ let e = Xr(t.input) ?? (n ? n.createElement("input") : void 0);
4771
4783
  return e && (e.type = "file", e.onchange = (e) => {
4772
4784
  r.value = e.target.files, o(r.value);
4773
4785
  }, e.oncancel = () => {
@@ -4777,7 +4789,7 @@ function si(t = {}) {
4777
4789
  r.value = null, l.value && l.value.value && (l.value.value = "", o(null));
4778
4790
  }, f = (e) => {
4779
4791
  let t = l.value;
4780
- t && (t.multiple = F(e.multiple), t.accept = F(e.accept), t.webkitdirectory = F(e.directory), Ir(e, "capture") && (t.capture = F(e.capture)));
4792
+ t && (t.multiple = F(e.multiple), t.accept = F(e.accept), t.webkitdirectory = F(e.directory), Lr(e, "capture") && (t.capture = F(e.capture)));
4781
4793
  };
4782
4794
  return d(() => {
4783
4795
  f(t);
@@ -4787,7 +4799,7 @@ function si(t = {}) {
4787
4799
  let n = l.value;
4788
4800
  if (!n) return;
4789
4801
  let r = {
4790
- ...ai,
4802
+ ...oi,
4791
4803
  ...t,
4792
4804
  ...e
4793
4805
  };
@@ -4800,48 +4812,48 @@ function si(t = {}) {
4800
4812
  }
4801
4813
  //#endregion
4802
4814
  //#region src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
4803
- var ci = { class: "tpl:p-4" }, li = {
4815
+ var li = { class: "tpl:p-4" }, ui = {
4804
4816
  key: 1,
4805
4817
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
4806
- }, ui = {
4818
+ }, di = {
4807
4819
  class: "tpl:text-xs",
4808
4820
  style: { color: "var(--tpl-text-muted)" }
4809
- }, di = {
4821
+ }, fi = {
4810
4822
  key: 2,
4811
4823
  class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
4812
- }, fi = ["onClick"], pi = { class: "tpl:aspect-square" }, mi = ["src", "alt"], hi = { class: "tpl:px-2 tpl:py-1.5" }, gi = {
4824
+ }, pi = ["onClick"], mi = { class: "tpl:aspect-square" }, hi = ["src", "alt"], gi = { class: "tpl:px-2 tpl:py-1.5" }, _i = {
4813
4825
  class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
4814
4826
  style: { color: "var(--tpl-text)" }
4815
- }, _i = {
4827
+ }, vi = {
4816
4828
  class: "tpl:flex tpl:justify-between tpl:text-[9px]",
4817
4829
  style: { color: "var(--tpl-text-muted)" }
4818
- }, vi = { key: 0 }, yi = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, bi = ["title", "onClick"], xi = ["title", "onClick"], Si = {
4830
+ }, yi = { key: 0 }, bi = { class: "tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, xi = ["title", "onClick"], Si = ["title", "onClick"], Ci = {
4819
4831
  key: 0,
4820
4832
  class: "tpl:absolute tpl:top-1.5 tpl:right-1.5 tpl:flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4821
4833
  style: { "background-color": "var(--tpl-primary)" }
4822
- }, Ci = {
4834
+ }, wi = {
4823
4835
  key: 3,
4824
4836
  class: "tpl:flex tpl:flex-col tpl:gap-1"
4825
- }, wi = ["onClick"], Ti = {
4837
+ }, Ti = ["onClick"], Ei = {
4826
4838
  class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
4827
4839
  style: { "background-color": "var(--tpl-bg-hover)" }
4828
- }, Ei = ["src", "alt"], Di = {
4840
+ }, Di = ["src", "alt"], Oi = {
4829
4841
  key: 1,
4830
4842
  class: "tpl-list-icon tpl:size-full"
4831
- }, Oi = { class: "tpl:min-w-0 tpl:flex-1" }, ki = {
4843
+ }, ki = { class: "tpl:min-w-0 tpl:flex-1" }, Ai = {
4832
4844
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
4833
4845
  style: { color: "var(--tpl-text)" }
4834
- }, Ai = {
4846
+ }, ji = {
4835
4847
  class: "tpl:text-[10px]",
4836
4848
  style: { color: "var(--tpl-text-muted)" }
4837
- }, ji = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Mi = ["title", "onClick"], Ni = ["title", "onClick"], Pi = {
4849
+ }, Mi = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Ni = ["title", "onClick"], Pi = ["title", "onClick"], Fi = {
4838
4850
  key: 0,
4839
4851
  class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4840
4852
  style: { "background-color": "var(--tpl-primary)" }
4841
- }, Fi = {
4853
+ }, Ii = {
4842
4854
  key: 4,
4843
4855
  class: "tpl:flex tpl:justify-center tpl:py-4"
4844
- }, Ii = /*#__PURE__*/ mr(/* @__PURE__ */ m({
4856
+ }, Li = /*#__PURE__*/ hr(/* @__PURE__ */ m({
4845
4857
  __name: "MediaGrid",
4846
4858
  props: {
4847
4859
  items: {},
@@ -4859,7 +4871,7 @@ var ci = { class: "tpl:p-4" }, li = {
4859
4871
  "replace"
4860
4872
  ],
4861
4873
  setup(n, { emit: a }) {
4862
- let o = n, s = a, { isAcceptedMimeType: c, isImageMimeType: l } = Fe();
4874
+ let o = n, s = a, { isAcceptedMimeType: c, isImageMimeType: l } = Le();
4863
4875
  function u(e) {
4864
4876
  return !o.accept || o.accept.length === 0 || c(e.mime_type, o.accept);
4865
4877
  }
@@ -4867,7 +4879,7 @@ var ci = { class: "tpl:p-4" }, li = {
4867
4879
  s("select", e);
4868
4880
  }
4869
4881
  let { t: f } = Ae(), m = e(null);
4870
- ii(m, ([{ isIntersecting: e }]) => {
4882
+ ai(m, ([{ isIntersecting: e }]) => {
4871
4883
  e && o.hasMore && !o.isLoading && s("loadMore");
4872
4884
  }, { threshold: .1 });
4873
4885
  function g(e) {
@@ -4880,34 +4892,34 @@ var ci = { class: "tpl:p-4" }, li = {
4880
4892
  day: "numeric"
4881
4893
  });
4882
4894
  }
4883
- return (e, a) => (z(), t("div", ci, [
4895
+ return (e, a) => (z(), t("div", li, [
4884
4896
  n.isLoading && n.items.length === 0 ? (z(), t("div", {
4885
4897
  key: 0,
4886
- class: k(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
4898
+ class: O(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
4887
4899
  }, [(z(), t(R, null, S(8, (e) => i("div", {
4888
4900
  key: e,
4889
- class: k(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
4901
+ class: O(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
4890
4902
  style: { "background-color": "var(--tpl-bg-hover)" }
4891
- }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", li, [p(A(le), {
4903
+ }, null, 2)), 64))], 2)) : n.items.length === 0 ? (z(), t("div", ui, [p(A(le), {
4892
4904
  class: "tpl:mb-3",
4893
4905
  size: 40,
4894
4906
  "stroke-width": 1,
4895
4907
  style: { color: "var(--tpl-text-dim)" }
4896
- }), i("p", ui, I(A(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", Ci, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
4908
+ }), i("p", di, I(A(f).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (z(), t("div", wi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
4897
4909
  key: e.id,
4898
- class: k(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!u(e) && !n.selectedIds.has(e.id) ? "tpl:opacity-60" : ""]]),
4910
+ class: O(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!u(e) && !n.selectedIds.has(e.id) ? "tpl:opacity-60" : ""]]),
4899
4911
  style: N({ backgroundColor: n.selectedIds.has(e.id) ? "var(--tpl-bg-hover)" : "transparent" }),
4900
4912
  onClick: (t) => d(e)
4901
4913
  }, [
4902
- i("div", Ti, [A(l)(e.mime_type) ? (z(), t("img", {
4914
+ i("div", Ei, [A(l)(e.mime_type) ? (z(), t("img", {
4903
4915
  key: 0,
4904
4916
  src: e.small_url || e.url,
4905
4917
  alt: e.filename,
4906
4918
  class: "tpl:size-full tpl:object-cover",
4907
4919
  loading: "lazy"
4908
- }, null, 8, Ei)) : (z(), t("div", Di, [p(kr, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
4909
- i("div", Oi, [i("p", ki, I(e.filename), 1), i("p", Ai, [j(I(g(e.size)) + " · " + I(_(e.created_at)) + " ", 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.width) + "×" + I(e.height), 1)], 64)) : M("", !0)])]),
4910
- i("div", ji, [i("button", {
4920
+ }, null, 8, Di)) : (z(), t("div", Oi, [p(Ar, { "mime-type": e.mime_type }, null, 8, ["mime-type"])]))]),
4921
+ i("div", ki, [i("p", Ai, I(e.filename), 1), i("p", ji, [j(I(g(e.size)) + " · " + I(_(e.created_at)) + " ", 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.width) + "×" + I(e.height), 1)], 64)) : M("", !0)])]),
4922
+ i("div", Mi, [i("button", {
4911
4923
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
4912
4924
  style: { color: "var(--tpl-text-muted)" },
4913
4925
  title: A(f).mediaLibrary.editFile,
@@ -4915,22 +4927,22 @@ var ci = { class: "tpl:p-4" }, li = {
4915
4927
  }, [p(A(he), {
4916
4928
  size: 12,
4917
4929
  "stroke-width": 2
4918
- })], 8, Mi), i("button", {
4930
+ })], 8, Ni), i("button", {
4919
4931
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
4920
4932
  style: { color: "var(--tpl-text-muted)" },
4921
4933
  title: A(f).mediaLibrary.replaceFile,
4922
4934
  onClick: r((t) => s("replace", e), ["stop"])
4923
- }, [p(A(O), {
4935
+ }, [p(A(D), {
4924
4936
  size: 12,
4925
4937
  "stroke-width": 2
4926
- })], 8, Ni)]),
4927
- n.selectedIds.has(e.id) ? (z(), t("div", Pi, [p(A(D), {
4938
+ })], 8, Pi)]),
4939
+ n.selectedIds.has(e.id) ? (z(), t("div", Fi, [p(A(E), {
4928
4940
  size: 12,
4929
4941
  "stroke-width": 3
4930
4942
  })])) : M("", !0)
4931
- ], 14, wi))), 128))])) : (z(), t("div", di, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
4943
+ ], 14, Ti))), 128))])) : (z(), t("div", fi, [(z(!0), t(R, null, S(n.items, (e) => (z(), t("div", {
4932
4944
  key: e.id,
4933
- class: k(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
4945
+ class: O(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
4934
4946
  "tpl:cursor-pointer",
4935
4947
  !u(e) && !n.selectedIds.has(e.id) ? "tpl:opacity-60" : "",
4936
4948
  n.selectedIds.has(e.id) ? "tpl-media-item--selected" : ""
@@ -4941,18 +4953,18 @@ var ci = { class: "tpl:p-4" }, li = {
4941
4953
  }),
4942
4954
  onClick: (t) => d(e)
4943
4955
  }, [
4944
- i("div", pi, [A(l)(e.mime_type) ? (z(), t("img", {
4956
+ i("div", mi, [A(l)(e.mime_type) ? (z(), t("img", {
4945
4957
  key: 0,
4946
4958
  src: e.small_url || e.url,
4947
4959
  alt: e.filename,
4948
4960
  class: "tpl:size-full tpl:object-cover",
4949
4961
  loading: "lazy"
4950
- }, null, 8, mi)) : (z(), h(kr, {
4962
+ }, null, 8, hi)) : (z(), h(Ar, {
4951
4963
  key: 1,
4952
4964
  "mime-type": e.mime_type
4953
4965
  }, null, 8, ["mime-type"]))]),
4954
- i("div", hi, [i("p", gi, I(e.filename), 1), i("p", _i, [i("span", null, I(g(e.size)), 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t("span", vi, I(e.width) + "×" + I(e.height), 1)) : M("", !0)])]),
4955
- i("div", yi, [i("button", {
4966
+ i("div", gi, [i("p", _i, I(e.filename), 1), i("p", vi, [i("span", null, I(g(e.size)), 1), A(l)(e.mime_type) && e.width && e.height ? (z(), t("span", yi, I(e.width) + "×" + I(e.height), 1)) : M("", !0)])]),
4967
+ i("div", bi, [i("button", {
4956
4968
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4957
4969
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
4958
4970
  title: A(f).mediaLibrary.editFile,
@@ -4960,26 +4972,26 @@ var ci = { class: "tpl:p-4" }, li = {
4960
4972
  }, [p(A(he), {
4961
4973
  size: 11,
4962
4974
  "stroke-width": 2
4963
- })], 8, bi), i("button", {
4975
+ })], 8, xi), i("button", {
4964
4976
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
4965
4977
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
4966
4978
  title: A(f).mediaLibrary.replaceFile,
4967
4979
  onClick: r((t) => s("replace", e), ["stop"])
4968
- }, [p(A(O), {
4980
+ }, [p(A(D), {
4969
4981
  size: 11,
4970
4982
  "stroke-width": 2
4971
- })], 8, xi)]),
4972
- n.selectedIds.has(e.id) ? (z(), t("div", Si, [p(A(D), {
4983
+ })], 8, Si)]),
4984
+ n.selectedIds.has(e.id) ? (z(), t("div", Ci, [p(A(E), {
4973
4985
  size: 12,
4974
4986
  "stroke-width": 3
4975
4987
  })])) : M("", !0)
4976
- ], 14, fi))), 128))])),
4988
+ ], 14, pi))), 128))])),
4977
4989
  i("div", {
4978
4990
  ref_key: "sentinelRef",
4979
4991
  ref: m,
4980
4992
  class: "tpl:h-4"
4981
4993
  }, null, 512),
4982
- n.isLoading && n.items.length > 0 ? (z(), t("div", Fi, [p(A(ce), {
4994
+ n.isLoading && n.items.length > 0 ? (z(), t("div", Ii, [p(A(ce), {
4983
4995
  class: "tpl-spinner",
4984
4996
  size: 20,
4985
4997
  "stroke-width": 2,
@@ -4987,20 +4999,20 @@ var ci = { class: "tpl:p-4" }, li = {
4987
4999
  })])) : M("", !0)
4988
5000
  ]));
4989
5001
  }
4990
- }), [["__scopeId", "data-v-9db961d1"]]), Li = ["data-tpl-theme"], Ri = {
5002
+ }), [["__scopeId", "data-v-9db961d1"]]), Ri = ["data-tpl-theme"], zi = {
4991
5003
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
4992
5004
  style: { "background-color": "var(--tpl-bg-elevated)" }
4993
- }, zi = {
5005
+ }, Bi = {
4994
5006
  class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
4995
5007
  style: { color: "var(--tpl-text)" }
4996
- }, Bi = { class: "tpl:mb-3" }, Vi = ["placeholder", "disabled"], Hi = {
5008
+ }, Vi = { class: "tpl:mb-3" }, Hi = ["placeholder", "disabled"], Ui = {
4997
5009
  key: 0,
4998
5010
  class: "tpl:mb-3 tpl:text-xs",
4999
5011
  style: { color: "var(--tpl-danger)" }
5000
- }, Ui = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Wi = ["disabled"], Gi = ["disabled"], Ki = {
5012
+ }, Wi = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Gi = ["disabled"], Ki = ["disabled"], qi = {
5001
5013
  key: 0,
5002
5014
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
5003
- }, qi = { key: 1 }, Ji = /* @__PURE__ */ m({
5015
+ }, Ji = { key: 1 }, Yi = /* @__PURE__ */ m({
5004
5016
  __name: "MediaImportUrlModal",
5005
5017
  props: {
5006
5018
  visible: { type: Boolean },
@@ -5009,7 +5021,7 @@ var ci = { class: "tpl:p-4" }, li = {
5009
5021
  },
5010
5022
  emits: ["import", "close"],
5011
5023
  setup(n, { emit: a }) {
5012
- let o = n, c = a, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ve, e(null)), g = e("");
5024
+ let o = n, c = a, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ie, e(null)), g = e("");
5013
5025
  s(() => o.visible, (e) => {
5014
5026
  e && (g.value = "");
5015
5027
  });
@@ -5038,9 +5050,9 @@ var ci = { class: "tpl:p-4" }, li = {
5038
5050
  style: { "background-color": "var(--tpl-overlay)" },
5039
5051
  onClick: r(v, ["self"]),
5040
5052
  onKeydown: y
5041
- }, [i("div", Ri, [
5042
- i("h3", zi, I(A(d).mediaLibrary.importFromUrl), 1),
5043
- i("div", Bi, [u(i("input", {
5053
+ }, [i("div", zi, [
5054
+ i("h3", Bi, I(A(d).mediaLibrary.importFromUrl), 1),
5055
+ i("div", Vi, [u(i("input", {
5044
5056
  "onUpdate:modelValue": a[0] ||= (e) => g.value = e,
5045
5057
  type: "url",
5046
5058
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -5052,10 +5064,10 @@ var ci = { class: "tpl:p-4" }, li = {
5052
5064
  placeholder: A(d).mediaLibrary.importUrlPlaceholder,
5053
5065
  disabled: n.isImporting,
5054
5066
  autofocus: ""
5055
- }, null, 8, Vi), [[ee, g.value]])]),
5056
- n.error ? (z(), t("p", Hi, I(n.error), 1)) : M("", !0),
5057
- i("div", Ui, [i("button", {
5058
- class: k(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150", { "tpl:cursor-not-allowed tpl:opacity-50": n.isImporting }]),
5067
+ }, null, 8, Hi), [[te, g.value]])]),
5068
+ n.error ? (z(), t("p", Ui, I(n.error), 1)) : M("", !0),
5069
+ i("div", Wi, [i("button", {
5070
+ class: O(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150", { "tpl:cursor-not-allowed tpl:opacity-50": n.isImporting }]),
5059
5071
  style: {
5060
5072
  "border-color": "var(--tpl-border)",
5061
5073
  color: "var(--tpl-text)",
@@ -5063,25 +5075,25 @@ var ci = { class: "tpl:p-4" }, li = {
5063
5075
  },
5064
5076
  disabled: n.isImporting,
5065
5077
  onClick: v
5066
- }, I(A(d).mediaLibrary.cancel), 11, Wi), i("button", {
5078
+ }, I(A(d).mediaLibrary.cancel), 11, Gi), i("button", {
5067
5079
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
5068
5080
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5069
5081
  disabled: !g.value.trim() || n.isImporting,
5070
5082
  onClick: _
5071
- }, [n.isImporting ? (z(), t("span", Ki, [p(A(ce), {
5083
+ }, [n.isImporting ? (z(), t("span", qi, [p(A(ce), {
5072
5084
  class: "tpl:animate-spin",
5073
5085
  size: 12,
5074
5086
  "stroke-width": 2
5075
- }), j(" " + I(A(d).mediaLibrary.importing), 1)])) : (z(), t("span", qi, I(A(d).mediaLibrary.import), 1))], 8, Gi)])
5076
- ])], 40, Li)) : M("", !0)]),
5087
+ }), j(" " + I(A(d).mediaLibrary.importing), 1)])) : (z(), t("span", Ji, I(A(d).mediaLibrary.import), 1))], 8, Ki)])
5088
+ ])], 40, Ri)) : M("", !0)]),
5077
5089
  _: 1
5078
5090
  })], 8, ["to"]));
5079
5091
  }
5080
- }), Yi = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, Xi = ["disabled", "onClick"], Zi = { class: "tpl:truncate" }, Qi = {
5092
+ }), Xi = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, Zi = ["disabled", "onClick"], Qi = { class: "tpl:truncate" }, $i = {
5081
5093
  key: 0,
5082
5094
  class: "tpl:shrink-0",
5083
5095
  style: { color: "var(--tpl-text-dim)" }
5084
- }, $i = /* @__PURE__ */ m({
5096
+ }, ea = /* @__PURE__ */ m({
5085
5097
  __name: "MediaMovePicker",
5086
5098
  props: {
5087
5099
  folders: {},
@@ -5099,7 +5111,7 @@ var ci = { class: "tpl:p-4" }, li = {
5099
5111
  }), r.children?.length && n.push(...c(r.children, t + 1));
5100
5112
  return n;
5101
5113
  }
5102
- return Qr(s, () => {
5114
+ return $r(s, () => {
5103
5115
  a("close");
5104
5116
  }), (e, r) => (z(), t("div", {
5105
5117
  ref_key: "pickerRef",
@@ -5109,7 +5121,7 @@ var ci = { class: "tpl:p-4" }, li = {
5109
5121
  "border-color": "var(--tpl-border)",
5110
5122
  "background-color": "var(--tpl-bg-elevated)"
5111
5123
  }
5112
- }, [i("div", Yi, [n.currentFolderId === null ? M("", !0) : (z(), t("button", {
5124
+ }, [i("div", Xi, [n.currentFolderId === null ? M("", !0) : (z(), t("button", {
5113
5125
  key: 0,
5114
5126
  class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
5115
5127
  style: { color: "var(--tpl-text)" },
@@ -5134,27 +5146,27 @@ var ci = { class: "tpl:p-4" }, li = {
5134
5146
  size: 14,
5135
5147
  "stroke-width": 1.5
5136
5148
  }),
5137
- i("span", Zi, I(e.name), 1),
5138
- e.id === n.currentFolderId ? (z(), t("span", Qi, I(A(o).mediaLibrary.currentFolder), 1)) : M("", !0)
5139
- ], 12, Xi))), 128))])], 512));
5149
+ i("span", Qi, I(e.name), 1),
5150
+ e.id === n.currentFolderId ? (z(), t("span", $i, I(A(o).mediaLibrary.currentFolder), 1)) : M("", !0)
5151
+ ], 12, Zi))), 128))])], 512));
5140
5152
  }
5141
- }), ea = { class: "tpl:flex tpl:items-center tpl:gap-3" }, ta = ["src", "alt"], na = {
5153
+ }), ta = { class: "tpl:flex tpl:items-center tpl:gap-3" }, na = ["src", "alt"], ra = {
5142
5154
  key: 1,
5143
5155
  class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
5144
5156
  style: { border: "1px solid var(--tpl-border)" }
5145
- }, ra = { class: "tpl:min-w-0 tpl:flex-1" }, ia = {
5157
+ }, ia = { class: "tpl:min-w-0 tpl:flex-1" }, aa = {
5146
5158
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5147
5159
  style: { color: "var(--tpl-text)" }
5148
- }, aa = {
5160
+ }, oa = {
5149
5161
  class: "tpl:mt-0.5 tpl:text-[10px]",
5150
5162
  style: { color: "var(--tpl-text-muted)" }
5151
- }, oa = {
5163
+ }, sa = {
5152
5164
  key: 2,
5153
5165
  class: "tpl:shrink-0"
5154
- }, sa = {
5166
+ }, ca = {
5155
5167
  class: "tpl:block tpl:text-[10px]",
5156
5168
  style: { color: "var(--tpl-text-muted)" }
5157
- }, ca = ["value"], la = ["value"], ua = /*#__PURE__*/ mr(/* @__PURE__ */ m({
5169
+ }, la = ["value"], ua = ["value"], da = /*#__PURE__*/ hr(/* @__PURE__ */ m({
5158
5170
  __name: "MediaPreviewPanel",
5159
5171
  props: {
5160
5172
  item: {},
@@ -5163,7 +5175,7 @@ var ci = { class: "tpl:p-4" }, li = {
5163
5175
  },
5164
5176
  emits: ["update:selectedConversion"],
5165
5177
  setup(e, { emit: n }) {
5166
- let r = e, o = n, { t: s } = Ae(), { isImageMimeType: c } = Fe(), l = a(() => {
5178
+ let r = e, o = n, { t: s } = Ae(), { isImageMimeType: c } = Le(), l = a(() => {
5167
5179
  if (!g.value || !r.item.conversions_generated) return [];
5168
5180
  let e = [];
5169
5181
  return r.item.small_url && e.push({
@@ -5222,20 +5234,20 @@ var ci = { class: "tpl:p-4" }, li = {
5222
5234
  day: "numeric"
5223
5235
  });
5224
5236
  }
5225
- return (n, r) => (z(), t("div", ea, [
5237
+ return (n, r) => (z(), t("div", ta, [
5226
5238
  g.value ? (z(), t("img", {
5227
5239
  key: 0,
5228
5240
  src: d.value ?? void 0,
5229
5241
  alt: e.item.alt_text || e.item.filename,
5230
5242
  class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
5231
5243
  style: { border: "1px solid var(--tpl-border)" }
5232
- }, null, 8, ta)) : (z(), t("div", na, [p(kr, {
5244
+ }, null, 8, na)) : (z(), t("div", ra, [p(Ar, {
5233
5245
  "mime-type": e.item.mime_type,
5234
5246
  class: "tpl-preview-icon"
5235
5247
  }, null, 8, ["mime-type"])])),
5236
- i("div", ra, [
5237
- i("p", ia, I(e.item.filename), 1),
5238
- i("p", aa, [
5248
+ i("div", ia, [
5249
+ i("p", aa, I(e.item.filename), 1),
5250
+ i("p", oa, [
5239
5251
  j(I(_(e.item.size)) + " · " + I(v(e.item.created_at)) + " ", 1),
5240
5252
  g.value && e.item.width && e.item.height ? (z(), t(R, { key: 0 }, [j(" · " + I(e.item.width) + "×" + I(e.item.height) + "px ", 1)], 64)) : M("", !0),
5241
5253
  h.value ? (z(), t(R, { key: 1 }, [
@@ -5250,11 +5262,11 @@ var ci = { class: "tpl:p-4" }, li = {
5250
5262
  ]),
5251
5263
  g.value ? (z(), t("p", {
5252
5264
  key: 0,
5253
- class: k(["tpl:mt-0.5 tpl:truncate tpl:text-[10px] tpl:italic", { "tpl:invisible": !e.item.alt_text }]),
5265
+ class: O(["tpl:mt-0.5 tpl:truncate tpl:text-[10px] tpl:italic", { "tpl:invisible": !e.item.alt_text }]),
5254
5266
  style: { color: "var(--tpl-text-dim)" }
5255
5267
  }, I(e.item.alt_text || "\xA0"), 3)) : M("", !0)
5256
5268
  ]),
5257
- u.value ? (z(), t("div", oa, [i("label", sa, I(A(s).mediaLibrary.conversionLabel), 1), i("select", {
5269
+ u.value ? (z(), t("div", sa, [i("label", ca, I(A(s).mediaLibrary.conversionLabel), 1), i("select", {
5258
5270
  class: "tpl:mt-0.5 tpl:rounded-md tpl:border tpl:py-1 tpl:pr-6 tpl:pl-2 tpl:text-xs tpl:outline-none",
5259
5271
  style: {
5260
5272
  "border-color": "var(--tpl-border)",
@@ -5266,36 +5278,36 @@ var ci = { class: "tpl:p-4" }, li = {
5266
5278
  }, [(z(!0), t(R, null, S(l.value, (e) => (z(), t("option", {
5267
5279
  key: e.value,
5268
5280
  value: e.value
5269
- }, I(e.label), 9, la))), 128))], 40, ca)])) : M("", !0)
5281
+ }, I(e.label), 9, ua))), 128))], 40, la)])) : M("", !0)
5270
5282
  ]));
5271
5283
  }
5272
- }), [["__scopeId", "data-v-060e36cd"]]), da = ["data-tpl-theme"], fa = {
5284
+ }), [["__scopeId", "data-v-060e36cd"]]), fa = ["data-tpl-theme"], pa = {
5273
5285
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
5274
5286
  style: { "background-color": "var(--tpl-bg-elevated)" }
5275
- }, pa = {
5287
+ }, ma = {
5276
5288
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
5277
5289
  style: { color: "var(--tpl-text)" }
5278
- }, ma = {
5290
+ }, ha = {
5279
5291
  class: "tpl:mb-2 tpl:text-xs",
5280
5292
  style: { color: "var(--tpl-text-muted)" }
5281
- }, ha = {
5293
+ }, ga = {
5282
5294
  key: 0,
5283
5295
  class: "tpl:mb-3 tpl:text-xs",
5284
5296
  style: { color: "var(--tpl-warning)" }
5285
- }, ga = {
5297
+ }, _a = {
5286
5298
  class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
5287
5299
  style: { "border-color": "var(--tpl-border)" }
5288
- }, _a = {
5300
+ }, va = {
5289
5301
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
5290
5302
  style: { color: "var(--tpl-text)" }
5291
- }, va = { class: "tpl:mb-4" }, ya = {
5303
+ }, ya = { class: "tpl:mb-4" }, ba = {
5292
5304
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
5293
5305
  style: { color: "var(--tpl-text-muted)" }
5294
- }, ba = ["accept"], xa = {
5306
+ }, xa = ["accept"], Sa = {
5295
5307
  key: 1,
5296
5308
  class: "tpl:mb-3 tpl:text-xs",
5297
5309
  style: { color: "var(--tpl-danger)" }
5298
- }, Sa = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ca = ["disabled"], wa = ["disabled"], Ta = /* @__PURE__ */ m({
5310
+ }, Ca = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, wa = ["disabled"], Ta = ["disabled"], Ea = /* @__PURE__ */ m({
5299
5311
  __name: "MediaReplaceModal",
5300
5312
  props: {
5301
5313
  visible: { type: Boolean },
@@ -5306,7 +5318,7 @@ var ci = { class: "tpl:p-4" }, li = {
5306
5318
  },
5307
5319
  emits: ["replace", "close"],
5308
5320
  setup(n, { emit: o }) {
5309
- let c = n, u = o, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ve, e(null)), g = e(null), _ = e(null), v = a(() => {
5321
+ let c = n, u = o, { t: d } = Ae(), f = l("tplUiTheme"), m = l(Ie, e(null)), g = e(null), _ = e(null), v = a(() => {
5310
5322
  if (!c.item) return "";
5311
5323
  let e = c.item.filename.split(".");
5312
5324
  return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
@@ -5339,12 +5351,12 @@ var ci = { class: "tpl:p-4" }, li = {
5339
5351
  style: { "background-color": "var(--tpl-overlay)" },
5340
5352
  onClick: a[1] ||= r((e) => u("close"), ["self"]),
5341
5353
  onKeydown: w
5342
- }, [i("div", fa, [
5343
- i("h3", pa, I(A(d).mediaLibrary.replaceWarningTitle), 1),
5344
- i("p", ma, I(A(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
5345
- x.value ? (z(), t("p", ha, I(A(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : M("", !0),
5346
- i("div", ga, [i("p", _a, I(n.item.filename), 1)]),
5347
- i("div", va, [i("label", ya, I(A(d).mediaLibrary.replaceSelectFile), 1), i("input", {
5354
+ }, [i("div", pa, [
5355
+ i("h3", ma, I(A(d).mediaLibrary.replaceWarningTitle), 1),
5356
+ i("p", ha, I(A(d).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
5357
+ x.value ? (z(), t("p", ga, I(A(d).mediaLibrary.replaceWarningUsageNote.replace("{count}", n.usageInfo.template_count.toString())), 1)) : M("", !0),
5358
+ i("div", _a, [i("p", va, I(n.item.filename), 1)]),
5359
+ i("div", ya, [i("label", ba, I(A(d).mediaLibrary.replaceSelectFile), 1), i("input", {
5348
5360
  ref_key: "fileInputRef",
5349
5361
  ref: g,
5350
5362
  type: "file",
@@ -5356,9 +5368,9 @@ var ci = { class: "tpl:p-4" }, li = {
5356
5368
  color: "var(--tpl-text)"
5357
5369
  },
5358
5370
  onChange: S
5359
- }, null, 40, ba)]),
5360
- n.error ? (z(), t("p", xa, I(n.error), 1)) : M("", !0),
5361
- i("div", Sa, [i("button", {
5371
+ }, null, 40, xa)]),
5372
+ n.error ? (z(), t("p", Sa, I(n.error), 1)) : M("", !0),
5373
+ i("div", Ca, [i("button", {
5362
5374
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
5363
5375
  style: {
5364
5376
  "border-color": "var(--tpl-border)",
@@ -5367,29 +5379,29 @@ var ci = { class: "tpl:p-4" }, li = {
5367
5379
  },
5368
5380
  disabled: n.isReplacing,
5369
5381
  onClick: a[0] ||= (e) => u("close")
5370
- }, I(A(d).mediaLibrary.cancel), 9, Ca), i("button", {
5382
+ }, I(A(d).mediaLibrary.cancel), 9, wa), i("button", {
5371
5383
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white tpl:transition-all tpl:duration-150 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
5372
5384
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
5373
5385
  disabled: !_.value || n.isReplacing,
5374
5386
  onClick: C
5375
- }, I(n.isReplacing ? A(d).mediaLibrary.replacing : A(d).mediaLibrary.replace), 9, wa)])
5376
- ])], 40, da)) : M("", !0)]),
5387
+ }, I(n.isReplacing ? A(d).mediaLibrary.replacing : A(d).mediaLibrary.replace), 9, Ta)])
5388
+ ])], 40, fa)) : M("", !0)]),
5377
5389
  _: 1
5378
5390
  })], 8, ["to"]));
5379
5391
  }
5380
- }), Ea = {
5392
+ }), Da = {
5381
5393
  key: 0,
5382
5394
  class: "tpl:flex tpl:items-center tpl:gap-2"
5383
- }, Da = {
5384
- class: "tpl:text-xs",
5385
- style: { color: "var(--tpl-text-muted)" }
5386
5395
  }, Oa = {
5387
5396
  class: "tpl:text-xs",
5388
5397
  style: { color: "var(--tpl-text-muted)" }
5389
5398
  }, ka = {
5399
+ class: "tpl:text-xs",
5400
+ style: { color: "var(--tpl-text-muted)" }
5401
+ }, Aa = {
5390
5402
  class: "tpl:mt-1 tpl:text-[10px]",
5391
5403
  style: { color: "var(--tpl-text-dim)" }
5392
- }, Aa = /* @__PURE__ */ m({
5404
+ }, ja = /* @__PURE__ */ m({
5393
5405
  __name: "MediaUploadZone",
5394
5406
  props: {
5395
5407
  isUploading: { type: Boolean },
@@ -5397,7 +5409,7 @@ var ci = { class: "tpl:p-4" }, li = {
5397
5409
  },
5398
5410
  emits: ["upload"],
5399
5411
  setup(n, { emit: r }) {
5400
- let a = r, { t: o, format: s } = Ae(), { allAcceptedMimeTypes: c, allAcceptedInputString: l, maxFileSize: u } = Fe(), d = e();
5412
+ let a = r, { t: o, format: s } = Ae(), { allAcceptedMimeTypes: c, allAcceptedInputString: l, maxFileSize: u } = Le(), d = e();
5401
5413
  function f(e) {
5402
5414
  let t = [];
5403
5415
  for (let n of Array.from(e)) c.value.includes(n.type) && n.size <= u.value && t.push(n);
@@ -5407,9 +5419,9 @@ var ci = { class: "tpl:p-4" }, li = {
5407
5419
  let t = f(e);
5408
5420
  t.length && a("upload", t);
5409
5421
  }
5410
- let { isOverDropZone: h } = ri(d, { onDrop: (e) => {
5422
+ let { isOverDropZone: h } = ii(d, { onDrop: (e) => {
5411
5423
  e?.length && m(e);
5412
- } }), { open: g, onChange: _ } = si({
5424
+ } }), { open: g, onChange: _ } = ci({
5413
5425
  accept: l.value,
5414
5426
  multiple: !0
5415
5427
  });
@@ -5418,18 +5430,18 @@ var ci = { class: "tpl:p-4" }, li = {
5418
5430
  }), (e, r) => (z(), t("div", {
5419
5431
  ref_key: "dropZoneRef",
5420
5432
  ref: d,
5421
- class: k(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", A(h) ? "tpl-upload-zone-active" : ""]),
5433
+ class: O(["tpl-upload-zone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", A(h) ? "tpl-upload-zone-active" : ""]),
5422
5434
  style: {
5423
5435
  "border-color": "var(--tpl-border-light)",
5424
5436
  "background-color": "var(--tpl-bg)"
5425
5437
  },
5426
5438
  onClick: r[0] ||= (e) => A(g)()
5427
- }, [n.isUploading ? (z(), t("div", Ea, [p(A(ce), {
5439
+ }, [n.isUploading ? (z(), t("div", Da, [p(A(ce), {
5428
5440
  class: "tpl-spinner",
5429
5441
  size: 20,
5430
5442
  "stroke-width": 2,
5431
5443
  style: { color: "var(--tpl-primary)" }
5432
- }), i("span", Da, I(n.uploadProgress && n.uploadProgress.total > 1 ? A(s)(A(o).mediaLibrary.uploadingProgress, {
5444
+ }), i("span", Oa, I(n.uploadProgress && n.uploadProgress.total > 1 ? A(s)(A(o).mediaLibrary.uploadingProgress, {
5433
5445
  current: n.uploadProgress.current,
5434
5446
  total: n.uploadProgress.total
5435
5447
  }) : A(o).mediaLibrary.uploading), 1)])) : (z(), t(R, { key: 1 }, [
@@ -5439,20 +5451,20 @@ var ci = { class: "tpl:p-4" }, li = {
5439
5451
  "stroke-width": 1.5,
5440
5452
  style: { color: "var(--tpl-text-dim)" }
5441
5453
  }),
5442
- i("p", Oa, I(A(o).mediaLibrary.dropOrClick), 1),
5443
- i("p", ka, I(A(o).mediaLibrary.acceptedFormats), 1)
5454
+ i("p", ka, I(A(o).mediaLibrary.dropOrClick), 1),
5455
+ i("p", Aa, I(A(o).mediaLibrary.acceptedFormats), 1)
5444
5456
  ], 64))], 2));
5445
5457
  }
5446
- }), ja = [
5458
+ }), Ma = [
5447
5459
  "width",
5448
5460
  "height",
5449
5461
  "viewBox"
5450
- ], Ma = [
5462
+ ], Na = [
5451
5463
  "cx",
5452
5464
  "cy",
5453
5465
  "r",
5454
5466
  "stroke-width"
5455
- ], Na = [
5467
+ ], Pa = [
5456
5468
  "cx",
5457
5469
  "cy",
5458
5470
  "r",
@@ -5460,14 +5472,14 @@ var ci = { class: "tpl:p-4" }, li = {
5460
5472
  "stroke",
5461
5473
  "stroke-dasharray",
5462
5474
  "stroke-dashoffset"
5463
- ], Pa = {
5475
+ ], Fa = {
5464
5476
  key: 0,
5465
5477
  class: "tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:-translate-x-1/2 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:whitespace-nowrap tpl:shadow-lg",
5466
5478
  style: {
5467
5479
  "background-color": "var(--tpl-text)",
5468
5480
  color: "var(--tpl-bg-elevated)"
5469
5481
  }
5470
- }, Fa = /* @__PURE__ */ m({
5482
+ }, Ia = /* @__PURE__ */ m({
5471
5483
  __name: "StorageProgressRing",
5472
5484
  props: {
5473
5485
  usedBytes: {},
@@ -5507,7 +5519,7 @@ var ci = { class: "tpl:p-4" }, li = {
5507
5519
  fill: "none",
5508
5520
  "stroke-width": u.value,
5509
5521
  style: { stroke: "var(--tpl-border)" }
5510
- }, null, 8, Ma), i("circle", {
5522
+ }, null, 8, Na), i("circle", {
5511
5523
  cx: l.value / 2,
5512
5524
  cy: l.value / 2,
5513
5525
  r: d.value,
@@ -5518,7 +5530,7 @@ var ci = { class: "tpl:p-4" }, li = {
5518
5530
  "stroke-dasharray": f.value,
5519
5531
  "stroke-dashoffset": h.value,
5520
5532
  class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
5521
- }, null, 8, Na)], 8, ja)), p(ve, {
5533
+ }, null, 8, Pa)], 8, Ma)), p(ve, {
5522
5534
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
5523
5535
  "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
5524
5536
  "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
@@ -5526,14 +5538,14 @@ var ci = { class: "tpl:p-4" }, li = {
5526
5538
  "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
5527
5539
  "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
5528
5540
  }, {
5529
- default: P(() => [c.value ? (z(), t("div", Pa, [j(I(S.value) + " ", 1), n[2] ||= i("div", {
5541
+ default: P(() => [c.value ? (z(), t("div", Fa, [j(I(S.value) + " ", 1), n[2] ||= i("div", {
5530
5542
  class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
5531
5543
  style: { "background-color": "var(--tpl-text)" }
5532
5544
  }, null, -1)])) : M("", !0)]),
5533
5545
  _: 1
5534
5546
  })], 32));
5535
5547
  }
5536
- }), Ia = class {
5548
+ }), La = class {
5537
5549
  authManager;
5538
5550
  constructor(e) {
5539
5551
  this.authManager = e;
@@ -5690,11 +5702,11 @@ var ci = { class: "tpl:p-4" }, li = {
5690
5702
  };
5691
5703
  //#endregion
5692
5704
  //#region src/composable.ts
5693
- function La(t) {
5705
+ function Ra(t) {
5694
5706
  if (!t.projectId) throw Error("projectId is required for useMediaLibrary");
5695
- let n = new Ia(t.authManager), r = e([]), i = e([]), a = e(null), o = e("files"), s = e(""), c = e(null), l = e("newest"), u = e(!1), d = e(!1), f = e(!1), p = e(null), m = e(null), h = e(/* @__PURE__ */ new Set()), g = e(null), _ = e([]), v = e({}), y = e(!1), b = e([]), x = e(!1), S = e(null), C = e(!1), w = e(null), T = e(!1), E = e(null), D = e(null), O = 0;
5696
- async function k() {
5697
- let e = ++O;
5707
+ let n = new La(t.authManager), r = e([]), i = e([]), a = e(null), o = e("files"), s = e(""), c = e(null), l = e("newest"), u = e(!1), d = e(!1), f = e(!1), p = e(null), m = e(null), h = e(/* @__PURE__ */ new Set()), g = e(null), _ = e([]), v = e({}), y = e(!1), b = e([]), x = e(!1), S = e(null), C = e(!1), w = e(null), ee = e(!1), T = e(null), E = e(null), D = 0;
5708
+ async function O() {
5709
+ let e = ++D;
5698
5710
  u.value = !0;
5699
5711
  try {
5700
5712
  let t = await n.browseMedia({
@@ -5703,18 +5715,18 @@ function La(t) {
5703
5715
  category: c.value || void 0,
5704
5716
  sort: l.value === "newest" ? void 0 : l.value
5705
5717
  });
5706
- if (e !== O) return;
5718
+ if (e !== D) return;
5707
5719
  r.value = t.data, p.value = t.meta.next_cursor, f.value = !!t.meta.next_cursor;
5708
5720
  } catch (n) {
5709
- if (e !== O) return;
5721
+ if (e !== D) return;
5710
5722
  t.onError?.(n);
5711
5723
  } finally {
5712
- e === O && (u.value = !1);
5724
+ e === D && (u.value = !1);
5713
5725
  }
5714
5726
  }
5715
- async function ee() {
5727
+ async function te() {
5716
5728
  if (!f.value || !p.value || u.value) return;
5717
- let e = ++O;
5729
+ let e = ++D;
5718
5730
  u.value = !0;
5719
5731
  try {
5720
5732
  let t = await n.browseMedia({
@@ -5724,26 +5736,26 @@ function La(t) {
5724
5736
  sort: l.value === "newest" ? void 0 : l.value,
5725
5737
  cursor: p.value
5726
5738
  });
5727
- if (e !== O) return;
5739
+ if (e !== D) return;
5728
5740
  r.value = [...r.value, ...t.data], p.value = t.meta.next_cursor, f.value = !!t.meta.next_cursor;
5729
5741
  } catch (n) {
5730
- if (e !== O) return;
5742
+ if (e !== D) return;
5731
5743
  t.onError?.(n);
5732
5744
  } finally {
5733
- e === O && (u.value = !1);
5745
+ e === D && (u.value = !1);
5734
5746
  }
5735
5747
  }
5736
- async function te(e) {
5737
- s.value = e, await k();
5738
- }
5739
5748
  async function ne(e) {
5740
- c.value = e, await k();
5749
+ s.value = e, await O();
5741
5750
  }
5742
5751
  async function re(e) {
5743
- l.value = e, await k();
5752
+ c.value = e, await O();
5744
5753
  }
5745
5754
  async function ie(e) {
5746
- o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await k();
5755
+ l.value = e, await O();
5756
+ }
5757
+ async function k(e) {
5758
+ o.value = "files", a.value = e, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await O();
5747
5759
  }
5748
5760
  async function ae() {
5749
5761
  o.value = "frequently-used", a.value = null, s.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await ce();
@@ -5893,29 +5905,29 @@ function La(t) {
5893
5905
  async function ge(e) {
5894
5906
  try {
5895
5907
  let t = he(i.value, e)?.parent_id ?? null;
5896
- await n.deleteMediaFolder(e), a.value === e && (a.value = t), await me(), await k();
5908
+ await n.deleteMediaFolder(e), a.value === e && (a.value = t), await me(), await O();
5897
5909
  } catch (e) {
5898
5910
  t.onError?.(e);
5899
5911
  }
5900
5912
  }
5901
5913
  async function L(e) {
5902
- E.value = e, w.value = null;
5914
+ T.value = e, w.value = null;
5903
5915
  try {
5904
5916
  let t = await n.checkMediaUsage([e.id]);
5905
- D.value = t.data[e.id] ?? null, T.value = !0;
5917
+ E.value = t.data[e.id] ?? null, ee.value = !0;
5906
5918
  } catch (e) {
5907
5919
  t.onError?.(e);
5908
5920
  }
5909
5921
  }
5910
5922
  function _e() {
5911
- T.value = !1, E.value = null, D.value = null, w.value = null;
5923
+ ee.value = !1, T.value = null, E.value = null, w.value = null;
5912
5924
  }
5913
5925
  async function ve(e) {
5914
- if (!E.value) return null;
5926
+ if (!T.value) return null;
5915
5927
  C.value = !0, w.value = null;
5916
5928
  try {
5917
- let t = await n.replaceMedia(E.value.id, e);
5918
- return r.value = r.value.map((e) => e.id === t.id ? t : e), _.value = _.value.map((e) => e.id === t.id ? t : e), g.value?.id === t.id && (g.value = t), T.value = !1, E.value = null, D.value = null, t;
5929
+ let t = await n.replaceMedia(T.value.id, e);
5930
+ return r.value = r.value.map((e) => e.id === t.id ? t : e), _.value = _.value.map((e) => e.id === t.id ? t : e), g.value?.id === t.id && (g.value = t), ee.value = !1, T.value = null, E.value = null, t;
5919
5931
  } catch (e) {
5920
5932
  return w.value = e instanceof Error ? e.message : "Replace failed", t.onError?.(e), null;
5921
5933
  } finally {
@@ -5947,12 +5959,12 @@ function La(t) {
5947
5959
  frequentlyUsedItems: _,
5948
5960
  deleteUsageInfo: v,
5949
5961
  showDeleteWarning: y,
5950
- loadItems: k,
5951
- loadMore: ee,
5952
- search: te,
5953
- filterByCategory: ne,
5954
- sortBy: re,
5955
- navigateToFolder: ie,
5962
+ loadItems: O,
5963
+ loadMore: te,
5964
+ search: ne,
5965
+ filterByCategory: re,
5966
+ sortBy: ie,
5967
+ navigateToFolder: k,
5956
5968
  showFrequentlyUsed: ae,
5957
5969
  uploadFile: oe,
5958
5970
  uploadFiles: se,
@@ -5976,9 +5988,9 @@ function La(t) {
5976
5988
  cancelDelete: de,
5977
5989
  isReplacing: C,
5978
5990
  replaceError: w,
5979
- showReplaceWarning: T,
5980
- pendingReplaceItem: E,
5981
- replaceUsageInfo: D,
5991
+ showReplaceWarning: ee,
5992
+ pendingReplaceItem: T,
5993
+ replaceUsageInfo: E,
5982
5994
  checkUsageBeforeReplace: L,
5983
5995
  cancelReplace: _e,
5984
5996
  replaceFile: ve,
@@ -5987,117 +5999,117 @@ function La(t) {
5987
5999
  }
5988
6000
  //#endregion
5989
6001
  //#region src/composables/useMediaLibraryUI.ts
5990
- function Ra(t) {
5991
- let { library: n, canUseMediaFolders: r, translations: i } = t;
5992
- function o() {
5993
- return "value" in i && typeof i.value == "object" ? i.value : i;
6002
+ function za(t) {
6003
+ let { library: n, translations: r } = t;
6004
+ function i() {
6005
+ return "value" in r && typeof r.value == "object" ? r.value : r;
5994
6006
  }
5995
- let c = e("grid"), l = e(!1), u = e(""), d = e("original"), f = e(null), p = e(!1), m = e(!1), h = a(() => {
6007
+ let o = e("grid"), c = e(!1), l = e(""), u = e("original"), d = e(null), f = e(!1), p = e(!1), m = a(() => {
5996
6008
  let e = n.previewItem.value;
5997
6009
  if (!e) return null;
5998
- switch (d.value) {
6010
+ switch (u.value) {
5999
6011
  case "small": return e.small_url || e.url;
6000
6012
  case "medium": return e.medium_url || e.url;
6001
6013
  case "large": return e.large_url || e.url;
6002
6014
  default: return e.url;
6003
6015
  }
6004
- }), g = a(() => n.frequentlyUsedItems.value.length > 0), _ = a(() => n.viewMode.value === "frequently-used" ? n.frequentlyUsedItems.value : n.items.value), v = a(() => Object.values(n.deleteUsageInfo.value).some((e) => e.template_count > 0)), y = {
6005
- images: () => o().mediaLibrary.filterImages,
6006
- documents: () => o().mediaLibrary.filterDocuments,
6007
- videos: () => o().mediaLibrary.filterVideos,
6008
- audio: () => o().mediaLibrary.filterAudio
6016
+ }), h = a(() => n.frequentlyUsedItems.value.length > 0), g = a(() => n.viewMode.value === "frequently-used" ? n.frequentlyUsedItems.value : n.items.value), _ = a(() => Object.values(n.deleteUsageInfo.value).some((e) => e.template_count > 0)), v = {
6017
+ images: () => i().mediaLibrary.filterImages,
6018
+ documents: () => i().mediaLibrary.filterDocuments,
6019
+ videos: () => i().mediaLibrary.filterVideos,
6020
+ audio: () => i().mediaLibrary.filterAudio
6009
6021
  };
6010
- function b(e) {
6011
- return y[e]?.() ?? e;
6022
+ function y(e) {
6023
+ return v[e]?.() ?? e;
6012
6024
  }
6013
- s(l, (e) => {
6014
- e && r.value && n.loadFolders();
6025
+ s(c, (e) => {
6026
+ e && n.loadFolders();
6015
6027
  }), s(() => n.previewItem.value?.id, () => {
6016
- d.value = "original";
6028
+ u.value = "original";
6017
6029
  });
6018
- let x = Ur((e) => {
6030
+ let b = Wr((e) => {
6019
6031
  n.search(e);
6020
6032
  }, 300);
6021
- function S(e) {
6022
- u.value = e, x(e);
6033
+ function x(e) {
6034
+ l.value = e, b(e);
6023
6035
  }
6024
- let { copy: C, copied: w } = ni({
6036
+ let { copy: S, copied: C } = ri({
6025
6037
  copiedDuring: 2e3,
6026
6038
  legacy: !0
6027
6039
  });
6028
- async function T(e) {
6040
+ async function w(e) {
6029
6041
  await n.uploadFiles(e);
6030
6042
  }
6031
- function E(e) {
6043
+ function ee(e) {
6032
6044
  n.selectItem(e);
6033
6045
  }
6034
- async function D(e, t) {
6046
+ async function T(e, t) {
6035
6047
  await n.createFolder(e, t);
6036
6048
  }
6037
- async function O(e, t) {
6049
+ async function E(e, t) {
6038
6050
  await n.renameFolder(e, t);
6039
6051
  }
6040
- async function k(e) {
6052
+ async function D(e) {
6041
6053
  await n.deleteFolder(e);
6042
6054
  }
6043
- function ee(e) {
6044
- f.value = e;
6055
+ function O(e) {
6056
+ d.value = e;
6045
6057
  }
6046
6058
  async function te(e, t, r, i) {
6047
- i && await n.replaceMediaDirectly(e, i.file), await n.updateFile(e, t, r), f.value = null;
6059
+ i && await n.replaceMediaDirectly(e, i.file), await n.updateFile(e, t, r), d.value = null;
6048
6060
  }
6049
6061
  async function ne(e) {
6050
- await n.importFromUrl(e) && (p.value = !1);
6062
+ await n.importFromUrl(e) && (f.value = !1);
6051
6063
  }
6052
6064
  async function re(e) {
6053
- m.value = !1, await n.moveSelected(e);
6065
+ p.value = !1, await n.moveSelected(e);
6054
6066
  }
6055
6067
  async function ie() {
6056
6068
  await n.checkUsageBeforeDelete();
6057
6069
  }
6058
- function ae(e) {
6070
+ function k(e) {
6059
6071
  n.checkUsageBeforeReplace(e);
6060
6072
  }
6061
- async function oe(e) {
6073
+ async function ae(e) {
6062
6074
  await n.replaceFile(e);
6063
6075
  }
6064
- function se() {
6065
- n.clearSelection(), n.cancelDelete(), n.cancelReplace(), u.value = "", n.categoryFilter.value = null, n.sortOption.value = "newest", n.viewMode.value = "files", f.value = null, p.value = !1, d.value = "original";
6076
+ function oe() {
6077
+ n.clearSelection(), n.cancelDelete(), n.cancelReplace(), l.value = "", n.categoryFilter.value = null, n.sortOption.value = "newest", n.viewMode.value = "files", d.value = null, f.value = !1, u.value = "original";
6066
6078
  }
6067
6079
  return {
6068
- layoutMode: c,
6069
- showSidebar: l,
6070
- searchInput: u,
6071
- selectedConversion: d,
6072
- editingItem: f,
6073
- showImportUrlModal: p,
6074
- showMovePicker: m,
6075
- selectedUrl: h,
6076
- hasFrequentlyUsed: g,
6077
- displayItems: _,
6078
- hasUsedFiles: v,
6079
- copy: C,
6080
- copied: w,
6081
- getCategoryLabel: b,
6082
- handleSearchInput: S,
6083
- handleUpload: T,
6084
- handleSelect: E,
6085
- handleCreateFolder: D,
6086
- handleRenameFolder: O,
6087
- handleDeleteFolder: k,
6088
- handleEditItem: ee,
6080
+ layoutMode: o,
6081
+ showSidebar: c,
6082
+ searchInput: l,
6083
+ selectedConversion: u,
6084
+ editingItem: d,
6085
+ showImportUrlModal: f,
6086
+ showMovePicker: p,
6087
+ selectedUrl: m,
6088
+ hasFrequentlyUsed: h,
6089
+ displayItems: g,
6090
+ hasUsedFiles: _,
6091
+ copy: S,
6092
+ copied: C,
6093
+ getCategoryLabel: y,
6094
+ handleSearchInput: x,
6095
+ handleUpload: w,
6096
+ handleSelect: ee,
6097
+ handleCreateFolder: T,
6098
+ handleRenameFolder: E,
6099
+ handleDeleteFolder: D,
6100
+ handleEditItem: O,
6089
6101
  handleEditSave: te,
6090
6102
  handleImportFromUrl: ne,
6091
6103
  handleMoveToFolder: re,
6092
6104
  handleDeleteClick: ie,
6093
- handleReplaceItem: ae,
6094
- handleReplaceFile: oe,
6095
- resetUI: se
6105
+ handleReplaceItem: k,
6106
+ handleReplaceFile: ae,
6107
+ resetUI: oe
6096
6108
  };
6097
6109
  }
6098
6110
  //#endregion
6099
6111
  //#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
6100
- var za = {
6112
+ var Ba = {
6101
6113
  class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
6102
6114
  style: {
6103
6115
  width: "100%",
@@ -6105,62 +6117,59 @@ var za = {
6105
6117
  "background-color": "var(--tpl-bg-elevated)",
6106
6118
  border: "1px solid var(--tpl-border)"
6107
6119
  }
6108
- }, Ba = {
6120
+ }, Va = {
6109
6121
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
6110
6122
  style: { "border-color": "var(--tpl-border)" }
6111
- }, Va = {
6123
+ }, Ha = {
6112
6124
  class: "tpl:text-sm tpl:font-semibold",
6113
6125
  style: { color: "var(--tpl-text)" }
6114
- }, Ha = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Ua = { class: "tpl:relative" }, Wa = ["value", "placeholder"], Ga = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Ka = {
6126
+ }, Ua = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Wa = { class: "tpl:relative" }, Ga = ["value", "placeholder"], Ka = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, qa = {
6115
6127
  key: 0,
6116
6128
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
6117
6129
  style: {
6118
6130
  "border-color": "var(--tpl-border)",
6119
6131
  "background-color": "var(--tpl-bg)"
6120
6132
  }
6121
- }, qa = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Ja = {
6133
+ }, Ja = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Ya = {
6122
6134
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
6123
6135
  style: { "border-color": "var(--tpl-border)" }
6124
- }, Ya = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Xa = ["title"], Za = {
6125
- key: 1,
6136
+ }, Xa = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Za = ["title"], Qa = {
6137
+ key: 0,
6126
6138
  class: "tpl:text-xs tpl:font-medium",
6127
6139
  style: { color: "var(--tpl-text)" }
6128
- }, Qa = {
6140
+ }, $a = {
6129
6141
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
6130
6142
  style: {
6131
6143
  border: "1px solid var(--tpl-border)",
6132
6144
  "background-color": "var(--tpl-bg)"
6133
6145
  }
6134
- }, $a = ["title"], eo = ["title"], to = { class: "tpl:flex tpl:items-center tpl:gap-2" }, no = ["value"], ro = { value: "" }, io = ["value"], ao = ["value"], oo = { value: "newest" }, so = { value: "oldest" }, co = { value: "name_asc" }, lo = { value: "name_desc" }, uo = { value: "size_asc" }, fo = { value: "size_desc" }, po = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, mo = {
6146
+ }, eo = ["title"], to = ["title"], no = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ro = ["value"], io = { value: "" }, ao = ["value"], oo = ["value"], so = { value: "newest" }, co = { value: "oldest" }, lo = { value: "name_asc" }, uo = { value: "name_desc" }, fo = { value: "size_asc" }, po = { value: "size_desc" }, mo = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, ho = {
6135
6147
  key: 0,
6136
6148
  class: "tpl:px-4 tpl:pt-3"
6137
- }, ho = {
6149
+ }, go = {
6138
6150
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
6139
6151
  style: {
6140
6152
  "background-color": "var(--tpl-bg-elevated)",
6141
6153
  "box-shadow": "var(--tpl-shadow-xl)"
6142
6154
  }
6143
- }, go = {
6155
+ }, _o = {
6144
6156
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
6145
6157
  style: { color: "var(--tpl-text)" }
6146
- }, _o = {
6158
+ }, vo = {
6147
6159
  key: 0,
6148
6160
  class: "tpl:mb-4 tpl:text-xs",
6149
6161
  style: { color: "var(--tpl-text-muted)" }
6150
- }, vo = {
6162
+ }, yo = {
6151
6163
  key: 1,
6152
6164
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
6153
6165
  style: { "border-color": "var(--tpl-border)" }
6154
- }, yo = { class: "tpl:font-medium" }, bo = { style: { color: "var(--tpl-text-muted)" } }, xo = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, So = {
6166
+ }, bo = { class: "tpl:font-medium" }, xo = { style: { color: "var(--tpl-text-muted)" } }, So = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Co = {
6155
6167
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
6156
6168
  style: { "border-color": "var(--tpl-border)" }
6157
- }, Co = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, wo = { class: "tpl:flex tpl:items-center tpl:gap-5" }, To = {
6169
+ }, wo = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, To = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Eo = {
6158
6170
  key: 0,
6159
6171
  class: "tpl:flex tpl:items-center tpl:gap-2"
6160
- }, Eo = {
6161
- key: 1,
6162
- class: "tpl:relative"
6163
- }, Do = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Oo = ["disabled"], ko = /* @__PURE__ */ m({
6172
+ }, Do = { class: "tpl:relative" }, Oo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ko = ["disabled"], Ao = /* @__PURE__ */ m({
6164
6173
  __name: "MediaLibrary",
6165
6174
  props: {
6166
6175
  authManager: {},
@@ -6173,41 +6182,40 @@ var za = {
6173
6182
  emits: ["ready"],
6174
6183
  setup(o, { emit: s }) {
6175
6184
  let c = o, l = s, u = a(() => c.translations);
6176
- n("translations", c.translations), n("authManager", c.authManager), n("projectId", a(() => c.projectId));
6185
+ n("translations", c.translations);
6177
6186
  let d = e(c.planConfig);
6178
- n("planConfig", {
6187
+ n(Fe, {
6179
6188
  config: d,
6180
6189
  isLoading: e(!1),
6181
6190
  hasFeature: (e) => c.planConfig.features[e] ?? !1,
6182
6191
  features: a(() => c.planConfig.features),
6183
6192
  fetchConfig: async () => {}
6184
6193
  });
6185
- let f = a(() => c.planConfig.features.media_folders ?? !1), m = a(() => c.planConfig.features.import_from_url ?? !1), g = a(() => c.planConfig.storage.used_bytes ?? 0), _ = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: y } = Fe(), b = La({
6194
+ let f = a(() => c.planConfig.storage.used_bytes ?? 0), m = a(() => c.planConfig.storage.limit_bytes ?? 0), { availableCategories: g } = Le(), _ = Ra({
6186
6195
  projectId: c.projectId,
6187
6196
  authManager: c.authManager,
6188
6197
  onError: c.onError
6189
- }), x = Ra({
6190
- library: b,
6191
- canUseMediaFolders: f,
6198
+ }), y = za({
6199
+ library: _,
6192
6200
  translations: u
6193
6201
  });
6194
- function C() {
6195
- if (!b.previewItem.value) return;
6196
- let e = b.previewItem.value;
6202
+ function b() {
6203
+ if (!_.previewItem.value) return;
6204
+ let e = _.previewItem.value;
6197
6205
  c.onSelect?.({
6198
6206
  ...e,
6199
- url: x.selectedUrl.value || e.url
6207
+ url: y.selectedUrl.value || e.url
6200
6208
  });
6201
6209
  }
6202
6210
  return v(() => {
6203
- b.loadItems(), b.loadFrequentlyUsed(), l("ready");
6204
- }), (e, n) => (z(), t("div", za, [
6205
- i("div", Ba, [i("h2", Va, I(u.value.mediaLibrary.title), 1), i("div", Ha, [p(Fa, {
6206
- "used-bytes": g.value,
6207
- "limit-bytes": _.value,
6211
+ _.loadItems(), _.loadFrequentlyUsed(), l("ready");
6212
+ }), (e, n) => (z(), t("div", Ba, [
6213
+ i("div", Va, [i("h2", Ha, I(u.value.mediaLibrary.title), 1), i("div", Ua, [p(Ia, {
6214
+ "used-bytes": f.value,
6215
+ "limit-bytes": m.value,
6208
6216
  size: 22
6209
- }, null, 8, ["used-bytes", "limit-bytes"]), i("div", Ua, [i("input", {
6210
- value: A(x).searchInput.value,
6217
+ }, null, 8, ["used-bytes", "limit-bytes"]), i("div", Wa, [i("input", {
6218
+ value: A(y).searchInput.value,
6211
6219
  type: "text",
6212
6220
  class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)]",
6213
6221
  style: {
@@ -6216,14 +6224,14 @@ var za = {
6216
6224
  color: "var(--tpl-text)"
6217
6225
  },
6218
6226
  placeholder: u.value.mediaLibrary.searchPlaceholder,
6219
- onInput: n[0] ||= (e) => A(x).handleSearchInput(e.target.value)
6220
- }, null, 40, Wa), p(A(se), {
6227
+ onInput: n[0] ||= (e) => A(y).handleSearchInput(e.target.value)
6228
+ }, null, 40, Ga), p(A(se), {
6221
6229
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
6222
6230
  size: 13,
6223
6231
  "stroke-width": 2,
6224
6232
  style: { color: "var(--tpl-text-dim)" }
6225
6233
  })])])]),
6226
- i("div", Ga, [p(ve, {
6234
+ i("div", Ka, [p(ve, {
6227
6235
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
6228
6236
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
6229
6237
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -6231,16 +6239,16 @@ var za = {
6231
6239
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
6232
6240
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
6233
6241
  }, {
6234
- default: P(() => [f.value && A(x).showSidebar.value ? (z(), t("div", Ka, [p(Dr, {
6235
- folders: A(b).folders.value,
6236
- "current-folder-id": A(b).currentFolderId.value,
6237
- "view-mode": A(b).viewMode.value,
6238
- "has-frequently-used": A(x).hasFrequentlyUsed.value,
6239
- onNavigate: A(b).navigateToFolder,
6240
- onCreateFolder: A(x).handleCreateFolder,
6241
- onRenameFolder: A(x).handleRenameFolder,
6242
- onDeleteFolder: A(x).handleDeleteFolder,
6243
- onShowFrequentlyUsed: A(b).showFrequentlyUsed
6242
+ default: P(() => [A(y).showSidebar.value ? (z(), t("div", qa, [p(Or, {
6243
+ folders: A(_).folders.value,
6244
+ "current-folder-id": A(_).currentFolderId.value,
6245
+ "view-mode": A(_).viewMode.value,
6246
+ "has-frequently-used": A(y).hasFrequentlyUsed.value,
6247
+ onNavigate: A(_).navigateToFolder,
6248
+ onCreateFolder: A(y).handleCreateFolder,
6249
+ onRenameFolder: A(y).handleRenameFolder,
6250
+ onDeleteFolder: A(y).handleDeleteFolder,
6251
+ onShowFrequentlyUsed: A(_).showFrequentlyUsed
6244
6252
  }, null, 8, [
6245
6253
  "folders",
6246
6254
  "current-folder-id",
@@ -6253,55 +6261,54 @@ var za = {
6253
6261
  "onShowFrequentlyUsed"
6254
6262
  ])])) : M("", !0)]),
6255
6263
  _: 1
6256
- }), i("div", qa, [i("div", Ja, [i("div", Ya, [
6257
- f.value ? (z(), t("button", {
6258
- key: 0,
6264
+ }), i("div", Ja, [i("div", Ya, [i("div", Xa, [
6265
+ i("button", {
6259
6266
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
6260
6267
  style: N({
6261
- color: A(x).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6262
- backgroundColor: A(x).showSidebar.value ? "var(--tpl-bg)" : "transparent",
6263
- border: A(x).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
6268
+ color: A(y).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6269
+ backgroundColor: A(y).showSidebar.value ? "var(--tpl-bg)" : "transparent",
6270
+ border: A(y).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
6264
6271
  }),
6265
- title: A(x).showSidebar.value ? u.value.mediaLibrary.hideFolders : u.value.mediaLibrary.showFolders,
6266
- onClick: n[1] ||= (e) => A(x).showSidebar.value = !A(x).showSidebar.value
6267
- }, [p(A(te), {
6272
+ title: A(y).showSidebar.value ? u.value.mediaLibrary.hideFolders : u.value.mediaLibrary.showFolders,
6273
+ onClick: n[1] ||= (e) => A(y).showSidebar.value = !A(y).showSidebar.value
6274
+ }, [p(A(ne), {
6268
6275
  size: 16,
6269
6276
  "stroke-width": 2
6270
- })], 12, Xa)) : M("", !0),
6271
- A(b).viewMode.value === "frequently-used" ? (z(), t("span", Za, I(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(Pe, {
6272
- key: 2,
6273
- folders: A(b).folders.value,
6274
- "current-folder-id": A(b).currentFolderId.value,
6275
- onNavigate: A(b).navigateToFolder
6277
+ })], 12, Za),
6278
+ A(_).viewMode.value === "frequently-used" ? (z(), t("span", Qa, I(u.value.mediaLibrary.frequentlyUsed), 1)) : (z(), h(Pe, {
6279
+ key: 1,
6280
+ folders: A(_).folders.value,
6281
+ "current-folder-id": A(_).currentFolderId.value,
6282
+ onNavigate: A(_).navigateToFolder
6276
6283
  }, null, 8, [
6277
6284
  "folders",
6278
6285
  "current-folder-id",
6279
6286
  "onNavigate"
6280
6287
  ])),
6281
- i("div", Qa, [i("button", {
6288
+ i("div", $a, [i("button", {
6282
6289
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6283
6290
  style: N({
6284
- color: A(x).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6285
- backgroundColor: A(x).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
6291
+ color: A(y).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6292
+ backgroundColor: A(y).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
6286
6293
  }),
6287
6294
  title: u.value.mediaLibrary.viewGrid,
6288
- onClick: n[2] ||= (e) => A(x).layoutMode.value = "grid"
6289
- }, [p(A(ie), {
6295
+ onClick: n[2] ||= (e) => A(y).layoutMode.value = "grid"
6296
+ }, [p(A(k), {
6290
6297
  size: 14,
6291
6298
  "stroke-width": 2
6292
- })], 12, $a), i("button", {
6299
+ })], 12, eo), i("button", {
6293
6300
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
6294
6301
  style: N({
6295
- color: A(x).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6296
- backgroundColor: A(x).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
6302
+ color: A(y).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
6303
+ backgroundColor: A(y).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
6297
6304
  }),
6298
6305
  title: u.value.mediaLibrary.viewList,
6299
- onClick: n[3] ||= (e) => A(x).layoutMode.value = "list"
6306
+ onClick: n[3] ||= (e) => A(y).layoutMode.value = "list"
6300
6307
  }, [p(A(_e), {
6301
6308
  size: 14,
6302
6309
  "stroke-width": 2
6303
- })], 12, eo)])
6304
- ]), i("div", to, [A(y).length > 1 ? (z(), t("select", {
6310
+ })], 12, to)])
6311
+ ]), i("div", no, [A(g).length > 1 ? (z(), t("select", {
6305
6312
  key: 0,
6306
6313
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
6307
6314
  style: {
@@ -6309,58 +6316,57 @@ var za = {
6309
6316
  "background-color": "var(--tpl-bg)",
6310
6317
  color: "var(--tpl-text)"
6311
6318
  },
6312
- value: A(b).categoryFilter.value ?? "",
6313
- onChange: n[4] ||= (e) => A(b).filterByCategory(e.target.value || null)
6314
- }, [i("option", ro, I(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(A(y), (e) => (z(), t("option", {
6319
+ value: A(_).categoryFilter.value ?? "",
6320
+ onChange: n[4] ||= (e) => A(_).filterByCategory(e.target.value || null)
6321
+ }, [i("option", io, I(u.value.mediaLibrary.filterAll), 1), (z(!0), t(R, null, S(A(g), (e) => (z(), t("option", {
6315
6322
  key: e,
6316
6323
  value: e
6317
- }, I(A(x).getCategoryLabel(e)), 9, io))), 128))], 40, no)) : M("", !0), i("select", {
6324
+ }, I(A(y).getCategoryLabel(e)), 9, ao))), 128))], 40, ro)) : M("", !0), i("select", {
6318
6325
  class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
6319
6326
  style: {
6320
6327
  "border-color": "var(--tpl-border)",
6321
6328
  "background-color": "var(--tpl-bg)",
6322
6329
  color: "var(--tpl-text)"
6323
6330
  },
6324
- value: A(b).sortOption.value,
6325
- onChange: n[5] ||= (e) => A(b).sortBy(e.target.value)
6331
+ value: A(_).sortOption.value,
6332
+ onChange: n[5] ||= (e) => A(_).sortBy(e.target.value)
6326
6333
  }, [
6327
- i("option", oo, I(u.value.mediaLibrary.sortNewest), 1),
6328
- i("option", so, I(u.value.mediaLibrary.sortOldest), 1),
6329
- i("option", co, I(u.value.mediaLibrary.sortNameAsc), 1),
6330
- i("option", lo, I(u.value.mediaLibrary.sortNameDesc), 1),
6331
- i("option", uo, I(u.value.mediaLibrary.sortSizeAsc), 1),
6332
- i("option", fo, I(u.value.mediaLibrary.sortSizeDesc), 1)
6333
- ], 40, ao)])]), i("div", po, [A(b).viewMode.value === "files" ? (z(), t("div", mo, [p(Aa, {
6334
- "is-uploading": A(b).isUploading.value,
6335
- "upload-progress": A(b).uploadProgress.value,
6336
- onUpload: A(x).handleUpload
6334
+ i("option", so, I(u.value.mediaLibrary.sortNewest), 1),
6335
+ i("option", co, I(u.value.mediaLibrary.sortOldest), 1),
6336
+ i("option", lo, I(u.value.mediaLibrary.sortNameAsc), 1),
6337
+ i("option", uo, I(u.value.mediaLibrary.sortNameDesc), 1),
6338
+ i("option", fo, I(u.value.mediaLibrary.sortSizeAsc), 1),
6339
+ i("option", po, I(u.value.mediaLibrary.sortSizeDesc), 1)
6340
+ ], 40, oo)])]), i("div", mo, [A(_).viewMode.value === "files" ? (z(), t("div", ho, [p(ja, {
6341
+ "is-uploading": A(_).isUploading.value,
6342
+ "upload-progress": A(_).uploadProgress.value,
6343
+ onUpload: A(y).handleUpload
6337
6344
  }, null, 8, [
6338
6345
  "is-uploading",
6339
6346
  "upload-progress",
6340
6347
  "onUpload"
6341
- ]), m.value ? (z(), t("button", {
6342
- key: 0,
6348
+ ]), i("button", {
6343
6349
  class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6344
6350
  style: {
6345
6351
  "border-color": "var(--tpl-border)",
6346
6352
  color: "var(--tpl-text-muted)",
6347
6353
  "background-color": "var(--tpl-bg)"
6348
6354
  },
6349
- onClick: n[6] ||= (e) => A(x).showImportUrlModal.value = !0
6350
- }, [p(A(ne), {
6355
+ onClick: n[6] ||= (e) => A(y).showImportUrlModal.value = !0
6356
+ }, [p(A(re), {
6351
6357
  size: 14,
6352
6358
  "stroke-width": 2
6353
- }), j(" " + I(u.value.mediaLibrary.importFromUrl), 1)])) : M("", !0)])) : M("", !0), p(Ii, {
6354
- items: A(x).displayItems.value,
6355
- "selected-ids": A(b).selectedItems.value,
6356
- "is-loading": A(b).isLoading.value,
6357
- "has-more": A(b).viewMode.value === "files" && A(b).hasMore.value,
6358
- layout: A(x).layoutMode.value,
6359
- onSelect: A(x).handleSelect,
6360
- onToggle: A(b).toggleSelection,
6361
- onLoadMore: A(b).loadMore,
6362
- onEdit: A(x).handleEditItem,
6363
- onReplace: A(x).handleReplaceItem
6359
+ }), j(" " + I(u.value.mediaLibrary.importFromUrl), 1)])])) : M("", !0), p(Li, {
6360
+ items: A(y).displayItems.value,
6361
+ "selected-ids": A(_).selectedItems.value,
6362
+ "is-loading": A(_).isLoading.value,
6363
+ "has-more": A(_).viewMode.value === "files" && A(_).hasMore.value,
6364
+ layout: A(y).layoutMode.value,
6365
+ onSelect: A(y).handleSelect,
6366
+ onToggle: A(_).toggleSelection,
6367
+ onLoadMore: A(_).loadMore,
6368
+ onEdit: A(y).handleEditItem,
6369
+ onReplace: A(y).handleReplaceItem
6364
6370
  }, null, 8, [
6365
6371
  "items",
6366
6372
  "selected-ids",
@@ -6373,36 +6379,36 @@ var za = {
6373
6379
  "onEdit",
6374
6380
  "onReplace"
6375
6381
  ])])])]),
6376
- p(Ji, {
6377
- visible: A(x).showImportUrlModal.value,
6378
- "is-importing": A(b).isImportingFromUrl.value,
6379
- error: A(b).importFromUrlError.value,
6380
- onImport: A(x).handleImportFromUrl,
6381
- onClose: n[7] ||= (e) => A(x).showImportUrlModal.value = !1
6382
+ p(Yi, {
6383
+ visible: A(y).showImportUrlModal.value,
6384
+ "is-importing": A(_).isImportingFromUrl.value,
6385
+ error: A(_).importFromUrlError.value,
6386
+ onImport: A(y).handleImportFromUrl,
6387
+ onClose: n[7] ||= (e) => A(y).showImportUrlModal.value = !1
6382
6388
  }, null, 8, [
6383
6389
  "visible",
6384
6390
  "is-importing",
6385
6391
  "error",
6386
6392
  "onImport"
6387
6393
  ]),
6388
- p(hr, {
6389
- visible: !!A(x).editingItem.value,
6390
- item: A(x).editingItem.value,
6391
- onSave: A(x).handleEditSave,
6392
- onClose: n[8] ||= (e) => A(x).editingItem.value = null
6394
+ p(gr, {
6395
+ visible: !!A(y).editingItem.value,
6396
+ item: A(y).editingItem.value,
6397
+ onSave: A(y).handleEditSave,
6398
+ onClose: n[8] ||= (e) => A(y).editingItem.value = null
6393
6399
  }, null, 8, [
6394
6400
  "visible",
6395
6401
  "item",
6396
6402
  "onSave"
6397
6403
  ]),
6398
- p(Ta, {
6399
- visible: A(b).showReplaceWarning.value,
6400
- item: A(b).pendingReplaceItem.value,
6401
- "usage-info": A(b).replaceUsageInfo.value,
6402
- "is-replacing": A(b).isReplacing.value,
6403
- error: A(b).replaceError.value,
6404
- onReplace: A(x).handleReplaceFile,
6405
- onClose: A(b).cancelReplace
6404
+ p(Ea, {
6405
+ visible: A(_).showReplaceWarning.value,
6406
+ item: A(_).pendingReplaceItem.value,
6407
+ "usage-info": A(_).replaceUsageInfo.value,
6408
+ "is-replacing": A(_).isReplacing.value,
6409
+ error: A(_).replaceError.value,
6410
+ onReplace: A(y).handleReplaceFile,
6411
+ onClose: A(_).cancelReplace
6406
6412
  }, null, 8, [
6407
6413
  "visible",
6408
6414
  "item",
@@ -6420,7 +6426,7 @@ var za = {
6420
6426
  "leave-from-class": "tpl:opacity-100",
6421
6427
  "leave-to-class": "tpl:opacity-0"
6422
6428
  }, {
6423
- default: P(() => [A(b).showDeleteWarning.value ? (z(), t("div", {
6429
+ default: P(() => [A(_).showDeleteWarning.value ? (z(), t("div", {
6424
6430
  key: 0,
6425
6431
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
6426
6432
  style: {
@@ -6428,27 +6434,27 @@ var za = {
6428
6434
  "backdrop-filter": "blur(8px)",
6429
6435
  "-webkit-backdrop-filter": "blur(8px)"
6430
6436
  },
6431
- onClick: n[11] ||= r((...e) => A(b).cancelDelete && A(b).cancelDelete(...e), ["self"])
6432
- }, [i("div", ho, [
6433
- i("h3", go, I(u.value.mediaLibrary.deleteWarningTitle), 1),
6437
+ onClick: n[11] ||= r((...e) => A(_).cancelDelete && A(_).cancelDelete(...e), ["self"])
6438
+ }, [i("div", go, [
6439
+ i("h3", _o, I(u.value.mediaLibrary.deleteWarningTitle), 1),
6434
6440
  i("p", {
6435
- class: k(["tpl:text-xs", A(x).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
6441
+ class: O(["tpl:text-xs", A(y).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
6436
6442
  style: { color: "var(--tpl-text-muted)" }
6437
6443
  }, I(u.value.mediaLibrary.deleteWarningMessage), 3),
6438
- A(x).hasUsedFiles.value ? (z(), t("p", _o, I(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : M("", !0),
6439
- A(x).hasUsedFiles.value ? (z(), t("div", vo, [(z(!0), t(R, null, S(A(b).deleteUsageInfo.value, (e, n) => (z(), t("div", {
6444
+ A(y).hasUsedFiles.value ? (z(), t("p", vo, I(u.value.mediaLibrary.deleteWarningUsageNote), 1)) : M("", !0),
6445
+ A(y).hasUsedFiles.value ? (z(), t("div", yo, [(z(!0), t(R, null, S(A(_).deleteUsageInfo.value, (e, n) => (z(), t("div", {
6440
6446
  key: n,
6441
6447
  class: "tpl:text-xs",
6442
6448
  style: { color: "var(--tpl-text)" }
6443
- }, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", yo, I(A(x).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", bo, " - " + I(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : M("", !0)]))), 128))])) : M("", !0),
6444
- i("div", xo, [i("button", {
6449
+ }, [e.template_count > 0 ? (z(), t(R, { key: 0 }, [i("span", bo, I(A(y).displayItems.value.find((e) => e.id === n)?.filename || n), 1), i("span", xo, " - " + I(u.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : M("", !0)]))), 128))])) : M("", !0),
6450
+ i("div", So, [i("button", {
6445
6451
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6446
6452
  style: {
6447
6453
  "border-color": "var(--tpl-border)",
6448
6454
  color: "var(--tpl-text)",
6449
6455
  "background-color": "var(--tpl-bg)"
6450
6456
  },
6451
- onClick: n[9] ||= (...e) => A(b).cancelDelete && A(b).cancelDelete(...e)
6457
+ onClick: n[9] ||= (...e) => A(_).cancelDelete && A(_).cancelDelete(...e)
6452
6458
  }, I(u.value.mediaLibrary.cancel), 1), i("button", {
6453
6459
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6454
6460
  style: {
@@ -6456,31 +6462,31 @@ var za = {
6456
6462
  color: "var(--tpl-danger)",
6457
6463
  "background-color": "var(--tpl-danger-light)"
6458
6464
  },
6459
- onClick: n[10] ||= (...e) => A(b).confirmDelete && A(b).confirmDelete(...e)
6460
- }, I(A(x).hasUsedFiles.value ? u.value.mediaLibrary.deleteAnyway : u.value.mediaLibrary.confirmDelete), 1)])
6465
+ onClick: n[10] ||= (...e) => A(_).confirmDelete && A(_).confirmDelete(...e)
6466
+ }, I(A(y).hasUsedFiles.value ? u.value.mediaLibrary.deleteAnyway : u.value.mediaLibrary.confirmDelete), 1)])
6461
6467
  ])])) : M("", !0)]),
6462
6468
  _: 1
6463
6469
  }),
6464
- i("div", So, [i("div", Co, [A(b).previewItem.value ? (z(), h(ua, {
6470
+ i("div", Co, [i("div", wo, [A(_).previewItem.value ? (z(), h(da, {
6465
6471
  key: 0,
6466
- "selected-conversion": A(x).selectedConversion.value,
6467
- "onUpdate:selectedConversion": n[12] ||= (e) => A(x).selectedConversion.value = e,
6468
- item: A(b).previewItem.value,
6469
- folders: A(b).folders.value
6472
+ "selected-conversion": A(y).selectedConversion.value,
6473
+ "onUpdate:selectedConversion": n[12] ||= (e) => A(y).selectedConversion.value = e,
6474
+ item: A(_).previewItem.value,
6475
+ folders: A(_).folders.value
6470
6476
  }, null, 8, [
6471
6477
  "selected-conversion",
6472
6478
  "item",
6473
6479
  "folders"
6474
- ])) : M("", !0)]), i("div", wo, [A(b).selectedItems.value.size > 0 ? (z(), t("div", To, [A(b).previewItem.value ? (z(), t("button", {
6480
+ ])) : M("", !0)]), i("div", To, [A(_).selectedItems.value.size > 0 ? (z(), t("div", Eo, [A(_).previewItem.value ? (z(), t("button", {
6475
6481
  key: 0,
6476
6482
  class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6477
6483
  style: N({
6478
- borderColor: A(x).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
6479
- color: A(x).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
6484
+ borderColor: A(y).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
6485
+ color: A(y).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
6480
6486
  backgroundColor: "var(--tpl-bg)"
6481
6487
  }),
6482
- onClick: n[13] ||= (e) => A(x).copy(A(x).selectedUrl.value)
6483
- }, [A(x).copied.value ? (z(), h(A(D), {
6488
+ onClick: n[13] ||= (e) => A(y).copy(A(y).selectedUrl.value)
6489
+ }, [A(y).copied.value ? (z(), h(A(E), {
6484
6490
  key: 1,
6485
6491
  size: 12,
6486
6492
  "stroke-width": 2
@@ -6488,25 +6494,25 @@ var za = {
6488
6494
  key: 0,
6489
6495
  size: 12,
6490
6496
  "stroke-width": 2
6491
- })), j(" " + I(A(x).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : M("", !0), f.value ? (z(), t("div", Eo, [i("button", {
6497
+ })), j(" " + I(A(y).copied.value ? u.value.mediaLibrary.copied : u.value.mediaLibrary.copyUrl), 1)], 4)) : M("", !0), i("div", Do, [i("button", {
6492
6498
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6493
6499
  style: {
6494
6500
  "border-color": "var(--tpl-border)",
6495
6501
  color: "var(--tpl-text)",
6496
6502
  "background-color": "var(--tpl-bg)"
6497
6503
  },
6498
- onClick: n[14] ||= (e) => A(x).showMovePicker.value = !A(x).showMovePicker.value
6499
- }, I(u.value.mediaLibrary.moveSelected), 1), A(x).showMovePicker.value ? (z(), h($i, {
6504
+ onClick: n[14] ||= (e) => A(y).showMovePicker.value = !A(y).showMovePicker.value
6505
+ }, I(u.value.mediaLibrary.moveSelected), 1), A(y).showMovePicker.value ? (z(), h(ea, {
6500
6506
  key: 0,
6501
- folders: A(b).folders.value,
6502
- "current-folder-id": A(b).currentFolderId.value,
6503
- onSelect: A(x).handleMoveToFolder,
6504
- onClose: n[15] ||= (e) => A(x).showMovePicker.value = !1
6507
+ folders: A(_).folders.value,
6508
+ "current-folder-id": A(_).currentFolderId.value,
6509
+ onSelect: A(y).handleMoveToFolder,
6510
+ onClose: n[15] ||= (e) => A(y).showMovePicker.value = !1
6505
6511
  }, null, 8, [
6506
6512
  "folders",
6507
6513
  "current-folder-id",
6508
6514
  "onSelect"
6509
- ])) : M("", !0)])) : M("", !0)])) : M("", !0), i("div", Do, [A(b).selectedItems.value.size > 0 ? (z(), t("button", {
6515
+ ])) : M("", !0)])])) : M("", !0), i("div", Oo, [A(_).selectedItems.value.size > 0 ? (z(), t("button", {
6510
6516
  key: 0,
6511
6517
  class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
6512
6518
  style: {
@@ -6514,7 +6520,7 @@ var za = {
6514
6520
  color: "var(--tpl-danger)",
6515
6521
  "background-color": "var(--tpl-danger-light)"
6516
6522
  },
6517
- onClick: n[16] ||= (...e) => A(x).handleDeleteClick && A(x).handleDeleteClick(...e)
6523
+ onClick: n[16] ||= (...e) => A(y).handleDeleteClick && A(y).handleDeleteClick(...e)
6518
6524
  }, I(u.value.mediaLibrary.deleteSelected), 1)) : M("", !0), o.onSelect ? (z(), t("button", {
6519
6525
  key: 1,
6520
6526
  class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
@@ -6522,12 +6528,12 @@ var za = {
6522
6528
  "background-color": "var(--tpl-primary)",
6523
6529
  color: "var(--tpl-bg)"
6524
6530
  },
6525
- disabled: !A(b).previewItem.value,
6526
- onClick: C
6527
- }, I(u.value.mediaLibrary.selectFile), 9, Oo)) : M("", !0)])])])
6531
+ disabled: !A(_).previewItem.value,
6532
+ onClick: b
6533
+ }, I(u.value.mediaLibrary.selectFile), 9, ko)) : M("", !0)])])])
6528
6534
  ]));
6529
6535
  }
6530
- }), Ao = /* #__PURE__ */ Object.assign({
6536
+ }), jo = /* #__PURE__ */ Object.assign({
6531
6537
  "./locales/ca.ts": () => import("./chunks/ca-DnghH5Xn.js"),
6532
6538
  "./locales/de.ts": () => import("./chunks/de-ByQyu2jv.js"),
6533
6539
  "./locales/en.ts": () => import("./chunks/en-B-xajqfh.js"),
@@ -6536,73 +6542,73 @@ var za = {
6536
6542
  "./locales/nl.ts": () => import("./chunks/nl-DGT1t3Be.js"),
6537
6543
  "./locales/pt-BR.ts": () => import("./chunks/pt-BR-C0Hzc26R.js")
6538
6544
  });
6539
- function jo(e) {
6545
+ function Mo(e) {
6540
6546
  return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
6541
6547
  }
6542
- var Mo = jo(Ao);
6543
- function No(e) {
6544
- return e.trim().replace(/_/g, "-").toLowerCase();
6545
- }
6548
+ var No = Mo(jo);
6546
6549
  function Po(e) {
6547
- let t = No(e);
6548
- return Mo.find((e) => No(e) === t);
6550
+ return e.trim().replace(/_/g, "-").toLowerCase();
6549
6551
  }
6550
6552
  function Fo(e) {
6551
- return No(e).split("-")[0];
6553
+ let t = Po(e);
6554
+ return No.find((e) => Po(e) === t);
6552
6555
  }
6553
6556
  function Io(e) {
6554
- return Po(e) ?? Po(Fo(e)) ?? "en";
6557
+ return Po(e).split("-")[0];
6558
+ }
6559
+ function Lo(e) {
6560
+ return Fo(e) ?? Fo(Io(e)) ?? "en";
6555
6561
  }
6556
- async function Lo(e) {
6557
- let t = Ao[`./locales/${Io(e)}.ts`];
6562
+ async function Ro(e) {
6563
+ let t = jo[`./locales/${Lo(e)}.ts`];
6558
6564
  return (await t()).default;
6559
6565
  }
6560
6566
  //#endregion
6561
6567
  //#region src/standalone/visual.ts
6562
- var Ro = null, zo = e(null);
6563
- async function Bo(e) {
6568
+ var zo = null, Bo = e(null);
6569
+ async function Vo(e) {
6564
6570
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
6565
6571
  if (!t) throw Error(`Container element not found: ${e.container}`);
6566
6572
  let n = Ce(e.auth, e.onError);
6567
6573
  await n.initialize();
6568
- let r = await new ke(n).fetchConfig(), i = await Lo(e.locale ?? "en");
6569
- return Ho(t, e.theme), Ro && Vo(), new Promise((a, s) => {
6574
+ let r = await new ke(n).fetchConfig(), i = await Ro(e.locale ?? "en");
6575
+ return Uo(t, e.theme), zo && Ho(), new Promise((a, s) => {
6570
6576
  try {
6571
- Ro = be({ setup() {
6577
+ zo = be({ setup() {
6572
6578
  let s = () => {
6573
6579
  a({
6574
- setTheme: (e) => Ho(t, e),
6575
- unmount: Vo
6580
+ setTheme: (e) => Uo(t, e),
6581
+ unmount: Ho
6576
6582
  });
6577
6583
  };
6578
- return () => o(ko, {
6584
+ return () => o(Ao, {
6579
6585
  authManager: n,
6580
6586
  projectId: n.projectId,
6581
6587
  planConfig: r,
6582
6588
  translations: i,
6583
6589
  onSelect: e.onSelect,
6584
6590
  onError: e.onError,
6585
- ref: zo,
6591
+ ref: Bo,
6586
6592
  onReady: s
6587
6593
  });
6588
- } }), Ro.mount(t);
6594
+ } }), zo.mount(t);
6589
6595
  } catch (e) {
6590
6596
  s(e);
6591
6597
  }
6592
6598
  });
6593
6599
  }
6594
- function Vo() {
6595
- Ro && (Ro.unmount(), Ro = null, zo.value = null);
6600
+ function Ho() {
6601
+ zo && (zo.unmount(), zo = null, Bo.value = null);
6596
6602
  }
6597
- function Ho(e, t) {
6603
+ function Uo(e, t) {
6598
6604
  t && (t.primaryColor && e.style.setProperty("--tpl-primary", t.primaryColor), t.borderRadius !== void 0 && (e.style.setProperty("--tpl-radius", `${t.borderRadius}px`), e.style.setProperty("--tpl-radius-sm", `${Math.max(0, t.borderRadius - 3)}px`), e.style.setProperty("--tpl-radius-lg", `${t.borderRadius + 4}px`)));
6599
6605
  }
6600
- var Uo = {
6601
- init: Bo,
6602
- unmount: Vo
6606
+ var Wo = {
6607
+ init: Vo,
6608
+ unmount: Ho
6603
6609
  };
6604
- typeof window < "u" && (window.TemplaticalMedia = Uo);
6610
+ typeof window < "u" && (window.TemplaticalMedia = Wo);
6605
6611
  //#endregion
6606
- export { Uo as default, Bo as init, Vo as unmount };
6612
+ export { Wo as default, Vo as init, Ho as unmount };
6607
6613
 
6608
6614
  //# sourceMappingURL=media-library.js.map