@crystaldesign/quick-config 26.3.0-beta.2 → 26.3.0-beta.21

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 (80) hide show
  1. package/build/cjs/index.js +2016 -0
  2. package/build/esm/index.js +1999 -0
  3. package/build/types/quick-config/src/Components/ConditionEvaluator/index.d.ts +47 -0
  4. package/build/types/quick-config/src/Components/ConditionEvaluator/index.d.ts.map +1 -0
  5. package/build/types/quick-config/src/Components/QuickConfig/components/FeatureRenderer/index.d.ts +10 -0
  6. package/build/types/quick-config/src/Components/QuickConfig/components/FeatureRenderer/index.d.ts.map +1 -0
  7. package/build/types/quick-config/src/Components/QuickConfig/components/Header/index.d.ts +12 -0
  8. package/build/types/quick-config/src/Components/QuickConfig/components/Header/index.d.ts.map +1 -0
  9. package/build/types/quick-config/src/Components/QuickConfig/components/Navigation/index.d.ts +18 -0
  10. package/build/types/quick-config/src/Components/QuickConfig/components/Navigation/index.d.ts.map +1 -0
  11. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/ButtonGroupLayout.d.ts +18 -0
  12. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/ButtonGroupLayout.d.ts.map +1 -0
  13. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/DropdownLayout.d.ts +16 -0
  14. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/DropdownLayout.d.ts.map +1 -0
  15. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/RangeLayout.d.ts +11 -0
  16. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/RangeLayout.d.ts.map +1 -0
  17. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/SelectionListLayout.d.ts +18 -0
  18. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/Layouts/SelectionListLayout.d.ts.map +1 -0
  19. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/index.d.ts +10 -0
  20. package/build/types/quick-config/src/Components/QuickConfig/components/OptionRenderer/index.d.ts.map +1 -0
  21. package/build/types/quick-config/src/Components/QuickConfig/components/ProgressBar/index.d.ts +7 -0
  22. package/build/types/quick-config/src/Components/QuickConfig/components/ProgressBar/index.d.ts.map +1 -0
  23. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/ContentItem.d.ts +8 -0
  24. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/ContentItem.d.ts.map +1 -0
  25. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/ResultItemsRenderer.d.ts +12 -0
  26. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/ResultItemsRenderer.d.ts.map +1 -0
  27. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/SpeedometerGroup/Speedometer.d.ts +17 -0
  28. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/SpeedometerGroup/Speedometer.d.ts.map +1 -0
  29. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/SpeedometerGroup/index.d.ts +10 -0
  30. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/SpeedometerGroup/index.d.ts.map +1 -0
  31. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/TextResult.d.ts +10 -0
  32. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/components/TextResult.d.ts.map +1 -0
  33. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/index.d.ts +13 -0
  34. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/index.d.ts.map +1 -0
  35. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/utils/index.d.ts +3 -0
  36. package/build/types/quick-config/src/Components/QuickConfig/components/ResultDisplay/utils/index.d.ts.map +1 -0
  37. package/build/types/quick-config/src/Components/QuickConfig/hooks/useOptionRenderer.d.ts +19 -0
  38. package/build/types/quick-config/src/Components/QuickConfig/hooks/useOptionRenderer.d.ts.map +1 -0
  39. package/build/types/quick-config/src/Components/QuickConfig/hooks/useQuickConfig.d.ts +30 -0
  40. package/build/types/quick-config/src/Components/QuickConfig/hooks/useQuickConfig.d.ts.map +1 -0
  41. package/build/types/quick-config/src/Components/QuickConfig/hooks/useQuickConfigCalculations.d.ts +7 -0
  42. package/build/types/quick-config/src/Components/QuickConfig/hooks/useQuickConfigCalculations.d.ts.map +1 -0
  43. package/build/types/quick-config/src/Components/QuickConfig/hooks/useQuickConfigFeatures.d.ts +6 -0
  44. package/build/types/quick-config/src/Components/QuickConfig/hooks/useQuickConfigFeatures.d.ts.map +1 -0
  45. package/build/types/quick-config/src/Components/QuickConfig/index.d.ts +10 -0
  46. package/build/types/quick-config/src/Components/QuickConfig/index.d.ts.map +1 -0
  47. package/build/types/quick-config/src/calculators/variantValueCalculator.d.ts +8 -0
  48. package/build/types/quick-config/src/calculators/variantValueCalculator.d.ts.map +1 -0
  49. package/build/types/quick-config/src/index.d.ts +8 -0
  50. package/build/types/quick-config/src/index.d.ts.map +1 -0
  51. package/build/types/quick-config/src/stories/QuickConfig.stories.d.ts +17 -0
  52. package/build/types/quick-config/src/stories/QuickConfig.stories.d.ts.map +1 -0
  53. package/build/types/quick-config/src/types.d.ts +210 -0
  54. package/build/types/quick-config/src/types.d.ts.map +1 -0
  55. package/build/types/quick-config/src/utils/index.d.ts +14 -0
  56. package/build/types/quick-config/src/utils/index.d.ts.map +1 -0
  57. package/build/umd/124.quick-config.umd.min.js +2 -0
  58. package/build/umd/124.quick-config.umd.min.js.LICENSE.txt +1 -0
  59. package/build/umd/145.quick-config.umd.min.js +2 -0
  60. package/build/umd/145.quick-config.umd.min.js.LICENSE.txt +1 -0
  61. package/build/umd/338.quick-config.umd.min.js +2 -0
  62. package/build/umd/338.quick-config.umd.min.js.LICENSE.txt +1 -0
  63. package/build/umd/433.quick-config.umd.min.js +2 -0
  64. package/build/umd/433.quick-config.umd.min.js.LICENSE.txt +1 -0
  65. package/build/umd/610.quick-config.umd.min.js +2 -0
  66. package/build/umd/610.quick-config.umd.min.js.LICENSE.txt +1 -0
  67. package/build/umd/662.quick-config.umd.min.js +2 -0
  68. package/build/umd/662.quick-config.umd.min.js.LICENSE.txt +1 -0
  69. package/build/umd/721.quick-config.umd.min.js +408 -0
  70. package/build/umd/721.quick-config.umd.min.js.LICENSE.txt +92 -0
  71. package/build/umd/74.quick-config.umd.min.js +2 -0
  72. package/build/umd/74.quick-config.umd.min.js.LICENSE.txt +1 -0
  73. package/build/umd/871.quick-config.umd.min.js +2 -0
  74. package/build/umd/871.quick-config.umd.min.js.LICENSE.txt +1 -0
  75. package/build/umd/944.quick-config.umd.min.js +2 -0
  76. package/build/umd/944.quick-config.umd.min.js.LICENSE.txt +10 -0
  77. package/build/umd/quick-config.umd.min.js +102 -0
  78. package/build/umd/quick-config.umd.min.js.LICENSE.txt +135 -0
  79. package/build/umd/report.html +38 -0
  80. package/package.json +3 -3
