@orangelogic/design-system 2.130.0 → 2.132.0

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 (38) hide show
  1. package/library/assets/validation.worker-Dc_pkZlD.js +1 -0
  2. package/library/chunks/{color-swatch-group.DPaKBfvX.js → color-swatch-group.Cy-M_lbx.js} +1 -1
  3. package/library/chunks/{document-viewer.Dn_vUYCW.js → document-viewer.CzGnnA_9.js} +2 -2
  4. package/library/chunks/{folder-select.DMpO7oQF.js → folder-select.CHzRsSGM.js} +45 -45
  5. package/library/chunks/image.BzmclWBR.js +150 -0
  6. package/library/chunks/{image.BC_hwk-b.js → image.DAtx64Jj.js} +1 -1
  7. package/library/chunks/{list-editor.DfOsqO4y.js → list-editor.CwCdVzMl.js} +2 -2
  8. package/library/chunks/{resizable-component.styles.BVhOesNE.js → resizable-component.styles.B5N-oYx6.js} +1 -1
  9. package/library/chunks/{table.Cf3C72Lv.js → table.C6YsaNOh.js} +2460 -2081
  10. package/library/components/asset-link-format.js +1 -1
  11. package/library/components/atoms.js +3 -3
  12. package/library/components/audio.js +1 -1
  13. package/library/components/color-swatch-group.js +2 -2
  14. package/library/components/cropper.js +1 -1
  15. package/library/components/document-viewer.js +3 -3
  16. package/library/components/folder-select.js +1 -1
  17. package/library/components/image.js +2 -2
  18. package/library/components/list-editor.js +2 -2
  19. package/library/components/masonry.js +1 -1
  20. package/library/components/molecules.js +2 -2
  21. package/library/components/organisms.js +1 -1
  22. package/library/components/table.js +52 -50
  23. package/library/components/types.js +10 -10
  24. package/library/components/video.js +2 -2
  25. package/library/package.json +1 -1
  26. package/library/packages/atoms/src/components/table/table.d.ts +43 -0
  27. package/library/packages/events/src/cx-table-validation-change.d.ts +8 -0
  28. package/library/packages/events/src/events.d.ts +7 -6
  29. package/library/packages/hybrid/table-core/src/tabulator-tables/index.d.ts +1 -0
  30. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/Validate.d.ts +81 -13
  31. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/defaults/rule-functions.d.ts +20 -0
  32. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/defaults/validators.d.ts +9 -18
  33. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/validation-worker-client.d.ts +13 -0
  34. package/library/packages/types/src/table.d.ts +55 -1
  35. package/library/react-web-component.d.ts +11 -3
  36. package/library/utils.js +1 -1
  37. package/package.json +1 -1
  38. package/library/chunks/image.9qwbjGNb.js +0 -150
