@snabcentr/common-lib 4.0.1 → 4.1.0-dev

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 (58) hide show
  1. package/dist/manifest.json +1 -1
  2. package/dist/sc-common-lib.js +626 -512
  3. package/dist/sc-common-lib.js.map +1 -1
  4. package/dist/sc-common-lib.umd.cjs +1 -1
  5. package/dist/sc-common-lib.umd.cjs.map +1 -1
  6. package/dist/src/clients/classes/client-base-info.d.ts +22 -0
  7. package/dist/src/clients/classes/client-base-info.d.ts.map +1 -0
  8. package/dist/src/clients/classes/index.d.ts +1 -0
  9. package/dist/src/clients/classes/index.d.ts.map +1 -1
  10. package/dist/src/clients/interfaces/i-client-base-info.d.ts +15 -0
  11. package/dist/src/clients/interfaces/i-client-base-info.d.ts.map +1 -0
  12. package/dist/src/clients/interfaces/index.d.ts +1 -0
  13. package/dist/src/clients/interfaces/index.d.ts.map +1 -1
  14. package/dist/src/discounts/classes/discount-client.d.ts +2 -16
  15. package/dist/src/discounts/classes/discount-client.d.ts.map +1 -1
  16. package/dist/src/discounts/interfaces/i-discount-client.d.ts +2 -10
  17. package/dist/src/discounts/interfaces/i-discount-client.d.ts.map +1 -1
  18. package/dist/src/index.d.ts +1 -0
  19. package/dist/src/index.d.ts.map +1 -1
  20. package/dist/src/reclamations/classes/index.d.ts +5 -0
  21. package/dist/src/reclamations/classes/index.d.ts.map +1 -0
  22. package/dist/src/reclamations/classes/reclamation-item.d.ts +39 -0
  23. package/dist/src/reclamations/classes/reclamation-item.d.ts.map +1 -0
  24. package/dist/src/reclamations/classes/reclamation-short-info.d.ts +55 -0
  25. package/dist/src/reclamations/classes/reclamation-short-info.d.ts.map +1 -0
  26. package/dist/src/reclamations/classes/reclamation.d.ts +26 -0
  27. package/dist/src/reclamations/classes/reclamation.d.ts.map +1 -0
  28. package/dist/src/reclamations/classes/reclamations-list-filters.d.ts +55 -0
  29. package/dist/src/reclamations/classes/reclamations-list-filters.d.ts.map +1 -0
  30. package/dist/src/reclamations/enums/index.d.ts +2 -0
  31. package/dist/src/reclamations/enums/index.d.ts.map +1 -0
  32. package/dist/src/reclamations/enums/reclamation-status-enum.d.ts +22 -0
  33. package/dist/src/reclamations/enums/reclamation-status-enum.d.ts.map +1 -0
  34. package/dist/src/reclamations/helpers/index.d.ts +2 -0
  35. package/dist/src/reclamations/helpers/index.d.ts.map +1 -0
  36. package/dist/src/reclamations/helpers/reclamation-status-helper.d.ts +23 -0
  37. package/dist/src/reclamations/helpers/reclamation-status-helper.d.ts.map +1 -0
  38. package/dist/src/reclamations/index.d.ts +6 -0
  39. package/dist/src/reclamations/index.d.ts.map +1 -0
  40. package/dist/src/reclamations/interfaces/i-reclamation-item.d.ts +25 -0
  41. package/dist/src/reclamations/interfaces/i-reclamation-item.d.ts.map +1 -0
  42. package/dist/src/reclamations/interfaces/i-reclamation-message-save-data.d.ts +20 -0
  43. package/dist/src/reclamations/interfaces/i-reclamation-message-save-data.d.ts.map +1 -0
  44. package/dist/src/reclamations/interfaces/i-reclamation-short-info.d.ts +29 -0
  45. package/dist/src/reclamations/interfaces/i-reclamation-short-info.d.ts.map +1 -0
  46. package/dist/src/reclamations/interfaces/i-reclamation.d.ts +12 -0
  47. package/dist/src/reclamations/interfaces/i-reclamation.d.ts.map +1 -0
  48. package/dist/src/reclamations/interfaces/i-reclamations-list-filters.d.ts +44 -0
  49. package/dist/src/reclamations/interfaces/i-reclamations-list-filters.d.ts.map +1 -0
  50. package/dist/src/reclamations/interfaces/i-reclamations-updates.d.ts +10 -0
  51. package/dist/src/reclamations/interfaces/i-reclamations-updates.d.ts.map +1 -0
  52. package/dist/src/reclamations/interfaces/index.d.ts +7 -0
  53. package/dist/src/reclamations/interfaces/index.d.ts.map +1 -0
  54. package/dist/src/reclamations/providers/index.d.ts +2 -0
  55. package/dist/src/reclamations/providers/index.d.ts.map +1 -0
  56. package/dist/src/reclamations/providers/reclamation-provider.d.ts +83 -0
  57. package/dist/src/reclamations/providers/reclamation-provider.d.ts.map +1 -0
  58. package/package.json +1 -1
@@ -1,41 +1,41 @@
1
1
  import { ChannelPrimaryInterest as e, CityWithRegionAndCountry as t, ContactLinks as n, Country as r, CuratedDirection as i, Currency as a, DateHelper as o, DeliveryType as s, FieldValidationResultData as c, GeoCoordinates as ee, HttpRequester as l, Identity as u, Manager as te, ManagerCommon as ne, NamedIdentity as d, Operator as re, Opf as ie, OpfEnum as f, OrderStatus as ae, PartnerGroup as p, PaymentType as oe, PriceCoefficient as se, PropertyType as ce, Reference as le, Region as ue, ResourceType as de, SalesDirection as m, SourcePrimaryInterest as fe, TypedInstanceFactory as h, UpdatableNamedIdentity as pe, UserCommonInfo as me, UserRegionShortInfo as he, Warehouse as ge, useBaseConfigStore as g } from "@snabcentr/common-core";
2
- import { addBusinessDays as _e, addDays as _, addMonths as v, addQuarters as ve, addWeeks as ye, addYears as be, differenceInCalendarDays as xe, differenceInCalendarMonths as Se, endOfDay as y, endOfMonth as b, endOfQuarter as Ce, endOfToday as we, endOfTomorrow as Te, endOfWeek as x, endOfYear as Ee, endOfYesterday as De, format as S, getDate as Oe, getDaysInMonth as ke, parseISO as C, setDate as Ae, startOfDay as w, startOfMonth as T, startOfQuarter as je, startOfToday as Me, startOfTomorrow as Ne, startOfWeek as E, startOfYear as D, startOfYesterday as Pe, subDays as Fe, subMonths as Ie, subQuarters as Le, subWeeks as Re, subYears as ze } from "date-fns";
3
- import { cloneDeep as Be, endsWith as Ve, forEach as He, includes as Ue, isArray as O, isDate as We, isEmpty as Ge, isFunction as Ke, isNil as k, isObject as qe, isPlainObject as Je, isString as A, isUndefined as Ye, map as j, merge as Xe, omitBy as Ze, round as Qe, some as $e, startsWith as et, toUpper as tt } from "lodash-es";
2
+ import { addBusinessDays as _e, addDays as _, addMonths as v, addQuarters as ve, addWeeks as ye, addYears as be, differenceInCalendarDays as xe, differenceInCalendarMonths as Se, endOfDay as y, endOfMonth as b, endOfQuarter as Ce, endOfToday as we, endOfTomorrow as Te, endOfWeek as Ee, endOfYear as De, endOfYesterday as Oe, format as x, getDate as ke, getDaysInMonth as Ae, parseISO as S, setDate as je, startOfDay as C, startOfMonth as w, startOfQuarter as Me, startOfToday as Ne, startOfTomorrow as Pe, startOfWeek as T, startOfYear as E, startOfYesterday as Fe, subDays as Ie, subMonths as Le, subQuarters as Re, subWeeks as ze, subYears as Be } from "date-fns";
3
+ import { cloneDeep as Ve, endsWith as He, forEach as Ue, includes as We, isArray as Ge, isDate as Ke, isEmpty as qe, isFunction as Je, isNil as D, isObject as Ye, isPlainObject as Xe, isString as O, isUndefined as Ze, map as k, merge as Qe, omitBy as $e, round as et, some as tt, startsWith as nt, toUpper as rt } from "lodash-es";
4
4
  export * from "@snabcentr/common-core";
5
5
  //#region src/blog/enums/blog-post-media-type-enum.ts
