@templatical/media-library 0.24.0 → 0.24.1

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.
@@ -838,7 +838,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
838
838
  }, st = {
839
839
  key: 3,
840
840
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:opacity-0 tpl:transition-opacity tpl:group-hover:opacity-100"
841
- }, ct = ["title"], lt = ["title"], ut = { key: 0 }, dt = ["placeholder"], ft = 5, pt = /* @__PURE__ */ h({
841
+ }, ct = ["title"], lt = ["title"], ut = { key: 0 }, dt = ["placeholder"], ft = /* @__PURE__ */ h({
842
842
  __name: "MediaFolderTreeNode",
843
843
  props: {
844
844
  folder: {},
@@ -852,7 +852,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
852
852
  "deleteFolder"
853
853
  ],
854
854
  setup(e, { emit: t }) {
855
- let n = e, r = t, { t: a } = Z(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth < ft - 1), x = s(() => n.currentFolderId === n.folder.id), C = s(() => !n.currentFolderId || !n.folder.children ? !1 : j(n.folder.children, n.currentFolderId)), O = s(() => o.value || C.value);
855
+ let n = e, r = t, { t: a } = Z(), o = w(!1), c = w(!1), p = w(""), h = w(!1), g = w(""), _ = s(() => (n.folder.children?.length ?? 0) > 0), v = s(() => n.depth < 4), x = s(() => n.currentFolderId === n.folder.id), C = s(() => !n.currentFolderId || !n.folder.children ? !1 : j(n.folder.children, n.currentFolderId)), O = s(() => o.value || C.value);
856
856
  function j(e, t) {
857
857
  for (let n of e) if (n.id === t || n.children && j(n.children, t)) return !0;
858
858
  return !1;
@@ -981,10 +981,10 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
981
981
  }, null, 40, dt), [[A, g.value]])], 4)) : u("", !0)])) : u("", !0)]);
982
982
  };
983
983
  }
984
- }), mt = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, ht = {
984
+ }), pt = { class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto" }, mt = {
985
985
  key: 0,
986
986
  class: "tpl:px-3 tpl:py-2"
987
- }, gt = ["placeholder"], _t = /* @__PURE__ */ h({
987
+ }, ht = ["placeholder"], gt = /* @__PURE__ */ h({
988
988
  __name: "MediaFolderTree",
989
989
  props: {
990
990
  folders: {},
@@ -1010,7 +1010,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1010
1010
  function h() {
1011
1011
  a.value = !1, o.value = "";
1012
1012
  }
1013
- return (t, g) => (S(), d("div", mt, [
1013
+ return (t, g) => (S(), d("div", pt, [
1014
1014
  f("button", {
1015
1015
  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",
1016
1016
  style: b({
@@ -1022,7 +1022,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1022
1022
  size: 14,
1023
1023
  "stroke-width": 1.5
1024
1024
  }), p(" " + D(k(r).mediaLibrary.allFiles), 1)], 4),
1025
- (S(!0), d(i, null, T(e.folders, (t) => (S(), l(pt, {
1025
+ (S(!0), d(i, null, T(e.folders, (t) => (S(), l(ft, {
1026
1026
  key: t.id,
1027
1027
  folder: t,
1028
1028
  "current-folder-id": e.currentFolderId,
@@ -1032,7 +1032,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1032
1032
  onRenameFolder: g[3] ||= (e, t) => n("renameFolder", e, t),
1033
1033
  onDeleteFolder: g[4] ||= (e) => n("deleteFolder", e)
1034
1034
  }, null, 8, ["folder", "current-folder-id"]))), 128)),
1035
- a.value ? (S(), d("div", ht, [N(f("input", {
1035
+ a.value ? (S(), d("div", mt, [N(f("input", {
1036
1036
  "onUpdate:modelValue": g[5] ||= (e) => o.value = e,
1037
1037
  type: "text",
1038
1038
  class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
@@ -1045,7 +1045,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1045
1045
  autofocus: "",
1046
1046
  onKeydown: [P(c, ["enter"]), P(h, ["escape"])],
1047
1047
  onBlur: c
1048
- }, null, 40, gt), [[A, o.value]])])) : u("", !0),
1048
+ }, null, 40, ht), [[A, o.value]])])) : u("", !0),
1049
1049
  a.value ? u("", !0) : (S(), d("button", {
1050
1050
  key: 1,
1051
1051
  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",
@@ -1071,7 +1071,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1071
1071
  }), p(" " + D(k(r).mediaLibrary.frequentlyUsed), 1)], 4)) : u("", !0)
1072
1072
  ]));
1073
1073
  }
1074
- }), vt = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, yt = /* @__PURE__ */ h({
1074
+ }), _t = { class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2" }, vt = /* @__PURE__ */ h({
1075
1075
  __name: "MediaFileIcon",
1076
1076
  props: { mimeType: {} },
1077
1077
  setup(e) {
@@ -1172,7 +1172,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1172
1172
  bgColor: "#f9fafb",
1173
1173
  icon: "document"
1174
1174
  }, i = s(() => n[t.mimeType] ?? r);
1175
- return (e, t) => (S(), d("div", vt, [i.value.icon === "document" ? (S(), d("svg", {
1175
+ return (e, t) => (S(), d("div", _t, [i.value.icon === "document" ? (S(), d("svg", {
1176
1176
  key: 0,
1177
1177
  width: "60",
1178
1178
  height: "60",
@@ -1241,48 +1241,48 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1241
1241
  style: b({ color: i.value.color })
1242
1242
  }, D(i.value.label), 5)]));
1243
1243
  }
1244
- }), bt = { class: "tpl:p-4" }, xt = {
1244
+ }), yt = { class: "tpl:p-4" }, bt = {
1245
1245
  key: 1,
1246
1246
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
1247
- }, St = {
1247
+ }, xt = {
1248
1248
  class: "tpl:text-xs",
1249
1249
  style: { color: "var(--tpl-text-muted)" }
1250
- }, Ct = {
1250
+ }, St = {
1251
1251
  key: 2,
1252
1252
  class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
1253
- }, wt = ["onClick"], Tt = { class: "tpl:aspect-square" }, Et = ["src", "alt"], Dt = { class: "tpl:px-2 tpl:py-1.5" }, Ot = {
1253
+ }, Ct = ["onClick"], wt = { class: "tpl:aspect-square" }, Tt = ["src", "alt"], Et = { class: "tpl:px-2 tpl:py-1.5" }, Dt = {
1254
1254
  class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
1255
1255
  style: { color: "var(--tpl-text)" }
1256
- }, kt = {
1256
+ }, Ot = {
1257
1257
  class: "tpl:flex tpl:justify-between tpl:text-[9px]",
1258
1258
  style: { color: "var(--tpl-text-muted)" }
1259
- }, At = { key: 0 }, jt = { 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" }, Mt = ["title", "onClick"], Nt = ["title", "onClick"], Pt = {
1259
+ }, kt = { key: 0 }, At = { 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" }, jt = ["title", "onClick"], Mt = ["title", "onClick"], Nt = {
1260
1260
  key: 0,
1261
1261
  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",
1262
1262
  style: { "background-color": "var(--tpl-primary)" }
1263
- }, Ft = {
1263
+ }, Pt = {
1264
1264
  key: 3,
1265
1265
  class: "tpl:flex tpl:flex-col tpl:gap-1"
1266
- }, It = ["onClick"], Lt = {
1266
+ }, Ft = ["onClick"], It = {
1267
1267
  class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
1268
1268
  style: { "background-color": "var(--tpl-bg-hover)" }
1269
- }, Rt = ["src", "alt"], zt = {
1269
+ }, Lt = ["src", "alt"], Rt = {
1270
1270
  key: 1,
1271
1271
  class: "tpl-list-icon tpl:size-full"
1272
- }, Bt = { class: "tpl:min-w-0 tpl:flex-1" }, Vt = {
1272
+ }, zt = { class: "tpl:min-w-0 tpl:flex-1" }, Bt = {
1273
1273
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1274
1274
  style: { color: "var(--tpl-text)" }
1275
- }, Ht = {
1275
+ }, Vt = {
1276
1276
  class: "tpl:text-[10px]",
1277
1277
  style: { color: "var(--tpl-text-muted)" }
1278
- }, Ut = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Wt = ["title", "onClick"], Gt = ["title", "onClick"], Kt = {
1278
+ }, Ht = { class: "tpl:flex tpl:gap-1 tpl:opacity-0 tpl:transition-opacity tpl:duration-150 tpl:group-hover:opacity-100" }, Ut = ["title", "onClick"], Wt = ["title", "onClick"], Gt = {
1279
1279
  key: 0,
1280
1280
  class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1281
1281
  style: { "background-color": "var(--tpl-primary)" }
1282
- }, qt = {
1282
+ }, Kt = {
1283
1283
  key: 4,
1284
1284
  class: "tpl:flex tpl:justify-center tpl:py-4"
1285
- }, Jt = /*#__PURE__*/ rt(/* @__PURE__ */ h({
1285
+ }, qt = /*#__PURE__*/ rt(/* @__PURE__ */ h({
1286
1286
  __name: "MediaGrid",
1287
1287
  props: {
1288
1288
  items: {},
@@ -1312,7 +1312,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1312
1312
  e && n.hasMore && !n.isLoading && r("loadMore");
1313
1313
  }, { threshold: .1 });
1314
1314
  function _(e) {
1315
- return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1315
+ return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
1316
1316
  }
1317
1317
  function v(e) {
1318
1318
  return new Date(e).toLocaleDateString(void 0, {
@@ -1321,7 +1321,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1321
1321
  day: "numeric"
1322
1322
  });
1323
1323
  }
1324
- return (t, n) => (S(), d("div", bt, [
1324
+ return (t, n) => (S(), d("div", yt, [
1325
1325
  e.isLoading && e.items.length === 0 ? (S(), d("div", {
1326
1326
  key: 0,
1327
1327
  class: y(e.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
@@ -1329,26 +1329,26 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1329
1329
  key: t,
1330
1330
  class: y(["tpl-pulse tpl:rounded-lg", e.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
1331
1331
  style: { "background-color": "var(--tpl-bg-hover)" }
1332
- }, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", xt, [m(k(z), {
1332
+ }, null, 2)), 64))], 2)) : e.items.length === 0 ? (S(), d("div", bt, [m(k(z), {
1333
1333
  class: "tpl:mb-3",
1334
1334
  size: 40,
1335
1335
  "stroke-width": 1,
1336
1336
  style: { color: "var(--tpl-text-dim)" }
1337
- }), f("p", St, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Ft, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1337
+ }), f("p", xt, D(k(h).mediaLibrary.noFiles), 1)])) : e.layout === "list" ? (S(), d("div", Pt, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1338
1338
  key: t.id,
1339
1339
  class: y(["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", [!s(t) && !e.selectedIds.has(t.id) ? "tpl:opacity-60" : ""]]),
1340
1340
  style: b({ backgroundColor: e.selectedIds.has(t.id) ? "var(--tpl-bg-hover)" : "transparent" }),
1341
1341
  onClick: (e) => c(t)
1342
1342
  }, [
1343
- f("div", Lt, [k(o)(t.mime_type) ? (S(), d("img", {
1343
+ f("div", It, [k(o)(t.mime_type) ? (S(), d("img", {
1344
1344
  key: 0,
1345
1345
  src: t.small_url || t.url,
1346
1346
  alt: t.filename,
1347
1347
  class: "tpl:size-full tpl:object-cover",
1348
1348
  loading: "lazy"
1349
- }, null, 8, Rt)) : (S(), d("div", zt, [m(yt, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
1350
- f("div", Bt, [f("p", Vt, D(t.filename), 1), f("p", Ht, [p(D(_(t.size)) + " · " + D(v(t.created_at)) + " ", 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d(i, { key: 0 }, [p(" · " + D(t.width) + "×" + D(t.height), 1)], 64)) : u("", !0)])]),
1351
- f("div", Ut, [f("button", {
1349
+ }, null, 8, Lt)) : (S(), d("div", Rt, [m(vt, { "mime-type": t.mime_type }, null, 8, ["mime-type"])]))]),
1350
+ f("div", zt, [f("p", Bt, D(t.filename), 1), f("p", Vt, [p(D(_(t.size)) + " · " + D(v(t.created_at)) + " ", 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d(i, { key: 0 }, [p(" · " + D(t.width) + "×" + D(t.height), 1)], 64)) : u("", !0)])]),
1351
+ f("div", Ht, [f("button", {
1352
1352
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
1353
1353
  style: { color: "var(--tpl-text-muted)" },
1354
1354
  title: k(h).mediaLibrary.editFile,
@@ -1356,7 +1356,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1356
1356
  }, [m(k(K), {
1357
1357
  size: 12,
1358
1358
  "stroke-width": 2
1359
- })], 8, Wt), f("button", {
1359
+ })], 8, Ut), f("button", {
1360
1360
  class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
1361
1361
  style: { color: "var(--tpl-text-muted)" },
1362
1362
  title: k(h).mediaLibrary.replaceFile,
@@ -1364,12 +1364,12 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1364
1364
  }, [m(k(J), {
1365
1365
  size: 12,
1366
1366
  "stroke-width": 2
1367
- })], 8, Gt)]),
1368
- e.selectedIds.has(t.id) ? (S(), d("div", Kt, [m(k(I), {
1367
+ })], 8, Wt)]),
1368
+ e.selectedIds.has(t.id) ? (S(), d("div", Gt, [m(k(I), {
1369
1369
  size: 12,
1370
1370
  "stroke-width": 3
1371
1371
  })])) : u("", !0)
1372
- ], 14, It))), 128))])) : (S(), d("div", Ct, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1372
+ ], 14, Ft))), 128))])) : (S(), d("div", St, [(S(!0), d(i, null, T(e.items, (t) => (S(), d("div", {
1373
1373
  key: t.id,
1374
1374
  class: y(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
1375
1375
  "tpl:cursor-pointer",
@@ -1382,18 +1382,18 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1382
1382
  }),
1383
1383
  onClick: (e) => c(t)
1384
1384
  }, [
1385
- f("div", Tt, [k(o)(t.mime_type) ? (S(), d("img", {
1385
+ f("div", wt, [k(o)(t.mime_type) ? (S(), d("img", {
1386
1386
  key: 0,
1387
1387
  src: t.small_url || t.url,
1388
1388
  alt: t.filename,
1389
1389
  class: "tpl:size-full tpl:object-cover",
1390
1390
  loading: "lazy"
1391
- }, null, 8, Et)) : (S(), l(yt, {
1391
+ }, null, 8, Tt)) : (S(), l(vt, {
1392
1392
  key: 1,
1393
1393
  "mime-type": t.mime_type
1394
1394
  }, null, 8, ["mime-type"]))]),
1395
- f("div", Dt, [f("p", Ot, D(t.filename), 1), f("p", kt, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", At, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
1396
- f("div", jt, [f("button", {
1395
+ f("div", Et, [f("p", Dt, D(t.filename), 1), f("p", Ot, [f("span", null, D(_(t.size)), 1), k(o)(t.mime_type) && t.width && t.height ? (S(), d("span", kt, D(t.width) + "×" + D(t.height), 1)) : u("", !0)])]),
1396
+ f("div", At, [f("button", {
1397
1397
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1398
1398
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
1399
1399
  title: k(h).mediaLibrary.editFile,
@@ -1401,7 +1401,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1401
1401
  }, [m(k(K), {
1402
1402
  size: 11,
1403
1403
  "stroke-width": 2
1404
- })], 8, Mt), f("button", {
1404
+ })], 8, jt), f("button", {
1405
1405
  class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-white",
1406
1406
  style: { "background-color": "rgba(0, 0, 0, 0.6)" },
1407
1407
  title: k(h).mediaLibrary.replaceFile,
@@ -1409,18 +1409,18 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1409
1409
  }, [m(k(J), {
1410
1410
  size: 11,
1411
1411
  "stroke-width": 2
1412
- })], 8, Nt)]),
1413
- e.selectedIds.has(t.id) ? (S(), d("div", Pt, [m(k(I), {
1412
+ })], 8, Mt)]),
1413
+ e.selectedIds.has(t.id) ? (S(), d("div", Nt, [m(k(I), {
1414
1414
  size: 12,
1415
1415
  "stroke-width": 3
1416
1416
  })])) : u("", !0)
1417
- ], 14, wt))), 128))])),
1417
+ ], 14, Ct))), 128))])),
1418
1418
  f("div", {
1419
1419
  ref_key: "sentinelRef",
1420
1420
  ref: g,
1421
1421
  class: "tpl:h-4"
1422
1422
  }, null, 512),
1423
- e.isLoading && e.items.length > 0 ? (S(), d("div", qt, [m(k(W), {
1423
+ e.isLoading && e.items.length > 0 ? (S(), d("div", Kt, [m(k(W), {
1424
1424
  class: "tpl-spinner",
1425
1425
  size: 20,
1426
1426
  "stroke-width": 2,
@@ -1428,20 +1428,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1428
1428
  })])) : u("", !0)
1429
1429
  ]));
1430
1430
  }
1431
- }), [["__scopeId", "data-v-9db961d1"]]), Yt = ["data-tpl-theme"], Xt = {
1431
+ }), [["__scopeId", "data-v-9db961d1"]]), Jt = ["data-tpl-theme"], Yt = {
1432
1432
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1433
1433
  style: { "background-color": "var(--tpl-bg-elevated)" }
1434
- }, Zt = {
1434
+ }, Xt = {
1435
1435
  class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
1436
1436
  style: { color: "var(--tpl-text)" }
1437
- }, Qt = { class: "tpl:mb-3" }, $t = ["placeholder", "disabled"], en = {
1437
+ }, Zt = { class: "tpl:mb-3" }, Qt = ["placeholder", "disabled"], $t = {
1438
1438
  key: 0,
1439
1439
  class: "tpl:mb-3 tpl:text-xs",
1440
1440
  style: { color: "var(--tpl-danger)" }
1441
- }, tn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, nn = ["disabled"], rn = ["disabled"], an = {
1441
+ }, en = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, tn = ["disabled"], nn = ["disabled"], rn = {
1442
1442
  key: 0,
1443
1443
  class: "tpl:flex tpl:items-center tpl:gap-1.5"
1444
- }, on = { key: 1 }, sn = /* @__PURE__ */ h({
1444
+ }, an = { key: 1 }, on = /* @__PURE__ */ h({
1445
1445
  __name: "MediaImportUrlModal",
1446
1446
  props: {
1447
1447
  visible: { type: Boolean },
@@ -1479,9 +1479,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1479
1479
  style: { "background-color": "var(--tpl-overlay)" },
1480
1480
  onClick: F(v, ["self"]),
1481
1481
  onKeydown: b
1482
- }, [f("div", Xt, [
1483
- f("h3", Zt, D(k(i).mediaLibrary.importFromUrl), 1),
1484
- f("div", Qt, [N(f("input", {
1482
+ }, [f("div", Yt, [
1483
+ f("h3", Xt, D(k(i).mediaLibrary.importFromUrl), 1),
1484
+ f("div", Zt, [N(f("input", {
1485
1485
  "onUpdate:modelValue": n[0] ||= (e) => h.value = e,
1486
1486
  type: "url",
1487
1487
  class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
@@ -1493,9 +1493,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1493
1493
  placeholder: k(i).mediaLibrary.importUrlPlaceholder,
1494
1494
  disabled: e.isImporting,
1495
1495
  autofocus: ""
1496
- }, null, 8, $t), [[A, h.value]])]),
1497
- e.error ? (S(), d("p", en, D(e.error), 1)) : u("", !0),
1498
- f("div", tn, [f("button", {
1496
+ }, null, 8, Qt), [[A, h.value]])]),
1497
+ e.error ? (S(), d("p", $t, D(e.error), 1)) : u("", !0),
1498
+ f("div", en, [f("button", {
1499
1499
  class: y(["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": e.isImporting }]),
1500
1500
  style: {
1501
1501
  "border-color": "var(--tpl-border)",
@@ -1504,25 +1504,25 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1504
1504
  },
1505
1505
  disabled: e.isImporting,
1506
1506
  onClick: v
1507
- }, D(k(i).mediaLibrary.cancel), 11, nn), f("button", {
1507
+ }, D(k(i).mediaLibrary.cancel), 11, tn), f("button", {
1508
1508
  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",
1509
1509
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
1510
1510
  disabled: !h.value.trim() || e.isImporting,
1511
1511
  onClick: g
1512
- }, [e.isImporting ? (S(), d("span", an, [m(k(W), {
1512
+ }, [e.isImporting ? (S(), d("span", rn, [m(k(W), {
1513
1513
  class: "tpl:animate-spin",
1514
1514
  size: 12,
1515
1515
  "stroke-width": 2
1516
- }), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", on, D(k(i).mediaLibrary.import), 1))], 8, rn)])
1517
- ])], 40, Yt)) : u("", !0)]),
1516
+ }), p(" " + D(k(i).mediaLibrary.importing), 1)])) : (S(), d("span", an, D(k(i).mediaLibrary.import), 1))], 8, nn)])
1517
+ ])], 40, Jt)) : u("", !0)]),
1518
1518
  _: 1
1519
1519
  })], 8, ["to"]));
1520
1520
  }