@@ -0,0 +1 @@
1
+ (function(){"use strict";function e(t){return t===""||t===null||t===void 0}function m(t){return Number.isFinite(Number(t))}function c(t,r){if(!r||typeof r!="object")return!0;const n=Number(t);return!(r.min!==void 0&&n<r.min||r.max!==void 0&&n>r.max)}function g(t){return t instanceof Date?t.getTime():typeof t=="number"?Number.isFinite(t)?t:NaN:typeof t=="string"?Date.parse(t):NaN}const p={alphanumeric(t){return e(t)?!0:/^[a-z0-9]+$/i.test(String(t))},boolean(t){return e(t)?!0:typeof t=="boolean"||t==="true"||t==="false"},date(t,r){if(e(t))return!0;const n=g(t);if(Number.isNaN(n))return!1;if(!r||typeof r!="object")return!0;if(r.starts!==void 0){const u=g(r.starts);if(Number.isNaN(u)||n<u)return!1}if(r.ends!==void 0){const u=g(r.ends);if(Number.isNaN(u)||n>u)return!1}return!0},ends(t,r){return e(t)?!0:String(t).toLowerCase().endsWith(String(r).toLowerCase())},float(t,r){if(e(t))return!0;const n=Number(t);return m(t)&&n%1!==0&&c(t,r)},in(t,r){if(e(t))return!0;const n=typeof r=="string"?r.split("|"):r;return Array.isArray(n)&&n.includes(t)},integer(t,r){if(e(t))return!0;const n=Number(t);return m(t)&&Math.floor(n)===n&&c(t,r)},max(t,r){return e(t)?!0:Number.parseFloat(String(t))<=Number(r)},maxLength(t,r){return e(t)?!0:String(t).length<=Number(r)},min(t,r){return e(t)?!0:Number.parseFloat(String(t))>=Number(r)},minLength(t,r){return e(t)?!0:String(t).length>=Number(r)},numeric(t,r){return e(t)?!0:!Number.isNaN(Number(t))&&c(t,r)},regex(t,r){if(e(t))return!0;let n;r instanceof RegExp?n=r:r===void 0?n="":n=String(r);try{return new RegExp(n).test(String(t))}catch{return!1}},required(t){return!e(t)},starts(t,r){return e(t)?!0:String(t).toLowerCase().startsWith(String(r).toLowerCase())},string(t,r){if(e(t))return!0;if(!Number.isNaN(Number(t)))return!1;if(!r||typeof r!="object")return!0;const n=String(t).length;return!(r.minLength!==void 0&&n<r.minLength||r.maxLength!==void 0&&n>r.maxLength)},unique(t,r,n){return e(t)||!n?.columnValues?!0:!n.columnValues.some(u=>u===t)}},y="cx-validation-request",S="cx-validation-response",a=1e3;function N(t){return t===""||t===null||t===void 0}function E(t){const r=new Map;return t.forEach(n=>{N(n)||r.set(n,(r.get(n)??0)+1)}),r}function L(t,r,n){const u=[];return r.forEach(s=>{let i;if(s.type==="unique")i=N(t)||(n.get(t)??0)<=1;else{const o=p[s.type];i=o?o(t,s.parameters):!0}i||u.push({message:s.message,parameters:s.parameters,type:s.type})}),u}globalThis.addEventListener("message",t=>{if(t.origin!==""||t.data?.type!==y)return;const{fields:r,id:n}=t.data.payload,u=r.map(i=>i.rules.some(o=>o.type==="unique")?E(i.values):new Map),s=r.reduce((i,o)=>Math.max(i,o.values.length),0);for(let i=0;i<s||i===0;i+=a){const o=Math.min(i+a,s),d=[];for(let f=i;f<o;f++)r.forEach((b,h)=>{const l=L(b.values[f],b.rules,u[h]);l.length&&d.push({failures:l,fieldIndex:h,rowIndex:f})});const V={done:o>=s,id:n,results:d};if(globalThis.postMessage({payload:V,type:S}),o>=s)break}})})();
@@ -1,5 +1,5 @@
1
1
  import z from "../components/space.js";
2
- import { C as $ } from "./table.Cf3C72Lv.js";
2
+ import { C as $ } from "./table.C6YsaNOh.js";
3
3
  import { C as k } from "./typography.DJC_UXgs.js";
4
4
  import { n as h, C as F } from "./lib-cortex-element.CVMmyPMC.js";
5
5
  import { C, a as g } from "./color-swatch.U-wztpLf.js";
@@ -1,4 +1,4 @@
1
- import { r as resizableComponentStyles, R as ResizableElement, a as ResizeDirection, b as HeightMode } from "./resizable-component.styles.BVhOesNE.js";
1
+ import { r as resizableComponentStyles, R as ResizableElement, a as ResizeDirection, b as HeightMode } from "./resizable-component.styles.B5N-oYx6.js";
2
2
  import { C as CxButton } from "./button.DcInI7IV.js";
3
3
  import CxDrawer from "../components/drawer.js";
4
4
  import CxDropdown from "../components/dropdown.js";
@@ -33,7 +33,7 @@ import { a as ObjectFit } from "./index.Cpamj0jB.js";
33
33
  import { r as r$1 } from "./state.CSDxrqLd.js";
34
34
  import { e } from "./class-map.BiVq-cVR.js";
35
35
  import { n as n$1 } from "./when.Dr1es41R.js";
36
- import { C as CxImage } from "./image.BC_hwk-b.js";
36
+ import { C as CxImage } from "./image.DAtx64Jj.js";
37
37
  var BookReaderMode$1 = /* @__PURE__ */ ((l) => (l.Image = "Image", l.Pdf = "Pdf", l))(BookReaderMode$1 || {}), BookReaderViewMode = /* @__PURE__ */ ((l) => (l.FourPage = "FourPage", l.OnePage = "OnePage", l.TwoPage = "TwoPage", l))(BookReaderViewMode || {});
