@synopackageland/sdk 0.9.8 → 0.9.9

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 (76) hide show
  1. package/README.md +12 -1
  2. package/dist/i18n/background/de.json +0 -1
  3. package/dist/i18n/background/en.json +0 -1
  4. package/dist/i18n/background/es.json +0 -1
  5. package/dist/i18n/background/fr.json +0 -1
  6. package/dist/i18n/background/it.json +0 -1
  7. package/dist/i18n/background/ja.json +2 -3
  8. package/dist/i18n/background/ko.json +0 -1
  9. package/dist/i18n/background/zh-CN.json +0 -1
  10. package/dist/i18n/background/zh-TW.json +0 -1
  11. package/dist/i18n/delegate/de.json +10 -2
  12. package/dist/i18n/delegate/en.json +10 -2
  13. package/dist/i18n/delegate/es.json +10 -2
  14. package/dist/i18n/delegate/fr.json +10 -2
  15. package/dist/i18n/delegate/it.json +10 -2
  16. package/dist/i18n/delegate/ja.json +10 -2
  17. package/dist/i18n/delegate/ko.json +10 -2
  18. package/dist/i18n/delegate/zh-CN.json +10 -2
  19. package/dist/i18n/delegate/zh-TW.json +10 -2
  20. package/dist/i18n/files/de.json +1 -0
  21. package/dist/i18n/files/en.json +1 -0
  22. package/dist/i18n/files/es.json +1 -0
  23. package/dist/i18n/files/fr.json +1 -0
  24. package/dist/i18n/files/it.json +1 -0
  25. package/dist/i18n/files/ja.json +1 -0
  26. package/dist/i18n/files/ko.json +1 -0
  27. package/dist/i18n/files/zh-CN.json +1 -0
  28. package/dist/i18n/files/zh-TW.json +1 -0
  29. package/dist/i18n/identity/de.json +2 -0
  30. package/dist/i18n/identity/en.json +2 -0
  31. package/dist/i18n/identity/es.json +2 -0
  32. package/dist/i18n/identity/fr.json +2 -0
  33. package/dist/i18n/identity/it.json +2 -0
  34. package/dist/i18n/identity/ja.json +2 -0
  35. package/dist/i18n/identity/ko.json +2 -0
  36. package/dist/i18n/identity/zh-CN.json +2 -0
  37. package/dist/i18n/identity/zh-TW.json +2 -0
  38. package/dist/i18n/portal/de.json +21 -0
  39. package/dist/i18n/portal/en.json +21 -0
  40. package/dist/i18n/portal/es.json +21 -0
  41. package/dist/i18n/portal/fr.json +21 -0
  42. package/dist/i18n/portal/it.json +21 -0
  43. package/dist/i18n/portal/ja.json +21 -0
  44. package/dist/i18n/portal/ko.json +21 -0
  45. package/dist/i18n/portal/zh-CN.json +21 -0
  46. package/dist/i18n/portal/zh-TW.json +21 -0
  47. package/dist/i18n/save/de.json +12 -2
  48. package/dist/i18n/save/en.json +12 -2
  49. package/dist/i18n/save/es.json +12 -2
  50. package/dist/i18n/save/fr.json +12 -2
  51. package/dist/i18n/save/it.json +12 -2
  52. package/dist/i18n/save/ja.json +12 -2
  53. package/dist/i18n/save/ko.json +12 -2
  54. package/dist/i18n/save/zh-CN.json +12 -2
  55. package/dist/i18n/save/zh-TW.json +12 -2
  56. package/dist/index.js +2622 -2162
  57. package/dist/src/background/BackgroundPanel.vue.d.ts +4 -1
  58. package/dist/src/background/i18n.d.ts +0 -1
  59. package/dist/src/background/picker-provider.d.ts +1 -1
  60. package/dist/src/context.d.ts +4 -1
  61. package/dist/src/delegate/BackgroundSavePanel.vue.d.ts +6 -1
  62. package/dist/src/delegate/DelegatePanel.vue.d.ts +3 -1
  63. package/dist/src/delegate/ExecutorSettings.vue.d.ts +4 -1
  64. package/dist/src/delegate/copy.d.ts +18 -2
  65. package/dist/src/delegate/save-copy.d.ts +34 -4
  66. package/dist/src/i18n.d.ts +2 -0
  67. package/dist/src/identity/i18n.d.ts +2 -0
  68. package/dist/src/index.d.ts +4 -1
  69. package/dist/src/nas/NasPicker.vue.d.ts +3 -0
  70. package/dist/src/nas/locale.d.ts +1 -0
  71. package/dist/src/nas/provider.d.ts +2 -2
  72. package/dist/src/portal/access.d.ts +16 -0
  73. package/dist/src/portal/i18n.d.ts +3 -0
  74. package/dist/style.css +1 -1
  75. package/dist/vue.js +1816 -1560
  76. package/package.json +3 -3
