@fluid-app/fluid-cli-theme-dev 0.1.1072 → 0.1.1073
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist-cli-preview/.vite/manifest.json +16 -16
- package/dist/dist-cli-preview/account-screens.js +1 -1
- package/dist/dist-cli-preview/chunks/{MediaScreen-DBtUJeQl.js → MediaScreen-D8_OOZDE.js} +1 -1
- package/dist/dist-cli-preview/chunks/{MemberShareablesScreen-DVXmNdC8.js → MemberShareablesScreen-D_8lv2vt.js} +634 -625
- package/dist/dist-cli-preview/chunks/{PlaylistsScreen-_n505wee.js → PlaylistsScreen-D810qXWd.js} +1 -1
- package/dist/dist-cli-preview/chunks/{cli-preview-GPTh24ar.js → cli-preview-DyTOrZKj.js} +3 -3
- package/dist/dist-cli-preview/chunks/{mount-account-screen-CEp4THXu.js → mount-account-screen-DM1wOWbo.js} +2 -2
- package/dist/dist-cli-preview/chunks/{navigate-account-screen-BmE8hOyr.js → navigate-account-screen-CXwiYAsj.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as be, l as o, j as e, G as kl, H as zn, J as Cl, K as os, M as Sl, N as Pl, O as On, R as Tl, U as Al, V as El, W as Ml, X as ve, Y as Ve, Z as ue, _ as Ge, $ as
|
|
2
|
-
import { u as
|
|
1
|
+
import { c as be, l as o, j as e, G as kl, H as zn, J as Cl, K as os, M as Sl, N as Pl, O as On, R as Tl, U as Al, V as El, W as Ml, X as ve, Y as Ve, Z as ue, _ as Ge, $ as q, a0 as Vt, a1 as _t, a2 as $n, a3 as Un, a4 as pr, a5 as ba, a6 as Hr, a7 as nt, a8 as rs, a9 as Fl, aa as Il, ab as Dl, ac as Ll, ad as Rl, ae as zl, a as Os, af as qn, ag as Hn, ah as qs, ai as Ol, B as hr, aj as $l, D as Ul, E as ql, ak as Hl, z as Bl, x as Kl } from "./account-screen-runtime-DBo540sf.js";
|
|
2
|
+
import { u as Rt } from "./useInfiniteQuery-B0k2lCPD.js";
|
|
3
3
|
import { u as ze, o as ke, r as Is, s as te, n as Nt, a as Ds, l as Vl, b as ts, c as Cs, d as Gt, e as fr, _ as Gl, C as as, f as Wl } from "./schemas-CJGm6iSl.js";
|
|
4
4
|
import { u as Bn, P as Ql } from "./PortalTenantClientProvider-Cm8sybr0.js";
|
|
5
5
|
import { p as Yl, d as Xl, e as Zl, f as Jl, g as eo, h as to, i as so, j as ao, c as ro } from "./hey-api-client-DNgwN6me.js";
|
|
@@ -9,10 +9,10 @@ import { M as Xe, D as ht, a as ft, b as gt, c as Fe, E as lt, d as yo, e as bo,
|
|
|
9
9
|
import { S as va } from "./search-BIGAexMo.js";
|
|
10
10
|
import { u as dt } from "./use-mobile-D7RwBZ2l.js";
|
|
11
11
|
import { c as ko, a as Co, b as So, u as Po } from "./translation-api-context-factory-BHkbs163.js";
|
|
12
|
-
import { B as zt, P as gr, M as Gn, a as
|
|
12
|
+
import { B as zt, P as gr, M as Gn, a as Hs, b as To, T as Wn, C as Qn } from "./Textarea-DumX44JD.js";
|
|
13
13
|
import { C as ja, a as Ao } from "./Card-D4L2W6cc.js";
|
|
14
|
-
import { L as _r, S as it, T as Eo, a as Mo, b as Ua, c as Ct, d as Fo, U as Io, e as Do, f as
|
|
15
|
-
import { D as bs, a as wa, b as xr, c as
|
|
14
|
+
import { L as _r, S as it, T as Eo, a as Mo, b as Ua, c as Ct, d as Fo, U as Io, e as Do, f as Lo, g as Ro, h as zo, i as Oo, M as $o, P as Uo } from "./index-D0GO5Cwg.js";
|
|
15
|
+
import { D as bs, a as wa, b as xr, c as qo, d as Ho, R as St, T as ns, P as Wt, e as Bs, f as Na, g as yr, h as br, M as Yn } from "./ResponsiveDialog-BQjNkHDC.js";
|
|
16
16
|
import { C as Bo } from "./copy-Dtj1yNq0.js";
|
|
17
17
|
import { u as Ko, S as Vo, P as Go, E as Wo } from "./index-DNhH5pOw.js";
|
|
18
18
|
import { c as Xn, A as Qo, R as Yo, C as Xo, a as Zo, b as Jo, d as fs, S as Zn, e as Jn, f as ei, g as ti, h as si } from "./Select-sW9YXp54.js";
|
|
@@ -20,7 +20,7 @@ import { u as ec } from "./index-BcVHp4rw.js";
|
|
|
20
20
|
import { d as tc } from "./member-permissions-ndhNmlOk.js";
|
|
21
21
|
import { u as sc } from "./use-store-BcHHhhoB.js";
|
|
22
22
|
import { c as ac, a as rc } from "./client.gen-C9JDLz8R.js";
|
|
23
|
-
import { i as nc } from "./navigate-account-screen-
|
|
23
|
+
import { i as nc } from "./navigate-account-screen-CXwiYAsj.js";
|
|
24
24
|
/**
|
|
25
25
|
* @license lucide-react v0.575.0 - ISC
|
|
26
26
|
*
|
|
@@ -135,7 +135,7 @@ const yc = [
|
|
|
135
135
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
136
136
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
137
137
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
138
|
-
],
|
|
138
|
+
], Ls = be("download", yc);
|
|
139
139
|
/**
|
|
140
140
|
* @license lucide-react v0.575.0 - ISC
|
|
141
141
|
*
|
|
@@ -317,14 +317,14 @@ const Dc = [
|
|
|
317
317
|
}
|
|
318
318
|
],
|
|
319
319
|
["path", { d: "M20.054 15.987H3.946", key: "14rxg9" }]
|
|
320
|
-
],
|
|
320
|
+
], Lc = be("laptop", Dc);
|
|
321
321
|
/**
|
|
322
322
|
* @license lucide-react v0.575.0 - ISC
|
|
323
323
|
*
|
|
324
324
|
* This source code is licensed under the ISC license.
|
|
325
325
|
* See the LICENSE file in the root directory of this source tree.
|
|
326
326
|
*/
|
|
327
|
-
const
|
|
327
|
+
const Rc = [
|
|
328
328
|
[
|
|
329
329
|
"path",
|
|
330
330
|
{
|
|
@@ -346,7 +346,7 @@ const Lc = [
|
|
|
346
346
|
key: "kqbvx6"
|
|
347
347
|
}
|
|
348
348
|
]
|
|
349
|
-
], zc = be("layers",
|
|
349
|
+
], zc = be("layers", Rc);
|
|
350
350
|
/**
|
|
351
351
|
* @license lucide-react v0.575.0 - ISC
|
|
352
352
|
*
|
|
@@ -381,18 +381,18 @@ const Uc = [
|
|
|
381
381
|
["path", { d: "M21 8V5a2 2 0 0 0-2-2h-3", key: "1e4gt3" }],
|
|
382
382
|
["path", { d: "M3 16v3a2 2 0 0 0 2 2h3", key: "wsl5sc" }],
|
|
383
383
|
["path", { d: "M16 21h3a2 2 0 0 0 2-2v-3", key: "18trek" }]
|
|
384
|
-
],
|
|
384
|
+
], qc = be("maximize", Uc);
|
|
385
385
|
/**
|
|
386
386
|
* @license lucide-react v0.575.0 - ISC
|
|
387
387
|
*
|
|
388
388
|
* This source code is licensed under the ISC license.
|
|
389
389
|
* See the LICENSE file in the root directory of this source tree.
|
|
390
390
|
*/
|
|
391
|
-
const
|
|
391
|
+
const Hc = [
|
|
392
392
|
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
393
393
|
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
394
394
|
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
395
|
-
], Bc = be("menu",
|
|
395
|
+
], Bc = be("menu", Hc);
|
|
396
396
|
/**
|
|
397
397
|
* @license lucide-react v0.575.0 - ISC
|
|
398
398
|
*
|
|
@@ -836,7 +836,7 @@ function It(t) {
|
|
|
836
836
|
return /* @__PURE__ */ e.jsx(wd, { ...t });
|
|
837
837
|
}
|
|
838
838
|
const Dt = Nd;
|
|
839
|
-
function
|
|
839
|
+
function Lt({
|
|
840
840
|
className: t,
|
|
841
841
|
sideOffset: s = 4,
|
|
842
842
|
...a
|
|
@@ -970,7 +970,7 @@ const Td = (t) => t.client.get(
|
|
|
970
970
|
"Content-Type": "application/json",
|
|
971
971
|
...t.headers
|
|
972
972
|
}
|
|
973
|
-
}),
|
|
973
|
+
}), Ld = (t) => t.client.delete({
|
|
974
974
|
responseStyle: "data",
|
|
975
975
|
security: [
|
|
976
976
|
{
|
|
@@ -981,7 +981,7 @@ const Td = (t) => t.client.get(
|
|
|
981
981
|
],
|
|
982
982
|
url: "/api/content/media/{medium_id}/products/{id}",
|
|
983
983
|
...t
|
|
984
|
-
}),
|
|
984
|
+
}), Rd = (t) => t.client.get({
|
|
985
985
|
responseStyle: "data",
|
|
986
986
|
security: [
|
|
987
987
|
{
|
|
@@ -1044,7 +1044,7 @@ const Td = (t) => t.client.get(
|
|
|
1044
1044
|
"Content-Type": "application/json",
|
|
1045
1045
|
...t.headers
|
|
1046
1046
|
}
|
|
1047
|
-
}),
|
|
1047
|
+
}), qd = (t) => t.client.get({
|
|
1048
1048
|
responseStyle: "data",
|
|
1049
1049
|
security: [
|
|
1050
1050
|
{
|
|
@@ -1055,7 +1055,7 @@ const Td = (t) => t.client.get(
|
|
|
1055
1055
|
],
|
|
1056
1056
|
url: "/api/content/playlists/{playlist_id}/items",
|
|
1057
1057
|
...t
|
|
1058
|
-
}),
|
|
1058
|
+
}), Hd = (t) => t.client.post({
|
|
1059
1059
|
responseStyle: "data",
|
|
1060
1060
|
security: [
|
|
1061
1061
|
{
|
|
@@ -1318,13 +1318,13 @@ const Td = (t) => t.client.get(
|
|
|
1318
1318
|
],
|
|
1319
1319
|
url: "/api/content/pages/by-shares",
|
|
1320
1320
|
...t
|
|
1321
|
-
}),
|
|
1322
|
-
content_media_by_shares: (t, s) => tu({ client: t, ...
|
|
1323
|
-
content_media_by_visits: (t, s) => eu({ client: t, ...
|
|
1324
|
-
content_pages_by_shares: (t, s) => nu({ client: t, ...
|
|
1325
|
-
content_pages_by_visits: (t, s) => ru({ client: t, ...
|
|
1326
|
-
content_playlists_by_shares: (t, s) => au({ client: t, ...
|
|
1327
|
-
content_playlists_by_visits: (t, s) => su({ client: t, ...
|
|
1321
|
+
}), He = (t) => t === void 0 ? {} : { query: t }, je = {
|
|
1322
|
+
content_media_by_shares: (t, s) => tu({ client: t, ...He(s) }),
|
|
1323
|
+
content_media_by_visits: (t, s) => eu({ client: t, ...He(s) }),
|
|
1324
|
+
content_pages_by_shares: (t, s) => nu({ client: t, ...He(s) }),
|
|
1325
|
+
content_pages_by_visits: (t, s) => ru({ client: t, ...He(s) }),
|
|
1326
|
+
content_playlists_by_shares: (t, s) => au({ client: t, ...He(s) }),
|
|
1327
|
+
content_playlists_by_visits: (t, s) => su({ client: t, ...He(s) }),
|
|
1328
1328
|
dam_asset_paths_create: (t, s, a) => _i({
|
|
1329
1329
|
client: t,
|
|
1330
1330
|
path: { asset_code: s },
|
|
@@ -1333,41 +1333,41 @@ const Td = (t) => t.client.get(
|
|
|
1333
1333
|
dam_asset_paths_list: (t, s, a) => Xd({
|
|
1334
1334
|
client: t,
|
|
1335
1335
|
path: { asset_code: s },
|
|
1336
|
-
...
|
|
1336
|
+
...He(a)
|
|
1337
1337
|
}),
|
|
1338
1338
|
dam_assets_create: (t, s) => gi({ client: t, body: s }),
|
|
1339
1339
|
dam_assets_destroy: (t, s) => xi({ client: t, path: { code: s } }),
|
|
1340
1340
|
dam_assets_discard: (t, s) => yi({ client: t, path: { code: s } }),
|
|
1341
|
-
dam_assets_list: (t, s) => Yd({ client: t, ...
|
|
1341
|
+
dam_assets_list: (t, s) => Yd({ client: t, ...He(s) }),
|
|
1342
1342
|
favorites_toggle: (t, s) => Jd({ client: t, body: s }),
|
|
1343
1343
|
media_create: (t, s) => Ad({ client: t, body: s }),
|
|
1344
1344
|
media_destroy: (t, s) => Ed({ client: t, path: { id: s } }),
|
|
1345
|
-
media_list: (t, s) => Td({ client: t, ...
|
|
1345
|
+
media_list: (t, s) => Td({ client: t, ...He(s) }),
|
|
1346
1346
|
media_products_add: (t, s, a) => Dd({ client: t, path: { medium_id: s }, body: a }),
|
|
1347
1347
|
media_products_list: (t, s, a) => Id({
|
|
1348
1348
|
client: t,
|
|
1349
1349
|
path: { medium_id: s },
|
|
1350
|
-
...
|
|
1350
|
+
...He(a)
|
|
1351
1351
|
}),
|
|
1352
|
-
media_products_remove: (t, s, a) =>
|
|
1352
|
+
media_products_remove: (t, s, a) => Ld({
|
|
1353
1353
|
client: t,
|
|
1354
1354
|
path: { medium_id: s, id: a }
|
|
1355
1355
|
}),
|
|
1356
|
-
media_show: (t, s, a) => Md({ client: t, path: { id: s }, ...
|
|
1357
|
-
media_update: (t, s, a, r) => Fd({ client: t, path: { id: s }, body: a, ...
|
|
1358
|
-
pages_list: (t, s) => Vd({ client: t, ...
|
|
1359
|
-
pages_show: (t, s, a) => Gd({ client: t, path: { id: s }, ...
|
|
1356
|
+
media_show: (t, s, a) => Md({ client: t, path: { id: s }, ...He(a) }),
|
|
1357
|
+
media_update: (t, s, a, r) => Fd({ client: t, path: { id: s }, body: a, ...He(r) }),
|
|
1358
|
+
pages_list: (t, s) => Vd({ client: t, ...He(s) }),
|
|
1359
|
+
pages_show: (t, s, a) => Gd({ client: t, path: { id: s }, ...He(a) }),
|
|
1360
1360
|
playlists_create: (t, s) => zd({ client: t, body: s }),
|
|
1361
1361
|
playlists_destroy: (t, s) => Od({ client: t, path: { id: s } }),
|
|
1362
|
-
playlists_items_add: (t, s, a) =>
|
|
1362
|
+
playlists_items_add: (t, s, a) => Hd({
|
|
1363
1363
|
client: t,
|
|
1364
1364
|
path: { playlist_id: s },
|
|
1365
1365
|
body: a
|
|
1366
1366
|
}),
|
|
1367
|
-
playlists_items_list: (t, s, a) =>
|
|
1367
|
+
playlists_items_list: (t, s, a) => qd({
|
|
1368
1368
|
client: t,
|
|
1369
1369
|
path: { playlist_id: s },
|
|
1370
|
-
...
|
|
1370
|
+
...He(a)
|
|
1371
1371
|
}),
|
|
1372
1372
|
playlists_items_remove: (t, s, a) => Kd({
|
|
1373
1373
|
client: t,
|
|
@@ -1378,11 +1378,11 @@ const Td = (t) => t.client.get(
|
|
|
1378
1378
|
path: { playlist_id: s },
|
|
1379
1379
|
body: a
|
|
1380
1380
|
}),
|
|
1381
|
-
playlists_list: (t, s) =>
|
|
1381
|
+
playlists_list: (t, s) => Rd({ client: t, ...He(s) }),
|
|
1382
1382
|
playlists_show: (t, s) => $d({ client: t, path: { id: s } }),
|
|
1383
1383
|
playlists_update: (t, s, a) => Ud({ client: t, path: { id: s }, body: a }),
|
|
1384
1384
|
shares_create: (t, s) => Qd({ client: t, body: s }),
|
|
1385
|
-
shares_list: (t, s) => Wd({ client: t, ...
|
|
1385
|
+
shares_list: (t, s) => Wd({ client: t, ...He(s) })
|
|
1386
1386
|
}, bi = o.createContext(null), iu = bi.Provider;
|
|
1387
1387
|
function vi() {
|
|
1388
1388
|
const t = o.useContext(bi);
|
|
@@ -1406,17 +1406,17 @@ function wi() {
|
|
|
1406
1406
|
);
|
|
1407
1407
|
return t.api;
|
|
1408
1408
|
}
|
|
1409
|
-
const
|
|
1409
|
+
const Rs = {
|
|
1410
1410
|
all: ["portal-products"],
|
|
1411
|
-
list: (t) => [...
|
|
1412
|
-
detail: (t) => [...
|
|
1413
|
-
search: (t, s) => [...
|
|
1414
|
-
media: (t) => [...
|
|
1411
|
+
list: (t) => [...Rs.all, "list", t],
|
|
1412
|
+
detail: (t) => [...Rs.all, "detail", String(t)],
|
|
1413
|
+
search: (t, s) => [...Rs.all, "search", t, s],
|
|
1414
|
+
media: (t) => [...Rs.all, "media", String(t)]
|
|
1415
1415
|
};
|
|
1416
1416
|
function ou(t, s) {
|
|
1417
1417
|
const a = wi();
|
|
1418
1418
|
return Ve({
|
|
1419
|
-
queryKey:
|
|
1419
|
+
queryKey: Rs.detail(t),
|
|
1420
1420
|
queryFn: () => a.getProduct(t),
|
|
1421
1421
|
enabled: s?.enabled ?? !0
|
|
1422
1422
|
});
|
|
@@ -1513,14 +1513,14 @@ const Yr = {
|
|
|
1513
1513
|
block_crawler: !1
|
|
1514
1514
|
}
|
|
1515
1515
|
};
|
|
1516
|
-
function
|
|
1516
|
+
function qa(t) {
|
|
1517
1517
|
const a = t.filter((r) => r.active !== !1).length > 0 ? lr(t) : t;
|
|
1518
1518
|
return {
|
|
1519
1519
|
product_subscription_plans: a,
|
|
1520
1520
|
product_subscription_plans_attributes: ki(a)
|
|
1521
1521
|
};
|
|
1522
1522
|
}
|
|
1523
|
-
const
|
|
1523
|
+
const Ha = (t) => {
|
|
1524
1524
|
try {
|
|
1525
1525
|
return new URL(t).pathname.split("/").pop() || "";
|
|
1526
1526
|
} catch {
|
|
@@ -1538,7 +1538,7 @@ const qa = (t) => {
|
|
|
1538
1538
|
isValid: !1,
|
|
1539
1539
|
isDirty: !1,
|
|
1540
1540
|
setProduct: (a) => {
|
|
1541
|
-
const r = a.image_path && !a.image_path.includes("undefined") ? a.image_path : a.image_url ?
|
|
1541
|
+
const r = a.image_path && !a.image_path.includes("undefined") ? a.image_path : a.image_url ? Ha(a.image_url) : void 0, n = a.category_id ? parseInt(a.category_id) : a.category?.id, i = {
|
|
1542
1542
|
...a.id !== void 0 && { id: a.id },
|
|
1543
1543
|
title: a.title || "",
|
|
1544
1544
|
description: a.description || "",
|
|
@@ -1596,7 +1596,7 @@ const qa = (t) => {
|
|
|
1596
1596
|
})(),
|
|
1597
1597
|
images_attributes: a.images?.map(
|
|
1598
1598
|
(l) => {
|
|
1599
|
-
const u = l.image_path && !l.image_path.includes("undefined") ? l.image_path : l.image_url ?
|
|
1599
|
+
const u = l.image_path && !l.image_path.includes("undefined") ? l.image_path : l.image_url ? Ha(l.image_url) : void 0;
|
|
1600
1600
|
return {
|
|
1601
1601
|
...l.id !== void 0 && { id: l.id },
|
|
1602
1602
|
position: l.position || 0,
|
|
@@ -1610,7 +1610,7 @@ const qa = (t) => {
|
|
|
1610
1610
|
if (a.image_path && typeof a.image_path == "string" && !a.image_path.includes("undefined"))
|
|
1611
1611
|
return { image_path: a.image_path };
|
|
1612
1612
|
const l = a.images.find((u) => u.position === 0);
|
|
1613
|
-
return l?.image_path && typeof l.image_path == "string" && !l.image_path.includes("undefined") ? { image_path: l.image_path } : a.image_url ? { image_path:
|
|
1613
|
+
return l?.image_path && typeof l.image_path == "string" && !l.image_path.includes("undefined") ? { image_path: l.image_path } : a.image_url ? { image_path: Ha(a.image_url) } : {};
|
|
1614
1614
|
})(),
|
|
1615
1615
|
product_subscription_plans: (() => {
|
|
1616
1616
|
const l = a?.product_subscription_plans?.map(
|
|
@@ -1781,7 +1781,7 @@ const qa = (t) => {
|
|
|
1781
1781
|
} = n || {};
|
|
1782
1782
|
t((c) => a === "product_subscription_plans" ? {
|
|
1783
1783
|
...c,
|
|
1784
|
-
...
|
|
1784
|
+
...qa(r),
|
|
1785
1785
|
errors: l ? { ...c.errors, [a]: void 0 } : c.errors,
|
|
1786
1786
|
isDirty: u ? !0 : c.isDirty
|
|
1787
1787
|
} : {
|
|
@@ -1795,7 +1795,7 @@ const qa = (t) => {
|
|
|
1795
1795
|
t((r) => a.product_subscription_plans ? {
|
|
1796
1796
|
...r,
|
|
1797
1797
|
...a,
|
|
1798
|
-
...
|
|
1798
|
+
...qa(a.product_subscription_plans),
|
|
1799
1799
|
errors: {
|
|
1800
1800
|
...r.errors,
|
|
1801
1801
|
...Object.keys(a).reduce(
|
|
@@ -1822,7 +1822,7 @@ const qa = (t) => {
|
|
|
1822
1822
|
const c = (Array.isArray(l[a]) ? l[a] : []).map((d) => typeof d == "object" && d !== null && i in d && d[i] === r ? n : d);
|
|
1823
1823
|
return a === "product_subscription_plans" ? {
|
|
1824
1824
|
...l,
|
|
1825
|
-
...
|
|
1825
|
+
...qa(
|
|
1826
1826
|
c
|
|
1827
1827
|
),
|
|
1828
1828
|
errors: { ...l.errors, [a]: void 0 },
|
|
@@ -2550,7 +2550,7 @@ function Du(t, s, a) {
|
|
|
2550
2550
|
return !1;
|
|
2551
2551
|
});
|
|
2552
2552
|
}
|
|
2553
|
-
function
|
|
2553
|
+
function Lu(t) {
|
|
2554
2554
|
if (!t || t.length === 0)
|
|
2555
2555
|
return "Any file type";
|
|
2556
2556
|
const s = [], a = /* @__PURE__ */ new Set();
|
|
@@ -2558,7 +2558,7 @@ function Ru(t) {
|
|
|
2558
2558
|
a.has(r) || (a.add(r), r === "image/*" ? s.push("Images") : r === "video/*" ? s.push("Videos") : r === "audio/*" ? s.push("Audio") : r === "application/pdf" ? s.push("PDF files") : r.startsWith(".") ? s.push(`${r.toUpperCase()} files`) : r.includes("/") && s.push(r));
|
|
2559
2559
|
}), s.length === 0 ? t.join(", ") : s.length === 1 ? s[0] : s.length === 2 ? `${s[0]} and ${s[1]}` : `${s.slice(0, -1).join(", ")}, and ${s[s.length - 1]}`;
|
|
2560
2560
|
}
|
|
2561
|
-
var
|
|
2561
|
+
var Ru = Object.defineProperty, zu = (t, s, a) => s in t ? Ru(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a, Pe = (t, s, a) => zu(t, typeof s != "symbol" ? s + "" : s, a);
|
|
2562
2562
|
const _a = {
|
|
2563
2563
|
x: 0,
|
|
2564
2564
|
y: 0,
|
|
@@ -2611,12 +2611,12 @@ function en(t, s, a, r, n, i = 0, l = 0, u = r, c = n) {
|
|
|
2611
2611
|
}
|
|
2612
2612
|
return d;
|
|
2613
2613
|
}
|
|
2614
|
-
function
|
|
2614
|
+
function qu(t, s, a, r) {
|
|
2615
2615
|
const n = { ...t };
|
|
2616
2616
|
return s === "ArrowLeft" ? r === "nw" ? (n.x -= a, n.y -= a, n.width += a, n.height += a) : r === "w" ? (n.x -= a, n.width += a) : r === "sw" ? (n.x -= a, n.width += a, n.height += a) : r === "ne" ? (n.y += a, n.width -= a, n.height -= a) : r === "e" ? n.width -= a : r === "se" && (n.width -= a, n.height -= a) : s === "ArrowRight" && (r === "nw" ? (n.x += a, n.y += a, n.width -= a, n.height -= a) : r === "w" ? (n.x += a, n.width -= a) : r === "sw" ? (n.x += a, n.width -= a, n.height -= a) : r === "ne" ? (n.y -= a, n.width += a, n.height += a) : r === "e" ? n.width += a : r === "se" && (n.width += a, n.height += a)), s === "ArrowUp" ? r === "nw" ? (n.x -= a, n.y -= a, n.width += a, n.height += a) : r === "n" ? (n.y -= a, n.height += a) : r === "ne" ? (n.y -= a, n.width += a, n.height += a) : r === "sw" ? (n.x += a, n.width -= a, n.height -= a) : r === "s" ? n.height -= a : r === "se" && (n.width -= a, n.height -= a) : s === "ArrowDown" && (r === "nw" ? (n.x += a, n.y += a, n.width -= a, n.height -= a) : r === "n" ? (n.y += a, n.height -= a) : r === "ne" ? (n.y += a, n.width -= a, n.height -= a) : r === "sw" ? (n.x -= a, n.width += a, n.height += a) : r === "s" ? n.height += a : r === "se" && (n.width += a, n.height += a)), n;
|
|
2617
2617
|
}
|
|
2618
2618
|
const ds = { capture: !0, passive: !1 };
|
|
2619
|
-
let
|
|
2619
|
+
let Hu = 0;
|
|
2620
2620
|
const Bt = class bt extends o.PureComponent {
|
|
2621
2621
|
constructor() {
|
|
2622
2622
|
super(...arguments), Pe(this, "docMoveBound", !1), Pe(this, "mouseDownOnCrop", !1), Pe(this, "dragStarted", !1), Pe(this, "evData", {
|
|
@@ -2627,7 +2627,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2627
2627
|
clientX: 0,
|
|
2628
2628
|
clientY: 0,
|
|
2629
2629
|
isResize: !0
|
|
2630
|
-
}), Pe(this, "componentRef", o.createRef()), Pe(this, "mediaRef", o.createRef()), Pe(this, "resizeObserver"), Pe(this, "initChangeCalled", !1), Pe(this, "instanceId", `rc-${
|
|
2630
|
+
}), Pe(this, "componentRef", o.createRef()), Pe(this, "mediaRef", o.createRef()), Pe(this, "resizeObserver"), Pe(this, "initChangeCalled", !1), Pe(this, "instanceId", `rc-${Hu++}`), Pe(this, "state", {
|
|
2631
2631
|
cropIsActive: !1,
|
|
2632
2632
|
newCropIsBeingDrawn: !1
|
|
2633
2633
|
}), Pe(this, "onCropPointerDown", (s) => {
|
|
@@ -2720,7 +2720,7 @@ const Bt = class bt extends o.PureComponent {
|
|
|
2720
2720
|
s.stopPropagation(), s.preventDefault();
|
|
2721
2721
|
else
|
|
2722
2722
|
return;
|
|
2723
|
-
const f = (navigator.platform.match("Mac") ? s.metaKey : s.ctrlKey) ? bt.nudgeStepLarge : s.shiftKey ? bt.nudgeStepMedium : bt.nudgeStep, g = wt(n, p.width, p.height), x =
|
|
2723
|
+
const f = (navigator.platform.match("Mac") ? s.metaKey : s.ctrlKey) ? bt.nudgeStepLarge : s.shiftKey ? bt.nudgeStepMedium : bt.nudgeStep, g = wt(n, p.width, p.height), x = qu(g, s.key, f, a), _ = en(
|
|
2724
2724
|
x,
|
|
2725
2725
|
r,
|
|
2726
2726
|
a,
|
|
@@ -3023,12 +3023,12 @@ async function Wu(t, s, a, r, n, i, l, u, c = "image/jpeg", d = 0.9, m) {
|
|
|
3023
3023
|
if (!K) throw new Error("No 2d context");
|
|
3024
3024
|
return K.imageSmoothingQuality = "high", K.imageSmoothingEnabled = !0, K.drawImage(O, E, P, A, M, 0, 0, A, M), new Promise((W, D) => {
|
|
3025
3025
|
S.toBlob(
|
|
3026
|
-
(
|
|
3027
|
-
if (!
|
|
3026
|
+
(L) => {
|
|
3027
|
+
if (!L) {
|
|
3028
3028
|
D(new Error("Canvas is empty"));
|
|
3029
3029
|
return;
|
|
3030
3030
|
}
|
|
3031
|
-
const T = new File([
|
|
3031
|
+
const T = new File([L], u, { type: c });
|
|
3032
3032
|
W(T);
|
|
3033
3033
|
},
|
|
3034
3034
|
c,
|
|
@@ -3992,7 +3992,7 @@ function ln(t) {
|
|
|
3992
3992
|
} : void 0
|
|
3993
3993
|
};
|
|
3994
3994
|
}
|
|
3995
|
-
function
|
|
3995
|
+
function Li(t) {
|
|
3996
3996
|
return {
|
|
3997
3997
|
listShares: async (s) => {
|
|
3998
3998
|
const a = await je.shares_list(t, {
|
|
@@ -4015,7 +4015,7 @@ function Ri(t) {
|
|
|
4015
4015
|
}
|
|
4016
4016
|
};
|
|
4017
4017
|
}
|
|
4018
|
-
const
|
|
4018
|
+
const Ri = {
|
|
4019
4019
|
Medium: "media",
|
|
4020
4020
|
media: "media",
|
|
4021
4021
|
Product: "product",
|
|
@@ -4027,15 +4027,15 @@ const Li = {
|
|
|
4027
4027
|
Page: "page",
|
|
4028
4028
|
page: "page"
|
|
4029
4029
|
}, vm = [
|
|
4030
|
-
...new Set(Object.values(
|
|
4030
|
+
...new Set(Object.values(Ri))
|
|
4031
4031
|
].join(", ");
|
|
4032
4032
|
function jm(t) {
|
|
4033
|
-
const s =
|
|
4033
|
+
const s = Li(t);
|
|
4034
4034
|
return {
|
|
4035
4035
|
createShareLink: async (a) => {
|
|
4036
4036
|
if (!a.relateableId)
|
|
4037
4037
|
throw new Error("Cannot create share link without a relateableId");
|
|
4038
|
-
const r =
|
|
4038
|
+
const r = Ri[a.relateableType];
|
|
4039
4039
|
if (!r)
|
|
4040
4040
|
throw new Error(
|
|
4041
4041
|
`Cannot share a "${a.relateableType}" — shareable links support only ${vm}.`
|
|
@@ -4469,7 +4469,7 @@ function Em(t) {
|
|
|
4469
4469
|
return Ii(t);
|
|
4470
4470
|
}
|
|
4471
4471
|
function Mm(t) {
|
|
4472
|
-
return
|
|
4472
|
+
return Li(t);
|
|
4473
4473
|
}
|
|
4474
4474
|
function Fm(t) {
|
|
4475
4475
|
return Oi(t);
|
|
@@ -4480,7 +4480,7 @@ function Im(t) {
|
|
|
4480
4480
|
function Dm(t) {
|
|
4481
4481
|
return zi(t);
|
|
4482
4482
|
}
|
|
4483
|
-
function
|
|
4483
|
+
function Lm(t) {
|
|
4484
4484
|
return wm(t);
|
|
4485
4485
|
}
|
|
4486
4486
|
async function pn(t, s, a) {
|
|
@@ -4493,7 +4493,7 @@ async function pn(t, s, a) {
|
|
|
4493
4493
|
})).is_favorited };
|
|
4494
4494
|
}
|
|
4495
4495
|
const Ui = o.createContext(null);
|
|
4496
|
-
function
|
|
4496
|
+
function Rm() {
|
|
4497
4497
|
const t = o.use(Ui);
|
|
4498
4498
|
if (!t)
|
|
4499
4499
|
throw new Error(
|
|
@@ -4501,7 +4501,7 @@ function Lm() {
|
|
|
4501
4501
|
);
|
|
4502
4502
|
return t;
|
|
4503
4503
|
}
|
|
4504
|
-
function
|
|
4504
|
+
function qi({
|
|
4505
4505
|
children: t
|
|
4506
4506
|
}) {
|
|
4507
4507
|
const s = Bn(), a = vi(), r = wi(), n = o.useMemo(
|
|
@@ -4517,7 +4517,7 @@ function Hi({
|
|
|
4517
4517
|
() => Dm(a),
|
|
4518
4518
|
[a]
|
|
4519
4519
|
), c = o.useMemo(
|
|
4520
|
-
() =>
|
|
4520
|
+
() => Lm(s),
|
|
4521
4521
|
[s]
|
|
4522
4522
|
), d = o.useMemo(
|
|
4523
4523
|
() => pm(a),
|
|
@@ -4562,7 +4562,7 @@ function Hi({
|
|
|
4562
4562
|
}
|
|
4563
4563
|
/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
|
|
4564
4564
|
const {
|
|
4565
|
-
entries:
|
|
4565
|
+
entries: Hi,
|
|
4566
4566
|
setPrototypeOf: hn,
|
|
4567
4567
|
isFrozen: zm,
|
|
4568
4568
|
getPrototypeOf: Om,
|
|
@@ -4592,7 +4592,7 @@ dr || (dr = function(s) {
|
|
|
4592
4592
|
r[n - 1] = arguments[n];
|
|
4593
4593
|
return new s(...r);
|
|
4594
4594
|
});
|
|
4595
|
-
const ia = et(Array.prototype.forEach), Um = et(Array.prototype.lastIndexOf), fn = et(Array.prototype.pop), Ps = et(Array.prototype.push),
|
|
4595
|
+
const ia = et(Array.prototype.forEach), Um = et(Array.prototype.lastIndexOf), fn = et(Array.prototype.pop), Ps = et(Array.prototype.push), qm = et(Array.prototype.splice), ma = et(String.prototype.toLowerCase), Va = et(String.prototype.toString), Ga = et(String.prototype.match), Ts = et(String.prototype.replace), Hm = et(String.prototype.indexOf), Bm = et(String.prototype.trim), pt = et(Object.prototype.hasOwnProperty), Ye = et(RegExp.prototype.test), As = Km(TypeError);
|
|
4596
4596
|
function et(t) {
|
|
4597
4597
|
return function(s) {
|
|
4598
4598
|
s instanceof RegExp && (s.lastIndex = 0);
|
|
@@ -4629,7 +4629,7 @@ function Vm(t) {
|
|
|
4629
4629
|
}
|
|
4630
4630
|
function jt(t) {
|
|
4631
4631
|
const s = ua(null);
|
|
4632
|
-
for (const [a, r] of
|
|
4632
|
+
for (const [a, r] of Hi(t))
|
|
4633
4633
|
pt(t, a) && (Array.isArray(r) ? s[a] = Vm(r) : r && typeof r == "object" && r.constructor === Object ? s[a] = jt(r) : s[a] = r);
|
|
4634
4634
|
return s;
|
|
4635
4635
|
}
|
|
@@ -4743,7 +4743,7 @@ function Vi() {
|
|
|
4743
4743
|
importNode: E
|
|
4744
4744
|
} = r;
|
|
4745
4745
|
let P = vn();
|
|
4746
|
-
s.isSupported = typeof
|
|
4746
|
+
s.isSupported = typeof Hi == "function" && typeof j == "function" && N && N.createHTMLDocument !== void 0;
|
|
4747
4747
|
const {
|
|
4748
4748
|
MUSTACHE_EXPR: A,
|
|
4749
4749
|
ERB_EXPR: M,
|
|
@@ -4751,7 +4751,7 @@ function Vi() {
|
|
|
4751
4751
|
DATA_ATTR: K,
|
|
4752
4752
|
ARIA_ATTR: W,
|
|
4753
4753
|
IS_SCRIPT_OR_DATA: D,
|
|
4754
|
-
ATTR_WHITESPACE:
|
|
4754
|
+
ATTR_WHITESPACE: L,
|
|
4755
4755
|
CUSTOM_ELEMENT: T
|
|
4756
4756
|
} = bn;
|
|
4757
4757
|
let {
|
|
@@ -4759,7 +4759,7 @@ function Vi() {
|
|
|
4759
4759
|
} = bn, $ = null;
|
|
4760
4760
|
const se = xe({}, [...gn, ...Wa, ...Qa, ...Ya, ..._n]);
|
|
4761
4761
|
let G = null;
|
|
4762
|
-
const
|
|
4762
|
+
const H = xe({}, [...xn, ...Xa, ...yn, ...la]);
|
|
4763
4763
|
let B = Object.seal(ua(null, {
|
|
4764
4764
|
tagNameCheck: {
|
|
4765
4765
|
writable: !0,
|
|
@@ -4794,28 +4794,28 @@ function Vi() {
|
|
|
4794
4794
|
value: null
|
|
4795
4795
|
}
|
|
4796
4796
|
}));
|
|
4797
|
-
let F = !0,
|
|
4797
|
+
let F = !0, R = !0, Y = !1, Z = !0, J = !1, me = !0, k = !1, oe = !1, ye = !1, fe = !1, X = !1, le = !1, We = !0, Be = !1;
|
|
4798
4798
|
const tt = "user-content-";
|
|
4799
4799
|
let Qe = !0, Pt = !1, V = {}, ae = null;
|
|
4800
4800
|
const pe = xe({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
4801
4801
|
let ge = null;
|
|
4802
|
-
const
|
|
4802
|
+
const Re = xe({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
4803
4803
|
let Ue = null;
|
|
4804
4804
|
const Qt = xe({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), vt = "http://www.w3.org/1998/Math/MathML", Tt = "http://www.w3.org/2000/svg", st = "http://www.w3.org/1999/xhtml";
|
|
4805
4805
|
let at = st, Yt = !1, $t = null;
|
|
4806
|
-
const
|
|
4806
|
+
const La = xe({}, [vt, Tt, st], Va);
|
|
4807
4807
|
let Ut = xe({}, ["mi", "mo", "mn", "ms", "mtext"]), Xt = xe({}, ["annotation-xml"]);
|
|
4808
4808
|
const ws = xe({}, ["title", "style", "font", "a", "script"]);
|
|
4809
|
-
let
|
|
4810
|
-
const
|
|
4811
|
-
let Me = null,
|
|
4809
|
+
let qt = null;
|
|
4810
|
+
const Ra = ["application/xhtml+xml", "text/html"], za = "text/html";
|
|
4811
|
+
let Me = null, Ht = null;
|
|
4812
4812
|
const Oa = a.createElement("form"), Xs = function(y) {
|
|
4813
4813
|
return y instanceof RegExp || y instanceof Function;
|
|
4814
4814
|
}, Ns = function() {
|
|
4815
4815
|
let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4816
|
-
if (!(
|
|
4817
|
-
if ((!y || typeof y != "object") && (y = {}), y = jt(y),
|
|
4818
|
-
|
|
4816
|
+
if (!(Ht && Ht === y)) {
|
|
4817
|
+
if ((!y || typeof y != "object") && (y = {}), y = jt(y), qt = // eslint-disable-next-line unicorn/prefer-includes
|
|
4818
|
+
Ra.indexOf(y.PARSER_MEDIA_TYPE) === -1 ? za : y.PARSER_MEDIA_TYPE, Me = qt === "application/xhtml+xml" ? Va : ma, $ = pt(y, "ALLOWED_TAGS") ? xe({}, y.ALLOWED_TAGS, Me) : se, G = pt(y, "ALLOWED_ATTR") ? xe({}, y.ALLOWED_ATTR, Me) : H, $t = pt(y, "ALLOWED_NAMESPACES") ? xe({}, y.ALLOWED_NAMESPACES, Va) : La, Ue = pt(y, "ADD_URI_SAFE_ATTR") ? xe(jt(Qt), y.ADD_URI_SAFE_ATTR, Me) : Qt, ge = pt(y, "ADD_DATA_URI_TAGS") ? xe(jt(Re), y.ADD_DATA_URI_TAGS, Me) : Re, ae = pt(y, "FORBID_CONTENTS") ? xe({}, y.FORBID_CONTENTS, Me) : pe, he = pt(y, "FORBID_TAGS") ? xe({}, y.FORBID_TAGS, Me) : jt({}), we = pt(y, "FORBID_ATTR") ? xe({}, y.FORBID_ATTR, Me) : jt({}), V = pt(y, "USE_PROFILES") ? y.USE_PROFILES : !1, F = y.ALLOW_ARIA_ATTR !== !1, R = y.ALLOW_DATA_ATTR !== !1, Y = y.ALLOW_UNKNOWN_PROTOCOLS || !1, Z = y.ALLOW_SELF_CLOSE_IN_ATTR !== !1, J = y.SAFE_FOR_TEMPLATES || !1, me = y.SAFE_FOR_XML !== !1, k = y.WHOLE_DOCUMENT || !1, fe = y.RETURN_DOM || !1, X = y.RETURN_DOM_FRAGMENT || !1, le = y.RETURN_TRUSTED_TYPE || !1, ye = y.FORCE_BODY || !1, We = y.SANITIZE_DOM !== !1, Be = y.SANITIZE_NAMED_PROPS || !1, Qe = y.KEEP_CONTENT !== !1, Pt = y.IN_PLACE || !1, I = y.ALLOWED_URI_REGEXP || Bi, at = y.NAMESPACE || st, Ut = y.MATHML_TEXT_INTEGRATION_POINTS || Ut, Xt = y.HTML_INTEGRATION_POINTS || Xt, B = y.CUSTOM_ELEMENT_HANDLING || {}, y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (B.tagNameCheck = y.CUSTOM_ELEMENT_HANDLING.tagNameCheck), y.CUSTOM_ELEMENT_HANDLING && Xs(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (B.attributeNameCheck = y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), y.CUSTOM_ELEMENT_HANDLING && typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), J && (R = !1), X && (fe = !0), V && ($ = xe({}, _n), G = ua(null), V.html === !0 && (xe($, gn), xe(G, xn)), V.svg === !0 && (xe($, Wa), xe(G, Xa), xe(G, la)), V.svgFilters === !0 && (xe($, Qa), xe(G, Xa), xe(G, la)), V.mathMl === !0 && (xe($, Ya), xe(G, yn), xe(G, la))), pt(y, "ADD_TAGS") || (_e.tagCheck = null), pt(y, "ADD_ATTR") || (_e.attributeCheck = null), y.ADD_TAGS && (typeof y.ADD_TAGS == "function" ? _e.tagCheck = y.ADD_TAGS : ($ === se && ($ = jt($)), xe($, y.ADD_TAGS, Me))), y.ADD_ATTR && (typeof y.ADD_ATTR == "function" ? _e.attributeCheck = y.ADD_ATTR : (G === H && (G = jt(G)), xe(G, y.ADD_ATTR, Me))), y.ADD_URI_SAFE_ATTR && xe(Ue, y.ADD_URI_SAFE_ATTR, Me), y.FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.FORBID_CONTENTS, Me)), y.ADD_FORBID_CONTENTS && (ae === pe && (ae = jt(ae)), xe(ae, y.ADD_FORBID_CONTENTS, Me)), Qe && ($["#text"] = !0), k && xe($, ["html", "head", "body"]), $.table && (xe($, ["tbody"]), delete he.tbody), y.TRUSTED_TYPES_POLICY) {
|
|
4819
4819
|
if (typeof y.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
4820
4820
|
throw As('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
4821
4821
|
if (typeof y.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
@@ -4823,7 +4823,7 @@ function Vi() {
|
|
|
4823
4823
|
v = y.TRUSTED_TYPES_POLICY, C = v.createHTML("");
|
|
4824
4824
|
} else
|
|
4825
4825
|
v === void 0 && (v = rp(f, n)), v !== null && typeof C == "string" && (C = v.createHTML(""));
|
|
4826
|
-
Je && Je(y),
|
|
4826
|
+
Je && Je(y), Ht = y;
|
|
4827
4827
|
}
|
|
4828
4828
|
}, Zt = xe({}, [...Wa, ...Qa, ...Gm]), ks = xe({}, [...Ya, ...Wm]), Zs = function(y) {
|
|
4829
4829
|
let Q = j(y);
|
|
@@ -4832,7 +4832,7 @@ function Vi() {
|
|
|
4832
4832
|
tagName: "template"
|
|
4833
4833
|
});
|
|
4834
4834
|
const re = ma(y.tagName), Se = ma(Q.tagName);
|
|
4835
|
-
return $t[y.namespaceURI] ? y.namespaceURI === Tt ? Q.namespaceURI === st ? re === "svg" : Q.namespaceURI === vt ? re === "svg" && (Se === "annotation-xml" || Ut[Se]) : !!Zt[re] : y.namespaceURI === vt ? Q.namespaceURI === st ? re === "math" : Q.namespaceURI === Tt ? re === "math" && Xt[Se] : !!ks[re] : y.namespaceURI === st ? Q.namespaceURI === Tt && !Xt[Se] || Q.namespaceURI === vt && !Ut[Se] ? !1 : !ks[re] && (ws[re] || !Zt[re]) : !!(
|
|
4835
|
+
return $t[y.namespaceURI] ? y.namespaceURI === Tt ? Q.namespaceURI === st ? re === "svg" : Q.namespaceURI === vt ? re === "svg" && (Se === "annotation-xml" || Ut[Se]) : !!Zt[re] : y.namespaceURI === vt ? Q.namespaceURI === st ? re === "math" : Q.namespaceURI === Tt ? re === "math" && Xt[Se] : !!ks[re] : y.namespaceURI === st ? Q.namespaceURI === Tt && !Xt[Se] || Q.namespaceURI === vt && !Ut[Se] ? !1 : !ks[re] && (ws[re] || !Zt[re]) : !!(qt === "application/xhtml+xml" && $t[y.namespaceURI]) : !1;
|
|
4836
4836
|
}, mt = function(y) {
|
|
4837
4837
|
Ps(s.removed, {
|
|
4838
4838
|
element: y
|
|
@@ -4873,11 +4873,11 @@ function Vi() {
|
|
|
4873
4873
|
const Ie = Ga(y, /^[\r\n\t ]+/);
|
|
4874
4874
|
re = Ie && Ie[0];
|
|
4875
4875
|
}
|
|
4876
|
-
|
|
4876
|
+
qt === "application/xhtml+xml" && at === st && (y = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + y + "</body></html>");
|
|
4877
4877
|
const Se = v ? v.createHTML(y) : y;
|
|
4878
4878
|
if (at === st)
|
|
4879
4879
|
try {
|
|
4880
|
-
Q = new p().parseFromString(Se,
|
|
4880
|
+
Q = new p().parseFromString(Se, qt);
|
|
4881
4881
|
} catch {
|
|
4882
4882
|
}
|
|
4883
4883
|
if (!Q || !Q.documentElement) {
|
|
@@ -4904,7 +4904,7 @@ function Vi() {
|
|
|
4904
4904
|
};
|
|
4905
4905
|
function ce(ie, y, Q) {
|
|
4906
4906
|
ia(ie, (re) => {
|
|
4907
|
-
re.call(s, y, Q,
|
|
4907
|
+
re.call(s, y, Q, Ht);
|
|
4908
4908
|
});
|
|
4909
4909
|
}
|
|
4910
4910
|
const de = function(y) {
|
|
@@ -4940,7 +4940,7 @@ function Vi() {
|
|
|
4940
4940
|
}, Te = function(y, Q, re) {
|
|
4941
4941
|
if (we[Q] || We && (Q === "id" || Q === "name") && (re in a || re in Oa))
|
|
4942
4942
|
return !1;
|
|
4943
|
-
if (!(
|
|
4943
|
+
if (!(R && !we[Q] && Ye(K, Q))) {
|
|
4944
4944
|
if (!(F && Ye(W, Q))) {
|
|
4945
4945
|
if (!(_e.attributeCheck instanceof Function && _e.attributeCheck(Q, y))) {
|
|
4946
4946
|
if (!G[Q] || we[Q]) {
|
|
@@ -4953,9 +4953,9 @@ function Vi() {
|
|
|
4953
4953
|
Q === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Ye(B.tagNameCheck, re) || B.tagNameCheck instanceof Function && B.tagNameCheck(re)))
|
|
4954
4954
|
) return !1;
|
|
4955
4955
|
} else if (!Ue[Q]) {
|
|
4956
|
-
if (!Ye(I, Ts(re,
|
|
4957
|
-
if (!((Q === "src" || Q === "xlink:href" || Q === "href") && y !== "script" &&
|
|
4958
|
-
if (!(Y && !Ye(D, Ts(re,
|
|
4956
|
+
if (!Ye(I, Ts(re, L, ""))) {
|
|
4957
|
+
if (!((Q === "src" || Q === "xlink:href" || Q === "href") && y !== "script" && Hm(re, "data:") === 0 && ge[y])) {
|
|
4958
|
+
if (!(Y && !Ye(D, Ts(re, L, "")))) {
|
|
4959
4959
|
if (re)
|
|
4960
4960
|
return !1;
|
|
4961
4961
|
}
|
|
@@ -4989,12 +4989,12 @@ function Vi() {
|
|
|
4989
4989
|
namespaceURI: rt,
|
|
4990
4990
|
value: Et
|
|
4991
4991
|
} = Ke, ls = Me(Ie), $a = Et;
|
|
4992
|
-
let
|
|
4993
|
-
if (re.attrName = ls, re.attrValue =
|
|
4992
|
+
let qe = Ie === "value" ? $a : Bm($a);
|
|
4993
|
+
if (re.attrName = ls, re.attrValue = qe, re.keepAttr = !0, re.forceKeepAttr = void 0, ce(P.uponSanitizeAttribute, y, re), qe = re.attrValue, Be && (ls === "id" || ls === "name") && (At(Ie, y), qe = tt + qe), me && Ye(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, qe)) {
|
|
4994
4994
|
At(Ie, y);
|
|
4995
4995
|
continue;
|
|
4996
4996
|
}
|
|
4997
|
-
if (ls === "attributename" && Ga(
|
|
4997
|
+
if (ls === "attributename" && Ga(qe, "href")) {
|
|
4998
4998
|
At(Ie, y);
|
|
4999
4999
|
continue;
|
|
5000
5000
|
}
|
|
@@ -5004,32 +5004,32 @@ function Vi() {
|
|
|
5004
5004
|
At(Ie, y);
|
|
5005
5005
|
continue;
|
|
5006
5006
|
}
|
|
5007
|
-
if (!Z && Ye(/\/>/i,
|
|
5007
|
+
if (!Z && Ye(/\/>/i, qe)) {
|
|
5008
5008
|
At(Ie, y);
|
|
5009
5009
|
continue;
|
|
5010
5010
|
}
|
|
5011
|
-
J && ia([A, M, S], (
|
|
5012
|
-
|
|
5011
|
+
J && ia([A, M, S], (qr) => {
|
|
5012
|
+
qe = Ts(qe, qr, " ");
|
|
5013
5013
|
});
|
|
5014
5014
|
const Ur = Me(y.nodeName);
|
|
5015
|
-
if (!Te(Ur, ls,
|
|
5015
|
+
if (!Te(Ur, ls, qe)) {
|
|
5016
5016
|
At(Ie, y);
|
|
5017
5017
|
continue;
|
|
5018
5018
|
}
|
|
5019
5019
|
if (v && typeof f == "object" && typeof f.getAttributeType == "function" && !rt)
|
|
5020
5020
|
switch (f.getAttributeType(Ur, ls)) {
|
|
5021
5021
|
case "TrustedHTML": {
|
|
5022
|
-
|
|
5022
|
+
qe = v.createHTML(qe);
|
|
5023
5023
|
break;
|
|
5024
5024
|
}
|
|
5025
5025
|
case "TrustedScriptURL": {
|
|
5026
|
-
|
|
5026
|
+
qe = v.createScriptURL(qe);
|
|
5027
5027
|
break;
|
|
5028
5028
|
}
|
|
5029
5029
|
}
|
|
5030
|
-
if (
|
|
5030
|
+
if (qe !== $a)
|
|
5031
5031
|
try {
|
|
5032
|
-
rt ? y.setAttributeNS(rt, Ie,
|
|
5032
|
+
rt ? y.setAttributeNS(rt, Ie, qe) : y.setAttribute(Ie, qe), is(y) ? mt(y) : fn(s.removed);
|
|
5033
5033
|
} catch {
|
|
5034
5034
|
At(Ie, y);
|
|
5035
5035
|
}
|
|
@@ -5090,9 +5090,9 @@ function Vi() {
|
|
|
5090
5090
|
let ie = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
5091
5091
|
Ns(ie), oe = !0;
|
|
5092
5092
|
}, s.clearConfig = function() {
|
|
5093
|
-
|
|
5093
|
+
Ht = null, oe = !1;
|
|
5094
5094
|
}, s.isValidAttribute = function(ie, y, Q) {
|
|
5095
|
-
|
|
5095
|
+
Ht || Ns({});
|
|
5096
5096
|
const re = Me(ie), Se = Me(y);
|
|
5097
5097
|
return Te(re, Se, Q);
|
|
5098
5098
|
}, s.addHook = function(ie, y) {
|
|
@@ -5100,7 +5100,7 @@ function Vi() {
|
|
|
5100
5100
|
}, s.removeHook = function(ie, y) {
|
|
5101
5101
|
if (y !== void 0) {
|
|
5102
5102
|
const Q = Um(P[ie], y);
|
|
5103
|
-
return Q === -1 ? void 0 :
|
|
5103
|
+
return Q === -1 ? void 0 : qm(P[ie], Q, 1)[0];
|
|
5104
5104
|
}
|
|
5105
5105
|
return fn(P[ie]);
|
|
5106
5106
|
}, s.removeHooks = function(ie) {
|
|
@@ -5109,7 +5109,7 @@ function Vi() {
|
|
|
5109
5109
|
P = vn();
|
|
5110
5110
|
}, s;
|
|
5111
5111
|
}
|
|
5112
|
-
var
|
|
5112
|
+
var Le = Vi();
|
|
5113
5113
|
function Gs({
|
|
5114
5114
|
searchValue: t,
|
|
5115
5115
|
onSearchChange: s,
|
|
@@ -5136,7 +5136,7 @@ function Gs({
|
|
|
5136
5136
|
}
|
|
5137
5137
|
),
|
|
5138
5138
|
t.length > 0 && /* @__PURE__ */ e.jsx(
|
|
5139
|
-
|
|
5139
|
+
q,
|
|
5140
5140
|
{
|
|
5141
5141
|
variant: "ghost",
|
|
5142
5142
|
size: "icon-xs",
|
|
@@ -5149,7 +5149,7 @@ function Gs({
|
|
|
5149
5149
|
] }),
|
|
5150
5150
|
r && r.length > 0 && (l === "bottom-sheet" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
5151
5151
|
/* @__PURE__ */ e.jsxs(
|
|
5152
|
-
|
|
5152
|
+
q,
|
|
5153
5153
|
{
|
|
5154
5154
|
variant: "outline",
|
|
5155
5155
|
"aria-label": h ? `${u}: ${h.label}` : u,
|
|
@@ -5179,7 +5179,7 @@ function Gs({
|
|
|
5179
5179
|
)
|
|
5180
5180
|
] }) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
5181
5181
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
5182
|
-
|
|
5182
|
+
q,
|
|
5183
5183
|
{
|
|
5184
5184
|
variant: "outline",
|
|
5185
5185
|
"aria-label": h ? `${u}: ${h.label}` : u,
|
|
@@ -5483,13 +5483,22 @@ const np = {
|
|
|
5483
5483
|
// Share
|
|
5484
5484
|
share_copied: "Copied",
|
|
5485
5485
|
share_copy_failed: "Couldn’t copy",
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5486
|
+
share_this_page: "Share this page",
|
|
5487
|
+
share_your_link: "Your link",
|
|
5488
|
+
share_credited_badge: "Credited to you",
|
|
5489
|
+
share_credited_description: "Anyone who buys through your link is credited to you.",
|
|
5490
|
+
share_copy: "Copy",
|
|
5491
|
+
share_destinations_label: "Send with",
|
|
5492
|
+
share_messages: "Messages",
|
|
5493
|
+
share_whatsapp: "WhatsApp",
|
|
5494
|
+
share_instagram: "Instagram",
|
|
5495
|
+
share_email: "Email",
|
|
5496
|
+
share_qr_code: "QR code",
|
|
5497
|
+
share_more: "More",
|
|
5498
|
+
share_instagram_paste_hint: "Link copied. Paste it in Instagram.",
|
|
5499
|
+
share_open_instagram: "Open Instagram",
|
|
5489
5500
|
share_scan_heading: "Scan to open",
|
|
5490
5501
|
share_scan_description: "Scan this code with your phone camera.",
|
|
5491
|
-
share_direct: "Share directly",
|
|
5492
|
-
share_link_label: "Share link",
|
|
5493
5502
|
share_download_asset: "Download Asset",
|
|
5494
5503
|
share_download_no_asset: "No downloadable asset available",
|
|
5495
5504
|
share_link_copied: "Share link copied to clipboard!",
|
|
@@ -5728,18 +5737,18 @@ function Ee() {
|
|
|
5728
5737
|
function Ws() {
|
|
5729
5738
|
return Ee().canCuratePlaylists !== !1;
|
|
5730
5739
|
}
|
|
5731
|
-
var Gi =
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5740
|
+
var Gi = Le;
|
|
5741
|
+
Le.sanitize.bind(Le);
|
|
5742
|
+
Le.isSupported;
|
|
5743
|
+
Le.addHook.bind(Le);
|
|
5744
|
+
Le.removeHook.bind(Le);
|
|
5745
|
+
Le.removeHooks.bind(Le);
|
|
5746
|
+
Le.removeAllHooks.bind(Le);
|
|
5747
|
+
Le.setConfig.bind(Le);
|
|
5748
|
+
Le.clearConfig.bind(Le);
|
|
5749
|
+
Le.isValidAttribute.bind(Le);
|
|
5750
|
+
Le.version;
|
|
5751
|
+
Le.removed;
|
|
5743
5752
|
const up = {
|
|
5744
5753
|
amp: "&",
|
|
5745
5754
|
apos: "'",
|
|
@@ -6137,7 +6146,7 @@ function Mp({
|
|
|
6137
6146
|
}, 300);
|
|
6138
6147
|
return () => clearTimeout(S);
|
|
6139
6148
|
}, [c]);
|
|
6140
|
-
const _ = m ? void 0 : p, w =
|
|
6149
|
+
const _ = m ? void 0 : p, w = Rt({
|
|
6141
6150
|
queryKey: [
|
|
6142
6151
|
"portal-product-catalog",
|
|
6143
6152
|
m || "",
|
|
@@ -6153,7 +6162,7 @@ function Mp({
|
|
|
6153
6162
|
getNextPageParam: (S) => S.meta?.pagination?.next_cursor ?? void 0,
|
|
6154
6163
|
initialPageParam: void 0,
|
|
6155
6164
|
enabled: !!s
|
|
6156
|
-
}), b =
|
|
6165
|
+
}), b = Rt({
|
|
6157
6166
|
queryKey: ["shareables-products", m, t],
|
|
6158
6167
|
queryFn: async ({ pageParam: S = 1 }) => {
|
|
6159
6168
|
if (!r) throw new Error("Unreachable: client is null");
|
|
@@ -6309,7 +6318,7 @@ function Aa({
|
|
|
6309
6318
|
),
|
|
6310
6319
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-4 py-3", children: [
|
|
6311
6320
|
/* @__PURE__ */ e.jsx(
|
|
6312
|
-
|
|
6321
|
+
q,
|
|
6313
6322
|
{
|
|
6314
6323
|
onClick: A,
|
|
6315
6324
|
disabled: f <= 1,
|
|
@@ -6335,7 +6344,7 @@ function Aa({
|
|
|
6335
6344
|
}
|
|
6336
6345
|
) }),
|
|
6337
6346
|
/* @__PURE__ */ e.jsx(
|
|
6338
|
-
|
|
6347
|
+
q,
|
|
6339
6348
|
{
|
|
6340
6349
|
onClick: M,
|
|
6341
6350
|
variant: "outline",
|
|
@@ -6395,14 +6404,14 @@ function Aa({
|
|
|
6395
6404
|
}
|
|
6396
6405
|
),
|
|
6397
6406
|
(n || r) && /* @__PURE__ */ e.jsx(
|
|
6398
|
-
|
|
6407
|
+
q,
|
|
6399
6408
|
{
|
|
6400
6409
|
onClick: () => p(!0),
|
|
6401
6410
|
className: "absolute top-3 left-3 z-0 flex size-8 items-center justify-center rounded-full bg-white/90 text-gray-700 backdrop-blur-sm transition-colors hover:bg-white",
|
|
6402
6411
|
variant: "ghost",
|
|
6403
6412
|
size: "sm",
|
|
6404
6413
|
"aria-label": j("open_media_preview"),
|
|
6405
|
-
children: /* @__PURE__ */ e.jsx(
|
|
6414
|
+
children: /* @__PURE__ */ e.jsx(qc, { className: "size-4" })
|
|
6406
6415
|
}
|
|
6407
6416
|
),
|
|
6408
6417
|
/* @__PURE__ */ e.jsx(bs, { open: z, onOpenChange: p, children: /* @__PURE__ */ e.jsxs(
|
|
@@ -6416,9 +6425,9 @@ function Aa({
|
|
|
6416
6425
|
},
|
|
6417
6426
|
children: [
|
|
6418
6427
|
/* @__PURE__ */ e.jsx(xr, { className: "sr-only", children: v }),
|
|
6419
|
-
/* @__PURE__ */ e.jsx(
|
|
6428
|
+
/* @__PURE__ */ e.jsx(qo, { className: "sr-only", children: j("image_viewer_description") }),
|
|
6420
6429
|
/* @__PURE__ */ e.jsx(
|
|
6421
|
-
|
|
6430
|
+
Ho,
|
|
6422
6431
|
{
|
|
6423
6432
|
"aria-label": j("close_image_viewer"),
|
|
6424
6433
|
className: "bg-foreground/60 text-background hover:bg-foreground/80 focus-visible:ring-ring focus-visible:ring-offset-background absolute top-4 right-4 z-10 flex size-10 cursor-pointer items-center justify-center rounded-full transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
@@ -6442,7 +6451,7 @@ function Aa({
|
|
|
6442
6451
|
onClick: () => p(!1),
|
|
6443
6452
|
children: [
|
|
6444
6453
|
/* @__PURE__ */ e.jsx(
|
|
6445
|
-
|
|
6454
|
+
q,
|
|
6446
6455
|
{
|
|
6447
6456
|
onClick: () => p(!1),
|
|
6448
6457
|
className: "absolute top-4 right-4 z-10000 flex size-10 items-center justify-center rounded-full bg-white/90 text-gray-900 backdrop-blur-sm transition-colors hover:bg-white",
|
|
@@ -6472,7 +6481,7 @@ function Aa({
|
|
|
6472
6481
|
onClick: () => p(!1),
|
|
6473
6482
|
children: [
|
|
6474
6483
|
/* @__PURE__ */ e.jsx(
|
|
6475
|
-
|
|
6484
|
+
q,
|
|
6476
6485
|
{
|
|
6477
6486
|
onClick: (S) => {
|
|
6478
6487
|
S.stopPropagation(), p(!1);
|
|
@@ -6578,7 +6587,7 @@ function Dp(t) {
|
|
|
6578
6587
|
}
|
|
6579
6588
|
);
|
|
6580
6589
|
}
|
|
6581
|
-
function
|
|
6590
|
+
function Lp(t) {
|
|
6582
6591
|
return /* @__PURE__ */ e.jsx(
|
|
6583
6592
|
"svg",
|
|
6584
6593
|
{
|
|
@@ -6590,7 +6599,7 @@ function Rp(t) {
|
|
|
6590
6599
|
}
|
|
6591
6600
|
);
|
|
6592
6601
|
}
|
|
6593
|
-
function
|
|
6602
|
+
function Rp(t) {
|
|
6594
6603
|
return /* @__PURE__ */ e.jsx(
|
|
6595
6604
|
"svg",
|
|
6596
6605
|
{
|
|
@@ -6674,8 +6683,8 @@ function zp({
|
|
|
6674
6683
|
}, g = [
|
|
6675
6684
|
{ name: "Facebook", Icon: Ip },
|
|
6676
6685
|
{ name: "Instagram", Icon: Dp },
|
|
6677
|
-
{ name: "TikTok", Icon:
|
|
6678
|
-
{ name: "X", Icon:
|
|
6686
|
+
{ name: "TikTok", Icon: Lp },
|
|
6687
|
+
{ name: "X", Icon: Rp }
|
|
6679
6688
|
];
|
|
6680
6689
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
6681
6690
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -6695,7 +6704,7 @@ function zp({
|
|
|
6695
6704
|
/* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
|
|
6696
6705
|
/* @__PURE__ */ e.jsxs("div", { className: "scrollbar-none flex flex-nowrap items-center gap-2 overflow-x-auto", children: [
|
|
6697
6706
|
/* @__PURE__ */ e.jsx(
|
|
6698
|
-
|
|
6707
|
+
q,
|
|
6699
6708
|
{
|
|
6700
6709
|
onClick: f,
|
|
6701
6710
|
variant: "secondary",
|
|
@@ -6706,7 +6715,7 @@ function zp({
|
|
|
6706
6715
|
),
|
|
6707
6716
|
wp() ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
6708
6717
|
/* @__PURE__ */ e.jsxs(
|
|
6709
|
-
|
|
6718
|
+
q,
|
|
6710
6719
|
{
|
|
6711
6720
|
variant: "secondary",
|
|
6712
6721
|
size: "sm",
|
|
@@ -6732,7 +6741,7 @@ function zp({
|
|
|
6732
6741
|
}
|
|
6733
6742
|
)
|
|
6734
6743
|
] }) : g.map((x) => /* @__PURE__ */ e.jsxs(
|
|
6735
|
-
|
|
6744
|
+
q,
|
|
6736
6745
|
{
|
|
6737
6746
|
onClick: () => p(x.name),
|
|
6738
6747
|
variant: "secondary",
|
|
@@ -6756,7 +6765,7 @@ function zp({
|
|
|
6756
6765
|
children: [
|
|
6757
6766
|
/* @__PURE__ */ e.jsx("span", { className: "flex-1 truncate text-sm text-[#344054]", children: t || c(s ? "share_generating_link" : "common_loading") }),
|
|
6758
6767
|
/* @__PURE__ */ e.jsx(
|
|
6759
|
-
|
|
6768
|
+
q,
|
|
6760
6769
|
{
|
|
6761
6770
|
onClick: h,
|
|
6762
6771
|
variant: "ghost",
|
|
@@ -6807,14 +6816,14 @@ function Ea({
|
|
|
6807
6816
|
}
|
|
6808
6817
|
}
|
|
6809
6818
|
}, [t, s, d, h]), g = t && /* @__PURE__ */ e.jsxs(
|
|
6810
|
-
|
|
6819
|
+
q,
|
|
6811
6820
|
{
|
|
6812
6821
|
onClick: f,
|
|
6813
6822
|
disabled: h,
|
|
6814
6823
|
className: u ? "border-foreground bg-background text-foreground hover:bg-muted flex h-10 items-center justify-center gap-2 rounded-lg border px-4 transition-all" : "bg-foreground text-background hover:bg-foreground/70 flex h-10 w-full items-center justify-between rounded-lg px-4 transition-all",
|
|
6815
6824
|
children: [
|
|
6816
6825
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: m("share_download_asset") }),
|
|
6817
|
-
/* @__PURE__ */ e.jsx(
|
|
6826
|
+
/* @__PURE__ */ e.jsx(Ls, { className: "size-4" })
|
|
6818
6827
|
]
|
|
6819
6828
|
}
|
|
6820
6829
|
);
|
|
@@ -6852,7 +6861,7 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = u
|
|
|
6852
6861
|
onTabChange: r
|
|
6853
6862
|
}) {
|
|
6854
6863
|
return /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex gap-2", children: s.map((n) => /* @__PURE__ */ e.jsx(
|
|
6855
|
-
|
|
6864
|
+
q,
|
|
6856
6865
|
{
|
|
6857
6866
|
onClick: () => r(n.id),
|
|
6858
6867
|
variant: "secondary",
|
|
@@ -6862,7 +6871,7 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = u
|
|
|
6862
6871
|
},
|
|
6863
6872
|
n.id
|
|
6864
6873
|
)) });
|
|
6865
|
-
}),
|
|
6874
|
+
}), qp = ue.memo(function({
|
|
6866
6875
|
mediaItem: s,
|
|
6867
6876
|
onClick: a
|
|
6868
6877
|
}) {
|
|
@@ -6886,7 +6895,7 @@ const $p = "https://assets.fluid.app/fluid-admin/images/placeholder.png", Up = u
|
|
|
6886
6895
|
]
|
|
6887
6896
|
}
|
|
6888
6897
|
);
|
|
6889
|
-
}),
|
|
6898
|
+
}), Hp = ue.memo(function({
|
|
6890
6899
|
message: s
|
|
6891
6900
|
}) {
|
|
6892
6901
|
const { t: a } = ne(), r = s ?? a("share_loading_media");
|
|
@@ -6972,10 +6981,10 @@ function Wp({
|
|
|
6972
6981
|
onTabChange: r
|
|
6973
6982
|
}
|
|
6974
6983
|
),
|
|
6975
|
-
t && /* @__PURE__ */ e.jsx(
|
|
6984
|
+
t && /* @__PURE__ */ e.jsx(Hp, {}),
|
|
6976
6985
|
s && /* @__PURE__ */ e.jsx(Bp, {}),
|
|
6977
6986
|
!t && !s && n.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-4 xl:grid-cols-3", children: n.map((f) => /* @__PURE__ */ e.jsx(
|
|
6978
|
-
|
|
6987
|
+
qp,
|
|
6979
6988
|
{
|
|
6980
6989
|
mediaItem: f,
|
|
6981
6990
|
onClick: h
|
|
@@ -7236,7 +7245,7 @@ function gh({
|
|
|
7236
7245
|
}
|
|
7237
7246
|
),
|
|
7238
7247
|
u && /* @__PURE__ */ e.jsx(
|
|
7239
|
-
|
|
7248
|
+
q,
|
|
7240
7249
|
{
|
|
7241
7250
|
onClick: () => n((c) => !c),
|
|
7242
7251
|
variant: "ghost",
|
|
@@ -7311,18 +7320,18 @@ function xh({
|
|
|
7311
7320
|
portalProduct: O,
|
|
7312
7321
|
legacyProduct: U,
|
|
7313
7322
|
locale: m
|
|
7314
|
-
}), K = (b?.media ?? []).filter((
|
|
7315
|
-
(
|
|
7316
|
-
id:
|
|
7317
|
-
title:
|
|
7318
|
-
image_url:
|
|
7319
|
-
kind:
|
|
7320
|
-
video_url:
|
|
7321
|
-
media_format:
|
|
7323
|
+
}), K = (b?.media ?? []).filter((L) => h === "all" ? !0 : h === "images" ? L.kind === "image" : h === "videos" ? L.kind === "video" : !0).map(
|
|
7324
|
+
(L) => ({
|
|
7325
|
+
id: L.id,
|
|
7326
|
+
title: L.title,
|
|
7327
|
+
image_url: L.image_url,
|
|
7328
|
+
kind: L.kind || "",
|
|
7329
|
+
video_url: L.video_url,
|
|
7330
|
+
media_format: L.media_format
|
|
7322
7331
|
})
|
|
7323
7332
|
), W = (b?.media?.length || 0) > 0, D = o.useCallback(
|
|
7324
|
-
(
|
|
7325
|
-
r?.("media", String(
|
|
7333
|
+
(L) => {
|
|
7334
|
+
r?.("media", String(L.id));
|
|
7326
7335
|
},
|
|
7327
7336
|
[r]
|
|
7328
7337
|
);
|
|
@@ -7332,8 +7341,8 @@ function xh({
|
|
|
7332
7341
|
kt,
|
|
7333
7342
|
{
|
|
7334
7343
|
href: "#",
|
|
7335
|
-
onClick: (
|
|
7336
|
-
|
|
7344
|
+
onClick: (L) => {
|
|
7345
|
+
L.preventDefault(), (i?.onClick ?? n ?? (() => c("products")))();
|
|
7337
7346
|
},
|
|
7338
7347
|
children: d("products_breadcrumb")
|
|
7339
7348
|
}
|
|
@@ -7465,7 +7474,7 @@ function vh({
|
|
|
7465
7474
|
] }),
|
|
7466
7475
|
/* @__PURE__ */ e.jsxs("div", { className: "hidden items-center gap-2 sm:flex", children: [
|
|
7467
7476
|
/* @__PURE__ */ e.jsx(
|
|
7468
|
-
|
|
7477
|
+
q,
|
|
7469
7478
|
{
|
|
7470
7479
|
type: "button",
|
|
7471
7480
|
variant: "outline",
|
|
@@ -7477,7 +7486,7 @@ function vh({
|
|
|
7477
7486
|
}
|
|
7478
7487
|
),
|
|
7479
7488
|
/* @__PURE__ */ e.jsx(
|
|
7480
|
-
|
|
7489
|
+
q,
|
|
7481
7490
|
{
|
|
7482
7491
|
type: "button",
|
|
7483
7492
|
variant: "outline",
|
|
@@ -7592,21 +7601,21 @@ function Zi({
|
|
|
7592
7601
|
hasNextPage: K,
|
|
7593
7602
|
isFetchingNextPage: W,
|
|
7594
7603
|
fetchNextPage: D,
|
|
7595
|
-
error:
|
|
7604
|
+
error: L,
|
|
7596
7605
|
isPending: T,
|
|
7597
7606
|
isFetching: I,
|
|
7598
7607
|
refetch: $
|
|
7599
|
-
} =
|
|
7608
|
+
} = Rt({
|
|
7600
7609
|
...Xi(d, _),
|
|
7601
7610
|
enabled: t && M === "pick",
|
|
7602
7611
|
// Hold the previous page while a new search is in flight, so the list
|
|
7603
7612
|
// doesn't blank — and read as "no playlists" — on every keystroke.
|
|
7604
7613
|
placeholderData: ba
|
|
7605
|
-
}), se = S?.pages.flatMap((F) => F.playlists) ?? [], G = N ? N.title ? h("playlist_item_already_exists_named", { title: N.title }) : h("playlist_item_already_exists") : "",
|
|
7614
|
+
}), se = S?.pages.flatMap((F) => F.playlists) ?? [], G = N ? N.title ? h("playlist_item_already_exists_named", { title: N.title }) : h("playlist_item_already_exists") : "", H = Ta({
|
|
7606
7615
|
hasNextPage: K,
|
|
7607
7616
|
isFetchingNextPage: W,
|
|
7608
7617
|
fetchNextPage: D,
|
|
7609
|
-
error:
|
|
7618
|
+
error: L
|
|
7610
7619
|
}), B = (F) => d.playlists.addItemToPlaylist(F, {
|
|
7611
7620
|
items: [{ relateable_type: r, relateable_id: a }]
|
|
7612
7621
|
}), he = () => {
|
|
@@ -7618,25 +7627,25 @@ function Zi({
|
|
|
7618
7627
|
onSuccess: () => {
|
|
7619
7628
|
u?.(), p({ type: "success", title: h("playlist_add_item_success") }), he(), s(!1);
|
|
7620
7629
|
},
|
|
7621
|
-
onError: (F, { id:
|
|
7622
|
-
if (
|
|
7623
|
-
C((Z) => new Set(Z).add(
|
|
7630
|
+
onError: (F, { id: R, title: Y }) => {
|
|
7631
|
+
if (Hr(F) && F.status === 409) {
|
|
7632
|
+
C((Z) => new Set(Z).add(R)), z({ id: R, title: Y }), R === O && (U(null), P("pick"), u?.());
|
|
7624
7633
|
return;
|
|
7625
7634
|
}
|
|
7626
7635
|
p({ type: "error", title: h("playlist_add_item_error"), error: F });
|
|
7627
7636
|
}
|
|
7628
7637
|
}), _e = ze({
|
|
7629
7638
|
mutationFn: async (F) => {
|
|
7630
|
-
const
|
|
7639
|
+
const R = await d.playlists.createPlaylist({
|
|
7631
7640
|
playlist: { title: F }
|
|
7632
7641
|
});
|
|
7633
|
-
U(
|
|
7642
|
+
U(R.playlist.id), x(""), w(""), l?.(R.playlist.id), await B(R.playlist.id);
|
|
7634
7643
|
},
|
|
7635
7644
|
onSuccess: () => {
|
|
7636
7645
|
U(null), u?.(), p({ type: "success", title: h("playlist_add_item_success") }), s(!1);
|
|
7637
7646
|
},
|
|
7638
7647
|
onError: (F) => {
|
|
7639
|
-
if (
|
|
7648
|
+
if (Hr(F) && F.status === 409) {
|
|
7640
7649
|
U(null), u?.(), p({ type: "success", title: h("playlist_add_item_success") }), s(!1);
|
|
7641
7650
|
return;
|
|
7642
7651
|
}
|
|
@@ -7668,7 +7677,7 @@ function Zi({
|
|
|
7668
7677
|
}
|
|
7669
7678
|
),
|
|
7670
7679
|
/* @__PURE__ */ e.jsx(
|
|
7671
|
-
|
|
7680
|
+
q,
|
|
7672
7681
|
{
|
|
7673
7682
|
disabled: !b.trim() || _e.isPending,
|
|
7674
7683
|
onClick: () => _e.mutate(b.trim()),
|
|
@@ -7676,7 +7685,7 @@ function Zi({
|
|
|
7676
7685
|
}
|
|
7677
7686
|
),
|
|
7678
7687
|
n === "pick" && /* @__PURE__ */ e.jsx(
|
|
7679
|
-
|
|
7688
|
+
q,
|
|
7680
7689
|
{
|
|
7681
7690
|
variant: "outline",
|
|
7682
7691
|
disabled: _e.isPending,
|
|
@@ -7704,9 +7713,9 @@ function Zi({
|
|
|
7704
7713
|
children: G
|
|
7705
7714
|
}
|
|
7706
7715
|
),
|
|
7707
|
-
T || I && se.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-6", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) :
|
|
7716
|
+
T || I && se.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-6", children: /* @__PURE__ */ e.jsx(it, { className: "size-5" }) }) : L ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-2 py-2", children: [
|
|
7708
7717
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h("common_load_error_default") }),
|
|
7709
|
-
/* @__PURE__ */ e.jsx(
|
|
7718
|
+
/* @__PURE__ */ e.jsx(q, { variant: "outline", size: "sm", onClick: () => $(), children: h("common_retry") })
|
|
7710
7719
|
] }) : se.length === 0 ? (
|
|
7711
7720
|
/* The list is empty, and without a create control here
|
|
7712
7721
|
that is a dead end: the sibling "New playlist" action sits on
|
|
@@ -7715,7 +7724,7 @@ function Zi({
|
|
|
7715
7724
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-start gap-3 py-2", children: [
|
|
7716
7725
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: h(_ ? "playlist_picker_no_matches" : "playlist_picker_empty") }),
|
|
7717
7726
|
O === null && /* @__PURE__ */ e.jsx(
|
|
7718
|
-
|
|
7727
|
+
q,
|
|
7719
7728
|
{
|
|
7720
7729
|
variant: "outline",
|
|
7721
7730
|
size: "sm",
|
|
@@ -7725,7 +7734,7 @@ function Zi({
|
|
|
7725
7734
|
)
|
|
7726
7735
|
] })
|
|
7727
7736
|
) : se.map((F) => {
|
|
7728
|
-
const
|
|
7737
|
+
const R = v.has(F.id), Y = we.isPending || R;
|
|
7729
7738
|
return /* @__PURE__ */ e.jsxs(
|
|
7730
7739
|
"button",
|
|
7731
7740
|
{
|
|
@@ -7766,7 +7775,7 @@ function Zi({
|
|
|
7766
7775
|
),
|
|
7767
7776
|
/* @__PURE__ */ e.jsxs("span", { className: "flex min-w-0 flex-col", children: [
|
|
7768
7777
|
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: F.title }),
|
|
7769
|
-
|
|
7778
|
+
R && /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: h("playlist_item_already_exists") })
|
|
7770
7779
|
] })
|
|
7771
7780
|
]
|
|
7772
7781
|
},
|
|
@@ -7774,7 +7783,7 @@ function Zi({
|
|
|
7774
7783
|
);
|
|
7775
7784
|
}),
|
|
7776
7785
|
W && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-2", children: /* @__PURE__ */ e.jsx(it, { className: "size-4" }) }),
|
|
7777
|
-
/* @__PURE__ */ e.jsx("div", { ref:
|
|
7786
|
+
/* @__PURE__ */ e.jsx("div", { ref: H })
|
|
7778
7787
|
] })
|
|
7779
7788
|
}
|
|
7780
7789
|
);
|
|
@@ -7789,7 +7798,7 @@ function Cn({
|
|
|
7789
7798
|
const { t: i } = ne(), l = dt(), [u, c] = o.useState(!1), d = o.useRef(null);
|
|
7790
7799
|
return l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
7791
7800
|
/* @__PURE__ */ e.jsx(
|
|
7792
|
-
|
|
7801
|
+
q,
|
|
7793
7802
|
{
|
|
7794
7803
|
ref: d,
|
|
7795
7804
|
variant: "ghost",
|
|
@@ -7834,7 +7843,7 @@ function Cn({
|
|
|
7834
7843
|
)
|
|
7835
7844
|
] }) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
7836
7845
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
7837
|
-
|
|
7846
|
+
q,
|
|
7838
7847
|
{
|
|
7839
7848
|
ref: d,
|
|
7840
7849
|
variant: "ghost",
|
|
@@ -7987,7 +7996,7 @@ function Ah({
|
|
|
7987
7996
|
}, 300);
|
|
7988
7997
|
return () => clearTimeout(k);
|
|
7989
7998
|
}, [j]);
|
|
7990
|
-
const { mutate: D, isPending:
|
|
7999
|
+
const { mutate: D, isPending: L } = ze({
|
|
7991
8000
|
mutationFn: (k) => n.media.deleteMedia(k),
|
|
7992
8001
|
onSuccess: () => {
|
|
7993
8002
|
d({ title: s("media_delete_success"), type: "success" }), l.invalidateQueries({
|
|
@@ -8006,11 +8015,11 @@ function Ah({
|
|
|
8006
8015
|
}, [f, D]), I = z === "title_asc" ? "title_asc" : z === "title_desc" ? "title_desc" : void 0, $ = M === "all" ? void 0 : M, {
|
|
8007
8016
|
data: se,
|
|
8008
8017
|
isLoading: G,
|
|
8009
|
-
isFetchingNextPage:
|
|
8018
|
+
isFetchingNextPage: H,
|
|
8010
8019
|
hasNextPage: B,
|
|
8011
8020
|
fetchNextPage: he,
|
|
8012
8021
|
error: we
|
|
8013
|
-
} =
|
|
8022
|
+
} = Rt({
|
|
8014
8023
|
queryKey: [
|
|
8015
8024
|
...Ne.media.list(
|
|
8016
8025
|
C,
|
|
@@ -8039,16 +8048,16 @@ function Ah({
|
|
|
8039
8048
|
[se?.pages]
|
|
8040
8049
|
), F = Ta({
|
|
8041
8050
|
hasNextPage: B,
|
|
8042
|
-
isFetchingNextPage:
|
|
8051
|
+
isFetchingNextPage: H,
|
|
8043
8052
|
fetchNextPage: he,
|
|
8044
8053
|
error: we
|
|
8045
|
-
}),
|
|
8054
|
+
}), R = o.useMemo(
|
|
8046
8055
|
() => Th.map((k) => ({
|
|
8047
8056
|
value: k.value,
|
|
8048
8057
|
label: s(k.labelKey)
|
|
8049
8058
|
})),
|
|
8050
8059
|
[s]
|
|
8051
|
-
), Y =
|
|
8060
|
+
), Y = R.find((k) => k.value === M)?.label ?? s("media_filter_all_types"), Z = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8052
8061
|
/* @__PURE__ */ e.jsx(Sc, { className: "size-4" }),
|
|
8053
8062
|
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: Y })
|
|
8054
8063
|
] }), J = /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
@@ -8084,7 +8093,7 @@ function Ah({
|
|
|
8084
8093
|
) }),
|
|
8085
8094
|
r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8086
8095
|
/* @__PURE__ */ e.jsx(
|
|
8087
|
-
|
|
8096
|
+
q,
|
|
8088
8097
|
{
|
|
8089
8098
|
variant: "outline",
|
|
8090
8099
|
"aria-label": s("media_filter_aria", {
|
|
@@ -8100,7 +8109,7 @@ function Ah({
|
|
|
8100
8109
|
open: K,
|
|
8101
8110
|
onOpenChange: W,
|
|
8102
8111
|
title: s("media_filter_all_types"),
|
|
8103
|
-
actions:
|
|
8112
|
+
actions: R.map((k) => ({
|
|
8104
8113
|
id: k.value,
|
|
8105
8114
|
label: k.label,
|
|
8106
8115
|
selected: M === k.value,
|
|
@@ -8110,7 +8119,7 @@ function Ah({
|
|
|
8110
8119
|
)
|
|
8111
8120
|
] }) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
8112
8121
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
8113
|
-
|
|
8122
|
+
q,
|
|
8114
8123
|
{
|
|
8115
8124
|
variant: "outline",
|
|
8116
8125
|
"aria-label": s("media_filter_aria", {
|
|
@@ -8119,7 +8128,7 @@ function Ah({
|
|
|
8119
8128
|
children: Z
|
|
8120
8129
|
}
|
|
8121
8130
|
) }),
|
|
8122
|
-
/* @__PURE__ */ e.jsx(gt, { align: "end", children:
|
|
8131
|
+
/* @__PURE__ */ e.jsx(gt, { align: "end", children: R.map((k) => /* @__PURE__ */ e.jsxs(
|
|
8123
8132
|
Fe,
|
|
8124
8133
|
{
|
|
8125
8134
|
onClick: () => S(k.value),
|
|
@@ -8136,14 +8145,14 @@ function Ah({
|
|
|
8136
8145
|
}
|
|
8137
8146
|
)
|
|
8138
8147
|
] }), me = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8139
|
-
|
|
8148
|
+
H && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx("div", { className: "border-primary size-6 animate-spin rounded-full border-2 border-t-transparent" }) }),
|
|
8140
8149
|
we && /* @__PURE__ */ e.jsxs("p", { className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2", children: [
|
|
8141
8150
|
s("common_error_prefix"),
|
|
8142
8151
|
we.message
|
|
8143
8152
|
] })
|
|
8144
8153
|
] });
|
|
8145
8154
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8146
|
-
/* @__PURE__ */ e.jsx(rs, { children: c ? null : /* @__PURE__ */ e.jsxs(
|
|
8155
|
+
/* @__PURE__ */ e.jsx(rs, { children: c ? null : /* @__PURE__ */ e.jsxs(q, { onClick: () => u("media/new"), size: "sm", children: [
|
|
8147
8156
|
/* @__PURE__ */ e.jsx(Wt, { className: "mr-1 size-4" }),
|
|
8148
8157
|
s("media_add_button")
|
|
8149
8158
|
] }) }),
|
|
@@ -8152,7 +8161,7 @@ function Ah({
|
|
|
8152
8161
|
Ys,
|
|
8153
8162
|
{
|
|
8154
8163
|
isLoading: G,
|
|
8155
|
-
isEmpty: !we && _e.length === 0 && !
|
|
8164
|
+
isEmpty: !we && _e.length === 0 && !H && !B,
|
|
8156
8165
|
emptyMessage: Ji({
|
|
8157
8166
|
searchTerm: C,
|
|
8158
8167
|
ownerFilter: P,
|
|
@@ -8269,21 +8278,21 @@ function Ah({
|
|
|
8269
8278
|
size: "compact",
|
|
8270
8279
|
children: /* @__PURE__ */ e.jsxs(Bs, { children: [
|
|
8271
8280
|
/* @__PURE__ */ e.jsx(
|
|
8272
|
-
|
|
8281
|
+
q,
|
|
8273
8282
|
{
|
|
8274
8283
|
variant: "secondary",
|
|
8275
8284
|
onClick: () => g(null),
|
|
8276
|
-
disabled:
|
|
8285
|
+
disabled: L,
|
|
8277
8286
|
children: s("common_cancel")
|
|
8278
8287
|
}
|
|
8279
8288
|
),
|
|
8280
8289
|
/* @__PURE__ */ e.jsx(
|
|
8281
|
-
|
|
8290
|
+
q,
|
|
8282
8291
|
{
|
|
8283
8292
|
variant: "destructive",
|
|
8284
8293
|
onClick: T,
|
|
8285
|
-
disabled:
|
|
8286
|
-
children:
|
|
8294
|
+
disabled: L,
|
|
8295
|
+
children: L ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : s("common_delete")
|
|
8287
8296
|
}
|
|
8288
8297
|
)
|
|
8289
8298
|
] })
|
|
@@ -8374,7 +8383,7 @@ function Fh({
|
|
|
8374
8383
|
}) {
|
|
8375
8384
|
const { t: r } = ne();
|
|
8376
8385
|
return /* @__PURE__ */ e.jsxs(
|
|
8377
|
-
|
|
8386
|
+
q,
|
|
8378
8387
|
{
|
|
8379
8388
|
ref: a,
|
|
8380
8389
|
type: "button",
|
|
@@ -8410,7 +8419,7 @@ function Ih({
|
|
|
8410
8419
|
),
|
|
8411
8420
|
children: /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "mt-2 flex flex-wrap items-center gap-3", children: s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8412
8421
|
/* @__PURE__ */ e.jsx(
|
|
8413
|
-
|
|
8422
|
+
q,
|
|
8414
8423
|
{
|
|
8415
8424
|
type: "button",
|
|
8416
8425
|
variant: "secondary",
|
|
@@ -8421,7 +8430,7 @@ function Ih({
|
|
|
8421
8430
|
}
|
|
8422
8431
|
),
|
|
8423
8432
|
/* @__PURE__ */ e.jsx(
|
|
8424
|
-
|
|
8433
|
+
q,
|
|
8425
8434
|
{
|
|
8426
8435
|
type: "button",
|
|
8427
8436
|
variant: "secondary",
|
|
@@ -8448,7 +8457,7 @@ function Dh(t, s) {
|
|
|
8448
8457
|
return s.default;
|
|
8449
8458
|
}
|
|
8450
8459
|
}
|
|
8451
|
-
function
|
|
8460
|
+
function Lh({
|
|
8452
8461
|
mediaId: t,
|
|
8453
8462
|
onNavigate: s,
|
|
8454
8463
|
onBack: a,
|
|
@@ -8482,7 +8491,7 @@ function Rh({
|
|
|
8482
8491
|
image: n("media_type_image"),
|
|
8483
8492
|
pdf: n("media_type_pdf"),
|
|
8484
8493
|
default: n("media_type_default")
|
|
8485
|
-
}),
|
|
8494
|
+
}), L = E?.description?.body || E?.stripped || "", T = K ? M : E?.pdf_url || A;
|
|
8486
8495
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
8487
8496
|
/* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsxs(ct, { className: "text-lg", children: [
|
|
8488
8497
|
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(
|
|
@@ -8499,7 +8508,7 @@ function Rh({
|
|
|
8499
8508
|
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(Ze, { className: "block max-w-[60vw] truncate align-bottom font-semibold md:max-w-[60ch]", children: P || n("media_breadcrumb") }) })
|
|
8500
8509
|
] }) }) }),
|
|
8501
8510
|
/* @__PURE__ */ e.jsx(rs, { children: d || !E || E.owner_type !== "user" ? null : /* @__PURE__ */ e.jsxs(
|
|
8502
|
-
|
|
8511
|
+
q,
|
|
8503
8512
|
{
|
|
8504
8513
|
size: "sm",
|
|
8505
8514
|
variant: "outline",
|
|
@@ -8518,7 +8527,7 @@ function Rh({
|
|
|
8518
8527
|
notFound: !E,
|
|
8519
8528
|
notFoundMessage: n("media_not_found"),
|
|
8520
8529
|
title: P,
|
|
8521
|
-
description:
|
|
8530
|
+
description: L,
|
|
8522
8531
|
containerHeightClass: "md:h-[calc(95vh-140px)]",
|
|
8523
8532
|
image: /* @__PURE__ */ e.jsxs("div", { className: "relative h-full overflow-hidden", children: [
|
|
8524
8533
|
/* @__PURE__ */ e.jsx(
|
|
@@ -8624,7 +8633,7 @@ function ya({
|
|
|
8624
8633
|
children: t,
|
|
8625
8634
|
value: s
|
|
8626
8635
|
}) {
|
|
8627
|
-
return /* @__PURE__ */ e.jsx(rl.Provider, { value: s, children: /* @__PURE__ */ e.jsx(
|
|
8636
|
+
return /* @__PURE__ */ e.jsx(rl.Provider, { value: s, children: /* @__PURE__ */ e.jsx(Rh, { children: t }) });
|
|
8628
8637
|
}
|
|
8629
8638
|
function ut() {
|
|
8630
8639
|
const t = o.useContext(rl);
|
|
@@ -8635,7 +8644,7 @@ function ut() {
|
|
|
8635
8644
|
return t;
|
|
8636
8645
|
}
|
|
8637
8646
|
const Fr = o.createContext(null), Ir = o.createContext(null);
|
|
8638
|
-
function
|
|
8647
|
+
function Rh({
|
|
8639
8648
|
children: t
|
|
8640
8649
|
}) {
|
|
8641
8650
|
return /* @__PURE__ */ e.jsx(Fr.Provider, { value: null, children: /* @__PURE__ */ e.jsx(Ir.Provider, { value: null, children: t }) });
|
|
@@ -8715,12 +8724,12 @@ const $h = (t = 300) => {
|
|
|
8715
8724
|
};
|
|
8716
8725
|
})
|
|
8717
8726
|
};
|
|
8718
|
-
},
|
|
8727
|
+
}, qh = (t) => typeof t == "object" && t !== null && ("code" in t || "asset_code" in t) && "name" in t && "category" in t, Sn = (t) => "asset_code" in t && Array.isArray(t.variants) && t.variants.length > 0 && typeof t.variants[0]?.ready == "boolean" ? t : ul(t), ml = (t, s = "", a = 0) => {
|
|
8719
8728
|
if (a > 10) return { folders: [], assets: [] };
|
|
8720
8729
|
const r = [], n = [];
|
|
8721
8730
|
for (const [i, l] of Object.entries(t)) {
|
|
8722
8731
|
const u = s ? `${s}.${i}` : i;
|
|
8723
|
-
if (
|
|
8732
|
+
if (qh(l))
|
|
8724
8733
|
n.push(ul(l));
|
|
8725
8734
|
else if (typeof l == "object" && l !== null) {
|
|
8726
8735
|
if (Object.keys(l ?? {})?.length === 0) continue;
|
|
@@ -8730,7 +8739,7 @@ const $h = (t = 300) => {
|
|
|
8730
8739
|
}
|
|
8731
8740
|
}
|
|
8732
8741
|
return { folders: r, assets: n };
|
|
8733
|
-
},
|
|
8742
|
+
}, Hh = (t, s) => {
|
|
8734
8743
|
const a = vs(), { companyId: r } = ut(), [n, i] = o.useState("*"), l = $h(300), u = s !== void 0, c = u ? s.searchQuery : l.searchQuery, d = u ? s.setSearchQuery : l.setSearchQuery, [m, h] = o.useState(
|
|
8735
8744
|
s?.searchQuery ?? ""
|
|
8736
8745
|
);
|
|
@@ -8755,7 +8764,7 @@ const $h = (t = 300) => {
|
|
|
8755
8764
|
fetchNextPage: C,
|
|
8756
8765
|
hasNextPage: N,
|
|
8757
8766
|
isFetchingNextPage: z
|
|
8758
|
-
} =
|
|
8767
|
+
} = Rt({
|
|
8759
8768
|
queryKey: ss.query({
|
|
8760
8769
|
path: _,
|
|
8761
8770
|
search: p,
|
|
@@ -8812,7 +8821,7 @@ const $h = (t = 300) => {
|
|
|
8812
8821
|
},
|
|
8813
8822
|
[]
|
|
8814
8823
|
), M = o.useCallback(() => Array.from(f.values()).map(({ asset: T, variantId: I }) => {
|
|
8815
|
-
const $ = I ? T.variants.find((he) => he.id === I) : T.variants.find((he) => he.ready) || T.variants[0], se = T.default_variant_url ?? "", G = $?.url || se || "",
|
|
8824
|
+
const $ = I ? T.variants.find((he) => he.id === I) : T.variants.find((he) => he.ready) || T.variants[0], se = T.default_variant_url ?? "", G = $?.url || se || "", H = $?.metadata || {}, B = typeof H.width == "number" && typeof H.height == "number" ? { width: H.width, height: H.height } : void 0;
|
|
8816
8825
|
return {
|
|
8817
8826
|
asset_id: T.id,
|
|
8818
8827
|
asset_code: T.asset_code,
|
|
@@ -8841,7 +8850,7 @@ const $h = (t = 300) => {
|
|
|
8841
8850
|
return I && T[I] ? { [I]: T[I] } : T;
|
|
8842
8851
|
},
|
|
8843
8852
|
[r]
|
|
8844
|
-
), { folders: D, allAssets:
|
|
8853
|
+
), { folders: D, allAssets: L } = o.useMemo(() => {
|
|
8845
8854
|
if (!w?.pages?.length)
|
|
8846
8855
|
return { folders: [], allAssets: [] };
|
|
8847
8856
|
const T = r?.toString(), I = T ? [T] : [];
|
|
@@ -8876,7 +8885,7 @@ const $h = (t = 300) => {
|
|
|
8876
8885
|
selectedAssets: K,
|
|
8877
8886
|
selectedAssetsMap: f,
|
|
8878
8887
|
folders: D ?? [],
|
|
8879
|
-
assets:
|
|
8888
|
+
assets: L ?? [],
|
|
8880
8889
|
isLoading: b,
|
|
8881
8890
|
error: j,
|
|
8882
8891
|
isSearching: c !== p,
|
|
@@ -8930,8 +8939,8 @@ function Vh({
|
|
|
8930
8939
|
control: r.control,
|
|
8931
8940
|
name: "folderName",
|
|
8932
8941
|
render: ({ field: u }) => /* @__PURE__ */ e.jsxs(Dl, { children: [
|
|
8933
|
-
/* @__PURE__ */ e.jsx(
|
|
8934
|
-
/* @__PURE__ */ e.jsx(
|
|
8942
|
+
/* @__PURE__ */ e.jsx(Ll, { children: "Folder Name" }),
|
|
8943
|
+
/* @__PURE__ */ e.jsx(Rl, { children: /* @__PURE__ */ e.jsx(
|
|
8935
8944
|
$e,
|
|
8936
8945
|
{
|
|
8937
8946
|
placeholder: "Enter folder name",
|
|
@@ -8943,7 +8952,7 @@ function Vh({
|
|
|
8943
8952
|
] })
|
|
8944
8953
|
}
|
|
8945
8954
|
),
|
|
8946
|
-
/* @__PURE__ */ e.jsx(
|
|
8955
|
+
/* @__PURE__ */ e.jsx(q, { variant: "default", type: "submit", disabled: n, children: n ? "Creating..." : "Add Folder" })
|
|
8947
8956
|
] }) })
|
|
8948
8957
|
}
|
|
8949
8958
|
);
|
|
@@ -8977,7 +8986,7 @@ function Pn({
|
|
|
8977
8986
|
] }),
|
|
8978
8987
|
/* @__PURE__ */ e.jsxs(Bs, { children: [
|
|
8979
8988
|
/* @__PURE__ */ e.jsx(
|
|
8980
|
-
|
|
8989
|
+
q,
|
|
8981
8990
|
{
|
|
8982
8991
|
type: "button",
|
|
8983
8992
|
onClick: l,
|
|
@@ -8988,7 +8997,7 @@ function Pn({
|
|
|
8988
8997
|
}
|
|
8989
8998
|
),
|
|
8990
8999
|
/* @__PURE__ */ e.jsx(
|
|
8991
|
-
|
|
9000
|
+
q,
|
|
8992
9001
|
{
|
|
8993
9002
|
disabled: c,
|
|
8994
9003
|
type: "button",
|
|
@@ -9342,15 +9351,15 @@ const hl = o.forwardRef(
|
|
|
9342
9351
|
selectedAssetsMap: K,
|
|
9343
9352
|
folders: W,
|
|
9344
9353
|
assets: D,
|
|
9345
|
-
isLoading:
|
|
9354
|
+
isLoading: L,
|
|
9346
9355
|
isSearching: T,
|
|
9347
9356
|
hasNextPage: I,
|
|
9348
9357
|
loadMore: $,
|
|
9349
9358
|
isFetching: se
|
|
9350
|
-
} =
|
|
9359
|
+
} = Hh(t.fileTypeFilter, C), G = o.useMemo(
|
|
9351
9360
|
() => Zh(N),
|
|
9352
9361
|
[N]
|
|
9353
|
-
),
|
|
9362
|
+
), H = o.useMemo(() => {
|
|
9354
9363
|
if (!h || !D?.length) return D ?? [];
|
|
9355
9364
|
const V = fa.find((ae) => ae.id === h);
|
|
9356
9365
|
return V ? [...D ?? []].sort((ae, pe) => {
|
|
@@ -9361,7 +9370,7 @@ const hl = o.forwardRef(
|
|
|
9361
9370
|
return V.sortDirection === "asc" ? ge : -ge;
|
|
9362
9371
|
}
|
|
9363
9372
|
if (V.sortBy === "created_at") {
|
|
9364
|
-
const ge = ae.id ?? 0,
|
|
9373
|
+
const ge = ae.id ?? 0, Re = pe.id ?? 0, Ue = ge - Re;
|
|
9365
9374
|
return V.sortDirection === "asc" ? Ue : -Ue;
|
|
9366
9375
|
}
|
|
9367
9376
|
return 0;
|
|
@@ -9389,7 +9398,7 @@ const hl = o.forwardRef(
|
|
|
9389
9398
|
onError: () => {
|
|
9390
9399
|
j.error("Failed to move assets to folder.");
|
|
9391
9400
|
}
|
|
9392
|
-
}), [
|
|
9401
|
+
}), [R, Y] = o.useState(null), Z = o.useRef(-1), J = o.useRef(
|
|
9393
9402
|
null
|
|
9394
9403
|
), { mutate: me, isPending: k } = ze({
|
|
9395
9404
|
mutationFn: (V) => w.deleteDamAsset(V),
|
|
@@ -9419,10 +9428,10 @@ const hl = o.forwardRef(
|
|
|
9419
9428
|
return;
|
|
9420
9429
|
}
|
|
9421
9430
|
const ae = A().map((pe) => {
|
|
9422
|
-
const ge = b.toString() + ".",
|
|
9431
|
+
const ge = b.toString() + ".", Re = fe(pe.metadata.file_name);
|
|
9423
9432
|
return {
|
|
9424
9433
|
code: pe.asset_code,
|
|
9425
|
-
asset_paths: [`${ge}${V.folderName}.${
|
|
9434
|
+
asset_paths: [`${ge}${V.folderName}.${Re}`]
|
|
9426
9435
|
};
|
|
9427
9436
|
});
|
|
9428
9437
|
_e(ae);
|
|
@@ -9464,7 +9473,7 @@ const hl = o.forwardRef(
|
|
|
9464
9473
|
},
|
|
9465
9474
|
selectAssetsByCodes: (V) => {
|
|
9466
9475
|
const ae = new Set(V), pe = [];
|
|
9467
|
-
for (const ge of
|
|
9476
|
+
for (const ge of H || [])
|
|
9468
9477
|
ae.has(ge.asset_code) && (O(ge), pe.push(ge.asset_code));
|
|
9469
9478
|
return pe;
|
|
9470
9479
|
},
|
|
@@ -9486,7 +9495,7 @@ const hl = o.forwardRef(
|
|
|
9486
9495
|
A,
|
|
9487
9496
|
s,
|
|
9488
9497
|
r,
|
|
9489
|
-
|
|
9498
|
+
H,
|
|
9490
9499
|
U,
|
|
9491
9500
|
O,
|
|
9492
9501
|
P,
|
|
@@ -9498,15 +9507,15 @@ const hl = o.forwardRef(
|
|
|
9498
9507
|
const We = o.useRef(a);
|
|
9499
9508
|
We.current = a, o.useEffect(() => {
|
|
9500
9509
|
const V = (S ?? []).length, ae = A(), pe = {};
|
|
9501
|
-
K.forEach((ge,
|
|
9510
|
+
K.forEach((ge, Re) => {
|
|
9502
9511
|
const Ue = ge?.asset?.variants?.length ?? 0;
|
|
9503
|
-
Ue > 0 && (pe[
|
|
9512
|
+
Ue > 0 && (pe[Re] = Ue);
|
|
9504
9513
|
}), We.current?.(V, ae, pe);
|
|
9505
9514
|
}, [S, A, K]);
|
|
9506
9515
|
const Be = (V, ae, pe) => {
|
|
9507
|
-
const ge = ae.variants.find((
|
|
9516
|
+
const ge = ae.variants.find((Re) => Re.ready) || ae.variants[0];
|
|
9508
9517
|
if (V.shiftKey && t.maxFiles !== 1) {
|
|
9509
|
-
const
|
|
9518
|
+
const Re = Z.current, Ue = Re >= 0 ? Math.min(Re, pe) : pe, Qt = Re >= 0 ? Math.max(Re, pe) : pe, vt = H?.slice(Ue, Qt + 1) ?? [], Tt = t.maxFiles ? Math.max(0, t.maxFiles - S.length) : vt.length;
|
|
9510
9519
|
let st = 0;
|
|
9511
9520
|
vt.forEach((at) => {
|
|
9512
9521
|
if (S.includes(at.asset_code) || st >= Tt) return;
|
|
@@ -9520,7 +9529,7 @@ const hl = o.forwardRef(
|
|
|
9520
9529
|
return;
|
|
9521
9530
|
}
|
|
9522
9531
|
Z.current = pe, S.includes(ae.asset_code) ? U(ae.asset_code) : t.maxFiles === 1 ? P(ae, ge?.id) : O(ae, ge?.id);
|
|
9523
|
-
}, tt = () => Y(null), Qe = o.useMemo(() =>
|
|
9532
|
+
}, tt = () => Y(null), Qe = o.useMemo(() => H?.length ? H.map((V) => {
|
|
9524
9533
|
const ae = S.includes(V.asset_code), pe = M(V.asset_code);
|
|
9525
9534
|
return {
|
|
9526
9535
|
id: V.asset_code,
|
|
@@ -9530,7 +9539,7 @@ const hl = o.forwardRef(
|
|
|
9530
9539
|
selectionIndex: pe,
|
|
9531
9540
|
raw: V
|
|
9532
9541
|
};
|
|
9533
|
-
}) : [], [
|
|
9542
|
+
}) : [], [H, S, M]), Pt = () => Math.round(200 * (c / 100));
|
|
9534
9543
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
9535
9544
|
/* @__PURE__ */ e.jsx(
|
|
9536
9545
|
Vh,
|
|
@@ -9545,10 +9554,10 @@ const hl = o.forwardRef(
|
|
|
9545
9554
|
/* @__PURE__ */ e.jsx(
|
|
9546
9555
|
Pn,
|
|
9547
9556
|
{
|
|
9548
|
-
open:
|
|
9549
|
-
description: `This asset **${
|
|
9557
|
+
open: R?.type === "Delete",
|
|
9558
|
+
description: `This asset **${R?.item.name}** will be permanently deleted.`,
|
|
9550
9559
|
onCancel: tt,
|
|
9551
|
-
onAction: () => me(
|
|
9560
|
+
onAction: () => me(R?.item.asset_code ?? "", {
|
|
9552
9561
|
onSuccess: tt
|
|
9553
9562
|
}),
|
|
9554
9563
|
title: "Are you sure?",
|
|
@@ -9559,9 +9568,9 @@ const hl = o.forwardRef(
|
|
|
9559
9568
|
Pn,
|
|
9560
9569
|
{
|
|
9561
9570
|
actionLabel: "Discard",
|
|
9562
|
-
open:
|
|
9563
|
-
description: `This asset **${
|
|
9564
|
-
onAction: () => oe(
|
|
9571
|
+
open: R?.type === "Discard",
|
|
9572
|
+
description: `This asset **${R?.item.name}** will be discarded from your library and will be permanently deleted after a month!`,
|
|
9573
|
+
onAction: () => oe(R?.item.asset_code ?? "", {
|
|
9565
9574
|
onSuccess: tt
|
|
9566
9575
|
}),
|
|
9567
9576
|
title: "Are you sure?",
|
|
@@ -9578,7 +9587,7 @@ const hl = o.forwardRef(
|
|
|
9578
9587
|
children: /* @__PURE__ */ e.jsxs(yr, { container: f ?? void 0, children: [
|
|
9579
9588
|
/* @__PURE__ */ e.jsx(br, { className: "z-9999 bg-black/70 backdrop-blur-none" }),
|
|
9580
9589
|
/* @__PURE__ */ e.jsx(
|
|
9581
|
-
|
|
9590
|
+
qn,
|
|
9582
9591
|
{
|
|
9583
9592
|
className: "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-10000 max-h-[85vh] w-full max-w-4xl -translate-x-1/2 -translate-y-1/2 overflow-hidden bg-white shadow-xl",
|
|
9584
9593
|
style: { zIndex: 1e4 },
|
|
@@ -9599,7 +9608,7 @@ const hl = o.forwardRef(
|
|
|
9599
9608
|
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
9600
9609
|
/* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsx(ct, { className: "min-w-0 flex-wrap", children: G.map((V, ae) => /* @__PURE__ */ e.jsxs(ue.Fragment, { children: [
|
|
9601
9610
|
/* @__PURE__ */ e.jsx(Ce, { className: "inline-flex min-w-0", children: V.isCurrent ? /* @__PURE__ */ e.jsx(Ze, { className: "max-w-48 truncate sm:max-w-xs", children: V.label }) : /* @__PURE__ */ e.jsx(
|
|
9602
|
-
|
|
9611
|
+
q,
|
|
9603
9612
|
{
|
|
9604
9613
|
variant: "ghost",
|
|
9605
9614
|
type: "button",
|
|
@@ -9612,14 +9621,14 @@ const hl = o.forwardRef(
|
|
|
9612
9621
|
) }),
|
|
9613
9622
|
ae < G.length - 1 && /* @__PURE__ */ e.jsx(xt, {})
|
|
9614
9623
|
] }, V.path)) }) }),
|
|
9615
|
-
|
|
9624
|
+
L || T ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
9616
9625
|
/* @__PURE__ */ e.jsx("div", { className: "mx-auto mb-2 h-8 w-8 animate-spin rounded-full border-2 border-blue-600 border-t-transparent" }),
|
|
9617
9626
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500", children: T ? "Searching..." : "Loading assets..." })
|
|
9618
9627
|
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
9619
9628
|
W?.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
9620
9629
|
/* @__PURE__ */ e.jsx("h3", { className: "text-sm font-medium text-gray-900", children: "Folders" }),
|
|
9621
9630
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5", children: W.map((V) => /* @__PURE__ */ e.jsxs(
|
|
9622
|
-
|
|
9631
|
+
q,
|
|
9623
9632
|
{
|
|
9624
9633
|
variant: "ghost",
|
|
9625
9634
|
onClick: () => z(V + ".*"),
|
|
@@ -9632,7 +9641,7 @@ const hl = o.forwardRef(
|
|
|
9632
9641
|
V
|
|
9633
9642
|
)) })
|
|
9634
9643
|
] }),
|
|
9635
|
-
|
|
9644
|
+
H?.length > 0 && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
9636
9645
|
/* @__PURE__ */ e.jsx("div", { className: "mb-4 flex items-center justify-between", children: /* @__PURE__ */ e.jsx("h3", { className: "text-sm font-medium text-gray-900", children: "Assets" }) }),
|
|
9637
9646
|
/* @__PURE__ */ e.jsx(
|
|
9638
9647
|
Dr,
|
|
@@ -9654,7 +9663,7 @@ const hl = o.forwardRef(
|
|
|
9654
9663
|
);
|
|
9655
9664
|
},
|
|
9656
9665
|
onClick: (V, ae, pe) => {
|
|
9657
|
-
const ge =
|
|
9666
|
+
const ge = H?.[pe];
|
|
9658
9667
|
if (!ge) return;
|
|
9659
9668
|
tn(
|
|
9660
9669
|
J,
|
|
@@ -9665,7 +9674,7 @@ const hl = o.forwardRef(
|
|
|
9665
9674
|
).onClick(V);
|
|
9666
9675
|
},
|
|
9667
9676
|
onDoubleClick: (V, ae, pe) => {
|
|
9668
|
-
const ge =
|
|
9677
|
+
const ge = H?.[pe];
|
|
9669
9678
|
if (!ge) return;
|
|
9670
9679
|
tn(
|
|
9671
9680
|
J,
|
|
@@ -9686,12 +9695,12 @@ const hl = o.forwardRef(
|
|
|
9686
9695
|
),
|
|
9687
9696
|
wrapItem: (V, ae) => /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9688
9697
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: ae }),
|
|
9689
|
-
/* @__PURE__ */ e.jsx(
|
|
9698
|
+
/* @__PURE__ */ e.jsx(Lt, { children: V.name })
|
|
9690
9699
|
] }) }, V.id)
|
|
9691
9700
|
}
|
|
9692
9701
|
),
|
|
9693
9702
|
I && /* @__PURE__ */ e.jsx("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ e.jsx(
|
|
9694
|
-
|
|
9703
|
+
q,
|
|
9695
9704
|
{
|
|
9696
9705
|
variant: "secondary",
|
|
9697
9706
|
size: "sm",
|
|
@@ -9709,7 +9718,7 @@ const hl = o.forwardRef(
|
|
|
9709
9718
|
}
|
|
9710
9719
|
) })
|
|
9711
9720
|
] }),
|
|
9712
|
-
W?.length === 0 &&
|
|
9721
|
+
W?.length === 0 && H?.length === 0 && !L && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-12", children: [
|
|
9713
9722
|
/* @__PURE__ */ e.jsx("div", { className: "mb-4 rounded-full bg-gray-100 p-3", children: /* @__PURE__ */ e.jsx(ar, { className: "h-6 w-6 text-gray-400" }) }),
|
|
9714
9723
|
/* @__PURE__ */ e.jsx("h3", { className: "mb-1 text-sm font-medium text-gray-900", children: "No assets found" }),
|
|
9715
9724
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-500", children: "Try searching for something else or navigate to a different folder" })
|
|
@@ -9728,7 +9737,7 @@ const Jh = ({
|
|
|
9728
9737
|
}) => t !== "select" ? null : /* @__PURE__ */ e.jsx("div", { className: "hidden h-full w-64 flex-col rounded-tl-lg border-r border-gray-200 bg-gray-50 md:flex", children: /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-2", children: [
|
|
9729
9738
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2 pt-3", children: /* @__PURE__ */ e.jsx("h3", { className: "text-sm font-semibold text-gray-900", children: "Choose source" }) }),
|
|
9730
9739
|
/* @__PURE__ */ e.jsx("div", { className: "flex w-full min-w-0 flex-col gap-1 p-2", children: r.filter((n) => Mi.includes(n.id)).map((n) => /* @__PURE__ */ e.jsxs(
|
|
9731
|
-
|
|
9740
|
+
q,
|
|
9732
9741
|
{
|
|
9733
9742
|
variant: "ghost",
|
|
9734
9743
|
onClick: () => a(n.id),
|
|
@@ -9784,7 +9793,7 @@ const Jh = ({
|
|
|
9784
9793
|
}
|
|
9785
9794
|
)
|
|
9786
9795
|
] }) }),
|
|
9787
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end gap-2 border-t border-gray-100 pt-4", children: /* @__PURE__ */ e.jsx(
|
|
9796
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end gap-2 border-t border-gray-100 pt-4", children: /* @__PURE__ */ e.jsx(q, { variant: "secondary", size: "sm", onClick: r, children: "Done" }) })
|
|
9788
9797
|
] });
|
|
9789
9798
|
};
|
|
9790
9799
|
mr.displayName = "FilePickerFiltersPanel";
|
|
@@ -9817,21 +9826,21 @@ const ef = ({
|
|
|
9817
9826
|
unsplashSearching: U = !1,
|
|
9818
9827
|
isUnsplashUploading: E = !1
|
|
9819
9828
|
}) => {
|
|
9820
|
-
const [P, A] = o.useState(!1), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D,
|
|
9829
|
+
const [P, A] = o.useState(!1), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, L] = o.useState(!1), T = js(), I = t === "select" && (s === "dam" || s === "media"), $ = t === "select" && s === "unsplash", se = t === "select" ? a.find((B) => B.id === s)?.label || "Select Files" : "Media Details", G = a.filter(
|
|
9821
9830
|
(B) => Mi.includes(B.id)
|
|
9822
|
-
),
|
|
9831
|
+
), H = T && t === "select" && n !== void 0 && G.length > 1;
|
|
9823
9832
|
return /* @__PURE__ */ e.jsxs("div", { className: "sticky top-0 z-20 flex w-full flex-wrap items-center justify-between gap-3 border-b border-gray-100 bg-white px-6 py-3", children: [
|
|
9824
9833
|
/* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-4", children: [
|
|
9825
|
-
|
|
9834
|
+
H ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
9826
9835
|
/* @__PURE__ */ e.jsxs(
|
|
9827
|
-
|
|
9836
|
+
q,
|
|
9828
9837
|
{
|
|
9829
9838
|
variant: "ghost",
|
|
9830
9839
|
type: "button",
|
|
9831
9840
|
"data-testid": "file-picker-method-switcher",
|
|
9832
9841
|
"aria-haspopup": "dialog",
|
|
9833
9842
|
"aria-expanded": D,
|
|
9834
|
-
onClick: () =>
|
|
9843
|
+
onClick: () => L(!0),
|
|
9835
9844
|
className: "h-8 shrink-0 gap-1 px-2 text-lg font-semibold text-gray-900 hover:bg-gray-100",
|
|
9836
9845
|
children: [
|
|
9837
9846
|
se,
|
|
@@ -9843,7 +9852,7 @@ const ef = ({
|
|
|
9843
9852
|
Xe,
|
|
9844
9853
|
{
|
|
9845
9854
|
open: D,
|
|
9846
|
-
onOpenChange:
|
|
9855
|
+
onOpenChange: L,
|
|
9847
9856
|
title: "Choose source",
|
|
9848
9857
|
actions: G.map((B) => ({
|
|
9849
9858
|
id: B.id,
|
|
@@ -9890,7 +9899,7 @@ const ef = ({
|
|
|
9890
9899
|
children: [
|
|
9891
9900
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9892
9901
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
9893
|
-
|
|
9902
|
+
q,
|
|
9894
9903
|
{
|
|
9895
9904
|
variant: "ghost",
|
|
9896
9905
|
size: "icon",
|
|
@@ -9904,10 +9913,10 @@ const ef = ({
|
|
|
9904
9913
|
children: /* @__PURE__ */ e.jsx(Gn, { className: "h-3 w-3" })
|
|
9905
9914
|
}
|
|
9906
9915
|
) }),
|
|
9907
|
-
/* @__PURE__ */ e.jsx(
|
|
9916
|
+
/* @__PURE__ */ e.jsx(Lt, { children: "Zoom out" })
|
|
9908
9917
|
] }) }),
|
|
9909
9918
|
/* @__PURE__ */ e.jsx(
|
|
9910
|
-
|
|
9919
|
+
Hn,
|
|
9911
9920
|
{
|
|
9912
9921
|
value: [c],
|
|
9913
9922
|
onValueChange: (B) => {
|
|
@@ -9922,7 +9931,7 @@ const ef = ({
|
|
|
9922
9931
|
),
|
|
9923
9932
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9924
9933
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
9925
|
-
|
|
9934
|
+
q,
|
|
9926
9935
|
{
|
|
9927
9936
|
variant: "ghost",
|
|
9928
9937
|
size: "icon",
|
|
@@ -9936,7 +9945,7 @@ const ef = ({
|
|
|
9936
9945
|
children: /* @__PURE__ */ e.jsx(Wt, { className: "h-3 w-3" })
|
|
9937
9946
|
}
|
|
9938
9947
|
) }),
|
|
9939
|
-
/* @__PURE__ */ e.jsx(
|
|
9948
|
+
/* @__PURE__ */ e.jsx(Lt, { children: "Zoom in" })
|
|
9940
9949
|
] }) })
|
|
9941
9950
|
]
|
|
9942
9951
|
}
|
|
@@ -9944,7 +9953,7 @@ const ef = ({
|
|
|
9944
9953
|
/* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
|
|
9945
9954
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9946
9955
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
9947
|
-
|
|
9956
|
+
q,
|
|
9948
9957
|
{
|
|
9949
9958
|
variant: "ghost",
|
|
9950
9959
|
size: "icon",
|
|
@@ -9954,13 +9963,13 @@ const ef = ({
|
|
|
9954
9963
|
children: /* @__PURE__ */ e.jsx(sd, { className: "h-4 w-4" })
|
|
9955
9964
|
}
|
|
9956
9965
|
) }),
|
|
9957
|
-
/* @__PURE__ */ e.jsx(
|
|
9966
|
+
/* @__PURE__ */ e.jsx(Lt, { children: m === "list" ? "Not available in list view" : p ? "Hide names on media" : "Show names on media" })
|
|
9958
9967
|
] }) }),
|
|
9959
9968
|
/* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
|
|
9960
9969
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 rounded-md border border-gray-200 bg-gray-50 p-0.5", children: [
|
|
9961
9970
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9962
9971
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
9963
|
-
|
|
9972
|
+
q,
|
|
9964
9973
|
{
|
|
9965
9974
|
variant: "ghost",
|
|
9966
9975
|
size: "icon",
|
|
@@ -9969,11 +9978,11 @@ const ef = ({
|
|
|
9969
9978
|
children: /* @__PURE__ */ e.jsx(Kn, { className: "h-3.5 w-3.5" })
|
|
9970
9979
|
}
|
|
9971
9980
|
) }),
|
|
9972
|
-
/* @__PURE__ */ e.jsx(
|
|
9981
|
+
/* @__PURE__ */ e.jsx(Lt, { children: "Grid View" })
|
|
9973
9982
|
] }) }),
|
|
9974
9983
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9975
9984
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
9976
|
-
|
|
9985
|
+
q,
|
|
9977
9986
|
{
|
|
9978
9987
|
variant: "ghost",
|
|
9979
9988
|
size: "icon",
|
|
@@ -9982,14 +9991,14 @@ const ef = ({
|
|
|
9982
9991
|
children: /* @__PURE__ */ e.jsx(_r, { className: "h-3.5 w-3.5" })
|
|
9983
9992
|
}
|
|
9984
9993
|
) }),
|
|
9985
|
-
/* @__PURE__ */ e.jsx(
|
|
9994
|
+
/* @__PURE__ */ e.jsx(Lt, { children: "List View" })
|
|
9986
9995
|
] }) })
|
|
9987
9996
|
] }),
|
|
9988
9997
|
/* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
|
|
9989
9998
|
s === "dam" && /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
9990
9999
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "inline-flex", children: T ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
9991
10000
|
/* @__PURE__ */ e.jsx(
|
|
9992
|
-
|
|
10001
|
+
q,
|
|
9993
10002
|
{
|
|
9994
10003
|
variant: "ghost",
|
|
9995
10004
|
size: "icon",
|
|
@@ -10021,7 +10030,7 @@ const ef = ({
|
|
|
10021
10030
|
)
|
|
10022
10031
|
] }) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
10023
10032
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
10024
|
-
|
|
10033
|
+
q,
|
|
10025
10034
|
{
|
|
10026
10035
|
variant: "ghost",
|
|
10027
10036
|
size: "icon",
|
|
@@ -10062,12 +10071,12 @@ const ef = ({
|
|
|
10062
10071
|
] })
|
|
10063
10072
|
] })
|
|
10064
10073
|
] }) }) }),
|
|
10065
|
-
/* @__PURE__ */ e.jsx(
|
|
10074
|
+
/* @__PURE__ */ e.jsx(Lt, { children: g ? "Add selected files to a folder" : "Select files to add to a folder" })
|
|
10066
10075
|
] }) }),
|
|
10067
10076
|
s === "dam" && /* @__PURE__ */ e.jsx("div", { className: "h-5 w-px bg-gray-200" }),
|
|
10068
10077
|
T ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
10069
10078
|
/* @__PURE__ */ e.jsx(
|
|
10070
|
-
|
|
10079
|
+
q,
|
|
10071
10080
|
{
|
|
10072
10081
|
variant: "ghost",
|
|
10073
10082
|
size: "icon",
|
|
@@ -10100,7 +10109,7 @@ const ef = ({
|
|
|
10100
10109
|
] }) : /* @__PURE__ */ e.jsxs(jo, { open: P, onOpenChange: A, children: [
|
|
10101
10110
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
10102
10111
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx(wo, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
10103
|
-
|
|
10112
|
+
q,
|
|
10104
10113
|
{
|
|
10105
10114
|
variant: "ghost",
|
|
10106
10115
|
size: "icon",
|
|
@@ -10109,7 +10118,7 @@ const ef = ({
|
|
|
10109
10118
|
children: /* @__PURE__ */ e.jsx(Wr, { className: "h-4 w-4" })
|
|
10110
10119
|
}
|
|
10111
10120
|
) }) }),
|
|
10112
|
-
/* @__PURE__ */ e.jsx(
|
|
10121
|
+
/* @__PURE__ */ e.jsx(Lt, { children: "Filters" })
|
|
10113
10122
|
] }) }),
|
|
10114
10123
|
/* @__PURE__ */ e.jsx(No, { align: "end", className: "w-auto p-0", children: /* @__PURE__ */ e.jsx(
|
|
10115
10124
|
mr,
|
|
@@ -10126,7 +10135,7 @@ const ef = ({
|
|
|
10126
10135
|
/* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsxs(It, { children: [
|
|
10127
10136
|
/* @__PURE__ */ e.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ e.jsx("span", { className: "inline-flex", children: T ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
10128
10137
|
/* @__PURE__ */ e.jsx(
|
|
10129
|
-
|
|
10138
|
+
q,
|
|
10130
10139
|
{
|
|
10131
10140
|
variant: "ghost",
|
|
10132
10141
|
size: "icon",
|
|
@@ -10151,7 +10160,7 @@ const ef = ({
|
|
|
10151
10160
|
)
|
|
10152
10161
|
] }) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
10153
10162
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
10154
|
-
|
|
10163
|
+
q,
|
|
10155
10164
|
{
|
|
10156
10165
|
variant: "ghost",
|
|
10157
10166
|
size: "icon",
|
|
@@ -10177,10 +10186,10 @@ const ef = ({
|
|
|
10177
10186
|
B.id
|
|
10178
10187
|
)) })
|
|
10179
10188
|
] }) }) }),
|
|
10180
|
-
/* @__PURE__ */ e.jsx(
|
|
10189
|
+
/* @__PURE__ */ e.jsx(Lt, { children: "Sort" })
|
|
10181
10190
|
] }) })
|
|
10182
10191
|
] }),
|
|
10183
|
-
/* @__PURE__ */ e.jsx(
|
|
10192
|
+
/* @__PURE__ */ e.jsx(q, { variant: "ghost", size: "sm", onClick: r, className: "ml-2", children: /* @__PURE__ */ e.jsx(Vt, { className: "h-4 w-4" }) })
|
|
10184
10193
|
] });
|
|
10185
10194
|
}, ca = {
|
|
10186
10195
|
images: "image",
|
|
@@ -10211,9 +10220,9 @@ const ef = ({
|
|
|
10211
10220
|
if (m && ca[m])
|
|
10212
10221
|
return ca[m];
|
|
10213
10222
|
if (!(!t.fileTypeFilter || t.fileTypeFilter.length === 0)) {
|
|
10214
|
-
for (const
|
|
10215
|
-
if (ca[
|
|
10216
|
-
return ca[
|
|
10223
|
+
for (const R of t.fileTypeFilter)
|
|
10224
|
+
if (ca[R])
|
|
10225
|
+
return ca[R];
|
|
10217
10226
|
}
|
|
10218
10227
|
}, [m, t.fileTypeFilter]), {
|
|
10219
10228
|
data: K,
|
|
@@ -10239,18 +10248,18 @@ const ef = ({
|
|
|
10239
10248
|
o.useEffect(() => {
|
|
10240
10249
|
z([]), U(1), M(!1);
|
|
10241
10250
|
}, [_, v, S]);
|
|
10242
|
-
const
|
|
10251
|
+
const L = ue.useRef(
|
|
10243
10252
|
`${_}|${v}|${S ?? ""}`
|
|
10244
10253
|
);
|
|
10245
10254
|
o.useEffect(() => {
|
|
10246
|
-
|
|
10255
|
+
L.current = `${_}|${v}|${S ?? ""}`;
|
|
10247
10256
|
}, [_, v, S]), o.useEffect(() => {
|
|
10248
10257
|
if (!K) return;
|
|
10249
10258
|
M(K.meta?.next != null);
|
|
10250
|
-
const
|
|
10251
|
-
|
|
10259
|
+
const R = K.media || [];
|
|
10260
|
+
R.length > 0 && z((Y) => {
|
|
10252
10261
|
const Z = new Map(Y.map((J) => [J.id, J]));
|
|
10253
|
-
for (const J of
|
|
10262
|
+
for (const J of R)
|
|
10254
10263
|
Z.set(J.id, J);
|
|
10255
10264
|
return Array.from(Z.values());
|
|
10256
10265
|
});
|
|
@@ -10259,15 +10268,15 @@ const ef = ({
|
|
|
10259
10268
|
if (!(!A || !x))
|
|
10260
10269
|
try {
|
|
10261
10270
|
P(!0);
|
|
10262
|
-
const
|
|
10271
|
+
const R = O + 1, Y = `${_}|${v}|${S ?? ""}`, Z = await x.media.list({
|
|
10263
10272
|
search_query: v,
|
|
10264
|
-
page:
|
|
10273
|
+
page: R,
|
|
10265
10274
|
per_page: 30,
|
|
10266
10275
|
active: !0,
|
|
10267
10276
|
with_type: S
|
|
10268
10277
|
});
|
|
10269
|
-
if (Y !==
|
|
10270
|
-
M(Z.meta?.next != null), U(
|
|
10278
|
+
if (Y !== L.current) return;
|
|
10279
|
+
M(Z.meta?.next != null), U(R);
|
|
10271
10280
|
const J = Z.media || [];
|
|
10272
10281
|
J.length > 0 && z((me) => {
|
|
10273
10282
|
const k = new Map(me.map((oe) => [oe.id, oe]));
|
|
@@ -10286,11 +10295,11 @@ const ef = ({
|
|
|
10286
10295
|
x,
|
|
10287
10296
|
_
|
|
10288
10297
|
]), I = o.useCallback(
|
|
10289
|
-
(
|
|
10290
|
-
let Y = "", Z = "", J =
|
|
10291
|
-
return
|
|
10292
|
-
asset_id:
|
|
10293
|
-
asset_code: `media_${
|
|
10298
|
+
(R) => {
|
|
10299
|
+
let Y = "", Z = "", J = R.title, me = "", k = "";
|
|
10300
|
+
return R.video_url ? (Y = R.video_url, Z = "video/mp4", J = `${R.title}.mp4`, me = R.image_url || "", k = R.description?.body || "") : R.pdf_url ? (Y = R.pdf_url, Z = "application/pdf", J = `${R.title}.pdf`) : R.image_url && (Y = R.image_url, Z = "image/jpeg", J = `${R.title}.jpg`), {
|
|
10301
|
+
asset_id: R.id,
|
|
10302
|
+
asset_code: `media_${R.id}`,
|
|
10294
10303
|
file_path: Y,
|
|
10295
10304
|
file_url: Y,
|
|
10296
10305
|
...me ? { thumbnail_url: me } : {},
|
|
@@ -10303,8 +10312,8 @@ const ef = ({
|
|
|
10303
10312
|
};
|
|
10304
10313
|
},
|
|
10305
10314
|
[]
|
|
10306
|
-
), { state: $, api: se } = nl(), G = $ !== null && se !== null,
|
|
10307
|
-
(
|
|
10315
|
+
), { state: $, api: se } = nl(), G = $ !== null && se !== null, H = o.useCallback(
|
|
10316
|
+
(R, Y, Z) => {
|
|
10308
10317
|
const J = parseInt(Y.replace(/^media_/, ""), 10);
|
|
10309
10318
|
if (Number.isNaN(J)) return;
|
|
10310
10319
|
if (G) {
|
|
@@ -10345,57 +10354,57 @@ const ef = ({
|
|
|
10345
10354
|
}, [G, r.length, s]);
|
|
10346
10355
|
const B = o.useMemo(() => {
|
|
10347
10356
|
if (!h || !N.length) return N;
|
|
10348
|
-
const
|
|
10349
|
-
return
|
|
10350
|
-
if (
|
|
10357
|
+
const R = fa.find((Y) => Y.id === h);
|
|
10358
|
+
return R ? [...N].sort((Y, Z) => {
|
|
10359
|
+
if (R.sortBy === "name") {
|
|
10351
10360
|
const J = (Y.title ?? "").localeCompare(Z.title ?? "", void 0, {
|
|
10352
10361
|
sensitivity: "base"
|
|
10353
10362
|
});
|
|
10354
|
-
return
|
|
10363
|
+
return R.sortDirection === "asc" ? J : -J;
|
|
10355
10364
|
}
|
|
10356
|
-
if (
|
|
10365
|
+
if (R.sortBy === "created_at") {
|
|
10357
10366
|
const J = Y.id ?? 0, me = Z.id ?? 0, k = J - me;
|
|
10358
|
-
return
|
|
10367
|
+
return R.sortDirection === "asc" ? k : -k;
|
|
10359
10368
|
}
|
|
10360
10369
|
return 0;
|
|
10361
10370
|
}) : N;
|
|
10362
|
-
}, [N, h]), he = (
|
|
10363
|
-
(
|
|
10364
|
-
if (
|
|
10371
|
+
}, [N, h]), he = (R) => R.image_url ? De : R.video_url ? xs : (R.pdf_url, _s), we = o.useCallback(
|
|
10372
|
+
(R, Y) => {
|
|
10373
|
+
if (R.image_url)
|
|
10365
10374
|
return /* @__PURE__ */ e.jsx(
|
|
10366
10375
|
"img",
|
|
10367
10376
|
{
|
|
10368
|
-
src:
|
|
10369
|
-
alt:
|
|
10377
|
+
src: R.image_url,
|
|
10378
|
+
alt: R.title,
|
|
10370
10379
|
width: 200,
|
|
10371
10380
|
height: 150,
|
|
10372
10381
|
className: "h-full w-full object-cover"
|
|
10373
10382
|
}
|
|
10374
10383
|
);
|
|
10375
|
-
const Z = he(
|
|
10384
|
+
const Z = he(R);
|
|
10376
10385
|
return /* @__PURE__ */ e.jsx("div", { className: "flex h-full w-full items-center justify-center bg-gray-100", children: /* @__PURE__ */ e.jsx(Z, { className: "h-8 w-8 text-gray-400" }) });
|
|
10377
10386
|
},
|
|
10378
10387
|
[]
|
|
10379
|
-
), _e = o.useMemo(() => B.map((
|
|
10380
|
-
const Y = `media_${
|
|
10388
|
+
), _e = o.useMemo(() => B.map((R) => {
|
|
10389
|
+
const Y = `media_${R.id}`;
|
|
10381
10390
|
let Z, J;
|
|
10382
10391
|
if (G) {
|
|
10383
10392
|
const me = $.items.findIndex((k) => k.asset_code === Y);
|
|
10384
10393
|
Z = me >= 0, J = Z ? me + 1 : 0;
|
|
10385
10394
|
} else {
|
|
10386
|
-
const me = r.indexOf(
|
|
10395
|
+
const me = r.indexOf(R.id);
|
|
10387
10396
|
Z = me >= 0, J = Z ? me + 1 : 0;
|
|
10388
10397
|
}
|
|
10389
10398
|
return {
|
|
10390
10399
|
id: Y,
|
|
10391
|
-
name:
|
|
10392
|
-
subtitle:
|
|
10400
|
+
name: R.title ?? "",
|
|
10401
|
+
subtitle: R.kind ?? "Media",
|
|
10393
10402
|
isSelected: Z,
|
|
10394
10403
|
selectionIndex: J,
|
|
10395
|
-
raw:
|
|
10404
|
+
raw: R
|
|
10396
10405
|
};
|
|
10397
10406
|
}), [B, r, G, $]), F = o.useCallback(
|
|
10398
|
-
(
|
|
10407
|
+
(R, Y, Z) => {
|
|
10399
10408
|
const J = B[Z];
|
|
10400
10409
|
J && g?.(J);
|
|
10401
10410
|
},
|
|
@@ -10409,7 +10418,7 @@ const ef = ({
|
|
|
10409
10418
|
bs,
|
|
10410
10419
|
{
|
|
10411
10420
|
open: !!f,
|
|
10412
|
-
onOpenChange: (
|
|
10421
|
+
onOpenChange: (R) => !R && g?.(null),
|
|
10413
10422
|
children: /* @__PURE__ */ e.jsxs(yr, { container: p ?? void 0, children: [
|
|
10414
10423
|
/* @__PURE__ */ e.jsx(br, { className: "z-9999 bg-black/70 backdrop-blur-none" }),
|
|
10415
10424
|
/* @__PURE__ */ e.jsx(
|
|
@@ -10435,8 +10444,8 @@ const ef = ({
|
|
|
10435
10444
|
}
|
|
10436
10445
|
) }) : /* @__PURE__ */ e.jsxs("div", { className: "flex aspect-video min-h-[200px] items-center justify-center bg-gray-100 p-8", children: [
|
|
10437
10446
|
(() => {
|
|
10438
|
-
const
|
|
10439
|
-
return /* @__PURE__ */ e.jsx(
|
|
10447
|
+
const R = he(f);
|
|
10448
|
+
return /* @__PURE__ */ e.jsx(R, { className: "h-16 w-16 text-gray-400" });
|
|
10440
10449
|
})(),
|
|
10441
10450
|
/* @__PURE__ */ e.jsx("p", { className: "ml-4 text-sm text-gray-600", children: f.title })
|
|
10442
10451
|
] }) })
|
|
@@ -10452,8 +10461,8 @@ const ef = ({
|
|
|
10452
10461
|
type: "text",
|
|
10453
10462
|
placeholder: "Search media...",
|
|
10454
10463
|
value: v,
|
|
10455
|
-
onChange: (
|
|
10456
|
-
C(
|
|
10464
|
+
onChange: (R) => {
|
|
10465
|
+
C(R.target.value);
|
|
10457
10466
|
},
|
|
10458
10467
|
className: "h-9"
|
|
10459
10468
|
}
|
|
@@ -10476,12 +10485,12 @@ const ef = ({
|
|
|
10476
10485
|
thumbnailSize: u,
|
|
10477
10486
|
showNamesOnMedia: d ?? !0,
|
|
10478
10487
|
renderThumbnail: we,
|
|
10479
|
-
onClick:
|
|
10488
|
+
onClick: H,
|
|
10480
10489
|
onDoubleClick: F
|
|
10481
10490
|
}
|
|
10482
10491
|
),
|
|
10483
10492
|
A && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ e.jsx(
|
|
10484
|
-
|
|
10493
|
+
q,
|
|
10485
10494
|
{
|
|
10486
10495
|
variant: "secondary",
|
|
10487
10496
|
size: "sm",
|
|
@@ -10499,7 +10508,7 @@ const ef = ({
|
|
|
10499
10508
|
] })
|
|
10500
10509
|
] });
|
|
10501
10510
|
}, An = 30;
|
|
10502
|
-
function
|
|
10511
|
+
function Lr({
|
|
10503
10512
|
contentKind: t,
|
|
10504
10513
|
assetCodePrefix: s,
|
|
10505
10514
|
labelPlural: a,
|
|
@@ -10544,9 +10553,9 @@ function Rr({
|
|
|
10544
10553
|
o.useEffect(() => {
|
|
10545
10554
|
D.current = `${b}|${C}`;
|
|
10546
10555
|
}, [b, C]);
|
|
10547
|
-
const { toast:
|
|
10556
|
+
const { toast: L } = ut(), T = o.useCallback(async () => {
|
|
10548
10557
|
if (!U) return;
|
|
10549
|
-
const F = C,
|
|
10558
|
+
const F = C, R = `${b}|${F}`;
|
|
10550
10559
|
try {
|
|
10551
10560
|
A(!0);
|
|
10552
10561
|
const Y = await r.list({
|
|
@@ -10554,7 +10563,7 @@ function Rr({
|
|
|
10554
10563
|
cursor: U,
|
|
10555
10564
|
limit: An
|
|
10556
10565
|
});
|
|
10557
|
-
if (
|
|
10566
|
+
if (R !== D.current) return;
|
|
10558
10567
|
O((Z) => {
|
|
10559
10568
|
const J = new Set(Z.map(n)), me = [...Z];
|
|
10560
10569
|
for (const k of Y.items)
|
|
@@ -10562,7 +10571,7 @@ function Rr({
|
|
|
10562
10571
|
return me;
|
|
10563
10572
|
}), E(Y.nextCursor);
|
|
10564
10573
|
} catch (Y) {
|
|
10565
|
-
|
|
10574
|
+
L.error(`Failed to load more ${a}`, Y);
|
|
10566
10575
|
} finally {
|
|
10567
10576
|
A(!1);
|
|
10568
10577
|
}
|
|
@@ -10573,13 +10582,13 @@ function Rr({
|
|
|
10573
10582
|
r,
|
|
10574
10583
|
n,
|
|
10575
10584
|
a,
|
|
10576
|
-
|
|
10585
|
+
L
|
|
10577
10586
|
]), { state: I, api: $ } = nl(), se = I !== null && $ !== null, G = o.useCallback(
|
|
10578
10587
|
(F) => {
|
|
10579
|
-
const
|
|
10588
|
+
const R = n(F), Y = i(F), Z = l(F) ?? "";
|
|
10580
10589
|
return {
|
|
10581
|
-
asset_id:
|
|
10582
|
-
asset_code: `${s}${
|
|
10590
|
+
asset_id: R,
|
|
10591
|
+
asset_code: `${s}${R}`,
|
|
10583
10592
|
file_path: Z,
|
|
10584
10593
|
file_url: Z,
|
|
10585
10594
|
...Z ? { thumbnail_url: Z } : {},
|
|
@@ -10591,24 +10600,24 @@ function Rr({
|
|
|
10591
10600
|
};
|
|
10592
10601
|
},
|
|
10593
10602
|
[s, n, i, l]
|
|
10594
|
-
),
|
|
10603
|
+
), H = o.useCallback(
|
|
10595
10604
|
(F) => se ? I.items.some(
|
|
10596
|
-
(
|
|
10605
|
+
(R) => R.asset_code === `${s}${F}`
|
|
10597
10606
|
) : m.includes(F),
|
|
10598
10607
|
[se, I, s, m]
|
|
10599
10608
|
), B = o.useCallback(
|
|
10600
10609
|
(F) => {
|
|
10601
10610
|
if (se) {
|
|
10602
|
-
const
|
|
10603
|
-
return I.items.findIndex((Y) => Y.asset_code ===
|
|
10611
|
+
const R = `${s}${F}`;
|
|
10612
|
+
return I.items.findIndex((Y) => Y.asset_code === R) + 1;
|
|
10604
10613
|
}
|
|
10605
10614
|
return m.indexOf(F) + 1;
|
|
10606
10615
|
},
|
|
10607
10616
|
[se, I, s, m]
|
|
10608
10617
|
), he = o.useCallback(
|
|
10609
|
-
(F,
|
|
10618
|
+
(F, R) => {
|
|
10610
10619
|
const Y = Number.parseInt(
|
|
10611
|
-
|
|
10620
|
+
R.startsWith(s) ? R.slice(s.length) : R,
|
|
10612
10621
|
10
|
|
10613
10622
|
);
|
|
10614
10623
|
if (Number.isNaN(Y)) return;
|
|
@@ -10652,11 +10661,11 @@ function Rr({
|
|
|
10652
10661
|
}, [se, m.length, f]);
|
|
10653
10662
|
const we = o.useCallback(
|
|
10654
10663
|
(F) => {
|
|
10655
|
-
const
|
|
10656
|
-
return
|
|
10664
|
+
const R = l(F);
|
|
10665
|
+
return R ? /* @__PURE__ */ e.jsx(
|
|
10657
10666
|
"img",
|
|
10658
10667
|
{
|
|
10659
|
-
src:
|
|
10668
|
+
src: R,
|
|
10660
10669
|
alt: i(F),
|
|
10661
10670
|
width: 200,
|
|
10662
10671
|
height: 150,
|
|
@@ -10667,12 +10676,12 @@ function Rr({
|
|
|
10667
10676
|
[c, l, i]
|
|
10668
10677
|
), _e = o.useMemo(
|
|
10669
10678
|
() => z.map((F) => {
|
|
10670
|
-
const
|
|
10679
|
+
const R = n(F), Y = B(R);
|
|
10671
10680
|
return {
|
|
10672
|
-
id: `${s}${
|
|
10681
|
+
id: `${s}${R}`,
|
|
10673
10682
|
name: i(F),
|
|
10674
10683
|
subtitle: u?.(F) ?? void 0,
|
|
10675
|
-
isSelected:
|
|
10684
|
+
isSelected: H(R),
|
|
10676
10685
|
selectionIndex: Y,
|
|
10677
10686
|
raw: F
|
|
10678
10687
|
};
|
|
@@ -10680,7 +10689,7 @@ function Rr({
|
|
|
10680
10689
|
[
|
|
10681
10690
|
z,
|
|
10682
10691
|
s,
|
|
10683
|
-
|
|
10692
|
+
H,
|
|
10684
10693
|
B,
|
|
10685
10694
|
n,
|
|
10686
10695
|
i,
|
|
@@ -10735,7 +10744,7 @@ function Rr({
|
|
|
10735
10744
|
}
|
|
10736
10745
|
),
|
|
10737
10746
|
U && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ e.jsx(
|
|
10738
|
-
|
|
10747
|
+
q,
|
|
10739
10748
|
{
|
|
10740
10749
|
variant: "secondary",
|
|
10741
10750
|
size: "sm",
|
|
@@ -10756,7 +10765,7 @@ function Rr({
|
|
|
10756
10765
|
const sf = (t) => {
|
|
10757
10766
|
const { shareablesClient: s } = ut(), a = s?.pages;
|
|
10758
10767
|
return a ? /* @__PURE__ */ e.jsx(
|
|
10759
|
-
|
|
10768
|
+
Lr,
|
|
10760
10769
|
{
|
|
10761
10770
|
contentKind: "pages",
|
|
10762
10771
|
assetCodePrefix: "page_",
|
|
@@ -10772,7 +10781,7 @@ const sf = (t) => {
|
|
|
10772
10781
|
}, af = (t) => {
|
|
10773
10782
|
const { shareablesClient: s } = ut(), a = s?.products;
|
|
10774
10783
|
return a ? /* @__PURE__ */ e.jsx(
|
|
10775
|
-
|
|
10784
|
+
Lr,
|
|
10776
10785
|
{
|
|
10777
10786
|
contentKind: "products",
|
|
10778
10787
|
assetCodePrefix: "product_",
|
|
@@ -10782,14 +10791,14 @@ const sf = (t) => {
|
|
|
10782
10791
|
getLabel: (r) => r.name || `Product #${r.id}`,
|
|
10783
10792
|
getImageUrl: (r) => r.image_url ?? null,
|
|
10784
10793
|
getSubtitle: (r) => r.price ? `$${r.price}` : void 0,
|
|
10785
|
-
fallbackIcon:
|
|
10794
|
+
fallbackIcon: Hs,
|
|
10786
10795
|
...t
|
|
10787
10796
|
}
|
|
10788
10797
|
) : null;
|
|
10789
10798
|
}, rf = (t) => {
|
|
10790
10799
|
const { shareablesClient: s } = ut(), a = s?.enrollment_packs;
|
|
10791
10800
|
return a ? /* @__PURE__ */ e.jsx(
|
|
10792
|
-
|
|
10801
|
+
Lr,
|
|
10793
10802
|
{
|
|
10794
10803
|
contentKind: "enrollment_packs",
|
|
10795
10804
|
assetCodePrefix: "enrollment_pack_",
|
|
@@ -10842,12 +10851,12 @@ const sf = (t) => {
|
|
|
10842
10851
|
});
|
|
10843
10852
|
try {
|
|
10844
10853
|
b((G) => {
|
|
10845
|
-
const
|
|
10846
|
-
return
|
|
10854
|
+
const H = new Map(G);
|
|
10855
|
+
return H.set(M, {
|
|
10847
10856
|
file_name: S,
|
|
10848
10857
|
progress: 25,
|
|
10849
10858
|
status: "uploading"
|
|
10850
|
-
}),
|
|
10859
|
+
}), H;
|
|
10851
10860
|
});
|
|
10852
10861
|
const K = new URL(A.urls.regular);
|
|
10853
10862
|
K.searchParams.set("fm", "jpg"), K.searchParams.set("q", "80");
|
|
@@ -10855,21 +10864,21 @@ const sf = (t) => {
|
|
|
10855
10864
|
if (!D.ok)
|
|
10856
10865
|
throw new Error(`Failed to download image: ${D.statusText}`);
|
|
10857
10866
|
b((G) => {
|
|
10858
|
-
const
|
|
10859
|
-
return
|
|
10867
|
+
const H = new Map(G);
|
|
10868
|
+
return H.set(M, {
|
|
10860
10869
|
file_name: S,
|
|
10861
10870
|
progress: 50,
|
|
10862
10871
|
status: "uploading"
|
|
10863
|
-
}),
|
|
10872
|
+
}), H;
|
|
10864
10873
|
});
|
|
10865
|
-
const
|
|
10874
|
+
const L = await D.blob(), T = new File([L], S, { type: "image/jpeg" });
|
|
10866
10875
|
b((G) => {
|
|
10867
|
-
const
|
|
10868
|
-
return
|
|
10876
|
+
const H = new Map(G);
|
|
10877
|
+
return H.set(M, {
|
|
10869
10878
|
file_name: S,
|
|
10870
10879
|
progress: 75,
|
|
10871
10880
|
status: "uploading"
|
|
10872
|
-
}),
|
|
10881
|
+
}), H;
|
|
10873
10882
|
});
|
|
10874
10883
|
const I = await z.mutateAsync({
|
|
10875
10884
|
file: T,
|
|
@@ -10884,12 +10893,12 @@ const sf = (t) => {
|
|
|
10884
10893
|
"Invalid DAM response structure - missing asset property"
|
|
10885
10894
|
);
|
|
10886
10895
|
b((G) => {
|
|
10887
|
-
const
|
|
10888
|
-
return
|
|
10896
|
+
const H = new Map(G);
|
|
10897
|
+
return H.set(M, {
|
|
10889
10898
|
file_name: S,
|
|
10890
10899
|
progress: 100,
|
|
10891
10900
|
status: "ready"
|
|
10892
|
-
}),
|
|
10901
|
+
}), H;
|
|
10893
10902
|
});
|
|
10894
10903
|
const $ = I.asset, se = kr($, C);
|
|
10895
10904
|
return {
|
|
@@ -10911,13 +10920,13 @@ const sf = (t) => {
|
|
|
10911
10920
|
} catch (K) {
|
|
10912
10921
|
const W = K instanceof Error ? K.message : "Upload failed";
|
|
10913
10922
|
return N.error(W), b((D) => {
|
|
10914
|
-
const
|
|
10915
|
-
return
|
|
10923
|
+
const L = new Map(D);
|
|
10924
|
+
return L.set(M, {
|
|
10916
10925
|
file_name: S,
|
|
10917
10926
|
progress: 0,
|
|
10918
10927
|
status: "error",
|
|
10919
10928
|
error: W
|
|
10920
|
-
}),
|
|
10929
|
+
}), L;
|
|
10921
10930
|
}), {
|
|
10922
10931
|
asset_id: 0,
|
|
10923
10932
|
asset_code: "",
|
|
@@ -11025,7 +11034,7 @@ const sf = (t) => {
|
|
|
11025
11034
|
style: {
|
|
11026
11035
|
backgroundColor: "rgba(0, 0, 0, 0)"
|
|
11027
11036
|
},
|
|
11028
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ e.jsx(
|
|
11037
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ e.jsx(Ls, { className: "h-6 w-6 text-white" }) })
|
|
11029
11038
|
}
|
|
11030
11039
|
),
|
|
11031
11040
|
/* @__PURE__ */ e.jsx("div", { className: "absolute right-0 bottom-0 left-0 bg-linear-to-t from-black to-transparent p-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-1 text-xs text-white", children: [
|
|
@@ -11061,7 +11070,7 @@ const sf = (t) => {
|
|
|
11061
11070
|
] })
|
|
11062
11071
|
] }) }),
|
|
11063
11072
|
w === v.id && p && /* @__PURE__ */ e.jsx("div", { className: "bg-opacity-75 absolute inset-0 flex items-center justify-center bg-blue-500", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center text-white", children: [
|
|
11064
|
-
/* @__PURE__ */ e.jsx(
|
|
11073
|
+
/* @__PURE__ */ e.jsx(Ls, { className: "mb-1 h-6 w-6 animate-pulse" }),
|
|
11065
11074
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Uploading..." })
|
|
11066
11075
|
] }) })
|
|
11067
11076
|
]
|
|
@@ -11073,11 +11082,11 @@ const sf = (t) => {
|
|
|
11073
11082
|
l,
|
|
11074
11083
|
'"'
|
|
11075
11084
|
] }) }),
|
|
11076
|
-
g && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ e.jsx(
|
|
11085
|
+
g && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center pt-4", children: /* @__PURE__ */ e.jsx(q, { onClick: x, disabled: _, variant: "outline", children: _ ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
11077
11086
|
/* @__PURE__ */ e.jsx(Ct, { className: "mr-2 animate-spin" }),
|
|
11078
11087
|
"Loading..."
|
|
11079
11088
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
11080
|
-
/* @__PURE__ */ e.jsx(
|
|
11089
|
+
/* @__PURE__ */ e.jsx(Ls, { className: "mr-2" }),
|
|
11081
11090
|
"Load More"
|
|
11082
11091
|
] }) }) }),
|
|
11083
11092
|
t.showProgress && h.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -11090,7 +11099,7 @@ const sf = (t) => {
|
|
|
11090
11099
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
11091
11100
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
11092
11101
|
(() => {
|
|
11093
|
-
const C = v.status === "ready" ? as : v.status === "error" ? Os :
|
|
11102
|
+
const C = v.status === "ready" ? as : v.status === "error" ? Os : Ls;
|
|
11094
11103
|
return /* @__PURE__ */ e.jsx(
|
|
11095
11104
|
C,
|
|
11096
11105
|
{
|
|
@@ -11291,7 +11300,7 @@ const sf = (t) => {
|
|
|
11291
11300
|
credentials: "omit"
|
|
11292
11301
|
})).headers.get("content-type") || "", z = d.trim() || w(u.trim());
|
|
11293
11302
|
if (!Du(N, z, t.accept)) {
|
|
11294
|
-
const O =
|
|
11303
|
+
const O = Lu(
|
|
11295
11304
|
t.accept
|
|
11296
11305
|
);
|
|
11297
11306
|
l.error(
|
|
@@ -11360,7 +11369,7 @@ const sf = (t) => {
|
|
|
11360
11369
|
),
|
|
11361
11370
|
u && /* @__PURE__ */ e.jsx("div", { className: "absolute top-1/2 right-3 -translate-y-1/2", children: _(u) ? /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-green-100", children: /* @__PURE__ */ e.jsx(as, { className: "h-3 w-3 text-green-600" }) }) : /* @__PURE__ */ e.jsx("div", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-red-100", children: /* @__PURE__ */ e.jsx(Os, { className: "h-3 w-3 text-red-600" }) }) })
|
|
11362
11371
|
] }),
|
|
11363
|
-
u.trim() && _(u) && /* @__PURE__ */ e.jsx(
|
|
11372
|
+
u.trim() && _(u) && /* @__PURE__ */ e.jsx(q, { variant: "default", type: "submit", disabled: f, children: f ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(Ct, { className: "h-3 w-3 animate-spin" }) }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(lc, { className: "h-3 w-3" }) }) })
|
|
11364
11373
|
] }),
|
|
11365
11374
|
u && !_(u) && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-600", children: "Please enter a valid URL" }),
|
|
11366
11375
|
u && _(u) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
@@ -11443,7 +11452,7 @@ const sf = (t) => {
|
|
|
11443
11452
|
)) }),
|
|
11444
11453
|
a && /* @__PURE__ */ e.jsx("div", { className: "mx-auto flex w-full items-center justify-between md:w-1/2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11445
11454
|
/* @__PURE__ */ e.jsx(
|
|
11446
|
-
|
|
11455
|
+
qs,
|
|
11447
11456
|
{
|
|
11448
11457
|
checked: r,
|
|
11449
11458
|
onCheckedChange: n,
|
|
@@ -11569,12 +11578,12 @@ const sf = (t) => {
|
|
|
11569
11578
|
n ?? "free"
|
|
11570
11579
|
), [z, O] = o.useState(0), [U, E] = o.useState(!1), [P, A] = o.useState(1), [M, S] = o.useState(!1), [K, W] = o.useState(
|
|
11571
11580
|
null
|
|
11572
|
-
), D = o.useRef(null),
|
|
11581
|
+
), D = o.useRef(null), L = o.useRef(null), T = o.useRef(null), I = C === "free" ? void 0 : C, $ = o.useMemo(() => {
|
|
11573
11582
|
const F = D.current;
|
|
11574
11583
|
if (!x || !F) return null;
|
|
11575
|
-
const
|
|
11584
|
+
const R = F.naturalWidth, Y = F.naturalHeight, Z = F.clientWidth, J = F.clientHeight;
|
|
11576
11585
|
if (!Z || !J) return null;
|
|
11577
|
-
const me = Math.max(
|
|
11586
|
+
const me = Math.max(R / Z, Y / J);
|
|
11578
11587
|
return {
|
|
11579
11588
|
width: Math.floor(x.width * me),
|
|
11580
11589
|
height: Math.floor(x.height * me)
|
|
@@ -11589,28 +11598,28 @@ const sf = (t) => {
|
|
|
11589
11598
|
}
|
|
11590
11599
|
t || (O(0), E(!1), A(1), S(!1), W(null), N(n ?? "free"));
|
|
11591
11600
|
}, [t, r, n]);
|
|
11592
|
-
const
|
|
11593
|
-
const
|
|
11594
|
-
if (!
|
|
11601
|
+
const H = o.useCallback((F) => {
|
|
11602
|
+
const R = D.current;
|
|
11603
|
+
if (!R) return;
|
|
11595
11604
|
const { crop: Y, completedCrop: Z } = Gu(
|
|
11596
|
-
|
|
11597
|
-
|
|
11605
|
+
R.clientWidth,
|
|
11606
|
+
R.clientHeight,
|
|
11598
11607
|
F
|
|
11599
11608
|
);
|
|
11600
11609
|
g(Y), setTimeout(() => _(Z), 0);
|
|
11601
11610
|
}, []), B = o.useCallback(() => {
|
|
11602
|
-
D.current &&
|
|
11603
|
-
}, [I,
|
|
11611
|
+
D.current && H(I);
|
|
11612
|
+
}, [I, H]), he = async () => {
|
|
11604
11613
|
if (D.current) {
|
|
11605
11614
|
v(!0);
|
|
11606
11615
|
try {
|
|
11607
|
-
const F = D.current.clientWidth,
|
|
11616
|
+
const F = D.current.clientWidth, R = D.current.clientHeight;
|
|
11608
11617
|
let Y, Z, J, me;
|
|
11609
|
-
x ? (Y = x.x, Z = x.y, J = x.width, me = x.height) : f ? f.unit === "%" ? (Y = f.x / 100 * F, Z = f.y / 100 *
|
|
11618
|
+
x ? (Y = x.x, Z = x.y, J = x.width, me = x.height) : f ? f.unit === "%" ? (Y = f.x / 100 * F, Z = f.y / 100 * R, J = f.width / 100 * F, me = f.height / 100 * R) : (Y = f.x, Z = f.y, J = f.width, me = f.height) : (Y = 0, Z = 0, J = F, me = R);
|
|
11610
11619
|
const k = await Wu(
|
|
11611
11620
|
D.current,
|
|
11612
11621
|
F,
|
|
11613
|
-
|
|
11622
|
+
R,
|
|
11614
11623
|
{ x: Y, y: Z, width: J, height: me },
|
|
11615
11624
|
P,
|
|
11616
11625
|
z,
|
|
@@ -11630,7 +11639,7 @@ const sf = (t) => {
|
|
|
11630
11639
|
}
|
|
11631
11640
|
}
|
|
11632
11641
|
}, we = () => {
|
|
11633
|
-
O(0), E(!1), A(1), S(!1), N(n ?? "free"),
|
|
11642
|
+
O(0), E(!1), A(1), S(!1), N(n ?? "free"), H(n ?? void 0);
|
|
11634
11643
|
}, _e = Ba.find(
|
|
11635
11644
|
(F) => F.value === C || typeof F.value == "number" && F.value === C
|
|
11636
11645
|
)?.label ?? "Free";
|
|
@@ -11645,7 +11654,7 @@ const sf = (t) => {
|
|
|
11645
11654
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-muted/30 flex shrink-0 flex-wrap items-center justify-center gap-2 px-4 py-2", children: [
|
|
11646
11655
|
m ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
11647
11656
|
/* @__PURE__ */ e.jsxs(
|
|
11648
|
-
|
|
11657
|
+
q,
|
|
11649
11658
|
{
|
|
11650
11659
|
variant: "outline",
|
|
11651
11660
|
size: "sm",
|
|
@@ -11667,7 +11676,7 @@ const sf = (t) => {
|
|
|
11667
11676
|
id: String(F.value),
|
|
11668
11677
|
label: F.label,
|
|
11669
11678
|
onSelect: () => {
|
|
11670
|
-
N(F.value),
|
|
11679
|
+
N(F.value), H(
|
|
11671
11680
|
F.value === "free" ? void 0 : F.value
|
|
11672
11681
|
);
|
|
11673
11682
|
}
|
|
@@ -11683,7 +11692,7 @@ const sf = (t) => {
|
|
|
11683
11692
|
Fe,
|
|
11684
11693
|
{
|
|
11685
11694
|
onClick: () => {
|
|
11686
|
-
N(F.value),
|
|
11695
|
+
N(F.value), H(
|
|
11687
11696
|
F.value === "free" ? void 0 : F.value
|
|
11688
11697
|
);
|
|
11689
11698
|
},
|
|
@@ -11693,7 +11702,7 @@ const sf = (t) => {
|
|
|
11693
11702
|
)) })
|
|
11694
11703
|
] }),
|
|
11695
11704
|
/* @__PURE__ */ e.jsxs(
|
|
11696
|
-
|
|
11705
|
+
q,
|
|
11697
11706
|
{
|
|
11698
11707
|
variant: "ghost",
|
|
11699
11708
|
size: "sm",
|
|
@@ -11708,15 +11717,15 @@ const sf = (t) => {
|
|
|
11708
11717
|
}
|
|
11709
11718
|
),
|
|
11710
11719
|
/* @__PURE__ */ e.jsxs(
|
|
11711
|
-
|
|
11720
|
+
q,
|
|
11712
11721
|
{
|
|
11713
11722
|
variant: "ghost",
|
|
11714
11723
|
size: "sm",
|
|
11715
11724
|
type: "button",
|
|
11716
11725
|
onClick: () => {
|
|
11717
11726
|
O((F) => {
|
|
11718
|
-
const
|
|
11719
|
-
return
|
|
11727
|
+
const R = F + 90;
|
|
11728
|
+
return R > Vu ? R - 360 : R < Ku ? R + 360 : R;
|
|
11720
11729
|
});
|
|
11721
11730
|
},
|
|
11722
11731
|
"aria-label": "Rotate 90deg",
|
|
@@ -11729,7 +11738,7 @@ const sf = (t) => {
|
|
|
11729
11738
|
),
|
|
11730
11739
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
11731
11740
|
/* @__PURE__ */ e.jsx(
|
|
11732
|
-
|
|
11741
|
+
q,
|
|
11733
11742
|
{
|
|
11734
11743
|
variant: "ghost",
|
|
11735
11744
|
size: "icon",
|
|
@@ -11741,7 +11750,7 @@ const sf = (t) => {
|
|
|
11741
11750
|
}
|
|
11742
11751
|
),
|
|
11743
11752
|
/* @__PURE__ */ e.jsx(
|
|
11744
|
-
|
|
11753
|
+
Hn,
|
|
11745
11754
|
{
|
|
11746
11755
|
min: 0.5,
|
|
11747
11756
|
max: 2,
|
|
@@ -11755,7 +11764,7 @@ const sf = (t) => {
|
|
|
11755
11764
|
}
|
|
11756
11765
|
),
|
|
11757
11766
|
/* @__PURE__ */ e.jsx(
|
|
11758
|
-
|
|
11767
|
+
q,
|
|
11759
11768
|
{
|
|
11760
11769
|
variant: "ghost",
|
|
11761
11770
|
size: "icon",
|
|
@@ -11790,14 +11799,14 @@ const sf = (t) => {
|
|
|
11790
11799
|
children: /* @__PURE__ */ e.jsx(
|
|
11791
11800
|
"div",
|
|
11792
11801
|
{
|
|
11793
|
-
ref:
|
|
11802
|
+
ref: L,
|
|
11794
11803
|
className: "image-crop-modal-crop [&_.ReactCrop__crop-selection]:border-contrast [&_.ReactCrop__rule]:border-border flex w-full items-center justify-center [&_.ReactCrop__crop-selection]:border-2 [&_.ReactCrop__crop-selection]:border-dashed [&_.ReactCrop__crop-selection]:shadow-[0_0_0_9999px_rgba(0,0,0,0.4)]",
|
|
11795
11804
|
children: /* @__PURE__ */ e.jsx(
|
|
11796
11805
|
Bu,
|
|
11797
11806
|
{
|
|
11798
11807
|
crop: f,
|
|
11799
|
-
onChange: (F,
|
|
11800
|
-
g(
|
|
11808
|
+
onChange: (F, R) => {
|
|
11809
|
+
g(R), _(F), S(!0);
|
|
11801
11810
|
},
|
|
11802
11811
|
onComplete: (F) => _(F),
|
|
11803
11812
|
aspect: I,
|
|
@@ -11833,7 +11842,7 @@ const sf = (t) => {
|
|
|
11833
11842
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", "aria-hidden": !0, children: $ ? `${$.width} x ${$.height} px · ${z}deg` : `${z}deg` }) }),
|
|
11834
11843
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
|
|
11835
11844
|
/* @__PURE__ */ e.jsx(
|
|
11836
|
-
|
|
11845
|
+
q,
|
|
11837
11846
|
{
|
|
11838
11847
|
variant: "ghost",
|
|
11839
11848
|
size: "sm",
|
|
@@ -11844,7 +11853,7 @@ const sf = (t) => {
|
|
|
11844
11853
|
}
|
|
11845
11854
|
),
|
|
11846
11855
|
/* @__PURE__ */ e.jsx(
|
|
11847
|
-
|
|
11856
|
+
q,
|
|
11848
11857
|
{
|
|
11849
11858
|
variant: "ghost",
|
|
11850
11859
|
size: "sm",
|
|
@@ -11855,7 +11864,7 @@ const sf = (t) => {
|
|
|
11855
11864
|
}
|
|
11856
11865
|
),
|
|
11857
11866
|
/* @__PURE__ */ e.jsx(
|
|
11858
|
-
|
|
11867
|
+
q,
|
|
11859
11868
|
{
|
|
11860
11869
|
variant: "default",
|
|
11861
11870
|
size: "sm",
|
|
@@ -11894,8 +11903,8 @@ const mf = ({
|
|
|
11894
11903
|
"image/heif",
|
|
11895
11904
|
"image/svg+xml"
|
|
11896
11905
|
], S = (D) => {
|
|
11897
|
-
const
|
|
11898
|
-
return
|
|
11906
|
+
const L = ga(D);
|
|
11907
|
+
return L.startsWith("image/") && !M.includes(L);
|
|
11899
11908
|
}, K = A.filter(S), W = A.filter((D) => !S(D));
|
|
11900
11909
|
if (K.length === 1 && !i)
|
|
11901
11910
|
j(W), w(K[0] || null), x(!0);
|
|
@@ -11953,7 +11962,7 @@ const mf = ({
|
|
|
11953
11962
|
/* @__PURE__ */ e.jsx("div", { className: "text-center", children: /* @__PURE__ */ e.jsx("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100 group-hover:bg-blue-200", children: /* @__PURE__ */ e.jsx(uc, { className: "h-10 w-10 text-gray-600 group-hover:text-blue-500" }) }) }),
|
|
11954
11963
|
/* @__PURE__ */ e.jsx("p", { className: "text-center text-xs text-gray-500", children: "50MB for Images and Documents. 2GB for Videos." }),
|
|
11955
11964
|
/* @__PURE__ */ e.jsx(
|
|
11956
|
-
|
|
11965
|
+
q,
|
|
11957
11966
|
{
|
|
11958
11967
|
variant: "default",
|
|
11959
11968
|
disabled: m,
|
|
@@ -12014,7 +12023,7 @@ const mf = ({
|
|
|
12014
12023
|
)) }),
|
|
12015
12024
|
a && /* @__PURE__ */ e.jsx("div", { className: "mx-auto flex w-full items-center justify-between px-4 md:w-1/2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
12016
12025
|
/* @__PURE__ */ e.jsx(
|
|
12017
|
-
|
|
12026
|
+
qs,
|
|
12018
12027
|
{
|
|
12019
12028
|
checked: r,
|
|
12020
12029
|
onCheckedChange: n,
|
|
@@ -12079,19 +12088,19 @@ const mf = ({
|
|
|
12079
12088
|
onDamSearchChange: K,
|
|
12080
12089
|
mediaSearchQuery: W,
|
|
12081
12090
|
onMediaSearchChange: D,
|
|
12082
|
-
unsplashSearchQuery:
|
|
12091
|
+
unsplashSearchQuery: L,
|
|
12083
12092
|
onUnsplashSearchChange: T,
|
|
12084
12093
|
onUnsplashSearchingChange: I,
|
|
12085
12094
|
onUnsplashUploadingChange: $,
|
|
12086
12095
|
thumbnailSize: se = 100,
|
|
12087
12096
|
viewMode: G = "grid",
|
|
12088
|
-
showNamesOnMedia:
|
|
12097
|
+
showNamesOnMedia: H = !0,
|
|
12089
12098
|
onDamFoldersChange: B,
|
|
12090
12099
|
previewContainer: he,
|
|
12091
12100
|
previewMedia: we,
|
|
12092
12101
|
onPreviewMediaChange: _e,
|
|
12093
12102
|
previewAsset: F,
|
|
12094
|
-
onPreviewAssetChange:
|
|
12103
|
+
onPreviewAssetChange: R,
|
|
12095
12104
|
uploadSelectionCount: Y
|
|
12096
12105
|
}) => {
|
|
12097
12106
|
const Z = ue.useMemo(
|
|
@@ -12143,10 +12152,10 @@ const mf = ({
|
|
|
12143
12152
|
onSearchChange: K,
|
|
12144
12153
|
thumbnailSize: se,
|
|
12145
12154
|
viewMode: G,
|
|
12146
|
-
showNamesOnMedia:
|
|
12155
|
+
showNamesOnMedia: H,
|
|
12147
12156
|
previewContainer: he,
|
|
12148
12157
|
previewAsset: F,
|
|
12149
|
-
onPreviewAssetChange:
|
|
12158
|
+
onPreviewAssetChange: R
|
|
12150
12159
|
}
|
|
12151
12160
|
),
|
|
12152
12161
|
t === "media" && /* @__PURE__ */ e.jsx(
|
|
@@ -12163,7 +12172,7 @@ const mf = ({
|
|
|
12163
12172
|
onSearchChange: D,
|
|
12164
12173
|
thumbnailSize: se,
|
|
12165
12174
|
viewMode: G,
|
|
12166
|
-
showNamesOnMedia:
|
|
12175
|
+
showNamesOnMedia: H,
|
|
12167
12176
|
mediaTypeFilter: a,
|
|
12168
12177
|
sortOption: r,
|
|
12169
12178
|
previewContainer: he,
|
|
@@ -12183,7 +12192,7 @@ const mf = ({
|
|
|
12183
12192
|
onSelectionCountChange: w,
|
|
12184
12193
|
thumbnailSize: se,
|
|
12185
12194
|
viewMode: G,
|
|
12186
|
-
showNamesOnMedia:
|
|
12195
|
+
showNamesOnMedia: H
|
|
12187
12196
|
}
|
|
12188
12197
|
),
|
|
12189
12198
|
t === "products" && /* @__PURE__ */ e.jsx(
|
|
@@ -12198,7 +12207,7 @@ const mf = ({
|
|
|
12198
12207
|
onSelectionCountChange: C,
|
|
12199
12208
|
thumbnailSize: se,
|
|
12200
12209
|
viewMode: G,
|
|
12201
|
-
showNamesOnMedia:
|
|
12210
|
+
showNamesOnMedia: H
|
|
12202
12211
|
}
|
|
12203
12212
|
),
|
|
12204
12213
|
t === "enrollment_packs" && /* @__PURE__ */ e.jsx(
|
|
@@ -12213,7 +12222,7 @@ const mf = ({
|
|
|
12213
12222
|
onSelectionCountChange: U,
|
|
12214
12223
|
thumbnailSize: se,
|
|
12215
12224
|
viewMode: G,
|
|
12216
|
-
showNamesOnMedia:
|
|
12225
|
+
showNamesOnMedia: H
|
|
12217
12226
|
}
|
|
12218
12227
|
),
|
|
12219
12228
|
t === "unsplash" && /* @__PURE__ */ e.jsx(
|
|
@@ -12221,7 +12230,7 @@ const mf = ({
|
|
|
12221
12230
|
{
|
|
12222
12231
|
config: s,
|
|
12223
12232
|
onFileSelected: i,
|
|
12224
|
-
searchQuery:
|
|
12233
|
+
searchQuery: L,
|
|
12225
12234
|
onSearchQueryChange: T,
|
|
12226
12235
|
onSearchingChange: I,
|
|
12227
12236
|
onUploadingChange: $
|
|
@@ -12365,7 +12374,7 @@ const mf = ({
|
|
|
12365
12374
|
] }),
|
|
12366
12375
|
/* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
12367
12376
|
h ? /* @__PURE__ */ e.jsx(
|
|
12368
|
-
|
|
12377
|
+
q,
|
|
12369
12378
|
{
|
|
12370
12379
|
variant: "ghost",
|
|
12371
12380
|
size: "icon",
|
|
@@ -12476,8 +12485,8 @@ const mf = ({
|
|
|
12476
12485
|
}
|
|
12477
12486
|
),
|
|
12478
12487
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-2 border-t border-gray-200 p-4", children: [
|
|
12479
|
-
/* @__PURE__ */ e.jsx(
|
|
12480
|
-
/* @__PURE__ */ e.jsx(
|
|
12488
|
+
/* @__PURE__ */ e.jsx(q, { variant: "secondary", size: "sm", onClick: a, children: "Clear" }),
|
|
12489
|
+
/* @__PURE__ */ e.jsx(q, { variant: "default", size: "sm", onClick: r, children: n ? "Next" : `Use ${t.length} File${t.length !== 1 ? "s" : ""}` })
|
|
12481
12490
|
] }),
|
|
12482
12491
|
_ && /* @__PURE__ */ e.jsx(
|
|
12483
12492
|
fl,
|
|
@@ -12523,7 +12532,7 @@ const mf = ({
|
|
|
12523
12532
|
children: /* @__PURE__ */ e.jsxs(yr, { children: [
|
|
12524
12533
|
/* @__PURE__ */ e.jsx(br, { className: "z-9999 bg-black/70 backdrop-blur-none" }),
|
|
12525
12534
|
/* @__PURE__ */ e.jsxs(
|
|
12526
|
-
|
|
12535
|
+
qn,
|
|
12527
12536
|
{
|
|
12528
12537
|
className: "fixed top-1/2 left-1/2 z-10000 max-h-[80vh] w-full max-w-3xl -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xl",
|
|
12529
12538
|
style: { zIndex: 1e4 },
|
|
@@ -12583,7 +12592,7 @@ const mf = ({
|
|
|
12583
12592
|
E?.id
|
|
12584
12593
|
)) }) }),
|
|
12585
12594
|
/* @__PURE__ */ e.jsx("div", { className: "border-t bg-gray-50 p-6", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
12586
|
-
|
|
12595
|
+
q,
|
|
12587
12596
|
{
|
|
12588
12597
|
variant: "secondary",
|
|
12589
12598
|
onClick: () => C(null),
|
|
@@ -12624,15 +12633,15 @@ const mf = ({
|
|
|
12624
12633
|
[]
|
|
12625
12634
|
), [x, _] = o.useState(0), [w, b] = o.useState(
|
|
12626
12635
|
[]
|
|
12627
|
-
), [j, v] = o.useState({}), [C, N] = o.useState(""), [z, O] = o.useState(!1), [U, E] = o.useState(""), [P, A] = o.useState(""), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D,
|
|
12636
|
+
), [j, v] = o.useState({}), [C, N] = o.useState(""), [z, O] = o.useState(!1), [U, E] = o.useState(""), [P, A] = o.useState(""), [M, S] = o.useState(!1), [K, W] = o.useState(!1), [D, L] = o.useState(0), [T, I] = o.useState(zs), [$, se] = o.useState(
|
|
12628
12637
|
void 0
|
|
12629
|
-
), [G,
|
|
12638
|
+
), [G, H] = o.useState([]), [B, he] = o.useState([]), [we, _e] = o.useState([]), [F, R] = o.useState([]), [Y, Z] = o.useState(
|
|
12630
12639
|
[]
|
|
12631
|
-
), [J, me] = o.useState(0), [k, oe] = o.useState([]), [ye, fe] = o.useState([]), [X, le] = o.useState(0), [We, Be] = o.useState([]), [tt, Qe] = o.useState([]), [Pt, V] = o.useState(0), [ae, pe] = o.useState([]), ge = o.useRef(null), [
|
|
12632
|
-
p(m), g([]), _(0), b([]), v({}), N(""), E(""), A(""), S(!1), W(!1),
|
|
12640
|
+
), [J, me] = o.useState(0), [k, oe] = o.useState([]), [ye, fe] = o.useState([]), [X, le] = o.useState(0), [We, Be] = o.useState([]), [tt, Qe] = o.useState([]), [Pt, V] = o.useState(0), [ae, pe] = o.useState([]), ge = o.useRef(null), [Re, Ue] = o.useState(null), [Qt, vt] = o.useState(null), [Tt, st] = o.useState(100), [at, Yt] = o.useState("grid"), [$t, La] = o.useState(!0), Ut = o.useCallback(() => {
|
|
12641
|
+
p(m), g([]), _(0), b([]), v({}), N(""), E(""), A(""), S(!1), W(!1), L(0), he([]), _e([]), R([]), Z([]), me(0), oe([]), fe([]), le(0), Be([]), Qe([]), V(0), pe([]), I(zs), se(void 0), ge.current?.clearSelection?.(), vt(null);
|
|
12633
12642
|
}, [m]), Xt = o.useCallback(
|
|
12634
12643
|
(ee) => {
|
|
12635
|
-
c.unifiedSelection || (g([]), _(0), b([]), v({}), N(""), A(""), S(!1), W(!1),
|
|
12644
|
+
c.unifiedSelection || (g([]), _(0), b([]), v({}), N(""), A(""), S(!1), W(!1), L(0), he([]), _e([]), R([]), Z([]), me(0), oe([]), fe([]), le(0), Be([]), Qe([]), V(0), ge.current?.clearSelection?.()), p(ee);
|
|
12636
12645
|
},
|
|
12637
12646
|
[c.unifiedSelection]
|
|
12638
12647
|
), ws = o.useCallback(
|
|
@@ -12650,7 +12659,7 @@ const mf = ({
|
|
|
12650
12659
|
});
|
|
12651
12660
|
},
|
|
12652
12661
|
[c.maxFiles]
|
|
12653
|
-
),
|
|
12662
|
+
), qt = o.useCallback(
|
|
12654
12663
|
(ee) => {
|
|
12655
12664
|
const ce = ee.filter(
|
|
12656
12665
|
(de) => de.upload_status !== "error"
|
|
@@ -12658,7 +12667,7 @@ const mf = ({
|
|
|
12658
12667
|
ce.length !== 0 && (s(ce), a?.());
|
|
12659
12668
|
},
|
|
12660
12669
|
[s, a]
|
|
12661
|
-
),
|
|
12670
|
+
), Ra = o.useCallback(
|
|
12662
12671
|
(ee) => {
|
|
12663
12672
|
ws([ee]);
|
|
12664
12673
|
},
|
|
@@ -12669,8 +12678,8 @@ const mf = ({
|
|
|
12669
12678
|
},
|
|
12670
12679
|
[]
|
|
12671
12680
|
), Me = o.useCallback((ee) => {
|
|
12672
|
-
|
|
12673
|
-
}, []),
|
|
12681
|
+
L(ee);
|
|
12682
|
+
}, []), Ht = o.useCallback((ee) => {
|
|
12674
12683
|
_e(ee);
|
|
12675
12684
|
}, []), Oa = o.useCallback((ee) => {
|
|
12676
12685
|
st(ee);
|
|
@@ -12706,7 +12715,7 @@ const mf = ({
|
|
|
12706
12715
|
{
|
|
12707
12716
|
id: "products",
|
|
12708
12717
|
label: "Products",
|
|
12709
|
-
icon:
|
|
12718
|
+
icon: Hs,
|
|
12710
12719
|
description: "Choose from existing products"
|
|
12711
12720
|
},
|
|
12712
12721
|
{
|
|
@@ -12718,7 +12727,7 @@ const mf = ({
|
|
|
12718
12727
|
{
|
|
12719
12728
|
id: "upload",
|
|
12720
12729
|
label: "Local Files",
|
|
12721
|
-
icon:
|
|
12730
|
+
icon: Lc,
|
|
12722
12731
|
description: "Upload files from computer or URL"
|
|
12723
12732
|
},
|
|
12724
12733
|
{
|
|
@@ -12827,7 +12836,7 @@ const mf = ({
|
|
|
12827
12836
|
viewMode: at,
|
|
12828
12837
|
onViewModeChange: Xs,
|
|
12829
12838
|
showNamesOnMedia: $t,
|
|
12830
|
-
onShowNamesOnMediaChange:
|
|
12839
|
+
onShowNamesOnMediaChange: La,
|
|
12831
12840
|
hasSelectedFiles: x > 0,
|
|
12832
12841
|
damFolders: G,
|
|
12833
12842
|
onAddToNewFolder: () => ge.current?.openAddFolderModal(),
|
|
@@ -12852,16 +12861,16 @@ const mf = ({
|
|
|
12852
12861
|
damTypeFilter: T.type ? T.type : void 0,
|
|
12853
12862
|
sortOption: $,
|
|
12854
12863
|
onFilesSelected: ws,
|
|
12855
|
-
onUploadConfirmAndMaybeCreate:
|
|
12856
|
-
onSingleFileSelected:
|
|
12864
|
+
onUploadConfirmAndMaybeCreate: qt,
|
|
12865
|
+
onSingleFileSelected: Ra,
|
|
12857
12866
|
damLibraryRef: ge,
|
|
12858
12867
|
onDamConfirmAndMaybeCreate: Ns,
|
|
12859
12868
|
selectedMediaIds: B,
|
|
12860
12869
|
onMediaIdsChange: he,
|
|
12861
12870
|
onMediaSelectionChange: Me,
|
|
12862
|
-
onMediaDataChange:
|
|
12871
|
+
onMediaDataChange: Ht,
|
|
12863
12872
|
selectedPageIds: F,
|
|
12864
|
-
onPageIdsChange:
|
|
12873
|
+
onPageIdsChange: R,
|
|
12865
12874
|
onPageSelectionChange: me,
|
|
12866
12875
|
onPageDataChange: Z,
|
|
12867
12876
|
selectedProductIds: k,
|
|
@@ -12886,8 +12895,8 @@ const mf = ({
|
|
|
12886
12895
|
thumbnailSize: Tt,
|
|
12887
12896
|
viewMode: at,
|
|
12888
12897
|
showNamesOnMedia: $t,
|
|
12889
|
-
onDamFoldersChange:
|
|
12890
|
-
previewContainer:
|
|
12898
|
+
onDamFoldersChange: H,
|
|
12899
|
+
previewContainer: Re,
|
|
12891
12900
|
previewAsset: Qt,
|
|
12892
12901
|
onPreviewAssetChange: vt,
|
|
12893
12902
|
uploadSelectionCount: h === "upload" || h === "url" || h === "unsplash" ? f.length : void 0
|
|
@@ -12930,7 +12939,7 @@ const mf = ({
|
|
|
12930
12939
|
));
|
|
12931
12940
|
},
|
|
12932
12941
|
onClear: () => {
|
|
12933
|
-
he([]), _e([]),
|
|
12942
|
+
he([]), _e([]), L(0);
|
|
12934
12943
|
},
|
|
12935
12944
|
onConfirm: () => {
|
|
12936
12945
|
s(we), a?.();
|
|
@@ -12945,14 +12954,14 @@ const mf = ({
|
|
|
12945
12954
|
selectedFiles: Y,
|
|
12946
12955
|
onRemoveFile: (ee) => {
|
|
12947
12956
|
const ce = parseInt(ee.replace(/^page_/, ""), 10);
|
|
12948
|
-
Number.isNaN(ce) || (
|
|
12957
|
+
Number.isNaN(ce) || (R(
|
|
12949
12958
|
(de) => de.filter((Te) => Te !== ce)
|
|
12950
12959
|
), Z(
|
|
12951
12960
|
(de) => de.filter((Te) => Te.asset_code !== ee)
|
|
12952
12961
|
));
|
|
12953
12962
|
},
|
|
12954
12963
|
onClear: () => {
|
|
12955
|
-
|
|
12964
|
+
R([]), Z([]), me(0);
|
|
12956
12965
|
},
|
|
12957
12966
|
onConfirm: () => {
|
|
12958
12967
|
s(Y), a?.();
|
|
@@ -13021,7 +13030,7 @@ const mf = ({
|
|
|
13021
13030
|
g([]);
|
|
13022
13031
|
},
|
|
13023
13032
|
onConfirm: () => {
|
|
13024
|
-
|
|
13033
|
+
qt(f);
|
|
13025
13034
|
},
|
|
13026
13035
|
isVisible: f.length > 0,
|
|
13027
13036
|
hasVariants: () => !1
|
|
@@ -13135,7 +13144,7 @@ function gl(t) {
|
|
|
13135
13144
|
n(!1);
|
|
13136
13145
|
}, [t]), { meta: s, fileName: i, handleLoad: l, handleError: u, loadError: r };
|
|
13137
13146
|
}
|
|
13138
|
-
function
|
|
13147
|
+
function Rr({
|
|
13139
13148
|
value: t,
|
|
13140
13149
|
onChange: s,
|
|
13141
13150
|
placeholder: a,
|
|
@@ -13244,7 +13253,7 @@ function Lr({
|
|
|
13244
13253
|
l?.isActive({ textAlign: "center" }) ? c : d
|
|
13245
13254
|
),
|
|
13246
13255
|
title: i("editor_align_center"),
|
|
13247
|
-
children: /* @__PURE__ */ e.jsx(
|
|
13256
|
+
children: /* @__PURE__ */ e.jsx(Lo, { className: "size-3.5" })
|
|
13248
13257
|
}
|
|
13249
13258
|
),
|
|
13250
13259
|
/* @__PURE__ */ e.jsx(
|
|
@@ -13257,7 +13266,7 @@ function Lr({
|
|
|
13257
13266
|
l?.isActive({ textAlign: "right" }) ? c : d
|
|
13258
13267
|
),
|
|
13259
13268
|
title: i("editor_align_right"),
|
|
13260
|
-
children: /* @__PURE__ */ e.jsx(
|
|
13269
|
+
children: /* @__PURE__ */ e.jsx(Ro, { className: "size-3.5" })
|
|
13261
13270
|
}
|
|
13262
13271
|
),
|
|
13263
13272
|
/* @__PURE__ */ e.jsx(
|
|
@@ -13357,7 +13366,7 @@ function Mn({
|
|
|
13357
13366
|
className: "size-10 shrink-0 rounded object-cover",
|
|
13358
13367
|
onError: () => n(!0)
|
|
13359
13368
|
}
|
|
13360
|
-
) : /* @__PURE__ */ e.jsx("div", { className: "flex size-10 shrink-0 items-center justify-center rounded bg-gray-100", children: /* @__PURE__ */ e.jsx(
|
|
13369
|
+
) : /* @__PURE__ */ e.jsx("div", { className: "flex size-10 shrink-0 items-center justify-center rounded bg-gray-100", children: /* @__PURE__ */ e.jsx(Hs, { className: "size-5 text-gray-400" }) });
|
|
13361
13370
|
}
|
|
13362
13371
|
function ff({
|
|
13363
13372
|
products: t,
|
|
@@ -13443,7 +13452,7 @@ function ff({
|
|
|
13443
13452
|
O(null);
|
|
13444
13453
|
}
|
|
13445
13454
|
}
|
|
13446
|
-
async function
|
|
13455
|
+
async function L(T) {
|
|
13447
13456
|
N(T);
|
|
13448
13457
|
try {
|
|
13449
13458
|
await a(T);
|
|
@@ -13464,7 +13473,7 @@ function ff({
|
|
|
13464
13473
|
/* @__PURE__ */ e.jsxs("div", { className: "rounded-lg border border-dashed border-gray-200 p-4 text-center", children: [
|
|
13465
13474
|
/* @__PURE__ */ e.jsx("p", { className: "mb-3 text-sm text-gray-500", children: l("media_no_products_tagged") }),
|
|
13466
13475
|
!n && /* @__PURE__ */ e.jsxs(
|
|
13467
|
-
|
|
13476
|
+
q,
|
|
13468
13477
|
{
|
|
13469
13478
|
type: "button",
|
|
13470
13479
|
onClick: W,
|
|
@@ -13484,7 +13493,7 @@ function ff({
|
|
|
13484
13493
|
max: String(i)
|
|
13485
13494
|
}) }),
|
|
13486
13495
|
!n && !M && /* @__PURE__ */ e.jsxs(
|
|
13487
|
-
|
|
13496
|
+
q,
|
|
13488
13497
|
{
|
|
13489
13498
|
type: "button",
|
|
13490
13499
|
onClick: W,
|
|
@@ -13520,12 +13529,12 @@ function ff({
|
|
|
13520
13529
|
] })
|
|
13521
13530
|
] }),
|
|
13522
13531
|
!n && /* @__PURE__ */ e.jsx(
|
|
13523
|
-
|
|
13532
|
+
q,
|
|
13524
13533
|
{
|
|
13525
13534
|
type: "button",
|
|
13526
13535
|
variant: "outline",
|
|
13527
13536
|
size: "sm",
|
|
13528
|
-
onClick: () => void
|
|
13537
|
+
onClick: () => void L(T.id),
|
|
13529
13538
|
disabled: C === T.id,
|
|
13530
13539
|
className: "text-xs text-red-600 hover:bg-red-50 hover:text-red-700",
|
|
13531
13540
|
children: C === T.id ? l("common_removing") : l("common_remove")
|
|
@@ -13596,7 +13605,7 @@ function ff({
|
|
|
13596
13605
|
] })
|
|
13597
13606
|
] }),
|
|
13598
13607
|
/* @__PURE__ */ e.jsx(
|
|
13599
|
-
|
|
13608
|
+
q,
|
|
13600
13609
|
{
|
|
13601
13610
|
type: "button",
|
|
13602
13611
|
variant: I ? "ghost" : "outline",
|
|
@@ -13624,7 +13633,7 @@ function ff({
|
|
|
13624
13633
|
)
|
|
13625
13634
|
] }) }),
|
|
13626
13635
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-end pt-2", children: /* @__PURE__ */ e.jsx(
|
|
13627
|
-
|
|
13636
|
+
q,
|
|
13628
13637
|
{
|
|
13629
13638
|
type: "button",
|
|
13630
13639
|
variant: "outline",
|
|
@@ -13693,7 +13702,7 @@ function _l({
|
|
|
13693
13702
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-5", children: [
|
|
13694
13703
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between border-b border-gray-200 pb-4", children: [
|
|
13695
13704
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium text-gray-700", children: u("cta_enable_toggle_label") }),
|
|
13696
|
-
/* @__PURE__ */ e.jsx(
|
|
13705
|
+
/* @__PURE__ */ e.jsx(qs, { checked: m, onCheckedChange: b })
|
|
13697
13706
|
] }),
|
|
13698
13707
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 items-start gap-4", children: [
|
|
13699
13708
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
@@ -13774,8 +13783,8 @@ function _l({
|
|
|
13774
13783
|
] })
|
|
13775
13784
|
] }),
|
|
13776
13785
|
/* @__PURE__ */ e.jsxs("div", { className: "-mx-6 -mb-6 flex items-center justify-end gap-3 rounded-b-lg border-t border-gray-200 bg-gray-50 px-6 py-4", children: [
|
|
13777
|
-
/* @__PURE__ */ e.jsx(
|
|
13778
|
-
/* @__PURE__ */ e.jsx(
|
|
13786
|
+
/* @__PURE__ */ e.jsx(q, { variant: "outline", onClick: j, children: u("common_cancel") }),
|
|
13787
|
+
/* @__PURE__ */ e.jsx(q, { onClick: v, children: u("common_done") })
|
|
13779
13788
|
] })
|
|
13780
13789
|
]
|
|
13781
13790
|
}
|
|
@@ -13803,20 +13812,20 @@ function gf({
|
|
|
13803
13812
|
}, []), z = o.useCallback((W) => {
|
|
13804
13813
|
const D = b.current;
|
|
13805
13814
|
if (!D) return;
|
|
13806
|
-
const
|
|
13807
|
-
D.currentTime =
|
|
13815
|
+
const L = Number(W.target.value);
|
|
13816
|
+
D.currentTime = L, f(L), D.paused || (D.pause(), h(!1));
|
|
13808
13817
|
}, []), O = o.useCallback(() => {
|
|
13809
13818
|
const W = b.current, D = j.current;
|
|
13810
13819
|
if (!(!W || !D)) {
|
|
13811
13820
|
w(!0);
|
|
13812
13821
|
try {
|
|
13813
13822
|
D.width = W.videoWidth, D.height = W.videoHeight;
|
|
13814
|
-
const
|
|
13815
|
-
if (!
|
|
13823
|
+
const L = D.getContext("2d");
|
|
13824
|
+
if (!L) {
|
|
13816
13825
|
w(!1);
|
|
13817
13826
|
return;
|
|
13818
13827
|
}
|
|
13819
|
-
|
|
13828
|
+
L.drawImage(W, 0, 0, D.width, D.height), D.toBlob(
|
|
13820
13829
|
(T) => {
|
|
13821
13830
|
T ? (a(T), d(!1)) : u({
|
|
13822
13831
|
title: i("media_frame_capture_error"),
|
|
@@ -13826,11 +13835,11 @@ function gf({
|
|
|
13826
13835
|
"image/jpeg",
|
|
13827
13836
|
0.92
|
|
13828
13837
|
);
|
|
13829
|
-
} catch (
|
|
13838
|
+
} catch (L) {
|
|
13830
13839
|
u({
|
|
13831
13840
|
title: i("media_frame_capture_error"),
|
|
13832
13841
|
type: "error",
|
|
13833
|
-
error:
|
|
13842
|
+
error: L
|
|
13834
13843
|
}), w(!1);
|
|
13835
13844
|
}
|
|
13836
13845
|
}
|
|
@@ -13868,7 +13877,7 @@ function gf({
|
|
|
13868
13877
|
P?.size && /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-xs", children: P.size }),
|
|
13869
13878
|
!n && /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-col items-start gap-2", children: [
|
|
13870
13879
|
/* @__PURE__ */ e.jsxs(
|
|
13871
|
-
|
|
13880
|
+
q,
|
|
13872
13881
|
{
|
|
13873
13882
|
variant: "outline",
|
|
13874
13883
|
size: "sm",
|
|
@@ -13881,7 +13890,7 @@ function gf({
|
|
|
13881
13890
|
}
|
|
13882
13891
|
),
|
|
13883
13892
|
r && /* @__PURE__ */ e.jsxs(
|
|
13884
|
-
|
|
13893
|
+
q,
|
|
13885
13894
|
{
|
|
13886
13895
|
variant: "outline",
|
|
13887
13896
|
size: "sm",
|
|
@@ -13900,7 +13909,7 @@ function gf({
|
|
|
13900
13909
|
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
13901
13910
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: i("media_no_thumbnail") }),
|
|
13902
13911
|
!n && /* @__PURE__ */ e.jsx("div", { className: "mt-2", children: /* @__PURE__ */ e.jsxs(
|
|
13903
|
-
|
|
13912
|
+
q,
|
|
13904
13913
|
{
|
|
13905
13914
|
variant: "outline",
|
|
13906
13915
|
size: "sm",
|
|
@@ -13970,7 +13979,7 @@ function gf({
|
|
|
13970
13979
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground w-12 text-right text-xs", children: Fn(g) })
|
|
13971
13980
|
] }),
|
|
13972
13981
|
/* @__PURE__ */ e.jsxs(
|
|
13973
|
-
|
|
13982
|
+
q,
|
|
13974
13983
|
{
|
|
13975
13984
|
onClick: O,
|
|
13976
13985
|
disabled: !E || _,
|
|
@@ -14037,7 +14046,7 @@ function xf({
|
|
|
14037
14046
|
] }),
|
|
14038
14047
|
r?.size && /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-xs", children: r.size }),
|
|
14039
14048
|
/* @__PURE__ */ e.jsx("div", { className: "mt-2", children: /* @__PURE__ */ e.jsxs(
|
|
14040
|
-
|
|
14049
|
+
q,
|
|
14041
14050
|
{
|
|
14042
14051
|
variant: "outline",
|
|
14043
14052
|
size: "sm",
|
|
@@ -14112,29 +14121,29 @@ function bf({
|
|
|
14112
14121
|
seoTitle: "",
|
|
14113
14122
|
seoDescription: "",
|
|
14114
14123
|
blockCrawler: !1
|
|
14115
|
-
}), [b, j] = o.useState(null), [v, C] = o.useState(null), [N, z] = o.useState(!1), [O, U] = o.useState(!1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), [S, K] = o.useState(!1), [W, D] = o.useState(!1), [
|
|
14124
|
+
}), [b, j] = o.useState(null), [v, C] = o.useState(null), [N, z] = o.useState(!1), [O, U] = o.useState(!1), [E, P] = o.useState(!1), [A, M] = o.useState(!1), [S, K] = o.useState(!1), [W, D] = o.useState(!1), [L, T] = o.useState(null), [I, $] = o.useState(null), { data: se, isLoading: G } = Ve({
|
|
14116
14125
|
queryKey: Ne.media.detail(Number(t), u, n),
|
|
14117
14126
|
queryFn: () => l.media.getMediaById(Number(t), n)
|
|
14118
|
-
}),
|
|
14127
|
+
}), H = se?.media, { data: B, refetch: he } = Ve({
|
|
14119
14128
|
queryKey: Ne.mediaProducts.list(Number(t), n),
|
|
14120
14129
|
queryFn: () => f?.listMediaProducts(Number(t), {
|
|
14121
14130
|
language_iso: n
|
|
14122
14131
|
}),
|
|
14123
14132
|
enabled: !!f
|
|
14124
|
-
}), we = B?.media_products ?? [], _e = o.useMemo(() =>
|
|
14133
|
+
}), we = B?.media_products ?? [], _e = o.useMemo(() => L || I ? !0 : b ? _.title !== b.title || _.description !== b.description || _.active !== b.active || _.ctaEnabled !== b.ctaEnabled || _.ctaType !== b.ctaType || _.ctaButtonText !== b.ctaButtonText || _.ctaUrl !== b.ctaUrl || _.seoTitle !== b.seoTitle || _.seoDescription !== b.seoDescription || _.blockCrawler !== b.blockCrawler : !1, [_, b, L, I]), F = o.useRef(!1);
|
|
14125
14134
|
F.current = _e, o.useEffect(() => {
|
|
14126
|
-
if (!
|
|
14127
|
-
const X = _f(
|
|
14135
|
+
if (!H || F.current) return;
|
|
14136
|
+
const X = _f(H);
|
|
14128
14137
|
w(X), j(X), C(n);
|
|
14129
|
-
}, [
|
|
14130
|
-
const { mutate:
|
|
14138
|
+
}, [H, n]);
|
|
14139
|
+
const { mutate: R, isPending: Y } = ze({
|
|
14131
14140
|
mutationFn: () => l.media.updateMedia(
|
|
14132
14141
|
Number(t),
|
|
14133
14142
|
{
|
|
14134
14143
|
title: _.title,
|
|
14135
14144
|
description: _.description,
|
|
14136
14145
|
active: _.active,
|
|
14137
|
-
...
|
|
14146
|
+
...L ? da(L) : {},
|
|
14138
14147
|
...I ? { thumbnail_url: I } : {},
|
|
14139
14148
|
settings: {
|
|
14140
14149
|
cta: {
|
|
@@ -14177,8 +14186,8 @@ function bf({
|
|
|
14177
14186
|
}), z(!1);
|
|
14178
14187
|
}
|
|
14179
14188
|
}), me = o.useCallback(() => {
|
|
14180
|
-
|
|
14181
|
-
}, [
|
|
14189
|
+
R();
|
|
14190
|
+
}, [R]), k = o.useCallback(() => {
|
|
14182
14191
|
Z();
|
|
14183
14192
|
}, [Z]), oe = o.useCallback((X) => {
|
|
14184
14193
|
const le = X[0];
|
|
@@ -14194,8 +14203,8 @@ function bf({
|
|
|
14194
14203
|
dismiss: () => {
|
|
14195
14204
|
}
|
|
14196
14205
|
}
|
|
14197
|
-
} : null, [h, m]), fe =
|
|
14198
|
-
return G ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-16", children: /* @__PURE__ */ e.jsx(it, { className: "size-8" }) }) :
|
|
14206
|
+
} : null, [h, m]), fe = H?.title ?? "";
|
|
14207
|
+
return G ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center py-16", children: /* @__PURE__ */ e.jsx(it, { className: "size-8" }) }) : H ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
14199
14208
|
/* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(ot, { children: /* @__PURE__ */ e.jsxs(ct, { className: "text-lg", children: [
|
|
14200
14209
|
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(
|
|
14201
14210
|
kt,
|
|
@@ -14222,10 +14231,10 @@ function bf({
|
|
|
14222
14231
|
/* @__PURE__ */ e.jsx(xt, {}),
|
|
14223
14232
|
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(Ze, { className: "font-semibold", children: r("common_edit") }) })
|
|
14224
14233
|
] }) }) }),
|
|
14225
|
-
/* @__PURE__ */ e.jsx(rs, { children: p || !
|
|
14234
|
+
/* @__PURE__ */ e.jsx(rs, { children: p || !H ? null : /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
14226
14235
|
i ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
14227
14236
|
/* @__PURE__ */ e.jsx(
|
|
14228
|
-
|
|
14237
|
+
q,
|
|
14229
14238
|
{
|
|
14230
14239
|
variant: "outline",
|
|
14231
14240
|
size: "sm",
|
|
@@ -14252,7 +14261,7 @@ function bf({
|
|
|
14252
14261
|
}
|
|
14253
14262
|
)
|
|
14254
14263
|
] }) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
14255
|
-
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
14264
|
+
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(q, { variant: "outline", size: "sm", className: "size-8 p-0", children: /* @__PURE__ */ e.jsx(lt, { className: "size-4" }) }) }),
|
|
14256
14265
|
/* @__PURE__ */ e.jsx(gt, { align: "end", children: /* @__PURE__ */ e.jsxs(
|
|
14257
14266
|
Fe,
|
|
14258
14267
|
{
|
|
@@ -14266,7 +14275,7 @@ function bf({
|
|
|
14266
14275
|
) })
|
|
14267
14276
|
] }),
|
|
14268
14277
|
/* @__PURE__ */ e.jsx(
|
|
14269
|
-
|
|
14278
|
+
q,
|
|
14270
14279
|
{
|
|
14271
14280
|
onClick: me,
|
|
14272
14281
|
disabled: !_e || Y,
|
|
@@ -14284,7 +14293,7 @@ function bf({
|
|
|
14284
14293
|
/* @__PURE__ */ e.jsx("h3", { className: "text-foreground text-base font-semibold", children: r("media_heading") }),
|
|
14285
14294
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
14286
14295
|
!p && ye && h && /* @__PURE__ */ e.jsx(
|
|
14287
|
-
|
|
14296
|
+
q,
|
|
14288
14297
|
{
|
|
14289
14298
|
onClick: () => P(!0),
|
|
14290
14299
|
variant: "outline",
|
|
@@ -14293,7 +14302,7 @@ function bf({
|
|
|
14293
14302
|
}
|
|
14294
14303
|
),
|
|
14295
14304
|
!p && /* @__PURE__ */ e.jsxs(
|
|
14296
|
-
|
|
14305
|
+
q,
|
|
14297
14306
|
{
|
|
14298
14307
|
variant: "outline",
|
|
14299
14308
|
size: "sm",
|
|
@@ -14310,13 +14319,13 @@ function bf({
|
|
|
14310
14319
|
/* @__PURE__ */ e.jsx(
|
|
14311
14320
|
yf,
|
|
14312
14321
|
{
|
|
14313
|
-
mediaItem:
|
|
14314
|
-
pendingFileUrl:
|
|
14315
|
-
pendingKind:
|
|
14322
|
+
mediaItem: H,
|
|
14323
|
+
pendingFileUrl: L ? L.file_url : null,
|
|
14324
|
+
pendingKind: L ? da(L).kind : null
|
|
14316
14325
|
}
|
|
14317
14326
|
),
|
|
14318
14327
|
(() => {
|
|
14319
|
-
const X =
|
|
14328
|
+
const X = L ? da(L).kind : null, le = H.content_format, We = X ?? le ?? H.kind, Be = X === "video" ? L?.file_url : H.video_url;
|
|
14320
14329
|
if (p) return null;
|
|
14321
14330
|
if (We === "video" && Be)
|
|
14322
14331
|
return /* @__PURE__ */ e.jsxs("div", { className: "border-border mt-4 border-t pt-4", children: [
|
|
@@ -14324,7 +14333,7 @@ function bf({
|
|
|
14324
14333
|
gf,
|
|
14325
14334
|
{
|
|
14326
14335
|
videoUrl: Be,
|
|
14327
|
-
thumbnailUrl: I ??
|
|
14336
|
+
thumbnailUrl: I ?? H.image_url,
|
|
14328
14337
|
onThumbnailCaptured: async (tt) => {
|
|
14329
14338
|
if (!x) {
|
|
14330
14339
|
m({
|
|
@@ -14353,7 +14362,7 @@ function bf({
|
|
|
14353
14362
|
I && /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground mt-1.5 text-xs", children: r("media_pending_save") })
|
|
14354
14363
|
] });
|
|
14355
14364
|
if (We === "pdf") {
|
|
14356
|
-
const tt = I ??
|
|
14365
|
+
const tt = I ?? H.image_url;
|
|
14357
14366
|
return /* @__PURE__ */ e.jsxs("div", { className: "border-border mt-4 border-t pt-4", children: [
|
|
14358
14367
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
14359
14368
|
/* @__PURE__ */ e.jsx("label", { className: "text-foreground mb-1.5 block text-sm font-medium", children: r("media_thumbnail_label") }),
|
|
@@ -14368,7 +14377,7 @@ function bf({
|
|
|
14368
14377
|
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
14369
14378
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground mb-2 text-sm", children: r("media_no_thumbnail") }),
|
|
14370
14379
|
/* @__PURE__ */ e.jsxs(
|
|
14371
|
-
|
|
14380
|
+
q,
|
|
14372
14381
|
{
|
|
14373
14382
|
variant: "outline",
|
|
14374
14383
|
size: "sm",
|
|
@@ -14416,7 +14425,7 @@ function bf({
|
|
|
14416
14425
|
// raw <p>/<strong>/etc. would show as visible characters.
|
|
14417
14426
|
/* @__PURE__ */ e.jsx("p", { className: "text-foreground/70 text-sm leading-relaxed", children: Tr(_.description) })
|
|
14418
14427
|
) : /* @__PURE__ */ e.jsx(
|
|
14419
|
-
|
|
14428
|
+
Rr,
|
|
14420
14429
|
{
|
|
14421
14430
|
value: _.description,
|
|
14422
14431
|
onChange: (X) => w((le) => ({ ...le, description: X })),
|
|
@@ -14472,7 +14481,7 @@ function bf({
|
|
|
14472
14481
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
14473
14482
|
/* @__PURE__ */ e.jsx("h3", { className: "text-foreground text-base font-semibold", children: r("seo_heading") }),
|
|
14474
14483
|
!p && /* @__PURE__ */ e.jsx(
|
|
14475
|
-
|
|
14484
|
+
q,
|
|
14476
14485
|
{
|
|
14477
14486
|
variant: "ghost",
|
|
14478
14487
|
size: "sm",
|
|
@@ -14482,7 +14491,7 @@ function bf({
|
|
|
14482
14491
|
)
|
|
14483
14492
|
] }),
|
|
14484
14493
|
(() => {
|
|
14485
|
-
const le = (
|
|
14494
|
+
const le = (L ? da(L) : null)?.image_url ?? I ?? H?.image_url;
|
|
14486
14495
|
return /* @__PURE__ */ e.jsxs("div", { className: "bg-muted/40 border-border mb-4 rounded-md border p-3", children: [
|
|
14487
14496
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center gap-2", children: [
|
|
14488
14497
|
le ? /* @__PURE__ */ e.jsx(
|
|
@@ -14495,7 +14504,7 @@ function bf({
|
|
|
14495
14504
|
) : /* @__PURE__ */ e.jsx("div", { className: "bg-muted flex size-8 items-center justify-center rounded", children: /* @__PURE__ */ e.jsx(De, { className: "text-muted-foreground size-4" }) }),
|
|
14496
14505
|
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
14497
14506
|
/* @__PURE__ */ e.jsx("p", { className: "text-foreground truncate text-xs font-medium", children: _.seoTitle || fe || r("seo_preview_title_fallback") }),
|
|
14498
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground truncate text-xs", children:
|
|
14507
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground truncate text-xs", children: H?.preview_link ?? H?.canonical_url ?? r("seo_preview_url_fallback") })
|
|
14499
14508
|
] })
|
|
14500
14509
|
] }),
|
|
14501
14510
|
_.seoDescription && /* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground line-clamp-2 text-xs", children: _.seoDescription })
|
|
@@ -14539,7 +14548,7 @@ function bf({
|
|
|
14539
14548
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: r("seo_block_crawlers_description") })
|
|
14540
14549
|
] }),
|
|
14541
14550
|
/* @__PURE__ */ e.jsx(
|
|
14542
|
-
|
|
14551
|
+
qs,
|
|
14543
14552
|
{
|
|
14544
14553
|
checked: _.blockCrawler,
|
|
14545
14554
|
onCheckedChange: (X) => w((le) => ({ ...le, blockCrawler: X })),
|
|
@@ -14557,14 +14566,14 @@ function bf({
|
|
|
14557
14566
|
onOpenChange: z,
|
|
14558
14567
|
title: r("media_delete_dialog_title"),
|
|
14559
14568
|
description: r("media_delete_dialog_description", {
|
|
14560
|
-
title:
|
|
14569
|
+
title: H?.title ?? ""
|
|
14561
14570
|
}),
|
|
14562
14571
|
presentation: i ? "bottom-sheet" : "dialog",
|
|
14563
14572
|
role: "alertdialog",
|
|
14564
14573
|
size: "compact",
|
|
14565
14574
|
children: /* @__PURE__ */ e.jsxs(Bs, { children: [
|
|
14566
14575
|
/* @__PURE__ */ e.jsx(
|
|
14567
|
-
|
|
14576
|
+
q,
|
|
14568
14577
|
{
|
|
14569
14578
|
variant: "secondary",
|
|
14570
14579
|
disabled: J,
|
|
@@ -14573,7 +14582,7 @@ function bf({
|
|
|
14573
14582
|
}
|
|
14574
14583
|
),
|
|
14575
14584
|
/* @__PURE__ */ e.jsx(
|
|
14576
|
-
|
|
14585
|
+
q,
|
|
14577
14586
|
{
|
|
14578
14587
|
variant: "destructive",
|
|
14579
14588
|
onClick: k,
|
|
@@ -14674,14 +14683,14 @@ function jf({
|
|
|
14674
14683
|
}) {
|
|
14675
14684
|
const { t: a } = ne(), { navigate: r, showToast: n, filePickerApi: i } = Ee(), l = _u(), [u, c] = o.useState(""), [d, m] = o.useState(""), [h] = o.useState(!0), [p, f] = o.useState(
|
|
14676
14685
|
null
|
|
14677
|
-
), [g, x] = o.useState(!1), [_, w] = o.useState(!1), [b, j] = o.useState(!1), [v, C] = o.useState("link"), [N, z] = o.useState(""), [O, U] = o.useState(""), [E, P] = o.useState(!1), [A, M] = o.useState(""), [S, K] = o.useState(""), [W, D] = o.useState(!1),
|
|
14686
|
+
), [g, x] = o.useState(!1), [_, w] = o.useState(!1), [b, j] = o.useState(!1), [v, C] = o.useState("link"), [N, z] = o.useState(""), [O, U] = o.useState(""), [E, P] = o.useState(!1), [A, M] = o.useState(""), [S, K] = o.useState(""), [W, D] = o.useState(!1), L = p ? In(p.metadata.mime_type) : null, { mutate: T, isPending: I } = ju(
|
|
14678
14687
|
{
|
|
14679
|
-
onSuccess: (
|
|
14680
|
-
n({ title: a("media_create_success"), type: "success" }), t?.("media", String(
|
|
14688
|
+
onSuccess: (H) => {
|
|
14689
|
+
n({ title: a("media_create_success"), type: "success" }), t?.("media", String(H.id));
|
|
14681
14690
|
},
|
|
14682
|
-
onError: (
|
|
14691
|
+
onError: (H) => {
|
|
14683
14692
|
n({
|
|
14684
|
-
title: a("media_create_error", { message:
|
|
14693
|
+
title: a("media_create_error", { message: H.message }),
|
|
14685
14694
|
type: "error"
|
|
14686
14695
|
});
|
|
14687
14696
|
}
|
|
@@ -14695,16 +14704,16 @@ function jf({
|
|
|
14695
14704
|
n({ title: a("media_file_required"), type: "warning" });
|
|
14696
14705
|
return;
|
|
14697
14706
|
}
|
|
14698
|
-
const
|
|
14707
|
+
const H = In(p.metadata.mime_type);
|
|
14699
14708
|
T({
|
|
14700
14709
|
title: u.trim(),
|
|
14701
14710
|
description: d,
|
|
14702
14711
|
active: h,
|
|
14703
14712
|
media_type: "share",
|
|
14704
|
-
kind:
|
|
14705
|
-
image_url:
|
|
14706
|
-
video_url:
|
|
14707
|
-
pdf_url:
|
|
14713
|
+
kind: H,
|
|
14714
|
+
image_url: H === "image" ? p.file_url : void 0,
|
|
14715
|
+
video_url: H === "video" ? p.file_url : void 0,
|
|
14716
|
+
pdf_url: H === "pdf" ? p.file_url : void 0,
|
|
14708
14717
|
user_id: l?.id,
|
|
14709
14718
|
settings: {
|
|
14710
14719
|
cta: b ? {
|
|
@@ -14737,16 +14746,16 @@ function jf({
|
|
|
14737
14746
|
S,
|
|
14738
14747
|
W
|
|
14739
14748
|
]), se = o.useCallback(
|
|
14740
|
-
(
|
|
14741
|
-
const B =
|
|
14749
|
+
(H) => {
|
|
14750
|
+
const B = H[0];
|
|
14742
14751
|
B && (f(B), x(!1), u.trim() || c(B.metadata.file_name.replace(/\.[^/.]+$/, "")));
|
|
14743
14752
|
},
|
|
14744
14753
|
[u]
|
|
14745
14754
|
), G = o.useMemo(() => i ? {
|
|
14746
14755
|
toast: {
|
|
14747
|
-
success: (
|
|
14748
|
-
error: (
|
|
14749
|
-
title: B instanceof Error ? `${
|
|
14756
|
+
success: (H) => n({ title: H, type: "success" }),
|
|
14757
|
+
error: (H, B) => n({
|
|
14758
|
+
title: B instanceof Error ? `${H}: ${B.message}` : H,
|
|
14750
14759
|
type: "error"
|
|
14751
14760
|
}),
|
|
14752
14761
|
loading: () => "",
|
|
@@ -14760,8 +14769,8 @@ function jf({
|
|
|
14760
14769
|
kt,
|
|
14761
14770
|
{
|
|
14762
14771
|
href: "#",
|
|
14763
|
-
onClick: (
|
|
14764
|
-
|
|
14772
|
+
onClick: (H) => {
|
|
14773
|
+
H.preventDefault(), (s ?? (() => r("media")))();
|
|
14765
14774
|
},
|
|
14766
14775
|
children: a("media_breadcrumb")
|
|
14767
14776
|
}
|
|
@@ -14769,7 +14778,7 @@ function jf({
|
|
|
14769
14778
|
/* @__PURE__ */ e.jsx(xt, {}),
|
|
14770
14779
|
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsx(Ze, { className: "font-semibold", children: a("media_create_breadcrumb") }) })
|
|
14771
14780
|
] }) }) }),
|
|
14772
|
-
/* @__PURE__ */ e.jsx(rs, { children: /* @__PURE__ */ e.jsx(
|
|
14781
|
+
/* @__PURE__ */ e.jsx(rs, { children: /* @__PURE__ */ e.jsx(q, { onClick: $, disabled: I, size: "sm", children: I ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : a("common_save") }) }),
|
|
14773
14782
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 px-4 py-4 md:px-10 md:py-6", children: [
|
|
14774
14783
|
/* @__PURE__ */ e.jsx("div", { className: "mx-auto flex w-full max-w-5xl items-center gap-3", children: /* @__PURE__ */ e.jsx("h1", { className: "text-foreground text-xl font-semibold", children: u.trim() || a("media_new_title") }) }),
|
|
14775
14784
|
/* @__PURE__ */ e.jsxs("div", { className: "mx-auto grid w-full max-w-5xl gap-6 md:grid-cols-[3fr_1fr]", children: [
|
|
@@ -14779,7 +14788,7 @@ function jf({
|
|
|
14779
14788
|
/* @__PURE__ */ e.jsx("h3", { className: "text-foreground text-base font-semibold", children: a("media_heading") }),
|
|
14780
14789
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
14781
14790
|
/* @__PURE__ */ e.jsx(
|
|
14782
|
-
|
|
14791
|
+
q,
|
|
14783
14792
|
{
|
|
14784
14793
|
onClick: () => x(!0),
|
|
14785
14794
|
variant: "outline",
|
|
@@ -14789,7 +14798,7 @@ function jf({
|
|
|
14789
14798
|
}
|
|
14790
14799
|
),
|
|
14791
14800
|
/* @__PURE__ */ e.jsxs(
|
|
14792
|
-
|
|
14801
|
+
q,
|
|
14793
14802
|
{
|
|
14794
14803
|
variant: "outline",
|
|
14795
14804
|
size: "sm",
|
|
@@ -14803,10 +14812,10 @@ function jf({
|
|
|
14803
14812
|
)
|
|
14804
14813
|
] })
|
|
14805
14814
|
] }),
|
|
14806
|
-
p &&
|
|
14807
|
-
/* @__PURE__ */ e.jsx(vf, { result: p, mediaType:
|
|
14815
|
+
p && L ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
14816
|
+
/* @__PURE__ */ e.jsx(vf, { result: p, mediaType: L }),
|
|
14808
14817
|
/* @__PURE__ */ e.jsx(
|
|
14809
|
-
|
|
14818
|
+
q,
|
|
14810
14819
|
{
|
|
14811
14820
|
onClick: () => x(!0),
|
|
14812
14821
|
variant: "outline",
|
|
@@ -14843,7 +14852,7 @@ function jf({
|
|
|
14843
14852
|
{
|
|
14844
14853
|
id: "media-title",
|
|
14845
14854
|
value: u,
|
|
14846
|
-
onChange: (
|
|
14855
|
+
onChange: (H) => c(H.target.value),
|
|
14847
14856
|
placeholder: a("media_title_placeholder"),
|
|
14848
14857
|
required: !0
|
|
14849
14858
|
}
|
|
@@ -14852,7 +14861,7 @@ function jf({
|
|
|
14852
14861
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
14853
14862
|
/* @__PURE__ */ e.jsx(nt, { children: a("common_description_label") }),
|
|
14854
14863
|
/* @__PURE__ */ e.jsx(
|
|
14855
|
-
|
|
14864
|
+
Rr,
|
|
14856
14865
|
{
|
|
14857
14866
|
value: d,
|
|
14858
14867
|
onChange: m,
|
|
@@ -14867,11 +14876,11 @@ function jf({
|
|
|
14867
14876
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
14868
14877
|
/* @__PURE__ */ e.jsx("h3", { className: "text-foreground text-base font-semibold", children: a("seo_heading") }),
|
|
14869
14878
|
/* @__PURE__ */ e.jsx(
|
|
14870
|
-
|
|
14879
|
+
q,
|
|
14871
14880
|
{
|
|
14872
14881
|
variant: "ghost",
|
|
14873
14882
|
size: "sm",
|
|
14874
|
-
onClick: () => P((
|
|
14883
|
+
onClick: () => P((H) => !H),
|
|
14875
14884
|
children: a(E ? "common_done" : "common_edit")
|
|
14876
14885
|
}
|
|
14877
14886
|
)
|
|
@@ -14894,7 +14903,7 @@ function jf({
|
|
|
14894
14903
|
{
|
|
14895
14904
|
id: "seo-title",
|
|
14896
14905
|
value: A,
|
|
14897
|
-
onChange: (
|
|
14906
|
+
onChange: (H) => M(H.target.value),
|
|
14898
14907
|
placeholder: a("seo_title_placeholder")
|
|
14899
14908
|
}
|
|
14900
14909
|
)
|
|
@@ -14906,7 +14915,7 @@ function jf({
|
|
|
14906
14915
|
{
|
|
14907
14916
|
id: "seo-description",
|
|
14908
14917
|
value: S,
|
|
14909
|
-
onChange: (
|
|
14918
|
+
onChange: (H) => K(H.target.value),
|
|
14910
14919
|
placeholder: a("seo_description_placeholder"),
|
|
14911
14920
|
rows: 3
|
|
14912
14921
|
}
|
|
@@ -14918,7 +14927,7 @@ function jf({
|
|
|
14918
14927
|
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: a("seo_block_crawlers_description") })
|
|
14919
14928
|
] }),
|
|
14920
14929
|
/* @__PURE__ */ e.jsx(
|
|
14921
|
-
|
|
14930
|
+
qs,
|
|
14922
14931
|
{
|
|
14923
14932
|
checked: W,
|
|
14924
14933
|
onCheckedChange: D,
|
|
@@ -14938,8 +14947,8 @@ function jf({
|
|
|
14938
14947
|
ctaType: v,
|
|
14939
14948
|
ctaButtonText: N,
|
|
14940
14949
|
ctaUrl: O,
|
|
14941
|
-
onDone: (
|
|
14942
|
-
j(
|
|
14950
|
+
onDone: (H) => {
|
|
14951
|
+
j(H.enabled), C(H.type), z(H.buttonText), U(H.url);
|
|
14943
14952
|
}
|
|
14944
14953
|
}
|
|
14945
14954
|
),
|
|
@@ -15193,7 +15202,7 @@ function Nf({
|
|
|
15193
15202
|
] }),
|
|
15194
15203
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
15195
15204
|
/* @__PURE__ */ e.jsx(
|
|
15196
|
-
|
|
15205
|
+
q,
|
|
15197
15206
|
{
|
|
15198
15207
|
onClick: n,
|
|
15199
15208
|
disabled: t === 0,
|
|
@@ -15233,8 +15242,8 @@ function Sf(t) {
|
|
|
15233
15242
|
isFetchingNextPage: K,
|
|
15234
15243
|
hasNextPage: W,
|
|
15235
15244
|
fetchNextPage: D,
|
|
15236
|
-
error:
|
|
15237
|
-
} =
|
|
15245
|
+
error: L
|
|
15246
|
+
} = Rt({
|
|
15238
15247
|
queryKey: A,
|
|
15239
15248
|
queryFn: async ({ pageParam: k }) => {
|
|
15240
15249
|
const oe = await s.playlists.getPlaylists({
|
|
@@ -15276,7 +15285,7 @@ function Sf(t) {
|
|
|
15276
15285
|
C.size === T.length ? N(/* @__PURE__ */ new Set()) : N(new Set(T.map((k) => k.id)));
|
|
15277
15286
|
}, [C.size, T]), G = o.useCallback(() => {
|
|
15278
15287
|
N(/* @__PURE__ */ new Set());
|
|
15279
|
-
}, []),
|
|
15288
|
+
}, []), H = ze({
|
|
15280
15289
|
mutationFn: (k) => u ? u({
|
|
15281
15290
|
favoriteableId: k,
|
|
15282
15291
|
favoriteableType: "Library"
|
|
@@ -15308,9 +15317,9 @@ function Sf(t) {
|
|
|
15308
15317
|
}
|
|
15309
15318
|
}), B = o.useCallback(
|
|
15310
15319
|
(k) => {
|
|
15311
|
-
u &&
|
|
15320
|
+
u && H.mutate(k);
|
|
15312
15321
|
},
|
|
15313
|
-
[u,
|
|
15322
|
+
[u, H]
|
|
15314
15323
|
), he = o.useCallback(() => {
|
|
15315
15324
|
for (const k of C)
|
|
15316
15325
|
B(k);
|
|
@@ -15332,7 +15341,7 @@ function Sf(t) {
|
|
|
15332
15341
|
error: k
|
|
15333
15342
|
}), O(null);
|
|
15334
15343
|
}
|
|
15335
|
-
}),
|
|
15344
|
+
}), R = o.useCallback(() => {
|
|
15336
15345
|
z != null && _e(z);
|
|
15337
15346
|
}, [z, _e]), Y = o.useMemo(
|
|
15338
15347
|
() => [
|
|
@@ -15381,13 +15390,13 @@ function Sf(t) {
|
|
|
15381
15390
|
}
|
|
15382
15391
|
), J = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
15383
15392
|
K && /* @__PURE__ */ e.jsx("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ e.jsx("div", { className: "border-primary size-6 animate-spin rounded-full border-2 border-t-transparent" }) }),
|
|
15384
|
-
|
|
15393
|
+
L && /* @__PURE__ */ e.jsxs("p", { className: "bg-destructive/10 text-destructive rounded-lg px-3 py-2", children: [
|
|
15385
15394
|
"Error: ",
|
|
15386
|
-
|
|
15395
|
+
L.message
|
|
15387
15396
|
] })
|
|
15388
15397
|
] }), me = T.length === 0 && !K && !W;
|
|
15389
15398
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
15390
|
-
/* @__PURE__ */ e.jsx(rs, { children: d ? /* @__PURE__ */ e.jsxs(
|
|
15399
|
+
/* @__PURE__ */ e.jsx(rs, { children: d ? /* @__PURE__ */ e.jsxs(q, { onClick: () => n("playlists/new"), size: "sm", children: [
|
|
15391
15400
|
/* @__PURE__ */ e.jsx(Wt, { className: "mr-1 size-4" }),
|
|
15392
15401
|
a("playlist_create_button")
|
|
15393
15402
|
] }) : null }),
|
|
@@ -15487,7 +15496,7 @@ function Sf(t) {
|
|
|
15487
15496
|
}
|
|
15488
15497
|
),
|
|
15489
15498
|
X && (r ? /* @__PURE__ */ e.jsx(
|
|
15490
|
-
|
|
15499
|
+
q,
|
|
15491
15500
|
{
|
|
15492
15501
|
variant: "ghost",
|
|
15493
15502
|
size: "sm",
|
|
@@ -15498,7 +15507,7 @@ function Sf(t) {
|
|
|
15498
15507
|
}
|
|
15499
15508
|
) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
15500
15509
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
15501
|
-
|
|
15510
|
+
q,
|
|
15502
15511
|
{
|
|
15503
15512
|
variant: "ghost",
|
|
15504
15513
|
size: "sm",
|
|
@@ -15582,7 +15591,7 @@ function Sf(t) {
|
|
|
15582
15591
|
size: "compact",
|
|
15583
15592
|
children: /* @__PURE__ */ e.jsxs(Bs, { children: [
|
|
15584
15593
|
/* @__PURE__ */ e.jsx(
|
|
15585
|
-
|
|
15594
|
+
q,
|
|
15586
15595
|
{
|
|
15587
15596
|
variant: "secondary",
|
|
15588
15597
|
onClick: () => O(null),
|
|
@@ -15591,10 +15600,10 @@ function Sf(t) {
|
|
|
15591
15600
|
}
|
|
15592
15601
|
),
|
|
15593
15602
|
/* @__PURE__ */ e.jsx(
|
|
15594
|
-
|
|
15603
|
+
q,
|
|
15595
15604
|
{
|
|
15596
15605
|
variant: "destructive",
|
|
15597
|
-
onClick:
|
|
15606
|
+
onClick: R,
|
|
15598
15607
|
disabled: F,
|
|
15599
15608
|
children: F ? /* @__PURE__ */ e.jsx(it, { className: "size-4" }) : a("common_delete")
|
|
15600
15609
|
}
|
|
@@ -15726,7 +15735,7 @@ function If({
|
|
|
15726
15735
|
) ?? [], N = C[m] ?? C[0], z = N?.image_url ?? N?.relateable?.image_url ?? N?.relateable?.compressed_image_url ?? Ff, O = w?.description || w?.search_engine_optimizer?.description || "", U = N?.kind ?? N?.relateable?.kind, E = U === "video" ? N?.video_url ?? N?.relateable?.video_url ?? void 0 : void 0, P = U === "video" && !!E;
|
|
15727
15736
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
15728
15737
|
/* @__PURE__ */ e.jsx(rs, { children: b ? /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
15729
|
-
|
|
15738
|
+
q,
|
|
15730
15739
|
{
|
|
15731
15740
|
variant: "outline",
|
|
15732
15741
|
size: "sm",
|
|
@@ -15834,7 +15843,7 @@ const yl = o.createContext(
|
|
|
15834
15843
|
countries: t?.countries?.map((s) => s.iso) ?? [],
|
|
15835
15844
|
search_engine_optimizer: t?.search_engine_optimizer ?? null
|
|
15836
15845
|
});
|
|
15837
|
-
function
|
|
15846
|
+
function Lf({
|
|
15838
15847
|
children: t,
|
|
15839
15848
|
playlist: s
|
|
15840
15849
|
}) {
|
|
@@ -15919,7 +15928,7 @@ function Ia() {
|
|
|
15919
15928
|
);
|
|
15920
15929
|
return t;
|
|
15921
15930
|
}
|
|
15922
|
-
function
|
|
15931
|
+
function Rf({
|
|
15923
15932
|
children: t,
|
|
15924
15933
|
initialItems: s = []
|
|
15925
15934
|
}) {
|
|
@@ -15981,7 +15990,7 @@ function zf({
|
|
|
15981
15990
|
/* @__PURE__ */ e.jsx(rs, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15982
15991
|
t && c && (h ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
15983
15992
|
/* @__PURE__ */ e.jsx(
|
|
15984
|
-
|
|
15993
|
+
q,
|
|
15985
15994
|
{
|
|
15986
15995
|
variant: "outline",
|
|
15987
15996
|
size: "sm",
|
|
@@ -16010,7 +16019,7 @@ function zf({
|
|
|
16010
16019
|
)
|
|
16011
16020
|
] }) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
16012
16021
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
16013
|
-
|
|
16022
|
+
q,
|
|
16014
16023
|
{
|
|
16015
16024
|
variant: "outline",
|
|
16016
16025
|
size: "sm",
|
|
@@ -16033,7 +16042,7 @@ function zf({
|
|
|
16033
16042
|
) })
|
|
16034
16043
|
] })),
|
|
16035
16044
|
/* @__PURE__ */ e.jsx(
|
|
16036
|
-
|
|
16045
|
+
q,
|
|
16037
16046
|
{
|
|
16038
16047
|
onClick: () => {
|
|
16039
16048
|
a().catch(() => {
|
|
@@ -16073,7 +16082,7 @@ function zf({
|
|
|
16073
16082
|
size: "compact",
|
|
16074
16083
|
children: /* @__PURE__ */ e.jsxs(Bs, { children: [
|
|
16075
16084
|
/* @__PURE__ */ e.jsx(
|
|
16076
|
-
|
|
16085
|
+
q,
|
|
16077
16086
|
{
|
|
16078
16087
|
variant: "secondary",
|
|
16079
16088
|
disabled: _,
|
|
@@ -16082,7 +16091,7 @@ function zf({
|
|
|
16082
16091
|
}
|
|
16083
16092
|
),
|
|
16084
16093
|
/* @__PURE__ */ e.jsx(
|
|
16085
|
-
|
|
16094
|
+
q,
|
|
16086
16095
|
{
|
|
16087
16096
|
variant: "destructive",
|
|
16088
16097
|
onClick: (N) => {
|
|
@@ -16125,7 +16134,7 @@ function Of() {
|
|
|
16125
16134
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
16126
16135
|
/* @__PURE__ */ e.jsx(nt, { className: "text-foreground font-medium", children: t("common_description_label") }),
|
|
16127
16136
|
/* @__PURE__ */ e.jsx("div", { className: "border-border rounded-[6px] border shadow-xs", children: /* @__PURE__ */ e.jsx(
|
|
16128
|
-
|
|
16137
|
+
Rr,
|
|
16129
16138
|
{
|
|
16130
16139
|
value: s.description || "",
|
|
16131
16140
|
onChange: (n) => a("description", n),
|
|
@@ -16159,9 +16168,9 @@ function $f({
|
|
|
16159
16168
|
}
|
|
16160
16169
|
function Uf(t, s) {
|
|
16161
16170
|
const a = s?.toLowerCase() ?? "";
|
|
16162
|
-
return t === "Medium" ? a === "video" || a.includes("video") ? xs : De : t === "Page" ? gs : t === "Product" ? ha : t === "EnrollmentPack" ?
|
|
16171
|
+
return t === "Medium" ? a === "video" || a.includes("video") ? xs : De : t === "Page" ? gs : t === "Product" ? ha : t === "EnrollmentPack" ? Hs : ha;
|
|
16163
16172
|
}
|
|
16164
|
-
function
|
|
16173
|
+
function qf(t, s, a) {
|
|
16165
16174
|
switch (t) {
|
|
16166
16175
|
case "Product":
|
|
16167
16176
|
return a("common_product");
|
|
@@ -16177,7 +16186,7 @@ function Hf(t, s, a) {
|
|
|
16177
16186
|
return t?.replace(/_/g, " ") || a("common_unknown");
|
|
16178
16187
|
}
|
|
16179
16188
|
}
|
|
16180
|
-
function
|
|
16189
|
+
function Hf(t) {
|
|
16181
16190
|
switch (t) {
|
|
16182
16191
|
case "Medium":
|
|
16183
16192
|
return /* @__PURE__ */ e.jsx(De, { className: "text-muted-foreground size-4" });
|
|
@@ -16186,7 +16195,7 @@ function qf(t) {
|
|
|
16186
16195
|
case "Product":
|
|
16187
16196
|
return /* @__PURE__ */ e.jsx(ha, { className: "text-muted-foreground size-4" });
|
|
16188
16197
|
case "EnrollmentPack":
|
|
16189
|
-
return /* @__PURE__ */ e.jsx(
|
|
16198
|
+
return /* @__PURE__ */ e.jsx(Hs, { className: "text-muted-foreground size-4" });
|
|
16190
16199
|
default:
|
|
16191
16200
|
return /* @__PURE__ */ e.jsx(De, { className: "text-muted-foreground size-4" });
|
|
16192
16201
|
}
|
|
@@ -16263,7 +16272,7 @@ function Bf({
|
|
|
16263
16272
|
alt: String(g.title),
|
|
16264
16273
|
className: "h-full w-full object-cover"
|
|
16265
16274
|
}
|
|
16266
|
-
) :
|
|
16275
|
+
) : Hf(g.relateable_type || "") }),
|
|
16267
16276
|
/* @__PURE__ */ e.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e.jsx("div", { className: "text-foreground truncate text-sm font-medium", children: g.title || i("common_untitled") }) })
|
|
16268
16277
|
] }) }),
|
|
16269
16278
|
/* @__PURE__ */ e.jsx("td", { className: "px-6 py-4 whitespace-nowrap", children: /* @__PURE__ */ e.jsx("div", { className: "bg-muted text-foreground inline-flex items-center gap-1 rounded-full px-2 py-1 text-xs", children: (() => {
|
|
@@ -16273,7 +16282,7 @@ function Bf({
|
|
|
16273
16282
|
);
|
|
16274
16283
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
16275
16284
|
/* @__PURE__ */ e.jsx(_, { className: "size-3 shrink-0" }),
|
|
16276
|
-
|
|
16285
|
+
qf(
|
|
16277
16286
|
g.relateable_type || "",
|
|
16278
16287
|
g.kind || "",
|
|
16279
16288
|
i
|
|
@@ -16281,7 +16290,7 @@ function Bf({
|
|
|
16281
16290
|
] });
|
|
16282
16291
|
})() }) }),
|
|
16283
16292
|
/* @__PURE__ */ e.jsx("td", { className: "px-6 py-4 text-right text-sm font-medium whitespace-nowrap", children: l ? /* @__PURE__ */ e.jsx(
|
|
16284
|
-
|
|
16293
|
+
q,
|
|
16285
16294
|
{
|
|
16286
16295
|
variant: "ghost",
|
|
16287
16296
|
size: "sm",
|
|
@@ -16298,7 +16307,7 @@ function Bf({
|
|
|
16298
16307
|
}
|
|
16299
16308
|
) : /* @__PURE__ */ e.jsxs(ht, { children: [
|
|
16300
16309
|
/* @__PURE__ */ e.jsx(ft, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
16301
|
-
|
|
16310
|
+
q,
|
|
16302
16311
|
{
|
|
16303
16312
|
variant: "ghost",
|
|
16304
16313
|
size: "sm",
|
|
@@ -16488,19 +16497,19 @@ function Qf({
|
|
|
16488
16497
|
playlistId: t,
|
|
16489
16498
|
data: {
|
|
16490
16499
|
items: W.filter(
|
|
16491
|
-
(
|
|
16492
|
-
).map((
|
|
16500
|
+
(L) => Number.isInteger(L.id) && typeof L.order == "number"
|
|
16501
|
+
).map((L) => ({ id: L.id, order: L.order }))
|
|
16493
16502
|
}
|
|
16494
16503
|
},
|
|
16495
16504
|
{
|
|
16496
16505
|
onSuccess: () => {
|
|
16497
16506
|
v.current === null ? C.current = null : C.current = W;
|
|
16498
16507
|
},
|
|
16499
|
-
onError: (
|
|
16508
|
+
onError: (L) => {
|
|
16500
16509
|
D && h(D), C.current = null, r({
|
|
16501
16510
|
title: s("playlist_reorder_error"),
|
|
16502
16511
|
type: "error",
|
|
16503
|
-
error:
|
|
16512
|
+
error: L
|
|
16504
16513
|
});
|
|
16505
16514
|
}
|
|
16506
16515
|
}
|
|
@@ -16536,9 +16545,9 @@ function Qf({
|
|
|
16536
16545
|
for (const W of S) {
|
|
16537
16546
|
const D = Vf(W.asset_code);
|
|
16538
16547
|
if (!D || !M.allowedRelateableTypes.has(D)) continue;
|
|
16539
|
-
const
|
|
16548
|
+
const L = W.asset_id, T = W.metadata?.file_name || `${D} #${L}`;
|
|
16540
16549
|
if (g.some(
|
|
16541
|
-
(G) => G.relateable_type === D && G.relateable?.id ===
|
|
16550
|
+
(G) => G.relateable_type === D && G.relateable?.id === L
|
|
16542
16551
|
)) {
|
|
16543
16552
|
r({
|
|
16544
16553
|
title: s("playlist_item_already_exists"),
|
|
@@ -16551,7 +16560,7 @@ function Qf({
|
|
|
16551
16560
|
order: $,
|
|
16552
16561
|
relateable_type: D,
|
|
16553
16562
|
relateable: {
|
|
16554
|
-
id:
|
|
16563
|
+
id: L,
|
|
16555
16564
|
title: T,
|
|
16556
16565
|
image_url: W.thumbnail_url ?? W.file_url ?? null
|
|
16557
16566
|
}
|
|
@@ -16563,7 +16572,7 @@ function Qf({
|
|
|
16563
16572
|
newItem: se,
|
|
16564
16573
|
data: {
|
|
16565
16574
|
relateable_type: D,
|
|
16566
|
-
relateable_id:
|
|
16575
|
+
relateable_id: L,
|
|
16567
16576
|
order: $
|
|
16568
16577
|
}
|
|
16569
16578
|
}), r({
|
|
@@ -16622,7 +16631,7 @@ function Qf({
|
|
|
16622
16631
|
);
|
|
16623
16632
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-8", children: [
|
|
16624
16633
|
/* @__PURE__ */ e.jsx(
|
|
16625
|
-
|
|
16634
|
+
Ln,
|
|
16626
16635
|
{
|
|
16627
16636
|
section: u.primary,
|
|
16628
16637
|
items: x,
|
|
@@ -16635,7 +16644,7 @@ function Qf({
|
|
|
16635
16644
|
}
|
|
16636
16645
|
),
|
|
16637
16646
|
(!P || A || _.length > 0) && /* @__PURE__ */ e.jsx(
|
|
16638
|
-
|
|
16647
|
+
Ln,
|
|
16639
16648
|
{
|
|
16640
16649
|
section: u.tagged,
|
|
16641
16650
|
items: _,
|
|
@@ -16677,7 +16686,7 @@ function Qf({
|
|
|
16677
16686
|
] }) })
|
|
16678
16687
|
] });
|
|
16679
16688
|
}
|
|
16680
|
-
function
|
|
16689
|
+
function Ln({
|
|
16681
16690
|
section: t,
|
|
16682
16691
|
items: s,
|
|
16683
16692
|
onAdd: a,
|
|
@@ -16695,7 +16704,7 @@ function Rn({
|
|
|
16695
16704
|
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: t.description })
|
|
16696
16705
|
] }),
|
|
16697
16706
|
/* @__PURE__ */ e.jsx("div", { className: "flex shrink-0 flex-wrap items-center justify-end gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
16698
|
-
|
|
16707
|
+
q,
|
|
16699
16708
|
{
|
|
16700
16709
|
type: "button",
|
|
16701
16710
|
disabled: i || u,
|
|
@@ -16993,7 +17002,7 @@ function ag({
|
|
|
16993
17002
|
] }) })
|
|
16994
17003
|
] });
|
|
16995
17004
|
}
|
|
16996
|
-
function
|
|
17005
|
+
function Rn({
|
|
16997
17006
|
playlistId: t,
|
|
16998
17007
|
onBack: s,
|
|
16999
17008
|
hideHeader: a,
|
|
@@ -17007,7 +17016,7 @@ function Ln({
|
|
|
17007
17016
|
return l && c ? /* @__PURE__ */ e.jsxs("div", { className: "mx-auto max-w-7xl space-y-6 px-6 pt-6 pb-8 md:px-10 md:py-8", children: [
|
|
17008
17017
|
/* @__PURE__ */ e.jsx(Oe, { className: "h-8 w-48" }),
|
|
17009
17018
|
/* @__PURE__ */ e.jsx(Oe, { className: "h-64 w-full" })
|
|
17010
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
17019
|
+
] }) : /* @__PURE__ */ e.jsx(Lf, { playlist: d, children: /* @__PURE__ */ e.jsx(Rf, { initialItems: m, children: /* @__PURE__ */ e.jsx(
|
|
17011
17020
|
ag,
|
|
17012
17021
|
{
|
|
17013
17022
|
playlistId: t,
|
|
@@ -17041,7 +17050,7 @@ function lg({
|
|
|
17041
17050
|
hasNextPage: p,
|
|
17042
17051
|
fetchNextPage: f,
|
|
17043
17052
|
error: g
|
|
17044
|
-
} =
|
|
17053
|
+
} = Rt({
|
|
17045
17054
|
queryKey: ["shareables-files", u],
|
|
17046
17055
|
queryFn: async ({ pageParam: b = 1 }) => await s.fileResources.getFileResources({
|
|
17047
17056
|
search_query: u || void 0,
|
|
@@ -17155,7 +17164,7 @@ function ug({
|
|
|
17155
17164
|
hasNextPage: w,
|
|
17156
17165
|
fetchNextPage: b,
|
|
17157
17166
|
error: j
|
|
17158
|
-
} =
|
|
17167
|
+
} = Rt({
|
|
17159
17168
|
queryKey: f,
|
|
17160
17169
|
queryFn: async ({ pageParam: N }) => {
|
|
17161
17170
|
const z = await s.pages.listPages({
|
|
@@ -17369,7 +17378,7 @@ function pg({
|
|
|
17369
17378
|
onBack: n
|
|
17370
17379
|
}
|
|
17371
17380
|
) : s && s !== "new" ? p = /* @__PURE__ */ e.jsx(
|
|
17372
|
-
|
|
17381
|
+
Lh,
|
|
17373
17382
|
{
|
|
17374
17383
|
mediaId: s,
|
|
17375
17384
|
onNavigate: r,
|
|
@@ -17386,7 +17395,7 @@ function pg({
|
|
|
17386
17395
|
break;
|
|
17387
17396
|
case "playlists":
|
|
17388
17397
|
case "playlist":
|
|
17389
|
-
s === "new" && h ? p = /* @__PURE__ */ e.jsx(
|
|
17398
|
+
s === "new" && h ? p = /* @__PURE__ */ e.jsx(Rn, { onBack: n }) : s && a === "edit" && h ? p = /* @__PURE__ */ e.jsx(Rn, { playlistId: s, onBack: n }) : s && s !== "new" ? p = /* @__PURE__ */ e.jsx(
|
|
17390
17399
|
If,
|
|
17391
17400
|
{
|
|
17392
17401
|
playlistId: s,
|
|
@@ -17523,7 +17532,7 @@ function jl({
|
|
|
17523
17532
|
pickerSourceKeys: c,
|
|
17524
17533
|
...d
|
|
17525
17534
|
}) {
|
|
17526
|
-
return /* @__PURE__ */ e.jsx("div", { ...d, className: `h-full ${d.className ?? ""}`, children: /* @__PURE__ */ e.jsx(xg, { children: /* @__PURE__ */ e.jsx(
|
|
17535
|
+
return /* @__PURE__ */ e.jsx("div", { ...d, className: `h-full ${d.className ?? ""}`, children: /* @__PURE__ */ e.jsx(xg, { children: /* @__PURE__ */ e.jsx(qi, { children: /* @__PURE__ */ e.jsx(
|
|
17527
17536
|
vg,
|
|
17528
17537
|
{
|
|
17529
17538
|
showProductSharablesCarousel: i,
|
|
@@ -17543,8 +17552,8 @@ function vg({
|
|
|
17543
17552
|
l.current = n;
|
|
17544
17553
|
const u = o.useRef(i);
|
|
17545
17554
|
u.current = i;
|
|
17546
|
-
const c =
|
|
17547
|
-
async (D,
|
|
17555
|
+
const c = Rm(), { productsApi: d } = c, m = vs(), { data: h } = Ul(), { data: p } = sc(), { currentSlug: f, navigate: g } = hr(), x = _g(), _ = s ?? tc(h), w = vi(), b = Ge(), j = o.useCallback(
|
|
17556
|
+
async (D, L, T, I) => D ? d.searchProducts(D, { cursor: L, limit: T }) : d.listProducts({ cursor: L, limit: T, sort: I }),
|
|
17548
17557
|
[d]
|
|
17549
17558
|
), v = o.useCallback(
|
|
17550
17559
|
async (D) => d.getProduct(D),
|
|
@@ -17558,8 +17567,8 @@ function vg({
|
|
|
17558
17567
|
enabled: !!O
|
|
17559
17568
|
}
|
|
17560
17569
|
), E = U?.product.name, P = o.useMemo(() => x ? E ? { ...x, label: E } : x : null, [x, E]), A = o.useCallback(
|
|
17561
|
-
(D,
|
|
17562
|
-
const T =
|
|
17570
|
+
(D, L) => {
|
|
17571
|
+
const T = L ? `share/${D}/${L}` : `share/${D}`;
|
|
17563
17572
|
g(T);
|
|
17564
17573
|
},
|
|
17565
17574
|
[g]
|
|
@@ -17581,22 +17590,22 @@ function vg({
|
|
|
17581
17590
|
affiliateId: null,
|
|
17582
17591
|
basePath: "",
|
|
17583
17592
|
navigate: (D) => {
|
|
17584
|
-
const
|
|
17593
|
+
const L = D.replace(/^\//, ""), T = L.startsWith("share/") ? L : `share/${L}`;
|
|
17585
17594
|
g(T);
|
|
17586
17595
|
},
|
|
17587
17596
|
showToast: (D) => {
|
|
17588
|
-
|
|
17597
|
+
ql({ title: D.title, type: D.type }), D.error && console.error("[Shareables]", D.error);
|
|
17589
17598
|
},
|
|
17590
17599
|
filePickerApi: m,
|
|
17591
17600
|
onToggleFavorite: async (D) => {
|
|
17592
|
-
const
|
|
17601
|
+
const L = await pn(
|
|
17593
17602
|
w,
|
|
17594
17603
|
D.favoriteableId,
|
|
17595
17604
|
D.favoriteableType
|
|
17596
17605
|
);
|
|
17597
17606
|
return b.invalidateQueries({
|
|
17598
17607
|
queryKey: Kr.favorites()
|
|
17599
|
-
}),
|
|
17608
|
+
}), L;
|
|
17600
17609
|
},
|
|
17601
17610
|
onMySiteShare: async (D) => {
|
|
17602
17611
|
await pn(
|
|
@@ -17616,13 +17625,13 @@ function vg({
|
|
|
17616
17625
|
},
|
|
17617
17626
|
mediaProductsApi: _ ? void 0 : {
|
|
17618
17627
|
...c.mediaProductsAdapter,
|
|
17619
|
-
listMediaProducts: (D,
|
|
17620
|
-
...
|
|
17621
|
-
language_iso:
|
|
17628
|
+
listMediaProducts: (D, L) => c.mediaProductsAdapter.listMediaProducts(D, {
|
|
17629
|
+
...L,
|
|
17630
|
+
language_iso: L?.language_iso ?? u.current
|
|
17622
17631
|
})
|
|
17623
17632
|
},
|
|
17624
|
-
searchProducts: _ ? void 0 : async (D,
|
|
17625
|
-
const T =
|
|
17633
|
+
searchProducts: _ ? void 0 : async (D, L) => {
|
|
17634
|
+
const T = L?.limit ?? 25, I = L?.cursor ?? void 0, $ = D.trim().length > 0 ? await d.searchProducts(D, {
|
|
17626
17635
|
cursor: I,
|
|
17627
17636
|
limit: T
|
|
17628
17637
|
}) : await d.listProducts({ cursor: I, limit: T });
|
|
@@ -17652,9 +17661,9 @@ function vg({
|
|
|
17652
17661
|
pickerSources: {
|
|
17653
17662
|
pages: {
|
|
17654
17663
|
cacheKey: `locale:${i}`,
|
|
17655
|
-
list: async ({ search: D, cursor:
|
|
17664
|
+
list: async ({ search: D, cursor: L, limit: T }) => {
|
|
17656
17665
|
const I = await c.pagesAdapter.listPages({
|
|
17657
|
-
cursor:
|
|
17666
|
+
cursor: L ?? void 0,
|
|
17658
17667
|
limit: T,
|
|
17659
17668
|
"filter[title]": D && D.trim().length > 0 ? D : void 0,
|
|
17660
17669
|
language_iso: u.current
|
|
@@ -17671,12 +17680,12 @@ function vg({
|
|
|
17671
17680
|
},
|
|
17672
17681
|
products: {
|
|
17673
17682
|
cacheKey: `locale:${i}`,
|
|
17674
|
-
list: async ({ search: D, cursor:
|
|
17683
|
+
list: async ({ search: D, cursor: L, limit: T }) => {
|
|
17675
17684
|
const I = D?.trim() ?? "", $ = I.length > 0 ? await d.searchProducts(I, {
|
|
17676
|
-
cursor:
|
|
17685
|
+
cursor: L ?? void 0,
|
|
17677
17686
|
limit: T
|
|
17678
17687
|
}) : await d.listProducts({
|
|
17679
|
-
cursor:
|
|
17688
|
+
cursor: L ?? void 0,
|
|
17680
17689
|
limit: T
|
|
17681
17690
|
});
|
|
17682
17691
|
return {
|
|
@@ -17699,10 +17708,10 @@ function vg({
|
|
|
17699
17708
|
// surface a non-functional one. Flip to true once the
|
|
17700
17709
|
// backend ships filter[title] support.
|
|
17701
17710
|
supportsSearch: !1,
|
|
17702
|
-
list: async ({ cursor: D, limit:
|
|
17711
|
+
list: async ({ cursor: D, limit: L }) => {
|
|
17703
17712
|
const T = await c.enrollmentPacksAdapter.listEnrollmentPacks({
|
|
17704
17713
|
cursor: D ?? void 0,
|
|
17705
|
-
limit:
|
|
17714
|
+
limit: L
|
|
17706
17715
|
});
|
|
17707
17716
|
return {
|
|
17708
17717
|
items: T.enrollment_packs.map(($) => ({
|
|
@@ -17717,10 +17726,10 @@ function vg({
|
|
|
17717
17726
|
}
|
|
17718
17727
|
}
|
|
17719
17728
|
},
|
|
17720
|
-
uploadThumbnail: _ ? void 0 : async (D,
|
|
17729
|
+
uploadThumbnail: _ ? void 0 : async (D, L) => {
|
|
17721
17730
|
const I = (await m.createDamAsset({
|
|
17722
|
-
file: new File([D],
|
|
17723
|
-
name:
|
|
17731
|
+
file: new File([D], L, { type: D.type }),
|
|
17732
|
+
name: L
|
|
17724
17733
|
})).asset?.default_variant_url;
|
|
17725
17734
|
if (!I)
|
|
17726
17735
|
throw new Error("Thumbnail upload succeeded but no URL returned");
|
|
@@ -17773,7 +17782,7 @@ function vg({
|
|
|
17773
17782
|
function jg({
|
|
17774
17783
|
children: t
|
|
17775
17784
|
}) {
|
|
17776
|
-
const { config: s } =
|
|
17785
|
+
const { config: s } = Hl(), { fetch: a } = Bl(), { baseUrl: r, defaultHeaders: n, onAuthError: i } = s, l = o.useMemo(
|
|
17777
17786
|
() => ro({
|
|
17778
17787
|
baseUrl: r,
|
|
17779
17788
|
defaultHeaders: n,
|
|
@@ -17823,7 +17832,7 @@ function kg({
|
|
|
17823
17832
|
}
|
|
17824
17833
|
const wl = [];
|
|
17825
17834
|
function Cg() {
|
|
17826
|
-
const t = Ae(), { isSuccess: s } =
|
|
17835
|
+
const t = Ae(), { isSuccess: s } = Rt({
|
|
17827
17836
|
...Xi(t, ""),
|
|
17828
17837
|
retry: !1
|
|
17829
17838
|
});
|
|
@@ -17846,7 +17855,7 @@ function Yg({
|
|
|
17846
17855
|
canCuratePlaylists: !0,
|
|
17847
17856
|
pickerSourceKeys: wl
|
|
17848
17857
|
}
|
|
17849
|
-
) : /* @__PURE__ */ e.jsx(
|
|
17858
|
+
) : /* @__PURE__ */ e.jsx(qi, { children: /* @__PURE__ */ e.jsx(Cg, {}) }) }) });
|
|
17850
17859
|
}
|
|
17851
17860
|
export {
|
|
17852
17861
|
Yg as M
|