1521
- }), cn = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, ln = ["disabled", "onClick"], un = { class: "tpl:truncate" }, dn = {
1521
+ }), sn = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, cn = ["disabled", "onClick"], ln = { class: "tpl:truncate" }, un = {
1522
1522
  key: 0,
1523
1523
  class: "tpl:shrink-0",
1524
1524
  style: { color: "var(--tpl-text-dim)" }
1525
- }, fn = /* @__PURE__ */ h({
1525
+ }, dn = /* @__PURE__ */ h({
1526
1526
  __name: "MediaMovePicker",
1527
1527
  props: {
1528
1528
  folders: {},
@@ -1550,7 +1550,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1550
1550
  "border-color": "var(--tpl-border)",
1551
1551
  "background-color": "var(--tpl-bg-elevated)"
1552
1552
  }
1553
- }, [f("div", cn, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
1553
+ }, [f("div", sn, [e.currentFolderId === null ? u("", !0) : (S(), d("button", {
1554
1554
  key: 0,
1555
1555
  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",
1556
1556
  style: { color: "var(--tpl-text)" },
@@ -1575,27 +1575,27 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1575
1575
  size: 14,
1576
1576
  "stroke-width": 1.5
1577
1577
  }),
1578
- f("span", un, D(t.name), 1),
1579
- t.id === e.currentFolderId ? (S(), d("span", dn, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
1580
- ], 12, ln))), 128))])], 512));
1578
+ f("span", ln, D(t.name), 1),
1579
+ t.id === e.currentFolderId ? (S(), d("span", un, D(k(r).mediaLibrary.currentFolder), 1)) : u("", !0)
1580
+ ], 12, cn))), 128))])], 512));
1581
1581
  }