6
- var nt = /* @__PURE__ */ function(e) {
6
+ var it = /* @__PURE__ */ function(e) {
7
7
  return e.Image = "image", e.Video = "video", e;
8
- }({}), rt = class extends u {
8
+ }({}), at = class extends u {
9
9
  mediaType;
10
10
  isCover;
11
11
  isUnused;
12
12
  url;
13
13
  urlWebp;
14
14
  constructor(e) {
15
- super(e, ""), this.mediaType = e?.mediaType ?? nt.Image, this.isCover = e?.isCover ?? !1, this.isUnused = e?.isUnused ?? !1, this.url = e?.url ?? "", this.urlWebp = e?.urlWebp;
15
+ super(e, ""), this.mediaType = e?.mediaType ?? it.Image, this.isCover = e?.isCover ?? !1, this.isUnused = e?.isUnused ?? !1, this.url = e?.url ?? "", this.urlWebp = e?.urlWebp;
16
16
  }
17
17
  isImage() {
18
- return this.mediaType === nt.Image;
18
+ return this.mediaType === it.Image;
19
19
  }
20
20
  isVideo() {
21
- return this.mediaType === nt.Video;
21
+ return this.mediaType === it.Video;
22
22
  }
23
- }, it = /* @__PURE__ */ function(e) {
23
+ }, ot = /* @__PURE__ */ function(e) {
24
24
  return e.Draft = "draft", e.Published = "published", e.Scheduled = "scheduled", e;
25
- }({}), M = class extends u {
25
+ }({}), A = class extends u {
26
26
  createdAt;
27
27
  constructor(e, t) {
28
28
  super(e, t), this.createdAt = o.parse(e?.createdAt) ?? /* @__PURE__ */ new Date();
29
29
  }
30
- }, at = class e extends M {
30
+ }, st = class e extends A {
31
31
  static resolvePublicationStatus(e) {
32
- return k(e) ? it.Draft : e.getTime() > Date.now() ? it.Scheduled : it.Published;
32
+ return D(e) ? ot.Draft : e.getTime() > Date.now() ? ot.Scheduled : ot.Published;
33
33
  }
34
34
  static getSlugError(e) {
35
- return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." : et(e, "-") || Ve(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : Ue(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
35
+ return e ? /[^a-z0-9-]/.test(e) ? "Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik»." : nt(e, "-") || He(e, "-") ? "Обозначение не может начинаться или заканчиваться дефисом." : We(e, "--") ? "Дефисы не могут идти подряд: разделяйте слова одним дефисом." : "" : "";
36
36
  }
37
37
  static parseDate(e) {
38
- return k(e) ? null : A(e) ? C(e) : e;
38
+ return D(e) ? null : O(e) ? S(e) : e;
39
39
  }
40
40
  slug;
41
41
  title;
@@ -46,11 +46,11 @@ var nt = /* @__PURE__ */ function(e) {
46
46
  getPublicationStatus() {
47
47
  return e.resolvePublicationStatus(this.publishedAt);
48
48
  }
49
- }, ot = class extends at {
49
+ }, ct = class extends st {
50
50
  content;
51
51
  media;
52
52
  constructor(e) {
53
- super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new rt(e));
53
+ super(e), this.content = e?.content ?? "", this.media = (e?.media ?? []).map((e) => new at(e));
54
54
  }
55
55
  toSaveData(e = !1) {
56
56
  return {
@@ -66,21 +66,21 @@ var nt = /* @__PURE__ */ function(e) {
66
66
  getUnusedMedia() {
67
67
  return this.media.filter((e) => e.isUnused);
68
68
  }
69
- }, N = class {
69
+ }, j = class {
70
70
  asClearRaw() {
71
71
  let e = {};
72
72
  return Object.keys(this).forEach((t) => {
73
73
  let n = this[t];
74
- k(n) || A(n) && n.trim().length === 0 || Ke(n.isNewRec) && n.isNewRec() || (e[t] = n);
74
+ D(n) || O(n) && n.trim().length === 0 || Je(n.isNewRec) && n.isNewRec() || (e[t] = n);
75
75
  }), e;
76
76
  }
77
- }, P = class {
77
+ }, M = class {
78
78
  from;
79
79
  to;
80
80
  constructor(e) {
81
- this.from = A(e?.from) ? C(e.from) : e?.from ?? null, this.to = A(e?.to) ? C(e.to) : e?.to ?? null;
81
+ this.from = O(e?.from) ? S(e.from) : e?.from ?? null, this.to = O(e?.to) ? S(e.to) : e?.to ?? null;
82
82
  }
83
- }, st = class extends N {
83
+ }, lt = class extends j {
84
84
  id;
85
85
  title;
86
86
  slug;
@@ -89,7 +89,7 @@ var nt = /* @__PURE__ */ function(e) {
89
89
  publishedAt;
90
90
  createdAt;
91
91
  constructor(e) {
92
- super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new P(e?.publishedAt), this.createdAt = new P(e?.createdAt);
92
+ super(), this.id = e?.id, this.title = e?.title, this.slug = e?.slug, this.content = e?.content, this.publicationStatus = e?.publicationStatus, this.publishedAt = new M(e?.publishedAt), this.createdAt = new M(e?.createdAt);
93
93
  }
94
94
  resetFilterValue(e) {
95
95
  switch (e) {
@@ -111,51 +111,51 @@ var nt = /* @__PURE__ */ function(e) {
111
111
  let e = super.asClearRaw();
112
112
  return !e?.publishedAt?.from && !e?.publishedAt?.to && delete e.publishedAt, !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
113
113
  }
114
- }, ct = /* @__PURE__ */ function(e) {
114
+ }, ut = /* @__PURE__ */ function(e) {
115
115
  return e.BeginWith = "bw", e.Contains = "cn", e.Custom = "custom", e.EndsWith = "ew", e.Equals = "eq", e.GreaterOrEqual = "ge", e.GreaterThan = "gt", e.InList = "in", e.LessOrEqual = "le", e.LessThan = "lt", e.NotBeginWith = "bn", e.NotContains = "nc", e.NotEndsWith = "en", e.NotEqual = "ne", e.NotInList = "ni", e.NotNull = "nn", e.Null = "nu", e;
116
- }({}), lt = class {
116
+ }({}), dt = class {
117
117
  field;
118
118
  op;
119
119
  value;
120
120
  constructor(e) {
121
- this.field = e?.field ?? "", this.op = e?.op ?? ct.Equals, this.value = e?.value ?? "";
121
+ this.field = e?.field ?? "", this.op = e?.op ?? ut.Equals, this.value = e?.value ?? "";
122
122
  }
123
123
  toPrimitive() {
124
124
  let e = g().config.dateFormats.api, t = {
125
125
  field: this.field,
126
126
  op: this.op
127
127
  };
128
- if (We(this.value)) t.value = S(this.value, e);
129
- else if (Je(this.value)) {
128
+ if (Ke(this.value)) t.value = x(this.value, e);
129
+ else if (Xe(this.value)) {
130
130
  let n = this.value;
131
131
  t.value = {
132
- from: n.from ? S(n.from, e) : null,
133
- to: n.to ? S(n.to, e) : null
132
+ from: n.from ? x(n.from, e) : null,
133
+ to: n.to ? x(n.to, e) : null
134
134
  };
135
135
  } else t.value = this.value;
136
136
  return t;
137
137
  }
138
- }, ut = class e {
138
+ }, ft = class e {
139
139
  groupOp;
140
140
  filters;
141
141
  groups;
142
142
  constructor(t) {
143
- this.groupOp = t?.groupOp ?? "and", this.filters = t?.filters?.map((e) => new lt(e)) ?? [], this.groups = t?.groups?.map((t) => new e(t)) ?? [];
143
+ this.groupOp = t?.groupOp ?? "and", this.filters = t?.filters?.map((e) => new dt(e)) ?? [], this.groups = t?.groups?.map((t) => new e(t)) ?? [];
144
144
  }
145
145
  toPrimitive() {
146
146
  return {
147
147
  groupOp: this.groupOp,
148
- filters: this.filters.map((e) => e instanceof lt && Ke(e.toPrimitive) ? e.toPrimitive() : e),
148
+ filters: this.filters.map((e) => e instanceof dt && Je(e.toPrimitive) ? e.toPrimitive() : e),
149
149
  groups: this.groups.map((t) => t instanceof e ? t.toPrimitive() : t)
150
150
  };
151
151
  }
152
- }, F = class extends l {
152
+ }, N = class extends l {
153
153
  getPaginated(e, t, n, r, i, a, o, s) {
154
154
  let c = {
155
155
  page: r?.page ?? 1,
156
156
  perPage: r?.pageSize ?? 10
157
157
  };
158
- return t && (c.filters = JSON.stringify((t instanceof ut ? t : new ut(t)).toPrimitive())), Ge(n) || (c.sort = O(n) ? n : [n]), i && (c = {
158
+ return t && (c.filters = JSON.stringify((t instanceof ft ? t : new ft(t)).toPrimitive())), qe(n) || (c.sort = Ge(n) ? n : [n]), i && (c = {
159
159
  ...c,
160
160
  ...i
161
161
  }), this.get(e, c, a, o, s);
@@ -166,29 +166,29 @@ var nt = /* @__PURE__ */ function(e) {
166
166
  data: h.instanceListInitializer(e, t.data.data)
167
167
  }), o, s);
168
168
  }
169
- }, dt = class e extends F {
169
+ }, pt = class e extends N {
170
170
  static preparePostSaveData(e) {
171
171
  let t = {};
172
- if (Ye(e.title) || (t.title = e.title), Ye(e.slug) || (t.slug = e.slug), Ye(e.content) || (t.content = e.content), !Ye(e.publishedAt)) {
172
+ if (Ze(e.title) || (t.title = e.title), Ze(e.slug) || (t.slug = e.slug), Ze(e.content) || (t.content = e.content), !Ze(e.publishedAt)) {
173
173
  let n = g().config.dateFormats.api;
174
- t.publishedAt = k(e.publishedAt) ? null : S(e.publishedAt, n);
174
+ t.publishedAt = D(e.publishedAt) ? null : x(e.publishedAt, n);
175
175
  }
176
176
  return t;
177
177
  }
178
178
  getPostList(e, t, n) {
179
179
  return this.getPaginated("/internal/blog", e, t, n, {}, (e) => ({
180
180
  ...e.data,
181
- data: e.data.data.map((e) => new at(e))
181
+ data: e.data.data.map((e) => new st(e))
182
182
  }));
183
183
  }
184
184
  getPost(e) {
185
- return this.get(`/internal/blog/${e}`, {}, (e) => new ot(e.data));
185
+ return this.get(`/internal/blog/${e}`, {}, (e) => new ct(e.data));
186
186
  }
187
187
  createPost(t, n = {}) {
188
- return this.post("/internal/blog", e.preparePostSaveData(t), (e) => new ot(e.data), n);
188
+ return this.post("/internal/blog", e.preparePostSaveData(t), (e) => new ct(e.data), n);
189
189
  }
190
190
  updatePost(t, n, r = {}) {
191
- return this.patch(`/internal/blog/${t}`, e.preparePostSaveData(n), (e) => new ot(e.data), r);
191
+ return this.patch(`/internal/blog/${t}`, e.preparePostSaveData(n), (e) => new ct(e.data), r);
192
192
  }
193
193
  removePost(e) {
194
194
  return this.delete(`/internal/blog/${e}`);
@@ -204,26 +204,26 @@ var nt = /* @__PURE__ */ function(e) {
204
204
  onUploadProgress: (e) => {
205
205
  r && r(e.total ? Math.round(e.loaded / e.total * 100) : 0);
206
206
  }
207
- }, (e) => new rt(e.data), i);
207
+ }, (e) => new at(e.data), i);
208
208
  }
209
209
  updateMedia(e, t, n, r = {}) {
210
- return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new rt(e.data), r);
210
+ return this.patch(`/internal/blog/${e}/media/${t}`, { isCover: n }, (e) => new at(e.data), r);
211
211
  }
212
212
  removeMedia(e, t) {
213
213
  return this.delete(`/internal/blog/${e}/media/${t}`);
214
214
  }
215
- }, ft = class extends pe {
215
+ }, mt = class extends pe {
216
216
  deletedAt;
217
217
  constructor(e) {
218
218
  super(e), this.deletedAt = o.parse(e?.deletedAt);
219
219
  }
220
- }, I = class extends d {
220
+ }, P = class extends d {
221
221
  type;
222
222
  isActive;
223
223
  constructor(e) {
224
224
  super(e), this.type = e?.type, this.isActive = e?.isActive ?? !0;
225
225
  }
226
- }, pt = class extends ft {
226
+ }, ht = class extends mt {
227
227
  costCoefficient;
228
228
  isLowPriceAllowed;
229
229
  publishedAt;
@@ -231,15 +231,15 @@ var nt = /* @__PURE__ */ function(e) {
231
231
  percent;
232
232
  owner;
233
233
  constructor(e) {
234
- super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.isLowPriceAllowed = e?.isLowPriceAllowed ?? !1, this.publishedAt = o.parse(e?.publishedAt), this.description = e?.description ?? void 0, this.percent = e?.percent ?? 0, this.owner = new I(e?.owner);
234
+ super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.isLowPriceAllowed = e?.isLowPriceAllowed ?? !1, this.publishedAt = o.parse(e?.publishedAt), this.description = e?.description ?? void 0, this.percent = e?.percent ?? 0, this.owner = new P(e?.owner);
235
235
  }
236
- }, L = class extends pe {
236
+ }, F = class extends pe {
237
237
  description;
238
238
  owner;
239
239
  constructor(e) {
240
- super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new I(e.owner) : void 0;
240
+ super(e), this.description = e?.description ?? "", this.owner = e?.owner ? new P(e.owner) : void 0;
241
241
  }
242
- }, mt = class {
242
+ }, gt = class {
243
243
  coefficient;
244
244
  value;
245
245
  cost;
@@ -248,13 +248,13 @@ var nt = /* @__PURE__ */ function(e) {
248
248
  constructor(e) {
249
249
  this.coefficient = new se(e?.coefficient), this.value = e?.value ?? 0, this.cost = e?.cost ?? 0, this.percent = e?.percent ?? 0, this.readOnly = e?.readOnly ?? !0;
250
250
  }
251
- }, ht = class {
251
+ }, _t = class {
252
252
  warehouse;
253
253
  count;
254
254
  constructor(e) {
255
255
  this.warehouse = new ge(e?.warehouse), this.count = e?.count ?? 0;
256
256
  }
257
- }, gt = class extends d {
257
+ }, vt = class extends d {
258
258
  slug = "";
259
259
  description;
260
260
  isSquare = !1;
@@ -262,35 +262,35 @@ var nt = /* @__PURE__ */ function(e) {
262
262
  constructor(e) {
263
263
  super(e), e && (this.slug = e.slug ?? "", this.description = e.description, this.isSquare = e.isSquare ?? !1, this.isLinear = e.isLinear ?? !1);
264
264
  }
265
- }, R = class extends d {
265
+ }, I = class extends d {
266
266
  code = "";
267
267
  constructor(e) {
268
268
  super(e), this.code = e?.code ?? "";
269
269
  }
270
- }, _t = class extends R {
270
+ }, yt = class extends I {
271
271
  slug;
272
272
  type;
273
273
  constructor(e) {
274
274
  super(e), this.slug = e?.slug ?? "";
275
275
  }
276
- }, vt = class extends _t {
276
+ }, bt = class extends yt {
277
277
  isHidden;
278
278
  constructor(e) {
279
279
  super(e), this.isHidden = e?.isHidden ?? !1;
280
280
  }
281
- }, yt = class {
281
+ }, xt = class {
282
282
  image;
283
283
  preview;
284
284
  isDefault;
285
285
  constructor(e, t) {
286
286
  this.image = `${t ?? ""}${e.image}`, this.preview = `${t ?? ""}${e.preview}`, this.isDefault = e.isDefault;
287
287
  }
288
- }, bt = class extends _t {
288
+ }, St = class extends yt {
289
289
  isPrimary;
290
290
  constructor(e) {
291
291
  super(e), this.isPrimary = e?.isPrimary ?? !1;
292
292
  }
293
- }, z = class extends vt {
293
+ }, L = class extends bt {
294
294
  supplierSku;
295
295
  unit;
296
296
  pack;
@@ -309,12 +309,12 @@ var nt = /* @__PURE__ */ function(e) {
309
309
  retailCostRub;
310
310
  priceCoefficients;
311
311
  constructor(e) {
312
- super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new gt(e.unit) : new gt(), this.pack = e?.pack, this.minCount = e?.minCount, this.currency = e?.currency ? new a(e.currency) : new a(), this.cost = e?.cost ?? 0, this.costRub = e?.costRub ?? 0, this.costDate = A(e?.costDate) ? C(e.costDate) : e?.costDate, this.onOrder = e?.onOrder ?? !1, this.stockCount = e?.stockCount?.map((e) => new ht(e)) ?? [], this.type = "product";
312
+ super(e), this.supplierSku = e?.supplierSku, this.unit = e?.unit ? new vt(e.unit) : new vt(), this.pack = e?.pack, this.minCount = e?.minCount, this.currency = e?.currency ? new a(e.currency) : new a(), this.cost = e?.cost ?? 0, this.costRub = e?.costRub ?? 0, this.costDate = O(e?.costDate) ? S(e.costDate) : e?.costDate, this.onOrder = e?.onOrder ?? !1, this.stockCount = e?.stockCount?.map((e) => new _t(e)) ?? [], this.type = "product";
313
313
  let t = e?.category ?? e?.categories?.find((e) => e.isPrimary);
314
- t && (this.category = new bt({
314
+ t && (this.category = new St({
315
315
  ...t,
316
316
  isPrimary: !0
317
- }), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new bt(e))), this.images = e?.images?.map((e) => new yt(e, g().config.http.mediaUrl)) ?? [], this.properties = e?.properties ?? {}, this.retailCost = e?.retailCost, this.retailCostRub = e?.retailCostRub, this.priceCoefficients = e?.priceCoefficients?.map((e) => new mt(e)) ?? [], e && "codeNumber" in e && !e.code && (this.code = e?.codeNumber);
317
+ }), this.categories = [this.category]), e?.categories && (this.categories = e.categories.map((e) => new St(e))), this.images = e?.images?.map((e) => new xt(e, g().config.http.mediaUrl)) ?? [], this.properties = e?.properties ?? {}, this.retailCost = e?.retailCost, this.retailCostRub = e?.retailCostRub, this.priceCoefficients = e?.priceCoefficients?.map((e) => new gt(e)) ?? [], e && "codeNumber" in e && !e.code && (this.code = e?.codeNumber);
318
318
  }
319
319
  getIsMeasurable() {
320
320
  return this.unit.isLinear || this.unit.isSquare;
@@ -325,9 +325,9 @@ var nt = /* @__PURE__ */ function(e) {
325
325
  getRetailCostRub() {
326
326
  return this.retailCostRub ?? this.costRub;
327
327
  }
328
- }, xt = /* @__PURE__ */ function(e) {
328
+ }, Ct = /* @__PURE__ */ function(e) {
329
329
  return e.Discount = "discount", e.PriceTemplate = "price_template", e.ClientPrice = "client_price", e.Product = "product", e;
330
- }({}), B = class extends z {
330
+ }({}), R = class extends L {
331
331
  costCoefficient;
332
332
  costSource;
333
333
  discount;
@@ -338,17 +338,17 @@ var nt = /* @__PURE__ */ function(e) {
338
338
  isRequired;
339
339
  isFavorite;
340
340
  constructor(e) {
341
- super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ?? xt.Product, this.discount = e?.discount ? new pt(e.discount) : void 0, this.priceTemplate = e?.priceTemplate ? new L(e.priceTemplate) : void 0, this.priceCoefficient = e?.priceCoefficient ? new se(e.priceCoefficient) : void 0, this.increasePercent = e?.increasePercent, this.isPreviouslyOrdered = e?.isPreviouslyOrdered, this.isRequired = e?.isRequired, this.isFavorite = e?.isFavorite;
341
+ super(e), this.costCoefficient = e?.costCoefficient ?? 0, this.costSource = e?.costSource ?? Ct.Product, this.discount = e?.discount ? new ht(e.discount) : void 0, this.priceTemplate = e?.priceTemplate ? new F(e.priceTemplate) : void 0, this.priceCoefficient = e?.priceCoefficient ? new se(e.priceCoefficient) : void 0, this.increasePercent = e?.increasePercent, this.isPreviouslyOrdered = e?.isPreviouslyOrdered, this.isRequired = e?.isRequired, this.isFavorite = e?.isFavorite;
342
342
  }
343
- }, V = class extends bt {
343
+ }, z = class extends St {
344
344
  isHidden;
345
345
  parentCategoryId;
346
346
  properties;
347
347
  currencyRates;
348
348
  constructor(e) {
349
- super(e), this.isHidden = e?.isHidden ?? !1, this.parentCategoryId = e?.parentCategoryId, this.properties = e?.properties, this.type = "category", this.currencyRates = e?.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([e, t]) => [tt(e), t])) : void 0;
349
+ super(e), this.isHidden = e?.isHidden ?? !1, this.parentCategoryId = e?.parentCategoryId, this.properties = e?.properties, this.type = "category", this.currencyRates = e?.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([e, t]) => [rt(e), t])) : void 0;
350
350
  }
351
- }, St = class extends u {
351
+ }, wt = class extends u {
352
352
  category;
353
353
  product;
354
354
  quantity;
@@ -367,9 +367,9 @@ var nt = /* @__PURE__ */ function(e) {
367
367
  originalId;
368
368
  replacementId;
369
369
  constructor(e) {
370
- super(e), this.product = new B(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new V(), this.currency = e.currency ? new a(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && Be(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new I(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
370
+ super(e), this.product = new R(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new z(), this.currency = e.currency ? new a(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && Ve(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new P(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
371
371
  }
372
- }, Ct = class extends St {
372
+ }, Tt = class extends wt {
373
373
  cost;
374
374
  costOne;
375
375
  costOneRub;
@@ -380,18 +380,18 @@ var nt = /* @__PURE__ */ function(e) {
380
380
  sawing;
381
381
  currency;
382
382
  constructor(e) {
383
- super(e), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = O(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new a(e.currency);
383
+ super(e), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = Ge(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, this.currency = new a(e.currency);
384
384
  }
385
- }, H = class {
385
+ }, B = class {
386
386
  items;
387
387
  resultSum;
388
388
  directionsSum;
389
389
  constructor(e) {
390
- this.items = e.items.map((e) => new Ct(e)), this.resultSum = e.resultSum, this.directionsSum = e.directionsSum;
390
+ this.items = e.items.map((e) => new Tt(e)), this.resultSum = e.resultSum, this.directionsSum = e.directionsSum;
391
391
  }
392
- }, wt = class extends l {
392
+ }, Et = class extends l {
393
393
  getCart(e) {
394
- return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new H(e.data));
394
+ return this.get(`internal/clients/${e.id}/cart`, {}, (e) => new B(e.data));
395
395
  }
396
396
  deleteCart(e) {
397
397
  return this.delete(`internal/clients/${e.id}/cart`);
@@ -408,7 +408,7 @@ var nt = /* @__PURE__ */ function(e) {
408
408
  marker: t.marker,
409
409
  is_additional_sale: t.isAdditionalSale,
410
410
  ...t.configuratorParams
411
- }, (e) => new H(e.data), n);
411
+ }, (e) => new B(e.data), n);
412
412
  }
413
413
  patchCartItem(e, t, n = {}) {
414
414
  return this.patch(`internal/clients/${e.id}/cart/${t.id}`, {
@@ -422,28 +422,28 @@ var nt = /* @__PURE__ */ function(e) {
422
422
  marker: t.marker,
423
423
  is_additional_sale: t.isAdditionalSale,
424
424
  ...t.configuratorParams
425
- }, (e) => new H(e.data), n);
425
+ }, (e) => new B(e.data), n);
426
426
  }
427
427
  deleteCartItem(e, t) {
428
- return this.delete(`internal/clients/${e.id}/cart/${t.id}`, (e) => new H(e.data));
428
+ return this.delete(`internal/clients/${e.id}/cart/${t.id}`, (e) => new B(e.data));
429
429
  }
430
430
  addCartItemFromCSV(e, t) {
431
- return this.post(`internal/clients/${e.id}/cart/add-products-from-csv`, t, (e) => new H(e.data));
431
+ return this.post(`internal/clients/${e.id}/cart/add-products-from-csv`, t, (e) => new B(e.data));
432
432
  }
433
433
  getCartItemFromCSVExample(e) {
434
434
  return this.get(`internal/clients/${e.id}/cart/add-products-from-csv/example`, {}, (e) => new Blob([e.data], { type: "text/csv" }));
435
435
  }
436
- }, Tt = /* @__PURE__ */ function(e) {
436
+ }, Dt = /* @__PURE__ */ function(e) {
437
437
  return e.m2Cost = "m2Cost", e.percent = "percent", e.value = "value", e;
438
- }({}), Et = /* @__PURE__ */ function(e) {
438
+ }({}), Ot = /* @__PURE__ */ function(e) {
439
439
  return e.Checkbox = "checkbox", e.Range = "range", e.Toggle = "toggle", e;
440
- }({}), U = class e extends V {
440
+ }({}), V = class e extends z {
441
441
  categories;
442
442
  products;
443
443
  constructor(t) {
444
- super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new z(e));
444
+ super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new L(e));
445
445
  }
446
- }, Dt = class extends V {
446
+ }, kt = class extends z {
447
447
  isDisabled;
448
448
  isRequired;
449
449
  isFavorite;
@@ -452,35 +452,35 @@ var nt = /* @__PURE__ */ function(e) {
452
452
  constructor(e) {
453
453
  super(e), this.isDisabled = e?.isDisabled ?? !1, this.isRequired = e?.isRequired ?? !1, this.isFavorite = e?.isFavorite ?? !1, this.hidingComment = e?.hidingComment, this.manager = e?.manager ? new te(e.manager) : void 0;
454
454
  }
455
- }, Ot = class e extends Dt {
455
+ }, At = class e extends kt {
456
456
  categories;
457
457
  products;
458
458
  constructor(t) {
459
- super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new B(e));
459
+ super(t), this.categories = t?.categories?.map((t) => new e(t)), this.products = t?.products?.map((e) => new R(e));
460
460
  }
461
- }, kt = class {
461
+ }, jt = class {
462
462
  priceCoefficient;
463
463
  increasePercent;
464
464
  constructor(e) {
465
465
  this.priceCoefficient = e?.priceCoefficient && new se(e.priceCoefficient), this.increasePercent = e?.increasePercent;
466
466
  }
467
- }, At = class extends kt {
467
+ }, Mt = class extends jt {
468
468
  constructor(e) {
469
469
  super(e);
470
470
  }
471
- }, jt = class extends At {
471
+ }, Nt = class extends Mt {
472
472
  productCategory;
473
473
  constructor(e) {
474
- super(e), this.productCategory = new V(e?.productCategory);
474
+ super(e), this.productCategory = new z(e?.productCategory);
475
475
  }
476
- }, Mt = class extends d {
476
+ }, Pt = class extends d {
477
477
  photo;
478
478
  contacts;
479
479
  curatedDirection;
480
480
  constructor(e) {
481
481
  super(e), this.photo = e.photo, this.contacts = new n(e.contacts), this.curatedDirection = new i(e.curatedDirection);
482
482
  }
483
- }, W = class extends me {
483
+ }, H = class extends me {
484
484
  salesDirection;
485
485
  debt;
486
486
  alternativeName;
@@ -491,25 +491,25 @@ var nt = /* @__PURE__ */ function(e) {
491
491
  managers;
492
492
  curators;
493
493
  constructor(e) {
494
- super(e), this.salesDirection = new m(e?.salesDirection), this.debt = e?.debt ?? 0, this.alternativeName = e?.alternativeName ?? "", this.city = new t(e?.city), this.comment = e?.comment, this.isPhoneApproved = e?.isPhoneApproved ?? !1, this.isEmailApproved = e?.isEmailApproved ?? !1, this.managers = e?.managers?.map((e) => new ne(e)) ?? [], this.curators = e?.curators?.map((e) => new Mt(e)) ?? void 0;
494
+ super(e), this.salesDirection = new m(e?.salesDirection), this.debt = e?.debt ?? 0, this.alternativeName = e?.alternativeName ?? "", this.city = new t(e?.city), this.comment = e?.comment, this.isPhoneApproved = e?.isPhoneApproved ?? !1, this.isEmailApproved = e?.isEmailApproved ?? !1, this.managers = e?.managers?.map((e) => new ne(e)) ?? [], this.curators = e?.curators?.map((e) => new Pt(e)) ?? void 0;
495
495
  }
496
- }, Nt = class extends M {
496
+ }, Ft = class extends A {
497
497
  deletedAt;
498
498
  constructor(e, t) {
499
499
  super(e, t), this.deletedAt = o.parse(e?.deletedAt);
500
500
  }
501
- }, G = class extends Nt {
501
+ }, U = class extends Ft {
502
502
  client;
503
503
  priceTemplate;
504
504
  constructor(e) {
505
- super(e), this.client = new W(e?.client), this.priceTemplate = new L(e?.priceTemplate);
505
+ super(e), this.client = new H(e?.client), this.priceTemplate = new F(e?.priceTemplate);
506
506
  }
507
- }, Pt = class extends At {
507
+ }, It = class extends Mt {
508
508
  product;
509
509
  constructor(e) {
510
- super(e), this.product = new z(e?.product);
510
+ super(e), this.product = new L(e?.product);
511
511
  }
512
- }, K = class extends d {
512
+ }, W = class extends d {
513
513
  type;
514
514
  description;
515
515
  metadata;
@@ -517,21 +517,21 @@ var nt = /* @__PURE__ */ function(e) {
517
517
  constructor(e) {
518
518
  super(e), this.type = new ce(e?.type), this.description = e?.description ?? "", this.metadata = e?.metadata, this.isFilterable = e?.isFilterable;
519
519
  }
520
- }, q = class {
520
+ }, G = class {
521
521
  property;
522
522
  value;
523
523
  constructor(e) {
524
- this.property = new K(e?.property), this.value = e?.value ?? "";
524
+ this.property = new W(e?.property), this.value = e?.value ?? "";
525
525
  }
526
- }, Ft = class {
526
+ }, Lt = class {
527
527
  id;
528
528
  name;
529
529
  description;
530
530
  ownerName;
531
- createdAt = new P();
532
- updatedAt = new P();
531
+ createdAt = new M();
532
+ updatedAt = new M();
533
533
  constructor(e) {
534
- this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new P(e?.createdAt), this.updatedAt = new P(e?.updatedAt);
534
+ this.id = e?.id, this.name = e?.name, this.description = e?.description, this.ownerName = e?.ownerName, this.createdAt = new M(e?.createdAt), this.updatedAt = new M(e?.updatedAt);
535
535
  }
536
536
  resetFilterValue(e) {
537
537
  switch (e) {
@@ -552,26 +552,26 @@ var nt = /* @__PURE__ */ function(e) {
552
552
  let e = {};
553
553
  return Object.keys(this).forEach((t) => {
554
554
  let n = this[t];
555
- k(n) || A(n) && n.trim().length === 0 || Ke(n.isNewRec) && n.isNewRec() || (e[t] = n);
555
+ D(n) || O(n) && n.trim().length === 0 || Je(n.isNewRec) && n.isNewRec() || (e[t] = n);
556
556
  }), !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.updatedAt?.from && !e?.updatedAt?.to && delete e.updatedAt, e;
557
557
  }
558
- }, It = class extends kt {
558
+ }, Rt = class extends jt {
559
559
  executor;
560
560
  createdAt;
561
561
  constructor(e) {
562
- super(e), this.executor = e?.executor ? new I(e.executor) : void 0, this.createdAt = o.parse(e?.createdAt);
562
+ super(e), this.executor = e?.executor ? new P(e.executor) : void 0, this.createdAt = o.parse(e?.createdAt);
563
563
  }
564
- }, Lt = class extends It {
564
+ }, zt = class extends Rt {
565
565
  product;
566
566
  constructor(e) {
567
- super(e), this.product = new z(e?.product);
567
+ super(e), this.product = new L(e?.product);
568
568
  }
569
- }, Rt = class extends It {
569
+ }, Bt = class extends Rt {
570
570
  productCategory;
571
571
  constructor(e) {
572
- super(e), this.productCategory = new V(e?.productCategory);
572
+ super(e), this.productCategory = new z(e?.productCategory);
573
573
  }
574
- }, J = class extends d {
574
+ }, K = class extends d {
575
575
  description;
576
576
  canChangeLowCost;
577
577
  parentRoleId;
@@ -581,14 +581,14 @@ var nt = /* @__PURE__ */ function(e) {
581
581
  constructor(e) {
582
582
  super(e), this.description = e?.description, this.canChangeLowCost = e?.canChangeLowCost ?? !1, this.parentRoleId = e?.parentRoleId;
583
583
  }
584
- }, zt = class {
584
+ }, Vt = class {
585
585
  role;
586
586
  category;
587
587
  minCoefficient;
588
588
  constructor(e) {
589
- this.role = new J(e?.role), this.category = new V(e?.category), this.minCoefficient = new se(e?.minCoefficient);
589
+ this.role = new K(e?.role), this.category = new z(e?.category), this.minCoefficient = new se(e?.minCoefficient);
590
590
  }
591
- }, Bt = class {
591
+ }, Ht = class {
592
592
  isFake;
593
593
  isHidden;
594
594
  isMultiple;
@@ -597,20 +597,20 @@ var nt = /* @__PURE__ */ function(e) {
597
597
  constructor(e) {
598
598
  this.isFake = e?.isFake ?? !1, this.isHidden = e?.isHidden ?? !1, this.isMultiple = e?.isMultiple ?? null, this.type = e?.type ?? null, this.ord = e?.ord ?? 0;
599
599
  }
600
- }, Vt = class {
600
+ }, Ut = class {
601
601
  category;
602
602
  property;
603
603
  settings;
604
604
  constructor(e) {
605
- this.category = new V(e?.category), this.property = new K(e?.property), this.settings = new Bt(e?.settings);
605
+ this.category = new z(e?.category), this.property = new W(e?.property), this.settings = new Ht(e?.settings);
606
606
  }
607
- }, Ht = class {
607
+ }, Wt = class {
608
608
  id;
609
609
  label;
610
610
  constructor(e) {
611
611
  this.id = e?.id ?? "", this.label = e?.label ?? "";
612
612
  }
613
- }, Ut = class {
613
+ }, Gt = class {
614
614
  id;
615
615
  label;
616
616
  type;
@@ -620,9 +620,9 @@ var nt = /* @__PURE__ */ function(e) {
620
620
  min;
621
621
  max;
622
622
  constructor(e) {
623
- this.id = e?.id ?? "", this.label = e?.label ?? "", this.type = e?.type ?? Et.Checkbox, this.ord = e?.ord ?? 0, this.isMultiple = e?.isMultiple ?? null, this.values = e?.values?.map((e) => new Ht(e)) ?? [], this.min = e?.min ?? null, this.max = e?.max ?? null;
623
+ this.id = e?.id ?? "", this.label = e?.label ?? "", this.type = e?.type ?? Ot.Checkbox, this.ord = e?.ord ?? 0, this.isMultiple = e?.isMultiple ?? null, this.values = e?.values?.map((e) => new Wt(e)) ?? [], this.min = e?.min ?? null, this.max = e?.max ?? null;
624
624
  }
625
- }, Wt = class extends l {
625
+ }, Kt = class extends l {
626
626
  search(e, t = !1) {
627
627
  return this.get("/internal/catalog/search", {
628
628
  term: e,
@@ -633,15 +633,15 @@ var nt = /* @__PURE__ */ function(e) {
633
633
  let i = `${g().config.http.portalApiUrl}/api/internal/price/export?format=${e}&show_hidden=${t}`;
634
634
  return n && (i += `&category_id=${n}`), r && (i += `&client_id=${r}`), i;
635
635
  }
636
- }, Gt = class extends l {
636
+ }, qt = class extends l {
637
637
  importPrices(e, t, n = !1) {
638
638
  return this.post(`/internal/clients/${e}/price/import`, t, void 0, {}, n);
639
639
  }
640
640
  getCategoryPrices(e) {
641
- return this.getTypedList(Rt, `/internal/clients/${e}/price/categories`);
641
+ return this.getTypedList(Bt, `/internal/clients/${e}/price/categories`);
642
642
  }
643
643
  getCategoryPrice(e, t) {
644
- return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new Rt(e.data));
644
+ return this.get(`/internal/clients/${e}/price/categories/${t}`, {}, (e) => new Bt(e.data));
645
645
  }
646
646
  updateCategoryPrices(e, t, n, r = !1) {
647
647
  return this.request({
@@ -687,16 +687,16 @@ var nt = /* @__PURE__ */ function(e) {
687
687
  return this.delete(`/internal/clients/${e}/price/categories/${t}/manager`);
688
688
  }
689
689
  getProductPrices(e) {
690
- return this.getTypedList(Lt, `/internal/clients/${e}/price/products`);
690
+ return this.getTypedList(zt, `/internal/clients/${e}/price/products`);
691
691
  }
692
692
  getProductPrice(e, t) {
693
- return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new Lt(e.data));
693
+ return this.get(`/internal/clients/${e}/price/products/${t}`, {}, (e) => new zt(e.data));
694
694
  }
695
695
  updateProductPrice(e, t, n) {
696
696
  return this.patch(`/internal/clients/${e}/price/products/${t}`, {
697
697
  price_coefficient_id: n.coefficient?.id,
698
698
  increase_percent: n.value
699
- }, (e) => new Lt(e.data));
699
+ }, (e) => new zt(e.data));
700
700
  }
701
701
  removeProductPrice(e, t) {
702
702
  return this.delete(`/internal/clients/${e}/price/products/${t}`);
@@ -716,19 +716,19 @@ var nt = /* @__PURE__ */ function(e) {
716
716
  sendCommercialOffer(e, t) {
717
717
  return this.post(`/internal/clients/${e}/price/commercial-offer/send`, t);
718
718
  }
719
- }, Kt = class extends l {
719
+ }, Jt = class extends l {
720
720
  getTemplateList(e) {
721
- return this.getTypedList(G, `/internal/clients/${e}/price/templates`);
721
+ return this.getTypedList(U, `/internal/clients/${e}/price/templates`);
722
722
  }
723
723
  getActiveTemplate(e) {
724
- return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new G(e.data), !0);
724
+ return this.get(`/internal/clients/${e}/price/templates/active`, {}, (e) => new U(e.data), !0);
725
725
  }
726
726
  attachTemplate(e, t, n) {
727
727
  let r = g().config.dateFormats.api;
728
728
  return this.post(`/internal/clients/${e}/price/templates/${t}`, n && {
729
- startAt: n.startAt && S(n.startAt, r),
730
- endAt: n.endAt && S(n.endAt, r)
731
- }, (e) => new G(e.data), {}, !0);
729
+ startAt: n.startAt && x(n.startAt, r),
730
+ endAt: n.endAt && x(n.endAt, r)
731
+ }, (e) => new U(e.data), {}, !0);
732
732
  }
733
733
  applyTemplate(e, t) {
734
734
  return this.post(`/internal/clients/${e}/price/templates/${t}/apply`, {}, void 0, {}, !0);
@@ -736,76 +736,76 @@ var nt = /* @__PURE__ */ function(e) {
736
736
  changeTemplate(e, t, n, r) {
737
737
  let i = g().config.dateFormats.api;
738
738
  return this.patch(`/internal/clients/${e}/price/templates/${t}/${n}`, r && {
739
- startAt: r.startAt && S(r.startAt, i),
740
- endAt: r.endAt && S(r.endAt, i)
741
- }, (e) => new G(e.data));
739
+ startAt: r.startAt && x(r.startAt, i),
740
+ endAt: r.endAt && x(r.endAt, i)
741
+ }, (e) => new U(e.data));
742
742
  }
743
743
  detachTemplate(e, t, n) {
744
744
  return this.delete(`/internal/clients/${e}/price/templates/${t}/${n}`);
745
745
  }
746
- }, qt = class extends l {
746
+ }, Yt = class extends l {
747
747
  getRootCategoriesList(e = !1) {
748
- return this.getTypedList(U, "/internal/catalog/categories", { showHidden: e });
748
+ return this.getTypedList(V, "/internal/catalog/categories", { showHidden: e });
749
749
  }
750
750
  getCategoryData(e, t = !1, n = !1) {
751
751
  return this.get(`/internal/catalog/categories/${e}`, {
752
752
  showHidden: t,
753
753
  withNestedCategories: n
754
- }, (e) => new U(e.data));
754
+ }, (e) => new V(e.data));
755
755
  }
756
756
  getPublicCategoryData(e) {
757
- return this.get(`/public/catalog/categories/${e}`, {}, (e) => new U(e.data));
757
+ return this.get(`/public/catalog/categories/${e}`, {}, (e) => new V(e.data));
758
758
  }
759
759
  getCategoryProductsList(e, t = !0, n = !1) {
760
760
  return this.get(`/internal/catalog/categories/${e}/products`, {
761
761
  showHidden: n,
762
762
  withPriceCoefficients: t
763
- }, (e) => j(e.data, (e) => new z(e)));
763
+ }, (e) => k(e.data, (e) => new L(e)));
764
764
  }
765
765
  getCategoryProductsCoefficients(e) {
766
766
  return this.get(`/internal/catalog/categories/${e}/products/coefficients`, {}, (e) => {
767
767
  let { data: t } = e;
768
- return He(t, (e) => e.map((e) => new mt(e))), t;
768
+ return Ue(t, (e) => e.map((e) => new gt(e))), t;
769
769
  });
770
770
  }
771
771
  publicSimpleSearch(e, t = 10) {
772
772
  return new Promise((n, r) => {
773
773
  this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then((e) => {
774
- n(e.categories.map((e) => new U(e)));
774
+ n(e.categories.map((e) => new V(e)));
775
775
  }).catch((e) => {
776
776
  r(e);
777
777
  });
778
778
  });
779
779
  }
780
- }, Jt = class extends F {
780
+ }, Xt = class extends N {
781
781
  getProductData(e, t = !1) {
782
- return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new z(e.data));
782
+ return this.get(`/internal/catalog/products/${e}`, { withPriceCoefficients: t }, (e) => new L(e.data));
783
783
  }
784
784
  getPublicProductData(e) {
785
- return this.get(`/public/catalog/products/${e}`, {}, (e) => new z(e.data));
785
+ return this.get(`/public/catalog/products/${e}`, {}, (e) => new L(e.data));
786
786
  }
787
787
  getProductPriceCoefficients(e) {
788
- return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => j(e.data, (e) => new mt(e)));
788
+ return this.get(`/internal/catalog/products/${e}/coefficients`, {}, (e) => k(e.data, (e) => new gt(e)));
789
789
  }
790
790
  getNewProducts(e, t, n = !0) {
791
791
  let r = g().config.dateFormats.api;
792
- return this.getTypedPaginated(z, "/internal/catalog/products/new", void 0, void 0, t, {
793
- period: { from: S(e, r) },
792
+ return this.getTypedPaginated(L, "/internal/catalog/products/new", void 0, void 0, t, {
793
+ period: { from: x(e, r) },
794
794
  withPriceCoefficients: n
795
795
  });
796
796
  }
797
797
  publicSimpleSearch(e, t = 10) {
798
798
  return new Promise((n, r) => {
799
799
  this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then((e) => {
800
- n(e.products.map((e) => new z(e)));
800
+ n(e.products.map((e) => new L(e)));
801
801
  }).catch((e) => {
802
802
  r(e);
803
803
  });
804
804
  });
805
805
  }
806
- }, Yt = class extends l {
806
+ }, Zt = class extends l {
807
807
  getRootCategoriesList(e, t = !1) {
808
- return this.getTypedList(Ot, "/internal/catalog/categories", {
808
+ return this.getTypedList(At, "/internal/catalog/categories", {
809
809
  clientId: e,
810
810
  showHidden: t
811
811
  });
@@ -815,66 +815,66 @@ var nt = /* @__PURE__ */ function(e) {
815
815
  clientId: e,
816
816
  showHidden: n,
817
817
  withNestedCategories: r
818
- }, (e) => new Ot(e.data));
818
+ }, (e) => new At(e.data));
819
819
  }
820
820
  getCategoryProductsList(e, t, n = !0, r = !1) {
821
821
  return this.get(`/internal/catalog/categories/${t}/products`, {
822
822
  client_id: e,
823
823
  showHidden: r,
824
824
  withPriceCoefficients: n
825
- }, (e) => j(e.data, (e) => new B(e)));
825
+ }, (e) => k(e.data, (e) => new R(e)));
826
826
  }
827
- }, Xt = class extends F {
827
+ }, Qt = class extends N {
828
828
  getProductData(e, t, n = !1) {
829
829
  return this.get(`/internal/catalog/products/${e}`, {
830
830
  clientId: t,
831
831
  withPriceCoefficients: n
832
- }, (e) => new B(e.data));
832
+ }, (e) => new R(e.data));
833
833
  }
834
834
  getNewProducts(e, t, n, r = !0) {
835
835
  let i = g().config.dateFormats.api;
836
- return this.getTypedPaginated(B, "/internal/catalog/products/new", void 0, void 0, n, {
836
+ return this.getTypedPaginated(R, "/internal/catalog/products/new", void 0, void 0, n, {
837
837
  clientId: e,
838
- period: { from: S(t, i) },
838
+ period: { from: x(t, i) },
839
839
  withPriceCoefficients: r
840
840
  });
841
841
  }
842
- }, Zt = class extends F {
842
+ }, $t = class extends N {
843
843
  getTemplateList(e, t, n) {
844
- return this.getTypedPaginated(L, "/internal/price/templates", e, t, n);
844
+ return this.getTypedPaginated(F, "/internal/price/templates", e, t, n);
845
845
  }
846
846
  createTemplate(e, t = {}) {
847
- return this.post("/internal/price/templates", e, (e) => new L(e.data), t);
847
+ return this.post("/internal/price/templates", e, (e) => new F(e.data), t);
848
848
  }
849
849
  getTemplate(e) {
850
- return this.get(`/internal/price/templates/${e}`, {}, (e) => new L(e.data));
850
+ return this.get(`/internal/price/templates/${e}`, {}, (e) => new F(e.data));
851
851
  }
852
852
  updateTemplate(e, t, n = {}) {
853
- return this.patch(`/internal/price/templates/${e}`, t, (e) => new L(e.data), n);
853
+ return this.patch(`/internal/price/templates/${e}`, t, (e) => new F(e.data), n);
854
854
  }
855
855
  removeTemplate(e) {
856
856
  return this.delete(`/internal/price/templates/${e}`);
857
857
  }
858
858
  getProductTemplatePrices(e) {
859
- return this.getTypedList(Pt, `/internal/price/templates/${e}/products`);
859
+ return this.getTypedList(It, `/internal/price/templates/${e}/products`);
860
860
  }
861
861
  getProductTemplatePrice(e, t) {
862
- return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new Pt(e.data));
862
+ return this.get(`/internal/price/templates/${e}/products/${t}`, {}, (e) => new It(e.data));
863
863
  }
864
864
  saveProductTemplatePrice(e, t, n) {
865
865
  return this.post(`/internal/price/templates/${e}/products/${t}`, {
866
866
  price_coefficient_id: n.coefficient?.id,
867
867
  increase_percent: n.value
868
- }, (e) => new Pt(e.data));
868
+ }, (e) => new It(e.data));
869
869
  }
870
870
  deleteProductTemplatePrice(e, t) {
871
871
  return this.delete(`/internal/price/templates/${e}/products/${t}`);
872
872
  }
873
873
  getCategoryTemplatePrices(e) {
874
- return this.getTypedList(jt, `/internal/price/templates/${e}/categories`);
874
+ return this.getTypedList(Nt, `/internal/price/templates/${e}/categories`);
875
875
  }
876
876
  getCategoryTemplatePrice(e, t) {
877
- return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new jt(e.data));
877
+ return this.get(`/internal/price/templates/${e}/categories/${t}`, {}, (e) => new Nt(e.data));
878
878
  }
879
879
  saveCategoryTemplatePrice(e, t, n, r = !1) {
880
880
  return this.request({
@@ -885,7 +885,7 @@ var nt = /* @__PURE__ */ function(e) {
885
885
  increase_percent: n.value
886
886
  },
887
887
  params: r ? { recursively: !0 } : {}
888
- }, (e) => new jt(e.data));
888
+ }, (e) => new Nt(e.data));
889
889
  }
890
890
  deleteCategoryTemplatePrice(e, t, n = !1) {
891
891
  return this.request({
@@ -895,62 +895,62 @@ var nt = /* @__PURE__ */ function(e) {
895
895
  });
896
896
  }
897
897
  getTemplateClients(e) {
898
- return this.getTypedList(G, `/internal/price/templates/${e}/clients`);
898
+ return this.getTypedList(U, `/internal/price/templates/${e}/clients`);
899
899
  }
900
- }, Qt = class extends l {
900
+ }, en = class extends l {
901
901
  getRoles() {
902
- return this.getTypedList(J, "/internal/price/roles");
902
+ return this.getTypedList(K, "/internal/price/roles");
903
903
  }
904
904
  createRole(e) {
905
- return this.post("/internal/price/roles", e, (e) => new J(e.data));
905
+ return this.post("/internal/price/roles", e, (e) => new K(e.data));
906
906
  }
907
907
  getRole(e) {
908
- return this.get(`/internal/price/roles/${e}`, {}, (e) => new J(e.data));
908
+ return this.get(`/internal/price/roles/${e}`, {}, (e) => new K(e.data));
909
909
  }
910
910
  updateRole(e, t) {
911
- return this.patch(`/internal/price/roles/${e}`, t, (e) => new J(e.data));
911
+ return this.patch(`/internal/price/roles/${e}`, t, (e) => new K(e.data));
912
912
  }
913
913
  deleteRole(e) {
914
914
  return this.delete(`/internal/price/roles/${e}`);
915
915
  }
916
916
  getCategoryRules(e) {
917
- return this.getTypedList(zt, `/internal/price/roles/rules/categories/${e}`);
917
+ return this.getTypedList(Vt, `/internal/price/roles/rules/categories/${e}`);
918
918
  }
919
919
  updateCategoryRules(e, t) {
920
- return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => h.instanceListInitializer(zt, e.data));
920
+ return this.patch(`/internal/price/roles/rules/categories/${e}`, t, (e) => h.instanceListInitializer(Vt, e.data));
921
921
  }
922
- }, $t = class extends F {
922
+ }, tn = class extends N {
923
923
  getProperties(e, t, n) {
924
- return this.getTypedPaginated(K, "/internal/catalog/properties", e, t, n);
924
+ return this.getTypedPaginated(W, "/internal/catalog/properties", e, t, n);
925
925
  }
926
926
  createProperty(e) {
927
927
  let { typeId: t, ...n } = e;
928
928
  return this.post("/internal/catalog/properties", {
929
929
  ...n,
930
930
  type: t
931
- }, (e) => new K(e.data));
931
+ }, (e) => new W(e.data));
932
932
  }
933
933
  getProperty(e) {
934
- return this.get(`/internal/catalog/properties/${e}`, {}, (e) => new K(e.data));
934
+ return this.get(`/internal/catalog/properties/${e}`, {}, (e) => new W(e.data));
935
935
  }
936
936
  updateProperty(e, t) {
937
937
  let { typeId: n, ...r } = t;
938
938
  return this.patch(`/internal/catalog/properties/${e}`, {
939
939
  ...r,
940
940
  type: n
941
- }, (e) => new K(e.data));
941
+ }, (e) => new W(e.data));
942
942
  }
943
943
  deleteProperty(e) {
944
944
  return this.delete(`/internal/catalog/properties/${e}`);
945
945
  }
946
946
  getProductProperties(e) {
947
- return this.getTypedList(q, `/internal/catalog/products/${e}/properties`);
947
+ return this.getTypedList(G, `/internal/catalog/products/${e}/properties`);
948
948
  }
949
949
  getProductProperty(e, t) {
950
- return this.get(`/internal/catalog/products/${e}/properties/${t}`, {}, (e) => new q(e.data));
950
+ return this.get(`/internal/catalog/products/${e}/properties/${t}`, {}, (e) => new G(e.data));
951
951
  }
952
952
  updateProductProperty(e, t, n) {
953
- return this.patch(`/internal/catalog/products/${e}/properties/${t}`, { value: n }, (e) => new q(e.data));
953
+ return this.patch(`/internal/catalog/products/${e}/properties/${t}`, { value: n }, (e) => new G(e.data));
954
954
  }
955
955
  deleteProductProperty(e, t) {
956
956
  return this.delete(`/internal/catalog/products/${e}/properties/${t}`);
@@ -989,13 +989,13 @@ var nt = /* @__PURE__ */ function(e) {
989
989
  return this.patch(`/internal/catalog/products/${e}/properties/slug`, { slug: t });
990
990
  }
991
991
  getCategoryProperties(e) {
992
- return this.getTypedList(q, `/internal/catalog/categories/${e}/properties`);
992
+ return this.getTypedList(G, `/internal/catalog/categories/${e}/properties`);
993
993
  }
994
994
  getCategoryProperty(e, t) {
995
- return this.get(`/internal/catalog/categories/${e}/properties/${t}`, {}, (e) => new q(e.data));
995
+ return this.get(`/internal/catalog/categories/${e}/properties/${t}`, {}, (e) => new G(e.data));
996
996
  }
997
997
  updateCategoryProperty(e, t, n) {
998
- return this.patch(`/internal/catalog/categories/${e}/properties/${t}`, { value: n }, (e) => new q(e.data));
998
+ return this.patch(`/internal/catalog/categories/${e}/properties/${t}`, { value: n }, (e) => new G(e.data));
999
999
  }
1000
1000
  deleteCategoryProperty(e, t) {
1001
1001
  return this.delete(`/internal/catalog/categories/${e}/properties/${t}`);
@@ -1037,20 +1037,20 @@ var nt = /* @__PURE__ */ function(e) {
1037
1037
  return this.post(`/internal/catalog/categories/${e}/image`, { image: t });
1038
1038
  }
1039
1039
  getCategoryFilters(e, t = !1) {
1040
- return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new Ut(e)));
1040
+ return this.get(`/internal/catalog/categories/${e}/filters`, { recursively: t }, (e) => e.data.map((e) => new Gt(e)));
1041
1041
  }
1042
1042
  getCategoryFilterSettings(e) {
1043
- return this.getTypedList(Vt, `/internal/catalog/categories/${e}/filter-settings`);
1043
+ return this.getTypedList(Ut, `/internal/catalog/categories/${e}/filter-settings`);
1044
1044
  }
1045
1045
  saveCategoryFilterSetting(e, t, n) {
1046
- return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new Vt(e.data));
1046
+ return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`, n, (e) => new Ut(e.data));
1047
1047
  }
1048
1048
  deleteCategoryFilterSetting(e, t) {
1049
1049
  return this.delete(`/internal/catalog/categories/${e}/filter-settings/${t}`);
1050
1050
  }
1051
- }, en = class extends l {
1051
+ }, nn = class extends l {
1052
1052
  getRootCategoriesList(e, t = !1) {
1053
- return this.getTypedList(U, "/internal/catalog/categories", {
1053
+ return this.getTypedList(V, "/internal/catalog/categories", {
1054
1054
  priceTemplateId: e,
1055
1055
  showHidden: t
1056
1056
  });
@@ -1060,30 +1060,30 @@ var nt = /* @__PURE__ */ function(e) {
1060
1060
  priceTemplateId: e,
1061
1061
  showHidden: n,
1062
1062
  withNestedCategories: r
1063
- }, (e) => new U(e.data));
1063
+ }, (e) => new V(e.data));
1064
1064
  }
1065
1065
  getCategoryProductsList(e, t, n = !0, r = !1) {
1066
1066
  return this.get(`/internal/catalog/categories/${t}/products`, {
1067
1067
  priceTemplateId: e,
1068
1068
  showHidden: r,
1069
1069
  withPriceCoefficients: n
1070
- }, (e) => j(e.data, (e) => new z(e)));
1070
+ }, (e) => k(e.data, (e) => new L(e)));
1071
1071
  }
1072
1072
  };
1073
1073
  //#endregion
1074
1074
  //#region src/catalog/methods/find-catalog-item.ts
1075
- function tn(e, t, n) {
1075
+ function rn(e, t, n) {
1076
1076
  let r;
1077
1077
  return e.some((e) => {
1078
1078
  if (e.type === n && e.id === t) return r = e, !0;
1079
1079
  if (e.type === "product") return !1;
1080
1080
  let i = e;
1081
1081
  if (i.products && i.products.length > 0) {
1082
- let e = tn(i.products, t, n);
1082
+ let e = rn(i.products, t, n);
1083
1083
  if (e) return r = e, !0;
1084
1084
  }
1085
1085
  if (i.categories && i.categories.length > 0) {
1086
- let e = tn(i.categories, t, n);
1086
+ let e = rn(i.categories, t, n);
1087
1087
  if (e) return r = e, !0;
1088
1088
  }
1089
1089
  return !1;
@@ -1091,20 +1091,20 @@ function tn(e, t, n) {
1091
1091
  }
1092
1092
  //#endregion
1093
1093
  //#region src/catalog/methods/flatten-catalog-items.ts
1094
- function nn(e) {
1094
+ function an(e) {
1095
1095
  let t = [];
1096
1096
  return e.forEach((e) => {
1097
1097
  if (t.push(e), e.type === "category") {
1098
1098
  let n = e;
1099
- n.products && n.products.length > 0 && t.push(...nn(n.products)), n.categories && n.categories.length > 0 && t.push(...nn(n.categories));
1099
+ n.products && n.products.length > 0 && t.push(...an(n.products)), n.categories && n.categories.length > 0 && t.push(...an(n.categories));
1100
1100
  }
1101
1101
  }), t;
1102
1102
  }
1103
1103
  //#endregion
1104
1104
  //#region src/clients/enums/clients-additional-data-request-type-enum.ts
1105
- var rn = /* @__PURE__ */ function(e) {
1105
+ var on = /* @__PURE__ */ function(e) {
1106
1106
  return e.LastOrder = "last_order", e.Contacts = "contacts", e.PartnerGroups = "partner_groups", e.PreferredDeliveryType = "preferred_delivery_type", e.SalesDirection = "sales_direction", e.Managers = "managers", e.Curators = "curators", e;
1107
- }({}), an = class extends u {
1107
+ }({}), sn = class extends u {
1108
1108
  bankName = "";
1109
1109
  bic = "";
1110
1110
  accountNumber = "";
@@ -1113,13 +1113,13 @@ var rn = /* @__PURE__ */ function(e) {
1113
1113
  constructor(e) {
1114
1114
  super(e), e && (this.bankName = e.bankName ?? "", this.bic = e.bic ?? "", this.accountNumber = e.accountNumber ?? "", this.correspondentAccount = e.correspondentAccount ?? "", this.currency = new a(e.currency));
1115
1115
  }
1116
- }, on = class extends ft {
1116
+ }, cn = class extends mt {
1117
1117
  phone;
1118
1118
  email;
1119
1119
  constructor(e) {
1120
1120
  super(e), this.email = e?.email, this.phone = /^\d+$/.test(e?.phone ?? "") ? `+${e?.phone}` : e?.phone;
1121
1121
  }
1122
- }, Y = class extends on {
1122
+ }, q = class extends cn {
1123
1123
  isPrimary;
1124
1124
  position;
1125
1125
  notDisturb;
@@ -1127,7 +1127,7 @@ var rn = /* @__PURE__ */ function(e) {
1127
1127
  constructor(e) {
1128
1128
  super(e), this.isPrimary = e?.isPrimary ?? !1, this.position = e?.position, this.notDisturb = e?.notDisturb ?? !1, this.comment = e?.comment;
1129
1129
  }
1130
- }, sn = class extends ft {
1130
+ }, ln = class extends mt {
1131
1131
  opf = ie.generatePersonItem();
1132
1132
  partnerGroup = new p();
1133
1133
  contacts = [];
@@ -1138,25 +1138,25 @@ var rn = /* @__PURE__ */ function(e) {
1138
1138
  updater;
1139
1139
  constructor(e) {
1140
1140
  if (super(e), e) {
1141
- if (this.opf = new ie(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.creator = e.creator ? new I(e.creator) : void 0, this.updater = e.updater ? new I(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new p(e.partnerGroup)), e.contacts) {
1141
+ if (this.opf = new ie(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.creator = e.creator ? new P(e.creator) : void 0, this.updater = e.updater ? new P(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new p(e.partnerGroup)), e.contacts) {
1142
1142
  let t = [];
1143
1143
  e.contacts.forEach((e) => {
1144
- t.push(new Y(e));
1144
+ t.push(new q(e));
1145
1145
  }), this.contacts = t;
1146
1146
  }
1147
1147
  if (e.bankAccounts) {
1148
1148
  let t = [];
1149
1149
  e.bankAccounts.forEach((e) => {
1150
- t.push(new an(e));
1150
+ t.push(new sn(e));
1151
1151
  }), this.bankAccounts = t;
1152
1152
  }
1153
1153
  }
1154
1154
  }
1155
- }, cn = class extends sn {
1155
+ }, un = class extends ln {
1156
1156
  constructor(e) {
1157
1157
  super(e);
1158
1158
  }
1159
- }, ln = class extends sn {
1159
+ }, dn = class extends ln {
1160
1160
  inn = "";
1161
1161
  okpo = "";
1162
1162
  ogrn = "";
@@ -1169,28 +1169,34 @@ var rn = /* @__PURE__ */ function(e) {
1169
1169
  constructor(e) {
1170
1170
  super(e), e && (this.inn = e.inn ?? "", this.okpo = e.okpo ?? "", this.ogrn = e.ogrn ?? "", this.directorName = e.directorName ?? "", this.directorPosition = e.directorPosition ?? "", this.directorActsOn = e.directorActsOn ?? "", this.legalAddress = e.legalAddress ?? "", this.postalAddress = e.postalAddress ?? "", this.actualAddress = e.actualAddress ?? "");
1171
1171
  }
1172
- }, un = class extends ln {
1172
+ }, fn = class extends dn {
1173
1173
  kpp = "";
1174
1174
  constructor(e) {
1175
1175
  super(e), e && (this.kpp = e.kpp ?? "");
1176
1176
  }
1177
- }, dn = class extends un {
1177
+ }, pn = class extends fn {
1178
1178
  registrationCountry = new r();
1179
1179
  registrationNumber = "";
1180
1180
  taxNumber = "";
1181
1181
  constructor(e) {
1182
1182
  super(e), e && (this.registrationCountry = new r(e.registrationCountry), this.registrationNumber = e.registrationNumber ?? "", this.taxNumber = e.taxNumber ?? "");
1183
1183
  }
1184
- }, fn = class {
1184
+ }, mn = class {
1185
1185
  static createInstance(e) {
1186
1186
  switch (e.opf.slug) {
1187
- case f.Ic: return new ln(e);
1188
- case f.UlR: return new un(e);
1189
- case f.UlNr: return new dn(e);
1190
- default: return new cn(e);
1187
+ case f.Ic: return new dn(e);
1188
+ case f.UlR: return new fn(e);
1189
+ case f.UlNr: return new pn(e);
1190
+ default: return new un(e);
1191
1191
  }
1192
1192
  }
1193
- }, X = class extends ft {
1193
+ }, hn = class extends d {
1194
+ city;
1195
+ isActive;
1196
+ constructor(e) {
1197
+ super(e), this.city = e?.city ? new t(e.city) : void 0, this.isActive = e?.isActive ?? !1;
1198
+ }
1199
+ }, J = class extends mt {
1194
1200
  address = "";
1195
1201
  coordinates;
1196
1202
  contacts;
@@ -1199,9 +1205,9 @@ var rn = /* @__PURE__ */ function(e) {
1199
1205
  isOneTime;
1200
1206
  isTransportCompanyAddress;
1201
1207
  constructor(e) {
1202
- super(e), this.address = e?.address ?? "", this.coordinates = new ee(e?.coordinates), this.contacts = e?.contacts?.map((e) => new Y(e)) ?? [], this.comment = e?.comment, this.operatingHours = e?.operatingHours, this.isOneTime = e?.isOneTime, this.isTransportCompanyAddress = e?.isTransportCompanyAddress;
1208
+ super(e), this.address = e?.address ?? "", this.coordinates = new ee(e?.coordinates), this.contacts = e?.contacts?.map((e) => new q(e)) ?? [], this.comment = e?.comment, this.operatingHours = e?.operatingHours, this.isOneTime = e?.isOneTime, this.isTransportCompanyAddress = e?.isTransportCompanyAddress;
1203
1209
  }
1204
- }, pn = class extends W {
1210
+ }, gn = class extends H {
1205
1211
  contragents;
1206
1212
  partnerGroups;
1207
1213
  contacts;
@@ -1213,9 +1219,9 @@ var rn = /* @__PURE__ */ function(e) {
1213
1219
  preferredWarehouse;
1214
1220
  extraData;
1215
1221
  constructor(t) {
1216
- super(t), this.contragents = t?.contragents?.map((e) => fn.createInstance(e)) ?? [], this.partnerGroups = t?.partnerGroups?.map((e) => new p(e)) ?? [], this.contacts = t?.contacts?.map((e) => new Y(e)) ?? [], this.deliveryAddresses = t?.deliveryAddresses?.map((e) => new X(e)) ?? [], this.channelPrimaryInterest = new e(t?.channelPrimaryInterest), this.sourcePrimaryInterest = new fe(t?.sourcePrimaryInterest), this.preferredDeliveryType = new s(t?.preferredDeliveryType), this.primaryDemand = t?.primaryDemand, this.preferredWarehouse = t?.preferredWarehouse ? new ge(t.preferredWarehouse) : void 0, this.extraData = t?.extraData ?? {};
1222
+ super(t), this.contragents = t?.contragents?.map((e) => mn.createInstance(e)) ?? [], this.partnerGroups = t?.partnerGroups?.map((e) => new p(e)) ?? [], this.contacts = t?.contacts?.map((e) => new q(e)) ?? [], this.deliveryAddresses = t?.deliveryAddresses?.map((e) => new J(e)) ?? [], this.channelPrimaryInterest = new e(t?.channelPrimaryInterest), this.sourcePrimaryInterest = new fe(t?.sourcePrimaryInterest), this.preferredDeliveryType = new s(t?.preferredDeliveryType), this.primaryDemand = t?.primaryDemand, this.preferredWarehouse = t?.preferredWarehouse ? new ge(t.preferredWarehouse) : void 0, this.extraData = t?.extraData ?? {};
1217
1223
  }
1218
- }, mn = class extends N {
1224
+ }, _n = class extends j {
1219
1225
  id;
1220
1226
  guid;
1221
1227
  name;
@@ -1227,8 +1233,8 @@ var rn = /* @__PURE__ */ function(e) {
1227
1233
  phone;
1228
1234
  email;
1229
1235
  isActive;
1230
- createdAt = new P();
1231
- lastLoginDate = new P();
1236
+ createdAt = new M();
1237
+ lastLoginDate = new M();
1232
1238
  lastLoginDateHasOrder;
1233
1239
  managers;
1234
1240
  includeSubordinateManagers;
@@ -1241,13 +1247,13 @@ var rn = /* @__PURE__ */ function(e) {
1241
1247
  partnerGroups;
1242
1248
  contact;
1243
1249
  lastOrder;
1244
- noOrdersPeriod = new P();
1250
+ noOrdersPeriod = new M();
1245
1251
  constructor(e) {
1246
- super(), this.id = e?.id, this.guid = e?.guid, this.name = e?.name, this.alternativeName = e?.alternativeName, this.searchTerm = e?.searchTerm, this.cities = e?.cities?.map((e) => new t(e)), this.region = new ue(e?.region), this.country = new r(e?.country), this.phone = e?.phone, this.email = e?.email, this.isActive = e && Object.prototype.hasOwnProperty.call(e, "isActive") ? e?.isActive : !0, this.createdAt = new P(e?.createdAt), this.lastLoginDate = new P(e?.lastLoginDate), this.lastLoginDateHasOrder = e?.lastLoginDateHasOrder ?? void 0, this.managers = e?.managers?.map((e) => new te(e)) ?? [], this.includeSubordinateManagers = e?.includeSubordinateManagers ?? !0, this.curators = e?.curators?.map((e) => new Mt(e)) ?? [], this.salesDirections = e?.salesDirections?.map((e) => new m(e)), this.contragentInn = e?.contragentInn, this.contragentType = new ie(e?.contragentType), this.preferredDeliveryType = e?.preferredDeliveryType ? new s(e?.preferredDeliveryType) : void 0, this.partnerGroups = e?.partnerGroups?.map((e) => new p(e)), this.contact = new on(e?.contact), this.lastOrder = {
1247
- createdAt: new P(e?.lastOrder?.createdAt),
1252
+ super(), this.id = e?.id, this.guid = e?.guid, this.name = e?.name, this.alternativeName = e?.alternativeName, this.searchTerm = e?.searchTerm, this.cities = e?.cities?.map((e) => new t(e)), this.region = new ue(e?.region), this.country = new r(e?.country), this.phone = e?.phone, this.email = e?.email, this.isActive = e && Object.prototype.hasOwnProperty.call(e, "isActive") ? e?.isActive : !0, this.createdAt = new M(e?.createdAt), this.lastLoginDate = new M(e?.lastLoginDate), this.lastLoginDateHasOrder = e?.lastLoginDateHasOrder ?? void 0, this.managers = e?.managers?.map((e) => new te(e)) ?? [], this.includeSubordinateManagers = e?.includeSubordinateManagers ?? !0, this.curators = e?.curators?.map((e) => new Pt(e)) ?? [], this.salesDirections = e?.salesDirections?.map((e) => new m(e)), this.contragentInn = e?.contragentInn, this.contragentType = new ie(e?.contragentType), this.preferredDeliveryType = e?.preferredDeliveryType ? new s(e?.preferredDeliveryType) : void 0, this.partnerGroups = e?.partnerGroups?.map((e) => new p(e)), this.contact = new cn(e?.contact), this.lastOrder = {
1253
+ createdAt: new M(e?.lastOrder?.createdAt),
1248
1254
  creator: e?.lastOrder?.creator,
1249
1255
  isApproved: e?.lastOrder?.isApproved
1250
- }, this.noOrdersPeriod = new P(e?.noOrdersPeriod);
1256
+ }, this.noOrdersPeriod = new M(e?.noOrdersPeriod);
1251
1257
  }
1252
1258
  resetFilterValue(e) {
1253
1259
  switch (e) {
@@ -1291,7 +1297,7 @@ var rn = /* @__PURE__ */ function(e) {
1291
1297
  this.partnerGroups = [];
1292
1298
  break;
1293
1299
  case "contact":
1294
- this.contact = new on();
1300
+ this.contact = new cn();
1295
1301
  break;
1296
1302
  default: this[e] = void 0;
1297
1303
  }
@@ -1301,12 +1307,12 @@ var rn = /* @__PURE__ */ function(e) {
1301
1307
  let e = super.asClearRaw();
1302
1308
  return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.lastLoginDate?.from && !e?.lastLoginDate?.to && delete e.lastLoginDate, !e?.noOrdersPeriod?.from && !e?.noOrdersPeriod?.to && delete e.noOrdersPeriod, e;
1303
1309
  }
1304
- }, hn = class extends M {
1310
+ }, vn = class extends A {
1305
1311
  creator;
1306
1312
  constructor(e) {
1307
- super(e), this.creator = new I(e?.creator);
1313
+ super(e), this.creator = new P(e?.creator);
1308
1314
  }
1309
- }, gn = class extends d {
1315
+ }, yn = class extends d {
1310
1316
  contacts = [];
1311
1317
  preferredDeliveryType;
1312
1318
  partnerGroups = [];
@@ -1315,23 +1321,23 @@ var rn = /* @__PURE__ */ function(e) {
1315
1321
  managers;
1316
1322
  curators;
1317
1323
  constructor(e) {
1318
- super(e), this.contacts = e.contacts?.map((e) => new Y(e)) ?? void 0, this.lastOrder = e.lastOrder ? new hn(e.lastOrder) : void 0, this.partnerGroups = e.partnerGroups?.map((e) => new p(e)) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new s(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new m(e.salesDirection) : void 0, this.managers = e.managers?.map((e) => new ne(e)) ?? void 0, this.curators = e.curators?.map((e) => new Mt(e)) ?? void 0;
1324
+ super(e), this.contacts = e.contacts?.map((e) => new q(e)) ?? void 0, this.lastOrder = e.lastOrder ? new vn(e.lastOrder) : void 0, this.partnerGroups = e.partnerGroups?.map((e) => new p(e)) ?? void 0, this.preferredDeliveryType = e.preferredDeliveryType ? new s(e.preferredDeliveryType) : void 0, this.salesDirection = e.salesDirection ? new m(e.salesDirection) : void 0, this.managers = e.managers?.map((e) => new ne(e)) ?? void 0, this.curators = e.curators?.map((e) => new Pt(e)) ?? void 0;
1319
1325
  }
1320
- }, _n = class extends u {
1326
+ }, bn = class extends u {
1321
1327
  isPrimary;
1322
1328
  constructor(e) {
1323
1329
  super(e), this.isPrimary = e.isPrimary;
1324
1330
  }
1325
- }, vn = class extends Y {
1331
+ }, xn = class extends q {
1326
1332
  relations = {
1327
1333
  clients: [],
1328
1334
  contragents: [],
1329
1335
  addresses: []
1330
1336
  };
1331
1337
  constructor(e) {
1332
- super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new _n(e))), e.relations.clients && (this.relations.clients = e.relations.clients.map((e) => new _n(e))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((e) => new _n(e))));
1338
+ super(e), e.relations && (e.relations.addresses && (this.relations.addresses = e.relations.addresses.map((e) => new bn(e))), e.relations.clients && (this.relations.clients = e.relations.clients.map((e) => new bn(e))), e.relations.contragents && (this.relations.contragents = e.relations.contragents.map((e) => new bn(e))));
1333
1339
  }
1334
- }, yn = class e extends F {
1340
+ }, Sn = class e extends N {
1335
1341
  static transformClientDataToRequest(e) {
1336
1342
  return {
1337
1343
  name: e.name,
@@ -1440,10 +1446,10 @@ var rn = /* @__PURE__ */ function(e) {
1440
1446
  };
1441
1447
  }
1442
1448
  getClient(e) {
1443
- return this.get(`/internal/clients/${e}`, {}, (e) => new pn(e.data));
1449
+ return this.get(`/internal/clients/${e}`, {}, (e) => new gn(e.data));
1444
1450
  }
1445
1451
  getClientsList(e, t, n, r, i) {
1446
- return this.getTypedPaginated(W, "/internal/clients", e, t, n, r, void 0, i);
1452
+ return this.getTypedPaginated(H, "/internal/clients", e, t, n, r, void 0, i);
1447
1453
  }
1448
1454
  searchClient(e) {
1449
1455
  return this.getClientsList(void 0, void 0, void 0, { searchTerm: e }).then((e) => e.data);
@@ -1454,7 +1460,7 @@ var rn = /* @__PURE__ */ function(e) {
1454
1460
  groups: [],
1455
1461
  filters: [{
1456
1462
  field: "phone",
1457
- op: ct.Contains,
1463
+ op: ut.Contains,
1458
1464
  value: e
1459
1465
  }]
1460
1466
  });
@@ -1464,13 +1470,13 @@ var rn = /* @__PURE__ */ function(e) {
1464
1470
  return this.post("/internal/clients/additional-data", {
1465
1471
  clients: n,
1466
1472
  requested_data_types: t
1467
- }, (e) => h.instanceListInitializer(gn, e.data));
1473
+ }, (e) => h.instanceListInitializer(yn, e.data));
1468
1474
  }
1469
1475
  getAllClientContacts(e) {
1470
- return this.getTypedList(vn, `/internal/clients/${e}/contacts/all`);
1476
+ return this.getTypedList(xn, `/internal/clients/${e}/contacts/all`);
1471
1477
  }
1472
1478
  createClientCommonData(t, n = {}) {
1473
- return this.post("/internal/clients", e.transformClientDataToRequest(t), (e) => new pn(e.data), n);
1479
+ return this.post("/internal/clients", e.transformClientDataToRequest(t), (e) => new gn(e.data), n);
1474
1480
  }
1475
1481
  updateClientCommonData(t, n = {}) {
1476
1482
  return this.patch(`/internal/clients/${t.id}`, e.transformClientDataToRequest(t), void 0, n);
@@ -1512,31 +1518,31 @@ var rn = /* @__PURE__ */ function(e) {
1512
1518
  })) });
1513
1519
  }
1514
1520
  createContragentClientData(t, n, r = {}) {
1515
- return this.post(`/internal/clients/${t}/contragents`, e.transformContragentClientDataToRequest(n), (e) => fn.createInstance(e.data), r);
1521
+ return this.post(`/internal/clients/${t}/contragents`, e.transformContragentClientDataToRequest(n), (e) => mn.createInstance(e.data), r);
1516
1522
  }
1517
1523
  updateContragentClientData(t, n, r = {}) {
1518
- return this.patch(`/internal/clients/${t}/contragents/${n.id}`, e.transformContragentClientDataToRequest(n), (e) => fn.createInstance(e.data), r);
1524
+ return this.patch(`/internal/clients/${t}/contragents/${n.id}`, e.transformContragentClientDataToRequest(n), (e) => mn.createInstance(e.data), r);
1519
1525
  }
1520
1526
  deleteClientContragent(e, t) {
1521
1527
  return this.delete(`/internal/clients/${e}/contragents/${t.id}`);
1522
1528
  }
1523
1529
  getClientDeliveryAddresses(e) {
1524
- return this.getTypedList(X, `/internal/clients/${e}/delivery-addresses`);
1530
+ return this.getTypedList(J, `/internal/clients/${e}/delivery-addresses`);
1525
1531
  }
1526
1532
  createClientDeliveryAddress(t, n, r = {}) {
1527
- return this.post(`/internal/clients/${t}/delivery-addresses`, e.transformClientDeliveryAddressToRequest(n), (e) => new X(e.data), r);
1533
+ return this.post(`/internal/clients/${t}/delivery-addresses`, e.transformClientDeliveryAddressToRequest(n), (e) => new J(e.data), r);
1528
1534
  }
1529
1535
  updateClientDeliveryAddress(t, n, r = {}) {
1530
- return this.patch(`/internal/clients/${t}/delivery-addresses/${n.id}`, e.transformClientDeliveryAddressToRequest(n), (e) => new X(e.data), r);
1536
+ return this.patch(`/internal/clients/${t}/delivery-addresses/${n.id}`, e.transformClientDeliveryAddressToRequest(n), (e) => new J(e.data), r);
1531
1537
  }
1532
1538
  deleteClientDeliveryAddress(e, t) {
1533
1539
  return this.delete(`/internal/clients/${e}/delivery-addresses/${t.id}`);
1534
1540
  }
1535
1541
  createContragentBankAccount(t, n, r, i = {}) {
1536
- return this.post(`/internal/clients/${t}/contragents/${n}/bank-accounts`, e.transformClientContragentBankAccountToRequest(r), (e) => new an(e.data), i);
1542
+ return this.post(`/internal/clients/${t}/contragents/${n}/bank-accounts`, e.transformClientContragentBankAccountToRequest(r), (e) => new sn(e.data), i);
1537
1543
  }
1538
1544
  updateContragentBankAccount(t, n, r, i = {}) {
1539
- return this.patch(`/internal/clients/${t}/contragents/${n}/bank-accounts/${r.id}`, e.transformClientContragentBankAccountToRequest(r), (e) => new an(e.data), i);
1545
+ return this.patch(`/internal/clients/${t}/contragents/${n}/bank-accounts/${r.id}`, e.transformClientContragentBankAccountToRequest(r), (e) => new sn(e.data), i);
1540
1546
  }
1541
1547
  deleteContragentBankAccount(e, t, n) {
1542
1548
  return this.delete(`/internal/clients/${e}/contragents/${t}/bank-accounts/${n.id}`);
@@ -1556,7 +1562,7 @@ var rn = /* @__PURE__ */ function(e) {
1556
1562
  email: t.email,
1557
1563
  comment: t.comment,
1558
1564
  not_disturb: t.notDisturb
1559
- }, (e) => new Y(e.data), n);
1565
+ }, (e) => new q(e.data), n);
1560
1566
  }
1561
1567
  setPrimaryClientContact(e, t) {
1562
1568
  return this.setPrimaryContact(`/internal/clients/${e}/contacts/${t.id}/primary`, t.isPrimary ?? !1);
@@ -1597,7 +1603,7 @@ var rn = /* @__PURE__ */ function(e) {
1597
1603
  comment: t.comment,
1598
1604
  ...n
1599
1605
  };
1600
- return t.phone?.length && (i.phone = t.phone), t.email?.length && (i.email = t.email), this.post(`/internal/clients/${e}/contacts`, i, (e) => new Y(e.data), r);
1606
+ return t.phone?.length && (i.phone = t.phone), t.email?.length && (i.email = t.email), this.post(`/internal/clients/${e}/contacts`, i, (e) => new q(e.data), r);
1601
1607
  }
1602
1608
  setPrimaryContact(e, t) {
1603
1609
  return this.patch(e, { is_primary: t });
@@ -1608,7 +1614,7 @@ var rn = /* @__PURE__ */ function(e) {
1608
1614
  sendClientEmailConfirmation(e) {
1609
1615
  return this.get(`/internal/clients/${e.id}/verification/email?email=${e.email}`);
1610
1616
  }
1611
- }, bn = class extends l {
1617
+ }, Cn = class extends l {
1612
1618
  checkPhoneIsBusy(e) {
1613
1619
  return new Promise((t, n) => {
1614
1620
  this.request({
@@ -1620,16 +1626,16 @@ var rn = /* @__PURE__ */ function(e) {
1620
1626
  }).catch(n);
1621
1627
  });
1622
1628
  }
1623
- }, xn = class {
1629
+ }, wn = class {
1624
1630
  date;
1625
1631
  name;
1626
1632
  version;
1627
1633
  constructor(e) {
1628
- this.date = A(e?.date) ? C(e.date) : e?.date ?? /* @__PURE__ */ new Date(), this.name = e?.name ?? "", this.version = e?.version ?? "0.0.0";
1634
+ this.date = O(e?.date) ? S(e.date) : e?.date ?? /* @__PURE__ */ new Date(), this.name = e?.name ?? "", this.version = e?.version ?? "0.0.0";
1629
1635
  }
1630
- }, Sn = /* @__PURE__ */ function(e) {
1636
+ }, Tn = /* @__PURE__ */ function(e) {
1631
1637
  return e.Kozyrek = "kozyrek", e.Mosquitto = "mosquitto", e.Strip = "strip", e.MetalForDoors = "metal_for_doors", e.Sandwich = "sandwich", e.SandwichM2 = "sandwich_m2", e;
1632
- }({}), Cn = class extends l {
1638
+ }({}), En = class extends l {
1633
1639
  getConfiguratorSettings(e, t) {
1634
1640
  return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/settings?client_id=${t}`);
1635
1641
  }
@@ -1641,7 +1647,7 @@ var rn = /* @__PURE__ */ function(e) {
1641
1647
  params: n,
1642
1648
  client_id: t
1643
1649
  }
1644
- }, (e) => new z(e.data), r);
1650
+ }, (e) => new L(e.data), r);
1645
1651
  }
