@epam/ai-dial-publish-panel 1.3.0-dev.331 → 1.3.0-dev.342

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,40 +1,40 @@
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 { ButtonVariant as o, Checkbox as s, DIAL_ICON_SIZE as c, DIAL_KIT_ICON_STROKE as l, DialFileNodeType as u, ElementSize as d, ErrorText as f, FolderName as p, GhostButton as m, GhostIconButton as h, Highlight as g, Input as _, LinkButton as ee, LiveRegion as v, LiveRegionElement as te, LiveRegionPoliteness as y, NeutralButton as b, Notification as x, NotificationType as S, NotificationVariant as C, PrimaryButton as ne, RadioGroup as re, Search as w, Select as T, SideDrawer as E, Spinner as D, Tag as O, TagInput as k } from "@epam/ai-dial-ui-kit";
3
- import { ResourceSummary as A, TAG_INPUT_TAG_CLASS_NAME as j, buildCssVars as ie, mergeClasses as M } from "@epam/ai-dial-chat-shared";
4
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
5
- import { IconFolder as I, IconFolderPlus as ae, IconPlus as L, IconTrashX as oe } from "@tabler/icons-react";
6
- import { DialFileNodeType as se, DialFoldersTree as ce } from "@epam/ai-dial-react-file-manager";
2
+ import { BottomSheet as o, ButtonVariant as s, Checkbox as c, DIAL_ICON_SIZE as l, DIAL_KIT_ICON_STROKE as u, DialFileNodeType as d, ElementSize as f, ErrorText as p, FolderName as m, GhostButton as h, GhostIconButton as g, Highlight as _, Input as ee, LinkButton as v, LiveRegion as y, LiveRegionElement as b, LiveRegionPoliteness as x, NeutralButton as S, Notification as C, NotificationType as w, NotificationVariant as T, PrimaryButton as E, RadioGroup as D, Search as O, Select as k, SideDrawer as A, Spinner as j, Tag as M, TagInput as N } from "@epam/ai-dial-ui-kit";
3
+ import { ResourceSummary as P, TAG_INPUT_TAG_CLASS_NAME as te, buildCssVars as ne, mergeClasses as F, useIsMobile as I } from "@epam/ai-dial-chat-shared";
4
+ import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
5
+ import { IconFolder as B, IconFolderPlus as re, IconPlus as ie, IconTrashX as ae } from "@tabler/icons-react";
6
+ import { DialFileNodeType as oe, DialFoldersTree as se } from "@epam/ai-dial-react-file-manager";
7
7
  //#region src/models/publish.ts