@@ -0,0 +1,1999 @@
1
+ import { useMemo, useCallback, useState, useEffect, useRef } from 'react';
2
+ import { useTranslation } from '@crystaldesign/diva-core';
3
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
4
+ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
5
+ import _createClass from '@babel/runtime/helpers/createClass';
6
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
7
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
8
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
+ import _typeof from '@babel/runtime/helpers/typeof';
10
+ import classNames from 'classnames';
11
+
12
+ (function() {
13
+ const env = {"STAGE":"production"};
14
+ try {
15
+ if (process) {
16
+ process.env = Object.assign({}, process.env);
17
+ Object.assign(process.env, env);
18
+ return;
19
+ }
20
+ } catch (e) {} // avoid ReferenceError: process is not defined
21
+ globalThis.process = { env:env };
22
+ })();
23
+
24
+ /**
25
+ * Utility functions for QuickConfig
26
+ */
27
+
28
+ /**
29
+ * Get translated text with fallback
30
+ */
31
+ function getTranslatedText(translations, language, fallbackCodex) {
32
+ return translations[language] || translations.en || translations.de || fallbackCodex || '';
33
+ }
34
+
35
+ /**
36
+ * Validate QuickConfig definition
37
+ */
38
+ function validateQuickConfig(config) {
39
+ var _config$features;
40
+ var errors = [];
41
+ if (!config.codex) {
42
+ errors.push('QuickConfig must have a codex');
43
+ }
44
+ if (!config.name || Object.keys(config.name).length === 0) {
45
+ errors.push('QuickConfig must have at least one language for name');
46
+ }
47
+ if (!config.features || config.features.length === 0) {
48
+ errors.push('QuickConfig must have at least one feature');
49
+ }
50
+
51
+ // Validate features
52
+ (_config$features = config.features) === null || _config$features === void 0 || _config$features.forEach(function (feature, index) {
53
+ var _feature$options;
54
+ if (!feature.codex) {
55
+ errors.push("Feature at index ".concat(index, " must have a codex"));
56
+ }
57
+ if (!feature.label || Object.keys(feature.label).length === 0) {
58
+ errors.push("Feature ".concat(feature.codex || index, " must have at least one language for label"));
59
+ }
60
+ if (!feature.layout) {
61
+ errors.push("Feature ".concat(feature.codex || index, " must have a layout"));
62
+ }
63
+ if (!feature.options || feature.options.length === 0) {
64
+ errors.push("Feature ".concat(feature.codex || index, " must have at least one option"));
65
+ }
66
+
67
+ // Validate options
68
+ (_feature$options = feature.options) === null || _feature$options === void 0 || _feature$options.forEach(function (option, optIndex) {
69
+ if (!option.codex) {
70
+ errors.push("Option at index ".concat(optIndex, " in feature ").concat(feature.codex || index, " must have a codex"));
71
+ }
72
+ if (!option.type) {
73
+ errors.push("Option ".concat(option.codex || optIndex, " must have a type"));
74
+ }
75
+ if (option.type === 'range' && !option.range) {
76
+ errors.push("Range option ".concat(option.codex || optIndex, " must have range configuration"));
77
+ }
78
+ });
79
+ });
80
+ return errors;
81
+ }
82
+
83
+ /**
84
+ * Evaluates a condition against the current user selections
85
+ */
86
+ var ConditionEvaluator = /*#__PURE__*/function () {
87
+ function ConditionEvaluator(selections) {
88
+ _classCallCheck(this, ConditionEvaluator);
89
+ _defineProperty(this, "selections", void 0);
90
+ this.selections = new Map(selections.map(function (s) {
91
+ return [s.featureCodex, s.selectedOptions];
92
+ }));
93
+ }
94
+
95
+ /**
96
+ * Main evaluation method
97
+ */
98
+ return _createClass(ConditionEvaluator, [{
99
+ key: "evaluate",
100
+ value: function evaluate(condition) {
101
+ if (this.isAndCondition(condition)) {
102
+ return this.evaluateAnd(condition);
103
+ }
104
+ if (this.isOrCondition(condition)) {
105
+ return this.evaluateOr(condition);
106
+ }
107
+ if (this.isNotCondition(condition)) {
108
+ return this.evaluateNot(condition);
109
+ }
110
+ return this.evaluateSingleCondition(condition);
111
+ }
112
+
113
+ /**
114
+ * Type guards
115
+ */
116
+ }, {
117
+ key: "isAndCondition",
118
+ value: function isAndCondition(condition) {
119
+ return 'and' in condition;
120
+ }
121
+ }, {
122
+ key: "isOrCondition",
123
+ value: function isOrCondition(condition) {
124
+ return 'or' in condition;
125
+ }
126
+ }, {
127
+ key: "isNotCondition",
128
+ value: function isNotCondition(condition) {
129
+ return 'not' in condition;
130
+ }
131
+
132
+ /**
133
+ * Evaluate logical operators
134
+ */
135
+ }, {
136
+ key: "evaluateAnd",
137
+ value: function evaluateAnd(condition) {
138
+ var _this = this;
139
+ return condition.and.every(function (c) {
140
+ return _this.evaluateSingleCondition(c);
141
+ });
142
+ }
143
+ }, {
144
+ key: "evaluateOr",
145
+ value: function evaluateOr(condition) {
146
+ var _this2 = this;
147
+ return condition.or.some(function (c) {
148
+ return _this2.evaluateSingleCondition(c);
149
+ });
150
+ }
151
+ }, {
152
+ key: "evaluateNot",
153
+ value: function evaluateNot(condition) {
154
+ return !this.evaluate(condition.not);
155
+ }
156
+
157
+ /**
158
+ * Evaluate a single condition
159
+ */
160
+ }, {
161
+ key: "evaluateSingleCondition",
162
+ value: function evaluateSingleCondition(condition) {
163
+ var selectedValues = this.selections.get(condition.featureCodex);
164
+
165
+ // If feature not selected yet, condition is false
166
+ if (!selectedValues || selectedValues.length === 0) {
167
+ return false;
168
+ }
169
+ switch (condition.operator) {
170
+ case 'eq':
171
+ return selectedValues.some(function (v) {
172
+ return v === condition.value;
173
+ });
174
+ case 'ne':
175
+ return !selectedValues.some(function (v) {
176
+ return v === condition.value;
177
+ });
178
+ case 'in':
179
+ return selectedValues.some(function (v) {
180
+ return condition.value.includes(v);
181
+ });
182
+ case 'nin':
183
+ return !selectedValues.some(function (v) {
184
+ return condition.value.includes(v);
185
+ });
186
+ default:
187
+ return false;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Utility method to check if a feature should be visible
193
+ */
194
+ }], [{
195
+ key: "shouldShowFeature",
196
+ value: function shouldShowFeature(feature, selections) {
197
+ if (!feature.condition) {
198
+ return true;
199
+ }
200
+ var evaluator = new ConditionEvaluator(selections);
201
+ return evaluator.evaluate(feature.condition);
202
+ }
203
+
204
+ /**
205
+ * Utility method to check if an option should be visible
206
+ */
207
+ }, {
208
+ key: "shouldShowOption",
209
+ value: function shouldShowOption(option, selections) {
210
+ if (!option.condition) {
211
+ return true;
212
+ }
213
+ var evaluator = new ConditionEvaluator(selections);
214
+ return evaluator.evaluate(option.condition);
215
+ }
216
+
217
+ /**
218
+ * Utility method to check if an instance should be visible
219
+ */
220
+ }, {
221
+ key: "shouldShowInstance",
222
+ value: function shouldShowInstance(instance, selections) {
223
+ if (!instance.condition) {
224
+ return true;
225
+ }
226
+ var evaluator = new ConditionEvaluator(selections);
227
+ return evaluator.evaluate(instance.condition);
228
+ }
229
+ }]);
230
+ }();
231
+
232
+ var useOptionRenderer = function useOptionRenderer(_ref) {
233
+ var feature = _ref.feature,
234
+ selectedOptions = _ref.selectedOptions,
235
+ onSelect = _ref.onSelect,
236
+ selections = _ref.selections;
237
+ var _useTranslation = useTranslation(),
238
+ i18n = _useTranslation.i18n;
239
+ var language = i18n.language;
240
+ // Filter visible options based on conditions
241
+ var visibleOptions = useMemo(function () {
242
+ return feature.options.filter(function (option) {
243
+ return ConditionEvaluator.shouldShowOption(option, selections);
244
+ });
245
+ }, [feature.options, selections]);
246
+ var selectOptions = useMemo(function () {
247
+ return visibleOptions.filter(function (o) {
248
+ return o.type === 'select';
249
+ });
250
+ }, [visibleOptions]);
251
+ var rangeOption = useMemo(function () {
252
+ return visibleOptions.find(function (o) {
253
+ return o.type === 'range';
254
+ });
255
+ }, [visibleOptions]);
256
+ var handleSingleSelect = useCallback(function (optionCodex) {
257
+ onSelect([optionCodex]);
258
+ }, [onSelect]);
259
+ var handleMultiSelect = useCallback(function (optionCodex) {
260
+ if (selectedOptions.includes(optionCodex)) {
261
+ onSelect(selectedOptions.filter(function (o) {
262
+ return o !== optionCodex;
263
+ }));
264
+ } else {
265
+ onSelect([].concat(_toConsumableArray(selectedOptions), [optionCodex]));
266
+ }
267
+ }, [selectedOptions, onSelect]);
268
+ var getOptionLabel = useCallback(function (option) {
269
+ return option.label[language] || option.label.en || option.label.de || option.codex;
270
+ }, [language]);
271
+ var getOptionDescription = useCallback(function (option) {
272
+ var _option$description, _option$description2, _option$description3;
273
+ return ((_option$description = option.description) === null || _option$description === void 0 ? void 0 : _option$description[language]) || ((_option$description2 = option.description) === null || _option$description2 === void 0 ? void 0 : _option$description2.en) || ((_option$description3 = option.description) === null || _option$description3 === void 0 ? void 0 : _option$description3.de);
274
+ }, [language]);
275
+ var getOptionCaption = useCallback(function (option) {
276
+ var _option$caption, _option$caption2, _option$caption3;
277
+ return ((_option$caption = option.caption) === null || _option$caption === void 0 ? void 0 : _option$caption[language]) || ((_option$caption2 = option.caption) === null || _option$caption2 === void 0 ? void 0 : _option$caption2.en) || ((_option$caption3 = option.caption) === null || _option$caption3 === void 0 ? void 0 : _option$caption3.de);
278
+ }, [language]);
279
+ return {
280
+ visibleOptions: visibleOptions,
281
+ selectOptions: selectOptions,
282
+ rangeOption: rangeOption,
283
+ handleSingleSelect: handleSingleSelect,
284
+ handleMultiSelect: handleMultiSelect,
285
+ getOptionLabel: getOptionLabel,
286
+ getOptionDescription: getOptionDescription,
287
+ getOptionCaption: getOptionCaption
288
+ };
289
+ };
290
+
291
+ function styleInject(css, ref) {
292
+ if ( ref === void 0 ) ref = {};
293
+ var insertAt = ref.insertAt;
294
+
295
+ if (!css || typeof document === 'undefined') { return; }
296
+
297
+ var head = document.head || document.getElementsByTagName('head')[0];
298
+ var style = document.createElement('style');
299
+ style.type = 'text/css';
300
+
301
+ if (insertAt === 'top') {
302
+ if (head.firstChild) {
303
+ head.insertBefore(style, head.firstChild);
304
+ } else {
305
+ head.appendChild(style);
306
+ }
307
+ } else {
308
+ head.appendChild(style);
309
+ }
310
+
311
+ if (style.styleSheet) {
312
+ style.styleSheet.cssText = css;
313
+ } else {
314
+ style.appendChild(document.createTextNode(css));
315
+ }
316
+ }
317
+
318
+ var container = "container-nN2kI";
319
+ var subContainer = "subContainer-x97eX";
320
+ var stickyHeader = "stickyHeader-V5orv";
321
+ var stickyHeaderSticky = "stickyHeaderSticky-5qqWo";
322
+ var featureContainer = "featureContainer-cTJH8";
323
+ var featureLabel = "featureLabel-q4sHn";
324
+ var featureRequired = "featureRequired-tby4F";
325
+ var featureDescription = "featureDescription-k4v-p";
326
+ var optionDescription = "optionDescription-omLcU";
327
+ var progressText = "progressText-LXaM7";
328
+ var optionsBox = "optionsBox-TBnRq";
329
+ var optionsGallery = "optionsGallery-72aVW";
330
+ var optionButton = "optionButton-tRXEs";
331
+ var radioOption = "radioOption-sv3m6";
332
+ var checkboxOption = "checkboxOption-UY3nL";
333
+ var optionButtonSelected = "optionButtonSelected-pjY9O";
334
+ var radioOptionSelected = "radioOptionSelected-vm6bN";
335
+ var checkboxOptionSelected = "checkboxOptionSelected-DuZGL";
336
+ var optionLabel = "optionLabel-oz4Zj";
337
+ var optionCaption = "optionCaption-3d-V1";
338
+ var optionContent = "optionContent-DS9Wc";
339
+ var progressBar = "progressBar-RKPZp";
340
+ var progressBarFill = "progressBarFill--Shc9";
341
+ var progressBarInner = "progressBarInner-agBx-";
342
+ var slider = "slider-ev57L";
343
+ var sliderInput = "sliderInput-xAXVM";
344
+ var sliderValue = "sliderValue-vwwNn";
345
+ var dropdown = "dropdown-fst7q";
346
+ var radio = "radio-GesCu";
347
+ var checkbox = "checkbox-xI7lT";
348
+ var toggle = "toggle-fi2uF";
349
+ var toggleButton = "toggleButton-4myWl";
350
+ var toggleButtonSelected = "toggleButtonSelected-4SMtn";
351
+ var resultContainer = "resultContainer-sc6De";
352
+ var resultItem = "resultItem-84scA";
353
+ var resultKey = "resultKey-qD5DS";
354
+ var resultValue = "resultValue-42tes";
355
+ var buttonContainer = "buttonContainer-UZKoO";
356
+ var navLeftGroup = "navLeftGroup-JOQ3N";
357
+ var navRightGroup = "navRightGroup-mWCAz";
358
+ var navButtonPadding = "navButtonPadding-aX9-f";
359
+ var button = "button-CT3BR";
360
+ var buttonPrimary = "buttonPrimary-b3Tur";
361
+ var buttonPrimaryApplied = "buttonPrimaryApplied-90Q5-";
362
+ var headerContainer = "headerContainer-fhFhh";
363
+ var tabWrapper = "tabWrapper-ZqpAa";
364
+ var tabSlider = "tabSlider-d133A";
365
+ var tab = "tab-Cf5O4";
366
+ var tabActive = "tabActive-B4W84";
367
+ var buttonSecondary = "buttonSecondary-Fs2ci";
368
+ var buttonWithArrow = "buttonWithArrow-PQQFS";
369
+ var closeButton = "closeButton-Regwf";
370
+ var resultsGrid = "resultsGrid-s3UTE";
371
+ var speedometer = "speedometer-kKRJQ";
372
+ var speedometerGroup = "speedometerGroup-SS-GT";
373
+ var speedometerGroupTitle = "speedometerGroupTitle-4s2YI";
374
+ var speedometerGroupGrid = "speedometerGroupGrid-SNMAM";
375
+ var speedometerGroupItem = "speedometerGroupItem-a4T-A";
376
+ var speedometerGroupItemTitle = "speedometerGroupItemTitle-N35gZ";
377
+ var contentSection = "contentSection-dJgsX";
378
+ var css_248z = ".container-nN2kI {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n height: 100%;\n\n max-height: calc(100vh - 40px);\n padding: 12px;\n box-sizing: border-box;\n overflow: auto;\n}\n\n@supports (height: 100dvh) {\n .container-nN2kI {\n max-height: calc(100dvh - 40px);\n }\n}\n\n.subContainer-x97eX {\n flex: 1;\n padding: 20px 0;\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n\n.mobile .subContainer-x97eX {\n padding: 12px 0;\n gap: 4px;\n}\n\n.stickyHeader-V5orv {\n position: sticky;\n top: -12px;\n z-index: 10;\n background: #fff;\n margin: -12px -12px 0 -12px;\n padding: 12px 12px 0 12px;\n}\n\n.stickyHeaderSticky-5qqWo {\n position: fixed;\n top: 13px;\n z-index: 1000;\n width: calc(100% - 24px);\n margin: -12px -12px 0 -12px;\n padding: 12px 12px 0 12px;\n}\n\n.darkmode .stickyHeader-V5orv {\n background: #1a1a1a;\n}\n\n.featureContainer-cTJH8 {\n min-width: 0;\n max-width: 100%;\n}\n\n.featureLabel-q4sHn {\n font-size: 18px;\n font-weight: 600;\n margin-bottom: 10px;\n word-wrap: break-word;\n}\n\n.featureRequired-tby4F {\n color: red;\n}\n\n.featureDescription-k4v-p,\n.optionDescription-omLcU,\n.progressText-LXaM7 {\n color: #666;\n}\n\n.darkmode .featureDescription-k4v-p,\n.darkmode .optionDescription-omLcU,\n.darkmode .progressText-LXaM7 {\n color: #aaa;\n}\n\n.featureDescription-k4v-p {\n font-size: 14px;\n margin-bottom: 15px;\n word-wrap: break-word;\n}\n\n.optionsContainer-oIEc3 {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.optionsBox-TBnRq {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));\n grid-gap: 10px;\n gap: 10px;\n min-width: 0;\n max-width: 100%;\n}\n\n.optionsGallery-72aVW {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n grid-gap: 15px;\n gap: 15px;\n min-width: 0;\n max-width: 100%;\n}\n\n/* Shared selectable option base (optionButton, radioOption, checkboxOption) */\n.optionButton-tRXEs,\n.radioOption-sv3m6,\n.checkboxOption-UY3nL {\n padding: 12px;\n border: 2px solid #ddd;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n transition: all 0.2s;\n min-width: 0;\n}\n\n.optionButton-tRXEs {\n padding: 15px;\n text-align: left;\n}\n\n.radioOption-sv3m6,\n.checkboxOption-UY3nL {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n.darkmode .optionButton-tRXEs,\n.darkmode .radioOption-sv3m6,\n.darkmode .checkboxOption-UY3nL {\n border-color: #444;\n background: #2a2a2a;\n}\n\n.optionButton-tRXEs:hover,\n.radioOption-sv3m6:hover,\n.checkboxOption-UY3nL:hover {\n border-color: #999;\n background: #f9f9f9;\n}\n\n.darkmode .optionButton-tRXEs:hover,\n.darkmode .radioOption-sv3m6:hover,\n.darkmode .checkboxOption-UY3nL:hover {\n border-color: #666;\n background: #333;\n}\n\n.optionButtonSelected-pjY9O,\n.radioOptionSelected-vm6bN,\n.checkboxOptionSelected-DuZGL {\n border-color: var(--diva-theme-palette-primary-main);\n background: var(--diva-theme-palette-primary-light);\n}\n\n.darkmode .optionButtonSelected-pjY9O,\n.darkmode .radioOptionSelected-vm6bN,\n.darkmode .checkboxOptionSelected-DuZGL {\n border-color: var(--diva-theme-palette-primary-main);\n background: var(--diva-theme-palette-primary-dark);\n}\n\n.optionButtonSelected-pjY9O:hover,\n.radioOptionSelected-vm6bN:hover,\n.checkboxOptionSelected-DuZGL:hover {\n border-color: var(--diva-theme-palette-primary-dark);\n background: var(--diva-theme-palette-primary-light);\n}\n\n.darkmode .optionButtonSelected-pjY9O:hover,\n.darkmode .radioOptionSelected-vm6bN:hover,\n.darkmode .checkboxOptionSelected-DuZGL:hover {\n border-color: var(--diva-theme-palette-primary-main);\n background: var(--diva-theme-palette-primary-dark);\n}\n\n.optionLabel-oz4Zj {\n font-weight: 500;\n display: flex;\n align-items: center;\n justify-self: start;\n gap: 5px;\n flex-direction: column;\n width: 100%;\n min-width: 0;\n word-wrap: break-word;\n}\n\n.optionCaption-3d-V1 {\n font-size: 0.75rem;\n opacity: 0.6;\n font-weight: normal;\n text-align: center;\n}\n\n.optionContent-DS9Wc {\n min-width: 0;\n flex: 1;\n}\n\n.optionDescription-omLcU {\n font-size: 12px;\n min-width: 0;\n word-wrap: break-word;\n}\n\n.progressBar-RKPZp {\n display: flex;\n align-items: center;\n gap: 10px;\n margin-bottom: 20px;\n padding-bottom: 15px;\n border-bottom: 1px solid #ddd;\n}\n\n.darkmode .progressBar-RKPZp {\n border-bottom-color: #444;\n}\n\n.progressBarFill--Shc9 {\n flex: 1;\n height: 6px;\n background: #e0e0e0;\n border-radius: 3px;\n overflow: hidden;\n}\n\n.darkmode .progressBarFill--Shc9 {\n background: #444;\n}\n\n.progressBarInner-agBx- {\n height: 100%;\n background: var(--diva-theme-palette-primary-main);\n transition: width 0.3s ease;\n}\n\n.progressText-LXaM7 {\n font-size: 14px;\n white-space: nowrap;\n}\n\n.backButton-qRYLD {\n padding: 8px 12px;\n border: 1px solid #ddd;\n background: #fff;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n}\n\n.darkmode .backButton-qRYLD {\n border-color: #444;\n background: #2a2a2a;\n color: white;\n}\n\n.backButton-qRYLD:hover {\n background: #f5f5f5;\n}\n\n.darkmode .backButton-qRYLD:hover {\n background: #333;\n}\n\n.slider-ev57L {\n width: 100%;\n margin: 20px 0;\n}\n\n.sliderInput-xAXVM {\n width: 100%;\n height: 6px;\n border-radius: 3px;\n background: #e0e0e0;\n outline: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.darkmode .sliderInput-xAXVM {\n background: #444;\n}\n\n.sliderInput-xAXVM::-webkit-slider-thumb,\n.sliderInput-xAXVM::-moz-range-thumb {\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: var(--diva-theme-palette-primary-main);\n cursor: pointer;\n border: none;\n}\n\n.sliderInput-xAXVM::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n}\n\n.sliderValue-vwwNn {\n text-align: center;\n font-size: 16px;\n font-weight: 600;\n margin-top: 10px;\n}\n\n.dropdown-fst7q {\n width: 100%;\n padding: 12px;\n border: 2px solid #ddd;\n border-radius: 8px;\n font-size: 16px;\n background: #fff;\n cursor: pointer;\n}\n\n.darkmode .dropdown-fst7q {\n border-color: #444;\n background: #2a2a2a;\n color: white;\n}\n\n.radio-GesCu {\n display: flex;\n flex-direction: column;\n gap: 10px;\n min-width: 0;\n max-width: 100%;\n}\n\n.checkbox-xI7lT {\n display: flex;\n flex-direction: column;\n gap: 10px;\n min-width: 0;\n max-width: 100%;\n}\n\n.toggle-fi2uF {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.toggleButton-4myWl {\n flex: 1;\n min-width: 120px;\n padding: 15px;\n border: 2px solid #ddd;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n transition: all 0.2s;\n text-align: center;\n font-weight: 500;\n}\n\n.darkmode .toggleButton-4myWl {\n border-color: #444;\n background: #2a2a2a;\n color: white;\n}\n\n.toggleButton-4myWl:hover {\n border-color: #999;\n background: #f9f9f9;\n}\n\n.darkmode .toggleButton-4myWl:hover {\n border-color: #666;\n background: #333;\n}\n\n.toggleButtonSelected-4SMtn {\n border-color: var(--diva-theme-palette-primary-main);\n background: var(--diva-theme-palette-primary-main);\n color: var(--diva-theme-palette-primary-contrast-text);\n}\n\n.toggleButtonSelected-4SMtn:hover {\n border-color: var(--diva-theme-palette-primary-dark);\n background: var(--diva-theme-palette-primary-dark);\n color: var(--diva-theme-palette-primary-contrast-text);\n}\n\n.resultContainer-sc6De {\n}\n\n.mobile .resultContainer-sc6De {\n padding: 4px;\n}\n\n.resultItem-84scA {\n display: flex;\n justify-content: space-between;\n padding: 15px;\n margin-bottom: 10px;\n background: #f5f5f5;\n border-radius: 8px;\n}\n\n.darkmode .resultItem-84scA {\n background: #2a2a2a;\n}\n\n.resultKey-qD5DS {\n font-weight: 600;\n}\n\n.resultValue-42tes {\n color: var(--diva-theme-palette-primary-main);\n font-weight: 500;\n}\n\n.buttonContainer-UZKoO {\n display: flex;\n gap: 10px;\n justify-content: flex-end;\n padding: 20px 0;\n border-top: 1px solid #ddd;\n}\n\n.navLeftGroup-JOQ3N {\n display: flex;\n gap: 10px;\n flex: 1;\n}\n\n.navRightGroup-mWCAz {\n display: flex;\n gap: 10px;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-end;\n flex-grow: 1;\n}\n\n.navButtonPadding-aX9-f {\n padding: 10px 20px;\n}\n\n.darkmode .buttonContainer-UZKoO {\n border-top-color: #444;\n}\n\n.button-CT3BR {\n padding: 10px 20px;\n border: 1px solid #ddd;\n border-radius: 4px;\n background: #fff;\n color: #000;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n transition: all 0.2s;\n}\n\n.darkmode .button-CT3BR {\n border-color: #444;\n background: #2a2a2a;\n color: white;\n}\n\n.button-CT3BR:hover:not(:disabled) {\n background: #f5f5f5;\n border-color: #999;\n}\n\n.darkmode .button-CT3BR:hover:not(:disabled) {\n background: #333;\n border-color: #666;\n}\n\n.button-CT3BR:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.buttonPrimary-b3Tur {\n background: var(--diva-theme-palette-primary-main);\n border-color: var(--diva-theme-palette-primary-main);\n color: var(--diva-theme-palette-primary-contrast-text);\n}\n\n.buttonPrimary-b3Tur:hover:not(:disabled) {\n background: var(--diva-theme-palette-primary-dark);\n border-color: var(--diva-theme-palette-primary-dark);\n}\n\n.buttonPrimaryApplied-90Q5- {\n background: var(--diva-theme-palette-primary-dark);\n border-color: var(--diva-theme-palette-primary-dark);\n}\n\n.buttonCancel-HA74N {\n background: transparent;\n border-color: #ddd;\n color: #666;\n}\n\n.darkmode .buttonCancel-HA74N {\n border-color: #444;\n color: #aaa;\n}\n\n.buttonCancel-HA74N:hover:not(:disabled) {\n background: #f5f5f5;\n border-color: #999;\n color: #333;\n}\n\n.darkmode .buttonCancel-HA74N:hover:not(:disabled) {\n background: #333;\n border-color: #666;\n color: white;\n}\n\n.headerContainer-fhFhh {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0;\n min-height: 40px;\n margin-bottom: 4px;\n position: relative;\n}\n\n.darkmode .headerContainer-fhFhh {\n border-bottom-color: #333;\n}\n\n/* Segmented control style tabs */\n.tabWrapper-ZqpAa {\n --tab-count: 2;\n display: flex;\n position: relative;\n flex-grow: 1;\n max-width: min(360px, 80%);\n min-width: 0;\n background: #f0f0f0;\n border-radius: 10px;\n padding: 3px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n}\n\n.darkmode .tabWrapper-ZqpAa {\n background: #333;\n}\n\n.tabSlider-d133A {\n position: absolute;\n top: 3px;\n left: 3px;\n width: calc((100% - 6px) / var(--tab-count));\n height: calc(100% - 6px);\n background: #fff;\n border-radius: 7px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n transition: transform 0.25s ease;\n pointer-events: none;\n}\n\n.darkmode .tabSlider-d133A {\n background: #404040;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);\n}\n\n.tab-Cf5O4 {\n flex: 1;\n min-width: 0;\n padding: 8px 16px;\n border: none;\n outline: none;\n background: transparent;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n color: #666;\n transition: color 0.25s ease;\n position: relative;\n z-index: 1;\n text-align: center;\n}\n\n.tab-Cf5O4:focus,\n.tab-Cf5O4.focus-visible-kxYL6,\n.tab-Cf5O4:hover,\n.tab-Cf5O4:active {\n outline: none;\n border: none;\n box-shadow: none;\n}\n\n.tab-Cf5O4:focus,\n.tab-Cf5O4:focus-visible,\n.tab-Cf5O4:hover,\n.tab-Cf5O4:active {\n outline: none;\n border: none;\n box-shadow: none;\n}\n\n.darkmode .tab-Cf5O4 {\n color: #999;\n}\n\n.tabActive-B4W84 {\n color: var(--diva-theme-palette-primary-main);\n}\n\n.tab-Cf5O4:hover:not(.tabActive-B4W84) {\n color: #333;\n}\n\n.darkmode .tab-Cf5O4:hover:not(.tabActive-B4W84) {\n color: #ccc;\n}\n\n.instanceNavContainer-0U7gZ {\n display: flex;\n flex-direction: column;\n gap: 12px;\n margin-top: 32px;\n padding: 0;\n background: transparent;\n border-radius: 0;\n border: none;\n}\n\n.darkmode .instanceNavContainer-0U7gZ {\n background: transparent;\n border-color: transparent;\n}\n\n.instanceNavButtons-HMFdy {\n display: flex;\n flex-direction: row;\n gap: 16px;\n flex-wrap: wrap;\n}\n\n.buttonSecondary-Fs2ci {\n background: #fff;\n border: 1px solid var(--diva-theme-palette-primary-main);\n color: var(--diva-theme-palette-primary-main);\n font-size: 14px;\n}\n\n.darkmode .buttonSecondary-Fs2ci {\n background: transparent;\n border-color: var(--diva-theme-palette-primary-main);\n color: var(--diva-theme-palette-primary-main);\n}\n\n.buttonSecondary-Fs2ci:hover:not(:disabled) {\n background: var(--diva-theme-palette-primary-light);\n color: var(--diva-theme-palette-primary-contrast-text);\n}\n\n.darkmode .buttonSecondary-Fs2ci:hover:not(:disabled) {\n background: color-mix(in srgb, var(--diva-theme-palette-primary-main) 10%, transparent);\n color: var(--diva-theme-palette-primary-contrast-text);\n}\n\n.buttonWithArrow-PQQFS {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 12px 24px;\n font-size: 16px;\n border-radius: 8px;\n height: auto;\n text-align: left;\n flex: 1;\n min-width: 250px;\n}\n\n.closeButton-Regwf {\n position: absolute;\n right: -8px;\n top: 50%;\n transform: translateY(-50%);\n background-color: rgba(255,255,255,0.8);\n border-radius: 50%;\n border: none;\n outline: none;\n cursor: pointer;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #949daf;\n transition: color 0.2s;\n}\n\n.closeButton-Regwf:focus,\n.closeButton-Regwf.focus-visible-kxYL6,\n.closeButton-Regwf:hover,\n.closeButton-Regwf:active {\n outline: none;\n border: none;\n box-shadow: none;\n}\n\n.closeButton-Regwf:focus,\n.closeButton-Regwf:focus-visible,\n.closeButton-Regwf:hover,\n.closeButton-Regwf:active {\n outline: none;\n border: none;\n box-shadow: none;\n}\n\n.closeButton-Regwf:hover {\n color: #333;\n}\n\n.darkmode .closeButton-Regwf:hover {\n color: #fff;\n}\n\n/* Mobile Smaller Version */\n.mobile .container-nN2kI {\n padding: 12px;\n}\n\n.mobile .subContainer-x97eX {\n padding: 12px 0;\n}\n\n.mobile .featureLabel-q4sHn {\n font-size: 16px;\n margin-bottom: 8px;\n}\n\n.mobile .featureDescription-k4v-p {\n font-size: 13px;\n margin-bottom: 10px;\n}\n\n.mobile .optionButton-tRXEs {\n padding: 10px;\n}\n\n.mobile .optionLabel-oz4Zj {\n gap: 3px;\n}\n\n.mobile .optionDescription-omLcU {\n font-size: 11px;\n}\n\n.mobile .progressBar-RKPZp {\n gap: 8px;\n margin-bottom: 15px;\n padding-bottom: 10px;\n}\n\n.mobile .progressText-LXaM7 {\n font-size: 12px;\n}\n\n.mobile .backButton-qRYLD {\n padding: 6px 10px;\n font-size: 13px;\n}\n\n.mobile .sliderValue-vwwNn {\n font-size: 14px;\n}\n\n.mobile .dropdown-fst7q {\n padding: 10px;\n font-size: 14px;\n}\n\n.mobile .radioOption-sv3m6,\n.mobile .checkboxOption-UY3nL {\n padding: 10px;\n}\n\n.mobile .toggleButton-4myWl {\n padding: 10px;\n min-width: 90px;\n}\n\n.mobile .resultContainer-sc6De {\n padding: 0px;\n}\n\n.mobile .resultTitle-WVM2- {\n font-size: 20px;\n margin-bottom: 15px;\n}\n\n.mobile .resultItem-84scA {\n padding: 10px;\n}\n\n.mobile .buttonContainer-UZKoO {\n padding: 8px 0;\n margin-top: 6px;\n}\n\n.mobile .button-CT3BR {\n padding: 8px 16px;\n font-size: 13px;\n}\n\n.mobile .headerContainer-fhFhh {\n margin-bottom: 15px;\n}\n\n.mobile .tab-Cf5O4 {\n padding: 6px 12px;\n font-size: 14px;\n}\n\n.mobile .instanceNavContainer-0U7gZ {\n padding: 10px;\n}\n\n.resultsGrid-s3UTE {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: 30px;\n}\n\n.speedometer-kKRJQ {\n width: 100%;\n max-width: 250px;\n margin: 0 auto;\n aspect-ratio: 240 / 170;\n}\n\n.speedometerGroup-SS-GT {\n width: 100%;\n}\n\n.speedometerGroupTitle-4s2YI {\n text-align: center;\n margin-bottom: 4px;\n margin-top: 4px;\n}\n\n.speedometerGroupGrid-SNMAM {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n gap: 16px;\n}\n\n.speedometerGroupItem-a4T-A {\n text-align: center;\n flex: 1 1 40%;\n max-width: 45%;\n}\n\n.speedometerGroupItemTitle-N35gZ {\n margin-bottom: 4px;\n margin-top: 4px;\n}\n\n.speedometerValue-pbLcR {\n color: var(--diva-theme-palette-primary-main);\n stroke: var(--diva-theme-palette-primary-main);\n}\n\n.contentSection-dJgsX {\n padding-top: 8px;\n border-top: 1px solid #eee;\n}\n\n.darkmode .contentSection-dJgsX {\n border-top-color: #333;\n}\n";
379
+ styleInject(css_248z);
380
+
381
+ var RangeLayout = function RangeLayout(_ref) {
382
+ var _range$unit, _range$unit2, _range$unit3;
383
+ var option = _ref.option,
384
+ selectedOptions = _ref.selectedOptions,
385
+ onSelect = _ref.onSelect,
386
+ getOptionCaption = _ref.getOptionCaption;
387
+ var _useTranslation = useTranslation(),
388
+ i18n = _useTranslation.i18n;
389
+ var language = i18n.language;
390
+ var range = option.range;
391
+ if (!range) return null;
392
+ var _useState = useState(selectedOptions[0] ? Number(selectedOptions[0]) : range.defaultValue || range.min),
393
+ _useState2 = _slicedToArray(_useState, 2),
394
+ value = _useState2[0],
395
+ setValue = _useState2[1];
396
+ var caption = getOptionCaption(option);
397
+ var handleChange = function handleChange(e) {
398
+ var newValue = Number(e.target.value);
399
+ setValue(newValue);
400
+ onSelect([String(newValue)]);
401
+ };
402
+ var unit = ((_range$unit = range.unit) === null || _range$unit === void 0 ? void 0 : _range$unit[language]) || ((_range$unit2 = range.unit) === null || _range$unit2 === void 0 ? void 0 : _range$unit2.en) || ((_range$unit3 = range.unit) === null || _range$unit3 === void 0 ? void 0 : _range$unit3.de) || '';
403
+ return /*#__PURE__*/jsxs("div", {
404
+ className: slider,
405
+ children: [/*#__PURE__*/jsx("input", {
406
+ type: "range",
407
+ min: range.min,
408
+ max: range.max,
409
+ step: range.step,
410
+ value: value,
411
+ onChange: handleChange,
412
+ className: sliderInput + ' diva-stop-swipe-detection'
413
+ }), /*#__PURE__*/jsxs("div", {
414
+ className: sliderValue,
415
+ children: [value, " ", unit, caption && /*#__PURE__*/jsx("span", {
416
+ className: optionCaption,
417
+ dangerouslySetInnerHTML: {
418
+ __html: " ".concat(caption)
419
+ }
420
+ })]
421
+ })]
422
+ });
423
+ };
424
+
425
+ var DropdownLayout = function DropdownLayout(_ref) {
426
+ var options = _ref.options,
427
+ selectedOptions = _ref.selectedOptions,
428
+ onSelect = _ref.onSelect,
429
+ getOptionLabel = _ref.getOptionLabel,
430
+ getOptionCaption = _ref.getOptionCaption,
431
+ layoutConfig = _ref.layoutConfig;
432
+ var _useTranslation = useTranslation(),
433
+ t = _useTranslation.t;
434
+ return /*#__PURE__*/jsxs("select", {
435
+ className: dropdown,
436
+ value: selectedOptions[0] || '',
437
+ onChange: function onChange(e) {
438
+ return onSelect(e.target.value);
439
+ },
440
+ style: {
441
+ fontSize: layoutConfig === null || layoutConfig === void 0 ? void 0 : layoutConfig.optionLabelFontSize
442
+ },
443
+ children: [/*#__PURE__*/jsx("option", {
444
+ value: "",
445
+ children: t('quickconfig.pleaseSelect', {
446
+ defaultValue: 'Bitte wählen'
447
+ })
448
+ }), options.map(function (option) {
449
+ var label = getOptionLabel(option);
450
+ var caption = getOptionCaption(option);
451
+ return /*#__PURE__*/jsxs("option", {
452
+ value: option.codex,
453
+ children: [label, caption ? " (".concat(caption, ")") : '']
454
+ }, option.codex);
455
+ })]
456
+ });
457
+ };
458
+
459
+ var SelectionListLayout = function SelectionListLayout(_ref) {
460
+ var options = _ref.options,
461
+ selectedOptions = _ref.selectedOptions,
462
+ onSelect = _ref.onSelect,
463
+ getOptionLabel = _ref.getOptionLabel,
464
+ getOptionDescription = _ref.getOptionDescription,
465
+ getOptionCaption = _ref.getOptionCaption,
466
+ type = _ref.type,
467
+ layoutConfig = _ref.layoutConfig;
468
+ var isRadio = type === 'radio';
469
+ var containerClass = isRadio ? radio : checkbox;
470
+ var itemClass = isRadio ? radioOption : checkboxOption;
471
+ var selectedItemClass = isRadio ? radioOptionSelected : checkboxOptionSelected;
472
+ return /*#__PURE__*/jsx("div", {
473
+ className: containerClass,
474
+ children: options.map(function (option) {
475
+ var isSelected = selectedOptions.includes(option.codex);
476
+ var label = getOptionLabel(option);
477
+ var description = getOptionDescription(option);
478
+ var caption = getOptionCaption(option);
479
+ return /*#__PURE__*/jsxs("div", {
480
+ className: isSelected ? "".concat(itemClass, " ").concat(selectedItemClass) : itemClass,
481
+ onClick: function onClick() {
482
+ return onSelect(option.codex);
483
+ },
484
+ children: [/*#__PURE__*/jsx("input", {
485
+ type: isRadio ? 'radio' : 'checkbox',
486
+ checked: isSelected,
487
+ onChange: function onChange() {
488
+ return onSelect(option.codex);
489
+ }
490
+ }), /*#__PURE__*/jsxs("div", {
491
+ className: optionContent,
492
+ children: [/*#__PURE__*/jsxs("div", {
493
+ className: optionLabel,
494
+ style: layoutConfig !== null && layoutConfig !== void 0 && layoutConfig.optionLabelFontSize ? {
495
+ fontSize: layoutConfig === null || layoutConfig === void 0 ? void 0 : layoutConfig.optionLabelFontSize
496
+ } : undefined,
497
+ children: [/*#__PURE__*/jsx("span", {
498
+ dangerouslySetInnerHTML: {
499
+ __html: label
500
+ }
501
+ }), caption && /*#__PURE__*/jsx("span", {
502
+ className: optionCaption,
503
+ dangerouslySetInnerHTML: {
504
+ __html: " ".concat(caption)
505
+ }
506
+ })]
507
+ }), description && /*#__PURE__*/jsx("div", {
508
+ className: optionDescription,
509
+ dangerouslySetInnerHTML: {
510
+ __html: description
511
+ }
512
+ })]
513
+ })]
514
+ }, option.codex);
515
+ })
516
+ });
517
+ };
518
+
519
+ var ButtonGroupLayout = function ButtonGroupLayout(_ref) {
520
+ var options = _ref.options,
521
+ selectedOptions = _ref.selectedOptions,
522
+ onSelect = _ref.onSelect,
523
+ getOptionLabel = _ref.getOptionLabel,
524
+ getOptionDescription = _ref.getOptionDescription,
525
+ getOptionCaption = _ref.getOptionCaption,
526
+ layout = _ref.layout,
527
+ layoutConfig = _ref.layoutConfig;
528
+ var isToggle = layout === 'toggle' || layout === 'multitoggle';
529
+ var containerClass = isToggle ? toggle : layout === 'gallery' ? optionsGallery : optionsBox;
530
+ var itemClass = isToggle ? toggleButton : optionButton;
531
+ var selectedItemClass = isToggle ? toggleButtonSelected : optionButtonSelected;
532
+ var style = {};
533
+ if (layoutConfig !== null && layoutConfig !== void 0 && layoutConfig.columns && !isToggle) {
534
+ style.gridTemplateColumns = "repeat(".concat(layoutConfig.columns, ", minmax(0, 1fr))");
535
+ }
536
+ if (layoutConfig !== null && layoutConfig !== void 0 && layoutConfig.gap && !isToggle) {
537
+ style.gap = typeof layoutConfig.gap === 'number' ? "".concat(layoutConfig.gap, "px") : layoutConfig.gap;
538
+ }
539
+ return /*#__PURE__*/jsx("div", {
540
+ className: containerClass,
541
+ style: style,
542
+ children: options.map(function (option) {
543
+ var isSelected = selectedOptions.includes(option.codex);
544
+ var label = getOptionLabel(option);
545
+ var description = getOptionDescription(option);
546
+ var caption = getOptionCaption(option);
547
+ if (isToggle) {
548
+ return /*#__PURE__*/jsx("button", {
549
+ className: isSelected ? "".concat(itemClass, " ").concat(selectedItemClass) : itemClass,
550
+ onClick: function onClick() {
551
+ return onSelect(option.codex);
552
+ },
553
+ children: /*#__PURE__*/jsxs("div", {
554
+ className: optionLabel,
555
+ style: layoutConfig !== null && layoutConfig !== void 0 && layoutConfig.optionLabelFontSize ? {
556
+ fontSize: layoutConfig === null || layoutConfig === void 0 ? void 0 : layoutConfig.optionLabelFontSize
557
+ } : undefined,
558
+ children: [/*#__PURE__*/jsx("span", {
559
+ dangerouslySetInnerHTML: {
560
+ __html: label
561
+ }
562
+ }), caption && /*#__PURE__*/jsx("span", {
563
+ className: optionCaption,
564
+ dangerouslySetInnerHTML: {
565
+ __html: " ".concat(caption)
566
+ }
567
+ })]
568
+ })
569
+ }, option.codex);
570
+ }
571
+ return /*#__PURE__*/jsxs("div", {
572
+ className: isSelected ? "".concat(itemClass, " ").concat(selectedItemClass) : itemClass,
573
+ onClick: function onClick() {
574
+ return onSelect(option.codex);
575
+ },
576
+ children: [/*#__PURE__*/jsxs("div", {
577
+ className: optionLabel,
578
+ style: layoutConfig !== null && layoutConfig !== void 0 && layoutConfig.optionLabelFontSize ? {
579
+ fontSize: layoutConfig === null || layoutConfig === void 0 ? void 0 : layoutConfig.optionLabelFontSize
580
+ } : undefined,
581
+ children: [/*#__PURE__*/jsx("span", {
582
+ dangerouslySetInnerHTML: {
583
+ __html: label
584
+ }
585
+ }), caption && /*#__PURE__*/jsx("span", {
586
+ className: optionCaption,
587
+ dangerouslySetInnerHTML: {
588
+ __html: " ".concat(caption)
589
+ }
590
+ })]
591
+ }), description && /*#__PURE__*/jsx("div", {
592
+ className: optionDescription,
593
+ dangerouslySetInnerHTML: {
594
+ __html: description
595
+ }
596
+ })]
597
+ }, option.codex);
598
+ })
599
+ });
600
+ };
601
+
602
+ var OptionRenderer = function OptionRenderer(_ref) {
603
+ var feature = _ref.feature,
604
+ selectedOptions = _ref.selectedOptions,
605
+ onSelect = _ref.onSelect,
606
+ selections = _ref.selections;
607
+ var _useOptionRenderer = useOptionRenderer({
608
+ feature: feature,
609
+ selectedOptions: selectedOptions,
610
+ onSelect: onSelect,
611
+ selections: selections
612
+ }),
613
+ selectOptions = _useOptionRenderer.selectOptions,
614
+ rangeOption = _useOptionRenderer.rangeOption,
615
+ handleSingleSelect = _useOptionRenderer.handleSingleSelect,
616
+ handleMultiSelect = _useOptionRenderer.handleMultiSelect,
617
+ getOptionLabel = _useOptionRenderer.getOptionLabel,
618
+ getOptionDescription = _useOptionRenderer.getOptionDescription,
619
+ getOptionCaption = _useOptionRenderer.getOptionCaption;
620
+
621
+ // Handle range type (slider)
622
+ if (rangeOption && rangeOption.range) {
623
+ return /*#__PURE__*/jsx(RangeLayout, {
624
+ option: rangeOption,
625
+ selectedOptions: selectedOptions,
626
+ onSelect: onSelect,
627
+ getOptionCaption: getOptionCaption
628
+ });
629
+ }
630
+ var handleSelect = feature.multiSelect ? handleMultiSelect : handleSingleSelect;
631
+ switch (feature.layout) {
632
+ case 'dropdown':
633
+ return /*#__PURE__*/jsx(DropdownLayout, {
634
+ options: selectOptions,
635
+ selectedOptions: selectedOptions,
636
+ onSelect: handleSingleSelect,
637
+ getOptionLabel: getOptionLabel,
638
+ getOptionCaption: getOptionCaption,
639
+ layoutConfig: feature.layoutConfig
640
+ });
641
+ case 'radio':
642
+ case 'checkbox':
643
+ return /*#__PURE__*/jsx(SelectionListLayout, {
644
+ options: selectOptions,
645
+ selectedOptions: selectedOptions,
646
+ onSelect: handleSelect,
647
+ getOptionLabel: getOptionLabel,
648
+ getOptionDescription: getOptionDescription,
649
+ getOptionCaption: getOptionCaption,
650
+ type: feature.layout,
651
+ layoutConfig: feature.layoutConfig
652
+ });
653
+ case 'toggle':
654
+ case 'multitoggle':
655
+ case 'box':
656
+ case 'gallery':
657
+ default:
658
+ return /*#__PURE__*/jsx(ButtonGroupLayout, {
659
+ options: selectOptions,
660
+ selectedOptions: selectedOptions,
661
+ onSelect: handleSelect,
662
+ getOptionLabel: getOptionLabel,
663
+ getOptionDescription: getOptionDescription,
664
+ getOptionCaption: getOptionCaption,
665
+ layout: feature.layout,
666
+ layoutConfig: feature.layoutConfig
667
+ });
668
+ }
669
+ };
670
+
671
+ var FeatureRenderer = function FeatureRenderer(_ref) {
672
+ var _feature$description, _feature$description2, _feature$description3;
673
+ var feature = _ref.feature,
674
+ selection = _ref.selection,
675
+ _onSelect = _ref.onSelect,
676
+ selections = _ref.selections;
677
+ var _useTranslation = useTranslation(),
678
+ i18n = _useTranslation.i18n;
679
+ var language = i18n.language;
680
+ var label = feature.label[language] || feature.label.en || feature.label.de || feature.codex;
681
+ var description = ((_feature$description = feature.description) === null || _feature$description === void 0 ? void 0 : _feature$description[language]) || ((_feature$description2 = feature.description) === null || _feature$description2 === void 0 ? void 0 : _feature$description2.en) || ((_feature$description3 = feature.description) === null || _feature$description3 === void 0 ? void 0 : _feature$description3.de);
682
+ return /*#__PURE__*/jsxs("div", {
683
+ className: featureContainer,
684
+ children: [/*#__PURE__*/jsxs("div", {
685
+ className: featureLabel,
686
+ children: [/*#__PURE__*/jsx("span", {
687
+ dangerouslySetInnerHTML: {
688
+ __html: label
689
+ }
690
+ }), feature.required && /*#__PURE__*/jsx("span", {
691
+ className: featureRequired,
692
+ children: " *"
693
+ })]
694
+ }), description && /*#__PURE__*/jsx("div", {
695
+ className: featureDescription,
696
+ dangerouslySetInnerHTML: {
697
+ __html: description
698
+ }
699
+ }), /*#__PURE__*/jsx(OptionRenderer, {
700
+ feature: feature,
701
+ selectedOptions: (selection === null || selection === void 0 ? void 0 : selection.selectedOptions) || [],
702
+ onSelect: function onSelect(selectedOptions) {
703
+ return _onSelect(feature.codex, selectedOptions);
704
+ },
705
+ selections: selections
706
+ })]
707
+ });
708
+ };
709
+
710
+ var Speedometer = function Speedometer(_ref) {
711
+ var value = _ref.value,
712
+ _ref$min = _ref.min,
713
+ min = _ref$min === void 0 ? 0 : _ref$min,
714
+ _ref$max = _ref.max,
715
+ max = _ref$max === void 0 ? 100 : _ref$max,
716
+ label = _ref.label,
717
+ _ref$zones = _ref.zones,
718
+ zones = _ref$zones === void 0 ? [] : _ref$zones;
719
+ var _useTranslation = useTranslation();
720
+ _useTranslation.t;
721
+ var radius = 80;
722
+ var strokeWidth = 12;
723
+ var centerX = 100;
724
+ var centerY = 110;
725
+ var normalizedValue = Math.min(Math.max(value, min), max);
726
+ var percentage = (normalizedValue - min) / (max - min);
727
+
728
+ // Speedometer arc: Centered at top (0deg), spanning 240 degrees
729
+ // From 240deg (bottom-left) to 480deg (bottom-right)
730
+ var startAngle = 240;
731
+ var endAngle = 480;
732
+ var totalAngle = endAngle - startAngle;
733
+ var currentAngle = startAngle + percentage * totalAngle;
734
+
735
+ // Animation state for the indicator
736
+ var _useState = useState(startAngle),
737
+ _useState2 = _slicedToArray(_useState, 2),
738
+ animatedAngle = _useState2[0],
739
+ setAnimatedAngle = _useState2[1];
740
+ useEffect(function () {
741
+ var timer = setTimeout(function () {
742
+ setAnimatedAngle(currentAngle);
743
+ }, 50);
744
+ return function () {
745
+ return clearTimeout(timer);
746
+ };
747
+ }, [currentAngle]);
748
+ var polarToCartesian = function polarToCartesian(cX, cY, r, angleInDegrees) {
749
+ var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0;
750
+ return {
751
+ x: cX + r * Math.cos(angleInRadians),
752
+ y: cY + r * Math.sin(angleInRadians)
753
+ };
754
+ };
755
+ var describeArc = function describeArc(x, y, r, startA, endA) {
756
+ var start = polarToCartesian(x, y, r, endA);
757
+ var end = polarToCartesian(x, y, r, startA);
758
+ var largeArcFlag = endA - startA <= 180 ? '0' : '1';
759
+ return ['M', start.x, start.y, 'A', r, r, 0, largeArcFlag, 0, end.x, end.y].join(' ');
760
+ };
761
+ var backgroundPath = describeArc(centerX, centerY, radius, startAngle, endAngle);
762
+
763
+ // Find current zone color
764
+ var currentZone = zones.find(function (z) {
765
+ if (z.value && label && z.value === label) return true;
766
+ return normalizedValue >= z.min && normalizedValue <= z.max;
767
+ });
768
+ var activeColor = (currentZone === null || currentZone === void 0 ? void 0 : currentZone.color) || 'var(--diva-theme-palette-primary-main)';
769
+ return /*#__PURE__*/jsx("div", {
770
+ className: speedometer,
771
+ children: /*#__PURE__*/jsxs("svg", {
772
+ viewBox: "-20 0 240 170",
773
+ width: "100%",
774
+ height: "100%",
775
+ children: [zones.length > 0 ? zones.map(function (zone, i) {
776
+ var zoneStart = startAngle + (zone.min - min) / (max - min) * totalAngle;
777
+ var zoneEnd = startAngle + (zone.max - min) / (max - min) * totalAngle;
778
+ return /*#__PURE__*/jsx("path", {
779
+ d: describeArc(centerX, centerY, radius, zoneStart, zoneEnd),
780
+ fill: "none",
781
+ stroke: zone.color || '#e6e6e6',
782
+ strokeWidth: strokeWidth,
783
+ opacity: 0.3
784
+ }, i);
785
+ }) : /*#__PURE__*/jsx("path", {
786
+ d: backgroundPath,
787
+ fill: "none",
788
+ stroke: "#e6e6e6",
789
+ strokeWidth: strokeWidth,
790
+ strokeLinecap: "round"
791
+ }), /*#__PURE__*/jsx("g", {
792
+ style: {
793
+ transition: 'transform 2s cubic-bezier(0.4, 0, 0.2, 1)',
794
+ transform: "rotate(".concat(animatedAngle, "deg)"),
795
+ transformOrigin: "".concat(centerX, "px ").concat(centerY, "px")
796
+ },
797
+ children: /*#__PURE__*/jsx("path", {
798
+ d: describeArc(centerX, centerY, radius + 5, -2, 2),
799
+ fill: "none",
800
+ stroke: activeColor,
801
+ strokeWidth: strokeWidth + 10,
802
+ strokeLinecap: "round"
803
+ })
804
+ }), zones.map(function (zone, i) {
805
+ var zoneMidAngle = startAngle + ((zone.min - min) / (max - min) + (zone.max - min) / (max - min)) / 2 * totalAngle;
806
+
807
+ // Adjust offset based on string length to avoid collision with the arc/pointer
808
+ var textLength = zone.label.length;
809
+ var labelOffset = 22 + (textLength > 5 ? 6 : 0);
810
+ var labelPos = polarToCartesian(centerX, centerY, radius - labelOffset, zoneMidAngle);
811
+ return /*#__PURE__*/jsx("text", {
812
+ x: labelPos.x,
813
+ y: labelPos.y,
814
+ textAnchor: "middle",
815
+ fontSize: textLength > 7 ? '10' : '12',
816
+ fontWeight: "500",
817
+ fill: "#999",
818
+ dominantBaseline: "middle",
819
+ children: zone.label
820
+ }, i);
821
+ }), /*#__PURE__*/jsx("text", {
822
+ x: centerX,
823
+ y: centerY - 10,
824
+ textAnchor: "middle",
825
+ fontSize: "22",
826
+ fontWeight: "700",
827
+ fill: activeColor,
828
+ children: (currentZone === null || currentZone === void 0 ? void 0 : currentZone.label) || label || value
829
+ }), /*#__PURE__*/jsx("text", {
830
+ x: centerX,
831
+ y: centerY + 34,
832
+ textAnchor: "middle",
833
+ fontSize: "20",
834
+ fontWeight: "600",
835
+ fill: activeColor,
836
+ children: value
837
+ })]
838
+ })
839
+ });
840
+ };
841
+
842
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
843
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
844
+ var SpeedometerGroup = function SpeedometerGroup(_ref) {
845
+ var displayConfig = _ref.displayConfig,
846
+ data = _ref.data,
847
+ language = _ref.language;
848
+ var titleText = displayConfig.title ? displayConfig.title[language] || displayConfig.title.en || displayConfig.title.de : '';
849
+ var speedometerConfigs = displayConfig.speedometers;
850
+ return /*#__PURE__*/jsxs("div", {
851
+ className: speedometerGroup,
852
+ children: [titleText && /*#__PURE__*/jsx("h4", {
853
+ className: speedometerGroupTitle,
854
+ dangerouslySetInnerHTML: {
855
+ __html: titleText
856
+ }
857
+ }), /*#__PURE__*/jsx("div", {
858
+ className: speedometerGroupGrid,
859
+ children: speedometerConfigs.map(function (sConfig, idx) {
860
+ var _sConfig$zones;
861
+ var sValue = sConfig.valueKey ? data[sConfig.valueKey] : null;
862
+ var sLabel = sConfig.labelKey ? data[sConfig.labelKey] : null;
863
+ var sTitle = sConfig.title ? sConfig.title[language] || sConfig.title.en || sConfig.title.de : '';
864
+ return /*#__PURE__*/jsxs("div", {
865
+ className: speedometerGroupItem,
866
+ children: [sTitle && /*#__PURE__*/jsx("h5", {
867
+ className: speedometerGroupItemTitle,
868
+ dangerouslySetInnerHTML: {
869
+ __html: sTitle
870
+ }
871
+ }), /*#__PURE__*/jsx(Speedometer, {
872
+ value: _typeof(sValue) === 'object' ? sValue.value : sValue,
873
+ label: _typeof(sLabel) === 'object' ? sLabel.result : sLabel,
874
+ min: sConfig.min,
875
+ max: sConfig.max,
876
+ zones: (_sConfig$zones = sConfig.zones) === null || _sConfig$zones === void 0 ? void 0 : _sConfig$zones.map(function (z) {
877
+ return _objectSpread$3(_objectSpread$3({}, z), {}, {
878
+ label: z.label[language] || z.label.en || z.label.de
879
+ });
880
+ })
881
+ })]
882
+ }, idx);
883
+ })
884
+ })]
885
+ });
886
+ };
887
+
888
+ var TextResult = function TextResult(_ref) {
889
+ var displayConfig = _ref.displayConfig,
890
+ data = _ref.data,
891
+ language = _ref.language;
892
+ var label = displayConfig.labelKey ? data[displayConfig.labelKey] : null;
893
+ var titleText = displayConfig.title ? displayConfig.title[language] || displayConfig.title.en || displayConfig.title.de : '';
894
+ var resultValueText = _typeof(label) === 'object' ? label.result : String(label);
895
+ return /*#__PURE__*/jsxs("div", {
896
+ className: resultItem,
897
+ children: [/*#__PURE__*/jsx("span", {
898
+ className: resultKey,
899
+ dangerouslySetInnerHTML: {
900
+ __html: titleText
901
+ }
902
+ }), /*#__PURE__*/jsx("span", {
903
+ className: resultValue,
904
+ dangerouslySetInnerHTML: {
905
+ __html: resultValueText
906
+ }
907
+ })]
908
+ }, displayConfig.labelKey || 'text');
909
+ };
910
+
911
+ var ResultItemsRenderer = function ResultItemsRenderer(_ref) {
912
+ var data = _ref.data,
913
+ config = _ref.config,
914
+ language = _ref.language;
915
+ var renderGenericResult = function renderGenericResult(displayConfig, data, index) {
916
+ switch (displayConfig.type) {
917
+ case 'speedometer':
918
+ return /*#__PURE__*/jsx(SpeedometerGroup, {
919
+ displayConfig: displayConfig,
920
+ data: data,
921
+ language: language
922
+ }, "speedometer-".concat(index));
923
+ case 'text':
924
+ return /*#__PURE__*/jsx(TextResult, {
925
+ displayConfig: displayConfig,
926
+ data: data,
927
+ language: language
928
+ }, "text-".concat(index));
929
+ default:
930
+ return null;
931
+ }
932
+ };
933
+ if (config.results && config.results.length > 0) {
934
+ return /*#__PURE__*/jsx("div", {
935
+ className: resultsGrid,
936
+ children: config.results.map(function (displayConfig, index) {
937
+ return renderGenericResult(displayConfig, data, index);
938
+ })
939
+ });
940
+ }
941
+
942
+ // Fallback to legacy rendering if no results config provided
943
+ return /*#__PURE__*/jsx(Fragment, {
944
+ children: Object.entries(data).map(function (_ref2) {
945
+ var _ref3 = _slicedToArray(_ref2, 2),
946
+ key = _ref3[0],
947
+ value = _ref3[1];
948
+ if (_typeof(value) === 'object' && value !== null) {
949
+ if (value.result !== undefined) {
950
+ return /*#__PURE__*/jsxs("div", {
951
+ className: resultItem,
952
+ children: [/*#__PURE__*/jsx("span", {
953
+ className: resultKey,
954
+ dangerouslySetInnerHTML: {
955
+ __html: key
956
+ }
957
+ }), /*#__PURE__*/jsx("span", {
958
+ className: resultValue,
959
+ dangerouslySetInnerHTML: {
960
+ __html: value.result
961
+ }
962
+ })]
963
+ }, key);
964
+ }
965
+ return null;
966
+ }
967
+ return /*#__PURE__*/jsxs("div", {
968
+ className: resultItem,
969
+ children: [/*#__PURE__*/jsx("span", {
970
+ className: resultKey,
971
+ dangerouslySetInnerHTML: {
972
+ __html: key
973
+ }
974
+ }), /*#__PURE__*/jsx("span", {
975
+ className: resultValue,
976
+ dangerouslySetInnerHTML: {
977
+ __html: String(value)
978
+ }
979
+ })]
980
+ }, key);
981
+ })
982
+ });
983
+ };
984
+
985
+ var ArrowRight = function ArrowRight() {
986
+ return /*#__PURE__*/jsxs("svg", {
987
+ width: "20",
988
+ height: "20",
989
+ viewBox: "0 0 24 24",
990
+ fill: "none",
991
+ stroke: "currentColor",
992
+ strokeWidth: "2",
993
+ strokeLinecap: "round",
994
+ strokeLinejoin: "round",
995
+ children: [/*#__PURE__*/jsx("line", {
996
+ x1: "5",
997
+ y1: "12",
998
+ x2: "19",
999
+ y2: "12"
1000
+ }), /*#__PURE__*/jsx("polyline", {
1001
+ points: "12 5 19 12 12 19"
1002
+ })]
1003
+ });
1004
+ };
1005
+ var CopyIcon = function CopyIcon() {
1006
+ return /*#__PURE__*/jsxs("svg", {
1007
+ width: "20",
1008
+ height: "20",
1009
+ viewBox: "0 0 24 24",
1010
+ fill: "none",
1011
+ stroke: "currentColor",
1012
+ strokeWidth: "2",
1013
+ strokeLinecap: "round",
1014
+ strokeLinejoin: "round",
1015
+ children: [/*#__PURE__*/jsx("rect", {
1016
+ x: "9",
1017
+ y: "9",
1018
+ width: "13",
1019
+ height: "13",
1020
+ rx: "2",
1021
+ ry: "2"
1022
+ }), /*#__PURE__*/jsx("path", {
1023
+ d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
1024
+ })]
1025
+ });
1026
+ };
1027
+ var CheckIcon = function CheckIcon() {
1028
+ return /*#__PURE__*/jsx("svg", {
1029
+ width: "20",
1030
+ height: "20",
1031
+ viewBox: "0 0 24 24",
1032
+ fill: "none",
1033
+ stroke: "currentColor",
1034
+ strokeWidth: "2",
1035
+ strokeLinecap: "round",
1036
+ strokeLinejoin: "round",
1037
+ children: /*#__PURE__*/jsx("polyline", {
1038
+ points: "20 6 9 17 4 12"
1039
+ })
1040
+ });
1041
+ };
1042
+ var CloseIcon = function CloseIcon() {
1043
+ return /*#__PURE__*/jsxs("svg", {
1044
+ width: "20",
1045
+ height: "20",
1046
+ viewBox: "0 0 24 24",
1047
+ fill: "none",
1048
+ stroke: "currentColor",
1049
+ strokeWidth: "2",
1050
+ strokeLinecap: "round",
1051
+ strokeLinejoin: "round",
1052
+ children: [/*#__PURE__*/jsx("line", {
1053
+ x1: "18",
1054
+ y1: "6",
1055
+ x2: "6",
1056
+ y2: "18"
1057
+ }), /*#__PURE__*/jsx("line", {
1058
+ x1: "6",
1059
+ y1: "6",
1060
+ x2: "18",
1061
+ y2: "18"
1062
+ })]
1063
+ });
1064
+ };
1065
+ var Navigation = function Navigation(_ref) {
1066
+ var onBack = _ref.onBack,
1067
+ onNext = _ref.onNext,
1068
+ onCopy = _ref.onCopy,
1069
+ onRetry = _ref.onRetry,
1070
+ onApply = _ref.onApply,
1071
+ onClose = _ref.onClose,
1072
+ _ref$canProceed = _ref.canProceed,
1073
+ canProceed = _ref$canProceed === void 0 ? true : _ref$canProceed,
1074
+ _ref$showBack = _ref.showBack,
1075
+ showBack = _ref$showBack === void 0 ? false : _ref$showBack,
1076
+ _ref$nextLabel = _ref.nextLabel,
1077
+ nextLabel = _ref$nextLabel === void 0 ? '' : _ref$nextLabel,
1078
+ nextInstance = _ref.nextInstance,
1079
+ currentInstanceId = _ref.currentInstanceId,
1080
+ _ref$language = _ref.language,
1081
+ language = _ref$language === void 0 ? 'de' : _ref$language;
1082
+ var _useTranslation = useTranslation(),
1083
+ t = _useTranslation.t;
1084
+ var _useState = useState(false),
1085
+ _useState2 = _slicedToArray(_useState, 2),
1086
+ appliedFeedback = _useState2[0],
1087
+ setAppliedFeedback = _useState2[1];
1088
+ var _useState3 = useState(false),
1089
+ _useState4 = _slicedToArray(_useState3, 2),
1090
+ showCloseButton = _useState4[0],
1091
+ setShowCloseButton = _useState4[1];
1092
+ var nextInstanceLabel = nextInstance ? nextInstance.label[language] || nextInstance.label.en || nextInstance.label.de || nextInstance.id : '';
1093
+ var handleApply = function handleApply() {
1094
+ onApply === null || onApply === void 0 || onApply();
1095
+ setAppliedFeedback(true);
1096
+ if (onClose) {
1097
+ setTimeout(function () {
1098
+ return setShowCloseButton(true);
1099
+ }, 1500);
1100
+ } else {
1101
+ setTimeout(function () {
1102
+ setAppliedFeedback(false);
1103
+ }, 2000);
1104
+ }
1105
+ };
1106
+ return /*#__PURE__*/jsxs("div", {
1107
+ className: buttonContainer,
1108
+ children: [showBack && /*#__PURE__*/jsx("div", {
1109
+ className: navLeftGroup,
1110
+ children: /*#__PURE__*/jsx("button", {
1111
+ className: button,
1112
+ onClick: onBack,
1113
+ "aria-label": t('quickconfig.back', {
1114
+ defaultValue: 'Zurück'
1115
+ }),
1116
+ children: t('quickconfig.back', {
1117
+ defaultValue: 'Zurück'
1118
+ })
1119
+ }, "back")
1120
+ }), /*#__PURE__*/jsxs("div", {
1121
+ className: navRightGroup,
1122
+ children: [onApply && !showCloseButton && /*#__PURE__*/jsxs("button", {
1123
+ className: classNames(button, buttonPrimary, buttonWithArrow, navButtonPadding, appliedFeedback && buttonPrimaryApplied),
1124
+ onClick: handleApply,
1125
+ disabled: appliedFeedback,
1126
+ children: [appliedFeedback ? t('quickconfig.changesApplied', {
1127
+ defaultValue: 'Änderungen wurden übernommen'
1128
+ }) : t('quickconfig.applyChanges', {
1129
+ defaultValue: 'Änderungen übernehmen'
1130
+ }), appliedFeedback ? /*#__PURE__*/jsx(CheckIcon, {}) : /*#__PURE__*/jsx(CopyIcon, {})]
1131
+ }, "apply"), onClose && showCloseButton && /*#__PURE__*/jsxs("button", {
1132
+ className: classNames(button, buttonPrimary, buttonWithArrow, navButtonPadding),
1133
+ onClick: onClose,
1134
+ children: [t('quickconfig.closeNow', {
1135
+ defaultValue: 'Jetzt schließen'
1136
+ }), /*#__PURE__*/jsx(CloseIcon, {})]
1137
+ }, "close"), onRetry && /*#__PURE__*/jsx("button", {
1138
+ className: classNames(button, buttonSecondary, buttonWithArrow, navButtonPadding),
1139
+ onClick: onRetry,
1140
+ children: t('quickconfig.retry', {
1141
+ defaultValue: 'Von vorne beginnen'
1142
+ })
1143
+ }, "retry"), nextInstance && onCopy && currentInstanceId && /*#__PURE__*/jsxs("button", {
1144
+ className: classNames(button, buttonSecondary, buttonWithArrow),
1145
+ onClick: function onClick() {
1146
+ onCopy(currentInstanceId, nextInstance.id);
1147
+ },
1148
+ disabled: !canProceed,
1149
+ children: [t('quickconfig.applyRecommendationsFor', {
1150
+ instance: nextInstanceLabel,
1151
+ defaultValue: "Empfehlungen f\xFCr ".concat(nextInstanceLabel, " \xFCbernehmen")
1152
+ }), /*#__PURE__*/jsx(ArrowRight, {})]
1153
+ }, "applyRecommendations"), onNext && /*#__PURE__*/jsxs("button", {
1154
+ className: classNames(button, buttonPrimary, buttonWithArrow),
1155
+ onClick: onNext,
1156
+ disabled: !canProceed,
1157
+ children: [nextInstance ? t('quickconfig.nextWith', {
1158
+ instance: nextInstanceLabel,
1159
+ defaultValue: "Weiter mit ".concat(nextInstanceLabel)
1160
+ }) : nextLabel, /*#__PURE__*/jsx(ArrowRight, {})]
1161
+ }, "next")]
1162
+ })]
1163
+ });
1164
+ };
1165
+
1166
+ var ContentItem = function ContentItem(_ref) {
1167
+ var id = _ref.id,
1168
+ renderContentItem = _ref.renderContentItem;
1169
+ return /*#__PURE__*/jsx("div", {
1170
+ className: contentSection,
1171
+ children: renderContentItem ? renderContentItem(id) : null
1172
+ });
1173
+ };
1174
+
1175
+ function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1176
+ function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
1177
+ function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1178
+ var resolveContentItemId = function resolveContentItemId(displayConfig, data) {
1179
+ // Convert calculation results to UserSelection format for ConditionEvaluator
1180
+ var resultAsSelections = Object.entries(data).filter(function (_ref) {
1181
+ var _ref2 = _slicedToArray(_ref, 1),
1182
+ key = _ref2[0];
1183
+ return key !== 'input' && key !== 'instanceResults';
1184
+ }).map(function (_ref3) {
1185
+ var _ref4 = _slicedToArray(_ref3, 2),
1186
+ key = _ref4[0],
1187
+ val = _ref4[1];
1188
+ var value = _typeof(val) === 'object' && val !== null && 'result' in val ? String(val.result) : String(val);
1189
+ return {
1190
+ featureCodex: key,
1191
+ selectedOptions: [value]
1192
+ };
1193
+ });
1194
+ var evaluator = new ConditionEvaluator(resultAsSelections);
1195
+
1196
+ // 1. Check rules first (complex logic)
1197
+ if (displayConfig.rules) {
1198
+ var _iterator = _createForOfIteratorHelper$1(displayConfig.rules),
1199
+ _step;
1200
+ try {
1201
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1202
+ var rule = _step.value;
1203
+ if (evaluator.evaluate(rule.condition)) {
1204
+ return rule.contentItemId;
1205
+ }
1206
+ }
1207
+ } catch (err) {
1208
+ _iterator.e(err);
1209
+ } finally {
1210
+ _iterator.f();
1211
+ }
1212
+ }
1213
+
1214
+ // 2. Fallback to direct key match or static contentItemId
1215
+ return (displayConfig.contentItemId && data[displayConfig.contentItemId] ? data[displayConfig.contentItemId] : null) || displayConfig.contentItemId || null;
1216
+ };
1217
+
1218
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1219
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1220
+ var ResultDisplay = function ResultDisplay(_ref) {
1221
+ var activeInstanceId = _ref.activeInstanceId,
1222
+ result = _ref.result,
1223
+ config = _ref.config,
1224
+ onRetry = _ref.onRetry,
1225
+ filteredInstances = _ref.filteredInstances,
1226
+ onEvent = _ref.onEvent,
1227
+ renderContentItem = _ref.renderContentItem;
1228
+ var _useTranslation = useTranslation(),
1229
+ i18n = _useTranslation.i18n;
1230
+ var language = i18n.language;
1231
+ var activeInstanceData = useMemo(function () {
1232
+ if (activeInstanceId && result.instanceResults && result.instanceResults[activeInstanceId]) return result.instanceResults[activeInstanceId];
1233
+ return result;
1234
+ }, [activeInstanceId, result]);
1235
+ var handleApplyResults = function handleApplyResults() {
1236
+ var combinedMappedResults = {};
1237
+ if (result.instanceResults && filteredInstances && filteredInstances.length > 0) {
1238
+ filteredInstances.forEach(function (instance) {
1239
+ var instanceRes = result.instanceResults[instance.id];
1240
+ if (instanceRes && instance.resultMapping) {
1241
+ Object.entries(instance.resultMapping).forEach(function (_ref2) {
1242
+ var _ref3 = _slicedToArray(_ref2, 2),
1243
+ resultKey = _ref3[0],
1244
+ targetKey = _ref3[1];
1245
+ var val = instanceRes[resultKey];
1246
+ if (val && val.result) {
1247
+ if (Array.isArray(targetKey)) {
1248
+ targetKey.forEach(function (key) {
1249
+ combinedMappedResults[key] = val.result;
1250
+ });
1251
+ } else {
1252
+ combinedMappedResults[targetKey] = val.result;
1253
+ }
1254
+ }
1255
+ });
1256
+ }
1257
+ });
1258
+ } else {
1259
+ var targetInstance = filteredInstances && filteredInstances.length === 1 ? filteredInstances[0] : null;
1260
+ var resSource = result.result || {};
1261
+ if (targetInstance !== null && targetInstance !== void 0 && targetInstance.resultMapping) {
1262
+ Object.entries(targetInstance.resultMapping).forEach(function (_ref4) {
1263
+ var _ref5 = _slicedToArray(_ref4, 2),
1264
+ resultKey = _ref5[0],
1265
+ targetKey = _ref5[1];
1266
+ var val = resSource[resultKey];
1267
+ if (val && val.result) {
1268
+ if (Array.isArray(targetKey)) {
1269
+ targetKey.forEach(function (key) {
1270
+ combinedMappedResults[key] = val.result;
1271
+ });
1272
+ } else {
1273
+ combinedMappedResults[targetKey] = val.result;
1274
+ }
1275
+ }
1276
+ });
1277
+ }
1278
+ }
1279
+ onEvent === null || onEvent === void 0 || onEvent({
1280
+ type: 'applyResults',
1281
+ payload: combinedMappedResults
1282
+ });
1283
+ };
1284
+ var handleClose = onEvent ? function () {
1285
+ return onEvent({
1286
+ type: 'onClose'
1287
+ });
1288
+ } : undefined;
1289
+ var renderResultsInOrder = function renderResultsInOrder() {
1290
+ if (!config.results || config.results.length === 0) {
1291
+ return /*#__PURE__*/jsx(ResultItemsRenderer, {
1292
+ data: activeInstanceData,
1293
+ config: config,
1294
+ language: language
1295
+ });
1296
+ }
1297
+ var elements = [];
1298
+ var currentNonContentGroup = [];
1299
+ var flushNonContentGroup = function flushNonContentGroup() {
1300
+ if (currentNonContentGroup.length === 0) return;
1301
+ var groupResults = _toConsumableArray(currentNonContentGroup);
1302
+ var key = "group-".concat(elements.length);
1303
+ elements.push(/*#__PURE__*/jsx(ResultItemsRenderer, {
1304
+ data: activeInstanceData,
1305
+ config: _objectSpread$2(_objectSpread$2({}, config), {}, {
1306
+ results: groupResults
1307
+ }),
1308
+ language: language
1309
+ }, key));
1310
+ currentNonContentGroup = [];
1311
+ };
1312
+ config.results.forEach(function (displayConfig, index) {
1313
+ if (displayConfig.type === 'content') {
1314
+ flushNonContentGroup();
1315
+ var contentItemId = resolveContentItemId(displayConfig, activeInstanceData);
1316
+ if (contentItemId) {
1317
+ elements.push(/*#__PURE__*/jsx(ContentItem, {
1318
+ id: contentItemId,
1319
+ renderContentItem: renderContentItem
1320
+ }, "content-".concat(index)));
1321
+ }
1322
+ } else {
1323
+ currentNonContentGroup.push(displayConfig);
1324
+ }
1325
+ });
1326
+ flushNonContentGroup();
1327
+ return elements;
1328
+ };
1329
+ return /*#__PURE__*/jsxs("div", {
1330
+ className: resultContainer,
1331
+ children: [renderResultsInOrder(), /*#__PURE__*/jsx(Navigation, {
1332
+ onRetry: onRetry,
1333
+ onApply: onEvent ? handleApplyResults : undefined,
1334
+ onClose: handleClose
1335
+ })]
1336
+ });
1337
+ };
1338
+
1339
+ var ProgressBar = function ProgressBar(_ref) {
1340
+ var currentStep = _ref.currentStep,
1341
+ totalSteps = _ref.totalSteps;
1342
+ var progress = currentStep / totalSteps * 100;
1343
+ return /*#__PURE__*/jsxs("div", {
1344
+ className: progressBar,
1345
+ children: [/*#__PURE__*/jsx("div", {
1346
+ className: progressBarFill,
1347
+ children: /*#__PURE__*/jsx("div", {
1348
+ className: progressBarInner,
1349
+ style: {
1350
+ width: "".concat(progress, "%")
1351
+ }
1352
+ })
1353
+ }), /*#__PURE__*/jsxs("div", {
1354
+ className: progressText,
1355
+ children: [currentStep, " / ", totalSteps]
1356
+ })]
1357
+ });
1358
+ };
1359
+
1360
+ var Header = function Header(_ref) {
1361
+ var _ref$instances = _ref.instances,
1362
+ instances = _ref$instances === void 0 ? [] : _ref$instances,
1363
+ _ref$activeInstanceId = _ref.activeInstanceId,
1364
+ activeInstanceId = _ref$activeInstanceId === void 0 ? '' : _ref$activeInstanceId,
1365
+ onSwitchInstance = _ref.onSwitchInstance,
1366
+ onCancel = _ref.onCancel,
1367
+ _ref$featureGroups = _ref.featureGroups,
1368
+ featureGroups = _ref$featureGroups === void 0 ? [] : _ref$featureGroups,
1369
+ currentFeatureGroupIndex = _ref.currentFeatureGroupIndex;
1370
+ var _useTranslation = useTranslation(),
1371
+ t = _useTranslation.t,
1372
+ i18n = _useTranslation.i18n;
1373
+ var language = i18n.language;
1374
+ var hasTabs = instances.length > 1;
1375
+ var activeIndex = instances.findIndex(function (i) {
1376
+ return i.id === activeInstanceId;
1377
+ });
1378
+ return /*#__PURE__*/jsxs("div", {
1379
+ className: hasTabs ? stickyHeader : stickyHeaderSticky,
1380
+ children: [/*#__PURE__*/jsxs("div", {
1381
+ className: headerContainer,
1382
+ children: [hasTabs && /*#__PURE__*/jsxs("div", {
1383
+ className: tabWrapper,
1384
+ style: {
1385
+ '--tab-count': instances.length
1386
+ },
1387
+ children: [/*#__PURE__*/jsx("div", {
1388
+ className: tabSlider,
1389
+ style: {
1390
+ transform: "translateX(".concat(activeIndex >= 0 ? activeIndex * 100 : 0, "%)")
1391
+ },
1392
+ "aria-hidden": true
1393
+ }), instances.map(function (instance) {
1394
+ return /*#__PURE__*/jsx("button", {
1395
+ type: "button",
1396
+ className: classNames(tab, _defineProperty({}, tabActive, activeInstanceId === instance.id)),
1397
+ onClick: function onClick() {
1398
+ return onSwitchInstance === null || onSwitchInstance === void 0 ? void 0 : onSwitchInstance(instance.id);
1399
+ },
1400
+ dangerouslySetInnerHTML: {
1401
+ __html: instance.label[language] || instance.label.en || instance.label.de || instance.id
1402
+ }
1403
+ }, instance.id);
1404
+ })]
1405
+ }), onCancel && /*#__PURE__*/jsx("button", {
1406
+ className: closeButton,
1407
+ onClick: onCancel,
1408
+ "aria-label": t('quickconfig.close', {
1409
+ defaultValue: 'Schließen'
1410
+ }),
1411
+ children: /*#__PURE__*/jsxs("svg", {
1412
+ width: "24",
1413
+ height: "24",
1414
+ viewBox: "0 0 24 24",
1415
+ fill: "none",
1416
+ stroke: "currentColor",
1417
+ strokeWidth: "2",
1418
+ strokeLinecap: "round",
1419
+ strokeLinejoin: "round",
1420
+ children: [/*#__PURE__*/jsx("line", {
1421
+ x1: "18",
1422
+ y1: "6",
1423
+ x2: "6",
1424
+ y2: "18"
1425
+ }), /*#__PURE__*/jsx("line", {
1426
+ x1: "6",
1427
+ y1: "6",
1428
+ x2: "18",
1429
+ y2: "18"
1430
+ })]
1431
+ })
1432
+ })]
1433
+ }), featureGroups.length > 1 && currentFeatureGroupIndex !== undefined && /*#__PURE__*/jsx(ProgressBar, {
1434
+ currentStep: currentFeatureGroupIndex + 1,
1435
+ totalSteps: featureGroups.length
1436
+ })]
1437
+ });
1438
+ };
1439
+
1440
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
1441
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
1442
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
1443
+ function calculateVariantValue(selections, config) {
1444
+ if (!config) {
1445
+ return {};
1446
+ }
1447
+
1448
+ // 1. Prepare variables for rule evaluation
1449
+ var variables = {};
1450
+
1451
+ // Extract values from selections based on config.features
1452
+ var _loop = function _loop() {
1453
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
1454
+ featureKey = _Object$entries$_i[0],
1455
+ featureConfig = _Object$entries$_i[1];
1456
+ var selection = selections.find(function (s) {
1457
+ return s.featureCodex === featureConfig.featureCodex;
1458
+ });
1459
+ if (selection && selection.selectedOptions.length > 0) {
1460
+ // Use the first selected option
1461
+ var selectedOptionCodex = selection.selectedOptions[0];
1462
+ var optionConfig = featureConfig.options[selectedOptionCodex];
1463
+ if (optionConfig) {
1464
+ variables[featureKey] = parseFloat(optionConfig.value) || 0;
1465
+ } else {
1466
+ // Handle range strings like "150-160" -> 160
1467
+ if (selectedOptionCodex.includes('-')) {
1468
+ var parts = selectedOptionCodex.split('-');
1469
+ var lastPart = parts[parts.length - 1];
1470
+ variables[featureKey] = parseFloat(lastPart) || 0;
1471
+ } else {
1472
+ variables[featureKey] = parseFloat(selectedOptionCodex) || 0;
1473
+ }
1474
+ }
1475
+ } else {
1476
+ variables[featureKey] = 0;
1477
+ }
1478
+ };
1479
+ for (var _i = 0, _Object$entries = Object.entries(config.features); _i < _Object$entries.length; _i++) {
1480
+ _loop();
1481
+ }
1482
+
1483
+ // 2. Evaluate results
1484
+ var calculatedResults = {};
1485
+ for (var _i2 = 0, _Object$entries2 = Object.entries(config.results); _i2 < _Object$entries2.length; _i2++) {
1486
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
1487
+ resultKey = _Object$entries2$_i[0],
1488
+ resultConfig = _Object$entries2$_i[1];
1489
+ var numericValue = evaluateRule(resultConfig.rule, variables);
1490
+ calculatedResults[resultKey] = getResultValue(resultKey, numericValue, resultConfig.valueResultPairs);
1491
+ }
1492
+ return calculatedResults;
1493
+ }
1494
+
1495
+ /**
1496
+ * Helper to evaluate a mathematical rule with given variables
1497
+ */
1498
+ function evaluateRule(rule, variables) {
1499
+ var expression = rule;
1500
+
1501
+ // Sort keys by length descending to avoid partial replacements
1502
+ var sortedKeys = Object.keys(variables).sort(function (a, b) {
1503
+ return b.length - a.length;
1504
+ });
1505
+ var _iterator = _createForOfIteratorHelper(sortedKeys),
1506
+ _step;
1507
+ try {
1508
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1509
+ var key = _step.value;
1510
+ var value = variables[key];
1511
+ var regex = new RegExp("\\b".concat(key, "\\b"), 'g');
1512
+ expression = expression.replace(regex, value.toString());
1513
+ }
1514
+
1515
+ // Safety check: only allow numbers, operators, parentheses and spaces
1516
+ } catch (err) {
1517
+ _iterator.e(err);
1518
+ } finally {
1519
+ _iterator.f();
1520
+ }
1521
+ var sanitizedExpression = expression.replace(/[0-9.+\-*/() ]/g, '');
1522
+ if (sanitizedExpression.length > 0) {
1523
+ return 0;
1524
+ }
1525
+ try {
1526
+ // eslint-disable-next-line no-new-func
1527
+ return new Function("return ".concat(expression))();
1528
+ } catch (e) {
1529
+ return 0;
1530
+ }
1531
+ }
1532
+
1533
+ /**
1534
+ * Helper to map a numeric value to a result string based on ranges
1535
+ */
1536
+ function getResultValue(resultKey, value, pairs) {
1537
+ console.log('resultKey', resultKey, value, pairs);
1538
+ var _iterator2 = _createForOfIteratorHelper(pairs),
1539
+ _step2;
1540
+ try {
1541
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1542
+ var _step2$value = _slicedToArray(_step2.value, 2),
1543
+ range = _step2$value[0],
1544
+ result = _step2$value[1];
1545
+ var parts = range.split('-');
1546
+ var min = parseFloat(parts[0]);
1547
+ var max = parseFloat(parts[1]);
1548
+ if (!isNaN(min) && !isNaN(max)) {
1549
+ if (value >= min && value <= max) {
1550
+ return {
1551
+ result: result,
1552
+ value: value
1553
+ };
1554
+ }
1555
+ } else if (!isNaN(min)) {
1556
+ if (value === min) return {
1557
+ result: result,
1558
+ value: value
1559
+ };
1560
+ }
1561
+ }
1562
+
1563
+ // Fallback: use first result if none match
1564
+ } catch (err) {
1565
+ _iterator2.e(err);
1566
+ } finally {
1567
+ _iterator2.f();
1568
+ }
1569
+ return pairs.length > 0 ? {
1570
+ result: pairs[0][1],
1571
+ value: value
1572
+ } : {
1573
+ result: '',
1574
+ value: value
1575
+ };
1576
+ }
1577
+
1578
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1579
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1580
+ var useQuickConfigCalculations = function useQuickConfigCalculations(config) {
1581
+ var calculateInstanceResult = useCallback(function (currentSelections) {
1582
+ if (!config.calculator) {
1583
+ return {};
1584
+ }
1585
+ if (config.calculator.variantValueConfig) {
1586
+ return calculateVariantValue(currentSelections, config.calculator.variantValueConfig);
1587
+ }
1588
+ return {};
1589
+ }, [config.calculator]);
1590
+ var calculateFullResult = useCallback(function (allInstanceSelections) {
1591
+ if (!config.instances || config.instances.length === 0) {
1592
+ var defaultSelections = allInstanceSelections['default'] || [];
1593
+ var res = calculateInstanceResult(defaultSelections);
1594
+ return _objectSpread$1(_objectSpread$1({}, res), {}, {
1595
+ input: {
1596
+ selections: defaultSelections
1597
+ }
1598
+ });
1599
+ }
1600
+ var instanceResults = {};
1601
+ config.instances.forEach(function (instance) {
1602
+ instanceResults[instance.id] = calculateInstanceResult(allInstanceSelections[instance.id] || []);
1603
+ });
1604
+ return {
1605
+ instanceResults: instanceResults,
1606
+ input: {
1607
+ selections: allInstanceSelections[config.instances[0].id] || [],
1608
+ // Backward compatibility
1609
+ instanceSelections: allInstanceSelections
1610
+ }
1611
+ };
1612
+ }, [config.instances, calculateInstanceResult]);
1613
+ return {
1614
+ calculateFullResult: calculateFullResult
1615
+ };
1616
+ };
1617
+
1618
+ var useQuickConfigFeatures = function useQuickConfigFeatures(config, selections, currentFeatureGroupIndex, result) {
1619
+ // Group features by group field
1620
+ var featureGroups = useMemo(function () {
1621
+ var groups = [];
1622
+ var groupMap = new Map();
1623
+ config.features.forEach(function (feature) {
1624
+ var groupKey = feature.group;
1625
+ if (!groupMap.has(groupKey)) {
1626
+ groupMap.set(groupKey, []);
1627
+ }
1628
+ groupMap.get(groupKey).push(feature);
1629
+ });
1630
+
1631
+ // Flatten groups in order they appear
1632
+ var seenGroups = new Set();
1633
+ config.features.forEach(function (feature) {
1634
+ var groupKey = feature.group;
1635
+ if (!seenGroups.has(groupKey)) {
1636
+ seenGroups.add(groupKey);
1637
+ groups.push(groupMap.get(groupKey));
1638
+ }
1639
+ });
1640
+ return groups;
1641
+ }, [config.features]);
1642
+
1643
+ // Get visible features in current group
1644
+ var currentFeatures = useMemo(function () {
1645
+ if (result) return [];
1646
+ var group = featureGroups[currentFeatureGroupIndex] || [];
1647
+ return group.filter(function (feature) {
1648
+ return ConditionEvaluator.shouldShowFeature(feature, selections);
1649
+ });
1650
+ }, [featureGroups, currentFeatureGroupIndex, selections, result]);
1651
+ return {
1652
+ featureGroups: featureGroups,
1653
+ currentFeatures: currentFeatures
1654
+ };
1655
+ };
1656
+
1657
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1658
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1659
+ var useQuickConfig = function useQuickConfig(_ref) {
1660
+ var config = _ref.config,
1661
+ onEvent = _ref.onEvent,
1662
+ initialContext = _ref.initialContext;
1663
+ var filteredInstances = useMemo(function () {
1664
+ if (!config.instances) return [];
1665
+ return config.instances.filter(function (instance) {
1666
+ return ConditionEvaluator.shouldShowInstance(instance, initialContext || []);
1667
+ });
1668
+ }, [config.instances, initialContext]);
1669
+ var _useState = useState({
1670
+ "default": []
1671
+ }),
1672
+ _useState2 = _slicedToArray(_useState, 2),
1673
+ instanceSelections = _useState2[0],
1674
+ setInstanceSelections = _useState2[1];
1675
+ var _useState3 = useState(filteredInstances.length > 0 ? filteredInstances[0].id : 'default'),
1676
+ _useState4 = _slicedToArray(_useState3, 2),
1677
+ activeInstanceId = _useState4[0],
1678
+ setActiveInstanceId = _useState4[1];
1679
+ var _useState5 = useState(0),
1680
+ _useState6 = _slicedToArray(_useState5, 2),
1681
+ currentFeatureGroupIndex = _useState6[0],
1682
+ setCurrentFeatureGroupIndex = _useState6[1];
1683
+ var _useState7 = useState(null),
1684
+ _useState8 = _slicedToArray(_useState7, 2),
1685
+ result = _useState8[0],
1686
+ setResult = _useState8[1];
1687
+ var _useState9 = useState(!!config.introText),
1688
+ _useState10 = _slicedToArray(_useState9, 2),
1689
+ showIntro = _useState10[0],
1690
+ setShowIntro = _useState10[1];
1691
+ useEffect(function () {
1692
+ if (result && filteredInstances.length > 0) {
1693
+ setActiveInstanceId(filteredInstances[0].id);
1694
+ }
1695
+ }, [result, filteredInstances]);
1696
+ var selections = useMemo(function () {
1697
+ return instanceSelections[activeInstanceId] || [];
1698
+ }, [instanceSelections, activeInstanceId]);
1699
+ var _useQuickConfigCalcul = useQuickConfigCalculations(config),
1700
+ calculateFullResult = _useQuickConfigCalcul.calculateFullResult;
1701
+ var _useQuickConfigFeatur = useQuickConfigFeatures(config, selections, currentFeatureGroupIndex, result),
1702
+ featureGroups = _useQuickConfigFeatur.featureGroups,
1703
+ currentFeatures = _useQuickConfigFeatur.currentFeatures;
1704
+ var handleFeatureSelect = useCallback(function (featureCodex, selectedOptions) {
1705
+ setInstanceSelections(function (prev) {
1706
+ var currentSelections = prev[activeInstanceId] || [];
1707
+ var existing = currentSelections.find(function (s) {
1708
+ return s.featureCodex === featureCodex;
1709
+ });
1710
+ var updatedSelections = existing ? currentSelections.map(function (s) {
1711
+ return s.featureCodex === featureCodex ? _objectSpread(_objectSpread({}, s), {}, {
1712
+ selectedOptions: selectedOptions
1713
+ }) : s;
1714
+ }) : [].concat(_toConsumableArray(currentSelections), [{
1715
+ featureCodex: featureCodex,
1716
+ selectedOptions: selectedOptions
1717
+ }]);
1718
+ var updated = _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, activeInstanceId, updatedSelections));
1719
+
1720
+ // Auto-advance logic
1721
+ var currentFeature = currentFeatures.find(function (f) {
1722
+ return f.codex === featureCodex;
1723
+ });
1724
+ if (currentFeatures.length === 1 && !(currentFeature !== null && currentFeature !== void 0 && currentFeature.multiSelect) && selectedOptions.length > 0) {
1725
+ var isLastGroup = currentFeatureGroupIndex === featureGroups.length - 1;
1726
+ var isLastInstance = filteredInstances.length === 0 || activeInstanceId === filteredInstances[filteredInstances.length - 1].id;
1727
+ if (!isLastGroup || !isLastInstance) {
1728
+ setTimeout(function () {
1729
+ if (currentFeatureGroupIndex < featureGroups.length - 1) {
1730
+ setCurrentFeatureGroupIndex(function (prevIdx) {
1731
+ return prevIdx + 1;
1732
+ });
1733
+ }
1734
+ }, 100);
1735
+ } else if (isLastGroup && isLastInstance) {
1736
+ setTimeout(function () {
1737
+ var fullResult = calculateFullResult(updated);
1738
+ setResult(fullResult);
1739
+ onEvent === null || onEvent === void 0 || onEvent({
1740
+ type: 'complete',
1741
+ payload: fullResult
1742
+ });
1743
+ }, 100);
1744
+ }
1745
+ }
1746
+ return updated;
1747
+ });
1748
+ }, [activeInstanceId, currentFeatures, currentFeatureGroupIndex, featureGroups.length, filteredInstances, calculateFullResult, onEvent]);
1749
+ var handleNext = useCallback(function () {
1750
+ var _filteredInstances$fi;
1751
+ var isLastGroup = currentFeatureGroupIndex === featureGroups.length - 1;
1752
+ var instanceIndex = (_filteredInstances$fi = filteredInstances.findIndex(function (i) {
1753
+ return i.id === activeInstanceId;
1754
+ })) !== null && _filteredInstances$fi !== void 0 ? _filteredInstances$fi : -1;
1755
+ var isLastInstance = filteredInstances.length === 0 || instanceIndex === filteredInstances.length - 1;
1756
+ if (!isLastGroup) {
1757
+ setCurrentFeatureGroupIndex(function (prev) {
1758
+ return prev + 1;
1759
+ });
1760
+ } else if (!isLastInstance) {
1761
+ setActiveInstanceId(filteredInstances[instanceIndex + 1].id);
1762
+ setCurrentFeatureGroupIndex(0);
1763
+ } else {
1764
+ var fullResult = calculateFullResult(instanceSelections);
1765
+ setResult(fullResult);
1766
+ onEvent === null || onEvent === void 0 || onEvent({
1767
+ type: 'complete',
1768
+ payload: fullResult
1769
+ });
1770
+ }
1771
+ }, [currentFeatureGroupIndex, featureGroups.length, filteredInstances, activeInstanceId, instanceSelections, calculateFullResult, onEvent]);
1772
+ var handleBack = useCallback(function () {
1773
+ var _filteredInstances$fi2;
1774
+ var instanceIndex = (_filteredInstances$fi2 = filteredInstances.findIndex(function (i) {
1775
+ return i.id === activeInstanceId;
1776
+ })) !== null && _filteredInstances$fi2 !== void 0 ? _filteredInstances$fi2 : -1;
1777
+ if (currentFeatureGroupIndex > 0) {
1778
+ setCurrentFeatureGroupIndex(function (prev) {
1779
+ return prev - 1;
1780
+ });
1781
+ } else if (instanceIndex > 0) {
1782
+ setActiveInstanceId(filteredInstances[instanceIndex - 1].id);
1783
+ setCurrentFeatureGroupIndex(featureGroups.length - 1);
1784
+ } else if (config.introText) {
1785
+ setShowIntro(true);
1786
+ }
1787
+ }, [currentFeatureGroupIndex, filteredInstances, activeInstanceId, featureGroups.length, config.introText]);
1788
+ var handleIntroNext = useCallback(function () {
1789
+ return setShowIntro(false);
1790
+ }, []);
1791
+ var handleRetry = useCallback(function () {
1792
+ setInstanceSelections({
1793
+ "default": []
1794
+ });
1795
+ setActiveInstanceId(filteredInstances.length > 0 ? filteredInstances[0].id : 'default');
1796
+ setCurrentFeatureGroupIndex(0);
1797
+ setResult(null);
1798
+ setShowIntro(!!config.introText);
1799
+ }, [filteredInstances, config.introText]);
1800
+ var handleSwitchInstance = useCallback(function (instanceId) {
1801
+ setActiveInstanceId(instanceId);
1802
+ setCurrentFeatureGroupIndex(0);
1803
+ }, []);
1804
+ var handleCopySelections = useCallback(function (fromId, toId) {
1805
+ var selectionsToCopy = instanceSelections[fromId] || [];
1806
+ var updatedSelections = _objectSpread({}, instanceSelections);
1807
+ var fromIndex = filteredInstances.findIndex(function (i) {
1808
+ return i.id === fromId;
1809
+ });
1810
+ if (fromIndex !== -1) {
1811
+ for (var i = fromIndex + 1; i < filteredInstances.length; i++) {
1812
+ updatedSelections[filteredInstances[i].id] = _toConsumableArray(selectionsToCopy);
1813
+ }
1814
+ } else {
1815
+ updatedSelections[toId] = _toConsumableArray(selectionsToCopy);
1816
+ }
1817
+ setInstanceSelections(updatedSelections);
1818
+ var fullResult = calculateFullResult(updatedSelections);
1819
+ setResult(fullResult);
1820
+ onEvent === null || onEvent === void 0 || onEvent({
1821
+ type: 'complete',
1822
+ payload: fullResult
1823
+ });
1824
+ }, [instanceSelections, filteredInstances, calculateFullResult, onEvent]);
1825
+ var canProceed = useMemo(function () {
1826
+ return currentFeatures.every(function (feature) {
1827
+ if (!feature.required) return true;
1828
+ var selection = selections.find(function (s) {
1829
+ return s.featureCodex === feature.codex;
1830
+ });
1831
+ return selection && selection.selectedOptions.length > 0;
1832
+ });
1833
+ }, [currentFeatures, selections]);
1834
+ return {
1835
+ selections: selections,
1836
+ instanceSelections: instanceSelections,
1837
+ activeInstanceId: activeInstanceId,
1838
+ currentFeatureGroupIndex: currentFeatureGroupIndex,
1839
+ result: result,
1840
+ showIntro: showIntro,
1841
+ featureGroups: featureGroups,
1842
+ currentFeatures: currentFeatures,
1843
+ canProceed: canProceed,
1844
+ handleFeatureSelect: handleFeatureSelect,
1845
+ handleNext: handleNext,
1846
+ handleBack: handleBack,
1847
+ handleIntroNext: handleIntroNext,
1848
+ handleRetry: handleRetry,
1849
+ handleSwitchInstance: handleSwitchInstance,
1850
+ handleCopySelections: handleCopySelections,
1851
+ setResult: setResult,
1852
+ filteredInstances: filteredInstances
1853
+ };
1854
+ };
1855
+
1856
+ function getLocalizedText(texts, language) {
1857
+ if (!texts) return '';
1858
+ return texts[language] || texts.en || texts.de || '';
1859
+ }
1860
+ var QuickConfig = function QuickConfig(_ref) {
1861
+ var config = _ref.config,
1862
+ onEvent = _ref.onEvent,
1863
+ initialContext = _ref.initialContext,
1864
+ renderContentItem = _ref.renderContentItem;
1865
+ var _useTranslation = useTranslation(),
1866
+ t = _useTranslation.t,
1867
+ i18n = _useTranslation.i18n;
1868
+ var language = i18n.language;
1869
+ var containerRef = useRef(null);
1870
+ var handleCancel = onEvent ? function () {
1871
+ return onEvent({
1872
+ type: 'onCancel'
1873
+ });
1874
+ } : undefined;
1875
+ var _useQuickConfig = useQuickConfig({
1876
+ config: config,
1877
+ onEvent: onEvent,
1878
+ initialContext: initialContext
1879
+ }),
1880
+ selections = _useQuickConfig.selections,
1881
+ activeInstanceId = _useQuickConfig.activeInstanceId,
1882
+ currentFeatureGroupIndex = _useQuickConfig.currentFeatureGroupIndex,
1883
+ result = _useQuickConfig.result,
1884
+ showIntro = _useQuickConfig.showIntro,
1885
+ featureGroups = _useQuickConfig.featureGroups,
1886
+ currentFeatures = _useQuickConfig.currentFeatures,
1887
+ canProceed = _useQuickConfig.canProceed,
1888
+ handleFeatureSelect = _useQuickConfig.handleFeatureSelect,
1889
+ handleNext = _useQuickConfig.handleNext,
1890
+ handleBack = _useQuickConfig.handleBack,
1891
+ handleIntroNext = _useQuickConfig.handleIntroNext,
1892
+ handleRetry = _useQuickConfig.handleRetry,
1893
+ handleSwitchInstance = _useQuickConfig.handleSwitchInstance,
1894
+ handleCopySelections = _useQuickConfig.handleCopySelections,
1895
+ filteredInstances = _useQuickConfig.filteredInstances;
1896
+ useEffect(function () {
1897
+ var _containerRef$current;
1898
+ (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 || _containerRef$current.scrollTo({
1899
+ top: 0
1900
+ });
1901
+ }, [currentFeatureGroupIndex, activeInstanceId, showIntro, result]);
1902
+ if (showIntro && config.introText) {
1903
+ return /*#__PURE__*/jsxs("div", {
1904
+ className: container,
1905
+ ref: containerRef,
1906
+ children: [/*#__PURE__*/jsx(Header, {
1907
+ onCancel: handleCancel,
1908
+ featureGroups: featureGroups,
1909
+ currentFeatureGroupIndex: currentFeatureGroupIndex
1910
+ }), /*#__PURE__*/jsxs("div", {
1911
+ className: subContainer,
1912
+ children: [/*#__PURE__*/jsx("h2", {
1913
+ dangerouslySetInnerHTML: {
1914
+ __html: getLocalizedText(config.name, language)
1915
+ }
1916
+ }), /*#__PURE__*/jsx("p", {
1917
+ dangerouslySetInnerHTML: {
1918
+ __html: getLocalizedText(config.introText, language)
1919
+ }
1920
+ })]
1921
+ }), /*#__PURE__*/jsx(Navigation, {
1922
+ onNext: handleIntroNext,
1923
+ canProceed: true,
1924
+ showBack: false,
1925
+ nextLabel: t('quickconfig.next', {
1926
+ defaultValue: 'Weiter'
1927
+ })
1928
+ })]
1929
+ });
1930
+ }
1931
+ if (result) {
1932
+ return /*#__PURE__*/jsxs("div", {
1933
+ className: container,
1934
+ ref: containerRef,
1935
+ children: [/*#__PURE__*/jsx(Header, {
1936
+ instances: filteredInstances,
1937
+ activeInstanceId: activeInstanceId,
1938
+ onSwitchInstance: handleSwitchInstance,
1939
+ onCancel: handleCancel,
1940
+ featureGroups: featureGroups,
1941
+ currentFeatureGroupIndex: currentFeatureGroupIndex
1942
+ }), /*#__PURE__*/jsx(ResultDisplay, {
1943
+ activeInstanceId: activeInstanceId,
1944
+ result: result,
1945
+ config: config,
1946
+ onRetry: handleRetry,
1947
+ filteredInstances: filteredInstances,
1948
+ onEvent: onEvent,
1949
+ renderContentItem: renderContentItem
1950
+ })]
1951
+ });
1952
+ }
1953
+ var currentInstanceIndex = filteredInstances.findIndex(function (i) {
1954
+ return i.id === activeInstanceId;
1955
+ });
1956
+ var hasNextInstance = filteredInstances.length > 1 && currentInstanceIndex < filteredInstances.length - 1;
1957
+ var isLastStep = currentFeatureGroupIndex >= featureGroups.length - 1 && !hasNextInstance;
1958
+ var nextLabel = isLastStep ? t('quickconfig.calculate', {
1959
+ defaultValue: 'Berechnen'
1960
+ }) : t('quickconfig.next', {
1961
+ defaultValue: 'Weiter'
1962
+ });
1963
+ return /*#__PURE__*/jsxs("div", {
1964
+ className: container,
1965
+ ref: containerRef,
1966
+ children: [/*#__PURE__*/jsx(Header, {
1967
+ instances: filteredInstances,
1968
+ activeInstanceId: activeInstanceId,
1969
+ onSwitchInstance: handleSwitchInstance,
1970
+ onCancel: handleCancel,
1971
+ featureGroups: featureGroups,
1972
+ currentFeatureGroupIndex: currentFeatureGroupIndex
1973
+ }), /*#__PURE__*/jsx("div", {
1974
+ className: subContainer,
1975
+ children: currentFeatures.map(function (feature) {
1976
+ return /*#__PURE__*/jsx(FeatureRenderer, {
1977
+ feature: feature,
1978
+ selection: selections.find(function (s) {
1979
+ return s.featureCodex === feature.codex;
1980
+ }),
1981
+ onSelect: handleFeatureSelect,
1982
+ selections: selections
1983
+ }, feature.codex);
1984
+ })
1985
+ }), /*#__PURE__*/jsx(Navigation, {
1986
+ onBack: handleBack,
1987
+ onNext: handleNext,
1988
+ onCopy: handleCopySelections,
1989
+ canProceed: canProceed,
1990
+ showBack: currentFeatureGroupIndex > 0,
1991
+ nextLabel: nextLabel,
1992
+ currentInstanceId: activeInstanceId,
1993
+ language: language,
1994
+ nextInstance: hasNextInstance ? filteredInstances[currentInstanceIndex + 1] : undefined
1995
+ }, currentFeatureGroupIndex)]
1996
+ });
1997
+ };
1998
+
1999
+ export { ConditionEvaluator, QuickConfig, getTranslatedText, validateQuickConfig };