@ynput/ayon-frontend-shared 0.6.8 → 0.6.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.
@@ -302,6 +302,21 @@ const gr = ({ name: t, fullName: e, imageKey: n, ...o }) => t ? /* @__PURE__ */
302
302
  "numberList",
303
303
  "bulletList",
304
304
  "checkList"
305
+ ], Pl = [
306
+ "h1",
307
+ "h2",
308
+ "h3",
309
+ "|",
310
+ "bold",
311
+ "italic",
312
+ "strikethrough",
313
+ "link",
314
+ "|",
315
+ "codeBlock",
316
+ "quote",
317
+ "|",
318
+ "numberList",
319
+ "bulletList"
305
320
  ], Cr = [
306
321
  "bold",
307
322
  "italic",
@@ -507,7 +522,7 @@ class ye extends gn {
507
522
  );
508
523
  }
509
524
  }
510
- const pe = (t) => at(new ye(t.trim())), Sr = (t) => t instanceof ye, bn = ["mp4", "mov", "webm", "mkv", "m4v", "ogv", "avi"], Or = ["png", "jpg", "jpeg", "gif", "webp", "svg", "avif", "bmp"], yn = (t) => t?.split(/[?#]/)[0].split(".").pop()?.toLowerCase() || "", vn = (t, ...e) => t?.startsWith("video/") ? "video" : t?.startsWith("image/") ? "image" : e.some((n) => bn.includes(yn(n))) ? "video" : "image", Rr = (t) => t.type.startsWith("image/") || t.type.startsWith("video/") || [...Or, ...bn].includes(yn(t.name)), Ir = /\/api\/projects\/[^/]+\/files\/([\w-]+)/, bt = (t) => t?.match(Ir)?.[1] ?? null, Ar = /^\s*!\[[^\]]*\]\(<?([^\s)>]+)>?(?:\s+"[^"]*")?\)\s*$/, Dr = /^\s*(```|~~~)/, Pl = (t) => {
525
+ const pe = (t) => at(new ye(t.trim())), Sr = (t) => t instanceof ye, bn = ["mp4", "mov", "webm", "mkv", "m4v", "ogv", "avi"], Or = ["png", "jpg", "jpeg", "gif", "webp", "svg", "avif", "bmp"], yn = (t) => t?.split(/[?#]/)[0].split(".").pop()?.toLowerCase() || "", vn = (t, ...e) => t?.startsWith("video/") ? "video" : t?.startsWith("image/") ? "image" : e.some((n) => bn.includes(yn(n))) ? "video" : "image", Rr = (t) => t.type.startsWith("image/") || t.type.startsWith("video/") || [...Or, ...bn].includes(yn(t.name)), Ir = /\/api\/projects\/[^/]+\/files\/([\w-]+)/, bt = (t) => t?.match(Ir)?.[1] ?? null, Ar = /^\s*!\[[^\]]*\]\(<?([^\s)>]+)>?(?:\s+"[^"]*")?\)\s*$/, Dr = /^\s*(```|~~~)/, Bl = (t) => {
511
526
  const e = /* @__PURE__ */ new Set();
512
527
  let n = !1;
513
528
  for (const o of String(t || "").split(`
@@ -2297,7 +2312,7 @@ const Hi = ({ placement: t = "inline", menuParent: e }) => {
2297
2312
  ),
2298
2313
  [t]
2299
2314
  ), null;
2300
- }, Ft = /^[0-9a-f]{32}$/, Bl = (t, e) => `source:${t}` + (e ? `?${new URLSearchParams({ type: e.type, id: e.id })}` : ""), ze = (t) => {
2315
+ }, Ft = /^[0-9a-f]{32}$/, zl = (t, e) => `source:${t}` + (e ? `?${new URLSearchParams({ type: e.type, id: e.id })}` : ""), ze = (t) => {
2301
2316
  if (!t) return null;
2302
2317
  const e = t.match(/^source:([0-9a-f]{32})(?:\?(.*))?$/);
2303
2318
  if (e) {
@@ -3634,7 +3649,7 @@ const js = (t, e) => {
3634
3649
  keywords: d,
3635
3650
  relevance: n.relevance
3636
3651
  };
3637
- }), zl = ({
3652
+ }), Fl = ({
3638
3653
  suggestions: t = {},
3639
3654
  // version options read the product types
3640
3655
  project: e = { productTypes: [] },
@@ -3923,10 +3938,10 @@ const js = (t, e) => {
3923
3938
  values: z["last-year"](),
3924
3939
  icon: "calendar_month"
3925
3940
  }
3926
- ], Fl = An(), ia = () => [
3941
+ ], Kl = An(), ia = () => [
3927
3942
  ra,
3928
3943
  ...An()
3929
- ], Kl = ia(), Ul = (t, e) => {
3944
+ ], Ul = ia(), Hl = (t, e) => {
3930
3945
  if (!t || !e) return null;
3931
3946
  try {
3932
3947
  const n = B(t), o = B(e);
@@ -4075,7 +4090,7 @@ const js = (t, e) => {
4075
4090
  o.set("activity", e);
4076
4091
  const i = new URL(`${window.location.origin}/projects/${t}/${r}`);
4077
4092
  return i.search = o.toString(), i.toString();
4078
- }, Hl = x.div`
4093
+ }, jl = x.div`
4079
4094
  /* use grid tick for auto height transition */
4080
4095
  display: grid;
4081
4096
  height: 100%;
@@ -4103,7 +4118,7 @@ const js = (t, e) => {
4103
4118
  --button-color-secondary: ${e};
4104
4119
  --button-text-color: ${to(t)};
4105
4120
  --border-color: ${t};
4106
- `, jl = x.div`
4121
+ `, Gl = x.div`
4107
4122
  /* VARS */
4108
4123
  --background-color: var(--md-sys-color-surface-container);
4109
4124
  --button-color: var(--md-sys-color-primary);
@@ -4201,14 +4216,14 @@ const js = (t, e) => {
4201
4216
  /* remove outline */
4202
4217
  outline: none;
4203
4218
  }
4204
- `, Gl = x.div`
4219
+ `, Wl = x.div`
4205
4220
  padding: 4px 4px 0;
4206
- `, Wl = x.span`
4221
+ `, Yl = x.span`
4207
4222
  width: 1px;
4208
4223
  height: 18px;
4209
4224
  margin: 0 4px;
4210
4225
  background-color: var(--md-sys-color-surface-container-hover);
4211
- `, Yl = x.footer`
4226
+ `, ql = x.footer`
4212
4227
  display: flex;
4213
4228
  justify-content: space-between;
4214
4229
  padding: var(--padding-m);
@@ -4249,7 +4264,7 @@ const js = (t, e) => {
4249
4264
  }
4250
4265
  }
4251
4266
  }
4252
- `, ql = x.div`
4267
+ `, Vl = x.div`
4253
4268
  display: inline-flex;
4254
4269
  align-items: center;
4255
4270
  border-radius: var(--border-radius-m);
@@ -4263,14 +4278,14 @@ const js = (t, e) => {
4263
4278
  background-color: var(--md-sys-color-primary-container-hover);
4264
4279
  }
4265
4280
  }
4266
- `, Vl = x(te)`
4281
+ `, Ql = x(te)`
4267
4282
  color: inherit;
4268
4283
  background: transparent;
4269
4284
 
4270
4285
  &:hover {
4271
4286
  background-color: var(--md-sys-color-primary-container-hover) !important;
4272
4287
  }
4273
- `, Ql = x(te)`
4288
+ `, Jl = x(te)`
4274
4289
  width: 100%;
4275
4290
  padding: 4px 6px;
4276
4291
  white-space: nowrap;
@@ -4280,14 +4295,14 @@ const js = (t, e) => {
4280
4295
  &:hover {
4281
4296
  background-color: var(--md-sys-color-surface-container-low) !important;
4282
4297
  }
4283
- `, Jl = x(eo)`
4298
+ `, Xl = x(eo)`
4284
4299
  min-width: 0;
4285
4300
  padding: 4px 8px;
4286
- `, Xl = x(ma)`
4301
+ `, Zl = x(ma)`
4287
4302
  margin-left: auto;
4288
4303
  flex-shrink: 1;
4289
4304
  overflow: hidden;
4290
- `, Zl = x.div`
4305
+ `, ec = x.div`
4291
4306
  position: absolute;
4292
4307
  inset: 0;
4293
4308
  user-select: none;
@@ -4311,18 +4326,18 @@ const js = (t, e) => {
4311
4326
  .icon {
4312
4327
  font-size: 40px;
4313
4328
  }
4314
- `, ec = x.span`
4329
+ `, tc = x.span`
4315
4330
  padding: 12px 15px;
4316
4331
  /* italic */
4317
4332
  font-style: italic;
4318
4333
  opacity: 0.4;
4319
- `, tc = x.div`
4334
+ `, nc = x.div`
4320
4335
  display: grid;
4321
4336
  gap: var(--base-gap-medium);
4322
4337
  grid-template-columns: 1fr 1fr;
4323
- `, nc = x.div`
4338
+ `, oc = x.div`
4324
4339
  margin-top: var(--padding-m);
4325
- `, oc = x(te)`
4340
+ `, rc = x(te)`
4326
4341
  background: transparent;
4327
4342
  border: solid 1px currentColor;
4328
4343
  flex-grow: 1;
@@ -4357,7 +4372,7 @@ const js = (t, e) => {
4357
4372
  pointer-events: none;
4358
4373
  }
4359
4374
  }
4360
- `, rc = x.div`
4375
+ `, ic = x.div`
4361
4376
  border-radius: var(--border-radius-l);
4362
4377
  margin-bottom: var(--padding-m);
4363
4378
  user-select: none;
@@ -4385,7 +4400,7 @@ const js = (t, e) => {
4385
4400
  x.div`
4386
4401
  border-radius: var(--border-radius-m);
4387
4402
  `;
4388
- const ic = x.li`
4403
+ const sc = x.li`
4389
4404
  /* VARS */
4390
4405
  --background-color: var(--md-sys-color-surface-container);
4391
4406
  --button-color-secondary: var(--md-sys-color-surface-container-high);
@@ -4435,7 +4450,7 @@ const ic = x.li`
4435
4450
  &.isHighlighted {
4436
4451
  background-color: var(--md-sys-color-secondary-container);
4437
4452
  }
4438
- `, sc = x.div`
4453
+ `, ac = x.div`
4439
4454
  background-color: var(--background-color);
4440
4455
  border-radius: var(--border-radius-m);
4441
4456
  padding: var(--padding-m);
@@ -4667,7 +4682,7 @@ const Wt = x.pre`
4667
4682
  color: var(--md-sys-color-tertiary);
4668
4683
  white-space: pre-wrap;
4669
4684
  word-break: break-word;
4670
- `, ac = x.div`
4685
+ `, lc = x.div`
4671
4686
  display: flex;
4672
4687
  position: absolute;
4673
4688
  right: 4px;
@@ -4680,7 +4695,7 @@ const Wt = x.pre`
4680
4695
 
4681
4696
  /* by default hidden */
4682
4697
  opacity: 0;
4683
- `, lc = x(te)`
4698
+ `, cc = x(te)`
4684
4699
  &.hasIcon {
4685
4700
  padding: 4px;
4686
4701
  }
@@ -4695,7 +4710,7 @@ const Wt = x.pre`
4695
4710
  position: relative;
4696
4711
  top: -1px;
4697
4712
  }
4698
- `, cc = x.span`
4713
+ `, dc = x.span`
4699
4714
  background-color: var(--md-sys-color-secondary-container);
4700
4715
  display: flex;
4701
4716
  align-items: center;
@@ -4716,14 +4731,14 @@ const Wt = x.pre`
4716
4731
  .icon {
4717
4732
  font-size: 24px;
4718
4733
  }
4719
- `, dc = x.div`
4734
+ `, uc = x.div`
4720
4735
  display: flex;
4721
4736
  align-items: center;
4722
4737
  gap: var(--base-gap-small);
4723
4738
  min-width: 0;
4724
4739
  overflow-x: auto;
4725
4740
  padding-bottom: 4px;
4726
- `, uc = x.button`
4741
+ `, mc = x.button`
4727
4742
  display: inline-flex;
4728
4743
  align-items: center;
4729
4744
  gap: var(--base-gap-small);
@@ -4779,7 +4794,7 @@ const Wt = x.pre`
4779
4794
  }
4780
4795
  }
4781
4796
  return {};
4782
- }, fa = (t) => qt.Children.toArray(t).map((e) => typeof e == "string" || typeof e == "number" ? String(e) : "").join(""), mc = ({ children: t, href: e }, {
4797
+ }, fa = (t) => qt.Children.toArray(t).map((e) => typeof e == "string" || typeof e == "number" ? String(e) : "").join(""), pc = ({ children: t, href: e }, {
4783
4798
  entityId: n,
4784
4799
  entityType: o,
4785
4800
  userName: r,
@@ -4848,17 +4863,17 @@ const Wt = x.pre`
4848
4863
  children: w
4849
4864
  }
4850
4865
  );
4851
- }, pc = ({ type: t, checked: e, ...n }, { activity: o, onCheckChange: r }) => t === "checkbox" ? /* @__PURE__ */ l(
4866
+ }, gc = ({ type: t, checked: e, ...n }, { activity: o, onCheckChange: r }) => t === "checkbox" ? /* @__PURE__ */ l(
4852
4867
  aa,
4853
4868
  {
4854
4869
  checked: !!e,
4855
4870
  onChange: (i) => r && r(i, o)
4856
4871
  }
4857
- ) : /* @__PURE__ */ l("input", { type: t, disabled: !0, ...n }), gc = ({ node: t, className: e, children: n }) => {
4872
+ ) : /* @__PURE__ */ l("input", { type: t, disabled: !0, ...n }), hc = ({ node: t, className: e, children: n }) => {
4858
4873
  if (!(!!e?.startsWith("language-") || t?.position && t.position.start.line !== t.position.end.line)) return /* @__PURE__ */ l(pa, { children: n });
4859
4874
  const r = e?.replace(/^language-/, ""), i = typeof n == "string" ? n.replace(/\n$/, "") : null, s = i !== null ? yr(i, r) : null;
4860
4875
  return s !== null ? /* @__PURE__ */ l(Wt, { children: /* @__PURE__ */ l("code", { className: e, dangerouslySetInnerHTML: { __html: s } }) }) : /* @__PURE__ */ l(Wt, { children: n });
4861
- }, hc = ({ children: t }) => {
4876
+ }, fc = ({ children: t }) => {
4862
4877
  const e = qt.Children.toArray(t).find((o) => !!o?.props)?.props?.children;
4863
4878
  if (!e) return /* @__PURE__ */ l("blockquote", { children: t });
4864
4879
  const n = [];
@@ -4908,67 +4923,91 @@ const Wt = x.pre`
4908
4923
  z-index: 0;
4909
4924
  border-radius: 100%;
4910
4925
  }
4911
- `, fc = Vt(
4926
+ `, bc = Vt(
4912
4927
  ({ className: t, ...e }, n) => /* @__PURE__ */ l(ba, { className: P("playable", t), ...e, ref: n, children: /* @__PURE__ */ l(J, { icon: "play_circle" }) })
4913
4928
  );
4914
4929
  export {
4915
- cc as $,
4916
- rt as A,
4930
+ Ae as $,
4931
+ $n as A,
4917
4932
  ae as B,
4918
4933
  oa as C,
4919
- ta as D,
4920
- Gl as E,
4921
- Yl as F,
4922
- Ql as G,
4923
- Zl as H,
4924
- nc as I,
4925
- Pl as J,
4926
- Bl as K,
4927
- rc as L,
4928
- Hs as M,
4934
+ Er as D,
4935
+ be as E,
4936
+ Cr as F,
4937
+ ye as G,
4938
+ Fl as H,
4939
+ vt as I,
4940
+ Ul as J,
4941
+ Kl as K,
4942
+ ia as L,
4943
+ Br as M,
4929
4944
  Se as N,
4930
- dc as O,
4931
- fc as P,
4932
- uc as Q,
4933
- ua as R,
4934
- Xl as S,
4935
- Wl as T,
4945
+ Bl as O,
4946
+ $s as P,
4947
+ vn as Q,
4948
+ _r as R,
4949
+ bt as S,
4950
+ zl as T,
4936
4951
  gr as U,
4937
- tc as V,
4938
- ic as W,
4939
- sc as X,
4952
+ Rr as V,
4953
+ ai as W,
4954
+ ze as X,
4940
4955
  Nr as Y,
4941
- ac as Z,
4942
- lc as _,
4956
+ j as Z,
4957
+ bc as _,
4943
4958
  na as a,
4944
- hc as a0,
4945
- gc as a1,
4946
- pc as a2,
4947
- mc as a3,
4948
- bt as a4,
4949
- Al as b,
4950
- ra as c,
4951
- Ul as d,
4952
- Dl as e,
4959
+ ga as a0,
4960
+ rt as a1,
4961
+ Js as a2,
4962
+ ic as a3,
4963
+ nc as a4,
4964
+ rc as a5,
4965
+ jl as a6,
4966
+ Gl as a7,
4967
+ Wl as a8,
4968
+ Yl as a9,
4969
+ tc as aa,
4970
+ ql as ab,
4971
+ ma as ac,
4972
+ Vl as ad,
4973
+ Ql as ae,
4974
+ Xl as af,
4975
+ Jl as ag,
4976
+ Zl as ah,
4977
+ ec as ai,
4978
+ oc as aj,
4979
+ uc as ak,
4980
+ mc as al,
4981
+ ua as am,
4982
+ sc as an,
4983
+ ac as ao,
4984
+ lc as ap,
4985
+ cc as aq,
4986
+ dc as ar,
4987
+ pc as as,
4988
+ fc as b,
4989
+ hc as c,
4990
+ Hl as d,
4991
+ Al as e,
4953
4992
  z as f,
4954
- An as g,
4955
- Kl as h,
4956
- Fl as i,
4957
- ia as j,
4958
- ga as k,
4959
- zl as l,
4960
- ht as m,
4961
- ai as n,
4962
- Js as o,
4993
+ ra as g,
4994
+ An as h,
4995
+ gc as i,
4996
+ De as j,
4997
+ pe as k,
4998
+ Rt as l,
4999
+ Xe as m,
5000
+ hn as n,
5001
+ Sr as o,
4963
5002
  re as p,
4964
- Br as q,
4965
- oc as r,
4966
- Hl as s,
4967
- j as t,
4968
- jl as u,
4969
- ec as v,
4970
- ma as w,
4971
- ql as x,
4972
- Vl as y,
4973
- Jl as z
5003
+ et as q,
5004
+ Dl as r,
5005
+ Pl as s,
5006
+ ta as t,
5007
+ Pe as u,
5008
+ Qr as v,
5009
+ ht as w,
5010
+ wr as x,
5011
+ Hs as y,
5012
+ ve as z
4974
5013
  };
@@ -31,13 +31,13 @@ import "@tanstack/react-table";
31
31
  import "date-fns";
32
32
  import "lexical";
33
33
  import "@lexical/markdown";
34
- import "@lexical/react/LexicalBlockWithAlignableContents";
35
- import "@lexical/react/LexicalDecoratorBlockNode";
36
34
  import "@lexical/code";
37
35
  import "@lexical/list";
38
36
  import "@lexical/rich-text";
39
37
  import "@lexical/selection";
40
38
  import "@lexical/utils";
39
+ import "@lexical/react/LexicalBlockWithAlignableContents";
40
+ import "@lexical/react/LexicalDecoratorBlockNode";
41
41
  import { T as Eo, E as To } from "./EntityPickerDialog.es.js";
42
42
  import { useDebounce as No } from "primereact/hooks";
43
43
  import { c as Po, a as kn, C as Cn, g as _o } from "./ColumnDropIndicator.es.js";
@@ -330,10 +330,10 @@ const X = (e, r) => {
330
330
  `, de = (e) => /* @__PURE__ */ c(me, { children: /* @__PURE__ */ c(N, { onClick: () => {
331
331
  const t = document.createElement("a");
332
332
  t.href = `data:application/octet-stream;base64,${e.value.payload}`, t.download = e.value.filename, document.body.appendChild(t), t.click(), document.body.removeChild(t);
333
- }, children: e.value.filename }) }), S = (e) => {
334
- const r = /* @__PURE__ */ V(B, { children: [
333
+ }, children: e.value.filename }) }), $ = (e, r, t) => {
334
+ const n = /* @__PURE__ */ V(B, { children: [
335
335
  /* @__PURE__ */ c("div", { style: { flex: 1 } }),
336
- e.badges && e.badges.map((t, n) => /* @__PURE__ */ c(ce, { label: t }, n))
336
+ e.badges && e.badges.map((s, o) => /* @__PURE__ */ c(ce, { label: s }, o))
337
337
  ] });
338
338
  return /* @__PURE__ */ c(
339
339
  U,
@@ -342,10 +342,11 @@ const X = (e, r) => {
342
342
  dataKey: "value",
343
343
  labelKey: "label",
344
344
  value: [`${e.value}`],
345
- endContent: r
345
+ selected: t ? [`${e.value}`] : [],
346
+ endContent: n
346
347
  }
347
348
  );
348
- }, $ = (e = []) => e.map((r) => ({ ...r, value: `${r.value}` })), O = (e = [], r) => e.find((t) => `${t.value}` === r)?.value ?? r, ye = ({ field: e, value: r, onChange: t }) => {
349
+ }, S = (e = []) => e.map((r) => ({ ...r, value: `${r.value}` })), O = (e = [], r) => e.find((t) => `${t.value}` === r)?.value ?? r, ye = ({ field: e, value: r, onChange: t }) => {
349
350
  const n = !!(e.disabled || e.readOnly);
350
351
  if (e.type === "text") {
351
352
  const s = typeof r == "string" ? r : "";
@@ -398,12 +399,12 @@ const X = (e, r) => {
398
399
  F,
399
400
  {
400
401
  widthExpand: !0,
401
- options: $(e.options),
402
+ options: S(e.options),
402
403
  value: s ? [s] : [],
403
404
  onSelectionChange: (o) => t(O(e.options, o[0])),
404
405
  className: "form-field",
405
406
  multiSelect: !1,
406
- itemTemplate: S,
407
+ itemTemplate: $,
407
408
  placeholder: e.placeholder,
408
409
  disabled: n
409
410
  }
@@ -415,12 +416,12 @@ const X = (e, r) => {
415
416
  F,
416
417
  {
417
418
  widthExpand: !0,
418
- options: $(e.options),
419
+ options: S(e.options),
419
420
  value: s,
420
421
  onSelectionChange: (o) => t(o.map((m) => O(e.options, m))),
421
422
  className: "form-field",
422
423
  multiSelect: !0,
423
- itemTemplate: S,
424
+ itemTemplate: $,
424
425
  placeholder: e.placeholder,
425
426
  disabled: n
426
427
  }
@@ -22,14 +22,14 @@ import "./PlayableIcon.es.js";
22
22
  import "date-fns";
23
23
  import "lexical";
24
24
  import "@lexical/markdown";
25
- import "@lexical/react/LexicalBlockWithAlignableContents";
26
- import "@lexical/react/LexicalDecoratorBlockNode";
27
25
  import "match-sorter";
28
26
  import "@lexical/code";
29
27
  import "@lexical/list";
30
28
  import "@lexical/rich-text";
31
29
  import "@lexical/selection";
32
30
  import "@lexical/utils";
31
+ import "@lexical/react/LexicalBlockWithAlignableContents";
32
+ import "@lexical/react/LexicalDecoratorBlockNode";
33
33
  import "@tanstack/react-table";
34
34
  import { b as he, H as vt, a as xt, e as It, S as Ct } from "./SimpleTable.es.js";
35
35
  import { g as ge } from "./getEntityTypeIcon.es.js";
@@ -21,14 +21,14 @@ import "react-redux";
21
21
  import { format as at } from "date-fns";
22
22
  import "lexical";
23
23
  import "@lexical/markdown";
24
- import "@lexical/react/LexicalBlockWithAlignableContents";
25
- import "@lexical/react/LexicalDecoratorBlockNode";
26
24
  import "match-sorter";
27
25
  import "@lexical/code";
28
26
  import "@lexical/list";
29
27
  import "@lexical/rich-text";
30
28
  import "@lexical/selection";
31
29
  import "@lexical/utils";
30
+ import "@lexical/react/LexicalBlockWithAlignableContents";
31
+ import "@lexical/react/LexicalDecoratorBlockNode";
32
32
  import "@tanstack/react-table";
33
33
  import { g as nt, h as Y } from "./humanizeFieldName.es.js";
34
34
  import { a as it, A as st } from "./ThumbnailSimple.es.js";
@@ -1,12 +1,18 @@
1
- import { b3 as g } from "./searchTerms.es.js";
2
- import { toast as f } from "react-toastify";
3
- const p = (t) => {
1
+ import { b3 as u } from "./searchTerms.es.js";
2
+ import { toast as l } from "react-toastify";
3
+ const g = "uri";
4
+ let c;
5
+ const h = () => {
6
+ if (c !== void 0) return c;
7
+ const t = new URL(window.location.href);
8
+ return c = t.searchParams.get(g) ?? "", c && (t.searchParams.delete(g), window.history.replaceState(window.history.state, "", t)), c;
9
+ }, f = (t) => {
4
10
  const s = t.split("://")[1].split("?"), e = s[0], r = s[1];
5
11
  return {
6
12
  baseUri: e,
7
13
  queryParams: new URLSearchParams(r || "")
8
14
  };
9
- }, P = ({
15
+ }, v = ({
10
16
  projectName: t,
11
17
  folderPath: s,
12
18
  taskName: e,
@@ -15,34 +21,34 @@ const p = (t) => {
15
21
  }) => {
16
22
  const n = new URL(`ayon+entity://${t}/${s}`);
17
23
  return e && n.searchParams.append("task", e), r && n.searchParams.append("product", r), a && n.searchParams.append("version", a), n.toString();
18
- }, u = (t) => {
19
- const { baseUri: s, queryParams: e } = p(t), r = s.split("/"), a = r[0], n = r.slice(1), [o, c] = a.split(":"), d = e.get("site") ?? void 0, i = e.get("project") ?? void 0;
24
+ }, m = (t) => {
25
+ const { baseUri: s, queryParams: e } = f(t), r = s.split("/"), a = r[0], n = r.slice(1), [o, d] = a.split(":"), p = e.get("site") ?? void 0, i = e.get("project") ?? void 0;
20
26
  return {
21
27
  addonName: o,
22
- addonVersion: c,
28
+ addonVersion: d,
23
29
  settingsPath: n,
24
- site: d,
30
+ site: p,
25
31
  project: i
26
32
  };
27
- }, l = (t) => {
28
- const { baseUri: s, queryParams: e } = p(t), r = s.split("/"), a = r[0], n = r.slice(1).join("/"), o = e.get("task") ?? void 0, c = e.get("product") ?? void 0, d = e.get("version") ?? void 0;
33
+ }, y = (t) => {
34
+ const { baseUri: s, queryParams: e } = f(t), r = s.split("/"), a = r[0], n = r.slice(1).join("/"), o = e.get("task") ?? void 0, d = e.get("product") ?? void 0, p = e.get("version") ?? void 0;
29
35
  let i;
30
- return d ? i = "version" : c ? i = "product" : o ? i = "task" : i = "folder", {
36
+ return p ? i = "version" : d ? i = "product" : o ? i = "task" : i = "folder", {
31
37
  projectName: a,
32
38
  entityType: i,
33
39
  folderPath: n,
34
40
  taskName: o,
35
- productName: c,
36
- versionName: d
41
+ productName: d,
42
+ versionName: p
37
43
  };
38
- }, U = (t) => t ? t.startsWith("ayon+settings://") ? {
44
+ }, M = (t) => t ? t.startsWith("ayon+settings://") ? {
39
45
  type: "settings",
40
- settings: u(t)
46
+ settings: m(t)
41
47
  } : t.startsWith("ayon+entity://") ? {
42
48
  type: "entity",
43
- entity: l(t)
44
- } : { type: void 0 } : { type: void 0 }, v = (t) => t?.attrib?.developerMode ? "developer" : t?.data?.frontendPreferences?.stagingMode ? "staging" : "production", M = (t, s) => {
45
- const [e] = g();
49
+ entity: y(t)
50
+ } : { type: void 0 } : { type: void 0 }, S = (t) => t?.attrib?.developerMode ? "developer" : t?.data?.frontendPreferences?.stagingMode ? "staging" : "production", w = (t, s) => {
51
+ const [e] = u();
46
52
  return [t?.data?.frontendPreferences?.stagingMode ?? !1, async (n) => {
47
53
  try {
48
54
  const o = {
@@ -54,15 +60,17 @@ const p = (t) => {
54
60
  patchData: o
55
61
  }).unwrap(), s && s(o);
56
62
  } catch (o) {
57
- console.error(o), f.error("Failed to update staging mode");
63
+ console.error(o), l.error("Failed to update staging mode");
58
64
  }
59
65
  }];
60
66
  };
61
67
  export {
62
- l as a,
63
- P as b,
64
- u as c,
65
- v as g,
66
- U as p,
67
- M as u
68
+ g as U,
69
+ y as a,
70
+ v as b,
71
+ h as c,
72
+ m as d,
73
+ S as g,
74
+ M as p,
75
+ w as u
68
76
  };