38
38
  function commonjsRequire(l) {
39
39
  throw new Error('Could not dynamically require "' + l + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
@@ -3,7 +3,7 @@ import { C as de } from "./input.BRgVRr2i.js";
3
3
  import ee from "../components/line-clamp.js";
4
4
  import pe from "../components/select.js";
5
5
  import ue from "../components/tag.js";
6
- import { C as S, a as fe } from "./tree.CbeHY8pn.js";
6
+ import { C as $, a as fe } from "./tree.CbeHY8pn.js";
7
7
  import { n as l, C as B } from "./lib-cortex-element.CVMmyPMC.js";
8
8
  import { h as L, F as me, c as ye } from "./endpoints.6E17hFiK.js";
9
9
  import { M as P } from "./asset-link-format.QzzboHHE.js";
@@ -25,7 +25,7 @@ import { n as w } from "./when.Dr1es41R.js";
25
25
  import ve from "../components/space.js";
26
26
  import { g as Fe } from "./template.ClovJacp.js";
27
27
  import { e as Te } from "./class-map.BiVq-cVR.js";
28
- 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
+ var S = /* @__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))(S || {});
29
29
  const Ie = 50;
30
30
  async function H({
31
31
  allowedFolders: e,
@@ -36,12 +36,12 @@ async function H({
36
36
  includeDirectChild: p,
37
37
  limit: u = Ie,
38
38
  searchTerm: g,
39
- self: C,
39
+ self: I,
40
40
  start: N = 0,
41
41
  token: ne
42
42
  }) {
43
43
  let O = [], Q = p ?? !0;
44
- e && e.length > 0 && !s ? (O = e, C = !0, Q = !1) : s && (O = [s]);
44
+ e && e.length > 0 && !s ? (O = e, I = !0, Q = !1) : s && (O = [s]);
45
45
  try {
46
46
  return (await L.request({
47
47
  baseURL: t,
@@ -55,7 +55,7 @@ async function H({
55
55
  Limit: u,
56
56
  ObjectRecordIDs: O,
57
57
  SeeThru: !!g,
58
- Self: C,
58
+ Self: I,
59
59
  Start: N,
60
60
  Text: g || void 0,
61
61
  Token: ne || void 0
@@ -66,32 +66,32 @@ async function H({
66
66
  responseType: "json",
67
67
  transformResponse: [
68
68
  ...Array.isArray(L.defaults.transformResponse) ? L.defaults.transformResponse : [],
69
- (F, Re, R) => {
69
+ (v, Re, R) => {
70
70
  if (R !== void 0 && (R < 200 || R >= 300))
71
71
  return {
72
72
  data: [],
73
73
  hasMore: !1,
74
74
  totalCount: 0
75
75
  };
76
- if (!F || typeof F != "object")
76
+ if (!v || typeof v != "object")
77
77
  throw new Error("Invalid response format");
78
- const he = F.contentItems?.length ?? 0;
78
+ const he = v.contentItems?.length ?? 0;
79
79
  return {
80
- data: F.contentItems?.map((b) => {
81
- const E = b.fields[v.DocType] ?? "", U = b.fields[v.TitleWithFallback] ?? "", k = b.fields[v.CortexPath] ?? "", M = k.endsWith("/") && k.length > 1 ? k.slice(0, -1) : k;
80
+ data: v.contentItems?.map((b) => {
81
+ const E = b.fields[S.DocType] ?? "", U = b.fields[S.TitleWithFallback] ?? "", k = b.fields[S.CortexPath] ?? "", M = k.endsWith("/") && k.length > 1 ? k.slice(0, -1) : k;
82
82
  let j = M;
83
83
  return (E === P.Album || E === P.ProjectDocument) && (j = M ? `${M}/${U}` : U), {
84
84
  docType: E,
85
85
  fullPath: j,
86
- hasChildren: b.fields[v.HasBrowserChildren] === "1",
86
+ hasChildren: b.fields[S.HasBrowserChildren] === "1",
87
87
  id: b.recordID,
88
- isShared: b.fields[v.rawDocSubtype] === "DO_OR1ND000001913488",
89
- representativeAssetId: b.fields[v.RepresentativeAssetId] ?? "",
88
+ isShared: b.fields[S.rawDocSubtype] === "DO_OR1ND000001913488",
89
+ representativeAssetId: b.fields[S.RepresentativeAssetId] ?? "",
90
90
  title: U
91
91
  };
92
92
  }) ?? [],
93
- hasMore: N + he < F.totalCount,
94
- totalCount: F.totalCount
93
+ hasMore: N + he < v.totalCount,
94
+ totalCount: v.totalCount
95
95
  };
96
96
  }
97
97
  ],
@@ -105,7 +105,7 @@ async function H({
105
105
  };
106
106
  }
107
107
  }
108
- var _ = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(_ || {}), Ce = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, d = (e, t, r, a) => {
108
+ var C = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(C || {}), Ce = Object.defineProperty, _e = Object.getOwnPropertyDescriptor, d = (e, t, r, a) => {
109
109
  for (var s = a > 1 ? void 0 : a ? _e(t, r) : t, p = e.length - 1, u; p >= 0; p--)
110
110
  (u = e[p]) && (s = (a ? u(t, r, s) : u(s)) || s);
111
111
  return a && s && Ce(t, r, s), s;
@@ -190,8 +190,8 @@ let o = class extends B {
190
190
  const g = $e(u);
191
191
  if (!g.path.trim() || !g.id.trim())
192
192
  continue;
193
- const C = Z(g.path);
194
- if (C.startsWith(r) && C !== r) {
193
+ const I = Z(g.path);
194
+ if (I.startsWith(r) && I !== r) {
195
195
  s = !0;
196
196
  break;
197
197
  }
@@ -222,7 +222,7 @@ o.dependencies = {
222
222
  "cx-icon": Y,
223
223
  "cx-line-clamp": ee,
224
224
  "cx-space": ve,
225
- "cx-tree-item": S
225
+ "cx-tree-item": $
226
226
  };
227
227
  d([
228
228
  re("cx-tree-item")
@@ -316,10 +316,10 @@ var De = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, le = (e) =
316
316
  for (var s = a > 1 ? void 0 : a ? ke(t, r) : t, p = e.length - 1, u; p >= 0; p--)
317
317
  (u = e[p]) && (s = (a ? u(t, r, s) : u(s)) || s);
318
318
  return a && s && De(t, r, s), s;
319
- }, ae = (e, t, r) => t.has(e) || le("Cannot " + r), $ = (e, t, r) => (ae(e, t, "read from private field"), t.get(e)), z = (e, t, r) => t.has(e) ? le("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), J = (e, t, r, a) => (ae(e, t, "write to private field"), t.set(e, r), r), T, V, D;
319
+ }, ae = (e, t, r) => t.has(e) || le("Cannot " + r), F = (e, t, r) => (ae(e, t, "read from private field"), t.get(e)), z = (e, t, r) => t.has(e) ? le("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), J = (e, t, r, a) => (ae(e, t, "write to private field"), t.set(e, r), r), _, V, D;
320
320
  let n = class extends B {
321
321
  constructor() {
322
- super(...arguments), this.localize = new q(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.seeThru = !1, this.extraFolderData = null, this.api = H, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.autoPageSize = !1, this.data = [], this.hasMore = !1, this.loading = !1, this.preloadedFolders = [], this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], z(this, T, !1), z(this, V, 10), z(this, D, /* @__PURE__ */ new Set());
322
+ super(...arguments), this.localize = new q(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.seeThru = !1, this.extraFolderData = null, this.api = H, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.autoPageSize = !1, this.data = [], this.hasMore = !1, this.loading = !1, this.preloadedFolders = [], this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], z(this, _, !1), z(this, V, 10), z(this, D, /* @__PURE__ */ new Set());
323
323
  }
