@orangelogic/design-system 2.78.0-pr86677.3 → 2.78.0-pr86677.4

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.
@@ -1,71 +1,71 @@
1
- import z from "../components/icon.js";
2
- import te from "../components/input.js";
3
- import B from "../components/line-clamp.js";
4
- import re from "../components/select.js";
5
- import se from "../components/tag.js";
6
- import { C as g, a as ae } from "./tree.q7xRVYyh.js";
7
- import { n as s, C as O } from "./lib-cortex-element.CVMmyPMC.js";
8
- import { h as w, F as le, b as ie } from "./endpoints.B7lcoc1N.js";
9
- import { c as q } from "./component.styles.CRO4Odto.js";
10
- import { c as V } from "./custom-element.L4WJXn1j.js";
11
- import { L as E } from "./i18n.BUW7B9hr.js";
1
+ import Q from "../components/icon.js";
2
+ import le from "../components/input.js";
3
+ import j from "../components/line-clamp.js";
4
+ import ie from "../components/select.js";
5
+ import oe from "../components/tag.js";
6
+ import { C as g, a as ce } from "./tree.q7xRVYyh.js";
7
+ import { n as s, C as E } from "./lib-cortex-element.CVMmyPMC.js";
8
+ import { h as P, F as ne, b as he } from "./endpoints.B7lcoc1N.js";
9
+ import { c as N } from "./component.styles.CRO4Odto.js";
10
+ import { c as R } from "./custom-element.L4WJXn1j.js";
11
+ import { L as U } from "./i18n.BUW7B9hr.js";
12
12
  import { w as f } from "./watch.BCJD77bD.js";
13
- import { x as m, i as oe } from "./lit-element.jLBm65_O.js";
13
+ import { x as m, i as de } from "./lit-element.jLBm65_O.js";
14
14
  import { r as x } from "./state.CSDxrqLd.js";
15
- import { e as W } from "./query.BBf1UFkC.js";
16
- import { r as ne } from "./choose.BTbF6BAn.js";
17
- import { C as Q } from "./button.KaZ7h26c.js";
18
- import { d as ce } from "./debounce.DaHuiSGU.js";
19
- import { g as N, p as M, e as he } from "./string.B_mXTq0K.js";
15
+ import { e as H } from "./query.BBf1UFkC.js";
16
+ import { r as ue } from "./choose.BTbF6BAn.js";
17
+ import { C as Z } from "./button.KaZ7h26c.js";
18
+ import { d as pe } from "./debounce.DaHuiSGU.js";
19
+ import { g as J, p as z, e as fe } from "./string.B_mXTq0K.js";
20
20
  import { o as y } from "./if-defined.BRoBj_Rp.js";
21
- import { c as H } from "./repeat.DbF2p5ae.js";
21
+ import { c as K } from "./repeat.DbF2p5ae.js";
22
22
  import { n as I } from "./when.Dr1es41R.js";
