@pisapp/core 7.0.0-dev.20260916-153034 → 7.0.0-dev.20261029-122603

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 (59) hide show
  1. package/LICENSE +26 -18
  2. package/README.md +3 -0
  3. package/catalogs.js +3 -3
  4. package/chunks/AttributesTable-DRKGguZ2.js +3474 -0
  5. package/chunks/PisGlobal-CPAlhOni.js +94 -0
  6. package/chunks/ProductsDetailsHeader-DfVlpJh_.js +4442 -0
  7. package/chunks/carousel.es-DBv2Q2Xn.js +1602 -0
  8. package/chunks/directives-8QlgHJi7.js +8244 -0
  9. package/chunks/entry-CwhdPOkr.js +9948 -0
  10. package/chunks/entry-DVqVFTtL.js +5687 -0
  11. package/chunks/entry-Dyo7FMUS.js +2207 -0
  12. package/chunks/registerCustomElements-CWZenCp9.js +426 -0
  13. package/classifications.js +2 -2
  14. package/core.js +3 -3
  15. package/generated/registries.json +2775 -0
  16. package/index.js +7 -6
  17. package/migration/API_V1_TO_V2_MIGRATION.md +1704 -177
  18. package/migration/legacy-option-rules.json +51 -6
  19. package/migration/v7.json +2983 -441
  20. package/migration/v7.schema.json +61 -2
  21. package/package.json +17 -8
  22. package/pis-csp.js +7 -7
  23. package/pis.js +9 -9
  24. package/products.js +3 -1
  25. package/server.js +354 -0
  26. package/styles/pis.css +1 -1
  27. package/styles/theme-abb.optimized.css +1 -1
  28. package/styles/theme-cux2-blue-dark.css +1 -1
  29. package/styles/theme-cux2-blue-dark.optimized.css +1 -1
  30. package/styles/theme-cux2-blue-light.css +1 -1
  31. package/styles/theme-cux2-blue-light.optimized.css +1 -1
  32. package/styles/theme-cux2-lilac-dark.css +1 -1
  33. package/styles/theme-cux2-lilac-dark.optimized.css +1 -1
  34. package/styles/theme-cux2-lilac-light.css +1 -1
  35. package/styles/theme-cux2-lilac-light.optimized.css +1 -1
  36. package/styles/theme-cux2-mono-dark.css +1 -1
  37. package/styles/theme-cux2-mono-dark.optimized.css +1 -1
  38. package/styles/theme-cux2-mono-light.css +1 -1
  39. package/styles/theme-cux2-mono-light.optimized.css +1 -1
  40. package/styles/theme-cux2-red-dark.css +1 -1
  41. package/styles/theme-cux2-red-dark.optimized.css +1 -1
  42. package/styles/theme-cux2-red-light.css +1 -1
  43. package/styles/theme-cux2-red-light.optimized.css +1 -1
  44. package/types.d.ts +797 -587
  45. package/catalogs.d.ts +0 -7725
  46. package/chunks/catalogs-domain-DJxK_B5E.js +0 -9060
  47. package/chunks/catalogs-domain-DJxK_B5E.js.map +0 -1
  48. package/chunks/classifications-domain-DdIJaF1D.js +0 -1980
  49. package/chunks/classifications-domain-DdIJaF1D.js.map +0 -1
  50. package/chunks/icons-shared-B8v5z3BE.js +0 -1387
  51. package/chunks/icons-shared-B8v5z3BE.js.map +0 -1
  52. package/chunks/products-domain-99vJaUyI.js +0 -22587
  53. package/chunks/products-domain-99vJaUyI.js.map +0 -1
  54. package/classifications.d.ts +0 -7725
  55. package/core.d.ts +0 -7711
  56. package/index.d.ts +0 -7992
  57. package/pis-csp.js.map +0 -1
  58. package/pis.js.map +0 -1
  59. package/products.d.ts +0 -7746