1582
- }), pn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, mn = ["src", "alt"], hn = {
1582
+ }), fn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, pn = ["src", "alt"], mn = {
1583
1583
  key: 1,
1584
1584
  class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
1585
1585
  style: { border: "1px solid var(--tpl-border)" }
1586
- }, gn = { class: "tpl:min-w-0 tpl:flex-1" }, _n = {
1586
+ }, hn = { class: "tpl:min-w-0 tpl:flex-1" }, gn = {
1587
1587
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1588
1588
  style: { color: "var(--tpl-text)" }
1589
- }, vn = {
1589
+ }, _n = {
1590
1590
  class: "tpl:mt-0.5 tpl:text-[10px]",
1591
1591
  style: { color: "var(--tpl-text-muted)" }
1592
- }, yn = {
1592
+ }, vn = {
1593
1593
  key: 2,
1594
1594
  class: "tpl:shrink-0"
1595
- }, bn = {
1595
+ }, yn = {
1596
1596
  class: "tpl:block tpl:text-[10px]",
1597
1597
  style: { color: "var(--tpl-text-muted)" }
1598
- }, xn = ["value"], Sn = ["value"], Cn = /*#__PURE__*/ rt(/* @__PURE__ */ h({
1598
+ }, bn = ["value"], xn = ["value"], Sn = /*#__PURE__*/ rt(/* @__PURE__ */ h({
1599
1599
  __name: "MediaPreviewPanel",
1600
1600
  props: {
1601
1601
  item: {},
@@ -1654,7 +1654,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1654
1654
  return e ? e.join("/") : null;
1655
1655
  }), b = s(() => o(n.item.mime_type));
1656
1656
  function x(e) {
1657
- return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1657
+ return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
1658
1658
  }
1659
1659
  function C(e) {
1660
1660
  return new Date(e).toLocaleDateString(void 0, {
@@ -1663,20 +1663,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1663
1663
  day: "numeric"
1664
1664
  });
1665
1665
  }
1666
- return (t, n) => (S(), d("div", pn, [
1666
+ return (t, n) => (S(), d("div", fn, [
1667
1667
  b.value ? (S(), d("img", {
1668
1668
  key: 0,
1669
1669
  src: h.value ?? void 0,
1670
1670
  alt: e.item.alt_text || e.item.filename,
1671
1671
  class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
1672
1672
  style: { border: "1px solid var(--tpl-border)" }
1673
- }, null, 8, mn)) : (S(), d("div", hn, [m(yt, {
1673
+ }, null, 8, pn)) : (S(), d("div", mn, [m(vt, {
1674
1674
  "mime-type": e.item.mime_type,
1675
1675
  class: "tpl-preview-icon"
1676
1676
  }, null, 8, ["mime-type"])])),
1677
- f("div", gn, [
1678
- f("p", _n, D(e.item.filename), 1),
1679
- f("p", vn, [
1677
+ f("div", hn, [
1678
+ f("p", gn, D(e.item.filename), 1),
1679
+ f("p", _n, [
1680
1680
  p(D(x(e.item.size)) + " · " + D(C(e.item.created_at)) + " ", 1),
1681
1681
  b.value && e.item.width && e.item.height ? (S(), d(i, { key: 0 }, [p(" · " + D(e.item.width) + "×" + D(e.item.height) + "px ", 1)], 64)) : u("", !0),
1682
1682
  v.value ? (S(), d(i, { key: 1 }, [
@@ -1695,7 +1695,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1695
1695
  style: { color: "var(--tpl-text-dim)" }
1696
1696
  }, D(e.item.alt_text || "\xA0"), 3)) : u("", !0)
1697
1697
  ]),
1698
- l.value ? (S(), d("div", yn, [f("label", bn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
1698
+ l.value ? (S(), d("div", vn, [f("label", yn, D(k(a).mediaLibrary.conversionLabel), 1), f("select", {
1699
1699
  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",
1700
1700
  style: {
1701
1701
  "border-color": "var(--tpl-border)",
@@ -1707,36 +1707,36 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1707
1707
  }, [(S(!0), d(i, null, T(c.value, (e) => (S(), d("option", {
1708
1708
  key: e.value,
1709
1709
  value: e.value
1710
- }, D(e.label), 9, Sn))), 128))], 40, xn)])) : u("", !0)
1710
+ }, D(e.label), 9, xn))), 128))], 40, bn)])) : u("", !0)
1711
1711
  ]));
1712
1712
  }
1713
- }), [["__scopeId", "data-v-060e36cd"]]), wn = ["data-tpl-theme"], Tn = {
1713
+ }), [["__scopeId", "data-v-060e36cd"]]), Cn = ["data-tpl-theme"], wn = {
1714
1714
  class: "tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1715
1715
  style: { "background-color": "var(--tpl-bg-elevated)" }
1716
- }, En = {
1716
+ }, Tn = {
1717
1717
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
1718
1718
  style: { color: "var(--tpl-text)" }
1719
- }, Dn = {
1719
+ }, En = {
1720
1720
  class: "tpl:mb-2 tpl:text-xs",
1721
1721
  style: { color: "var(--tpl-text-muted)" }
1722
- }, On = {
1722
+ }, Dn = {
1723
1723
  key: 0,
1724
1724
  class: "tpl:mb-3 tpl:text-xs",
1725
1725
  style: { color: "var(--tpl-warning)" }
1726
- }, kn = {
1726
+ }, On = {
1727
1727
  class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
1728
1728
  style: { "border-color": "var(--tpl-border)" }
1729
- }, An = {
1729
+ }, kn = {
1730
1730
  class: "tpl:truncate tpl:text-xs tpl:font-medium",
1731
1731
  style: { color: "var(--tpl-text)" }
1732
- }, jn = { class: "tpl:mb-4" }, Mn = {
1732
+ }, An = { class: "tpl:mb-4" }, jn = {
1733
1733
  class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
1734
1734
  style: { color: "var(--tpl-text-muted)" }
1735
- }, Nn = ["accept"], Pn = {
1735
+ }, Mn = ["accept"], Nn = {
1736
1736
  key: 1,
1737
1737
  class: "tpl:mb-3 tpl:text-xs",
1738
1738
  style: { color: "var(--tpl-danger)" }
1739
- }, Fn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, In = ["disabled"], Ln = ["disabled"], Rn = /* @__PURE__ */ h({
1739
+ }, Pn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Fn = ["disabled"], In = ["disabled"], Ln = /* @__PURE__ */ h({
1740
1740
  __name: "MediaReplaceModal",
1741
1741
  props: {
1742
1742
  visible: { type: Boolean },
@@ -1780,12 +1780,12 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1780
1780
  style: { "background-color": "var(--tpl-overlay)" },
1781
1781
  onClick: n[1] ||= F((e) => r("close"), ["self"]),
1782
1782
  onKeydown: T
1783
- }, [f("div", Tn, [
1784
- f("h3", En, D(k(i).mediaLibrary.replaceWarningTitle), 1),
1785
- f("p", Dn, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
1786
- b.value ? (S(), d("p", On, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
1787
- f("div", kn, [f("p", An, D(e.item.filename), 1)]),
1788
- f("div", jn, [f("label", Mn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
1783
+ }, [f("div", wn, [
1784
+ f("h3", Tn, D(k(i).mediaLibrary.replaceWarningTitle), 1),
1785
+ f("p", En, D(k(i).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${v.value}`)), 1),
1786
+ b.value ? (S(), d("p", Dn, D(k(i).mediaLibrary.replaceWarningUsageNote.replace("{count}", e.usageInfo.template_count.toString())), 1)) : u("", !0),
1787
+ f("div", On, [f("p", kn, D(e.item.filename), 1)]),
1788
+ f("div", An, [f("label", jn, D(k(i).mediaLibrary.replaceSelectFile), 1), f("input", {
1789
1789
  ref_key: "fileInputRef",
1790
1790
  ref: h,
1791
1791
  type: "file",
@@ -1797,9 +1797,9 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1797
1797
  color: "var(--tpl-text)"
1798
1798
  },
1799
1799
  onChange: x
1800
- }, null, 40, Nn)]),
1801
- e.error ? (S(), d("p", Pn, D(e.error), 1)) : u("", !0),
1802
- f("div", Fn, [f("button", {
1800
+ }, null, 40, Mn)]),
1801
+ e.error ? (S(), d("p", Nn, D(e.error), 1)) : u("", !0),
1802
+ f("div", Pn, [f("button", {
1803
1803
  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",
1804
1804
  style: {
1805
1805
  "border-color": "var(--tpl-border)",
@@ -1808,29 +1808,29 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1808
1808
  },
1809
1809
  disabled: e.isReplacing,
1810
1810
  onClick: n[0] ||= (e) => r("close")
1811
- }, D(k(i).mediaLibrary.cancel), 9, In), f("button", {
1811
+ }, D(k(i).mediaLibrary.cancel), 9, Fn), f("button", {
1812
1812
  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",
1813
1813
  style: { background: "linear-gradient(\n 135deg,\n var(--tpl-primary),\n var(--tpl-primary-hover)\n )" },
1814
1814
  disabled: !g.value || e.isReplacing,
1815
1815
  onClick: C
1816
- }, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, Ln)])
1817
- ])], 40, wn)) : u("", !0)]),
1816
+ }, D(e.isReplacing ? k(i).mediaLibrary.replacing : k(i).mediaLibrary.replace), 9, In)])
1817
+ ])], 40, Cn)) : u("", !0)]),
1818
1818
  _: 1
1819
1819
  })], 8, ["to"]));
1820
1820
  }
1821
- }), zn = {
1821
+ }), Rn = {
1822
1822
  key: 0,
1823
1823
  class: "tpl:flex tpl:items-center tpl:gap-2"
1824
- }, Bn = {
1824
+ }, zn = {
1825
1825
  class: "tpl:text-xs",
1826
1826
  style: { color: "var(--tpl-text-muted)" }
1827
- }, Vn = {
1827
+ }, Bn = {
1828
1828
  class: "tpl:text-xs",
1829
1829
  style: { color: "var(--tpl-text-muted)" }
1830
- }, Hn = {
1830
+ }, Vn = {
1831
1831
  class: "tpl:mt-1 tpl:text-[10px]",
1832
1832
  style: { color: "var(--tpl-text-dim)" }
1833
- }, Un = /* @__PURE__ */ h({
1833
+ }, Hn = /* @__PURE__ */ h({
1834
1834
  __name: "MediaUploadZone",
1835
1835
  props: {
1836
1836
  isUploading: { type: Boolean },
@@ -1865,12 +1865,12 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1865
1865
  "background-color": "var(--tpl-bg)"
1866
1866
  },
1867
1867
  onClick: n[0] ||= (e) => k(g)()
1868
- }, [e.isUploading ? (S(), d("div", zn, [m(k(W), {
1868
+ }, [e.isUploading ? (S(), d("div", Rn, [m(k(W), {
1869
1869
  class: "tpl-spinner",
1870
1870
  size: 20,
1871
1871
  "stroke-width": 2,
1872
1872
  style: { color: "var(--tpl-primary)" }
1873
- }), f("span", Bn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
1873
+ }), f("span", zn, D(e.uploadProgress && e.uploadProgress.total > 1 ? k(a)(k(r).mediaLibrary.uploadingProgress, {
1874
1874
  current: e.uploadProgress.current,
1875
1875
  total: e.uploadProgress.total
1876
1876
  }) : k(r).mediaLibrary.uploading), 1)])) : (S(), d(i, { key: 1 }, [
@@ -1880,20 +1880,20 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1880
1880
  "stroke-width": 1.5,
1881
1881
  style: { color: "var(--tpl-text-dim)" }
1882
1882
  }),
1883
- f("p", Vn, D(k(r).mediaLibrary.dropOrClick), 1),
1884
- f("p", Hn, D(k(r).mediaLibrary.acceptedFormats), 1)
1883
+ f("p", Bn, D(k(r).mediaLibrary.dropOrClick), 1),
1884
+ f("p", Vn, D(k(r).mediaLibrary.acceptedFormats), 1)
1885
1885
  ], 64))], 2));
1886
1886
  }
1887
- }), Wn = [
1887
+ }), Un = [
1888
1888
  "width",
1889
1889
  "height",
1890
1890
  "viewBox"
1891
- ], Gn = [
1891
+ ], Wn = [
1892
1892
  "cx",
1893
1893
  "cy",
1894
1894
  "r",
1895
1895
  "stroke-width"
1896
- ], Kn = [
1896
+ ], Gn = [
1897
1897
  "cx",
1898
1898
  "cy",
1899
1899
  "r",
@@ -1901,14 +1901,14 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1901
1901
  "stroke",
1902
1902
  "stroke-dasharray",
1903
1903
  "stroke-dashoffset"
1904
- ], qn = {
1904
+ ], Kn = {
1905
1905
  key: 0,
1906
1906
  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",
1907
1907
  style: {
1908
1908
  "background-color": "var(--tpl-text)",
1909
1909
  color: "var(--tpl-bg-elevated)"
1910
1910
  }
1911
- }, Jn = /* @__PURE__ */ h({
1911
+ }, qn = /* @__PURE__ */ h({
1912
1912
  __name: "StorageProgressRing",
1913
1913
  props: {
1914
1914
  usedBytes: {},
@@ -1948,7 +1948,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1948
1948
  fill: "none",
1949
1949
  "stroke-width": c.value,
1950
1950
  style: { stroke: "var(--tpl-border)" }
1951
- }, null, 8, Gn), f("circle", {
1951
+ }, null, 8, Wn), f("circle", {
1952
1952
  cx: a.value / 2,
1953
1953
  cy: a.value / 2,
1954
1954
  r: l.value,
@@ -1959,7 +1959,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1959
1959
  "stroke-dasharray": h.value,
1960
1960
  "stroke-dashoffset": _.value,
1961
1961
  class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
1962
- }, null, 8, Kn)], 8, Wn)), m(o, {
1962
+ }, null, 8, Gn)], 8, Un)), m(o, {
1963
1963
  "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1964
1964
  "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
1965
1965
  "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
@@ -1967,7 +1967,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1967
1967
  "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
1968
1968
  "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
1969
1969
  }, {
1970
- default: M(() => [i.value ? (S(), d("div", qn, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
1970
+ default: M(() => [i.value ? (S(), d("div", Kn, [p(D(E.value) + " ", 1), t[2] ||= f("div", {
1971
1971
  class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
1972
1972
  style: { "background-color": "var(--tpl-text)" }
1973
1973
  }, null, -1)])) : u("", !0)]),
@@ -1977,7 +1977,7 @@ var Se = Symbol("templaticalMediaPopoverTarget"), Ce = ["data-tpl-theme"], we =
1977
1977
  });
1978
1978
  //#endregion
1979
1979
  //#region src/composables/useMediaLibraryUI.ts
1980
- function Yn(e) {
1980
+ function Jn(e) {
1981
1981
  let { library: t, canUseMediaFolders: n, translations: r } = e;
1982
1982
  function i() {
1983
1983
  return "value" in r && typeof r.value == "object" ? r.value : r;
@@ -2087,7 +2087,7 @@ function Yn(e) {
2087
2087
  }
2088
2088
  //#endregion
2089
2089
  //#region src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
2090
- var Xn = ["data-tpl-theme"], Zn = {
2090
+ var Yn = ["data-tpl-theme"], Xn = {
2091
2091
  class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
2092
2092
  style: {
2093
2093
  width: "900px",
@@ -2098,62 +2098,62 @@ var Xn = ["data-tpl-theme"], Zn = {
2098
2098
  border: "1px solid var(--tpl-border)",
2099
2099
  "box-shadow": "var(--tpl-shadow-xl)"
2100
2100
  }
2101
- }, Qn = {
2101
+ }, Zn = {
2102
2102
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
2103
2103
  style: { "border-color": "var(--tpl-border)" }
2104
- }, $n = {
2104
+ }, Qn = {
2105
2105
  class: "tpl:text-sm tpl:font-semibold",
2106
2106
  style: { color: "var(--tpl-text)" }
2107
- }, er = { class: "tpl:flex tpl:items-center tpl:gap-3" }, tr = { class: "tpl:relative" }, nr = ["value", "placeholder"], rr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ir = {
2107
+ }, $n = { class: "tpl:flex tpl:items-center tpl:gap-3" }, er = { class: "tpl:relative" }, tr = ["value", "placeholder"], nr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, rr = {
2108
2108
  key: 0,
2109
2109
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
2110
2110
  style: {
2111
2111
  "border-color": "var(--tpl-border)",
2112
2112
  "background-color": "var(--tpl-bg)"
2113
2113
  }
2114
- }, ar = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, or = {
2114
+ }, ir = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, ar = {
2115
2115
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
2116
2116
  style: { "border-color": "var(--tpl-border)" }
2117
- }, sr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, cr = ["title"], lr = {
2117
+ }, or = { class: "tpl:flex tpl:items-center tpl:gap-2" }, sr = ["title"], cr = {
2118
2118
  key: 1,
2119
2119
  class: "tpl:text-xs tpl:font-medium",
2120
2120
  style: { color: "var(--tpl-text)" }
2121
- }, ur = {
2121
+ }, lr = {
2122
2122
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
2123
2123
  style: {
2124
2124
  border: "1px solid var(--tpl-border)",
2125
2125
  "background-color": "var(--tpl-bg)"
2126
2126
  }
2127
- }, dr = ["title"], fr = ["title"], pr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, mr = ["value"], hr = { value: "" }, gr = ["value"], _r = ["value"], vr = { value: "newest" }, yr = { value: "oldest" }, br = { value: "name_asc" }, xr = { value: "name_desc" }, Sr = { value: "size_asc" }, Cr = { value: "size_desc" }, wr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Tr = {
2127
+ }, ur = ["title"], dr = ["title"], fr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, pr = ["value"], mr = { value: "" }, hr = ["value"], gr = ["value"], _r = { value: "newest" }, vr = { value: "oldest" }, yr = { value: "name_asc" }, br = { value: "name_desc" }, xr = { value: "size_asc" }, Sr = { value: "size_desc" }, Cr = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, wr = {
2128
2128
  key: 0,
2129
2129
  class: "tpl:px-4 tpl:pt-3"
2130
- }, Er = {
2130
+ }, Tr = {
2131
2131
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
2132
2132
  style: {
2133
2133
  "background-color": "var(--tpl-bg-elevated)",
2134
2134
  "box-shadow": "var(--tpl-shadow-xl)"
2135
2135
  }
2136
- }, Dr = {
2136
+ }, Er = {
2137
2137
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
2138
2138
  style: { color: "var(--tpl-text)" }
2139
- }, Or = {
2139
+ }, Dr = {
2140
2140
  key: 0,
2141
2141
  class: "tpl:mb-4 tpl:text-xs",
2142
2142
  style: { color: "var(--tpl-text-muted)" }
2143
- }, kr = {
2143
+ }, Or = {
2144
2144
  key: 1,
2145
2145
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
2146
2146
  style: { "border-color": "var(--tpl-border)" }
2147
- }, Ar = { class: "tpl:font-medium" }, jr = { style: { color: "var(--tpl-text-muted)" } }, Mr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Nr = {
2147
+ }, kr = { class: "tpl:font-medium" }, Ar = { style: { color: "var(--tpl-text-muted)" } }, jr = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Mr = {
2148
2148
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
2149
2149
  style: { "border-color": "var(--tpl-border)" }
2150
- }, Pr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Fr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ir = {
2150
+ }, Nr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Pr = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Fr = {
2151
2151
  key: 0,
2152
2152
  class: "tpl:flex tpl:items-center tpl:gap-2"
2153
- }, Lr = {
2153
+ }, Ir = {
2154
2154
  key: 1,
2155
2155
  class: "tpl:relative"
2156
- }, Rr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, zr = ["disabled"], Br = /* @__PURE__ */ h({
2156
+ }, Lr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Rr = ["disabled"], zr = /* @__PURE__ */ h({
2157
2157
  __name: "MediaLibraryModal",
2158
2158
  props: {
2159
2159
  visible: { type: Boolean },
@@ -2162,31 +2162,31 @@ var Xn = ["data-tpl-theme"], Zn = {
2162
2162
  },
2163
2163
  emits: ["close", "select"],
2164
2164
  setup(e, { emit: t }) {
2165
- let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme");
2166
- C(Se, O(() => n.popoverTarget ?? null));
2167
- let g = _("authManager"), v = _("projectId"), x = s(() => v.value), w = _("planConfig"), E = s(() => w.hasFeature("media_folders")), A = s(() => w.hasFeature("import_from_url")), N = s(() => w.config.value?.storage.used_bytes ?? 0), P = s(() => w.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: L, availableCategories: z } = Q(), B = fe({
2168
- projectId: x.value,
2169
- authManager: g
2170
- }), W = Yn({
2171
- library: B,
2172
- canUseMediaFolders: E,
2165
+ let n = e, r = t, { t: c } = Z(), h = _("tplUiTheme"), g = O(() => n.popoverTarget ?? null);
2166
+ C(Se, g);
2167
+ let v = _("authManager"), x = _("projectId"), w = s(() => x.value), E = _("planConfig"), A = s(() => E.hasFeature("media_folders")), N = s(() => E.hasFeature("import_from_url")), P = s(() => E.config.value?.storage.used_bytes ?? 0), L = s(() => E.config.value?.storage.limit_bytes ?? 0), { isAcceptedMimeType: z, availableCategories: B } = Q(), W = fe({
2168
+ projectId: w.value,
2169
+ authManager: v
2170
+ }), K = Jn({
2171
+ library: W,
2172
+ canUseMediaFolders: A,
2173
2173
  translations: c
2174
2174
  });
2175
2175
  j(() => n.visible, (e) => {
2176
- e ? (B.loadItems(), B.loadFrequentlyUsed()) : W.resetUI();
2176
+ e ? (W.loadItems(), W.loadFrequentlyUsed()) : K.resetUI();
2177
2177
  });
2178
- function K(e) {
2178
+ function q(e) {
2179
2179
  e.key === "Escape" && r("close");
2180
2180
  }
2181
- ce(document, "keydown", K);
2182
- function q() {
2183
- return B.previewItem.value ? !n.accept?.length || L(B.previewItem.value.mime_type, n.accept) : !1;
2184
- }
2181
+ ce(document, "keydown", q);
2185
2182
  function J() {
2186
- if (q()) {
2187
- let e = B.previewItem.value, t = {
2183
+ return W.previewItem.value ? !n.accept?.length || z(W.previewItem.value.mime_type, n.accept) : !1;
2184
+ }
2185
+ function ee() {
2186
+ if (J()) {
2187
+ let e = W.previewItem.value, t = {
2188
2188
  ...e,
2189
- url: W.selectedUrl.value || e.url
2189
+ url: K.selectedUrl.value || e.url
2190
2190
  };
2191
2191
  r("select", t), r("close");
2192
2192
  }
@@ -2204,15 +2204,15 @@ var Xn = ["data-tpl-theme"], Zn = {
2204
2204
  "data-tpl-theme": k(h),
2205
2205
  class: "tpl tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-[9999]",
2206
2206
  onClick: n[18] ||= F((e) => r("close"), ["self"])
2207
- }, [f("div", Zn, [
2208
- f("div", Qn, [f("h2", $n, D(k(c).mediaLibrary.title), 1), f("div", er, [
2209
- m(Jn, {
2210
- "used-bytes": N.value,
2211
- "limit-bytes": P.value,
2207
+ }, [f("div", Xn, [
2208
+ f("div", Zn, [f("h2", Qn, D(k(c).mediaLibrary.title), 1), f("div", $n, [
2209
+ m(qn, {
2210
+ "used-bytes": P.value,
2211
+ "limit-bytes": L.value,
2212
2212
  size: 22
2213
2213
  }, null, 8, ["used-bytes", "limit-bytes"]),
2214
- f("div", tr, [f("input", {
2215
- value: k(W).searchInput.value,
2214
+ f("div", er, [f("input", {
2215
+ value: k(K).searchInput.value,
2216
2216
  type: "text",
2217
2217
  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)]",
2218
2218
  style: {
@@ -2221,8 +2221,8 @@ var Xn = ["data-tpl-theme"], Zn = {
2221
2221
  color: "var(--tpl-text)"
2222
2222
  },
2223
2223
  placeholder: k(c).mediaLibrary.searchPlaceholder,
2224
- onInput: n[0] ||= (e) => k(W).handleSearchInput(e.target.value)
2225
- }, null, 40, nr), m(k(Y), {
2224
+ onInput: n[0] ||= (e) => k(K).handleSearchInput(e.target.value)
2225
+ }, null, 40, tr), m(k(Y), {
2226
2226
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
2227
2227
  size: 13,
2228
2228
  "stroke-width": 2,
@@ -2237,7 +2237,7 @@ var Xn = ["data-tpl-theme"], Zn = {
2237
2237
  "stroke-width": 2
2238
2238
  })])
2239
2239
  ])]),
2240
- f("div", rr, [m(o, {
2240
+ f("div", nr, [m(o, {
2241
2241
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
2242
2242
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
2243
2243
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -2245,16 +2245,16 @@ var Xn = ["data-tpl-theme"], Zn = {
2245
2245
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
2246
2246
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
2247
2247
  }, {
2248
- default: M(() => [E.value && k(W).showSidebar.value ? (S(), d("div", ir, [m(_t, {
2249
- folders: k(B).folders.value,
2250
- "current-folder-id": k(B).currentFolderId.value,
2251
- "view-mode": k(B).viewMode.value,
2252
- "has-frequently-used": k(W).hasFrequentlyUsed.value,
2253
- onNavigate: k(B).navigateToFolder,
2254
- onCreateFolder: k(W).handleCreateFolder,
2255
- onRenameFolder: k(W).handleRenameFolder,
2256
- onDeleteFolder: k(W).handleDeleteFolder,
2257
- onShowFrequentlyUsed: k(B).showFrequentlyUsed
2248
+ default: M(() => [A.value && k(K).showSidebar.value ? (S(), d("div", rr, [m(gt, {
2249
+ folders: k(W).folders.value,
2250
+ "current-folder-id": k(W).currentFolderId.value,
2251
+ "view-mode": k(W).viewMode.value,
2252
+ "has-frequently-used": k(K).hasFrequentlyUsed.value,
2253
+ onNavigate: k(W).navigateToFolder,
2254
+ onCreateFolder: k(K).handleCreateFolder,
2255
+ onRenameFolder: k(K).handleRenameFolder,
2256
+ onDeleteFolder: k(K).handleDeleteFolder,
2257
+ onShowFrequentlyUsed: k(W).showFrequentlyUsed
2258
2258
  }, null, 8, [
2259
2259
  "folders",
2260
2260
  "current-folder-id",
@@ -2267,55 +2267,55 @@ var Xn = ["data-tpl-theme"], Zn = {
2267
2267
  "onShowFrequentlyUsed"
2268
2268
  ])])) : u("", !0)]),
2269
2269
  _: 1
2270
- }), f("div", ar, [f("div", or, [f("div", sr, [
2271
- E.value ? (S(), d("button", {
2270
+ }), f("div", ir, [f("div", ar, [f("div", or, [
2271
+ A.value ? (S(), d("button", {
2272
2272
  key: 0,
2273
2273
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2274
2274
  style: b({
2275
- color: k(W).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2276
- backgroundColor: k(W).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2277
- border: k(W).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2275
+ color: k(K).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2276
+ backgroundColor: k(K).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2277
+ border: k(K).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2278
2278
  }),
2279
- title: k(W).showSidebar.value ? k(c).mediaLibrary.hideFolders : k(c).mediaLibrary.showFolders,
2280
- onClick: n[2] ||= (e) => k(W).showSidebar.value = !k(W).showSidebar.value
2279
+ title: k(K).showSidebar.value ? k(c).mediaLibrary.hideFolders : k(c).mediaLibrary.showFolders,
2280
+ onClick: n[2] ||= (e) => k(K).showSidebar.value = !k(K).showSidebar.value
2281
2281
  }, [m(k(G), {
2282
2282
  size: 16,
2283
2283
  "stroke-width": 2
2284
- })], 12, cr)) : u("", !0),
2285
- k(B).viewMode.value === "frequently-used" ? (S(), d("span", lr, D(k(c).mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2284
+ })], 12, sr)) : u("", !0),
2285
+ k(W).viewMode.value === "frequently-used" ? (S(), d("span", cr, D(k(c).mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2286
2286
  key: 2,
2287
- folders: k(B).folders.value,
2288
- "current-folder-id": k(B).currentFolderId.value,
2289
- onNavigate: k(B).navigateToFolder
2287
+ folders: k(W).folders.value,
2288
+ "current-folder-id": k(W).currentFolderId.value,
2289
+ onNavigate: k(W).navigateToFolder
2290
2290
  }, null, 8, [
2291
2291
  "folders",
2292
2292
  "current-folder-id",
2293
2293
  "onNavigate"
2294
2294
  ])),
2295
- f("div", ur, [f("button", {
2295
+ f("div", lr, [f("button", {
2296
2296
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2297
2297
  style: b({
2298
- color: k(W).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2299
- backgroundColor: k(W).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2298
+ color: k(K).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2299
+ backgroundColor: k(K).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2300
2300
  }),
2301
2301
  title: k(c).mediaLibrary.viewGrid,
2302
- onClick: n[3] ||= (e) => k(W).layoutMode.value = "grid"
2302
+ onClick: n[3] ||= (e) => k(K).layoutMode.value = "grid"
2303
2303
  }, [m(k(V), {
2304
2304
  size: 14,
2305
2305
  "stroke-width": 2
2306
- })], 12, dr), f("button", {
2306
+ })], 12, ur), f("button", {
2307
2307
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2308
2308
  style: b({
2309
- color: k(W).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2310
- backgroundColor: k(W).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2309
+ color: k(K).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2310
+ backgroundColor: k(K).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2311
2311
  }),
2312
2312
  title: k(c).mediaLibrary.viewList,
2313
- onClick: n[4] ||= (e) => k(W).layoutMode.value = "list"
2313
+ onClick: n[4] ||= (e) => k(K).layoutMode.value = "list"
2314
2314
  }, [m(k(U), {
2315
2315
  size: 14,
2316
2316
  "stroke-width": 2
2317
- })], 12, fr)])
2318
- ]), f("div", pr, [k(z).length > 1 ? (S(), d("select", {
2317
+ })], 12, dr)])
2318
+ ]), f("div", fr, [k(B).length > 1 ? (S(), d("select", {
2319
2319
  key: 0,
2320
2320
  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",
2321
2321
  style: {
@@ -2323,36 +2323,36 @@ var Xn = ["data-tpl-theme"], Zn = {
2323
2323
  "background-color": "var(--tpl-bg)",
2324
2324
  color: "var(--tpl-text)"
2325
2325
  },
2326
- value: k(B).categoryFilter.value ?? "",
2327
- onChange: n[5] ||= (e) => k(B).filterByCategory(e.target.value || null)
2328
- }, [f("option", hr, D(k(c).mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(z), (e) => (S(), d("option", {
2326
+ value: k(W).categoryFilter.value ?? "",
2327
+ onChange: n[5] ||= (e) => k(W).filterByCategory(e.target.value || null)
2328
+ }, [f("option", mr, D(k(c).mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(B), (e) => (S(), d("option", {
2329
2329
  key: e,
2330
2330
  value: e
2331
- }, D(k(W).getCategoryLabel(e)), 9, gr))), 128))], 40, mr)) : u("", !0), f("select", {
2331
+ }, D(k(K).getCategoryLabel(e)), 9, hr))), 128))], 40, pr)) : u("", !0), f("select", {
2332
2332
  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",
2333
2333
  style: {
2334
2334
  "border-color": "var(--tpl-border)",
2335
2335
  "background-color": "var(--tpl-bg)",
2336
2336
  color: "var(--tpl-text)"
2337
2337
  },
2338
- value: k(B).sortOption.value,
2339
- onChange: n[6] ||= (e) => k(B).sortBy(e.target.value)
2338
+ value: k(W).sortOption.value,
2339
+ onChange: n[6] ||= (e) => k(W).sortBy(e.target.value)
2340
2340
  }, [
2341
- f("option", vr, D(k(c).mediaLibrary.sortNewest), 1),
2342
- f("option", yr, D(k(c).mediaLibrary.sortOldest), 1),
2343
- f("option", br, D(k(c).mediaLibrary.sortNameAsc), 1),
2344
- f("option", xr, D(k(c).mediaLibrary.sortNameDesc), 1),
2345
- f("option", Sr, D(k(c).mediaLibrary.sortSizeAsc), 1),
2346
- f("option", Cr, D(k(c).mediaLibrary.sortSizeDesc), 1)
2347
- ], 40, _r)])]), f("div", wr, [k(B).viewMode.value === "files" ? (S(), d("div", Tr, [m(Un, {
2348
- "is-uploading": k(B).isUploading.value,
2349
- "upload-progress": k(B).uploadProgress.value,
2350
- onUpload: k(W).handleUpload
2341
+ f("option", _r, D(k(c).mediaLibrary.sortNewest), 1),
2342
+ f("option", vr, D(k(c).mediaLibrary.sortOldest), 1),
2343
+ f("option", yr, D(k(c).mediaLibrary.sortNameAsc), 1),
2344
+ f("option", br, D(k(c).mediaLibrary.sortNameDesc), 1),
2345
+ f("option", xr, D(k(c).mediaLibrary.sortSizeAsc), 1),
2346
+ f("option", Sr, D(k(c).mediaLibrary.sortSizeDesc), 1)
2347
+ ], 40, gr)])]), f("div", Cr, [k(W).viewMode.value === "files" ? (S(), d("div", wr, [m(Hn, {
2348
+ "is-uploading": k(W).isUploading.value,
2349
+ "upload-progress": k(W).uploadProgress.value,
2350
+ onUpload: k(K).handleUpload
2351
2351
  }, null, 8, [
2352
2352
  "is-uploading",
2353
2353
  "upload-progress",
2354
2354
  "onUpload"
2355
- ]), A.value ? (S(), d("button", {
2355
+ ]), N.value ? (S(), d("button", {
2356
2356
  key: 0,
2357
2357
  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",
2358
2358
  style: {
@@ -2360,22 +2360,22 @@ var Xn = ["data-tpl-theme"], Zn = {
2360
2360
  color: "var(--tpl-text-muted)",
2361
2361
  "background-color": "var(--tpl-bg)"
2362
2362
  },
2363
- onClick: n[7] ||= (e) => k(W).showImportUrlModal.value = !0
2363
+ onClick: n[7] ||= (e) => k(K).showImportUrlModal.value = !0
2364
2364
  }, [m(k(H), {
2365
2365
  size: 14,
2366
2366
  "stroke-width": 2
2367
- }), p(" " + D(k(c).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Jt, {
2368
- items: k(W).displayItems.value,
2369
- "selected-ids": k(B).selectedItems.value,
2370
- "is-loading": k(B).isLoading.value,
2371
- "has-more": k(B).viewMode.value === "files" && k(B).hasMore.value,
2367
+ }), p(" " + D(k(c).mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(qt, {
2368
+ items: k(K).displayItems.value,
2369
+ "selected-ids": k(W).selectedItems.value,
2370
+ "is-loading": k(W).isLoading.value,
2371
+ "has-more": k(W).viewMode.value === "files" && k(W).hasMore.value,
2372
2372
  accept: e.accept,
2373
- layout: k(W).layoutMode.value,
2374
- onSelect: k(W).handleSelect,
2375
- onToggle: k(B).toggleSelection,
2376
- onLoadMore: k(B).loadMore,
2377
- onEdit: k(W).handleEditItem,
2378
- onReplace: k(W).handleReplaceItem
2373
+ layout: k(K).layoutMode.value,
2374
+ onSelect: k(K).handleSelect,
2375
+ onToggle: k(W).toggleSelection,
2376
+ onLoadMore: k(W).loadMore,
2377
+ onEdit: k(K).handleEditItem,
2378
+ onReplace: k(K).handleReplaceItem
2379
2379
  }, null, 8, [
2380
2380
  "items",
2381
2381
  "selected-ids",
@@ -2389,12 +2389,12 @@ var Xn = ["data-tpl-theme"], Zn = {
2389
2389
  "onEdit",
2390
2390
  "onReplace"
2391
2391
  ])])])]),
2392
- m(sn, {
2393
- visible: k(W).showImportUrlModal.value,
2394
- "is-importing": k(B).isImportingFromUrl.value,
2395
- error: k(B).importFromUrlError.value,
2396
- onImport: k(W).handleImportFromUrl,
2397
- onClose: n[8] ||= (e) => k(W).showImportUrlModal.value = !1
2392
+ m(on, {
2393
+ visible: k(K).showImportUrlModal.value,
2394
+ "is-importing": k(W).isImportingFromUrl.value,
2395
+ error: k(W).importFromUrlError.value,
2396
+ onImport: k(K).handleImportFromUrl,
2397
+ onClose: n[8] ||= (e) => k(K).showImportUrlModal.value = !1
2398
2398
  }, null, 8, [
2399
2399
  "visible",
2400
2400
  "is-importing",
@@ -2402,23 +2402,23 @@ var Xn = ["data-tpl-theme"], Zn = {
2402
2402
  "onImport"
2403
2403
  ]),
2404
2404
  m(it, {
2405
- visible: !!k(W).editingItem.value,
2406
- item: k(W).editingItem.value,
2407
- onSave: k(W).handleEditSave,
2408
- onClose: n[9] ||= (e) => k(W).editingItem.value = null
2405
+ visible: !!k(K).editingItem.value,
2406
+ item: k(K).editingItem.value,
2407
+ onSave: k(K).handleEditSave,
2408
+ onClose: n[9] ||= (e) => k(K).editingItem.value = null
2409
2409
  }, null, 8, [
2410
2410
  "visible",
2411
2411
  "item",
2412
2412
  "onSave"
2413
2413
  ]),
2414
- m(Rn, {
2415
- visible: k(B).showReplaceWarning.value,
2416
- item: k(B).pendingReplaceItem.value,
2417
- "usage-info": k(B).replaceUsageInfo.value,
2418
- "is-replacing": k(B).isReplacing.value,
2419
- error: k(B).replaceError.value,
2420
- onReplace: k(W).handleReplaceFile,
2421
- onClose: k(B).cancelReplace
2414
+ m(Ln, {
2415
+ visible: k(W).showReplaceWarning.value,
2416
+ item: k(W).pendingReplaceItem.value,
2417
+ "usage-info": k(W).replaceUsageInfo.value,
2418
+ "is-replacing": k(W).isReplacing.value,
2419
+ error: k(W).replaceError.value,
2420
+ onReplace: k(K).handleReplaceFile,
2421
+ onClose: k(W).cancelReplace
2422
2422
  }, null, 8, [
2423
2423
  "visible",
2424
2424
  "item",
@@ -2436,7 +2436,7 @@ var Xn = ["data-tpl-theme"], Zn = {
2436
2436
  "leave-from-class": "tpl:opacity-100",
2437
2437
  "leave-to-class": "tpl:opacity-0"
2438
2438
  }, {
2439
- default: M(() => [k(B).showDeleteWarning.value ? (S(), d("div", {
2439
+ default: M(() => [k(W).showDeleteWarning.value ? (S(), d("div", {
2440
2440
  key: 0,
2441
2441
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
2442
2442
  style: {
@@ -2444,27 +2444,27 @@ var Xn = ["data-tpl-theme"], Zn = {
2444
2444
  "backdrop-filter": "blur(8px)",
2445
2445
  "-webkit-backdrop-filter": "blur(8px)"
2446
2446
  },
2447
- onClick: n[12] ||= F((...e) => k(B).cancelDelete && k(B).cancelDelete(...e), ["self"])
2448
- }, [f("div", Er, [
2449
- f("h3", Dr, D(k(c).mediaLibrary.deleteWarningTitle), 1),
2447
+ onClick: n[12] ||= F((...e) => k(W).cancelDelete && k(W).cancelDelete(...e), ["self"])
2448
+ }, [f("div", Tr, [
2449
+ f("h3", Er, D(k(c).mediaLibrary.deleteWarningTitle), 1),
2450
2450
  f("p", {
2451
- class: y(["tpl:text-xs", k(W).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2451
+ class: y(["tpl:text-xs", k(K).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2452
2452
  style: { color: "var(--tpl-text-muted)" }
2453
2453
  }, D(k(c).mediaLibrary.deleteWarningMessage), 3),
2454
- k(W).hasUsedFiles.value ? (S(), d("p", Or, D(k(c).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2455
- k(W).hasUsedFiles.value ? (S(), d("div", kr, [(S(!0), d(i, null, T(k(B).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2454
+ k(K).hasUsedFiles.value ? (S(), d("p", Dr, D(k(c).mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2455
+ k(K).hasUsedFiles.value ? (S(), d("div", Or, [(S(!0), d(i, null, T(k(W).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2456
2456
  key: t,
2457
2457
  class: "tpl:text-xs",
2458
2458
  style: { color: "var(--tpl-text)" }
2459
- }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", Ar, D(k(W).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", jr, " - " + D(k(c).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2460
- f("div", Mr, [f("button", {
2459
+ }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", kr, D(k(K).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Ar, " - " + D(k(c).mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2460
+ f("div", jr, [f("button", {
2461
2461
  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",
2462
2462
  style: {
2463
2463
  "border-color": "var(--tpl-border)",
2464
2464
  color: "var(--tpl-text)",
2465
2465
  "background-color": "var(--tpl-bg)"
2466
2466
  },
2467
- onClick: n[10] ||= (...e) => k(B).cancelDelete && k(B).cancelDelete(...e)
2467
+ onClick: n[10] ||= (...e) => k(W).cancelDelete && k(W).cancelDelete(...e)
2468
2468
  }, D(k(c).mediaLibrary.cancel), 1), f("button", {
2469
2469
  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",
2470
2470
  style: {
@@ -2472,31 +2472,31 @@ var Xn = ["data-tpl-theme"], Zn = {
2472
2472
  color: "var(--tpl-danger)",
2473
2473
  "background-color": "var(--tpl-danger-light)"
2474
2474
  },
2475
- onClick: n[11] ||= (...e) => k(B).confirmDelete && k(B).confirmDelete(...e)
2476
- }, D(k(W).hasUsedFiles.value ? k(c).mediaLibrary.deleteAnyway : k(c).mediaLibrary.confirmDelete), 1)])
2475
+ onClick: n[11] ||= (...e) => k(W).confirmDelete && k(W).confirmDelete(...e)
2476
+ }, D(k(K).hasUsedFiles.value ? k(c).mediaLibrary.deleteAnyway : k(c).mediaLibrary.confirmDelete), 1)])
2477
2477
  ])])) : u("", !0)]),
2478
2478
  _: 1
2479
2479
  }),
2480
- f("div", Nr, [f("div", Pr, [k(B).previewItem.value ? (S(), l(Cn, {
2480
+ f("div", Mr, [f("div", Nr, [k(W).previewItem.value ? (S(), l(Sn, {
2481
2481
  key: 0,
2482
- "selected-conversion": k(W).selectedConversion.value,
2483
- "onUpdate:selectedConversion": n[13] ||= (e) => k(W).selectedConversion.value = e,
2484
- item: k(B).previewItem.value,
2485
- folders: k(B).folders.value
2482
+ "selected-conversion": k(K).selectedConversion.value,
2483
+ "onUpdate:selectedConversion": n[13] ||= (e) => k(K).selectedConversion.value = e,
2484
+ item: k(W).previewItem.value,
2485
+ folders: k(W).folders.value
2486
2486
  }, null, 8, [
2487
2487
  "selected-conversion",
2488
2488
  "item",
2489
2489
  "folders"
2490
- ])) : u("", !0)]), f("div", Fr, [k(B).selectedItems.value.size > 0 ? (S(), d("div", Ir, [k(B).previewItem.value ? (S(), d("button", {
2490
+ ])) : u("", !0)]), f("div", Pr, [k(W).selectedItems.value.size > 0 ? (S(), d("div", Fr, [k(W).previewItem.value ? (S(), d("button", {
2491
2491
  key: 0,
2492
2492
  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",
2493
2493
  style: b({
2494
- borderColor: k(W).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2495
- color: k(W).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2494
+ borderColor: k(K).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2495
+ color: k(K).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2496
2496
  backgroundColor: "var(--tpl-bg)"
2497
2497
  }),
2498
- onClick: n[14] ||= (e) => k(W).copy(k(W).selectedUrl.value)
2499
- }, [k(W).copied.value ? (S(), l(k(I), {
2498
+ onClick: n[14] ||= (e) => k(K).copy(k(K).selectedUrl.value)
2499
+ }, [k(K).copied.value ? (S(), l(k(I), {
2500
2500
  key: 1,
2501
2501
  size: 12,
2502
2502
  "stroke-width": 2
@@ -2504,25 +2504,25 @@ var Xn = ["data-tpl-theme"], Zn = {
2504
2504
  key: 0,
2505
2505
  size: 12,
2506
2506
  "stroke-width": 2
2507
- })), p(" " + D(k(W).copied.value ? k(c).mediaLibrary.copied : k(c).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), E.value ? (S(), d("div", Lr, [f("button", {
2507
+ })), p(" " + D(k(K).copied.value ? k(c).mediaLibrary.copied : k(c).mediaLibrary.copyUrl), 1)], 4)) : u("", !0), A.value ? (S(), d("div", Ir, [f("button", {
2508
2508
  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",
2509
2509
  style: {
2510
2510
  "border-color": "var(--tpl-border)",
2511
2511
  color: "var(--tpl-text)",
2512
2512
  "background-color": "var(--tpl-bg)"
2513
2513
  },
2514
- onClick: n[15] ||= (e) => k(W).showMovePicker.value = !k(W).showMovePicker.value
2515
- }, D(k(c).mediaLibrary.moveSelected), 1), k(W).showMovePicker.value ? (S(), l(fn, {
2514
+ onClick: n[15] ||= (e) => k(K).showMovePicker.value = !k(K).showMovePicker.value
2515
+ }, D(k(c).mediaLibrary.moveSelected), 1), k(K).showMovePicker.value ? (S(), l(dn, {
2516
2516
  key: 0,
2517
- folders: k(B).folders.value,
2518
- "current-folder-id": k(B).currentFolderId.value,
2519
- onSelect: k(W).handleMoveToFolder,
2520
- onClose: n[16] ||= (e) => k(W).showMovePicker.value = !1
2517
+ folders: k(W).folders.value,
2518
+ "current-folder-id": k(W).currentFolderId.value,
2519
+ onSelect: k(K).handleMoveToFolder,
2520
+ onClose: n[16] ||= (e) => k(K).showMovePicker.value = !1
2521
2521
  }, null, 8, [
2522
2522
  "folders",
2523
2523
  "current-folder-id",
2524
2524
  "onSelect"
2525
- ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Rr, [k(B).selectedItems.value.size > 0 ? (S(), d("button", {
2525
+ ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Lr, [k(W).selectedItems.value.size > 0 ? (S(), d("button", {
2526
2526
  key: 0,
2527
2527
  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",
2528
2528
  style: {
@@ -2530,24 +2530,24 @@ var Xn = ["data-tpl-theme"], Zn = {
2530
2530
  color: "var(--tpl-danger)",
2531
2531
  "background-color": "var(--tpl-danger-light)"
2532
2532
  },
2533
- onClick: n[17] ||= (...e) => k(W).handleDeleteClick && k(W).handleDeleteClick(...e)
2533
+ onClick: n[17] ||= (...e) => k(K).handleDeleteClick && k(K).handleDeleteClick(...e)
2534
2534
  }, D(k(c).mediaLibrary.deleteSelected), 1)) : u("", !0), f("button", {
2535
2535
  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",
2536
2536
  style: {
2537
2537
  "background-color": "var(--tpl-primary)",
2538
2538
  color: "var(--tpl-bg)"
2539
2539
  },
2540
- disabled: !q(),
2541
- onClick: J
2542
- }, D(e.accept?.length ? k(c).mediaLibrary.selectImage : k(c).mediaLibrary.selectFile), 9, zr)])])])
2543
- ])], 8, Xn)) : u("", !0)]),
2540
+ disabled: !J(),
2541
+ onClick: ee
2542
+ }, D(e.accept?.length ? k(c).mediaLibrary.selectImage : k(c).mediaLibrary.selectFile), 9, Rr)])])])
2543
+ ])], 8, Yn)) : u("", !0)]),
2544
2544
  _: 1
2545
2545
  })], 8, ["to"]));
2546
2546
  }
2547
2547
  });
2548
2548
  //#endregion
2549
2549
  //#region src/composables/useMediaPicker.ts
2550
- function Vr() {
2550
+ function Br() {
2551
2551
  let e = _("onRequestMedia"), t = _("planConfig"), n = w(!1), r = s(() => !!e && t.hasFeature("pluggable_media"));
2552
2552
  async function i(t) {
2553
2553
  if (!e) return null;
@@ -2566,7 +2566,7 @@ function Vr() {
2566
2566
  }
2567
2567
  //#endregion
2568
2568
  //#region src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
2569
- var Hr = {
2569
+ var Vr = {
2570
2570
  class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
2571
2571
  style: {
2572
2572
  width: "100%",
@@ -2574,62 +2574,62 @@ var Hr = {
2574
2574
  "background-color": "var(--tpl-bg-elevated)",
2575
2575
  border: "1px solid var(--tpl-border)"
2576
2576
  }
2577
- }, Ur = {
2577
+ }, Hr = {
2578
2578
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
2579
2579
  style: { "border-color": "var(--tpl-border)" }
2580
- }, Wr = {
2580
+ }, Ur = {
2581
2581
  class: "tpl:text-sm tpl:font-semibold",
2582
2582
  style: { color: "var(--tpl-text)" }
2583
- }, Gr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Kr = { class: "tpl:relative" }, qr = ["value", "placeholder"], Jr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Yr = {
2583
+ }, Wr = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Gr = { class: "tpl:relative" }, Kr = ["value", "placeholder"], qr = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, Jr = {
2584
2584
  key: 0,
2585
2585
  class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
2586
2586
  style: {
2587
2587
  "border-color": "var(--tpl-border)",
2588
2588
  "background-color": "var(--tpl-bg)"
2589
2589
  }
2590
- }, Xr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Zr = {
2590
+ }, Yr = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, Xr = {
2591
2591
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
2592
2592
  style: { "border-color": "var(--tpl-border)" }
2593
- }, Qr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, $r = ["title"], ei = {
2593
+ }, Zr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Qr = ["title"], $r = {
2594
2594
  key: 1,
2595
2595
  class: "tpl:text-xs tpl:font-medium",
2596
2596
  style: { color: "var(--tpl-text)" }
2597
- }, ti = {
2597
+ }, ei = {
2598
2598
  class: "tpl:flex tpl:rounded-md tpl:p-0.5",
2599
2599
  style: {
2600
2600
  border: "1px solid var(--tpl-border)",
2601
2601
  "background-color": "var(--tpl-bg)"
2602
2602
  }
2603
- }, ni = ["title"], ri = ["title"], ii = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ai = ["value"], oi = { value: "" }, si = ["value"], ci = ["value"], li = { value: "newest" }, ui = { value: "oldest" }, di = { value: "name_asc" }, fi = { value: "name_desc" }, pi = { value: "size_asc" }, mi = { value: "size_desc" }, hi = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, gi = {
2603
+ }, ti = ["title"], ni = ["title"], ri = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ii = ["value"], ai = { value: "" }, oi = ["value"], si = ["value"], ci = { value: "newest" }, li = { value: "oldest" }, ui = { value: "name_asc" }, di = { value: "name_desc" }, fi = { value: "size_asc" }, pi = { value: "size_desc" }, mi = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, hi = {
2604
2604
  key: 0,
2605
2605
  class: "tpl:px-4 tpl:pt-3"
2606
- }, _i = {
2606
+ }, gi = {
2607
2607
  class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
2608
2608
  style: {
2609
2609
  "background-color": "var(--tpl-bg-elevated)",
2610
2610
  "box-shadow": "var(--tpl-shadow-xl)"
2611
2611
  }
2612
- }, vi = {
2612
+ }, _i = {
2613
2613
  class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
2614
2614
  style: { color: "var(--tpl-text)" }
2615
- }, yi = {
2615
+ }, vi = {
2616
2616
  key: 0,
2617
2617
  class: "tpl:mb-4 tpl:text-xs",
2618
2618
  style: { color: "var(--tpl-text-muted)" }
2619
- }, bi = {
2619
+ }, yi = {
2620
2620
  key: 1,
2621
2621
  class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
2622
2622
  style: { "border-color": "var(--tpl-border)" }
2623
- }, xi = { class: "tpl:font-medium" }, Si = { style: { color: "var(--tpl-text-muted)" } }, Ci = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, wi = {
2623
+ }, bi = { class: "tpl:font-medium" }, xi = { style: { color: "var(--tpl-text-muted)" } }, Si = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ci = {
2624
2624
  class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
2625
2625
  style: { "border-color": "var(--tpl-border)" }
2626
- }, Ti = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Ei = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Di = {
2626
+ }, wi = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Ti = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ei = {
2627
2627
  key: 0,
2628
2628
  class: "tpl:flex tpl:items-center tpl:gap-2"
2629
- }, Oi = {
2629
+ }, Di = {
2630
2630
  key: 1,
2631
2631
  class: "tpl:relative"
2632
- }, ki = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ai = ["disabled"], ji = /* @__PURE__ */ h({
2632
+ }, Oi = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ki = ["disabled"], Ai = /* @__PURE__ */ h({
2633
2633
  __name: "MediaLibrary",
2634
2634
  props: {
2635
2635
  authManager: {},
@@ -2642,39 +2642,41 @@ var Hr = {
2642
2642
  emits: ["ready"],
2643
2643
  setup(e, { emit: t }) {
2644
2644
  let n = e, r = t, a = s(() => n.translations);
2645
- C("translations", n.translations), C("authManager", n.authManager), C("projectId", s(() => n.projectId)), C("planConfig", {
2646
- config: w(n.planConfig),
2645
+ C("translations", n.translations), C("authManager", n.authManager), C("projectId", s(() => n.projectId));
2646
+ let c = w(n.planConfig);
2647
+ C("planConfig", {
2648
+ config: c,
2647
2649
  isLoading: w(!1),
2648
2650
  hasFeature: (e) => n.planConfig.features[e] ?? !1,
2649
2651
  features: s(() => n.planConfig.features),
2650
2652
  fetchConfig: async () => {}
2651
2653
  });
2652
- let c = s(() => n.planConfig.features.media_folders ?? !1), h = s(() => n.planConfig.features.import_from_url ?? !1), g = s(() => n.planConfig.storage.used_bytes ?? 0), _ = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: v } = Q(), E = fe({
2654
+ let h = s(() => n.planConfig.features.media_folders ?? !1), g = s(() => n.planConfig.features.import_from_url ?? !1), _ = s(() => n.planConfig.storage.used_bytes ?? 0), v = s(() => n.planConfig.storage.limit_bytes ?? 0), { availableCategories: E } = Q(), O = fe({
2653
2655
  projectId: n.projectId,
2654
2656
  authManager: n.authManager,
2655
2657
  onError: n.onError
2656
- }), O = Yn({
2657
- library: E,
2658
- canUseMediaFolders: c,
2658
+ }), A = Jn({
2659
+ library: O,
2660
+ canUseMediaFolders: h,
2659
2661
  translations: a
2660
2662
  });
2661
- function A() {
2662
- if (!E.previewItem.value) return;
2663
- let e = E.previewItem.value, t = {
2663
+ function j() {
2664
+ if (!O.previewItem.value) return;
2665
+ let e = O.previewItem.value, t = {
2664
2666
  ...e,
2665
- url: O.selectedUrl.value || e.url
2667
+ url: A.selectedUrl.value || e.url
2666
2668
  };
2667
2669
  n.onSelect?.(t);
2668
2670
  }
2669
2671
  return x(() => {
2670
- E.loadItems(), E.loadFrequentlyUsed(), r("ready");
2671
- }), (t, n) => (S(), d("div", Hr, [
2672
- f("div", Ur, [f("h2", Wr, D(a.value.mediaLibrary.title), 1), f("div", Gr, [m(Jn, {
2673
- "used-bytes": g.value,
2674
- "limit-bytes": _.value,
2672
+ O.loadItems(), O.loadFrequentlyUsed(), r("ready");
2673
+ }), (t, n) => (S(), d("div", Vr, [
2674
+ f("div", Hr, [f("h2", Ur, D(a.value.mediaLibrary.title), 1), f("div", Wr, [m(qn, {
2675
+ "used-bytes": _.value,
2676
+ "limit-bytes": v.value,
2675
2677
  size: 22
2676
- }, null, 8, ["used-bytes", "limit-bytes"]), f("div", Kr, [f("input", {
2677
- value: k(O).searchInput.value,
2678
+ }, null, 8, ["used-bytes", "limit-bytes"]), f("div", Gr, [f("input", {
2679
+ value: k(A).searchInput.value,
2678
2680
  type: "text",
2679
2681
  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)]",
2680
2682
  style: {
@@ -2683,14 +2685,14 @@ var Hr = {
2683
2685
  color: "var(--tpl-text)"
2684
2686
  },
2685
2687
  placeholder: a.value.mediaLibrary.searchPlaceholder,
2686
- onInput: n[0] ||= (e) => k(O).handleSearchInput(e.target.value)
2687
- }, null, 40, qr), m(k(Y), {
2688
+ onInput: n[0] ||= (e) => k(A).handleSearchInput(e.target.value)
2689
+ }, null, 40, Kr), m(k(Y), {
2688
2690
  class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
2689
2691
  size: 13,
2690
2692
  "stroke-width": 2,
2691
2693
  style: { color: "var(--tpl-text-dim)" }
2692
2694
  })])])]),
2693
- f("div", Jr, [m(o, {
2695
+ f("div", qr, [m(o, {
2694
2696
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
2695
2697
  "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
2696
2698
  "enter-to-class": "tpl:ml-0 tpl:opacity-100",
@@ -2698,16 +2700,16 @@ var Hr = {
2698
2700
  "leave-from-class": "tpl:ml-0 tpl:opacity-100",
2699
2701
  "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
2700
2702
  }, {
2701
- default: M(() => [c.value && k(O).showSidebar.value ? (S(), d("div", Yr, [m(_t, {
2702
- folders: k(E).folders.value,
2703
- "current-folder-id": k(E).currentFolderId.value,
2704
- "view-mode": k(E).viewMode.value,
2705
- "has-frequently-used": k(O).hasFrequentlyUsed.value,
2706
- onNavigate: k(E).navigateToFolder,
2707
- onCreateFolder: k(O).handleCreateFolder,
2708
- onRenameFolder: k(O).handleRenameFolder,
2709
- onDeleteFolder: k(O).handleDeleteFolder,
2710
- onShowFrequentlyUsed: k(E).showFrequentlyUsed
2703
+ default: M(() => [h.value && k(A).showSidebar.value ? (S(), d("div", Jr, [m(gt, {
2704
+ folders: k(O).folders.value,
2705
+ "current-folder-id": k(O).currentFolderId.value,
2706
+ "view-mode": k(O).viewMode.value,
2707
+ "has-frequently-used": k(A).hasFrequentlyUsed.value,
2708
+ onNavigate: k(O).navigateToFolder,
2709
+ onCreateFolder: k(A).handleCreateFolder,
2710
+ onRenameFolder: k(A).handleRenameFolder,
2711
+ onDeleteFolder: k(A).handleDeleteFolder,
2712
+ onShowFrequentlyUsed: k(O).showFrequentlyUsed
2711
2713
  }, null, 8, [
2712
2714
  "folders",
2713
2715
  "current-folder-id",
@@ -2720,55 +2722,55 @@ var Hr = {
2720
2722
  "onShowFrequentlyUsed"
2721
2723
  ])])) : u("", !0)]),
2722
2724
  _: 1
2723
- }), f("div", Xr, [f("div", Zr, [f("div", Qr, [
2724
- c.value ? (S(), d("button", {
2725
+ }), f("div", Yr, [f("div", Xr, [f("div", Zr, [
2726
+ h.value ? (S(), d("button", {
2725
2727
  key: 0,
2726
2728
  class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2727
2729
  style: b({
2728
- color: k(O).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2729
- backgroundColor: k(O).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2730
- border: k(O).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2730
+ color: k(A).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2731
+ backgroundColor: k(A).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2732
+ border: k(A).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2731
2733
  }),
2732
- title: k(O).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
2733
- onClick: n[1] ||= (e) => k(O).showSidebar.value = !k(O).showSidebar.value
2734
+ title: k(A).showSidebar.value ? a.value.mediaLibrary.hideFolders : a.value.mediaLibrary.showFolders,
2735
+ onClick: n[1] ||= (e) => k(A).showSidebar.value = !k(A).showSidebar.value
2734
2736
  }, [m(k(G), {
2735
2737
  size: 16,
2736
2738
  "stroke-width": 2
2737
- })], 12, $r)) : u("", !0),
2738
- k(E).viewMode.value === "frequently-used" ? (S(), d("span", ei, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2739
+ })], 12, Qr)) : u("", !0),
2740
+ k(O).viewMode.value === "frequently-used" ? (S(), d("span", $r, D(a.value.mediaLibrary.frequentlyUsed), 1)) : (S(), l(ge, {
2739
2741
  key: 2,
2740
- folders: k(E).folders.value,
2741
- "current-folder-id": k(E).currentFolderId.value,
2742
- onNavigate: k(E).navigateToFolder
2742
+ folders: k(O).folders.value,
2743
+ "current-folder-id": k(O).currentFolderId.value,
2744
+ onNavigate: k(O).navigateToFolder
2743
2745
  }, null, 8, [
2744
2746
  "folders",
2745
2747
  "current-folder-id",
2746
2748
  "onNavigate"
2747
2749
  ])),
2748
- f("div", ti, [f("button", {
2750
+ f("div", ei, [f("button", {
2749
2751
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2750
2752
  style: b({
2751
- color: k(O).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2752
- backgroundColor: k(O).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2753
+ color: k(A).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2754
+ backgroundColor: k(A).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2753
2755
  }),
2754
2756
  title: a.value.mediaLibrary.viewGrid,
2755
- onClick: n[2] ||= (e) => k(O).layoutMode.value = "grid"
2757
+ onClick: n[2] ||= (e) => k(A).layoutMode.value = "grid"
2756
2758
  }, [m(k(V), {
2757
2759
  size: 14,
2758
2760
  "stroke-width": 2
2759
- })], 12, ni), f("button", {
2761
+ })], 12, ti), f("button", {
2760
2762
  class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2761
2763
  style: b({
2762
- color: k(O).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2763
- backgroundColor: k(O).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2764
+ color: k(A).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2765
+ backgroundColor: k(A).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2764
2766
  }),
2765
2767
  title: a.value.mediaLibrary.viewList,
2766
- onClick: n[3] ||= (e) => k(O).layoutMode.value = "list"
2768
+ onClick: n[3] ||= (e) => k(A).layoutMode.value = "list"
2767
2769
  }, [m(k(U), {
2768
2770
  size: 14,
2769
2771
  "stroke-width": 2
2770
- })], 12, ri)])
2771
- ]), f("div", ii, [k(v).length > 1 ? (S(), d("select", {
2772
+ })], 12, ni)])
2773
+ ]), f("div", ri, [k(E).length > 1 ? (S(), d("select", {
2772
2774
  key: 0,
2773
2775
  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",
2774
2776
  style: {
@@ -2776,36 +2778,36 @@ var Hr = {
2776
2778
  "background-color": "var(--tpl-bg)",
2777
2779
  color: "var(--tpl-text)"
2778
2780
  },
2779
- value: k(E).categoryFilter.value ?? "",
2780
- onChange: n[4] ||= (e) => k(E).filterByCategory(e.target.value || null)
2781
- }, [f("option", oi, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(v), (e) => (S(), d("option", {
2781
+ value: k(O).categoryFilter.value ?? "",
2782
+ onChange: n[4] ||= (e) => k(O).filterByCategory(e.target.value || null)
2783
+ }, [f("option", ai, D(a.value.mediaLibrary.filterAll), 1), (S(!0), d(i, null, T(k(E), (e) => (S(), d("option", {
2782
2784
  key: e,
2783
2785
  value: e
2784
- }, D(k(O).getCategoryLabel(e)), 9, si))), 128))], 40, ai)) : u("", !0), f("select", {
2786
+ }, D(k(A).getCategoryLabel(e)), 9, oi))), 128))], 40, ii)) : u("", !0), f("select", {
2785
2787
  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",
2786
2788
  style: {
2787
2789
  "border-color": "var(--tpl-border)",
2788
2790
  "background-color": "var(--tpl-bg)",
2789
2791
  color: "var(--tpl-text)"
2790
2792
  },
2791
- value: k(E).sortOption.value,
2792
- onChange: n[5] ||= (e) => k(E).sortBy(e.target.value)
2793
+ value: k(O).sortOption.value,
2794
+ onChange: n[5] ||= (e) => k(O).sortBy(e.target.value)
2793
2795
  }, [
2794
- f("option", li, D(a.value.mediaLibrary.sortNewest), 1),
2795
- f("option", ui, D(a.value.mediaLibrary.sortOldest), 1),
2796
- f("option", di, D(a.value.mediaLibrary.sortNameAsc), 1),
2797
- f("option", fi, D(a.value.mediaLibrary.sortNameDesc), 1),
2798
- f("option", pi, D(a.value.mediaLibrary.sortSizeAsc), 1),
2799
- f("option", mi, D(a.value.mediaLibrary.sortSizeDesc), 1)
2800
- ], 40, ci)])]), f("div", hi, [k(E).viewMode.value === "files" ? (S(), d("div", gi, [m(Un, {
2801
- "is-uploading": k(E).isUploading.value,
2802
- "upload-progress": k(E).uploadProgress.value,
2803
- onUpload: k(O).handleUpload
2796
+ f("option", ci, D(a.value.mediaLibrary.sortNewest), 1),
2797
+ f("option", li, D(a.value.mediaLibrary.sortOldest), 1),
2798
+ f("option", ui, D(a.value.mediaLibrary.sortNameAsc), 1),
2799
+ f("option", di, D(a.value.mediaLibrary.sortNameDesc), 1),
2800
+ f("option", fi, D(a.value.mediaLibrary.sortSizeAsc), 1),
2801
+ f("option", pi, D(a.value.mediaLibrary.sortSizeDesc), 1)
2802
+ ], 40, si)])]), f("div", mi, [k(O).viewMode.value === "files" ? (S(), d("div", hi, [m(Hn, {
2803
+ "is-uploading": k(O).isUploading.value,
2804
+ "upload-progress": k(O).uploadProgress.value,
2805
+ onUpload: k(A).handleUpload
2804
2806
  }, null, 8, [
2805
2807
  "is-uploading",
2806
2808
  "upload-progress",
2807
2809
  "onUpload"
2808
- ]), h.value ? (S(), d("button", {
2810
+ ]), g.value ? (S(), d("button", {
2809
2811
  key: 0,
2810
2812
  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",
2811
2813
  style: {
@@ -2813,21 +2815,21 @@ var Hr = {
2813
2815
  color: "var(--tpl-text-muted)",
2814
2816
  "background-color": "var(--tpl-bg)"
2815
2817
  },
2816
- onClick: n[6] ||= (e) => k(O).showImportUrlModal.value = !0
2818
+ onClick: n[6] ||= (e) => k(A).showImportUrlModal.value = !0
2817
2819
  }, [m(k(H), {
2818
2820
  size: 14,
2819
2821
  "stroke-width": 2
2820
- }), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(Jt, {
2821
- items: k(O).displayItems.value,
2822
- "selected-ids": k(E).selectedItems.value,
2823
- "is-loading": k(E).isLoading.value,
2824
- "has-more": k(E).viewMode.value === "files" && k(E).hasMore.value,
2825
- layout: k(O).layoutMode.value,
2826
- onSelect: k(O).handleSelect,
2827
- onToggle: k(E).toggleSelection,
2828
- onLoadMore: k(E).loadMore,
2829
- onEdit: k(O).handleEditItem,
2830
- onReplace: k(O).handleReplaceItem
2822
+ }), p(" " + D(a.value.mediaLibrary.importFromUrl), 1)])) : u("", !0)])) : u("", !0), m(qt, {
2823
+ items: k(A).displayItems.value,
2824
+ "selected-ids": k(O).selectedItems.value,
2825
+ "is-loading": k(O).isLoading.value,
2826
+ "has-more": k(O).viewMode.value === "files" && k(O).hasMore.value,
2827
+ layout: k(A).layoutMode.value,
2828
+ onSelect: k(A).handleSelect,
2829
+ onToggle: k(O).toggleSelection,
2830
+ onLoadMore: k(O).loadMore,
2831
+ onEdit: k(A).handleEditItem,
2832
+ onReplace: k(A).handleReplaceItem
2831
2833
  }, null, 8, [
2832
2834
  "items",
2833
2835
  "selected-ids",
@@ -2840,12 +2842,12 @@ var Hr = {
2840
2842
  "onEdit",
2841
2843
  "onReplace"
2842
2844
  ])])])]),
2843
- m(sn, {
2844
- visible: k(O).showImportUrlModal.value,
2845
- "is-importing": k(E).isImportingFromUrl.value,
2846
- error: k(E).importFromUrlError.value,
2847
- onImport: k(O).handleImportFromUrl,
2848
- onClose: n[7] ||= (e) => k(O).showImportUrlModal.value = !1
2845
+ m(on, {
2846
+ visible: k(A).showImportUrlModal.value,
2847
+ "is-importing": k(O).isImportingFromUrl.value,
2848
+ error: k(O).importFromUrlError.value,
2849
+ onImport: k(A).handleImportFromUrl,
2850
+ onClose: n[7] ||= (e) => k(A).showImportUrlModal.value = !1
2849
2851
  }, null, 8, [
2850
2852
  "visible",
2851
2853
  "is-importing",
@@ -2853,23 +2855,23 @@ var Hr = {
2853
2855
  "onImport"
2854
2856
  ]),
2855
2857
  m(it, {
2856
- visible: !!k(O).editingItem.value,
2857
- item: k(O).editingItem.value,
2858
- onSave: k(O).handleEditSave,
2859
- onClose: n[8] ||= (e) => k(O).editingItem.value = null
2858
+ visible: !!k(A).editingItem.value,
2859
+ item: k(A).editingItem.value,
2860
+ onSave: k(A).handleEditSave,
2861
+ onClose: n[8] ||= (e) => k(A).editingItem.value = null
2860
2862
  }, null, 8, [
2861
2863
  "visible",
2862
2864
  "item",
2863
2865
  "onSave"
2864
2866
  ]),
2865
- m(Rn, {
2866
- visible: k(E).showReplaceWarning.value,
2867
- item: k(E).pendingReplaceItem.value,
2868
- "usage-info": k(E).replaceUsageInfo.value,
2869
- "is-replacing": k(E).isReplacing.value,
2870
- error: k(E).replaceError.value,
2871
- onReplace: k(O).handleReplaceFile,
2872
- onClose: k(E).cancelReplace
2867
+ m(Ln, {
2868
+ visible: k(O).showReplaceWarning.value,
2869
+ item: k(O).pendingReplaceItem.value,
2870
+ "usage-info": k(O).replaceUsageInfo.value,
2871
+ "is-replacing": k(O).isReplacing.value,
2872
+ error: k(O).replaceError.value,
2873
+ onReplace: k(A).handleReplaceFile,
2874
+ onClose: k(O).cancelReplace
2873
2875
  }, null, 8, [
2874
2876
  "visible",
2875
2877
  "item",
@@ -2887,7 +2889,7 @@ var Hr = {
2887
2889
  "leave-from-class": "tpl:opacity-100",
2888
2890
  "leave-to-class": "tpl:opacity-0"
2889
2891
  }, {
2890
- default: M(() => [k(E).showDeleteWarning.value ? (S(), d("div", {
2892
+ default: M(() => [k(O).showDeleteWarning.value ? (S(), d("div", {
2891
2893
  key: 0,
2892
2894
  class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
2893
2895
  style: {
@@ -2895,27 +2897,27 @@ var Hr = {
2895
2897
  "backdrop-filter": "blur(8px)",
2896
2898
  "-webkit-backdrop-filter": "blur(8px)"
2897
2899
  },
2898
- onClick: n[11] ||= F((...e) => k(E).cancelDelete && k(E).cancelDelete(...e), ["self"])
2899
- }, [f("div", _i, [
2900
- f("h3", vi, D(a.value.mediaLibrary.deleteWarningTitle), 1),
2900
+ onClick: n[11] ||= F((...e) => k(O).cancelDelete && k(O).cancelDelete(...e), ["self"])
2901
+ }, [f("div", gi, [
2902
+ f("h3", _i, D(a.value.mediaLibrary.deleteWarningTitle), 1),
2901
2903
  f("p", {
2902
- class: y(["tpl:text-xs", k(O).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2904
+ class: y(["tpl:text-xs", k(A).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2903
2905
  style: { color: "var(--tpl-text-muted)" }
2904
2906
  }, D(a.value.mediaLibrary.deleteWarningMessage), 3),
2905
- k(O).hasUsedFiles.value ? (S(), d("p", yi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2906
- k(O).hasUsedFiles.value ? (S(), d("div", bi, [(S(!0), d(i, null, T(k(E).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2907
+ k(A).hasUsedFiles.value ? (S(), d("p", vi, D(a.value.mediaLibrary.deleteWarningUsageNote), 1)) : u("", !0),
2908
+ k(A).hasUsedFiles.value ? (S(), d("div", yi, [(S(!0), d(i, null, T(k(O).deleteUsageInfo.value, (e, t) => (S(), d("div", {
2907
2909
  key: t,
2908
2910
  class: "tpl:text-xs",
2909
2911
  style: { color: "var(--tpl-text)" }
2910
- }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", xi, D(k(O).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", Si, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2911
- f("div", Ci, [f("button", {
2912
+ }, [e.template_count > 0 ? (S(), d(i, { key: 0 }, [f("span", bi, D(k(A).displayItems.value.find((e) => e.id === t)?.filename || t), 1), f("span", xi, " - " + D(a.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : u("", !0)]))), 128))])) : u("", !0),
2913
+ f("div", Si, [f("button", {
2912
2914
  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",
2913
2915
  style: {
2914
2916
  "border-color": "var(--tpl-border)",
2915
2917
  color: "var(--tpl-text)",
2916
2918
  "background-color": "var(--tpl-bg)"
2917
2919
  },
2918
- onClick: n[9] ||= (...e) => k(E).cancelDelete && k(E).cancelDelete(...e)
2920
+ onClick: n[9] ||= (...e) => k(O).cancelDelete && k(O).cancelDelete(...e)
2919
2921
  }, D(a.value.mediaLibrary.cancel), 1), f("button", {
2920
2922
  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",
2921
2923
  style: {
@@ -2923,31 +2925,31 @@ var Hr = {
2923
2925
  color: "var(--tpl-danger)",
2924
2926
  "background-color": "var(--tpl-danger-light)"
2925
2927
  },
2926
- onClick: n[10] ||= (...e) => k(E).confirmDelete && k(E).confirmDelete(...e)
2927
- }, D(k(O).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
2928
+ onClick: n[10] ||= (...e) => k(O).confirmDelete && k(O).confirmDelete(...e)
2929
+ }, D(k(A).hasUsedFiles.value ? a.value.mediaLibrary.deleteAnyway : a.value.mediaLibrary.confirmDelete), 1)])
2928
2930
  ])])) : u("", !0)]),
2929
2931
  _: 1
2930
2932
  }),
2931
- f("div", wi, [f("div", Ti, [k(E).previewItem.value ? (S(), l(Cn, {
2933
+ f("div", Ci, [f("div", wi, [k(O).previewItem.value ? (S(), l(Sn, {
2932
2934
  key: 0,
2933
- "selected-conversion": k(O).selectedConversion.value,
2934
- "onUpdate:selectedConversion": n[12] ||= (e) => k(O).selectedConversion.value = e,
2935
- item: k(E).previewItem.value,
2936
- folders: k(E).folders.value
2935
+ "selected-conversion": k(A).selectedConversion.value,
2936
+ "onUpdate:selectedConversion": n[12] ||= (e) => k(A).selectedConversion.value = e,
2937
+ item: k(O).previewItem.value,
2938
+ folders: k(O).folders.value
2937
2939
  }, null, 8, [
2938
2940
  "selected-conversion",
2939
2941
  "item",
2940
2942
  "folders"
2941
- ])) : u("", !0)]), f("div", Ei, [k(E).selectedItems.value.size > 0 ? (S(), d("div", Di, [k(E).previewItem.value ? (S(), d("button", {
2943
+ ])) : u("", !0)]), f("div", Ti, [k(O).selectedItems.value.size > 0 ? (S(), d("div", Ei, [k(O).previewItem.value ? (S(), d("button", {
2942
2944
  key: 0,
2943
2945
  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",
2944
2946
  style: b({
2945
- borderColor: k(O).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2946
- color: k(O).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2947
+ borderColor: k(A).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2948
+ color: k(A).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2947
2949
  backgroundColor: "var(--tpl-bg)"
2948
2950
  }),
2949
- onClick: n[13] ||= (e) => k(O).copy(k(O).selectedUrl.value)
2950
- }, [k(O).copied.value ? (S(), l(k(I), {
2951
+ onClick: n[13] ||= (e) => k(A).copy(k(A).selectedUrl.value)
2952
+ }, [k(A).copied.value ? (S(), l(k(I), {
2951
2953
  key: 1,
2952
2954
  size: 12,
2953
2955
  "stroke-width": 2
@@ -2955,25 +2957,25 @@ var Hr = {
2955
2957
  key: 0,
2956
2958
  size: 12,
2957
2959
  "stroke-width": 2
2958
- })), p(" " + D(k(O).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), c.value ? (S(), d("div", Oi, [f("button", {
2960
+ })), p(" " + D(k(A).copied.value ? a.value.mediaLibrary.copied : a.value.mediaLibrary.copyUrl), 1)], 4)) : u("", !0), h.value ? (S(), d("div", Di, [f("button", {
2959
2961
  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",
2960
2962
  style: {
2961
2963
  "border-color": "var(--tpl-border)",
2962
2964
  color: "var(--tpl-text)",
2963
2965
  "background-color": "var(--tpl-bg)"
2964
2966
  },
2965
- onClick: n[14] ||= (e) => k(O).showMovePicker.value = !k(O).showMovePicker.value
2966
- }, D(a.value.mediaLibrary.moveSelected), 1), k(O).showMovePicker.value ? (S(), l(fn, {
2967
+ onClick: n[14] ||= (e) => k(A).showMovePicker.value = !k(A).showMovePicker.value
2968
+ }, D(a.value.mediaLibrary.moveSelected), 1), k(A).showMovePicker.value ? (S(), l(dn, {
2967
2969
  key: 0,
2968
- folders: k(E).folders.value,
2969
- "current-folder-id": k(E).currentFolderId.value,
2970
- onSelect: k(O).handleMoveToFolder,
2971
- onClose: n[15] ||= (e) => k(O).showMovePicker.value = !1
2970
+ folders: k(O).folders.value,
2971
+ "current-folder-id": k(O).currentFolderId.value,
2972
+ onSelect: k(A).handleMoveToFolder,
2973
+ onClose: n[15] ||= (e) => k(A).showMovePicker.value = !1
2972
2974
  }, null, 8, [
2973
2975
  "folders",
2974
2976
  "current-folder-id",
2975
2977
  "onSelect"
2976
- ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", ki, [k(E).selectedItems.value.size > 0 ? (S(), d("button", {
2978
+ ])) : u("", !0)])) : u("", !0)])) : u("", !0), f("div", Oi, [k(O).selectedItems.value.size > 0 ? (S(), d("button", {
2977
2979
  key: 0,
2978
2980
  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",
2979
2981
  style: {
@@ -2981,7 +2983,7 @@ var Hr = {
2981
2983
  color: "var(--tpl-danger)",
2982
2984
  "background-color": "var(--tpl-danger-light)"
2983
2985
  },
2984
- onClick: n[16] ||= (...e) => k(O).handleDeleteClick && k(O).handleDeleteClick(...e)
2986
+ onClick: n[16] ||= (...e) => k(A).handleDeleteClick && k(A).handleDeleteClick(...e)
2985
2987
  }, D(a.value.mediaLibrary.deleteSelected), 1)) : u("", !0), e.onSelect ? (S(), d("button", {
2986
2988
  key: 1,
2987
2989
  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",
@@ -2989,12 +2991,12 @@ var Hr = {
2989
2991
  "background-color": "var(--tpl-primary)",
2990
2992
  color: "var(--tpl-bg)"
2991
2993
  },
2992
- disabled: !k(E).previewItem.value,
2993
- onClick: A
2994
- }, D(a.value.mediaLibrary.selectFile), 9, Ai)) : u("", !0)])])])
2994
+ disabled: !k(O).previewItem.value,
2995
+ onClick: j
2996
+ }, D(a.value.mediaLibrary.selectFile), 9, ki)) : u("", !0)])])])
2995
2997
  ]));
2996
2998
  }
2997
- }), Mi = /* #__PURE__ */ Object.assign({
2999
+ }), ji = /* #__PURE__ */ Object.assign({
2998
3000
  "./locales/ca.ts": () => import("./ca-DnghH5Xn.js"),
2999
3001
  "./locales/de.ts": () => import("./de-ByQyu2jv.js"),
3000
3002
  "./locales/en.ts": () => import("./en-B-xajqfh.js"),
@@ -3003,53 +3005,53 @@ var Hr = {
3003
3005
  "./locales/nl.ts": () => import("./nl-DGT1t3Be.js"),
3004
3006
  "./locales/pt-BR.ts": () => import("./pt-BR-C0Hzc26R.js")
3005
3007
  });
3006
- function Ni(e) {
3008
+ function Mi(e) {
3007
3009
  return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
3008
3010
  }
3009
- var Pi = Ni(Mi);
3010
- function Fi(e) {
3011
+ var Ni = Mi(ji);
3012
+ function Pi(e) {
3011
3013
  return e.trim().replace(/_/g, "-").toLowerCase();
3012
3014
  }
3015
+ function Fi(e) {
3016
+ let t = Pi(e);
3017
+ return Ni.find((e) => Pi(e) === t);
3018
+ }
3013
3019
  function Ii(e) {
3014
- let t = Fi(e);
3015
- return Pi.find((e) => Fi(e) === t);
3020
+ return Pi(e).split("-")[0];
3016
3021
  }
3017
3022
  function Li(e) {
3018
- return Fi(e).split("-")[0];
3019
- }
3020
- function Ri(e) {
3021
- return Ii(e) ?? Ii(Li(e)) ?? "en";
3023
+ return Fi(e) ?? Fi(Ii(e)) ?? "en";
3022
3024
  }
3023
- async function zi(e) {
3024
- let t = Mi[`./locales/${Ri(e)}.ts`];
3025
+ async function Ri(e) {
3026
+ let t = ji[`./locales/${Li(e)}.ts`];
3025
3027
  return (await t()).default;
3026
3028
  }
3027
3029
  //#endregion
3028
3030
  //#region src/standalone/visual.ts
3029
- var $ = null, Bi = w(null);
3030
- async function Vi(e) {
3031
+ var $ = null, zi = w(null);
3032
+ async function Bi(e) {
3031
3033
  let n = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
3032
3034
  if (!n) throw Error(`Container element not found: ${e.container}`);
3033
3035
  let i = r(e.auth, e.onError);
3034
3036
  await i.initialize();
3035
- let a = await new t(i).fetchConfig(), o = await zi(e.locale ?? "en");
3036
- return Ui(n, e.theme), $ && Hi(), new Promise((t, r) => {
3037
+ let a = await new t(i).fetchConfig(), o = await Ri(e.locale ?? "en");
3038
+ return Hi(n, e.theme), $ && Vi(), new Promise((t, r) => {
3037
3039
  try {
3038
3040
  $ = c({ setup() {
3039
3041
  let r = () => {
3040
3042
  t({
3041
- setTheme: (e) => Ui(n, e),
3042
- unmount: Hi
3043
+ setTheme: (e) => Hi(n, e),
3044
+ unmount: Vi
3043
3045
  });
3044
3046
  };
3045
- return () => g(ji, {
3047
+ return () => g(Ai, {
3046
3048
  authManager: i,
3047
3049
  projectId: i.projectId,
3048
3050
  planConfig: a,
3049
3051
  translations: o,
3050
3052
  onSelect: e.onSelect,
3051
3053
  onError: e.onError,
3052
- ref: Bi,
3054
+ ref: zi,
3053
3055
  onReady: r
3054
3056
  });
3055
3057
  } }), $.mount(n);
@@ -3058,15 +3060,15 @@ async function Vi(e) {
3058
3060
  }
3059
3061
  });
3060
3062
  }
3061
- function Hi() {
3062
- $ && ($.unmount(), $ = null, Bi.value = null);
3063
+ function Vi() {
3064
+ $ && ($.unmount(), $ = null, zi.value = null);
3063
3065
  }
3064
- function Ui(e, t) {
3066
+ function Hi(e, t) {
3065
3067
  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`)));
3066
3068
  }
3067
3069
  typeof window < "u" && (window.TemplaticalMedia = {
3068
- init: Vi,
3069
- unmount: Hi
3070
+ init: Bi,
3071
+ unmount: Vi
3070
3072
  });
3071
3073
  //#endregion
3072
- export { de as MediaApiClient, Br as MediaLibraryModal, Vi as init, Hi as unmount, Z as useI18n, Q as useMediaCategories, fe as useMediaLibrary, Vr as useMediaPicker };
3074
+ export { de as MediaApiClient, zr as MediaLibraryModal, Bi as init, Vi as unmount, Z as useI18n, Q as useMediaCategories, fe as useMediaLibrary, Br as useMediaPicker };