324
324
  get empty() {
325
325
  return !this.loading && this.data.length === 0;
@@ -406,10 +406,10 @@ let n = class extends B {
406
406
  }
407
407
  async handleFetchFolders() {
408
408
  const { data: e, hasMore: t } = await this.fetchFolders();
409
- $(this, T) || (e.length > 0 && this.firstFetchCallback?.(e), J(this, T, !0)), this.data = e, this.hasMore = t, this.loading = !1, this.seedSelectionFromValue(e), this.removePreloadedFolders(e), await this.preloadSelectedFolders();
409
+ F(this, _) || (e.length > 0 && this.firstFetchCallback?.(e), J(this, _, !0)), this.data = e, this.hasMore = t, this.loading = !1, this.seedSelectionFromValue(e), this.removePreloadedFolders(e), await this.preloadSelectedFolders();
410
410
  }
411
411
  async handleSelectedValueChange() {
412
- if (!$(this, T))
412
+ if (!F(this, _))
413
413
  return;
414
414
  const e = new Set(
415
415
  this.selectedValue.split(/[\s,]+/).filter(Boolean)
@@ -433,7 +433,7 @@ let n = class extends B {
433
433
  bearerToken: this.bearerToken,
434
434
  excludeVirtualFolders: this.excludeVirtualFolders,
435
435
  folderId: "",
436
- limit: $(this, T) ? 10 : $(this, V),
436
+ limit: F(this, V),
437
437
  searchTerm: this.searchTerm,
438
438
  seeThru: this.seeThru,
439
439
  start: 0,
@@ -462,7 +462,7 @@ let n = class extends B {
462
462
  ...this.data.map((s) => s.id),
463
463
  ...this.extraFolderData ? [this.extraFolderData.id] : [],
464
464
  ...this.preloadedFolders.map((s) => s.id),
465
- ...$(this, D),
465
+ ...F(this, D),
466
466
  ...[
467
467
  ...this.querySelectorAll(
468
468
  "cx-folder-select-tree-item"
@@ -473,7 +473,7 @@ let n = class extends B {
473
473
  );
474
474
  if (r.length === 0)
475
475
  return;
476
- r.forEach((s) => $(this, D).add(s));
476
+ r.forEach((s) => F(this, D).add(s));
477
477
  const a = [];
478
478
  if (await Promise.all(
479
479
  r.map(async (s) => {
@@ -495,7 +495,7 @@ let n = class extends B {
495
495
  } catch {
496
496
  }
497
497
  })
498
- ), r.forEach((s) => $(this, D).delete(s)), a.length > 0) {
498
+ ), r.forEach((s) => F(this, D).delete(s)), a.length > 0) {
499
499
  const s = new Set(this.preloadedFolders.map((u) => u.id)), p = a.filter((u) => !s.has(u.id));
500
500
  p.length > 0 && (this.preloadedFolders = [...this.preloadedFolders, ...p].sort(
501
501
  (u, g) => u.title.localeCompare(g.title)
@@ -543,7 +543,7 @@ let n = class extends B {
543
543
  )}`;
544
544
  }
545
545
  };
546
- T = /* @__PURE__ */ new WeakMap();
546
+ _ = /* @__PURE__ */ new WeakMap();
547
547
  V = /* @__PURE__ */ new WeakMap();
548
548
  D = /* @__PURE__ */ new WeakMap();
549
549
  n.dependencies = {
@@ -644,17 +644,17 @@ var Ve = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, ie = (e) =
644
644
  for (var s = a > 1 ? void 0 : a ? Pe(t, r) : t, p = e.length - 1, u; p >= 0; p--)
645
645
  (u = e[p]) && (s = (a ? u(t, r, s) : u(s)) || s);
646
646
  return a && s && Ve(t, r, s), s;
647
- }, oe = (e, t, r) => t.has(e) || ie("Cannot " + r), K = (e, t, r) => (oe(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Oe = (e, t, r) => t.has(e) ? ie("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), X = (e, t, r, a) => (oe(e, t, "write to private field"), t.set(e, r), r), I;
647
+ }, oe = (e, t, r) => t.has(e) || ie("Cannot " + r), K = (e, t, r) => (oe(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Oe = (e, t, r) => t.has(e) ? ie("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), X = (e, t, r, a) => (oe(e, t, "write to private field"), t.set(e, r), r), T;
648
648
  let i = class extends B {
649
649
  constructor() {
650
- super(), this.localize = new q(this), this.minQueryLength = 1, this.selection = "single", this.variant = _.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = H, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.autoPageSize = !1, this.firstFetchCallback = null, this.searchTerm = "", Oe(this, I), 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();
650
+ super(), this.localize = new q(this), this.minQueryLength = 1, this.selection = "single", this.variant = C.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = H, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.extraFolderIcon = "", this.autoPageSize = !1, this.firstFetchCallback = null, this.searchTerm = "", Oe(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();
651
651
  }
652
652
  updateWrappedApi() {
653
653
  if (!this.api) {
654
- X(this, I, void 0);
654
+ X(this, T, void 0);
655
655
  return;
656
656
  }
657
- X(this, I, async (e) => {
657
+ X(this, T, async (e) => {
658
658
  try {
659
659
  return await this.api(e);
660
660
  } catch (t) {
@@ -696,17 +696,17 @@ let i = class extends B {
696
696
  ), this.selectEl.handleDefaultSlotChange(), await this.selectEl.updateComplete, this.selectEl.displayLabel = this.searchTerm);
697
697
  }
698
698
  selectGetOptionValue(e) {
699
- return !e || !(e instanceof S) ? this.value : e.dataset.id || this.value;
699
+ return !e || !(e instanceof $) ? this.value : e.dataset.id || this.value;
700
700
  }
701
701
  selectGetOptionLabel(e) {
702
- return !e || !(e instanceof S) ? this.selectedLabel : e.dataset.name || this.selectedLabel;
702
+ return !e || !(e instanceof $) ? this.selectedLabel : e.dataset.name || this.selectedLabel;
703
703
  }
704
704
  selectGetOptionSelected(e) {
705
- if (!(!e || !(e instanceof S)))
705
+ if (!(!e || !(e instanceof $)))
706
706
  return e.selected;
707
707
  }
708
708
  selectFilterCallback(e) {
709
- return !(!e || !(e instanceof S));
709
+ return !(!e || !(e instanceof $));
710
710
  }
711
711
  /**
712
712
  * Custom tag renderer for cx-select multi mode. Identical visuals to the
@@ -723,11 +723,11 @@ let i = class extends B {
723
723
  remove-button:tag__remove-button,
724
724
  remove-button__base:tag__remove-button__base
725
725
  " removable @cx-remove=${(r) => {
726
- r.stopPropagation(), e instanceof S && (e.selected = !1);
726
+ r.stopPropagation(), e instanceof $ && (e.selected = !1);
727
727
  }}><cx-line-clamp lines="1">${this.selectGetOptionLabel(e)}</cx-line-clamp></cx-tag>`;
728
728
  }
729
729
  selectSetOptionSelected(e, t) {
730
- if (!(!e || !(e instanceof S)) && this.selection !== "multiple") {
730
+ if (!(!e || !(e instanceof $)) && this.selection !== "multiple") {
731
731
  if (t === void 0) {
732
732
  e.selected = !e.selected;
733
733
  return;
@@ -748,7 +748,7 @@ let i = class extends B {
748
748
  }
749
749
  }
750
750
  async handleVariantChange() {
751
- this.variant === _.Select && (await this.updateComplete, this.updateFunctionProps());
751
+ this.variant === C.Select && (await this.updateComplete, this.updateFunctionProps());
752
752
  }
753
753
  handleValueChange() {
754
754
  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());
@@ -756,17 +756,17 @@ let i = class extends B {
756
756
  render() {
757
757
  return m`<div class="folder-select">${ge(this.variant, [
758
758
  [
759
- _.Input,
760
- () => m`<cx-input class="folder-select__search" 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 class="folder-select__tree" base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} 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} ?auto-page-size=${this.autoPageSize} .api=${K(this, I)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
759
+ C.Input,
760
+ () => m`<cx-input class="folder-select__search" 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 class="folder-select__tree" base-url=${this.baseUrl} extra-folder-id=${this.extraFolderId} extra-folder-title=${this.extraFolderTitle} extra-folder-icon=${this.extraFolderIcon} 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} ?auto-page-size=${this.autoPageSize} .api=${K(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree>`
761
761
  ],
762
762
  [
763
- _.Select,
764
- () => 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} extra-folder-icon=${this.extraFolderIcon} 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} ?auto-page-size=${this.autoPageSize} .api=${K(this, I)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
763
+ C.Select,
764
+ () => 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} extra-folder-icon=${this.extraFolderIcon} 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} ?auto-page-size=${this.autoPageSize} .api=${K(this, T)} .firstFetchCallback=${this.firstFetchCallback}></cx-folder-select-tree></cx-select>`
765
765
  ]
766
766
  ])}</div>`;
767
767
  }
768
768
  };
769
- I = /* @__PURE__ */ new WeakMap();
769
+ T = /* @__PURE__ */ new WeakMap();
770
770
  i.styles = [te, we];
771
771
  i.dependencies = {
772
772
  "cx-folder-select-tree": n,
@@ -879,6 +879,6 @@ i = c([
879
879
  ], i);
880
880
  export {
881
881
  i as C,
882
- _ as F,
882
+ C as F,
883
883
  H as a
884
884
  };
@@ -0,0 +1,150 @@
1
+ import { r as g } from "./number.B4PQLJIg.js";
2
+ function m(e, t, i, o) {
3
+ const a = e / t, n = i / o;
4
+ let c = e, r = t;
5
+ return a > n ? c = Math.round(r * n) : r = Math.round(c / n), {
6
+ height: r,
7
+ width: c
8
+ };
9
+ }
10
+ function p(e, t, i, o, a) {
11
+ const n = new Image();
12
+ return n.src = e, n.crossOrigin = "anonymous", new Promise((c) => {
13
+ n.onload = () => {
14
+ const r = document.createElement("canvas");
15
+ if (t > o || i > a) {
16
+ const h = o / t, l = a / i, u = Math.max(h, l);
17
+ r.width = t * u, r.height = i * u;
18
+ } else
19
+ r.width = t, r.height = i;
20
+ const s = r.getContext("2d");
21
+ s ? (s.fillStyle = "white", s.fillRect(0, 0, r.width, r.height), s.drawImage(n, 0, 0, r.width, r.height), c({
22
+ height: r.height,
23
+ url: r.toDataURL("image/jpeg"),
24
+ width: r.width
25
+ })) : c({
26
+ height: i,
27
+ url: e,
28
+ width: t
29
+ });
30
+ }, n.onerror = () => {
31
+ c({
32
+ height: i,
33
+ url: e,
34
+ width: t
35
+ });
36
+ };
37
+ });
38
+ }
39
+ function R(e, t) {
40
+ const i = new Image();
41
+ return i.src = e.url, i.crossOrigin = "anonymous", new Promise((o) => {
42
+ i.onload = () => {
43
+ const a = document.createElement("canvas");
44
+ a.width = t.width, a.height = t.height;
45
+ const n = a.getContext("2d");
46
+ n ? (n.fillStyle = "white", n.fillRect(0, 0, a.width, a.height), n.drawImage(i, -t.x, -t.y, e.width, e.height), o(a.toDataURL("image/jpeg"))) : o(e.url);
47
+ }, i.onerror = () => {
48
+ o(e.url);
49
+ };
50
+ });
51
+ }
52
+ function S(e, t) {
53
+ const i = new Image();
54
+ return i.src = e.url, i.crossOrigin = "anonymous", new Promise((o) => {
55
+ i.onload = () => {
56
+ const { height: a, width: n } = g(e.width, e.height, t), c = document.createElement("canvas");
57
+ c.width = n, c.height = a;
58
+ const r = c.getContext("2d");
59
+ r ? (r.fillStyle = "white", r.fillRect(0, 0, n, a), r.translate(n / 2, a / 2), r.rotate(t * Math.PI / 180), r.drawImage(
60
+ i,
61
+ -e.width / 2,
62
+ -e.height / 2,
63
+ e.width,
64
+ e.height
65
+ ), r.rotate(-(t * Math.PI) / 180), r.translate(-n / 2, -a / 2), o(c.toDataURL("image/jpeg"))) : o(e.url);
66
+ }, i.onerror = () => {
67
+ o(e.url);
68
+ };
69
+ });
70
+ }
71
+ function y(e) {
72
+ const t = e.getBoundingClientRect(), i = t.width / t.height, o = e.naturalWidth / e.naturalHeight;
73
+ let a, n;
74
+ return o > i ? (a = t.width, n = t.width / o) : (n = t.height, a = t.height * o), { height: n, width: a };
75
+ }
76
+ async function d(e) {
77
+ const t = new Image();
78
+ return t.src = e, await t.decode(), [t.naturalWidth, t.naturalHeight];
79
+ }
80
+ function b(e) {
81
+ const t = e.trim();
82
+ if (!t)
83
+ return !1;
84
+ if (t.startsWith("data:image/") || t.startsWith("blob:"))
85
+ return !0;
86
+ try {
87
+ const i = new URL(t, globalThis.location.href);
88
+ return ["blob:", "data:", "http:", "https:"].includes(i.protocol);
89
+ } catch {
90
+ return !1;
91
+ }
92
+ }
93
+ async function I(e) {
94
+ try {
95
+ const t = await fetch(e), i = t.headers.get("Content-Type");
96
+ if (!i)
97
+ return null;
98
+ const o = i.split("/")[1], a = await t.blob();
99
+ if (!a)
100
+ return null;
101
+ const n = URL.createObjectURL(a), [c, r] = await d(n);
102
+ return {
103
+ fileExtension: o,
104
+ height: r,
105
+ src: n,
106
+ width: c
107
+ };
108
+ } catch {
109
+ return null;
110
+ }
111
+ }
112
+ function w(e = /* @__PURE__ */ new Date()) {
113
+ const i = [
114
+ "Jan",
115
+ "Feb",
116
+ "Mar",
117
+ "Apr",
118
+ "May",
119
+ "Jun",
120
+ "Jul",
121
+ "Aug",
122
+ "Sep",
123
+ "Oct",
124
+ "Nov",
125
+ "Dec"
126
+ ][e.getMonth()], o = e.getDate(), a = e.getFullYear();
127
+ let n = e.getHours();
128
+ const r = n < 12 ? "AM" : "PM";
129
+ n = n % 12, n = n === 0 ? 12 : n;
130
+ const s = e.getMinutes().toString().padStart(2, "0"), h = e.getSeconds().toString().padStart(2, "0"), l = e.getMilliseconds().toString().padStart(3, "0");
131
+ return `Screenshot - ${i} ${o} ${a} ${n}-${s}-${h}-${l} ${r}`;
132
+ }
133
+ function M(e) {
134
+ const t = e.split(".");
135
+ if (t.length <= 1 || e.startsWith(".") && t.length === 2)
136
+ return e.slice(0, 256);
137
+ const i = t.slice(0, -1).join(".").trim();
138
+ return i.length === 0 || i === "image" ? w() : i.slice(0, 256 - t[1].length);
139
+ }
140
+ export {
141
+ S as a,
142
+ R as b,
143
+ m as c,
144
+ d,
145
+ I as e,
146
+ M as f,
147
+ y as g,
148
+ b as i,
149
+ p as r
150
+ };
@@ -1,4 +1,4 @@
1
- import { r as we, R as Ee, H as Y, a as te, b as Ce } from "./resizable-component.styles.BVhOesNE.js";
1
+ import { r as we, R as Ee, H as Y, a as te, b as Ce } from "./resizable-component.styles.B5N-oYx6.js";
2
2
  import { c as ke } from "./component.styles.CRO4Odto.js";
3
3
  import { a as Le } from "./index.Cpamj0jB.js";
4
4
  import { c as Re } from "./custom-element.L4WJXn1j.js";
@@ -9,7 +9,7 @@ import U from "../components/radio.js";
9
9
  import H from "../components/radio-group.js";
10
10
  import V from "../components/select.js";
11
11
  import T from "../components/space.js";
12
- import { C as W, H as J } from "./table.Cf3C72Lv.js";
12
+ import { C as W, H as J } from "./table.C6YsaNOh.js";
13
13
  import { C as L } from "./typography.DJC_UXgs.js";
14
14
  import { n as r, C as D } from "./lib-cortex-element.CVMmyPMC.js";
15
15
  import X from "../components/dynamic-select.js";
@@ -29,7 +29,7 @@ import { c as x } from "./repeat.DbF2p5ae.js";
29
29
  import { n as N } from "./when.Dr1es41R.js";
30
30
  import { t as ae } from "./toString.CAY8lys2.js";
31
31
  import { C as ie } from "./icon-button.COTH_z-J.js";
32
- import { C as ne } from "./image.BC_hwk-b.js";
32
+ import { C as ne } from "./image.DAtx64Jj.js";
33
33
  import { a as se, F as I, b as w } from "./asset.D_VITxRH.js";
34
34
  import { a as re } from "./index.Cpamj0jB.js";
35
35
  import { A as g } from "./content-builder.BGzxZUgi.js";
@@ -3,7 +3,7 @@ import { C as N, n as o } from "./lib-cortex-element.CVMmyPMC.js";
3
3
  import { r as x } from "./state.CSDxrqLd.js";
4
4
  import { e as W } from "./query.BBf1UFkC.js";
5
5
  import { E as $, b as S } from "./index.Cpamj0jB.js";
6
- var k = /* @__PURE__ */ ((t) => (t.Bottom = "bottom", t.BottomCenter = "bottom-center", t.BottomLeft = "bottom-left", t.BottomRight = "bottom-right", t.CenterCenter = "center-center", t.CenterLeft = "center-left", t.CenterRight = "center-right", t.Left = "left", t.Right = "right", t.Top = "top", t.TopCenter = "top-center", t.TopLeft = "top-left", t.TopRight = "top-right", t))(k || {}), B = /* @__PURE__ */ ((t) => (t.Jump = "jump", t.None = "none", t.TextReveal = "text-reveal", t.Zoom = "zoom", t))(B || {}), C = /* @__PURE__ */ ((t) => (t.PopOut = "pop-out", t.WithinBorders = "within-borders", t))(C || {}), H = /* @__PURE__ */ ((t) => (t.Fade = "fade", t.Slide = "slide", t))(H || {}), b = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Fixed = "fixed", t))(b || {}), p = /* @__PURE__ */ ((t) => (t.Both = "both", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(p || {}), I = Object.defineProperty, l = (t, e, g, v) => {
6
+ var b = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Fixed = "fixed", t))(b || {}), p = /* @__PURE__ */ ((t) => (t.Both = "both", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(p || {}), k = /* @__PURE__ */ ((t) => (t.Bottom = "bottom", t.BottomCenter = "bottom-center", t.BottomLeft = "bottom-left", t.BottomRight = "bottom-right", t.CenterCenter = "center-center", t.CenterLeft = "center-left", t.CenterRight = "center-right", t.Left = "left", t.Right = "right", t.Top = "top", t.TopCenter = "top-center", t.TopLeft = "top-left", t.TopRight = "top-right", t))(k || {}), B = /* @__PURE__ */ ((t) => (t.Jump = "jump", t.None = "none", t.TextReveal = "text-reveal", t.Zoom = "zoom", t))(B || {}), C = /* @__PURE__ */ ((t) => (t.PopOut = "pop-out", t.WithinBorders = "within-borders", t))(C || {}), H = /* @__PURE__ */ ((t) => (t.Fade = "fade", t.Slide = "slide", t))(H || {}), I = Object.defineProperty, l = (t, e, g, v) => {
7
7
  for (var s = void 0, h = t.length - 1, a; h >= 0; h--)
8
8
  (a = t[h]) && (s = a(e, g, s) || s);
9
9
  return s && I(e, g, s), s;