@@ -0,0 +1,4442 @@
1
+ import { $t as e, A as t, D as n, Dn as r, E as i, En as a, F as o, I as s, L as c, N as l, O as u, On as d, P as f, Qt as p, R as m, Rt as h, Sn as g, T as _, Tn as v, Tt as y, Ut as b, V as ee, W as te, Xt as ne, Yt as x, Zt as S, _ as C, _n as w, an as re, at as ie, bn as ae, c as oe, cn as se, ct as T, dt as ce, en as le, ft as ue, g as E, h as de, hn as fe, ht as pe, i as me, in as he, j as ge, jt as _e, k as ve, l as ye, ln as be, lt as xe, m as Se, mn as D, mt as Ce, n as we, nn as Te, nt as O, on as Ee, ot as De, p as Oe, pn as ke, pt as k, rn as Ae, s as je, sn as Me, tn as Ne, u as Pe, un as Fe, ut as Ie, v as A, vn as Le, wn as Re, x as ze, xn as Be, y as Ve, yn as He } from "./directives-8QlgHJi7.js";
2
+ import { $ as Ue, D as We, E as Ge, F as Ke, O as qe, P as Je, Q as Ye, T as Xe, U as Ze, V as Qe, X as $e, Y as et, Z as tt, _ as nt, at as rt, ct as it, et as at, it as ot, k as st, l as ct, m as lt, nt as ut, p as dt, q as ft, r as pt, rt as mt, s as ht, st as gt, t as _t, tt as vt, u as yt, ut as bt, v as xt, w as St } from "./AttributesTable-DRKGguZ2.js";
3
+ import { c as j, n as Ct } from "./PisGlobal-CPAlhOni.js";
4
+ import { Fragment as M, computed as N, createBlock as P, createCommentVNode as F, createElementBlock as I, createElementVNode as L, createSlots as wt, createTextVNode as R, createVNode as z, defineComponent as B, h as Tt, mergeProps as Et, normalizeClass as V, normalizeStyle as Dt, onMounted as Ot, openBlock as H, reactive as kt, ref as U, renderList as W, renderSlot as G, resolveComponent as K, resolveDirective as q, resolveDynamicComponent as At, toDisplayString as J, toHandlers as jt, vModelCheckbox as Mt, watch as Nt, withCtx as Y, withDirectives as X, withKeys as Pt, withModifiers as Z } from "vue";
5
+ //#region src/common/components/cell-defaults/ProductNameTableCell.vue?vue&type=script&setup=true&lang.ts
6
+ var Ft = {
7
+ key: 1,
8
+ class: "text-muted"
9
+ }, It = /* @__PURE__ */ B({
10
+ __name: "ProductNameTableCell",
11
+ props: { ctx: {} },
12
+ setup(e) {
13
+ let t = e, n = N(() => t.ctx.item), r = N(() => v(n.value, "#DisplayName"));
14
+ return (t, i) => n.value.inactive ? (H(), I("span", Ft, J(r.value), 1)) : (H(), I("a", {
15
+ key: 0,
16
+ class: "fw-medium",
17
+ href: "#",
18
+ onClick: i[0] || (i[0] = Z((t) => e.ctx.details(e.ctx.item), ["prevent"]))
19
+ }, J(r.value), 1));
20
+ }
21
+ }), Lt = { class: "fw-bold" }, Rt = { class: "text-muted small" }, zt = { key: 1 }, Bt = { class: "fw-bold" }, Vt = { class: "text-muted small" }, Ht = /* @__PURE__ */ B({
22
+ __name: "VariantsProductCell",
23
+ props: { ctx: {} },
24
+ setup(e) {
25
+ let t = e, n = N(() => t.ctx.item), r = N(() => v(n.value, "#DisplayName")), i = N(() => v(n.value, "CatalogDescription"));
26
+ return (t, a) => n.value.productId ? (H(), I("a", {
27
+ key: 0,
28
+ href: "#",
29
+ class: "text-decoration-none",
30
+ onClick: a[0] || (a[0] = Z((t) => e.ctx.details(e.ctx.item), ["prevent"]))
31
+ }, [L("div", Lt, J(r.value), 1), L("div", Rt, J(i.value), 1)])) : (H(), I("div", zt, [L("div", Bt, J(r.value), 1), L("div", Vt, J(i.value), 1)]));
32
+ }
33
+ }), Ut = { class: "d-flex flex-wrap gap-1" }, Wt = /* @__PURE__ */ B({
34
+ __name: "VariantsVariantCell",
35
+ props: { ctx: {} },
36
+ setup(e) {
37
+ let t = e, n = (e, t) => v(e, t), r = N(() => t.ctx.group.variantAttributes ?? []);
38
+ return (t, i) => {
39
+ let a = q("pis-test-key");
40
+ return H(), I("div", Ut, [(H(!0), I(M, null, W(r.value, (t, r) => X((H(), I("span", {
41
+ key: t.attributeCode ?? r,
42
+ class: "badge bg-light text-dark border"
43
+ }, [R(J(t.attributeName ?? "") + ": " + J(n(e.ctx.item, t.attributeCode)), 1)])), [[a, t]])), 128))]);
44
+ };
45
+ }
46
+ }), Gt = class {
47
+ constructor() {
48
+ j(this, "appSettings", {
49
+ appCode: "",
50
+ langCode: "en",
51
+ countryCode: void 0,
52
+ includeInternalData: !1,
53
+ treeType: k.PRODUCTS
54
+ }), j(this, "styles", []), j(this, "components", {
55
+ common: {
56
+ hideDocumentLinks: !0,
57
+ hideReplacements: !1,
58
+ hideWhereUsed: !1,
59
+ maxAttributeValuesVisible: 10
60
+ },
61
+ search: {
62
+ common: {
63
+ configurators: { visible: !1 },
64
+ productItemSettings: {
65
+ maxProductImages: 1,
66
+ includeAliases: !0,
67
+ includeReplacements: !0,
68
+ includeVariantAttributes: !0
69
+ }
70
+ },
71
+ breadcrumbs: { visible: !0 },
72
+ form: {
73
+ visible: !0,
74
+ useAutocomplete: !0,
75
+ maxCategoryMatches: 2
76
+ },
77
+ toolbar: {
78
+ visible: !0,
79
+ pageSizes: [
80
+ 12,
81
+ 24,
82
+ 48,
83
+ 72
84
+ ],
85
+ subViews: [
86
+ "table",
87
+ "list",
88
+ "grid"
89
+ ],
90
+ countVisible: !0,
91
+ subViewsVisible: !0,
92
+ pageSizesVisible: !0,
93
+ sortVisible: !0,
94
+ exportMenu: {
95
+ visible: !1,
96
+ items: []
97
+ }
98
+ },
99
+ pagination: {
100
+ visible: !0,
101
+ visiblePages: 5
102
+ },
103
+ header: { visible: !0 },
104
+ categories: {
105
+ transparent: !1,
106
+ visible: !0,
107
+ card: !0,
108
+ icon: !1,
109
+ maxCategoriesVisible: 12
110
+ },
111
+ filters: {
112
+ transparent: !1,
113
+ visible: !0,
114
+ card: !0,
115
+ icon: !1,
116
+ maxFiltersVisible: 10,
117
+ visibleFromNodeLevel: 0
118
+ },
119
+ filtersStatus: { visible: !0 },
120
+ narrowByProduct: {
121
+ visible: !0,
122
+ card: !0,
123
+ icon: !0
124
+ },
125
+ partTypes: { visible: !0 },
126
+ selection: {
127
+ visible: !1,
128
+ deselectAllVisible: !0,
129
+ selectAllVisible: !0,
130
+ persist: !1,
131
+ countVisible: !0
132
+ },
133
+ table: {
134
+ visible: !0,
135
+ selectable: !1,
136
+ columns: [
137
+ {
138
+ caption: "Name",
139
+ dataField: "#DisplayName",
140
+ width: "33%",
141
+ treeTypes: [k.PRODUCTS],
142
+ showAllIdentifiers: !0,
143
+ headerTemplate: bt("ProductListProduct", "common"),
144
+ cellTemplate: It
145
+ },
146
+ {
147
+ caption: "Name",
148
+ dataField: "#DisplayName",
149
+ width: "33%",
150
+ treeTypes: [k.PARTS],
151
+ showAllIdentifiers: !0,
152
+ headerTemplate: bt("ProductListSparePart", "common"),
153
+ cellTemplate: It
154
+ },
155
+ {
156
+ caption: "Description",
157
+ treeTypes: [k.PRODUCTS, k.PARTS],
158
+ headerTemplate: bt("ProductListInformation", "common"),
159
+ dataField: "CatalogDescription",
160
+ showReplacements: !0,
161
+ showVariants: !0
162
+ },
163
+ {
164
+ caption: "Quantity",
165
+ treeTypes: [k.PARTS],
166
+ headerTemplate: bt("ProductListQuantity", "common"),
167
+ dataField: "#Quantity",
168
+ masterProductRequired: !0
169
+ }
170
+ ]
171
+ },
172
+ list: {
173
+ visible: !0,
174
+ showAllIdentifiers: !0,
175
+ showReplacements: !0,
176
+ navigateOnContentClick: !0,
177
+ imageSize: "10rem",
178
+ selectable: !1,
179
+ imagePadding: 0,
180
+ mobileBreakpoint: 680,
181
+ imageLazyLoading: !0,
182
+ showVariants: !0
183
+ },
184
+ grid: {
185
+ visible: !0,
186
+ selectable: !1,
187
+ showAllIdentifiers: !0,
188
+ showReplacements: !0,
189
+ navigateOnContentClick: !0,
190
+ imageLazyLoading: !0,
191
+ showVariants: !0
192
+ },
193
+ gridHorizontal: {
194
+ visible: !0,
195
+ selectable: !1,
196
+ showAllIdentifiers: !0,
197
+ showReplacements: !0,
198
+ navigateOnContentClick: !0,
199
+ showVariants: !0,
200
+ carousel: {
201
+ mouseDrag: !0,
202
+ touchDrag: !0,
203
+ transition: 300,
204
+ wrapAround: !1,
205
+ defaults: {
206
+ itemsToShow: 1,
207
+ itemsToScroll: 1,
208
+ snapAlign: "center",
209
+ margin: 5,
210
+ navigationVisible: !0,
211
+ paginationVisible: !0
212
+ },
213
+ breakpoints: {
214
+ 576: {
215
+ itemsToShow: 2,
216
+ itemsToScroll: 1,
217
+ snapAlign: "start",
218
+ margin: 2,
219
+ navigationVisible: !0,
220
+ paginationVisible: !1
221
+ },
222
+ 922: {
223
+ itemsToShow: 4,
224
+ itemsToScroll: 1,
225
+ snapAlign: "start",
226
+ margin: 2,
227
+ navigationVisible: !0,
228
+ paginationVisible: !1
229
+ }
230
+ }
231
+ }
232
+ },
233
+ favoriteCategories: {
234
+ visible: !1,
235
+ card: !0,
236
+ icon: !1,
237
+ transparent: !1,
238
+ productCids: void 0,
239
+ partCids: void 0,
240
+ maxCategoriesVisible: 12
241
+ },
242
+ favoriteViews: {
243
+ visible: !1,
244
+ transparent: !1,
245
+ card: !0,
246
+ icon: !1,
247
+ fallbackCode: "ABB",
248
+ maxViewsVisible: 10,
249
+ savedViewIds: void 0
250
+ }
251
+ },
252
+ details: {
253
+ data: {
254
+ bottomNavigationSticky: !0,
255
+ hideBottomNavigation: !1,
256
+ showTabCounts: !0,
257
+ showTabIcons: !0,
258
+ productItemSettings: {
259
+ includeAliases: !0,
260
+ includeReplacements: !0,
261
+ maxProductImages: 6
262
+ },
263
+ variants: { productItemSettings: { maxProductImages: 1 } },
264
+ relationships: {
265
+ productRelationshipFiltering: !0,
266
+ pageSize: 5,
267
+ searchMinItems: 5,
268
+ filteringMinItems: 5,
269
+ filteringMaxAttributesVisible: 5,
270
+ actionTemplates: {},
271
+ displayMode: { All: "table" },
272
+ productItemSettings: {
273
+ maxProductImages: 1,
274
+ includeVariantAttributes: !0
275
+ }
276
+ },
277
+ downloads: {
278
+ visible: !0,
279
+ count: void 0,
280
+ loading: !1
281
+ }
282
+ },
283
+ classifications: {
284
+ visible: !0,
285
+ treeView: !1
286
+ },
287
+ gallery: {
288
+ visible: !0,
289
+ hideThumbnailImages: !1,
290
+ showOverlayArrows: !1
291
+ },
292
+ relatedLinks: {
293
+ visible: !1,
294
+ showImages: !0
295
+ },
296
+ header: {
297
+ visible: !0,
298
+ showBackBtn: !0,
299
+ showPrintToPdfBtn: !0,
300
+ showPrintViewBtn: !1
301
+ },
302
+ variantsDropdown: {
303
+ visible: !1,
304
+ showImages: !0
305
+ },
306
+ variantsSelector: {
307
+ visible: !0,
308
+ unavailableValuesBehavior: "disabled"
309
+ },
310
+ variantsTable: {
311
+ visible: !1,
312
+ showImages: !0,
313
+ columns: [{
314
+ caption: "Product",
315
+ width: "25%",
316
+ headerTemplate: bt("ProductListProduct", "common"),
317
+ cellTemplate: Ht
318
+ }, {
319
+ caption: "Variant",
320
+ width: "auto",
321
+ headerTemplate: bt("Variant", "products"),
322
+ cellTemplate: Wt
323
+ }]
324
+ }
325
+ },
326
+ compare: { view: {
327
+ visible: !0,
328
+ imageSize: "120px",
329
+ showAllIdentifiers: !0,
330
+ showReplacements: !0,
331
+ categoriesVisible: !0,
332
+ navigationVisible: !0,
333
+ printButtonVisible: !1,
334
+ compactMode: !0,
335
+ attrColWidth: "240px",
336
+ valColWidth: "240px",
337
+ imageVisible: !0,
338
+ imageHideOnScroll: !0,
339
+ productItemSettings: {
340
+ includeAliases: !0,
341
+ includeReplacements: !0,
342
+ maxProductImages: 1
343
+ }
344
+ } },
345
+ preview: { view: {
346
+ visible: !0,
347
+ productItemSettings: {
348
+ includeAliases: !0,
349
+ includeReplacements: !0,
350
+ maxProductImages: 6
351
+ }
352
+ } }
353
+ }), j(this, "allowMobileView", !0), j(this, "cacheTranslations", !0), j(this, "testMode", !1);
354
+ }
355
+ }, Kt = (e) => ({ addToCatalog: async (t, n, r, i) => e.execute(new ht({
356
+ productId: t,
357
+ catalogType: n,
358
+ uom: r,
359
+ catalogId: i
360
+ }), "api") }), qt = {
361
+ search: "/v2/Products/Search",
362
+ count: "/v2/Products/Count",
363
+ detail: "/v2/Products/Detail",
364
+ variantsTable: "/v2/Products/Variants/Table",
365
+ translations: "/v2/Translations"
366
+ }, Q = {
367
+ Classifications: T.CLASSIFICATIONS,
368
+ Products: T.PRODUCTS,
369
+ Filters: T.FILTERS,
370
+ Breadcrumbs: T.BREADCRUMBS,
371
+ Configurators: T.CONFIGURATORS,
372
+ MasterProducts: T.MASTER_PRODUCTS,
373
+ PartTypes: T.PART_TYPES,
374
+ ProductDetails: O.PRODUCT_DETAILS,
375
+ ProductClassifications: O.PRODUCT_CLASSIFICATIONS,
376
+ AttributeGroups: O.ATTRIBUTE_GROUPS,
377
+ ProductRelationships: O.PRODUCT_RELATIONSHIPS,
378
+ RelatedLinks: O.RELATED_LINKS,
379
+ ProductVariantsSelector: O.PRODUCT_VARIANTS_SELECTOR,
380
+ ProductVariantsTable: O.PRODUCT_VARIANTS_TABLE,
381
+ ProductVariantsDropdown: O.PRODUCT_VARIANTS_DROPDOWN,
382
+ ExtendedObjectData: O.EXTENDED_OBJECT_DATA,
383
+ ProductPreview: "ProductPreview",
384
+ FavoriteProductCategories: "FavoriteProductCategories",
385
+ FavoritePartCategories: "FavoritePartCategories",
386
+ FavoriteViews: "FavoriteViews",
387
+ Translations: "Translations",
388
+ RelatedProducts: "RelatedProducts",
389
+ ProductCompare: "ProductCompare",
390
+ ProductIdToName: "ProductIdToName"
391
+ }, Jt = {
392
+ [Q.Products]: (e, t) => {
393
+ e.products = t;
394
+ },
395
+ [Q.Classifications]: (e, t) => {
396
+ e.classifications = t;
397
+ },
398
+ [Q.Filters]: (e, t) => {
399
+ e.filters = t;
400
+ },
401
+ [Q.Breadcrumbs]: (e, t) => {
402
+ e.breadcrumbs = t;
403
+ },
404
+ [Q.ProductDetails]: (e, t) => {
405
+ t == null ? (e.productDetail = void 0, e.itemNotFound = !0) : (e.productDetail = t, e.itemNotFound = !1);
406
+ },
407
+ [Q.ProductClassifications]: (e, t) => {
408
+ e.productClassifications = t;
409
+ },
410
+ [Q.AttributeGroups]: (e, t) => {
411
+ e.attributeGroups = t;
412
+ },
413
+ [Q.ProductRelationships]: (e, t) => {
414
+ e.prm = t;
415
+ },
416
+ [Q.Configurators]: (e, t) => {
417
+ e.configurators = t;
418
+ },
419
+ [Q.RelatedLinks]: (e, t) => {
420
+ e.relatedLinks = t;
421
+ },
422
+ [Q.ProductPreview]: (e, t) => {
423
+ e.productPreview = t;
424
+ },
425
+ [Q.PartTypes]: (e, t) => {
426
+ e.partTypes = t;
427
+ },
428
+ [Q.MasterProducts]: (e, t) => {
429
+ e.sparePartMasterProducts = t;
430
+ },
431
+ [Q.FavoriteProductCategories]: (e, t) => {
432
+ e.favoriteProductCategories = t;
433
+ },
434
+ [Q.FavoritePartCategories]: (e, t) => {
435
+ e.favoritePartCategories = t;
436
+ },
437
+ [Q.FavoriteViews]: (e, t) => {
438
+ e.favoriteViews = t;
439
+ },
440
+ [Q.RelatedProducts]: (e, t) => {
441
+ e.relatedProducts = t;
442
+ },
443
+ [Q.ProductCompare]: (e, t) => {
444
+ e.compareResult = t;
445
+ },
446
+ [Q.ProductIdToName]: (e, t) => {
447
+ if (e.productIdToDisplayName || (e.productIdToDisplayName = {}), t != null && t.item) {
448
+ let { requestedProductId: n, item: r } = t, i = v(r, "#DisplayName");
449
+ i && (e.productIdToDisplayName[r.productId] = i, e.productIdToDisplayName[n] = i);
450
+ }
451
+ },
452
+ [Q.ProductVariantsSelector]: (e, t) => {
453
+ e.productVariantsSelector = t;
454
+ },
455
+ [Q.ProductVariantsTable]: (e, t) => {
456
+ var n;
457
+ let r = t == null ? void 0 : t.items, i = (n = e.productVariantsTable) == null ? void 0 : n.items;
458
+ if ((r == null ? void 0 : r.length) === 1 && i != null && i.length) {
459
+ let e = r[0], t = i.findIndex((t) => t.attributeCode === e.attributeCode);
460
+ if (t >= 0) {
461
+ i.splice(t, 1, e);
462
+ return;
463
+ }
464
+ i.push(e);
465
+ return;
466
+ }
467
+ e.productVariantsTable = t;
468
+ },
469
+ [Q.ProductVariantsDropdown]: (e, t) => {
470
+ e.productVariantsDropdown = t;
471
+ },
472
+ [Q.Translations]: (e, t) => {
473
+ c.log("Setting store data not handled", {
474
+ type: Q.Translations,
475
+ data: t
476
+ });
477
+ },
478
+ [Q.ExtendedObjectData]: (e, t) => {
479
+ c.log("Setting store data not handled", {
480
+ type: Q.ExtendedObjectData,
481
+ data: t
482
+ });
483
+ }
484
+ }, Yt = class extends m {
485
+ constructor(e) {
486
+ super(e);
487
+ }
488
+ dataInterceptor() {
489
+ var e;
490
+ return (e = this.instance.store) == null ? void 0 : e.options.dataInterceptor;
491
+ }
492
+ dispatchLoadEvent(e) {
493
+ this.setStoreData(e);
494
+ }
495
+ setStoreData({ type: e, data: t }) {
496
+ if (!this.instance.store) return;
497
+ let n = Jt[e];
498
+ n(this.instance.store.data, t);
499
+ }
500
+ }, Xt = "pis-products-translations", Zt = class extends f {
501
+ constructor(e, t, n) {
502
+ super(), j(this, "instance", void 0), j(this, "instanceType", "Products"), j(this, "storeService", void 0), j(this, "client", void 0), j(this, "variantTableController", void 0), j(this, "loadController", void 0), j(this, "autocompleteController", new AbortController()), j(this, "autocompleteCache", {}), j(this, "_lastFilterLoad", {
503
+ key: "",
504
+ count: 0
505
+ }), this.instance = e, this.client = o(e, t, n), this.storeService = new Yt(e);
506
+ }
507
+ searchVariants() {
508
+ var e;
509
+ let t = (e = this.instance.store.options.components) == null || (e = e.search) == null || (e = e.common) == null ? void 0 : e.variants;
510
+ return t ? { clustering: t.clustering } : void 0;
511
+ }
512
+ detailVariants() {
513
+ var e;
514
+ let t = (e = this.instance.store.options.components) == null || (e = e.details) == null || (e = e.data) == null ? void 0 : e.variants;
515
+ return t ? {
516
+ clustering: t.clustering,
517
+ productItemSettings: t.productItemSettings
518
+ } : void 0;
519
+ }
520
+ relationshipSettings(e) {
521
+ var t;
522
+ let n = (t = this.instance.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
523
+ return {
524
+ productRelationshipFiltering: n == null ? void 0 : n.productRelationshipFiltering,
525
+ productItemSettings: n == null ? void 0 : n.productItemSettings,
526
+ ...e ? { pager: e } : {}
527
+ };
528
+ }
529
+ relationshipAutocompleteSettings(e) {
530
+ var t;
531
+ let n = (t = this.instance.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
532
+ return {
533
+ productItemSettings: n == null ? void 0 : n.productItemSettings,
534
+ pager: e
535
+ };
536
+ }
537
+ async load(e) {
538
+ if (this.instance.router) try {
539
+ let t = e || this.instance.router.routeData;
540
+ switch (t.view) {
541
+ case "search": return await this.query(t);
542
+ case "detail": return await this.detail(t);
543
+ case "compare": return await this.compare(t);
544
+ default: throw Error(`Unknown view type "${t.view}" to be handled by HttpService`);
545
+ }
546
+ } catch (e) {
547
+ this.instance.store.data.isLoadingData = !1, console.error("Load failed", e);
548
+ }
549
+ }
550
+ async paginate(e) {
551
+ var t, n, r;
552
+ let i = this.searchAttribution();
553
+ (t = this.loadController) == null || t.abort();
554
+ let a = new AbortController();
555
+ this.loadController = a, this.instance.store.data.isLoadingData = !0;
556
+ let o = Date.now(), c;
557
+ try {
558
+ var l, u, d, f, p, m, h, g, _, v, y, b, ee;
559
+ c = await be({
560
+ ...s(),
561
+ productsSearchQuery: {
562
+ productItemSettings: (l = this.instance.store.options.components) == null || (l = l.search) == null || (l = l.common) == null ? void 0 : l.productItemSettings,
563
+ appSettings: (u = this.instance.store) == null ? void 0 : u.options.appSettings,
564
+ dataTypes: [T.PRODUCTS],
565
+ variants: this.searchVariants(),
566
+ sortMap: (d = this.instance.store.options.components) == null || (d = d.search) == null || (d = d.common) == null ? void 0 : d.sortMap,
567
+ pager: {
568
+ page: (e == null || (f = e.search) == null || (f = f.pagination) == null ? void 0 : f.page) ?? 1,
569
+ pageSize: (e == null || (p = e.search) == null || (p = p.pagination) == null ? void 0 : p.pageSize) ?? 12
570
+ },
571
+ search: {
572
+ cid: (m = e.search) == null ? void 0 : m.cid,
573
+ partType: ((h = e.search) == null ? void 0 : h.partsType) || De.ALL,
574
+ searchType: (g = e.search) == null ? void 0 : g.searchType,
575
+ searchText: ((_ = e.search) == null ? void 0 : _.searchText) ?? void 0,
576
+ filter: (v = e.search) == null ? void 0 : v.filters,
577
+ masterProductId: ((y = e.search) == null ? void 0 : y.masterProductId) ?? void 0
578
+ },
579
+ sort: {
580
+ field: ((b = e.search) == null ? void 0 : b.sortField) ?? ue.PRODUCT,
581
+ direction: ((ee = e.search) == null ? void 0 : ee.sortDirection) ?? ce.ASCENDING
582
+ }
583
+ }
584
+ }, {
585
+ client: this.client,
586
+ signal: a.signal
587
+ });
588
+ } catch (t) {
589
+ if (He(t)) return;
590
+ throw this.trackSearch(e, {
591
+ status: "error",
592
+ durationMs: Date.now() - o
593
+ }, i), t;
594
+ }
595
+ this.loadController === a && (this.trackSearch(e, ae((n = c.products) == null ? void 0 : n.totalCount, (r = c.products) == null ? void 0 : r.items, Date.now() - o), i), this.instance.eventBus.emit("search-loaded", c), c.products && this.storeService.setData(Q.Products, c.products), this.instance.store.data.isLoadingData = !1);
596
+ }
597
+ searchAttribution() {
598
+ let { action: e, source: t, trigger: n = "ui" } = Be(this.instance) ?? {};
599
+ return {
600
+ origin: e ?? "route",
601
+ trigger: n,
602
+ ...t ? { source: t } : {}
603
+ };
604
+ }
605
+ trackSearch(e, t, n) {
606
+ var r, i, a, o, s, c;
607
+ g(this.instance, {
608
+ kind: "search",
609
+ action: "search",
610
+ trigger: n.trigger,
611
+ origin: n.origin,
612
+ ...n.source ? { source: n.source } : {},
613
+ args: {
614
+ searchText: ((r = e.search) == null ? void 0 : r.searchText) ?? null,
615
+ searchType: ((i = e.search) == null ? void 0 : i.searchType) ?? null,
616
+ cid: ((a = e.search) == null ? void 0 : a.cid) ?? null,
617
+ page: ((o = e.search) == null || (o = o.pagination) == null ? void 0 : o.page) ?? 1,
618
+ pageSize: ((s = e.search) == null || (s = s.pagination) == null ? void 0 : s.pageSize) ?? 12,
619
+ appliedFilterCount: ((c = e.search) == null || (c = c.filters) == null || (c = c.rules) == null ? void 0 : c.length) ?? 0
620
+ },
621
+ outcome: t
622
+ });
623
+ }
624
+ async query(e) {
625
+ var t, n, r, i, a, o, c, l, u;
626
+ let { pagination: d, searchText: f, searchType: p, cid: m, filters: h, sortField: g, sortDirection: _, partsType: v, masterProductId: y } = e.search ?? {}, b = this.instance.getRegisteredSearchDataTypes();
627
+ if (!b.length) return Promise.resolve();
628
+ let ee = this.searchAttribution();
629
+ (t = this.loadController) == null || t.abort();
630
+ let te = new AbortController();
631
+ this.loadController = te, this.instance.store.data.isLoadingData = !0;
632
+ let ne = Date.now(), x = {
633
+ appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings,
634
+ dataTypes: b,
635
+ variants: this.searchVariants(),
636
+ productItemSettings: (r = this.instance.store.options.components) == null || (r = r.search) == null || (r = r.common) == null ? void 0 : r.productItemSettings,
637
+ sortMap: (i = this.instance.store.options.components) == null || (i = i.search) == null || (i = i.common) == null ? void 0 : i.sortMap,
638
+ classifications: { maxClassificationImages: (a = this.instance.store.options.components) == null || (a = a.search) == null || (a = a.common) == null ? void 0 : a.maxCategoryImages },
639
+ pager: {
640
+ page: (d == null ? void 0 : d.page) ?? 1,
641
+ pageSize: (d == null ? void 0 : d.pageSize) ?? 12
642
+ },
643
+ search: {
644
+ cid: m,
645
+ partType: v || De.ALL,
646
+ searchType: p,
647
+ searchText: f ?? void 0,
648
+ filter: h,
649
+ masterProductId: y ?? void 0
650
+ },
651
+ sort: {
652
+ field: g ?? ue.PRODUCT,
653
+ direction: _ ?? ce.ASCENDING
654
+ },
655
+ filters: {
656
+ attributeCodes: (o = this.instance.store.options.components) == null || (o = o.search) == null || (o = o.filters) == null ? void 0 : o.attributeCodes,
657
+ maxFilterAttributes: (c = this.instance.store.options.components) == null || (c = c.search) == null || (c = c.filters) == null ? void 0 : c.maxFiltersVisible
658
+ }
659
+ }, S;
660
+ if (this.instance.store.options.httpInterceptor) try {
661
+ S = await this.instance.store.options.httpInterceptor({
662
+ body: x,
663
+ url: qt.search,
664
+ method: "post"
665
+ });
666
+ } catch {}
667
+ if (this.loadController !== te) return;
668
+ let C = S;
669
+ try {
670
+ C || (C = await be({
671
+ ...s(),
672
+ productsSearchQuery: x
673
+ }, {
674
+ client: this.client,
675
+ signal: te.signal
676
+ }));
677
+ } catch (t) {
678
+ if (He(t)) return;
679
+ throw this.trackSearch(e, {
680
+ status: "error",
681
+ durationMs: Date.now() - ne
682
+ }, ee), t;
683
+ }
684
+ this.loadController === te && (this.trackSearch(e, ae((l = C.products) == null ? void 0 : l.totalCount, (u = C.products) == null ? void 0 : u.items, Date.now() - ne), ee), this.instance.eventBus.emit("search-loaded", C), C.products && this.storeService.setData(Q.Products, C.products), C.classifications && this.storeService.setData(Q.Classifications, C.classifications), C.filters && this.storeService.setData(Q.Filters, C.filters), C.breadcrumbs && this.storeService.setData(Q.Breadcrumbs, C.breadcrumbs), C.configurators && this.storeService.setData(Q.Configurators, C.configurators), C.partTypes && this.storeService.setData(Q.PartTypes, C.partTypes), C.masterProducts && this.storeService.setData(Q.MasterProducts, C.masterProducts), this.instance.store.data.isLoadingData = !1, this.instance.eventBus.emit("search-changed"));
685
+ }
686
+ async detail(e) {
687
+ var t, n, r, i, a, o;
688
+ let c = (t = e.detail) == null ? void 0 : t.productId, l = (n = e.search) == null ? void 0 : n.cid;
689
+ if (!c) return Promise.resolve();
690
+ let u = this.instance.getRegisteredDetailsDataTypes();
691
+ if (!u.length) return Promise.resolve();
692
+ (r = this.loadController) == null || r.abort();
693
+ let d = new AbortController();
694
+ this.loadController = d, this.instance.store.data.isLoadingData = !0, this.instance.store.data.productDetail = void 0, (i = this.variantTableController) == null || i.abort(), await this.storeService.setData(Q.ProductVariantsTable, void 0);
695
+ let f = {
696
+ appSettings: (a = this.instance.store) == null ? void 0 : a.options.appSettings,
697
+ dataTypes: u,
698
+ search: {
699
+ productId: c,
700
+ cid: l
701
+ },
702
+ productItemSettings: (o = this.instance.store) == null || (o = o.options.components) == null || (o = o.details) == null || (o = o.data) == null ? void 0 : o.productItemSettings,
703
+ relationships: this.relationshipSettings(),
704
+ variants: this.detailVariants()
705
+ }, p;
706
+ if (this.instance.store.options.httpInterceptor) try {
707
+ p = await this.instance.store.options.httpInterceptor({
708
+ body: f,
709
+ url: qt.detail,
710
+ method: "post"
711
+ });
712
+ } catch {}
713
+ if (this.loadController !== d) return;
714
+ let m = p;
715
+ if (!m) try {
716
+ m = await S({
717
+ ...s(),
718
+ detailQuery: f
719
+ }, {
720
+ client: this.client,
721
+ signal: d.signal
722
+ });
723
+ } catch (e) {
724
+ if (He(e)) return;
725
+ throw e;
726
+ }
727
+ this.loadController === d && (this.instance.eventBus.emit("detail-loaded", m), m.productDetails ? (this.storeService.setData(Q.ProductDetails, m.productDetails), this.storeService.setData(Q.ProductIdToName, {
728
+ item: m.productDetails.item,
729
+ requestedProductId: c
730
+ })) : this.storeService.setData(Q.ProductDetails, void 0), m.attributeGroups && this.storeService.setData(Q.AttributeGroups, m.attributeGroups), m.productRelationships && this.storeService.setData(Q.ProductRelationships, m.productRelationships), m.productClassifications && this.storeService.setData(Q.ProductClassifications, m.productClassifications), m.relatedLinks ? this.storeService.setData(Q.RelatedLinks, m.relatedLinks) : this.storeService.setData(Q.RelatedLinks, void 0), m.productVariantsSelector && this.storeService.setData(Q.ProductVariantsSelector, m.productVariantsSelector), m.productVariantsTable && this.storeService.setData(Q.ProductVariantsTable, m.productVariantsTable), m.productVariantsDropdown && this.storeService.setData(Q.ProductVariantsDropdown, m.productVariantsDropdown), this.storeService.setData(Q.RelatedProducts, m.relatedProducts || void 0), this.instance.store.data.isLoadingData = !1);
731
+ }
732
+ async loadVariantTableGroup(e) {
733
+ var t, n, r, i, a;
734
+ let { productId: o } = this.instance.router.routeData.detail ?? {};
735
+ if (!o || !e) return;
736
+ let c = (t = this.instance.store.data.productVariantsTable) == null || (t = t.items) == null ? void 0 : t.find((t) => t.attributeCode === e);
737
+ if ((c == null ? void 0 : c.products) !== void 0 && c.variantAttributes !== void 0) return;
738
+ (n = this.variantTableController) == null || n.abort();
739
+ let l = new AbortController();
740
+ this.variantTableController = l;
741
+ let u = {
742
+ appSettings: this.instance.store.options.appSettings,
743
+ attributeCode: e,
744
+ productItemSettings: (r = this.detailVariants()) == null ? void 0 : r.productItemSettings,
745
+ search: { productId: o }
746
+ }, d;
747
+ if (this.instance.store.options.httpInterceptor && (d = await this.instance.store.options.httpInterceptor({
748
+ body: u,
749
+ url: qt.variantsTable,
750
+ method: "post"
751
+ }), l.signal.aborted || this.variantTableController !== l)) return;
752
+ let f;
753
+ try {
754
+ f = d ?? await Fe({
755
+ ...s(),
756
+ productVariantsTableQuery: u
757
+ }, {
758
+ client: this.client,
759
+ signal: l.signal
760
+ });
761
+ } catch (e) {
762
+ if (He(e)) return;
763
+ throw e;
764
+ }
765
+ if (l.signal.aborted || this.variantTableController !== l) return;
766
+ let p = (i = f.items) == null ? void 0 : i[0];
767
+ if (((a = f.items) == null ? void 0 : a.length) !== 1 || (p == null ? void 0 : p.attributeCode) !== e) throw Error(`Variants table group "${e}" was not returned.`);
768
+ await this.storeService.setData(Q.ProductVariantsTable, f);
769
+ }
770
+ async compare(e) {
771
+ var t;
772
+ (t = this.loadController) == null || t.abort();
773
+ let n = new AbortController();
774
+ this.loadController = n, this.instance.store.data.isLoadingData = !0;
775
+ let r;
776
+ try {
777
+ var i, a, o, c, l, u, d, f;
778
+ r = await x({
779
+ ...s(),
780
+ compareQuery: {
781
+ appSettings: (i = this.instance.store) == null ? void 0 : i.options.appSettings,
782
+ search: {
783
+ productIds: ((a = e.compare) == null ? void 0 : a.productIds) ?? [],
784
+ mergeMethod: ((o = e.compare) == null ? void 0 : o.mergeMethod) ?? te.FLAT,
785
+ cids: ((c = e.compare) == null ? void 0 : c.cids) ?? [],
786
+ differencesOnly: (l = e.compare) == null ? void 0 : l.differencesOnly,
787
+ strictMode: (u = e.compare) == null ? void 0 : u.strictMode,
788
+ specialDocumentHandling: (d = e.compare) == null ? void 0 : d.specialDocumentHandling
789
+ },
790
+ productItemSettings: (f = this.instance.store.options.components) == null || (f = f.compare) == null || (f = f.view) == null ? void 0 : f.productItemSettings
791
+ }
792
+ }, {
793
+ client: this.client,
794
+ signal: n.signal
795
+ });
796
+ } catch (e) {
797
+ if (He(e)) return;
798
+ throw e;
799
+ }
800
+ this.loadController === n && (this.instance.eventBus.emit("compare-loaded", r), r && this.storeService.setData(Q.ProductCompare, r), this.instance.store.data.isLoadingData = !1);
801
+ }
802
+ async preview(e) {
803
+ var t, n, r, i;
804
+ this.instance.store.data.isLoadingData = !0;
805
+ let a = await re({
806
+ ...s(),
807
+ previewQuery: {
808
+ appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
809
+ search: {
810
+ productId: e,
811
+ cid: (n = this.instance.getRouteData().search) == null ? void 0 : n.cid,
812
+ filter: (r = this.instance.getRouteData().search) == null ? void 0 : r.filters
813
+ },
814
+ productItemSettings: (i = this.instance.store.options.components) == null || (i = i.preview) == null || (i = i.view) == null ? void 0 : i.productItemSettings
815
+ }
816
+ }, { client: this.client });
817
+ this.instance.eventBus.emit("preview-loaded", a), a && this.storeService.setData(Q.ProductPreview, a), this.instance.store.data.isLoadingData = !1;
818
+ }
819
+ async filterValues(e) {
820
+ var t;
821
+ let { searchText: n, searchType: r, cid: i, filters: a, partsType: o } = this.instance.router.routeData.search ?? {};
822
+ return await Ae({
823
+ ...s(),
824
+ filterValueQuery: {
825
+ appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
826
+ variants: this.searchVariants(),
827
+ search: {
828
+ cid: i,
829
+ searchText: n,
830
+ searchType: r,
831
+ partType: o,
832
+ filter: a,
833
+ attributeCodes: e
834
+ }
835
+ }
836
+ }, { client: this.client });
837
+ }
838
+ async filters() {
839
+ var e;
840
+ let { searchText: t, searchType: n, cid: r, filters: i, partsType: a } = this.instance.router.routeData.search ?? {};
841
+ return await Te({
842
+ ...s(),
843
+ filtersQuery: {
844
+ appSettings: (e = this.instance.store) == null ? void 0 : e.options.appSettings,
845
+ variants: this.searchVariants(),
846
+ search: {
847
+ cid: r,
848
+ searchText: t,
849
+ searchType: n,
850
+ partType: a,
851
+ filter: i
852
+ }
853
+ }
854
+ }, { client: this.client });
855
+ }
856
+ async loadTranslations() {
857
+ var e;
858
+ let t = await this.fetchTranslations(Xt, qt.translations), n = (e = this.instance.store) == null ? void 0 : e.options.dataInterceptor, r = {
859
+ type: Q.Translations,
860
+ data: kt({ items: t }),
861
+ instance: this.instance
862
+ };
863
+ if (n) {
864
+ var i;
865
+ let e = await n(r);
866
+ return e.type === "Translations" ? (i = e.data) == null ? void 0 : i.items : t;
867
+ }
868
+ return t;
869
+ }
870
+ async loadPrmRelationship(e, t) {
871
+ var n;
872
+ return await Ee({
873
+ ...s(),
874
+ relationshipQuery: {
875
+ appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings,
876
+ relationships: this.relationshipSettings(t),
877
+ search: e
878
+ }
879
+ }, { client: this.client });
880
+ }
881
+ async loadPrmRelationshipAutocomplete(e, t) {
882
+ var n;
883
+ return await Me({
884
+ ...s(),
885
+ relationshipAutocompleteQuery: {
886
+ appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings,
887
+ relationships: this.relationshipAutocompleteSettings(t),
888
+ search: e
889
+ }
890
+ }, { client: this.client });
891
+ }
892
+ async loadPrmRelationshipFilterValues(e) {
893
+ var t;
894
+ return await se({
895
+ ...s(),
896
+ relationshipFilterValueQuery: {
897
+ appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
898
+ search: e
899
+ }
900
+ }, { client: this.client });
901
+ }
902
+ async autocomplete(e, t) {
903
+ var n, r, i;
904
+ let { action: a, source: o, trigger: c = "ui" } = Be(this.instance) ?? {};
905
+ this.autocompleteController && this.autocompleteController.abort(), this.autocompleteController = new AbortController();
906
+ let { cid: l, searchType: u, partsType: d, filters: f } = this.instance.router.routeData.search ?? {}, p = (n = this.instance.store.options.components) == null || (n = n.search) == null ? void 0 : n.form, m = (r = this.instance.store.options.components) == null || (r = r.search) == null || (r = r.common) == null ? void 0 : r.productItemSettings, h = {
907
+ appSettings: (i = this.instance.store) == null ? void 0 : i.options.appSettings,
908
+ variants: this.searchVariants(),
909
+ productItemSettings: {
910
+ ...m,
911
+ maxProductImages: p != null && p.showProductImages ? (m == null ? void 0 : m.maxProductImages) ?? 1 : 0
912
+ },
913
+ pager: {
914
+ page: 1,
915
+ pageSize: 5
916
+ },
917
+ search: {
918
+ cid: t ? void 0 : l,
919
+ searchType: t ? xe.HIERARCHICAL : u,
920
+ searchText: e ?? void 0,
921
+ filter: f,
922
+ partType: d
923
+ },
924
+ autoCategoryNavigation: p == null ? void 0 : p.autoCategoryNavigation,
925
+ fetchCategoryImages: t ? !0 : p == null ? void 0 : p.showCategoryImages,
926
+ categorySearch: t ? !0 : p == null ? void 0 : p.categorySearch,
927
+ categoryKeywordSearch: t ? !0 : p == null ? void 0 : p.categoryKeywordSearch
928
+ }, _ = JSON.stringify(h);
929
+ if (this.autocompleteCache[_]) return Promise.resolve(this.autocompleteCache[_]);
930
+ let v = Date.now(), y;
931
+ try {
932
+ y = await pe({
933
+ ...s(),
934
+ autocompleteQuery: h
935
+ }, {
936
+ client: this.client,
937
+ signal: this.autocompleteController.signal
938
+ });
939
+ } catch (t) {
940
+ throw He(t) || g(this.instance, {
941
+ kind: "autocomplete",
942
+ action: "autocomplete",
943
+ trigger: c,
944
+ ...a ? { origin: a } : {},
945
+ ...o ? { source: o } : {},
946
+ args: { searchText: e },
947
+ outcome: {
948
+ status: "error",
949
+ durationMs: Date.now() - v
950
+ }
951
+ }), t;
952
+ }
953
+ return this.autocompleteCache[_] = y, g(this.instance, {
954
+ kind: "autocomplete",
955
+ action: "autocomplete",
956
+ trigger: c,
957
+ ...a ? { origin: a } : {},
958
+ ...o ? { source: o } : {},
959
+ args: { searchText: e },
960
+ outcome: ae(y.totalCount, y.items, Date.now() - v)
961
+ }), y;
962
+ }
963
+ async loadFiltersResultCount(e) {
964
+ var t;
965
+ let { cid: n, searchType: r, searchText: i, partsType: a } = this.instance.router.routeData.search ?? {}, o = {
966
+ appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
967
+ variants: this.searchVariants(),
968
+ search: {
969
+ cid: n,
970
+ searchType: r,
971
+ searchText: i,
972
+ filter: e,
973
+ partType: a
974
+ }
975
+ }, c = JSON.stringify(o);
976
+ if (this._lastFilterLoad.key == c) return Promise.resolve({ totalCount: this._lastFilterLoad.count });
977
+ let l;
978
+ if (this.instance.store.options.httpInterceptor) try {
979
+ l = await this.instance.store.options.httpInterceptor({
980
+ body: o,
981
+ url: qt.count,
982
+ method: "post"
983
+ });
984
+ } catch {}
985
+ try {
986
+ let e = l ?? await ne({
987
+ ...s(),
988
+ countQuery: o
989
+ }, { client: this.client });
990
+ return this._lastFilterLoad.key = c, this._lastFilterLoad.count = e.totalCount, e;
991
+ } catch {
992
+ return Promise.resolve({ totalCount: 0 });
993
+ }
994
+ }
995
+ async loadFavoriteViews(e) {
996
+ try {
997
+ var t;
998
+ let n = await le({
999
+ ...s(),
1000
+ favoriteViewsQuery: {
1001
+ appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings,
1002
+ search: { ids: e }
1003
+ }
1004
+ }, { client: this.client }), r = n.items ? n.items : [];
1005
+ return this.storeService.setData(Q.FavoriteViews, { items: r }), r;
1006
+ } catch (e) {
1007
+ return this.instance.logger.log("Failed to fetch favorite views", e), [];
1008
+ }
1009
+ }
1010
+ async saveFavoriteView(e, t, n) {
1011
+ try {
1012
+ var r, i, a, o, c, l, u, d, f, m, h;
1013
+ let v = {
1014
+ code: t,
1015
+ data: {
1016
+ treeType: k.PRODUCTS,
1017
+ pager: {
1018
+ page: (n == null || (r = n.search) == null || (r = r.pagination) == null ? void 0 : r.page) ?? 1,
1019
+ pageSize: (n == null || (i = n.search) == null || (i = i.pagination) == null ? void 0 : i.pageSize) ?? 12
1020
+ },
1021
+ search: {
1022
+ cid: (a = n.search) == null ? void 0 : a.cid,
1023
+ partType: (o = n.search) == null ? void 0 : o.partsType,
1024
+ searchType: (c = n.search) == null ? void 0 : c.searchType,
1025
+ searchText: ((l = n.search) == null ? void 0 : l.searchText) ?? void 0,
1026
+ filter: (u = n.search) == null ? void 0 : u.filters,
1027
+ masterProductId: ((d = n.search) == null ? void 0 : d.masterProductId) ?? void 0
1028
+ },
1029
+ sort: {
1030
+ field: ((f = n.search) == null ? void 0 : f.sortField) ?? ue.PRODUCT,
1031
+ direction: ((m = n.search) == null ? void 0 : m.sortDirection) ?? ce.ASCENDING
1032
+ }
1033
+ }
1034
+ }, y = (h = this.instance.store) == null ? void 0 : h.options.appSettings, b = e ? await Ne({
1035
+ ...s(),
1036
+ id: e,
1037
+ favoriteViewUpdateAction: {
1038
+ appSettings: y,
1039
+ favoriteView: v
1040
+ }
1041
+ }, { client: this.client }) : await p({
1042
+ ...s(),
1043
+ favoriteViewCreateAction: {
1044
+ appSettings: y,
1045
+ favoriteView: v
1046
+ }
1047
+ }, { client: this.client });
1048
+ if (b.id) {
1049
+ var g;
1050
+ let e = (((g = this.instance.store) == null || (g = g.data.favoriteViews) == null ? void 0 : g.items) || []).find((e) => e.id === b.id);
1051
+ if (e) Object.assign(e, b);
1052
+ else {
1053
+ var _;
1054
+ this.storeService.setData(Q.FavoriteViews, { items: [...((_ = this.instance.store) == null || (_ = _.data.favoriteViews) == null ? void 0 : _.items) || [], b] });
1055
+ }
1056
+ return b;
1057
+ }
1058
+ } catch (e) {
1059
+ this.instance.logger.log("Failed to fetch favorite views", e);
1060
+ }
1061
+ }
1062
+ async deleteFavoriteView(t) {
1063
+ try {
1064
+ var n;
1065
+ if (await e({
1066
+ ...s(),
1067
+ id: t,
1068
+ favoriteViewDeleteAction: { appSettings: (n = this.instance.store) == null ? void 0 : n.options.appSettings }
1069
+ }, { client: this.client })) {
1070
+ var r;
1071
+ return this.storeService.setData(Q.FavoriteViews, { items: (((r = this.instance.store) == null || (r = r.data.favoriteViews) == null ? void 0 : r.items) ?? []).filter((e) => e.id !== t) }), t;
1072
+ }
1073
+ } catch (e) {
1074
+ this.instance.logger.log("Failed to delete favorite view", e);
1075
+ }
1076
+ }
1077
+ async generatePDFUrl(e) {
1078
+ this.instance.store.data.isLoadingData = !0;
1079
+ try {
1080
+ var t;
1081
+ let n = await he({
1082
+ ...s(),
1083
+ pdfQuery: {
1084
+ search: { productId: e },
1085
+ appSettings: (t = this.instance.store) == null ? void 0 : t.options.appSettings
1086
+ }
1087
+ }, { client: this.client });
1088
+ if (n && n.guid) return this.instance.store.data.isLoadingData = !1, `${this.instance.getOptions().baseUrl}/v2/Products/Pdf/Downloads/${encodeURIComponent(n.guid)}`;
1089
+ } catch (e) {
1090
+ this.instance.logger.log("Failed to print product to pdf", e);
1091
+ }
1092
+ this.instance.store.data.isLoadingData = !1;
1093
+ }
1094
+ async getCatalogOptions() {
1095
+ return h(s(), { client: this.client });
1096
+ }
1097
+ async getAllCatalogs() {
1098
+ var e, t;
1099
+ return b({
1100
+ ...s(),
1101
+ catalogSearchQuery: {
1102
+ appSettings: {
1103
+ appCode: (e = this.instance.store) == null || (e = e.options.appSettings) == null ? void 0 : e.appCode,
1104
+ langCode: (t = this.instance.store) == null || (t = t.options.appSettings) == null ? void 0 : t.langCode
1105
+ },
1106
+ pager: {
1107
+ page: 1,
1108
+ pageSize: 1e3
1109
+ }
1110
+ }
1111
+ }, { client: this.client });
1112
+ }
1113
+ async addCatalog(e, t, n) {
1114
+ return _e({
1115
+ ...s(),
1116
+ catalogCreateAction: {
1117
+ code: e,
1118
+ type: t,
1119
+ description: n
1120
+ }
1121
+ }, { client: this.client });
1122
+ }
1123
+ async addProductToCatalog(e, t) {
1124
+ var n, r;
1125
+ return y({
1126
+ ...s(),
1127
+ catalogId: e,
1128
+ catalogProductAddAction: {
1129
+ appSettings: {
1130
+ appCode: (n = this.instance.store) == null || (n = n.options.appSettings) == null ? void 0 : n.appCode,
1131
+ langCode: (r = this.instance.store) == null || (r = r.options.appSettings) == null ? void 0 : r.langCode
1132
+ },
1133
+ products: t
1134
+ }
1135
+ }, { client: this.client });
1136
+ }
1137
+ }, Qt = 50, $t = class {
1138
+ constructor(e) {
1139
+ j(this, "instance", void 0), j(this, "routeData", kt(D($e))), j(this, "history", []), this.instance = e;
1140
+ }
1141
+ async setRoute(e, t = !1) {
1142
+ let n = D(this.routeData);
1143
+ if (e) {
1144
+ var r;
1145
+ if ((r = e.search) != null && r.pagination) {
1146
+ var i;
1147
+ it(e.search.pagination, (i = this.routeData) == null || (i = i.search) == null ? void 0 : i.pagination);
1148
+ }
1149
+ w(n, e), l(n, $e);
1150
+ }
1151
+ if (this.history.length > 0 && fe(n, D(this.routeData))) return;
1152
+ let a = !1;
1153
+ if (!t && this.history.length > 1 && n.view == "search") {
1154
+ let e = this.history[this.history.length - 1];
1155
+ a = fe(e, n, (e) => e === "subView");
1156
+ }
1157
+ if (a) {
1158
+ this.commitRoute(n);
1159
+ return;
1160
+ }
1161
+ let o = !1;
1162
+ if (!t && this.history.length > 1 && n.view == "search") {
1163
+ let e = this.history[this.history.length - 1];
1164
+ o = fe(e, n, (e) => e === "page" || e === "pageSize");
1165
+ }
1166
+ let s = D(this.routeData);
1167
+ if (w(s, n), this.instance.props.nextRoute = s, this.instance.store.data.isInitialized && this.instance.httpService) {
1168
+ if (t) return this.commitRoute(n);
1169
+ if (o) return await this.instance.httpService.paginate(n), this.commitRoute(n);
1170
+ var c;
1171
+ return await ((c = this.instance.httpService) == null ? void 0 : c.load(n)), this.commitRoute(n);
1172
+ }
1173
+ return this.commitRoute(n);
1174
+ }
1175
+ commitRoute(e) {
1176
+ this.instance.props.nextRoute = null, this.history.push(D(e)), this.history.length > Qt && this.history.shift(), this.merge(e);
1177
+ let t = D(this.routeData);
1178
+ setTimeout(() => this.instance.eventBus.emit("route-changed", t), 10);
1179
+ }
1180
+ merge(e) {
1181
+ w(this.routeData, e);
1182
+ }
1183
+ async reload() {
1184
+ var e, t;
1185
+ (e = this.routeData) != null && (e = e.search) != null && e.pagination && (this.routeData.search.pagination.page = 1), await ((t = this.instance.httpService) == null ? void 0 : t.load(this.routeData));
1186
+ }
1187
+ async back(e = 1) {
1188
+ let t = this.history.length - e - 1, n = this.history[t];
1189
+ return n && this.history.splice(t), this.setRoute(n ?? $e);
1190
+ }
1191
+ }, en = class {
1192
+ get lifetimeSignal() {
1193
+ return this.lifetimeController.signal;
1194
+ }
1195
+ constructor(e, t) {
1196
+ j(this, "id", void 0), j(this, "accessor", void 0), j(this, "helpers", void 0), j(this, "instanceType", "Products"), j(this, "props", {}), j(this, "lifetimeController", new AbortController()), j(this, "onReadyDisposers", []), j(this, "httpService", void 0), j(this, "store", kt({
1197
+ notifications: [],
1198
+ data: {
1199
+ isInitialized: !1,
1200
+ actions: {
1201
+ data: null,
1202
+ current: null
1203
+ }
1204
+ },
1205
+ options: { isInitialized: !1 }
1206
+ })), j(this, "router", new $t(this)), j(this, "translations", new u(this)), j(this, "commandExecutor", new lt(this)), j(this, "logger", c), j(this, "registeredComponents", kt(/* @__PURE__ */ new Set())), j(this, "dataTypesRequired", kt(/* @__PURE__ */ new Set())), j(this, "eventBus", d()), j(this, "eventBusExt", ve(this.eventBus)), j(this, "selection", new gt(this)), this.id = e, this.accessor = t, this.helpers = Kt(this);
1207
+ }
1208
+ isInitialized() {
1209
+ return this.store.data.isInitialized;
1210
+ }
1211
+ async reload() {
1212
+ await this.translations.load(), await this.router.reload();
1213
+ }
1214
+ setRoute(e) {
1215
+ this.router.setRoute(e);
1216
+ }
1217
+ async init(e, t) {
1218
+ if (this.store.data.isInitialized) throw Error(`Instance "${this.id}" is already initialized`);
1219
+ _("products", e), i(e);
1220
+ let r = n(e == null ? void 0 : e.baseUrl), a = this.store.options.isInitialized ? this.store.options : new Gt();
1221
+ ge(a, e), t && this.router.merge(t), this.store.options = a, this.store.options.isInitialized = !0, this.httpService = new Zt(this, r, a.accessToken), this.store.data.isInitialized = !0, this.router.setRoute(t);
1222
+ try {
1223
+ return await this.translations.load(), Promise.resolve();
1224
+ } catch (e) {
1225
+ this.store.data.isInitialized = !1;
1226
+ let t = ke(a.errorInterceptor, {
1227
+ type: "InitError",
1228
+ message: "PIS initialization error.",
1229
+ isHandled: !1
1230
+ });
1231
+ return console.error("[PIS] initialization error", t, e), Promise.reject(Error("PIS initialization error", { cause: e }));
1232
+ }
1233
+ }
1234
+ update(e, t) {
1235
+ _("products", e), i(e);
1236
+ let n = this.store.options.isInitialized ? this.store.options : new Gt();
1237
+ ge(n, e), this.store.options = n, this.store.options.isInitialized = !0, t && this.router.setRoute(t);
1238
+ }
1239
+ on(e, t) {
1240
+ this.eventBusExt.on(e, t);
1241
+ }
1242
+ onReady(e) {
1243
+ let t = Nt(() => this.store.data.isInitialized, (n) => {
1244
+ n && (e(), t());
1245
+ });
1246
+ this.onReadyDisposers.push(t);
1247
+ }
1248
+ off(e, t) {
1249
+ e ? this.eventBusExt.off(e, t) : this.eventBusExt.all.clear();
1250
+ }
1251
+ registerComponent(e) {
1252
+ this.registeredComponents.add(e);
1253
+ }
1254
+ registerRequiredDataTypes(e) {
1255
+ e.forEach((e) => this.dataTypesRequired.add(e));
1256
+ }
1257
+ getRegisteredSearchDataTypes() {
1258
+ if (this.dataTypesRequired && this.dataTypesRequired.size) {
1259
+ var e, t;
1260
+ let n = Object.values(T), r = Array.from(this.dataTypesRequired).filter((e) => n.includes(e));
1261
+ return (e = this.store.options.components) != null && (e = e.search) != null && (e = e.common) != null && (e = e.configurators) != null && e.visible && r.push(T.CONFIGURATORS), ((t = this.store.options.appSettings) == null ? void 0 : t.treeType) == k.PARTS && r.push(T.MASTER_PRODUCTS), [...new Set(r)];
1262
+ }
1263
+ return [];
1264
+ }
1265
+ getRegisteredDetailsDataTypes() {
1266
+ if (this.dataTypesRequired && this.dataTypesRequired.size) {
1267
+ var e, t, n, r;
1268
+ let i = Object.values(O), a = Array.from(this.dataTypesRequired).filter((e) => i.includes(e));
1269
+ return a.push(O.EXTENDED_OBJECT_DATA), (e = this.store.options.components) != null && (e = e.details) != null && (e = e.variantsSelector) != null && e.visible && a.push(O.PRODUCT_VARIANTS_SELECTOR), (t = this.store.options.components) != null && (t = t.details) != null && (t = t.variantsDropdown) != null && t.visible && a.push(O.PRODUCT_VARIANTS_DROPDOWN), (n = this.store.options.components) != null && (n = n.details) != null && (n = n.variantsTable) != null && n.visible && a.push(O.PRODUCT_VARIANTS_TABLE), (r = this.store.options.components) != null && (r = r.details) != null && (r = r.relatedLinks) != null && r.visible && a.push(O.RELATED_LINKS), [...new Set(a)];
1270
+ }
1271
+ return [];
1272
+ }
1273
+ teardown() {
1274
+ this.lifetimeController.abort();
1275
+ for (let e of this.onReadyDisposers) e();
1276
+ this.onReadyDisposers.length = 0;
1277
+ }
1278
+ destroy() {
1279
+ return this.teardown(), this.accessor.destroyInstance(this.id);
1280
+ }
1281
+ execute(e, t) {
1282
+ return this.commandExecutor.execute(e, t);
1283
+ }
1284
+ executeCommand(e, ...t) {
1285
+ return this.commandExecutor.executeCommand(e, ...t);
1286
+ }
1287
+ trackUserAction(e) {
1288
+ Le(this, e);
1289
+ }
1290
+ getDefaultOptions() {
1291
+ return t(new Gt());
1292
+ }
1293
+ getDefaultRouteData() {
1294
+ return D($e);
1295
+ }
1296
+ getOptions() {
1297
+ return this.store.options;
1298
+ }
1299
+ getRouteData() {
1300
+ return this.props.nextRoute ? this.props.nextRoute : D(this.router.routeData);
1301
+ }
1302
+ }, tn = class {
1303
+ constructor() {
1304
+ j(this, "instances", kt(/* @__PURE__ */ new Map()));
1305
+ }
1306
+ destroyInstance(e) {
1307
+ try {
1308
+ let t = this.instances.get(e);
1309
+ t == null || t.teardown(), t == null || t.off();
1310
+ } catch {}
1311
+ this.instances.delete(e);
1312
+ }
1313
+ getInstance(e) {
1314
+ let t = this.instances.size;
1315
+ if (e !== void 0) {
1316
+ if (this.instances.has(e)) return this.instances.get(e);
1317
+ {
1318
+ let t = new en(e, this);
1319
+ return this.instances.set(e, t), t;
1320
+ }
1321
+ }
1322
+ if (t === 1) return this.instances.values().next().value;
1323
+ if (t > 1) throw Error("[PIS Products] Cannot pick default instance if more than one exists");
1324
+ }
1325
+ setAccessTokenInAllInstances(e) {
1326
+ this.instances.forEach((t) => {
1327
+ t.getOptions().accessToken = e;
1328
+ });
1329
+ }
1330
+ }, nn = Ve({
1331
+ getInstance: (e) => Ct.Products.getInstance(e),
1332
+ instanceTag: "pis-products-instance",
1333
+ isReadyIncludesOptions: !0,
1334
+ filtersCommands: {
1335
+ getFilters: () => new Xe(),
1336
+ getFilterValues: (e) => new St({ attributeCodes: e }),
1337
+ applyFilters: (e) => new ct({ filters: e }),
1338
+ excludeFilter: (e, t) => new xt({
1339
+ attributeCode: e,
1340
+ value: t
1341
+ })
1342
+ }
1343
+ });
1344
+ function $(e, t, n) {
1345
+ return nn(e, t, n);
1346
+ }
1347
+ //#endregion
1348
+ //#region src/products/composables/routeData.ts
1349
+ var rn = {}, an = (e) => {
1350
+ let t = e.id;
1351
+ if (!rn[t]) {
1352
+ let n = N(() => [...e.router.history ?? []].reverse()), r = N(() => n.value.findIndex(({ view: e }) => e === "search"));
1353
+ rn[t] = {
1354
+ historyReversed: n,
1355
+ lastSearchIndex: r,
1356
+ previousProductName: N(() => {
1357
+ if (r.value > 1) {
1358
+ var t, i;
1359
+ let r = (t = e.router.routeData.detail) == null ? void 0 : t.productId, o = (i = n.value.find((e) => {
1360
+ var t;
1361
+ return !(e.view !== "detail" || r && ((t = e.detail) == null ? void 0 : t.productId) === r);
1362
+ })) == null || (i = i.detail) == null ? void 0 : i.productId;
1363
+ if (o) {
1364
+ var a;
1365
+ return (((a = e.store) == null ? void 0 : a.data.productIdToDisplayName) || {})[o];
1366
+ }
1367
+ }
1368
+ })
1369
+ };
1370
+ }
1371
+ return rn[t];
1372
+ }, on = B({
1373
+ components: {
1374
+ Btn: ye,
1375
+ Tooltip: we,
1376
+ Icon: E
1377
+ },
1378
+ props: {
1379
+ instance: {
1380
+ type: Object,
1381
+ required: !0
1382
+ },
1383
+ t: {
1384
+ type: Function,
1385
+ required: !0
1386
+ }
1387
+ },
1388
+ setup(e) {
1389
+ let { lastSearchIndex: t, previousProductName: n } = an(e.instance);
1390
+ return {
1391
+ allowBack: N(() => {
1392
+ var t;
1393
+ return ((t = e.instance) == null || (t = t.store) == null ? void 0 : t.data.itemNotFound) !== !0;
1394
+ }),
1395
+ lastSearchIndex: t,
1396
+ previousProductName: n,
1397
+ navigateBack: async () => {
1398
+ try {
1399
+ var t;
1400
+ await ((t = e.instance) == null ? void 0 : t.execute(new yt().from("navigation-btns")));
1401
+ } catch {}
1402
+ },
1403
+ navigateToSearch: async () => {
1404
+ try {
1405
+ if (t.value > 0) {
1406
+ var n;
1407
+ await ((n = e.instance) == null ? void 0 : n.execute(new yt({ step: t.value }).from("navigation-btns")));
1408
+ } else {
1409
+ var r;
1410
+ await ((r = e.instance) == null ? void 0 : r.execute(new Ze().from("navigation-btns")));
1411
+ }
1412
+ } catch {}
1413
+ }
1414
+ };
1415
+ }
1416
+ }), sn = { class: "d-flex flex-wrap gap-3" }, cn = { class: "text-nowrap pis-text-ellipsis" }, ln = { class: "text-nowrap text-truncate" };
1417
+ function un(e, t, n, r, i, a) {
1418
+ let o = K("Icon"), s = K("Btn"), c = K("Tooltip");
1419
+ return H(), I("div", sn, [e.allowBack ? (H(), P(s, {
1420
+ key: 0,
1421
+ class: "pis-mw-10-rem ext-back",
1422
+ variant: "secondary",
1423
+ onClick: Z(e.navigateToSearch, ["prevent"])
1424
+ }, {
1425
+ default: Y(() => [z(o, {
1426
+ name: "arrow-left",
1427
+ size: 16,
1428
+ class: "me-2"
1429
+ }), L("span", cn, J(e.t("BackToSearch", !0)), 1)]),
1430
+ _: 1
1431
+ }, 8, ["onClick"])) : F("", !0), e.lastSearchIndex > 1 && e.previousProductName ? (H(), P(c, {
1432
+ key: 1,
1433
+ text: e.previousProductName,
1434
+ placement: "bottom",
1435
+ trigger: "hover focus"
1436
+ }, {
1437
+ default: Y(() => [z(s, {
1438
+ class: "mw-100 d-block ext-prod-back",
1439
+ variant: "secondary",
1440
+ onClick: Z(e.navigateBack, ["prevent"])
1441
+ }, {
1442
+ default: Y(() => [z(o, {
1443
+ name: "arrow-left",
1444
+ size: 16,
1445
+ class: "me-2"
1446
+ }), L("span", ln, J(e.previousProductName ?? e.t("PreviousProduct", !0)), 1)]),
1447
+ _: 1
1448
+ }, 8, ["onClick"])]),
1449
+ _: 1
1450
+ }, 8, ["text"])) : F("", !0)]);
1451
+ }
1452
+ var dn = /*#__PURE__*/ A(on, [["render", un]]), fn = B({
1453
+ name: "PisReplacements",
1454
+ components: {
1455
+ PisLink: pt,
1456
+ Icon: E
1457
+ },
1458
+ props: {
1459
+ replacements: {
1460
+ type: Object,
1461
+ required: !0
1462
+ },
1463
+ instance: {
1464
+ type: Object,
1465
+ required: !0
1466
+ },
1467
+ showIcon: Boolean,
1468
+ isDetailView: Boolean,
1469
+ visible: Boolean
1470
+ },
1471
+ setup(e) {
1472
+ let t = async (t, n) => {
1473
+ if (e.isDetailView) {
1474
+ let e = "#pis-anchor-attr-TechnicalInformation", t = n == null ? void 0 : n.getRootNode(), r = (t && "querySelector" in t ? t.querySelector(e) : null) ?? document.querySelector(e);
1475
+ r && r.scrollIntoView({ behavior: "smooth" });
1476
+ } else try {
1477
+ var r;
1478
+ await ((r = e.instance) == null ? void 0 : r.execute(new nt({ productId: t }).from("pis-replacements")));
1479
+ } catch {}
1480
+ };
1481
+ return {
1482
+ LinkTypeEnum: ie,
1483
+ renderLink: (e) => {
1484
+ var n;
1485
+ let r = (n = e.link) == null ? void 0 : n.text;
1486
+ if (!r) return Tt("span", e.label ?? "");
1487
+ let i = /{([^}]+)}/, a = [], o = r, s;
1488
+ for (; (s = i.exec(o)) !== null;) {
1489
+ let e = o.slice(0, s.index);
1490
+ e && a.push(e);
1491
+ let n = s[1].split("|"), r = n[0], i = n[1] ?? r;
1492
+ a.push(Tt("a", {
1493
+ href: "#",
1494
+ role: "button",
1495
+ onClick: (e) => {
1496
+ e.preventDefault(), t(r, e.currentTarget);
1497
+ },
1498
+ onKeydown: (e) => {
1499
+ e.key === " " && (e.preventDefault(), t(r, e.currentTarget));
1500
+ }
1501
+ }, i)), o = o.slice(s.index + s[0].length);
1502
+ }
1503
+ return o && a.push(o), a.length === 0 ? Tt("span", e.label ?? "") : Tt("span", a);
1504
+ },
1505
+ navigate: t
1506
+ };
1507
+ }
1508
+ }), pn = {
1509
+ key: 0,
1510
+ class: "pis-replacements"
1511
+ }, mn = {
1512
+ key: 1,
1513
+ class: "fw-bold"
1514
+ }, hn = { class: "fw-bold" }, gn = { class: "fw-bold text-nowrap" };
1515
+ function _n(e, t, n, r, i, a) {
1516
+ let o = K("icon"), s = K("PisLink"), c = q("pis-test-key");
1517
+ return e.replacements && e.replacements.length && e.visible ? (H(), I("div", pn, [(H(!0), I(M, null, W(e.replacements, (n, r) => X((H(), I("div", {
1518
+ key: r,
1519
+ class: V({ "d-flex": e.showIcon })
1520
+ }, [e.showIcon ? (H(), P(o, {
1521
+ key: 0,
1522
+ class: "text-muted me-2",
1523
+ name: "information-circle",
1524
+ lg: ""
1525
+ })) : F("", !0), n.link && n.link.type === e.LinkTypeEnum.TECHNICAL_INFORMATION ? (H(), I("span", mn, [(H(), P(At(e.renderLink(n))))])) : (H(), I(M, { key: 2 }, [
1526
+ L("span", hn, J(n.label), 1),
1527
+ t[0] || (t[0] = R("\xA0 ", -1)),
1528
+ n.link ? (H(), P(s, {
1529
+ key: 0,
1530
+ instance: e.instance,
1531
+ link: n.link,
1532
+ "clear-search": !0
1533
+ }, {
1534
+ default: Y(() => [L("span", gn, J(n.link.text), 1)]),
1535
+ _: 2
1536
+ }, 1032, ["instance", "link"])) : F("", !0)
1537
+ ], 64))], 2)), [[c, n]])), 128))])) : F("", !0);
1538
+ }
1539
+ var vn = /*#__PURE__*/ A(fn, [["render", _n]]), yn = B({
1540
+ components: { FiltersNavigatorModalBase: Ue },
1541
+ inheritAttrs: !1,
1542
+ props: {
1543
+ show: Boolean,
1544
+ title: {
1545
+ type: String,
1546
+ required: !0
1547
+ },
1548
+ isMobile: Boolean,
1549
+ t: {
1550
+ type: Function,
1551
+ required: !0
1552
+ },
1553
+ filtersAll: {
1554
+ type: Array,
1555
+ default: void 0
1556
+ },
1557
+ filtersPromoted: {
1558
+ type: Array,
1559
+ default: void 0
1560
+ },
1561
+ filtersAdditional: {
1562
+ type: Array,
1563
+ default: void 0
1564
+ },
1565
+ filtersFetched: Map,
1566
+ filtersModel: {
1567
+ type: Object,
1568
+ default: void 0
1569
+ },
1570
+ filteredResultCount: {
1571
+ type: Number,
1572
+ default: void 0
1573
+ },
1574
+ filteredResultCountLoading: Boolean,
1575
+ fetchFilterValues: {
1576
+ type: Function,
1577
+ required: !0
1578
+ },
1579
+ clearFiltersModelFromEmptyValues: {
1580
+ type: Function,
1581
+ default: void 0
1582
+ }
1583
+ }
1584
+ });
1585
+ //#endregion
1586
+ //#region src/products/components/common/FiltersNavigatorModal.vue
1587
+ function bn(e, t, n, r, i, a) {
1588
+ let o = K("FiltersNavigatorModalBase");
1589
+ return H(), P(o, Et(e.$attrs, {
1590
+ show: e.show,
1591
+ title: e.title,
1592
+ "is-mobile": e.isMobile,
1593
+ t: e.t,
1594
+ "filters-all": e.filtersAll,
1595
+ "filters-promoted": e.filtersPromoted,
1596
+ "filters-additional": e.filtersAdditional,
1597
+ "filters-fetched": e.filtersFetched,
1598
+ "filters-model": e.filtersModel,
1599
+ "filtered-result-count": e.filteredResultCount,
1600
+ "filtered-result-count-loading": e.filteredResultCountLoading,
1601
+ "fetch-filter-values": e.fetchFilterValues,
1602
+ "clear-filters-model-from-empty-values": e.clearFiltersModelFromEmptyValues,
1603
+ "reset-filter-on-open": ""
1604
+ }), null, 16, [
1605
+ "show",
1606
+ "title",
1607
+ "is-mobile",
1608
+ "t",
1609
+ "filters-all",
1610
+ "filters-promoted",
1611
+ "filters-additional",
1612
+ "filters-fetched",
1613
+ "filters-model",
1614
+ "filtered-result-count",
1615
+ "filtered-result-count-loading",
1616
+ "fetch-filter-values",
1617
+ "clear-filters-model-from-empty-values"
1618
+ ]);
1619
+ }
1620
+ var xn = /*#__PURE__*/ A(yn, [["render", bn]]), Sn = B({
1621
+ name: "PrmListSearchForm",
1622
+ components: {
1623
+ FormInputClearable: me,
1624
+ Dropdown: je,
1625
+ Btn: ye,
1626
+ Clickable: C,
1627
+ Spinner: Pe,
1628
+ Highlighter: oe
1629
+ },
1630
+ props: {
1631
+ instance: {
1632
+ type: Object,
1633
+ required: !0
1634
+ },
1635
+ productId: {
1636
+ type: String,
1637
+ required: !0
1638
+ },
1639
+ relationshipType: {
1640
+ type: String,
1641
+ required: !0
1642
+ },
1643
+ relationshipCode: {
1644
+ type: String,
1645
+ required: !1,
1646
+ default: void 0
1647
+ },
1648
+ filterCriteria: {
1649
+ type: Object,
1650
+ required: !0
1651
+ },
1652
+ t: {
1653
+ type: Function,
1654
+ required: !0
1655
+ },
1656
+ modelValue: {
1657
+ type: String,
1658
+ default: ""
1659
+ }
1660
+ },
1661
+ emits: [
1662
+ "update:modelValue",
1663
+ "search",
1664
+ "clear"
1665
+ ],
1666
+ setup(e, { emit: t }) {
1667
+ let n = U(e.modelValue), r = U(!1), i = U(!1), a = U({
1668
+ totalCount: 0,
1669
+ itemsCount: 0,
1670
+ items: []
1671
+ }), o = (e, t) => {
1672
+ if (e.attributes) {
1673
+ let n = e.attributes[t];
1674
+ if (n && n.values) return n.values[0].text;
1675
+ }
1676
+ }, s = (e) => {
1677
+ if (e.attributes) {
1678
+ let t = e.attributes["#AllIdentifiers"];
1679
+ if (t && t.values) return t.values.map((e) => e.text).join(", ");
1680
+ }
1681
+ }, c = ze(async (t) => {
1682
+ let n = t != null && t.length > 2;
1683
+ if (r.value = n, n) {
1684
+ i.value = !0;
1685
+ try {
1686
+ var c;
1687
+ let n = new Ge({
1688
+ search: {
1689
+ productId: e.productId,
1690
+ searchText: t,
1691
+ relationshipType: e.relationshipType,
1692
+ relationshipCode: e.relationshipCode,
1693
+ filter: e.filterCriteria
1694
+ },
1695
+ pager: {
1696
+ page: 1,
1697
+ pageSize: 5
1698
+ }
1699
+ }), r = await ((c = e.instance) == null ? void 0 : c.execute(n));
1700
+ if (r) {
1701
+ var l;
1702
+ let e = (r.items || []).map((e) => ({
1703
+ text: o(e, "#DisplayName") || e.productId || "",
1704
+ secondaryText: s(e) || "",
1705
+ description: o(e, "CatalogDescription") || ""
1706
+ }));
1707
+ a.value = {
1708
+ totalCount: r.totalCount || 0,
1709
+ itemsCount: ((l = r.items) == null ? void 0 : l.length) || 0,
1710
+ items: e
1711
+ };
1712
+ } else a.value = {
1713
+ totalCount: 0,
1714
+ itemsCount: 0,
1715
+ items: []
1716
+ };
1717
+ } catch {}
1718
+ i.value = !1;
1719
+ } else a.value = {
1720
+ totalCount: 0,
1721
+ itemsCount: 0,
1722
+ items: []
1723
+ };
1724
+ }, 300), l = ze(() => {
1725
+ t("update:modelValue", n.value), c(n.value), n.value || t("search", "");
1726
+ }, 300);
1727
+ return {
1728
+ searchText: n,
1729
+ isAutocompleteVisible: r,
1730
+ isAutocompleteLoading: i,
1731
+ autocomplete: a,
1732
+ highlightTerms: N(() => {
1733
+ if (!n.value) return [];
1734
+ let e = n.value.trim().toLowerCase().split(/[._-\s/]+/);
1735
+ return e.push(n.value.trim()), e;
1736
+ }),
1737
+ onSearchInput: l,
1738
+ onEnter: () => {
1739
+ r.value = !1, t("update:modelValue", n.value), t("search", n.value);
1740
+ },
1741
+ onClear: () => {
1742
+ n.value = "", a.value = {
1743
+ totalCount: 0,
1744
+ itemsCount: 0,
1745
+ items: []
1746
+ }, t("update:modelValue", ""), t("clear");
1747
+ },
1748
+ selectItem: (e) => {
1749
+ n.value = e, r.value = !1, t("update:modelValue", e), t("search", e);
1750
+ },
1751
+ openAutocomplete: () => {
1752
+ n.value && n.value.length > 2 && (r.value = !0, c(n.value));
1753
+ }
1754
+ };
1755
+ }
1756
+ }), Cn = { class: "d-flex align-items-center" }, wn = { class: "fw-bold ext-display-name" }, Tn = {
1757
+ key: 0,
1758
+ class: "small ext-all-identifiers text-wrap"
1759
+ }, En = {
1760
+ key: 1,
1761
+ class: "small ext-description text-wrap"
1762
+ }, Dn = {
1763
+ key: 0,
1764
+ class: "text-center"
1765
+ }, On = { key: 1 }, kn = { key: 2 };
1766
+ function An(e, t, n, r, i, a) {
1767
+ let o = K("Highlighter"), s = K("Clickable"), c = K("Spinner"), l = K("FormInputClearable"), u = K("Btn"), d = K("Dropdown"), f = q("pis-test-key");
1768
+ return H(), P(d, {
1769
+ open: e.isAutocompleteVisible,
1770
+ "onUpdate:open": t[2] || (t[2] = (t) => e.isAutocompleteVisible = t),
1771
+ "min-width": "300px",
1772
+ items: e.autocomplete.items
1773
+ }, {
1774
+ item: Y(({ item: t }) => [X((H(), P(s, {
1775
+ class: "dropdown-item mb-1",
1776
+ onClick: (n) => e.selectItem(t.text)
1777
+ }, {
1778
+ default: Y(() => [L("div", Cn, [L("div", null, [
1779
+ L("div", wn, [z(o, {
1780
+ "highlight-class-name": "text-primary p-0 display-inline bg-transparent ext-highlight",
1781
+ "highlight-tag": "span",
1782
+ "search-words": e.highlightTerms,
1783
+ "auto-escape": !0,
1784
+ "text-to-highlight": t.text || ""
1785
+ }, null, 8, ["search-words", "text-to-highlight"])]),
1786
+ t.text != t.secondaryText && t.secondaryText ? (H(), I("div", Tn, [z(o, {
1787
+ "highlight-class-name": "fw-bold text-primary p-0 display-inline bg-transparent ext-highlight",
1788
+ "highlight-tag": "span",
1789
+ "search-words": e.highlightTerms,
1790
+ "auto-escape": !0,
1791
+ "text-to-highlight": t.secondaryText
1792
+ }, null, 8, ["search-words", "text-to-highlight"])])) : F("", !0),
1793
+ t.description ? (H(), I("div", En, [z(o, {
1794
+ "highlight-class-name": "fw-bold text-primary p-0 display-inline bg-transparent ext-highlight",
1795
+ "highlight-tag": "span",
1796
+ "search-words": e.highlightTerms,
1797
+ "auto-escape": !0,
1798
+ "text-to-highlight": t.description
1799
+ }, null, 8, ["search-words", "text-to-highlight"])])) : F("", !0)
1800
+ ])])]),
1801
+ _: 2
1802
+ }, 1032, ["onClick"])), [[f, t]])]),
1803
+ footer: Y(() => [e.isAutocompleteLoading ? (H(), I("div", Dn, [z(c, { sm: "" })])) : e.autocomplete.totalCount ? (H(), I("small", On, J(e.t("ShowingNOfNMatches", !1, [`${e.autocomplete.itemsCount}`, `${e.autocomplete.totalCount}`])), 1)) : e.searchText && e.searchText.length > 2 ? (H(), I("small", kn, J(e.t("NoResults")), 1)) : F("", !0)]),
1804
+ activator: Y(({ on: n }) => [L("form", {
1805
+ class: "input-group flex-nowrap",
1806
+ onSubmit: t[1] || (t[1] = Z((...t) => e.onEnter && e.onEnter(...t), ["prevent"]))
1807
+ }, [z(l, Et({
1808
+ modelValue: e.searchText,
1809
+ "onUpdate:modelValue": t[0] || (t[0] = (t) => e.searchText = t),
1810
+ modelModifiers: { trim: !0 },
1811
+ "class-inner": "border-end-0",
1812
+ placeholder: e.t("SearchProductsInputPlaceholder")
1813
+ }, jt(n), {
1814
+ "onUpdate:modelValue": e.onSearchInput,
1815
+ onKeyup: Pt(e.onEnter, ["enter"]),
1816
+ onClear: e.onClear,
1817
+ onFocus: e.openAutocomplete
1818
+ }), null, 16, [
1819
+ "modelValue",
1820
+ "placeholder",
1821
+ "onUpdate:modelValue",
1822
+ "onKeyup",
1823
+ "onClear",
1824
+ "onFocus"
1825
+ ]), z(u, {
1826
+ "aria-label": e.t("SearchProductsInputAriaLabel"),
1827
+ icon: "lens-search-find"
1828
+ }, {
1829
+ default: Y(() => [L("span", null, J(e.t("SearchButtonText")), 1)]),
1830
+ _: 1
1831
+ }, 8, ["aria-label"])], 32)]),
1832
+ _: 1
1833
+ }, 8, ["open", "items"]);
1834
+ }
1835
+ var jn = /*#__PURE__*/ A(Sn, [["render", An]]), Mn = B({
1836
+ name: "PrmSearchList",
1837
+ components: {
1838
+ Icon: E,
1839
+ PisReplacements: vn,
1840
+ Tooltip: we,
1841
+ MountPoint: de,
1842
+ Clickable: C,
1843
+ Image: Ye
1844
+ },
1845
+ props: {
1846
+ products: {
1847
+ type: Array,
1848
+ required: !0
1849
+ },
1850
+ instance: {
1851
+ type: Object,
1852
+ required: !0
1853
+ },
1854
+ t: {
1855
+ type: Function,
1856
+ required: !0
1857
+ },
1858
+ emit: {
1859
+ type: Function,
1860
+ required: !0
1861
+ }
1862
+ },
1863
+ setup(e) {
1864
+ let t = U(), n = N(() => {
1865
+ var t;
1866
+ return (t = e.instance) == null ? void 0 : t.store;
1867
+ }), i = N(() => e.products), o = N(() => {
1868
+ var e;
1869
+ return ((e = n.value) == null || (e = e.options.components) == null || (e = e.search) == null ? void 0 : e.list) ?? {};
1870
+ }), s = N(() => {
1871
+ var t;
1872
+ return ((t = e.instance) == null ? void 0 : t.registeredComponents.has("pis-products-preview")) ?? !1;
1873
+ }), c = N(() => {
1874
+ var e;
1875
+ return ((e = n.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideReplacements) != 1;
1876
+ }), l = (e) => o.value.actionTemplate && (o.value.showActionTemplateIfInactive || !(e != null && e.inactive)), u = async (t) => {
1877
+ try {
1878
+ var n;
1879
+ await ((n = e.instance) == null ? void 0 : n.execute(new Je({ productId: t.productId }).from("prm-search-list")));
1880
+ } catch {}
1881
+ }, d = async (t) => {
1882
+ if (!(t != null && t.inactive) && t) try {
1883
+ var n;
1884
+ await ((n = e.instance) == null ? void 0 : n.execute(new nt(t).from("prm-search-list")));
1885
+ } catch {}
1886
+ }, f = Se((t) => ({
1887
+ instance: e.instance,
1888
+ item: t.item,
1889
+ emit: e.emit,
1890
+ t: e.t
1891
+ })), p = Se((t) => ({
1892
+ instance: e.instance,
1893
+ item: t.item,
1894
+ emit: e.emit,
1895
+ details: d,
1896
+ attrValue: v,
1897
+ t: e.t
1898
+ }));
1899
+ return {
1900
+ root: t,
1901
+ componentOptions: o,
1902
+ productsItems: i,
1903
+ previewEnabled: s,
1904
+ replacementsVisible: c,
1905
+ showActionTemplate: l,
1906
+ attrValue: v,
1907
+ attrValues: a,
1908
+ details: d,
1909
+ preview: u,
1910
+ additionalInfoText: Re,
1911
+ variantsAvailableInfo: r,
1912
+ imageOverlayCtx: f,
1913
+ itemCtx: p
1914
+ };
1915
+ }
1916
+ }), Nn = { key: 0 }, Pn = { class: "row align-items-center" }, Fn = {
1917
+ key: 1,
1918
+ class: "position-absolute p-2 top-50 start-0 ext-select-checkbox",
1919
+ style: {
1920
+ "z-index": "1",
1921
+ width: "auto",
1922
+ "margin-top": "-1rem"
1923
+ }
1924
+ }, In = ["checked", "onClick"], Ln = { class: "position-relative col d-flex justify-content-center align-items-center card" }, Rn = { key: 0 }, zn = { class: "col" }, Bn = {
1925
+ key: 0,
1926
+ class: "text-muted"
1927
+ }, Vn = ["onClick"], Hn = { key: 5 }, Un = {
1928
+ key: 7,
1929
+ class: "d-flex align-items-center fw-bold mt-1"
1930
+ };
1931
+ function Wn(e, t, n, r, i, a) {
1932
+ let o = K("Icon"), s = K("Clickable"), c = K("Image"), l = K("MountPoint"), u = K("Tooltip"), d = K("PisReplacements"), f = q("pis-test-key"), p = q("safe-html");
1933
+ return H(), I("div", {
1934
+ ref: "root",
1935
+ class: V(["pis-component", "pis-prm-search-list"])
1936
+ }, [e.productsItems && e.productsItems.length ? (H(), I("div", Nn, [(H(!0), I(M, null, W(e.productsItems, (t) => {
1937
+ var n, r, i;
1938
+ return X((H(), I("div", {
1939
+ key: t.productId,
1940
+ class: V(["card mb-3 p-3", {
1941
+ "bg-light": t.exactMatch,
1942
+ "ext-selected": (n = e.instance) == null ? void 0 : n.selection.isSelected(t)
1943
+ }])
1944
+ }, [L("div", Pn, [
1945
+ e.previewEnabled ? (H(), P(s, {
1946
+ key: 0,
1947
+ class: "position-absolute p-2 top-0 start-0 d-flex ext-icon-preview",
1948
+ "hover-mode": "primary",
1949
+ style: {
1950
+ "z-index": "1",
1951
+ width: "auto"
1952
+ },
1953
+ title: e.t("Preview", !0),
1954
+ disabled: t.inactive,
1955
+ onClick: (n) => !t.inactive && e.preview(t)
1956
+ }, {
1957
+ default: Y(() => [z(o, {
1958
+ class: "text-muted",
1959
+ name: "document-analysis",
1960
+ size: 24
1961
+ })]),
1962
+ _: 1
1963
+ }, 8, [
1964
+ "title",
1965
+ "disabled",
1966
+ "onClick"
1967
+ ])) : F("", !0),
1968
+ e.componentOptions.selectable ? (H(), I("div", Fn, [L("input", {
1969
+ type: "checkbox",
1970
+ class: "form-check-input",
1971
+ checked: (r = e.instance) == null ? void 0 : r.selection.isSelected(t),
1972
+ onClick: (n) => {
1973
+ var r;
1974
+ return (r = e.instance) == null ? void 0 : r.selection.toggle(t);
1975
+ }
1976
+ }, null, 8, In)])) : F("", !0),
1977
+ L("div", {
1978
+ class: V([e.previewEnabled || e.componentOptions.selectable ? "ms-4" : "", "col"]),
1979
+ style: Dt({ "max-width": e.componentOptions.imageSize })
1980
+ }, [L("div", Ln, [z(c, {
1981
+ style: Dt({ "max-width": e.componentOptions.imageSize }),
1982
+ src: (i = (t.images || [])[0]) == null ? void 0 : i.url,
1983
+ clickable: e.componentOptions.navigateOnContentClick && !t.inactive,
1984
+ "hide-frame": !0,
1985
+ padding: e.componentOptions.imagePadding,
1986
+ "lazy-loading": e.componentOptions.imageLazyLoading,
1987
+ onClick: (n) => e.details(t)
1988
+ }, null, 8, [
1989
+ "style",
1990
+ "src",
1991
+ "clickable",
1992
+ "padding",
1993
+ "lazy-loading",
1994
+ "onClick"
1995
+ ]), e.componentOptions.imageOverlayTemplate ? (H(), I("div", Rn, [z(l, {
1996
+ callbacks: e.componentOptions.imageOverlayTemplate,
1997
+ ctx: e.imageOverlayCtx({ item: t })
1998
+ }, null, 8, ["callbacks", "ctx"])])) : F("", !0)])], 6),
1999
+ L("div", zn, [
2000
+ t.additionalInfo && t.additionalInfo.length ? (H(), P(u, {
2001
+ key: 0,
2002
+ text: e.additionalInfoText(t.additionalInfo)
2003
+ }, {
2004
+ default: Y(() => [z(o, {
2005
+ class: "text-warning me-1",
2006
+ name: "warning-triangle"
2007
+ })]),
2008
+ _: 1
2009
+ }, 8, ["text"])) : F("", !0),
2010
+ e.componentOptions.titleTemplate ? (H(), P(l, {
2011
+ key: 1,
2012
+ callbacks: e.componentOptions.titleTemplate,
2013
+ ctx: e.itemCtx({ item: t })
2014
+ }, null, 8, ["callbacks", "ctx"])) : (H(), I(M, { key: 2 }, [t.inactive ? (H(), I("strong", Bn, J(e.attrValue(t, "#DisplayName")), 1)) : (H(), I("a", {
2015
+ key: 1,
2016
+ href: "#",
2017
+ onClick: Z((n) => e.details(t), ["prevent"])
2018
+ }, [L("strong", null, J(e.attrValue(t, "#DisplayName")), 1)], 8, Vn))], 64)),
2019
+ e.componentOptions.showAllIdentifiers ? (H(!0), I(M, { key: 3 }, W(e.attrValues(t, "#AllIdentifiers"), (e, t) => X((H(), I("div", {
2020
+ key: t,
2021
+ class: "small text-muted fw-bold"
2022
+ }, [R(J(e), 1)])), [[f, e]])), 128)) : F("", !0),
2023
+ e.componentOptions.itemTemplate ? (H(), P(l, {
2024
+ key: 4,
2025
+ callbacks: e.componentOptions.itemTemplate,
2026
+ ctx: e.itemCtx({ item: t })
2027
+ }, null, 8, ["callbacks", "ctx"])) : (H(), I("div", Hn, [L("span", null, J(e.attrValue(t, "CatalogDescription")), 1)])),
2028
+ t.replacements && t.replacements.length && e.componentOptions.showReplacements ? (H(), P(d, {
2029
+ key: 6,
2030
+ instance: e.instance,
2031
+ replacements: t.replacements,
2032
+ visible: e.replacementsVisible
2033
+ }, null, 8, [
2034
+ "instance",
2035
+ "replacements",
2036
+ "visible"
2037
+ ])) : F("", !0),
2038
+ e.componentOptions.showVariants && t.variantsAvailable ? (H(), I("div", Un, [z(o, {
2039
+ class: "text-muted me-2",
2040
+ name: "information-circle"
2041
+ }), X(L("span", null, null, 512), [[p, e.t("VariantsAvailable") + ": " + e.variantsAvailableInfo(t.variantAttributes) + "."]])])) : F("", !0)
2042
+ ]),
2043
+ e.componentOptions.additionalColumnTemplate ? (H(), I("div", {
2044
+ key: 2,
2045
+ class: V("col-" + e.componentOptions.additionalColumnTemplateWidth)
2046
+ }, [z(l, {
2047
+ callbacks: e.componentOptions.additionalColumnTemplate,
2048
+ ctx: e.itemCtx({ item: t })
2049
+ }, null, 8, ["callbacks", "ctx"])], 2)) : F("", !0),
2050
+ e.showActionTemplate(t) ? (H(), I("div", {
2051
+ key: 3,
2052
+ class: V("col-" + e.componentOptions.actionTemplateWidth)
2053
+ }, [z(l, {
2054
+ callbacks: e.componentOptions.actionTemplate,
2055
+ ctx: e.itemCtx({ item: t })
2056
+ }, null, 8, ["callbacks", "ctx"])], 2)) : F("", !0)
2057
+ ])], 2)), [[f, t]]);
2058
+ }), 128))])) : F("", !0)], 512);
2059
+ }
2060
+ var Gn = /*#__PURE__*/ A(Mn, [["render", Wn]]), Kn = B({
2061
+ name: "PrmSearchTable",
2062
+ components: {
2063
+ Icon: E,
2064
+ Tooltip: we,
2065
+ PisReplacements: vn,
2066
+ Clickable: C,
2067
+ MountPoint: de
2068
+ },
2069
+ props: {
2070
+ products: {
2071
+ type: Array,
2072
+ required: !0
2073
+ },
2074
+ relationshipColumns: {
2075
+ type: Array,
2076
+ required: !0
2077
+ },
2078
+ instance: {
2079
+ type: Object,
2080
+ required: !0
2081
+ },
2082
+ t: {
2083
+ type: Function,
2084
+ required: !0
2085
+ },
2086
+ emit: {
2087
+ type: Function,
2088
+ required: !0
2089
+ },
2090
+ relationship: {
2091
+ type: Object,
2092
+ required: !0
2093
+ },
2094
+ actionTemplate: {
2095
+ type: Object,
2096
+ default: void 0
2097
+ }
2098
+ },
2099
+ setup(e) {
2100
+ let t = U(), n = N(() => e.products), i = N(() => {
2101
+ var t;
2102
+ return (t = e.instance) == null ? void 0 : t.store;
2103
+ }), o = N(() => {
2104
+ var t;
2105
+ return ((t = e.instance) == null ? void 0 : t.registeredComponents.has("pis-products-preview")) ?? !1;
2106
+ }), s = N(() => {
2107
+ var e;
2108
+ return ((e = i.value) == null || (e = e.options.components) == null || (e = e.search) == null ? void 0 : e.table) ?? {};
2109
+ }), c = N(() => {
2110
+ var t, n;
2111
+ let r = (t = s.value.columns) == null ? void 0 : t.filter((e) => e.treeTypes.indexOf(k.PRODUCTS) > -1), i = [];
2112
+ if (r != null && r.length) {
2113
+ var a;
2114
+ i.push({
2115
+ ...r[0],
2116
+ headerTemplate: void 0,
2117
+ caption: ((a = e.relationshipColumns[0]) == null ? void 0 : a.text) ?? r[0].caption
2118
+ });
2119
+ }
2120
+ let o = e.relationshipColumns[1];
2121
+ if ((o == null ? void 0 : o.dataField) === "CatalogDescription" && r && r.length > 1) {
2122
+ i.push({
2123
+ ...r[1],
2124
+ headerTemplate: void 0,
2125
+ caption: o.text ?? r[1].caption
2126
+ });
2127
+ let t = e.relationshipColumns.slice(2).map((e) => ({
2128
+ caption: e.text,
2129
+ dataField: e.dataField,
2130
+ treeTypes: [k.PRODUCTS]
2131
+ }));
2132
+ i.push(...t);
2133
+ } else {
2134
+ let t = e.relationshipColumns.slice(1).map((e) => ({
2135
+ caption: e.text,
2136
+ dataField: e.dataField,
2137
+ treeTypes: [k.PRODUCTS]
2138
+ }));
2139
+ i.push(...t);
2140
+ }
2141
+ return (n = e.actionTemplate) != null && n.cellTemplate && i.push({
2142
+ caption: "",
2143
+ width: e.actionTemplate.columnWidth,
2144
+ treeTypes: [k.PRODUCTS],
2145
+ headerTemplate: e.actionTemplate.headerTemplate,
2146
+ cellTemplate: e.actionTemplate.cellTemplate
2147
+ }), i;
2148
+ }), l = N(() => {
2149
+ var e;
2150
+ return (e = n.value) == null ? void 0 : e.some(({ additionalInfo: e }) => e == null ? void 0 : e.length);
2151
+ }), u = N(() => {
2152
+ var e;
2153
+ return ((e = i.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideReplacements) != 1;
2154
+ }), d = async (t) => {
2155
+ if (t) try {
2156
+ var n;
2157
+ await ((n = e.instance) == null ? void 0 : n.execute(new nt(t).from("prm-search-table")));
2158
+ } catch {}
2159
+ }, f = async (t) => {
2160
+ try {
2161
+ var n;
2162
+ await ((n = e.instance) == null ? void 0 : n.execute(new Je({ productId: t.productId }).from("prm-search-table")));
2163
+ } catch {}
2164
+ }, p = Se((t) => ({
2165
+ instance: e.instance,
2166
+ col: t.col,
2167
+ item: t.item,
2168
+ emit: e.emit,
2169
+ details: d,
2170
+ attrValue: v,
2171
+ attrValues: a,
2172
+ t: e.t,
2173
+ relationship: e.relationship,
2174
+ row: t.item
2175
+ }));
2176
+ return {
2177
+ root: t,
2178
+ componentOptions: s,
2179
+ productsItems: n,
2180
+ previewEnabled: o,
2181
+ columns: c,
2182
+ shouldDisplayAdditionalInfo: l,
2183
+ replacementsVisible: u,
2184
+ details: d,
2185
+ preview: f,
2186
+ attrValue: v,
2187
+ attrValues: a,
2188
+ additionalInfoText: Re,
2189
+ variantsAvailableInfo: r,
2190
+ reactiveContext: Oe,
2191
+ cellCtx: p
2192
+ };
2193
+ }
2194
+ }), qn = {
2195
+ key: 0,
2196
+ class: "table-responsive pis-scroll"
2197
+ }, Jn = { class: "table" }, Yn = {
2198
+ key: 0,
2199
+ style: { width: "1%" }
2200
+ }, Xn = {
2201
+ key: 1,
2202
+ style: { width: "1%" }
2203
+ }, Zn = {
2204
+ key: 2,
2205
+ style: { width: "1%" }
2206
+ }, Qn = { key: 0 }, $n = { key: 1 }, er = { key: 2 }, tr = { key: 0 }, nr = { class: "ext-select-checkbox" }, rr = ["checked", "onClick"], ir = { key: 1 }, ar = { key: 2 }, or = { key: 1 }, sr = { key: 2 }, cr = {
2207
+ key: 4,
2208
+ class: "d-flex align-items-center fw-bold mt-1"
2209
+ };
2210
+ function lr(e, t, n, r, i, a) {
2211
+ let o = K("MountPoint"), s = K("Icon"), c = K("Clickable"), l = K("Tooltip"), u = K("PisReplacements"), d = q("pis-test-key"), f = q("safe-html");
2212
+ return H(), I("div", {
2213
+ ref: "root",
2214
+ class: V(["pis-component", "pis-prm-search-table"])
2215
+ }, [e.productsItems && e.productsItems.length ? (H(), I("div", qn, [L("table", Jn, [
2216
+ L("colgroup", null, [
2217
+ e.componentOptions.selectable ? (H(), I("col", Yn)) : F("", !0),
2218
+ e.previewEnabled ? (H(), I("col", Xn)) : F("", !0),
2219
+ e.shouldDisplayAdditionalInfo ? (H(), I("col", Zn)) : F("", !0),
2220
+ (H(!0), I(M, null, W(e.columns, (e, t) => X((H(), I("col", {
2221
+ key: t,
2222
+ style: Dt({ width: e.width })
2223
+ }, null, 4)), [[d, e]])), 128))
2224
+ ]),
2225
+ L("thead", null, [L("tr", null, [
2226
+ e.componentOptions.selectable ? (H(), I("th", Qn)) : F("", !0),
2227
+ e.previewEnabled ? (H(), I("th", $n)) : F("", !0),
2228
+ e.shouldDisplayAdditionalInfo ? (H(), I("th", er)) : F("", !0),
2229
+ (H(!0), I(M, null, W(e.columns, (t, n) => X((H(), I("th", { key: n }, [t.headerTemplate ? (H(), P(o, {
2230
+ key: 0,
2231
+ callbacks: t.headerTemplate,
2232
+ ctx: e.reactiveContext({
2233
+ t: e.t,
2234
+ col: t
2235
+ })
2236
+ }, null, 8, ["callbacks", "ctx"])) : (H(), I(M, { key: 1 }, [R(J(t.caption), 1)], 64))])), [[d, t]])), 128))
2237
+ ])]),
2238
+ L("tbody", null, [(H(!0), I(M, null, W(e.productsItems, (t) => {
2239
+ var n, r;
2240
+ return X((H(), I("tr", {
2241
+ key: t.productId,
2242
+ class: V({
2243
+ "bg-light": t.exactMatch,
2244
+ "ext-selected": (n = e.instance) == null ? void 0 : n.selection.isSelected(t)
2245
+ })
2246
+ }, [
2247
+ e.componentOptions.selectable ? (H(), I("td", tr, [L("div", nr, [L("input", {
2248
+ type: "checkbox",
2249
+ class: "form-check-input",
2250
+ checked: (r = e.instance) == null ? void 0 : r.selection.isSelected(t),
2251
+ onClick: (n) => {
2252
+ var r;
2253
+ return (r = e.instance) == null ? void 0 : r.selection.toggle(t);
2254
+ }
2255
+ }, null, 8, rr)])])) : F("", !0),
2256
+ e.previewEnabled ? (H(), I("td", ir, [z(c, {
2257
+ class: "d-flex ext-icon-preview",
2258
+ "hover-mode": "primary",
2259
+ title: e.t(t.inactive ? "PreviewNotAvailable" : "Preview", !0),
2260
+ disabled: t.inactive,
2261
+ onClick: Z((n) => !t.inactive && e.preview(t), ["prevent"])
2262
+ }, {
2263
+ default: Y(() => [z(s, {
2264
+ class: "text-muted",
2265
+ name: "document-analysis",
2266
+ size: 24
2267
+ })]),
2268
+ _: 1
2269
+ }, 8, [
2270
+ "title",
2271
+ "disabled",
2272
+ "onClick"
2273
+ ])])) : F("", !0),
2274
+ e.shouldDisplayAdditionalInfo ? (H(), I("td", ar, [t.additionalInfo && t.additionalInfo.length ? (H(), P(l, {
2275
+ key: 0,
2276
+ text: e.additionalInfoText(t.additionalInfo)
2277
+ }, {
2278
+ default: Y(() => [z(s, {
2279
+ class: "text-warning",
2280
+ name: "warning-triangle"
2281
+ })]),
2282
+ _: 1
2283
+ }, 8, ["text"])) : F("", !0)])) : F("", !0),
2284
+ (H(!0), I(M, null, W(e.columns, (n, r) => X((H(), I("td", { key: r }, [
2285
+ n.cellTemplate ? (H(), P(o, {
2286
+ key: 0,
2287
+ callbacks: n.cellTemplate,
2288
+ ctx: e.cellCtx({
2289
+ item: t,
2290
+ col: n
2291
+ })
2292
+ }, null, 8, ["callbacks", "ctx"])) : n.dataField == "ProductId" ? (H(), I("span", or, [z(c, { onClick: (n) => e.details(t) }, {
2293
+ default: Y(() => [R(J(e.attrValue(t, n.dataField)), 1)]),
2294
+ _: 2
2295
+ }, 1032, ["onClick"])])) : (H(), I("span", sr, J(e.attrValue(t, n.dataField)), 1)),
2296
+ n.showReplacements && t.replacements && t.replacements.length ? (H(), P(u, {
2297
+ key: 3,
2298
+ instance: e.instance,
2299
+ replacements: t.replacements,
2300
+ visible: e.replacementsVisible
2301
+ }, null, 8, [
2302
+ "instance",
2303
+ "replacements",
2304
+ "visible"
2305
+ ])) : F("", !0),
2306
+ n.showVariants && t.variantsAvailable ? (H(), I("div", cr, [z(s, {
2307
+ class: "text-muted me-2",
2308
+ name: "information-circle"
2309
+ }), X(L("span", null, null, 512), [[f, e.t("VariantsAvailable") + ": " + e.variantsAvailableInfo(t.variantAttributes) + "."]])])) : F("", !0),
2310
+ n.showAllIdentifiers ? (H(!0), I(M, { key: 5 }, W(e.attrValues(t, "#AllIdentifiers"), (e, t) => X((H(), I("div", {
2311
+ key: t,
2312
+ class: "small text-muted fw-bold"
2313
+ }, [R(J(e), 1)])), [[d, e]])), 128)) : F("", !0)
2314
+ ])), [[d, n]])), 128))
2315
+ ], 2)), [[d, t]]);
2316
+ }), 128))])
2317
+ ])])) : F("", !0)], 512);
2318
+ }
2319
+ //#endregion
2320
+ //#region src/products/components/shared/PrmList.vue?vue&type=script&lang.ts
2321
+ var ur = B({
2322
+ name: "PrmList",
2323
+ components: {
2324
+ Arrow: rt,
2325
+ Btn: ye,
2326
+ Card: mt,
2327
+ LinkSecondary: vt,
2328
+ Message: at,
2329
+ ScrollableList: ut,
2330
+ Icon: E,
2331
+ Pagination: ot,
2332
+ ImageGallery: tt,
2333
+ PrmListSearchForm: jn,
2334
+ FiltersNavigatorModal: xn,
2335
+ Spinner: Pe,
2336
+ Clickable: C,
2337
+ PrmSearchTable: /* @__PURE__ */ A(Kn, [["render", lr]]),
2338
+ PrmSearchList: Gn
2339
+ },
2340
+ props: {
2341
+ relationship: {
2342
+ type: Object,
2343
+ required: !0
2344
+ },
2345
+ instance: {
2346
+ type: Object,
2347
+ required: !0
2348
+ },
2349
+ productId: {
2350
+ type: String,
2351
+ required: !0
2352
+ },
2353
+ t: {
2354
+ type: Function,
2355
+ required: !0
2356
+ },
2357
+ cid: {
2358
+ type: String,
2359
+ required: !1,
2360
+ default: void 0
2361
+ },
2362
+ emit: {
2363
+ type: Function,
2364
+ required: !0
2365
+ }
2366
+ },
2367
+ setup(e) {
2368
+ var t, n;
2369
+ let r = U(!1), i = U(!1), a = N(() => e.relationship), o = N(() => a.value.columns), s = U(!1), c = U(!1), l = N(() => {
2370
+ var t;
2371
+ return (t = e.instance) == null || (t = t.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
2372
+ }), u = et(e.productId, e.relationship), { filter: d, filtersAll: f, filtersPromoted: p, filtersAdditional: m, filtersModel: h, filtersFetched: g, filtersLoading: _, filtersOpen: v, saveSettings: y, setFilters: b, setFilterValues: te, resetFiltersApplied: ne, getFiltersModelAsCriteriaGroup: x } = u, S = U(1), C = U(((t = l.value) == null ? void 0 : t.pageSize) || 0), w = U(((n = a.value.products) == null ? void 0 : n.totalCount) || 0), re = U([]), ie = U(!1), ae = U([]), oe = U(!1), se = U(!1), T = U(0), ce = 0, le = 0, ue = 0, E = /* @__PURE__ */ new Map(), de = N(() => {
2373
+ var t;
2374
+ return ie.value === !0 ? re.value : ((t = e.relationship.products) == null ? void 0 : t.items) || [];
2375
+ }), fe = N(() => C.value > 0 ? Math.ceil(w.value / C.value) : 0), pe = async () => {
2376
+ let t = ++ce;
2377
+ se.value = !0;
2378
+ let n = new qe({
2379
+ search: {
2380
+ productId: e.productId,
2381
+ searchText: d.value || void 0,
2382
+ relationshipType: e.relationship.type,
2383
+ relationshipCode: e.relationship.code,
2384
+ filter: x()
2385
+ },
2386
+ pager: {
2387
+ page: S.value,
2388
+ pageSize: C.value
2389
+ }
2390
+ });
2391
+ try {
2392
+ var i, a, o, s;
2393
+ let c = await ((i = e.instance) == null ? void 0 : i.execute(n));
2394
+ if (t !== ce || !c) return;
2395
+ let l = (a = c.items) == null ? void 0 : a[0];
2396
+ re.value = (l == null || (o = l.products) == null ? void 0 : o.items) || [], w.value = (l == null || (s = l.products) == null ? void 0 : s.totalCount) || 0, b((l == null ? void 0 : l.filters) || []);
2397
+ let u = /* @__PURE__ */ new Set([...g.keys(), ..._]);
2398
+ if (u.size > 0 && (await me([...u]), t !== ce)) return;
2399
+ ie.value = !0, r.value = !1;
2400
+ } catch {} finally {
2401
+ t === ce && (se.value = !1);
2402
+ }
2403
+ }, me = async (t) => {
2404
+ let n = ++ue;
2405
+ t.forEach((e) => {
2406
+ E.set(e, n), _.add(e);
2407
+ });
2408
+ let r = (e) => E.get(e) === n;
2409
+ try {
2410
+ var i;
2411
+ let n = await ((i = e.instance) == null ? void 0 : i.execute(new We({
2412
+ attributeCodes: t,
2413
+ productId: e.productId,
2414
+ searchText: d.value || void 0,
2415
+ relationshipType: e.relationship.type,
2416
+ relationshipCode: e.relationship.code,
2417
+ filter: x()
2418
+ }).from("prm-list")));
2419
+ te(((n == null ? void 0 : n.items) || []).filter((e) => r(e.attributeCode)));
2420
+ } catch {} finally {
2421
+ t.filter(r).forEach((e) => {
2422
+ E.delete(e), _.delete(e);
2423
+ });
2424
+ }
2425
+ }, he = async (e) => {
2426
+ S.value = e, await pe();
2427
+ }, ge = async () => {
2428
+ i.value = !1, await pe();
2429
+ }, _e = async (e) => {
2430
+ d.value = e, S.value = 1, await ge();
2431
+ }, ve = async () => {
2432
+ d.value = "", S.value = 1, await pe();
2433
+ }, ye = (e) => {
2434
+ var t;
2435
+ return e.slice(0, (t = l.value) == null ? void 0 : t.filteringMaxAttributesVisible) ?? [];
2436
+ }, be = N(() => ye(p.value.length ? p.value : m.value)), xe = async ({ attributeCode: t }) => {
2437
+ !t || !e.instance || (v.has(t) ? v.delete(t) : (g.has(t) || await me([t]), v.add(t)));
2438
+ }, Se = ({ attributeCode: e }) => v.has(e), D = ({ attributeCode: e }) => _.has(e), Ce = () => {
2439
+ T.value++, i.value = !0;
2440
+ }, we = async () => {
2441
+ ne(), v.clear(), r.value = !1, await pe();
2442
+ }, Te = ({ attributeCode: e, filterValueName: t, value: n }) => {
2443
+ var r;
2444
+ (r = h.value)[e] ?? (r[e] = {}), h.value[e][t] = n;
2445
+ }, O = () => {
2446
+ r.value = !0;
2447
+ }, Ee = async (t) => {
2448
+ let n = ++le;
2449
+ oe.value = !0;
2450
+ try {
2451
+ var r;
2452
+ let i = await ((r = e.instance) == null || (r = r.httpService) == null ? void 0 : r.loadImagesById(t));
2453
+ n === le && i != null && i.items && (ae.value = i.items);
2454
+ } catch {} finally {
2455
+ n === le && (oe.value = !1);
2456
+ }
2457
+ }, De = async () => {
2458
+ if (e.relationship && (e.relationship.images && Ee(e.relationship.images), e.relationship.filters && b(e.relationship.filters)), x().rules.length || d.value) s.value = !0, c.value = !0, await pe();
2459
+ else {
2460
+ var t, n;
2461
+ s.value = w.value >= (((t = l.value) == null ? void 0 : t.filteringMinItems) || 0) && [
2462
+ Ie.ACCESSORIES,
2463
+ Ie.KIT_CONTENTS,
2464
+ Ie.SPARE_PART_USED_ON_LIST
2465
+ ].includes(e.relationship.type || ""), c.value = w.value >= (((n = l.value) == null ? void 0 : n.searchMinItems) || 0);
2466
+ }
2467
+ }, Oe = () => {
2468
+ var t;
2469
+ ce++, le++, E.clear(), u.productId = e.productId, u.relationshipCode = e.relationship.code, S.value = 1, d.value = void 0, ne(), h.value = {}, _.clear(), b([]), r.value = !1, i.value = !1, ie.value = !1, se.value = !1, re.value = [], w.value = ((t = e.relationship.products) == null ? void 0 : t.totalCount) || 0, ae.value = [], oe.value = !1, s.value = !1, c.value = !1;
2470
+ };
2471
+ Nt([
2472
+ () => e.relationship.type,
2473
+ () => e.relationship.code,
2474
+ () => e.productId
2475
+ ], () => {
2476
+ Oe(), De();
2477
+ }), Ot(De);
2478
+ let ke = N(() => {
2479
+ var t;
2480
+ let n = (t = e.instance) == null || (t = t.store.options.components) == null || (t = t.details) == null || (t = t.data) == null ? void 0 : t.relationships;
2481
+ if (n != null && n.actionTemplates) {
2482
+ if (n.actionTemplates[e.relationship.type]) return n.actionTemplates[e.relationship.type];
2483
+ if (n.actionTemplates.All) return n.actionTemplates.All;
2484
+ }
2485
+ }), k = N(() => {
2486
+ var t;
2487
+ let n = (t = e.instance) == null || (t = t.store) == null || (t = t.options) == null || (t = t.components) == null || (t = t.details) == null || (t = t.data) == null || (t = t.relationships) == null ? void 0 : t.displayMode;
2488
+ if (n) {
2489
+ if (n[e.relationship.type]) return n[e.relationship.type];
2490
+ if (n.All) return n.All;
2491
+ }
2492
+ return "table";
2493
+ });
2494
+ return {
2495
+ isTableMode: N(() => k.value === "table"),
2496
+ isListMode: N(() => k.value === "list"),
2497
+ prm: a,
2498
+ products: de,
2499
+ filter: d,
2500
+ page: S,
2501
+ pageCount: fe,
2502
+ totalCount: w,
2503
+ productsImages: ae,
2504
+ productsImagesLoading: oe,
2505
+ isLoading: se,
2506
+ filtersAll: f,
2507
+ filtersPromoted: p,
2508
+ filtersAdditional: m,
2509
+ filtersToDisplay: be,
2510
+ filtersOpen: v,
2511
+ filtersFetched: g,
2512
+ areFiltersDirty: r,
2513
+ filtersModel: h,
2514
+ isSearchEnabled: c,
2515
+ filteringOptions: l,
2516
+ isFilteringEnabled: s,
2517
+ allFiltersModalShown: i,
2518
+ filtersModalKey: T,
2519
+ actionTemplate: ke,
2520
+ columns: o,
2521
+ getFiltersModelAsCriteriaGroup: x,
2522
+ criterionValueKey: ee,
2523
+ onSearch: _e,
2524
+ onSearchClear: ve,
2525
+ searchNow: ge,
2526
+ toggleFilter: xe,
2527
+ saveSettings: y,
2528
+ onPageChange: he,
2529
+ isFilterOpen: Se,
2530
+ showAllFilters: Ce,
2531
+ isFilterLoading: D,
2532
+ onFetchFilterValues: me,
2533
+ onFilterValueChange: O,
2534
+ clearAndCloseFilters: we,
2535
+ onModalFilterValueChange: Te
2536
+ };
2537
+ }
2538
+ }), dr = { key: 0 }, fr = { class: "fw-bold" }, pr = {
2539
+ key: 1,
2540
+ class: "mb-4"
2541
+ }, mr = { key: 2 }, hr = {
2542
+ key: 0,
2543
+ class: "list-group list-group-flush"
2544
+ }, gr = { class: "text-break" }, _r = { class: "small text-muted text-nowrap ms-2" }, vr = { class: "d-flex align-items-center ms-auto ps-2 flex-shrink-0 my-auto" }, yr = {
2545
+ key: 0,
2546
+ class: "card-body py-0"
2547
+ }, br = { class: "form-check pe-1" }, xr = { class: "form-check-label pis-label d-flex align-items-start py-1 ms-2" }, Sr = ["onUpdate:modelValue", "name"], Cr = { class: "text-break" }, wr = ["textContent"], Tr = { class: "text-muted small text-nowrap ms-1" }, Er = {
2548
+ key: 1,
2549
+ class: "card-body"
2550
+ }, Dr = { class: "d-flex justify-content-between align-items-center" }, Or = { class: "text-muted fw-bold" }, kr = { key: 0 }, Ar = { class: "fw-bold" }, jr = { key: 1 }, Mr = { key: 3 }, Nr = { key: 4 }, Pr = {
2551
+ key: 5,
2552
+ class: "d-flex flex-row-reverse"
2553
+ };
2554
+ function Fr(e, t, n, r, i, a) {
2555
+ var o, s, c, l;
2556
+ let u = K("Icon"), d = K("ImageGallery"), f = K("Spinner"), p = K("Arrow"), m = K("Clickable"), h = K("ScrollableList"), g = K("Message"), _ = K("Btn"), v = K("Card"), y = K("FiltersNavigatorModal"), b = K("LinkSecondary"), ee = K("PrmListSearchForm"), te = K("PrmSearchTable"), ne = K("PrmSearchList"), x = K("Pagination"), S = q("pis-test-key"), C = q("safe-html");
2557
+ return H(), I(M, null, [
2558
+ e.prm.userFields ? (H(), I("div", dr, [(H(!0), I(M, null, W(e.prm.userFields, (e, t) => X((H(), I("div", {
2559
+ key: t,
2560
+ class: "mb-4"
2561
+ }, [L("div", fr, [z(u, { name: "information-circle" }), R(" " + J(e.name), 1)]), (H(!0), I(M, null, W(e.values, (e, t) => X((H(), I("div", { key: t }, [R(J(e), 1)])), [[S, e]])), 128))])), [[S, e]])), 128))])) : F("", !0),
2562
+ e.productsImages.length ? (H(), I("div", pr, [z(d, {
2563
+ images: e.productsImages,
2564
+ "always-show-thumbnails": !0,
2565
+ title: e.t("ProductGallery")
2566
+ }, null, 8, ["images", "title"])])) : F("", !0),
2567
+ e.isFilteringEnabled && ["inline-collapsed", "inline-expanded"].includes(((o = e.filteringOptions) == null ? void 0 : o.filtering) || "") ? (H(), I("div", mr, [z(v, {
2568
+ class: "mb-4",
2569
+ "sticky-footer": "",
2570
+ icon: "funnel-filter",
2571
+ header: e.t("PrmFilters", !0),
2572
+ "use-markup": !0,
2573
+ collapsed: ((s = e.filteringOptions) == null ? void 0 : s.filtering) === "inline-collapsed"
2574
+ }, wt({
2575
+ list: Y(() => {
2576
+ var n;
2577
+ return [(n = e.filtersToDisplay) != null && n.length ? (H(), I("div", hr, [(H(!0), I(M, null, W(e.filtersToDisplay, (n) => {
2578
+ var r;
2579
+ return X((H(), I("div", { key: n.attributeCode }, [z(m, {
2580
+ class: "list-group-item list-group-item-action d-flex align-items-start border-0 user-select-none",
2581
+ "aria-expanded": e.isFilterOpen(n),
2582
+ onClick: Z((t) => e.toggleFilter(n), ["prevent"])
2583
+ }, {
2584
+ default: Y(() => [L("span", gr, [X(L("span", { class: V(["pis-label", e.isFilterOpen(n) ? "fw-bold" : ""]) }, null, 2), [[C, n.attributeName]]), L("span", _r, "(" + J(n.hitCount) + ")", 1)]), L("span", vr, [e.isFilterLoading(n) ? (H(), P(f, {
2585
+ key: 0,
2586
+ sm: ""
2587
+ })) : (H(), P(p, {
2588
+ key: 1,
2589
+ dir: e.isFilterOpen(n) ? "up" : "down"
2590
+ }, null, 8, ["dir"]))])]),
2591
+ _: 2
2592
+ }, 1032, ["aria-expanded", "onClick"]), e.isFilterOpen(n) ? (H(), I("div", yr, [(r = e.filtersFetched.get(n.attributeCode)) != null && r.length ? (H(), P(h, {
2593
+ key: 0,
2594
+ class: "list-unstyled my-1",
2595
+ height: "30vh",
2596
+ items: e.filtersFetched.get(n.attributeCode) || []
2597
+ }, {
2598
+ item: Y(({ item: r }) => [X((H(), I("div", br, [L("label", xr, [X(L("input", {
2599
+ "onUpdate:modelValue": (t) => e.filtersModel[n.attributeCode][e.criterionValueKey(r.value)] = t,
2600
+ type: "checkbox",
2601
+ class: "form-check-input mt-1 me-2 flex-shrink-0",
2602
+ name: r.text,
2603
+ onChange: t[0] || (t[0] = (...t) => e.onFilterValueChange && e.onFilterValueChange(...t))
2604
+ }, null, 40, Sr), [[Mt, e.filtersModel[n.attributeCode][e.criterionValueKey(r.value)]]]), L("span", Cr, [L("span", {
2605
+ class: "text-break user-select-none",
2606
+ textContent: J(r.text)
2607
+ }, null, 8, wr), L("span", Tr, "(" + J(r.hitCount) + ")", 1)])])])), [[S, r]])]),
2608
+ _: 2
2609
+ }, 1032, ["items"])) : (H(), P(g, { key: 1 }, {
2610
+ default: Y(() => [R(J(e.t("NoFilterValues")), 1)]),
2611
+ _: 1
2612
+ }))])) : F("", !0)])), [[S, n]]);
2613
+ }), 128))])) : (H(), I("div", Er, [z(g, null, {
2614
+ default: Y(() => [R(J(e.t("NoFilters")), 1)]),
2615
+ _: 1
2616
+ })]))];
2617
+ }),
2618
+ _: 2
2619
+ }, [(c = e.filtersAll) != null && c.length ? {
2620
+ name: "footer",
2621
+ fn: Y(() => [
2622
+ e.areFiltersDirty ? (H(), P(_, {
2623
+ key: 0,
2624
+ class: "w-100 mb-2 justify-content-center ext-apply",
2625
+ variant: "primary",
2626
+ onClick: Z(e.searchNow, ["prevent"])
2627
+ }, {
2628
+ default: Y(() => [R(J(e.t("ShowResults", !0)), 1)]),
2629
+ _: 1
2630
+ }, 8, ["onClick"])) : F("", !0),
2631
+ z(_, {
2632
+ icon: "stop-not-allowed",
2633
+ class: "w-100 mt-2 ext-clear",
2634
+ variant: "secondary",
2635
+ sm: "",
2636
+ onClick: Z(e.clearAndCloseFilters, ["prevent"])
2637
+ }, {
2638
+ default: Y(() => [R(J(e.t("ClearFilters", !0)), 1)]),
2639
+ _: 1
2640
+ }, 8, ["onClick"]),
2641
+ z(_, {
2642
+ icon: "pop-out-window",
2643
+ class: "w-100 mt-2 ext-show-all",
2644
+ variant: "secondary",
2645
+ sm: "",
2646
+ onClick: Z(e.showAllFilters, ["prevent"])
2647
+ }, {
2648
+ default: Y(() => [R(J(e.t("ShowAllFilters")) + " (" + J(e.filtersAll.length) + ") ", 1)]),
2649
+ _: 1
2650
+ }, 8, ["onClick"])
2651
+ ]),
2652
+ key: "0"
2653
+ } : void 0]), 1032, ["header", "collapsed"])])) : F("", !0),
2654
+ (H(), P(y, {
2655
+ key: e.filtersModalKey,
2656
+ show: e.isFilteringEnabled && e.allFiltersModalShown,
2657
+ title: e.t("AllFiltersModalTitle"),
2658
+ t: e.t,
2659
+ "filters-all": e.filtersAll,
2660
+ "filters-promoted": e.filtersPromoted,
2661
+ "filters-additional": e.filtersAdditional,
2662
+ "filters-fetched": e.filtersFetched,
2663
+ "filters-model": e.filtersModel,
2664
+ "fetch-filter-values": e.onFetchFilterValues,
2665
+ "filtered-result-count": void 0,
2666
+ "filtered-result-count-loading": !1,
2667
+ onValueChange: e.onModalFilterValueChange,
2668
+ onApplyFilters: e.searchNow,
2669
+ onClear: e.clearAndCloseFilters
2670
+ }, null, 8, [
2671
+ "show",
2672
+ "title",
2673
+ "t",
2674
+ "filters-all",
2675
+ "filters-promoted",
2676
+ "filters-additional",
2677
+ "filters-fetched",
2678
+ "filters-model",
2679
+ "fetch-filter-values",
2680
+ "onValueChange",
2681
+ "onApplyFilters",
2682
+ "onClear"
2683
+ ])),
2684
+ L("div", Dr, [
2685
+ L("div", null, [L("span", Or, J(e.totalCount) + " " + J(e.t("Products", !0)), 1)]),
2686
+ e.isFilteringEnabled && ((l = e.filteringOptions) == null ? void 0 : l.filtering) === "popup" ? (H(), I("div", kr, [z(b, {
2687
+ icon: "funnel-filter",
2688
+ onClick: Z(e.showAllFilters, ["prevent"])
2689
+ }, {
2690
+ default: Y(() => [L("span", Ar, J(e.t("PrmFilters", !0)), 1)]),
2691
+ _: 1
2692
+ }, 8, ["onClick"])])) : F("", !0),
2693
+ e.isSearchEnabled ? (H(), I("div", jr, [z(ee, {
2694
+ modelValue: e.filter,
2695
+ "onUpdate:modelValue": t[1] || (t[1] = (t) => e.filter = t),
2696
+ instance: e.instance,
2697
+ "product-id": e.productId,
2698
+ "relationship-type": e.relationship.type,
2699
+ "relationship-code": e.relationship.code,
2700
+ "filter-criteria": e.getFiltersModelAsCriteriaGroup(),
2701
+ t: e.t,
2702
+ onSearch: e.onSearch,
2703
+ onClear: e.onSearchClear
2704
+ }, null, 8, [
2705
+ "modelValue",
2706
+ "instance",
2707
+ "product-id",
2708
+ "relationship-type",
2709
+ "relationship-code",
2710
+ "filter-criteria",
2711
+ "t",
2712
+ "onSearch",
2713
+ "onClear"
2714
+ ])])) : F("", !0)
2715
+ ]),
2716
+ e.isTableMode ? (H(), I("div", Mr, [G(e.$slots, "search-table", {}, () => [z(te, {
2717
+ products: e.products,
2718
+ "relationship-columns": e.columns,
2719
+ instance: e.instance,
2720
+ t: e.t,
2721
+ emit: e.emit,
2722
+ relationship: e.relationship,
2723
+ "action-template": e.actionTemplate
2724
+ }, null, 8, [
2725
+ "products",
2726
+ "relationship-columns",
2727
+ "instance",
2728
+ "t",
2729
+ "emit",
2730
+ "relationship",
2731
+ "action-template"
2732
+ ])])])) : F("", !0),
2733
+ e.isListMode ? (H(), I("div", Nr, [G(e.$slots, "search-list", {}, () => [z(ne, {
2734
+ products: e.products,
2735
+ instance: e.instance,
2736
+ t: e.t,
2737
+ emit: e.emit
2738
+ }, null, 8, [
2739
+ "products",
2740
+ "instance",
2741
+ "t",
2742
+ "emit"
2743
+ ])])])) : F("", !0),
2744
+ e.pageCount > 1 ? (H(), I("div", Pr, [z(x, {
2745
+ total: e.pageCount,
2746
+ current: e.page,
2747
+ onChange: e.onPageChange
2748
+ }, null, 8, [
2749
+ "total",
2750
+ "current",
2751
+ "onChange"
2752
+ ])])) : F("", !0)
2753
+ ], 64);
2754
+ }
2755
+ var Ir = /*#__PURE__*/ A(ur, [["render", Fr]]), Lr = (e) => typeof CSS < "u" ? CSS.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, "\\$&"), Rr = (e) => `pis-anchor-prm-${Lr(e)}`, zr = (e) => `#${Lr(e)}`, Br = (e) => {
2756
+ let t = N(() => {
2757
+ var t;
2758
+ return (t = e.value) == null || (t = t.store.options.components) == null || (t = t.common) == null ? void 0 : t.hideWhereUsed;
2759
+ }), n = N(() => {
2760
+ var t, n, r;
2761
+ let i = (t = e.value) == null ? void 0 : t.store, a = {
2762
+ agms: [],
2763
+ prms: []
2764
+ }, o = [...(i == null || (n = i.data.attributeGroups) == null ? void 0 : n.items) || []], s = [...(i == null || (r = i.data.prm) == null ? void 0 : r.items) || []];
2765
+ for (let e of o) {
2766
+ var c;
2767
+ let t = {
2768
+ prms: [],
2769
+ attributeGroup: e
2770
+ };
2771
+ if ((c = e.relationshipCodes) != null && c.length) {
2772
+ let n = new Set(e.relationshipCodes);
2773
+ t.prms = s.filter((e) => n.has(e.code)), t.prms.forEach((e) => s.splice(s.indexOf(e), 1));
2774
+ }
2775
+ a.agms.push(t);
2776
+ }
2777
+ return a.prms = s, a;
2778
+ });
2779
+ return {
2780
+ prmData: n,
2781
+ visibleAgmData: N(() => n.value.agms.reduce((e, n) => n.attributeGroup.visible ? e.concat([{
2782
+ attributeGroup: n.attributeGroup,
2783
+ prms: n.prms.filter((e) => !t.value || e.type !== Ie.WHERE_USED && e.type !== Ie.SPARE_PART_USED_ON_LIST)
2784
+ }]) : e, [])),
2785
+ visiblePrmData: N(() => n.value.prms.reduce((e, n) => !t.value || n.type !== Ie.WHERE_USED && n.type !== Ie.SPARE_PART_USED_ON_LIST ? e.concat([n]) : e, []))
2786
+ };
2787
+ }, Vr = B({
2788
+ name: "pis-products-details-attribute-groups",
2789
+ components: {
2790
+ PrmList: Ir,
2791
+ AttributesTable: _t
2792
+ },
2793
+ props: { instanceId: {
2794
+ type: String,
2795
+ default: void 0
2796
+ } },
2797
+ setup(e) {
2798
+ let t = U(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, [Q.AttributeGroups, Q.ProductRelationships]);
2799
+ return {
2800
+ root: t,
2801
+ componentName: r,
2802
+ isReady: i,
2803
+ isWebComponent: a,
2804
+ store: o,
2805
+ instance: n,
2806
+ hideDocumentLinks: N(() => {
2807
+ var e;
2808
+ return ((e = o.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideDocumentLinks) == 1;
2809
+ }),
2810
+ prmDataFiltered: Br(n).visibleAgmData,
2811
+ productId: N(() => {
2812
+ var e;
2813
+ return (e = o.value) == null || (e = e.data.productDetail) == null || (e = e.item) == null ? void 0 : e.productId;
2814
+ }),
2815
+ t: s,
2816
+ emit: c,
2817
+ buildPrmAnchorId: Rr
2818
+ };
2819
+ }
2820
+ }), Hr = { key: 0 }, Ur = ["id"], Wr = { class: "pis-heading ext-attr-group-heading" }, Gr = { class: "ext-attr-group-content" }, Kr = ["id"], qr = { class: "" }, Jr = { class: "ext-attr-group-content" };
2821
+ function Yr(e, t, n, r, i, a) {
2822
+ let o = K("AttributesTable"), s = K("PrmList"), c = q("pis-test-part"), l = q("pis-test-key");
2823
+ return H(), I("div", {
2824
+ ref: "root",
2825
+ class: V(["pis-component", e.componentName])
2826
+ }, [e.isReady ? (H(), I("div", Hr, [(H(!0), I(M, null, W(e.prmDataFiltered, (t, n) => X((H(), I("div", {
2827
+ key: n,
2828
+ class: "mt-4 ext-attr-group"
2829
+ }, [L("div", {
2830
+ id: `pis-anchor-agm-${t.attributeGroup.code}`,
2831
+ class: "ext-attr-group-inner"
2832
+ }, [
2833
+ X((H(), I("h4", Wr, [R(J(t.attributeGroup.description), 1)])), [[
2834
+ c,
2835
+ t.attributeGroup.code,
2836
+ "header"
2837
+ ]]),
2838
+ L("div", Gr, [t.attributeGroup.attributes ? (H(), P(o, {
2839
+ key: 0,
2840
+ attributes: t.attributeGroup.attributes,
2841
+ instance: e.instance,
2842
+ "hide-document-links": e.hideDocumentLinks,
2843
+ t: e.t
2844
+ }, null, 8, [
2845
+ "attributes",
2846
+ "instance",
2847
+ "hide-document-links",
2848
+ "t"
2849
+ ])) : F("", !0)]),
2850
+ (H(!0), I(M, null, W(t.prms, (t) => X((H(), I("div", {
2851
+ key: t.code,
2852
+ class: "ext-attr-group-list"
2853
+ }, [t && e.productId ? (H(), I("div", {
2854
+ key: 0,
2855
+ id: e.buildPrmAnchorId(t.code),
2856
+ class: "ps-lg-3"
2857
+ }, [L("h5", qr, J(t.description), 1), L("div", Jr, [z(s, {
2858
+ relationship: t,
2859
+ instance: e.instance,
2860
+ "product-id": e.productId,
2861
+ t: e.t,
2862
+ emit: e.emit
2863
+ }, null, 8, [
2864
+ "relationship",
2865
+ "instance",
2866
+ "product-id",
2867
+ "t",
2868
+ "emit"
2869
+ ])])], 8, Kr)) : F("", !0)])), [[l, t]])), 128))
2870
+ ], 8, Ur)])), [[l, t]])), 128))])) : F("", !0)], 2);
2871
+ }
2872
+ var Xr = /*#__PURE__*/ A(Vr, [["render", Yr]]), Zr = B({
2873
+ name: "pis-products-details-classifications",
2874
+ components: { Message: at },
2875
+ props: { instanceId: {
2876
+ type: String,
2877
+ default: void 0
2878
+ } },
2879
+ setup(e) {
2880
+ let t = U(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s } = $(t, e.instanceId, [Q.ProductClassifications]);
2881
+ return {
2882
+ root: t,
2883
+ componentName: r,
2884
+ isReady: i,
2885
+ isWebComponent: a,
2886
+ store: o,
2887
+ classifications: N(() => {
2888
+ var e;
2889
+ return (e = o.value) == null || (e = e.data.productClassifications) == null ? void 0 : e.items;
2890
+ }),
2891
+ setCategory: async (e) => {
2892
+ if (n.value && e) try {
2893
+ await n.value.execute(new dt({
2894
+ cid: e.cid,
2895
+ clearSearch: !0
2896
+ }).from(r));
2897
+ } catch {}
2898
+ },
2899
+ t: s
2900
+ };
2901
+ }
2902
+ }), Qr = { key: 0 }, $r = { key: 0 }, ei = { class: "fw-bold ext-class-group" }, ti = { class: "ext-class-nodes" }, ni = { key: 0 }, ri = ["onClick"], ii = {
2903
+ key: 2,
2904
+ class: "px-1 ext-class-arrow"
2905
+ };
2906
+ function ai(e, t, n, r, i, a) {
2907
+ let o = K("Message"), s = q("pis-test-key");
2908
+ return H(), I("div", {
2909
+ ref: "root",
2910
+ class: V(["pis-component", e.componentName])
2911
+ }, [e.isReady ? (H(), I("div", Qr, [e.classifications ? (H(), I("div", $r, [L("ul", null, [(H(!0), I(M, null, W(e.classifications, (t, n) => X((H(), I("li", { key: n }, [L("span", ei, J(n), 1), L("ul", null, [(H(!0), I(M, null, W(t, (t, n) => X((H(), I("li", { key: n }, [L("div", ti, [(H(!0), I(M, null, W(t, (n, r) => X((H(), I("span", {
2912
+ key: n.cid,
2913
+ class: "ext-class-node"
2914
+ }, [n.inactive ? (H(), I("span", ni, J(n.name), 1)) : (H(), I("a", {
2915
+ key: 1,
2916
+ href: "#",
2917
+ onClick: Z((t) => e.setCategory(n), ["prevent"])
2918
+ }, J(n.name), 9, ri)), r + 1 < t.length ? (H(), I("span", ii, "›")) : F("", !0)])), [[s, n]])), 128))])])), [[s, t]])), 128))])])), [[s, t]])), 128))])])) : (H(), P(o, {
2919
+ key: 1,
2920
+ class: "p-2"
2921
+ }, {
2922
+ default: Y(() => [R(J(e.t("ProductNotClassified")), 1)]),
2923
+ _: 1
2924
+ }))])) : F("", !0)], 2);
2925
+ }
2926
+ var oi = /*#__PURE__*/ A(Zr, [["render", ai]]), si = B({
2927
+ name: "pis-products-details-general-information",
2928
+ components: { AttributesTable: _t },
2929
+ props: { instanceId: {
2930
+ type: String,
2931
+ default: void 0
2932
+ } },
2933
+ setup(e) {
2934
+ let t = U(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s } = $(t, e.instanceId, [O.PRODUCT_DETAILS]);
2935
+ return {
2936
+ root: t,
2937
+ componentName: r,
2938
+ isReady: i,
2939
+ isWebComponent: a,
2940
+ store: o,
2941
+ instance: n,
2942
+ item: N(() => {
2943
+ var e;
2944
+ return (e = o.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item;
2945
+ }),
2946
+ hideDocumentLinks: N(() => {
2947
+ var e;
2948
+ return ((e = o.value) == null || (e = e.options.components) == null || (e = e.common) == null ? void 0 : e.hideDocumentLinks) == 1;
2949
+ }),
2950
+ t: s
2951
+ };
2952
+ }
2953
+ }), ci = { key: 0 }, li = { key: 0 }, ui = { class: "pis-heading ext-attr-group-heading" }, di = { class: "ext-attr-group-content" };
2954
+ function fi(e, t, n, r, i, a) {
2955
+ let o = K("AttributesTable");
2956
+ return H(), I("div", {
2957
+ ref: "root",
2958
+ class: V(["pis-component", e.componentName])
2959
+ }, [e.isReady ? (H(), I("div", ci, [e.item ? (H(), I("div", li, [L("h3", ui, J(e.t("GeneralInfo")), 1), L("div", di, [e.item.attributes ? (H(), P(o, {
2960
+ key: 0,
2961
+ attributes: e.item.attributes,
2962
+ instance: e.instance,
2963
+ "hide-document-links": e.hideDocumentLinks,
2964
+ t: e.t
2965
+ }, null, 8, [
2966
+ "attributes",
2967
+ "instance",
2968
+ "hide-document-links",
2969
+ "t"
2970
+ ])) : F("", !0)])])) : F("", !0)])) : F("", !0)], 2);
2971
+ }
2972
+ var pi = /*#__PURE__*/ A(si, [["render", fi]]), mi = B({
2973
+ name: "pis-products-details-navigation",
2974
+ components: { Clickable: C },
2975
+ props: { instanceId: {
2976
+ type: String,
2977
+ default: void 0
2978
+ } },
2979
+ setup(e) {
2980
+ let t = U(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, widerThan: s, t: c } = $(t, e.instanceId, []), l = Br(n);
2981
+ return {
2982
+ root: t,
2983
+ componentName: r,
2984
+ isReady: i,
2985
+ isWebComponent: a,
2986
+ store: o,
2987
+ links: N(() => {
2988
+ var e, t, r;
2989
+ let i = [];
2990
+ return (e = n.value) != null && e.translations.translations ? (l.visibleAgmData.value.forEach((e) => i.push({
2991
+ text: e.attributeGroup.description,
2992
+ id: `pis-anchor-agm-${e.attributeGroup.code}`
2993
+ })), l.visiblePrmData.value.forEach((e) => i.push({
2994
+ text: e.description,
2995
+ id: Rr(e.code)
2996
+ })), (t = o.value) != null && (t = t.options.components) != null && (t = t.details) != null && (t = t.variantsTable) != null && t.visible && (((r = o.value) == null || (r = r.data.productVariantsTable) == null || (r = r.items) == null ? void 0 : r.length) ?? !1) && i.push({
2997
+ text: c("AllVariantProducts"),
2998
+ id: "pis-anchor-variants-table"
2999
+ }), i) : i;
3000
+ }),
3001
+ t: c,
3002
+ scrollToLink: (e) => {
3003
+ let t = document.querySelector(zr(e.id));
3004
+ t && t.scrollIntoView({ behavior: "smooth" });
3005
+ },
3006
+ widerThan: s
3007
+ };
3008
+ }
3009
+ }), hi = { key: 0 }, gi = {
3010
+ key: 0,
3011
+ class: "bg-light p-3"
3012
+ }, _i = { class: "fw-bold" }, vi = { class: "row" };
3013
+ function yi(e, t, n, r, i, a) {
3014
+ let o = K("Clickable"), s = q("pis-test-key");
3015
+ return H(), I("div", {
3016
+ ref: "root",
3017
+ class: V(["pis-component", e.componentName])
3018
+ }, [e.isReady ? (H(), I("div", hi, [e.links.length > 1 ? (H(), I("div", gi, [L("p", _i, J(e.t("GoToSection")) + ":", 1), L("div", vi, [(H(!0), I(M, null, W(e.links, (t) => X((H(), I("div", {
3019
+ key: t.id,
3020
+ class: V([e.widerThan("lg") ? "col-6" : "col-12", "mb-1"])
3021
+ }, [z(o, {
3022
+ class: "text-body",
3023
+ "hover-mode": "background",
3024
+ onClick: (n) => e.scrollToLink(t)
3025
+ }, {
3026
+ default: Y(() => [R(J(t.text), 1)]),
3027
+ _: 2
3028
+ }, 1032, ["onClick"])], 2)), [[s, t]])), 128))])])) : F("", !0)])) : F("", !0)], 2);
3029
+ }
3030
+ var bi = /*#__PURE__*/ A(mi, [["render", yi]]), xi = B({
3031
+ components: {
3032
+ Card: mt,
3033
+ Image: Ye
3034
+ },
3035
+ props: {
3036
+ imageSrc: {
3037
+ type: String,
3038
+ default: void 0
3039
+ },
3040
+ imageLoading: Boolean,
3041
+ inactive: Boolean,
3042
+ contentClickable: Boolean,
3043
+ wide: Boolean,
3044
+ useCardMarkup: {
3045
+ type: Boolean,
3046
+ default: !0
3047
+ },
3048
+ hideImage: Boolean,
3049
+ imageClickable: {
3050
+ type: Boolean,
3051
+ default: !0
3052
+ },
3053
+ imageWidth: {
3054
+ type: String,
3055
+ default: "8rem"
3056
+ },
3057
+ additionalColumnTemplateWidth: {
3058
+ type: Number,
3059
+ default: 2
3060
+ },
3061
+ actionTemplateWidth: {
3062
+ type: Number,
3063
+ default: 2
3064
+ }
3065
+ },
3066
+ emits: ["click-content"]
3067
+ }), Si = {
3068
+ key: 0,
3069
+ class: "flex-fill"
3070
+ }, Ci = { class: "position-relative" }, wi = { class: "col" };
3071
+ function Ti(e, t, n, r, i, a) {
3072
+ let o = K("Image"), s = K("Card");
3073
+ return H(), P(s, {
3074
+ class: V([e.useCardMarkup ? "mb-4" : "mb-5"]),
3075
+ "use-markup": e.useCardMarkup
3076
+ }, {
3077
+ default: Y(() => [G(e.$slots, "before"), L("div", { class: V(["row align-items-center mt-2", [e.$slots.before ? "ms-3" : ""]]) }, [
3078
+ L("div", {
3079
+ class: V(["mb-lg-2", {
3080
+ col: e.wide,
3081
+ "col-12": !e.wide
3082
+ }]),
3083
+ style: Dt({ "max-width": e.wide ? e.imageWidth : "100%" })
3084
+ }, [e.hideImage ? F("", !0) : (H(), I("div", Si, [L("div", Ci, [z(o, {
3085
+ style: { width: "100%" },
3086
+ class: "flex-fill",
3087
+ src: e.imageSrc,
3088
+ "is-loading": e.imageLoading,
3089
+ clickable: e.imageClickable,
3090
+ "hide-frame": !0,
3091
+ onClick: t[0] || (t[0] = (t) => e.$emit("click-content"))
3092
+ }, null, 8, [
3093
+ "src",
3094
+ "is-loading",
3095
+ "clickable"
3096
+ ]), G(e.$slots, "imageOverlay")])]))], 6),
3097
+ L("div", wi, [G(e.$slots, "content")]),
3098
+ e.$slots.additionalColumn ? (H(), I("div", {
3099
+ key: 0,
3100
+ class: V(["mt-lg-2", ["col-lg-" + e.additionalColumnTemplateWidth]])
3101
+ }, [L("div", { class: V([e.wide ? "ms-auto" : "mt-3"]) }, [G(e.$slots, "additionalColumn")], 2)], 2)) : F("", !0),
3102
+ !e.inactive && e.$slots.after ? (H(), I("div", {
3103
+ key: 1,
3104
+ class: V(["mt-lg-2", ["col-lg-" + e.actionTemplateWidth]])
3105
+ }, [L("div", { class: V([e.wide ? "ms-auto text-end" : "mt-3"]) }, [G(e.$slots, "after")], 2)], 2)) : F("", !0)
3106
+ ], 2)]),
3107
+ _: 3
3108
+ }, 8, ["class", "use-markup"]);
3109
+ }
3110
+ //#endregion
3111
+ //#region src/products/components/details/ProductDetailsRelatedLinks.vue?vue&type=script&lang.ts
3112
+ var Ei = B({
3113
+ name: "pis-products-details-related-links",
3114
+ components: {
3115
+ Message: at,
3116
+ ProductsListItem: /* @__PURE__ */ A(xi, [["render", Ti]]),
3117
+ Tooltip: we,
3118
+ Icon: E
3119
+ },
3120
+ props: { instanceId: {
3121
+ type: String,
3122
+ default: void 0
3123
+ } },
3124
+ setup(e) {
3125
+ let t = U(), { componentName: n, isReady: r, isWebComponent: i, store: a, t: o, widerThan: s } = $(t, e.instanceId), c = N(() => {
3126
+ var e;
3127
+ return (e = a.value) == null || (e = e.data.relatedLinks) == null ? void 0 : e.items;
3128
+ });
3129
+ return {
3130
+ root: t,
3131
+ componentName: n,
3132
+ componentOptions: N(() => {
3133
+ var e;
3134
+ return ((e = a.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.relatedLinks) ?? {};
3135
+ }),
3136
+ isReady: r,
3137
+ isWebComponent: i,
3138
+ store: a,
3139
+ relatedLinks: c,
3140
+ t: o,
3141
+ widerThan: s
3142
+ };
3143
+ }
3144
+ }), Di = { key: 0 }, Oi = ["href"];
3145
+ function ki(e, t, n, r, i, a) {
3146
+ var o;
3147
+ let s = K("Icon"), c = K("Tooltip"), l = K("ProductsListItem"), u = K("Message"), d = q("pis-test-key");
3148
+ return H(), I("div", {
3149
+ ref: "root",
3150
+ class: V(["pis-component", e.componentName])
3151
+ }, [e.componentOptions.visible && e.isReady ? (H(), I("div", Di, [(o = e.relatedLinks) != null && o.length ? (H(!0), I(M, { key: 0 }, W(e.relatedLinks, (t, n) => X((H(), I("a", {
3152
+ key: n,
3153
+ target: "_blank",
3154
+ href: t.url ?? void 0
3155
+ }, [z(l, {
3156
+ "image-src": e.componentOptions.showImages ? t.image ?? void 0 : "",
3157
+ wide: e.widerThan("sm"),
3158
+ "hide-image": !e.componentOptions.showImages
3159
+ }, {
3160
+ content: Y(() => [t.internal ? (H(), P(c, {
3161
+ key: 0,
3162
+ text: e.t("Internal", !0)
3163
+ }, {
3164
+ default: Y(() => [z(s, {
3165
+ class: "text-warning text-end",
3166
+ name: "warning-triangle"
3167
+ })]),
3168
+ _: 1
3169
+ }, 8, ["text"])) : F("", !0), R(" " + J(t.text), 1)]),
3170
+ _: 2
3171
+ }, 1032, [
3172
+ "image-src",
3173
+ "wide",
3174
+ "hide-image"
3175
+ ])], 8, Oi)), [[d, t]])), 128)) : (H(), P(u, {
3176
+ key: 1,
3177
+ class: "p-2"
3178
+ }, {
3179
+ default: Y(() => [R(J(e.t("RelatedLinksNotAvailable")), 1)]),
3180
+ _: 1
3181
+ }))])) : F("", !0)], 2);
3182
+ }
3183
+ var Ai = /*#__PURE__*/ A(Ei, [["render", ki]]), ji = B({
3184
+ name: "pis-products-details-relationships",
3185
+ components: { PrmList: Ir },
3186
+ props: { instanceId: {
3187
+ type: String,
3188
+ default: void 0
3189
+ } },
3190
+ setup(e) {
3191
+ let t = U(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, [Q.ProductRelationships]);
3192
+ return {
3193
+ root: t,
3194
+ componentName: r,
3195
+ isReady: i,
3196
+ isWebComponent: a,
3197
+ store: o,
3198
+ instance: n,
3199
+ prmItems: Br(n).visiblePrmData,
3200
+ productId: N(() => {
3201
+ var e;
3202
+ return (e = o.value) == null || (e = e.data.productDetail) == null || (e = e.item) == null ? void 0 : e.productId;
3203
+ }),
3204
+ t: s,
3205
+ emit: c,
3206
+ buildPrmAnchorId: Rr
3207
+ };
3208
+ }
3209
+ }), Mi = { key: 0 }, Ni = ["id"], Pi = { class: "pis-heading" };
3210
+ function Fi(e, t, n, r, i, a) {
3211
+ let o = K("PrmList"), s = q("pis-test-key");
3212
+ return H(), I("div", {
3213
+ ref: "root",
3214
+ class: V(["pis-component", e.componentName])
3215
+ }, [e.isReady && e.productId ? (H(), I("div", Mi, [(H(!0), I(M, null, W(e.prmItems, (t) => X((H(), I("div", {
3216
+ id: e.buildPrmAnchorId(t.code),
3217
+ key: t.code,
3218
+ class: "mt-4"
3219
+ }, [L("h4", Pi, J(t.description), 1), z(o, {
3220
+ relationship: t,
3221
+ instance: e.instance,
3222
+ "product-id": e.productId,
3223
+ t: e.t,
3224
+ emit: e.emit
3225
+ }, null, 8, [
3226
+ "relationship",
3227
+ "instance",
3228
+ "product-id",
3229
+ "t",
3230
+ "emit"
3231
+ ])], 8, Ni)), [[s, t]])), 128))])) : F("", !0)], 2);
3232
+ }
3233
+ var Ii = /*#__PURE__*/ A(ji, [["render", Fi]]), Li = B({
3234
+ name: "pis-products-details-variants-dropdown",
3235
+ components: {
3236
+ Icon: E,
3237
+ Dropdown: je,
3238
+ Clickable: C
3239
+ },
3240
+ props: { instanceId: {
3241
+ type: String,
3242
+ default: void 0
3243
+ } },
3244
+ setup(e) {
3245
+ let t = U(), n = U(!1), { componentName: r, isReady: i, isWebComponent: a, instance: o, store: s, t: c, routeData: l } = $(t, e.instanceId), u = N(() => {
3246
+ var e;
3247
+ return ((e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.variantsDropdown) ?? {};
3248
+ }), d = N(() => {
3249
+ var e, t;
3250
+ return (e = s.value) != null && (e = e.data.productVariantsDropdown) != null && (e = e.items) != null && e.length ? (t = s.value) == null ? void 0 : t.data.productVariantsDropdown.items : [];
3251
+ }), f = N(() => {
3252
+ var e;
3253
+ return u.value.visible !== !1 && (((e = d.value) == null ? void 0 : e.length) ?? 0) > 0;
3254
+ }), p = N(() => {
3255
+ var e;
3256
+ let t = [];
3257
+ return (e = d.value) != null && e.length && d.value.forEach((e) => {
3258
+ var n;
3259
+ t.push({
3260
+ type: "group",
3261
+ value: e
3262
+ }), (n = e.products) == null || n.forEach((e) => {
3263
+ t.push({
3264
+ type: "product",
3265
+ value: e
3266
+ });
3267
+ });
3268
+ }), t;
3269
+ });
3270
+ return {
3271
+ root: t,
3272
+ componentName: r,
3273
+ isReady: i,
3274
+ isWebComponent: a,
3275
+ instance: o,
3276
+ store: s,
3277
+ t: c,
3278
+ componentOptions: u,
3279
+ variants: d,
3280
+ visible: f,
3281
+ isDropdownOpen: n,
3282
+ selectedProduct: N(() => {
3283
+ var e;
3284
+ return ((e = s.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item) || {};
3285
+ }),
3286
+ dropdownItems: p,
3287
+ attrValue: v,
3288
+ toggleDropdown: () => {
3289
+ n.value = !n.value;
3290
+ },
3291
+ details: async (e) => {
3292
+ if (!(e != null && e.inactive) && l.value && e) {
3293
+ n.value = !1;
3294
+ try {
3295
+ var t;
3296
+ await ((t = o.value) == null ? void 0 : t.execute(new nt(e).from(r)));
3297
+ } catch {}
3298
+ }
3299
+ }
3300
+ };
3301
+ }
3302
+ }), Ri = { key: 0 }, zi = { class: "mb-4 ext-attr-group" }, Bi = { class: "row" }, Vi = { class: "col-12" }, Hi = {
3303
+ key: 0,
3304
+ class: "px-3 py-2 fw-semibold text-muted bg-light border-bottom small sticky-top"
3305
+ }, Ui = { class: "d-flex align-items-center" }, Wi = {
3306
+ key: 0,
3307
+ class: "me-2 flex-shrink-0",
3308
+ style: { width: "2.5rem" }
3309
+ }, Gi = ["src", "alt"], Ki = {
3310
+ key: 1,
3311
+ class: "d-flex align-items-center justify-content-center rounded border bg-light text-muted",
3312
+ style: {
3313
+ height: "2rem",
3314
+ "font-size": "1rem"
3315
+ }
3316
+ }, qi = { class: "flex-grow-1 overflow-hidden" }, Ji = { class: "fw-bold text-truncate" }, Yi = {
3317
+ key: 0,
3318
+ class: "small text-muted text-truncate"
3319
+ }, Xi = ["aria-expanded"], Zi = { class: "d-flex align-items-center flex-grow-1 w-100" }, Qi = {
3320
+ key: 0,
3321
+ class: "me-2 flex-shrink-0",
3322
+ style: { width: "2rem" }
3323
+ }, $i = ["src", "alt"], ea = {
3324
+ key: 1,
3325
+ class: "d-flex align-items-center justify-content-center rounded border bg-light text-muted",
3326
+ style: {
3327
+ height: "1.5rem",
3328
+ "font-size": "0.875rem"
3329
+ }
3330
+ }, ta = { class: "flex-grow-1 overflow-hidden" }, na = {
3331
+ key: 0,
3332
+ class: "text-truncate d-block"
3333
+ }, ra = { class: "fw-medium d-block text-truncate" }, ia = {
3334
+ key: 0,
3335
+ class: "text-muted small d-block text-truncate"
3336
+ }, aa = {
3337
+ key: 1,
3338
+ class: "text-muted"
3339
+ };
3340
+ function oa(e, t, n, r, i, a) {
3341
+ let o = K("Icon"), s = K("Clickable"), c = K("Dropdown"), l = q("safe-html"), u = q("pis-test-key");
3342
+ return H(), I("div", {
3343
+ id: "pis-anchor-variants-dropdown",
3344
+ ref: "root",
3345
+ class: V(["pis-component", e.componentName])
3346
+ }, [e.isReady && e.visible ? (H(), I("div", Ri, [L("h4", null, J(e.t("Variants")), 1), L("div", zi, [L("div", Bi, [L("div", Vi, [z(c, {
3347
+ open: e.isDropdownOpen,
3348
+ "onUpdate:open": t[3] || (t[3] = (t) => e.isDropdownOpen = t),
3349
+ width: "100%",
3350
+ items: e.dropdownItems
3351
+ }, {
3352
+ item: Y(({ item: t }) => {
3353
+ var n;
3354
+ return [t.type === "group" ? X((H(), I("div", Hi, [X(L("span", null, null, 512), [[l, t.value.attributeName + ": " + t.value.attributeValueText]])])), [[u, t]]) : t.type === "product" ? X((H(), P(s, {
3355
+ key: 1,
3356
+ class: V(["dropdown-item py-2", { active: t.value.productId === ((n = e.selectedProduct) == null ? void 0 : n.productId) }]),
3357
+ onClick: (n) => e.details(t.value)
3358
+ }, {
3359
+ default: Y(() => {
3360
+ var n;
3361
+ return [L("div", Ui, [e.componentOptions.showImages === !1 ? F("", !0) : (H(), I("div", Wi, [(n = t.value.images) != null && n.length ? (H(), I("img", {
3362
+ key: 0,
3363
+ src: t.value.images[0].thumbnailUrl,
3364
+ alt: e.attrValue(t.value, "#DisplayName"),
3365
+ class: "img-fluid rounded border",
3366
+ style: {
3367
+ "max-height": "2rem",
3368
+ "object-fit": "contain"
3369
+ },
3370
+ loading: "lazy"
3371
+ }, null, 8, Gi)) : (H(), I("div", Ki, [z(o, { name: "photo-picture" })]))])), L("div", qi, [L("div", Ji, J(e.attrValue(t.value, "#DisplayName")), 1), e.attrValue(t.value, "CatalogDescription") ? (H(), I("div", Yi, J(e.attrValue(t.value, "CatalogDescription")), 1)) : F("", !0)])])];
3372
+ }),
3373
+ _: 2
3374
+ }, 1032, ["class", "onClick"])), [[u, t]]) : F("", !0)];
3375
+ }),
3376
+ activator: Y(({ on: n }) => {
3377
+ var r;
3378
+ return [L("div", Et({
3379
+ class: "form-select d-flex align-items-center",
3380
+ tabindex: "0",
3381
+ role: "combobox",
3382
+ "aria-expanded": e.isDropdownOpen,
3383
+ "aria-haspopup": "listbox"
3384
+ }, jt(n, !0), {
3385
+ onClick: t[0] || (t[0] = (...t) => e.toggleDropdown && e.toggleDropdown(...t)),
3386
+ onKeydown: [t[1] || (t[1] = Pt((...t) => e.toggleDropdown && e.toggleDropdown(...t), ["enter"])), t[2] || (t[2] = Pt(Z((...t) => e.toggleDropdown && e.toggleDropdown(...t), ["prevent"]), ["space"]))]
3387
+ }), [L("div", Zi, [e.componentOptions.showImages !== !1 && e.selectedProduct ? (H(), I("div", Qi, [(r = e.selectedProduct.images) != null && r.length ? (H(), I("img", {
3388
+ key: 0,
3389
+ src: e.selectedProduct.images[0].thumbnailUrl,
3390
+ alt: e.selectedProduct && e.attrValue(e.selectedProduct, "#DisplayName"),
3391
+ class: "img-fluid rounded border",
3392
+ style: {
3393
+ "max-height": "1.5rem",
3394
+ "object-fit": "contain"
3395
+ }
3396
+ }, null, 8, $i)) : (H(), I("div", ea, [z(o, {
3397
+ name: "photo-picture",
3398
+ size: 16
3399
+ })]))])) : F("", !0), L("div", ta, [e.selectedProduct ? (H(), I("span", na, [L("span", ra, J(e.attrValue(e.selectedProduct, "#DisplayName")), 1), e.attrValue(e.selectedProduct, "CatalogDescription") ? (H(), I("span", ia, " (" + J(e.attrValue(e.selectedProduct, "CatalogDescription")) + ") ", 1)) : F("", !0)])) : (H(), I("span", aa, J(e.t("SelectProduct")), 1))])])], 16, Xi)];
3400
+ }),
3401
+ _: 1
3402
+ }, 8, ["open", "items"])])])])])) : F("", !0)], 2);
3403
+ }
3404
+ var sa = /*#__PURE__*/ A(Li, [["render", oa]]), ca = B({
3405
+ name: "pis-products-details-variants-selector",
3406
+ components: {
3407
+ Icon: E,
3408
+ Dropdown: je,
3409
+ Clickable: C
3410
+ },
3411
+ props: { instanceId: {
3412
+ type: String,
3413
+ default: void 0
3414
+ } },
3415
+ setup(e) {
3416
+ let t = U(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, t: s, routeData: c } = $(t, e.instanceId), l = N(() => {
3417
+ var e;
3418
+ return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.variantsSelector) ?? {};
3419
+ }), u = N(() => {
3420
+ var e, t;
3421
+ return (e = o.value) != null && (e = e.data.productVariantsSelector) != null && (e = e.items) != null && e.length ? (t = o.value) == null ? void 0 : t.data.productVariantsSelector.items : [];
3422
+ }), d = N(() => {
3423
+ var e;
3424
+ return l.value.visible !== !1 && (((e = u.value) == null ? void 0 : e.length) ?? 0) > 0;
3425
+ }), f = (e) => {
3426
+ if (l.value.unavailableValuesBehavior === "hidden") {
3427
+ var t;
3428
+ return ((t = e.values) == null ? void 0 : t.filter((e) => e.match === !0)) || [];
3429
+ }
3430
+ return e.values || [];
3431
+ }, p = U({});
3432
+ return {
3433
+ root: t,
3434
+ componentName: n,
3435
+ isReady: r,
3436
+ isWebComponent: i,
3437
+ store: o,
3438
+ t: s,
3439
+ componentOptions: l,
3440
+ variants: u,
3441
+ visible: d,
3442
+ isDropdownOpen: p,
3443
+ VariantAttributeDisplayModeEnum: Ce,
3444
+ getVariantValues: f,
3445
+ details: async (e) => {
3446
+ var t;
3447
+ if (!((t = e.product) != null && t.inactive) && !(l.value.unavailableValuesBehavior === "disabled" && !e.match) && c.value && e.product) try {
3448
+ var r;
3449
+ await ((r = a.value) == null ? void 0 : r.execute(new nt(e.product).from(n)));
3450
+ } catch {}
3451
+ },
3452
+ toggleDropdown: (e) => {
3453
+ p.value[e] = !p.value[e];
3454
+ },
3455
+ getSelectedValue: (e) => {
3456
+ var t;
3457
+ return ((t = e.values) == null ? void 0 : t.find((e) => e.selected)) || null;
3458
+ },
3459
+ Clickable: C
3460
+ };
3461
+ }
3462
+ }), la = { key: 0 }, ua = { class: "mb-4 ext-attr-group" }, da = { class: "mb-3" }, fa = { class: "d-flex justify-content-between align-items-center mb-3" }, pa = { class: "fw-bold" }, ma = {
3463
+ key: 0,
3464
+ class: "variant-values"
3465
+ }, ha = {
3466
+ key: 0,
3467
+ class: "pis-tabs-pills d-flex flex-wrap gap-2 mb-3"
3468
+ }, ga = ["disabled", "onClick"], _a = {
3469
+ key: 1,
3470
+ class: "mb-3"
3471
+ }, va = { class: "d-flex align-items-center" }, ya = {
3472
+ class: "me-2 flex-shrink-0",
3473
+ style: { width: "2rem" }
3474
+ }, ba = ["src", "alt"], xa = { class: "flex-grow-1 min-w-0" }, Sa = { class: "fw-medium text-truncate" }, Ca = [
3475
+ "aria-expanded",
3476
+ "onClick",
3477
+ "onKeydown"
3478
+ ], wa = { class: "d-flex align-items-center flex-grow-1" }, Ta = {
3479
+ class: "me-2 flex-shrink-0",
3480
+ style: { width: "1.5rem" }
3481
+ }, Ea = ["src", "alt"], Da = { class: "flex-grow-1 min-w-0" }, Oa = { class: "text-truncate d-block" }, ka = { class: "fw-medium" }, Aa = {
3482
+ key: 1,
3483
+ class: "text-muted"
3484
+ }, ja = {
3485
+ key: 2,
3486
+ class: "mb-3"
3487
+ }, Ma = { class: "row g-2" }, Na = [
3488
+ "title",
3489
+ "onClick",
3490
+ "onKeydown"
3491
+ ], Pa = {
3492
+ class: "variant-image-container d-flex align-items-center justify-content-center position-relative",
3493
+ style: {
3494
+ width: "100%",
3495
+ "aspect-ratio": "1",
3496
+ "min-height": "60px"
3497
+ }
3498
+ }, Fa = ["src", "alt"], Ia = {
3499
+ key: 1,
3500
+ class: "variant-image-placeholder text-muted d-flex align-items-center justify-content-center h-100"
3501
+ };
3502
+ function La(e, t, n, r, i, a) {
3503
+ let o = K("Clickable"), s = K("Dropdown"), c = K("Icon"), l = q("safe-html"), u = q("pis-test-key");
3504
+ return H(), I("div", {
3505
+ ref: "root",
3506
+ class: V(["pis-component mt-4", e.componentName])
3507
+ }, [e.isReady && e.visible ? (H(), I("div", la, [L("div", ua, [L("h4", da, J(e.t("Variants")), 1), (H(!0), I(M, null, W(e.variants, (t, n) => X((H(), I("div", {
3508
+ key: t.attributeCode || n,
3509
+ class: "mb-4"
3510
+ }, [L("div", fa, [L("div", null, [X(L("span", pa, null, 512), [[l, t.attributeName]])])]), e.getVariantValues(t).length ? (H(), I("div", ma, [t.displayMode === e.VariantAttributeDisplayModeEnum.PILLS ? (H(), I("div", ha, [(H(!0), I(M, null, W(e.getVariantValues(t), (t) => X((H(), I("button", {
3511
+ key: t.attributeValueText,
3512
+ type: "button",
3513
+ class: V(["btn btn-sm", {
3514
+ active: t.selected,
3515
+ "btn-outline-primary": e.componentOptions.unavailableValuesBehavior !== "disabled" || t.match,
3516
+ "btn-outline-secondary": e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match
3517
+ }]),
3518
+ disabled: e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match,
3519
+ onClick: (n) => t.product && e.details(t)
3520
+ }, [L("span", null, J(t.attributeValueText), 1)], 10, ga)), [[u, t]])), 128))])) : t.displayMode === e.VariantAttributeDisplayModeEnum.DROPDOWN ? (H(), I("div", _a, [z(s, {
3521
+ open: e.isDropdownOpen[t.attributeCode || ""],
3522
+ "onUpdate:open": (n) => e.isDropdownOpen[t.attributeCode || ""] = n,
3523
+ width: "100%",
3524
+ items: e.getVariantValues(t).map((e) => ({
3525
+ type: "value",
3526
+ value: e
3527
+ }))
3528
+ }, {
3529
+ item: Y(({ item: n }) => [n.type === "value" ? X((H(), P(o, {
3530
+ key: 0,
3531
+ class: V(["dropdown-item py-2", {
3532
+ active: n.value.selected,
3533
+ disabled: e.componentOptions.unavailableValuesBehavior === "disabled" && !n.value.match
3534
+ }]),
3535
+ onClick: (r) => {
3536
+ e.toggleDropdown(t.attributeCode || ""), e.details(n.value);
3537
+ }
3538
+ }, {
3539
+ default: Y(() => {
3540
+ var e;
3541
+ return [L("div", va, [L("div", ya, [(e = n.value.product) != null && (e = e.images) != null && e.length ? (H(), I("img", {
3542
+ key: 0,
3543
+ src: n.value.product.images[0].thumbnailUrl,
3544
+ alt: n.value.name,
3545
+ class: "img-fluid rounded border",
3546
+ style: {
3547
+ "max-height": "1.5rem",
3548
+ "object-fit": "contain"
3549
+ },
3550
+ loading: "lazy"
3551
+ }, null, 8, ba)) : F("", !0)]), L("div", xa, [L("div", Sa, J(n.value.attributeValueText), 1)])])];
3552
+ }),
3553
+ _: 2
3554
+ }, 1032, ["class", "onClick"])), [[u, n]]) : F("", !0)]),
3555
+ activator: Y(({ on: n }) => {
3556
+ var r, i;
3557
+ return [L("div", Et({
3558
+ class: "form-select d-flex align-items-center",
3559
+ tabindex: "0",
3560
+ role: "combobox",
3561
+ "aria-expanded": e.isDropdownOpen[t.attributeCode || ""] ? "true" : "false",
3562
+ "aria-haspopup": "listbox",
3563
+ style: {
3564
+ cursor: "pointer",
3565
+ "background-color": "white"
3566
+ }
3567
+ }, jt(n, !0), {
3568
+ onClick: (n) => e.toggleDropdown(t.attributeCode || ""),
3569
+ onKeydown: [Pt((n) => e.toggleDropdown(t.attributeCode || ""), ["enter"]), Pt(Z((n) => e.toggleDropdown(t.attributeCode || ""), ["prevent"]), ["space"])]
3570
+ }), [L("div", wa, [e.getSelectedValue(t) ? (H(), I(M, { key: 0 }, [L("div", Ta, [(r = e.getSelectedValue(t).product) != null && (r = r.images) != null && r.length ? (H(), I("img", {
3571
+ key: 0,
3572
+ src: (i = e.getSelectedValue(t)) == null || (i = i.product) == null || (i = i.images) == null || (i = i[0]) == null ? void 0 : i.thumbnailUrl,
3573
+ alt: e.getSelectedValue(t).attributeValueText,
3574
+ class: "img-fluid rounded border",
3575
+ style: {
3576
+ "max-height": "1.5rem",
3577
+ "object-fit": "contain"
3578
+ }
3579
+ }, null, 8, Ea)) : F("", !0)]), L("div", Da, [L("span", Oa, [L("span", ka, J(e.getSelectedValue(t).attributeValueText), 1)])])], 64)) : (H(), I("span", Aa, J(e.t("SelectVariant")), 1))])], 16, Ca)];
3580
+ }),
3581
+ _: 2
3582
+ }, 1032, [
3583
+ "open",
3584
+ "onUpdate:open",
3585
+ "items"
3586
+ ])])) : t.displayMode === e.VariantAttributeDisplayModeEnum.IMAGES ? (H(), I("div", ja, [L("div", Ma, [(H(!0), I(M, null, W(e.getVariantValues(t), (t) => {
3587
+ var n;
3588
+ return X((H(), I("div", {
3589
+ key: t.attributeValueText,
3590
+ class: "col-xl-2 col-lg-3 col-md-4 col-sm-4 col-4"
3591
+ }, [L("div", {
3592
+ class: V(["card h-100 text-center position-relative", {
3593
+ "border-primary": t.selected,
3594
+ "opacity-50": e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match,
3595
+ "border-1": t.selected
3596
+ }]),
3597
+ title: t.attributeValueText,
3598
+ role: "button",
3599
+ tabindex: "0",
3600
+ style: Dt({
3601
+ cursor: e.componentOptions.unavailableValuesBehavior === "disabled" && !t.match ? "not-allowed" : "pointer",
3602
+ transition: "all 0.15s ease-in-out"
3603
+ }),
3604
+ onClick: (n) => t.product && e.details(t),
3605
+ onKeydown: [Pt((n) => t.product && e.details(t), ["enter"]), Pt(Z((n) => t.product && e.details(t), ["prevent"]), ["space"])]
3606
+ }, [L("div", Pa, [L("div", null, [(n = t.product) != null && (n = n.images) != null && n.length ? (H(), I("img", {
3607
+ key: 0,
3608
+ src: t.product.images[0].thumbnailUrl,
3609
+ alt: t.attributeValueText,
3610
+ class: "variant-image img-fluid",
3611
+ style: {
3612
+ "max-height": "100%",
3613
+ "max-width": "100%",
3614
+ "object-fit": "contain"
3615
+ }
3616
+ }, null, 8, Fa)) : (H(), I("div", Ia, [z(c, {
3617
+ name: "photo-picture",
3618
+ size: 24
3619
+ })]))])])], 46, Na)])), [[u, t]]);
3620
+ }), 128))])])) : F("", !0)])) : F("", !0)])), [[u, t]])), 128))])])) : F("", !0)], 2);
3621
+ }
3622
+ var Ra = /*#__PURE__*/ A(ca, [["render", La]]), za = B({
3623
+ name: "pis-products-details-variants-table",
3624
+ components: {
3625
+ Icon: E,
3626
+ Clickable: C,
3627
+ MountPoint: de
3628
+ },
3629
+ props: { instanceId: {
3630
+ type: String,
3631
+ default: void 0
3632
+ } },
3633
+ setup(e) {
3634
+ let t = U(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, t: s, routeData: c } = $(t, e.instanceId), l = N(() => {
3635
+ var e;
3636
+ return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.variantsTable) ?? {};
3637
+ }), u = N(() => {
3638
+ var e, t;
3639
+ return (e = o.value) != null && (e = e.data.productVariantsTable) != null && (e = e.items) != null && e.length ? (t = o.value) == null ? void 0 : t.data.productVariantsTable.items : [];
3640
+ }), d = N(() => {
3641
+ var e;
3642
+ return l.value.visible !== !1 && (((e = u.value) == null ? void 0 : e.length) ?? 0) > 0;
3643
+ }), f = U(), p = U(), m = (e) => {
3644
+ let t = u.value.find((t) => t.attributeCode === e);
3645
+ return (t == null ? void 0 : t.products) !== void 0 && t.variantAttributes !== void 0;
3646
+ }, h = N(() => u.value.find((e) => e.attributeCode === f.value));
3647
+ Nt(u, (e) => {
3648
+ var t, n;
3649
+ h.value || (f.value = ((t = e.find((e) => e.products !== void 0 && e.variantAttributes !== void 0)) == null ? void 0 : t.attributeCode) ?? ((n = e[0]) == null ? void 0 : n.attributeCode));
3650
+ }, { immediate: !0 });
3651
+ let g = async (e) => {
3652
+ if (e !== f.value && p.value !== e) {
3653
+ if (m(e)) {
3654
+ f.value = e;
3655
+ return;
3656
+ }
3657
+ p.value = e;
3658
+ try {
3659
+ var t;
3660
+ await ((t = a.value) == null ? void 0 : t.execute(new st({ attributeCode: e }).from(n))), m(e) && (f.value = e);
3661
+ } catch {} finally {
3662
+ p.value === e && (p.value = void 0);
3663
+ }
3664
+ }
3665
+ }, _ = async (e) => {
3666
+ if (!(e != null && e.inactive) && c.value && e) try {
3667
+ var t;
3668
+ await ((t = a.value) == null ? void 0 : t.execute(new nt(e).from(n)));
3669
+ } catch {}
3670
+ }, y = Se((e) => ({
3671
+ col: e.col,
3672
+ group: e.group,
3673
+ item: e.item,
3674
+ instance: a.value,
3675
+ t: s,
3676
+ attrValue: v,
3677
+ details: _
3678
+ }));
3679
+ return {
3680
+ root: t,
3681
+ componentName: n,
3682
+ isReady: r,
3683
+ isWebComponent: i,
3684
+ instance: a,
3685
+ store: o,
3686
+ t: s,
3687
+ componentOptions: l,
3688
+ groups: u,
3689
+ selectedGroup: h,
3690
+ loadingAttributeCode: p,
3691
+ selectGroup: g,
3692
+ visible: d,
3693
+ attrValue: v,
3694
+ Clickable: C,
3695
+ details: _,
3696
+ reactiveContext: Oe,
3697
+ cellCtx: y
3698
+ };
3699
+ }
3700
+ }), Ba = { key: 0 }, Va = { class: "mb-4 ext-attr-group" }, Ha = { class: "pis-heading ext-attr-group-heading" }, Ua = ["aria-label"], Wa = [
3701
+ "aria-pressed",
3702
+ "aria-busy",
3703
+ "disabled",
3704
+ "onClick"
3705
+ ], Ga = {
3706
+ key: 0,
3707
+ class: "mb-4"
3708
+ }, Ka = {
3709
+ class: "table-responsive position-relative d-none d-md-block",
3710
+ style: {
3711
+ "min-height": "3rem",
3712
+ "overflow-x": "auto"
3713
+ }
3714
+ }, qa = { class: "table table-sm table-striped" }, Ja = {
3715
+ key: 0,
3716
+ style: { width: "80px" }
3717
+ }, Ya = { class: "table-light" }, Xa = {
3718
+ key: 0,
3719
+ class: "text-center border-top-0 ps-4 pe-4"
3720
+ }, Za = {
3721
+ key: 0,
3722
+ class: "text-center align-middle"
3723
+ }, Qa = {
3724
+ key: 0,
3725
+ class: "d-flex align-items-center justify-content-center",
3726
+ style: { height: "40px" }
3727
+ }, $a = ["src"], eo = {
3728
+ key: 1,
3729
+ class: "d-flex align-items-center justify-content-center text-muted",
3730
+ style: { height: "40px" }
3731
+ }, to = { key: 1 }, no = {
3732
+ key: 1,
3733
+ class: "fw-bold"
3734
+ }, ro = { key: 2 }, io = { class: "d-flex flex-wrap gap-1" }, ao = { class: "mt-1" }, oo = {
3735
+ class: "badge bg-primary text-white variant-value-badge",
3736
+ style: { "font-size": "0.7rem" }
3737
+ }, so = { key: 3 }, co = { class: "d-md-none" }, lo = { class: "card-body p-3" }, uo = { class: "d-flex align-items-start mb-2" }, fo = {
3738
+ key: 0,
3739
+ class: "flex-shrink-0 me-3"
3740
+ }, po = {
3741
+ key: 0,
3742
+ style: {
3743
+ width: "60px",
3744
+ height: "60px"
3745
+ }
3746
+ }, mo = ["src"], ho = {
3747
+ key: 1,
3748
+ class: "d-flex align-items-center justify-content-center text-muted rounded border",
3749
+ style: {
3750
+ width: "60px",
3751
+ height: "60px"
3752
+ }
3753
+ }, go = { class: "flex-grow-1 min-w-0" }, _o = { class: "mb-2" }, vo = {
3754
+ key: 1,
3755
+ class: "fw-bold text-break"
3756
+ }, yo = { class: "mb-2" }, bo = {
3757
+ class: "badge bg-primary text-white variant-value-badge",
3758
+ style: { "font-size": "0.7rem" }
3759
+ }, xo = { class: "mb-3" }, So = { class: "d-flex flex-wrap gap-1" }, Co = { key: 0 }, wo = { class: "text-muted d-block" }, To = {
3760
+ key: 1,
3761
+ class: "text-break"
3762
+ };
3763
+ function Eo(e, t, n, r, i, a) {
3764
+ let o = K("MountPoint"), s = K("Icon"), c = K("Clickable"), l = q("safe-html"), u = q("pis-test-key");
3765
+ return H(), I("div", {
3766
+ id: "pis-anchor-variants-table",
3767
+ ref: "root",
3768
+ class: V(["pis-component mt-4", e.componentName])
3769
+ }, [e.isReady && e.visible ? (H(), I("div", Ba, [L("div", Va, [
3770
+ L("h4", Ha, J(e.t("VariantProducts")), 1),
3771
+ L("div", {
3772
+ class: "pis-tabs-pills d-flex flex-wrap gap-2 mb-3",
3773
+ role: "group",
3774
+ "aria-label": e.t("VariantProducts")
3775
+ }, [(H(!0), I(M, null, W(e.groups, (t) => {
3776
+ var n, r;
3777
+ return X((H(), I("button", {
3778
+ key: t.attributeCode,
3779
+ type: "button",
3780
+ class: V(["btn btn-sm variant-group-pill", t.attributeCode === ((n = e.selectedGroup) == null ? void 0 : n.attributeCode) ? "btn-primary" : "btn-outline-primary"]),
3781
+ "aria-pressed": t.attributeCode === ((r = e.selectedGroup) == null ? void 0 : r.attributeCode),
3782
+ "aria-busy": e.loadingAttributeCode === t.attributeCode,
3783
+ disabled: e.loadingAttributeCode === t.attributeCode,
3784
+ onClick: (n) => e.selectGroup(t.attributeCode)
3785
+ }, null, 10, Wa)), [[l, t.attributeName + ": " + t.attributeValueText], [u, t]]);
3786
+ }), 128))], 8, Ua),
3787
+ e.selectedGroup ? (H(), I("div", Ga, [L("div", Ka, [L("table", qa, [
3788
+ L("colgroup", null, [e.componentOptions.showImages === !1 ? F("", !0) : (H(), I("col", Ja)), (H(!0), I(M, null, W(e.componentOptions.columns, (e, t) => X((H(), I("col", {
3789
+ key: t,
3790
+ style: Dt({ width: e.width })
3791
+ }, null, 4)), [[u, e]])), 128))]),
3792
+ L("thead", Ya, [L("tr", null, [e.componentOptions.showImages === !1 ? F("", !0) : (H(), I("th", Xa, [...t[0] || (t[0] = [L("span", { class: "ms-1 me-1" }, null, -1)])])), (H(!0), I(M, null, W(e.componentOptions.columns, (t, n) => X((H(), I("th", {
3793
+ key: n,
3794
+ class: "border-top-0"
3795
+ }, [t.headerTemplate ? (H(), P(o, {
3796
+ key: 0,
3797
+ callbacks: t.headerTemplate,
3798
+ ctx: e.reactiveContext({
3799
+ t: e.t,
3800
+ col: t
3801
+ })
3802
+ }, null, 8, ["callbacks", "ctx"])) : (H(), I(M, { key: 1 }, [R(J(t.caption), 1)], 64))])), [[u, t]])), 128))])]),
3803
+ L("tbody", null, [(H(!0), I(M, null, W(e.selectedGroup.products ?? [], (t) => {
3804
+ var n;
3805
+ return X((H(), I("tr", { key: `${e.selectedGroup.attributeCode}-${t.productId}` }, [e.componentOptions.showImages === !1 ? F("", !0) : (H(), I("td", Za, [(n = t.images) != null && n.length ? (H(), I("div", Qa, [L("img", {
3806
+ src: t.images[0].thumbnailUrl,
3807
+ class: "img-fluid",
3808
+ style: {
3809
+ "max-height": "40px",
3810
+ "object-fit": "contain"
3811
+ }
3812
+ }, null, 8, $a)])) : (H(), I("div", eo, [z(s, {
3813
+ name: "photo-picture",
3814
+ size: 24
3815
+ })]))])), (H(!0), I(M, null, W(e.componentOptions.columns, (n, r) => X((H(), I("td", {
3816
+ key: r,
3817
+ class: "align-middle"
3818
+ }, [n.cellTemplate ? (H(), P(o, {
3819
+ key: 0,
3820
+ callbacks: n.cellTemplate,
3821
+ ctx: e.cellCtx({
3822
+ item: t,
3823
+ col: n,
3824
+ group: e.selectedGroup
3825
+ })
3826
+ }, null, 8, ["callbacks", "ctx"])) : n.dataField === "ProductName" ? (H(), I("div", to, [t.productId ? (H(), P(c, {
3827
+ key: 0,
3828
+ class: "text-decoration-none fw-bold",
3829
+ onClick: (n) => e.details(t)
3830
+ }, {
3831
+ default: Y(() => [R(J(e.attrValue(t, "#DisplayName")), 1)]),
3832
+ _: 2
3833
+ }, 1032, ["onClick"])) : (H(), I("span", no, J(e.attrValue(t, "#DisplayName")), 1))])) : n.dataField === "VariantAttributes" ? (H(), I("div", ro, [L("div", io, [(H(!0), I(M, null, W(e.selectedGroup.variantAttributes ?? [], (n, r) => X((H(), I("span", {
3834
+ key: r,
3835
+ class: "badge bg-light text-dark border variant-value-badge"
3836
+ })), [[l, n.attributeName + ": " + e.attrValue(t, n.attributeCode)], [u, n]])), 128))]), L("div", ao, [X(L("span", oo, null, 512), [[l, e.selectedGroup.attributeName + ": " + e.attrValue(t, e.selectedGroup.attributeCode)]])])])) : (H(), I("div", so, J(e.attrValue(t, n.dataField)), 1))])), [[u, n]])), 128))])), [[u, t]]);
3837
+ }), 128))])
3838
+ ])]), L("div", co, [(H(!0), I(M, null, W(e.selectedGroup.products ?? [], (t) => {
3839
+ var n;
3840
+ return X((H(), I("div", {
3841
+ key: `mobile-${e.selectedGroup.attributeCode}-${t.productId}`,
3842
+ class: "card mb-3 border"
3843
+ }, [L("div", lo, [
3844
+ L("div", uo, [e.componentOptions.showImages === !1 ? F("", !0) : (H(), I("div", fo, [(n = t.images) != null && n.length ? (H(), I("div", po, [L("img", {
3845
+ src: t.images[0].thumbnailUrl,
3846
+ class: "img-fluid rounded",
3847
+ style: {
3848
+ width: "100%",
3849
+ height: "100%",
3850
+ "object-fit": "contain",
3851
+ border: "1px solid #dee2e6"
3852
+ }
3853
+ }, null, 8, mo)])) : (H(), I("div", ho, [z(s, { name: "photo-picture" })]))])), L("div", go, [L("div", _o, [t.productId ? (H(), P(c, {
3854
+ key: 0,
3855
+ class: "text-decoration-none fw-bold text-break",
3856
+ onClick: (n) => e.details(t)
3857
+ }, {
3858
+ default: Y(() => [R(J(e.attrValue(t, "#DisplayName")), 1)]),
3859
+ _: 2
3860
+ }, 1032, ["onClick"])) : (H(), I("span", vo, J(e.attrValue(t, "#DisplayName")), 1))]), L("div", yo, [X(L("span", bo, null, 512), [[l, e.selectedGroup.attributeName + ": " + e.attrValue(t, e.selectedGroup.attributeCode)]])])])]),
3861
+ L("div", xo, [L("div", So, [(H(!0), I(M, null, W(e.selectedGroup.variantAttributes ?? [], (n, r) => X((H(), I("span", {
3862
+ key: r,
3863
+ class: "badge bg-light text-dark border variant-value-badge",
3864
+ style: { "font-size": "0.7rem" }
3865
+ })), [[l, n.attributeName + ": " + e.attrValue(t, n.attributeCode)], [u, n]])), 128))])]),
3866
+ (H(!0), I(M, null, W(e.componentOptions.columns, (n, r) => X((H(), I("div", {
3867
+ key: r,
3868
+ class: "mb-2"
3869
+ }, [n.dataField !== "ProductName" && n.dataField !== "VariantAttributes" ? (H(), I("div", Co, [L("small", wo, J(n.caption) + ":", 1), n.cellTemplate ? (H(), P(o, {
3870
+ key: 0,
3871
+ callbacks: n.cellTemplate,
3872
+ ctx: e.cellCtx({
3873
+ item: t,
3874
+ col: n,
3875
+ group: e.selectedGroup
3876
+ })
3877
+ }, null, 8, ["callbacks", "ctx"])) : (H(), I("span", To, J(e.attrValue(t, n.dataField) || "-"), 1))])) : F("", !0)])), [[u, n]])), 128))
3878
+ ])])), [[u, t]]);
3879
+ }), 128))])])) : F("", !0)
3880
+ ])])) : F("", !0)], 2);
3881
+ }
3882
+ var Do = /*#__PURE__*/ A(za, [["render", Eo], ["__scopeId", "data-v-4713f75a"]]), Oo = B({
3883
+ name: "pis-products-details-actions",
3884
+ components: { MountPoint: de },
3885
+ props: { instanceId: {
3886
+ type: String,
3887
+ default: void 0
3888
+ } },
3889
+ setup(e) {
3890
+ let t = U(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, []);
3891
+ return {
3892
+ root: t,
3893
+ componentName: r,
3894
+ isReady: i,
3895
+ isWebComponent: a,
3896
+ store: o,
3897
+ instance: n,
3898
+ item: N(() => {
3899
+ var e;
3900
+ return (e = o.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item;
3901
+ }),
3902
+ componentOptions: N(() => {
3903
+ var e;
3904
+ return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.actions) ?? {};
3905
+ }),
3906
+ emit: c,
3907
+ t: s,
3908
+ reactiveContext: Oe
3909
+ };
3910
+ }
3911
+ }), ko = { key: 0 }, Ao = {
3912
+ key: 0,
3913
+ class: "mt-2"
3914
+ };
3915
+ function jo(e, t, n, r, i, a) {
3916
+ let o = K("MountPoint");
3917
+ return H(), I("div", {
3918
+ ref: "root",
3919
+ class: V(["pis-component", e.componentName])
3920
+ }, [e.isReady && e.item ? (H(), I("div", ko, [e.componentOptions.actionTemplate ? (H(), I("div", Ao, [z(o, {
3921
+ callbacks: e.componentOptions.actionTemplate,
3922
+ ctx: e.reactiveContext({
3923
+ instance: e.instance,
3924
+ item: e.item,
3925
+ emit: e.emit,
3926
+ t: e.t
3927
+ })
3928
+ }, null, 8, ["callbacks", "ctx"])])) : F("", !0)])) : F("", !0)], 2);
3929
+ }
3930
+ var Mo = /*#__PURE__*/ A(Oo, [["render", jo]]), No = B({
3931
+ name: "Tab",
3932
+ props: {
3933
+ title: {
3934
+ type: String,
3935
+ default: void 0
3936
+ },
3937
+ icon: {
3938
+ type: String,
3939
+ default: void 0
3940
+ },
3941
+ loading: Boolean,
3942
+ count: {
3943
+ type: [String, Number],
3944
+ default: void 0
3945
+ },
3946
+ extclass: {
3947
+ type: String,
3948
+ default: void 0
3949
+ }
3950
+ }
3951
+ });
3952
+ //#endregion
3953
+ //#region src/common/components/Tab.vue
3954
+ function Po(e, t, n, r, i, a) {
3955
+ return G(e.$slots, "default");
3956
+ }
3957
+ var Fo = /*#__PURE__*/ A(No, [["render", Po]]), Io = 0, Lo = {
3958
+ xs: "pis-tabs-xs",
3959
+ sm: "pis-tabs-sm",
3960
+ md: "pis-tabs-md",
3961
+ lg: "pis-tabs-lg",
3962
+ xl: "pis-tabs-xl"
3963
+ }, Ro = {
3964
+ xs: 16,
3965
+ sm: 16,
3966
+ md: 16,
3967
+ lg: 24,
3968
+ xl: 24
3969
+ }, zo = (e) => e.flatMap((e) => e.type === Fo ? [e] : e.type === M && Array.isArray(e.children) ? zo(e.children) : []), Bo = B({
3970
+ name: "Tabs",
3971
+ components: {
3972
+ Clickable: C,
3973
+ Icon: E,
3974
+ Spinner: Pe
3975
+ },
3976
+ props: {
3977
+ modelValue: {
3978
+ type: Number,
3979
+ default: 0
3980
+ },
3981
+ desktop: Boolean,
3982
+ size: {
3983
+ type: String,
3984
+ default: "md"
3985
+ },
3986
+ variant: {
3987
+ type: String,
3988
+ default: "floating"
3989
+ },
3990
+ divider: Boolean
3991
+ },
3992
+ emits: ["update:modelValue"],
3993
+ setup(e, { slots: t }) {
3994
+ let n = N(() => t.default ? zo(t.default()) : []), r = N(() => [
3995
+ Lo[e.size] ?? Lo.md,
3996
+ e.variant === "panel" && "pis-tabs-panel",
3997
+ e.variant === "pills" && "pis-tabs-pills",
3998
+ e.divider && "pis-tabs-divider"
3999
+ ]), i = N(() => Ro[e.size] ?? 16), a = U("tabpanel");
4000
+ return Ot(() => {
4001
+ a.value = `pis-tabpanel-${++Io}`;
4002
+ }), {
4003
+ tabItems: n,
4004
+ listClasses: r,
4005
+ iconSize: i,
4006
+ idPrefix: a
4007
+ };
4008
+ }
4009
+ }), Vo = { key: 0 }, Ho = {
4010
+ key: 2,
4011
+ class: "badge rounded-pill bg-secondary text-body ms-1 small"
4012
+ }, Uo = ["id"], Wo = { key: 1 }, Go = { class: "my-4 d-flex align-items-center mb-0 mt-5" };
4013
+ function Ko(e, t, n, r, i, a) {
4014
+ let o = K("Icon"), s = K("Spinner"), c = K("Clickable"), l = q("pis-test-key");
4015
+ return e.desktop ? (H(), I("div", Vo, [L("ul", {
4016
+ class: V(["nav nav-tabs mb-3", e.listClasses]),
4017
+ role: "tablist"
4018
+ }, [(H(!0), I(M, null, W(e.tabItems, (t, n) => {
4019
+ var r;
4020
+ return X((H(), I("li", {
4021
+ key: n,
4022
+ class: V([(r = t.props) == null ? void 0 : r.extclass])
4023
+ }, [z(c, {
4024
+ class: V(["nav-link d-flex align-items-center", { active: n === e.modelValue }]),
4025
+ role: "tab",
4026
+ "aria-selected": n === e.modelValue ? "true" : "false",
4027
+ "aria-controls": `${e.idPrefix}-${n}`,
4028
+ onClick: (t) => e.$emit("update:modelValue", n)
4029
+ }, {
4030
+ default: Y(() => {
4031
+ var n, r, i, a, c;
4032
+ return [
4033
+ (n = t.props) != null && n.icon ? (H(), P(o, {
4034
+ key: 0,
4035
+ name: t.props.icon,
4036
+ class: "me-1",
4037
+ size: e.iconSize
4038
+ }, null, 8, ["name", "size"])) : F("", !0),
4039
+ R(" " + J((r = t.props) == null ? void 0 : r.title) + " ", 1),
4040
+ (i = t.props) != null && i.loading ? (H(), P(s, {
4041
+ key: 1,
4042
+ class: "ms-1",
4043
+ sm: ""
4044
+ })) : F("", !0),
4045
+ !((a = t.props) != null && a.loading) && (c = t.props) != null && c.count ? (H(), I("span", Ho, J(t.props.count), 1)) : F("", !0)
4046
+ ];
4047
+ }),
4048
+ _: 2
4049
+ }, 1032, [
4050
+ "aria-selected",
4051
+ "aria-controls",
4052
+ "class",
4053
+ "onClick"
4054
+ ])], 2)), [[l, t]]);
4055
+ }), 128))], 2), (H(!0), I(M, null, W(e.tabItems, (t, n) => X((H(), I("div", {
4056
+ id: `${e.idPrefix}-${n}`,
4057
+ key: n,
4058
+ role: "tabpanel",
4059
+ style: Dt({ display: n === e.modelValue ? "block" : "none" })
4060
+ }, [(H(), P(At(t)))], 12, Uo)), [[l, t]])), 128))])) : (H(), I("div", Wo, [(H(!0), I(M, null, W(e.tabItems, (e, n) => {
4061
+ var r, i, a;
4062
+ return X((H(), I("div", { key: n }, [
4063
+ L("h4", Go, [(r = e.props) != null && r.isLoading ? (H(), P(s, {
4064
+ key: 0,
4065
+ class: "me-2",
4066
+ sm: ""
4067
+ })) : (i = e.props) != null && i.icon ? (H(), P(o, {
4068
+ key: 1,
4069
+ name: e.props.icon,
4070
+ class: "me-2"
4071
+ }, null, 8, ["name"])) : F("", !0), R(" " + J((a = e.props) == null ? void 0 : a.title), 1)]),
4072
+ t[0] || (t[0] = L("hr", {
4073
+ class: "mt-2",
4074
+ style: { height: "2px" }
4075
+ }, null, -1)),
4076
+ (H(), P(At(e)))
4077
+ ])), [[l, e]]);
4078
+ }), 128))]));
4079
+ }
4080
+ //#endregion
4081
+ //#region src/products/components/details/ProductsDetailsData.vue?vue&type=script&lang.ts
4082
+ var qo = B({
4083
+ name: "pis-products-details-data",
4084
+ components: {
4085
+ Tabs: /* @__PURE__ */ A(Bo, [["render", Ko]]),
4086
+ Tab: Fo,
4087
+ NavigationBtns: dn,
4088
+ Icon: E,
4089
+ Btn: ye,
4090
+ ProductDetailsRelatedLinks: Ai,
4091
+ ProductDetailsAttributeGroups: Xr,
4092
+ ProductDetailsRelationships: Ii,
4093
+ ProductDetailsNavigation: bi,
4094
+ ProductDetailsClassifications: oi,
4095
+ Message: at,
4096
+ ProductDetailsVariantsTable: Do
4097
+ },
4098
+ props: { instanceId: {
4099
+ type: String,
4100
+ default: void 0
4101
+ } },
4102
+ setup(e) {
4103
+ let t = U(), n = U(0), { componentName: r, isReady: i, isWebComponent: a, instance: o, store: s, routeData: c, t: l, widerThan: u } = $(t, e.instanceId, [
4104
+ Q.ProductClassifications,
4105
+ Q.AttributeGroups,
4106
+ Q.ProductRelationships,
4107
+ Q.RelatedLinks
4108
+ ]), d = N(() => {
4109
+ var e;
4110
+ return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.data;
4111
+ }), f = N(() => {
4112
+ var e;
4113
+ return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.classifications) == null ? void 0 : e.visible;
4114
+ }), p = N(() => {
4115
+ var e;
4116
+ return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.relatedLinks) == null ? void 0 : e.visible;
4117
+ }), m = N(() => {
4118
+ var e;
4119
+ return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.data) == null || (e = e.downloads) == null ? void 0 : e.visible;
4120
+ }), h = N(() => {
4121
+ var e;
4122
+ return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.data) == null || (e = e.downloads) == null ? void 0 : e.loading;
4123
+ }), g = N(() => {
4124
+ var e;
4125
+ return (e = s.value) == null || (e = e.options.components) == null || (e = e.details) == null || (e = e.data) == null || (e = e.downloads) == null ? void 0 : e.count;
4126
+ }), _ = N(() => {
4127
+ var e;
4128
+ return ((e = s.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item) != null;
4129
+ }), v = N(() => {
4130
+ var e, t;
4131
+ if (!((e = d.value) != null && e.showTabCounts)) return;
4132
+ var n = (t = s.value) == null || (t = t.data.productClassifications) == null ? void 0 : t.items;
4133
+ if (!n) return 0;
4134
+ let r = 0;
4135
+ for (let e in n) n[e].forEach(() => {
4136
+ r++;
4137
+ });
4138
+ return r;
4139
+ }), y = N(() => {
4140
+ var e, t;
4141
+ if ((e = d.value) != null && e.showTabCounts) {
4142
+ var n = (t = s.value) == null || (t = t.data.relatedLinks) == null ? void 0 : t.items;
4143
+ return n ? n.length : 0;
4144
+ }
4145
+ });
4146
+ return Nt(() => {
4147
+ var e;
4148
+ return (e = c.value) == null ? void 0 : e.view;
4149
+ }, (e, t) => {
4150
+ e === "detail" && e !== t && (n.value = 0);
4151
+ }), {
4152
+ root: t,
4153
+ itemLoaded: _,
4154
+ currentTabIndex: n,
4155
+ componentName: r,
4156
+ isReady: i,
4157
+ isWebComponent: a,
4158
+ store: s,
4159
+ classifications: f,
4160
+ instance: o,
4161
+ downloads: m,
4162
+ downloadsLoading: h,
4163
+ downloadsCount: g,
4164
+ relatedLinks: p,
4165
+ componentOptions: d,
4166
+ classificationCount: v,
4167
+ relatedLinkCount: y,
4168
+ t: l,
4169
+ widerThan: u,
4170
+ scrollTop: async () => {
4171
+ try {
4172
+ var e, t;
4173
+ await ((e = o.value) == null ? void 0 : e.execute(new Qe({ productId: ((t = c.value) == null || (t = t.detail) == null ? void 0 : t.productId) || "" }).from(r)));
4174
+ } catch {}
4175
+ }
4176
+ };
4177
+ }
4178
+ });
4179
+ //#endregion
4180
+ //#region src/products/components/details/ProductsDetailsData.vue
4181
+ function Jo(e, t, n, r, i, a) {
4182
+ var o, s;
4183
+ let c = K("ProductDetailsNavigation"), l = K("ProductDetailsAttributeGroups"), u = K("ProductDetailsRelationships"), d = K("ProductDetailsVariantsTable"), f = K("Tab"), p = K("ProductDetailsClassifications"), m = K("Message"), h = K("ProductDetailsRelatedLinks"), g = K("Tabs"), _ = K("NavigationBtns"), v = K("Icon"), y = K("Btn");
4184
+ return H(), I("div", {
4185
+ ref: "root",
4186
+ class: V(["pis-component", e.componentName])
4187
+ }, [e.isReady && e.itemLoaded ? (H(), I(M, { key: 0 }, [z(g, {
4188
+ modelValue: e.currentTabIndex,
4189
+ "onUpdate:modelValue": t[0] || (t[0] = (t) => e.currentTabIndex = t),
4190
+ class: "mt-4",
4191
+ size: "xl",
4192
+ desktop: e.widerThan("md")
4193
+ }, {
4194
+ default: Y(() => {
4195
+ var t, n, r, i;
4196
+ return [
4197
+ z(f, {
4198
+ title: e.t("DetailsTabTitle"),
4199
+ icon: (t = e.componentOptions) != null && t.showTabIcons ? "file-document" : void 0,
4200
+ extclass: "ext-tab-details"
4201
+ }, {
4202
+ default: Y(() => [
4203
+ z(c, { "instance-id": e.instanceId }, null, 8, ["instance-id"]),
4204
+ z(l, { "instance-id": e.instanceId }, null, 8, ["instance-id"]),
4205
+ z(u, { "instance-id": e.instanceId }, null, 8, ["instance-id"]),
4206
+ z(d, { "instance-id": e.instanceId }, null, 8, ["instance-id"])
4207
+ ]),
4208
+ _: 1
4209
+ }, 8, ["title", "icon"]),
4210
+ e.classifications ? (H(), P(f, {
4211
+ key: 0,
4212
+ title: e.t("CategoriesTabTitle"),
4213
+ icon: (n = e.componentOptions) != null && n.showTabIcons ? "folder-open" : void 0,
4214
+ extclass: "ext-tab-details",
4215
+ count: e.classificationCount
4216
+ }, {
4217
+ default: Y(() => [z(p, { "instance-id": e.instanceId }, null, 8, ["instance-id"])]),
4218
+ _: 1
4219
+ }, 8, [
4220
+ "title",
4221
+ "icon",
4222
+ "count"
4223
+ ])) : F("", !0),
4224
+ e.downloads ? (H(), P(f, {
4225
+ key: 1,
4226
+ icon: (r = e.componentOptions) != null && r.showTabIcons ? "download" : void 0,
4227
+ title: e.t("DownloadsTabTitle"),
4228
+ loading: e.downloadsLoading,
4229
+ count: e.downloadsCount,
4230
+ extclass: "ext-tab-downloads"
4231
+ }, {
4232
+ default: Y(() => [G(e.$slots, "detail-downloads", {}, () => [z(m, { class: "p-2" }, {
4233
+ default: Y(() => [R(J(e.t("DownloadsNotAvailable")), 1)]),
4234
+ _: 1
4235
+ })])]),
4236
+ _: 3
4237
+ }, 8, [
4238
+ "icon",
4239
+ "title",
4240
+ "loading",
4241
+ "count"
4242
+ ])) : F("", !0),
4243
+ e.relatedLinks ? (H(), P(f, {
4244
+ key: 2,
4245
+ title: e.t("LinksTabTitle"),
4246
+ icon: (i = e.componentOptions) != null && i.showTabIcons ? "link" : void 0,
4247
+ extclass: "ext-tab-related-links",
4248
+ count: e.relatedLinkCount
4249
+ }, {
4250
+ default: Y(() => [z(h, { "instance-id": e.instanceId }, null, 8, ["instance-id"])]),
4251
+ _: 1
4252
+ }, 8, [
4253
+ "title",
4254
+ "icon",
4255
+ "count"
4256
+ ])) : F("", !0)
4257
+ ];
4258
+ }),
4259
+ _: 3
4260
+ }, 8, ["modelValue", "desktop"]), ((o = e.componentOptions) == null ? void 0 : o.hideBottomNavigation) === !0 ? F("", !0) : (H(), I("div", {
4261
+ key: 0,
4262
+ class: V(["d-flex d-grid gap-3 justify-content-end align-items-center mt-4 pb-2", { "position-sticky bottom-0 bg-body": ((s = e.componentOptions) == null ? void 0 : s.bottomNavigationSticky) === !0 }]),
4263
+ style: { "z-index": "5" }
4264
+ }, [e.widerThan("sm") ? (H(), P(_, {
4265
+ key: 0,
4266
+ instance: e.instance,
4267
+ t: e.t
4268
+ }, null, 8, ["instance", "t"])) : F("", !0), z(y, {
4269
+ class: "ext-scroll-top",
4270
+ variant: "secondary",
4271
+ onClick: Z(e.scrollTop, ["prevent"])
4272
+ }, {
4273
+ default: Y(() => [z(v, {
4274
+ name: "arrow-up",
4275
+ size: 16,
4276
+ class: "me-2"
4277
+ }), R(" " + J(e.t("BackToTop")), 1)]),
4278
+ _: 1
4279
+ }, 8, ["onClick"])], 2))], 64)) : F("", !0)], 2);
4280
+ }
4281
+ var Yo = /*#__PURE__*/ A(qo, [["render", Jo]]), Xo = B({
4282
+ name: "pis-products-details-gallery",
4283
+ components: {
4284
+ ImageGallery: tt,
4285
+ MountPoint: de
4286
+ },
4287
+ props: {
4288
+ instanceId: {
4289
+ type: String,
4290
+ default: void 0
4291
+ },
4292
+ showPreview: {
4293
+ type: Boolean,
4294
+ default: !0
4295
+ }
4296
+ },
4297
+ setup(e) {
4298
+ let t = U(), { instance: n, componentName: r, isReady: i, isWebComponent: a, store: o, t: s, emit: c } = $(t, e.instanceId, [Q.Breadcrumbs, Q.ProductDetails]), l = N(() => {
4299
+ var e;
4300
+ return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.gallery) ?? {};
4301
+ }), u = N(() => {
4302
+ var e;
4303
+ return ((e = o.value) == null ? void 0 : e.data.productDetail) || void 0;
4304
+ });
4305
+ return {
4306
+ root: t,
4307
+ componentName: r,
4308
+ componentOptions: l,
4309
+ isReady: i,
4310
+ isWebComponent: a,
4311
+ store: o,
4312
+ visible: N(() => {
4313
+ var e;
4314
+ return l.value.visible && ((e = u.value) == null ? void 0 : e.item);
4315
+ }),
4316
+ instance: n,
4317
+ productDetail: u,
4318
+ t: s,
4319
+ emit: c,
4320
+ reactiveContext: Oe
4321
+ };
4322
+ }
4323
+ }), Zo = { key: 0 }, Qo = { key: 0 };
4324
+ function $o(e, t, n, r, i, a) {
4325
+ var o;
4326
+ let s = K("MountPoint"), c = K("ImageGallery");
4327
+ return H(), I("div", {
4328
+ ref: "root",
4329
+ class: V(["pis-component", e.componentName])
4330
+ }, [e.isReady && e.visible ? (H(), I("div", Zo, [z(c, {
4331
+ "show-preview": e.showPreview,
4332
+ images: (o = e.productDetail) == null || (o = o.item) == null ? void 0 : o.images,
4333
+ "hide-thumbnails": e.componentOptions.hideThumbnailImages,
4334
+ "show-overlay-arrows": e.componentOptions.showOverlayArrows,
4335
+ title: e.t("ProductGallery")
4336
+ }, {
4337
+ default: Y(() => {
4338
+ var t;
4339
+ return [e.componentOptions.imageOverlayTemplate ? (H(), I("div", Qo, [z(s, {
4340
+ callbacks: e.componentOptions.imageOverlayTemplate,
4341
+ ctx: e.reactiveContext({
4342
+ instance: e.instance,
4343
+ item: (t = e.productDetail) == null ? void 0 : t.item,
4344
+ emit: e.emit,
4345
+ t: e.t
4346
+ })
4347
+ }, null, 8, ["callbacks", "ctx"])])) : F("", !0)];
4348
+ }),
4349
+ _: 1
4350
+ }, 8, [
4351
+ "show-preview",
4352
+ "images",
4353
+ "hide-thumbnails",
4354
+ "show-overlay-arrows",
4355
+ "title"
4356
+ ])])) : F("", !0)], 2);
4357
+ }
4358
+ var es = /*#__PURE__*/ A(Xo, [["render", $o]]), ts = B({
4359
+ name: "pis-products-details-header",
4360
+ components: {
4361
+ Icon: E,
4362
+ Btn: ye,
4363
+ NavigationBtns: dn
4364
+ },
4365
+ props: { instanceId: {
4366
+ type: String,
4367
+ default: void 0
4368
+ } },
4369
+ setup(e) {
4370
+ let t = U(), { componentName: n, isReady: r, isWebComponent: i, instance: a, store: o, t: s, widerThan: c } = $(t, e.instanceId, [Q.Breadcrumbs, Q.ProductDetails]), l = N(() => {
4371
+ var e;
4372
+ return (e = o.value) == null || (e = e.data.productDetail) == null ? void 0 : e.item;
4373
+ });
4374
+ return {
4375
+ root: t,
4376
+ title: N(() => l.value ? v(l.value, "#DisplayName") : ""),
4377
+ store: o,
4378
+ isReady: r,
4379
+ instance: a,
4380
+ componentName: n,
4381
+ isWebComponent: i,
4382
+ componentOptions: N(() => {
4383
+ var e;
4384
+ return ((e = o.value) == null || (e = e.options.components) == null || (e = e.details) == null ? void 0 : e.header) ?? {};
4385
+ }),
4386
+ t: s,
4387
+ widerThan: c,
4388
+ printToPdf: async () => {
4389
+ if (l.value) try {
4390
+ var e;
4391
+ await ((e = a.value) == null ? void 0 : e.execute(new Ke({ productId: l.value.productId }).from(n)));
4392
+ } catch {}
4393
+ },
4394
+ showPrintView: async () => {
4395
+ if (l.value) try {
4396
+ var e;
4397
+ await ((e = a.value) == null ? void 0 : e.execute(new ft({ productId: l.value.productId }).from(n)));
4398
+ } catch {}
4399
+ }
4400
+ };
4401
+ }
4402
+ }), ns = { key: 0 }, rs = { class: "h2 with-cursor" }, is = { class: "d-flex flex-column" }, as = { class: "d-grid gap-3 d-md-flex justify-content-md-between align-items-center" }, os = { class: "d-flex gap-3" }, ss = { class: "overflow-hidden text-nowrap" }, cs = { class: "overflow-hidden text-nowrap" };
4403
+ function ls(e, t, n, r, i, a) {
4404
+ let o = K("NavigationBtns"), s = K("Icon"), c = K("Btn");
4405
+ return H(), I("div", {
4406
+ ref: "root",
4407
+ class: V(["pis-component", e.componentName])
4408
+ }, [e.isReady && e.componentOptions.visible ? (H(), I(M, { key: 0 }, [e.title ? (H(), I("div", ns, [L("h2", rs, J(e.title), 1)])) : F("", !0), L("div", is, [L("div", as, [e.componentOptions.showBackBtn ? (H(), P(o, {
4409
+ key: 0,
4410
+ instance: e.instance,
4411
+ t: e.t
4412
+ }, null, 8, ["instance", "t"])) : F("", !0), L("div", os, [e.componentOptions.showPrintViewBtn ? (H(), P(c, {
4413
+ key: 0,
4414
+ variant: "secondary",
4415
+ class: "d-flex align-items-center ext-print-view",
4416
+ onClick: e.showPrintView
4417
+ }, {
4418
+ default: Y(() => [z(s, {
4419
+ name: "printer",
4420
+ class: "me-1",
4421
+ size: 24
4422
+ }), L("span", ss, J(e.t("ShowPrintView")), 1)]),
4423
+ _: 1
4424
+ }, 8, ["onClick"])) : F("", !0), e.componentOptions.showPrintToPdfBtn ? (H(), P(c, {
4425
+ key: 1,
4426
+ variant: "secondary",
4427
+ class: "d-flex align-items-center ext-print-pdf",
4428
+ onClick: t[0] || (t[0] = (t) => e.printToPdf())
4429
+ }, {
4430
+ default: Y(() => [z(s, {
4431
+ name: "printer",
4432
+ class: "me-1",
4433
+ size: 24
4434
+ }), L("span", cs, J(e.t("PrintToPdf")), 1)]),
4435
+ _: 1
4436
+ })) : F("", !0)])])])], 64)) : F("", !0)], 2);
4437
+ }
4438
+ var us = /*#__PURE__*/ A(ts, [["render", ls]]);
4439
+ //#endregion
4440
+ export { $ as _, Do as a, qt as b, Ii as c, pi as d, oi as f, dn as g, vn as h, Mo as i, Ai as l, xn as m, es as n, Ra as o, Xr as p, Yo as r, sa as s, us as t, bi as u, tn as v, Q as y };
4441
+
4442
+ //# sourceMappingURL=ProductsDetailsHeader-DfVlpJh_.js.map