package/dist/vue.js CHANGED
@@ -1,11 +1,11 @@
1
- import { shellCopy as Je, nasCopy as re, nasErrorCopy as Ee, format as Pe, uiLocale as Xe, saveCopy as Re, saveError as Ve, createNasProvider as qe, identityCopy as Qe, backgroundCopy as Ye, createBackgroundPickerProvider as We, backgroundErrorCopy as Ze, requestKey as De, delegateCopy as Be, errorCopy as je, scopedPicker as ea, authorizationCopy as aa } from "./index.js";
2
- import { FILE_STATION_APP as Bt, activePage as Ot, authorizationCatalogs as Ft, backgroundCatalogs as Lt, catalogs as Nt, createBackgroundSaveFacade as Mt, createFileTransfers as Kt, decodeResponse as Ht, delegateCatalogs as Gt, encodeRequest as Jt, fileStationPath as Xt, identityCatalogs as Qt, mergeCatalogs as Yt, nasCatalogs as Wt, openFileInFileStation as Zt, openFolderInFileStation as jt, protocolCodes as en, protocolOps as an, protocolSchemas as ln, saveCatalogs as tn, shellCatalogs as nn, shellPages as sn, uiLocales as on } from "./index.js";
3
- import { inject as Oe, ref as y, onBeforeUnmount as ue, defineComponent as le, computed as F, openBlock as t, createBlock as $, unref as e, withCtx as n, createVNode as h, renderSlot as Ie, createElementVNode as C, markRaw as la, h as ta, onMounted as ve, createElementBlock as S, createTextVNode as g, toDisplayString as l, createCommentVNode as k, watch as Fe, Fragment as Z, withModifiers as me, onUnmounted as Le, nextTick as na, renderList as de, provide as sa } from "vue";
4
- import { AppLayout as ia, PageContent as oa, PageHeader as ua, AppSidebar as ra, FileTypeIcon as Se, IconButton as ze, Breadcrumb as da, FilePicker as va, Button as A, Callout as Q, TreeView as ca, DataGrid as fa, Dialog as Ae, SettingsSection as ce, Link as Ne, Form as be, FormItem as oe, Input as pe, FormActions as ke, Select as Me, Checkbox as pa, SettingsRow as ya } from "@synopackageland/ui";
5
- import { Timer as ma, Info as ba, ChevronLeft as ka, ChevronRight as ga, RotateCw as ha, ShieldCheck as _a } from "@lucide/vue";
6
- const wa = /* @__PURE__ */ Symbol("executor-setup");
7
- function Ca() {
8
- return Oe(wa, {
1
+ import { shellCopy as aa, nasCopy as be, nasErrorCopy as Le, format as Ae, uiLocale as ta, saveCopy as Ne, saveError as Ie, createNasProvider as Me, identityCopy as la, backgroundCopy as sa, createBackgroundPickerProvider as na, backgroundErrorCopy as ia, requestKey as Be, delegateCopy as Ke, labelSeparator as He, errorCopy as oa, scopedPicker as ua, openFolderInFileStation as ra, authorizationCopy as da } from "./index.js";
2
+ import { DEFAULT_REQUEST_TIMEOUT as ts, FILE_STATION_APP as ls, activePage as ss, authorizationCatalogs as ns, backgroundCatalogs as is, catalogs as os, clientTimeout as us, createBackgroundSaveFacade as rs, createFileTransfers as ds, createPortalAccess as vs, decodeResponse as cs, delegateCatalogs as ps, encodeRequest as fs, fileStationPath as ys, identityCatalogs as ms, mergeCatalogs as bs, nasCatalogs as gs, openFileInFileStation as hs, portalCatalogs as ks, portalMessages as _s, protocolCodes as ws, protocolOps as xs, protocolSchemas as Cs, saveCatalogs as $s, shellCatalogs as Ss, shellPages as zs, uiLocales as Ps } from "./index.js";
3
+ import { inject as Ge, ref as b, onBeforeUnmount as ye, defineComponent as oe, computed as L, openBlock as s, createBlock as x, unref as e, withCtx as l, createVNode as d, renderSlot as De, createElementVNode as $, markRaw as va, h as ca, onMounted as ge, createElementBlock as V, createTextVNode as g, toDisplayString as t, createCommentVNode as h, watch as Je, Fragment as ne, createSlots as Xe, withModifiers as Se, onUnmounted as Qe, nextTick as pa, renderList as ke, provide as fa } from "vue";
4
+ import { AppLayout as ya, PageContent as ma, PageHeader as ba, AppSidebar as ga, FileTypeIcon as Ee, IconButton as Ue, Breadcrumb as ha, FilePicker as ka, Button as U, Callout as X, TreeView as _a, DataGrid as wa, Dialog as qe, SettingsSection as he, PathDisplay as pe, Link as Ye, Form as ze, FormItem as fe, Input as _e, FormActions as Pe, Card as Fe, Badge as $e, Select as Ze, Checkbox as xa, KeyValueRow as Ce, DataTable as Ca, formatFileSize as $a, Pagination as Sa, SettingsRow as za } from "@synopackageland/ui";
5
+ import { Timer as Pa, Info as Va, ChevronLeft as Ia, ChevronRight as Ta, RotateCw as Ea, FolderOpen as Ua, ShieldCheck as Aa } from "@lucide/vue";
6
+ const Da = /* @__PURE__ */ Symbol("executor-setup");
7
+ function We() {
8
+ return Ge(Da, {
9
9
  async status() {
10
10
  return { state: "blocked", reason: "setup-unavailable" };
11
11
  },
@@ -17,102 +17,102 @@ function Ca() {
17
17
  }
18
18
  });
19
19
  }
20
- function xt(p) {
21
- const I = y(!1), a = y(!1), m = y(), i = y("");
22
- let d = !1, s = 0, o, r;
23
- function P() {
24
- clearTimeout(o), clearTimeout(r);
20
+ function Ml(y) {
21
+ const q = b(!1), f = b(!1), a = b(), o = b("");
22
+ let m = !1, i = 0, n, u;
23
+ function r() {
24
+ clearTimeout(n), clearTimeout(u);
25
25
  }
26
- function v(E = "") {
27
- s++, P(), m.value = void 0, i.value = E;
26
+ function v(N = "") {
27
+ i++, r(), a.value = void 0, o.value = N;
28
28
  }
29
- function _(E) {
30
- if (d) return;
31
- const q = Date.parse(E.expiresAt) - Date.now();
32
- if (!Number.isFinite(q) || q <= 0) {
29
+ function k(N) {
30
+ if (m) return;
31
+ const K = Date.parse(N.expiresAt) - Date.now();
32
+ if (!Number.isFinite(K) || K <= 0) {
33
33
  v("expired");
34
34
  return;
35
35
  }
36
- P(), m.value = E, i.value = "", o = setTimeout(() => v("expired"), q);
37
- const J = s;
38
- r = setTimeout(async () => {
36
+ r(), a.value = N, o.value = "", n = setTimeout(() => v("expired"), K);
37
+ const O = i;
38
+ u = setTimeout(async () => {
39
39
  try {
40
- const G = await p.call("identity.session");
41
- !d && s === J && _(G);
40
+ const Z = await y.call("identity.session");
41
+ !m && i === O && k(Z);
42
42
  } catch {
43
- !d && s === J && v("expired");
43
+ !m && i === O && v("expired");
44
44
  }
45
- }, Math.min(6e4, q));
45
+ }, Math.min(6e4, K));
46
46
  }
47
- async function z() {
47
+ async function D() {
48
48
  try {
49
- const E = await p.call("identity.status");
50
- if (d) return;
51
- if (I.value = E.enabled === !0, I.value)
49
+ const N = await y.call("identity.status");
50
+ if (m) return;
51
+ if (q.value = N.enabled === !0, q.value)
52
52
  try {
53
- _(await p.call("identity.session", { bootstrap: !0 }));
53
+ k(await y.call("identity.session", { bootstrap: !0 }));
54
54
  } catch {
55
- d || v();
55
+ m || v();
56
56
  }
57
- } catch (E) {
58
- const q = E?.code;
59
- I.value = !["unknown_method", "admin_required", "app_privilege_denied", "session_required"].includes(q || ""), I.value && (i.value = "unavailable");
57
+ } catch (N) {
58
+ const K = N?.code;
59
+ q.value = !["unknown_method", "admin_required", "app_privilege_denied", "session_required"].includes(K || ""), q.value && (o.value = "unavailable");
60
60
  } finally {
61
- d || (a.value = !0);
61
+ m || (f.value = !0);
62
62
  }
63
63
  }
64
- async function x(E, q) {
65
- const J = s;
64
+ async function S(N, K) {
65
+ const O = i;
66
66
  try {
67
- const G = await p.call(E, q);
68
- if (d || I.value && J !== s) throw { code: "session_required" };
69
- return G;
70
- } catch (G) {
71
- const K = G?.code;
72
- throw !d && J === s && I.value && ["session_required", "session_revalidation_required"].includes(K || "") && v(K === "session_revalidation_required" ? "revalidate" : "expired"), G;
67
+ const Z = await y.call(N, K);
68
+ if (m || q.value && O !== i) throw { code: "session_required" };
69
+ return Z;
70
+ } catch (Z) {
71
+ const ae = Z?.code;
72
+ throw !m && O === i && q.value && ["session_required", "session_revalidation_required"].includes(ae || "") && v(ae === "session_revalidation_required" ? "revalidate" : "expired"), Z;
73
73
  }
74
74
  }
75
- async function b(E, q, J) {
76
- const G = await p.call("identity.login", { account: E, password: q, otp: J });
77
- d || (s++, _(G));
75
+ async function c(N, K, O) {
76
+ const Z = await y.call("identity.login", { account: N, password: K, otp: O });
77
+ m || (i++, k(Z));
78
78
  }
79
- async function D() {
80
- const E = await p.call("identity.session", { bootstrap: !0 });
81
- d || (s++, _(E));
79
+ async function w() {
80
+ const N = await y.call("identity.session", { bootstrap: !0 });
81
+ m || (i++, k(N));
82
82
  }
83
- async function R() {
84
- await p.call("identity.logout"), d || v();
83
+ async function z() {
84
+ await y.call("identity.logout"), m || v();
85
85
  }
86
- function L() {
87
- d = !0, v();
86
+ function M() {
87
+ m = !0, v();
88
88
  }
89
- return { enabled: I, ready: a, subject: m, notice: i, start: z, call: x, login: b, bootstrap: D, logout: R, dispose: L };
89
+ return { enabled: q, ready: f, subject: a, notice: o, start: D, call: S, login: c, bootstrap: w, logout: z, dispose: M };
90
90
  }
91
- function $a() {
92
- const p = y(!1), I = y();
93
- let a = !1, m = 0, i;
94
- function d() {
95
- m++, i?.abort(), i = void 0, p.value = !1, I.value = void 0;
91
+ function Ra() {
92
+ const y = b(!1), q = b();
93
+ let f = !1, a = 0, o;
94
+ function m() {
95
+ a++, o?.abort(), o = void 0, y.value = !1, q.value = void 0;
96
96
  }
97
- async function s(o) {
98
- if (a || p.value) return;
99
- const r = ++m, P = new AbortController();
100
- i = P, p.value = !0, I.value = void 0;
97
+ async function i(n) {
98
+ if (f || y.value) return;
99
+ const u = ++a, r = new AbortController();
100
+ o = r, y.value = !0, q.value = void 0;
101
101
  try {
102
- const v = await o(P.signal);
103
- return !a && r === m ? v : void 0;
102
+ const v = await n(r.signal);
103
+ return !f && u === a ? v : void 0;
104
104
  } catch (v) {
105
- !a && r === m && (I.value = v);
105
+ !f && u === a && (q.value = v);
106
106
  return;
107
107
  } finally {
108
- !a && r === m && (p.value = !1, i = void 0);
108
+ !f && u === a && (y.value = !1, o = void 0);
109
109
  }
110
110
  }
111
- return ue(() => {
112
- a = !0, d();
113
- }), { busy: p, error: I, run: s, cancel: d };
111
+ return ye(() => {
112
+ f = !0, m();
113
+ }), { busy: y, error: q, run: i, cancel: m };
114
114
  }
115
- const xa = { class: "app-page-content" }, Sa = /* @__PURE__ */ le({
115
+ const qa = { class: "app-page-content" }, Ba = /* @__PURE__ */ oe({
116
116
  __name: "AppShell",
117
117
  props: {
118
118
  locale: {},
@@ -121,36 +121,36 @@ const xa = { class: "app-page-content" }, Sa = /* @__PURE__ */ le({
121
121
  description: {}
122
122
  },
123
123
  emits: ["update:modelValue"],
124
- setup(p, { emit: I }) {
125
- const a = p, m = I, i = F(() => Je(a.locale)), d = { status: ba, background: ma }, s = F(() => [{
126
- items: a.pages.map((r) => ({ key: r, label: i.value[r], icon: d[r] }))
127
- }]), o = F(() => i.value[a.modelValue] ?? i.value.status);
128
- return (r, P) => (t(), $(e(ia), {
124
+ setup(y, { emit: q }) {
125
+ const f = y, a = q, o = L(() => aa(f.locale)), m = { status: Va, background: Pa }, i = L(() => [{
126
+ items: f.pages.map((u) => ({ key: u, label: o.value[u], icon: m[u] }))
127
+ }]), n = L(() => o.value[f.modelValue] ?? o.value.status);
128
+ return (u, r) => (s(), x(e(ya), {
129
129
  class: "app-shell",
130
130
  "min-height": "0",
131
131
  "wide-layout": "window"
132
132
  }, {
133
- sidebar: n(() => [
134
- h(e(ra), {
135
- "model-value": p.modelValue,
136
- groups: s.value,
137
- "onUpdate:modelValue": P[0] || (P[0] = (v) => m("update:modelValue", v))
133
+ sidebar: l(() => [
134
+ d(e(ga), {
135
+ "model-value": y.modelValue,
136
+ groups: i.value,
137
+ "onUpdate:modelValue": r[0] || (r[0] = (v) => a("update:modelValue", v))
138
138
  }, null, 8, ["model-value", "groups"])
139
139
  ]),
140
- default: n(() => [
141
- h(e(oa), { class: "app-page" }, {
142
- default: n(() => [
143
- h(e(ua), {
144
- title: o.value,
145
- description: p.description
140
+ default: l(() => [
141
+ d(e(ma), { class: "app-page" }, {
142
+ default: l(() => [
143
+ d(e(ba), {
144
+ title: n.value,
145
+ description: y.description
146
146
  }, {
147
- actions: n(() => [
148
- Ie(r.$slots, "actions", {}, void 0, !0)
147
+ actions: l(() => [
148
+ De(u.$slots, "actions", {}, void 0, !0)
149
149
  ]),
150
150
  _: 3
151
151
  }, 8, ["title", "description"]),
152
- C("div", xa, [
153
- Ie(r.$slots, "default", {}, void 0, !0)
152
+ $("div", qa, [
153
+ De(u.$slots, "default", {}, void 0, !0)
154
154
  ])
155
155
  ]),
156
156
  _: 3
@@ -159,32 +159,32 @@ const xa = { class: "app-page-content" }, Sa = /* @__PURE__ */ le({
159
159
  _: 3
160
160
  }));
161
161
  }
162
- }), ne = (p, I) => {
163
- const a = p.__vccOpts || p;
164
- for (const [m, i] of I)
165
- a[m] = i;
166
- return a;
167
- }, St = /* @__PURE__ */ ne(Sa, [["__scopeId", "data-v-05f63ca5"]]), Te = ["B", "KB", "MB", "GB", "TB", "PB"];
168
- function Ue(p, I) {
169
- let a = 0, m = p;
170
- for (; m >= 1024 && a < Te.length - 1; )
171
- m /= 1024, a++;
172
- return `${new Intl.NumberFormat(I, { maximumFractionDigits: a ? 1 : 0 }).format(m)} ${Te[a]}`;
162
+ }), ue = (y, q) => {
163
+ const f = y.__vccOpts || y;
164
+ for (const [a, o] of q)
165
+ f[a] = o;
166
+ return f;
167
+ }, Kl = /* @__PURE__ */ ue(Ba, [["__scopeId", "data-v-05f63ca5"]]), Oe = ["B", "KB", "MB", "GB", "TB", "PB"];
168
+ function Re(y, q) {
169
+ let f = 0, a = y;
170
+ for (; a >= 1024 && f < Oe.length - 1; )
171
+ a /= 1024, f++;
172
+ return `${new Intl.NumberFormat(q, { maximumFractionDigits: f ? 1 : 0 }).format(a)} ${Oe[f]}`;
173
173
  }
174
- const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-location" }, Va = ["aria-label"], Ia = {
174
+ const Fa = ["aria-busy", "aria-label"], Oa = { class: "file-toolbar file-location" }, La = ["aria-label"], Na = {
175
175
  key: 0,
176
176
  class: "file-toolbar"
177
- }, Ua = {
177
+ }, Ma = {
178
178
  key: 1,
179
179
  role: "status"
180
- }, Aa = { role: "alert" }, Da = {
180
+ }, Ka = { role: "alert" }, Ha = {
181
181
  key: 4,
182
182
  role: "status"
183
- }, Ta = { class: "file-columns" }, Ea = ["aria-label"], Ra = { class: "file-content" }, qa = { class: "file-name" }, Ba = { class: "file-empty" }, Oa = { class: "file-bytes" }, Fa = {
183
+ }, Ga = { class: "file-columns" }, Ja = ["aria-label"], Xa = { class: "file-content" }, Qa = { class: "file-name" }, Ya = { class: "file-empty" }, Za = { class: "file-bytes" }, Wa = {
184
184
  key: 5,
185
185
  class: "file-selection",
186
186
  role: "status"
187
- }, La = /* @__PURE__ */ le({
187
+ }, ja = /* @__PURE__ */ oe({
188
188
  __name: "FileBrowser",
189
189
  props: {
190
190
  provider: {},
@@ -193,310 +193,310 @@ const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-locatio
193
193
  transfers: { type: Boolean, default: !1 }
194
194
  },
195
195
  emits: ["selected"],
196
- setup(p, { emit: I }) {
197
- const a = p, m = I, i = F(() => re(a.locale)), d = $a(), { busy: s, error: o } = d, r = y([]), P = y([]), v = y([]), _ = y(), z = y(), x = y(), b = y([]), D = y(), R = y({ key: "name", direction: "asc" }), L = y(0), E = y([]), q = y(!1);
198
- let J = new AbortController();
199
- async function G() {
200
- const V = _.value;
201
- !V || V.isDir || !a.provider.download || await d.run(async (u) => (await a.provider.info(V.path, u), a.provider.download(V.path), !0));
196
+ setup(y, { emit: q }) {
197
+ const f = y, a = q, o = L(() => be(f.locale)), m = Ra(), { busy: i, error: n } = m, u = b([]), r = b([]), v = b([]), k = b(), D = b(), S = b(), c = b([]), w = b(), z = b({ key: "name", direction: "asc" }), M = b(0), N = b([]), K = b(!1);
198
+ let O = new AbortController();
199
+ async function Z() {
200
+ const C = k.value;
201
+ !C || C.isDir || !f.provider.download || await m.run(async (P) => (await f.provider.info(C.path, P), f.provider.download(C.path), !0));
202
202
  }
203
- async function K() {
204
- const V = v.value.at(-1)?.path, u = E.value[0];
205
- if (!V || !u || !a.provider.upload) return;
206
- q.value = !1, await d.run(async (c) => (await a.provider.upload(V, u, c), !0)) && (E.value = [], await se(v.value), q.value = !0);
203
+ async function ae() {
204
+ const C = v.value.at(-1)?.path, P = N.value[0];
205
+ if (!C || !P || !f.provider.upload) return;
206
+ K.value = !1, await m.run(async (p) => (await f.provider.upload(C, P, p), !0)) && (N.value = [], await re(v.value), K.value = !0);
207
207
  }
208
- const O = F(() => [
209
- { key: "name", label: i.value.nameColumn, sortable: !0 },
210
- { key: "kind", label: i.value.kindColumn },
211
- { key: "bytes", label: i.value.sizeColumn, align: "right", sortable: !0 }
212
- ]), H = la((V, { attrs: u }) => ta(Se, { ...u, kind: "folder" }));
213
- function W(V) {
214
- return { id: V.path, label: V.name, icon: H, data: V };
208
+ const W = L(() => [
209
+ { key: "name", label: o.value.nameColumn, sortable: !0 },
210
+ { key: "kind", label: o.value.kindColumn },
211
+ { key: "bytes", label: o.value.sizeColumn, align: "right", sortable: !0 }
212
+ ]), H = va((C, { attrs: P }) => ca(Ee, { ...P, kind: "folder" }));
213
+ function j(C) {
214
+ return { id: C.path, label: C.name, icon: H, data: C };
215
215
  }
216
- function j(V) {
217
- _.value = V, m("selected", V?.path);
216
+ function te(C) {
217
+ k.value = C, a("selected", C?.path);
218
218
  }
219
- function ee(V) {
220
- z.value = V.path, j(a.mode === "folder" ? V.isDir ? V : v.value.at(-1) : V.isDir ? void 0 : V);
219
+ function se(C) {
220
+ D.value = C.path, te(f.mode === "folder" ? C.isDir ? C : v.value.at(-1) : C.isDir ? void 0 : C);
221
221
  }
222
- function N(V) {
223
- V.isDir ? Ce(V) : ee(V);
222
+ function Q(C) {
223
+ C.isDir ? ve(C) : se(C);
224
224
  }
225
- const T = (V) => r.value.find((u) => u.path === V);
226
- function B(V, u, f = []) {
227
- for (const c of V) {
228
- const X = [...f, c.data];
229
- if (c.id === u) return X;
230
- const te = B(c.children ?? [], u, X);
231
- if (te) return te;
225
+ const Y = (C) => u.value.find((P) => P.path === C);
226
+ function G(C, P, I = []) {
227
+ for (const p of C) {
228
+ const B = [...I, p.data];
229
+ if (p.id === P) return B;
230
+ const _ = G(p.children ?? [], P, B);
231
+ if (_) return _;
232
232
  }
233
233
  }
234
- function w(V, u) {
235
- for (const f of V) {
236
- if (f.id === u) return f;
237
- const c = w(f.children ?? [], u);
238
- if (c) return c;
234
+ function le(C, P) {
235
+ for (const I of C) {
236
+ if (I.id === P) return I;
237
+ const p = le(I.children ?? [], P);
238
+ if (p) return p;
239
239
  }
240
240
  }
241
- function U(V, u, f) {
242
- return V.map((c) => c.id === u ? { ...c, children: f } : c.children ? { ...c, children: U(c.children, u, f) } : c);
241
+ function R(C, P, I) {
242
+ return C.map((p) => p.id === P ? { ...p, children: I } : p.children ? { ...p, children: R(p.children, P, I) } : p);
243
243
  }
244
- let M = 0;
245
- async function Y(V) {
246
- const u = ++M;
247
- for (const f of V.slice(0, -1)) {
248
- const c = w(P.value, f.path);
249
- if (!c) break;
250
- if (c.children === void 0) {
251
- const X = await ae(c);
252
- if (u !== M || !X) return;
253
- P.value = U(P.value, c.id, X);
244
+ let T = 0;
245
+ async function E(C) {
246
+ const P = ++T;
247
+ for (const I of C.slice(0, -1)) {
248
+ const p = le(r.value, I.path);
249
+ if (!p) break;
250
+ if (p.children === void 0) {
251
+ const B = await J(p);
252
+ if (P !== T || !B) return;
253
+ r.value = R(r.value, p.id, B);
254
254
  }
255
- b.value.includes(c.id) || (b.value = [...b.value, c.id]);
255
+ c.value.includes(p.id) || (c.value = [...c.value, p.id]);
256
256
  }
257
- D.value = V.at(-1)?.path;
257
+ w.value = C.at(-1)?.path;
258
258
  }
259
- async function ae(V) {
260
- const u = L.value, f = J.signal;
259
+ async function J(C) {
260
+ const P = M.value, I = O.signal;
261
261
  try {
262
- const c = [];
263
- let X = 0;
264
- for (; X !== void 0; ) {
265
- const te = await a.provider.list(V.id, { offset: X, sortBy: "name", sortDirection: "ASC" }, f);
266
- if (f.aborted || u !== L.value) return;
267
- c.push(...te.entries.filter((Ge) => Ge.isDir).map(W)), X = te.nextOffset;
262
+ const p = [];
263
+ let B = 0;
264
+ for (; B !== void 0; ) {
265
+ const _ = await f.provider.list(C.id, { offset: B, sortBy: "name", sortDirection: "ASC" }, I);
266
+ if (I.aborted || P !== M.value) return;
267
+ p.push(..._.entries.filter((ie) => ie.isDir).map(j)), B = _.nextOffset;
268
268
  }
269
- return c;
270
- } catch (c) {
271
- !f.aborted && u === L.value && (o.value = c, j());
269
+ return p;
270
+ } catch (p) {
271
+ !I.aborted && P === M.value && (n.value = p, te());
272
272
  return;
273
273
  }
274
274
  }
275
- async function se(V, u = !1) {
276
- if (s.value) return;
277
- j(), z.value = void 0, r.value = u ? r.value : [], x.value = u ? x.value : void 0;
278
- const f = u ? x.value ?? 0 : 0, c = V.at(-1)?.path;
279
- v.value = V;
280
- const X = await d.run((te) => c ? a.provider.list(c, { offset: f, sortBy: R.value.key, sortDirection: R.value.direction === "asc" ? "ASC" : "DESC" }, te) : a.provider.shares(f, te));
281
- X && (r.value = u ? [...r.value, ...X.entries] : X.entries, x.value = X.nextOffset, c ? a.mode === "folder" && !u && j(V.at(-1)) : P.value = r.value.filter((te) => te.isDir).map(W), u || Y(V));
275
+ async function re(C, P = !1) {
276
+ if (i.value) return;
277
+ te(), D.value = void 0, u.value = P ? u.value : [], S.value = P ? S.value : void 0;
278
+ const I = P ? S.value ?? 0 : 0, p = C.at(-1)?.path;
279
+ v.value = C;
280
+ const B = await m.run((_) => p ? f.provider.list(p, { offset: I, sortBy: z.value.key, sortDirection: z.value.direction === "asc" ? "ASC" : "DESC" }, _) : f.provider.shares(I, _));
281
+ B && (u.value = P ? [...u.value, ...B.entries] : B.entries, S.value = B.nextOffset, p ? f.mode === "folder" && !P && te(C.at(-1)) : r.value = u.value.filter((_) => _.isDir).map(j), P || E(C));
282
282
  }
283
- const ge = F(() => [{ id: "", display: i.value.roots }, ...v.value.map((V) => ({ id: V.path, display: V.name }))]);
284
- function we(V) {
285
- const u = ge.value.findIndex((f) => f.id === V.id);
286
- u < v.value.length && ye(v.value.slice(0, u));
283
+ const we = L(() => [{ id: "", display: o.value.roots }, ...v.value.map((C) => ({ id: C.path, display: C.name }))]);
284
+ function xe(C) {
285
+ const P = we.value.findIndex((I) => I.id === C.id);
286
+ P < v.value.length && me(v.value.slice(0, P));
287
287
  }
288
- function Ce(V) {
289
- ye([...v.value, V]);
288
+ function ve(C) {
289
+ me([...v.value, C]);
290
290
  }
291
- const fe = y([[]]), ie = y(0);
292
- function ye(V) {
293
- s.value || (V.at(-1)?.path !== v.value.at(-1)?.path && (fe.value = [...fe.value.slice(0, ie.value + 1), V], ie.value++), se(V));
291
+ const ce = b([[]]), de = b(0);
292
+ function me(C) {
293
+ i.value || (C.at(-1)?.path !== v.value.at(-1)?.path && (ce.value = [...ce.value.slice(0, de.value + 1), C], de.value++), re(C));
294
294
  }
295
- function he(V) {
296
- s.value || (ie.value += V, se(fe.value[ie.value]));
295
+ function F(C) {
296
+ i.value || (de.value += C, re(ce.value[de.value]));
297
297
  }
298
- function $e(V) {
299
- R.value = { key: V?.key === "bytes" ? "size" : "name", direction: V?.direction ?? "asc" }, se(v.value);
298
+ function ee(C) {
299
+ z.value = { key: C?.key === "bytes" ? "size" : "name", direction: C?.direction ?? "asc" }, re(v.value);
300
300
  }
301
- function xe() {
302
- s.value || (L.value++, J.abort(), J = new AbortController(), P.value = [], b.value = [], D.value = void 0, fe.value = [[]], ie.value = 0, se([]));
301
+ function A() {
302
+ i.value || (M.value++, O.abort(), O = new AbortController(), r.value = [], c.value = [], w.value = void 0, ce.value = [[]], de.value = 0, re([]));
303
303
  }
304
- return ve(() => {
305
- se([]);
306
- }), ue(() => {
307
- L.value++, J.abort();
308
- }), (V, u) => (t(), S("section", {
304
+ return ge(() => {
305
+ re([]);
306
+ }), ye(() => {
307
+ M.value++, O.abort();
308
+ }), (C, P) => (s(), V("section", {
309
309
  class: "file-browser",
310
- "aria-busy": e(s),
311
- "aria-label": i.value.title
310
+ "aria-busy": e(i),
311
+ "aria-label": o.value.title
312
312
  }, [
313
- C("div", Pa, [
314
- h(e(ze), {
315
- label: i.value.back,
313
+ $("div", Oa, [
314
+ d(e(Ue), {
315
+ label: o.value.back,
316
316
  size: "sm",
317
- disabled: e(s) || ie.value === 0,
318
- onClick: u[0] || (u[0] = (f) => he(-1))
317
+ disabled: e(i) || de.value === 0,
318
+ onClick: P[0] || (P[0] = (I) => F(-1))
319
319
  }, {
320
- default: n(() => [
321
- h(e(ka), {
320
+ default: l(() => [
321
+ d(e(Ia), {
322
322
  size: 16,
323
323
  "aria-hidden": "true"
324
324
  })
325
325
  ]),
326
326
  _: 1
327
327
  }, 8, ["label", "disabled"]),
328
- h(e(ze), {
329
- label: i.value.forward,
328
+ d(e(Ue), {
329
+ label: o.value.forward,
330
330
  size: "sm",
331
- disabled: e(s) || ie.value === fe.value.length - 1,
332
- onClick: u[1] || (u[1] = (f) => he(1))
331
+ disabled: e(i) || de.value === ce.value.length - 1,
332
+ onClick: P[1] || (P[1] = (I) => F(1))
333
333
  }, {
334
- default: n(() => [
335
- h(e(ga), {
334
+ default: l(() => [
335
+ d(e(Ta), {
336
336
  size: 16,
337
337
  "aria-hidden": "true"
338
338
  })
339
339
  ]),
340
340
  _: 1
341
341
  }, 8, ["label", "disabled"]),
342
- h(e(ze), {
343
- label: i.value.refresh,
342
+ d(e(Ue), {
343
+ label: o.value.refresh,
344
344
  size: "sm",
345
- disabled: e(s),
346
- onClick: xe
345
+ disabled: e(i),
346
+ onClick: A
347
347
  }, {
348
- default: n(() => [
349
- h(e(ha), {
348
+ default: l(() => [
349
+ d(e(Ea), {
350
350
  size: 14,
351
351
  "aria-hidden": "true"
352
352
  })
353
353
  ]),
354
354
  _: 1
355
355
  }, 8, ["label", "disabled"]),
356
- C("nav", {
356
+ $("nav", {
357
357
  class: "file-path",
358
- "aria-label": i.value.location
358
+ "aria-label": o.value.location
359
359
  }, [
360
- h(e(da), {
361
- items: ge.value,
362
- "collapsed-label": i.value.fullPath,
363
- onClickItem: we
360
+ d(e(ha), {
361
+ items: we.value,
362
+ "collapsed-label": o.value.fullPath,
363
+ onClickItem: xe
364
364
  }, null, 8, ["items", "collapsed-label"])
365
- ], 8, Va)
365
+ ], 8, La)
366
366
  ]),
367
- p.transfers && p.provider.upload && v.value.length ? (t(), S("div", Ia, [
368
- h(e(va), {
369
- modelValue: E.value,
370
- "onUpdate:modelValue": u[2] || (u[2] = (f) => E.value = f),
367
+ y.transfers && y.provider.upload && v.value.length ? (s(), V("div", Na, [
368
+ d(e(ka), {
369
+ modelValue: N.value,
370
+ "onUpdate:modelValue": P[2] || (P[2] = (I) => N.value = I),
371
371
  variant: "compact",
372
- disabled: e(s),
372
+ disabled: e(i),
373
373
  "max-files": 1,
374
374
  "max-size": 16 * 1024 ** 3,
375
- title: i.value.upload,
376
- onRejected: u[3] || (u[3] = (f) => o.value = { code: "upload_size_required" })
375
+ title: o.value.upload,
376
+ onRejected: P[3] || (P[3] = (I) => n.value = { code: "upload_size_required" })
377
377
  }, null, 8, ["modelValue", "disabled", "title"]),
378
- h(e(A), {
378
+ d(e(U), {
379
379
  variant: "primary",
380
- disabled: e(s) || !E.value.length,
381
- onClick: K
380
+ disabled: e(i) || !N.value.length,
381
+ onClick: ae
382
382
  }, {
383
- default: n(() => [
384
- g(l(i.value.upload), 1)
383
+ default: l(() => [
384
+ g(t(o.value.upload), 1)
385
385
  ]),
386
386
  _: 1
387
387
  }, 8, ["disabled"])
388
- ])) : k("", !0),
389
- q.value ? (t(), S("p", Ua, l(i.value.uploaded), 1)) : k("", !0),
390
- p.transfers && p.provider.download && _.value && !_.value.isDir && !e(o) ? (t(), $(e(A), {
388
+ ])) : h("", !0),
389
+ K.value ? (s(), V("p", Ma, t(o.value.uploaded), 1)) : h("", !0),
390
+ y.transfers && y.provider.download && k.value && !k.value.isDir && !e(n) ? (s(), x(e(U), {
391
391
  key: 2,
392
392
  variant: "secondary",
393
- disabled: e(s),
394
- onClick: G
393
+ disabled: e(i),
394
+ onClick: Z
395
395
  }, {
396
- default: n(() => [
397
- g(l(i.value.download), 1)
396
+ default: l(() => [
397
+ g(t(o.value.download), 1)
398
398
  ]),
399
399
  _: 1
400
- }, 8, ["disabled"])) : k("", !0),
401
- e(o) ? (t(), $(e(Q), {
400
+ }, 8, ["disabled"])) : h("", !0),
401
+ e(n) ? (s(), x(e(X), {
402
402
  key: 3,
403
403
  tone: "danger"
404
404
  }, {
405
- default: n(() => [
406
- C("span", Aa, l(e(Ee)(e(o), i.value)), 1)
405
+ default: l(() => [
406
+ $("span", Ka, t(e(Le)(e(n), o.value)), 1)
407
407
  ]),
408
408
  _: 1
409
- })) : k("", !0),
410
- e(s) ? (t(), S("p", Da, l(i.value.loading), 1)) : k("", !0),
411
- C("div", Ta, [
412
- C("aside", {
409
+ })) : h("", !0),
410
+ e(i) ? (s(), V("p", Ha, t(o.value.loading), 1)) : h("", !0),
411
+ $("div", Ga, [
412
+ $("aside", {
413
413
  class: "file-tree",
414
- "aria-label": i.value.roots
414
+ "aria-label": o.value.roots
415
415
  }, [
416
- P.value.length ? (t(), $(e(ca), {
417
- key: L.value,
416
+ r.value.length ? (s(), x(e(_a), {
417
+ key: M.value,
418
418
  "selection-style": "background",
419
- modelValue: D.value,
420
- "onUpdate:modelValue": u[4] || (u[4] = (f) => D.value = f),
421
- nodes: P.value,
422
- "onUpdate:nodes": u[5] || (u[5] = (f) => P.value = f),
423
- expanded: b.value,
424
- "onUpdate:expanded": u[6] || (u[6] = (f) => b.value = f),
425
- "load-children": ae,
426
- "expand-label": (f, c) => e(Pe)(c ? i.value.collapse : i.value.expand, { name: f.label }),
427
- onSelect: u[7] || (u[7] = (f) => ye(B(P.value, f.id) ?? [f.data]))
428
- }, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : k("", !0)
429
- ], 8, Ea),
430
- C("div", Ra, [
431
- e(o) ? k("", !0) : (t(), $(e(fa), {
419
+ modelValue: w.value,
420
+ "onUpdate:modelValue": P[4] || (P[4] = (I) => w.value = I),
421
+ nodes: r.value,
422
+ "onUpdate:nodes": P[5] || (P[5] = (I) => r.value = I),
423
+ expanded: c.value,
424
+ "onUpdate:expanded": P[6] || (P[6] = (I) => c.value = I),
425
+ "load-children": J,
426
+ "expand-label": (I, p) => e(Ae)(p ? o.value.collapse : o.value.expand, { name: I.label }),
427
+ onSelect: P[7] || (P[7] = (I) => me(G(r.value, I.id) ?? [I.data]))
428
+ }, null, 8, ["modelValue", "nodes", "expanded", "expand-label"])) : h("", !0)
429
+ ], 8, Ja),
430
+ $("div", Xa, [
431
+ e(n) ? h("", !0) : (s(), x(e(wa), {
432
432
  key: 0,
433
- columns: O.value,
434
- rows: r.value.map((f) => ({ ...f, kind: f.isDir ? i.value.directoryKind : i.value.fileKind })),
433
+ columns: W.value,
434
+ rows: u.value.map((I) => ({ ...I, kind: I.isDir ? o.value.directoryKind : o.value.fileKind })),
435
435
  "row-key": "path",
436
436
  footer: !1,
437
437
  resizable: !1,
438
438
  "local-sort": !1,
439
439
  "local-pagination": !1,
440
- loading: e(s),
441
- "loading-text": i.value.loading,
442
- sort: { key: R.value.key === "size" ? "bytes" : R.value.key, direction: R.value.direction },
443
- labels: { empty: i.value.emptyFolder },
440
+ loading: e(i),
441
+ "loading-text": o.value.loading,
442
+ sort: { key: z.value.key === "size" ? "bytes" : z.value.key, direction: z.value.direction },
443
+ labels: { empty: o.value.emptyFolder },
444
444
  "single-select": "",
445
- "selected-keys": z.value ? [z.value] : [],
446
- "onUpdate:sort": $e,
447
- "onUpdate:selectedKeys": u[8] || (u[8] = (f) => {
448
- e(s) || ee(T(f[0]));
445
+ "selected-keys": D.value ? [D.value] : [],
446
+ "onUpdate:sort": ee,
447
+ "onUpdate:selectedKeys": P[8] || (P[8] = (I) => {
448
+ e(i) || se(Y(I[0]));
449
449
  }),
450
- onRowActivate: u[9] || (u[9] = (f) => {
451
- e(s) || N(T(f.path));
450
+ onRowActivate: P[9] || (P[9] = (I) => {
451
+ e(i) || Q(Y(I.path));
452
452
  }),
453
- onRowDblclick: u[10] || (u[10] = (f) => {
454
- e(s) || N(T(f.path));
453
+ onRowDblclick: P[10] || (P[10] = (I) => {
454
+ e(i) || Q(Y(I.path));
455
455
  })
456
456
  }, {
457
- "cell-name": n(({ row: f }) => [
458
- C("span", qa, [
459
- h(e(Se), {
460
- kind: f.isDir ? "folder" : "file",
461
- name: f.name
457
+ "cell-name": l(({ row: I }) => [
458
+ $("span", Qa, [
459
+ d(e(Ee), {
460
+ kind: I.isDir ? "folder" : "file",
461
+ name: I.name
462
462
  }, null, 8, ["kind", "name"]),
463
- g(l(f.name), 1)
463
+ g(t(I.name), 1)
464
464
  ])
465
465
  ]),
466
- empty: n(() => [
467
- C("div", Ba, [
468
- h(e(Se), {
466
+ empty: l(() => [
467
+ $("div", Ya, [
468
+ d(e(Ee), {
469
469
  kind: "folder",
470
470
  size: [40, 40]
471
471
  }),
472
- C("span", null, l(i.value.emptyFolder), 1)
472
+ $("span", null, t(o.value.emptyFolder), 1)
473
473
  ])
474
474
  ]),
475
- "cell-bytes": n(({ row: f }) => [
476
- C("span", Oa, l(f.isDir || f.bytes === void 0 ? "—" : e(Ue)(f.bytes, e(Xe)(p.locale))), 1)
475
+ "cell-bytes": l(({ row: I }) => [
476
+ $("span", Za, t(I.isDir || I.bytes === void 0 ? "—" : e(Re)(I.bytes, e(ta)(y.locale))), 1)
477
477
  ]),
478
478
  _: 1
479
479
  }, 8, ["columns", "rows", "loading", "loading-text", "sort", "labels", "selected-keys"])),
480
- x.value !== void 0 && !e(o) ? (t(), $(e(A), {
480
+ S.value !== void 0 && !e(n) ? (s(), x(e(U), {
481
481
  key: 1,
482
482
  variant: "secondary",
483
- disabled: e(s),
484
- onClick: u[11] || (u[11] = (f) => se(v.value, !0))
483
+ disabled: e(i),
484
+ onClick: P[11] || (P[11] = (I) => re(v.value, !0))
485
485
  }, {
486
- default: n(() => [
487
- g(l(i.value.loadMore), 1)
486
+ default: l(() => [
487
+ g(t(o.value.loadMore), 1)
488
488
  ]),
489
489
  _: 1
490
- }, 8, ["disabled"])) : k("", !0)
490
+ }, 8, ["disabled"])) : h("", !0)
491
491
  ])
492
492
  ]),
493
- _.value && !e(o) ? (t(), S("p", Fa, l(e(Pe)(i.value.selected, { name: _.value.path })), 1)) : k("", !0)
494
- ], 8, za));
493
+ k.value && !e(n) ? (s(), V("p", Wa, t(e(Ae)(o.value.selected, { name: k.value.path })), 1)) : h("", !0)
494
+ ], 8, Fa));
495
495
  }
496
- }), Ke = /* @__PURE__ */ ne(La, [["__scopeId", "data-v-c689761c"]]), Na = {
496
+ }), je = /* @__PURE__ */ ue(ja, [["__scopeId", "data-v-c689761c"]]), et = {
497
497
  key: 0,
498
498
  class: "save-consent"
499
- }, Ma = ["aria-busy", "inert"], Ka = /* @__PURE__ */ le({
499
+ }, at = ["aria-busy", "inert"], tt = /* @__PURE__ */ oe({
500
500
  __name: "NasPicker",
501
501
  props: {
502
502
  open: { type: Boolean },
@@ -505,537 +505,565 @@ const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-locatio
505
505
  mode: {},
506
506
  title: {},
507
507
  description: {},
508
- destination: {}
508
+ destination: {},
509
+ errorText: { type: Function }
509
510
  },
510
- emits: ["update:open", "selected", "authorized"],
511
- setup(p, { emit: I }) {
512
- const a = p, m = I, i = y(), d = F(() => re(a.locale)), s = F(() => Re(a.locale)), o = y(!1), r = y();
513
- let P = 0, v = !1;
514
- Fe(() => a.open, () => {
515
- P++, i.value = void 0, r.value = void 0;
516
- }), ue(() => {
517
- v = !0, P++;
511
+ emits: ["update:open", "selected", "authorized", "refused"],
512
+ setup(y, { emit: q }) {
513
+ const f = y, a = q, o = b(), m = L(() => be(f.locale)), i = L(() => Ne(f.locale)), n = b(!1), u = b();
514
+ let r = 0, v = !1;
515
+ Je(() => f.open, () => {
516
+ r++, o.value = void 0, u.value = void 0;
517
+ }), ye(() => {
518
+ v = !0, r++;
518
519
  });
519
- function _() {
520
- o.value || (i.value = void 0, m("update:open", !1));
520
+ function k() {
521
+ n.value || (o.value = void 0, a("update:open", !1));
521
522
  }
522
- async function z() {
523
- const x = i.value, b = a.destination, D = P;
524
- if (!(!x || o.value || !a.open || v || b && a.mode !== "folder")) {
525
- if (!b) {
526
- m("selected", x), _();
523
+ async function D() {
524
+ const S = o.value, c = f.destination, w = r;
525
+ if (!(!S || n.value || !f.open || v || c && f.mode !== "folder")) {
526
+ if (!c) {
527
+ a("selected", S), k();
527
528
  return;
528
529
  }
529
- o.value = !0, r.value = void 0;
530
+ n.value = !0, u.value = void 0;
530
531
  try {
531
- const R = await b.selectDestination({ key: b.key, path: x });
532
- if (v || D !== P) return;
533
- if (!R || typeof R.id != "string" || !R.id || typeof R.username != "string" || !R.username || R.path !== x || R.key !== b.key || R.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
534
- m("authorized", R), o.value = !1, _();
535
- } catch (R) {
536
- !v && D === P && (r.value = R);
532
+ const z = await c.selectDestination({ key: c.key, path: S });
533
+ if (v || w !== r) return;
534
+ if (!z || typeof z.id != "string" || !z.id || typeof z.username != "string" || !z.username || z.path !== S || z.key !== c.key || z.lifetime !== "until-revoked") throw { code: "commit-uncertain" };
535
+ a("authorized", z), n.value = !1, k();
536
+ } catch (z) {
537
+ if (v || w !== r) return;
538
+ if (z?.code === "APP_DENIED") {
539
+ n.value = !1, a("refused", z), k();
540
+ return;
541
+ }
542
+ u.value = z;
537
543
  } finally {
538
- v || (o.value = !1);
544
+ v || (n.value = !1);
539
545
  }
540
546
  }
541
547
  }
542
- return (x, b) => (t(), $(e(Ae), {
543
- open: p.open,
544
- title: p.title ?? (p.mode === "folder" ? d.value.choose : d.value.chooseFile),
545
- description: p.description ?? d.value.ownPermissions,
546
- "close-label": d.value.close,
547
- "show-close": !o.value,
548
+ return (S, c) => (s(), x(e(qe), {
549
+ open: y.open,
550
+ title: y.title ?? (y.mode === "folder" ? m.value.choose : m.value.chooseFile),
551
+ description: y.description ?? m.value.ownPermissions,
552
+ "close-label": m.value.close,
553
+ "show-close": !n.value,
548
554
  width: "800px",
549
- onEscapeKeyDown: b[1] || (b[1] = (D) => {
550
- o.value && D.preventDefault();
555
+ onEscapeKeyDown: c[1] || (c[1] = (w) => {
556
+ n.value && w.preventDefault();
551
557
  }),
552
- onInteractOutside: b[2] || (b[2] = (D) => {
553
- o.value && D.preventDefault();
558
+ onInteractOutside: c[2] || (c[2] = (w) => {
559
+ n.value && w.preventDefault();
554
560
  }),
555
- "onUpdate:open": b[3] || (b[3] = (D) => {
556
- D || _();
561
+ "onUpdate:open": c[3] || (c[3] = (w) => {
562
+ w || k();
557
563
  })
558
564
  }, {
559
- footer: n(() => [
560
- h(e(A), {
565
+ footer: l(() => [
566
+ d(e(U), {
561
567
  variant: "secondary",
562
- disabled: o.value,
563
- onClick: _
568
+ disabled: n.value,
569
+ onClick: k
564
570
  }, {
565
- default: n(() => [
566
- g(l(d.value.cancel), 1)
571
+ default: l(() => [
572
+ g(t(m.value.cancel), 1)
567
573
  ]),
568
574
  _: 1
569
575
  }, 8, ["disabled"]),
570
- h(e(A), {
576
+ d(e(U), {
571
577
  variant: "primary",
572
- disabled: !i.value || o.value || !!p.destination && p.mode !== "folder",
573
- onClick: z
578
+ disabled: !o.value || n.value || !!y.destination && y.mode !== "folder",
579
+ onClick: D
574
580
  }, {
575
- default: n(() => [
576
- g(l(d.value.confirm), 1)
581
+ default: l(() => [
582
+ g(t(m.value.confirm), 1)
577
583
  ]),
578
584
  _: 1
579
585
  }, 8, ["disabled"])
580
586
  ]),
581
- default: n(() => [
582
- p.destination ? (t(), S("p", Na, l(s.value.selection), 1)) : k("", !0),
583
- r.value ? (t(), $(e(Q), {
587
+ default: l(() => [
588
+ y.destination ? (s(), V("p", et, t(i.value.selection), 1)) : h("", !0),
589
+ u.value ? (s(), x(e(X), {
584
590
  key: 1,
585
591
  tone: "danger",
586
592
  role: "alert",
587
593
  class: "save-message"
588
594
  }, {
589
- default: n(() => [
590
- g(l(e(Ve)(r.value, s.value)), 1)
595
+ default: l(() => [
596
+ g(t(y.errorText?.(u.value) ?? e(Ie)(u.value, i.value, "select")), 1)
591
597
  ]),
592
598
  _: 1
593
- })) : k("", !0),
594
- C("div", {
599
+ })) : h("", !0),
600
+ $("div", {
595
601
  class: "nas-picker-content",
596
- "aria-busy": o.value,
597
- inert: o.value
602
+ "aria-busy": n.value,
603
+ inert: n.value
598
604
  }, [
599
- p.open ? (t(), $(Ke, {
605
+ y.open ? (s(), x(je, {
600
606
  key: 0,
601
- provider: p.provider,
602
- locale: p.locale,
603
- mode: p.mode,
604
- onSelected: b[0] || (b[0] = (D) => i.value = D)
605
- }, null, 8, ["provider", "locale", "mode"])) : k("", !0)
606
- ], 8, Ma)
607
+ provider: y.provider,
608
+ locale: y.locale,
609
+ mode: y.mode,
610
+ onSelected: c[0] || (c[0] = (w) => o.value = w)
611
+ }, null, 8, ["provider", "locale", "mode"])) : h("", !0)
612
+ ], 8, at)
607
613
  ]),
608
614
  _: 1
609
615
  }, 8, ["open", "title", "description", "close-label", "show-close"]));
610
616
  }
611
- }), _e = /* @__PURE__ */ ne(Ka, [["__scopeId", "data-v-535a0e54"]]), Ha = { role: "alert" }, Ga = { class: "files-actions" }, Ja = {
617
+ }), Te = /* @__PURE__ */ ue(tt, [["__scopeId", "data-v-6ed8b8f6"]]), lt = { role: "alert" }, st = { class: "files-actions" }, nt = {
612
618
  key: 0,
613
619
  class: "files-path",
614
620
  role: "status"
615
- }, Xa = /* @__PURE__ */ le({
621
+ }, it = /* @__PURE__ */ oe({
616
622
  __name: "FilesPage",
617
623
  props: {
618
624
  ctx: {}
619
625
  },
620
- setup(p) {
621
- const I = p, a = y(), m = y(!1), i = y("folder"), d = y(!1), s = y(""), o = y(0), r = qe(I.ctx);
622
- let P = !1, v;
623
- async function _() {
624
- if (!P) {
625
- a.value = void 0, m.value = !1, s.value = "", d.value = !1, o.value++;
626
+ setup(y) {
627
+ const q = y, f = b(), a = b(!1), o = b("folder"), m = b(!1), i = b(""), n = b(0), u = Me(q.ctx);
628
+ let r = !1, v;
629
+ async function k() {
630
+ if (!r) {
631
+ f.value = void 0, a.value = !1, i.value = "", m.value = !1, n.value++;
626
632
  try {
627
- await I.ctx.call("nas.session.status"), P || (m.value = !0);
628
- } catch (z) {
629
- !P && z?.code !== "unknown_method" && (a.value = z);
633
+ await q.ctx.call("nas.session.status"), r || (a.value = !0);
634
+ } catch (D) {
635
+ !r && D?.code !== "unknown_method" && (f.value = D);
630
636
  }
631
637
  }
632
638
  }
633
- return ve(() => {
634
- v = I.ctx.reopen(() => {
635
- _();
636
- }), _();
637
- }), ue(() => {
638
- P = !0, v?.(), r.dispose();
639
- }), (z, x) => (t(), S(Z, null, [
640
- a.value ? (t(), $(e(Q), {
639
+ return ge(() => {
640
+ v = q.ctx.reopen(() => {
641
+ k();
642
+ }), k();
643
+ }), ye(() => {
644
+ r = !0, v?.(), u.dispose();
645
+ }), (D, S) => (s(), V(ne, null, [
646
+ f.value ? (s(), x(e(X), {
641
647
  key: 0,
642
648
  tone: "danger"
643
649
  }, {
644
- default: n(() => [
645
- C("span", Ha, l(e(Ee)(a.value, e(re)(p.ctx.locale))), 1),
646
- h(e(A), {
650
+ default: l(() => [
651
+ $("span", lt, t(e(Le)(f.value, e(be)(y.ctx.locale))), 1),
652
+ d(e(U), {
647
653
  variant: "secondary",
648
- onClick: _
654
+ onClick: k
649
655
  }, {
650
- default: n(() => [
651
- g(l(e(re)(p.ctx.locale).refresh), 1)
656
+ default: l(() => [
657
+ g(t(e(be)(y.ctx.locale).refresh), 1)
652
658
  ]),
653
659
  _: 1
654
660
  })
655
661
  ]),
656
662
  _: 1
657
- })) : k("", !0),
658
- m.value ? (t(), $(e(ce), {
663
+ })) : h("", !0),
664
+ a.value ? (s(), x(e(he), {
659
665
  key: 1,
660
- title: e(re)(p.ctx.locale).title,
666
+ title: e(be)(y.ctx.locale).title,
667
+ description: e(be)(y.ctx.locale).ownPermissions,
661
668
  collapsible: !1
662
669
  }, {
663
- default: n(() => [
664
- C("p", null, l(e(re)(p.ctx.locale).ownPermissions), 1),
665
- C("div", Ga, [
666
- h(e(A), {
670
+ default: l(() => [
671
+ $("div", st, [
672
+ d(e(U), {
667
673
  variant: "secondary",
668
- onClick: x[0] || (x[0] = (b) => {
669
- i.value = "folder", d.value = !0;
674
+ onClick: S[0] || (S[0] = (c) => {
675
+ o.value = "folder", m.value = !0;
670
676
  })
671
677
  }, {
672
- default: n(() => [
673
- g(l(e(re)(p.ctx.locale).choose), 1)
678
+ default: l(() => [
679
+ g(t(e(be)(y.ctx.locale).choose), 1)
674
680
  ]),
675
681
  _: 1
676
682
  }),
677
- h(e(A), {
683
+ d(e(U), {
678
684
  variant: "secondary",
679
- onClick: x[1] || (x[1] = (b) => {
680
- i.value = "file", d.value = !0;
685
+ onClick: S[1] || (S[1] = (c) => {
686
+ o.value = "file", m.value = !0;
681
687
  })
682
688
  }, {
683
- default: n(() => [
684
- g(l(e(re)(p.ctx.locale).chooseFile), 1)
689
+ default: l(() => [
690
+ g(t(e(be)(y.ctx.locale).chooseFile), 1)
685
691
  ]),
686
692
  _: 1
687
693
  })
688
694
  ]),
689
- s.value ? (t(), S("p", Ja, l(s.value), 1)) : k("", !0),
690
- (t(), $(Ke, {
691
- key: o.value,
692
- provider: e(r),
693
- locale: p.ctx.locale,
695
+ i.value ? (s(), V("p", nt, [
696
+ d(e(pe), { path: i.value }, null, 8, ["path"])
697
+ ])) : h("", !0),
698
+ (s(), x(je, {
699
+ key: n.value,
700
+ provider: e(u),
701
+ locale: y.ctx.locale,
694
702
  transfers: ""
695
703
  }, null, 8, ["provider", "locale"])),
696
- h(_e, {
697
- provider: e(r),
698
- locale: p.ctx.locale,
699
- mode: i.value,
700
- open: d.value,
701
- "onUpdate:open": x[2] || (x[2] = (b) => d.value = b),
702
- onSelected: x[3] || (x[3] = (b) => s.value = b)
704
+ d(Te, {
705
+ provider: e(u),
706
+ locale: y.ctx.locale,
707
+ mode: o.value,
708
+ open: m.value,
709
+ "onUpdate:open": S[2] || (S[2] = (c) => m.value = c),
710
+ onSelected: S[3] || (S[3] = (c) => i.value = c)
703
711
  }, null, 8, ["provider", "locale", "mode", "open"])
704
712
  ]),
705
713
  _: 1
706
- }, 8, ["title"])) : k("", !0)
714
+ }, 8, ["title", "description"])) : h("", !0)
707
715
  ], 64));
708
716
  }
709
- }), zt = /* @__PURE__ */ ne(Xa, [["__scopeId", "data-v-699931fa"]]), Qa = { key: 0 }, Ya = { key: 0 }, Wa = { key: 4 }, Za = { role: "alert" }, ja = 5e3, Pt = /* @__PURE__ */ le({
717
+ }), Hl = /* @__PURE__ */ ue(it, [["__scopeId", "data-v-15f9eb8e"]]), ot = { key: 0 }, ut = { key: 1 }, rt = { key: 0 }, dt = { key: 3 }, vt = { role: "alert" }, ct = 5e3, pt = /* @__PURE__ */ oe({
710
718
  __name: "PortalSettings",
711
719
  props: {
712
720
  portal: {}
713
721
  },
714
- setup(p) {
715
- const I = p, a = I.portal.messages, m = y(), i = y(""), d = y(!1), s = y("");
716
- let o = !1;
717
- function r(_) {
718
- o || (m.value = _, i.value = _.alias || _.defaultAlias);
722
+ setup(y) {
723
+ const q = y, f = We(), a = q.portal.messages, o = b(), m = b(""), i = b(!1), n = b("");
724
+ let u = !1;
725
+ function r(S) {
726
+ u || (o.value = S, m.value = S.alias || S.defaultAlias);
719
727
  }
720
- const P = /* @__PURE__ */ Symbol("late");
721
- async function v(_) {
722
- if (d.value) return;
723
- d.value = !0, s.value = "";
724
- const z = _();
728
+ const v = /* @__PURE__ */ Symbol("late");
729
+ async function k(S) {
730
+ if (i.value) return;
731
+ i.value = !0, n.value = "";
732
+ const c = S();
725
733
  try {
726
- const x = await Promise.race([z, new Promise((b) => setTimeout(() => b(P), ja))]);
727
- if (x !== P) {
728
- r(x);
734
+ const w = await Promise.race([c, new Promise((z) => setTimeout(() => z(v), ct))]);
735
+ if (w !== v) {
736
+ r(w);
729
737
  return;
730
738
  }
731
- z.then(r, () => {
732
- }), r(await I.portal.status());
733
- } catch (x) {
734
- o || (s.value = a[x?.code || ""] || a.portal_unavailable);
739
+ r(await q.portal.status());
740
+ try {
741
+ await c;
742
+ } finally {
743
+ r(await q.portal.status());
744
+ }
745
+ } catch (w) {
746
+ u || (n.value = a[w?.code || ""] || a.portal_unavailable);
735
747
  } finally {
736
- o || (d.value = !1);
748
+ u || (i.value = !1);
737
749
  }
738
750
  }
739
- return ve(() => {
740
- I.portal.status().then(r);
741
- }), ue(() => {
742
- o = !0;
743
- }), (_, z) => m.value ? (t(), $(e(ce), {
751
+ function D() {
752
+ i.value || q.portal.status().then(r, () => {
753
+ });
754
+ }
755
+ return ge(() => {
756
+ f.subscribe?.(D), D();
757
+ }), ye(() => {
758
+ u = !0;
759
+ }), (S, c) => o.value ? (s(), x(e(he), {
744
760
  key: 0,
745
761
  title: e(a).title,
746
762
  collapsible: !1,
747
- "aria-busy": d.value
748
- }, {
749
- default: n(() => [
750
- m.value.state === "active" ? (t(), S("p", Qa, [
751
- g(l(e(a).link) + " ", 1),
752
- h(e(Ne), {
753
- href: m.value.url,
763
+ "aria-busy": i.value
764
+ }, Xe({
765
+ default: l(() => [
766
+ o.value.state === "active" ? (s(), V("p", ot, [
767
+ g(t(e(a).link) + " ", 1),
768
+ d(e(Ye), {
769
+ href: o.value.url,
754
770
  external: ""
755
771
  }, {
756
- default: n(() => [
757
- g(l(m.value.url), 1)
772
+ default: l(() => [
773
+ g(t(o.value.url), 1)
758
774
  ]),
759
775
  _: 1
760
776
  }, 8, ["href"])
761
- ])) : k("", !0),
762
- m.value.canManage && m.value.entry && m.value.entry !== "registered" ? (t(), S(Z, { key: 1 }, [
763
- C("p", null, l(m.value.entry === "unregistered" ? e(a).entryOff : e(a).cleanupRequired), 1),
764
- m.value.entry === "unregistered" ? (t(), $(e(A), {
765
- key: 0,
766
- variant: "primary",
767
- disabled: d.value,
768
- onClick: z[0] || (z[0] = (x) => v(() => p.portal.register()))
777
+ ])) : h("", !0),
778
+ o.value.canManage && o.value.entry && o.value.entry !== "registered" ? (s(), V("p", ut, t(o.value.entry === "unregistered" ? e(a).entryOff : e(a).cleanupRequired), 1)) : o.value.canManage ? (s(), V(ne, { key: 2 }, [
779
+ o.value.state !== "active" ? (s(), V("p", rt, t(e(a).inactive), 1)) : h("", !0),
780
+ d(e(ze), {
781
+ direction: "vertical",
782
+ class: "portal-form",
783
+ onSubmit: c[4] || (c[4] = Se((w) => k(() => y.portal.apply(m.value)), ["prevent"]))
769
784
  }, {
770
- default: n(() => [
771
- g(l(e(a).register), 1)
772
- ]),
773
- _: 1
774
- }, 8, ["disabled"])) : (t(), $(e(A), {
775
- key: 1,
776
- variant: "primary",
777
- disabled: d.value,
778
- onClick: z[1] || (z[1] = (x) => v(() => p.portal.unregister()))
779
- }, {
780
- default: n(() => [
781
- g(l(e(a).unregister), 1)
782
- ]),
783
- _: 1
784
- }, 8, ["disabled"]))
785
- ], 64)) : m.value.canManage ? (t(), S(Z, { key: 2 }, [
786
- m.value.state !== "active" ? (t(), S("p", Ya, l(e(a).inactive), 1)) : k("", !0),
787
- h(e(be), {
788
- onSubmit: z[4] || (z[4] = me((x) => v(() => p.portal.apply(i.value)), ["prevent"]))
789
- }, {
790
- default: n(() => [
791
- h(e(oe), {
785
+ default: l(() => [
786
+ d(e(fe), {
792
787
  label: e(a).alias,
793
788
  "label-for": "portal-alias"
794
789
  }, {
795
- default: n(() => [
796
- h(e(pe), {
790
+ default: l(() => [
791
+ d(e(_e), {
797
792
  id: "portal-alias",
798
- modelValue: i.value,
799
- "onUpdate:modelValue": z[2] || (z[2] = (x) => i.value = x),
793
+ modelValue: m.value,
794
+ "onUpdate:modelValue": c[0] || (c[0] = (w) => m.value = w),
800
795
  maxlength: "64",
801
796
  autocomplete: "off",
802
- disabled: d.value
797
+ disabled: i.value
803
798
  }, null, 8, ["modelValue", "disabled"])
804
799
  ]),
805
800
  _: 1
806
801
  }, 8, ["label"]),
807
- h(e(ke), null, {
808
- default: n(() => [
809
- h(e(A), {
802
+ d(e(Pe), null, {
803
+ default: l(() => [
804
+ d(e(U), {
810
805
  type: "submit",
811
806
  variant: "primary",
812
- disabled: d.value
807
+ disabled: i.value
813
808
  }, {
814
- default: n(() => [
815
- g(l(e(a).apply), 1)
809
+ default: l(() => [
810
+ g(t(e(a).apply), 1)
816
811
  ]),
817
812
  _: 1
818
813
  }, 8, ["disabled"]),
819
- m.value.state === "active" ? (t(), $(e(A), {
814
+ o.value.state === "active" ? (s(), x(e(U), {
820
815
  key: 0,
821
816
  variant: "secondary",
822
- disabled: d.value,
823
- onClick: z[3] || (z[3] = (x) => v(() => p.portal.disable()))
817
+ disabled: i.value,
818
+ onClick: c[1] || (c[1] = (w) => k(() => y.portal.disable()))
819
+ }, {
820
+ default: l(() => [
821
+ g(t(e(a).disable), 1)
822
+ ]),
823
+ _: 1
824
+ }, 8, ["disabled"])) : h("", !0),
825
+ d(e(U), {
826
+ variant: "secondary",
827
+ onClick: c[2] || (c[2] = (w) => y.portal.openControlPanel())
828
+ }, {
829
+ default: l(() => [
830
+ g(t(e(a).advanced), 1)
831
+ ]),
832
+ _: 1
833
+ }),
834
+ o.value.entry ? (s(), x(e(U), {
835
+ key: 1,
836
+ variant: "secondary",
837
+ disabled: i.value,
838
+ onClick: c[3] || (c[3] = (w) => k(() => y.portal.unregister()))
824
839
  }, {
825
- default: n(() => [
826
- g(l(e(a).disable), 1)
840
+ default: l(() => [
841
+ g(t(e(a).unregister), 1)
827
842
  ]),
828
843
  _: 1
829
- }, 8, ["disabled"])) : k("", !0)
844
+ }, 8, ["disabled"])) : h("", !0)
830
845
  ]),
831
846
  _: 1
832
847
  })
833
848
  ]),
834
849
  _: 1
835
- }),
836
- h(e(A), {
837
- variant: "secondary",
838
- onClick: z[5] || (z[5] = (x) => p.portal.openControlPanel())
850
+ })
851
+ ], 64)) : !o.value.controlPanel && o.value.state !== "active" ? (s(), V("p", dt, t(e(a).askAdmin), 1)) : h("", !0),
852
+ n.value ? (s(), x(e(X), {
853
+ key: 4,
854
+ tone: "danger"
855
+ }, {
856
+ default: l(() => [
857
+ $("span", vt, t(n.value), 1)
858
+ ]),
859
+ _: 1
860
+ })) : h("", !0)
861
+ ]),
862
+ _: 2
863
+ }, [
864
+ o.value?.canManage && o.value.entry && o.value.entry !== "registered" ? {
865
+ name: "footer",
866
+ fn: l(() => [
867
+ o.value.entry === "unregistered" ? (s(), x(e(U), {
868
+ key: 0,
869
+ variant: "primary",
870
+ disabled: i.value,
871
+ onClick: c[5] || (c[5] = (w) => k(() => y.portal.register()))
839
872
  }, {
840
- default: n(() => [
841
- g(l(e(a).advanced), 1)
873
+ default: l(() => [
874
+ g(t(e(a).register), 1)
842
875
  ]),
843
876
  _: 1
844
- }),
845
- m.value.entry ? (t(), $(e(A), {
877
+ }, 8, ["disabled"])) : (s(), x(e(U), {
846
878
  key: 1,
879
+ variant: "primary",
880
+ disabled: i.value,
881
+ onClick: c[6] || (c[6] = (w) => k(() => y.portal.unregister()))
882
+ }, {
883
+ default: l(() => [
884
+ g(t(e(a).unregister), 1)
885
+ ]),
886
+ _: 1
887
+ }, 8, ["disabled"]))
888
+ ]),
889
+ key: "0"
890
+ } : o.value && !o.value.canManage && o.value.controlPanel ? {
891
+ name: "footer",
892
+ fn: l(() => [
893
+ d(e(U), {
847
894
  variant: "secondary",
848
- disabled: d.value,
849
- onClick: z[6] || (z[6] = (x) => v(() => p.portal.unregister()))
895
+ onClick: c[7] || (c[7] = (w) => y.portal.openControlPanel())
850
896
  }, {
851
- default: n(() => [
852
- g(l(e(a).unregister), 1)
897
+ default: l(() => [
898
+ g(t(e(a).controlPanel), 1)
853
899
  ]),
854
900
  _: 1
855
- }, 8, ["disabled"])) : k("", !0)
856
- ], 64)) : m.value.controlPanel ? (t(), $(e(A), {
857
- key: 3,
858
- variant: "secondary",
859
- onClick: z[7] || (z[7] = (x) => p.portal.openControlPanel())
860
- }, {
861
- default: n(() => [
862
- g(l(e(a).controlPanel), 1)
863
- ]),
864
- _: 1
865
- })) : m.value.state !== "active" ? (t(), S("p", Wa, l(e(a).askAdmin), 1)) : k("", !0),
866
- s.value ? (t(), $(e(Q), {
867
- key: 5,
868
- tone: "danger"
869
- }, {
870
- default: n(() => [
871
- C("span", Za, l(s.value), 1)
872
- ]),
873
- _: 1
874
- })) : k("", !0)
875
- ]),
876
- _: 1
877
- }, 8, ["title", "aria-busy"])) : k("", !0);
901
+ })
902
+ ]),
903
+ key: "1"
904
+ } : void 0
905
+ ]), 1032, ["title", "aria-busy"])) : h("", !0);
878
906
  }
879
- }), el = ["aria-busy"], al = {
907
+ }), Gl = /* @__PURE__ */ ue(pt, [["__scopeId", "data-v-d803ac7c"]]), ft = ["aria-busy"], yt = {
880
908
  key: 1,
881
909
  role: "status"
882
- }, ll = { role: "alert" }, tl = { role: "status" }, nl = /* @__PURE__ */ le({
910
+ }, mt = { role: "alert" }, bt = { role: "status" }, gt = /* @__PURE__ */ oe({
883
911
  __name: "LoginPage",
884
912
  props: {
885
913
  session: {},
886
914
  locale: {}
887
915
  },
888
- setup(p) {
889
- const I = p, a = F(() => Qe(I.locale)), m = y(""), i = y(""), d = y(""), s = y(!1), o = y(!1), r = y(""), P = y(), v = F(() => window.location.protocol === "https:");
890
- let _ = !1;
891
- function z(R) {
892
- const L = R?.code;
893
- return a.value.errors[L || ""] || a.value.errors.failed;
916
+ setup(y) {
917
+ const q = y, f = L(() => la(q.locale)), a = b(""), o = b(""), m = b(""), i = b(!1), n = b(!1), u = b(""), r = b(), v = L(() => window.location.protocol === "https:");
918
+ let k = !1;
919
+ function D(z) {
920
+ const M = z?.code;
921
+ return f.value.errors[M || ""] || f.value.errors.failed;
894
922
  }
895
- async function x() {
896
- if (!(o.value || !v.value || !m.value || !i.value || s.value && !d.value)) {
897
- o.value = !0, r.value = "";
923
+ async function S() {
924
+ if (!(n.value || !v.value || !a.value || !o.value || i.value && !m.value)) {
925
+ n.value = !0, u.value = "";
898
926
  try {
899
- await I.session.login(m.value, i.value, d.value), i.value = "", d.value = "";
900
- } catch (R) {
901
- if (_) return;
902
- d.value = "", R?.code === "otp_required" ? s.value = !0 : (r.value = z(R), i.value = "", s.value = !1);
927
+ await q.session.login(a.value, o.value, m.value), o.value = "", m.value = "";
928
+ } catch (z) {
929
+ if (k) return;
930
+ m.value = "", z?.code === "otp_required" ? i.value = !0 : (u.value = D(z), o.value = "", i.value = !1);
903
931
  } finally {
904
- _ || (o.value = !1, s.value && (await na(), _ || P.value?.querySelector("input")?.focus()));
932
+ k || (n.value = !1, i.value && (await pa(), k || r.value?.querySelector("input")?.focus()));
905
933
  }
906
934
  }
907
935
  }
908
- async function b() {
909
- if (!o.value) {
910
- o.value = !0, r.value = "";
936
+ async function c() {
937
+ if (!n.value) {
938
+ n.value = !0, u.value = "";
911
939
  try {
912
- await I.session.bootstrap();
913
- } catch (R) {
914
- _ || (r.value = z(R));
940
+ await q.session.bootstrap();
941
+ } catch (z) {
942
+ k || (u.value = D(z));
915
943
  } finally {
916
- _ || (o.value = !1);
944
+ k || (n.value = !1);
917
945
  }
918
946
  }
919
947
  }
920
- function D() {
921
- i.value = "", d.value = "", s.value = !1, r.value = "";
948
+ function w() {
949
+ o.value = "", m.value = "", i.value = !1, u.value = "";
922
950
  }
923
- return Le(() => {
924
- _ = !0, i.value = "", d.value = "";
925
- }), (R, L) => (t(), S("main", {
951
+ return Qe(() => {
952
+ k = !0, o.value = "", m.value = "";
953
+ }), (z, M) => (s(), V("main", {
926
954
  class: "identity-login",
927
- "aria-busy": o.value
955
+ "aria-busy": n.value
928
956
  }, [
929
- h(e(ce), {
930
- title: a.value.title,
957
+ d(e(he), {
958
+ title: f.value.title,
959
+ description: f.value.intro,
931
960
  collapsible: !1
932
961
  }, {
933
- default: n(() => [
934
- C("p", null, l(a.value.intro), 1),
935
- v.value ? k("", !0) : (t(), $(e(Q), {
962
+ default: l(() => [
963
+ v.value ? h("", !0) : (s(), x(e(X), {
936
964
  key: 0,
937
965
  tone: "warning",
938
- title: a.value.httpsTitle
966
+ title: f.value.httpsTitle
939
967
  }, {
940
- default: n(() => [
941
- g(l(a.value.errors.https_required), 1)
968
+ default: l(() => [
969
+ g(t(f.value.errors.https_required), 1)
942
970
  ]),
943
971
  _: 1
944
972
  }, 8, ["title"])),
945
- p.session.notice.value ? (t(), S("p", al, l(a.value.notices[p.session.notice.value]), 1)) : k("", !0),
946
- r.value ? (t(), $(e(Q), {
973
+ y.session.notice.value ? (s(), V("p", yt, t(f.value.notices[y.session.notice.value]), 1)) : h("", !0),
974
+ u.value ? (s(), x(e(X), {
947
975
  key: 2,
948
976
  tone: "danger",
949
- title: a.value.failedTitle
977
+ title: f.value.failedTitle
950
978
  }, {
951
- default: n(() => [
952
- C("span", ll, l(r.value), 1)
979
+ default: l(() => [
980
+ $("span", mt, t(u.value), 1)
953
981
  ]),
954
982
  _: 1
955
- }, 8, ["title"])) : k("", !0),
956
- h(e(be), {
957
- onSubmit: me(x, ["prevent"])
983
+ }, 8, ["title"])) : h("", !0),
984
+ d(e(ze), {
985
+ onSubmit: Se(S, ["prevent"])
958
986
  }, {
959
- default: n(() => [
960
- h(e(oe), {
961
- label: a.value.account
987
+ default: l(() => [
988
+ d(e(fe), {
989
+ label: f.value.account
962
990
  }, {
963
- default: n(() => [
964
- h(e(pe), {
965
- modelValue: m.value,
966
- "onUpdate:modelValue": L[0] || (L[0] = (E) => m.value = E),
991
+ default: l(() => [
992
+ d(e(_e), {
993
+ modelValue: a.value,
994
+ "onUpdate:modelValue": M[0] || (M[0] = (N) => a.value = N),
967
995
  autocomplete: "username",
968
- disabled: o.value || s.value || !v.value
996
+ disabled: n.value || i.value || !v.value
969
997
  }, null, 8, ["modelValue", "disabled"])
970
998
  ]),
971
999
  _: 1
972
1000
  }, 8, ["label"]),
973
- s.value ? (t(), S(Z, { key: 1 }, [
974
- C("p", tl, l(a.value.otpPrompt), 1),
975
- C("div", {
1001
+ i.value ? (s(), V(ne, { key: 1 }, [
1002
+ $("p", bt, t(f.value.otpPrompt), 1),
1003
+ $("div", {
976
1004
  ref_key: "otpField",
977
- ref: P
1005
+ ref: r
978
1006
  }, [
979
- h(e(oe), {
980
- label: a.value.otp
1007
+ d(e(fe), {
1008
+ label: f.value.otp
981
1009
  }, {
982
- default: n(() => [
983
- h(e(pe), {
984
- modelValue: d.value,
985
- "onUpdate:modelValue": L[2] || (L[2] = (E) => d.value = E),
1010
+ default: l(() => [
1011
+ d(e(_e), {
1012
+ modelValue: m.value,
1013
+ "onUpdate:modelValue": M[2] || (M[2] = (N) => m.value = N),
986
1014
  inputmode: "numeric",
987
1015
  autocomplete: "one-time-code",
988
- disabled: o.value
1016
+ disabled: n.value
989
1017
  }, null, 8, ["modelValue", "disabled"])
990
1018
  ]),
991
1019
  _: 1
992
1020
  }, 8, ["label"])
993
1021
  ], 512)
994
- ], 64)) : (t(), $(e(oe), {
1022
+ ], 64)) : (s(), x(e(fe), {
995
1023
  key: 0,
996
- label: a.value.password
1024
+ label: f.value.password
997
1025
  }, {
998
- default: n(() => [
999
- h(e(pe), {
1000
- modelValue: i.value,
1001
- "onUpdate:modelValue": L[1] || (L[1] = (E) => i.value = E),
1026
+ default: l(() => [
1027
+ d(e(_e), {
1028
+ modelValue: o.value,
1029
+ "onUpdate:modelValue": M[1] || (M[1] = (N) => o.value = N),
1002
1030
  type: "password",
1003
1031
  autocomplete: "current-password",
1004
- disabled: o.value || !v.value
1032
+ disabled: n.value || !v.value
1005
1033
  }, null, 8, ["modelValue", "disabled"])
1006
1034
  ]),
1007
1035
  _: 1
1008
1036
  }, 8, ["label"])),
1009
- h(e(ke), null, {
1010
- default: n(() => [
1011
- h(e(A), {
1037
+ d(e(Pe), null, {
1038
+ default: l(() => [
1039
+ d(e(U), {
1012
1040
  type: "submit",
1013
1041
  variant: "primary",
1014
- disabled: o.value || !v.value || !m.value || !i.value || s.value && !d.value
1042
+ disabled: n.value || !v.value || !a.value || !o.value || i.value && !m.value
1015
1043
  }, {
1016
- default: n(() => [
1017
- g(l(o.value ? a.value.signingIn : s.value ? a.value.verify : a.value.signIn), 1)
1044
+ default: l(() => [
1045
+ g(t(n.value ? f.value.signingIn : i.value ? f.value.verify : f.value.signIn), 1)
1018
1046
  ]),
1019
1047
  _: 1
1020
1048
  }, 8, ["disabled"]),
1021
- s.value ? (t(), $(e(A), {
1049
+ i.value ? (s(), x(e(U), {
1022
1050
  key: 0,
1023
1051
  variant: "secondary",
1024
- disabled: o.value,
1025
- onClick: D
1052
+ disabled: n.value,
1053
+ onClick: w
1026
1054
  }, {
1027
- default: n(() => [
1028
- g(l(a.value.otherAccount), 1)
1055
+ default: l(() => [
1056
+ g(t(f.value.otherAccount), 1)
1029
1057
  ]),
1030
1058
  _: 1
1031
- }, 8, ["disabled"])) : (t(), $(e(A), {
1059
+ }, 8, ["disabled"])) : (s(), x(e(U), {
1032
1060
  key: 1,
1033
1061
  variant: "secondary",
1034
- disabled: o.value || !v.value,
1035
- onClick: b
1062
+ disabled: n.value || !v.value,
1063
+ onClick: c
1036
1064
  }, {
1037
- default: n(() => [
1038
- g(l(a.value.continueDSM), 1)
1065
+ default: l(() => [
1066
+ g(t(f.value.continueDSM), 1)
1039
1067
  ]),
1040
1068
  _: 1
1041
1069
  }, 8, ["disabled"]))
@@ -1047,370 +1075,389 @@ const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-locatio
1047
1075
  })
1048
1076
  ]),
1049
1077
  _: 1
1050
- }, 8, ["title"])
1051
- ], 8, el));
1078
+ }, 8, ["title", "description"])
1079
+ ], 8, ft));
1052
1080
  }
1053
- }), Vt = /* @__PURE__ */ ne(nl, [["__scopeId", "data-v-f7afcf5e"]]), sl = { class: "integration-help" }, il = { role: "status" }, ol = { class: "integration-help" }, ul = { class: "integration-help" }, rl = { class: "integration-help" }, dl = { class: "integration-actions" }, vl = { class: "integration-actions" }, cl = {
1081
+ }), Jl = /* @__PURE__ */ ue(gt, [["__scopeId", "data-v-1c0358cd"]]), ht = { role: "status" }, kt = { class: "integration-help" }, _t = { class: "integration-help" }, wt = { class: "integration-help" }, xt = { class: "integration-actions" }, Ct = {
1054
1082
  key: 0,
1055
1083
  role: "status",
1056
- "data-bg-picked": ""
1057
- }, fl = { class: "integration-actions" }, pl = { key: 2 }, yl = {
1084
+ "data-bg-picked": "",
1085
+ class: "bg-path"
1086
+ }, $t = { class: "integration-actions" }, St = { key: 2 }, zt = {
1058
1087
  key: 3,
1059
- class: "integration-jobs"
1060
- }, ml = ["data-job-state", "data-job-id"], bl = { class: "nas-folder-name" }, kl = {
1088
+ class: "bg-cards"
1089
+ }, Pt = { class: "bg-card-body" }, Vt = {
1061
1090
  key: 0,
1062
1091
  class: "integration-help"
1063
- }, gl = {
1092
+ }, It = {
1064
1093
  key: 1,
1065
1094
  class: "integration-help"
1066
- }, hl = {
1095
+ }, Tt = {
1067
1096
  key: 2,
1068
- class: "integration-help"
1069
- }, _l = {
1097
+ class: "integration-help bg-path"
1098
+ }, Et = {
1070
1099
  key: 3,
1071
1100
  class: "integration-help"
1072
- }, wl = {
1073
- key: 9,
1101
+ }, Ut = {
1102
+ key: 4,
1074
1103
  class: "integration-help"
1075
- }, Cl = ["aria-label"], $l = { class: "integration-help" }, xl = { key: 1 }, Sl = {
1104
+ }, At = { class: "integration-actions" }, Dt = ["aria-label"], Rt = { class: "integration-help" }, qt = { key: 1 }, Bt = {
1076
1105
  key: 2,
1077
- class: "integration-jobs"
1078
- }, zl = ["data-schedule-id"], Pl = { class: "nas-folder-name" }, Vl = {
1106
+ class: "bg-cards"
1107
+ }, Ft = { class: "bg-card-body" }, Ot = {
1079
1108
  key: 0,
1080
1109
  class: "integration-help"
1081
- }, Il = {
1110
+ }, Lt = {
1082
1111
  key: 1,
1083
1112
  class: "integration-help"
1084
- }, Ul = { class: "integration-help" }, Al = { class: "integration-actions" }, Dl = { class: "integration-actions" }, Tl = { class: "integration-actions" }, El = /* @__PURE__ */ le({
1113
+ }, Nt = { class: "integration-help" }, Mt = { class: "integration-actions" }, Kt = { class: "integration-actions" }, Ht = { class: "integration-actions" }, Gt = /* @__PURE__ */ oe({
1085
1114
  __name: "BackgroundPanel",
1086
1115
  props: {
1087
1116
  ctx: {}
1088
1117
  },
1089
- setup(p) {
1090
- const I = p, a = F(() => Ye(I.ctx.locale)), m = (u, f) => Pe(u, f, I.ctx.locale), i = y(), d = y([]), s = y(), o = y(!1), r = y(!1), P = y([]), v = y(), _ = y(!1), z = y("3600"), x = y(), b = y(), D = y(), R = y(!1), L = y(!1), E = y(), q = y(""), J = y(""), G = We(I.ctx);
1091
- let K, O = !1;
1092
- const H = (u) => !["queued", "running"].includes(u.state), W = (u) => H(u) && u.state !== "paused", j = (u) => u.state === "running" && u.pauseRequested, ee = (u) => j(u) ? a.value.pausing : a.value[`state_${u.state}`];
1093
- async function N(u, f) {
1118
+ setup(y, { expose: q }) {
1119
+ const f = y, a = L(() => sa(f.ctx.locale)), o = (p, B) => Ae(p, B, f.ctx.locale), m = b(), i = b([]), n = b(), u = b(!1), r = b(!1), v = b([]), k = b(), D = b(!1), S = b("3600"), c = b(), w = b(), z = b(), M = b(!1), N = b(!1), K = b(), O = b(""), Z = b(""), ae = na(f.ctx);
1120
+ let W, H = !1;
1121
+ const j = (p) => !["queued", "running"].includes(p.state), te = (p) => j(p) && p.state !== "paused", se = (p) => p.state === "running" && p.pauseRequested, Q = (p) => se(p) ? a.value.pausing : a.value[`state_${p.state}`], Y = (p) => se(p) ? "warning" : { queued: "info", running: "info", paused: "warning", succeeded: "success", failed: "danger", canceled: "neutral", interrupted: "danger" }[p.state];
1122
+ async function G(p, B) {
1094
1123
  try {
1095
- return await I.ctx.call(u, f);
1096
- } catch (c) {
1097
- if (O) return;
1098
- c?.code === "unsupported" ? (o.value = !0, d.value = [], P.value = [], v.value = void 0, x.value = void 0, b.value = void 0, i.value = void 0, D.value = void 0, E.value = void 0, q.value && URL.revokeObjectURL(q.value), q.value = "") : O || (s.value = c);
1124
+ return await f.ctx.call(p, B);
1125
+ } catch (_) {
1126
+ if (H) return;
1127
+ _?.code === "unsupported" ? (u.value = !0, i.value = [], v.value = [], k.value = void 0, c.value = void 0, w.value = void 0, m.value = void 0, z.value = void 0, K.value = void 0, O.value && URL.revokeObjectURL(O.value), O.value = "") : H || (n.value = _);
1099
1128
  return;
1100
1129
  }
1101
1130
  }
1102
- async function T() {
1103
- if (!(O || R.value)) {
1104
- R.value = !0;
1131
+ async function le() {
1132
+ if (!(H || M.value)) {
1133
+ M.value = !0;
1105
1134
  try {
1106
- const u = await N("bg.status");
1107
- if (!u || O) return;
1108
- if (!u.limits || typeof u.admin != "boolean") {
1109
- s.value = { code: "unavailable" };
1135
+ const p = await G("bg.status");
1136
+ if (!p || H) return;
1137
+ if (!p.limits || typeof p.admin != "boolean") {
1138
+ n.value = { code: "unavailable" };
1110
1139
  return;
1111
1140
  }
1112
- o.value = !1, i.value = u;
1113
- const f = await N("bg.jobs.list");
1114
- f && !O && (d.value = f.jobs ?? []);
1115
- const c = await N("bg.schedules.list");
1116
- c && !O && (P.value = c.schedules ?? []), !O && d.value.every(H) && P.value.every((X) => !X.enabled) && K && (clearInterval(K), K = void 0);
1141
+ u.value = !1, m.value = p;
1142
+ const B = await G("bg.jobs.list");
1143
+ B && !H && (i.value = B.jobs ?? []);
1144
+ const _ = await G("bg.schedules.list");
1145
+ _ && !H && (v.value = _.schedules ?? []), !H && i.value.every(j) && v.value.every((ie) => !ie.enabled) && W && (clearInterval(W), W = void 0);
1117
1146
  } finally {
1118
- R.value = !1;
1147
+ M.value = !1;
1119
1148
  }
1120
1149
  }
1121
1150
  }
1122
- function B() {
1123
- K || (K = setInterval(() => {
1124
- T();
1151
+ function R() {
1152
+ W || (W = setInterval(() => {
1153
+ le();
1125
1154
  }, 3e3));
1126
1155
  }
1127
- async function w(u) {
1156
+ async function T(p) {
1128
1157
  if (!r.value) {
1129
- r.value = !0, s.value = void 0;
1158
+ r.value = !0, n.value = void 0;
1130
1159
  try {
1131
- await u(), await T(), (P.value.some((f) => f.enabled) || d.value.some((f) => !H(f))) && B();
1160
+ await p(), await le(), (v.value.some((B) => B.enabled) || i.value.some((B) => !j(B))) && R();
1132
1161
  } finally {
1133
- O || (r.value = !1);
1162
+ H || (r.value = !1);
1134
1163
  }
1135
1164
  }
1136
1165
  }
1137
- const U = () => w(async () => {
1138
- if (!D.value) return;
1139
- await N("bg.jobs.purge", { owner: D.value }) && (D.value = void 0);
1140
- }), M = F(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), Y = (u) => {
1141
- v.value = u, _.value = !1, z.value = "3600";
1142
- }, ae = () => w(async () => {
1143
- if (!v.value || !_.value) return;
1144
- await N("bg.schedules.create", { key: De(), jobId: v.value.id, intervalSeconds: Number(z.value), consent: !0 }) && (v.value = void 0);
1145
- }), se = (u) => w(() => N("bg.schedules.disable", { id: u })), ge = () => w(async () => {
1146
- if (!x.value) return;
1147
- await N("bg.schedules.delete", { id: x.value.id }) && (x.value = void 0);
1148
- }), we = () => w(async () => {
1149
- if (!b.value) return;
1150
- await N("bg.schedules.enable", { id: b.value.id, consent: !0 }) && (b.value = void 0);
1151
- }), Ce = (u) => {
1152
- const f = new Date(u);
1153
- return Number.isFinite(f.getTime()) ? f.toLocaleString() : a.value.unknownTime;
1154
- }, fe = (u) => u.copyRetained && u.state === "succeeded" && !u.scheduleId && u.submitter?.user === i.value?.owner?.user && u.submitter?.uid === i.value?.owner?.uid, ie = (u) => w(() => N("bg.jobs.cancel", { id: u })), ye = (u) => w(() => N("bg.jobs.pause", { id: u })), he = (u) => w(() => N("bg.jobs.resume", { id: u })), $e = (u) => {
1155
- const f = u.lastIndexOf("/");
1156
- E.value = { folder: u.slice(0, f), relative: u.slice(f + 1) };
1157
- }, xe = () => w(async () => {
1158
- if (!E.value) return;
1159
- await N("bg.jobs.submit", { key: De(), ...E.value }) && (E.value = void 0);
1166
+ const E = () => T(async () => {
1167
+ if (!z.value) return;
1168
+ await G("bg.jobs.purge", { owner: z.value }) && (z.value = void 0);
1169
+ }), J = L(() => [{ value: "3600", label: a.value.hourly }, { value: "86400", label: a.value.daily }, { value: "604800", label: a.value.weekly }]), re = (p) => {
1170
+ k.value = p, D.value = !1, S.value = "3600";
1171
+ }, we = () => T(async () => {
1172
+ if (!k.value || !D.value) return;
1173
+ await G("bg.schedules.create", { key: Be(), jobId: k.value.id, intervalSeconds: Number(S.value), consent: !0 }) && (k.value = void 0);
1174
+ }), xe = (p) => T(() => G("bg.schedules.disable", { id: p })), ve = () => T(async () => {
1175
+ if (!c.value) return;
1176
+ await G("bg.schedules.delete", { id: c.value.id }) && (c.value = void 0);
1177
+ }), ce = () => T(async () => {
1178
+ if (!w.value) return;
1179
+ await G("bg.schedules.enable", { id: w.value.id, consent: !0 }) && (w.value = void 0);
1180
+ }), de = (p) => {
1181
+ const B = new Date(p);
1182
+ return Number.isFinite(B.getTime()) ? B.toLocaleString() : a.value.unknownTime;
1183
+ }, me = (p) => p.copyRetained && p.state === "succeeded" && !p.scheduleId && p.submitter?.user === m.value?.owner?.user && p.submitter?.uid === m.value?.owner?.uid, F = (p) => T(() => G("bg.jobs.cancel", { id: p })), ee = (p) => T(() => G("bg.jobs.pause", { id: p })), A = (p) => T(() => G("bg.jobs.resume", { id: p })), C = (p) => {
1184
+ const B = p.lastIndexOf("/");
1185
+ K.value = { folder: p.slice(0, B), relative: p.slice(B + 1) };
1186
+ }, P = () => T(async () => {
1187
+ if (!K.value) return;
1188
+ await G("bg.jobs.submit", { key: Be(), ...K.value }) && (K.value = void 0);
1160
1189
  });
1161
- async function V(u) {
1162
- const f = await N("bg.jobs.result", { id: u.id });
1163
- !f || O || (q.value && URL.revokeObjectURL(q.value), q.value = URL.createObjectURL(new Blob([JSON.stringify(f.result, null, 2)], { type: "application/json" })), J.value = `${u.name || u.id}.sha256.json`);
1190
+ async function I(p) {
1191
+ const B = await G("bg.jobs.result", { id: p.id });
1192
+ !B || H || (O.value && URL.revokeObjectURL(O.value), O.value = URL.createObjectURL(new Blob([JSON.stringify(B.result, null, 2)], { type: "application/json" })), Z.value = `${p.name || p.id}.sha256.json`);
1164
1193
  }
1165
- return ve(() => {
1166
- T().then(() => {
1167
- (P.value.some((u) => u.enabled) || d.value.some((u) => !H(u))) && B();
1194
+ return q({ refresh: le }), ge(() => {
1195
+ le().then(() => {
1196
+ (v.value.some((p) => p.enabled) || i.value.some((p) => !j(p))) && R();
1168
1197
  });
1169
- }), ue(() => {
1170
- O = !0, G.dispose(), K && clearInterval(K), q.value && URL.revokeObjectURL(q.value);
1171
- }), (u, f) => (t(), $(e(ce), {
1172
- "aria-busy": r.value || R.value,
1198
+ }), ye(() => {
1199
+ H = !0, ae.dispose(), W && clearInterval(W), O.value && URL.revokeObjectURL(O.value);
1200
+ }), (p, B) => (s(), x(e(he), {
1201
+ "aria-busy": r.value || M.value,
1173
1202
  title: a.value.title,
1203
+ description: u.value ? void 0 : a.value.help,
1204
+ loading: !m.value && !n.value && !u.value,
1174
1205
  collapsible: !1,
1175
1206
  "data-background-panel": ""
1176
1207
  }, {
1177
- default: n(() => [
1178
- o.value ? (t(), $(e(Q), {
1208
+ default: l(() => [
1209
+ u.value ? (s(), x(e(X), {
1179
1210
  key: 0,
1180
1211
  tone: "warning"
1181
1212
  }, {
1182
- default: n(() => [
1183
- g(l(a.value.unsupported), 1)
1213
+ default: l(() => [
1214
+ g(t(a.value.unsupported), 1)
1184
1215
  ]),
1185
1216
  _: 1
1186
- })) : (t(), S(Z, { key: 1 }, [
1187
- C("p", sl, l(a.value.help), 1),
1188
- s.value ? (t(), $(e(Q), {
1217
+ })) : (s(), V(ne, { key: 1 }, [
1218
+ n.value ? (s(), x(e(X), {
1189
1219
  key: 0,
1190
1220
  tone: "danger",
1191
1221
  role: "alert"
1192
1222
  }, {
1193
- default: n(() => [
1194
- g(l(e(Ze)(s.value, a.value)), 1)
1223
+ default: l(() => [
1224
+ g(t(e(ia)(n.value, a.value)), 1)
1195
1225
  ]),
1196
1226
  _: 1
1197
- })) : k("", !0),
1198
- i.value ? (t(), S(Z, { key: 1 }, [
1199
- C("p", il, l(i.value.worker?.alive ? m(a.value.workerRunning, { user: i.value.worker.username }) : a.value.workerStopped), 1),
1200
- C("p", ol, l(m(a.value.limits, { size: i.value.limits.maxInputBytes / 1024, queue: i.value.limits.maxQueued, seconds: i.value.limits.jobTimeoutSeconds })), 1),
1201
- C("p", ul, l(i.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
1202
- C("p", rl, l(m(a.value.ownerLimits, { jobs: i.value.limits.maxOwnerPending, size: i.value.limits.maxOwnerBytes / 1024 })), 1),
1203
- C("div", dl, [
1204
- h(e(A), {
1227
+ })) : h("", !0),
1228
+ m.value ? (s(), V(ne, { key: 1 }, [
1229
+ $("p", ht, t(m.value.worker?.alive ? o(a.value.workerRunning, { user: m.value.worker.username }) : a.value.workerStopped), 1),
1230
+ $("p", kt, t(o(a.value.limits, { size: m.value.limits.maxInputBytes / 1024, queue: m.value.limits.maxQueued, seconds: m.value.limits.jobTimeoutSeconds })), 1),
1231
+ $("p", _t, t(m.value.admin ? a.value.adminScope : a.value.ownerScope), 1),
1232
+ $("p", wt, t(o(a.value.ownerLimits, { jobs: m.value.limits.maxOwnerPending, size: m.value.limits.maxOwnerBytes / 1024 })), 1),
1233
+ $("div", xt, [
1234
+ d(e(U), {
1205
1235
  variant: "secondary",
1206
1236
  disabled: r.value,
1207
- onClick: T
1237
+ onClick: B[0] || (B[0] = (_) => N.value = !0)
1208
1238
  }, {
1209
- default: n(() => [
1210
- g(l(a.value.refresh), 1)
1211
- ]),
1212
- _: 1
1213
- }, 8, ["disabled"])
1214
- ]),
1215
- C("div", vl, [
1216
- h(e(A), {
1217
- variant: "secondary",
1218
- disabled: r.value,
1219
- onClick: f[0] || (f[0] = (c) => L.value = !0)
1220
- }, {
1221
- default: n(() => [
1222
- g(l(a.value.chooseFile), 1)
1239
+ default: l(() => [
1240
+ g(t(a.value.chooseFile), 1)
1223
1241
  ]),
1224
1242
  _: 1
1225
1243
  }, 8, ["disabled"]),
1226
- h(e(A), {
1244
+ d(e(U), {
1227
1245
  variant: "primary",
1228
- disabled: r.value || !E.value,
1229
- onClick: xe
1246
+ disabled: r.value || !K.value,
1247
+ onClick: P
1230
1248
  }, {
1231
- default: n(() => [
1232
- g(l(a.value.submit), 1)
1249
+ default: l(() => [
1250
+ g(t(a.value.submit), 1)
1233
1251
  ]),
1234
1252
  _: 1
1235
1253
  }, 8, ["disabled"])
1236
1254
  ]),
1237
- E.value ? (t(), S("p", cl, l(m(a.value.chosen, { path: `${E.value.folder}/${E.value.relative}` })), 1)) : k("", !0),
1238
- h(_e, {
1239
- open: L.value,
1240
- "onUpdate:open": f[1] || (f[1] = (c) => L.value = c),
1241
- locale: p.ctx.locale,
1242
- provider: e(G),
1255
+ K.value ? (s(), V("p", Ct, [
1256
+ g(t(o(a.value.chosen, { path: "" }).trim()) + " ", 1),
1257
+ d(e(pe), {
1258
+ path: `${K.value.folder}/${K.value.relative}`
1259
+ }, null, 8, ["path"])
1260
+ ])) : h("", !0),
1261
+ d(Te, {
1262
+ open: N.value,
1263
+ "onUpdate:open": B[1] || (B[1] = (_) => N.value = _),
1264
+ locale: y.ctx.locale,
1265
+ provider: e(ae),
1243
1266
  mode: "file",
1244
1267
  title: a.value.pickerTitle,
1245
1268
  description: a.value.pickerConsent,
1246
- onSelected: $e
1269
+ onSelected: C
1247
1270
  }, null, 8, ["open", "locale", "provider", "title", "description"]),
1248
- D.value && i.value.admin ? (t(), $(e(Q), {
1271
+ z.value && m.value.admin ? (s(), x(e(X), {
1249
1272
  key: 1,
1250
1273
  tone: "warning"
1251
1274
  }, {
1252
- default: n(() => [
1253
- C("p", null, l(m(a.value.purgeConfirm, { user: D.value.user, uid: D.value.uid })), 1),
1254
- C("div", fl, [
1255
- h(e(A), {
1275
+ default: l(() => [
1276
+ $("p", null, t(o(a.value.purgeConfirm, { user: z.value.user, uid: z.value.uid })), 1),
1277
+ $("div", $t, [
1278
+ d(e(U), {
1256
1279
  variant: "secondary",
1257
1280
  disabled: r.value,
1258
- onClick: U
1281
+ onClick: E
1259
1282
  }, {
1260
- default: n(() => [
1261
- g(l(a.value.confirmPurge), 1)
1283
+ default: l(() => [
1284
+ g(t(a.value.confirmPurge), 1)
1262
1285
  ]),
1263
1286
  _: 1
1264
1287
  }, 8, ["disabled"]),
1265
- h(e(A), {
1288
+ d(e(U), {
1266
1289
  variant: "secondary",
1267
1290
  disabled: r.value,
1268
- onClick: f[2] || (f[2] = (c) => D.value = void 0)
1291
+ onClick: B[2] || (B[2] = (_) => z.value = void 0)
1269
1292
  }, {
1270
- default: n(() => [
1271
- g(l(a.value.keepJobs), 1)
1293
+ default: l(() => [
1294
+ g(t(a.value.keepJobs), 1)
1272
1295
  ]),
1273
1296
  _: 1
1274
1297
  }, 8, ["disabled"])
1275
1298
  ])
1276
1299
  ]),
1277
1300
  _: 1
1278
- })) : k("", !0),
1279
- d.value.length ? (t(), S("ul", yl, [
1280
- (t(!0), S(Z, null, de(d.value, (c) => (t(), S("li", {
1281
- key: c.id,
1282
- "data-job-state": c.state,
1283
- "data-job-id": c.id
1284
- }, [
1285
- C("span", bl, l(c.name) + " — " + l(ee(c)), 1),
1286
- c.progress?.total ? (t(), S("span", kl, l(m(a.value.progressItems, { done: c.progress.done, count: c.progress.total })), 1)) : k("", !0),
1287
- c.progress?.totalBytes ? (t(), S("span", gl, l(m(a.value.progressBytes, { done: e(Ue)(c.progress.bytes, p.ctx.locale), total: e(Ue)(c.progress.totalBytes, p.ctx.locale) })), 1)) : k("", !0),
1288
- c.progress?.item ? (t(), S("span", hl, l(m(a.value.progressItem, { item: c.progress.item })), 1)) : k("", !0),
1289
- i.value.admin && c.submitter ? (t(), S("span", _l, l(m(a.value.owner, { user: c.submitter.user, uid: c.submitter.uid })), 1)) : k("", !0),
1290
- i.value.admin && c.submitter ? (t(), $(e(A), {
1291
- key: 4,
1292
- variant: "secondary",
1293
- disabled: r.value,
1294
- onClick: (X) => D.value = c.submitter
1295
- }, {
1296
- default: n(() => [
1297
- g(l(a.value.purgeOwner), 1)
1298
- ]),
1299
- _: 1
1300
- }, 8, ["disabled", "onClick"])) : k("", !0),
1301
- !H(c) && !c.pauseRequested && !c.delegation_id ? (t(), $(e(A), {
1302
- key: 5,
1303
- variant: "secondary",
1304
- disabled: r.value,
1305
- onClick: (X) => ye(c.id)
1306
- }, {
1307
- default: n(() => [
1308
- g(l(a.value.pause), 1)
1309
- ]),
1310
- _: 1
1311
- }, 8, ["disabled", "onClick"])) : k("", !0),
1312
- c.state === "paused" || j(c) ? (t(), $(e(A), {
1313
- key: 6,
1314
- variant: "secondary",
1315
- disabled: r.value,
1316
- onClick: (X) => he(c.id)
1317
- }, {
1318
- default: n(() => [
1319
- g(l(a.value.resume), 1)
1320
- ]),
1321
- _: 1
1322
- }, 8, ["disabled", "onClick"])) : k("", !0),
1323
- W(c) ? k("", !0) : (t(), $(e(A), {
1324
- key: 7,
1325
- variant: "secondary",
1326
- disabled: r.value,
1327
- onClick: (X) => ie(c.id)
1328
- }, {
1329
- default: n(() => [
1330
- g(l(a.value.cancel), 1)
1331
- ]),
1332
- _: 1
1333
- }, 8, ["disabled", "onClick"])),
1334
- fe(c) ? (t(), $(e(A), {
1335
- key: 8,
1336
- variant: "secondary",
1337
- disabled: r.value,
1338
- onClick: (X) => Y(c)
1339
- }, {
1340
- default: n(() => [
1341
- g(l(a.value.scheduleCopy), 1)
1342
- ]),
1343
- _: 1
1344
- }, 8, ["disabled", "onClick"])) : k("", !0),
1345
- c.scheduleId ? (t(), S("span", wl, l(a.value.scheduledJob), 1)) : k("", !0),
1346
- c.state === "succeeded" ? (t(), $(e(A), {
1347
- key: 10,
1348
- variant: "secondary",
1349
- disabled: r.value,
1350
- onClick: (X) => V(c)
1351
- }, {
1352
- default: n(() => [
1353
- g(l(a.value.result), 1)
1354
- ]),
1355
- _: 1
1356
- }, 8, ["disabled", "onClick"])) : k("", !0)
1357
- ], 8, ml))), 128))
1358
- ])) : (t(), S("p", pl, l(a.value.noJobs), 1)),
1359
- C("section", {
1301
+ })) : h("", !0),
1302
+ i.value.length ? (s(), V("div", zt, [
1303
+ (s(!0), V(ne, null, ke(i.value, (_) => (s(), x(e(Fe), {
1304
+ key: _.id,
1305
+ title: _.name,
1306
+ "layout-type": "compact",
1307
+ "data-job-state": _.state,
1308
+ "data-job-id": _.id
1309
+ }, {
1310
+ "header-actions": l(() => [
1311
+ d(e($e), {
1312
+ tone: Y(_),
1313
+ "data-bg-state": ""
1314
+ }, {
1315
+ default: l(() => [
1316
+ g(t(Q(_)), 1)
1317
+ ]),
1318
+ _: 2
1319
+ }, 1032, ["tone"])
1320
+ ]),
1321
+ default: l(() => [
1322
+ $("div", Pt, [
1323
+ _.progress?.total ? (s(), V("span", Vt, t(o(a.value.progressItems, { done: _.progress.done, count: _.progress.total })), 1)) : h("", !0),
1324
+ _.progress?.totalBytes ? (s(), V("span", It, t(o(a.value.progressBytes, { done: e(Re)(_.progress.bytes, y.ctx.locale), total: e(Re)(_.progress.totalBytes, y.ctx.locale) })), 1)) : h("", !0),
1325
+ _.progress?.item ? (s(), V("span", Tt, [
1326
+ g(t(o(a.value.progressItem, { item: "" }).trim()) + " ", 1),
1327
+ d(e(pe), {
1328
+ path: _.progress.item
1329
+ }, null, 8, ["path"])
1330
+ ])) : h("", !0),
1331
+ m.value.admin && _.submitter ? (s(), V("span", Et, t(o(a.value.owner, { user: _.submitter.user, uid: _.submitter.uid })), 1)) : h("", !0),
1332
+ _.scheduleId ? (s(), V("span", Ut, t(a.value.scheduledJob), 1)) : h("", !0),
1333
+ $("div", At, [
1334
+ m.value.admin && _.submitter ? (s(), x(e(U), {
1335
+ key: 0,
1336
+ variant: "secondary",
1337
+ disabled: r.value,
1338
+ onClick: (ie) => z.value = _.submitter
1339
+ }, {
1340
+ default: l(() => [
1341
+ g(t(a.value.purgeOwner), 1)
1342
+ ]),
1343
+ _: 1
1344
+ }, 8, ["disabled", "onClick"])) : h("", !0),
1345
+ !j(_) && !_.pauseRequested && !_.delegation_id ? (s(), x(e(U), {
1346
+ key: 1,
1347
+ variant: "secondary",
1348
+ disabled: r.value,
1349
+ onClick: (ie) => ee(_.id)
1350
+ }, {
1351
+ default: l(() => [
1352
+ g(t(a.value.pause), 1)
1353
+ ]),
1354
+ _: 1
1355
+ }, 8, ["disabled", "onClick"])) : h("", !0),
1356
+ _.state === "paused" || se(_) ? (s(), x(e(U), {
1357
+ key: 2,
1358
+ variant: "secondary",
1359
+ disabled: r.value,
1360
+ onClick: (ie) => A(_.id)
1361
+ }, {
1362
+ default: l(() => [
1363
+ g(t(a.value.resume), 1)
1364
+ ]),
1365
+ _: 1
1366
+ }, 8, ["disabled", "onClick"])) : h("", !0),
1367
+ te(_) ? h("", !0) : (s(), x(e(U), {
1368
+ key: 3,
1369
+ variant: "secondary",
1370
+ disabled: r.value,
1371
+ onClick: (ie) => F(_.id)
1372
+ }, {
1373
+ default: l(() => [
1374
+ g(t(a.value.cancel), 1)
1375
+ ]),
1376
+ _: 1
1377
+ }, 8, ["disabled", "onClick"])),
1378
+ me(_) ? (s(), x(e(U), {
1379
+ key: 4,
1380
+ variant: "secondary",
1381
+ disabled: r.value,
1382
+ onClick: (ie) => re(_)
1383
+ }, {
1384
+ default: l(() => [
1385
+ g(t(a.value.scheduleCopy), 1)
1386
+ ]),
1387
+ _: 1
1388
+ }, 8, ["disabled", "onClick"])) : h("", !0),
1389
+ _.state === "succeeded" ? (s(), x(e(U), {
1390
+ key: 5,
1391
+ variant: "secondary",
1392
+ disabled: r.value,
1393
+ onClick: (ie) => I(_)
1394
+ }, {
1395
+ default: l(() => [
1396
+ g(t(a.value.result), 1)
1397
+ ]),
1398
+ _: 1
1399
+ }, 8, ["disabled", "onClick"])) : h("", !0)
1400
+ ])
1401
+ ])
1402
+ ]),
1403
+ _: 2
1404
+ }, 1032, ["title", "data-job-state", "data-job-id"]))), 128))
1405
+ ])) : (s(), V("p", St, t(a.value.noJobs), 1)),
1406
+ $("section", {
1360
1407
  "data-bg-schedules": "",
1361
1408
  class: "bg-schedules",
1362
1409
  "aria-label": a.value.schedulesTitle
1363
1410
  }, [
1364
- C("h3", null, l(a.value.schedulesTitle), 1),
1365
- C("p", $l, l(a.value.scheduleHelp), 1),
1366
- v.value ? (t(), $(e(be), {
1411
+ $("h3", null, t(a.value.schedulesTitle), 1),
1412
+ $("p", Rt, t(a.value.scheduleHelp), 1),
1413
+ k.value ? (s(), x(e(ze), {
1367
1414
  key: 0,
1368
1415
  class: "bg-schedule-form",
1369
- onSubmit: me(ae, ["prevent"])
1416
+ onSubmit: Se(we, ["prevent"])
1370
1417
  }, {
1371
- default: n(() => [
1372
- C("p", null, l(m(a.value.scheduleSource, { name: v.value.name })), 1),
1373
- h(e(oe), {
1418
+ default: l(() => [
1419
+ $("p", null, t(o(a.value.scheduleSource, { name: k.value.name })), 1),
1420
+ d(e(fe), {
1374
1421
  label: a.value.interval
1375
1422
  }, {
1376
- default: n(() => [
1377
- h(e(Me), {
1378
- modelValue: z.value,
1379
- "onUpdate:modelValue": f[3] || (f[3] = (c) => z.value = c),
1423
+ default: l(() => [
1424
+ d(e(Ze), {
1425
+ modelValue: S.value,
1426
+ "onUpdate:modelValue": B[3] || (B[3] = (_) => S.value = _),
1380
1427
  "data-schedule-interval": "",
1381
- options: M.value,
1428
+ options: J.value,
1382
1429
  disabled: r.value
1383
1430
  }, null, 8, ["modelValue", "options", "disabled"])
1384
1431
  ]),
1385
1432
  _: 1
1386
1433
  }, 8, ["label"]),
1387
- h(e(pa), {
1388
- modelValue: _.value,
1389
- "onUpdate:modelValue": f[4] || (f[4] = (c) => _.value = c),
1434
+ d(e(xa), {
1435
+ modelValue: D.value,
1436
+ "onUpdate:modelValue": B[4] || (B[4] = (_) => D.value = _),
1390
1437
  "data-schedule-consent": "",
1391
1438
  disabled: r.value,
1392
1439
  label: a.value.scheduleConsent
1393
1440
  }, null, 8, ["modelValue", "disabled", "label"]),
1394
- h(e(ke), null, {
1395
- default: n(() => [
1396
- h(e(A), {
1441
+ d(e(Pe), null, {
1442
+ default: l(() => [
1443
+ d(e(U), {
1397
1444
  type: "submit",
1398
1445
  variant: "primary",
1399
- disabled: r.value || !_.value
1446
+ disabled: r.value || !D.value
1400
1447
  }, {
1401
- default: n(() => [
1402
- g(l(a.value.createSchedule), 1)
1448
+ default: l(() => [
1449
+ g(t(a.value.createSchedule), 1)
1403
1450
  ]),
1404
1451
  _: 1
1405
1452
  }, 8, ["disabled"]),
1406
- h(e(A), {
1453
+ d(e(U), {
1407
1454
  type: "button",
1408
1455
  variant: "secondary",
1409
1456
  disabled: r.value,
1410
- onClick: f[5] || (f[5] = (c) => v.value = void 0)
1457
+ onClick: B[5] || (B[5] = (_) => k.value = void 0)
1411
1458
  }, {
1412
- default: n(() => [
1413
- g(l(a.value.cancel), 1)
1459
+ default: l(() => [
1460
+ g(t(a.value.cancel), 1)
1414
1461
  ]),
1415
1462
  _: 1
1416
1463
  }, 8, ["disabled"])
@@ -1419,148 +1466,171 @@ const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-locatio
1419
1466
  })
1420
1467
  ]),
1421
1468
  _: 1
1422
- })) : k("", !0),
1423
- P.value.length ? (t(), S("ul", Sl, [
1424
- (t(!0), S(Z, null, de(P.value, (c) => (t(), S("li", {
1425
- key: c.id,
1426
- "data-schedule-id": c.id
1427
- }, [
1428
- C("span", Pl, l(c.name) + " — " + l(c.enabled ? a.value.scheduleOn : a.value.scheduleOff), 1),
1429
- i.value.admin ? (t(), S("span", Vl, l(m(a.value.owner, { user: c.owner.user, uid: c.owner.uid })), 1)) : k("", !0),
1430
- c.enabled ? (t(), S("span", Il, l(m(a.value.nextRun, { time: Ce(c.nextAt) })), 1)) : k("", !0),
1431
- C("span", Ul, l(m(a.value.missedRuns, { count: c.missed })), 1),
1432
- c.reason === "worker-changed" ? (t(), $(e(Q), {
1433
- key: 2,
1434
- tone: "warning"
1435
- }, {
1436
- default: n(() => [
1437
- g(l(a.value.revisionChanged), 1)
1438
- ]),
1439
- _: 1
1440
- })) : c.reason === "input-unavailable" ? (t(), $(e(Q), {
1441
- key: 3,
1442
- tone: "warning"
1443
- }, {
1444
- default: n(() => [
1445
- g(l(a.value.errors["input-unavailable"]), 1)
1446
- ]),
1447
- _: 1
1448
- })) : k("", !0),
1449
- C("div", Al, [
1450
- c.enabled ? (t(), $(e(A), {
1451
- key: 0,
1452
- variant: "secondary",
1453
- disabled: r.value,
1454
- onClick: (X) => se(c.id)
1455
- }, {
1456
- default: n(() => [
1457
- g(l(a.value.disableSchedule), 1)
1458
- ]),
1459
- _: 1
1460
- }, 8, ["disabled", "onClick"])) : i.value.admin ? (t(), $(e(A), {
1461
- key: 1,
1462
- variant: "secondary",
1463
- disabled: r.value,
1464
- onClick: (X) => b.value = c
1465
- }, {
1466
- default: n(() => [
1467
- g(l(a.value.enableSchedule), 1)
1468
- ]),
1469
- _: 1
1470
- }, 8, ["disabled", "onClick"])) : k("", !0),
1471
- h(e(A), {
1472
- variant: "secondary",
1473
- disabled: r.value,
1474
- onClick: (X) => x.value = c
1469
+ })) : h("", !0),
1470
+ v.value.length ? (s(), V("div", Bt, [
1471
+ (s(!0), V(ne, null, ke(v.value, (_) => (s(), x(e(Fe), {
1472
+ key: _.id,
1473
+ title: _.name,
1474
+ "layout-type": "compact",
1475
+ "data-schedule-id": _.id
1476
+ }, {
1477
+ "header-actions": l(() => [
1478
+ d(e($e), {
1479
+ tone: _.enabled ? "success" : "neutral",
1480
+ "data-bg-state": ""
1475
1481
  }, {
1476
- default: n(() => [
1477
- g(l(a.value.deleteSchedule), 1)
1482
+ default: l(() => [
1483
+ g(t(_.enabled ? a.value.scheduleOn : a.value.scheduleOff), 1)
1478
1484
  ]),
1479
- _: 1
1480
- }, 8, ["disabled", "onClick"])
1481
- ])
1482
- ], 8, zl))), 128))
1483
- ])) : (t(), S("p", xl, l(a.value.noSchedules), 1)),
1484
- x.value ? (t(), $(e(Q), {
1485
+ _: 2
1486
+ }, 1032, ["tone"])
1487
+ ]),
1488
+ default: l(() => [
1489
+ $("div", Ft, [
1490
+ m.value.admin ? (s(), V("span", Ot, t(o(a.value.owner, { user: _.owner.user, uid: _.owner.uid })), 1)) : h("", !0),
1491
+ _.enabled ? (s(), V("span", Lt, t(o(a.value.nextRun, { time: de(_.nextAt) })), 1)) : h("", !0),
1492
+ $("span", Nt, t(o(a.value.missedRuns, { count: _.missed })), 1),
1493
+ _.reason === "worker-changed" ? (s(), x(e(X), {
1494
+ key: 2,
1495
+ tone: "warning"
1496
+ }, {
1497
+ default: l(() => [
1498
+ g(t(a.value.revisionChanged), 1)
1499
+ ]),
1500
+ _: 1
1501
+ })) : _.reason === "input-unavailable" ? (s(), x(e(X), {
1502
+ key: 3,
1503
+ tone: "warning"
1504
+ }, {
1505
+ default: l(() => [
1506
+ g(t(a.value.errors["input-unavailable"]), 1)
1507
+ ]),
1508
+ _: 1
1509
+ })) : h("", !0),
1510
+ $("div", Mt, [
1511
+ _.enabled ? (s(), x(e(U), {
1512
+ key: 0,
1513
+ variant: "secondary",
1514
+ disabled: r.value,
1515
+ onClick: (ie) => xe(_.id)
1516
+ }, {
1517
+ default: l(() => [
1518
+ g(t(a.value.disableSchedule), 1)
1519
+ ]),
1520
+ _: 1
1521
+ }, 8, ["disabled", "onClick"])) : m.value.admin ? (s(), x(e(U), {
1522
+ key: 1,
1523
+ variant: "secondary",
1524
+ disabled: r.value,
1525
+ onClick: (ie) => w.value = _
1526
+ }, {
1527
+ default: l(() => [
1528
+ g(t(a.value.enableSchedule), 1)
1529
+ ]),
1530
+ _: 1
1531
+ }, 8, ["disabled", "onClick"])) : h("", !0),
1532
+ d(e(U), {
1533
+ variant: "secondary",
1534
+ disabled: r.value,
1535
+ onClick: (ie) => c.value = _
1536
+ }, {
1537
+ default: l(() => [
1538
+ g(t(a.value.deleteSchedule), 1)
1539
+ ]),
1540
+ _: 1
1541
+ }, 8, ["disabled", "onClick"])
1542
+ ])
1543
+ ])
1544
+ ]),
1545
+ _: 2
1546
+ }, 1032, ["title", "data-schedule-id"]))), 128))
1547
+ ])) : (s(), V("p", qt, t(a.value.noSchedules), 1)),
1548
+ c.value ? (s(), x(e(X), {
1485
1549
  key: 3,
1486
1550
  tone: "warning"
1487
1551
  }, {
1488
- default: n(() => [
1489
- C("p", null, l(m(a.value.deleteScheduleConsent, { name: x.value.name })), 1),
1490
- C("div", Dl, [
1491
- h(e(A), {
1552
+ default: l(() => [
1553
+ $("p", null, t(o(a.value.deleteScheduleConsent, { name: c.value.name })), 1),
1554
+ $("div", Kt, [
1555
+ d(e(U), {
1492
1556
  variant: "danger",
1493
1557
  disabled: r.value,
1494
- onClick: ge
1558
+ onClick: ve
1495
1559
  }, {
1496
- default: n(() => [
1497
- g(l(a.value.confirmDeleteSchedule), 1)
1560
+ default: l(() => [
1561
+ g(t(a.value.confirmDeleteSchedule), 1)
1498
1562
  ]),
1499
1563
  _: 1
1500
1564
  }, 8, ["disabled"]),
1501
- h(e(A), {
1565
+ d(e(U), {
1502
1566
  variant: "secondary",
1503
1567
  disabled: r.value,
1504
- onClick: f[6] || (f[6] = (c) => x.value = void 0)
1568
+ onClick: B[6] || (B[6] = (_) => c.value = void 0)
1505
1569
  }, {
1506
- default: n(() => [
1507
- g(l(a.value.cancel), 1)
1570
+ default: l(() => [
1571
+ g(t(a.value.cancel), 1)
1508
1572
  ]),
1509
1573
  _: 1
1510
1574
  }, 8, ["disabled"])
1511
1575
  ])
1512
1576
  ]),
1513
1577
  _: 1
1514
- })) : k("", !0),
1515
- b.value ? (t(), $(e(Q), {
1578
+ })) : h("", !0),
1579
+ w.value ? (s(), x(e(X), {
1516
1580
  key: 4,
1517
1581
  tone: "warning"
1518
1582
  }, {
1519
- default: n(() => [
1520
- C("p", null, l(m(a.value.enableScheduleConsent, { name: b.value.name })), 1),
1521
- C("div", Tl, [
1522
- h(e(A), {
1583
+ default: l(() => [
1584
+ $("p", null, t(o(a.value.enableScheduleConsent, { name: w.value.name })), 1),
1585
+ $("div", Ht, [
1586
+ d(e(U), {
1523
1587
  variant: "primary",
1524
1588
  disabled: r.value,
1525
- onClick: we
1589
+ onClick: ce
1526
1590
  }, {
1527
- default: n(() => [
1528
- g(l(a.value.confirmEnableSchedule), 1)
1591
+ default: l(() => [
1592
+ g(t(a.value.confirmEnableSchedule), 1)
1529
1593
  ]),
1530
1594
  _: 1
1531
1595
  }, 8, ["disabled"]),
1532
- h(e(A), {
1596
+ d(e(U), {
1533
1597
  variant: "secondary",
1534
1598
  disabled: r.value,
1535
- onClick: f[7] || (f[7] = (c) => b.value = void 0)
1599
+ onClick: B[7] || (B[7] = (_) => w.value = void 0)
1536
1600
  }, {
1537
- default: n(() => [
1538
- g(l(a.value.cancel), 1)
1601
+ default: l(() => [
1602
+ g(t(a.value.cancel), 1)
1539
1603
  ]),
1540
1604
  _: 1
1541
1605
  }, 8, ["disabled"])
1542
1606
  ])
1543
1607
  ]),
1544
1608
  _: 1
1545
- })) : k("", !0)
1546
- ], 8, Cl),
1547
- q.value ? (t(), $(e(Ne), {
1609
+ })) : h("", !0)
1610
+ ], 8, Dt),
1611
+ O.value ? (s(), x(e(Ye), {
1548
1612
  key: 4,
1549
- href: q.value,
1550
- download: J.value
1613
+ href: O.value,
1614
+ download: Z.value
1551
1615
  }, {
1552
- default: n(() => [
1553
- g(l(a.value.download), 1)
1616
+ default: l(() => [
1617
+ g(t(a.value.download), 1)
1554
1618
  ]),
1555
1619
  _: 1
1556
- }, 8, ["href", "download"])) : k("", !0)
1557
- ], 64)) : k("", !0)
1620
+ }, 8, ["href", "download"])) : h("", !0)
1621
+ ], 64)) : h("", !0)
1558
1622
  ], 64))
1559
1623
  ]),
1560
1624
  _: 1
1561
- }, 8, ["aria-busy", "title"]));
1625
+ }, 8, ["aria-busy", "title", "description", "loading"]));
1562
1626
  }
1563
- }), It = /* @__PURE__ */ ne(El, [["__scopeId", "data-v-d845d0a7"]]), Rl = { role: "status" }, ql = { key: 1 }, Bl = { key: 2 }, Ut = /* @__PURE__ */ le({
1627
+ }), Xl = /* @__PURE__ */ ue(Gt, [["__scopeId", "data-v-fa2b6101"]]), Jt = { class: "executor-alert" }, Xt = {
1628
+ key: 1,
1629
+ class: "executor-summary"
1630
+ }, Qt = ["data-executor-status"], Yt = { class: "executor-help" }, Zt = {
1631
+ key: 0,
1632
+ class: "executor-hint"
1633
+ }, Wt = /* @__PURE__ */ oe({
1564
1634
  __name: "ExecutorSettings",
1565
1635
  props: {
1566
1636
  admin: { type: Boolean },
@@ -1568,301 +1638,381 @@ const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-locatio
1568
1638
  ctx: {}
1569
1639
  },
1570
1640
  emits: ["confirmed"],
1571
- setup(p, { emit: I }) {
1572
- const a = p, m = I, i = Ca(), d = F(() => Be(a.locale)), s = y(), o = y(""), r = y(!1), P = y(!1), v = y(!1), _ = y(), z = y(""), x = y([]), b = F(() => _.value?.scope_mode === "install-selected"), D = F(() => [{ label: d.value.homeScope, value: "home" }, ...x.value]), R = F(() => !b.value || !!z.value && D.value.some((O) => O.value === z.value)), L = F(() => b.value && !_.value?.selection), E = F(() => z.value !== _.value?.selection?.scope);
1573
- let q = !1;
1574
- async function J(O) {
1575
- const H = O ?? await i.status();
1576
- if (q || (s.value = H, !a.ctx)) return;
1577
- const W = await a.ctx.call("delegate.status");
1578
- if (q || (_.value = W, W.scope_mode !== "install-selected")) return;
1579
- const j = [];
1580
- let ee = 0;
1581
- for (let N = 0; N < 128; N++) {
1582
- const T = await a.ctx.call("bg.browse", { offset: ee });
1583
- if (q) return;
1584
- if (!Array.isArray(T.shares) || !Number.isSafeInteger(T.total) || T.total < 0 || !T.shares.length && ee < T.total) throw { code: "EXECUTOR_PROTOCOL" };
1585
- for (const B of T.shares)
1586
- B.isdir && B.path === "/" + B.name && !["home", "homes"].includes(B.name.toLowerCase()) && j.push({ label: B.name, value: "shared:" + B.name });
1587
- if (ee += T.shares.length, ee >= T.total) break;
1588
- if (N === 127) throw { code: "EXECUTOR_PROTOCOL" };
1641
+ setup(y, { expose: q, emit: f }) {
1642
+ const a = y, o = f, m = We(), i = L(() => Ke(a.locale)), n = b(), u = b(""), r = b(!1), v = b(!1), k = b(!1), D = b(), S = b(""), c = b([]), w = L(() => D.value?.scope_mode === "install-selected"), z = L(() => [{ label: i.value.homeScope, value: "home" }, ...c.value]), M = L(() => !w.value || !!S.value && z.value.some((Q) => Q.value === S.value)), N = L(() => w.value && !D.value?.selection), K = L(() => S.value !== D.value?.selection?.scope);
1643
+ let O = !1;
1644
+ async function Z(Q) {
1645
+ const Y = Q ?? await m.status();
1646
+ if (O || (n.value = Y, !a.ctx)) return;
1647
+ const G = await a.ctx.call("delegate.status");
1648
+ if (O || (D.value = G, G.scope_mode !== "install-selected")) return;
1649
+ const le = [];
1650
+ let R = 0;
1651
+ for (let T = 0; T < 128; T++) {
1652
+ const E = await a.ctx.call("bg.browse", { offset: R });
1653
+ if (O) return;
1654
+ if (!Array.isArray(E.shares) || !Number.isSafeInteger(E.total) || E.total < 0 || !E.shares.length && R < E.total) throw { code: "EXECUTOR_PROTOCOL" };
1655
+ for (const J of E.shares)
1656
+ J.isdir && J.path === "/" + J.name && !["home", "homes"].includes(J.name.toLowerCase()) && le.push({ label: J.name, value: "shared:" + J.name });
1657
+ if (R += E.shares.length, R >= E.total) break;
1658
+ if (T === 127) throw { code: "EXECUTOR_PROTOCOL" };
1589
1659
  }
1590
- x.value = j, z.value = W.selection?.scope ?? W.preselection ?? "";
1660
+ c.value = le, S.value = G.selection?.scope ?? G.preselection ?? "";
1591
1661
  }
1592
- async function G() {
1662
+ async function ae() {
1593
1663
  if (!(!a.admin || r.value)) {
1594
- r.value = !0, v.value = !1;
1664
+ r.value = !0, k.value = !1;
1595
1665
  try {
1596
- await J();
1666
+ await Z();
1597
1667
  } catch {
1598
- q || (v.value = !0);
1668
+ O || (k.value = !0);
1599
1669
  } finally {
1600
- q || (r.value = !1);
1670
+ O || (r.value = !1);
1601
1671
  }
1602
1672
  }
1603
1673
  }
1604
- async function K() {
1605
- if (!a.admin || r.value || !o.value || !R.value || v.value) return;
1606
- r.value = !0, v.value = !1;
1607
- const O = o.value;
1608
- o.value = "", P.value = !0;
1674
+ async function W() {
1675
+ if (!a.admin || r.value || !u.value || !M.value || k.value) return;
1676
+ r.value = !0, k.value = !1;
1677
+ const Q = u.value;
1678
+ u.value = "", v.value = !0;
1609
1679
  try {
1610
- let H = b.value ? await i.authorize(O, z.value) : await i.authorize(O);
1611
- await J(H), !q && b.value && H.state === "ready" && L.value && (H = await i.authorize(O, z.value), await J(H)), q || m("confirmed");
1680
+ let Y = w.value ? await m.authorize(Q, S.value) : await m.authorize(Q);
1681
+ await Z(Y), !O && w.value && Y.state === "ready" && N.value && (Y = await m.authorize(Q, S.value), await Z(Y)), O || o("confirmed");
1612
1682
  } catch {
1613
- q || (v.value = !0);
1683
+ O || (k.value = !0);
1614
1684
  } finally {
1615
- q || (r.value = !1, P.value = !1);
1685
+ O || (r.value = !1, v.value = !1);
1616
1686
  }
1617
1687
  }
1618
- return ve(() => {
1619
- i.subscribe?.((O) => {
1620
- q || (s.value = O);
1621
- }), G();
1622
- }), ue(() => {
1623
- q = !0, o.value = "";
1624
- }), (O, H) => p.admin ? (t(), $(e(ce), {
1688
+ const H = L(() => v.value ? "confirming" : n.value ? n.value.state === "ready" ? N.value ? "scope" : "ready" : n.value.state === "needs-admin-approval" ? "needs" : "blocked" : void 0), j = L(() => ({ ready: { tone: "success", text: i.value.statusReady }, scope: { tone: "warning", text: i.value.statusScope }, needs: { tone: "warning", text: i.value.statusNeeds }, blocked: { tone: "danger", text: i.value.statusBlocked }, confirming: { tone: "info", text: i.value.statusConfirming } })[H.value ?? "confirming"]), te = L(() => w.value && !!D.value?.selection && !K.value), se = L(() => r.value || k.value ? "" : te.value ? i.value.hintUnchanged : u.value ? "" : i.value.hintPassword);
1689
+ return q({ refresh: ae }), ge(() => {
1690
+ m.subscribe?.((Q) => {
1691
+ O || (n.value = Q);
1692
+ }), ae();
1693
+ }), ye(() => {
1694
+ O = !0, u.value = "";
1695
+ }), (Q, Y) => y.admin ? (s(), x(e(he), {
1625
1696
  key: 0,
1626
- title: d.value.setupTitle,
1697
+ title: i.value.setupTitle,
1698
+ description: i.value.setupHelp,
1699
+ loading: !n.value && !v.value && !k.value,
1627
1700
  collapsible: !1,
1628
1701
  "aria-busy": r.value
1629
1702
  }, {
1630
- default: n(() => [
1631
- C("p", null, l(d.value.setupHelp), 1),
1632
- v.value ? (t(), $(e(Q), {
1703
+ default: l(() => [
1704
+ k.value ? (s(), x(e(X), {
1633
1705
  key: 0,
1634
1706
  tone: "danger",
1635
1707
  role: "alert"
1636
1708
  }, {
1637
- default: n(() => [
1638
- g(l(d.value.setupError), 1)
1709
+ default: l(() => [
1710
+ $("span", Jt, [
1711
+ g(t(i.value.setupError), 1),
1712
+ d(e(U), {
1713
+ variant: "secondary",
1714
+ size: "sm",
1715
+ disabled: r.value,
1716
+ onClick: ae
1717
+ }, {
1718
+ default: l(() => [
1719
+ g(t(i.value.retry), 1)
1720
+ ]),
1721
+ _: 1
1722
+ }, 8, ["disabled"])
1723
+ ])
1639
1724
  ]),
1640
1725
  _: 1
1641
- })) : k("", !0),
1642
- C("p", Rl, l(P.value ? d.value.confirming : s.value ? s.value.state === "ready" ? L.value ? d.value.scopeNeeds : d.value.ready : s.value.state === "needs-admin-approval" ? d.value.needs : d.value.blocked : d.value.loading), 1),
1643
- s.value?.reason && (s.value.state === "blocked" || s.value.state === "unsupported") ? (t(), S("p", ql, l(d.value.details) + ": " + l(s.value.reason), 1)) : k("", !0),
1644
- _.value?.selection ? (t(), S("p", Bl, l(d.value.protectedScope) + ": " + l(_.value.selection.root), 1)) : k("", !0),
1645
- _.value?.mismatch ? (t(), $(e(Q), {
1726
+ })) : h("", !0),
1727
+ n.value || v.value ? (s(), V("div", Xt, [
1728
+ d(e(Ce), {
1729
+ label: i.value.status,
1730
+ "label-width": "10rem"
1731
+ }, {
1732
+ default: l(() => [
1733
+ $("span", {
1734
+ role: "status",
1735
+ "data-executor-status": H.value
1736
+ }, [
1737
+ d(e($e), {
1738
+ tone: j.value.tone
1739
+ }, {
1740
+ default: l(() => [
1741
+ g(t(j.value.text), 1)
1742
+ ]),
1743
+ _: 1
1744
+ }, 8, ["tone"])
1745
+ ], 8, Qt)
1746
+ ]),
1747
+ _: 1
1748
+ }, 8, ["label"]),
1749
+ n.value?.reason && (n.value.state === "blocked" || n.value.state === "unsupported") ? (s(), x(e(Ce), {
1750
+ key: 0,
1751
+ label: i.value.details,
1752
+ "label-width": "10rem"
1753
+ }, {
1754
+ default: l(() => [
1755
+ g(t(n.value.reason), 1)
1756
+ ]),
1757
+ _: 1
1758
+ }, 8, ["label"])) : h("", !0),
1759
+ D.value?.selection ? (s(), x(e(Ce), {
1760
+ key: 1,
1761
+ label: i.value.protectedScope,
1762
+ "label-width": "10rem"
1763
+ }, {
1764
+ default: l(() => [
1765
+ d(e(pe), {
1766
+ path: D.value.selection.root
1767
+ }, null, 8, ["path"])
1768
+ ]),
1769
+ _: 1
1770
+ }, 8, ["label"])) : h("", !0)
1771
+ ])) : h("", !0),
1772
+ H.value === "needs" ? (s(), x(e(X), {
1773
+ key: 2,
1774
+ tone: "info"
1775
+ }, {
1776
+ default: l(() => [
1777
+ g(t(i.value.needs), 1)
1778
+ ]),
1779
+ _: 1
1780
+ })) : H.value === "scope" ? (s(), x(e(X), {
1646
1781
  key: 3,
1647
1782
  tone: "warning"
1648
1783
  }, {
1649
- default: n(() => [
1650
- g(l(d.value.scopeMismatch) + " " + l(d.value.preselection) + ": " + l(_.value.preselection) + " · " + l(d.value.protectedScope) + ": " + l(_.value.selection?.root), 1)
1784
+ default: l(() => [
1785
+ g(t(i.value.scopeNeeds), 1)
1651
1786
  ]),
1652
1787
  _: 1
1653
- })) : k("", !0),
1654
- s.value?.state === "needs-admin-approval" || s.value?.retry || b.value && s.value?.state === "ready" ? (t(), $(e(be), {
1788
+ })) : H.value === "blocked" ? (s(), x(e(X), {
1655
1789
  key: 4,
1656
- onSubmit: me(K, ["prevent"])
1790
+ tone: "warning"
1791
+ }, {
1792
+ default: l(() => [
1793
+ g(t(i.value.blocked), 1)
1794
+ ]),
1795
+ _: 1
1796
+ })) : h("", !0),
1797
+ D.value?.mismatch ? (s(), x(e(X), {
1798
+ key: 5,
1799
+ tone: "warning"
1800
+ }, {
1801
+ default: l(() => [
1802
+ g(t(i.value.scopeMismatch), 1)
1803
+ ]),
1804
+ _: 1
1805
+ })) : h("", !0),
1806
+ n.value?.state === "needs-admin-approval" || n.value?.retry || w.value && n.value?.state === "ready" ? (s(), x(e(ze), {
1807
+ key: 6,
1808
+ direction: "vertical",
1809
+ class: "executor-form",
1810
+ onSubmit: Se(W, ["prevent"])
1657
1811
  }, {
1658
- default: n(() => [
1659
- b.value ? (t(), S(Z, { key: 0 }, [
1660
- C("p", null, l(_.value?.selection ? d.value.scopeChangeHelp : d.value.preselectionHelp), 1),
1661
- h(e(oe), {
1662
- label: d.value.scopeLabel,
1812
+ default: l(() => [
1813
+ w.value ? (s(), V(ne, { key: 0 }, [
1814
+ $("p", Yt, t(D.value?.selection ? i.value.scopeChangeHelp : i.value.preselectionHelp), 1),
1815
+ d(e(fe), {
1816
+ label: i.value.scopeLabel,
1663
1817
  "label-for": "delegate-scope"
1664
1818
  }, {
1665
- default: n(() => [
1666
- h(e(Me), {
1819
+ default: l(() => [
1820
+ d(e(Ze), {
1667
1821
  id: "delegate-scope",
1668
- modelValue: z.value,
1669
- "onUpdate:modelValue": H[0] || (H[0] = (W) => z.value = W),
1670
- options: D.value,
1671
- disabled: r.value || v.value
1822
+ modelValue: S.value,
1823
+ "onUpdate:modelValue": Y[0] || (Y[0] = (G) => S.value = G),
1824
+ options: z.value,
1825
+ disabled: r.value || k.value
1672
1826
  }, null, 8, ["modelValue", "options", "disabled"])
1673
1827
  ]),
1674
1828
  _: 1
1675
1829
  }, 8, ["label"])
1676
- ], 64)) : k("", !0),
1677
- h(e(oe), {
1678
- label: d.value.password,
1830
+ ], 64)) : h("", !0),
1831
+ d(e(fe), {
1832
+ label: i.value.password,
1679
1833
  "label-for": "delegate-password"
1680
1834
  }, {
1681
- default: n(() => [
1682
- h(e(pe), {
1835
+ default: l(() => [
1836
+ d(e(_e), {
1683
1837
  id: "delegate-password",
1684
- modelValue: o.value,
1685
- "onUpdate:modelValue": H[1] || (H[1] = (W) => o.value = W),
1838
+ modelValue: u.value,
1839
+ "onUpdate:modelValue": Y[1] || (Y[1] = (G) => u.value = G),
1686
1840
  type: "password",
1687
1841
  autocomplete: "current-password",
1688
- disabled: r.value || v.value
1842
+ disabled: r.value || k.value
1689
1843
  }, null, 8, ["modelValue", "disabled"])
1690
1844
  ]),
1691
1845
  _: 1
1692
1846
  }, 8, ["label"]),
1693
- h(e(ke), null, {
1694
- default: n(() => [
1695
- h(e(A), {
1847
+ d(e(Pe), null, {
1848
+ default: l(() => [
1849
+ d(e(U), {
1696
1850
  type: "submit",
1697
1851
  variant: "primary",
1698
- disabled: r.value || v.value || !o.value || !R.value || b.value && !!_.value?.selection && !E.value
1852
+ disabled: r.value || k.value || !u.value || !M.value || te.value
1699
1853
  }, {
1700
- default: n(() => [
1701
- g(l(b.value ? _.value?.selection ? d.value.confirmScope : d.value.confirmShare : d.value.authorize), 1)
1854
+ default: l(() => [
1855
+ g(t(w.value ? D.value?.selection ? i.value.confirmScope : i.value.confirmShare : i.value.authorize), 1)
1702
1856
  ]),
1703
1857
  _: 1
1704
- }, 8, ["disabled"])
1858
+ }, 8, ["disabled"]),
1859
+ se.value ? (s(), V("span", Zt, t(se.value), 1)) : h("", !0)
1705
1860
  ]),
1706
1861
  _: 1
1707
1862
  })
1708
1863
  ]),
1709
1864
  _: 1
1710
- })) : k("", !0),
1711
- h(e(A), {
1712
- variant: "secondary",
1713
- disabled: r.value,
1714
- onClick: G
1715
- }, {
1716
- default: n(() => [
1717
- g(l(d.value.refresh), 1)
1718
- ]),
1719
- _: 1
1720
- }, 8, ["disabled"])
1865
+ })) : h("", !0)
1721
1866
  ]),
1722
1867
  _: 1
1723
- }, 8, ["title", "aria-busy"])) : k("", !0);
1868
+ }, 8, ["title", "description", "loading", "aria-busy"])) : h("", !0);
1724
1869
  }
1725
- }), Ol = {
1870
+ }), Ql = /* @__PURE__ */ ue(Wt, [["__scopeId", "data-v-868f9f3a"]]), jt = {
1726
1871
  key: 1,
1727
1872
  role: "status"
1728
- }, Fl = {
1873
+ }, el = {
1729
1874
  key: 2,
1730
1875
  role: "status"
1731
- }, Ll = {
1876
+ }, al = {
1732
1877
  key: 0,
1733
1878
  role: "status",
1734
1879
  class: "destination"
1735
- }, Nl = { class: "section-heading" }, Ml = { key: 3 }, Kl = {
1880
+ }, tl = { key: 3 }, ll = {
1736
1881
  key: 4,
1737
1882
  class: "records"
1738
- }, Hl = ["data-job-state"], Gl = ["role"], Jl = { key: 5 }, Xl = {
1883
+ }, sl = ["data-job-state"], nl = ["role"], il = { key: 5 }, ol = {
1739
1884
  key: 6,
1740
1885
  class: "records"
1741
- }, Ql = /* @__PURE__ */ le({
1886
+ }, ul = /* @__PURE__ */ oe({
1742
1887
  __name: "DelegatePanel",
1743
1888
  props: {
1744
1889
  ctx: {}
1745
1890
  },
1746
- setup(p) {
1747
- const I = p, a = F(() => Be(I.ctx.locale)), m = qe(I.ctx), i = y(), d = y([]), s = y([]), o = y(!1), r = y(), P = y(""), v = y(!1), _ = y(""), z = y(""), x = y("");
1748
- let b = !1, D, R;
1749
- Fe([z, _, x], () => {
1750
- R = void 0;
1891
+ setup(y, { expose: q }) {
1892
+ const f = y, a = L(() => Ke(f.ctx.locale)), o = L(() => He(f.ctx.locale)), m = Me(f.ctx), i = b(), n = b([]), u = b([]), r = b(!1), v = b(), k = b(""), D = b(!1), S = b(""), c = b(""), w = b("");
1893
+ let z = !1, M, N;
1894
+ Je([c, S, w], () => {
1895
+ N = void 0;
1751
1896
  }, { flush: "sync" });
1752
- const L = (B) => ["queued", "running", "waiting_executor"].includes(B.state), E = F(() => s.value.some((B) => B.state === "waiting_executor")), q = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], J = F(() => E.value && q.includes(r.value?.code ?? "")), G = F(() => i.value && i.value.state !== "ready" && !(E.value && i.value.state === "needs-admin-approval" && q.includes(i.value.reason ?? "")));
1753
- async function K() {
1754
- if (b) return;
1755
- const [B, w, U] = await Promise.allSettled([I.ctx.call("delegate.status"), I.ctx.call("delegate.list"), I.ctx.call("delegate.jobs.list")]);
1756
- if (!b) {
1757
- B.status === "fulfilled" && (i.value = B.value), w.status === "fulfilled" && (d.value = (w.value.delegations ?? []).filter((M) => !M.revoked)), U.status === "fulfilled" && (s.value = U.value.jobs ?? []);
1758
- for (const M of [B, w, U]) if (M.status === "rejected") throw M.reason;
1897
+ const K = (R) => ["queued", "running", "waiting_executor"].includes(R.state), O = L(() => u.value.some((R) => R.state === "waiting_executor")), Z = ["EXECUTOR_UNAVAILABLE", "EXECUTOR_TIMEOUT"], ae = L(() => O.value && Z.includes(v.value?.code ?? "")), W = L(() => i.value && i.value.state !== "ready" && !(O.value && i.value.state === "needs-admin-approval" && Z.includes(i.value.reason ?? "")));
1898
+ async function H() {
1899
+ if (z) return;
1900
+ const [R, T, E] = await Promise.allSettled([f.ctx.call("delegate.status"), f.ctx.call("delegate.list"), f.ctx.call("delegate.jobs.list")]);
1901
+ if (!z) {
1902
+ R.status === "fulfilled" && (i.value = R.value), T.status === "fulfilled" && (n.value = (T.value.delegations ?? []).filter((J) => !J.revoked)), E.status === "fulfilled" && (u.value = E.value.jobs ?? []);
1903
+ for (const J of [R, T, E]) if (J.status === "rejected") throw J.reason;
1759
1904
  }
1760
1905
  }
1761
- async function O(B) {
1762
- if (!(o.value || b)) {
1763
- o.value = !0, r.value = void 0;
1906
+ async function j(R) {
1907
+ if (!(r.value || z)) {
1908
+ r.value = !0, v.value = void 0;
1764
1909
  try {
1765
- await B();
1766
- } catch (w) {
1767
- b || (r.value = w);
1910
+ await R();
1911
+ } catch (T) {
1912
+ z || (v.value = T);
1768
1913
  } finally {
1769
- b || (o.value = !1);
1914
+ z || (r.value = !1);
1770
1915
  }
1771
1916
  }
1772
1917
  }
1773
- const H = () => O(K), W = (B) => O(async () => {
1774
- await I.ctx.call("delegate.revoke", { delegation_id: B }), await K();
1775
- }), j = (B) => O(async () => {
1776
- const w = await I.ctx.call("delegate.jobs.cancel", { id: B });
1777
- b || (P.value = w.revocation_pending ? a.value.pending : ""), await K();
1778
- }), ee = F(() => i.value?.state === "ready" && !!_.value && !!z.value && !!x.value), N = () => O(async () => {
1779
- ee.value && (await I.ctx.call("delegate.jobs.submit", { key: R ?? (R = crypto.randomUUID()), url: z.value, dest: _.value, name: x.value }), b || (z.value = "", x.value = "", _.value = ""), await K());
1780
- }), T = (B) => {
1781
- const w = new Date(B);
1782
- return Number.isNaN(w.getTime()) ? "—" : w.toLocaleString(I.ctx.locale);
1918
+ const te = () => j(H), se = (R) => j(async () => {
1919
+ await f.ctx.call("delegate.revoke", { delegation_id: R }), await H();
1920
+ }), Q = (R) => j(async () => {
1921
+ const T = await f.ctx.call("delegate.jobs.cancel", { id: R });
1922
+ z || (k.value = T.revocation_pending ? a.value.pending : ""), await H();
1923
+ }), Y = L(() => i.value?.state === "ready" && !!S.value && !!c.value && !!w.value), G = () => j(async () => {
1924
+ Y.value && (await f.ctx.call("delegate.jobs.submit", { key: N ?? (N = crypto.randomUUID()), url: c.value, dest: S.value, name: w.value }), z || (c.value = "", w.value = "", S.value = ""), await H());
1925
+ }), le = (R) => {
1926
+ const T = new Date(R);
1927
+ return Number.isNaN(T.getTime()) ? "—" : T.toLocaleString(f.ctx.locale);
1783
1928
  };
1784
- return ve(() => {
1785
- H(), D = setInterval(() => {
1786
- s.value.some(L) && H();
1929
+ return q({ refresh: te }), ge(() => {
1930
+ te(), M = setInterval(() => {
1931
+ u.value.some(K) && te();
1787
1932
  }, 3e3);
1788
- }), ue(() => {
1789
- b = !0, D && clearInterval(D), m.dispose();
1790
- }), (B, w) => (t(), $(e(ce), {
1933
+ }), ye(() => {
1934
+ z = !0, M && clearInterval(M), m.dispose();
1935
+ }), (R, T) => (s(), x(e(he), {
1791
1936
  title: a.value.title,
1937
+ description: a.value.help,
1938
+ loading: !i.value && r.value,
1792
1939
  collapsible: !1,
1793
- "aria-busy": o.value,
1940
+ "aria-busy": r.value,
1794
1941
  class: "delegate-panel"
1795
1942
  }, {
1796
- default: n(() => [
1797
- C("p", null, l(a.value.help), 1),
1798
- r.value && !J.value ? (t(), $(e(Q), {
1943
+ default: l(() => [
1944
+ v.value && !ae.value ? (s(), x(e(X), {
1799
1945
  key: 0,
1800
1946
  tone: "danger",
1801
1947
  role: "alert"
1802
1948
  }, {
1803
- default: n(() => [
1804
- g(l(e(je)(r.value, a.value)), 1)
1949
+ default: l(() => [
1950
+ g(t(e(oa)(v.value, a.value)), 1)
1805
1951
  ]),
1806
1952
  _: 1
1807
- })) : k("", !0),
1808
- P.value ? (t(), S("p", Ol, l(P.value), 1)) : k("", !0),
1809
- G.value ? (t(), S("p", Fl, l(i.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : k("", !0),
1810
- h(e(be), {
1811
- onSubmit: me(N, ["prevent"])
1953
+ })) : h("", !0),
1954
+ k.value ? (s(), V("p", jt, t(k.value), 1)) : h("", !0),
1955
+ W.value ? (s(), V("p", el, t(i.value?.state === "needs-admin-approval" ? a.value.needs : a.value.blocked), 1)) : h("", !0),
1956
+ d(e(ze), {
1957
+ direction: "vertical",
1958
+ onSubmit: Se(G, ["prevent"])
1812
1959
  }, {
1813
- default: n(() => [
1814
- h(e(oe), {
1960
+ default: l(() => [
1961
+ d(e(fe), {
1815
1962
  label: a.value.url,
1816
1963
  "label-for": "delegate-url"
1817
1964
  }, {
1818
- default: n(() => [
1819
- h(e(pe), {
1965
+ default: l(() => [
1966
+ d(e(_e), {
1820
1967
  id: "delegate-url",
1821
- modelValue: z.value,
1822
- "onUpdate:modelValue": w[0] || (w[0] = (U) => z.value = U),
1968
+ modelValue: c.value,
1969
+ "onUpdate:modelValue": T[0] || (T[0] = (E) => c.value = E),
1823
1970
  type: "url",
1824
- disabled: o.value || i.value?.state !== "ready"
1971
+ disabled: r.value || i.value?.state !== "ready"
1825
1972
  }, null, 8, ["modelValue", "disabled"])
1826
1973
  ]),
1827
1974
  _: 1
1828
1975
  }, 8, ["label"]),
1829
- h(e(oe), {
1976
+ d(e(fe), {
1830
1977
  label: a.value.name,
1831
1978
  "label-for": "delegate-name"
1832
1979
  }, {
1833
- default: n(() => [
1834
- h(e(pe), {
1980
+ default: l(() => [
1981
+ d(e(_e), {
1835
1982
  id: "delegate-name",
1836
- modelValue: x.value,
1837
- "onUpdate:modelValue": w[1] || (w[1] = (U) => x.value = U),
1983
+ modelValue: w.value,
1984
+ "onUpdate:modelValue": T[1] || (T[1] = (E) => w.value = E),
1838
1985
  "data-file-name": "",
1839
- disabled: o.value || i.value?.state !== "ready"
1986
+ disabled: r.value || i.value?.state !== "ready"
1840
1987
  }, null, 8, ["modelValue", "disabled"])
1841
1988
  ]),
1842
1989
  _: 1
1843
1990
  }, 8, ["label"]),
1844
- C("p", null, l(a.value.size), 1),
1845
- _.value ? (t(), S("p", Ll, l(a.value.destination) + ": " + l(_.value), 1)) : k("", !0),
1846
- h(e(ke), null, {
1847
- default: n(() => [
1848
- h(e(A), {
1991
+ $("p", null, t(a.value.size), 1),
1992
+ S.value ? (s(), V("p", al, [
1993
+ g(t(a.value.destination) + t(o.value), 1),
1994
+ d(e(pe), { path: S.value }, null, 8, ["path"])
1995
+ ])) : h("", !0),
1996
+ d(e(Pe), null, {
1997
+ default: l(() => [
1998
+ d(e(U), {
1849
1999
  type: "button",
1850
2000
  variant: "secondary",
1851
- disabled: o.value || i.value?.state !== "ready",
1852
- onClick: w[2] || (w[2] = (U) => v.value = !0)
2001
+ disabled: r.value || i.value?.state !== "ready",
2002
+ onClick: T[2] || (T[2] = (E) => D.value = !0)
1853
2003
  }, {
1854
- default: n(() => [
1855
- g(l(a.value.choose), 1)
2004
+ default: l(() => [
2005
+ g(t(a.value.choose), 1)
1856
2006
  ]),
1857
2007
  _: 1
1858
2008
  }, 8, ["disabled"]),
1859
- h(e(A), {
2009
+ d(e(U), {
1860
2010
  type: "submit",
1861
2011
  variant: "primary",
1862
- disabled: o.value || !ee.value
2012
+ disabled: r.value || !Y.value
1863
2013
  }, {
1864
- default: n(() => [
1865
- g(l(a.value.submit), 1)
2014
+ default: l(() => [
2015
+ g(t(a.value.submit), 1)
1866
2016
  ]),
1867
2017
  _: 1
1868
2018
  }, 8, ["disabled"])
@@ -1872,64 +2022,54 @@ const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-locatio
1872
2022
  ]),
1873
2023
  _: 1
1874
2024
  }),
1875
- h(_e, {
1876
- open: v.value,
1877
- "onUpdate:open": w[3] || (w[3] = (U) => v.value = U),
1878
- locale: p.ctx.locale,
2025
+ d(Te, {
2026
+ open: D.value,
2027
+ "onUpdate:open": T[3] || (T[3] = (E) => D.value = E),
2028
+ locale: y.ctx.locale,
1879
2029
  provider: e(m),
1880
2030
  mode: "folder",
1881
- onSelected: w[4] || (w[4] = (U) => _.value = U)
2031
+ onSelected: T[4] || (T[4] = (E) => S.value = E)
1882
2032
  }, null, 8, ["open", "locale", "provider"]),
1883
- C("div", Nl, [
1884
- C("h3", null, l(a.value.downloads), 1),
1885
- h(e(A), {
1886
- variant: "secondary",
1887
- disabled: o.value,
1888
- onClick: H
1889
- }, {
1890
- default: n(() => [
1891
- g(l(a.value.refresh), 1)
1892
- ]),
1893
- _: 1
1894
- }, 8, ["disabled"])
1895
- ]),
1896
- !s.value.length && !r.value ? (t(), S("p", Ml, l(a.value.noJobs), 1)) : (t(), S("ul", Kl, [
1897
- (t(!0), S(Z, null, de(s.value, (U) => (t(), S("li", {
1898
- key: U.id,
1899
- "data-job-state": U.state
2033
+ $("h3", null, t(a.value.downloads), 1),
2034
+ !u.value.length && !v.value ? (s(), V("p", tl, t(a.value.noJobs), 1)) : (s(), V("ul", ll, [
2035
+ (s(!0), V(ne, null, ke(u.value, (E) => (s(), V("li", {
2036
+ key: E.id,
2037
+ "data-job-state": E.state
1900
2038
  }, [
1901
- C("span", {
1902
- role: U.state === "waiting_executor" ? "status" : void 0
1903
- }, l(U.name) + " · " + l(a.value[U.state]), 9, Gl),
1904
- L(U) ? (t(), $(e(A), {
2039
+ $("span", {
2040
+ role: E.state === "waiting_executor" ? "status" : void 0
2041
+ }, t(E.name) + " · " + t(a.value[E.state]), 9, nl),
2042
+ K(E) ? (s(), x(e(U), {
1905
2043
  key: 0,
1906
2044
  variant: "secondary",
1907
- disabled: o.value,
1908
- onClick: (M) => j(U.id)
2045
+ disabled: r.value,
2046
+ onClick: (J) => Q(E.id)
1909
2047
  }, {
1910
- default: n(() => [
1911
- g(l(a.value.cancel), 1)
2048
+ default: l(() => [
2049
+ g(t(a.value.cancel), 1)
1912
2050
  ]),
1913
2051
  _: 1
1914
- }, 8, ["disabled", "onClick"])) : k("", !0)
1915
- ], 8, Hl))), 128))
2052
+ }, 8, ["disabled", "onClick"])) : h("", !0)
2053
+ ], 8, sl))), 128))
1916
2054
  ])),
1917
- C("h3", null, l(a.value.delegations), 1),
1918
- !d.value.length && !r.value ? (t(), S("p", Jl, l(a.value.noDelegations), 1)) : (t(), S("ul", Xl, [
1919
- (t(!0), S(Z, null, de(d.value, (U) => (t(), S("li", {
1920
- key: U.delegation_id
2055
+ $("h3", null, t(a.value.delegations), 1),
2056
+ !n.value.length && !v.value ? (s(), V("p", il, t(a.value.noDelegations), 1)) : (s(), V("ul", ol, [
2057
+ (s(!0), V(ne, null, ke(n.value, (E) => (s(), V("li", {
2058
+ key: E.delegation_id
1921
2059
  }, [
1922
- C("div", null, [
1923
- C("strong", null, l(U.path), 1),
1924
- C("p", null, l(a.value.expires) + ": " + l(T(U.expires_at)), 1)
2060
+ $("div", null, [
2061
+ d(e(pe), {
2062
+ path: E.path
2063
+ }, null, 8, ["path"]),
2064
+ $("p", null, t(a.value.expires) + t(o.value) + t(le(E.expires_at)), 1)
1925
2065
  ]),
1926
- h(e(A), {
2066
+ d(e(U), {
1927
2067
  variant: "secondary",
1928
- disabled: o.value,
1929
- onClick: (M) => W(U.delegation_id)
2068
+ disabled: r.value,
2069
+ onClick: (J) => se(E.delegation_id)
1930
2070
  }, {
1931
- default: n(() => [
1932
- g(l(a.value.revoke), 1)
2071
+ default: l(() => [
2072
+ g(t(a.value.revoke), 1)
1933
2073
  ]),
1934
2074
  _: 1
1935
2075
  }, 8, ["disabled", "onClick"])
@@ -1937,460 +2077,570 @@ const za = ["aria-busy", "aria-label"], Pa = { class: "file-toolbar file-locatio
1937
2077
  ]))
1938
2078
  ]),
1939
2079
  _: 1
1940
- }, 8, ["title", "aria-busy"]));
2080
+ }, 8, ["title", "description", "loading", "aria-busy"]));
1941
2081
  }
1942
- }), At = /* @__PURE__ */ ne(Ql, [["__scopeId", "data-v-d79ee942"]]), Yl = {
1943
- key: 1,
1944
- role: "status"
1945
- }, Wl = {
2082
+ }), Yl = /* @__PURE__ */ ue(ul, [["__scopeId", "data-v-c590f505"]]), rl = { class: "save-alert" }, dl = { "data-save-error": "" }, vl = {
1946
2083
  key: 2,
1947
- role: "status"
1948
- }, Zl = { key: 3 }, jl = {
2084
+ class: "save-summary"
2085
+ }, cl = ["data-save-status"], pl = {
1949
2086
  key: 7,
1950
- role: "status"
1951
- }, et = { class: "save-actions" }, at = { key: 8 }, lt = {
1952
- key: 10,
2087
+ class: "save-help"
2088
+ }, fl = {
2089
+ key: 8,
2090
+ class: "save-records"
2091
+ }, yl = { class: "save-record" }, ml = { class: "save-note" }, bl = {
2092
+ key: 9,
1953
2093
  class: "save-actions"
1954
- }, tt = { key: 12 }, nt = { class: "save-records" }, st = { class: "save-actions" }, it = { key: 14 }, ot = { class: "save-records" }, ut = ["data-job-id", "data-save-state"], rt = { key: 0 }, dt = { key: 3 }, vt = /* @__PURE__ */ le({
2094
+ }, gl = {
2095
+ key: 11,
2096
+ class: "save-example"
2097
+ }, hl = { class: "save-help" }, kl = { class: "save-actions" }, _l = {
2098
+ key: 12,
2099
+ class: "save-help"
2100
+ }, wl = {
2101
+ key: 13,
2102
+ "data-save-operations": ""
2103
+ }, xl = ["data-save-job", "title"], Cl = {
2104
+ key: 0,
2105
+ class: "save-note"
2106
+ }, $l = {
2107
+ key: 1,
2108
+ class: "save-note"
2109
+ }, Sl = ["data-save-state"], zl = { key: 1 }, Pl = {
2110
+ class: "save-danger",
2111
+ "data-save-danger": ""
2112
+ }, Ve = 10, Vl = /* @__PURE__ */ oe({
1955
2113
  __name: "BackgroundSavePanel",
1956
2114
  props: {
1957
2115
  sdk: {},
1958
2116
  admin: { type: Boolean },
1959
2117
  locale: {},
1960
- picker: {}
2118
+ picker: {},
2119
+ pickerErrorText: { type: Function },
2120
+ sampleSave: { type: Boolean }
1961
2121
  },
1962
2122
  emits: ["authorized"],
1963
- setup(p, { emit: I }) {
1964
- const a = p, m = I, i = y(!1), d = y(""), s = F(() => Re(a.locale)), o = y(), r = y([]), P = y([]), v = y(!1), _ = y(), z = y(""), x = y([]), b = F(() => a.picker && (o.value?.selection ? ea(a.picker.provider, o.value.selection.root) : o.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider));
1965
- let D = !1, R;
1966
- const L = (T) => T.state === "copying" && T.code === "CANCEL_REQUESTED", E = (T) => L(T) ? "canceling" : T.state === "committed" && !T.receipt?.path ? "uncertain" : T.state, q = (T) => ["queued", "copying"].includes(T.state) && !L(T);
1967
- function J() {
1968
- o.value = void 0, r.value = [], P.value = [], x.value = [], i.value = !1;
2123
+ setup(y, { expose: q, emit: f }) {
2124
+ const a = y, o = f, m = b(!1), i = b(""), n = L(() => Ne(a.locale)), u = b(), r = b([]), v = b([]), k = b(!1), D = b(), S = b(""), c = b(!1), w = b([]), z = L(() => a.picker && (u.value?.selection ? ua(a.picker.provider, u.value.selection.root) : u.value?.scopeMode === "install-selected" ? void 0 : a.picker.provider));
2125
+ let M = !1, N;
2126
+ const K = (F) => F.state === "copying" && F.code === "CANCEL_REQUESTED", O = (F) => K(F) ? "canceling" : F.state === "committed" && !F.receipt?.path ? "uncertain" : F.state, Z = (F) => ["queued", "copying"].includes(F.state) && !K(F);
2127
+ function ae() {
2128
+ u.value = void 0, r.value = [], v.value = [], w.value = [], m.value = !1;
1969
2129
  }
1970
- async function G() {
1971
- const [T, B, w, U] = await Promise.all([a.sdk.status(), a.sdk.list(), a.sdk.operations(), Promise.all((a.picker?.keys ?? []).map((M) => a.sdk.destination(M)))]);
1972
- if (!D) {
1973
- if (!T || typeof T.disabled != "boolean" || !Array.isArray(B) || !Array.isArray(w)) throw { code: "unavailable" };
1974
- (o.value?.selection?.generation !== T.selection?.generation || o.value?.selection?.scope !== T.selection?.scope) && (i.value = !1), o.value = T, r.value = U.length ? B.filter((M) => U.some((Y) => Y.status === "active" && Y.destination?.id === M.id)) : B, P.value = w, x.value = U;
2130
+ async function W() {
2131
+ const [F, ee, A, C] = await Promise.all([a.sdk.status(), a.sdk.list(), a.sdk.operations(), Promise.all((a.picker?.keys ?? []).map((P) => a.sdk.destination(P)))]);
2132
+ if (!M) {
2133
+ if (!F || typeof F.disabled != "boolean" || !Array.isArray(ee) || !Array.isArray(A)) throw { code: "unavailable" };
2134
+ (u.value?.selection?.generation !== F.selection?.generation || u.value?.selection?.scope !== F.selection?.scope) && (m.value = !1), u.value = F, r.value = C.length ? ee.filter((P) => C.some((I) => I.status === "active" && I.destination?.id === P.id)) : ee, v.value = A, w.value = C;
1975
2135
  }
1976
2136
  }
1977
- async function K(T) {
1978
- if (!(D || v.value)) {
1979
- v.value = !0, _.value = void 0, z.value = "";
2137
+ async function H(F) {
2138
+ if (!(M || k.value)) {
2139
+ k.value = !0, D.value = void 0, S.value = "", c.value = !1;
1980
2140
  try {
1981
- await T();
1982
- } catch (B) {
1983
- D || (J(), _.value = B);
2141
+ await F();
2142
+ } catch (ee) {
2143
+ M || (ae(), D.value = ee);
1984
2144
  } finally {
1985
- D || (v.value = !1);
2145
+ M || (k.value = !1);
1986
2146
  }
1987
2147
  }
1988
2148
  }
1989
- const O = () => K(G);
1990
- function H(T) {
1991
- m("authorized", T), O();
2149
+ const j = () => H(W);
2150
+ function te(F) {
2151
+ o("authorized", F), j();
1992
2152
  }
1993
- const W = (T) => K(async () => {
1994
- if ((await a.sdk.revoke({ delegation_id: T }))?.revoked !== !0) throw { code: "commit-uncertain" };
1995
- await G(), D || (z.value = s.value.revoked);
1996
- }), j = (T) => K(async () => {
1997
- await a.sdk.cancel({ delegation_id: T.delegation_id, job_id: T.job_id }), await G();
1998
- }), ee = () => K(async () => {
1999
- if (!a.admin || !o.value) return;
2000
- const T = o.value.disabled;
2001
- if ((T ? await a.sdk.enable() : await a.sdk.disable())?.disabled !== !T) throw { code: "commit-uncertain" };
2002
- await G();
2003
- }), N = (T) => K(async () => {
2004
- const B = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (w) => w.toString(16).padStart(2, "0")).join("");
2005
- await a.sdk.exportExample({ key: T, job_id: B }), await G();
2006
- });
2007
- return ve(() => {
2008
- O(), R = setInterval(() => {
2009
- P.value.some(q) && O();
2153
+ function se(F) {
2154
+ M || (S.value = "", D.value = F, c.value = !0);
2155
+ }
2156
+ const Q = L(() => c.value ? a.pickerErrorText?.(D.value) ?? Ie(D.value, n.value, "select") : Ie(D.value, n.value)), Y = (F) => H(async () => {
2157
+ if ((await a.sdk.revoke({ delegation_id: F }))?.revoked !== !0) throw { code: "commit-uncertain" };
2158
+ await W(), M || (S.value = n.value.revoked);
2159
+ }), G = (F) => H(async () => {
2160
+ await a.sdk.cancel({ delegation_id: F.delegation_id, job_id: F.job_id }), await W();
2161
+ }), le = () => H(async () => {
2162
+ if (!a.admin || !u.value) return;
2163
+ const F = u.value.disabled;
2164
+ if ((F ? await a.sdk.enable() : await a.sdk.disable())?.disabled !== !F) throw { code: "commit-uncertain" };
2165
+ await W();
2166
+ }), R = (F) => H(async () => {
2167
+ const ee = "example-" + Array.from(crypto.getRandomValues(new Uint8Array(16)), (A) => A.toString(16).padStart(2, "0")).join("");
2168
+ await a.sdk.exportExample({ key: F, job_id: ee }), await W();
2169
+ }), T = b(1), E = L(() => v.value.slice((T.value - 1) * Ve, T.value * Ve)), J = L(() => [{ key: "name", label: n.value.file }, { key: "state", label: n.value.status, width: "6.5rem" }, { key: "size", label: n.value.size, width: "6rem", align: "right" }, { key: "location", label: n.value.location, width: "30%" }, { key: "actions", label: "", width: "7.5rem" }]), re = (F) => ({ committed: "success", canceled: "neutral", canceling: "neutral", interrupted: "danger", uncertain: "warning" })[O(F)] ?? "info", we = (F) => F.slice(0, F.lastIndexOf("/")) || "/", xe = L(() => u.value?.scopeMode === "install-selected" && !u.value.selection), ve = L(() => u.value ? u.value.disabled ? "disabled" : xe.value ? "needs-scope" : "enabled" : void 0), ce = (F) => a.picker?.labels?.[F] ? `${n.value.choose}${me.value}${a.picker.labels[F]}` : n.value.choose, de = (F) => a.picker?.labels?.[F] ? `${n.value.example}${me.value}${a.picker.labels[F]}` : n.value.example, me = L(() => He(a.locale));
2170
+ return q({ refresh: j }), ge(() => {
2171
+ j(), N = setInterval(() => {
2172
+ v.value.some(Z) && j();
2010
2173
  }, 3e3);
2011
- }), ue(() => {
2012
- D = !0, R && clearInterval(R);
2013
- }), (T, B) => (t(), $(e(ce), {
2014
- title: s.value.title,
2174
+ }), ye(() => {
2175
+ M = !0, N && clearInterval(N);
2176
+ }), (F, ee) => (s(), x(e(he), {
2177
+ title: n.value.title,
2178
+ description: n.value.help,
2179
+ loading: k.value && !u.value && !D.value,
2015
2180
  collapsible: !1,
2016
- "aria-busy": v.value,
2181
+ "aria-busy": k.value,
2017
2182
  class: "background-save-panel"
2018
- }, {
2019
- default: n(() => [
2020
- C("p", null, l(s.value.help), 1),
2021
- _.value ? (t(), $(e(Q), {
2183
+ }, Xe({
2184
+ default: l(() => [
2185
+ D.value ? (s(), x(e(X), {
2022
2186
  key: 0,
2023
2187
  tone: "danger",
2024
2188
  role: "alert",
2025
2189
  class: "save-message"
2026
2190
  }, {
2027
- default: n(() => [
2028
- g(l(e(Ve)(_.value, s.value)), 1)
2191
+ default: l(() => [
2192
+ $("span", rl, [
2193
+ $("span", dl, t(Q.value), 1),
2194
+ d(e(U), {
2195
+ variant: "secondary",
2196
+ size: "sm",
2197
+ disabled: k.value,
2198
+ onClick: j
2199
+ }, {
2200
+ default: l(() => [
2201
+ g(t(n.value.retry), 1)
2202
+ ]),
2203
+ _: 1
2204
+ }, 8, ["disabled"])
2205
+ ])
2029
2206
  ]),
2030
2207
  _: 1
2031
- })) : k("", !0),
2032
- v.value && !o.value ? (t(), S("p", Yl, l(s.value.loading), 1)) : k("", !0),
2033
- z.value ? (t(), S("p", Wl, l(z.value), 1)) : k("", !0),
2034
- o.value?.selection ? (t(), S("p", Zl, [
2035
- C("strong", null, l(s.value.scope), 1),
2036
- g(": " + l(o.value.selection.root), 1)
2037
- ])) : k("", !0),
2038
- o.value?.mismatch ? (t(), $(e(Q), {
2039
- key: 4,
2208
+ })) : h("", !0),
2209
+ S.value ? (s(), x(e(X), {
2210
+ key: 1,
2211
+ tone: "success",
2212
+ role: "status"
2213
+ }, {
2214
+ default: l(() => [
2215
+ g(t(S.value), 1)
2216
+ ]),
2217
+ _: 1
2218
+ })) : h("", !0),
2219
+ u.value ? (s(), V("div", vl, [
2220
+ d(e(Ce), {
2221
+ label: n.value.status,
2222
+ "label-width": "10rem"
2223
+ }, {
2224
+ default: l(() => [
2225
+ $("span", {
2226
+ role: "status",
2227
+ "data-save-status": ve.value
2228
+ }, [
2229
+ d(e($e), {
2230
+ tone: ve.value === "enabled" ? "success" : ve.value === "disabled" ? "neutral" : "warning"
2231
+ }, {
2232
+ default: l(() => [
2233
+ g(t(ve.value === "enabled" ? n.value.statusEnabled : ve.value === "disabled" ? n.value.statusDisabled : n.value.statusNeedsScope), 1)
2234
+ ]),
2235
+ _: 1
2236
+ }, 8, ["tone"])
2237
+ ], 8, cl)
2238
+ ]),
2239
+ _: 1
2240
+ }, 8, ["label"]),
2241
+ u.value.selection ? (s(), x(e(Ce), {
2242
+ key: 0,
2243
+ label: n.value.scope,
2244
+ "label-width": "10rem",
2245
+ "data-save-scope": ""
2246
+ }, {
2247
+ default: l(() => [
2248
+ d(e(pe), {
2249
+ path: u.value.selection.root
2250
+ }, null, 8, ["path"])
2251
+ ]),
2252
+ _: 1
2253
+ }, 8, ["label"])) : h("", !0)
2254
+ ])) : h("", !0),
2255
+ u.value?.mismatch ? (s(), x(e(X), {
2256
+ key: 3,
2040
2257
  tone: "warning"
2041
2258
  }, {
2042
- default: n(() => [
2043
- g(l(s.value.scopeMismatch) + " " + l(o.value.preselection) + " → " + l(o.value.selection?.root), 1)
2259
+ default: l(() => [
2260
+ g(t(n.value.scopeMismatch) + " " + t(u.value.preselection) + " → " + t(u.value.selection?.root), 1)
2044
2261
  ]),
2045
2262
  _: 1
2046
- })) : k("", !0),
2047
- o.value?.scopeMode === "install-selected" && !o.value.selection ? (t(), $(e(Q), {
2048
- key: 5,
2263
+ })) : h("", !0),
2264
+ xe.value ? (s(), x(e(X), {
2265
+ key: 4,
2049
2266
  tone: "warning"
2050
2267
  }, {
2051
- default: n(() => [
2052
- g(l(s.value.scopeNeeds), 1)
2268
+ default: l(() => [
2269
+ g(t(n.value.scopeNeeds), 1)
2053
2270
  ]),
2054
2271
  _: 1
2055
- })) : k("", !0),
2056
- o.value?.disabled ? (t(), $(e(Q), {
2057
- key: 6,
2272
+ })) : h("", !0),
2273
+ u.value?.disabled ? (s(), x(e(X), {
2274
+ key: 5,
2058
2275
  tone: "warning",
2059
- role: "status",
2060
2276
  class: "save-message"
2061
2277
  }, {
2062
- default: n(() => [
2063
- g(l(s.value.disabled), 1)
2278
+ default: l(() => [
2279
+ g(t(n.value.disabled), 1)
2064
2280
  ]),
2065
2281
  _: 1
2066
- })) : o.value && !(o.value.scopeMode === "install-selected" && !o.value.selection) ? (t(), S("p", jl, l(s.value.enabled), 1)) : k("", !0),
2067
- C("div", et, [
2068
- h(e(A), {
2069
- variant: "secondary",
2070
- disabled: v.value,
2071
- onClick: O
2072
- }, {
2073
- default: n(() => [
2074
- g(l(s.value.refresh), 1)
2075
- ]),
2076
- _: 1
2077
- }, 8, ["disabled"]),
2078
- p.admin && o.value ? (t(), $(e(A), {
2079
- key: 0,
2080
- variant: o.value.disabled ? "secondary" : "danger",
2081
- disabled: v.value,
2082
- onClick: ee
2083
- }, {
2084
- default: n(() => [
2085
- g(l(o.value.disabled ? s.value.enable : s.value.disable), 1)
2086
- ]),
2087
- _: 1
2088
- }, 8, ["variant", "disabled"])) : k("", !0)
2089
- ]),
2090
- p.admin && o.value ? (t(), S("p", at, l(s.value.disableHelp), 1)) : k("", !0),
2091
- C("h3", null, l(s.value.delegations), 1),
2092
- x.value.some((w) => w.status === "reselection-required") ? (t(), $(e(Q), {
2093
- key: 9,
2282
+ })) : h("", !0),
2283
+ $("h3", null, t(n.value.delegations), 1),
2284
+ w.value.some((A) => A.status === "reselection-required") ? (s(), x(e(X), {
2285
+ key: 6,
2094
2286
  tone: "warning"
2095
2287
  }, {
2096
- default: n(() => [
2097
- g(l(s.value.reselect), 1)
2288
+ default: l(() => [
2289
+ g(t(n.value.reselect), 1)
2098
2290
  ]),
2099
2291
  _: 1
2100
- })) : k("", !0),
2101
- p.picker ? (t(), S("div", lt, [
2102
- (t(!0), S(Z, null, de(p.picker.keys, (w) => (t(), $(e(A), {
2103
- key: w,
2104
- variant: "secondary",
2105
- disabled: v.value || !o.value || o.value.disabled || !b.value,
2106
- onClick: (U) => {
2107
- d.value = w, i.value = !0;
2108
- }
2109
- }, {
2110
- default: n(() => [
2111
- g(l(s.value.choose) + " (" + l(w) + ")", 1)
2112
- ]),
2113
- _: 2
2114
- }, 1032, ["disabled", "onClick"]))), 128))
2115
- ])) : k("", !0),
2116
- b.value ? (t(), $(_e, {
2117
- key: o.value?.selection?.scope,
2118
- open: i.value,
2119
- "onUpdate:open": B[0] || (B[0] = (w) => i.value = w),
2120
- provider: b.value,
2121
- locale: p.locale,
2122
- mode: "folder",
2123
- destination: { key: d.value, selectDestination: p.sdk.selectDestination },
2124
- onAuthorized: H
2125
- }, null, 8, ["open", "provider", "locale", "destination"])) : k("", !0),
2126
- o.value && !r.value.length ? (t(), S("p", tt, l(s.value.empty), 1)) : k("", !0),
2127
- C("ul", nt, [
2128
- (t(!0), S(Z, null, de(r.value, (w) => (t(), S("li", {
2129
- key: w.id
2292
+ })) : h("", !0),
2293
+ u.value && !r.value.length ? (s(), V("p", pl, t(n.value.empty), 1)) : h("", !0),
2294
+ r.value.length ? (s(), V("ul", fl, [
2295
+ (s(!0), V(ne, null, ke(r.value, (A) => (s(), V("li", {
2296
+ key: A.id
2130
2297
  }, [
2131
- C("div", null, [
2132
- C("strong", null, l(w.path), 1),
2133
- C("p", null, l(s.value.untilRevoked), 1)
2298
+ $("div", yl, [
2299
+ d(e(pe), {
2300
+ path: A.path
2301
+ }, null, 8, ["path"]),
2302
+ $("span", ml, t(n.value.untilRevoked), 1)
2134
2303
  ]),
2135
- h(e(A), {
2304
+ d(e(U), {
2136
2305
  variant: "secondary",
2137
- disabled: v.value,
2138
- onClick: (U) => W(w.id)
2306
+ disabled: k.value,
2307
+ onClick: (C) => Y(A.id)
2139
2308
  }, {
2140
- default: n(() => [
2141
- g(l(s.value.revoke), 1)
2309
+ default: l(() => [
2310
+ g(t(n.value.revoke), 1)
2142
2311
  ]),
2143
2312
  _: 1
2144
2313
  }, 8, ["disabled", "onClick"])
2145
2314
  ]))), 128))
2146
- ]),
2147
- x.value.some((w) => w.status === "active") ? (t(), S(Z, { key: 13 }, [
2148
- C("p", null, l(s.value.exampleHelp), 1),
2149
- C("div", st, [
2150
- (t(!0), S(Z, null, de(x.value.filter((w) => w.status === "active"), (w) => (t(), $(e(A), {
2151
- key: w.key,
2315
+ ])) : h("", !0),
2316
+ y.picker ? (s(), V("div", bl, [
2317
+ (s(!0), V(ne, null, ke(y.picker.keys, (A) => (s(), x(e(U), {
2318
+ key: A,
2319
+ variant: "secondary",
2320
+ disabled: k.value || !u.value || u.value.disabled || !z.value,
2321
+ onClick: (C) => {
2322
+ i.value = A, m.value = !0;
2323
+ }
2324
+ }, {
2325
+ default: l(() => [
2326
+ g(t(ce(A)), 1)
2327
+ ]),
2328
+ _: 2
2329
+ }, 1032, ["disabled", "onClick"]))), 128))
2330
+ ])) : h("", !0),
2331
+ z.value ? (s(), x(Te, {
2332
+ key: u.value?.selection?.scope,
2333
+ open: m.value,
2334
+ "onUpdate:open": ee[0] || (ee[0] = (A) => m.value = A),
2335
+ provider: z.value,
2336
+ locale: y.locale,
2337
+ mode: "folder",
2338
+ destination: { key: i.value, selectDestination: y.sdk.selectDestination },
2339
+ onAuthorized: te,
2340
+ onRefused: se,
2341
+ "error-text": y.pickerErrorText
2342
+ }, null, 8, ["open", "provider", "locale", "destination", "error-text"])) : h("", !0),
2343
+ y.sampleSave && w.value.some((A) => A.status === "active") ? (s(), V("div", gl, [
2344
+ $("p", hl, t(n.value.exampleHelp), 1),
2345
+ $("div", kl, [
2346
+ (s(!0), V(ne, null, ke(w.value.filter((A) => A.status === "active"), (A) => (s(), x(e(U), {
2347
+ key: A.key,
2152
2348
  variant: "secondary",
2153
- disabled: v.value || o.value?.disabled,
2154
- onClick: (U) => N(w.key)
2349
+ disabled: k.value || u.value?.disabled,
2350
+ onClick: (C) => R(A.key)
2155
2351
  }, {
2156
- default: n(() => [
2157
- g(l(s.value.example) + " (" + l(w.key) + ")", 1)
2352
+ default: l(() => [
2353
+ g(t(de(A.key)), 1)
2158
2354
  ]),
2159
2355
  _: 2
2160
2356
  }, 1032, ["disabled", "onClick"]))), 128))
2161
2357
  ])
2162
- ], 64)) : k("", !0),
2163
- C("h3", null, l(s.value.operations), 1),
2164
- o.value && !P.value.length ? (t(), S("p", it, l(s.value.noOperations), 1)) : k("", !0),
2165
- C("ul", ot, [
2166
- (t(!0), S(Z, null, de(P.value, (w) => (t(), S("li", {
2167
- key: w.job_id,
2168
- "data-job-id": w.job_id,
2169
- "data-save-state": E(w)
2170
- }, [
2171
- C("div", null, [
2172
- C("strong", null, l(w.name), 1),
2173
- C("p", null, l(s.value[E(w)]) + " · " + l(w.job_id), 1),
2174
- E(w) === "committed" ? (t(), S("p", rt, l(w.receipt?.path), 1)) : k("", !0),
2175
- E(w) === "uncertain" ? (t(), $(e(Q), {
2176
- key: 1,
2177
- tone: "warning",
2178
- class: "save-message"
2358
+ ])) : h("", !0),
2359
+ $("h3", null, t(n.value.operations), 1),
2360
+ u.value && !v.value.length ? (s(), V("p", _l, t(n.value.noOperations), 1)) : h("", !0),
2361
+ v.value.length ? (s(), V("div", wl, [
2362
+ d(e(Ca), {
2363
+ columns: J.value,
2364
+ rows: E.value,
2365
+ "row-key": "job_id"
2366
+ }, {
2367
+ "cell-name": l(({ row: A }) => [
2368
+ $("span", {
2369
+ class: "save-name",
2370
+ "data-save-job": A.job_id,
2371
+ title: A.name
2372
+ }, t(A.name), 9, xl),
2373
+ O(A) === "uncertain" ? (s(), V("p", Cl, t(n.value.uncertainHelp), 1)) : O(A) === "interrupted" ? (s(), V("p", $l, t(A.code ? e(Ie)({ code: A.code }, n.value) : n.value.interruptedHelp), 1)) : h("", !0)
2374
+ ]),
2375
+ "cell-state": l(({ row: A }) => [
2376
+ $("span", {
2377
+ "data-save-state": O(A)
2378
+ }, [
2379
+ d(e($e), {
2380
+ tone: re(A)
2381
+ }, {
2382
+ default: l(() => [
2383
+ g(t(n.value[O(A)]), 1)
2384
+ ]),
2385
+ _: 2
2386
+ }, 1032, ["tone"])
2387
+ ], 8, Sl)
2388
+ ]),
2389
+ "cell-size": l(({ row: A }) => [
2390
+ g(t(A.receipt?.size !== void 0 ? e($a)(A.receipt.size) : "—"), 1)
2391
+ ]),
2392
+ "cell-location": l(({ row: A }) => [
2393
+ O(A) === "committed" ? (s(), x(e(pe), {
2394
+ key: 0,
2395
+ path: A.receipt.path
2396
+ }, null, 8, ["path"])) : (s(), V("span", zl, "—"))
2397
+ ]),
2398
+ "cell-actions": l(({ row: A }) => [
2399
+ O(A) === "committed" ? (s(), x(e(U), {
2400
+ key: 0,
2401
+ variant: "ghost",
2402
+ size: "sm",
2403
+ "aria-label": n.value.openFolder,
2404
+ title: n.value.openFolder,
2405
+ onClick: (C) => e(ra)(we(A.receipt.path))
2179
2406
  }, {
2180
- default: n(() => [
2181
- g(l(s.value.uncertainHelp), 1)
2407
+ default: l(() => [
2408
+ d(e(Ua), {
2409
+ class: "save-icon",
2410
+ "aria-hidden": "true"
2411
+ })
2182
2412
  ]),
2183
2413
  _: 1
2184
- })) : E(w) === "interrupted" ? (t(), $(e(Q), {
2185
- key: 2,
2186
- tone: "warning",
2187
- class: "save-message"
2414
+ }, 8, ["aria-label", "title", "onClick"])) : h("", !0),
2415
+ Z(A) ? (s(), x(e(U), {
2416
+ key: 1,
2417
+ variant: "secondary",
2418
+ size: "sm",
2419
+ disabled: k.value,
2420
+ onClick: (C) => G(A)
2188
2421
  }, {
2189
- default: n(() => [
2190
- g(l(s.value.interruptedHelp), 1)
2422
+ default: l(() => [
2423
+ g(t(n.value.cancel), 1)
2191
2424
  ]),
2192
2425
  _: 1
2193
- })) : k("", !0),
2194
- E(w) === "interrupted" && w.code ? (t(), S("p", dt, l(e(Ve)({ code: w.code }, s.value)), 1)) : k("", !0)
2426
+ }, 8, ["disabled", "onClick"])) : h("", !0)
2195
2427
  ]),
2196
- q(w) ? (t(), $(e(A), {
2197
- key: 0,
2198
- variant: "secondary",
2199
- disabled: v.value,
2200
- onClick: (U) => j(w)
2428
+ _: 1
2429
+ }, 8, ["columns", "rows"]),
2430
+ v.value.length > Ve ? (s(), x(e(Sa), {
2431
+ key: 0,
2432
+ modelValue: T.value,
2433
+ "onUpdate:modelValue": ee[1] || (ee[1] = (A) => T.value = A),
2434
+ total: v.value.length,
2435
+ "page-size": Ve,
2436
+ class: "save-pages"
2437
+ }, null, 8, ["modelValue", "total"])) : h("", !0)
2438
+ ])) : h("", !0)
2439
+ ]),
2440
+ _: 2
2441
+ }, [
2442
+ y.admin && u.value ? {
2443
+ name: "footer",
2444
+ fn: l(() => [
2445
+ $("div", Pl, [
2446
+ $("p", null, t(n.value.disableHelp), 1),
2447
+ d(e(U), {
2448
+ variant: u.value.disabled ? "secondary" : "danger",
2449
+ disabled: k.value,
2450
+ onClick: le
2201
2451
  }, {
2202
- default: n(() => [
2203
- g(l(s.value.cancel), 1)
2452
+ default: l(() => [
2453
+ g(t(u.value.disabled ? n.value.enable : n.value.disable), 1)
2204
2454
  ]),
2205
2455
  _: 1
2206
- }, 8, ["disabled", "onClick"])) : k("", !0)
2207
- ], 8, ut))), 128))
2208
- ])
2209
- ]),
2210
- _: 1
2211
- }, 8, ["title", "aria-busy"]));
2456
+ }, 8, ["variant", "disabled"])
2457
+ ])
2458
+ ]),
2459
+ key: "0"
2460
+ } : void 0
2461
+ ]), 1032, ["title", "description", "loading", "aria-busy"]));
2212
2462
  }
2213
- }), Dt = /* @__PURE__ */ ne(vt, [["__scopeId", "data-v-c38db985"]]), He = /* @__PURE__ */ Symbol("authorization");
2214
- function ct() {
2215
- const p = Oe(He, void 0);
2216
- if (!p) throw Error("authorization controls must be placed inside AuthorizationGate");
2217
- return p;
2463
+ }), Zl = /* @__PURE__ */ ue(Vl, [["__scopeId", "data-v-5ef5e256"]]), ea = /* @__PURE__ */ Symbol("authorization");
2464
+ function Il() {
2465
+ const y = Ge(ea, void 0);
2466
+ if (!y) throw Error("authorization controls must be placed inside AuthorizationGate");
2467
+ return y;
2218
2468
  }
2219
- const ft = { class: "authorization-content" }, pt = ["aria-busy", "data-authorization-state"], yt = { class: "authorization-body" }, mt = /* @__PURE__ */ le({
2469
+ const Tl = { class: "authorization-content" }, El = ["aria-busy", "data-authorization-state"], Ul = { class: "authorization-body" }, Al = /* @__PURE__ */ oe({
2220
2470
  __name: "AuthorizationGate",
2221
2471
  props: {
2222
2472
  ctx: {},
2223
2473
  name: {}
2224
2474
  },
2225
2475
  emits: ["ready"],
2226
- setup(p, { emit: I }) {
2227
- const a = p, m = I, i = y(), d = y(), s = y(!1), o = y(!1), r = y(!1);
2228
- let P = [], v = !1, _ = 0, z = !1, x;
2229
- const b = F(() => aa(a.ctx.locale, a.name ?? a.ctx.displayName ?? "")), D = F(() => i.value || d.value), R = F(() => D.value?.state === "authorization_required"), L = F(() => ["helper_untrusted", "cli_untrusted"].includes(D.value?.reason || "")), E = F(() => R.value && !L.value), q = F(() => D.value?.reason === "credential_not_ready" ? "credential" : "unavailable"), J = F(() => D.value ? R.value ? b.value("title") : D.value.state === "ready" ? b.value("ready") : D.value.state === "not_admin" ? b.value("not_admin.title") : D.value.state === "session_expired" ? b.value("session_expired.title") : b.value(q.value + ".title") : b.value("checking")), G = F(() => R.value ? b.value("purpose") : D.value?.state === "not_admin" ? b.value("not_admin.body") : D.value?.state === "session_expired" ? b.value("session_expired.body") : D.value?.state === "unavailable" ? b.value(q.value + ".body") : b.value("purpose")), K = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], O = F(() => K.includes(D.value?.reason || "") ? D.value.reason : "unknown"), H = F(() => L.value ? "next.reinstall" : O.value === "grant_missing" ? "next.install" : O.value === "upgrade_reapproval" || O.value === "grant_incompatible" ? "next.update" : "next.repair");
2230
- function W(U) {
2231
- if (!U || U.command !== "authorization" || U.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(U.state) || U.reason === "upgrade_reapproval" && U.state !== "authorization_required") throw Error("invalid status");
2232
- return U;
2476
+ setup(y, { emit: q }) {
2477
+ const f = y, a = q, o = b(), m = b(), i = b(!1), n = b(!1), u = b(!1);
2478
+ let r = [], v = !1, k = 0, D = !1, S;
2479
+ const c = L(() => da(f.ctx.locale, f.name ?? f.ctx.displayName ?? "")), w = L(() => o.value || m.value), z = L(() => w.value?.state === "authorization_required"), M = L(() => ["helper_untrusted", "cli_untrusted"].includes(w.value?.reason || "")), N = L(() => z.value && !M.value), K = L(() => w.value?.reason === "credential_not_ready" ? "credential" : "unavailable"), O = L(() => w.value ? z.value ? c.value("title") : w.value.state === "ready" ? c.value("ready") : w.value.state === "not_admin" ? c.value("not_admin.title") : w.value.state === "session_expired" ? c.value("session_expired.title") : c.value(K.value + ".title") : c.value("checking")), Z = L(() => z.value ? c.value("purpose") : w.value?.state === "not_admin" ? c.value("not_admin.body") : w.value?.state === "session_expired" ? c.value("session_expired.body") : w.value?.state === "unavailable" ? c.value(K.value + ".body") : c.value("purpose")), ae = ["grant_missing", "upgrade_reapproval", "helper_untrusted", "cli_untrusted", "grant_incompatible", "package_identity_changed", "maintenance_task_missing", "maintenance_task_mismatch", "helper_health_rejected", "capability_missing"], W = L(() => ae.includes(w.value?.reason || "") ? w.value.reason : "unknown"), H = L(() => M.value ? "next.reinstall" : W.value === "grant_missing" ? "next.install" : W.value === "upgrade_reapproval" || W.value === "grant_incompatible" ? "next.update" : "next.repair");
2480
+ function j(R) {
2481
+ if (!R || R.command !== "authorization" || R.schema_version !== 1 || !["ready", "authorization_required", "not_admin", "session_expired", "unavailable"].includes(R.state) || R.reason === "upgrade_reapproval" && R.state !== "authorization_required") throw Error("invalid status");
2482
+ return R;
2233
2483
  }
2234
- const j = [1e3, 3e3];
2235
- async function ee(U) {
2236
- const M = U === "status" && !r.value ? j : [];
2237
- for (let Y = 0; ; Y++) {
2484
+ const te = [1e3, 3e3];
2485
+ async function se(R) {
2486
+ const T = R === "status" && !u.value ? te : [];
2487
+ for (let E = 0; ; E++) {
2238
2488
  try {
2239
- const ae = W(await a.ctx.authorization?.[U]());
2240
- if (ae.state !== "unavailable" || Y >= M.length) return ae;
2241
- } catch (ae) {
2242
- if (ae.code === "session_required" || Y >= M.length) throw ae;
2489
+ const J = j(await f.ctx.authorization?.[R]());
2490
+ if (J.state !== "unavailable" || E >= T.length) return J;
2491
+ } catch (J) {
2492
+ if (J.code === "session_required" || E >= T.length) throw J;
2243
2493
  }
2244
- if (await new Promise((ae) => setTimeout(ae, M[Y])), v) throw Error("disposed");
2494
+ if (await new Promise((J) => setTimeout(J, T[E])), v) throw Error("disposed");
2245
2495
  }
2246
2496
  }
2247
- async function N(U) {
2248
- if (s.value || v) return;
2249
- const M = ++_;
2250
- d.value = U === "request" && i.value?.state === "authorization_required" ? i.value : void 0, s.value = !0, o.value = !1, i.value = void 0;
2497
+ async function Q(R) {
2498
+ if (i.value || v) return;
2499
+ const T = ++k;
2500
+ m.value = R === "request" && o.value?.state === "authorization_required" ? o.value : void 0, i.value = !0, n.value = !1, o.value = void 0;
2251
2501
  try {
2252
- const Y = await ee(U);
2253
- if (v || M !== _) return;
2254
- i.value = Y, r.value = Y.state !== "ready", Y.state === "ready" && T(!0), Y.state === "ready" && m("ready");
2255
- } catch (Y) {
2256
- !v && M === _ && (i.value = Y.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : d.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: "service_unavailable" }, o.value = !0, r.value = !0);
2502
+ const E = await se(R);
2503
+ if (v || T !== k) return;
2504
+ o.value = E, u.value = E.state !== "ready", E.state === "ready" && Y(!0), E.state === "ready" && a("ready");
2505
+ } catch (E) {
2506
+ !v && T === k && (o.value = E.code === "session_required" ? { command: "authorization", schema_version: 1, state: "session_expired", reason: "session_expired" } : m.value || { command: "authorization", schema_version: 1, state: "unavailable", reason: "service_unavailable" }, n.value = !0, u.value = !0);
2257
2507
  } finally {
2258
- !v && M === _ && (s.value = !1, d.value = void 0, z && (z = !1, N("status")));
2508
+ !v && T === k && (i.value = !1, m.value = void 0, D && (D = !1, Q("status")));
2259
2509
  }
2260
2510
  }
2261
- function T(U) {
2262
- const M = P;
2263
- P = [], M.forEach((Y) => Y(U));
2511
+ function Y(R) {
2512
+ const T = r;
2513
+ r = [], T.forEach((E) => E(R));
2264
2514
  }
2265
- function B(U) {
2266
- r.value = U, U || T(!1);
2515
+ function G(R) {
2516
+ u.value = R, R || Y(!1);
2267
2517
  }
2268
- function w() {
2269
- return i.value?.state === "ready" ? Promise.resolve(!0) : (s.value || (r.value = !0), new Promise((U) => P.push(U)));
2518
+ function le() {
2519
+ return o.value?.state === "ready" ? Promise.resolve(!0) : (i.value || (u.value = !0), new Promise((R) => r.push(R)));
2270
2520
  }
2271
- return sa(He, { state: F(() => i.value?.state ?? "checking"), requireAuthorization: w, text: b, busy: s, canManage: () => !!a.ctx.authorization?.canManage?.(), revoke: () => N("revoke") }), ve(() => {
2272
- x = a.ctx.reopen(() => {
2273
- s.value ? z = !0 : N("status");
2274
- }), N("status");
2275
- }), Le(() => {
2276
- v = !0, _++, T(!1), typeof x == "function" && x();
2277
- }), (U, M) => (t(), S(Z, null, [
2278
- C("div", ft, [
2279
- Ie(U.$slots, "default", {}, void 0, !0)
2521
+ return fa(ea, { state: L(() => o.value?.state ?? "checking"), requireAuthorization: le, text: c, busy: i, canManage: () => !!f.ctx.authorization?.canManage?.(), revoke: () => Q("revoke") }), ge(() => {
2522
+ S = f.ctx.reopen(() => {
2523
+ i.value ? D = !0 : Q("status");
2524
+ }), Q("status");
2525
+ }), Qe(() => {
2526
+ v = !0, k++, Y(!1), typeof S == "function" && S();
2527
+ }), (R, T) => (s(), V(ne, null, [
2528
+ $("div", Tl, [
2529
+ De(R.$slots, "default", {}, void 0, !0)
2280
2530
  ]),
2281
- h(e(Ae), {
2282
- open: r.value,
2283
- title: J.value,
2531
+ d(e(qe), {
2532
+ open: u.value,
2533
+ title: O.value,
2284
2534
  width: "480px",
2285
- "onUpdate:open": B
2535
+ "onUpdate:open": G
2286
2536
  }, {
2287
- footer: n(() => [
2288
- E.value ? (t(), $(e(A), {
2537
+ footer: l(() => [
2538
+ N.value ? (s(), x(e(U), {
2289
2539
  key: 0,
2290
2540
  variant: "primary",
2291
- loading: s.value,
2292
- disabled: s.value,
2293
- onClick: M[0] || (M[0] = (Y) => N("request"))
2541
+ loading: i.value,
2542
+ disabled: i.value,
2543
+ onClick: T[0] || (T[0] = (E) => Q("request"))
2294
2544
  }, {
2295
- default: n(() => [
2296
- g(l(s.value ? b.value("authorizing") : b.value("authorize")), 1)
2545
+ default: l(() => [
2546
+ g(t(i.value ? c.value("authorizing") : c.value("authorize")), 1)
2297
2547
  ]),
2298
2548
  _: 1
2299
- }, 8, ["loading", "disabled"])) : (t(), $(e(A), {
2549
+ }, 8, ["loading", "disabled"])) : (s(), x(e(U), {
2300
2550
  key: 1,
2301
2551
  variant: "primary",
2302
- loading: s.value,
2303
- disabled: s.value,
2304
- onClick: M[1] || (M[1] = (Y) => N("status"))
2552
+ loading: i.value,
2553
+ disabled: i.value,
2554
+ onClick: T[1] || (T[1] = (E) => Q("status"))
2305
2555
  }, {
2306
- default: n(() => [
2307
- g(l(s.value ? b.value("checking") : b.value("retry")), 1)
2556
+ default: l(() => [
2557
+ g(t(i.value ? c.value("checking") : c.value("retry")), 1)
2308
2558
  ]),
2309
2559
  _: 1
2310
2560
  }, 8, ["loading", "disabled"]))
2311
2561
  ]),
2312
- default: n(() => [
2313
- C("div", {
2562
+ default: l(() => [
2563
+ $("div", {
2314
2564
  class: "authorization-view",
2315
- "aria-busy": s.value,
2316
- "data-authorization-state": i.value?.state || "checking"
2565
+ "aria-busy": i.value,
2566
+ "data-authorization-state": o.value?.state || "checking"
2317
2567
  }, [
2318
- C("p", yt, l(G.value), 1),
2319
- R.value ? (t(), $(e(Q), {
2568
+ $("p", Ul, t(Z.value), 1),
2569
+ z.value ? (s(), x(e(X), {
2320
2570
  key: 0,
2321
2571
  class: "authorization-status",
2322
- tone: ["grant_missing", "upgrade_reapproval"].includes(O.value) ? "info" : "warning",
2323
- title: b.value("reason." + O.value)
2572
+ tone: ["grant_missing", "upgrade_reapproval"].includes(W.value) ? "info" : "warning",
2573
+ title: c.value("reason." + W.value)
2324
2574
  }, {
2325
- default: n(() => [
2326
- g(l(b.value(H.value)), 1)
2575
+ default: l(() => [
2576
+ g(t(c.value(H.value)), 1)
2327
2577
  ]),
2328
2578
  _: 1
2329
- }, 8, ["tone", "title"])) : k("", !0),
2330
- o.value ? (t(), $(e(Q), {
2579
+ }, 8, ["tone", "title"])) : h("", !0),
2580
+ n.value ? (s(), x(e(X), {
2331
2581
  key: 1,
2332
2582
  class: "authorization-failed",
2333
2583
  tone: "warning"
2334
2584
  }, {
2335
- default: n(() => [
2336
- g(l(b.value("failed")), 1)
2585
+ default: l(() => [
2586
+ g(t(c.value("failed")), 1)
2337
2587
  ]),
2338
2588
  _: 1
2339
- })) : k("", !0)
2340
- ], 8, pt)
2589
+ })) : h("", !0)
2590
+ ], 8, El)
2341
2591
  ]),
2342
2592
  _: 1
2343
2593
  }, 8, ["open", "title"])
2344
2594
  ], 64));
2345
2595
  }
2346
- }), Tt = /* @__PURE__ */ ne(mt, [["__scopeId", "data-v-e16b5f7d"]]), bt = { class: "authorization-setting" }, kt = {
2596
+ }), Wl = /* @__PURE__ */ ue(Al, [["__scopeId", "data-v-e16b5f7d"]]), Dl = { class: "authorization-setting" }, Rl = {
2347
2597
  class: "authorization-state",
2348
2598
  role: "status"
2349
- }, gt = { class: "authorization-revoke-body" }, ht = /* @__PURE__ */ le({
2599
+ }, ql = { class: "authorization-revoke-body" }, Bl = /* @__PURE__ */ oe({
2350
2600
  __name: "AuthorizationSettings",
2351
- setup(p) {
2352
- const { state: I, requireAuthorization: a, text: m, busy: i, canManage: d, revoke: s } = ct(), o = y(!1), r = { checking: "checking", ready: "ready", authorization_required: "state.required", not_admin: "not_admin.title", session_expired: "session_expired.title", unavailable: "state.unavailable" };
2353
- return (P, v) => (t(), S(Z, null, [
2354
- h(e(ce), {
2355
- title: e(m)("settings.title"),
2601
+ setup(y) {
2602
+ const { state: q, requireAuthorization: f, text: a, busy: o, canManage: m, revoke: i } = Il(), n = b(!1), u = { checking: "checking", ready: "ready", authorization_required: "state.required", not_admin: "not_admin.title", session_expired: "session_expired.title", unavailable: "state.unavailable" };
2603
+ return (r, v) => (s(), V(ne, null, [
2604
+ d(e(he), {
2605
+ title: e(a)("settings.title"),
2356
2606
  collapsible: !1
2357
2607
  }, {
2358
- default: n(() => [
2359
- h(e(ya), {
2360
- label: e(m)("settings.status"),
2361
- description: e(m)("purpose"),
2608
+ default: l(() => [
2609
+ d(e(za), {
2610
+ label: e(a)("settings.status"),
2611
+ description: e(a)("purpose"),
2362
2612
  align: "center"
2363
2613
  }, {
2364
- default: n(() => [
2365
- C("div", bt, [
2366
- C("span", kt, [
2367
- e(I) === "ready" ? (t(), $(e(_a), {
2614
+ default: l(() => [
2615
+ $("div", Dl, [
2616
+ $("span", Rl, [
2617
+ e(q) === "ready" ? (s(), x(e(Aa), {
2368
2618
  key: 0,
2369
2619
  size: 16,
2370
2620
  "aria-hidden": "true"
2371
- })) : k("", !0),
2372
- g(l(e(m)(r[e(I)])), 1)
2621
+ })) : h("", !0),
2622
+ g(t(e(a)(u[e(q)])), 1)
2373
2623
  ]),
2374
- e(I) === "ready" && e(d)() ? (t(), $(e(A), {
2624
+ e(q) === "ready" && e(m)() ? (s(), x(e(U), {
2375
2625
  key: 0,
2376
2626
  variant: "secondary",
2377
- disabled: e(i),
2378
- onClick: v[0] || (v[0] = (_) => o.value = !0)
2627
+ disabled: e(o),
2628
+ onClick: v[0] || (v[0] = (k) => n.value = !0)
2379
2629
  }, {
2380
- default: n(() => [
2381
- g(l(e(m)("revoke")), 1)
2630
+ default: l(() => [
2631
+ g(t(e(a)("revoke")), 1)
2382
2632
  ]),
2383
2633
  _: 1
2384
- }, 8, ["disabled"])) : e(I) !== "ready" && e(I) !== "checking" ? (t(), $(e(A), {
2634
+ }, 8, ["disabled"])) : e(q) !== "ready" && e(q) !== "checking" ? (s(), x(e(U), {
2385
2635
  key: 1,
2386
2636
  variant: "secondary",
2387
- onClick: v[1] || (v[1] = (_) => e(a)())
2637
+ onClick: v[1] || (v[1] = (k) => e(f)())
2388
2638
  }, {
2389
- default: n(() => [
2390
- g(l(e(m)("settings.details")), 1)
2639
+ default: l(() => [
2640
+ g(t(e(a)("settings.details")), 1)
2391
2641
  ]),
2392
2642
  _: 1
2393
- })) : k("", !0)
2643
+ })) : h("", !0)
2394
2644
  ])
2395
2645
  ]),
2396
2646
  _: 1
@@ -2398,99 +2648,105 @@ const ft = { class: "authorization-content" }, pt = ["aria-busy", "data-authoriz
2398
2648
  ]),
2399
2649
  _: 1
2400
2650
  }, 8, ["title"]),
2401
- h(e(Ae), {
2402
- open: o.value,
2403
- "onUpdate:open": v[4] || (v[4] = (_) => o.value = _),
2404
- title: e(m)("revoke.title"),
2651
+ d(e(qe), {
2652
+ open: n.value,
2653
+ "onUpdate:open": v[4] || (v[4] = (k) => n.value = k),
2654
+ title: e(a)("revoke.title"),
2405
2655
  width: "480px"
2406
2656
  }, {
2407
- footer: n(() => [
2408
- h(e(A), {
2657
+ footer: l(() => [
2658
+ d(e(U), {
2409
2659
  variant: "secondary",
2410
- onClick: v[2] || (v[2] = (_) => o.value = !1)
2660
+ onClick: v[2] || (v[2] = (k) => n.value = !1)
2411
2661
  }, {
2412
- default: n(() => [
2413
- g(l(e(m)("cancel")), 1)
2662
+ default: l(() => [
2663
+ g(t(e(a)("cancel")), 1)
2414
2664
  ]),
2415
2665
  _: 1
2416
2666
  }),
2417
- h(e(A), {
2667
+ d(e(U), {
2418
2668
  variant: "danger",
2419
- disabled: e(i),
2420
- onClick: v[3] || (v[3] = (_) => {
2421
- o.value = !1, e(s)();
2669
+ disabled: e(o),
2670
+ onClick: v[3] || (v[3] = (k) => {
2671
+ n.value = !1, e(i)();
2422
2672
  })
2423
2673
  }, {
2424
- default: n(() => [
2425
- g(l(e(m)("revoke")), 1)
2674
+ default: l(() => [
2675
+ g(t(e(a)("revoke")), 1)
2426
2676
  ]),
2427
2677
  _: 1
2428
2678
  }, 8, ["disabled"])
2429
2679
  ]),
2430
- default: n(() => [
2431
- C("p", gt, l(e(m)("revoke.body")), 1)
2680
+ default: l(() => [
2681
+ $("p", ql, t(e(a)("revoke.body")), 1)
2432
2682
  ]),
2433
2683
  _: 1
2434
2684
  }, 8, ["open", "title"])
2435
2685
  ], 64));
2436
2686
  }
2437
- }), Et = /* @__PURE__ */ ne(ht, [["__scopeId", "data-v-f031e7c7"]]);
2687
+ }), jl = /* @__PURE__ */ ue(Bl, [["__scopeId", "data-v-f031e7c7"]]);
2438
2688
  export {
2439
- St as AppShell,
2440
- Tt as AuthorizationGate,
2441
- Et as AuthorizationSettings,
2442
- It as BackgroundPanel,
2443
- Dt as BackgroundSavePanel,
2444
- At as DelegatePanel,
2445
- Ut as ExecutorSettings,
2446
- wa as ExecutorSetupKey,
2447
- Bt as FILE_STATION_APP,
2448
- Ke as FileBrowser,
2449
- zt as FilesPage,
2450
- Vt as LoginPage,
2451
- _e as NasPicker,
2452
- Pt as PortalSettings,
2453
- Ot as activePage,
2454
- Ft as authorizationCatalogs,
2455
- aa as authorizationCopy,
2456
- Lt as backgroundCatalogs,
2457
- Ye as backgroundCopy,
2458
- Ze as backgroundErrorCopy,
2459
- Nt as catalogs,
2460
- We as createBackgroundPickerProvider,
2461
- Mt as createBackgroundSaveFacade,
2462
- Kt as createFileTransfers,
2463
- qe as createNasProvider,
2464
- xt as createSession,
2465
- Ht as decodeResponse,
2466
- Gt as delegateCatalogs,
2467
- Be as delegateCopy,
2468
- Jt as encodeRequest,
2469
- je as errorCopy,
2470
- Xt as fileStationPath,
2471
- Pe as format,
2472
- Qt as identityCatalogs,
2473
- Qe as identityCopy,
2474
- Yt as mergeCatalogs,
2475
- Wt as nasCatalogs,
2476
- re as nasCopy,
2477
- Ee as nasErrorCopy,
2478
- Zt as openFileInFileStation,
2479
- jt as openFolderInFileStation,
2480
- en as protocolCodes,
2481
- an as protocolOps,
2482
- ln as protocolSchemas,
2483
- De as requestKey,
2484
- tn as saveCatalogs,
2485
- Re as saveCopy,
2486
- Ve as saveError,
2487
- ea as scopedPicker,
2488
- nn as shellCatalogs,
2489
- Je as shellCopy,
2490
- sn as shellPages,
2491
- Xe as uiLocale,
2492
- on as uiLocales,
2493
- ct as useAuthorization,
2494
- Ca as useExecutorSetup,
2495
- $a as useNasRequest
2689
+ Kl as AppShell,
2690
+ Wl as AuthorizationGate,
2691
+ jl as AuthorizationSettings,
2692
+ Xl as BackgroundPanel,
2693
+ Zl as BackgroundSavePanel,
2694
+ ts as DEFAULT_REQUEST_TIMEOUT,
2695
+ Yl as DelegatePanel,
2696
+ Ql as ExecutorSettings,
2697
+ Da as ExecutorSetupKey,
2698
+ ls as FILE_STATION_APP,
2699
+ je as FileBrowser,
2700
+ Hl as FilesPage,
2701
+ Jl as LoginPage,
2702
+ Te as NasPicker,
2703
+ Gl as PortalSettings,
2704
+ ss as activePage,
2705
+ ns as authorizationCatalogs,
2706
+ da as authorizationCopy,
2707
+ is as backgroundCatalogs,
2708
+ sa as backgroundCopy,
2709
+ ia as backgroundErrorCopy,
2710
+ os as catalogs,
2711
+ us as clientTimeout,
2712
+ na as createBackgroundPickerProvider,
2713
+ rs as createBackgroundSaveFacade,
2714
+ ds as createFileTransfers,
2715
+ Me as createNasProvider,
2716
+ vs as createPortalAccess,
2717
+ Ml as createSession,
2718
+ cs as decodeResponse,
2719
+ ps as delegateCatalogs,
2720
+ Ke as delegateCopy,
2721
+ fs as encodeRequest,
2722
+ oa as errorCopy,
2723
+ ys as fileStationPath,
2724
+ Ae as format,
2725
+ ms as identityCatalogs,
2726
+ la as identityCopy,
2727
+ He as labelSeparator,
2728
+ bs as mergeCatalogs,
2729
+ gs as nasCatalogs,
2730
+ be as nasCopy,
2731
+ Le as nasErrorCopy,
2732
+ hs as openFileInFileStation,
2733
+ ra as openFolderInFileStation,
2734
+ ks as portalCatalogs,
2735
+ _s as portalMessages,
2736
+ ws as protocolCodes,
2737
+ xs as protocolOps,
2738
+ Cs as protocolSchemas,
2739
+ Be as requestKey,
2740
+ $s as saveCatalogs,
2741
+ Ne as saveCopy,
2742
+ Ie as saveError,
2743
+ ua as scopedPicker,
2744
+ Ss as shellCatalogs,
2745
+ aa as shellCopy,
2746
+ zs as shellPages,
2747
+ ta as uiLocale,
2748
+ Ps as uiLocales,
2749
+ Il as useAuthorization,
2750
+ We as useExecutorSetup,
2751
+ Ra as useNasRequest
2496
2752
  };