1646
1652
  createTemplate(e, t, n, r = {}) {
1647
1653
  return this.post(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/template?client_id=${t}`, { ...n }, () => {}, r);
@@ -1655,13 +1661,13 @@ var rn = /* @__PURE__ */ function(e) {
1655
1661
  ...n
1656
1662
  });
1657
1663
  }
1658
- }, wn = class {
1664
+ }, Dn = class {
1659
1665
  page = 1;
1660
1666
  pageSize = 50;
1661
1667
  constructor(e) {
1662
1668
  this.page = e?.page ?? 1, this.pageSize = e?.pageSize ?? 50;
1663
1669
  }
1664
- }, Tn = class extends wn {
1670
+ }, On = class extends Dn {
1665
1671
  itemCount = 0;
1666
1672
  pageCount = 1;
1667
1673
  pageSlot = 5;
@@ -1678,13 +1684,13 @@ var rn = /* @__PURE__ */ function(e) {
1678
1684
  100
1679
1685
  ], this.showSizePicker = e?.showSizePicker ?? !0;
1680
1686
  }
1681
- }, En = class {
1687
+ }, kn = class {
1682
1688
  field;
1683
1689
  direction;
1684
1690
  constructor(e) {
1685
1691
  this.field = e?.field ?? "", this.direction = e?.direction ?? "asc";
1686
1692
  }
1687
- }, Z = class e {
1693
+ }, Y = class e {
1688
1694
  static decadeInterval(t) {
1689
1695
  let [n, r] = e.shiftedDecadeBounds(t, 0);
1690
1696
  return {
@@ -1709,14 +1715,14 @@ var rn = /* @__PURE__ */ function(e) {
1709
1715
  return v(e, t * 6);
1710
1716
  }
1711
1717
  static intervalTillSameDate(e, t, n) {
1712
- let r = Se(T(n), T(e)), i = T(v(t, r)), a = Math.min(Oe(n), ke(i));
1718
+ let r = Se(w(n), w(e)), i = w(v(t, r)), a = Math.min(ke(n), Ae(i));
1713
1719
  return {
1714
- from: w(t),
1715
- to: y(Ae(i, a))
1720
+ from: C(t),
1721
+ to: y(je(i, a))
1716
1722
  };
1717
1723
  }
1718
1724
  static weekTillSameWeekday(e, t) {
1719
- let n = E(ye(e, t), { weekStartsOn: 1 }), r = xe(e, E(e, { weekStartsOn: 1 }));
1725
+ let n = T(ye(e, t), { weekStartsOn: 1 }), r = xe(e, T(e, { weekStartsOn: 1 }));
1720
1726
  return {
1721
1727
  from: n,
1722
1728
  to: y(_(n, r))
@@ -1730,20 +1736,20 @@ var rn = /* @__PURE__ */ function(e) {
1730
1736
  };
1731
1737
  }
1732
1738
  static shiftedDecadeBounds(e, t) {
1733
- let n = Oe(e), r = 2;
1739
+ let n = ke(e), r = 2;
1734
1740
  n <= 10 ? r = 0 : n <= 20 && (r = 1);
1735
- let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s = T(v(e, a)), c = _(s, o * 10);
1741
+ let i = r + t, a = Math.floor(i / 3), o = (i % 3 + 3) % 3, s = w(v(e, a)), c = _(s, o * 10);
1736
1742
  return [c, o === 2 ? b(s) : y(_(c, 9))];
1737
1743
  }
1738
1744
  };
1739
1745
  //#endregion
1740
1746
  //#region src/date-time/helpers/days-ago-iso.ts
1741
- function Dn(e) {
1742
- return S(Fe(Me(), e), "yyyy-MM-dd");
1747
+ function An(e) {
1748
+ return x(Ie(Ne(), e), "yyyy-MM-dd");
1743
1749
  }
1744
1750
  //#endregion
1745
1751
  //#region src/i18n/helpers/pluralize.ts
1746
- function On(e, t) {
1752
+ function jn(e, t) {
1747
1753
  let n = [
1748
1754
  2,
1749
1755
  0,
@@ -1756,13 +1762,13 @@ function On(e, t) {
1756
1762
  }
1757
1763
  //#endregion
1758
1764
  //#region src/date-time/helpers/format-relative-date.ts
1759
- function kn(e) {
1760
- let t = C(e), n = xe(Me(), t);
1765
+ function Mn(e) {
1766
+ let t = S(e), n = xe(Ne(), t);
1761
1767
  switch (!0) {
1762
1768
  case n === 0: return "Сегодня";
1763
1769
  case n === 1: return "Вчера";
1764
1770
  case n < 0: return e;
1765
- default: return `${n} ${On(n, [
1771
+ default: return `${n} ${jn(n, [
1766
1772
  "день",
1767
1773
  "дня",
1768
1774
  "дней"
@@ -1771,38 +1777,38 @@ function kn(e) {
1771
1777
  }
1772
1778
  //#endregion
1773
1779
  //#region src/date-time/providers/date-time-provider.ts
1774
- var An = class {
1780
+ var Nn = class {
1775
1781
  static defaultDateRanges(e) {
1776
- let t = _e(/* @__PURE__ */ new Date(), 1), n = /* @__PURE__ */ new Date(), r = D(e === void 0 ? n : new Date(e, 0, 1)), i = Ee(r);
1782
+ let t = _e(/* @__PURE__ */ new Date(), 1), n = /* @__PURE__ */ new Date(), r = E(e === void 0 ? n : new Date(e, 0, 1)), i = De(r);
1777
1783
  return {
1778
1784
  nextWorkingDay: {
1779
1785
  label: "Следующий рабочий день",
1780
- from: w(t),
1786
+ from: C(t),
1781
1787
  to: y(t)
1782
1788
  },
1783
1789
  today: {
1784
1790
  label: "Сегодня",
1785
- from: Me(),
1791
+ from: Ne(),
1786
1792
  to: we()
1787
1793
  },
1788
1794
  yesterday: {
1789
1795
  label: "Вчера",
1790
- from: Pe(),
1791
- to: De()
1796
+ from: Fe(),
1797
+ to: Oe()
1792
1798
  },
1793
1799
  tomorrow: {
1794
1800
  label: "Завтра",
1795
- from: Ne(),
1801
+ from: Pe(),
1796
1802
  to: Te()
1797
1803
  },
1798
1804
  currentWeek: {
1799
1805
  label: "Неделя",
1800
- from: E(n, { weekStartsOn: 1 }),
1801
- to: x(n, { weekStartsOn: 1 })
1806
+ from: T(n, { weekStartsOn: 1 }),
1807
+ to: Ee(n, { weekStartsOn: 1 })
1802
1808
  },
1803
1809
  currentMonth: {
1804
1810
  label: "Месяц",
1805
- from: T(n),
1811
+ from: w(n),
1806
1812
  to: b(n)
1807
1813
  },
1808
1814
  oneMonth: {
@@ -1858,13 +1864,13 @@ var An = class {
1858
1864
  };
1859
1865
  }
1860
1866
  static standardPeriods(e = /* @__PURE__ */ new Date()) {
1861
- let t = { weekStartsOn: 1 }, n = w(e), r = y(e), i = Z.decadeInterval(e), a = T(e), o = je(e), s = Z.startOfHalfYear(e), c = D(e), ee = Z.addHalfYears(e, -1), l = Z.addHalfYears(e, 1);
1867
+ let t = { weekStartsOn: 1 }, n = C(e), r = y(e), i = Y.decadeInterval(e), a = w(e), o = Me(e), s = Y.startOfHalfYear(e), c = E(e), ee = Y.addHalfYears(e, -1), l = Y.addHalfYears(e, 1);
1862
1868
  return {
1863
1869
  yesterday: {
1864
1870
  label: "Вчера",
1865
1871
  group: "day",
1866
- from: w(Fe(e, 1)),
1867
- to: y(Fe(e, 1))
1872
+ from: C(Ie(e, 1)),
1873
+ to: y(Ie(e, 1))
1868
1874
  },
1869
1875
  today: {
1870
1876
  label: "Сегодня",
@@ -1875,31 +1881,31 @@ var An = class {
1875
1881
  tomorrow: {
1876
1882
  label: "Завтра",
1877
1883
  group: "day",
1878
- from: w(_(e, 1)),
1884
+ from: C(_(e, 1)),
1879
1885
  to: y(_(e, 1))
1880
1886
  },
1881
1887
  lastWeek: {
1882
1888
  label: "Прошлая неделя",
1883
1889
  group: "week",
1884
- from: E(Re(e, 1), t),
1885
- to: x(Re(e, 1), t)
1890
+ from: T(ze(e, 1), t),
1891
+ to: Ee(ze(e, 1), t)
1886
1892
  },
1887
1893
  thisWeek: {
1888
1894
  label: "Эта неделя",
1889
1895
  group: "week",
1890
- from: E(e, t),
1891
- to: x(e, t)
1896
+ from: T(e, t),
1897
+ to: Ee(e, t)
1892
1898
  },
1893
1899
  nextWeek: {
1894
1900
  label: "Следующая неделя",
1895
1901
  group: "week",
1896
- from: E(ye(e, 1), t),
1897
- to: x(ye(e, 1), t)
1902
+ from: T(ye(e, 1), t),
1903
+ to: Ee(ye(e, 1), t)
1898
1904
  },
1899
1905
  lastTenDays: {
1900
1906
  label: "Прошлая декада",
1901
1907
  group: "decade",
1902
- ...Z.shiftDecadeInterval(e, -1)
1908
+ ...Y.shiftDecadeInterval(e, -1)
1903
1909
  },
1904
1910
  thisTenDays: {
1905
1911
  label: "Эта декада",
@@ -1909,13 +1915,13 @@ var An = class {
1909
1915
  nextTenDays: {
1910
1916
  label: "Следующая декада",
1911
1917
  group: "decade",
1912
- ...Z.shiftDecadeInterval(e, 1)
1918
+ ...Y.shiftDecadeInterval(e, 1)
1913
1919
  },
1914
1920
  lastMonth: {
1915
1921
  label: "Прошлый месяц",
1916
1922
  group: "month",
1917
- from: T(Ie(e, 1)),
1918
- to: b(Ie(e, 1))
1923
+ from: w(Le(e, 1)),
1924
+ to: b(Le(e, 1))
1919
1925
  },
1920
1926
  thisMonth: {
1921
1927
  label: "Этот месяц",
@@ -1926,14 +1932,14 @@ var An = class {
1926
1932
  nextMonth: {
1927
1933
  label: "Следующий месяц",
1928
1934
  group: "month",
1929
- from: T(v(e, 1)),
1935
+ from: w(v(e, 1)),
1930
1936
  to: b(v(e, 1))
1931
1937
  },
1932
1938
  lastQuarter: {
1933
1939
  label: "Прошлый квартал",
1934
1940
  group: "quarter",
1935
- from: je(Le(e, 1)),
1936
- to: Ce(Le(e, 1))
1941
+ from: Me(Re(e, 1)),
1942
+ to: Ce(Re(e, 1))
1937
1943
  },
1938
1944
  thisQuarter: {
1939
1945
  label: "Этот квартал",
@@ -1944,50 +1950,50 @@ var An = class {
1944
1950
  nextQuarter: {
1945
1951
  label: "Следующий квартал",
1946
1952
  group: "quarter",
1947
- from: je(ve(e, 1)),
1953
+ from: Me(ve(e, 1)),
1948
1954
  to: Ce(ve(e, 1))
1949
1955
  },
1950
1956
  lastHalfYear: {
1951
1957
  label: "Прошлое полугодие",
1952
1958
  group: "halfYear",
1953
- from: Z.startOfHalfYear(ee),
1954
- to: Z.endOfHalfYear(ee)
1959
+ from: Y.startOfHalfYear(ee),
1960
+ to: Y.endOfHalfYear(ee)
1955
1961
  },
1956
1962
  thisHalfYear: {
1957
1963
  label: "Это полугодие",
1958
1964
  group: "halfYear",
1959
1965
  from: s,
1960
- to: Z.endOfHalfYear(e)
1966
+ to: Y.endOfHalfYear(e)
1961
1967
  },
1962
1968
  nextHalfYear: {
1963
1969
  label: "Следующее полугодие",
1964
1970
  group: "halfYear",
1965
- from: Z.startOfHalfYear(l),
1966
- to: Z.endOfHalfYear(l)
1971
+ from: Y.startOfHalfYear(l),
1972
+ to: Y.endOfHalfYear(l)
1967
1973
  },
1968
1974
  lastYear: {
1969
1975
  label: "Прошлый год",
1970
1976
  group: "year",
1971
- from: D(ze(e, 1)),
1972
- to: Ee(ze(e, 1))
1977
+ from: E(Be(e, 1)),
1978
+ to: De(Be(e, 1))
1973
1979
  },
1974
1980
  thisYear: {
1975
1981
  label: "Этот год",
1976
1982
  group: "year",
1977
1983
  from: c,
1978
- to: Ee(e)
1984
+ to: De(e)
1979
1985
  },
1980
1986
  nextYear: {
1981
1987
  label: "Следующий год",
1982
1988
  group: "year",
1983
- from: D(be(e, 1)),
1984
- to: Ee(be(e, 1))
1989
+ from: E(be(e, 1)),
1990
+ to: De(be(e, 1))
1985
1991
  },
1986
1992
  fromBeginningOfThisWeek: {
1987
1993
  label: "С начала этой недели",
1988
1994
  group: "other",
1989
1995
  section: "fromBeginning",
1990
- from: E(e, t),
1996
+ from: T(e, t),
1991
1997
  to: r
1992
1998
  },
1993
1999
  fromBeginningOfThisTenDays: {
@@ -2030,7 +2036,7 @@ var An = class {
2030
2036
  group: "other",
2031
2037
  section: "tillEnd",
2032
2038
  from: n,
2033
- to: x(e, t)
2039
+ to: Ee(e, t)
2034
2040
  },
2035
2041
  tillEndOfThisTenDays: {
2036
2042
  label: "До конца этой декады",
@@ -2058,92 +2064,92 @@ var An = class {
2058
2064
  group: "other",
2059
2065
  section: "tillEnd",
2060
2066
  from: n,
2061
- to: Z.endOfHalfYear(e)
2067
+ to: Y.endOfHalfYear(e)
2062
2068
  },
2063
2069
  tillEndOfThisYear: {
2064
2070
  label: "До конца этого года",
2065
2071
  group: "other",
2066
2072
  section: "tillEnd",
2067
2073
  from: n,
2068
- to: Ee(e)
2074
+ to: De(e)
2069
2075
  },
2070
2076
  lastWeekTillSameWeekDay: {
2071
2077
  label: "Прошлая неделя, до такого же дня недели",
2072
2078
  group: "other",
2073
2079
  section: "lastTillSame",
2074
- ...Z.weekTillSameWeekday(e, -1)
2080
+ ...Y.weekTillSameWeekday(e, -1)
2075
2081
  },
2076
2082
  lastTenDaysTillSameDayNumber: {
2077
2083
  label: "Прошлая декада, до такого же номера дня",
2078
2084
  group: "other",
2079
2085
  section: "lastTillSame",
2080
- ...Z.decadeTillSameDayNumber(e, -1)
2086
+ ...Y.decadeTillSameDayNumber(e, -1)
2081
2087
  },
2082
2088
  lastMonthTillSameDate: {
2083
2089
  label: "Прошлый месяц, до такой же даты",
2084
2090
  group: "other",
2085
2091
  section: "lastTillSame",
2086
- ...Z.intervalTillSameDate(a, T(Ie(e, 1)), e)
2092
+ ...Y.intervalTillSameDate(a, w(Le(e, 1)), e)
2087
2093
  },
2088
2094
  lastQuarterTillSameDate: {
2089
2095
  label: "Прошлый квартал, до такой же даты",
2090
2096
  group: "other",
2091
2097
  section: "lastTillSame",
2092
- ...Z.intervalTillSameDate(o, je(Le(e, 1)), e)
2098
+ ...Y.intervalTillSameDate(o, Me(Re(e, 1)), e)
2093
2099
  },
2094
2100
  lastHalfYearTillSameDate: {
2095
2101
  label: "Прошлое полугодие, до такой же даты",
2096
2102
  group: "other",
2097
2103
  section: "lastTillSame",
2098
- ...Z.intervalTillSameDate(s, Z.startOfHalfYear(ee), e)
2104
+ ...Y.intervalTillSameDate(s, Y.startOfHalfYear(ee), e)
2099
2105
  },
2100
2106
  lastYearTillSameDate: {
2101
2107
  label: "Прошлый год, до такой же даты",
2102
2108
  group: "other",
2103
2109
  section: "lastTillSame",
2104
- ...Z.intervalTillSameDate(c, D(ze(e, 1)), e)
2110
+ ...Y.intervalTillSameDate(c, E(Be(e, 1)), e)
2105
2111
  },
2106
2112
  nextWeekTillSameWeekDay: {
2107
2113
  label: "Следующая неделя, до такого же дня недели",
2108
2114
  group: "other",
2109
2115
  section: "nextTillSame",
2110
- ...Z.weekTillSameWeekday(e, 1)
2116
+ ...Y.weekTillSameWeekday(e, 1)
2111
2117
  },
2112
2118
  nextTenDaysTillSameDayNumber: {
2113
2119
  label: "Следующая декада, до такого же номера дня",
2114
2120
  group: "other",
2115
2121
  section: "nextTillSame",
2116
- ...Z.decadeTillSameDayNumber(e, 1)
2122
+ ...Y.decadeTillSameDayNumber(e, 1)
2117
2123
  },
2118
2124
  nextMonthTillSameDate: {
2119
2125
  label: "Следующий месяц, до такой же даты",
2120
2126
  group: "other",
2121
2127
  section: "nextTillSame",
2122
- ...Z.intervalTillSameDate(a, T(v(e, 1)), e)
2128
+ ...Y.intervalTillSameDate(a, w(v(e, 1)), e)
2123
2129
  },
2124
2130
  nextQuarterTillSameDate: {
2125
2131
  label: "Следующий квартал, до такой же даты",
2126
2132
  group: "other",
2127
2133
  section: "nextTillSame",
2128
- ...Z.intervalTillSameDate(o, je(ve(e, 1)), e)
2134
+ ...Y.intervalTillSameDate(o, Me(ve(e, 1)), e)
2129
2135
  },
2130
2136
  nextHalfYearTillSameDate: {
2131
2137
  label: "Следующее полугодие, до такой же даты",
2132
2138
  group: "other",
2133
2139
  section: "nextTillSame",
2134
- ...Z.intervalTillSameDate(s, Z.startOfHalfYear(l), e)
2140
+ ...Y.intervalTillSameDate(s, Y.startOfHalfYear(l), e)
2135
2141
  },
2136
2142
  nextYearTillSameDate: {
2137
2143
  label: "Следующий год, до такой же даты",
2138
2144
  group: "other",
2139
2145
  section: "nextTillSame",
2140
- ...Z.intervalTillSameDate(c, D(be(e, 1)), e)
2146
+ ...Y.intervalTillSameDate(c, E(be(e, 1)), e)
2141
2147
  },
2142
2148
  last7Days: {
2143
2149
  label: "Последние 7 дней",
2144
2150
  group: "other",
2145
2151
  section: "rollingDays",
2146
- from: w(Fe(e, 6)),
2152
+ from: C(Ie(e, 6)),
2147
2153
  to: r
2148
2154
  },
2149
2155
  next7Days: {
@@ -2155,7 +2161,7 @@ var An = class {
2155
2161
  }
2156
2162
  };
2157
2163
  }
2158
- }, jn = [
2164
+ }, Pn = [
2159
2165
  {
2160
2166
  key: "day",
2161
2167
  label: "День"
@@ -2188,7 +2194,7 @@ var An = class {
2188
2194
  key: "other",
2189
2195
  label: "Прочее"
2190
2196
  }
2191
- ], Mn = [
2197
+ ], Fn = [
2192
2198
  {
2193
2199
  key: "fromBeginning",
2194
2200
  label: "С начала периода"
@@ -2209,13 +2215,7 @@ var An = class {
2209
2215
  key: "rollingDays",
2210
2216
  label: "7 дней"
2211
2217
  }
2212
- ], Nn = class extends d {
2213
- city;
2214
- isActive;
2215
- constructor(e) {
2216
- super(e), this.city = e?.city ? new t(e.city) : void 0, this.isActive = e?.isActive ?? !1;
2217
- }
2218
- }, Pn = class {
2218
+ ], In = class extends hn {}, Ln = class {
2219
2219
  salesDirections;
2220
2220
  partnerGroups;
2221
2221
  managers;
@@ -2226,10 +2226,10 @@ var An = class {
2226
2226
  lastLoginDate;
2227
2227
  lastOrderDate;
2228
2228
  constructor(e) {
2229
- this.salesDirections = j(e?.salesDirections ?? [], (e) => new m(e)), this.partnerGroups = j(e?.partnerGroups ?? [], (e) => new p(e)), this.managers = j(e?.managers ?? [], (e) => new I(e)), this.additionalClients = j(e?.additionalClients ?? [], (e) => new Nn(e)), this.fixedClients = j(e?.fixedClients ?? [], (e) => new Nn(e)), this.regions = j(e?.regions ?? [], (e) => new ue(e)), this.cities = j(e?.cities ?? [], (e) => new t(e)), this.lastLoginDate = new P(e?.lastLoginDate), this.lastOrderDate = new P(e?.lastOrderDate);
2229
+ this.salesDirections = k(e?.salesDirections ?? [], (e) => new m(e)), this.partnerGroups = k(e?.partnerGroups ?? [], (e) => new p(e)), this.managers = k(e?.managers ?? [], (e) => new P(e)), this.additionalClients = k(e?.additionalClients ?? [], (e) => new In(e)), this.fixedClients = k(e?.fixedClients ?? [], (e) => new In(e)), this.regions = k(e?.regions ?? [], (e) => new ue(e)), this.cities = k(e?.cities ?? [], (e) => new t(e)), this.lastLoginDate = new M(e?.lastLoginDate), this.lastOrderDate = new M(e?.lastOrderDate);
2230
2230
  }
2231
2231
  hasClientConditions() {
2232
- return $e([
2232
+ return tt([
2233
2233
  this.salesDirections,
2234
2234
  this.partnerGroups,
2235
2235
  this.managers,
@@ -2237,33 +2237,33 @@ var An = class {
2237
2237
  this.fixedClients,
2238
2238
  this.regions,
2239
2239
  this.cities
2240
- ], (e) => !Ge(e)) || $e([this.lastLoginDate, this.lastOrderDate], (e) => !!e.from || !!e.to);
2240
+ ], (e) => !qe(e)) || tt([this.lastLoginDate, this.lastOrderDate], (e) => !!e.from || !!e.to);
2241
2241
  }
2242
2242
  setPeriod(e, t) {
2243
- return this[e] = new P({
2244
- from: t?.from ? w(t.from) : null,
2243
+ return this[e] = new M({
2244
+ from: t?.from ? C(t.from) : null,
2245
2245
  to: t?.to ? y(t.to) : null
2246
2246
  }), this;
2247
2247
  }
2248
2248
  toSaveData() {
2249
2249
  return {
2250
- salesDirections: j(this.salesDirections, "id"),
2251
- partnerGroups: j(this.partnerGroups, "id"),
2252
- managers: j(this.managers, "id"),
2253
- additionalClients: j(this.additionalClients, "id"),
2254
- regions: j(this.regions, "id"),
2255
- cities: j(this.cities, "id"),
2256
- lastLoginDate: new P(this.lastLoginDate),
2257
- lastOrderDate: new P(this.lastOrderDate)
2250
+ salesDirections: k(this.salesDirections, "id"),
2251
+ partnerGroups: k(this.partnerGroups, "id"),
2252
+ managers: k(this.managers, "id"),
2253
+ additionalClients: k(this.additionalClients, "id"),
2254
+ regions: k(this.regions, "id"),
2255
+ cities: k(this.cities, "id"),
2256
+ lastLoginDate: new M(this.lastLoginDate),
2257
+ lastOrderDate: new M(this.lastOrderDate)
2258
2258
  };
2259
2259
  }
2260
- }, Fn = /* @__PURE__ */ function(e) {
2260
+ }, Rn = /* @__PURE__ */ function(e) {
2261
2261
  return e.Active = "active", e.Scheduled = "scheduled", e.Completed = "completed", e;
2262
- }({}), In = class {
2262
+ }({}), zn = class {
2263
2263
  static resolve(e, t = /* @__PURE__ */ new Date()) {
2264
- return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ? Fn.Completed : e.publishedAt && e.publishedAt.getTime() > t.getTime() ? Fn.Scheduled : Fn.Active;
2264
+ return e.deletedAt && e.deletedAt.getTime() <= t.getTime() ? Rn.Completed : e.publishedAt && e.publishedAt.getTime() > t.getTime() ? Rn.Scheduled : Rn.Active;
2265
2265
  }
2266
- }, Ln = class extends pt {
2266
+ }, Bn = class extends ht {
2267
2267
  conditions;
2268
2268
  products;
2269
2269
  productCategories;
@@ -2272,10 +2272,10 @@ var An = class {
2272
2272
  countDiscountedProducts;
2273
2273
  countDiscountedClients;
2274
2274
  constructor(e) {
2275
- super(e), this.conditions = new Pn(e?.conditions), this.products = j(e?.products ?? [], (e) => new z(e)), this.productCategories = j(e?.productCategories ?? [], (e) => new U(e)), this.countDiscountedPrices = e?.countDiscountedPrices ?? 0, this.expectedCountDiscountedPrices = e?.expectedCountDiscountedPrices ?? 0, this.countDiscountedProducts = e?.countDiscountedProducts ?? 0, this.countDiscountedClients = e?.countDiscountedClients ?? 0;
2275
+ super(e), this.conditions = new Ln(e?.conditions), this.products = k(e?.products ?? [], (e) => new L(e)), this.productCategories = k(e?.productCategories ?? [], (e) => new V(e)), this.countDiscountedPrices = e?.countDiscountedPrices ?? 0, this.expectedCountDiscountedPrices = e?.expectedCountDiscountedPrices ?? 0, this.countDiscountedProducts = e?.countDiscountedProducts ?? 0, this.countDiscountedClients = e?.countDiscountedClients ?? 0;
2276
2276
  }
2277
2277
  getState(e = /* @__PURE__ */ new Date()) {
2278
- return In.resolve(this, e);
2278
+ return zn.resolve(this, e);
2279
2279
  }
2280
2280
  assignCounters(e) {
2281
2281
  this.countDiscountedPrices = e.countDiscountedPrices, this.expectedCountDiscountedPrices = e.expectedCountDiscountedPrices, this.countDiscountedProducts = e.countDiscountedProducts, this.countDiscountedClients = e.countDiscountedClients;
@@ -2291,12 +2291,12 @@ var An = class {
2291
2291
  publishedAt: this.publishedAt ?? null,
2292
2292
  deletedAt: this.deletedAt ?? null,
2293
2293
  description: this.description ?? "",
2294
- products: j(this.products, "id"),
2295
- productCategories: j(this.productCategories, "id"),
2294
+ products: k(this.products, "id"),
2295
+ productCategories: k(this.productCategories, "id"),
2296
2296
  conditions: this.conditions.toSaveData()
2297
2297
  };
2298
2298
  }
2299
- }, Rn = class {
2299
+ }, Vn = class {
2300
2300
  client;
2301
2301
  additionalClientsCondition;
2302
2302
  fixedClientsCondition;
@@ -2306,12 +2306,12 @@ var An = class {
2306
2306
  regionsCondition;
2307
2307
  salesDirectionsCondition;
2308
2308
  constructor(e) {
2309
- this.client = new Nn(e?.client), this.additionalClientsCondition = e?.additionalClientsCondition ?? !1, this.fixedClientsCondition = e?.fixedClientsCondition ?? !1, this.partnerGroupsCondition = e?.partnerGroupsCondition ?? !1, this.managersCondition = e?.managersCondition ?? !1, this.citiesCondition = e?.citiesCondition ?? !1, this.regionsCondition = e?.regionsCondition ?? !1, this.salesDirectionsCondition = e?.salesDirectionsCondition ?? !1;
2309
+ this.client = new In(e?.client), this.additionalClientsCondition = e?.additionalClientsCondition ?? !1, this.fixedClientsCondition = e?.fixedClientsCondition ?? !1, this.partnerGroupsCondition = e?.partnerGroupsCondition ?? !1, this.managersCondition = e?.managersCondition ?? !1, this.citiesCondition = e?.citiesCondition ?? !1, this.regionsCondition = e?.regionsCondition ?? !1, this.salesDirectionsCondition = e?.salesDirectionsCondition ?? !1;
2310
2310
  }
2311
2311
  isEligible() {
2312
2312
  return this.additionalClientsCondition || this.fixedClientsCondition || this.partnerGroupsCondition || this.managersCondition || this.citiesCondition || this.regionsCondition || this.salesDirectionsCondition;
2313
2313
  }
2314
- }, zn = class extends N {
2314
+ }, Hn = class extends j {
2315
2315
  id;
2316
2316
  name;
2317
2317
  states;
@@ -2326,7 +2326,7 @@ var An = class {
2326
2326
  }
2327
2327
  return this;
2328
2328
  }
2329
- }, Bn = class e extends F {
2329
+ }, Un = class e extends N {
2330
2330
  static prepareSaveData(e, t) {
2331
2331
  return {
2332
2332
  ...e,
@@ -2341,68 +2341,68 @@ var An = class {
2341
2341
  };
2342
2342
  }
2343
2343
  getDiscountsList(e, t, n, r) {
2344
- return this.getTypedPaginated(pt, "/internal/price/discounts", e, t, n, {}, void 0, r);
2344
+ return this.getTypedPaginated(ht, "/internal/price/discounts", e, t, n, {}, void 0, r);
2345
2345
  }
2346
2346
  getDiscount(e) {
2347
- return this.get(`/internal/price/discounts/${e}`, {}, (e) => new Ln(e.data));
2347
+ return this.get(`/internal/price/discounts/${e}`, {}, (e) => new Bn(e.data));
2348
2348
  }
2349
2349
  createDiscount(t, n, r = {}) {
2350
- return this.post("/internal/price/discounts", e.prepareSaveData(t, n), (e) => new Ln(e.data), r);
2350
+ return this.post("/internal/price/discounts", e.prepareSaveData(t, n), (e) => new Bn(e.data), r);
2351
2351
  }
2352
2352
  updateDiscount(t, n, r, i = {}) {
2353
- return this.patch(`/internal/price/discounts/${t}`, e.prepareSaveData(n, r), (e) => new Ln(e.data), i);
2353
+ return this.patch(`/internal/price/discounts/${t}`, e.prepareSaveData(n, r), (e) => new Bn(e.data), i);
2354
2354
  }
2355
2355
  removeDiscount(e) {
2356
2356
  return this.delete(`/internal/price/discounts/${e}`);
2357
2357
  }
2358
2358
  getEligibleClients(e) {
2359
- return this.getTypedList(Rn, `/internal/price/discounts/${e}/clients`);
2359
+ return this.getTypedList(Vn, `/internal/price/discounts/${e}/clients`);
2360
2360
  }
2361
2361
  checkClient(e, t) {
2362
- return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new Rn(e.data));
2362
+ return this.get(`/internal/price/discounts/${e}/clients/${t}/check`, {}, (e) => new Vn(e.data));
2363
2363
  }
2364
- }, Vn = class extends d {
2364
+ }, Wn = class extends d {
2365
2365
  constructor(e) {
2366
2366
  super(e);
2367
2367
  }
2368
- }, Hn = class extends u {
2368
+ }, X = class extends u {
2369
2369
  question;
2370
2370
  answer;
2371
2371
  groups;
2372
2372
  constructor(e) {
2373
- super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = j(e?.groups ?? [], (e) => new Vn(e));
2373
+ super(e, -1), this.question = e?.question ?? "", this.answer = e?.answer ?? "", this.groups = k(e?.groups ?? [], (e) => new Wn(e));
2374
2374
  }
2375
2375
  toSaveData() {
2376
2376
  return {
2377
2377
  question: this.question,
2378
2378
  answer: this.answer,
2379
- groups: j(this.groups, "id")
2379
+ groups: k(this.groups, "id")
2380
2380
  };
2381
2381
  }
2382
- }, Un = class extends F {
2382
+ }, Gn = class extends N {
2383
2383
  getFaqList(e, t) {
2384
- return this.getTypedPaginated(Hn, "/internal/faq", void 0, void 0, t, k(e) ? {} : { group: e });
2384
+ return this.getTypedPaginated(X, "/internal/faq", void 0, void 0, t, D(e) ? {} : { group: e });
2385
2385
  }
2386
2386
  getFaq(e) {
2387
- return this.get(`/internal/faq/${e}`, {}, (e) => new Hn(e.data));
2387
+ return this.get(`/internal/faq/${e}`, {}, (e) => new X(e.data));
2388
2388
  }
2389
2389
  createFaq(e, t = {}) {
2390
- return this.post("/internal/faq", e, (e) => new Hn(e.data), t);
2390
+ return this.post("/internal/faq", e, (e) => new X(e.data), t);
2391
2391
  }
2392
2392
  updateFaq(e, t, n = {}) {
2393
- return this.patch(`/internal/faq/${e}`, t, (e) => new Hn(e.data), n);
2393
+ return this.patch(`/internal/faq/${e}`, t, (e) => new X(e.data), n);
2394
2394
  }
2395
2395
  removeFaq(e) {
2396
2396
  return this.delete(`/internal/faq/${e}`);
2397
2397
  }
2398
2398
  getGroupsList() {
2399
- return this.getTypedList(Vn, "/internal/faq/groups");
2399
+ return this.getTypedList(Wn, "/internal/faq/groups");
2400
2400
  }
2401
2401
  createGroup(e, t = {}) {
2402
- return this.post("/internal/faq/groups", e, (e) => new Vn(e.data), t);
2402
+ return this.post("/internal/faq/groups", e, (e) => new Wn(e.data), t);
2403
2403
  }
2404
2404
  updateGroup(e, t, n = {}) {
2405
- return this.patch(`/internal/faq/groups/${e}`, t, (e) => new Vn(e.data), n);
2405
+ return this.patch(`/internal/faq/groups/${e}`, t, (e) => new Wn(e.data), n);
2406
2406
  }
2407
2407
  removeGroup(e) {
2408
2408
  return this.delete(`/internal/faq/groups/${e}`);
@@ -2410,13 +2410,13 @@ var An = class {
2410
2410
  };
2411
2411
  //#endregion
2412
2412
  //#region src/helpers/format-percent-change.ts
2413
- function Wn(e) {
2414
- let t = Qe(e * 100);
2413
+ function Kn(e) {
2414
+ let t = et(e * 100);
2415
2415
  return `${t >= 0 ? "+" : ""}${t}%`;
2416
2416
  }
2417
2417
  //#endregion
2418
2418
  //#region src/helpers/units-helper.ts
2419
- var Gn = class e {
2419
+ var qn = class e {
2420
2420
  static productIsMeasurable(e) {
2421
2421
  return e.unit.isLinear || e.unit.isSquare;
2422
2422
  }
@@ -2426,7 +2426,7 @@ var Gn = class e {
2426
2426
  static getProductLengthMultiplicity(e) {
2427
2427
  return e.properties?.lengthStep == null ? !e.properties?.ignoreMinCountCheck && e.properties?.minCount != null ? e.properties.minCount : .01 : e.properties.lengthStep;
2428
2428
  }
2429
- }, Kn = class {
2429
+ }, Jn = class {
2430
2430
  static generateUndefinedManagerInstance() {
2431
2431
  return new te({
2432
2432
  id: 0,
@@ -2438,18 +2438,18 @@ var Gn = class e {
2438
2438
  static isUndefinedManagerInstance(e) {
2439
2439
  return e.id === 0 && e.guid === "-undefined-";
2440
2440
  }
2441
- }, qn = /* @__PURE__ */ function(e) {
2441
+ }, Yn = /* @__PURE__ */ function(e) {
2442
2442
  return e.Processing = "processing", e.Completed = "completed", e.Error = "error", e.NeedsActualization = "needs_actualization", e;
2443
- }({}), Jn = class {
2443
+ }({}), Xn = class {
2444
2444
  status;
2445
2445
  actualizedAt;
2446
2446
  expiresAt;
2447
2447
  error;
2448
2448
  constructor(e) {
2449
- this.status = e?.status ?? qn.Processing, this.actualizedAt = o.parse(e?.actualizedAt), this.expiresAt = o.parse(e?.expiresAt), this.error = e?.error;
2449
+ this.status = e?.status ?? Yn.Processing, this.actualizedAt = o.parse(e?.actualizedAt), this.expiresAt = o.parse(e?.expiresAt), this.error = e?.error;
2450
2450
  }
2451
2451
  get isProcessing() {
2452
- return this.status === qn.Processing;
2452
+ return this.status === Yn.Processing;
2453
2453
  }
2454
2454
  get isOutdated() {
2455
2455
  return this.isOutdatedAt(/* @__PURE__ */ new Date());
@@ -2458,12 +2458,12 @@ var Gn = class e {
2458
2458
  return this.isOrderAllowedAt(/* @__PURE__ */ new Date());
2459
2459
  }
2460
2460
  isOutdatedAt(e) {
2461
- return this.status !== qn.Completed || k(this.actualizedAt) ? !0 : !k(this.expiresAt) && this.expiresAt.getTime() < e.getTime();
2461
+ return this.status !== Yn.Completed || D(this.actualizedAt) ? !0 : !D(this.expiresAt) && this.expiresAt.getTime() < e.getTime();
2462
2462
  }
2463
2463
  isOrderAllowedAt(e) {
2464
- return this.status === qn.Completed && !this.isOutdatedAt(e);
2464
+ return this.status === Yn.Completed && !this.isOutdatedAt(e);
2465
2465
  }
2466
- }, Yn = class extends M {
2466
+ }, Zn = class extends A {
2467
2467
  name;
2468
2468
  client;
2469
2469
  sum;
@@ -2471,9 +2471,9 @@ var Gn = class e {
2471
2471
  actualization;
2472
2472
  file;
2473
2473
  constructor(e) {
2474
- super(e), this.name = e?.name, this.client = new W(e?.client), this.sum = e?.sum, this.isProfstroy = e?.isProfstroy, this.actualization = e?.actualization && new Jn(e.actualization), this.file = e?.file;
2474
+ super(e), this.name = e?.name, this.client = new H(e?.client), this.sum = e?.sum, this.isProfstroy = e?.isProfstroy, this.actualization = e?.actualization && new Xn(e.actualization), this.file = e?.file;
2475
2475
  }
2476
- }, Xn = class extends Ct {
2476
+ }, Qn = class extends Tt {
2477
2477
  groupName;
2478
2478
  supplierSku;
2479
2479
  isIgnored;
@@ -2482,24 +2482,24 @@ var Gn = class e {
2482
2482
  super(e), this.groupName = e.groupName, this.supplierSku = e.supplierSku ?? e.product.supplierSku, this.isIgnored = e.isIgnored, this.lineError = e.lineError;
2483
2483
  }
2484
2484
  get isProductStub() {
2485
- return k(this.product.id);
2485
+ return D(this.product.id);
2486
2486
  }
2487
2487
  get isOrderable() {
2488
- return !this.isProductStub && !this.isIgnored && Ge(this.lineError);
2488
+ return !this.isProductStub && !this.isIgnored && qe(this.lineError);
2489
2489
  }
2490
- }, Q = class extends Yn {
2490
+ }, Z = class extends Zn {
2491
2491
  sum;
2492
2492
  products;
2493
2493
  constructor(e) {
2494
- super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new Xn(t) : new Ct(t));
2494
+ super(e), this.sum = e.sum ?? 0, this.products = (e.products ?? []).map((t) => e.isProfstroy ? new Qn(t) : new Tt(t));
2495
2495
  }
2496
- }, Zn = class extends N {
2496
+ }, $n = class extends j {
2497
2497
  id;
2498
2498
  clientSearchTerm;
2499
2499
  name;
2500
- createdAt = new P();
2500
+ createdAt = new M();
2501
2501
  constructor(e) {
2502
- super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new P(e?.createdAt);
2502
+ super(), this.id = e?.id, this.clientSearchTerm = e?.clientSearchTerm, this.name = e?.name, this.createdAt = new M(e?.createdAt);
2503
2503
  }
2504
2504
  resetFilterValue(e) {
2505
2505
  return e === "createdAt" ? (this.createdAt.from = null, this.createdAt.to = null) : this[e] = void 0, this;
@@ -2508,7 +2508,7 @@ var Gn = class e {
2508
2508
  let e = super.asClearRaw();
2509
2509
  return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, e;
2510
2510
  }
2511
- }, Qn = class extends hn {
2511
+ }, er = class extends vn {
2512
2512
  client;
2513
2513
  payment;
2514
2514
  delivery;
@@ -2523,20 +2523,20 @@ var Gn = class e {
2523
2523
  sum;
2524
2524
  isLargeOrder;
2525
2525
  constructor(e) {
2526
- super(e), this.client = new W(e?.client), this.payment = {
2526
+ super(e), this.client = new H(e?.client), this.payment = {
2527
2527
  type: e?.payment?.type ?? -1,
2528
2528
  status: e?.payment?.status ?? -1,
2529
2529
  onlinePaymentLink: e?.payment?.onlinePaymentLink
2530
2530
  }, this.delivery = {
2531
2531
  type: e?.delivery?.type ?? -1,
2532
- date: A(e?.delivery?.date) ? C(e.delivery.date) : e?.delivery?.date ?? /* @__PURE__ */ new Date(),
2533
- address: e?.delivery?.address ? new X(e.delivery.address) : void 0,
2532
+ date: O(e?.delivery?.date) ? S(e.delivery.date) : e?.delivery?.date ?? /* @__PURE__ */ new Date(),
2533
+ address: e?.delivery?.address ? new J(e.delivery.address) : void 0,
2534
2534
  warehouse: e?.delivery?.warehouse ? new ge(e.delivery.warehouse) : void 0
2535
- }, this.attachedUser = e?.attachedUser ? new I(e?.attachedUser) : void 0, this.status = new ae(e?.status), this.statusDetail = e?.statusDetail ? new le(e.statusDetail) : void 0, this.salesDirection = new m(e?.salesDirection);
2535
+ }, this.attachedUser = e?.attachedUser ? new P(e?.attachedUser) : void 0, this.status = new ae(e?.status), this.statusDetail = e?.statusDetail ? new le(e.statusDetail) : void 0, this.salesDirection = new m(e?.salesDirection);
2536
2536
  let t = e?.attachedAt;
2537
- this.attachedAt = A(t) ? C(t) : e?.attachedAt, this.isOnOrder = e?.isOnOrder ?? !1, this.isProfstroy = e?.isProfstroy ?? !1, this.isNotInStock = e?.isNotInStock ?? !1, this.sum = e?.sum ?? 0, this.isLargeOrder = e?.isLargeOrder ?? !1;
2537
+ this.attachedAt = O(t) ? S(t) : e?.attachedAt, this.isOnOrder = e?.isOnOrder ?? !1, this.isProfstroy = e?.isProfstroy ?? !1, this.isNotInStock = e?.isNotInStock ?? !1, this.sum = e?.sum ?? 0, this.isLargeOrder = e?.isLargeOrder ?? !1;
2538
2538
  }
2539
- }, $n = class extends St {
2539
+ }, tr = class extends wt {
2540
2540
  product;
2541
2541
  cost;
2542
2542
  costOne;
@@ -2550,9 +2550,9 @@ var Gn = class e {
2550
2550
  changedFields = [];
2551
2551
  replacement;
2552
2552
  constructor(e, t) {
2553
- super(e), this.product = new B(e.product), this.currency = new a(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = O(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
2553
+ super(e), this.product = new R(e.product), this.currency = new a(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = Ge(e.sawing) ? e.sawing : e.sawing ? [e.sawing] : void 0, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
2554
2554
  }
2555
- }, $ = class extends Qn {
2555
+ }, Q = class extends er {
2556
2556
  products;
2557
2557
  invoices;
2558
2558
  comment;
@@ -2568,35 +2568,35 @@ var Gn = class e {
2568
2568
  erpOrderUrl;
2569
2569
  numberDoc;
2570
2570
  constructor(e) {
2571
- super(e), this.products = (e.products ?? []).map((t) => new $n(t, t.replacementId ? e.products?.find((e) => e.id === t.replacementId) : void 0)), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? fn.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new le(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = e.nextStatuses?.map((e) => new ae(e)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment, this.erpOrderUrl = e.erpOrderUrl, this.numberDoc = e.numberDoc;
2571
+ super(e), this.products = (e.products ?? []).map((t) => new tr(t, t.replacementId ? e.products?.find((e) => e.id === t.replacementId) : void 0)), this.invoices = e.invoices ?? [], this.comment = e.comment, this.image = e.image, this.contragent = e.contragent ? mn.createInstance(e.contragent) : void 0, this.barcode = e.barcode, this.orderSource = e.orderSource ? new le(e.orderSource) : void 0, this.isAllowProcessingWithoutPayment = e.isAllowProcessingWithoutPayment, this.nextStatuses = e.nextStatuses?.map((e) => new ae(e)), this.actions = e.actions, this.operatorsComment = e.operatorsComment, this.operatorsForWarehouseComment = e.operatorsForWarehouseComment, this.erpOrderUrl = e.erpOrderUrl, this.numberDoc = e.numberDoc;
2572
2572
  }
2573
- }, er = class extends F {
2573
+ }, nr = class extends N {
2574
2574
  getOffers(e, t, n, r) {
2575
- return this.getTypedPaginated(Yn, "/internal/orders/offers", e, t, n, {}, void 0, r);
2575
+ return this.getTypedPaginated(Zn, "/internal/orders/offers", e, t, n, {}, void 0, r);
2576
2576
  }
2577
2577
  createOfferFromCart(e, t, n) {
2578
2578
  return this.post(`/internal/orders/offers/${e}`, {
2579
2579
  name: t,
2580
2580
  items: n?.length ? n : void 0
2581
- }, (e) => new Q(e.data));
2581
+ }, (e) => new Z(e.data));
2582
2582
  }
2583
2583
  createProfstroyOffer(e, t, n, r = {}) {
2584
2584
  return this.post(`/internal/orders/offers/${e}/profstroy`, {
2585
2585
  file: t,
2586
2586
  name: n
2587
- }, (e) => new Q(e.data), r);
2587
+ }, (e) => new Z(e.data), r);
2588
2588
  }
2589
2589
  actualizeProfstroyOffer(e) {
2590
- return this.post(`/internal/orders/offers/${e}/profstroy/actualize`, {}, (e) => new Q(e.data));
2590
+ return this.post(`/internal/orders/offers/${e}/profstroy/actualize`, {}, (e) => new Z(e.data));
2591
2591
  }
2592
2592
  reloadProfstroyOffer(e) {
2593
- return this.post(`/internal/orders/offers/${e}/profstroy/reload`, {}, (e) => new Q(e.data));
2593
+ return this.post(`/internal/orders/offers/${e}/profstroy/reload`, {}, (e) => new Z(e.data));
2594
2594
  }
2595
2595
  getOffer(e) {
2596
- return this.get(`/internal/orders/offers/${e}`, {}, (e) => new Q(e.data));
2596
+ return this.get(`/internal/orders/offers/${e}`, {}, (e) => new Z(e.data));
2597
2597
  }
2598
2598
  updateOffer(e, t) {
2599
- return this.patch(`/internal/orders/offers/${e}`, { name: t }, (e) => new Q(e.data));
2599
+ return this.patch(`/internal/orders/offers/${e}`, { name: t }, (e) => new Z(e.data));
2600
2600
  }
2601
2601
  deleteOffer(e) {
2602
2602
  return this.delete(`/internal/orders/offers/${e}`);
@@ -2605,9 +2605,9 @@ var Gn = class e {
2605
2605
  let i = g().config.dateFormats.api;
2606
2606
  return this.post(`/internal/orders/offers/${e}/create-order`, {
2607
2607
  ...t,
2608
- deliveryDate: t.deliveryDate ? S(t.deliveryDate, i) : void 0,
2608
+ deliveryDate: t.deliveryDate ? x(t.deliveryDate, i) : void 0,
2609
2609
  items: n?.length ? n : void 0
2610
- }, (e) => h.instanceListInitializer($, e.data), r);
2610
+ }, (e) => h.instanceListInitializer(Q, e.data), r);
2611
2611
  }
2612
2612
  addOfferProduct(e, t, n = {}) {
2613
2613
  return this.post(`/internal/orders/offers/${e}/products`, {
@@ -2621,7 +2621,7 @@ var Gn = class e {
2621
2621
  marker: t.marker,
2622
2622
  is_additional_sale: t.isAdditionalSale,
2623
2623
  ...t.configuratorParams
2624
- }, (e) => new Q(e.data), n);
2624
+ }, (e) => new Z(e.data), n);
2625
2625
  }
2626
2626
  patchOfferProduct(e, t, n, r = {}) {
2627
2627
  return this.patch(`/internal/orders/offers/${e}/products/${t}`, {
@@ -2635,10 +2635,10 @@ var Gn = class e {
2635
2635
  marker: n.marker,
2636
2636
  is_additional_sale: n.isAdditionalSale,
2637
2637
  ...n.configuratorParams
2638
- }, (e) => new Q(e.data), r);
2638
+ }, (e) => new Z(e.data), r);
2639
2639
  }
2640
2640
  deleteOfferProduct(e, t) {
2641
- return this.delete(`/internal/orders/offers/${e}/products/${t}`, (e) => new Q(e.data));
2641
+ return this.delete(`/internal/orders/offers/${e}/products/${t}`, (e) => new Z(e.data));
2642
2642
  }
2643
2643
  getOfferHtml(e, t) {
2644
2644
  return this.get(`/internal/orders/offers/${e}/view`, t ? { recipientText: t } : {}, (e) => new Blob([e.data], { type: "text/html" }));
@@ -2649,16 +2649,16 @@ var Gn = class e {
2649
2649
  sendOffer(e, t) {
2650
2650
  return this.post(`/internal/orders/offers/${e}/send`, t);
2651
2651
  }
2652
- }, tr = class {
2652
+ }, rr = class {
2653
2653
  static isProfstroy(e) {
2654
2654
  return !!e?.isProfstroy;
2655
2655
  }
2656
2656
  static isProfstroyOffer(e) {
2657
- return !k(e) && e.isProfstroy === !0 && !k(e.actualization);
2657
+ return !D(e) && e.isProfstroy === !0 && !D(e.actualization);
2658
2658
  }
2659
- }, nr = /* @__PURE__ */ function(e) {
2659
+ }, ir = /* @__PURE__ */ function(e) {
2660
2660
  return e.View = "view", e.Share = "share", e.EditTags = "edit_tags", e.SaveOrderIgnoredProducts = "save_order_ignored_products", e.ChangeStatus = "change_status", e.ChangeProducts = "change_products", e.ChangeOrderParameters = "change_order_parameters", e.Recalculate = "recalculate", e.AttachOrder = "attach_order", e.DetachOrder = "detach_order", e.ChangeAttachedOperator = "change_attached_operator", e.SendOnlinePaymentLink = "send_online_payment_link", e.ConfirmOnlineFullPayment = "confirm_online_full_payment", e.MergeOrders = "merge_orders", e.GetHistory = "get_history", e.CloneOrder = "clone_order", e.DeleteAttachedFile = "delete_attached_file", e;
2661
- }({}), rr = class {
2661
+ }({}), ar = class {
2662
2662
  paymentType;
2663
2663
  deliveryType;
2664
2664
  contragentId;
@@ -2676,21 +2676,21 @@ var Gn = class e {
2676
2676
  constructor(e) {
2677
2677
  this.paymentType = e?.payment.type, this.deliveryType = e?.delivery.type, this.contragentId = e?.contragent?.id, this.deliveryDate = e?.delivery.date ? new Date(e.delivery.date) : void 0, this.addressId = e?.delivery.address?.id, this.warehouseId = e?.delivery.warehouse?.id, this.comment = e?.comment, this.barcode = e?.barcode, this.operatorsComment = e?.operatorsComment, this.operatorsForWarehouseComment = e?.operatorsForWarehouseComment, this.isAllowProcessingWithoutPayment = e?.isAllowProcessingWithoutPayment;
2678
2678
  }
2679
- }, ir = class extends N {
2679
+ }, or = class extends j {
2680
2680
  attachedUsers;
2681
2681
  clientSearchTerm;
2682
2682
  client;
2683
2683
  contragent;
2684
- createdAt = new P();
2684
+ createdAt = new M();
2685
2685
  creator;
2686
- deliveryDate = new P();
2686
+ deliveryDate = new M();
2687
2687
  deliveryAddressSearch;
2688
2688
  clientCities;
2689
2689
  id;
2690
2690
  isApproved;
2691
2691
  isNotInStock;
2692
2692
  isOnOrder;
2693
- attachedAt = new P();
2693
+ attachedAt = new M();
2694
2694
  salesDirections;
2695
2695
  status;
2696
2696
  statusDetail;
@@ -2701,7 +2701,7 @@ var Gn = class e {
2701
2701
  isToProcess;
2702
2702
  onlyMyRegions;
2703
2703
  constructor(e) {
2704
- super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new te(e) : new re(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new W(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new P(e?.createdAt), this.creator = e?.creator ? new I(e.creator) : void 0, this.deliveryDate = new P(e?.deliveryDate), this.deliveryAddressSearch = e?.deliveryAddressSearch, this.clientCities = e?.clientCities?.map((e) => new t(e)), this.id = e?.id, this.isApproved = e?.isApproved, this.isNotInStock = e?.isNotInStock, this.isOnOrder = e?.isOnOrder, this.isLargeOrder = e?.isLargeOrder, this.attachedAt = new P(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new m(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new s(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new oe(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new ge(e)), this.isToProcess = e?.isToProcess;
2704
+ super(), this.attachedUsers = e?.attachedUsers?.map((e) => "isActive" in e ? new te(e) : new re(e)), this.clientSearchTerm = e?.clientSearchTerm, this.client = e?.client ? new H(e.client) : void 0, this.contragent = e?.contragent, this.createdAt = new M(e?.createdAt), this.creator = e?.creator ? new P(e.creator) : void 0, this.deliveryDate = new M(e?.deliveryDate), this.deliveryAddressSearch = e?.deliveryAddressSearch, this.clientCities = e?.clientCities?.map((e) => new t(e)), this.id = e?.id, this.isApproved = e?.isApproved, this.isNotInStock = e?.isNotInStock, this.isOnOrder = e?.isOnOrder, this.isLargeOrder = e?.isLargeOrder, this.attachedAt = new M(e?.attachedAt), this.salesDirections = e?.salesDirections?.map((e) => new m(e)), this.status = e?.status, this.statusDetail = e?.statusDetail, this.deliveryType = e?.deliveryType ? new s(e.deliveryType) : void 0, this.paymentType = e?.paymentType ? new oe(e.paymentType) : void 0, this.warehouses = e?.warehouses?.map((e) => new ge(e)), this.isToProcess = e?.isToProcess;
2705
2705
  }
2706
2706
  resetFilterValue(e) {
2707
2707
  switch (e) {
@@ -2742,48 +2742,48 @@ var Gn = class e {
2742
2742
  let e = super.asClearRaw();
2743
2743
  return !e?.createdAt?.from && !e?.createdAt?.to && delete e.createdAt, !e?.deliveryDate?.from && !e?.deliveryDate?.to && delete e.deliveryDate, !e?.attachedAt?.from && !e?.attachedAt?.to && delete e.attachedAt, e;
2744
2744
  }
2745
- }, ar = class {
2745
+ }, sr = class {
2746
2746
  user;
2747
2747
  status;
2748
2748
  statusDetail;
2749
2749
  createdAt;
2750
2750
  constructor(e) {
2751
- this.user = new I(e?.user), this.status = new ae(e?.status), this.statusDetail = e?.statusDetail ? new le(e.statusDetail) : void 0;
2751
+ this.user = new P(e?.user), this.status = new ae(e?.status), this.statusDetail = e?.statusDetail ? new le(e.statusDetail) : void 0;
2752
2752
  let t = e?.createdAt;
2753
- this.createdAt = A(t) ? C(t) : e?.createdAt ?? /* @__PURE__ */ new Date();
2753
+ this.createdAt = O(t) ? S(t) : e?.createdAt ?? /* @__PURE__ */ new Date();
2754
2754
  }
2755
- }, or = class extends F {
2755
+ }, cr = class extends N {
2756
2756
  getOrders(e, t, n, r) {
2757
- return this.getTypedPaginated(Qn, "/internal/orders", e, t, n, {}, void 0, r);
2757
+ return this.getTypedPaginated(er, "/internal/orders", e, t, n, {}, void 0, r);
2758
2758
  }
2759
2759
  getOrdersCount(e, t) {
2760
- return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof ut ? e : new ut(e)).toPrimitive()) } : {}, void 0, void 0, t).then((e) => e.count);
2760
+ return this.get("/internal/orders/count", e ? { filters: JSON.stringify((e instanceof ft ? e : new ft(e)).toPrimitive()) } : {}, void 0, void 0, t).then((e) => e.count);
2761
2761
  }
2762
2762
  getClientOrderStatistics(e, t) {
2763
2763
  return this.get(`/internal/clients/${e}/orders/statistics`, t ? { period: t } : {});
2764
2764
  }
2765
2765
  getOrder(e) {
2766
- return this.get(`/internal/orders/${e}`, {}, (e) => new $(e.data));
2766
+ return this.get(`/internal/orders/${e}`, {}, (e) => new Q(e.data));
2767
2767
  }
2768
2768
  createClientOrder(e, t, n, r = {}) {
2769
2769
  let i = g().config.dateFormats.api;
2770
2770
  return this.post(`/internal/clients/${e}/orders`, {
2771
2771
  ...t,
2772
- deliveryDate: S(t.deliveryDate, i),
2772
+ deliveryDate: x(t.deliveryDate, i),
2773
2773
  items: n?.length ? n : void 0
2774
- }, (e) => h.instanceListInitializer($, e.data), r);
2774
+ }, (e) => h.instanceListInitializer(Q, e.data), r);
2775
2775
  }
2776
2776
  attachOrder(e) {
2777
- return this.patch(`/internal/orders/${e}/attach`, {}, (e) => new $(e.data));
2777
+ return this.patch(`/internal/orders/${e}/attach`, {}, (e) => new Q(e.data));
2778
2778
  }
2779
2779
  detachOrder(e) {
2780
- return this.patch(`/internal/orders/${e}/detach`, {}, (e) => new $(e.data));
2780
+ return this.patch(`/internal/orders/${e}/detach`, {}, (e) => new Q(e.data));
2781
2781
  }
2782
2782
  mergeOrders(e, t) {
2783
- return this.patch(`/internal/orders/${e}/merge`, { ids: t }, (e) => new $(e.data));
2783
+ return this.patch(`/internal/orders/${e}/merge`, { ids: t }, (e) => new Q(e.data));
2784
2784
  }
2785
2785
  recalculateOrder(e) {
2786
- return this.patch(`/internal/orders/${e}/recalculate`, {}, (e) => new $(e.data));
2786
+ return this.patch(`/internal/orders/${e}/recalculate`, {}, (e) => new Q(e.data));
2787
2787
  }
2788
2788
  cloneOrder(e) {
2789
2789
  return this.get(`/internal/orders/${e}/clone`, {});
@@ -2792,8 +2792,8 @@ var Gn = class e {
2792
2792
  let r = g().config.dateFormats.api;
2793
2793
  return this.patch(`/internal/orders/${e}`, {
2794
2794
  ...t,
2795
- deliveryDate: t.deliveryDate ? S(t.deliveryDate, r) : void 0
2796
- }, (e) => new $(e.data), n);
2795
+ deliveryDate: t.deliveryDate ? x(t.deliveryDate, r) : void 0
2796
+ }, (e) => new Q(e.data), n);
2797
2797
  }
2798
2798
  addOrderProduct(e, t, n = {}) {
2799
2799
  return this.post(`/internal/orders/${e}/products`, {
@@ -2807,19 +2807,19 @@ var Gn = class e {
2807
2807
  marker: t.marker,
2808
2808
  is_additional_sale: t.isAdditionalSale,
2809
2809
  ...t.configuratorParams
2810
- }, (e) => new $(e.data), n);
2810
+ }, (e) => new Q(e.data), n);
2811
2811
  }
2812
2812
  changeOrderStatus(e, t, n, r = {}) {
2813
2813
  return this.patch(`/internal/orders/${e}/status`, {
2814
2814
  status: t,
2815
2815
  statusDetail: n
2816
- }, (e) => new $(e.data), r);
2816
+ }, (e) => new Q(e.data), r);
2817
2817
  }
2818
2818
  changeOrderStatusDetail(e, t) {
2819
- return this.patch(`/internal/orders/${e}/status`, { statusDetail: t }, (e) => new $(e.data));
2819
+ return this.patch(`/internal/orders/${e}/status`, { statusDetail: t }, (e) => new Q(e.data));
2820
2820
  }
2821
2821
  getOrderStatusHistory(e) {
2822
- return this.getTypedList(ar, `/internal/orders/${e}/history`);
2822
+ return this.getTypedList(sr, `/internal/orders/${e}/history`);
2823
2823
  }
2824
2824
  getOrderPrintHtml(e, t) {
2825
2825
  return this.get(`/internal/orders/${e}/print/view`, { ...t }, (e) => new Blob([e.data], { type: "text/html" }));
@@ -2831,13 +2831,13 @@ var Gn = class e {
2831
2831
  return this.post(`/internal/orders/${e}/print/send`, t);
2832
2832
  }
2833
2833
  changeAttachedOperator(e, t) {
2834
- return this.patch(`/internal/orders/${e}/change-attached-operator`, { operatorId: t }, (e) => new $(e.data));
2834
+ return this.patch(`/internal/orders/${e}/change-attached-operator`, { operatorId: t }, (e) => new Q(e.data));
2835
2835
  }
2836
2836
  deleteOrderAttachedFile(e) {
2837
- return this.delete(`/internal/orders/${e}/file/attached`, (e) => new $(e.data));
2837
+ return this.delete(`/internal/orders/${e}/file/attached`, (e) => new Q(e.data));
2838
2838
  }
2839
2839
  deleteOrderProduct(e, t) {
2840
- return this.delete(`/internal/orders/${e}/products/${t}`, (e) => new $(e.data));
2840
+ return this.delete(`/internal/orders/${e}/products/${t}`, (e) => new Q(e.data));
2841
2841
  }
2842
2842
  patchOrderProduct(e, t, n, r = {}) {
2843
2843
  return this.patch(`/internal/orders/${e}/products/${t}`, {
@@ -2851,7 +2851,7 @@ var Gn = class e {
2851
2851
  marker: n.marker,
2852
2852
  is_additional_sale: n.isAdditionalSale,
2853
2853
  ...n.configuratorParams
2854
- }, (e) => new $(e.data), r);
2854
+ }, (e) => new Q(e.data), r);
2855
2855
  }
2856
2856
  getDeliveryNearestDates(e, t) {
2857
2857
  return this.get(`/internal/orders/delivery/${e}/nearest-dates`, {}, (e) => e.data, void 0, t);
@@ -2862,49 +2862,49 @@ var Gn = class e {
2862
2862
  getDeliveryCost(e, t, n, r) {
2863
2863
  let i = g().config.dateFormats.api;
2864
2864
  return this.get(`/internal/orders/delivery/${e}/cost`, {
2865
- date: S(t, i),
2865
+ date: x(t, i),
2866
2866
  warehouse_id: n
2867
2867
  }, (e) => e.data, void 0, r);
2868
2868
  }
2869
- }, sr = Symbol("currentOrder"), cr = class {
2869
+ }, lr = Symbol("currentOrder"), ur = class {
2870
2870
  client;
2871
2871
  product;
2872
2872
  cost;
2873
2873
  costCoefficient;
2874
2874
  source;
2875
2875
  constructor(e) {
2876
- this.client = new W(e?.client), this.product = new z(e?.product), this.cost = e?.cost ?? 0, this.costCoefficient = e?.costCoefficient ?? 0, this.source = e?.source ?? xt.Product;
2876
+ this.client = new H(e?.client), this.product = new L(e?.product), this.cost = e?.cost ?? 0, this.costCoefficient = e?.costCoefficient ?? 0, this.source = e?.source ?? Ct.Product;
2877
2877
  }
2878
- }, lr = (e) => e ? Ze({
2878
+ }, dr = (e) => e ? $e({
2879
2879
  cities: e.cities?.map((e) => e.id),
2880
2880
  clients: e.clients?.map((e) => e.id),
2881
2881
  managers: e.managers?.map((e) => e.id),
2882
2882
  partnerGroups: e.partnerGroups?.map((e) => e.id),
2883
2883
  salesDirections: e.salesDirections?.map((e) => e.id),
2884
2884
  hideNotActive: e.hideNotActive
2885
- }, (e) => k(e) || (O(e) || qe(e)) && Ge(e)) : {}, ur = (e) => {
2885
+ }, (e) => D(e) || (Ge(e) || Ye(e)) && qe(e)) : {}, fr = (e) => {
2886
2886
  let t = {};
2887
2887
  return e.from && (e.from.coefficient || e.from.value) && (t.from = {}, e.from.coefficient && (t.from.priceCoefficientId = e.from.coefficient.id), e.from.value && (t.from.increasePercent = e.from.value)), e.to && (e.to.coefficient || e.to.value) && (t.to = {}, e.to.coefficient && (t.to.priceCoefficientId = e.to.coefficient.id), e.to.value && (t.to.increasePercent = e.to.value)), t;
2888
- }, dr = class extends l {
2888
+ }, pr = class extends l {
2889
2889
  analyzeProductPrices(e, t, n) {
2890
2890
  return this.get(`/internal/price/products/${e}/analyze`, {
2891
- ...ur(t),
2892
- filters: lr(n)
2893
- }, (e) => h.instanceListInitializer(cr, e.data));
2891
+ ...fr(t),
2892
+ filters: dr(n)
2893
+ }, (e) => h.instanceListInitializer(ur, e.data));
2894
2894
  }
2895
2895
  analyzeCategoryPrices(e, t, n) {
2896
2896
  return this.get(`/internal/price/categories/${e}/analyze`, {
2897
- ...ur(t),
2898
- filters: lr(n)
2899
- }, (e) => h.instanceListInitializer(cr, e.data));
2897
+ ...fr(t),
2898
+ filters: dr(n)
2899
+ }, (e) => h.instanceListInitializer(ur, e.data));
2900
2900
  }
2901
2901
  analyzeCategoryPricesBySquare(e, t, n) {
2902
2902
  return this.get(`/internal/price/categories/${e}/analyze/square`, {
2903
2903
  ...t,
2904
- filters: lr(n)
2905
- }, (e) => h.instanceListInitializer(cr, e.data));
2904
+ filters: dr(n)
2905
+ }, (e) => h.instanceListInitializer(ur, e.data));
2906
2906
  }
2907
- }, fr = class {
2907
+ }, mr = class {
2908
2908
  cost;
2909
2909
  isLowCost;
2910
2910
  isRetail;
@@ -2916,33 +2916,147 @@ var Gn = class e {
2916
2916
  executor;
2917
2917
  currency;
2918
2918
  constructor(e) {
2919
- this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate = A(e.costDate) ? C(e.costDate) : e.costDate ?? /* @__PURE__ */ new Date(), this.discountName = e.discountName, this.priceTemplateName = e.priceTemplateName, this.product = e.product ? new R(e.product) : void 0, this.client = e.client ? new I(e.client) : void 0, this.executor = e.executor ? new I(e.executor) : void 0, this.currency = e.currency ? new a(e.currency) : void 0;
2919
+ this.cost = e.cost ?? 0, this.isLowCost = e.isLowCost ?? !1, this.isRetail = e.isRetail ?? !1, this.costDate = O(e.costDate) ? S(e.costDate) : e.costDate ?? /* @__PURE__ */ new Date(), this.discountName = e.discountName, this.priceTemplateName = e.priceTemplateName, this.product = e.product ? new I(e.product) : void 0, this.client = e.client ? new P(e.client) : void 0, this.executor = e.executor ? new P(e.executor) : void 0, this.currency = e.currency ? new a(e.currency) : void 0;
2920
2920
  }
2921
- }, pr = class extends R {
2921
+ }, hr = class extends I {
2922
2922
  history;
2923
2923
  constructor(e) {
2924
- super(e), this.history = j(e.history, (e) => new fr(e));
2924
+ super(e), this.history = k(e.history, (e) => new mr(e));
2925
2925
  }
2926
- }, mr = class extends l {
2926
+ }, gr = class extends l {
2927
2927
  getProductPriceHistory(e) {
2928
- let t = g().config.dateFormats.api, n = Ze(Xe(e, { costDate: {
2929
- from: We(e.costDate?.from) ? S(e.costDate.from, t) : e.costDate?.from,
2930
- to: We(e.costDate?.to) ? S(e.costDate.to, t) : e.costDate?.to
2931
- } }), (e) => k(e) || (O(e) || qe(e)) && Ge(e)), r = e.product?.[0] ?? 0;
2932
- return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new pr(Xe(e[0], { history: e }))]);
2928
+ let t = g().config.dateFormats.api, n = $e(Qe(e, { costDate: {
2929
+ from: Ke(e.costDate?.from) ? x(e.costDate.from, t) : e.costDate?.from,
2930
+ to: Ke(e.costDate?.to) ? x(e.costDate.to, t) : e.costDate?.to
2931
+ } }), (e) => D(e) || (Ge(e) || Ye(e)) && qe(e)), r = e.product?.[0] ?? 0;
2932
+ return delete n.product, this.get(`/internal/price/products/${r}/history`, n).then((e) => [new hr(Qe(e[0], { history: e }))]);
2933
+ }
2934
+ }, _r = class {
2935
+ createdAt;
2936
+ creator;
2937
+ files;
2938
+ text;
2939
+ status;
2940
+ constructor(e) {
2941
+ this.createdAt = o.parse(e?.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = D(e?.creator) ? void 0 : new P(e.creator), this.files = e?.files ?? [], this.text = e?.text ?? void 0, this.status = e?.status ?? void 0;
2942
+ }
2943
+ isStatusChanged() {
2944
+ return !D(this.status);
2945
+ }
2946
+ }, $ = /* @__PURE__ */ function(e) {
2947
+ return e[e.Initiated = 1] = "Initiated", e[e.InfoRequired = 2] = "InfoRequired", e[e.Pending = 3] = "Pending", e[e.Completed = 4] = "Completed", e;
2948
+ }({}), vr = class extends A {
2949
+ status;
2950
+ closedAt;
2951
+ isRead;
2952
+ isDeleted;
2953
+ client;
2954
+ constructor(e) {
2955
+ super(e), this.status = e?.status ?? $.Initiated, this.closedAt = o.parse(e?.closedAt), this.isRead = e?.isRead ?? !1, this.isDeleted = e?.isDeleted ?? !1, this.client = new hn(e?.client);
2956
+ }
2957
+ isClosed() {
2958
+ return this.status === $.Completed;
2959
+ }
2960
+ isDeletionPending() {
2961
+ return this.isDeleted && !this.isClosed();
2962
+ }
2963
+ canAddMessage() {
2964
+ return !this.isClosed();
2933
2965
  }
2934
- }, hr = class {
2966
+ getConsiderationDays(e = /* @__PURE__ */ new Date()) {
2967
+ return Math.max(xe(this.closedAt ?? e, this.createdAt), 0);
2968
+ }
2969
+ }, yr = class extends vr {
2970
+ items;
2971
+ constructor(e) {
2972
+ super(e), this.items = k(e?.items ?? [], (e) => new _r(e));
2973
+ }
2974
+ isClientMessage(e) {
2975
+ return e.creator?.id === this.client.id;
2976
+ }
2977
+ }, br = class extends j {
2978
+ id;
2979
+ statuses;
2980
+ createdAt;
2981
+ closedAt;
2982
+ isRead;
2983
+ isDeleted;
2984
+ clientName;
2985
+ cityName;
2986
+ constructor(e) {
2987
+ super(), this.id = {
2988
+ from: e?.id?.from ?? null,
2989
+ to: e?.id?.to ?? null
2990
+ }, this.statuses = e?.statuses, this.createdAt = new M(e?.createdAt), this.closedAt = new M(e?.closedAt), this.isRead = e?.isRead, this.isDeleted = e?.isDeleted, this.clientName = e?.clientName, this.cityName = e?.cityName;
2991
+ }
2992
+ resetFilterValue(e) {
2993
+ switch (e) {
2994
+ case "isDeleted":
2995
+ this.isDeleted = !1;
2996
+ break;
2997
+ case "statuses":
2998
+ case "isRead":
2999
+ case "clientName":
3000
+ case "cityName":
3001
+ this[e] = void 0;
3002
+ break;
3003
+ case "id":
3004
+ this.id.from = null, this.id.to = null;
3005
+ break;
3006
+ case "createdAt":
3007
+ this.createdAt.from = null, this.createdAt.to = null;
3008
+ break;
3009
+ case "closedAt": this.closedAt.from = null, this.closedAt.to = null;
3010
+ }
3011
+ return this;
3012
+ }
3013
+ }, xr = class e {
3014
+ static apiCodes = {
3015
+ [$.Initiated]: "initiated",
3016
+ [$.InfoRequired]: "info_required",
3017
+ [$.Pending]: "pending",
3018
+ [$.Completed]: "completed"
3019
+ };
3020
+ static toApiCode(t) {
3021
+ return e.apiCodes[t];
3022
+ }
3023
+ static toApiCodes(t) {
3024
+ return k(t, (t) => e.toApiCode(t));
3025
+ }
3026
+ }, Sr = class extends N {
3027
+ getReclamationsList(e, t, n, r, i = !1) {
3028
+ return this.getTypedPaginated(vr, "/internal/reclamations", e, t, n, {}, i, r);
3029
+ }
3030
+ getReclamation(e, t, n = !1) {
3031
+ return this.get(`/internal/reclamations/${e}`, {}, (e) => new yr(e.data), n, t);
3032
+ }
3033
+ createMessage(e, t, n = {}) {
3034
+ return this.post(`/internal/reclamations/${e}/messages`, t, (e) => new yr(e.data), n);
3035
+ }
3036
+ deleteReclamation(e) {
3037
+ return this.delete(`/internal/reclamations/${e}`);
3038
+ }
3039
+ restoreReclamation(e) {
3040
+ return this.post(`/internal/reclamations/${e}/restore`, {}, (e) => new yr(e.data));
3041
+ }
3042
+ downloadReclamation(e, t = !1) {
3043
+ return this.getBlob(`/internal/reclamations/${e}/download`, {}, (e) => new Blob([e.request.response], { type: "application/pdf" }), t);
3044
+ }
3045
+ getUpdates(e, t = !1) {
3046
+ return this.get("/internal/reclamations/updates", {}, void 0, t, e);
3047
+ }
3048
+ }, Cr = class {
2935
3049
  products = [];
2936
3050
  productCategories = [];
2937
3051
  constructor(e) {
2938
- e?.products && (this.products = e.products.map((e) => new R(e))), e?.productCategories && (this.productCategories = e.productCategories.map((e) => new R(e)));
3052
+ e?.products && (this.products = e.products.map((e) => new I(e))), e?.productCategories && (this.productCategories = e.productCategories.map((e) => new I(e)));
2939
3053
  }
2940
- }, gr = class extends l {
3054
+ }, wr = class extends l {
2941
3055
  getProductCategoryRecommendations(e) {
2942
- return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new hr(e.data));
3056
+ return this.get(`/internal/catalog/recommendations/categories/${e.id}`, {}, (e) => new Cr(e.data));
2943
3057
  }
2944
3058
  getProductRecommendations(e) {
2945
- return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new hr(e.data));
3059
+ return this.get(`/internal/catalog/recommendations/products/${e.id}`, {}, (e) => new Cr(e.data));
2946
3060
  }
2947
3061
  saveProductCategoryRecommendations(e, t) {
2948
3062
  return this.post(`/internal/catalog/recommendations/categories/${e.id}`, {
@@ -2956,7 +3070,7 @@ var Gn = class e {
2956
3070
  products: t.products.map((e) => e.id)
2957
3071
  });
2958
3072
  }
2959
- }, _r = class {
3073
+ }, Tr = class {
2960
3074
  static generateUndefinedInstance(e, t = "- Не определён -") {
2961
3075
  return new e({
2962
3076
  id: 0,
@@ -2967,13 +3081,13 @@ var Gn = class e {
2967
3081
  static isUndefinedInstance(e) {
2968
3082
  return e.id === 0 && e.slug === "-undefined-";
2969
3083
  }
2970
- }, vr = class {
3084
+ }, Er = class {
2971
3085
  name;
2972
3086
  content;
2973
3087
  constructor(e) {
2974
3088
  this.name = e.name, this.content = e.content;
2975
3089
  }
2976
- }, yr = class {
3090
+ }, Dr = class {
2977
3091
  resourceType;
2978
3092
  resourceId;
2979
3093
  h1;
@@ -2983,42 +3097,42 @@ var Gn = class e {
2983
3097
  meta;
2984
3098
  tags;
2985
3099
  constructor(e) {
2986
- this.resourceType = new de(e?.resourceType), this.resourceId = e?.resourceId ?? "", this.h1 = e?.h1, this.title = e?.title, this.description = e?.description, this.keywords = e?.keywords, this.meta = e?.meta?.map((e) => new vr(e)) ?? [], this.tags = e?.tags;
3100
+ this.resourceType = new de(e?.resourceType), this.resourceId = e?.resourceId ?? "", this.h1 = e?.h1, this.title = e?.title, this.description = e?.description, this.keywords = e?.keywords, this.meta = e?.meta?.map((e) => new Er(e)) ?? [], this.tags = e?.tags;
2987
3101
  }
2988
- }, br = class extends l {
3102
+ }, Or = class extends l {
2989
3103
  getResourceSeoData(e, t) {
2990
- return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new yr(e.data));
3104
+ return this.get(`/internal/seo/${e.slug}/${t}`, {}, (e) => new Dr(e.data));
2991
3105
  }
2992
3106
  saveResourceSeoData(e, t = {}) {
2993
- return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new yr(e.data), t);
3107
+ return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`, e, (e) => new Dr(e.data), t);
2994
3108
  }
2995
3109
  deleteResourceSeoData(e, t) {
2996
3110
  return this.delete(`/internal/seo/${e.slug}/${t}`);
2997
3111
  }
2998
- }, xr = class extends u {
3112
+ }, kr = class extends u {
2999
3113
  text;
3000
3114
  searchCount;
3001
3115
  lastSearchedAt;
3002
3116
  constructor(e) {
3003
3117
  super(e), this.text = e?.text ?? "", this.searchCount = e?.searchCount ?? 0, this.lastSearchedAt = o.parse(e?.lastSearchedAt);
3004
3118
  }
3005
- }, Sr = class extends l {
3119
+ }, Ar = class extends l {
3006
3120
  getSearchProductsStatistics(e, t) {
3007
- return this.getTypedList(xr, "/internal/statistics/search/products", { date: o.periodToApiFormat(e) }, !1, t);
3121
+ return this.getTypedList(kr, "/internal/statistics/search/products", { date: o.periodToApiFormat(e) }, !1, t);
3008
3122
  }
3009
3123
  removeSearchProductStatistic(e) {
3010
3124
  return this.delete(`/internal/statistics/search/products/${e}`);
3011
3125
  }
3012
- }, Cr = /* @__PURE__ */ function(e) {
3126
+ }, jr = /* @__PURE__ */ function(e) {
3013
3127
  return e[e.Undetermined = 0] = "Undetermined", e[e.Complete = 1] = "Complete", e[e.Incomplete = 2] = "Incomplete", e;
3014
- }({}), wr = class e {
3128
+ }({}), Mr = class e {
3015
3129
  static isBlocked(e, t) {
3016
- return t && e === Cr.Incomplete;
3130
+ return t && e === jr.Incomplete;
3017
3131
  }
3018
3132
  static getValidationResult(t, n) {
3019
- return e.isBlocked(t, n) ? new c("Проверьте адрес и выберите более точный вариант из подсказок", "error") : t === Cr.Incomplete || t === Cr.Undetermined ? new c("Проверьте правильность адреса", "warning") : void 0;
3133
+ return e.isBlocked(t, n) ? new c("Проверьте адрес и выберите более точный вариант из подсказок", "error") : t === jr.Incomplete || t === jr.Undetermined ? new c("Проверьте правильность адреса", "warning") : void 0;
3020
3134
  }
3021
- }, Tr = class extends l {
3135
+ }, Nr = class extends l {
3022
3136
  searchAddresses(e) {
3023
3137
  return this.execSuggestionQuery("/public/suggestions/address", e);
3024
3138
  }
@@ -3036,26 +3150,26 @@ var Gn = class e {
3036
3150
  }), t;
3037
3151
  });