8
- var R = /* @__PURE__ */ function(e) {
8
+ var V = /* @__PURE__ */ function(e) {
9
9
  return e.Equal = "EQUAL", e.Contain = "CONTAIN", e.Regex = "REGEX", e;
10
- }({}), z = /* @__PURE__ */ function(e) {
10
+ }({}), H = /* @__PURE__ */ function(e) {
11
11
  return e.None = "none", e.Info = "info", e.ReplaceWarning = "replaceWarning", e.NoAccess = "noAccess", e.SubmitError = "submitError", e;
12
- }({}), B = (e) => e.isSubmitting ? {
13
- calloutKind: z.None,
12
+ }({}), U = (e) => e.isSubmitting ? {
13
+ calloutKind: H.None,
14
14
  isSubmitDisabled: !0,
15
15
  isSubmitLoading: !0
16
16
  } : e.hasSelectedFolder ? e.hasWriteAccess ? e.hasSubmitError ? {
17
- calloutKind: z.SubmitError,
17
+ calloutKind: H.SubmitError,
18
18
  isSubmitDisabled: !1,
19
19
  isSubmitLoading: !1
20
20
  } : e.hasExistingPublicationInFolder ? {
21
- calloutKind: z.ReplaceWarning,
21
+ calloutKind: H.ReplaceWarning,
22
22
  isSubmitDisabled: e.allowReplace === !1,
23
23
  isSubmitLoading: !1
24
24
  } : {
25
- calloutKind: z.Info,
25
+ calloutKind: H.Info,
26
26
  isSubmitDisabled: !1,
27
27
  isSubmitLoading: !1
28
28
  } : {
29
- calloutKind: z.NoAccess,
29
+ calloutKind: H.NoAccess,
30
30
  isSubmitDisabled: !0,
31
31
  isSubmitLoading: !1
32
32
  } : {
33
- calloutKind: z.None,
33
+ calloutKind: H.None,
34
34
  isSubmitDisabled: !0,
35
35
  isSubmitLoading: !1
36
- }, V = 864e5, H = (e, t = Date.now(), n) => {
37
- let r = Math.floor((t - e) / V);
36
+ }, ce = 864e5, W = (e, t = Date.now(), n) => {
37
+ let r = Math.floor((t - e) / ce);
38
38
  return r <= 0 ? "Today" : r === 1 ? "Yesterday" : r < 7 ? `${r} days ago` : new Date(e).toLocaleDateString(n, {
39
39
  month: "short",
40
40
  day: "numeric",
@@ -52,45 +52,45 @@ var R = /* @__PURE__ */ function(e) {
52
52
  } : {
53
53
  ...e,
54
54
  children: e.children ? le(e.children, t, n) : e.children
55
- }), U = (e, t, n) => {
55
+ }), G = (e, t, n) => {
56
56
  let r = [...t, n].join("/");
57
57
  return t.length === 0 ? e.filter((e) => e.path.join("/") !== r) : e.map((e) => e.path.join("/") === t.join("/") ? {
58
58
  ...e,
59
59
  children: (e.children ?? []).filter((e) => e.path.join("/") !== r)
60
60
  } : {
61
61
  ...e,
62
- children: e.children ? U(e.children, t, n) : e.children
62
+ children: e.children ? G(e.children, t, n) : e.children
63
63
  });
64
- }, ue = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
64
+ }, K = ({ item: n, history: i, folderItems: o, hasWriteAccess: s = () => !0, defaultAuthor: c = "", onCreateFolder: l, onPublish: u, onPublishSuccess: d, onPublishError: f, onFetchExistingRules: p }) => {
65
65
  let [m, h] = a(o);
66
66
  t(() => {
67
67
  h(o);
68
68
  }, [o]);
69
- let [g, _] = a(), [ee, v] = a(!1), [te, y] = a(!1), [b, x] = a([]), [S, C] = a(!1), [ne, re] = a(!1), [w, T] = a(c), [E, D] = a(!1), [O, k] = a(!1);
69
+ let [g, _] = a(), [ee, v] = a(!1), [y, b] = a(!1), [x, S] = a([]), [C, w] = a(!1), [T, E] = a(!1), [D, O] = a(c), [k, A] = a(!1), [j, M] = a(!1);
70
70
  t(() => {
71
- O || T(c);
72
- }, [c, O]);
73
- let A = e((e) => {
74
- k(!0), T(e);
71
+ j || O(c);
72
+ }, [c, j]);
73
+ let N = e((e) => {
74
+ M(!0), O(e);
75
75
  }, []);
76
76
  t(() => {
77
77
  if (g == null) {
78
- x([]), re(!1);
78
+ S([]), E(!1);
79
79
  return;
80
80
  }
81
81
  if (!p) return;
82
82
  let e = !1;
83
- return C(!0), re(!1), p(g).then((t) => {
84
- e || x(t);
83
+ return w(!0), E(!1), p(g).then((t) => {
84
+ e || S(t);
85
85
  }).catch(() => {
86
- e || re(!0);
86
+ e || E(!0);
87
87
  }).finally(() => {
88
- e || C(!1);
88
+ e || w(!1);
89
89
  }), () => {
90
90
  e = !0;
91
91
  };
92
92
  }, [g]);
93
- let j = r(() => {
93
+ let P = r(() => {
94
94
  if (!g) return !1;
95
95
  let e = g.join("/");
96
96
  return i.some((t) => t.folderPath.join("/") === e ? n.version == null || t.version === n.version : !1);
@@ -98,59 +98,77 @@ var R = /* @__PURE__ */ function(e) {
98
98
  i,
99
99
  n.version,
100
100
  g
101
- ]), ie = e(async (e, t) => {
101
+ ]), te = e(async (e, t) => {
102
102
  h((n) => le(n, e, t));
103
103
  try {
104
104
  await l?.(e, t);
105
105
  } catch {
106
- h((n) => U(n, e, t)), y(!0);
106
+ h((n) => G(n, e, t)), b(!0);
107
107
  }
108
- }, [l]), M = e(async () => {
108
+ }, [l]), ne = e(async () => {
109
109
  if (!g) return !1;
110
- v(!0), y(!1);
110
+ v(!0), b(!1);
111
111
  try {
112
- return await u(n, g, b, w.trim(), E), d?.(n, g), !0;
112
+ return await u(n, g, x, D.trim(), k), d?.(n, g), !0;
113
113
  } catch (e) {
114
- return y(!0), f?.(n, g, e), !1;
114
+ return b(!0), f?.(n, g, e), !1;
115
115
  } finally {
116
116
  v(!1);
117
117
  }
118
118
  }, [
119
- w,
119
+ D,
120
120
  n,
121
121
  u,
122
122
  f,
123
123
  d,
124
- E,
125
- b,
124
+ k,
125
+ x,
126
126
  g
127
- ]), N = e(() => {
128
- h(o), _(void 0), y(!1), x([]), re(!1), T(c), k(!1), D(!1);
127
+ ]), F = e(() => {
128
+ h(o), _(void 0), b(!1), S([]), E(!1), O(c), M(!1), A(!1);
129
129
  }, [c, o]);
130
130
  return {
131
131
  folderItems: m,
132
132
  selectedFolderPath: g,
133
133
  setSelectedFolderPath: _,
134
- handleCreateFolder: ie,
135
- hasExistingPublicationInFolder: j,
134
+ handleCreateFolder: te,
135
+ hasExistingPublicationInFolder: P,
136
136
  hasWriteAccess: !g || s(g),
137
137
  isSubmitting: ee,
138
- hasSubmitError: te,
139
- handleSubmit: M,
140
- reset: N,
141
- rules: b,
142
- setRules: x,
143
- author: w,
144
- setAuthor: A,
145
- publishCredentials: E,
146
- setPublishCredentials: D,
147
- isRulesLoading: S,
148
- hasRulesLoadError: ne
138
+ hasSubmitError: y,
139
+ handleSubmit: ne,
140
+ reset: F,
141
+ rules: x,
142
+ setRules: S,
143
+ author: D,
144
+ setAuthor: N,
145
+ publishCredentials: k,
146
+ setPublishCredentials: A,
147
+ isRulesLoading: C,
148
+ hasRulesLoadError: T
149
+ };
150
+ }, q = /* @__PURE__ */ function(e) {
151
+ return e.Main = "main", e.ChangeFolder = "change-folder", e;
152
+ }({}), ue = ({ isOpen: e, selectedFolderPath: n, onSelectedFolderPathChange: r }) => {
153
+ let [i, o] = a(q.Main), [s, c] = a();
154
+ return t(() => {
155
+ e && o(q.Main);
156
+ }, [e]), {
157
+ view: i,
158
+ pendingFolderPath: s,
159
+ setPendingFolderPath: c,
160
+ openFolderView: () => {
161
+ c(n), o(q.ChangeFolder);
162
+ },
163
+ backToMain: () => o(q.Main),
164
+ selectFolder: () => {
165
+ s != null && r(s), o(q.Main);
166
+ }
149
167
  };
150
- }, W = (e, t) => {
168
+ }, J = (e, t) => {
151
169
  let n = t.trim().toLowerCase();
152
170
  return n ? e.reduce((e, r) => {
153
- let i = r.children ? W(r.children, t) : void 0;
171
+ let i = r.children ? J(r.children, t) : void 0;
154
172
  return r.name.toLowerCase().includes(n) ? e.push(r) : i?.length && e.push({
155
173
  ...r,
156
174
  children: i
@@ -159,203 +177,204 @@ var R = /* @__PURE__ */ function(e) {
159
177
  }, de = (e, t) => e.localeCompare(t, void 0, {
160
178
  sensitivity: "base",
161
179
  numeric: !0
162
- }), fe = (e) => [...e].sort((e, t) => de(e.name, t.name)).map((e) => e.children ? {
180
+ }), Y = (e) => [...e].sort((e, t) => de(e.name, t.name)).map((e) => e.children ? {
163
181
  ...e,
164
- children: fe(e.children)
165
- } : e), G = (e, t, n) => {
182
+ children: Y(e.children)
183
+ } : e), X = (e, t, n) => {
166
184
  let [r, ...i] = t;
167
185
  if (r == null) return e;
168
186
  let a = [...n, r], o = e.find((e) => e.name === r);
169
187
  return o ? i.length ? e.map((e) => e === o ? {
170
188
  ...e,
171
- children: G(e.children ?? [], i, a)
189
+ children: X(e.children ?? [], i, a)
172
190
  } : e) : e : [...e, {
173
191
  path: a,
174
192
  name: r,
175
- children: i.length ? G([], i, a) : void 0
193
+ children: i.length ? X([], i, a) : void 0
176
194
  }];
177
- }, K = (e, t) => t.reduce((e, t) => t.length ? G(e, t, []) : e, e), q = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? q(e.children) : []]), J = (e) => e.join("/"), pe = (e) => e.split("/").filter(Boolean), Y = (e) => e.map((e) => {
178
- let t = J(e.path);
195
+ }, Z = (e, t) => t.reduce((e, t) => t.length ? X(e, t, []) : e, e), fe = (e) => e.flatMap((e) => [e.path.join("/"), ...e.children ? fe(e.children) : []]), Q = (e) => e.join("/"), pe = (e) => e.split("/").filter(Boolean), me = (e) => e.map((e) => {
196
+ let t = Q(e.path);
179
197
  return {
180
198
  path: t,
181
199
  name: e.name,
182
200
  folderId: t,
183
- nodeType: u.FOLDER,
184
- items: e.children ? Y(e.children) : void 0
201
+ nodeType: d.FOLDER,
202
+ items: e.children ? me(e.children) : void 0
185
203
  };
186
- }), me = /[/\\:;,={}&"]/, he = (e, t, n) => {
204
+ }), he = /[/\\:;,={}&"]/, ge = (e, t, n) => {
187
205
  let r = e.trim();
188
- return r ? r.includes("..") || me.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
189
- }, ge = (e, t) => {
206
+ return r ? r.includes("..") || he.test(r) ? n.invalid : t.some((e) => e.toLowerCase() === r.toLowerCase()) ? n.duplicate : null : n.empty;
207
+ }, _e = (e, t) => {
190
208
  let n = new Set(t.map((e) => e.toLowerCase()));
191
209
  if (!n.has(e.toLowerCase())) return e;
192
210
  let r = 2;
193
211
  for (; n.has(`${e} ${r}`.toLowerCase());) r += 1;
194
212
  return `${e} ${r}`;
195
- }, _e = (e, t) => {
213
+ }, ve = (e, t) => {
196
214
  if (t.length === 0) return e.map((e) => e.name);
197
- let n = J(t), r = (e) => {
215
+ let n = Q(t), r = (e) => {
198
216
  for (let t of e) {
199
- if (J(t.path) === n) return t;
217
+ if (Q(t.path) === n) return t;
200
218
  let e = t.children ? r(t.children) : void 0;
201
219
  if (e) return e;
202
220
  }
203
221
  };
204
222
  return (r(e)?.children ?? []).map((e) => e.name);
205
- }, ve = {
206
- dialog: "_dialog_jqcm2_5",
207
- error: "_error_jqcm2_14",
208
- selectField: "_selectField_jqcm2_28",
209
- selectFieldOpen: "_selectFieldOpen_jqcm2_40"
210
- }, X = 20, Z = 200, ye = 8, be = (e) => {
223
+ }, ye = {
224
+ sheet: "_sheet_1jbwn_3",
225
+ inline: "_inline_1jbwn_7",
226
+ selectField: "_selectField_1jbwn_21",
227
+ selectFieldOpen: "_selectFieldOpen_1jbwn_33"
228
+ }, be = 20, xe = 200, Se = 8, Ce = (e) => {
211
229
  let t = e.trim();
212
- if (t.length === 0 || t.length > Z) return !1;
230
+ if (t.length === 0 || t.length > xe) return !1;
213
231
  try {
214
232
  return new RegExp(t) instanceof RegExp;
215
233
  } catch {
216
234
  return !1;
217
235
  }
218
- }, Q = ({ sourceOptions: e, onSave: o, onCancel: s, disabled: c = !1, maxTargets: l = X, labels: u = {}, errorClassName: d = "dial-tiny-text", styles: p = {} }) => {
219
- let h = {
220
- ...ie({
221
- "--pare-mobile-bg": p.colors?.mobileBackground,
222
- "--pare-bg": p.colors?.background,
223
- "--pare-error-text": p.colors?.errorText,
224
- "--pare-select-border": p.colors?.selectBorder,
225
- "--pare-select-border-hover": p.colors?.selectBorderHover,
226
- "--pare-select-border-open": p.colors?.selectBorderOpen,
227
- "--pare-select-border-focus": p.colors?.selectBorderFocus
236
+ }, we = ({ sourceOptions: e, onSave: s, onCancel: c, disabled: l = !1, maxTargets: u = be, labels: d = {}, styles: f = {} }) => {
237
+ let p = I(), m = {
238
+ ...ne({
239
+ "--pare-mobile-bg": f.colors?.mobileBackground,
240
+ "--pare-bg": f.colors?.background,
241
+ "--pare-select-border": f.colors?.selectBorder,
242
+ "--pare-select-border-hover": f.colors?.selectBorderHover,
243
+ "--pare-select-border-open": f.colors?.selectBorderOpen,
244
+ "--pare-select-border-focus": f.colors?.selectBorderFocus
228
245
  }),
229
- ...p.cssVars
230
- }, { sourceLabel: ee = "Source", sourcePlaceholder: v = "Select...", functionLabel: te = "Function", equalOptionLabel: y = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: S = "Regex", targetsLabel: C = "Targets", targetsPlaceholder: ne = "Add a target", targetsHintLabel: re = "Press Enter or comma to add a target.", patternLabel: w = "Pattern", patternPlaceholder: E = "Enter a regular expression", invalidRegexError: D = "Enter a valid regular expression.", requiredFieldError: O = "This field is required.", targetsRequiredError: A = "Add at least one target.", saveLabel: N = "Save", cancelLabel: I = "Cancel", dialogAriaLabel: ae = "Add access rule" } = u, L = n(), oe = n(), se = n(), ce = n(), z = i(null);
246
+ ...f.cssVars
247
+ }, { sourceLabel: g = "Source", sourcePlaceholder: v = "Select...", functionLabel: y = "Function", equalOptionLabel: b = "Equal", containOptionLabel: x = "Contain", regexOptionLabel: C = "Regex", targetsLabel: w = "Targets", targetsPlaceholder: T = "Add a target", targetsHintLabel: E = "Press Enter or comma to add a target.", patternLabel: D = "Pattern", patternPlaceholder: O = "Enter a regular expression", invalidRegexError: A = "Enter a valid regular expression.", requiredFieldError: j = "This field is required.", targetsRequiredError: M = "Add at least one target.", saveLabel: P = "Save", cancelLabel: B = "Cancel", dialogAriaLabel: re = "Add access rule" } = d, ie = n(), ae = n(), oe = n(), se = n(), H = i(null);
231
248
  t(() => {
232
- z.current?.focus();
233
- }, []);
234
- let [B, V] = a(), [H, le] = a(), [U, ue] = a([]), [W, de] = a(""), [fe, G] = a(!1), [K, q] = a(""), [J, pe] = a(!1), [Y, me] = a(!1), he = M(ve.selectField, fe && ve.selectFieldOpen), ge = M(ve.selectField, J && ve.selectFieldOpen), _e = r(() => e.map((e) => ({
249
+ p || H.current?.focus();
250
+ }, [p]);
251
+ let [U, ce] = a(), [W, le] = a(), [G, K] = a([]), [q, ue] = a(""), [J, de] = a(!1), [Y, X] = a(""), [Z, fe] = a(!1), [Q, pe] = a(!1), me = F(ye.selectField, J && ye.selectFieldOpen), he = F(ye.selectField, Z && ye.selectFieldOpen), ge = r(() => e.map((e) => ({
235
252
  value: e,
236
253
  label: e,
237
- labelNode: K.trim() ? /* @__PURE__ */ P(g, {
254
+ labelNode: Y.trim() ? /* @__PURE__ */ R(_, {
238
255
  text: e,
239
- query: K,
256
+ query: Y,
240
257
  maxLines: 1
241
258
  }) : void 0
242
- })), [e, K]), Z = r(() => [
259
+ })), [e, Y]), _e = r(() => [
243
260
  {
244
- value: R.Equal,
245
- label: y
261
+ value: V.Equal,
262
+ label: b
246
263
  },
247
264
  {
248
- value: R.Contain,
265
+ value: V.Contain,
249
266
  label: x
250
267
  },
251
268
  {
252
- value: R.Regex,
253
- label: S
269
+ value: V.Regex,
270
+ label: C
254
271
  }
255
272
  ], [
256
- y,
273
+ b,
257
274
  x,
258
- S
259
- ]), Q = H === R.Regex, $ = be(W), xe = B != null && H != null && (Q ? $ : U.length > 0);
260
- return /* @__PURE__ */ F("div", {
261
- ref: z,
262
- role: "dialog",
263
- "aria-modal": "true",
264
- "aria-label": ae,
275
+ C
276
+ ]), ve = W === V.Regex, xe = Ce(q), we = U != null && W != null && (ve ? xe : G.length > 0), $ = (e) => {
277
+ ce(Array.isArray(e) ? e[0] : e), de(!1);
278
+ }, Te = (e) => {
279
+ let t = Array.isArray(e) ? e[0] : e;
280
+ W === V.Regex != (t === V.Regex) && (K([]), ue("")), le(t), fe(!1);
281
+ }, Ee = (e) => {
282
+ let t = [];
283
+ for (let n of e) {
284
+ let e = n.trim();
285
+ if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= u)) break;
286
+ }
287
+ K(t);
288
+ }, De = () => {
289
+ !we || U == null || W == null ? pe(!0) : s({
290
+ source: U,
291
+ function: W,
292
+ targets: ve ? [q.trim()] : G
293
+ });
294
+ }, Oe = (q.length > 0 || Q) && !xe, ke = (e) => {
295
+ e.key === "Escape" && (e.stopPropagation(), c());
296
+ }, Ae = /* @__PURE__ */ z(L, { children: [
297
+ /* @__PURE__ */ R(k, {
298
+ id: ae,
299
+ labelProps: { label: g },
300
+ options: ge,
301
+ value: U,
302
+ onChange: $,
303
+ placeholder: v,
304
+ searchable: e.length > Se,
305
+ searchPlaceholder: v,
306
+ onSearchQueryChange: X,
307
+ disabled: l,
308
+ open: J,
309
+ onOpenChange: de,
310
+ fieldClassName: me,
311
+ invalid: Q && U == null,
312
+ error: Q && U == null ? j : void 0
313
+ }),
314
+ /* @__PURE__ */ R(k, {
315
+ labelProps: { label: y },
316
+ id: oe,
317
+ options: _e,
318
+ value: W,
319
+ onChange: Te,
320
+ placeholder: y,
321
+ disabled: l,
322
+ open: Z,
323
+ onOpenChange: fe,
324
+ fieldClassName: he,
325
+ invalid: Q && W == null,
326
+ error: Q && W == null ? j : void 0
327
+ }),
328
+ ve ? /* @__PURE__ */ R(ee, {
329
+ id: ie,
330
+ labelProps: { label: D },
331
+ placeholder: O,
332
+ value: q,
333
+ onChange: (e) => ue(e ?? ""),
334
+ error: Oe ? A : void 0,
335
+ disabled: l
336
+ }) : /* @__PURE__ */ R(N, {
337
+ id: se,
338
+ labelProps: { label: w },
339
+ placeholder: T,
340
+ caption: Q && G.length === 0 ? void 0 : E,
341
+ error: Q && G.length === 0 ? M : void 0,
342
+ invalid: Q && G.length === 0,
343
+ value: G,
344
+ onChange: Ee,
345
+ disabled: l,
346
+ tagClassName: te
347
+ }),
348
+ /* @__PURE__ */ z("div", {
349
+ className: "mt-auto flex justify-end gap-2 desktop:mt-2",
350
+ children: [/* @__PURE__ */ R(h, {
351
+ label: B,
352
+ onClick: c,
353
+ disabled: l
354
+ }), /* @__PURE__ */ R(S, {
355
+ label: P,
356
+ onClick: De,
357
+ disabled: l
358
+ })]
359
+ })
360
+ ] });
361
+ return p ? /* @__PURE__ */ R(o, {
362
+ open: !0,
363
+ onClose: c,
364
+ ariaLabel: re,
365
+ style: m,
366
+ className: ye.sheet,
367
+ bodyClassName: "flex flex-col gap-3 p-4",
368
+ children: Ae
369
+ }) : /* @__PURE__ */ R("div", {
370
+ ref: H,
371
+ role: "group",
372
+ "aria-label": re,
265
373
  tabIndex: -1,
266
- onKeyDown: (e) => {
267
- e.key === "Escape" && (e.stopPropagation(), s());
268
- },
269
- style: h,
270
- className: M("fixed inset-0 z-60 flex flex-col gap-3 overflow-y-auto p-4", "desktop:static desktop:z-auto desktop:flex-none desktop:overflow-visible desktop:rounded-lg desktop:p-3", ve.dialog),
271
- children: [
272
- /* @__PURE__ */ P(T, {
273
- id: oe,
274
- labelProps: { label: ee },
275
- options: _e,
276
- value: B,
277
- onChange: (e) => {
278
- V(Array.isArray(e) ? e[0] : e), G(!1);
279
- },
280
- placeholder: v,
281
- searchable: e.length > ye,
282
- searchPlaceholder: v,
283
- onSearchQueryChange: q,
284
- disabled: c,
285
- open: fe,
286
- onOpenChange: G,
287
- fieldClassName: he,
288
- invalid: Y && B == null,
289
- error: Y && B == null ? O : void 0
290
- }),
291
- /* @__PURE__ */ P(T, {
292
- labelProps: { label: te },
293
- id: se,
294
- options: Z,
295
- value: H,
296
- onChange: (e) => {
297
- let t = Array.isArray(e) ? e[0] : e;
298
- H === R.Regex != (t === R.Regex) && (ue([]), de("")), le(t), pe(!1);
299
- },
300
- placeholder: te,
301
- disabled: c,
302
- open: J,
303
- onOpenChange: pe,
304
- fieldClassName: ge,
305
- invalid: Y && H == null,
306
- error: Y && H == null ? O : void 0
307
- }),
308
- Q ? /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P(_, {
309
- id: `${L}-input`,
310
- labelProps: { label: w },
311
- placeholder: E,
312
- value: W,
313
- onChange: (e) => de(e ?? ""),
314
- invalid: (W.length > 0 || Y) && !$,
315
- "aria-describedby": (W.length > 0 || Y) && !$ ? L : void 0,
316
- disabled: c
317
- }), (W.length > 0 || Y) && !$ && /* @__PURE__ */ P(f, {
318
- id: L,
319
- className: M("mt-1 block", d, ve.error),
320
- text: D
321
- })] }) : /* @__PURE__ */ P(k, {
322
- id: ce,
323
- labelProps: { label: C },
324
- placeholder: ne,
325
- caption: Y && U.length === 0 ? void 0 : re,
326
- error: Y && U.length === 0 ? A : void 0,
327
- invalid: Y && U.length === 0,
328
- value: U,
329
- onChange: (e) => {
330
- let t = [];
331
- for (let n of e) {
332
- let e = n.trim();
333
- if (!(e.length === 0 || t.includes(e)) && (t.push(e), t.length >= l)) break;
334
- }
335
- ue(t);
336
- },
337
- disabled: c,
338
- tagClassName: j
339
- }),
340
- /* @__PURE__ */ F("div", {
341
- className: "mt-auto flex justify-end gap-2 desktop:mt-2",
342
- children: [/* @__PURE__ */ P(m, {
343
- label: I,
344
- onClick: s,
345
- disabled: c
346
- }), /* @__PURE__ */ P(b, {
347
- label: N,
348
- onClick: () => {
349
- !xe || B == null || H == null ? me(!0) : o({
350
- source: B,
351
- function: H,
352
- targets: Q ? [W.trim()] : U
353
- });
354
- },
355
- disabled: c
356
- })]
357
- })
358
- ]
374
+ onKeyDown: ke,
375
+ style: m,
376
+ className: F("flex flex-none flex-col gap-3 rounded-lg p-3", ye.inline),
377
+ children: Ae
359
378
  });
360
379
  }, $ = {
361
380
  ruleRow: "_ruleRow_nx0en_1",
@@ -363,158 +382,158 @@ var R = /* @__PURE__ */ function(e) {
363
382
  hint: "_hint_nx0en_9",
364
383
  loading: "_loading_nx0en_13",
365
384
  ruleText: "_ruleText_nx0en_17"
366
- }, xe = 20, Se = (e, t) => e === R.Equal ? t.equal : e === R.Contain ? t.contain : t.regex, Ce = ({ rules: e, onRulesChange: r, sourceOptions: s, folderName: u, disabled: d = !1, isLoading: f = !1, hasLoadError: p = !1, maxRules: g = xe, maxTargetsPerRule: _, labels: ee = {}, headingClassName: y = "dial-body-semi-text", hintClassName: b = "dial-small-text", loadingClassName: ne = "dial-small-text", ruleTextClassName: re = "dial-small-text", ruleSourceClassName: w = "dial-small-semi-text", styles: T = {} }) => {
367
- let E = {
368
- ...ie({
369
- "--par-rule-bg": T.colors?.ruleBackground,
370
- "--par-heading-text": T.colors?.headingText,
371
- "--par-hint-text": T.colors?.hintText,
372
- "--par-loading-text": T.colors?.loadingText,
373
- "--par-rule-text": T.colors?.ruleText
385
+ }, Te = 20, Ee = (e, t) => e === V.Equal ? t.equal : e === V.Contain ? t.contain : t.regex, De = ({ rules: e, onRulesChange: r, sourceOptions: o, folderName: c, disabled: d = !1, isLoading: f = !1, hasLoadError: p = !1, maxRules: m = Te, maxTargetsPerRule: _, labels: ee = {}, headingClassName: v = "dial-body-semi-text", hintClassName: x = "dial-small-text", loadingClassName: S = "dial-small-text", ruleTextClassName: E = "dial-small-text", ruleSourceClassName: D = "dial-small-semi-text", styles: O = {} }) => {
386
+ let k = {
387
+ ...ne({
388
+ "--par-rule-bg": O.colors?.ruleBackground,
389
+ "--par-heading-text": O.colors?.headingText,
390
+ "--par-hint-text": O.colors?.hintText,
391
+ "--par-loading-text": O.colors?.loadingText,
392
+ "--par-rule-text": O.colors?.ruleText
374
393
  }),
375
- ...T.cssVars
376
- }, { heading: O = "Allow access if all match", folderScopeHint: k = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: A = "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: N = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: ae = "Clear all", orSeparatorLabel: se = "Or", removeRuleAriaLabelTemplate: ce = "Remove rule for {source}: {targets}", equalFunctionLabel: R = "Equal", containFunctionLabel: z = "Contain", regexFunctionLabel: B = "Regex", loadingLabel: V = "Loading existing rules…", loadErrorLabel: H = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: le = "Rule added.", ruleRemovedAnnouncement: U = "Rule removed.", rulesClearedAnnouncement: ue = "All rules cleared.", rulesLoadedAnnouncement: W = "Existing rules loaded for the selected folder.", editorLabels: de } = ee, fe = n(), [G, K] = a(!1), [q, J] = a(""), pe = i(null), Y = i(f);
394
+ ...O.cssVars
395
+ }, { heading: A = "Allow access if all match", folderScopeHint: M = "These rules apply to \"{folder}\". Selecting another folder loads that folder's own rules instead.", noFolderScopeHint: N = "Access rules apply to the destination folder — pick a folder above to set its rules.", rulesWithoutFolderWarning: P = "These rules have no destination yet. Select a folder above to apply them.", maxRulesReachedLabel: te = "Rule limit reached ({max}). Remove a rule to add another.", addRuleLabel: I = "Add rule", clearAllLabel: L = "Clear all", orSeparatorLabel: B = "Or", removeRuleAriaLabelTemplate: re = "Remove rule for {source}: {targets}", equalFunctionLabel: oe = "Equal", containFunctionLabel: se = "Contain", regexFunctionLabel: V = "Regex", loadingLabel: H = "Loading existing rules…", loadErrorLabel: U = "Couldn't load existing rules for this folder. You can still add rules manually.", ruleAddedAnnouncement: ce = "Rule added.", ruleRemovedAnnouncement: W = "Rule removed.", rulesClearedAnnouncement: le = "All rules cleared.", rulesLoadedAnnouncement: G = "Existing rules loaded for the selected folder.", editorLabels: K } = ee, q = n(), [ue, J] = a(!1), [de, Y] = a(""), X = i(null), Z = i(f);
377
396
  t(() => {
378
- Y.current && !f && e.length > 0 && J(W), Y.current = f;
397
+ Z.current && !f && e.length > 0 && Y(G), Z.current = f;
379
398
  }, [
380
399
  f,
381
400
  e,
382
- W
401
+ G
383
402
  ]);
384
- let me = () => {
385
- pe.current = document.activeElement, K(!0);
403
+ let fe = () => {
404
+ X.current = document.activeElement, J(!0);
405
+ }, Q = () => {
406
+ J(!1), X.current?.focus?.();
407
+ }, pe = (t) => {
408
+ r([...e, t]), Y(ce), Q();
409
+ }, me = (t) => {
410
+ r(e.filter((e, n) => n !== t)), Y(W);
386
411
  }, he = () => {
387
- K(!1), pe.current?.focus?.();
388
- }, ge = (t) => {
389
- r([...e, t]), J(le), he();
390
- }, _e = (t) => {
391
- r(e.filter((e, n) => n !== t)), J(U);
392
- }, ve = () => {
393
- r([]), J(ue);
394
- }, X = {
395
- equal: R,
396
- contain: z,
397
- regex: B
398
- }, Z = e.length >= g, ye = d || Z, be = u != null && u !== "";
399
- return /* @__PURE__ */ F("div", {
412
+ r([]), Y(le);
413
+ }, ge = {
414
+ equal: oe,
415
+ contain: se,
416
+ regex: V
417
+ }, _e = e.length >= m, ve = d || _e, ye = c != null && c !== "";
418
+ return /* @__PURE__ */ z("div", {
400
419
  role: "group",
401
- "aria-labelledby": fe,
402
- style: E,
403
- className: M(d && "pointer-events-none opacity-60"),
420
+ "aria-labelledby": q,
421
+ style: k,
422
+ className: F(d && "pointer-events-none opacity-60"),
404
423
  children: [
405
- /* @__PURE__ */ P(v, {
424
+ /* @__PURE__ */ R(y, {
406
425
  visuallyHidden: !0,
407
- as: te.Span,
408
- children: q
426
+ as: b.Span,
427
+ children: de
409
428
  }),
410
- /* @__PURE__ */ F("div", {
429
+ /* @__PURE__ */ z("div", {
411
430
  className: "mb-1 flex items-center justify-between gap-2",
412
- children: [/* @__PURE__ */ P("div", {
413
- id: fe,
414
- className: M(y, $.heading),
415
- children: O
416
- }), e.length > 0 && /* @__PURE__ */ P(m, {
417
- variant: o.Primary,
418
- label: ae,
419
- onClick: ve,
431
+ children: [/* @__PURE__ */ R("div", {
432
+ id: q,
433
+ className: F(v, $.heading),
434
+ children: A
435
+ }), e.length > 0 && /* @__PURE__ */ R(h, {
436
+ variant: s.Primary,
437
+ label: L,
438
+ onClick: he,
420
439
  disabled: d
421
440
  })]
422
441
  }),
423
- /* @__PURE__ */ P("p", {
424
- className: M("mb-2", b, $.hint),
425
- children: be ? k.replace("{folder}", u) : A
442
+ /* @__PURE__ */ R("p", {
443
+ className: F("mb-2", x, $.hint),
444
+ children: ye ? M.replace("{folder}", c) : N
426
445
  }),
427
- e.length > 0 && !be && /* @__PURE__ */ P("div", {
446
+ e.length > 0 && !ye && /* @__PURE__ */ R("div", {
428
447
  className: "mb-2",
429
- children: /* @__PURE__ */ P(x, {
430
- type: S.SectionMessage,
431
- variant: C.Warning,
432
- message: j
448
+ children: /* @__PURE__ */ R(C, {
449
+ type: w.SectionMessage,
450
+ variant: T.Warning,
451
+ message: P
433
452
  })
434
453
  }),
435
- f && /* @__PURE__ */ F("div", {
436
- className: M("mb-2 flex items-center gap-2", ne, $.loading),
437
- children: [/* @__PURE__ */ P(D, {
454
+ f && /* @__PURE__ */ z("div", {
455
+ className: F("mb-2 flex items-center gap-2", S, $.loading),
456
+ children: [/* @__PURE__ */ R(j, {
438
457
  size: 16,
439
- ariaLabel: V
440
- }), /* @__PURE__ */ P("span", { children: V })]
458
+ ariaLabel: H
459
+ }), /* @__PURE__ */ R("span", { children: H })]
441
460
  }),
442
- p && /* @__PURE__ */ P("div", {
461
+ p && /* @__PURE__ */ R("div", {
443
462
  className: "mb-2",
444
- children: /* @__PURE__ */ P(x, {
445
- type: S.SectionMessage,
446
- variant: C.Warning,
447
- message: H
463
+ children: /* @__PURE__ */ R(C, {
464
+ type: w.SectionMessage,
465
+ variant: T.Warning,
466
+ message: U
448
467
  })
449
468
  }),
450
- e.length > 0 && /* @__PURE__ */ P("ul", {
469
+ e.length > 0 && /* @__PURE__ */ R("ul", {
451
470
  className: "mb-3 flex flex-col gap-2",
452
471
  children: e.map((e, t) => {
453
- let n = e.targets.join(` ${se} `), r = ce.replace("{source}", e.source).replace("{targets}", n);
454
- return /* @__PURE__ */ F("li", {
455
- className: M("flex items-center justify-between gap-2 rounded-lg px-3 py-2", $.ruleRow),
456
- children: [/* @__PURE__ */ F("span", {
457
- className: M("truncate", re, $.ruleText),
472
+ let n = e.targets.join(` ${B} `), r = re.replace("{source}", e.source).replace("{targets}", n);
473
+ return /* @__PURE__ */ z("li", {
474
+ className: F("flex items-center justify-between gap-2 rounded-lg px-3 py-2", $.ruleRow),
475
+ children: [/* @__PURE__ */ z("span", {
476
+ className: F("truncate", E, $.ruleText),
458
477
  children: [
459
- /* @__PURE__ */ P("span", {
460
- className: w,
478
+ /* @__PURE__ */ R("span", {
479
+ className: D,
461
480
  children: e.source
462
481
  }),
463
482
  " ",
464
- Se(e.function, X),
483
+ Ee(e.function, ge),
465
484
  ": ",
466
485
  n
467
486
  ]
468
- }), /* @__PURE__ */ P(h, {
469
- icon: /* @__PURE__ */ P(oe, {
470
- size: c.SM,
487
+ }), /* @__PURE__ */ R(g, {
488
+ icon: /* @__PURE__ */ R(ae, {
489
+ size: l.SM,
471
490
  "aria-hidden": !0,
472
- stroke: l
491
+ stroke: u
473
492
  }),
474
493
  "aria-label": r,
475
- onClick: () => _e(t),
494
+ onClick: () => me(t),
476
495
  disabled: d
477
496
  })]
478
497
  }, t);
479
498
  })
480
499
  }),
481
- G && /* @__PURE__ */ P(Q, {
482
- sourceOptions: s,
483
- onSave: ge,
484
- onCancel: he,
500
+ ue && /* @__PURE__ */ R(we, {
501
+ sourceOptions: o,
502
+ onSave: pe,
503
+ onCancel: Q,
485
504
  disabled: d,
486
505
  maxTargets: _,
487
- labels: de,
488
- styles: T.editor
506
+ labels: K,
507
+ styles: O.editor
489
508
  }),
490
- /* @__PURE__ */ P("div", {
509
+ /* @__PURE__ */ R("div", {
491
510
  className: "flex flex-wrap items-center gap-2",
492
- children: /* @__PURE__ */ P(m, {
511
+ children: /* @__PURE__ */ R(h, {
493
512
  label: I,
494
- iconBefore: /* @__PURE__ */ P(L, {
495
- size: c.SM,
513
+ iconBefore: /* @__PURE__ */ R(ie, {
514
+ size: l.SM,
496
515
  "aria-hidden": !0,
497
- stroke: l
516
+ stroke: u
498
517
  }),
499
- onClick: me,
500
- disabled: ye
518
+ onClick: fe,
519
+ disabled: ve
501
520
  })
502
521
  }),
503
- Z && /* @__PURE__ */ P("p", {
504
- className: M("mt-2", b, $.hint),
505
- children: N.replace("{max}", String(g))
522
+ _e && /* @__PURE__ */ R("p", {
523
+ className: F("mt-2", x, $.hint),
524
+ children: te.replace("{max}", String(m))
506
525
  })
507
526
  ]
508
527
  });
509
- }, we = {
528
+ }, Oe = {
510
529
  currentBadge: "_currentBadge_d0adf_1",
511
530
  sharedCredentialsBadge: "_sharedCredentialsBadge_d0adf_7",
512
531
  version: "_version_d0adf_13",
513
532
  date: "_date_d0adf_17",
514
533
  emptyState: "_emptyState_d0adf_21",
515
534
  stripedRow: "_stripedRow_d0adf_25"
516
- }, Te = ({ 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 }) => {
517
- let m = ie({
535
+ }, ke = ({ 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 }) => {
536
+ let m = ne({
518
537
  "--phl-badge-border": p?.currentBadgeBorder,
519
538
  "--phl-badge-bg": p?.currentBadgeBackground,
520
539
  "--phl-badge-text": p?.currentBadgeText,
@@ -525,420 +544,468 @@ var R = /* @__PURE__ */ function(e) {
525
544
  "--phl-date-text": p?.dateText,
526
545
  "--phl-empty-text": p?.emptyStateText,
527
546
  "--phl-striped-bg": p?.stripedBackground
528
- }), h = M(f, we.emptyState);
547
+ }), h = F(f, Oe.emptyState);
529
548
  if (n || r || e.length === 0) {
530
549
  let e = s;
531
- return n ? e = c : r && (e = l), /* @__PURE__ */ P(v, {
532
- as: te.P,
550
+ return n ? e = c : r && (e = l), /* @__PURE__ */ R(y, {
551
+ as: b.P,
533
552
  style: m,
534
553
  className: h,
535
554
  children: e
536
555
  });
537
556
  }
538
- return /* @__PURE__ */ P("ul", {
557
+ return /* @__PURE__ */ R("ul", {
539
558
  style: m,
540
- children: e.map((e, n) => /* @__PURE__ */ F("li", {
541
- className: M("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && we.stripedRow),
542
- children: [/* @__PURE__ */ F("span", {
559
+ children: e.map((e, n) => /* @__PURE__ */ z("li", {
560
+ className: F("flex items-center justify-between gap-2 rounded-lg px-3 py-[11px]", n % 2 == 0 && Oe.stripedRow),
561
+ children: [/* @__PURE__ */ z("span", {
543
562
  className: "flex min-w-0 items-center gap-2",
544
563
  style: m,
545
564
  children: [
546
- /* @__PURE__ */ F("span", {
547
- className: M(u, we.version),
565
+ /* @__PURE__ */ z("span", {
566
+ className: F(u, Oe.version),
548
567
  children: [
549
568
  i,
550
569
  " ",
551
570
  e.version
552
571
  ]
553
572
  }),
554
- e.version === t && /* @__PURE__ */ P(O, {
573
+ e.version === t && /* @__PURE__ */ R(M, {
555
574
  label: a,
556
- className: M("shrink-0 whitespace-nowrap", we.currentBadge)
575
+ className: F("shrink-0 whitespace-nowrap", Oe.currentBadge)
557
576
  }),
558
- e.publishCredentials === !0 && /* @__PURE__ */ P(O, {
577
+ e.publishCredentials === !0 && /* @__PURE__ */ R(M, {
559
578
  label: o,
560
- className: M("shrink-0 whitespace-nowrap", we.sharedCredentialsBadge)
579
+ className: F("shrink-0 whitespace-nowrap", Oe.sharedCredentialsBadge)
561
580
  })
562
581
  ]
563
- }), /* @__PURE__ */ P("span", {
564
- className: M(d, we.date),
565
- children: H(e.publishedAt)
582
+ }), /* @__PURE__ */ R("span", {
583
+ className: F(d, Oe.date),
584
+ children: W(e.publishedAt)
566
585
  })]
567
586
  }, `${e.version}-${n}`))
568
587
  });
569
- }, Ee = ":", De = (e) => `${Ee}${e}`, Oe = (e) => e?.startsWith(Ee) ? e.slice(1) : void 0, ke = (e) => [De(e.rootKey), ...e.path], Ae = (e) => {
570
- let [t, ...n] = e, r = Oe(t);
588
+ }, Ae = ":", je = (e) => `${Ae}${e}`, Me = (e) => e?.startsWith(Ae) ? e.slice(1) : void 0, Ne = (e) => [je(e.rootKey), ...e.path], Pe = (e) => {
589
+ let [t, ...n] = e, r = Me(t);
571
590
  return r == null ? void 0 : {
572
591
  rootKey: r,
573
592
  path: n
574
593
  };
575
- }, je = (e, t) => e.map((e) => ({
594
+ }, Fe = (e, t) => e.map((e) => ({
576
595
  ...e,
577
596
  path: [t, ...e.path],
578
- children: e.children ? je(e.children, t) : void 0
579
- })), Me = (e) => e.map((e) => {
580
- let t = De(e.key);
597
+ children: e.children ? Fe(e.children, t) : void 0
598
+ })), Ie = (e) => e.map((e) => {
599
+ let t = je(e.key);
581
600
  return {
582
601
  path: [t],
583
602
  name: e.label,
584
- children: je(fe(e.items), t)
603
+ children: Fe(Y(e.items), t)
585
604
  };
586
- }), Ne = (e) => e.map((e) => De(e.key)), Pe = (e, t) => {
605
+ }), Le = (e) => e.map((e) => je(e.key)), Re = (e, t) => {
587
606
  let n = /* @__PURE__ */ new Set();
588
607
  for (let r of e) {
589
- let e = De(r.key);
608
+ let e = je(r.key);
590
609
  for (let i of t(r) ?? []) n.add(i ? `${e}/${i}` : e);
591
610
  }
592
611
  return n;
593
- }, Fe = (e, t) => {
612
+ }, ze = (e, t) => {
594
613
  let n = new Map(e.map((e) => [e.key, /* @__PURE__ */ new Set()]));
595
614
  for (let e of t) {
596
- let [t, ...r] = e.split("/"), i = Oe(t);
597
- i != null && r.length !== 0 && n.get(i)?.add(J(r));
615
+ let [t, ...r] = e.split("/"), i = Me(t);
616
+ i != null && r.length !== 0 && n.get(i)?.add(Q(r));
598
617
  }
599
618
  return n;
600
- }, Ie = {
619
+ }, Be = {
601
620
  divider: "_divider_1gs31_1",
602
621
  tree: "_tree_1gs31_17"
603
- }, Le = "data-cancel-creating-folder", Re = "", ze = [], Be = ({ items: e = ze, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: u, destination: d, onDestinationChange: f, onCreateDestinationFolder: p, searchQuery: h, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: ee = "Cancel", addSiblingFolderLabel: v = "Add sibling", addChildFolderLabel: te = "Add child", newFolderDefaultName: y = "New folder", noResultsLabel: b = "No folders match \"{query}\".", emptyFolderNameError: x = "Folder name cannot be empty.", invalidFolderNameError: S = "Folder name contains invalid characters.", duplicateFolderNameError: C = "A folder with this name already exists.", rootLabel: ne = "Organization", expandedPaths: re, onExpandedPathsChange: w, loadingPaths: T, styles: E = {} }) => {
604
- let D = {
605
- ...ie({ "--pft-divider": E.colors?.divider }),
606
- ...E.cssVars
607
- }, O = u != null, k = r(() => u ? Me(u) : e, [u, e]), A = r(() => u ? Ne(u) : [Re], [u]), j = n;
608
- O && (j = d ? ke(d) : void 0);
609
- let N = (e) => {
610
- O ? f?.(e ? Ae(e) : void 0) : o?.(e);
611
- }, [I, oe] = a(() => new Set(j?.map((e, t) => J(j.slice(0, t + 1))) ?? [])), R = r(() => u ? /* @__PURE__ */ new Set([...I, ...Pe(u, (e) => e.expandedPaths)]) : void 0, [u, I]) ?? re ?? I, z = r(() => u ? Pe(u, (e) => e.loadingPaths) : T, [u, T]), B = (e) => {
622
+ }, Ve = "data-cancel-creating-folder", He = "", Ue = [], We = ({ items: e = Ue, selectedPath: n, onSelectedPathChange: o, onCreateFolder: s, roots: c, destination: d, onDestinationChange: f, onCreateDestinationFolder: p, searchQuery: m, disabled: g = !1, createFolderLabel: _ = "Create new folder", cancelCreatingFolderLabel: ee = "Cancel", addSiblingFolderLabel: v = "Add sibling", addChildFolderLabel: y = "Add child", newFolderDefaultName: b = "New folder", noResultsLabel: x = "No folders match \"{query}\".", emptyFolderNameError: S = "Folder name cannot be empty.", invalidFolderNameError: C = "Folder name contains invalid characters.", duplicateFolderNameError: w = "A folder with this name already exists.", rootLabel: T = "Organization", expandedPaths: E, onExpandedPathsChange: D, loadingPaths: O, styles: k = {} }) => {
623
+ let A = {
624
+ ...ne({ "--pft-divider": k.colors?.divider }),
625
+ ...k.cssVars
626
+ }, j = c != null, M = r(() => c ? Ie(c) : e, [c, e]), N = r(() => c ? Le(c) : [He], [c]), P = n;
627
+ j && (P = d ? Ne(d) : void 0);
628
+ let te = (e) => {
629
+ j ? f?.(e ? Pe(e) : void 0) : o?.(e);
630
+ }, [I, L] = a(() => new Set(P?.map((e, t) => Q(P.slice(0, t + 1))) ?? [])), B = r(() => c ? /* @__PURE__ */ new Set([...I, ...Re(c, (e) => e.expandedPaths)]) : void 0, [c, I]) ?? E ?? I, ae = r(() => c ? Re(c, (e) => e.loadingPaths) : O, [c, O]), V = (e) => {
612
631
  let t = new Set(e);
613
- for (let e of A) t.delete(e);
614
- if (u) {
615
- oe(t);
616
- let e = Fe(u, t);
617
- for (let t of u) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
618
- } else w ? w(t) : oe(t);
619
- }, [V, H] = a(null), [le, U] = a(y), ue = i(null), de = i(!1);
632
+ for (let e of N) t.delete(e);
633
+ if (c) {
634
+ L(t);
635
+ let e = ze(c, t);
636
+ for (let t of c) t.onExpandedPathsChange?.(e.get(t.key) ?? /* @__PURE__ */ new Set());
637
+ } else D ? D(t) : L(t);
638
+ }, [H, U] = a(null), [ce, W] = a(b), le = i(null), G = i(!1);
620
639
  t(() => {
621
640
  let e = (e) => {
622
- e.target instanceof Element && e.target.closest(`[${Le}]`) && (de.current = !0);
641
+ e.target instanceof Element && e.target.closest(`[${Ve}]`) && (G.current = !0);
623
642
  };
624
643
  return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
625
644
  }, []);
626
- let G = h.trim(), K = V != null, me = r(() => W(k, h), [k, h]), ve = G.length > 0 && me.length === 0, X = !K && G.length > 0, Z = r(() => {
627
- let e = X ? me : k;
628
- return O ? e : fe(e);
645
+ let K = m.trim(), q = H != null, ue = r(() => J(M, m), [M, m]), de = K.length > 0 && ue.length === 0, X = !q && K.length > 0, Z = r(() => {
646
+ let e = X ? ue : M;
647
+ return j ? e : Y(e);
629
648
  }, [
630
649
  X,
631
- me,
632
- k,
633
- O
634
- ]), ye = r(() => /* @__PURE__ */ new Set([...A, ...q(Z)]), [A, Z]), be = r(() => /* @__PURE__ */ new Set([...A, ...X ? ye : R]), [
635
- A,
650
+ ue,
651
+ M,
652
+ j
653
+ ]), he = r(() => /* @__PURE__ */ new Set([...N, ...fe(Z)]), [N, Z]), ye = r(() => /* @__PURE__ */ new Set([...N, ...X ? he : B]), [
654
+ N,
636
655
  X,
637
- ye,
638
- R
639
- ]), Q = r(() => Y(Z), [Z]), $ = r(() => X && Q.length === 0 ? [] : O ? Q : [{
640
- path: Re,
641
- name: ne,
642
- folderId: Re,
643
- nodeType: se.FOLDER,
644
- items: Q
656
+ he,
657
+ B
658
+ ]), be = r(() => me(Z), [Z]), xe = r(() => X && be.length === 0 ? [] : j ? be : [{
659
+ path: He,
660
+ name: T,
661
+ folderId: He,
662
+ nodeType: oe.FOLDER,
663
+ items: be
645
664
  }], [
646
- Q,
647
- ne,
665
+ be,
666
+ T,
648
667
  X,
649
- O
650
- ]), xe = V ? J(V) : null, Se = {
651
- empty: x,
652
- invalid: S,
653
- duplicate: C
654
- }, Ce = (e) => {
655
- if (!u) return !0;
656
- let t = Ae(e), n = u.find((e) => e.key === t?.rootKey);
668
+ j
669
+ ]), Se = H ? Q(H) : null, Ce = {
670
+ empty: S,
671
+ invalid: C,
672
+ duplicate: w
673
+ }, we = (e) => {
674
+ if (!c) return !0;
675
+ let t = Pe(e), n = c.find((e) => e.key === t?.rootKey);
657
676
  return n != null && n.canCreateFolders !== !1;
658
- }, we = (() => {
659
- if (!u) return j ?? [];
660
- if (j && Ce(j)) return j;
661
- let e = u.find((e) => e.canCreateFolders !== !1);
662
- return e ? ke({
677
+ }, $ = (() => {
678
+ if (!c) return P ?? [];
679
+ if (P && we(P)) return P;
680
+ let e = c.find((e) => e.canCreateFolders !== !1);
681
+ return e ? Ne({
663
682
  rootKey: e.key,
664
683
  path: []
665
684
  }) : void 0;
666
- })(), Te = (e) => ge(ve && he(G, [], Se) == null ? G : y, _e(k, e)), Ee = (e) => {
667
- H(e), U(Te(e)), ue.current = null, de.current = !1;
668
- let t = J(e);
669
- t && B(new Set(R).add(t));
685
+ })(), Te = (e) => _e(de && ge(K, [], Ce) == null ? K : b, ve(M, e)), Ee = (e) => {
686
+ U(e), W(Te(e)), le.current = null, G.current = !1;
687
+ let t = Q(e);
688
+ t && V(new Set(B).add(t));
670
689
  }, De = () => {
671
- we && Ee(we);
690
+ $ && Ee($);
672
691
  }, Oe = (e) => {
673
692
  let t = pe(e.path);
674
- if (!Ce(t)) return [];
693
+ if (!we(t)) return [];
675
694
  let n = [{
676
695
  key: "add-child",
677
- label: te,
678
- icon: /* @__PURE__ */ P(ae, {
679
- size: c.SM,
696
+ label: y,
697
+ icon: /* @__PURE__ */ R(re, {
698
+ size: l.SM,
680
699
  "aria-hidden": !0,
681
- stroke: l
700
+ stroke: u
682
701
  }),
683
702
  onClick: () => Ee(t)
684
703
  }];
685
- return A.includes(e.path) || n.push({
704
+ return N.includes(e.path) || n.push({
686
705
  key: "add-sibling",
687
706
  label: v,
688
- icon: /* @__PURE__ */ P(L, {
689
- size: c.SM,
707
+ icon: /* @__PURE__ */ R(ie, {
708
+ size: l.SM,
690
709
  "aria-hidden": !0,
691
- stroke: l
710
+ stroke: u
692
711
  }),
693
712
  onClick: () => Ee(t.slice(0, -1))
694
713
  }), n;
695
- }, je = (e) => {
696
- if (!V) return null;
697
- let t = he(e, _e(k, V), Se);
698
- return ue.current = t, t;
699
- }, Be = (e) => {
700
- if (!V || de.current) return;
701
- let t = e.trim(), n = ue.current;
702
- if (!(je(e) ?? n)) {
703
- let e = u ? Ae(V) : void 0;
704
- e ? p?.(e.rootKey, e.path, t) : s?.(V, t), N([...V, t]);
714
+ }, ke = (e) => {
715
+ if (!H) return null;
716
+ let t = ge(e, ve(M, H), Ce);
717
+ return le.current = t, t;
718
+ }, Ae = (e) => {
719
+ if (!H || G.current) return;
720
+ let t = e.trim(), n = le.current;
721
+ if (!(ke(e) ?? n)) {
722
+ let e = c ? Pe(H) : void 0;
723
+ e ? p?.(e.rootKey, e.path, t) : s?.(H, t), te([...H, t]);
705
724
  }
706
- H(null);
707
- }, Ve = () => H(null);
708
- return /* @__PURE__ */ F("div", {
709
- style: D,
710
- className: M(g && "pointer-events-none opacity-60", E.className),
725
+ U(null);
726
+ }, je = () => U(null);
727
+ return /* @__PURE__ */ z("div", {
728
+ style: A,
729
+ className: F(g && "pointer-events-none opacity-60", k.className),
711
730
  children: [
712
- /* @__PURE__ */ P("div", {
713
- className: M("w-full max-w-full min-w-0", Ie.tree),
714
- children: /* @__PURE__ */ P(ce, {
715
- items: $,
731
+ /* @__PURE__ */ R("div", {
732
+ className: F("w-full max-w-full min-w-0", Be.tree),
733
+ children: /* @__PURE__ */ R(se, {
734
+ items: xe,
716
735
  showFiles: !1,
717
- selectedPath: j == null ? void 0 : J(j),
718
- expandedPaths: be,
719
- onExpandedPathsChange: B,
720
- loadingPaths: z,
736
+ selectedPath: P == null ? void 0 : Q(P),
737
+ expandedPaths: ye,
738
+ onExpandedPathsChange: V,
739
+ loadingPaths: ae,
721
740
  onItemClick: (e) => {
722
- let t = j != null && J(j) === e.path;
723
- N(t ? void 0 : pe(e.path));
741
+ let t = P != null && Q(P) === e.path;
742
+ te(t ? void 0 : pe(e.path));
724
743
  },
725
744
  getContextMenuItems: Oe,
726
- createdFolderPath: xe,
727
- newFolderDefaultName: le,
728
- onCreateFolderSave: Be,
729
- onCreateFolderCancel: Ve,
730
- onRenameValidate: (e) => je(e),
731
- emptyStateTitle: X ? b.replace("{query}", G) : void 0
745
+ createdFolderPath: Se,
746
+ newFolderDefaultName: ce,
747
+ onCreateFolderSave: Ae,
748
+ onCreateFolderCancel: je,
749
+ onRenameValidate: (e) => ke(e),
750
+ emptyStateTitle: X ? x.replace("{query}", K) : void 0
732
751
  })
733
752
  }),
734
- /* @__PURE__ */ P("div", {
735
- className: M("my-2 h-px", Ie.divider),
753
+ /* @__PURE__ */ R("div", {
754
+ className: F("my-2 h-px", Be.divider),
736
755
  "aria-hidden": !0
737
756
  }),
738
- /* @__PURE__ */ F("div", {
757
+ /* @__PURE__ */ z("div", {
739
758
  className: "mb-4 flex flex-wrap items-center gap-2",
740
- children: [/* @__PURE__ */ P(m, {
759
+ children: [/* @__PURE__ */ R(h, {
741
760
  onClick: De,
742
761
  label: _,
743
- iconBefore: /* @__PURE__ */ P(L, {
744
- size: c.SM,
762
+ iconBefore: /* @__PURE__ */ R(ie, {
763
+ size: l.SM,
745
764
  "aria-hidden": !0,
746
- stroke: l
765
+ stroke: u
747
766
  }),
748
- disabled: g || K || !we
749
- }), K && /* @__PURE__ */ P(m, {
767
+ disabled: g || q || !$
768
+ }), q && /* @__PURE__ */ R(h, {
750
769
  label: ee,
751
- onClick: Ve,
770
+ onClick: je,
752
771
  disabled: g,
753
- [Le]: ""
772
+ [Ve]: ""
754
773
  })]
755
774
  })
756
775
  ]
757
776
  });
758
- }, Ve = { panel: "dial-publish-panel-panel" }, He = {
759
- summaryTitle: "_summaryTitle_tf20a_1",
760
- sectionHeading: "_sectionHeading_tf20a_5"
761
- }, Ue = 200, We = ({ resource: e, renderSummary: t, folderItems: i, selectedFolderPath: o, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: ee = !0, author: v, onAuthorChange: te, publishCredentials: y = !1, onPublishCredentialsChange: b, rules: C, onRulesChange: ne, ruleSourceOptions: re, isRulesLoading: T = !1, hasRulesLoadError: E = !1, labels: D = {}, summaryTitleClassName: O = "dial-body-semi-text", headingClassName: k = "dial-body-semi-text", calloutFolderNameClassName: j = "dial-small-paragraph-semi-text", styles: N = {} }) => {
762
- let { colors: I, folderTree: ae, accessRules: L } = N, oe = {
763
- ...ie({
764
- "--pp-summary-title-text": I?.summaryTitleText,
765
- "--pp-heading-text": I?.headingText
777
+ }, Ge = { panel: "dial-publish-panel-panel" }, Ke = {
778
+ summaryTitle: "_summaryTitle_zj3gd_1",
779
+ sectionHeading: "_sectionHeading_zj3gd_5",
780
+ destination: "_destination_zj3gd_9"
781
+ }, qe = 200, Je = ({ view: e = q.Main, onChangeFolderClick: o, resource: s, renderSummary: d, folderItems: p, selectedFolderPath: g, pendingFolderPath: _, onPendingFolderPathChange: v, onCreateFolder: y, expandedPaths: b, onExpandedPathsChange: x, loadingPaths: S, hasExistingPublicationInFolder: T, hasWriteAccess: E, isSubmitting: D, hasSubmitError: k = !1, allowReplace: A = !0, author: j, onAuthorChange: M, publishCredentials: N = !1, onPublishCredentialsChange: te, rules: I, onRulesChange: L, ruleSourceOptions: re, isRulesLoading: ie = !1, hasRulesLoadError: ae = !1, labels: oe = {}, summaryTitleClassName: se = "dial-body-semi-text", headingClassName: V = "dial-body-semi-text", destinationClassName: ce = "dial-small-semi-text", calloutFolderNameClassName: W = "dial-small-paragraph-semi-text", styles: le = {} }) => {
782
+ let { colors: G, folderTree: K, accessRules: ue } = le, J = {
783
+ ...ne({
784
+ "--pp-summary-title-text": G?.summaryTitleText,
785
+ "--pp-heading-text": G?.headingText,
786
+ "--pp-destination-text": G?.destinationText
766
787
  }),
767
- ...N.cssVars
768
- }, se = {
769
- border: I?.summaryBorder,
770
- background: I?.summaryBackground,
771
- versionTagBorder: I?.summaryVersionTagBorder,
772
- versionTagBackground: I?.summaryVersionTagBackground,
773
- versionTagText: I?.summaryVersionTagText
774
- }, { folderLabel: ce = "Publish to folder", replaceWarning: R = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: V = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: H = "Publishing failed. Please try again.", folderEmptyStateLabel: le, addSiblingFolderLabel: U, addChildFolderLabel: ue, cancelCreatingFolderLabel: W, createFolderEmptyNameError: de, createFolderInvalidNameError: fe, createFolderDuplicateNameError: G, rootFolderLabel: K = "Organization", summaryVersionLabel: q, accessRulesLabels: J, searchPlaceholder: pe, clearSearchAriaLabel: Y, authorLabel: me = "Author", authorPlaceholder: he = "Author name", authorHint: ge = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: _e = "Publish with my credentials", credentialsHint: ve = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = D, [X, Z] = a(""), ye = n(), be = (e) => {
775
- Z(e ?? "");
776
- }, Q = o != null, $ = r(() => B({
777
- hasSelectedFolder: Q,
778
- hasExistingPublicationInFolder: p,
779
- hasWriteAccess: m,
780
- isSubmitting: h,
781
- hasSubmitError: g,
782
- allowReplace: ee
788
+ ...le.cssVars
789
+ }, de = {
790
+ border: G?.summaryBorder,
791
+ background: G?.summaryBackground
792
+ }, { folderLabel: Y = "Publish to folder", destinationAriaLabel: X = "Destination folder", noFolderSelectedLabel: Z = "No folder selected", changeFolderLabel: fe = "Change", chooseFolderLabel: Q = "Choose", replaceWarning: pe = "Version {version} is already published in {folder}. Publishing will replace it.", noAccessError: me = "You don't have permission to publish to {folder}. Pick another, or ask an owner for access.", submitError: he = "Publishing failed. Please try again.", folderEmptyStateLabel: ge, addSiblingFolderLabel: _e, addChildFolderLabel: ve, cancelCreatingFolderLabel: ye, createFolderEmptyNameError: be, createFolderInvalidNameError: xe, createFolderDuplicateNameError: Se, rootFolderLabel: Ce = "Organization", accessRulesLabels: we, searchPlaceholder: $, clearSearchAriaLabel: Te, authorLabel: Ee = "Author", authorPlaceholder: Oe = "Author name", authorHint: ke = "Shown as the publication’s author. Defaults to you — replace it to credit a team instead.", credentialsLabel: Ae = "Publish with my credentials", credentialsHint: je = "Members will use this without signing in themselves. Your credential itself is never shown to them." } = oe, [Me, Ne] = a(""), Pe = n(), Fe = i(null), Ie = i(null), Le = (e) => {
793
+ Ne(e ?? "");
794
+ }, Re = i(e);
795
+ t(() => {
796
+ Re.current !== e && (Re.current = e, e === q.ChangeFolder ? Ie.current?.focus({ preventScroll: !0 }) : Fe.current?.focus({ preventScroll: !0 }));
797
+ }, [e]);
798
+ let ze = g != null, Be = r(() => U({
799
+ hasSelectedFolder: ze,
800
+ hasExistingPublicationInFolder: T,
801
+ hasWriteAccess: E,
802
+ isSubmitting: D,
803
+ hasSubmitError: k,
804
+ allowReplace: A
783
805
  }), [
784
- Q,
785
- p,
786
- m,
787
- h,
788
- g,
789
- ee
790
- ]), xe = Q ? o[o.length - 1] ?? K : "", Se = t ? t() : /* @__PURE__ */ P("span", {
791
- className: M("truncate", O, He.summaryTitle),
792
- children: e?.title
806
+ ze,
807
+ T,
808
+ E,
809
+ D,
810
+ k,
811
+ A
812
+ ]), Ve = ze ? g[g.length - 1] ?? Ce : "", He = d ? d() : /* @__PURE__ */ R("span", {
813
+ className: F("truncate", se, Ke.summaryTitle),
814
+ children: s?.title
815
+ });
816
+ if (e === q.ChangeFolder) return /* @__PURE__ */ z("div", {
817
+ ref: Ie,
818
+ tabIndex: -1,
819
+ role: "group",
820
+ "aria-label": Y,
821
+ className: F("flex flex-col gap-3 outline-none", Ge.panel),
822
+ style: J,
823
+ children: [/* @__PURE__ */ R("div", {
824
+ role: "search",
825
+ children: /* @__PURE__ */ R(O, {
826
+ value: Me,
827
+ onChange: Le,
828
+ placeholder: $,
829
+ clearLabel: Te,
830
+ "aria-label": $
831
+ })
832
+ }), /* @__PURE__ */ R(We, {
833
+ items: p,
834
+ selectedPath: _,
835
+ onSelectedPathChange: v,
836
+ onCreateFolder: y,
837
+ expandedPaths: b,
838
+ onExpandedPathsChange: x,
839
+ loadingPaths: S,
840
+ searchQuery: Me,
841
+ disabled: D,
842
+ noResultsLabel: ge,
843
+ addSiblingFolderLabel: _e,
844
+ addChildFolderLabel: ve,
845
+ cancelCreatingFolderLabel: ye,
846
+ emptyFolderNameError: be,
847
+ invalidFolderNameError: xe,
848
+ duplicateFolderNameError: Se,
849
+ rootLabel: Ce,
850
+ styles: K
851
+ })]
793
852
  });
794
- return /* @__PURE__ */ F("div", {
795
- className: M("flex flex-col gap-5", Ve.panel),
796
- style: oe,
797
- children: [e?.type == null ? /* @__PURE__ */ P(A, {
798
- colors: se,
799
- children: Se
800
- }) : /* @__PURE__ */ P(A, {
853
+ let Ue = F(ce, Ke.destination);
854
+ return /* @__PURE__ */ z("div", {
855
+ className: F("flex flex-col gap-5", Ge.panel),
856
+ style: J,
857
+ children: [s?.type == null ? /* @__PURE__ */ R(P, {
858
+ colors: de,
859
+ children: He
860
+ }) : /* @__PURE__ */ R(P, {
801
861
  item: {
802
- type: e.type,
803
- name: e.title,
804
- version: e.version ?? "",
805
- iconUrl: e.iconUrl
862
+ type: s.type,
863
+ name: s.title,
864
+ version: s.version ?? "",
865
+ iconUrl: s.iconUrl
806
866
  },
807
- versionLabel: q,
808
- colors: se
809
- }), /* @__PURE__ */ F("div", { children: [
810
- /* @__PURE__ */ P("div", {
811
- className: M("mb-2", k, He.sectionHeading),
812
- children: ce
867
+ hasVersionTag: !1,
868
+ colors: de
869
+ }), /* @__PURE__ */ z("section", { children: [
870
+ /* @__PURE__ */ R("h2", {
871
+ className: F("mb-2", V, Ke.sectionHeading),
872
+ children: Y
813
873
  }),
814
- /* @__PURE__ */ P("div", {
815
- role: "search",
816
- className: "mb-3",
817
- children: /* @__PURE__ */ P(w, {
818
- value: X,
819
- onChange: be,
820
- placeholder: pe,
821
- clearLabel: Y,
822
- "aria-label": pe
823
- })
824
- }),
825
- /* @__PURE__ */ P(Be, {
826
- items: i,
827
- selectedPath: o,
828
- onSelectedPathChange: c,
829
- onCreateFolder: l,
830
- expandedPaths: u,
831
- onExpandedPathsChange: d,
832
- loadingPaths: f,
833
- searchQuery: X,
834
- disabled: h,
835
- noResultsLabel: le,
836
- addSiblingFolderLabel: U,
837
- addChildFolderLabel: ue,
838
- cancelCreatingFolderLabel: W,
839
- emptyFolderNameError: de,
840
- invalidFolderNameError: fe,
841
- duplicateFolderNameError: G,
842
- rootLabel: K,
843
- styles: ae
874
+ /* @__PURE__ */ z("div", {
875
+ className: "flex min-w-0 items-center gap-2",
876
+ children: [/* @__PURE__ */ R("div", {
877
+ role: "group",
878
+ "aria-label": X,
879
+ className: "min-w-0 flex-1",
880
+ children: ze ? /* @__PURE__ */ R(m, {
881
+ name: [Ce, ...g].join(" / "),
882
+ nameClassName: Ue
883
+ }) : /* @__PURE__ */ R("span", {
884
+ className: F("block truncate", Ue),
885
+ children: Z
886
+ })
887
+ }), /* @__PURE__ */ R(h, {
888
+ ref: Fe,
889
+ size: f.Small,
890
+ label: ze ? fe : Q,
891
+ iconBefore: /* @__PURE__ */ R(B, {
892
+ size: l.SM,
893
+ stroke: u,
894
+ "aria-hidden": !0
895
+ }),
896
+ disabled: D,
897
+ onClick: o
898
+ })]
844
899
  }),
845
- $.calloutKind !== z.None && $.calloutKind !== z.Info && /* @__PURE__ */ P("div", {
900
+ Be.calloutKind !== H.None && Be.calloutKind !== H.Info && /* @__PURE__ */ R("div", {
846
901
  className: "mt-3",
847
- children: /* @__PURE__ */ P(x, {
848
- type: S.SectionMessage,
849
- variant: Ge($.calloutKind),
850
- message: qe($.calloutKind, {
851
- replaceWarning: R,
852
- noAccessError: V,
853
- submitError: H,
854
- folderName: xe,
855
- version: e?.version,
856
- folderNameClassName: j
902
+ children: /* @__PURE__ */ R(C, {
903
+ type: w.SectionMessage,
904
+ variant: Ye(Be.calloutKind),
905
+ message: Ze(Be.calloutKind, {
906
+ replaceWarning: pe,
907
+ noAccessError: me,
908
+ submitError: he,
909
+ folderName: Ve,
910
+ version: s?.version,
911
+ folderNameClassName: W
857
912
  })
858
913
  })
859
914
  }),
860
- /* @__PURE__ */ P("div", {
915
+ /* @__PURE__ */ R("div", {
861
916
  className: "mt-4",
862
- children: /* @__PURE__ */ P(_, {
863
- id: ye,
864
- labelProps: { label: me },
865
- placeholder: he,
866
- caption: ge,
867
- value: v,
868
- onChange: (e) => te(e ?? ""),
869
- maxLength: Ue,
870
- disabled: h
917
+ children: /* @__PURE__ */ R(ee, {
918
+ id: Pe,
919
+ labelProps: { label: Ee },
920
+ placeholder: Oe,
921
+ caption: ke,
922
+ value: j,
923
+ onChange: (e) => M(e ?? ""),
924
+ maxLength: qe,
925
+ disabled: D
871
926
  })
872
927
  }),
873
- b != null && /* @__PURE__ */ P("div", {
928
+ te != null && /* @__PURE__ */ R("div", {
874
929
  className: "mt-4",
875
- children: /* @__PURE__ */ P(s, {
876
- labelProps: { label: _e },
877
- caption: ve,
878
- isSelected: y,
879
- onChange: b,
880
- disabled: h
930
+ children: /* @__PURE__ */ R(c, {
931
+ labelProps: { label: Ae },
932
+ caption: je,
933
+ isSelected: N,
934
+ onChange: te,
935
+ disabled: D
881
936
  })
882
937
  }),
883
- /* @__PURE__ */ P("div", {
938
+ /* @__PURE__ */ R("div", {
884
939
  className: "mt-4",
885
- children: /* @__PURE__ */ P(Ce, {
886
- rules: C,
887
- onRulesChange: ne,
940
+ children: /* @__PURE__ */ R(De, {
941
+ rules: I,
942
+ onRulesChange: L,
888
943
  sourceOptions: re,
889
- folderName: Q ? xe : void 0,
890
- disabled: h,
891
- isLoading: T,
892
- hasLoadError: E,
893
- labels: J,
894
- styles: L
944
+ folderName: ze ? Ve : void 0,
945
+ disabled: D,
946
+ isLoading: ie,
947
+ hasLoadError: ae,
948
+ labels: we,
949
+ styles: ue
895
950
  })
896
951
  })
897
952
  ] })]
898
953
  });
899
- }, Ge = (e) => e === z.ReplaceWarning ? C.Warning : C.Error, Ke = (e, t, n) => {
954
+ }, Ye = (e) => e === H.ReplaceWarning ? T.Warning : T.Error, Xe = (e, t, n) => {
900
955
  let [r, i, ...a] = e.split("{folder}");
901
- return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ F(N, { children: [
956
+ return i === void 0 || a.length > 0 ? e : /* @__PURE__ */ z(L, { children: [
902
957
  r,
903
- /* @__PURE__ */ P("strong", {
958
+ /* @__PURE__ */ R("strong", {
904
959
  className: n,
905
960
  children: t
906
961
  }),
907
962
  i
908
963
  ] });
909
- }, qe = (e, t) => e === z.ReplaceWarning ? Ke(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === z.NoAccess ? Ke(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Je = { footer: "_footer_dks1v_1" }, Ye = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, labels: s = {}, colors: l }) => {
910
- let u = ie({ "--pf-border": l?.border }), { cancelLabel: d = "Cancel", publishDefaultLabel: f = "Publish", updateLabel: p = "Update version {version}", publishingInProgressLabel: h = "Publishing…" } = s, g = i ? h : n && t && e != null ? p.replace("{version}", e) : f;
911
- return /* @__PURE__ */ F("div", {
912
- style: u,
913
- className: M("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Je.footer),
914
- children: [/* @__PURE__ */ P(m, {
915
- label: d,
964
+ }, Ze = (e, t) => e === H.ReplaceWarning ? Xe(t.replaceWarning.replace("{version}", t.version ?? ""), t.folderName, t.folderNameClassName) : e === H.NoAccess ? Xe(t.noAccessError, t.folderName, t.folderNameClassName) : t.submitError, Qe = { footer: "_footer_dks1v_1" }, $e = ({ version: e, hasExistingPublicationInFolder: t, allowReplace: n = !0, isSubmitDisabled: r, isSubmitLoading: i, onCancel: a, onSubmit: o, view: s = q.Main, onSelectFolder: c, isSelectFolderDisabled: u = !1, labels: d = {}, colors: f }) => {
965
+ let p = ne({ "--pf-border": f?.border }), { cancelLabel: m = "Cancel", publishDefaultLabel: g = "Publish", updateLabel: _ = "Update version {version}", publishingInProgressLabel: ee = "Publishing…", selectFolderLabel: v = "Select" } = d, y = s === q.ChangeFolder, b = i ? ee : n && t && e != null ? _.replace("{version}", e) : g;
966
+ return /* @__PURE__ */ z("div", {
967
+ style: p,
968
+ className: F("flex items-center justify-end gap-2 border-t px-4 py-4 rtl:flex-row-reverse rtl:justify-start desktop:px-3.5", Qe.footer),
969
+ children: [/* @__PURE__ */ R(h, {
970
+ label: m,
916
971
  className: "mobile:flex-1",
917
972
  disabled: i,
918
973
  onClick: a
919
- }), /* @__PURE__ */ P(b, {
920
- label: g,
974
+ }), y ? /* @__PURE__ */ R(S, {
975
+ label: v,
976
+ className: "mobile:flex-1",
977
+ disabled: u,
978
+ onClick: c
979
+ }) : /* @__PURE__ */ R(S, {
980
+ label: b,
921
981
  className: "mobile:flex-1",
922
982
  disabled: r,
923
- iconBefore: i ? /* @__PURE__ */ P(D, { size: c.SM }) : void 0,
983
+ iconBefore: i ? /* @__PURE__ */ R("span", {
984
+ "aria-hidden": !0,
985
+ children: /* @__PURE__ */ R(j, { size: l.SM })
986
+ }) : void 0,
924
987
  onClick: o
925
988
  })]
926
989
  });
927
- }, Xe = {
990
+ }, et = {
928
991
  backdrop: "_backdrop_16jmd_6",
929
992
  panel: "_panel_16jmd_10",
930
993
  divider: "_divider_16jmd_15",
931
994
  content: "_content_16jmd_19",
932
995
  title: "_title_16jmd_24"
933
- }, Ze = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: te, onRulesChange: y, ruleSourceOptions: b, isRulesLoading: x = !1, hasRulesLoadError: S = !1, onClose: C, returnFocusRef: ne, onSubmit: re, panelLabels: w, panelStyles: T, panelSummaryTitleClassName: D, panelHeadingClassName: O, panelCalloutFolderNameClassName: k, footerLabels: A, labels: j = {}, titleClassName: N = "dial-body-semi-text", colors: I }) => {
934
- let ae = ie({
996
+ }, tt = ({ isOpen: e, resource: n, renderSummary: i, folderItems: o, selectedFolderPath: s, onSelectedFolderPathChange: c, onCreateFolder: l, expandedPaths: u, onExpandedPathsChange: d, loadingPaths: f, hasExistingPublicationInFolder: p, hasWriteAccess: m, isSubmitting: h, hasSubmitError: g = !1, allowReplace: _ = !0, author: ee, onAuthorChange: v, rules: y, onRulesChange: b, ruleSourceOptions: x, isRulesLoading: S = !1, hasRulesLoadError: C = !1, onClose: w, returnFocusRef: T, onSubmit: E, panelLabels: D, panelStyles: O, panelSummaryTitleClassName: k, panelHeadingClassName: j, panelCalloutFolderNameClassName: M, footerLabels: N, labels: P = {}, titleClassName: te = "dial-body-semi-text", colors: I }) => {
997
+ let L = ne({
935
998
  "--spp-backdrop-bg": I?.backdropBackground,
936
999
  "--spp-panel-bg": I?.panelBackground,
937
1000
  "--spp-panel-border": I?.panelBorder,
938
1001
  "--spp-divider-border": I?.dividerBorder,
939
1002
  "--spp-scrollbar-thumb": I?.scrollbarThumb,
940
1003
  "--spp-title-text": I?.titleText
941
- }), [L, oe] = a(null), { title: se = "Publish", ariaLabel: ce = "Publish", closeAriaLabel: R = "Close" } = j, z = r(() => B({
1004
+ }), [B, re] = a(null), { title: ie = "Publish", changeFolderTitle: ae = "Change folder", backAriaLabel: oe = "Back", ariaLabel: se = "Publish", closeAriaLabel: V = "Close" } = P, H = ue({
1005
+ isOpen: e,
1006
+ selectedFolderPath: s,
1007
+ onSelectedFolderPathChange: c
1008
+ }), ce = H.view === q.ChangeFolder, W = r(() => U({
942
1009
  hasSelectedFolder: s != null,
943
1010
  hasExistingPublicationInFolder: p,
944
1011
  hasWriteAccess: m,
@@ -954,7 +1021,7 @@ var R = /* @__PURE__ */ function(e) {
954
1021
  _
955
1022
  ]);
956
1023
  return t(() => {
957
- let t = L?.closest("[role=\"dialog\"]");
1024
+ let t = B?.closest("[role=\"dialog\"]");
958
1025
  if (!e || !t) return;
959
1026
  let n = () => t.focus({ preventScroll: !0 });
960
1027
  n();
@@ -964,41 +1031,47 @@ var R = /* @__PURE__ */ function(e) {
964
1031
  document.addEventListener("focusin", r);
965
1032
  let i = requestAnimationFrame(() => {
966
1033
  document.removeEventListener("focusin", r);
967
- }), a = ne?.current;
1034
+ }), a = T?.current;
968
1035
  return () => {
969
1036
  cancelAnimationFrame(i), document.removeEventListener("focusin", r), a?.isConnected && a.focus({ preventScroll: !0 });
970
1037
  };
971
1038
  }, [
972
1039
  e,
973
- L,
974
- ne
975
- ]), /* @__PURE__ */ F(E, {
1040
+ B,
1041
+ T
1042
+ ]), /* @__PURE__ */ z(A, {
976
1043
  open: e,
977
- onClose: C,
978
- header: /* @__PURE__ */ P("span", {
979
- className: M("block truncate text-center", N, Xe.title),
980
- children: se
1044
+ onClose: w,
1045
+ header: /* @__PURE__ */ R("span", {
1046
+ className: F("block truncate text-center", te, et.title),
1047
+ children: ce ? ae : ie
981
1048
  }),
982
- ariaLabel: ce,
983
- closeAriaLabel: R,
1049
+ ariaLabel: se,
1050
+ onBack: ce ? H.backToMain : void 0,
1051
+ backAriaLabel: oe,
1052
+ backDisabled: h,
1053
+ closeAriaLabel: V,
984
1054
  closeDisabled: h,
985
- style: ae,
986
- overlayStyle: ae,
987
- className: M(Xe.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
988
- overlayClassName: Xe.backdrop,
989
- headerClassName: M("px-[22px]", Xe.divider),
1055
+ style: L,
1056
+ overlayStyle: L,
1057
+ className: F(et.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1058
+ overlayClassName: et.backdrop,
1059
+ headerClassName: F("px-[22px]", et.divider),
990
1060
  bodyClassName: "flex flex-col overflow-hidden",
991
- children: [/* @__PURE__ */ P("div", {
992
- ref: oe,
993
- className: M("min-h-0 flex-1 overflow-y-auto", Xe.content),
994
- children: /* @__PURE__ */ P("div", {
1061
+ children: [/* @__PURE__ */ R("div", {
1062
+ ref: re,
1063
+ className: F("min-h-0 flex-1 overflow-y-auto", et.content),
1064
+ children: /* @__PURE__ */ R("div", {
995
1065
  className: "p-[22px]",
996
- children: /* @__PURE__ */ P(We, {
1066
+ children: /* @__PURE__ */ R(Je, {
997
1067
  resource: n,
998
1068
  renderSummary: i,
1069
+ view: H.view,
1070
+ onChangeFolderClick: H.openFolderView,
999
1071
  folderItems: o,
1000
1072
  selectedFolderPath: s,
1001
- onSelectedFolderPathChange: c,
1073
+ pendingFolderPath: H.pendingFolderPath,
1074
+ onPendingFolderPathChange: H.setPendingFolderPath,
1002
1075
  onCreateFolder: l,
1003
1076
  expandedPaths: u,
1004
1077
  onExpandedPathsChange: d,
@@ -1010,286 +1083,286 @@ var R = /* @__PURE__ */ function(e) {
1010
1083
  allowReplace: _,
1011
1084
  author: ee,
1012
1085
  onAuthorChange: v,
1013
- rules: te,
1014
- onRulesChange: y,
1015
- ruleSourceOptions: b,
1016
- isRulesLoading: x,
1017
- hasRulesLoadError: S,
1018
- labels: w,
1019
- styles: T,
1020
- summaryTitleClassName: D,
1021
- headingClassName: O,
1022
- calloutFolderNameClassName: k
1086
+ rules: y,
1087
+ onRulesChange: b,
1088
+ ruleSourceOptions: x,
1089
+ isRulesLoading: S,
1090
+ hasRulesLoadError: C,
1091
+ labels: D,
1092
+ styles: O,
1093
+ summaryTitleClassName: k,
1094
+ headingClassName: j,
1095
+ calloutFolderNameClassName: M
1023
1096
  })
1024
1097
  })
1025
- }), /* @__PURE__ */ P(Ye, {
1098
+ }), /* @__PURE__ */ R($e, {
1026
1099
  version: n?.version,
1027
1100
  hasExistingPublicationInFolder: p,
1028
1101
  allowReplace: _,
1029
- isSubmitDisabled: z.isSubmitDisabled,
1030
- isSubmitLoading: z.isSubmitLoading,
1031
- onCancel: C,
1032
- onSubmit: re,
1033
- labels: A
1102
+ isSubmitDisabled: W.isSubmitDisabled,
1103
+ isSubmitLoading: W.isSubmitLoading,
1104
+ onCancel: ce ? H.backToMain : w,
1105
+ onSubmit: E,
1106
+ view: H.view,
1107
+ onSelectFolder: H.selectFolder,
1108
+ isSelectFolderDisabled: H.pendingFolderPath == null,
1109
+ labels: N
1034
1110
  })]
1035
1111
  });
1036
- }, Qe = /* @__PURE__ */ function(e) {
1112
+ }, nt = /* @__PURE__ */ function(e) {
1037
1113
  return e.Keep = "keep", e.New = "new", e;
1038
- }({}), $e = /* @__PURE__ */ function(e) {
1114
+ }({}), rt = /* @__PURE__ */ function(e) {
1039
1115
  return e.Main = "main", e.ChangeFolder = "change-folder", e;
1040
- }({}), et = {
1116
+ }({}), it = {
1041
1117
  heading: "_heading_vk731_1",
1042
1118
  destination: "_destination_vk731_5"
1043
- }, tt = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, onChangeFolderClick: u, changeFolderButtonRef: h, pendingDestination: g, onPendingDestinationChange: te, version: b, accessRules: x, isSubmitting: S = !1, submitError: C, foldersError: ne, onRetryFolders: T, panelLabels: E = {}, panelStyles: D = {}, headingClassName: O = "dial-body-semi-text", destinationClassName: k = "dial-small-semi-text" }) => {
1044
- let { saveToFolderHeading: j = "Save to folder", changeFolderLabel: N = "Change", destinationAriaLabel: ae = "Destination folder", versionHeading: L = "Version", keepVersionLabel: oe = "Keep version {version}", saveAsNewVersionLabel: se = "Save as new version", newVersionLabel: ce = "Version", newVersionPlaceholder: R = "Enter new version", searchPlaceholder: z = "Search folders", clearSearchAriaLabel: B = "Clear search", folderEmptyStateLabel: V, createFolderLabel: H, cancelCreatingFolderLabel: le, addSiblingFolderLabel: U, addChildFolderLabel: ue, createFolderEmptyNameError: W, createFolderInvalidNameError: de, createFolderDuplicateNameError: fe, retryLabel: G = "Retry", summaryVersionLabel: K } = E, { colors: q, folderTree: J } = D, pe = {
1045
- ...ie({
1046
- "--stf-heading-text": q?.headingText,
1047
- "--stf-destination-text": q?.destinationText
1119
+ }, at = ({ view: e, resource: t, roots: i, destination: o, onCreateFolder: s, onChangeFolderClick: c, changeFolderButtonRef: d, pendingDestination: g, onPendingDestinationChange: _, version: b, accessRules: S, isSubmitting: C = !1, submitError: w, foldersError: T, onRetryFolders: E, panelLabels: k = {}, panelStyles: A = {}, headingClassName: j = "dial-body-semi-text", destinationClassName: M = "dial-small-semi-text" }) => {
1120
+ let { saveToFolderHeading: N = "Save to folder", changeFolderLabel: te = "Change", destinationAriaLabel: I = "Destination folder", versionHeading: L = "Version", keepVersionLabel: re = "Keep version {version}", saveAsNewVersionLabel: ie = "Save as new version", newVersionLabel: ae = "Version", newVersionPlaceholder: oe = "Enter new version", searchPlaceholder: se = "Search folders", clearSearchAriaLabel: V = "Clear search", folderEmptyStateLabel: H, createFolderLabel: U, cancelCreatingFolderLabel: ce, addSiblingFolderLabel: W, addChildFolderLabel: le, createFolderEmptyNameError: G, createFolderInvalidNameError: K, createFolderDuplicateNameError: q, retryLabel: ue = "Retry" } = k, { colors: J, folderTree: de } = A, Y = {
1121
+ ...ne({
1122
+ "--stf-heading-text": J?.headingText,
1123
+ "--stf-destination-text": J?.destinationText
1048
1124
  }),
1049
- ...D.cssVars
1050
- }, Y = {
1051
- border: q?.summaryBorder,
1052
- background: q?.summaryBackground,
1053
- versionTagBorder: q?.summaryVersionTagBorder,
1054
- versionTagBackground: q?.summaryVersionTagBackground,
1055
- versionTagText: q?.summaryVersionTagText
1056
- }, [me, he] = a(""), ge = n(), _e = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), ve = i.find((e) => e.key === g?.rootKey), X = g ? g.path[g.path.length - 1] ?? ve?.label : void 0, Z = M(O, et.heading);
1057
- if (e === $e.ChangeFolder) return /* @__PURE__ */ F("div", {
1125
+ ...A.cssVars
1126
+ }, X = {
1127
+ border: J?.summaryBorder,
1128
+ background: J?.summaryBackground
1129
+ }, [Z, fe] = a(""), Q = n(), pe = r(() => [i.find((e) => e.key === o.rootKey)?.label ?? o.rootKey, ...o.path], [i, o]), me = i.find((e) => e.key === g?.rootKey), he = g ? g.path[g.path.length - 1] ?? me?.label : void 0, ge = F(j, it.heading);
1130
+ if (e === rt.ChangeFolder) return /* @__PURE__ */ z("div", {
1058
1131
  className: "flex flex-col gap-3",
1059
- style: pe,
1132
+ style: Y,
1060
1133
  children: [
1061
- /* @__PURE__ */ P("div", {
1134
+ /* @__PURE__ */ R("div", {
1062
1135
  role: "search",
1063
- children: /* @__PURE__ */ P(w, {
1064
- value: me,
1065
- onChange: (e) => he(e ?? ""),
1066
- placeholder: z,
1067
- clearLabel: B,
1068
- "aria-label": z
1136
+ children: /* @__PURE__ */ R(O, {
1137
+ value: Z,
1138
+ onChange: (e) => fe(e ?? ""),
1139
+ placeholder: se,
1140
+ clearLabel: V,
1141
+ "aria-label": se
1069
1142
  })
1070
1143
  }),
1071
- /* @__PURE__ */ P(v, {
1072
- politeness: y.Assertive,
1073
- children: ne && /* @__PURE__ */ F("div", {
1144
+ /* @__PURE__ */ R(y, {
1145
+ politeness: x.Assertive,
1146
+ children: T && /* @__PURE__ */ z("div", {
1074
1147
  className: "flex flex-wrap items-center gap-2",
1075
- children: [/* @__PURE__ */ P(f, { text: ne }), T && /* @__PURE__ */ P(ee, {
1076
- label: G,
1077
- onClick: T
1148
+ children: [/* @__PURE__ */ R(p, { text: T }), E && /* @__PURE__ */ R(v, {
1149
+ label: ue,
1150
+ onClick: E
1078
1151
  })]
1079
1152
  })
1080
1153
  }),
1081
- /* @__PURE__ */ P(Be, {
1154
+ /* @__PURE__ */ R(We, {
1082
1155
  roots: i,
1083
1156
  destination: g,
1084
- onDestinationChange: te,
1157
+ onDestinationChange: _,
1085
1158
  onCreateDestinationFolder: s,
1086
- searchQuery: me,
1087
- disabled: S,
1088
- noResultsLabel: V,
1089
- createFolderLabel: H,
1090
- cancelCreatingFolderLabel: le,
1091
- addSiblingFolderLabel: U,
1092
- addChildFolderLabel: ue,
1093
- emptyFolderNameError: W,
1094
- invalidFolderNameError: de,
1095
- duplicateFolderNameError: fe,
1096
- styles: J
1159
+ searchQuery: Z,
1160
+ disabled: C,
1161
+ noResultsLabel: H,
1162
+ createFolderLabel: U,
1163
+ cancelCreatingFolderLabel: ce,
1164
+ addSiblingFolderLabel: W,
1165
+ addChildFolderLabel: le,
1166
+ emptyFolderNameError: G,
1167
+ invalidFolderNameError: K,
1168
+ duplicateFolderNameError: q,
1169
+ styles: de
1097
1170
  }),
1098
- x && ve?.hasAccessRules && /* @__PURE__ */ P("div", {
1171
+ S && me?.hasAccessRules && /* @__PURE__ */ R("div", {
1099
1172
  className: "mt-1",
1100
- children: /* @__PURE__ */ P(Ce, {
1101
- rules: x.rules,
1102
- onRulesChange: x.onRulesChange,
1103
- sourceOptions: x.sourceOptions,
1104
- folderName: X,
1105
- disabled: S,
1106
- isLoading: x.isLoading,
1107
- hasLoadError: x.hasLoadError,
1108
- labels: x.labels,
1109
- styles: x.styles
1173
+ children: /* @__PURE__ */ R(De, {
1174
+ rules: S.rules,
1175
+ onRulesChange: S.onRulesChange,
1176
+ sourceOptions: S.sourceOptions,
1177
+ folderName: he,
1178
+ disabled: C,
1179
+ isLoading: S.isLoading,
1180
+ hasLoadError: S.hasLoadError,
1181
+ labels: S.labels,
1182
+ styles: S.styles
1110
1183
  })
1111
1184
  })
1112
1185
  ]
1113
1186
  });
1114
- let ye = b ? [{
1115
- value: Qe.Keep,
1116
- label: oe.replace("{version}", b.currentVersion)
1187
+ let _e = b ? [{
1188
+ value: nt.Keep,
1189
+ label: re.replace("{version}", b.currentVersion)
1117
1190
  }, {
1118
- value: Qe.New,
1119
- label: se,
1120
- content: /* @__PURE__ */ P(_, {
1121
- id: ge,
1191
+ value: nt.New,
1192
+ label: ie,
1193
+ content: /* @__PURE__ */ R(ee, {
1194
+ id: Q,
1122
1195
  value: b.newVersion,
1123
1196
  onChange: (e) => b.onNewVersionChange(e ?? ""),
1124
1197
  onBlur: b.onNewVersionBlur,
1125
1198
  labelProps: {
1126
- label: ce,
1199
+ label: ae,
1127
1200
  required: !0
1128
1201
  },
1129
- placeholder: R,
1202
+ placeholder: oe,
1130
1203
  error: b.newVersionError,
1131
1204
  invalid: !!b.newVersionError,
1132
- disabled: S
1205
+ disabled: C
1133
1206
  })
1134
1207
  }] : [];
1135
- return /* @__PURE__ */ F("div", {
1208
+ return /* @__PURE__ */ z("div", {
1136
1209
  className: "flex flex-col gap-5",
1137
- style: pe,
1210
+ style: Y,
1138
1211
  children: [
1139
- t.type == null ? /* @__PURE__ */ P(A, {
1140
- colors: Y,
1141
- children: /* @__PURE__ */ P("span", {
1142
- className: M("truncate", Z),
1212
+ t.type == null ? /* @__PURE__ */ R(P, {
1213
+ colors: X,
1214
+ children: /* @__PURE__ */ R("span", {
1215
+ className: F("truncate", ge),
1143
1216
  children: t.title
1144
1217
  })
1145
- }) : /* @__PURE__ */ P(A, {
1218
+ }) : /* @__PURE__ */ R(P, {
1146
1219
  item: {
1147
1220
  type: t.type,
1148
1221
  name: t.title,
1149
1222
  version: t.version ?? "",
1150
1223
  iconUrl: t.iconUrl
1151
1224
  },
1152
- versionLabel: K,
1153
- colors: Y
1225
+ hasVersionTag: !1,
1226
+ colors: X
1154
1227
  }),
1155
- /* @__PURE__ */ F("section", {
1228
+ /* @__PURE__ */ z("section", {
1156
1229
  className: "flex flex-col gap-2",
1157
- children: [/* @__PURE__ */ P("h2", {
1158
- className: Z,
1159
- children: j
1160
- }), /* @__PURE__ */ F("div", {
1230
+ children: [/* @__PURE__ */ R("h2", {
1231
+ className: ge,
1232
+ children: N
1233
+ }), /* @__PURE__ */ z("div", {
1161
1234
  className: "flex min-w-0 items-center gap-2",
1162
- children: [/* @__PURE__ */ P("div", {
1235
+ children: [/* @__PURE__ */ R("div", {
1163
1236
  role: "group",
1164
- "aria-label": ae,
1237
+ "aria-label": I,
1165
1238
  className: "min-w-0 flex-1",
1166
- children: /* @__PURE__ */ P(p, {
1167
- name: _e.join(" / "),
1168
- nameClassName: M(k, et.destination)
1239
+ children: /* @__PURE__ */ R(m, {
1240
+ name: pe.join(" / "),
1241
+ nameClassName: F(M, it.destination)
1169
1242
  })
1170
- }), /* @__PURE__ */ P(m, {
1171
- ref: h,
1172
- size: d.Small,
1173
- label: N,
1174
- iconBefore: /* @__PURE__ */ P(I, {
1175
- size: c.SM,
1176
- stroke: l,
1243
+ }), /* @__PURE__ */ R(h, {
1244
+ ref: d,
1245
+ size: f.Small,
1246
+ label: te,
1247
+ iconBefore: /* @__PURE__ */ R(B, {
1248
+ size: l.SM,
1249
+ stroke: u,
1177
1250
  "aria-hidden": !0
1178
1251
  }),
1179
- disabled: S,
1180
- onClick: u
1252
+ disabled: C,
1253
+ onClick: c
1181
1254
  })]
1182
1255
  })]
1183
1256
  }),
1184
- b && /* @__PURE__ */ F("section", {
1257
+ b && /* @__PURE__ */ z("section", {
1185
1258
  className: "flex flex-col gap-2",
1186
- children: [/* @__PURE__ */ P("h2", {
1187
- className: Z,
1259
+ children: [/* @__PURE__ */ R("h2", {
1260
+ className: ge,
1188
1261
  children: L
1189
- }), /* @__PURE__ */ P(re, {
1262
+ }), /* @__PURE__ */ R(D, {
1190
1263
  ariaLabel: L,
1191
1264
  value: b.versionMode,
1192
1265
  onChange: (e) => b.onVersionModeChange(e),
1193
- items: ye,
1194
- disabled: S
1266
+ items: _e,
1267
+ disabled: C
1195
1268
  })]
1196
1269
  }),
1197
- /* @__PURE__ */ P(v, {
1198
- politeness: y.Assertive,
1199
- children: C && /* @__PURE__ */ P(f, { text: C })
1270
+ /* @__PURE__ */ R(y, {
1271
+ politeness: x.Assertive,
1272
+ children: w && /* @__PURE__ */ R(p, { text: w })
1200
1273
  })
1201
1274
  ]
1202
1275
  });
1203
- }, nt = {
1276
+ }, ot = {
1204
1277
  backdrop: "_backdrop_1ie8s_6",
1205
1278
  panel: "_panel_1ie8s_10",
1206
1279
  divider: "_divider_1ie8s_15",
1207
1280
  footer: "_footer_1ie8s_19",
1208
1281
  content: "_content_1ie8s_23",
1209
1282
  title: "_title_1ie8s_28"
1210
- }, rt = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: l = {}, colors: u, titleClassName: d = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: h = !1, onPendingDestinationChange: g, ..._ }) => {
1211
- let { title: ee = "Save", changeFolderTitle: v = "Change folder", closeAriaLabel: te = "Close", backAriaLabel: y = "Back", cancelLabel: x = "Cancel", saveLabel: S = "Save", savingLabel: C = "Saving…", selectLabel: re = "Select" } = l, w = ie({
1283
+ }, st = ({ isOpen: e, onClose: n, onSubmit: r, isSubmitDisabled: o = !1, returnFocusRef: s, labels: c = {}, colors: u, titleClassName: d = "dial-body-semi-text", destination: f, onDestinationChange: p, isSubmitting: m = !1, onPendingDestinationChange: g, ..._ }) => {
1284
+ let { title: ee = "Save", changeFolderTitle: v = "Change folder", closeAriaLabel: y = "Close", backAriaLabel: b = "Back", cancelLabel: x = "Cancel", saveLabel: C = "Save", savingLabel: w = "Saving…", selectLabel: T = "Select" } = c, D = ne({
1212
1285
  "--sstf-backdrop-bg": u?.backdropBackground,
1213
1286
  "--sstf-panel-bg": u?.panelBackground,
1214
1287
  "--sstf-panel-border": u?.panelBorder,
1215
1288
  "--sstf-divider-border": u?.dividerBorder,
1216
1289
  "--sstf-scrollbar-thumb": u?.scrollbarThumb,
1217
1290
  "--sstf-title-text": u?.titleText
1218
- }), [T, O] = a($e.Main), [k, A] = a(f), j = i(null), N = i(null);
1291
+ }), [O, k] = a(rt.Main), [M, N] = a(f), P = i(null), te = i(null);
1219
1292
  t(() => {
1220
- e && O($e.Main);
1293
+ e && k(rt.Main);
1221
1294
  }, [e]);
1222
- let I = i(T);
1295
+ let I = i(O);
1223
1296
  t(() => {
1224
- I.current !== T && (I.current = T, T === $e.ChangeFolder ? j.current?.focus({ preventScroll: !0 }) : N.current?.focus({ preventScroll: !0 }));
1225
- }, [T]);
1226
- let ae = i(e);
1297
+ I.current !== O && (I.current = O, O === rt.ChangeFolder ? P.current?.focus({ preventScroll: !0 }) : te.current?.focus({ preventScroll: !0 }));
1298
+ }, [O]);
1299
+ let L = i(e);
1227
1300
  t(() => {
1228
- let t = ae.current;
1229
- ae.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1301
+ let t = L.current;
1302
+ L.current = e, t && !e && s?.current?.isConnected && s.current.focus({ preventScroll: !0 });
1230
1303
  }, [e, s]);
1231
- let L = T === $e.ChangeFolder, oe = (e) => {
1232
- A(e), g?.(e);
1233
- }, se = () => {
1234
- oe(f), O($e.ChangeFolder);
1235
- }, ce = () => {
1236
- g?.(f), O($e.Main);
1237
- }, R = () => {
1238
- k && p(k), O($e.Main);
1304
+ let B = O === rt.ChangeFolder, re = (e) => {
1305
+ N(e), g?.(e);
1306
+ }, ie = () => {
1307
+ re(f), k(rt.ChangeFolder);
1308
+ }, ae = () => {
1309
+ g?.(f), k(rt.Main);
1310
+ }, oe = () => {
1311
+ M && p(M), k(rt.Main);
1239
1312
  };
1240
- return /* @__PURE__ */ F(E, {
1313
+ return /* @__PURE__ */ z(A, {
1241
1314
  open: e,
1242
1315
  onClose: n,
1243
- header: /* @__PURE__ */ P("span", {
1244
- ref: j,
1316
+ header: /* @__PURE__ */ R("span", {
1317
+ ref: P,
1245
1318
  tabIndex: -1,
1246
- className: M("block truncate outline-none", d, nt.title),
1247
- children: L ? v : ee
1319
+ className: F("block truncate outline-none", d, ot.title),
1320
+ children: B ? v : ee
1248
1321
  }),
1249
1322
  ariaLabel: ee,
1250
- onBack: L ? ce : void 0,
1251
- backAriaLabel: y,
1252
- backDisabled: h,
1253
- closeAriaLabel: te,
1254
- closeDisabled: h,
1255
- style: w,
1256
- overlayStyle: w,
1257
- className: M(nt.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1258
- overlayClassName: nt.backdrop,
1259
- headerClassName: M("px-[22px]", nt.divider),
1323
+ onBack: B ? ae : void 0,
1324
+ backAriaLabel: b,
1325
+ backDisabled: m,
1326
+ closeAriaLabel: y,
1327
+ closeDisabled: m,
1328
+ style: D,
1329
+ overlayStyle: D,
1330
+ className: F(ot.panel, "tablet:w-[540px]! tablet:max-w-[calc(100%-32px)]!"),
1331
+ overlayClassName: ot.backdrop,
1332
+ headerClassName: F("px-[22px]", ot.divider),
1260
1333
  bodyClassName: "flex flex-col overflow-hidden",
1261
- children: [/* @__PURE__ */ P("div", {
1262
- className: M("min-h-0 flex-1 overflow-y-auto p-[22px]", nt.content),
1263
- children: /* @__PURE__ */ P(tt, {
1334
+ children: [/* @__PURE__ */ R("div", {
1335
+ className: F("min-h-0 flex-1 overflow-y-auto p-[22px]", ot.content),
1336
+ children: /* @__PURE__ */ R(at, {
1264
1337
  ..._,
1265
- view: T,
1338
+ view: O,
1266
1339
  destination: f,
1267
1340
  onDestinationChange: p,
1268
- isSubmitting: h,
1269
- onChangeFolderClick: se,
1270
- changeFolderButtonRef: N,
1271
- pendingDestination: k,
1272
- onPendingDestinationChange: oe
1341
+ isSubmitting: m,
1342
+ onChangeFolderClick: ie,
1343
+ changeFolderButtonRef: te,
1344
+ pendingDestination: M,
1345
+ onPendingDestinationChange: re
1273
1346
  })
1274
- }), /* @__PURE__ */ F("div", {
1275
- className: M("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", nt.footer),
1276
- children: [/* @__PURE__ */ P(m, {
1347
+ }), /* @__PURE__ */ z("div", {
1348
+ className: F("flex items-center justify-end gap-2 border-t px-4 py-4 desktop:px-3.5", ot.footer),
1349
+ children: [/* @__PURE__ */ R(h, {
1277
1350
  label: x,
1278
1351
  className: "mobile:flex-1",
1279
- disabled: h,
1280
- onClick: L ? ce : n
1281
- }), L ? /* @__PURE__ */ P(b, {
1282
- label: re,
1352
+ disabled: m,
1353
+ onClick: B ? ae : n
1354
+ }), B ? /* @__PURE__ */ R(S, {
1355
+ label: T,
1283
1356
  className: "mobile:flex-1",
1284
- disabled: k == null,
1285
- onClick: R
1286
- }) : /* @__PURE__ */ P(ne, {
1287
- label: h ? C : S,
1357
+ disabled: M == null,
1358
+ onClick: oe
1359
+ }) : /* @__PURE__ */ R(E, {
1360
+ label: m ? w : C,
1288
1361
  className: "mobile:flex-1",
1289
- disabled: o || h,
1290
- iconBefore: h ? /* @__PURE__ */ P("span", {
1362
+ disabled: o || m,
1363
+ iconBefore: m ? /* @__PURE__ */ R("span", {
1291
1364
  "aria-hidden": !0,
1292
- children: /* @__PURE__ */ P(D, { size: c.SM })
1365
+ children: /* @__PURE__ */ R(j, { size: l.SM })
1293
1366
  }) : void 0,
1294
1367
  onClick: r
1295
1368
  })]
@@ -1297,4 +1370,4 @@ var R = /* @__PURE__ */ function(e) {
1297
1370
  });
1298
1371
  };
1299
1372
  //#endregion
1300
- export { Ve as PUBLISH_PANEL_CLASS, R as PublicationRuleFunction, Q as PublishAccessRuleEditor, Ce as PublishAccessRules, z as PublishCalloutKind, Be as PublishFoldersTree, Ye as PublishFooter, Te as PublishHistoryList, We as PublishPanel, tt as SaveToFolderPanel, $e as SaveToFolderView, Qe as SaveVersionMode, Ze as StandalonePublishPanel, rt as StandaloneSaveToFolderPanel, q as collectFolderKeys, B as derivePublishState, W as filterFolderTree, H as formatPublishedDate, pe as fromFolderPathKey, _e as getSiblingFolderNames, ge as getUniqueFolderName, K as mergeFolderPaths, fe as sortFolderTree, Y as toDialFileTree, J as toFolderPathKey, ue as usePublishFlow, he as validateFolderName };
1373
+ export { Ge as PUBLISH_PANEL_CLASS, V as PublicationRuleFunction, we as PublishAccessRuleEditor, De as PublishAccessRules, H as PublishCalloutKind, We as PublishFoldersTree, $e as PublishFooter, ke as PublishHistoryList, Je as PublishPanel, q as PublishPanelView, at as SaveToFolderPanel, rt as SaveToFolderView, nt as SaveVersionMode, tt as StandalonePublishPanel, st as StandaloneSaveToFolderPanel, fe as collectFolderKeys, U as derivePublishState, J as filterFolderTree, W as formatPublishedDate, pe as fromFolderPathKey, ve as getSiblingFolderNames, _e as getUniqueFolderName, Z as mergeFolderPaths, Y as sortFolderTree, me as toDialFileTree, Q as toFolderPathKey, K as usePublishFlow, ue as usePublishFolderView, ge as validateFolderName };