@epam/ai-dial-publish-panel 1.4.0-dev.110 → 1.4.0-dev.116

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/index.js CHANGED
@@ -1,48 +1,58 @@
1
1
  import { useCallback as e, useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
2
- import { Badge as o, BottomSheet as s, ButtonVariant as c, Checkbox as l, ConfirmationPopupVariant as u, DIAL_ICON_SIZE as d, DIAL_KIT_ICON_STROKE as f, DialFileNodeType as p, DialItemType as m, ElementSize as h, EllipsisTooltip as g, ErrorText as _, FileIcon as v, FolderName as y, GhostButton as b, GhostIconButton as x, Highlight as S, Input as ee, LinkButton as C, LiveRegion as w, LiveRegionElement as te, LiveRegionPoliteness as T, NeutralButton as E, Notification as D, NotificationType as O, NotificationVariant as k, PrimaryButton as A, RadioGroup as ne, Search as j, Select as M, SideDrawer as re, Skeleton as N, SkeletonVariant as P, Spinner as ie, Tag as F, TagInput as ae } from "@epam/ai-dial-ui-kit";
3
- import { ConfirmationDialog as I, DeploymentIcon as L, ResourceSummary as oe, TAG_INPUT_TAG_CLASS_NAME as R, buildCssVars as se, mergeClasses as z, useIsMobile as ce } from "@epam/ai-dial-chat-shared";
4
- import { Fragment as le, jsx as B, jsxs as V } from "react/jsx-runtime";
5
- import { IconFolder as H, IconFolderPlus as U, IconPlus as W, IconTrashX as ue } from "@tabler/icons-react";
6
- import { DialFileNodeType as de, DialFoldersTree as fe } from "@epam/ai-dial-react-file-manager";
2
+ import { Badge as o, BottomSheet as s, ButtonVariant as c, Checkbox as l, ConfirmationPopupVariant as u, DIAL_ICON_SIZE as d, DIAL_KIT_ICON_STROKE as f, DialFileNodeType as p, DialItemType as m, ElementSize as h, EllipsisTooltip as g, ErrorText as _, FileIcon as v, FolderName as y, GhostButton as b, GhostIconButton as x, Highlight as S, Input as ee, LinkButton as C, LiveRegion as w, LiveRegionElement as T, LiveRegionPoliteness as E, NeutralButton as D, Notification as O, NotificationType as k, NotificationVariant as A, PrimaryButton as j, RadioGroup as te, Search as M, Select as N, SideDrawer as ne, Skeleton as P, SkeletonVariant as F, Spinner as I, Tag as re, TagInput as ie } from "@epam/ai-dial-ui-kit";
3
+ import { ConfirmationDialog as L, DeploymentIcon as R, ResourceSummary as ae, TAG_INPUT_TAG_CLASS_NAME as z, buildCssVars as B, mergeClasses as V, useIsMobile as oe } from "@epam/ai-dial-chat-shared";
4
+ import { Fragment as se, jsx as H, jsxs as U } from "react/jsx-runtime";
5
+ import { IconFolder as W, IconFolderPlus as ce, IconPlus as le, IconTrashX as G } from "@tabler/icons-react";
6
+ import { DialFileNodeType as ue, DialFoldersTree as de } from "@epam/ai-dial-react-file-manager";
7
7
  //#region src/models/publish.ts
8
- var G = /* @__PURE__ */ function(e) {
8
+ var K = /* @__PURE__ */ function(e) {
9
9
  return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
10
- }({}), K = /* @__PURE__ */ function(e) {
11
- return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
12
10
  }({}), q = /* @__PURE__ */ function(e) {
11
+ return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.TargetTaken = "targetTaken", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
12
+ }({}), J = /* @__PURE__ */ function(e) {
13
13
  return e.Application = "application", e.Toolset = "toolset", e.Prompt = "prompt", e.Skill = "skill", e.File = "file", e;
14
- }({}), J = (e) => e.isSubmitting ? {
15
- calloutKind: K.None,
14
+ }({}), Y = /* @__PURE__ */ function(e) {
15
+ return e.Warning = "warning", e.Published = "published", e;
16
+ }({}), fe = (e) => e.isSubmitting ? {
17
+ calloutKind: q.None,
16
18
  isSubmitDisabled: !0,
17
19
  isSubmitLoading: !0
18
- } : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
19
- calloutKind: K.SubmitError,
20
+ } : e.hasSelectedFolder ? e.hasWriteAccess ? e.isTargetChecking ? {
21
+ calloutKind: q.None,
22
+ isSubmitDisabled: !0,
23
+ isSubmitLoading: !1
24
+ } : e.hasSubmitError ? {
25
+ calloutKind: q.SubmitError,
20
26
  isSubmitDisabled: !1,
21
27
  isSubmitLoading: !1
22
28
  } : e.hasExistingPublicationInFolder ? {
23
- calloutKind: K.ReplaceWarning,
29
+ calloutKind: q.ReplaceWarning,
24
30
  isSubmitDisabled: e.allowReplace === !1,
25
31
  isSubmitLoading: !1
32
+ } : e.isTargetTaken ? {
33
+ calloutKind: q.TargetTaken,
34
+ isSubmitDisabled: !0,
35
+ isSubmitLoading: !1
26
36
  } : {
27
- calloutKind: K.Info,
37
+ calloutKind: q.Info,
28
38
  isSubmitDisabled: !1,
29
39
  isSubmitLoading: !1
30
40
  } : {
31
- calloutKind: K.NoAccess,
41
+ calloutKind: q.NoAccess,
32
42
  isSubmitDisabled: !0,
33
43
  isSubmitLoading: !1
34
44
  } : {
35
- calloutKind: K.None,
45
+ calloutKind: q.None,
36
46
  isSubmitDisabled: !0,
37
47
  isSubmitLoading: !1
38
- }, pe = 864e5, Y = (e, t = Date.now(), n) => {
39
- let r = Math.floor((t - e) / pe);
48
+ }, X = 864e5, pe = (e, t = Date.now(), n) => {
49
+ let r = Math.floor((t - e) / X);
40
50
  return r <= 0 ? "Today" : r === 1 ? "Yesterday" : r < 7 ? `${r} days ago` : new Date(e).toLocaleDateString(n, {
41
51
  month: "short",
42
52
  day: "numeric",
43
53
  year: "numeric"
44
54
  });
45
- }, X = (e, t, n) => t.length === 0 ? [...e, {
55
+ }, Z = (e, t, n) => t.length === 0 ? [...e, {
46
56
  path: [n],
47
57
  name: n
48
58
  }] : e.map((e) => e.path.join("/") === t.join("/") ? {
@@ -53,105 +63,134 @@ var G = /* @__PURE__ */ function(e) {
53
63
  }]
54
64
  } : {
55
65
  ...e,
56
- children: e.children ? X(e.children, t, n) : e.children
57
- }), Z = (e, t, n) => {
66
+ children: e.children ? Z(e.children, t, n) : e.children
67
+ }), me = (e, t, n) => {
58
68
  let r = [...t, n].join("/");
59
69
  return t.length === 0 ? e.filter((e) => e.path.join("/") !== r) : e.map((e) => e.path.join("/") === t.join("/") ? {
60
70
  ...e,
61
71
  children: (e.children ?? []).filter((e) => e.path.join("/") !== r)
62
72
  } : {
63
73
  ...e,
64
- children: e.children ? Z(e.children, t, n) : e.children
74
+ children: e.children ? me(e.children, t, n) : e.children
65
75
  });
66
- }, me = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
67
- let [m, h] = a(o);
76
+ }, he = ({ item: n, history: o, folderItems: s, hasWriteAccess: c = () => !0, defaultAuthor: l = "", onCreateFolder: u, onPublish: d, onPublishSuccess: f, onPublishError: p, onFetchExistingRules: m, onCheckTargetExists: h, isTargetTakenError: g }) => {
77
+ let [_, v] = a(s);
68
78
  t(() => {
69
- h(o);
70
- }, [o]);
71
- let [g, _] = a(), [v, y] = a(!1), [b, x] = a(!1), [S, ee] = a([]), [C, w] = a(!1), [te, T] = a(!1), [E, D] = a(c), [O, k] = a(!1), [A, ne] = a(!1);
79
+ v(s);
80
+ }, [s]);
81
+ let [y, b] = a(), [x, S] = a(!1), [ee, C] = a(!1), [w, T] = a([]), [E, D] = a(!1), [O, k] = a(!1), [A, j] = a(l), [te, M] = a(!1), [N, ne] = a(!1);
72
82
  t(() => {
73
- A || D(c);
74
- }, [c, A]);
75
- let j = e((e) => {
76
- ne(!0), D(e);
83
+ N || j(l);
84
+ }, [l, N]);
85
+ let P = e((e) => {
86
+ ne(!0), j(e);
77
87
  }, []);
78
88
  t(() => {
79
- if (g == null) {
80
- ee([]), T(!1);
89
+ if (y == null) {
90
+ T([]), k(!1);
81
91
  return;
82
92
  }
83
- if (!p) return;
93
+ if (!m) return;
84
94
  let e = !1;
85
- return w(!0), T(!1), p(g).then((t) => {
86
- e || ee(t);
95
+ return D(!0), k(!1), m(y).then((t) => {
96
+ e || T(t);
87
97
  }).catch(() => {
88
- e || T(!0);
98
+ e || k(!0);
89
99
  }).finally(() => {
90
- e || w(!1);
100
+ e || D(!1);
91
101
  }), () => {
92
102
  e = !0;
93
103
  };
94
- }, [g]);
95
- let M = r(() => {
96
- if (!g) return !1;
97
- let e = g.join("/");
98
- return i.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
104
+ }, [y]);
105
+ let F = r(() => {
106
+ if (!y) return !1;
107
+ let e = y.join("/");
108
+ return o.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
99
109
  }, [
100
- i,
110
+ o,
101
111
  n.version,
102
- g
103
- ]), re = e(async (e, t) => {
104
- h((n) => X(n, e, t));
112
+ y
113
+ ]), I = i(/* @__PURE__ */ new Set()), [re, ie] = a(), [L, R] = a(), [ae, z] = a(!1), B = y == null ? void 0 : `${n.id ?? ""}\u0000${y.join("/")}\u0000${n.version ?? ""}`, V = B != null && (re === B || L === B);
114
+ t(() => {
115
+ if (y == null || B == null || !h || F) {
116
+ z(!1);
117
+ return;
118
+ }
119
+ let e = y.join("/");
120
+ if ([...I.current].some((t) => e === t || e.startsWith(`${t}/`))) {
121
+ z(!1);
122
+ return;
123
+ }
124
+ let t = !1;
125
+ return z(!0), h(n, y).then((e) => {
126
+ t || ie((t) => e ? B : t === B ? void 0 : t);
127
+ }).catch(() => void 0).finally(() => {
128
+ t || z(!1);
129
+ }), () => {
130
+ t = !0;
131
+ };
132
+ }, [
133
+ B,
134
+ F,
135
+ h == null
136
+ ]);
137
+ let oe = e(async (e, t) => {
138
+ let n = [...e, t].join("/");
139
+ I.current.add(n), v((n) => Z(n, e, t));
105
140
  try {
106
- await l?.(e, t);
141
+ await u?.(e, t);
107
142
  } catch {
108
- h((n) => Z(n, e, t)), x(!0);
143
+ I.current.delete(n), v((n) => me(n, e, t)), C(!0);
109
144
  }
110
- }, [l]), N = e(async () => {
111
- if (!g) return !1;
112
- y(!0), x(!1);
145
+ }, [u]), se = e(async () => {
146
+ if (!y) return !1;
147
+ S(!0), C(!1);
113
148
  try {
114
- return await u(n, g, S, E.trim(), O), d?.(n, g), !0;
149
+ return await d(n, y, w, A.trim(), te), f?.(n, y), !0;
115
150
  } catch (e) {
116
- return x(!0), f?.(n, g, e), !1;
151
+ return g?.(e) && B != null ? R(B) : C(!0), p?.(n, y, e), !1;
117
152
  } finally {
118
- y(!1);
153
+ S(!1);
119
154
  }
120
155
  }, [
121
- E,
156
+ A,
157
+ g,
122
158
  n,
123
- u,
124
- f,
125
159
  d,
126
- O,
127
- S,
128
- g
129
- ]), P = e(() => {
130
- h(o), _(void 0), x(!1), ee([]), T(!1), D(c), ne(!1), k(!1);
131
- }, [c, o]);
160
+ p,
161
+ f,
162
+ te,
163
+ w,
164
+ y,
165
+ B
166
+ ]), H = e(() => {
167
+ v(s), b(void 0), C(!1), T([]), k(!1), j(l), ne(!1), M(!1), I.current.clear(), ie(void 0), R(void 0), z(!1);
168
+ }, [l, s]);
132
169
  return {
133
- folderItems: m,
134
- selectedFolderPath: g,
135
- setSelectedFolderPath: _,
136
- handleCreateFolder: re,
137
- hasExistingPublicationInFolder: M,
138
- hasWriteAccess: !g || s(g),
139
- isSubmitting: v,
140
- hasSubmitError: b,
141
- handleSubmit: N,
142
- reset: P,
143
- rules: S,
144
- setRules: ee,
145
- author: E,
146
- setAuthor: j,
147
- publishCredentials: O,
148
- setPublishCredentials: k,
149
- isRulesLoading: C,
150
- hasRulesLoadError: te
170
+ folderItems: _,
171
+ selectedFolderPath: y,
172
+ setSelectedFolderPath: b,
173
+ handleCreateFolder: oe,
174
+ hasExistingPublicationInFolder: F,
175
+ hasWriteAccess: !y || c(y),
176
+ isSubmitting: x,
177
+ hasSubmitError: ee,
178
+ handleSubmit: se,
179
+ reset: H,
180
+ rules: w,
181
+ setRules: T,
182
+ author: A,
183
+ setAuthor: P,
184
+ publishCredentials: te,
185
+ setPublishCredentials: M,
186
+ isTargetTaken: V,
187
+ isTargetChecking: ae,
188
+ isRulesLoading: E,
189
+ hasRulesLoadError: O
151
190
  };
152
191
  }, Q = /* @__PURE__ */ function(e) {
153
192
  return e.Main = "main", e.ChangeFolder = "change-folder", e;
154
- }({}), he = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
193
+ }({}), ge = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
155
194
  let [i, o] = a(Q.Main), [s, c] = a();
156
195
  return t(() => {
157
196
  e && o(Q.Main);
@@ -167,52 +206,52 @@ var G = /* @__PURE__ */ function(e) {
167
206
  s != null && r(s), o(Q.Main);
168
207
  }
169
208
  };
170
- }, ge = (e, t) => {
209
+ }, _e = (e, t) => {
171
210
  let n = t.trim().toLowerCase();
172
211
  return n ? e.reduce((e, r) => {
173
- let i = r.children ? ge(r.children, t) : void 0;
212
+ let i = r.children ? _e(r.children, t) : void 0;
174
213
  return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
175
214
  ...r,
176
215
  children: i
177
216
  }), e;
178
217
  }, []) : e;