3038
3152
  }
3039
- }, Er = class extends l {
3153
+ }, Pr = class extends l {
3040
3154
  constructor() {
3041
3155
  super(), this.baseUrl = `${g().config.http.portalApiUrl}/api`, this.interceptorIds.request.authRequestInterceptor && this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor);
3042
3156
  }
3043
3157
  getAccessToken() {
3044
3158
  return this.get("internal/users/current-tokens").then((e) => e.accessToken);
3045
3159
  }
3046
- }, Dr = class {
3160
+ }, Fr = class {
3047
3161
  user;
3048
3162
  salesDirection;
3049
3163
  constructor(e) {
3050
- this.user = new I(e?.user), this.salesDirection = new m(e?.salesDirection);
3164
+ this.user = new P(e?.user), this.salesDirection = new m(e?.salesDirection);
3051
3165
  }
3052
- }, Or = class extends he {
3166
+ }, Ir = class extends he {
3053
3167
  cities;
3054
3168
  users;
3055
3169
  constructor(e) {
3056
- super(e), this.cities = e?.cities?.map((e) => new t(e)) ?? [], this.users = e?.users?.map((e) => new Dr(e)) ?? [];
3170
+ super(e), this.cities = e?.cities?.map((e) => new t(e)) ?? [], this.users = e?.users?.map((e) => new Fr(e)) ?? [];
3057
3171
  }
3058
- }, kr = class extends N {
3172
+ }, Lr = class extends j {
3059
3173
  id;
3060
3174
  name;
3061
3175
  abbr;
@@ -3070,27 +3184,27 @@ var Gn = class e {
3070
3184
  }
3071
3185
  return this;
3072
3186
  }
