@epam/ai-dial-publish-panel 1.4.0-dev.12 → 1.4.0-dev.124

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