179
- }, _e = (e, t) => e.localeCompare(t, void 0, {
218
+ }, ve = (e, t) => e.localeCompare(t, void 0, {
180
219
  sensitivity: "base",
181
220
  numeric: !0
182
- }), ve = (e) => [...e].sort((e, t) => _e(e.name, t.name)).map((e) => e.children ? {
221
+ }), ye = (e) => [...e].sort((e, t) => ve(e.name, t.name)).map((e) => e.children ? {
183
222
  ...e,
184
- children: ve(e.children)
185
- } : e), ye = (e, t, n) => {
223
+ children: ye(e.children)
224
+ } : e), be = (e, t, n) => {
186
225
  let [r, ...i] = t;
187
226
  if (r == null) return e;
188
227
  let a = [...n, r], o = e.find((e) => e.name === r);
189
228
  return o ? i.length ? e.map((e) => e === o ? {
190
229
  ...e,
191
- children: ye(e.children ?? [], i, a)
230
+ children: be(e.children ?? [], i, a)
192
231
  } : e) : e : [...e, {
193
232
  path: a,
194
233
  name: r,
195
- children: i.length ? ye([], i, a) : void 0
234
+ children: i.length ? be([], i, a) : void 0
196
235
  }];
197
- }, be = (e, t) => t.reduce((e, t) => t.length ? ye(e, t, []) : e, e), xe = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? xe(e.children) : []]), $ = (e) => e.join("/"), Se = (e) => e.split("/").filter(Boolean), Ce = (e, t) => Se(e).at(-1) ?? t, we = (e) => e.map((e) => {
236
+ }, xe = (e, t) => t.reduce((e, t) => t.length ? be(e, t, []) : e, e), Se = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? Se(e.children) : []]), $ = (e) => e.join("/"), Ce = (e) => e.split("/").filter(Boolean), we = (e, t) => Ce(e).at(-1) ?? t, Te = (e) => e.map((e) => {
198
237
  let t = $(e.path);
199
238
  return {
200
239
  path: t,
201
240
  name: e.name,
202
241
  folderId: t,
203
242
  nodeType: p.FOLDER,
204
- items: e.children ? we(e.children) : void 0
243
+ items: e.children ? Te(e.children) : void 0
205
244
  };
206
- }), Te = /[/\\:;,={}&"]/, Ee = (e, t, n, r) => {
245
+ }), Ee = /[/\\:;,={}&"]/, De = (e, t, n, r) => {
207
246
  let i = e.trim();
208
- return i ? i.includes("..") || Te.test(i) ? n.invalid : t.some((e) => e.toLowerCase() === i.toLowerCase()) ? n.duplicate : r?.toLowerCase() === i.toLowerCase() ? n.sameAsParent ?? n.duplicate : null : n.empty;
209
- }, De = (e, t) => {
247
+ return i ? i.includes("..") || Ee.test(i) ? n.invalid : t.some((e) => e.toLowerCase() === i.toLowerCase()) ? n.duplicate : r?.toLowerCase() === i.toLowerCase() ? n.sameAsParent ?? n.duplicate : null : n.empty;
248
+ }, Oe = (e, t) => {
210
249
  let n = new Set(t.map((e) => e.toLowerCase()));
211
250
  if (!n.has(e.toLowerCase())) return e;
212
251
  let r = 2;
213
252
  for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
214
253
  return `${e} ${r}`;
215
- }, Oe = (e, t) => {
254
+ }, ke = (e, t) => {
216
255
  if (t.length === 0) return e.map((e) => e.name);
217
256
  let n = $(t), r = (e) => {
218
257
  for (let t of e) {
@@ -222,22 +261,22 @@ var G = /* @__PURE__ */ function(e) {
222
261
  }
223
262
  };
224
263
  return (r(e)?.children ?? []).map((e) => e.name);
225
- }, ke = {
264
+ }, Ae = {
226
265
  sheet: "_sheet_1jbwn_3",
227
266
  inline: "_inline_1jbwn_7",
228
267
  selectField: "_selectField_1jbwn_21",
229
268
  selectFieldOpen: "_selectFieldOpen_1jbwn_33"
230
- }, Ae = 20, je = 200, Me = 8, Ne = (e) => {
269
+ }, je = 20, Me = 200, Ne = 8, Pe = (e) => {
231
270
  let t = e.trim();
232
- if (t.length === 0 || t.length > je) return !1;
271
+ if (t.length === 0 || t.length > Me) return !1;
233
272
  try {
234
273
  return new RegExp(t) instanceof RegExp;
235
274
  } catch {
236
275
  return !1;
237
276
  }
238
- }, Pe = ({ sourceOptions: e, onSave: o, onCancel: c, disabled: l = !1, maxTargets: u = Ae, labels: d = {}, styles: f = {} }) => {
239
- let p = ce(), m = {
240
- ...se({
277
+ }, Fe = ({ sourceOptions: e, onSave: o, onCancel: c, disabled: l = !1, maxTargets: u = je, labels: d = {}, styles: f = {} }) => {
278
+ let p = oe(), m = {
279
+ ...B({
241
280
  "--pare-mobile-bg": f.colors?.mobileBackground,
242
281
  "--pare-bg": f.colors?.background,
243
282
  "--pare-select-border": f.colors?.selectBorder,
@@ -246,147 +285,147 @@ var G = /* @__PURE__ */ function(e) {
246
285
  "--pare-select-border-focus": f.colors?.selectBorderFocus
247
286
  }),
248
287
  ...f.cssVars
249
- }, { sourceLabel: h = "Source", sourcePlaceholder: g = "Select...", functionLabel: _ = "Function", equalOptionLabel: v = "Equal", containOptionLabel: y = "Contain", regexOptionLabel: x = "Regex", targetsLabel: C = "Targets", targetsPlaceholder: w = "Add a target", targetsHintLabel: te = "Press Enter or comma to add a target.", patternLabel: T = "Pattern", patternPlaceholder: D = "Enter a regular expression", invalidRegexError: O = "Enter a valid regular expression.", requiredFieldError: k = "This field is required.", targetsRequiredError: A = "Add at least one target.", saveLabel: ne = "Save", cancelLabel: j = "Cancel", dialogAriaLabel: re = "Add access rule" } = d, N = n(), P = n(), ie = n(), F = n(), I = i(null);
288
+ }, { sourceLabel: h = "Source", sourcePlaceholder: g = "Select...", functionLabel: _ = "Function", equalOptionLabel: v = "Equal", containOptionLabel: y = "Contain", regexOptionLabel: x = "Regex", targetsLabel: C = "Targets", targetsPlaceholder: w = "Add a target", targetsHintLabel: T = "Press Enter or comma to add a target.", patternLabel: E = "Pattern", patternPlaceholder: O = "Enter a regular expression", invalidRegexError: k = "Enter a valid regular expression.", requiredFieldError: A = "This field is required.", targetsRequiredError: j = "Add at least one target.", saveLabel: te = "Save", cancelLabel: M = "Cancel", dialogAriaLabel: ne = "Add access rule" } = d, P = n(), F = n(), I = n(), re = n(), L = i(null);
250
289
  t(() => {
251
- p || I.current?.focus();
290
+ p || L.current?.focus();
252
291
  }, [p]);
253
- let [L, oe] = a(), [H, U] = a(), [W, ue] = a([]), [de, fe] = a(""), [K, q] = a(!1), [J, pe] = a(""), [Y, X] = a(!1), [Z, me] = a(!1), Q = z(ke.selectField, K && ke.selectFieldOpen), he = z(ke.selectField, Y && ke.selectFieldOpen), ge = r(() => e.map((e) => ({
292
+ let [R, ae] = a(), [W, ce] = a(), [le, G] = a([]), [ue, de] = a(""), [q, J] = a(!1), [Y, fe] = a(""), [X, pe] = a(!1), [Z, me] = a(!1), he = V(Ae.selectField, q && Ae.selectFieldOpen), Q = V(Ae.selectField, X && Ae.selectFieldOpen), ge = r(() => e.map((e) => ({
254
293
  value: e,
255
294
  label: e,
256
- labelNode: J.trim() ? /* @__PURE__ */ B(S, {
295
+ labelNode: Y.trim() ? /* @__PURE__ */ H(S, {
257
296
  text: e,
258
- query: J,
297
+ query: Y,
259
298
  maxLines: 1
260
299
  }) : void 0
261
- })), [e, J]), _e = r(() => [
300
+ })), [e, Y]), _e = r(() => [
262
301
  {
263
- value: G.Equal,
302
+ value: K.Equal,
264
303
  label: v
265
304
  },
266
305
  {
267
- value: G.Contain,
306
+ value: K.Contain,
268
307
  label: y
269
308
  },
270
309
  {
271
- value: G.Regex,
310
+ value: K.Regex,
272
311
  label: x
273
312
  }
274
313
  ], [
275
314
  v,
276
315
  y,
277
316
  x
278
- ]), ve = H === G.Regex, ye = Ne(de), be = L != null && H != null && (ve ? ye : W.length > 0), xe = (e) => {
279
- oe(Array.isArray(e) ? e[0] : e), q(!1);
280
- }, $ = (e) => {
281
- let t = Array.isArray(e) ? e[0] : e;
282
- H === G.Regex != (t === G.Regex) && (ue([]), fe("")), U(t), X(!1);
317
+ ]), ve = W === K.Regex, ye = Pe(ue), be = R != null && W != null && (ve ? ye : le.length > 0), xe = (e) => {
318
+ ae(Array.isArray(e) ? e[0] : e), J(!1);
283
319
  }, Se = (e) => {
320
+ let t = Array.isArray(e) ? e[0] : e;
321
+ W === K.Regex != (t === K.Regex) && (G([]), de("")), ce(t), pe(!1);
322
+ }, $ = (e) => {
284
323
  let t = [];
285
324
  for (let n of e) {
286
325
  let e = n.trim();
287
326
  if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= u)) break;
288
327
  }
289
- ue(t);
328
+ G(t);
290
329
  }, Ce = () => {
291
- !be || L == null || H == null ? me(!0) : o({
292
- source: L,
293
- function: H,
294
- targets: ve ? [de.trim()] : W
330
+ !be || R == null || W == null ? me(!0) : o({
331
+ source: R,
332
+ function: W,
333
+ targets: ve ? [ue.trim()] : le
295
334
  });
296
- }, we = (de.length > 0 || Z) && !ye, Te = (e) => {
335
+ }, we = (ue.length > 0 || Z) && !ye, Te = (e) => {
297
336
  e.key === "Escape" && (e.stopPropagation(), c());
298
- }, Ee = /* @__PURE__ */ V(le, { children: [
299
- /* @__PURE__ */ B(M, {
300
- id: P,
337
+ }, Ee = /* @__PURE__ */ U(se, { children: [
338
+ /* @__PURE__ */ H(N, {
339
+ id: F,
301
340
  labelProps: { label: h },
302
341
  options: ge,
303
- value: L,
342
+ value: R,
304
343
  onChange: xe,
305
344
  placeholder: g,
306
- searchable: e.length > Me,
345
+ searchable: e.length > Ne,
307
346
  searchPlaceholder: g,
308
- onSearchQueryChange: pe,
347
+ onSearchQueryChange: fe,
309
348
  disabled: l,
310
- open: K,
311
- onOpenChange: q,
312
- fieldClassName: Q,
313
- invalid: Z && L == null,
314
- error: Z && L == null ? k : void 0
349
+ open: q,
350
+ onOpenChange: J,
351
+ fieldClassName: he,
352
+ invalid: Z && R == null,
353
+ error: Z && R == null ? A : void 0
315
354
  }),
316
- /* @__PURE__ */ B(M, {
355
+ /* @__PURE__ */ H(N, {
317
356
  labelProps: { label: _ },
318
- id: ie,
357
+ id: I,
319
358
  options: _e,
320
- value: H,
321
- onChange: $,
359
+ value: W,
360
+ onChange: Se,
322
361
  placeholder: _,
323
362
  disabled: l,
324
- open: Y,
325
- onOpenChange: X,
326
- fieldClassName: he,
327
- invalid: Z && H == null,
328
- error: Z && H == null ? k : void 0
363
+ open: X,
364
+ onOpenChange: pe,
365
+ fieldClassName: Q,
366
+ invalid: Z && W == null,
367
+ error: Z && W == null ? A : void 0
329
368
  }),
330
- ve ? /* @__PURE__ */ B(ee, {
331
- id: N,
332
- labelProps: { label: T },
333
- placeholder: D,
334
- value: de,
335
- onChange: (e) => fe(e ?? ""),
336
- error: we ? O : void 0,
369
+ ve ? /* @__PURE__ */ H(ee, {
370
+ id: P,
371
+ labelProps: { label: E },
372
+ placeholder: O,
373
+ value: ue,
374
+ onChange: (e) => de(e ?? ""),
375
+ error: we ? k : void 0,
337
376
  disabled: l
338
- }) : /* @__PURE__ */ B(ae, {
339
- id: F,
377
+ }) : /* @__PURE__ */ H(ie, {
378
+ id: re,
340
379
  labelProps: { label: C },
341
380
  placeholder: w,
342
- caption: Z && W.length === 0 ? void 0 : te,
343
- error: Z && W.length === 0 ? A : void 0,
344
- invalid: Z && W.length === 0,
345
- value: W,
346
- onChange: Se,
381
+ caption: Z && le.length === 0 ? void 0 : T,
382
+ error: Z && le.length === 0 ? j : void 0,
383
+ invalid: Z && le.length === 0,
384
+ value: le,
385
+ onChange: $,
347
386
  disabled: l,
348
- tagClassName: R
387
+ tagClassName: z
349
388
  }),
350
- /* @__PURE__ */ V("div", {
389
+ /* @__PURE__ */ U("div", {
351
390
  className: "mt-auto flex justify-end gap-2 desktop:mt-2",
352
- children: [/* @__PURE__ */ B(b, {
353
- label: j,
391
+ children: [/* @__PURE__ */ H(b, {
392
+ label: M,
354
393
  onClick: c,
355
394
  disabled: l
356
- }), /* @__PURE__ */ B(E, {
357
- label: ne,
395
+ }), /* @__PURE__ */ H(D, {
396
+ label: te,
358
397
  onClick: Ce,
359
398
  disabled: l
360
399
  })]
361
400
  })
362
401
  ] });
363
- return p ? /* @__PURE__ */ B(s, {
402
+ return p ? /* @__PURE__ */ H(s, {
364
403
  open: !0,
365
404
  onClose: c,
366
- ariaLabel: re,
405
+ ariaLabel: ne,
367
406
  style: m,
368
- className: ke.sheet,
407
+ className: Ae.sheet,
369
408
  bodyClassName: "flex flex-col gap-3 p-4",
370
409
  children: Ee
371
- }) : /* @__PURE__ */ B("div", {
372
- ref: I,
410
+ }) : /* @__PURE__ */ H("div", {
411
+ ref: L,
373
412
  role: "group",
374
- "aria-label": re,
413
+ "aria-label": ne,
375
414
  tabIndex: -1,
376
415
  onKeyDown: Te,
377
416
  style: m,
378
- className: z("flex flex-none flex-col gap-3 rounded-lg p-3", ke.inline),
417
+ className: V("flex flex-none flex-col gap-3 rounded-lg p-3", Ae.inline),
379
418
  children: Ee
380
419
  });
381
- }, Fe = {
420
+ }, Ie = {
382
421
  ruleRow: "_ruleRow_nx0en_1",
383
422
  heading: "_heading_nx0en_5",
384
423
  hint: "_hint_nx0en_9",
385
424
  loading: "_loading_nx0en_13",
386
425
  ruleText: "_ruleText_nx0en_17"
387
- }, Ie = 20, Le = (e, t) => e === G.Equal ? t.equal : e === G.Contain ? t.contain : t.regex, Re = ({ rules: e, onRulesChange: r, sourceOptions: o, folderName: s, disabled: l = !1, isLoading: u = !1, hasLoadError: p = !1, maxRules: m = Ie, maxTargetsPerRule: h, labels: g = {}, headingClassName: _ = "dial-body-semi-text", hintClassName: v = "dial-small-text", loadingClassName: y = "dial-small-text", ruleTextClassName: S = "dial-small-text", ruleSourceClassName: ee = "dial-small-semi-text", styles: C = {} }) => {
388
- let T = {
389
- ...se({
426
+ }, Le = 20, Re = (e, t) => e === K.Equal ? t.equal : e === K.Contain ? t.contain : t.regex, ze = ({ rules: e, onRulesChange: r, sourceOptions: o, folderName: s, disabled: l = !1, isLoading: u = !1, hasLoadError: p = !1, maxRules: m = Le, maxTargetsPerRule: h, labels: g = {}, headingClassName: _ = "dial-body-semi-text", hintClassName: v = "dial-small-text", loadingClassName: y = "dial-small-text", ruleTextClassName: S = "dial-small-text", ruleSourceClassName: ee = "dial-small-semi-text", styles: C = {} }) => {
427
+ let E = {
428
+ ...B({
390
429
  "--par-rule-bg": C.colors?.ruleBackground,
391
430
  "--par-heading-text": C.colors?.headingText,
392
431
  "--par-hint-text": C.colors?.hintText,
@@ -394,149 +433,149 @@ var G = /* @__PURE__ */ function(e) {
394
433
  "--par-rule-text": C.colors?.ruleText
395
434
  }),
396
435
  ...C.cssVars
397
- }, { heading: E = "Allow access if all match", folderScopeHint: A = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: ne = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: j = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: M = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: re = "Add rule", clearAllLabel: N = "Clear all", orSeparatorLabel: P = "Or", removeRuleAriaLabelTemplate: F = "Remove rule for {source}: {targets}", equalFunctionLabel: ae = "Equal", containFunctionLabel: I = "Contain", regexFunctionLabel: L = "Regex", loadingLabel: oe = "Loading existing rules…", loadErrorLabel: R = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: ce = "Rule added.", ruleRemovedAnnouncement: le = "Rule removed.", rulesClearedAnnouncement: H = "All rules cleared.", rulesLoadedAnnouncement: U = "Existing rules loaded for the selected folder.", editorLabels: de } = g, fe = n(), [G, K] = a(!1), [q, J] = a(""), pe = i(null), Y = i(u);
436
+ }, { heading: D = "Allow access if all match", folderScopeHint: j = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: te = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: M = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: N = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: ne = "Add rule", clearAllLabel: P = "Clear all", orSeparatorLabel: F = "Or", removeRuleAriaLabelTemplate: re = "Remove rule for {source}: {targets}", equalFunctionLabel: ie = "Equal", containFunctionLabel: L = "Contain", regexFunctionLabel: R = "Regex", loadingLabel: ae = "Loading existing rules…", loadErrorLabel: z = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: oe = "Rule added.", ruleRemovedAnnouncement: se = "Rule removed.", rulesClearedAnnouncement: W = "All rules cleared.", rulesLoadedAnnouncement: ce = "Existing rules loaded for the selected folder.", editorLabels: ue } = g, de = n(), [K, q] = a(!1), [J, Y] = a(""), fe = i(null), X = i(u);
398
437
  t(() => {
399
- Y.current && !u && e.length > 0 && J(U), Y.current = u;
438
+ X.current && !u && e.length > 0 && Y(ce), X.current = u;
400
439
  }, [
401
440
  u,
402
441
  e,
403
- U
442
+ ce
404
443
  ]);
405
- let X = () => {
406
- pe.current = document.activeElement, K(!0);
444
+ let pe = () => {
445
+ fe.current = document.activeElement, q(!0);
407
446
  }, Z = () => {
408
- K(!1), pe.current?.focus?.();
447
+ q(!1), fe.current?.focus?.();
409
448
  }, me = (t) => {
410
- r([...e, t]), J(ce), Z();
411
- }, Q = (t) => {
412
- r(e.filter((e, n) => n !== t)), J(le);
413
- }, he = () => {
414
- r([]), J(H);
449
+ r([...e, t]), Y(oe), Z();
450
+ }, he = (t) => {
451
+ r(e.filter((e, n) => n !== t)), Y(se);
452
+ }, Q = () => {
453
+ r([]), Y(W);
415
454
  }, ge = {
416
- equal: ae,
417
- contain: I,
418
- regex: L
455
+ equal: ie,
456
+ contain: L,
457
+ regex: R
419
458
  }, _e = e.length >= m, ve = l || _e, ye = s != null && s !== "";
420
- return /* @__PURE__ */ V("div", {
459
+ return /* @__PURE__ */ U("div", {
421
460
  role: "group",
422
- "aria-labelledby": fe,
423
- style: T,
424
- className: z(l && "pointer-events-none opacity-60"),
461
+ "aria-labelledby": de,
462
+ style: E,
463
+ className: V(l && "pointer-events-none opacity-60"),
425
464
  children: [
426
- /* @__PURE__ */ B(w, {
465
+ /* @__PURE__ */ H(w, {
427
466
  visuallyHidden: !0,
428
- as: te.Span,
429
- children: q
467
+ as: T.Span,
468
+ children: J
430
469
  }),
431
- /* @__PURE__ */ V("div", {
470
+ /* @__PURE__ */ U("div", {
432
471
  className: "mb-1 flex items-center justify-between gap-2",
433
- children: [/* @__PURE__ */ B("div", {
434
- id: fe,
435
- className: z(_, Fe.heading),
436
- children: E
437
- }), e.length > 0 && /* @__PURE__ */ B(b, {
472
+ children: [/* @__PURE__ */ H("div", {
473
+ id: de,
474
+ className: V(_, Ie.heading),
475
+ children: D
476
+ }), e.length > 0 && /* @__PURE__ */ H(b, {
438
477
  variant: c.Primary,
439
- label: N,
440
- onClick: he,
478
+ label: P,
479
+ onClick: Q,
441
480
  disabled: l
442
481
  })]
443
482
  }),
444
- /* @__PURE__ */ B("p", {
445
- className: z("mb-2", v, Fe.hint),
446
- children: ye ? A.replace("{folder}", s) : ne
483
+ /* @__PURE__ */ H("p", {
484
+ className: V("mb-2", v, Ie.hint),
485
+ children: ye ? j.replace("{folder}", s) : te
447
486
  }),
448
- e.length > 0 && !ye && /* @__PURE__ */ B("div", {
487
+ e.length > 0 && !ye && /* @__PURE__ */ H("div", {
449
488
  className: "mb-2",
450
- children: /* @__PURE__ */ B(D, {
451
- type: O.SectionMessage,
452
- variant: k.Warning,
453
- message: j
489
+ children: /* @__PURE__ */ H(O, {
490
+ type: k.SectionMessage,
491
+ variant: A.Warning,
492
+ message: M
454
493
  })
455
494
  }),
456
- u && /* @__PURE__ */ V("div", {
457
- className: z("mb-2 flex items-center gap-2", y, Fe.loading),
458
- children: [/* @__PURE__ */ B(ie, {
495
+ u && /* @__PURE__ */ U("div", {
496
+ className: V("mb-2 flex items-center gap-2", y, Ie.loading),
497
+ children: [/* @__PURE__ */ H(I, {
459
498
  size: 16,
460
- ariaLabel: oe
461
- }), /* @__PURE__ */ B("span", { children: oe })]
499
+ ariaLabel: ae
500
+ }), /* @__PURE__ */ H("span", { children: ae })]
462
501
  }),
463
- p && /* @__PURE__ */ B("div", {
502
+ p && /* @__PURE__ */ H("div", {
464
503
  className: "mb-2",
465
- children: /* @__PURE__ */ B(D, {
466
- type: O.SectionMessage,
467
- variant: k.Warning,
468
- message: R
504
+ children: /* @__PURE__ */ H(O, {
505
+ type: k.SectionMessage,
506
+ variant: A.Warning,
507
+ message: z
469
508
  })
470
509
  }),
471
- e.length > 0 && /* @__PURE__ */ B("ul", {
510
+ e.length > 0 && /* @__PURE__ */ H("ul", {
472
511
  className: "mb-3 flex flex-col gap-2",
473
512
  children: e.map((e, t) => {
474
- let n = e.targets.join(` ${P} `), r = F.replace("{source}", e.source).replace("{targets}", n);
475
- return /* @__PURE__ */ V("li", {
476
- className: z("flex items-center justify-between gap-2 rounded-lg px-3 py-2", Fe.ruleRow),
477
- children: [/* @__PURE__ */ V("span", {
478
- className: z("truncate", S, Fe.ruleText),
513
+ let n = e.targets.join(` ${F} `), r = re.replace("{source}", e.source).replace("{targets}", n);
514
+ return /* @__PURE__ */ U("li", {
515
+ className: V("flex items-center justify-between gap-2 rounded-lg px-3 py-2", Ie.ruleRow),
516
+ children: [/* @__PURE__ */ U("span", {
517
+ className: V("truncate", S, Ie.ruleText),
479
518
  children: [
480
- /* @__PURE__ */ B("span", {
519
+ /* @__PURE__ */ H("span", {
481
520
  className: ee,
482
521
  children: e.source
483
522
  }),
484
523
  " ",
485
- Le(e.function, ge),
524
+ Re(e.function, ge),
486
525
  ": ",
487
526
  n
488
527
  ]
489
- }), /* @__PURE__ */ B(x, {
490
- icon: /* @__PURE__ */ B(ue, {
528
+ }), /* @__PURE__ */ H(x, {
529
+ icon: /* @__PURE__ */ H(G, {
491
530
  size: d.SM,
492
531
  "aria-hidden": !0,
493
532
  stroke: f
494
533
  }),
495
534
  "aria-label": r,
496
- onClick: () => Q(t),
535
+ onClick: () => he(t),
497
536
  disabled: l
498
537
  })]
499
538
  }, t);
500
539
  })
501
540
  }),
502
- G && /* @__PURE__ */ B(Pe, {
541
+ K && /* @__PURE__ */ H(Fe, {
503
542
  sourceOptions: o,
504
543
  onSave: me,
505
544
  onCancel: Z,
506
545
  disabled: l,
507
546
  maxTargets: h,
508
- labels: de,
547
+ labels: ue,
509
548
  styles: C.editor
510
549
  }),
511
- /* @__PURE__ */ B("div", {
550
+ /* @__PURE__ */ H("div", {
512
551
  className: "flex flex-wrap items-center gap-2",
513
- children: /* @__PURE__ */ B(b, {
514
- label: re,
515
- iconBefore: /* @__PURE__ */ B(W, {
552
+ children: /* @__PURE__ */ H(b, {
553
+ label: ne,
554
+ iconBefore: /* @__PURE__ */ H(le, {
516
555
  size: d.SM,
517
556
  "aria-hidden": !0,
518
557
  stroke: f
519
558
  }),
520
- onClick: X,
559
+ onClick: pe,
521
560
  disabled: ve
522
561
  })
523
562
  }),
524
- _e && /* @__PURE__ */ B("p", {
525
- className: z("mt-2", v, Fe.hint),
526
- children: M.replace("{max}", String(m))
563
+ _e && /* @__PURE__ */ H("p", {
564
+ className: V("mt-2", v, Ie.hint),
565
+ children: N.replace("{max}", String(m))
527
566
  })
528
567
  ]
529
568
  });
530
- }, ze = /* @__PURE__ */ function(e) {
569
+ }, Be = /* @__PURE__ */ function(e) {
531
570
  return e.NotPublished = "not-published", e.InReview = "in-review", e.Published = "published", e.Unknown = "unknown", e;
532
- }({}), Be = {
571
+ }({}), Ve = {
533
572
  skeletonColor: "var(--pp-vh-skeleton, var(--bg-control-disable-primary, #dce0e8))",
534
573
  heading: "_heading_s0cgn_2",
535
574
  version: "_version_s0cgn_6",
536
575
  date: "_date_s0cgn_10",
537
576
  meta: "_meta_s0cgn_15",
538
577
  row: "_row_s0cgn_19"
539
- }, Ve = {
578
+ }, He = {
540
579
  heading: "Versions history",
541
580
  inReviewLabel: "In review",
542
581
  publishedLabel: "Published",
@@ -545,21 +584,21 @@ var G = /* @__PURE__ */ function(e) {
545
584
  emptyLabel: "No saved versions yet.",
546
585
  errorLabel: "Could not load publication statuses.",
547
586
  retryLabel: "Retry"
548
- }, He = (e, t) => {
587
+ }, Ue = (e, t) => {
549
588
  switch (e.status) {
550
- case ze.InReview: return t.inReviewLabel;
551
- case ze.Unknown: return t.unknownLabel;
552
- case ze.Published: return t.publishedLabel;
589
+ case Be.InReview: return t.inReviewLabel;
590
+ case Be.Unknown: return t.unknownLabel;
591
+ case Be.Published: return t.publishedLabel;
553
592
  default: return;
554
593
  }
555
- }, Ue = ({ rows: e, isLoading: r = !1, hasError: i = !1, onRetry: s, labels: c = {}, headingClassName: l = "dial-body-semi-text", versionClassName: u = "dial-small-semi-text", dateClassName: d = "dial-small-text", metaClassName: f = "dial-tiny-text", styles: p = {} }) => {
594
+ }, We = ({ rows: e, isLoading: r = !1, hasError: i = !1, onRetry: s, labels: c = {}, headingClassName: l = "dial-body-semi-text", versionClassName: u = "dial-small-semi-text", dateClassName: d = "dial-small-text", metaClassName: f = "dial-tiny-text", styles: p = {} }) => {
556
595
  let m = n(), [v, b] = a(!1);
557
596
  t(() => b(!0), []);
558
597
  let x = {
559
- ...Ve,
598
+ ...He,
560
599
  ...c
561
600
  }, { colors: S } = p, ee = {
562
- ...se({
601
+ ...B({
563
602
  "--pp-vh-heading-text": S?.headingText,
564
603
  "--pp-vh-version-text": S?.versionText,
565
604
  "--pp-vh-date-text": S?.dateText,
@@ -569,69 +608,69 @@ var G = /* @__PURE__ */ function(e) {
569
608
  }),
570
609
  ...p.cssVars
571
610
  };
572
- return /* @__PURE__ */ V("section", {
611
+ return /* @__PURE__ */ U("section", {
573
612
  "aria-labelledby": m,
574
613
  className: "flex flex-col gap-2",
575
614
  style: ee,
576
615
  children: [
577
- /* @__PURE__ */ B("h2", {
616
+ /* @__PURE__ */ H("h2", {
578
617
  id: m,
579
- className: z(l, Be.heading),
618
+ className: V(l, Ve.heading),
580
619
  children: x.heading
581
620
  }),
582
- /* @__PURE__ */ B(w, {
621
+ /* @__PURE__ */ H(w, {
583
622
  visuallyHidden: !0,
584
- politeness: T.Polite,
623
+ politeness: E.Polite,
585
624
  children: v && r && !i ? x.loadingLabel : ""
586
625
  }),
587
- /* @__PURE__ */ B(w, {
588
- politeness: T.Assertive,
589
- children: i && /* @__PURE__ */ V("div", {
626
+ /* @__PURE__ */ H(w, {
627
+ politeness: E.Assertive,
628
+ children: i && /* @__PURE__ */ U("div", {
590
629
  className: "flex flex-wrap items-center gap-2",
591
- children: [/* @__PURE__ */ B(_, { text: x.errorLabel }), s && /* @__PURE__ */ B(C, {
630
+ children: [/* @__PURE__ */ H(_, { text: x.errorLabel }), s && /* @__PURE__ */ H(C, {
592
631
  label: x.retryLabel,
593
632
  size: h.Small,
594
633
  onClick: s
595
634
  })]
596
635
  })
597
636
  }),
598
- e.length === 0 ? /* @__PURE__ */ B("p", {
599
- className: z(f, Be.meta),
637
+ e.length === 0 ? /* @__PURE__ */ H("p", {
638
+ className: V(f, Ve.meta),
600
639
  children: x.emptyLabel
601
- }) : /* @__PURE__ */ B("ul", { children: e.map((e) => {
602
- let t = He(e, x), n = e.status == null && r && !i;
603
- return /* @__PURE__ */ V("li", {
604
- className: z("flex flex-col gap-1 py-2", Be.row),
605
- children: [/* @__PURE__ */ V("div", {
640
+ }) : /* @__PURE__ */ H("ul", { children: e.map((e) => {
641
+ let t = Ue(e, x), n = e.status == null && r && !i;
642
+ return /* @__PURE__ */ U("li", {
643
+ className: V("flex flex-col gap-1 py-2", Ve.row),
644
+ children: [/* @__PURE__ */ U("div", {
606
645
  className: "flex min-h-6 min-w-0 items-center gap-2",
607
646
  children: [
608
- /* @__PURE__ */ B(g, {
647
+ /* @__PURE__ */ H(g, {
609
648
  text: e.version,
610
- className: z("flex-initial!", u, Be.version)
649
+ className: V("flex-initial!", u, Ve.version)
611
650
  }),
612
- t && /* @__PURE__ */ B(o, { label: t }),
613
- n && /* @__PURE__ */ B("span", {
651
+ t && /* @__PURE__ */ H(o, { label: t }),
652
+ n && /* @__PURE__ */ H("span", {
614
653
  "aria-hidden": !0,
615
654
  className: "shrink-0",
616
- children: /* @__PURE__ */ B(N, {
617
- variant: P.Text,
655
+ children: /* @__PURE__ */ H(P, {
656
+ variant: F.Text,
618
657
  width: "84px",
619
658
  height: "24px",
620
- color: Be.skeletonColor
659
+ color: Ve.skeletonColor
621
660
  })
622
661
  }),
623
- e.modifiedAt && /* @__PURE__ */ B("span", {
624
- className: z("ms-auto shrink-0", d, Be.date),
662
+ e.modifiedAt && /* @__PURE__ */ H("span", {
663
+ className: V("ms-auto shrink-0", d, Ve.date),
625
664
  children: e.modifiedAt
626
665
  })
627
666
  ]
628
- }), (e.folder || e.author) && /* @__PURE__ */ V("div", {
667
+ }), (e.folder || e.author) && /* @__PURE__ */ U("div", {
629
668
  className: "flex min-w-0 items-center justify-between gap-2",
630
- children: [e.folder && /* @__PURE__ */ B(y, {
669
+ children: [e.folder && /* @__PURE__ */ H(y, {
631
670
  name: e.folder,
632
- nameClassName: z(f, Be.meta)
633
- }), e.author && /* @__PURE__ */ B("span", {
634
- className: z("ms-auto shrink-0", f, Be.meta),
671
+ nameClassName: V(f, Ve.meta)
672
+ }), e.author && /* @__PURE__ */ H("span", {
673
+ className: V("ms-auto shrink-0", f, Ve.meta),
635
674
  children: e.author
636
675
  })]
637
676
  })]
@@ -639,87 +678,120 @@ var G = /* @__PURE__ */ function(e) {
639
678
  }) })
640
679
  ]
641
680
  });
642
- }, We = {
681
+ }, Ge = {
643
682
  panel: "dial-publish-panel-panel",
644
683
  dependencies: "dial-publish-panel-dependencies",
645
684
  dependenciesList: "dial-publish-panel-dependencies-list",
646
685
  dependenciesItem: "dial-publish-panel-dependencies-item"
647
- }, Ge = {
648
- heading: "_heading_k0m34_1",
649
- name: "_name_k0m34_5",
650
- meta: "_meta_k0m34_9"
651
686
  }, Ke = {
652
- [q.Application]: "Application",
653
- [q.Toolset]: "Toolset",
654
- [q.Prompt]: "Prompt",
655
- [q.Skill]: "Skill",
656
- [q.File]: "File"
657
- }, qe = 32, Je = 24, Ye = (e) => /* @__PURE__ */ B("span", {
658
- "aria-hidden": "true",
659
- className: "shrink-0",
660
- children: e.type === q.File ? /* @__PURE__ */ B("span", {
661
- className: "flex items-center justify-center",
662
- style: {
663
- width: qe,
664
- height: qe
665
- },
666
- children: /* @__PURE__ */ B(v, {
667
- decorative: !0,
668
- size: Je,
669
- name: e.name,
670
- type: e.isFolder ? m.Folder : m.File
687
+ heading: "_heading_18b5e_1",
688
+ name: "_name_18b5e_5",
689
+ meta: "_meta_18b5e_9",
690
+ caption: "_caption_18b5e_13",
691
+ type: "_type_18b5e_17",
692
+ row: "_row_18b5e_21"
693
+ }, qe = {
694
+ [J.Application]: "Application",
695
+ [J.Toolset]: "Toolset",
696
+ [J.Prompt]: "Prompt",
697
+ [J.Skill]: "Skill",
698
+ [J.File]: "File"
699
+ }, Je = 32, Ye = 24, Xe = 40, Ze = 32, Qe = (e, t) => {
700
+ let n = t ? Xe : Je;
701
+ return /* @__PURE__ */ H("span", {
702
+ "aria-hidden": "true",
703
+ className: "shrink-0",
704
+ children: e.type === J.File ? /* @__PURE__ */ H("span", {
705
+ className: "flex items-center justify-center",
706
+ style: {
707
+ width: n,
708
+ height: n
709
+ },
710
+ children: /* @__PURE__ */ H(v, {
711
+ decorative: !0,
712
+ size: t ? Ze : Ye,
713
+ name: e.name,
714
+ type: e.isFolder ? m.Folder : m.File
715
+ })
716
+ }) : /* @__PURE__ */ H(R, {
717
+ size: n,
718
+ src: e.iconUrl,
719
+ initialsName: e.name,
720
+ styles: { badgeClassName: t ? "rounded-xl" : "rounded-lg" }
671
721
  })
672
- }) : /* @__PURE__ */ B(L, {
673
- size: qe,
674
- src: e.iconUrl,
675
- initialsName: e.name,
676
- styles: { badgeClassName: "rounded-lg" }
677
- })
678
- }), Xe = "Private dependencies", Ze = "This item depends on personal private resources (listed below). After publishing, other users may not be able to use it fully, or may run into problems.", Qe = (e) => `${e} ${e === 1 ? "dependency is" : "dependencies are"} not public yet`, $e = ({ dependencies: e, labels: t = {}, headingClassName: r = "dial-body-semi-text", nameClassName: i = "dial-small-semi-text", metaClassName: a = "dial-small-text", styles: o = {} }) => {
679
- let s = n(), { title: c = Xe, description: l = Ze, typeLabels: u = {}, getAnnouncement: d = Qe } = t, { colors: f } = o, p = {
680
- ...se({
681
- "--pp-dependencies-heading-text": f?.headingText,
682
- "--pp-dependencies-name-text": f?.nameText,
683
- "--pp-dependencies-meta-text": f?.metaText
722
+ });
723
+ }, $e = "Private dependencies", et = "This item depends on personal private resources (listed below). After publishing, other users may not be able to use it fully, or may run into problems.", tt = (e) => `${e} ${e === 1 ? "dependency is" : "dependencies are"} not public yet`, nt = ({ dependencies: e, labels: t = {}, headingClassName: r = "dial-body-semi-text", nameClassName: i, metaClassName: a = "dial-small-text", captionClassName: o = "dial-tiny-text", typeClassName: s = "dial-tiny-lead-semi-text", styles: c = {} }) => {
724
+ let l = n(), { title: u = $e, description: d = et, appearance: f = Y.Warning, typeLabels: p = {}, getAnnouncement: m = tt } = t, h = f === Y.Published, g = i ?? (h ? "dial-body-semi-text" : "dial-small-semi-text"), { colors: _ } = c, v = {
725
+ ...B({
726
+ "--pp-dependencies-heading-text": _?.headingText,
727
+ "--pp-dependencies-name-text": _?.nameText,
728
+ "--pp-dependencies-meta-text": _?.metaText,
729
+ "--pp-dependencies-caption-text": _?.captionText,
730
+ "--pp-dependencies-type-text": _?.typeText,
731
+ "--pp-dependencies-divider": _?.divider
684
732
  }),
685
- ...o.cssVars
686
- }, m = e.length;
687
- return /* @__PURE__ */ V(le, { children: [/* @__PURE__ */ B(w, {
733
+ ...c.cssVars
734
+ }, y = e.length;
735
+ return /* @__PURE__ */ U(se, { children: [/* @__PURE__ */ H(w, {
688
736
  visuallyHidden: !0,
689
- as: te.Span,
690
- children: m > 0 ? d(m) : ""
691
- }), m > 0 && /* @__PURE__ */ V("section", {
692
- "aria-labelledby": s,
693
- className: z("flex flex-col gap-3", We.dependencies),
694
- style: p,
737
+ as: T.Span,
738
+ children: y > 0 ? m(y) : ""
739
+ }), y > 0 && /* @__PURE__ */ U("section", {
740
+ "aria-labelledby": l,
741
+ className: V("flex flex-col", h ? "gap-2" : "gap-3", Ge.dependencies),
742
+ style: v,
695
743
  children: [
696
- /* @__PURE__ */ B("h2", {
697
- id: s,
698
- className: z(r, Ge.heading),
699
- children: c
744
+ /* @__PURE__ */ H("h2", {
745
+ id: l,
746
+ className: V(r, Ke.heading),
747
+ children: u
700
748
  }),
701
- /* @__PURE__ */ B(D, {
702
- type: O.SectionMessage,
703
- variant: k.Warning,
704
- message: l,
749
+ h ? /* @__PURE__ */ H("p", {
750
+ className: V(o, Ke.caption),
751
+ children: d
752
+ }) : /* @__PURE__ */ H(O, {
753
+ type: k.SectionMessage,
754
+ variant: A.Warning,
755
+ message: d,
705
756
  role: "note"
706
757
  }),
707
- /* @__PURE__ */ B("ul", {
708
- className: We.dependenciesList,
709
- children: e.map((e) => {
710
- let t = u[e.type] ?? Ke[e.type];
711
- return /* @__PURE__ */ V("li", {
712
- className: z("flex items-center gap-3 py-2", We.dependenciesItem),
713
- children: [Ye(e), /* @__PURE__ */ V("div", {
758
+ /* @__PURE__ */ H("ul", {
759
+ className: Ge.dependenciesList,
760
+ children: e.map(h ? (e) => {
761
+ let t = p[e.type] ?? qe[e.type];
762
+ return /* @__PURE__ */ U("li", {
763
+ className: V("flex items-center gap-3 py-3", Ke.row, Ge.dependenciesItem),
764
+ children: [Qe(e, !0), /* @__PURE__ */ U("div", {
765
+ className: "flex min-w-0 flex-col",
766
+ children: [/* @__PURE__ */ U("span", {
767
+ className: V("truncate", s, Ke.type),
768
+ children: [t, e.location && /* @__PURE__ */ H("span", {
769
+ className: V("ms-1 normal-case", a, Ke.meta),
770
+ children: `· ${e.location}`
771
+ })]
772
+ }), /* @__PURE__ */ U("span", {
773
+ className: V("truncate", g, Ke.name),
774
+ children: [e.name, e.version != null && /* @__PURE__ */ H("span", {
775
+ className: V("ms-2", a, Ke.meta),
776
+ children: e.version
777
+ })]
778
+ })]
779
+ })]
780
+ }, e.id);
781
+ } : (e) => {
782
+ let t = p[e.type] ?? qe[e.type];
783
+ return /* @__PURE__ */ U("li", {
784
+ className: V("flex items-center gap-3 py-2", Ge.dependenciesItem),
785
+ children: [Qe(e, !1), /* @__PURE__ */ U("div", {
714
786
  className: "flex min-w-0 flex-col",
715
- children: [/* @__PURE__ */ V("span", {
716
- className: z("truncate", i, Ge.name),
717
- children: [e.name, e.version != null && /* @__PURE__ */ B("span", {
718
- className: z("ms-2", a, Ge.meta),
787
+ children: [/* @__PURE__ */ U("span", {
788
+ className: V("truncate", g, Ke.name),
789
+ children: [e.name, e.version != null && /* @__PURE__ */ H("span", {
790
+ className: V("ms-2", a, Ke.meta),
719
791
  children: e.version
720
792
  })]
721
- }), /* @__PURE__ */ B("span", {
722
- className: z("truncate", a, Ge.meta),
793
+ }), /* @__PURE__ */ H("span", {
794
+ className: V("truncate", a, Ke.meta),
723
795
  children: e.location ? `${t} · ${e.location}` : t
724
796
  })]
725
797
  })]
@@ -728,15 +800,15 @@ var G = /* @__PURE__ */ function(e) {
728
800
  })
729
801
  ]
730
802
  })] });
731
- }, et = {
803
+ }, rt = {
732
804
  currentBadge: "_currentBadge_d0adf_1",
733
805
  sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
734
806
  version: "_version_d0adf_13",
735
807
  date: "_date_d0adf_17",
736
808
  emptyState: "_emptyState_d0adf_21",
737
809
  stripedRow: "_stripedRow_d0adf_25"
738
- }, tt = ({ entries: e, currentVersion: t, isLoading: n = !1, hasError: r = !1, versionPrefix: i = "Version", currentBadgeLabel: a = "Current", sharedCredentialsLabel: o = "Shared credentials", emptyStateLabel: s = "Not published to this folder yet — this will be the first version here.", loadingLabel: c = "Loading history…", errorLabel: l = "Failed to load publish history.", versionClassName: u = "dial-small-text", dateClassName: d = "dial-small-text", emptyStateClassName: f = "dial-small-text", colors: p }) => {
739
- let m = se({
810
+ }, it = ({ entries: e, currentVersion: t, isLoading: n = !1, hasError: r = !1, versionPrefix: i = "Version", currentBadgeLabel: a = "Current", sharedCredentialsLabel: o = "Shared credentials", emptyStateLabel: s = "Not published to this folder yet — this will be the first version here.", loadingLabel: c = "Loading history…", errorLabel: l = "Failed to load publish history.", versionClassName: u = "dial-small-text", dateClassName: d = "dial-small-text", emptyStateClassName: f = "dial-small-text", colors: p }) => {
811
+ let m = B({
740
812
  "--phl-badge-border": p?.currentBadgeBorder,
741
813
  "--phl-badge-bg": p?.currentBadgeBackground,
742
814
  "--phl-badge-text": p?.currentBadgeText,
@@ -747,191 +819,191 @@ var G = /* @__PURE__ */ function(e) {
747
819
  "--phl-date-text": p?.dateText,
748
820
  "--phl-empty-text": p?.emptyStateText,
749
821
  "--phl-striped-bg": p?.stripedBackground
750
- }), h = z(f, et.emptyState);
822
+ }), h = V(f, rt.emptyState);
751
823
  if (n || r || e.length === 0) {
752
824
  let e = s;
753
- return n ? e = c : r && (e = l), /* @__PURE__ */ B(w, {
754
- as: te.P,
825
+ return n ? e = c : r && (e = l), /* @__PURE__ */ H(w, {
826
+ as: T.P,
755
827
  style: m,
756
828
  className: h,
757
829
  children: e
758
830
  });
759
831
  }
760
- return /* @__PURE__ */ B("ul", {
832
+ return /* @__PURE__ */ H("ul", {
761
833
  style: m,
762
- children: e.map((e, n) => /* @__PURE__ */ V("li", {
763
- className: z("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && et.stripedRow),
764
- children: [/* @__PURE__ */ V("span", {
834
+ children: e.map((e, n) => /* @__PURE__ */ U("li", {
835
+ className: V("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && rt.stripedRow),
836
+ children: [/* @__PURE__ */ U("span", {
765
837
  className: "flex min-w-0 items-center gap-2",
766
838
  style: m,
767
839
  children: [
768
- /* @__PURE__ */ V("span", {
769
- className: z(u, et.version),
840
+ /* @__PURE__ */ U("span", {
841
+ className: V(u, rt.version),
770
842
  children: [
771
843
  i,
772
844
  " ",
773
845
  e.version
774
846
  ]
775
847
  }),
776
- e.version === t && /* @__PURE__ */ B(F, {
848
+ e.version === t && /* @__PURE__ */ H(re, {
777
849
  label: a,
778
- className: z("shrink-0 whitespace-nowrap", et.currentBadge)
850
+ className: V("shrink-0 whitespace-nowrap", rt.currentBadge)
779
851
  }),
780
- e.publishCredentials === !0 && /* @__PURE__ */ B(F, {
852
+ e.publishCredentials === !0 && /* @__PURE__ */ H(re, {
781
853
  label: o,
782
- className: z("shrink-0 whitespace-nowrap", et.sharedCredentialsBadge)
854
+ className: V("shrink-0 whitespace-nowrap", rt.sharedCredentialsBadge)
783
855
  })
784
856
  ]
785
- }), /* @__PURE__ */ B("span", {
786
- className: z(d, et.date),
787
- children: Y(e.publishedAt)
857
+ }), /* @__PURE__ */ H("span", {
858
+ className: V(d, rt.date),
859
+ children: pe(e.publishedAt)
788
860
  })]
789
861
  }, `${e.version}-${n}`))
790
862
  });
791
- }, nt = ":", rt = (e) => `${nt}${e}`, it = (e) => e?.startsWith(nt) ? e.slice(1) : void 0, at = (e) => [rt(e.rootKey), ...e.path], ot = (e) => {
792
- let [t, ...n] = e, r = it(t);
863
+ }, at = ":", ot = (e) => `${at}${e}`, st = (e) => e?.startsWith(at) ? e.slice(1) : void 0, ct = (e) => [ot(e.rootKey), ...e.path], lt = (e) => {
864
+ let [t, ...n] = e, r = st(t);
793
865
  return r == null ? void 0 : {
794
866
  rootKey: r,
795
867
  path: n
796
868
  };
797
- }, st = (e, t) => e.map((e) => ({
869
+ }, ut = (e, t) => e.map((e) => ({
798
870
  ...e,
799
871
  path: [t, ...e.path],
800
- children: e.children ? st(e.children, t) : void 0
801
- })), ct = (e) => e.map((e) => {
802
- let t = rt(e.key);
872
+ children: e.children ? ut(e.children, t) : void 0
873
+ })), dt = (e) => e.map((e) => {
874
+ let t = ot(e.key);
803
875
  return {
804
876
  path: [t],
805
877
  name: e.label,
806
- children: st(ve(e.items), t)
878
+ children: ut(ye(e.items), t)
807
879
  };
808
- }), lt = (e) => e.map((e) => rt(e.key)), ut = (e, t) => {
880
+ }), ft = (e) => e.map((e) => ot(e.key)), pt = (e, t) => {
809
881
  let n = /* @__PURE__ */ new Set();
810
882
  for (let r of e) {
811
- let e = rt(r.key);
883
+ let e = ot(r.key);
812
884
  for (let i of t(r) ?? []) n.add(i ? `${e}/${i}` : e);
813
885
  }
814
886
  return n;
815
- }, dt = (e, t) => {
887
+ }, mt = (e, t) => {
816
888
  let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
817
889
  for (let e of t) {
818
- let [t, ...r] = e.split("/"), i = it(t);
890
+ let [t, ...r] = e.split("/"), i = st(t);
819
891
  i != null && r.length !== 0 && n.get(i)?.add($(r));
820
892
  }
821
893
  return n;
822
- }, ft = {
894
+ }, ht = {
823
895
  divider: "_divider_1gs31_1",
824
896
  tree: "_tree_1gs31_17"
825
- }, pt = "data-cancel-creating-folder", mt = "", ht = [], gt = ({ items: e = ht, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: c, destination: l, onDestinationChange: u, onCreateDestinationFolder: p, searchQuery: m, getDisabledReason: h, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: v = "Cancel", addSiblingFolderLabel: y = "Add sibling", addChildFolderLabel: x = "Add child", newFolderDefaultName: S = "New folder", noResultsLabel: ee = "No folders match \"{query}\".", emptyFolderNameError: C = "Folder name cannot be empty.", invalidFolderNameError: w = "Folder name contains invalid characters.", duplicateFolderNameError: te = "A folder with this name already exists.", sameAsParentFolderNameError: T = "A folder cannot have the same name as its parent folder.", rootLabel: E = "Organization", expandedPaths: D, onExpandedPathsChange: O, loadingPaths: k, styles: A = {} }) => {
826
- let ne = {
827
- ...se({ "--pft-divider": A.colors?.divider }),
828
- ...A.cssVars
829
- }, j = c != null, M = r(() => c ? ct(c) : e, [c, e]), re = i(M);
897
+ }, gt = "data-cancel-creating-folder", _t = "", vt = [], yt = ({ items: e = vt, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: c, destination: l, onDestinationChange: u, onCreateDestinationFolder: p, searchQuery: m, getDisabledReason: h, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: v = "Cancel", addSiblingFolderLabel: y = "Add sibling", addChildFolderLabel: x = "Add child", newFolderDefaultName: S = "New folder", noResultsLabel: ee = "No folders match \"{query}\".", emptyFolderNameError: C = "Folder name cannot be empty.", invalidFolderNameError: w = "Folder name contains invalid characters.", duplicateFolderNameError: T = "A folder with this name already exists.", sameAsParentFolderNameError: E = "A folder cannot have the same name as its parent folder.", rootLabel: D = "Organization", expandedPaths: O, onExpandedPathsChange: k, loadingPaths: A, styles: j = {} }) => {
898
+ let te = {
899
+ ...B({ "--pft-divider": j.colors?.divider }),
900
+ ...j.cssVars
901
+ }, M = c != null, N = r(() => c ? dt(c) : e, [c, e]), ne = i(N);
830
902
  t(() => {
831
- re.current = M;
832
- }, [M]);
833
- let N = r(() => c ? lt(c) : [mt], [c]), P = n;
834
- j && (P = l ? at(l) : void 0);
835
- let ie = (e) => {
836
- j ? u?.(e ? ot(e) : void 0) : o?.(e);
837
- }, [F, ae] = a(() => new Set(P?.map((e, t) => $(P.slice(0, t + 1))) ?? [])), I = r(() => c ? /* @__PURE__ */ new Set([...F, ...ut(c, (e) => e.expandedPaths)]) : void 0, [c, F]) ?? D ?? F, L = r(() => c ? ut(c, (e) => e.loadingPaths) : k, [c, k]), oe = (e) => {
903
+ ne.current = N;
904
+ }, [N]);
905
+ let P = r(() => c ? ft(c) : [_t], [c]), F = n;
906
+ M && (F = l ? ct(l) : void 0);
907
+ let I = (e) => {
908
+ M ? u?.(e ? lt(e) : void 0) : o?.(e);
909
+ }, [re, ie] = a(() => new Set(F?.map((e, t) => $(F.slice(0, t + 1))) ?? [])), L = r(() => c ? /* @__PURE__ */ new Set([...re, ...pt(c, (e) => e.expandedPaths)]) : void 0, [c, re]) ?? O ?? re, R = r(() => c ? pt(c, (e) => e.loadingPaths) : A, [c, A]), ae = (e) => {
838
910
  let t = new Set(e);
839
- for (let e of N) t.delete(e);
911
+ for (let e of P) t.delete(e);
840
912
  if (c) {
841
- ae(t);
842
- let e = dt(c, t);
913
+ ie(t);
914
+ let e = mt(c, t);
843
915
  for (let t of c) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
844
- } else O ? O(t) : ae(t);
845
- }, [R, ce] = a(null), [le, H] = a(S), ue = i(null), G = i(!1);
916
+ } else k ? k(t) : ie(t);
917
+ }, [z, oe] = a(null), [se, W] = a(S), G = i(null), K = i(!1);
846
918
  t(() => {
847
919
  let e = (e) => {
848
- e.target instanceof Element && e.target.closest(`[${pt}]`) && (G.current = !0);
920
+ e.target instanceof Element && e.target.closest(`[${gt}]`) && (K.current = !0);
849
921
  };
850
922
  return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
851
923
  }, []);
852
- let K = m.trim(), q = R != null, J = r(() => ge(M, m), [M, m]), pe = K.length > 0 && J.length === 0, Y = !q && K.length > 0, X = r(() => {
853
- let e = Y ? J : M;
854
- return j ? e : ve(e);
924
+ let q = m.trim(), J = z != null, Y = r(() => _e(N, m), [N, m]), fe = q.length > 0 && Y.length === 0, X = !J && q.length > 0, pe = r(() => {
925
+ let e = X ? Y : N;
926
+ return M ? e : ye(e);
855
927
  }, [
928
+ X,
856
929
  Y,
857
- J,
858
- M,
859
- j
860
- ]), Z = r(() => /* @__PURE__ */ new Set([...N, ...xe(X)]), [N, X]), me = r(() => /* @__PURE__ */ new Set([...N, ...Y ? Z : I]), [
861
930
  N,
862
- Y,
931
+ M
932
+ ]), Z = r(() => /* @__PURE__ */ new Set([...P, ...Se(pe)]), [P, pe]), me = r(() => /* @__PURE__ */ new Set([...P, ...X ? Z : L]), [
933
+ P,
934
+ X,
863
935
  Z,
864
- I
865
- ]), Q = r(() => we(X), [X]), he = r(() => Y && Q.length === 0 ? [] : j ? Q : [{
866
- path: mt,
867
- name: E,
868
- folderId: mt,
869
- nodeType: de.FOLDER,
870
- items: Q
936
+ L
937
+ ]), he = r(() => Te(pe), [pe]), Q = r(() => X && he.length === 0 ? [] : M ? he : [{
938
+ path: _t,
939
+ name: D,
940
+ folderId: _t,
941
+ nodeType: ue.FOLDER,
942
+ items: he
871
943
  }], [
872
- Q,
873
- E,
874
- Y,
875
- j
876
- ]), _e = R ? $(R) : null, ye = {
944
+ he,
945
+ D,
946
+ X,
947
+ M
948
+ ]), ge = z ? $(z) : null, ve = {
877
949
  empty: C,
878
950
  invalid: w,
879
- duplicate: te,
880
- sameAsParent: T
881
- }, be = (e) => N.includes($(e)) ? void 0 : e.at(-1), Ce = (e) => c ? ot(e) : {
882
- rootKey: mt,
951
+ duplicate: T,
952
+ sameAsParent: E
953
+ }, be = (e) => P.includes($(e)) ? void 0 : e.at(-1), xe = (e) => c ? lt(e) : {
954
+ rootKey: _t,
883
955
  path: e
884
- }, Te = (e) => {
956
+ }, we = (e) => {
885
957
  if (!h) return;
886
- let t = Ce(Se(e.path));
958
+ let t = xe(Ce(e.path));
887
959
  return t && h(t) || void 0;
888
- }, ke = (e) => {
889
- let t = Ce(e);
960
+ }, Ee = (e) => {
961
+ let t = xe(e);
890
962
  return t != null && !!h?.(t);
891
963
  }, Ae = (e) => {
892
- if (ke(e)) return !1;
964
+ if (Ee(e)) return !1;
893
965
  if (!c) return !0;
894
- let t = ot(e), n = c.find((e) => e.key === t?.rootKey);
966
+ let t = lt(e), n = c.find((e) => e.key === t?.rootKey);
895
967
  return n != null && n.canCreateFolders !== !1;
896
968
  }, je = (() => {
897
969
  if (!c) {
898
- let e = P ?? [];
970
+ let e = F ?? [];
899
971
  return Ae(e) ? e : void 0;
900
972
  }
901
- if (P && Ae(P)) return P;
973
+ if (F && Ae(F)) return F;
902
974
  let e = c.find((e) => e.canCreateFolders !== !1);
903
- return e ? at({
975
+ return e ? ct({
904
976
  rootKey: e.key,
905
977
  path: []
906
978
  }) : void 0;
907
979
  })(), Me = (e) => {
908
- let t = pe && Ee(K, [], ye) == null, n = be(e);
909
- return De(t ? K : S, [...Oe(M, e), ...n ? [n] : []]);
980
+ let t = fe && De(q, [], ve) == null, n = be(e);
981
+ return Oe(t ? q : S, [...ke(N, e), ...n ? [n] : []]);
910
982
  }, [Ne, Pe] = a(null);
911
- Ne != null && !L?.has($(Ne)) && (Pe(null), ce(Ne), H(Me(Ne)));
983
+ Ne != null && !R?.has($(Ne)) && (Pe(null), oe(Ne), W(Me(Ne)));
912
984
  let Fe = (e) => {
913
- ce(null), Pe(e), ue.current = null, G.current = !1;
985
+ oe(null), Pe(e), G.current = null, K.current = !1;
914
986
  let t = $(e);
915
- t && oe(new Set(I).add(t));
987
+ t && ae(new Set(L).add(t));
916
988
  }, Ie = () => {
917
989
  je && Fe(je);
918
990
  }, Le = (e) => {
919
- let t = Se(e.path);
991
+ let t = Ce(e.path);
920
992
  if (!Ae(t)) return [];
921
993
  let n = [{
922
994
  key: "add-child",
923
995
  label: x,
924
- icon: /* @__PURE__ */ B(U, {
996
+ icon: /* @__PURE__ */ H(ce, {
925
997
  size: d.SM,
926
998
  "aria-hidden": !0,
927
999
  stroke: f
928
1000
  }),
929
1001
  onClick: () => Fe(t)
930
1002
  }];
931
- return N.includes(e.path) || n.push({
1003
+ return P.includes(e.path) || n.push({
932
1004
  key: "add-sibling",
933
1005
  label: y,
934
- icon: /* @__PURE__ */ B(W, {
1006
+ icon: /* @__PURE__ */ H(le, {
935
1007
  size: d.SM,
936
1008
  "aria-hidden": !0,
937
1009
  stroke: f
@@ -939,127 +1011,131 @@ var G = /* @__PURE__ */ function(e) {
939
1011
  onClick: () => Fe(t.slice(0, -1))
940
1012
  }), n;
941
1013
  }, Re = (e) => {
942
- if (!R) return null;
943
- let t = Ee(e, Oe(re.current, R), ye, be(R));
944
- return ue.current = t, t;
1014
+ if (!z) return null;
1015
+ let t = De(e, ke(ne.current, z), ve, be(z));
1016
+ return G.current = t, t;
945
1017
  }, ze = (e) => {
946
- if (!R || G.current) return;
947
- let t = e.trim(), n = ue.current;
1018
+ if (!z || K.current) return;
1019
+ let t = e.trim(), n = G.current;
948
1020
  if (!(Re(e) ?? n)) {
949
- let e = c ? ot(R) : void 0;
950
- e ? p?.(e.rootKey, e.path, t) : s?.(R, t), ie([...R, t]);
1021
+ let e = c ? lt(z) : void 0;
1022
+ e ? p?.(e.rootKey, e.path, t) : s?.(z, t), I([...z, t]);
951
1023
  }
952
- ce(null);
953
- }, Be = () => ce(null);
954
- return /* @__PURE__ */ V("div", {
955
- style: ne,
956
- className: z(g && "pointer-events-none opacity-60", A.className),
1024
+ oe(null);
1025
+ }, Be = () => oe(null);
1026
+ return /* @__PURE__ */ U("div", {
1027
+ style: te,
1028
+ className: V(g && "pointer-events-none opacity-60", j.className),
957
1029
  children: [
958
- /* @__PURE__ */ B("div", {
959
- className: z("w-full max-w-full min-w-0", ft.tree),
960
- children: /* @__PURE__ */ B(fe, {
961
- items: he,
1030
+ /* @__PURE__ */ H("div", {
1031
+ className: V("w-full max-w-full min-w-0", ht.tree),
1032
+ children: /* @__PURE__ */ H(de, {
1033
+ items: Q,
962
1034
  showFiles: !1,
963
- selectedPath: P == null ? void 0 : $(P),
1035
+ selectedPath: F == null ? void 0 : $(F),
964
1036
  expandedPaths: me,
965
- onExpandedPathsChange: oe,
966
- loadingPaths: L,
1037
+ onExpandedPathsChange: ae,
1038
+ loadingPaths: R,
967
1039
  onItemClick: (e) => {
968
- if (g || Te(e)) return;
969
- let t = P != null && $(P) === e.path;
970
- ie(t ? void 0 : Se(e.path));
1040
+ if (g || we(e)) return;
1041
+ let t = F != null && $(F) === e.path;
1042
+ I(t ? void 0 : Ce(e.path));
971
1043
  },
972
- getDisabledTooltip: h ? Te : void 0,
1044
+ getDisabledTooltip: h ? we : void 0,
973
1045
  getContextMenuItems: Le,
974
- createdFolderPath: _e,
975
- newFolderDefaultName: le,
1046
+ createdFolderPath: ge,
1047
+ newFolderDefaultName: se,
976
1048
  onCreateFolderSave: ze,
977
1049
  onCreateFolderCancel: Be,
978
1050
  onRenameValidate: (e) => Re(e),
979
- searchQuery: Y ? K : void 0,
980
- emptyStateTitle: Y ? ee.replace("{query}", K) : void 0
1051
+ searchQuery: X ? q : void 0,
1052
+ emptyStateTitle: X ? ee.replace("{query}", q) : void 0
981
1053
  })
982
1054
  }),
983
- /* @__PURE__ */ B("div", {
984
- className: z("my-2 h-px", ft.divider),
1055
+ /* @__PURE__ */ H("div", {
1056
+ className: V("my-2 h-px", ht.divider),
985
1057
  "aria-hidden": !0
986
1058
  }),
987
- /* @__PURE__ */ V("div", {
1059
+ /* @__PURE__ */ U("div", {
988
1060
  className: "mb-4 flex flex-wrap items-center gap-2",
989
- children: [/* @__PURE__ */ B(b, {
1061
+ children: [/* @__PURE__ */ H(b, {
990
1062
  onClick: Ie,
991
1063
  label: _,
992
- iconBefore: /* @__PURE__ */ B(W, {
1064
+ iconBefore: /* @__PURE__ */ H(le, {
993
1065
  size: d.SM,
994
1066
  "aria-hidden": !0,
995
1067
  stroke: f
996
1068
  }),
997
- disabled: g || q || !je
998
- }), q && /* @__PURE__ */ B(b, {
1069
+ disabled: g || J || !je
1070
+ }), J && /* @__PURE__ */ H(b, {
999
1071
  label: v,
1000
1072
  onClick: Be,
1001
1073
  disabled: g,
1002
- [pt]: ""
1074
+ [gt]: ""
1003
1075
  })]
1004
1076
  })
1005
1077
  ]
1006
1078
  });
1007
- }, _t = {
1079
+ }, bt = {
1008
1080
  summaryTitle: "_summaryTitle_zj3gd_1",
1009
1081
  sectionHeading: "_sectionHeading_zj3gd_5",
1010
1082
  destination: "_destination_zj3gd_9"
1011
- }, vt = 200, yt = [], bt = [], xt = ({ view: e = Q.Main, onChangeFolderClick: o, resource: s, renderSummary: c, dependencies: u, versionHistory: p, folderItems: m, selectedFolderPath: g, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: x, getDisabledReason: S, expandedPaths: C, onExpandedPathsChange: w, loadingPaths: te, hasExistingPublicationInFolder: T, hasWriteAccess: E, isSubmitting: A, hasSubmitError: ne = !1, allowReplace: M = !0, author: re = "", onAuthorChange: N, publishCredentials: P = !1, onPublishCredentialsChange: ie, rules: F = yt, onRulesChange: ae, ruleSourceOptions: I = bt, isRulesLoading: L = !1, hasRulesLoadError: R = !1, labels: ce = {}, summaryTitleClassName: le = "dial-body-semi-text", headingClassName: U = "dial-body-semi-text", destinationClassName: W = "dial-small-semi-text", calloutFolderNameClassName: ue = "dial-small-paragraph-semi-text", styles: de = {} }) => {
1012
- let { colors: fe, folderTree: G, accessRules: q, dependencies: pe } = de, Y = {
1013
- ...se({
1014
- "--pp-summary-title-text": fe?.summaryTitleText,
1015
- "--pp-heading-text": fe?.headingText,
1016
- "--pp-destination-text": fe?.destinationText
1083
+ }, xt = 200, St = [], Ct = [], wt = ({ view: e = Q.Main, onChangeFolderClick: o, resource: s, renderSummary: c, dependencies: u, versionHistory: p, folderItems: m, selectedFolderPath: g, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: x, getDisabledReason: S, expandedPaths: C, onExpandedPathsChange: w, loadingPaths: T, hasExistingPublicationInFolder: E, hasWriteAccess: D, isSubmitting: j, hasSubmitError: te = !1, isTargetTaken: N = !1, isTargetChecking: ne = !1, allowReplace: P = !0, author: F = "", onAuthorChange: I, publishCredentials: re = !1, onPublishCredentialsChange: ie, rules: L = St, onRulesChange: R, ruleSourceOptions: z = Ct, isRulesLoading: oe = !1, hasRulesLoadError: se = !1, labels: ce = {}, summaryTitleClassName: le = "dial-body-semi-text", headingClassName: G = "dial-body-semi-text", destinationClassName: ue = "dial-small-semi-text", calloutFolderNameClassName: de = "dial-small-paragraph-semi-text", styles: K = {} }) => {
1084
+ let { colors: J, folderTree: Y, accessRules: X, dependencies: pe } = K, Z = {
1085
+ ...B({
1086
+ "--pp-summary-title-text": J?.summaryTitleText,
1087
+ "--pp-heading-text": J?.headingText,
1088
+ "--pp-destination-text": J?.destinationText
1017
1089
  }),
1018
- ...de.cssVars
1019
- }, X = {
1020
- border: fe?.summaryBorder,
1021
- background: fe?.summaryBackground
1022
- }, { folderLabel: Z = "Publish to folder", destinationAriaLabel: me = "Destination folder", noFolderSelectedLabel: he = "No folder selected", changeFolderLabel: ge = "Change", chooseFolderLabel: _e = "Choose", replaceWarning: ve = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: ye = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: be = "Publishing failed. Please try again.", adminApprovalTitle: xe = "Admin approval required", adminApprovalMessage: $ = "We’ll send a request to your organization’s admin. If approved, it will appear in the folder.", folderEmptyStateLabel: Se, addSiblingFolderLabel: Ce, addChildFolderLabel: we, cancelCreatingFolderLabel: Te, createFolderEmptyNameError: Ee, createFolderInvalidNameError: De, createFolderDuplicateNameError: Oe, createFolderSameAsParentNameError: ke, rootFolderLabel: Ae = "Organization", accessRulesLabels: je, dependenciesLabels: Me, searchPlaceholder: Ne, clearSearchAriaLabel: Pe, authorLabel: Fe = "Author", authorPlaceholder: Ie = "Author name", authorHint: Le = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: ze = "Publish with my credentials", credentialsHint: Be = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = ce, [Ve, He] = a(""), Ge = n(), Ke = i(null), qe = i(null), Je = (e) => {
1023
- He(e ?? "");
1024
- }, Ye = i(e);
1090
+ ...K.cssVars
1091
+ }, me = {
1092
+ border: J?.summaryBorder,
1093
+ background: J?.summaryBackground
1094
+ }, { folderLabel: he = "Publish to folder", destinationAriaLabel: ge = "Destination folder", noFolderSelectedLabel: _e = "No folder selected", changeFolderLabel: ve = "Change", chooseFolderLabel: ye = "Choose", replaceWarning: be = "Version {version} is already published in {folder}. Publishing will replace it.", targetTakenLabel: xe = "A resource with this name already exists in {folder}. Rename it or choose another folder.", targetTakenVersionedLabel: Se = "Version {version} of a resource with this name already exists in {folder}. Rename it, change its version or choose another folder.", noAccessError: $ = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: Ce = "Publishing failed. Please try again.", adminApprovalTitle: we = "Admin approval required", adminApprovalMessage: Te = "We’ll send a request to your organization’s admin. If approved, it will appear in the folder.", folderEmptyStateLabel: Ee, addSiblingFolderLabel: De, addChildFolderLabel: Oe, cancelCreatingFolderLabel: ke, createFolderEmptyNameError: Ae, createFolderInvalidNameError: je, createFolderDuplicateNameError: Me, createFolderSameAsParentNameError: Ne, rootFolderLabel: Pe = "Organization", accessRulesLabels: Fe, dependenciesLabels: Ie, searchPlaceholder: Le, clearSearchAriaLabel: Re, authorLabel: Be = "Author", authorPlaceholder: Ve = "Author name", authorHint: He = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Ue = "Publish with my credentials", credentialsHint: Ke = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = ce, [qe, Je] = a(""), Ye = n(), Xe = i(null), Ze = i(null), Qe = (e) => {
1095
+ Je(e ?? "");
1096
+ }, $e = i(e);
1025
1097
  t(() => {
1026
- Ye.current !== e && (Ye.current = e, e === Q.ChangeFolder ? qe.current?.focus({ preventScroll: !0 }) : Ke.current?.focus({ preventScroll: !0 }));
1098
+ $e.current !== e && ($e.current = e, e === Q.ChangeFolder ? Ze.current?.focus({ preventScroll: !0 }) : Xe.current?.focus({ preventScroll: !0 }));
1027
1099
  }, [e]);
1028
- let Xe = g != null, Ze = r(() => J({
1029
- hasSelectedFolder: Xe,
1030
- hasExistingPublicationInFolder: T,
1031
- hasWriteAccess: E,
1032
- isSubmitting: A,
1033
- hasSubmitError: ne,
1034
- allowReplace: M
1100
+ let et = g != null, tt = r(() => fe({
1101
+ hasSelectedFolder: et,
1102
+ hasExistingPublicationInFolder: E,
1103
+ hasWriteAccess: D,
1104
+ isSubmitting: j,
1105
+ hasSubmitError: te,
1106
+ isTargetTaken: N,
1107
+ isTargetChecking: ne,
1108
+ allowReplace: P
1035
1109
  }), [
1036
- Xe,
1037
- T,
1110
+ et,
1038
1111
  E,
1039
- A,
1112
+ D,
1113
+ j,
1114
+ te,
1115
+ N,
1040
1116
  ne,
1041
- M
1042
- ]), Qe = Xe ? g[g.length - 1] ?? Ae : "", et = c ? c() : /* @__PURE__ */ B("span", {
1043
- className: z("truncate", le, _t.summaryTitle),
1117
+ P
1118
+ ]), rt = et ? g[g.length - 1] ?? Pe : "", it = c ? c() : /* @__PURE__ */ H("span", {
1119
+ className: V("truncate", le, bt.summaryTitle),
1044
1120
  children: s?.title
1045
1121
  });
1046
- if (e === Q.ChangeFolder) return /* @__PURE__ */ V("div", {
1047
- ref: qe,
1122
+ if (e === Q.ChangeFolder) return /* @__PURE__ */ U("div", {
1123
+ ref: Ze,
1048
1124
  tabIndex: -1,
1049
1125
  role: "group",
1050
- "aria-label": Z,
1051
- className: z("flex flex-col gap-3 outline-none", We.panel),
1052
- style: Y,
1053
- children: [/* @__PURE__ */ B("div", {
1126
+ "aria-label": he,
1127
+ className: V("flex flex-col gap-3 outline-none", Ge.panel),
1128
+ style: Z,
1129
+ children: [/* @__PURE__ */ H("div", {
1054
1130
  role: "search",
1055
- children: /* @__PURE__ */ B(j, {
1056
- value: Ve,
1057
- onChange: Je,
1058
- placeholder: Ne,
1059
- clearLabel: Pe,
1060
- "aria-label": Ne
1131
+ children: /* @__PURE__ */ H(M, {
1132
+ value: qe,
1133
+ onChange: Qe,
1134
+ placeholder: Le,
1135
+ clearLabel: Re,
1136
+ "aria-label": Le
1061
1137
  })
1062
- }), /* @__PURE__ */ B(gt, {
1138
+ }), /* @__PURE__ */ H(yt, {
1063
1139
  items: m,
1064
1140
  selectedPath: _,
1065
1141
  onSelectedPathChange: v,
@@ -1067,30 +1143,30 @@ var G = /* @__PURE__ */ function(e) {
1067
1143
  getDisabledReason: S,
1068
1144
  expandedPaths: C,
1069
1145
  onExpandedPathsChange: w,
1070
- loadingPaths: te,
1071
- searchQuery: Ve,
1072
- disabled: A,
1073
- noResultsLabel: Se,
1074
- addSiblingFolderLabel: Ce,
1075
- addChildFolderLabel: we,
1076
- cancelCreatingFolderLabel: Te,
1077
- emptyFolderNameError: Ee,
1078
- invalidFolderNameError: De,
1079
- duplicateFolderNameError: Oe,
1080
- sameAsParentFolderNameError: ke,
1081
- rootLabel: Ae,
1082
- styles: G
1146
+ loadingPaths: T,
1147
+ searchQuery: qe,
1148
+ disabled: j,
1149
+ noResultsLabel: Ee,
1150
+ addSiblingFolderLabel: De,
1151
+ addChildFolderLabel: Oe,
1152
+ cancelCreatingFolderLabel: ke,
1153
+ emptyFolderNameError: Ae,
1154
+ invalidFolderNameError: je,
1155
+ duplicateFolderNameError: Me,
1156
+ sameAsParentFolderNameError: Ne,
1157
+ rootLabel: Pe,
1158
+ styles: Y
1083
1159
  })]
1084
1160
  });
1085
- let tt = z(W, _t.destination);
1086
- return /* @__PURE__ */ V("div", {
1087
- className: z("flex flex-col gap-5", We.panel),
1088
- style: Y,
1161
+ let at = V(ue, bt.destination);
1162
+ return /* @__PURE__ */ U("div", {
1163
+ className: V("flex flex-col gap-5", Ge.panel),
1164
+ style: Z,
1089
1165
  children: [
1090
- s?.type == null ? /* @__PURE__ */ B(oe, {
1091
- colors: X,
1092
- children: et
1093
- }) : /* @__PURE__ */ B(oe, {
1166
+ s?.type == null ? /* @__PURE__ */ H(ae, {
1167
+ colors: me,
1168
+ children: it
1169
+ }) : /* @__PURE__ */ H(ae, {
1094
1170
  item: {
1095
1171
  type: s.type,
1096
1172
  name: s.title,
@@ -1098,184 +1174,189 @@ var G = /* @__PURE__ */ function(e) {
1098
1174
  iconUrl: s.iconUrl
1099
1175
  },
1100
1176
  hasVersionTag: !1,
1101
- colors: X
1177
+ colors: me
1102
1178
  }),
1103
- /* @__PURE__ */ V("section", { children: [
1104
- /* @__PURE__ */ B("h2", {
1105
- className: z("mb-2", U, _t.sectionHeading),
1106
- children: Z
1179
+ /* @__PURE__ */ U("section", { children: [
1180
+ /* @__PURE__ */ H("h2", {
1181
+ className: V("mb-2", G, bt.sectionHeading),
1182
+ children: he
1107
1183
  }),
1108
- /* @__PURE__ */ V("div", {
1184
+ /* @__PURE__ */ U("div", {
1109
1185
  className: "flex min-w-0 items-center gap-2",
1110
- children: [/* @__PURE__ */ B("div", {
1186
+ children: [/* @__PURE__ */ H("div", {
1111
1187
  role: "group",
1112
- "aria-label": me,
1188
+ "aria-label": ge,
1113
1189
  className: "min-w-0 flex-1",
1114
- children: Xe ? /* @__PURE__ */ B(y, {
1115
- name: [Ae, ...g].join(" / "),
1116
- nameClassName: tt
1117
- }) : /* @__PURE__ */ B("span", {
1118
- className: z("block truncate", tt),
1119
- children: he
1190
+ children: et ? /* @__PURE__ */ H(y, {
1191
+ name: [Pe, ...g].join(" / "),
1192
+ nameClassName: at
1193
+ }) : /* @__PURE__ */ H("span", {
1194
+ className: V("block truncate", at),
1195
+ children: _e
1120
1196
  })
1121
- }), /* @__PURE__ */ B(b, {
1122
- ref: Ke,
1197
+ }), /* @__PURE__ */ H(b, {
1198
+ ref: Xe,
1123
1199
  size: h.Small,
1124
- label: Xe ? ge : _e,
1125
- iconBefore: /* @__PURE__ */ B(H, {
1200
+ label: et ? ve : ye,
1201
+ iconBefore: /* @__PURE__ */ H(W, {
1126
1202
  size: d.SM,
1127
1203
  stroke: f,
1128
1204
  "aria-hidden": !0
1129
1205
  }),
1130
- disabled: A,
1206
+ disabled: j,
1131
1207
  onClick: o
1132
1208
  })]
1133
1209
  }),
1134
- Ze.calloutKind === K.Info && /* @__PURE__ */ B("div", {
1210
+ tt.calloutKind === q.Info && /* @__PURE__ */ H("div", {
1135
1211
  className: "my-4",
1136
- children: /* @__PURE__ */ B(D, {
1137
- type: O.SectionMessage,
1138
- variant: k.Info,
1139
- title: xe,
1140
- message: $
1212
+ children: /* @__PURE__ */ H(O, {
1213
+ type: k.SectionMessage,
1214
+ variant: A.Info,
1215
+ title: we,
1216
+ message: Te
1141
1217
  })
1142
1218
  }),
1143
- Ze.calloutKind !== K.None && Ze.calloutKind !== K.Info && /* @__PURE__ */ B("div", {
1219
+ tt.calloutKind !== q.None && tt.calloutKind !== q.Info && /* @__PURE__ */ H("div", {
1144
1220
  className: "mt-3",
1145
- children: /* @__PURE__ */ B(D, {
1146
- type: O.SectionMessage,
1147
- variant: St(Ze.calloutKind),
1148
- message: wt(Ze.calloutKind, {
1149
- replaceWarning: ve,
1150
- noAccessError: ye,
1151
- submitError: be,
1152
- folderName: Qe,
1221
+ children: /* @__PURE__ */ H(O, {
1222
+ type: k.SectionMessage,
1223
+ variant: Tt(tt.calloutKind),
1224
+ message: Dt(tt.calloutKind, {
1225
+ replaceWarning: be,
1226
+ targetTaken: s?.version ? Se : xe,
1227
+ noAccessError: $,
1228
+ submitError: Ce,
1229
+ folderName: rt,
1153
1230
  version: s?.version,
1154
- folderNameClassName: ue
1231
+ folderNameClassName: de
1155
1232
  })
1156
1233
  })
1157
1234
  }),
1158
- N != null && /* @__PURE__ */ B("div", {
1235
+ I != null && /* @__PURE__ */ H("div", {
1159
1236
  className: "mt-4",
1160
- children: /* @__PURE__ */ B(ee, {
1161
- id: Ge,
1162
- labelProps: { label: Fe },
1163
- placeholder: Ie,
1164
- caption: Le,
1165
- value: re,
1166
- onChange: (e) => N(e ?? ""),
1167
- maxLength: vt,
1168
- disabled: A
1237
+ children: /* @__PURE__ */ H(ee, {
1238
+ id: Ye,
1239
+ labelProps: { label: Be },
1240
+ placeholder: Ve,
1241
+ caption: He,
1242
+ value: F,
1243
+ onChange: (e) => I(e ?? ""),
1244
+ maxLength: xt,
1245
+ disabled: j
1169
1246
  })
1170
1247
  }),
1171
- ie != null && /* @__PURE__ */ B("div", {
1248
+ ie != null && /* @__PURE__ */ H("div", {
1172
1249
  className: "mt-4",
1173
- children: /* @__PURE__ */ B(l, {
1174
- labelProps: { label: ze },
1175
- caption: Be,
1176
- isSelected: P,
1250
+ children: /* @__PURE__ */ H(l, {
1251
+ labelProps: { label: Ue },
1252
+ caption: Ke,
1253
+ isSelected: re,
1177
1254
  onChange: ie,
1178
- disabled: A
1255
+ disabled: j
1179
1256
  })
1180
1257
  }),
1181
- ae != null && /* @__PURE__ */ B("div", {
1258
+ R != null && /* @__PURE__ */ H("div", {
1182
1259
  className: "mt-4",
1183
- children: /* @__PURE__ */ B(Re, {
1184
- rules: F,
1185
- onRulesChange: ae,
1186
- sourceOptions: I,
1187
- folderName: Xe ? Qe : void 0,
1188
- disabled: A,
1189
- isLoading: L,
1190
- hasLoadError: R,
1191
- labels: je,
1192
- styles: q
1260
+ children: /* @__PURE__ */ H(ze, {
1261
+ rules: L,
1262
+ onRulesChange: R,
1263
+ sourceOptions: z,
1264
+ folderName: et ? rt : void 0,
1265
+ disabled: j,
1266
+ isLoading: oe,
1267
+ hasLoadError: se,
1268
+ labels: Fe,
1269
+ styles: X
1193
1270
  })
1194
1271
  })
1195
1272
  ] }),
1196
- u != null && /* @__PURE__ */ B($e, {
1273
+ u != null && /* @__PURE__ */ H(nt, {
1197
1274
  dependencies: u,
1198
- labels: Me,
1199
- headingClassName: U,
1275
+ labels: Ie,
1276
+ headingClassName: G,
1200
1277
  styles: pe
1201
1278
  }),
1202
- p != null && /* @__PURE__ */ B(Ue, {
1203
- headingClassName: U,
1279
+ p != null && /* @__PURE__ */ H(We, {
1280
+ headingClassName: G,
1204
1281
  ...p
1205
1282
  })
1206
1283
  ]
1207
1284
  });
1208
- }, St = (e) => e === K.ReplaceWarning ? k.Warning : k.Error, Ct = (e, t, n) => {
1285
+ }, Tt = (e) => e === q.ReplaceWarning || e === q.TargetTaken ? A.Warning : A.Error, Et = (e, t, n) => {
1209
1286
  let [r, i, ...a] = e.split("{folder}");
1210
- return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ V(le, { children: [
1287
+ return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ U(se, { children: [
1211
1288
  r,
1212
- /* @__PURE__ */ B("strong", {
1289
+ /* @__PURE__ */ H("strong", {
1213
1290
  className: n,
1214
1291
  children: t
1215
1292
  }),
1216
1293
  i
1217
1294
  ] });
1218
- }, wt = (e, t) => e === K.ReplaceWarning ? Ct(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === K.NoAccess ? Ct(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Tt = { footer: "_footer_dks1v_1" }, Et = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = Q.Main, onSelectFolder: c, isSelectFolderDisabled: l = !1, labels: u = {}, colors: f }) => {
1219
- let p = se({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: h = "Publish", updateLabel: g = "Update version {version}", publishingInProgressLabel: _ = "Publishing…", selectFolderLabel: v = "Select" } = u, y = s === Q.ChangeFolder, x = i ? _ : n && t && e != null ? g.replace("{version}", e) : h;
1220
- return /* @__PURE__ */ V("div", {
1295
+ }, Dt = (e, t) => e === q.ReplaceWarning ? Et(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === q.TargetTaken ? Et(t.targetTaken.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === q.NoAccess ? Et(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Ot = { footer: "_footer_dks1v_1" }, kt = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = Q.Main, onSelectFolder: c, isSelectFolderDisabled: l = !1, labels: u = {}, colors: f }) => {
1296
+ let p = B({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: h = "Publish", updateLabel: g = "Update version {version}", publishingInProgressLabel: _ = "Publishing…", selectFolderLabel: v = "Select" } = u, y = s === Q.ChangeFolder, x = i ? _ : n && t && e != null ? g.replace("{version}", e) : h;
1297
+ return /* @__PURE__ */ U("div", {
1221
1298
  style: p,
1222
- className: z("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Tt.footer),
1223
- children: [/* @__PURE__ */ B(b, {
1299
+ className: V("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Ot.footer),
1300
+ children: [/* @__PURE__ */ H(b, {
1224
1301
  label: m,
1225
1302
  className: "mobile:flex-1",
1226
1303
  disabled: i,
1227
1304
  onClick: a
1228
- }), y ? /* @__PURE__ */ B(E, {
1305
+ }), y ? /* @__PURE__ */ H(D, {
1229
1306
  label: v,
1230
1307
  className: "mobile:flex-1",
1231
1308
  disabled: l,
1232
1309
  onClick: c
1233
- }) : /* @__PURE__ */ B(A, {
1310
+ }) : /* @__PURE__ */ H(j, {
1234
1311
  label: x,
1235
1312
  className: "mobile:flex-1",
1236
1313
  disabled: r,
1237
- iconBefore: i ? /* @__PURE__ */ B("span", {
1314
+ iconBefore: i ? /* @__PURE__ */ H("span", {
1238
1315
  "aria-hidden": !0,
1239
- children: /* @__PURE__ */ B(ie, { size: d.SM })
1316
+ children: /* @__PURE__ */ H(I, { size: d.SM })
1240
1317
  }) : void 0,
1241
1318
  onClick: o
1242
1319
  })]
1243
1320
  });
1244
- }, Dt = {
1321
+ }, At = {
1245
1322
  backdrop: "_backdrop_16jmd_6",
1246
1323
  panel: "_panel_16jmd_10",
1247
1324
  divider: "_divider_16jmd_15",
1248
1325
  content: "_content_16jmd_19",
1249
1326
  title: "_title_16jmd_24"
1250
- }, Ot = ({ isOpen: e, resource: n, renderSummary: i, dependencies: o, versionHistory: s, folderItems: c, selectedFolderPath: l, onSelectedFolderPathChange: u, onCreateFolder: d, getDisabledReason: f, expandedPaths: p, onExpandedPathsChange: m, loadingPaths: h, hasExistingPublicationInFolder: g, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, allowReplace: b = !0, author: x, onAuthorChange: S, rules: ee, onRulesChange: C, ruleSourceOptions: w, isRulesLoading: te = !1, hasRulesLoadError: T = !1, onClose: E, returnFocusRef: D, onSubmit: O, panelLabels: k, panelStyles: A, panelSummaryTitleClassName: ne, panelHeadingClassName: j, panelCalloutFolderNameClassName: M, footerLabels: N, labels: P = {}, titleClassName: ie = "dial-body-semi-text", colors: F }) => {
1251
- let ae = se({
1252
- "--spp-backdrop-bg": F?.backdropBackground,
1253
- "--spp-panel-bg": F?.panelBackground,
1254
- "--spp-panel-border": F?.panelBorder,
1255
- "--spp-divider-border": F?.dividerBorder,
1256
- "--spp-scrollbar-thumb": F?.scrollbarThumb,
1257
- "--spp-title-text": F?.titleText
1258
- }), [I, L] = a(null), { title: oe = "Publish", changeFolderTitle: R = "Change folder", backAriaLabel: ce = "Back", ariaLabel: le = "Publish", closeAriaLabel: H = "Close" } = P, U = he({
1327
+ }, jt = ({ isOpen: e, resource: n, renderSummary: i, dependencies: o, versionHistory: s, folderItems: c, selectedFolderPath: l, onSelectedFolderPathChange: u, onCreateFolder: d, getDisabledReason: f, expandedPaths: p, onExpandedPathsChange: m, loadingPaths: h, hasExistingPublicationInFolder: g, hasWriteAccess: _, isSubmitting: v, hasSubmitError: y = !1, isTargetTaken: b = !1, isTargetChecking: x = !1, allowReplace: S = !0, author: ee, onAuthorChange: C, rules: w, onRulesChange: T, ruleSourceOptions: E, isRulesLoading: D = !1, hasRulesLoadError: O = !1, onClose: k, returnFocusRef: A, onSubmit: j, panelLabels: te, panelStyles: M, panelSummaryTitleClassName: N, panelHeadingClassName: P, panelCalloutFolderNameClassName: F, footerLabels: I, labels: re = {}, titleClassName: ie = "dial-body-semi-text", colors: L }) => {
1328
+ let R = B({
1329
+ "--spp-backdrop-bg": L?.backdropBackground,
1330
+ "--spp-panel-bg": L?.panelBackground,
1331
+ "--spp-panel-border": L?.panelBorder,
1332
+ "--spp-divider-border": L?.dividerBorder,
1333
+ "--spp-scrollbar-thumb": L?.scrollbarThumb,
1334
+ "--spp-title-text": L?.titleText
1335
+ }), [ae, z] = a(null), { title: oe = "Publish", changeFolderTitle: se = "Change folder", backAriaLabel: W = "Back", ariaLabel: ce = "Publish", closeAriaLabel: le = "Close" } = re, G = ge({
1259
1336
  isOpen: e,
1260
1337
  selectedFolderPath: l,
1261
1338
  onSelectedFolderPathChange: u
1262
- }), W = U.view === Q.ChangeFolder, ue = r(() => J({
1339
+ }), ue = G.view === Q.ChangeFolder, de = r(() => fe({
1263
1340
  hasSelectedFolder: l != null,
1264
1341
  hasExistingPublicationInFolder: g,
1265
1342
  hasWriteAccess: _,
1266
1343
  isSubmitting: v,
1267
1344
  hasSubmitError: y,
1268
- allowReplace: b
1345
+ isTargetTaken: b,
1346
+ isTargetChecking: x,
1347
+ allowReplace: S
1269
1348
  }), [
1270
1349
  l,
1271
1350
  g,
1272
1351
  _,
1273
1352
  v,
1274
1353
  y,
1275
- b
1354
+ b,
1355
+ x,
1356
+ S
1276
1357
  ]);
1277
1358
  return t(() => {
1278
- let t = I?.closest("[role=\"dialog\"]");
1359
+ let t = ae?.closest("[role=\"dialog\"]");
1279
1360
  if (!e || !t) return;
1280
1361
  let n = () => t.focus({ preventScroll: !0 });
1281
1362
  n();
@@ -1285,49 +1366,49 @@ var G = /* @__PURE__ */ function(e) {
1285
1366
  document.addEventListener("focusin", r);
1286
1367
  let i = requestAnimationFrame(() => {
1287
1368
  document.removeEventListener("focusin", r);
1288
- }), a = D?.current;
1369
+ }), a = A?.current;
1289
1370
  return () => {
1290
1371
  cancelAnimationFrame(i), document.removeEventListener("focusin", r), a?.isConnected && a.focus({ preventScroll: !0 });
1291
1372
  };
1292
1373
  }, [
1293
1374
  e,
1294
- I,
1295
- D
1296
- ]), /* @__PURE__ */ V(re, {
1375
+ ae,
1376
+ A
1377
+ ]), /* @__PURE__ */ U(ne, {
1297
1378
  open: e,
1298
- onClose: E,
1299
- header: /* @__PURE__ */ B("span", {
1300
- className: z("block truncate text-center", ie, Dt.title),
1301
- children: W ? R : oe
1379
+ onClose: k,
1380
+ header: /* @__PURE__ */ H("span", {
1381
+ className: V("block truncate text-center", ie, At.title),
1382
+ children: ue ? se : oe
1302
1383
  }),
1303
- ariaLabel: le,
1304
- onBack: W ? U.backToMain : void 0,
1305
- backAriaLabel: ce,
1384
+ ariaLabel: ce,
1385
+ onBack: ue ? G.backToMain : void 0,
1386
+ backAriaLabel: W,
1306
1387
  backDisabled: v,
1307
- closeAriaLabel: H,
1388
+ closeAriaLabel: le,
1308
1389
  closeDisabled: v,
1309
- style: ae,
1310
- overlayStyle: ae,
1311
- className: z(Dt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1312
- overlayClassName: Dt.backdrop,
1313
- headerClassName: z("px-[22px]", Dt.divider),
1390
+ style: R,
1391
+ overlayStyle: R,
1392
+ className: V(At.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1393
+ overlayClassName: At.backdrop,
1394
+ headerClassName: V("px-[22px]", At.divider),
1314
1395
  bodyClassName: "flex flex-col overflow-hidden",
1315
- children: [/* @__PURE__ */ B("div", {
1316
- ref: L,
1317
- className: z("min-h-0 flex-1 overflow-y-auto", Dt.content),
1318
- children: /* @__PURE__ */ B("div", {
1396
+ children: [/* @__PURE__ */ H("div", {
1397
+ ref: z,
1398
+ className: V("min-h-0 flex-1 overflow-y-auto", At.content),
1399
+ children: /* @__PURE__ */ H("div", {
1319
1400
  className: "p-[22px]",
1320
- children: /* @__PURE__ */ B(xt, {
1401
+ children: /* @__PURE__ */ H(wt, {
1321
1402
  resource: n,
1322
1403
  renderSummary: i,
1323
1404
  dependencies: o,
1324
1405
  versionHistory: s,
1325
- view: U.view,
1326
- onChangeFolderClick: U.openFolderView,
1406
+ view: G.view,
1407
+ onChangeFolderClick: G.openFolderView,
1327
1408
  folderItems: c,
1328
1409
  selectedFolderPath: l,
1329
- pendingFolderPath: U.pendingFolderPath,
1330
- onPendingFolderPathChange: U.setPendingFolderPath,
1410
+ pendingFolderPath: G.pendingFolderPath,
1411
+ onPendingFolderPathChange: G.setPendingFolderPath,
1331
1412
  onCreateFolder: d,
1332
1413
  getDisabledReason: f,
1333
1414
  expandedPaths: p,
@@ -1337,38 +1418,40 @@ var G = /* @__PURE__ */ function(e) {
1337
1418
  hasWriteAccess: _,
1338
1419
  isSubmitting: v,
1339
1420
  hasSubmitError: y,
1340
- allowReplace: b,
1341
- author: x,
1342
- onAuthorChange: S,
1343
- rules: ee,
1344
- onRulesChange: C,
1345
- ruleSourceOptions: w,
1346
- isRulesLoading: te,
1347
- hasRulesLoadError: T,
1348
- labels: k,
1349
- styles: A,
1350
- summaryTitleClassName: ne,
1351
- headingClassName: j,
1352
- calloutFolderNameClassName: M
1421
+ isTargetTaken: b,
1422
+ isTargetChecking: x,
1423
+ allowReplace: S,
1424
+ author: ee,
1425
+ onAuthorChange: C,
1426
+ rules: w,
1427
+ onRulesChange: T,
1428
+ ruleSourceOptions: E,
1429
+ isRulesLoading: D,
1430
+ hasRulesLoadError: O,
1431
+ labels: te,
1432
+ styles: M,
1433
+ summaryTitleClassName: N,
1434
+ headingClassName: P,
1435
+ calloutFolderNameClassName: F
1353
1436
  })
1354
1437
  })
1355
- }), /* @__PURE__ */ B(Et, {
1438
+ }), /* @__PURE__ */ H(kt, {
1356
1439
  version: n?.version,
1357
1440
  hasExistingPublicationInFolder: g,
1358
- allowReplace: b,
1359
- isSubmitDisabled: ue.isSubmitDisabled,
1360
- isSubmitLoading: ue.isSubmitLoading,
1361
- onCancel: W ? U.backToMain : E,
1362
- onSubmit: O,
1363
- view: U.view,
1364
- onSelectFolder: U.selectFolder,
1365
- isSelectFolderDisabled: U.pendingFolderPath == null,
1366
- labels: N
1441
+ allowReplace: S,
1442
+ isSubmitDisabled: de.isSubmitDisabled,
1443
+ isSubmitLoading: de.isSubmitLoading,
1444
+ onCancel: ue ? G.backToMain : k,
1445
+ onSubmit: j,
1446
+ view: G.view,
1447
+ onSelectFolder: G.selectFolder,
1448
+ isSelectFolderDisabled: G.pendingFolderPath == null,
1449
+ labels: I
1367
1450
  })]
1368
1451
  });
1369
- }, kt = { option: "_option_skygm_1" }, At = (e, t) => `Unpublish "${e}" from "${t}"?`, jt = (e) => `Choose which folder to unpublish "${e}" from.`, Mt = ({ isOpen: e, name: t, folders: n, selectedFolder: r, onSelectedFolderChange: i, isLoading: a = !1, labels: o, optionClassName: s = "dial-small-text", colors: c, onConfirm: l, onClose: d }) => {
1370
- let { title: f = "Unpublish?", confirmLabel: p = "Unpublish", cancelLabel: m = "Cancel", rootFolderLabel: h = "Organization", folderGroupAriaLabel: g = "Published folders", loadingStatusLabel: _ = "Requesting unpublish…", confirmMessage: v = At, selectFolderMessage: y = jt } = o ?? {}, b = n.length > 1;
1371
- return /* @__PURE__ */ B(I, {
1452
+ }, Mt = { option: "_option_skygm_1" }, Nt = (e, t) => `Unpublish "${e}" from "${t}"?`, Pt = (e) => `Choose which folder to unpublish "${e}" from.`, Ft = ({ isOpen: e, name: t, folders: n, selectedFolder: r, onSelectedFolderChange: i, isLoading: a = !1, labels: o, optionClassName: s = "dial-small-text", colors: c, onConfirm: l, onClose: d }) => {
1453
+ let { title: f = "Unpublish?", confirmLabel: p = "Unpublish", cancelLabel: m = "Cancel", rootFolderLabel: h = "Organization", folderGroupAriaLabel: g = "Published folders", loadingStatusLabel: _ = "Requesting unpublish…", confirmMessage: v = Nt, selectFolderMessage: y = Pt } = o ?? {}, b = n.length > 1;
1454
+ return /* @__PURE__ */ H(L, {
1372
1455
  open: e,
1373
1456
  title: f,
1374
1457
  confirmLabel: p,
@@ -1377,71 +1460,71 @@ var G = /* @__PURE__ */ function(e) {
1377
1460
  isLoading: a,
1378
1461
  isConfirmDisabled: b && r == null,
1379
1462
  loadingStatusLabel: _,
1380
- message: /* @__PURE__ */ B("span", {
1463
+ message: /* @__PURE__ */ H("span", {
1381
1464
  className: "wrap-break-word",
1382
- children: b ? y(t) : v(t, Ce(n[0] ?? "", h))
1465
+ children: b ? y(t) : v(t, we(n[0] ?? "", h))
1383
1466
  }),
1384
1467
  onConfirm: l,
1385
1468
  onClose: d,
1386
- children: b && /* @__PURE__ */ B("div", {
1469
+ children: b && /* @__PURE__ */ H("div", {
1387
1470
  className: "mt-3",
1388
- style: se({ "--ucd-option-text": c?.optionText }),
1389
- children: /* @__PURE__ */ B(ne, {
1471
+ style: B({ "--ucd-option-text": c?.optionText }),
1472
+ children: /* @__PURE__ */ H(te, {
1390
1473
  ariaLabel: g,
1391
1474
  value: r ?? void 0,
1392
1475
  onChange: i,
1393
1476
  disabled: a,
1394
1477
  items: n.map((e) => ({
1395
1478
  value: e,
1396
- label: Ce(e, h)
1479
+ label: we(e, h)
1397
1480
  })),
1398
- radioClassName: z(s, kt.option)
1481
+ radioClassName: V(s, Mt.option)
1399
1482
  })
1400
1483
  })
1401
1484
  });
1402
- }, Nt = /* @__PURE__ */ function(e) {
1485
+ }, It = /* @__PURE__ */ function(e) {
1403
1486
  return e.Keep = "keep", e.New = "new", e;
1404
- }({}), Pt = /* @__PURE__ */ function(e) {
1487
+ }({}), Lt = /* @__PURE__ */ function(e) {
1405
1488
  return e.Main = "main", e.ChangeFolder = "change-folder", e;
1406
- }({}), Ft = {
1489
+ }({}), Rt = {
1407
1490
  heading: "_heading_vk731_1",
1408
1491
  destination: "_destination_vk731_5"
1409
- }, It = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, getDisabledReason: c, onChangeFolderClick: l, changeFolderButtonRef: u, pendingDestination: p, onPendingDestinationChange: m, version: g, accessRules: v, versionHistory: x, isSubmitting: S = !1, submitError: te, foldersError: E, onRetryFolders: D, panelLabels: O = {}, panelStyles: k = {}, headingClassName: A = "dial-body-semi-text", destinationClassName: M = "dial-small-semi-text" }) => {
1410
- let { saveToFolderHeading: re = "Save to folder", changeFolderLabel: N = "Change", destinationAriaLabel: P = "Destination folder", versionHeading: ie = "Version", keepVersionLabel: F = "Keep version {version}", saveAsNewVersionLabel: ae = "Save as new version", newVersionLabel: I = "Version", newVersionPlaceholder: L = "Enter new version", searchPlaceholder: R = "Search folders", clearSearchAriaLabel: ce = "Clear search", folderEmptyStateLabel: le, createFolderLabel: U, cancelCreatingFolderLabel: W, addSiblingFolderLabel: ue, addChildFolderLabel: de, createFolderEmptyNameError: fe, createFolderInvalidNameError: G, createFolderDuplicateNameError: K, createFolderSameAsParentNameError: q, retryLabel: J = "Retry" } = O, { colors: pe, folderTree: Y } = k, X = {
1411
- ...se({
1412
- "--stf-heading-text": pe?.headingText,
1413
- "--stf-destination-text": pe?.destinationText
1492
+ }, zt = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, getDisabledReason: c, onChangeFolderClick: l, changeFolderButtonRef: u, pendingDestination: p, onPendingDestinationChange: m, version: g, accessRules: v, versionHistory: x, isSubmitting: S = !1, submitError: T, foldersError: D, onRetryFolders: O, panelLabels: k = {}, panelStyles: A = {}, headingClassName: j = "dial-body-semi-text", destinationClassName: N = "dial-small-semi-text" }) => {
1493
+ let { saveToFolderHeading: ne = "Save to folder", changeFolderLabel: P = "Change", destinationAriaLabel: F = "Destination folder", versionHeading: I = "Version", keepVersionLabel: re = "Keep version {version}", saveAsNewVersionLabel: ie = "Save as new version", newVersionLabel: L = "Version", newVersionPlaceholder: R = "Enter new version", searchPlaceholder: z = "Search folders", clearSearchAriaLabel: oe = "Clear search", folderEmptyStateLabel: se, createFolderLabel: ce, cancelCreatingFolderLabel: le, addSiblingFolderLabel: G, addChildFolderLabel: ue, createFolderEmptyNameError: de, createFolderInvalidNameError: K, createFolderDuplicateNameError: q, createFolderSameAsParentNameError: J, retryLabel: Y = "Retry" } = k, { colors: fe, folderTree: X } = A, pe = {
1494
+ ...B({
1495
+ "--stf-heading-text": fe?.headingText,
1496
+ "--stf-destination-text": fe?.destinationText
1414
1497
  }),
1415
- ...k.cssVars
1498
+ ...A.cssVars
1416
1499
  }, Z = {
1417
- border: pe?.summaryBorder,
1418
- background: pe?.summaryBackground
1419
- }, [me, Q] = a(""), he = n(), ge = n(), _e = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), ve = i.find((e) => e.key === p?.rootKey), ye = p ? p.path[p.path.length - 1] ?? ve?.label : void 0, be = z(A, Ft.heading), xe = c?.(o);
1420
- if (e === Pt.ChangeFolder) return /* @__PURE__ */ V("div", {
1500
+ border: fe?.summaryBorder,
1501
+ background: fe?.summaryBackground
1502
+ }, [me, he] = a(""), Q = n(), ge = n(), _e = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), ve = i.find((e) => e.key === p?.rootKey), ye = p ? p.path[p.path.length - 1] ?? ve?.label : void 0, be = V(j, Rt.heading), xe = c?.(o);
1503
+ if (e === Lt.ChangeFolder) return /* @__PURE__ */ U("div", {
1421
1504
  className: "flex flex-col gap-3",
1422
- style: X,
1505
+ style: pe,
1423
1506
  children: [
1424
- /* @__PURE__ */ B("div", {
1507
+ /* @__PURE__ */ H("div", {
1425
1508
  role: "search",
1426
- children: /* @__PURE__ */ B(j, {
1509
+ children: /* @__PURE__ */ H(M, {
1427
1510
  value: me,
1428
- onChange: (e) => Q(e ?? ""),
1429
- placeholder: R,
1430
- clearLabel: ce,
1431
- "aria-label": R
1511
+ onChange: (e) => he(e ?? ""),
1512
+ placeholder: z,
1513
+ clearLabel: oe,
1514
+ "aria-label": z
1432
1515
  })
1433
1516
  }),
1434
- /* @__PURE__ */ B(w, {
1435
- politeness: T.Assertive,
1436
- children: E && /* @__PURE__ */ V("div", {
1517
+ /* @__PURE__ */ H(w, {
1518
+ politeness: E.Assertive,
1519
+ children: D && /* @__PURE__ */ U("div", {
1437
1520
  className: "flex flex-wrap items-center gap-2",
1438
- children: [/* @__PURE__ */ B(_, { text: E }), D && /* @__PURE__ */ B(C, {
1439
- label: J,
1440
- onClick: D
1521
+ children: [/* @__PURE__ */ H(_, { text: D }), O && /* @__PURE__ */ H(C, {
1522
+ label: Y,
1523
+ onClick: O
1441
1524
  })]
1442
1525
  })
1443
1526
  }),
1444
- /* @__PURE__ */ B(gt, {
1527
+ /* @__PURE__ */ H(yt, {
1445
1528
  roots: i,
1446
1529
  destination: p,
1447
1530
  onDestinationChange: m,
@@ -1449,20 +1532,20 @@ var G = /* @__PURE__ */ function(e) {
1449
1532
  getDisabledReason: c,
1450
1533
  searchQuery: me,
1451
1534
  disabled: S,
1452
- noResultsLabel: le,
1453
- createFolderLabel: U,
1454
- cancelCreatingFolderLabel: W,
1455
- addSiblingFolderLabel: ue,
1456
- addChildFolderLabel: de,
1457
- emptyFolderNameError: fe,
1458
- invalidFolderNameError: G,
1459
- duplicateFolderNameError: K,
1460
- sameAsParentFolderNameError: q,
1461
- styles: Y
1535
+ noResultsLabel: se,
1536
+ createFolderLabel: ce,
1537
+ cancelCreatingFolderLabel: le,
1538
+ addSiblingFolderLabel: G,
1539
+ addChildFolderLabel: ue,
1540
+ emptyFolderNameError: de,
1541
+ invalidFolderNameError: K,
1542
+ duplicateFolderNameError: q,
1543
+ sameAsParentFolderNameError: J,
1544
+ styles: X
1462
1545
  }),
1463
- v && ve?.hasAccessRules && !(p && v.isHiddenFor?.(p)) && /* @__PURE__ */ B("div", {
1546
+ v && ve?.hasAccessRules && !(p && v.isHiddenFor?.(p)) && /* @__PURE__ */ H("div", {
1464
1547
  className: "mt-1",
1465
- children: /* @__PURE__ */ B(Re, {
1548
+ children: /* @__PURE__ */ H(ze, {
1466
1549
  rules: v.rules,
1467
1550
  onRulesChange: v.onRulesChange,
1468
1551
  sourceOptions: v.sourceOptions,
@@ -1476,38 +1559,38 @@ var G = /* @__PURE__ */ function(e) {
1476
1559
  })
1477
1560
  ]
1478
1561
  });
1479
- let $ = g ? [{
1480
- value: Nt.Keep,
1481
- label: F.replace("{version}", g.currentVersion)
1562
+ let Se = g ? [{
1563
+ value: It.Keep,
1564
+ label: re.replace("{version}", g.currentVersion)
1482
1565
  }, {
1483
- value: Nt.New,
1484
- label: ae,
1485
- content: /* @__PURE__ */ B(ee, {
1486
- id: he,
1566
+ value: It.New,
1567
+ label: ie,
1568
+ content: /* @__PURE__ */ H(ee, {
1569
+ id: Q,
1487
1570
  value: g.newVersion,
1488
1571
  onChange: (e) => g.onNewVersionChange(e ?? ""),
1489
1572
  onBlur: g.onNewVersionBlur,
1490
1573
  labelProps: {
1491
- label: I,
1574
+ label: L,
1492
1575
  required: !0
1493
1576
  },
1494
- placeholder: L,
1577
+ placeholder: R,
1495
1578
  error: g.newVersionError,
1496
1579
  invalid: !!g.newVersionError,
1497
1580
  disabled: S
1498
1581
  })
1499
1582
  }] : [];
1500
- return /* @__PURE__ */ V("div", {
1583
+ return /* @__PURE__ */ U("div", {
1501
1584
  className: "flex flex-col gap-5",
1502
- style: X,
1585
+ style: pe,
1503
1586
  children: [
1504
- t.type == null ? /* @__PURE__ */ B(oe, {
1587
+ t.type == null ? /* @__PURE__ */ H(ae, {
1505
1588
  colors: Z,
1506
- children: /* @__PURE__ */ B("span", {
1507
- className: z("truncate", be),
1589
+ children: /* @__PURE__ */ H("span", {
1590
+ className: V("truncate", be),
1508
1591
  children: t.title
1509
1592
  })
1510
- }) : /* @__PURE__ */ B(oe, {
1593
+ }) : /* @__PURE__ */ H(ae, {
1511
1594
  item: {
1512
1595
  type: t.type,
1513
1596
  name: t.title,
@@ -1517,27 +1600,27 @@ var G = /* @__PURE__ */ function(e) {
1517
1600
  hasVersionTag: !1,
1518
1601
  colors: Z
1519
1602
  }),
1520
- /* @__PURE__ */ V("section", {
1603
+ /* @__PURE__ */ U("section", {
1521
1604
  className: "flex flex-col gap-2",
1522
- children: [/* @__PURE__ */ B("h2", {
1605
+ children: [/* @__PURE__ */ H("h2", {
1523
1606
  className: be,
1524
- children: re
1525
- }), /* @__PURE__ */ V("div", {
1607
+ children: ne
1608
+ }), /* @__PURE__ */ U("div", {
1526
1609
  className: "flex min-w-0 items-center gap-2",
1527
- children: [/* @__PURE__ */ B("div", {
1610
+ children: [/* @__PURE__ */ H("div", {
1528
1611
  role: "group",
1529
- "aria-label": P,
1612
+ "aria-label": F,
1530
1613
  "aria-describedby": xe ? ge : void 0,
1531
1614
  className: "min-w-0 flex-1",
1532
- children: /* @__PURE__ */ B(y, {
1615
+ children: /* @__PURE__ */ H(y, {
1533
1616
  name: _e.join(" / "),
1534
- nameClassName: z(M, Ft.destination)
1617
+ nameClassName: V(N, Rt.destination)
1535
1618
  })
1536
- }), /* @__PURE__ */ B(b, {
1619
+ }), /* @__PURE__ */ H(b, {
1537
1620
  ref: u,
1538
1621
  size: h.Small,
1539
- label: N,
1540
- iconBefore: /* @__PURE__ */ B(H, {
1622
+ label: P,
1623
+ iconBefore: /* @__PURE__ */ H(W, {
1541
1624
  size: d.SM,
1542
1625
  stroke: f,
1543
1626
  "aria-hidden": !0
@@ -1547,122 +1630,122 @@ var G = /* @__PURE__ */ function(e) {
1547
1630
  })]
1548
1631
  })]
1549
1632
  }),
1550
- g && /* @__PURE__ */ V("section", {
1633
+ g && /* @__PURE__ */ U("section", {
1551
1634
  className: "flex flex-col gap-2",
1552
- children: [/* @__PURE__ */ B("h2", {
1635
+ children: [/* @__PURE__ */ H("h2", {
1553
1636
  className: be,
1554
- children: ie
1555
- }), /* @__PURE__ */ B(ne, {
1556
- ariaLabel: ie,
1637
+ children: I
1638
+ }), /* @__PURE__ */ H(te, {
1639
+ ariaLabel: I,
1557
1640
  value: g.versionMode,
1558
1641
  onChange: (e) => g.onVersionModeChange(e),
1559
- items: $,
1642
+ items: Se,
1560
1643
  disabled: S
1561
1644
  })]
1562
1645
  }),
1563
- /* @__PURE__ */ V(w, {
1564
- politeness: T.Assertive,
1565
- children: [xe && /* @__PURE__ */ B(_, {
1646
+ /* @__PURE__ */ U(w, {
1647
+ politeness: E.Assertive,
1648
+ children: [xe && /* @__PURE__ */ H(_, {
1566
1649
  id: ge,
1567
1650
  text: xe
1568
- }), te && /* @__PURE__ */ B(_, { text: te })]
1651
+ }), T && /* @__PURE__ */ H(_, { text: T })]
1569
1652
  }),
1570
- x != null && /* @__PURE__ */ B(Ue, {
1571
- headingClassName: A,
1653
+ x != null && /* @__PURE__ */ H(We, {
1654
+ headingClassName: j,
1572
1655
  ...x
1573
1656
  })
1574
1657
  ]
1575
1658
  });
1576
- }, Lt = {
1659
+ }, Bt = {
1577
1660
  backdrop: "_backdrop_1ie8s_6",
1578
1661
  panel: "_panel_1ie8s_10",
1579
1662
  divider: "_divider_1ie8s_15",
1580
1663
  footer: "_footer_1ie8s_19",
1581
1664
  content: "_content_1ie8s_23",
1582
1665
  title: "_title_1ie8s_28"
1583
- }, Rt = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, colors: l, titleClassName: u = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: m = !1, onPendingDestinationChange: h, ...g }) => {
1584
- let { title: _ = "Save", changeFolderTitle: v = "Change folder", closeAriaLabel: y = "Close", backAriaLabel: x = "Back", cancelLabel: S = "Cancel", saveLabel: ee = "Save", savingLabel: C = "Saving…", selectLabel: w = "Select" } = c, te = se({
1666
+ }, Vt = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, colors: l, titleClassName: u = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: m = !1, onPendingDestinationChange: h, ...g }) => {
1667
+ let { title: _ = "Save", changeFolderTitle: v = "Change folder", closeAriaLabel: y = "Close", backAriaLabel: x = "Back", cancelLabel: S = "Cancel", saveLabel: ee = "Save", savingLabel: C = "Saving…", selectLabel: w = "Select" } = c, T = B({
1585
1668
  "--sstf-backdrop-bg": l?.backdropBackground,
1586
1669
  "--sstf-panel-bg": l?.panelBackground,
1587
1670
  "--sstf-panel-border": l?.panelBorder,
1588
1671
  "--sstf-divider-border": l?.dividerBorder,
1589
1672
  "--sstf-scrollbar-thumb": l?.scrollbarThumb,
1590
1673
  "--sstf-title-text": l?.titleText
1591
- }), [T, D] = a(Pt.Main), [O, k] = a(f), ne = i(null), j = i(null);
1674
+ }), [E, O] = a(Lt.Main), [k, A] = a(f), te = i(null), M = i(null);
1592
1675
  t(() => {
1593
- e && D(Pt.Main);
1676
+ e && O(Lt.Main);
1594
1677
  }, [e]);
1595
- let M = i(T);
1678
+ let N = i(E);
1596
1679
  t(() => {
1597
- M.current !== T && (M.current = T, T === Pt.ChangeFolder ? ne.current?.focus({ preventScroll: !0 }) : j.current?.focus({ preventScroll: !0 }));
1598
- }, [T]);
1599
- let N = i(e);
1680
+ N.current !== E && (N.current = E, E === Lt.ChangeFolder ? te.current?.focus({ preventScroll: !0 }) : M.current?.focus({ preventScroll: !0 }));
1681
+ }, [E]);
1682
+ let P = i(e);
1600
1683
  t(() => {
1601
- let t = N.current;
1602
- N.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1684
+ let t = P.current;
1685
+ P.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1603
1686
  }, [e, s]);
1604
- let P = T === Pt.ChangeFolder, F = (e) => {
1605
- k(e), h?.(e);
1606
- }, ae = () => {
1607
- F(f), D(Pt.ChangeFolder);
1608
- }, I = () => {
1609
- h?.(f), D(Pt.Main);
1687
+ let F = E === Lt.ChangeFolder, re = (e) => {
1688
+ A(e), h?.(e);
1689
+ }, ie = () => {
1690
+ re(f), O(Lt.ChangeFolder);
1610
1691
  }, L = () => {
1611
- O && p(O), D(Pt.Main);
1692
+ h?.(f), O(Lt.Main);
1693
+ }, R = () => {
1694
+ k && p(k), O(Lt.Main);
1612
1695
  };
1613
- return /* @__PURE__ */ V(re, {
1696
+ return /* @__PURE__ */ U(ne, {
1614
1697
  open: e,
1615
1698
  onClose: n,
1616
- header: /* @__PURE__ */ B("span", {
1617
- ref: ne,
1699
+ header: /* @__PURE__ */ H("span", {
1700
+ ref: te,
1618
1701
  tabIndex: -1,
1619
- className: z("block truncate outline-none", u, Lt.title),
1620
- children: P ? v : _
1702
+ className: V("block truncate outline-none", u, Bt.title),
1703
+ children: F ? v : _
1621
1704
  }),
1622
1705
  ariaLabel: _,
1623
- onBack: P ? I : void 0,
1706
+ onBack: F ? L : void 0,
1624
1707
  backAriaLabel: x,
1625
1708
  backDisabled: m,
1626
1709
  closeAriaLabel: y,
1627
1710
  closeDisabled: m,
1628
- style: te,
1629
- overlayStyle: te,
1630
- className: z(Lt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1631
- overlayClassName: Lt.backdrop,
1632
- headerClassName: z("px-[22px]", Lt.divider),
1711
+ style: T,
1712
+ overlayStyle: T,
1713
+ className: V(Bt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1714
+ overlayClassName: Bt.backdrop,
1715
+ headerClassName: V("px-[22px]", Bt.divider),
1633
1716
  bodyClassName: "flex flex-col overflow-hidden",
1634
- children: [/* @__PURE__ */ B("div", {
1635
- className: z("min-h-0 flex-1 overflow-y-auto p-[22px]", Lt.content),
1636
- children: /* @__PURE__ */ B(It, {
1717
+ children: [/* @__PURE__ */ H("div", {
1718
+ className: V("min-h-0 flex-1 overflow-y-auto p-[22px]", Bt.content),
1719
+ children: /* @__PURE__ */ H(zt, {
1637
1720
  ...g,
1638
- view: T,
1721
+ view: E,
1639
1722
  destination: f,
1640
1723
  onDestinationChange: p,
1641
1724
  isSubmitting: m,
1642
- onChangeFolderClick: ae,
1643
- changeFolderButtonRef: j,
1644
- pendingDestination: O,
1645
- onPendingDestinationChange: F
1725
+ onChangeFolderClick: ie,
1726
+ changeFolderButtonRef: M,
1727
+ pendingDestination: k,
1728
+ onPendingDestinationChange: re
1646
1729
  })
1647
- }), /* @__PURE__ */ V("div", {
1648
- className: z("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", Lt.footer),
1649
- children: [/* @__PURE__ */ B(b, {
1730
+ }), /* @__PURE__ */ U("div", {
1731
+ className: V("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", Bt.footer),
1732
+ children: [/* @__PURE__ */ H(b, {
1650
1733
  label: S,
1651
1734
  className: "mobile:flex-1",
1652
1735
  disabled: m,
1653
- onClick: P ? I : n
1654
- }), P ? /* @__PURE__ */ B(E, {
1736
+ onClick: F ? L : n
1737
+ }), F ? /* @__PURE__ */ H(D, {
1655
1738
  label: w,
1656
1739
  className: "mobile:flex-1",
1657
- disabled: O == null,
1658
- onClick: L
1659
- }) : /* @__PURE__ */ B(A, {
1740
+ disabled: k == null,
1741
+ onClick: R
1742
+ }) : /* @__PURE__ */ H(j, {
1660
1743
  label: m ? C : ee,
1661
1744
  className: "mobile:flex-1",
1662
1745
  disabled: o || m,
1663
- iconBefore: m ? /* @__PURE__ */ B("span", {
1746
+ iconBefore: m ? /* @__PURE__ */ H("span", {
1664
1747
  "aria-hidden": !0,
1665
- children: /* @__PURE__ */ B(ie, { size: d.SM })
1748
+ children: /* @__PURE__ */ H(I, { size: d.SM })
1666
1749
  }) : void 0,
1667
1750
  onClick: r
1668
1751
  })]
@@ -1670,4 +1753,4 @@ var G = /* @__PURE__ */ function(e) {
1670
1753
  });
1671
1754
  };
1672
1755
  //#endregion
1673
- export { We as PUBLISH_PANEL_CLASS, G as PublicationRuleFunction, Pe as PublishAccessRuleEditor, Re as PublishAccessRules, K as PublishCalloutKind, $e as PublishDependenciesList, q as PublishDependencyType, gt as PublishFoldersTree, Et as PublishFooter, tt as PublishHistoryList, xt as PublishPanel, Q as PublishPanelView, It as SaveToFolderPanel, Pt as SaveToFolderView, Nt as SaveVersionMode, Ot as StandalonePublishPanel, Rt as StandaloneSaveToFolderPanel, Mt as UnpublishConfirmationDialog, Ue as VersionHistorySection, ze as VersionHistoryStatus, xe as collectFolderKeys, J as derivePublishState, ge as filterFolderTree, Y as formatPublishedDate, Se as fromFolderPathKey, Oe as getSiblingFolderNames, De as getUniqueFolderName, be as mergeFolderPaths, ve as sortFolderTree, we as toDialFileTree, $ as toFolderPathKey, me as usePublishFlow, he as usePublishFolderView, Ee as validateFolderName };
1756
+ export { Ge as PUBLISH_PANEL_CLASS, K as PublicationRuleFunction, Fe as PublishAccessRuleEditor, ze as PublishAccessRules, q as PublishCalloutKind, Y as PublishDependenciesAppearance, nt as PublishDependenciesList, J as PublishDependencyType, yt as PublishFoldersTree, kt as PublishFooter, it as PublishHistoryList, wt as PublishPanel, Q as PublishPanelView, zt as SaveToFolderPanel, Lt as SaveToFolderView, It as SaveVersionMode, jt as StandalonePublishPanel, Vt as StandaloneSaveToFolderPanel, Ft as UnpublishConfirmationDialog, We as VersionHistorySection, Be as VersionHistoryStatus, Se as collectFolderKeys, fe as derivePublishState, _e as filterFolderTree, pe as formatPublishedDate, Ce as fromFolderPathKey, ke as getSiblingFolderNames, Oe as getUniqueFolderName, xe as mergeFolderPaths, ye as sortFolderTree, Te as toDialFileTree, $ as toFolderPathKey, he as usePublishFlow, ge as usePublishFolderView, De as validateFolderName };