3073
- }, Ar = class extends F {
3187
+ }, Rr = class extends N {
3074
3188
  getRegionsList(e, t, n) {
3075
3189
  return this.getTypedPaginated(he, "/internal/users/regions", e, t, n);
3076
3190
  }
3077
3191
  getRegion(e) {
3078
- return this.get(`/internal/users/regions/${e}`, {}, (e) => new Or(e.data));
3192
+ return this.get(`/internal/users/regions/${e}`, {}, (e) => new Ir(e.data));
3079
3193
  }
3080
3194
  createRegion(e, t = {}) {
3081
- return this.post("/internal/users/regions", e, (e) => new Or(e.data), t);
3195
+ return this.post("/internal/users/regions", e, (e) => new Ir(e.data), t);
3082
3196
  }
3083
3197
  updateRegion(e, t, n = {}) {
3084
- return this.patch(`/internal/users/regions/${e}`, t, (e) => new Or(e.data), n);
3198
+ return this.patch(`/internal/users/regions/${e}`, t, (e) => new Ir(e.data), n);
3085
3199
  }
3086
3200
  removeRegion(e) {
3087
3201
  return this.delete(`/internal/users/regions/${e}`);
3088
3202
  }
3089
3203
  getRegionEmployees(e) {
3090
- return this.getTypedList(Dr, `/internal/users/regions/${e}/users`);
3204
+ return this.getTypedList(Fr, `/internal/users/regions/${e}/users`);
3091
3205
  }
3092
3206
  attachRegionEmployee(e, t, n) {
3093
- return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new Dr(e.data));
3207
+ return this.post(`/internal/users/regions/${e}/users/${t}`, { salesDirectionId: n }, (e) => new Fr(e.data));
3094
3208
  }