23
- import de from "../components/space.js";
24
- import { M as L } from "./asset-link-format.BSRDqHg7.js";
25
- import { g as pe } from "./template.CsJd8Pb_.js";
26
- import { e as ue } from "./class-map.BiVq-cVR.js";
27
- var v = /* @__PURE__ */ ((e) => (e.CortexPath = "Document.CortexPath", e.DocType = "CoreField.DocType", e.HasBrowserChildren = "Document.HasBrowserChildren", e.RepresentativeAssetId = "Document.DocumentDirectRepresentativeRID", e.TitleWithFallback = "CoreField.TitleWithFallback", e.rawDocSubtype = "Document.RawDocSubType", e))(v || {});
28
- const fe = 50;
29
- async function P({
23
+ import me from "../components/space.js";
24
+ import { M as B } from "./asset-link-format.BSRDqHg7.js";
25
+ import { g as ye } from "./template.CsJd8Pb_.js";
26
+ import { e as xe } from "./class-map.BiVq-cVR.js";
27
+ var V = /* @__PURE__ */ ((e) => (e.Album = "Album", e.Audio = "Audio", e.Image = "Image", e.Multimedia = "Multimedia", e.ProjectDocument = "ProjectDocument", e.Story = "Story", e.Video = "Video", e.Widget = "Widget", e))(V || {}), v = /* @__PURE__ */ ((e) => (e.CortexPath = "Document.CortexPath", e.DocType = "CoreField.DocType", e.HasBrowserChildren = "Document.HasBrowserChildren", e.RepresentativeAssetId = "Document.DocumentDirectRepresentativeRID", e.TitleWithFallback = "CoreField.TitleWithFallback", e.rawDocSubtype = "Document.RawDocSubType", e))(v || {});
28
+ const be = 50;
29
+ async function L({
30
30
  allowedFolders: e,
31
31
  baseUrl: t,
32
32
  bearerToken: r,
33
33
  excludeVirtualFolders: l,
34
34
  folderId: a,
35
- includeDirectChild: p,
36
- limit: u = fe,
35
+ includeDirectChild: u,
36
+ limit: p = be,
37
37
  searchTerm: $,
38
38
  self: C,
39
- start: R = 0,
40
- token: X
39
+ start: M = 0,
40
+ token: re
41
41
  }) {
42
- let D = [], U = p ?? !0;
43
- e && e.length > 0 && !a ? (D = e, C = !0, U = !1) : a && (D = [a]);
42
+ let _ = [], A = u ?? !0;
43
+ e && e.length > 0 && !a ? (_ = e, C = !0, A = !1) : a && (_ = [a]);
44
44
  try {
45
- return (await w.request({
45
+ return (await P.request({
46
46
  baseURL: t,
47
47
  headers: {
48
48
  Authorization: `Bearer ${r}`
49
49
  },
50
50
  method: "GET",
51
51
  params: {
52
- IncludeDirectChild: U,
52
+ IncludeDirectChild: A,
53
53
  IncludeVirtualFolders: !l,
54
- Limit: u,
55
- ObjectRecordIDs: D,
54
+ Limit: p,
55
+ ObjectRecordIDs: _,
56
56
  SeeThru: !!$,
57
57
  Self: C,
58
- Start: R,
58
+ Start: M,
59
59
  Text: $ || void 0,
60
- Token: X || void 0
60
+ Token: re || void 0
61
61
  },
62
62
  paramsSerializer: {
63
63
  indexes: null
64
64
  },
65
65
  responseType: "json",
66
66
  transformResponse: [
67
- ...Array.isArray(w.defaults.transformResponse) ? w.defaults.transformResponse : [],
68
- (S, Ie, k) => {
67
+ ...Array.isArray(P.defaults.transformResponse) ? P.defaults.transformResponse : [],
68
+ (S, we, k) => {
69
69
  if (k !== void 0 && (k < 200 || k >= 300))
70
70
  return {
71
71
  data: [],
@@ -74,23 +74,27 @@ async function P({
74
74
  };
75
75
  if (!S || typeof S != "object")
76
76
  throw new Error("Invalid response format");
77
- const ee = S.contentItems?.length ?? 0;
77
+ const ae = S.contentItems?.length ?? 0;
78
78
  return {
79
- data: S.contentItems?.map((b) => ({
80
- docType: b.fields[v.DocType] ?? "",
81
- fullPath: b.fields[v.CortexPath] ?? "",
82
- hasChildren: b.fields[v.HasBrowserChildren] === "1",
83
- id: b.recordID,
84
- isShared: b.fields[v.rawDocSubtype] === "DO_OR1ND000001913488",
85
- representativeAssetId: b.fields[v.RepresentativeAssetId] ?? "",
86
- title: b.fields[v.TitleWithFallback] ?? ""
87
- })) ?? [],
88
- hasMore: R + ee < S.totalCount,
79
+ data: S.contentItems?.map((b) => {
80
+ const w = b.fields[v.DocType] ?? "", G = b.fields[v.TitleWithFallback] ?? "";
81
+ let O = b.fields[v.CortexPath] ?? "";
82
+ return (w === V.Album || w === V.ProjectDocument) && (O = `${O}/${G}`), {
83
+ docType: w,
84
+ fullPath: O,
85
+ hasChildren: b.fields[v.HasBrowserChildren] === "1",
86
+ id: b.recordID,
87
+ isShared: b.fields[v.rawDocSubtype] === "DO_OR1ND000001913488",
88
+ representativeAssetId: b.fields[v.RepresentativeAssetId] ?? "",
89
+ title: G
90
+ };
91
+ }) ?? [],
92
+ hasMore: M + ae < S.totalCount,
89
93
  totalCount: S.totalCount
90
94
  };
91
95
  }
92
96
  ],
93
- url: le
97
+ url: ne
94
98
  })).data;
95
99
  } catch {
96
100
  return {
@@ -100,14 +104,14 @@ async function P({
100
104
  };
101
105
  }
102
106
  }
103
- var F = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(F || {}), me = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, h = (e, t, r, l) => {
104
- for (var a = l > 1 ? void 0 : l ? ye(t, r) : t, p = e.length - 1, u; p >= 0; p--)
105
- (u = e[p]) && (a = (l ? u(t, r, a) : u(a)) || a);
106
- return l && a && me(t, r, a), a;
107
+ var F = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(F || {}), ge = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, h = (e, t, r, l) => {
108
+ for (var a = l > 1 ? void 0 : l ? ve(t, r) : t, u = e.length - 1, p; u >= 0; u--)
109
+ (p = e[u]) && (a = (l ? p(t, r, a) : p(a)) || a);
110
+ return l && a && ge(t, r, a), a;
107
111
  };
108
- let o = class extends O {
112
+ let o = class extends E {
109
113
  constructor() {
110
- super(...arguments), this.localize = new E(this), this.role = "treeitem", this.disabledSyncCheckboxes = !0, this.folderId = "", this.hasChildren = !1, this.selectable = !1, this.fullPath = "", this.docType = L.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.selection = "single", this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = P, this.excludeVirtualFolders = !1, this.url = "", this.data = null, this.hasMore = !1, this.loading = !1;
114
+ super(...arguments), this.localize = new U(this), this.role = "treeitem", this.disabledSyncCheckboxes = !0, this.folderId = "", this.hasChildren = !1, this.selectable = !1, this.fullPath = "", this.docType = B.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.selection = "single", this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = L, this.excludeVirtualFolders = !1, this.url = "", this.data = null, this.hasMore = !1, this.loading = !1;
111
115
  }
112
116
  /**
113
117
  * This is used to render the cx-tree-item inside the cx-folder-item without the shadow root so that the cx-tree can query select the cx-tree-item inside
@@ -166,28 +170,28 @@ let o = class extends O {
166
170
  async syncBoxes() {
167
171
  if (this.selection !== "multiple" || (await this.updateComplete, !this.treeItem))
168
172
  return;
169
- const e = this.fullPath, t = N({ id: this.folderId, path: e }), r = M(e), l = this.currentRootIDsSet.has(t);
173
+ const e = this.fullPath, t = J({ id: this.folderId, path: e }), r = z(e), l = this.currentRootIDsSet.has(t);
170
174
  let a = !1;
171
175
  if (e)
172
- for (const u of this.currentRootIDsSet) {
173
- const $ = he(u);
176
+ for (const p of this.currentRootIDsSet) {
177
+ const $ = fe(p);
174
178
  if (!$.path.trim() || !$.id.trim())
175
179
  continue;
176
- const C = M($.path);
180
+ const C = z($.path);
177
181
  if (C.startsWith(r) && C !== r) {
178
182
  a = !0;
179
183
  break;
180
184
  }
181
185
  }
182
- const p = !l && a;
183
- this.treeItem.selected = l, await this.treeItem.updateComplete, this.treeItem.indeterminate = p;
186
+ const u = !l && a;
187
+ this.treeItem.selected = l, await this.treeItem.updateComplete, this.treeItem.indeterminate = u;
184
188
  }
185
189
  render() {
186
- return m`<cx-tree-item class=${ue({
190
+ return m`<cx-tree-item class=${xe({
187
191
  "folder-select-tree-item": !0
188
192
  })} data-id=${this.folderId} data-url=${y(this.url)} data-name=${y(this.name?.trim() || void 0)} data-representative-asset-id=${y(
189
193
  this.representativeAssetId || void 0
190
- )} role="option" ?lazy=${this.hasChildren && this.data === null} ?selected=${this.selection !== "multiple" && this.selectedValue === this.folderId} ?disabled-sync-checkboxes=${this.selection === "multiple"} .selectable=${this.selectable} @cx-lazy-load=${this.handleLazyLoad}><cx-space class="folder-select-tree-item__label" direction="horizontal" spacing="x-small" align-items="center" wrap="nowrap"><cx-icon class="folder-select-tree__item__icon" name="folder" variant=${this.docType === L.Album ? "outlined" : "filled"}></cx-icon><cx-line-clamp lines="1" class="folder-select-tree-item__title">${pe(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${H(
194
+ )} role="option" ?lazy=${this.hasChildren && this.data === null} ?selected=${this.selection !== "multiple" && this.selectedValue === this.folderId} ?disabled-sync-checkboxes=${this.selection === "multiple"} .selectable=${this.selectable} @cx-lazy-load=${this.handleLazyLoad}><cx-space class="folder-select-tree-item__label" direction="horizontal" spacing="x-small" align-items="center" wrap="nowrap"><cx-icon class="folder-select-tree__item__icon" name="folder" variant=${this.docType === B.Album ? "outlined" : "filled"}></cx-icon><cx-line-clamp lines="1" class="folder-select-tree-item__title">${ye(this.name, this.searchTerm)}</cx-line-clamp></cx-space>${K(
191
195
  this.data || [],
192
196
  (e) => e.id,
193
197
  (e) => m`<cx-folder-select-tree-item slot="children" folder-id=${e.id} full-path=${e.fullPath} name=${e.title} representative-asset-id=${e.representativeAssetId} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?has-children=${e.hasChildren} ?selectable=${this.selectable} base-url=${this.baseUrl} url=${y(e.url ?? void 0)} .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} value=${e.url}></cx-folder-select-tree-item>`
@@ -198,16 +202,16 @@ let o = class extends O {
198
202
  `;
199
203
  }
200
204
  };
201
- o.styles = [q];
205
+ o.styles = [N];
202
206
  o.dependencies = {
203
- "cx-button": Q,
204
- "cx-icon": z,
205
- "cx-line-clamp": B,
206
- "cx-space": de,
207
+ "cx-button": Z,
208
+ "cx-icon": Q,
209
+ "cx-line-clamp": j,
210
+ "cx-space": me,
207
211
  "cx-tree-item": g
208
212
  };
209
213
  h([
210
- W("cx-tree-item")
214
+ H("cx-tree-item")
211
215
  ], o.prototype, "treeItem", 2);
212
216
  h([
213
217
  s({ attribute: "folder-id", reflect: !0, type: String })
@@ -287,18 +291,18 @@ h([
287
291
  f("folderId")
288
292
  ], o.prototype, "syncBoxes", 1);
289
293
  o = h([
290
- V("cx-folder-select-tree-item")
294
+ R("cx-folder-select-tree-item")
291
295
  ], o);
292
- var xe = Object.defineProperty, be = Object.getOwnPropertyDescriptor, j = (e) => {
296
+ var $e = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, X = (e) => {
293
297
  throw TypeError(e);
294
298
  }, d = (e, t, r, l) => {
295
- for (var a = l > 1 ? void 0 : l ? be(t, r) : t, p = e.length - 1, u; p >= 0; p--)
296
- (u = e[p]) && (a = (l ? u(t, r, a) : u(a)) || a);
297
- return l && a && xe(t, r, a), a;
298
- }, Z = (e, t, r) => t.has(e) || j("Cannot " + r), ge = (e, t, r) => (Z(e, t, "read from private field"), t.get(e)), ve = (e, t, r) => t.has(e) ? j("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), $e = (e, t, r, l) => (Z(e, t, "write to private field"), t.set(e, r), r), _;
299
- let c = class extends O {
299
+ for (var a = l > 1 ? void 0 : l ? Se(t, r) : t, u = e.length - 1, p; u >= 0; u--)
300
+ (p = e[u]) && (a = (l ? p(t, r, a) : p(a)) || a);
301
+ return l && a && $e(t, r, a), a;
302
+ }, Y = (e, t, r) => t.has(e) || X("Cannot " + r), Te = (e, t, r) => (Y(e, t, "read from private field"), t.get(e)), Ce = (e, t, r) => t.has(e) ? X("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Fe = (e, t, r, l) => (Y(e, t, "write to private field"), t.set(e, r), r), D;
303
+ let n = class extends E {
300
304
  constructor() {
301
- super(...arguments), this.localize = new E(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.seeThru = !1, this.extraFolderData = null, this.api = P, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], ve(this, _, !1);
305
+ super(...arguments), this.localize = new U(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.seeThru = !1, this.extraFolderData = null, this.api = L, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], Ce(this, D, !1);
302
306
  }
303
307
  get empty() {
304
308
  return !this.loading && this.data.length === 0;
@@ -350,7 +354,7 @@ let c = class extends O {
350
354
  )?.fullPath;
351
355
  if (await t.updateComplete, !r.trim() || !l?.trim())
352
356
  return;
353
- const a = N({ id: r, path: l });
357
+ const a = J({ id: r, path: l });
354
358
  t.indeterminate && !t.selected || (t.selected ? this.currentRootIDsSet.add(a) : this.currentRootIDsSet.delete(a), this.currentRootIDsSet = new Set(this.currentRootIDsSet));
355
359
  }
356
360
  async loadMore(e) {
@@ -374,7 +378,7 @@ let c = class extends O {
374
378
  }
375
379
  async handleFetchFolders() {
376
380
  const { data: e, hasMore: t } = await this.fetchFolders();
377
- ge(this, _) || e.length > 0 && (this.firstFetchCallback?.(e), $e(this, _, !0)), this.data = e, this.hasMore = t, this.loading = !1;
381
+ Te(this, D) || e.length > 0 && (this.firstFetchCallback?.(e), Fe(this, D, !0)), this.data = e, this.hasMore = t, this.loading = !1;
378
382
  }
379
383
  async fetchFolders() {
380
384
  if (!this.api)
@@ -416,7 +420,7 @@ let c = class extends O {
416
420
  this.extraFolderData,
417
421
  () => m`<cx-folder-select-tree-item .api=${this.api} .currentRootIDsSet=${this.currentRootIDsSet} .removedIDs=${this.removedIDs} base-url=${this.baseUrl} doc-type=${y(this.extraFolderData?.docType ?? void 0)} folder-id=${y(this.extraFolderData?.id ?? void 0)} full-path=${y(this.extraFolderData?.fullPath ?? void 0)} name=${this.extraFolderTitle || this.extraFolderData?.title} search-term=${this.searchTerm} selected-value=${this.selectedValue} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} url=${y(this.extraFolderData?.url ?? void 0)} ?has-children=${this.extraFolderData?.hasChildren} ?selectable=${this.selection === "multiple"} ?exclude-virtual-folders=${this.excludeVirtualFolders}></cx-folder-select-tree-item>`
418
422
  )}
419
- ${H(
423
+ ${K(
420
424
  this.data,
421
425
  (e) => e.id,
422
426
  (e) => this.renderFolder(e)
@@ -427,108 +431,108 @@ let c = class extends O {
427
431
  )}</cx-tree>`;
428
432
  }
429
433
  };
430
- _ = /* @__PURE__ */ new WeakMap();
431
- c.dependencies = {
432
- "cx-button": Q,
434
+ D = /* @__PURE__ */ new WeakMap();
435
+ n.dependencies = {
436
+ "cx-button": Z,
433
437
  "cx-folder-select-tree-item": o,
434
- "cx-tree": ae
438
+ "cx-tree": ce
435
439
  };
436
440
  d([
437
441
  s({ attribute: "min-query-length", reflect: !0, type: Number })
438
- ], c.prototype, "minQueryLength", 2);
442
+ ], n.prototype, "minQueryLength", 2);
439
443
  d([
440
444
  s({ attribute: "selection", reflect: !0, type: String })
441
- ], c.prototype, "selection", 2);
445
+ ], n.prototype, "selection", 2);
442
446
  d([
443
447
  s({ attribute: "search-term", reflect: !0, type: String })
444
- ], c.prototype, "searchTerm", 2);
448
+ ], n.prototype, "searchTerm", 2);
445
449
  d([
446
450
  s({ attribute: "selected-value", reflect: !0, type: String })
447
- ], c.prototype, "selectedValue", 2);
451
+ ], n.prototype, "selectedValue", 2);
448
452
  d([
449
453
  s({ reflect: !0, type: String })
450
- ], c.prototype, "token", 2);
454
+ ], n.prototype, "token", 2);
451
455
  d([
452
456
  s({ attribute: "bearer-token", reflect: !0, type: String })
453
- ], c.prototype, "bearerToken", 2);
457
+ ], n.prototype, "bearerToken", 2);
454
458
  d([
455
459
  s({ attribute: "base-url", reflect: !0, type: String })
456
- ], c.prototype, "baseUrl", 2);
460
+ ], n.prototype, "baseUrl", 2);
457
461
  d([
458
462
  s({ attribute: "extra-folder-id", reflect: !0, type: String })
459
- ], c.prototype, "extraFolderId", 2);
463
+ ], n.prototype, "extraFolderId", 2);
460
464
  d([
461
465
  s({ attribute: "extra-folder-title", reflect: !0, type: String })
462
- ], c.prototype, "extraFolderTitle", 2);
466
+ ], n.prototype, "extraFolderTitle", 2);
463
467
  d([
464
468
  s({ attribute: "see-thru", reflect: !0, type: Boolean })
465
- ], c.prototype, "seeThru", 2);
469
+ ], n.prototype, "seeThru", 2);
466
470
  d([
467
471
  x()
468
- ], c.prototype, "extraFolderData", 2);
472
+ ], n.prototype, "extraFolderData", 2);
469
473
  d([
470
474
  s({ type: Function })
471
- ], c.prototype, "api", 2);
475
+ ], n.prototype, "api", 2);
472
476
  d([
473
477
  s({
474
478
  attribute: "exclude-virtual-folders",
475
479
  reflect: !0,
476
480
  type: Boolean
477
481
  })
478
- ], c.prototype, "excludeVirtualFolders", 2);
482
+ ], n.prototype, "excludeVirtualFolders", 2);
479
483
  d([
480
484
  s({ attribute: "first-fetch-callback", reflect: !1, type: Function })
481
- ], c.prototype, "firstFetchCallback", 2);
485
+ ], n.prototype, "firstFetchCallback", 2);
482
486
  d([
483
487
  x()
484
- ], c.prototype, "data", 2);
488
+ ], n.prototype, "data", 2);
485
489
  d([
486
490
  x()
487
- ], c.prototype, "hasMore", 2);
491
+ ], n.prototype, "hasMore", 2);
488
492
  d([
489
493
  x()
490
- ], c.prototype, "loading", 2);
494
+ ], n.prototype, "loading", 2);
491
495
  d([
492
496
  x()
493
- ], c.prototype, "currentRootIDsSet", 2);
497
+ ], n.prototype, "currentRootIDsSet", 2);
494
498
  d([
495
499
  x()
496
- ], c.prototype, "removedIDs", 2);
500
+ ], n.prototype, "removedIDs", 2);
497
501
  d([
498
502
  f("extraFolderId")
499
- ], c.prototype, "handleExtraFolderIdChange", 1);
503
+ ], n.prototype, "handleExtraFolderIdChange", 1);
500
504
  d([
501
505
  f("baseUrl", { waitUntilFirstUpdate: !0 }),
502
506
  f("token", { waitUntilFirstUpdate: !0 }),
503
507
  f("searchTerm", { waitUntilFirstUpdate: !0 }),
504
508
  f("excludeVirtualFolders", { waitUntilFirstUpdate: !0 }),
505
- ce(500)
506
- ], c.prototype, "handleFetchFolders", 1);
507
- c = d([
508
- V("cx-folder-select-tree")
509
- ], c);
510
- const Se = oe`:host{width:100%;display:block}.folder-select{gap:var(--cx-spacing-x-small);flex-direction:column;display:flex}.folder-select-tree{flex:1;overflow:auto}.folder-select-tree__item__icon{color:var(--cx-color-primary)}.folder-select-tree__empty-message{font-size:var(--cx-font-size-small);color:var(--cx-color-neutral-500);padding-block:var(--cx-spacing-2x-small);padding-inline:var(--cx-spacing-small);text-align:center;cursor:default;user-select:none}.folder-select-tree__load-more{margin-inline:var(--cx-spacing-small)}.folder-select-tree-item::part(label),.folder-select-tree-item__label,.folder-select-tree-item__title{overflow:hidden}`;
511
- var Te = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, J = (e) => {
509
+ pe(500)
510
+ ], n.prototype, "handleFetchFolders", 1);
511
+ n = d([
512
+ R("cx-folder-select-tree")
513
+ ], n);
514
+ const Ie = de`:host{width:100%;display:block}.folder-select{gap:var(--cx-spacing-x-small);flex-direction:column;display:flex}.folder-select-tree{flex:1;overflow:auto}.folder-select-tree__item__icon{color:var(--cx-color-primary)}.folder-select-tree__empty-message{font-size:var(--cx-font-size-small);color:var(--cx-color-neutral-500);padding-block:var(--cx-spacing-2x-small);padding-inline:var(--cx-spacing-small);text-align:center;cursor:default;user-select:none}.folder-select-tree__load-more{margin-inline:var(--cx-spacing-small)}.folder-select-tree-item::part(label),.folder-select-tree-item__label,.folder-select-tree-item__title{overflow:hidden}`;
515
+ var De = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, ee = (e) => {
512
516
  throw TypeError(e);
513
- }, n = (e, t, r, l) => {
514
- for (var a = l > 1 ? void 0 : l ? Ce(t, r) : t, p = e.length - 1, u; p >= 0; p--)
515
- (u = e[p]) && (a = (l ? u(t, r, a) : u(a)) || a);
516
- return l && a && Te(t, r, a), a;
517
- }, K = (e, t, r) => t.has(e) || J("Cannot " + r), G = (e, t, r) => (K(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Fe = (e, t, r) => t.has(e) ? J("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), A = (e, t, r, l) => (K(e, t, "write to private field"), t.set(e, r), r), T;
518
- let i = class extends O {
517
+ }, c = (e, t, r, l) => {
518
+ for (var a = l > 1 ? void 0 : l ? _e(t, r) : t, u = e.length - 1, p; u >= 0; u--)
519
+ (p = e[u]) && (a = (l ? p(t, r, a) : p(a)) || a);
520
+ return l && a && De(t, r, a), a;
521
+ }, te = (e, t, r) => t.has(e) || ee("Cannot " + r), W = (e, t, r) => (te(e, t, "read from private field"), r ? r.call(e) : t.get(e)), ke = (e, t, r) => t.has(e) ? ee("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), q = (e, t, r, l) => (te(e, t, "write to private field"), t.set(e, r), r), T;
522
+ let i = class extends E {
519
523
  constructor() {
520
- super(), this.localize = new E(this), this.minQueryLength = 1, this.selection = "single", this.variant = F.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = P, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.firstFetchCallback = null, this.searchTerm = "", Fe(this, T), this.selectGetOptionValue = this.selectGetOptionValue.bind(this), this.selectGetOptionLabel = this.selectGetOptionLabel.bind(this), this.selectGetOptionSelected = this.selectGetOptionSelected.bind(this), this.selectFilterCallback = this.selectFilterCallback.bind(this), this.selectSetOptionSelected = this.selectSetOptionSelected.bind(this), this.selectGetTag = this.selectGetTag.bind(this), this.updateWrappedApi();
524
+ super(), this.localize = new U(this), this.minQueryLength = 1, this.selection = "single", this.variant = F.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = L, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.firstFetchCallback = null, this.searchTerm = "", ke(this, T), this.selectGetOptionValue = this.selectGetOptionValue.bind(this), this.selectGetOptionLabel = this.selectGetOptionLabel.bind(this), this.selectGetOptionSelected = this.selectGetOptionSelected.bind(this), this.selectFilterCallback = this.selectFilterCallback.bind(this), this.selectSetOptionSelected = this.selectSetOptionSelected.bind(this), this.selectGetTag = this.selectGetTag.bind(this), this.updateWrappedApi();
521
525
  }
522
526
  updateWrappedApi() {
523
527
  if (!this.api) {
524
- A(this, T, void 0);
528
+ q(this, T, void 0);
525
529
  return;
526
530
  }
527
- A(this, T, async (e) => {
531
+ q(this, T, async (e) => {
528
532
  try {
529
533
  return await this.api(e);
530
534
  } catch (t) {
531
- return t instanceof ie && t.response?.status === 401 && this.emit("cx-renew-token"), { data: [], hasMore: !1, totalCount: 0 };
535
+ return t instanceof he && t.response?.status === 401 && this.emit("cx-renew-token"), { data: [], hasMore: !1, totalCount: 0 };
532
536
  }
533
537
  });
534
538
  }
@@ -624,121 +628,122 @@ let i = class extends O {
624
628
  this.selectEl && (this.searchTerm = "", this.selectEl.getOptionValue = this.selectGetOptionValue, this.selectEl.getOptionLabel = this.selectGetOptionLabel, this.selectEl.getOptionSelected = this.selectGetOptionSelected, this.selectEl.filterCallback = this.selectFilterCallback, this.selectEl.setOptionSelected = this.selectSetOptionSelected, this.selectEl.getTag = this.selectGetTag, this.selectEl.handleDefaultSlotChange());
625
629
  }
626
630
  render() {
627
- return m`<div class="folder-select">${ne(this.variant, [
631
+ return m`<div class="folder-select">${ue(this.variant, [
628
632
  [
629
633
  F.Input,
630
- () => m`<cx-input aria-label=${this.localize.term("searchFolders")} placeholder=${`${this.localize.term("searchFolders")}...`} value=${this.searchTerm} clearable @cx-input=${this.handleSearchTermInputChange}><cx-icon name="search" slot="prefix"></cx-icon></cx-input><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${G(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
634
+ () => m`<cx-input aria-label=${this.localize.term("searchFolders")} placeholder=${`${this.localize.term("searchFolders")}...`} value=${this.searchTerm} clearable @cx-input=${this.handleSearchTermInputChange}><cx-icon name="search" slot="prefix"></cx-icon></cx-input><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${W(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
631
635
  ],
632
636
  [
633
637
  F.Select,
634
- () => m`<cx-select clearable hoist lazy name=${this.name} value=${this.value} .form=${this.form} ?required=${this.required} ?multiple=${this.selection === "multiple"} @input=${this.handleSearchTermSelectChange} @cx-clear=${this.handleSelectClear} @cx-selected-change=${this.handleTreeSelectedChange} allow-freetext><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${G(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
638
+ () => m`<cx-select clearable hoist lazy name=${this.name} value=${this.value} .form=${this.form} ?required=${this.required} ?multiple=${this.selection === "multiple"} @input=${this.handleSearchTermSelectChange} @cx-clear=${this.handleSelectClear} @cx-selected-change=${this.handleTreeSelectedChange} allow-freetext><cx-folder-select-tree base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} min-query-length=${this.minQueryLength} search-term=${this.searchTerm} selected-value=${this.value} selection=${this.selection} token=${this.token} bearer-token=${this.bearerToken} ?exclude-virtual-folders=${this.excludeVirtualFolders} ?see-thru=${this.seeThru} .api=${W(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
635
639
  ]
636
640
  ])}</div>`;
637
641
  }
638
642
  };
639
643
  T = /* @__PURE__ */ new WeakMap();
640
- i.styles = [q, Se];
644
+ i.styles = [N, Ie];
641
645
  i.dependencies = {
642
- "cx-folder-select-tree": c,
643
- "cx-icon": z,
644
- "cx-input": te,
645
- "cx-line-clamp": B,
646
- "cx-select": re,
647
- "cx-tag": se
646
+ "cx-folder-select-tree": n,
647
+ "cx-icon": Q,
648
+ "cx-input": le,
649
+ "cx-line-clamp": j,
650
+ "cx-select": ie,
651
+ "cx-tag": oe
648
652
  };
649
- n([
650
- W("cx-select")
653
+ c([
654
+ H("cx-select")
651
655
  ], i.prototype, "selectEl", 2);
652
- n([
656
+ c([
653
657
  s({ attribute: "min-query-length", reflect: !0, type: Number })
654
658
  ], i.prototype, "minQueryLength", 2);
655
- n([
659
+ c([
656
660
  s({ attribute: "selection", reflect: !0, type: String })
657
661
  ], i.prototype, "selection", 2);
658
- n([
662
+ c([
659
663
  s({ attribute: "variant", reflect: !0, type: String })
660
664
  ], i.prototype, "variant", 2);
661
- n([
665
+ c([
662
666
  s({ reflect: !0, type: String })
663
667
  ], i.prototype, "value", 2);
664
- n([
668
+ c([
665
669
  s({ reflect: !0, type: String })
666
670
  ], i.prototype, "name", 2);
667
- n([
671
+ c([
668
672
  s({ attribute: "selected-label", reflect: !0, type: String })
669
673
  ], i.prototype, "selectedLabel", 2);
670
- n([
674
+ c([
671
675
  s({ attribute: "base-url", reflect: !0, type: String })
672
676
  ], i.prototype, "baseUrl", 2);
673
- n([
677
+ c([
674
678
  s({ reflect: !0, type: Boolean })
675
679
  ], i.prototype, "open", 2);
676
- n([
680
+ c([
677
681
  s({ reflect: !1, type: String })
678
682
  ], i.prototype, "token", 2);
679
- n([
683
+ c([
680
684
  s({ attribute: "bearer-token", reflect: !0, type: String })
681
685
  ], i.prototype, "bearerToken", 2);
682
- n([
686
+ c([
683
687
  s({ attribute: "see-thru", reflect: !0, type: Boolean })
684
688
  ], i.prototype, "seeThru", 2);
685
- n([
689
+ c([
686
690
  s({ type: Function })
687
691
  ], i.prototype, "api", 2);
688
- n([
692
+ c([
689
693
  s({ reflect: !0, type: Boolean })
690
694
  ], i.prototype, "required", 2);
691
- n([
695
+ c([
692
696
  s({ reflect: !1 })
693
697
  ], i.prototype, "form", 2);
694
- n([
698
+ c([
695
699
  s({
696
700
  attribute: "exclude-virtual-folders",
697
701
  reflect: !0,
698
702
  type: Boolean
699
703
  })
700
704
  ], i.prototype, "excludeVirtualFolders", 2);
701
- n([
705
+ c([
702
706
  s({
703
707
  attribute: "extra-folder-id",
704
708
  reflect: !0,
705
709
  type: String
706
710
  })
707
711
  ], i.prototype, "extraFolderId", 2);
708
- n([
712
+ c([
709
713
  s({
710
714
  attribute: "extra-folder-title",
711
715
  reflect: !0,
712
716
  type: String
713
717
  })
714
718
  ], i.prototype, "extraFolderTitle", 2);
715
- n([
719
+ c([
716
720
  s({ attribute: "first-fetch-callback", reflect: !1, type: Function })
717
721
  ], i.prototype, "firstFetchCallback", 2);
718
- n([
722
+ c([
719
723
  x()
720
724
  ], i.prototype, "searchTerm", 2);
721
- n([
725
+ c([
722
726
  f("api")
723
727
  ], i.prototype, "updateWrappedApi", 1);
724
- n([
728
+ c([
725
729
  f("searchTerm", { waitUntilFirstUpdate: !0 })
726
730
  ], i.prototype, "handleSearchTermChange", 1);
727
- n([
731
+ c([
728
732
  f("open")
729
733
  ], i.prototype, "handleOpenChange", 1);
730
- n([
734
+ c([
731
735
  f("variant")
732
736
  ], i.prototype, "handleVariantChange", 1);
733
- n([
737
+ c([
734
738
  f("selectedLabel", { waitUntilFirstUpdate: !0 }),
735
739
  f("value", { waitUntilFirstUpdate: !0 })
736
740
  ], i.prototype, "handleValueChange", 1);
737
- i = n([
738
- V("cx-folder-select")
741
+ i = c([
742
+ R("cx-folder-select")
739
743
  ], i);
740
744
  export {
741
745
  i as C,
742
746
  F,
743
- P as a
747
+ V as M,
748
+ L as a
744
749
  };
@@ -5,7 +5,7 @@ import "./select.js";
5
5
  import "./tag.js";
6
6
  import "../chunks/tree.q7xRVYyh.js";
7
7
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
8
- import { C as h } from "../chunks/folder-select.DOh66tEd.js";
8
+ import { C as h } from "../chunks/folder-select.xc6PtE47.js";
9
9
  import "../chunks/component.styles.CRO4Odto.js";
10
10
  import "../chunks/custom-element.L4WJXn1j.js";
11
11
  import "../chunks/i18n.BUW7B9hr.js";
@@ -5,7 +5,7 @@ import { C } from "../chunks/confirm-popover.DO0gfilx.js";
5
5
  import { default as u } from "./corner-position-input-group.js";
6
6
  import { C as m } from "../chunks/cropper.DTokTzP9.js";
7
7
  import { default as i } from "./dynamic-select.js";
8
- import { C as c } from "../chunks/folder-select.DOh66tEd.js";
8
+ import { C as c } from "../chunks/folder-select.xc6PtE47.js";
9
9
  import { C as P } from "../chunks/list-editor.BwI5h4Sp.js";
10
10
  import { default as I } from "./masonry.js";
11
11
  import { default as y } from "./padding-input-group.js";