3095
3209
  detachRegionEmployee(e, t, n) {
3096
3210
  return this.request({
@@ -3101,4 +3215,4 @@ var Gn = class e {
3101
3215
  }
3102
3216
  };
3103
3217
  //#endregion
3104
- export { Cr as AddressQualityEnum, wr as AddressQualityHelper, an as BankAccount, F as BasePaginationProvider, ot as BlogPost, rt as BlogPostMediaFile, nt as BlogPostMediaTypeEnum, it as BlogPostPublicationStatusEnum, at as BlogPostShortInfo, st as BlogPostsListFilters, dt as BlogProvider, Tt as CalculationTypeEnum, Z as CalendarHelper, H as Cart, wt as CartProvider, Wt as CatalogProvider, _t as CatalogableItem, U as Category, Ut as CategoryFilter, Vt as CategoryFilterSetting, Ht as CategoryFilterValue, zt as CategoryPricingRule, pn as Client, gn as ClientAdditionalData, Ot as ClientCategory, yn as ClientDataProvider, It as ClientPriceCatalogableItem, Rt as ClientPriceCategory, Lt as ClientPriceProduct, Gt as ClientPriceProvider, Kt as ClientPriceTemplateProvider, B as ClientProduct, Yt as ClientProductCategoryDataProvider, Xt as ClientProductDataProvider, W as ClientShortInfo, rn as ClientsAdditionalDataRequestTypeEnum, mn as ClientsListFilters, R as CodedIdentity, Cn as ConfiguratorProvider, Sn as ConfiguratorsEnum, on as Contact, Y as ContactPerson, vn as ContactPersonRelated, _n as ContactRelation, sn as ContragentBase, fn as ContragentFactory, ln as ContragentIc, cn as ContragentPerson, dn as ContragentUlNr, un as ContragentUlR, xt as CostSourceEnum, M as CreatableIdentity, Mt as Curator, Tr as DataSuggestionProvider, An as DateTimeProvider, Nt as DeletableIdentity, ft as DeletableNamedIdentity, X as DeliveryAddress, Ln as Discount, Nn as DiscountClient, Rn as DiscountClientEligibility, Pn as DiscountConditions, Bn as DiscountProvider, pt as DiscountShortInfo, Fn as DiscountStateEnum, In as DiscountStateHelper, zn as DiscountsListFilters, Hn as Faq, Vn as FaqGroup, Un as FaqProvider, ut as FilterGroup, lt as FilterItem, ct as FilterOpEnum, Bt as FilterSettings, vt as HiddenCatalogableItem, yt as Image, Kn as ManagerDataFactory, vr as MetaTagItem, Q as Offer, Jn as OfferActualization, qn as OfferActualizationStatus, tr as OfferHelper, Yn as OfferShortInfo, er as OffersDataProvider, Zn as OffersListFilters, $ as Order, nr as OrderAction, rr as OrderEditorData, Qn as OrderInfo, $n as OrderItem, St as OrderItemBase, hn as OrderShortInfo, ar as OrderStatusHistoryInfo, or as OrdersDataProvider, ir as OrdersListFilters, N as PaginationFiltersBase, cr as PriceAnalyze, dr as PriceAnalyzeProvider, kt as PriceCatalogableItem, mr as PriceHistoryDataProvider, fr as PriceHistoryItem, L as PriceTemplate, jt as PriceTemplateCategory, G as PriceTemplateClient, At as PriceTemplateICatalogableItem, Pt as PriceTemplateProduct, Zt as PriceTemplateProvider, J as PricingRole, Qt as PricingRoleProvider, bt as PrimaryCatalogableItem, z as Product, qt as ProductCategoryDataProvider, Jt as ProductDataProvider, Et as ProductFilterTypeEnum, mt as ProductPriceCoefficient, pr as ProductPriceHistory, gt as ProductUnit, Xn as ProfstroyOfferItem, $t as PropertiesProvider, K as Property, q as PropertyValue, gr as RecommendationsDataProvider, hr as RecommendationsList, _r as ReferenceDataFactory, jn as STANDARD_PERIOD_GROUPS, Mn as STANDARD_PERIOD_SECTIONS, xr as SearchProductStatistic, yr as Seo, br as SeoDataProvider, Sr as StatisticsProvider, ht as StockCount, Tn as TableDataPagination, wn as TableDataPaginationRequestParams, En as TableDataSortRequestParams, en as TemplateProductCategoryDataProvider, Ft as TemplatesListFilters, Gn as UnitsHelper, bn as UnknownClientDataProvider, Er as UserAuthDataProvider, Or as UserRegion, Dr as UserRegionEmployee, Ar as UserRegionProvider, kr as UserRegionsListFilters, I as UserShortInfo, xn as VersionConfig, sr as currentOrderInjectionKey, Dn as daysAgoIso, tn as findCatalogItemByIdRecursive, nn as flattenCatalogItems, Wn as formatPercentChange, kn as formatRelativeDate, On as pluralize };
3218
+ export { jr as AddressQualityEnum, Mr as AddressQualityHelper, sn as BankAccount, N as BasePaginationProvider, ct as BlogPost, at as BlogPostMediaFile, it as BlogPostMediaTypeEnum, ot as BlogPostPublicationStatusEnum, st as BlogPostShortInfo, lt as BlogPostsListFilters, pt as BlogProvider, Dt as CalculationTypeEnum, Y as CalendarHelper, B as Cart, Et as CartProvider, Kt as CatalogProvider, yt as CatalogableItem, V as Category, Gt as CategoryFilter, Ut as CategoryFilterSetting, Wt as CategoryFilterValue, Vt as CategoryPricingRule, gn as Client, yn as ClientAdditionalData, hn as ClientBaseInfo, At as ClientCategory, Sn as ClientDataProvider, Rt as ClientPriceCatalogableItem, Bt as ClientPriceCategory, zt as ClientPriceProduct, qt as ClientPriceProvider, Jt as ClientPriceTemplateProvider, R as ClientProduct, Zt as ClientProductCategoryDataProvider, Qt as ClientProductDataProvider, H as ClientShortInfo, on as ClientsAdditionalDataRequestTypeEnum, _n as ClientsListFilters, I as CodedIdentity, En as ConfiguratorProvider, Tn as ConfiguratorsEnum, cn as Contact, q as ContactPerson, xn as ContactPersonRelated, bn as ContactRelation, ln as ContragentBase, mn as ContragentFactory, dn as ContragentIc, un as ContragentPerson, pn as ContragentUlNr, fn as ContragentUlR, Ct as CostSourceEnum, A as CreatableIdentity, Pt as Curator, Nr as DataSuggestionProvider, Nn as DateTimeProvider, Ft as DeletableIdentity, mt as DeletableNamedIdentity, J as DeliveryAddress, Bn as Discount, In as DiscountClient, Vn as DiscountClientEligibility, Ln as DiscountConditions, Un as DiscountProvider, ht as DiscountShortInfo, Rn as DiscountStateEnum, zn as DiscountStateHelper, Hn as DiscountsListFilters, X as Faq, Wn as FaqGroup, Gn as FaqProvider, ft as FilterGroup, dt as FilterItem, ut as FilterOpEnum, Ht as FilterSettings, bt as HiddenCatalogableItem, xt as Image, Jn as ManagerDataFactory, Er as MetaTagItem, Z as Offer, Xn as OfferActualization, Yn as OfferActualizationStatus, rr as OfferHelper, Zn as OfferShortInfo, nr as OffersDataProvider, $n as OffersListFilters, Q as Order, ir as OrderAction, ar as OrderEditorData, er as OrderInfo, tr as OrderItem, wt as OrderItemBase, vn as OrderShortInfo, sr as OrderStatusHistoryInfo, cr as OrdersDataProvider, or as OrdersListFilters, j as PaginationFiltersBase, ur as PriceAnalyze, pr as PriceAnalyzeProvider, jt as PriceCatalogableItem, gr as PriceHistoryDataProvider, mr as PriceHistoryItem, F as PriceTemplate, Nt as PriceTemplateCategory, U as PriceTemplateClient, Mt as PriceTemplateICatalogableItem, It as PriceTemplateProduct, $t as PriceTemplateProvider, K as PricingRole, en as PricingRoleProvider, St as PrimaryCatalogableItem, L as Product, Yt as ProductCategoryDataProvider, Xt as ProductDataProvider, Ot as ProductFilterTypeEnum, gt as ProductPriceCoefficient, hr as ProductPriceHistory, vt as ProductUnit, Qn as ProfstroyOfferItem, tn as PropertiesProvider, W as Property, G as PropertyValue, yr as Reclamation, _r as ReclamationItem, Sr as ReclamationProvider, vr as ReclamationShortInfo, $ as ReclamationStatusEnum, xr as ReclamationStatusHelper, br as ReclamationsListFilters, wr as RecommendationsDataProvider, Cr as RecommendationsList, Tr as ReferenceDataFactory, Pn as STANDARD_PERIOD_GROUPS, Fn as STANDARD_PERIOD_SECTIONS, kr as SearchProductStatistic, Dr as Seo, Or as SeoDataProvider, Ar as StatisticsProvider, _t as StockCount, On as TableDataPagination, Dn as TableDataPaginationRequestParams, kn as TableDataSortRequestParams, nn as TemplateProductCategoryDataProvider, Lt as TemplatesListFilters, qn as UnitsHelper, Cn as UnknownClientDataProvider, Pr as UserAuthDataProvider, Ir as UserRegion, Fr as UserRegionEmployee, Rr as UserRegionProvider, Lr as UserRegionsListFilters, P as UserShortInfo, wn as VersionConfig, lr as currentOrderInjectionKey, An as daysAgoIso, rn as findCatalogItemByIdRecursive, an as flattenCatalogItems, Kn as formatPercentChange, Mn as formatRelativeDate, jn as pluralize };